diff --git a/.ci/bootstrap_eolian.sh b/.ci/bootstrap_eolian.sh new file mode 100755 index 0000000000..3e2734e714 --- /dev/null +++ b/.ci/bootstrap_eolian.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +mkdir build-eolian-bootstrap +meson --prefix=/usr/ --libdir=/usr/lib -Deolian-bootstrap=true build-eolian-bootstrap +ninja -C build-eolian-bootstrap install +rm -rf build-eolian-bootstrap +ldconfig diff --git a/.ci/ci-configure.sh b/.ci/ci-configure.sh index 4a2211ba09..464380c0e0 100755 --- a/.ci/ci-configure.sh +++ b/.ci/ci-configure.sh @@ -25,6 +25,10 @@ if [ "$BUILDSYSTEM" = "ninja" ] ; then OPTS="$OPTS $DISABLED_LINUX_COPTS" fi + if [ "$1" = "wayland" ]; then + OPTS="$OPTS $WAYLAND_LINUX_COPTS" + fi + if [ "$1" = "release-ready" ]; then OPTS="$OPTS $RELEASE_READY_LINUX_COPTS" fi @@ -40,7 +44,8 @@ if [ "$BUILDSYSTEM" = "ninja" ] ; then export CFLAGS="-I/usr/local/opt/openssl/include -frewrite-includes $CFLAGS" export LDFLAGS="-L/usr/local/opt/openssl/lib $LDFLAGS" - export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig" + LIBFFI_VER=$(brew list --versions libffi|head -n1|cut -d' ' -f2) + export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:/usr/local/Cellar/libffi/$LIBFFI_VER/lib/pkgconfig" mkdir build && meson build -Decore-imf-loaders-disabler=scim,ibus -Dx11=false -Davahi=false -Dbindings=luajit -Deeze=false -Dsystemd=false -Dnls=false -Dcocoa=true -Demotion-loaders-disabler=gstreamer,gstreamer1,libvlc,xine fi else @@ -73,9 +78,9 @@ else RELEASE_READY_LINUX_COPTS=" --with-profile=release" - MINGW_COPTS=" --prefix=/root/EFL/ewpi_64 --host=x86_64-w64-mingw32 --with-eolian-gen=/usr/local/bin/eolian_gen \ - --with-edje-cc=/usr/local/bin/edje_cc --with-eet-eet=/usr/local/bin/eet \ - --with-bin-elm-prefs-cc=/usr/local/bin/elm_prefs_cc \ + MINGW_COPTS=" --prefix=/ewpi-64-install --host=x86_64-w64-mingw32 --with-eolian-gen=/usr/bin/eolian_gen \ + --with-edje-cc=/usr/bin/edje_cc --with-eet-eet=/usr/bin/eet \ + --with-bin-elm-prefs-cc=/usr/bin/elm_prefs_cc \ --disable-static --with-tests=regular --with-crypto=openssl \ --disable-libmount --disable-valgrind --disable-avahi --disable-spectre --disable-libraw \ --disable-librsvg --disable-pulseaudio --disable-cxx-bindings" @@ -95,6 +100,10 @@ else OPTS="$OPTS $DISABLED_LINUX_COPTS" fi + if [ "$1" = "wayland" ]; then + OPTS="$OPTS $WAYLAND_LINUX_COPTS" + fi + if [ "$1" = "release-ready" ]; then OPTS="$OPTS $RELEASE_READY_LINUX_COPTS" fi @@ -102,13 +111,14 @@ else if [ "$1" = "mingw" ]; then OPTS="$OPTS $MINGW_COPTS" docker exec $(cat $HOME/cid) sh -c 'rm -f /src/config.cache' + docker exec $(cat $HOME/cid) sh -c '.ci/bootstrap_eolian.sh' fi docker exec $(cat $HOME/cid) sh -c 'rm -f ~/.ccache/ccache.conf' travis_fold autoreconf autoreconf if [ "$1" = "mingw" ]; then docker exec $(cat $HOME/cid) sh -c 'rm -f /src/config.cache' docker exec --env MAKEFLAGS="-j5 -rR" --env EIO_MONITOR_POLL=1 --env CFLAGS="-pipe" --env CXXFLAGS="-pipe" \ - --env CPPFLAGS="-I/root/EFL/ewpi_64/include -DECORE_WIN32_WIP_POZEFLKSD" --env LDFLAGS="-L/root/EFL/ewpi_64/lib/" --env PKG_CONFIG_PATH="/root/EFL/ewpi_64/lib/pkgconfig/" \ + --env CPPFLAGS="-I/ewpi-64-install/include -DECORE_WIN32_WIP_POZEFLKSD" --env LDFLAGS="-L/ewpi-64-install/lib/" --env PKG_CONFIG_PATH="/ewpi-64-install/lib/pkgconfig/" \ $(cat $HOME/cid) sh -c "autoreconf -iv" else docker exec --env MAKEFLAGS="-j5 -rR" --env EIO_MONITOR_POLL=1 --env CC="ccache gcc" \ @@ -119,7 +129,7 @@ else travis_fold configure "configure $OPTS" if [ "$1" = "mingw" ]; then docker exec --env MAKEFLAGS="-j5 -rR" --env EIO_MONITOR_POLL=1 --env CFLAGS="-pipe" --env CXXFLAGS="-pipe" \ - --env CPPFLAGS="-I/root/EFL/ewpi_64/include -DECORE_WIN32_WIP_POZEFLKSD" --env LDFLAGS="-L/root/EFL/ewpi_64/lib/" --env PKG_CONFIG_PATH="/root/EFL/ewpi_64/lib/pkgconfig/" \ + --env CPPFLAGS="-I/ewpi-64-install/include -DECORE_WIN32_WIP_POZEFLKSD" --env LDFLAGS="-L/ewpi-64-install/lib/" --env PKG_CONFIG_PATH="/ewpi-64-install/lib/pkgconfig/" \ $(cat $HOME/cid) sh -c ".ci/configure.sh $OPTS" else docker exec --env MAKEFLAGS="-j5 -rR" --env EIO_MONITOR_POLL=1 --env CC="ccache gcc" \ @@ -137,7 +147,8 @@ else export CFLAGS="-I/usr/local/opt/openssl/include -frewrite-includes $CFLAGS" export LDFLAGS="-L/usr/local/opt/openssl/lib $LDFLAGS" - export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig" + LIBFFI_VER=$(brew list --versions libffi|head -n1|cut -d' ' -f2) + export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:/usr/local/Cellar/libffi/$LIBFFI_VER/lib/pkgconfig" # Normal build test of all targets rm -f ~/.ccache/ccache.conf diff --git a/.ci/ci-make-check.sh b/.ci/ci-make-check.sh index 6dff663e69..762cf70774 100755 --- a/.ci/ci-make-check.sh +++ b/.ci/ci-make-check.sh @@ -21,10 +21,10 @@ if [ "$BUILDSYSTEM" = "ninja" ] ; then if [ "$DISTRO" != "" ] ; then # disable them for this distros, after meson 0.49 is out, this can be removed # https://github.com/mesonbuild/meson/commit/253c581412d7f2b09af353dd83d943454bd555be - if [ "$DISTRO" != "Ubuntu1804" ] && [ "$DISTRO" != "Debian91" ]; then + if [ "$DISTRO" != "Ubuntu1810" ] && [ "$DISTRO" != "Debian96" ]; then for tries in $(seq 1 ${NUM_TRIES}); do - (docker exec --env EINA_LOG_BACKTRACE="0" --env MAKEFLAGS="-j5 -rR" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) ninja -C build test) && break - docker exec --env MAKEFLAGS="-j5 -rR" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) cat src/test-suite.log + (docker exec --env EINA_LOG_BACKTRACE="0" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) meson test -C build --wrapper dbus-launch ) && break + docker exec --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) cat build/meson-logs/testlog-dbus-launch.txt if [ $tries != ${NUM_TRIES} ] ; then echo "tests failed, trying again!" ; fi false done diff --git a/.ci/ci-osx-deps.sh b/.ci/ci-osx-deps.sh index 22672606e8..838dd2dc05 100755 --- a/.ci/ci-osx-deps.sh +++ b/.ci/ci-osx-deps.sh @@ -2,5 +2,5 @@ brew update 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 ccache ninja python3 +brew install gettext check bullet dbus fontconfig freetype fribidi gst-plugins-good gstreamer luajit openssl webp libsndfile glib libspectre libraw librsvg poppler lz4 pulseaudio ccache ninja python3 libffi pip3 install meson diff --git a/.ci/configure.sh b/.ci/configure.sh index fc2b231081..bdc2d85274 100755 --- a/.ci/configure.sh +++ b/.ci/configure.sh @@ -1,9 +1,8 @@ -#!/bin/bash - +#!/bin/bash +e set -o pipefail export TEST_VAR=1 -if ! ./configure $@ | tee -a configlog ; then +if ! ./configure $@ 2>&1 | tee -a configlog ; then if grep -q 'configure: error: changes in the environment can compromise the build' configlog ; then echo "clearing config.cache and retrying..." rm -f configlog config.cache diff --git a/.gitignore b/.gitignore index 195dfdc64c..325b2059cd 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ tags *.eo.h *.eot.h *.eo.legacy.h +*.eo.legacy.c *.eo.hh *.eo.impl.hh *.eo.js.cc diff --git a/.travis.yml b/.travis.yml index 7974cf5f38..7b84077161 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,10 +7,6 @@ cache: sudo: required dist: trusty -os: - - linux - - osx - env: global: - MAKEFLAGS="-j5 -rR" @@ -20,59 +16,46 @@ env: jobs: include: - - env: - - os: linux - - DISTRO=Fedora28-mingw - - CI_BUILD_TYPE=mingw - - env: - - os: linux - - DISTRO=Fedora28 - - CI_BUILD_TYPE=options-enabled - - env: - - os: linux - - DISTRO=Fedora28 - - CI_BUILD_TYPE=options-disabled - - env: - - os: linux - - DISTRO=Fedora28 - - CI_BUILD_TYPE=options-enabled - - BUILDSYSTEM=ninja - - env: - - os: linux - - DISTRO=Fedora28 - - CI_BUILD_TYPE=options-disabled - - BUILDSYSTEM=ninja - - if: type = cron - env: - - os: linux - - DISTRO=Ubuntu1804 - - if: type = cron - env: - - os: linux - - DISTRO=Fedora28 - - CI_BUILD_TYPE=release-ready - - if: type = cron - env: - - os: linux - - DISTRO=Debian91 - - if: type = cron - env: - - os: linux - - DISTRO=Ubuntu1804 - - BUILDSYSTEM=ninja - - if: type = cron - env: - - os: linux - - DISTRO=Fedora28 - - CI_BUILD_TYPE=release-ready - - BUILDSYSTEM=ninja - - if: type = cron - env: - - os: linux - - DISTRO=Debian91 - - BUILDSYSTEM=ninja - exclude: + - os: osx + env: BUILDSYSTEM=ninja - os: linux + env: DISTRO=Fedora29-mingw CI_BUILD_TYPE=mingw + - os: linux + env: DISTRO=Fedora29 CI_BUILD_TYPE=options-enabled + - os: linux + env: DISTRO=Fedora29 CI_BUILD_TYPE=options-disabled + - os: linux + env: DISTRO=Fedora29 CI_BUILD_TYPE=wayland + - os: linux + env: DISTRO=Fedora29 CI_BUILD_TYPE=default + - os: linux + env: DISTRO=Fedora29 CI_BUILD_TYPE=options-enabled BUILDSYSTEM=ninja + - os: linux + env: DISTRO=Fedora29 CI_BUILD_TYPE=options-disabled BUILDSYSTEM=ninja + - os: linux + env: DISTRO=Fedora29 CI_BUILD_TYPE=wayland BUILDSYSTEM=ninja + - os: linux + env: DISTRO=Fedora29 CI_BUILD_TYPE=default BUILDSYSTEM=ninja + - os: osx + if: type = cron + - os: linux + if: type = cron + env: DISTRO=Fedora29 CI_BUILD_TYPE=release-ready + - os: linux + if: type = cron + env: DISTRO=Fedora29 CI_BUILD_TYPE=release-ready BUILDSYSTEM=ninja + - os: linux + if: type = cron + env: DISTRO=Ubuntu1810 + - os: linux + if: type = cron + env: DISTRO=Debian96 + - os: linux + if: type = cron + env: DISTRO=Ubuntu1810 BUILDSYSTEM=ninja + - os: linux + if: type = cron + env: DISTRO=Debian96 BUILDSYSTEM=ninja services: - docker @@ -139,15 +122,6 @@ before_cache: mv $HOME/Library/Caches/Homebrew $HOME/cachedir/Homebrew 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: diff --git a/Makefile.am b/Makefile.am index a94d3fac57..9f2d6976f8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -519,6 +519,7 @@ pkgbuild:: clean-local: rm -rf benchmark coverage + @find . -name '*.eo.legacy.c' -delete DISTCLEANFILES= \ ./src/lib/emile/Makefile \ diff --git a/NEWS b/NEWS index b4763b3428..e71f224ea7 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,134 @@ ========== -EFL 1.21.0 +EFL 1.22.0 ========== +Changes since 1.21.0: +--------------------- + +Features: + + * evas textblock: add/apply cursor cluster APIs based on grapheme cluster + * efl_ui_spin_button: Addded direction feature. + * scroller: refactory a momentum scroll animator + * elementary textpath: support legacy APIs + * elementary transit: add a convenient API. + * elementary transit: add a new api - elm_transit_progress_value_set() + * Text: add markup_range_get + * Canvas layout: support more Efl.Text.* with efl_part + * efl: Add support to elput for using elogind instead of systemd + * eina: add locale-independent eina_convert_strtod_c function + * elm perf tool - bring one back to efl + * eina: add locale-independent eina_convert_strtod_c function + * elm perf tool - bring one back to efl + * efl gfx_path: introduce efl_gfx_path_reserve() + * efl gfx_path: remove EFL_GFX_PATH_EVENT_CHANGED + * efl gfx_path: remove EFL_GFX_PATH_EVENT_CHANGED + * gfx: Add size hint fill (EO) (T3912) + * efl_app: add "standby" event (T5494) + * edje_cc: fail upon detecting invalid part description references in programs (T7016) + * elput: Add API to allow settings tap-to-click on pointer device + * ecore_drm2: Add API to allow settings tap-to-click on pointer device + * efl_ui_win: add 'exit_on_all_windows_closed' class property and unit test (T5494) + * efl_ui_win: add 'exit_on_close' property and unit test (T5494) + * eo: implement class overriding (+unit tests) (T7516) + * eolian gen: initial support for reflection api + * efl_ui_relative_layout: introduce new relative container (T5487) + * eolian: introduce typed slice types + * eolian: add support for inlist structs + * eolian: remove support for inlist/inarray + +Fixes: + + * build: fix rpath for binaries which use ecore-x dependencies + * elm/genlist: remove conditional in _calc_job for verifying show_item code (T6368) + * elementary image: don't calc size using empty ones. + * evas image: fix screen flickering issue at partial + image preloading + * edje_cc: change .mo file write location to be relative to the .edj file + * theme: add programs for deferred naviframe push/pop signals + * edje: unset internal _need_imf flag on shutdown + * elm_panel: return instead of EINA_SAFETY_ON_FALSE_RETURN (T7265) + * build: fix evas static build of gl engines + * ecore/main: only update loop_time during loop iteration if the change is monotonic + * evas gl: fix missing map texture target. + * elm_code: fix crash on backspace and selection delete. (T7259) + * ecore_wl2_dmabuf: Link with ecore_wl2 (T7327) + * ecore_wl2_dmabuf: Depend on ecore_wl2 (T7327) + * efl selection manager - avoid multiple selection get callbacks for req + * evas image: fix a bug in image preloading. + * evas canvas: fix null possibility of evas_object_above_get(). + * edje: Remove hack code + * efl gfx_path: prevent buffer overflow. + * ecore_main: fix the invalid return value + * eina_vpath: fix the memory leak + * elementary: remove meaningless memory allocation and leaking + * elementary: fix memory leak from Efl.Ui.Layout.Object + * evas gl: fix invalid image size. + * elementary entry: apply scale to all edje objects + * eina debug: fix a double unlock issue + * elm_theme: fix return value when default style fallback is done + * evas vg: fix memory leak. + * devas vg: return default root node if possible. + * evas vg: fix memory leak at gradient. + * evas filter: remove critical messages from Evas Filter + * elementary transit: fix wrong pausing time calculation. + * Canvas text: fix line_jump_by logic + * cxx: explicitly require c++11 and fix tests to conform + * edje: fix an overflow issue for state values + * evas textblock: remove white space after line-break by a next item + * evas ector: fix memory leaks. + * evas vg: update render properly. + * ector software: make a pair of ref/unref. + * evas gl: recover current program state. + * ecore_evas - fix aninmator based frame render ticking to full framerate + * ecore evas - buffer - init ecore event evas as many times as shutdown + * eina: fix a build failure caused by missing 'locale_t' from OSX + * ecore_con: handle timeout of the attempt to connect. + * ecore_evas - fix aninmator based frame render ticking to full framerate + * ecore evas - buffer - init ecore event evas as many times as shutdown + * eina: fix a build failure caused by missing 'locale_t' from OSX + * ecore_con: handle timeout of the attempt to connect. + * evas gl - make GLintptr etc. also ndefed for GL_VERSION_1_5 fix typedef (T7502) + * ecore-drm2: Fix drmModeSetCrtc call during fb flip + * textblock: Fix crash with filters + * edje - stop trying to access ready deleted exrt/group swallow objects + * evas: remove memory leaks from deleted Textblock objects + * elm - dnd - restore to working as drop targets + * elm_config: Free data returned from eet_read + * ui/flip: fix efl_pack usage + * elm_entry: make file loading succeed on 0-sized files (T6562) + * theme: fix odd state setting on some items for list/genlist/gengrid + * theme: correct part name in program for elm/hover/base/main_menu_submenu/default (T6219) + * theme: remove a ton of invalid part description references in various programs (T6873) + * ecore-evas/extn: use evas from events when updating key masks (T5536) + * edje: apply maps to textblock cursors and backgrounds (T4977) + * ecore drm2 - work around kms/drm bug seemingly when no flip event comes + * elm textpath: reduces differences between actual pos and modified pos + * elm_map: Make more robust elm_map (T7443) + * Fix leak in elm atspi + * eina_file: set errno on open fail for win32 build + * evas-gl-drm: Fix issue of rotation not actually rotating (T7690) + * solve neon rotation issue by moving to the tiled rotator + * eo: Fix missing varags cleanup (CID1399080) + * efl_core_command_line: Fix logically dead code (CID1399106) + * efl_ui_widget_common: Fix potential resource leak (CID1399088) + * efl_ui_selection_manager: Fix unchecked return value (CID1399092) + * evas_device: Fix dereferencing null pointer (CID1399091) + * efl_ui_stack: Fix dereference null return value (CID1399082) + * efl_ui_datepicker: Fix uninitialized scalar value (CID1397006) + * efl_ui_grid: Fix dereferencing null pointer (CID1397000) + * ecore_con: Fix dereferencing of null pointer (CID1396990) + * elm_atspi_bridge: Fix resource leak (CID1399429) + * efl_ui_win: Fix dereference null return value (CID1399428) + * efl_ui_win: Fix dereference null return (CID1399427) + * efl_ui_win: Fix dereference null return (CID1399426) + * efl_ui_win: Fix dereference null return value (CID1399425) + * efreet: Fix resource leak (CID1399090) + * efl_ui_text: Fix resource leak (CID1396998) + * eldbus: Fix dereference after null check (CID1399422) + * efl_ui_focus_manager_calc: Fix resource leaks (CID1396984, CID1396965) + * elm_focus_legacy: Fix resource leaks (CID1399096, CID1399095) + * eldbus: Fix resource leak (CID1399097) + Changes since 1.20.0: --------------------- @@ -5006,3 +5133,130 @@ Fixes: - Fix memory leak in error case. * Eeze: - Fix sensors to not segv on shutdown. +Changes since 1.21.0: +--------------------- + +Features: + + * evas textblock: add/apply cursor cluster APIs based on grapheme cluster + * efl_ui_spin_button: Addded direction feature. + * scroller: refactory a momentum scroll animator + * elementary textpath: support legacy APIs + * elementary transit: add a convenient API. + * elementary transit: add a new api - elm_transit_progress_value_set() + * Text: add markup_range_get + * Canvas layout: support more Efl.Text.* with efl_part + * efl: Add support to elput for using elogind instead of systemd + * eina: add locale-independent eina_convert_strtod_c function + * elm perf tool - bring one back to efl + * eina: add locale-independent eina_convert_strtod_c function + * elm perf tool - bring one back to efl + * efl gfx_path: introduce efl_gfx_path_reserve() + * efl gfx_path: remove EFL_GFX_PATH_EVENT_CHANGED + * efl gfx_path: remove EFL_GFX_PATH_EVENT_CHANGED + * gfx: Add size hint fill (EO) (T3912) + * efl_app: add "standby" event (T5494) + * edje_cc: fail upon detecting invalid part description references in programs (T7016) + * elput: Add API to allow settings tap-to-click on pointer device + * ecore_drm2: Add API to allow settings tap-to-click on pointer device + * efl_ui_win: add 'exit_on_all_windows_closed' class property and unit test (T5494) + * efl_ui_win: add 'exit_on_close' property and unit test (T5494) + * eo: implement class overriding (+unit tests) (T7516) + * eolian gen: initial support for reflection api + * efl_ui_relative_layout: introduce new relative container (T5487) + * eolian: introduce typed slice types + * eolian: add support for inlist structs + * eolian: remove support for inlist/inarray + * ecore-drm2: Add API function to return output rotation (T7690) + +Fixes: + + * ecore_wl2_dmabuf: Link with ecore_wl2 (T7327) + * ecore_wl2_dmabuf: Depend on ecore_wl2 (T7327) + * efl selection manager - avoid multiple selection get callbacks for req + * evas image: fix a bug in image preloading. + * evas canvas: fix null possibility of evas_object_above_get(). + * edje: Remove hack code + * efl gfx_path: prevent buffer overflow. + * ecore_main: fix the invalid return value + * eina_vpath: fix the memory leak + * elementary: remove meaningless memory allocation and leaking + * elementary: fix memory leak from Efl.Ui.Layout.Object + * evas gl: fix invalid image size. + * elementary entry: apply scale to all edje objects + * eina debug: fix a double unlock issue + * elm_theme: fix return value when default style fallback is done + * evas vg: fix memory leak. + * devas vg: return default root node if possible. + * evas vg: fix memory leak at gradient. + * evas filter: remove critical messages from Evas Filter + * elementary transit: fix wrong pausing time calculation. + * Canvas text: fix line_jump_by logic + * cxx: explicitly require c++11 and fix tests to conform + * edje: fix an overflow issue for state values + * evas textblock: remove white space after line-break by a next item + * evas ector: fix memory leaks. + * evas vg: update render properly. + * ector software: make a pair of ref/unref. + * evas gl: recover current program state. + * ecore_evas - fix aninmator based frame render ticking to full framerate + * ecore evas - buffer - init ecore event evas as many times as shutdown + * eina: fix a build failure caused by missing 'locale_t' from OSX + * ecore_con: handle timeout of the attempt to connect. + * ecore_evas - fix aninmator based frame render ticking to full framerate + * ecore evas - buffer - init ecore event evas as many times as shutdown + * eina: fix a build failure caused by missing 'locale_t' from OSX + * ecore_con: handle timeout of the attempt to connect. + * evas gl - make GLintptr etc. also ndefed for GL_VERSION_1_5 fix typedef (T7502) + * ecore-drm2: Fix drmModeSetCrtc call during fb flip + * textblock: Fix crash with filters + * edje - stop trying to access ready deleted exrt/group swallow objects + * evas: remove memory leaks from deleted Textblock objects + * elm - dnd - restore to working as drop targets + * elm_config: Free data returned from eet_read + * ui/flip: fix efl_pack usage + * elm_entry: make file loading succeed on 0-sized files (T6562) + * theme: fix odd state setting on some items for list/genlist/gengrid + * theme: correct part name in program for elm/hover/base/main_menu_submenu/default (T6219) + * theme: remove a ton of invalid part description references in various programs (T6873) + * ecore-evas/extn: use evas from events when updating key masks (T5536) + * edje: apply maps to textblock cursors and backgrounds (T4977) + * ecore drm2 - work around kms/drm bug seemingly when no flip event comes + * elm textpath: reduces differences between actual pos and modified pos + * elm_map: Make more robust elm_map (T7443) + * Fix leak in elm atspi + * eina_file: set errno on open fail for win32 build + * evas-gl-drm: Fix issue of rotation not actually rotating (T7690) + * solve neon rotation issue by moving to the tiled rotator + * eo: Fix missing varags cleanup (CID1399080) + * efl_core_command_line: Fix logically dead code (CID1399106) + * efl_ui_widget_common: Fix potential resource leak (CID1399088) + * efl_ui_selection_manager: Fix unchecked return value (CID1399092) + * evas_device: Fix dereferencing null pointer (CID1399091) + * efl_ui_stack: Fix dereference null return value (CID1399082) + * efl_ui_datepicker: Fix uninitialized scalar value (CID1397006) + * efl_ui_grid: Fix dereferencing null pointer (CID1397000) + * ecore_con: Fix dereferencing of null pointer (CID1396990) + * elm_atspi_bridge: Fix resource leak (CID1399429) + * efl_ui_win: Fix dereference null return value (CID1399428) + * efl_ui_win: Fix dereference null return (CID1399427) + * efl_ui_win: Fix dereference null return (CID1399426) + * efl_ui_win: Fix dereference null return value (CID1399425) + * efreet: Fix resource leak (CID1399090) + * efl_ui_text: Fix resource leak (CID1396998) + * eldbus: Fix dereference after null check (CID1399422) + * efl_ui_focus_manager_calc: Fix resource leaks (CID1396984, CID1396965) + * elm_focus_legacy: Fix resource leaks (CID1399096, CID1399095) + * eldbus: Fix resource leak (CID1399097) + * efl_canvas_vg_object: Fix dereference after null check (CID1399423, CID1399421) + * efl_ui_win: fix hw accel detection + * efl_ui_layout: Eina_Error type has been modified to work correctly. + * ecore-drm2: Don't use AtomicAddProperty for plane rotation (T7690) + * ecore-drm2: Update plane state values based on FB (T7690) + * ecore-drm2: Factor in output rotation when getting output info (T7690) + * evas drm: Don't use eng_output_resize or redraws clear (T7690) + * evas drm: Fix software output rotation (T7690) + * efl_ui_image: remove job in sizing calc. (T7360) + * evas_render: Process deferred callback in the sync render case. + * efl_ui_selection_manager: Don't leak malloc'd data (CID1396949) + * ecore-drm2: Add missing @ingroup for some doxy diff --git a/README.meson b/README.meson index ad76faa3f7..da75966f30 100644 --- a/README.meson +++ b/README.meson @@ -8,7 +8,8 @@ ninja test sudo ninja install -In autotools there have been a few flags that are used to disable loaders. In meson the following four disbler arrays are used: +In autotools there have been a few flags that are used to disable loaders. +In meson the following four disabler arrays are used: emotion-generic-loaders-disabler @@ -48,4 +49,5 @@ The following options are merged into the pixman option --enable-pixman-image-scale-sample ---disable-valgrind Is dropped, and handled due to the build profile, this can be handled with --buildtype release or plain. +--disable-valgrind Is dropped, and handled due to the build profile, this can +be handled with --buildtype release or plain. diff --git a/cmakeconfig/EFLConfigVersion.cmake.in b/cmakeconfig/EflConfigVersion.cmake.in similarity index 100% rename from cmakeconfig/EFLConfigVersion.cmake.in rename to cmakeconfig/EflConfigVersion.cmake.in diff --git a/cmakeconfig/meson.build b/cmakeconfig/meson.build index 2261a4ff12..158b2a9dc6 100644 --- a/cmakeconfig/meson.build +++ b/cmakeconfig/meson.build @@ -27,7 +27,7 @@ cmake_src = [ ] cmake_version_src = [ - 'EFL', + 'Efl', 'Elementary', ] diff --git a/configure.ac b/configure.ac index 34f71f32ca..c7be1c5b3d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -EFL_VERSION([1], [21], [99], [dev]) +EFL_VERSION([1], [22], [99], [dev]) AC_INIT([efl], [efl_version], [enlightenment-devel@lists.sourceforge.net]) AC_PREREQ([2.60]) @@ -28,7 +28,6 @@ CXXFLAGS="${CXXFLAGS} -Wno-shadow" # No shadow warnings #### Apply configuring with legacy api's only, eo api's or both. EFL_API_LEGACY_DEF="#define EFL_NOLEGACY_API_SUPPORT" -EFL_API_EO_DEF="#define EFL_EO_API_SUPPORT" efl_api="both" #### For the moment the Eo EFL API is not ready you need to explicitly optin. @@ -43,22 +42,15 @@ AC_ARG_WITH([api], case "$efl_api" in eo) EFL_API_LEGACY_DEF="#define EFL_NOLEGACY_API_SUPPORT" - EFL_API_EO_DEF="#define EFL_EO_API_SUPPORT" CFOPT_WARNING="xyes" ;; - legacy) + legacy|both) EFL_API_LEGACY_DEF="" - EFL_API_EO_DEF="" - ;; - both) - EFL_API_LEGACY_DEF="" - EFL_API_EO_DEF="#define EFL_EO_API_SUPPORT" ;; *) AC_MSG_ERROR([Invalid api (${efl_api}): must be eo, legacy or both]) ;; esac AC_SUBST(EFL_API_LEGACY_DEF) -AC_SUBST(EFL_API_EO_DEF) #### Additional options to configure @@ -147,6 +139,20 @@ case "${build_tests}" in ;; esac +install_eo_files="no" +AC_ARG_ENABLE([install-eo-files], + [AS_HELP_STRING([--enable-install-eo-files],[Enable installing eo files. @<:@default=disabled@:>@])], + [ + if test "x${enableval}" = "xyes" ; then + install_eo_files="yes" + else + install_eo_files="no" + fi + ], + [install_eo_files="no"]) + +AM_CONDITIONAL([INSTALL_EO_FILES], [test "${install_eo_files}" = "yes"]) + AC_ARG_WITH([ecore-con-http-test-url], [AS_HELP_STRING([--with-ecore-con-http-test-url=http://username:password@example.com],[Url of http server for testing with username and password])],[ECORE_CON_HTTP_TEST_URL=${withval}][AC_DEFINE_UNQUOTED([ECORE_CON_HTTP_TEST_URL],["$withval"],[Http url for testing])]) @@ -804,7 +810,7 @@ EFL_SELECT_WINDOWS_VERSION ### Checks for libraries -EFL_ADD_LIBS([EVIL], [-lpsapi -lole32 -lws2_32 -lsecur32 -luuid -lmsvcr100]) +EFL_ADD_LIBS([EVIL], [-lpsapi -lole32 -lws2_32 -lsecur32 -luuid]) ### Checks for header files @@ -1117,6 +1123,7 @@ EINA_CONFIG([HAVE_DEBUG_THREADS], [test "x${want_debug_threads}" = "xyes"]) EINA_CONFIG([HAVE_POSIX_SPINLOCK], [test "x${efl_have_posix_threads_spinlock}" = "xyes"]) EINA_CONFIG([HAVE_OSX_SPINLOCK], [test "x${efl_have_osx_spinlock}" = "xyes"]) EINA_CONFIG([HAVE_OSX_SEMAPHORE], [test "x${have_darwin}" = "xyes"]) +EINA_CONFIG([HAVE_WORDS_BIGENDIAN], [test "x${ac_cv_c_bigendian}" = "xyes"]) ### Modules @@ -1428,6 +1435,7 @@ EFL_LIB_START_OPTIONAL([Efl_Custom_Exports_Mono], [test "x${want_csharp}" = "xye EFL_PLATFORM_DEPEND([EFL_CUSTOM_EXPORTS_MONO], [evil]) EFL_INTERNAL_DEPEND_PKG([EFL_CUSTOM_EXPORTS_MONO], [Eina]) EFL_INTERNAL_DEPEND_PKG([EFL_CUSTOM_EXPORTS_MONO], [Eo]) +EFL_INTERNAL_DEPEND_PKG([EFL_CUSTOM_EXPORTS_MONO], [Ecore]) EFL_INTERNAL_DEPEND_PKG([EFL_CUSTOM_EXPORTS_MONO], [Efl]) EFL_INTERNAL_DEPEND_PKG([EFL_CUSTOM_EXPORTS_MONO], [Eldbus]) @@ -1464,7 +1472,6 @@ if test "x${have_windows}" = "xyes"; then else EVIL_DL_MONO="dl" fi -ECORE_EVAS_DL_MONO="${DLIB_PREFIX_MONO}ecore_evas${DLIB_SUFFIX_MONO}" EDJE_DL_MONO="${DLIB_PREFIX_MONO}edje${DLIB_SUFFIX_MONO}" ELEMENTARY_DL_MONO="${DLIB_PREFIX_MONO}elementary${DLIB_SUFFIX_MONO}" ELDBUS_DL_MONO="${DLIB_PREFIX_MONO}eldbus${DLIB_SUFFIX_MONO}" @@ -1476,7 +1483,6 @@ AC_SUBST([EINA_DL_MONO]) AC_SUBST([EO_DL_MONO]) AC_SUBST([EVAS_DL_MONO]) AC_SUBST([EVIL_DL_MONO]) -AC_SUBST([ECORE_EVAS_DL_MONO]) AC_SUBST([EDJE_DL_MONO]) AC_SUBST([ELEMENTARY_DL_MONO]) AC_SUBST([ELDBUS_DL_MONO]) @@ -1582,8 +1588,6 @@ fi EFL_CHECK_LIBS([EMILE], [zlib]) EFL_INTERNAL_DEPEND_PKG([EMILE], [eina]) -requirements_cflags_emile="${requirements_cflags_emile} -I\${top_srcdir}/src/lib/efl -I\${top_builddir}/src/lib/efl" -requirements_pc_emile="efl >= ${PACKAGE_VERSION} ${requirements_pc_emile}" EFL_EVAL_PKGS([EMILE]) @@ -1635,8 +1639,6 @@ fi EFL_INTERNAL_DEPEND_PKG([EET], [eina]) EFL_INTERNAL_DEPEND_PKG([EET], [emile]) -requirements_pc_eet="${requirements_pc_eet} ${requirements_pc_emile}" -requirements_cflags_eet="${requirements_cflags_eet} ${requirements_cflags_emile}" EFL_EVAL_PKGS([EET]) @@ -2543,19 +2545,6 @@ AC_ARG_ENABLE([pixman-image-scale-sample], ], [have_pixman_image_scale_sample="no"]) -# Tile rotate -AC_ARG_ENABLE([tile-rotate], - [AS_HELP_STRING([--enable-tile-rotate],[Enable tiled rotate algorithm. @<:@default=disabled@:>@])], - [ - if test "x${enableval}" = "xyes" ; then - have_tile_rotate="yes" - CFOPT_WARNING="xyes" - else - have_tile_rotate="no" - fi - ], - [have_tile_rotate="no"]) - # Ecore Buffer AC_ARG_ENABLE([ecore-buffer], [AS_HELP_STRING([--enable-ecore-buffer],[enable ecore-buffer. @<:@default=disabled@:>@])], @@ -2989,13 +2978,6 @@ AC_CHECK_LIB([m], [lround], ### Configuration -## Tile rotation - -if test "x${have_tile_rotate}" = "xyes" ; then - AC_DEFINE(TILE_ROTATE, 1, [Enable tiled rotate algorithm]) -fi - - ## dither options AC_ARG_WITH([evas-dither-mask], @@ -3277,7 +3259,7 @@ EFL_EVAL_PKGS([ECORE_CON]) ### Checks for header files -AC_CHECK_HEADERS([ws2tcpip.h netdb.h sys/filio.h]) +AC_CHECK_HEADERS([netdb.h sys/filio.h]) if test "x${ac_cv_header_netdb_h}" = "xno" && test "x${have_windows}" = "xno"; then AC_MSG_ERROR([netdb.h is requested to have Ecore_Con. Exiting...]) @@ -3285,18 +3267,19 @@ fi ### Checks for types -have_ipv6="no" -AC_CHECK_TYPES([struct ipv6_mreq], - [have_ipv6="yes"], - [have_ipv6="no"], - [[ +if test "x${have_win32}" = "xyes" ; then + have_ipv6="yes" +else + have_ipv6="no" + AC_CHECK_TYPES([struct ipv6_mreq], + [have_ipv6="yes"], + [have_ipv6="no"], + [[ #ifdef HAVE_NETINET_IN_H # include #endif -#ifdef HAVE_WS2TCPIP_H -# include -#endif -]]) + ]]) +fi AC_DEFINE_IF([HAVE_IPV6], [test "x${have_ipv6}" = "xyes"], @@ -4107,7 +4090,6 @@ if test "x${want_sndfile}" = "xyes" ; then fi if test "x${want_wasapiaudio}" = "xyes" ; then EFL_ADD_LIBS([ECORE_AUDIO], [-luuid -lwinmm -lksuser]) - AC_DEFINE([HAVE_WASAPI], [1], [Wasapiaudio support]) fi dnl EFL_OPTIONAL_DEPEND_PKG([ECORE_AUDIO_ALSA], [${want_alsa}], [ALSA], [alsa]) @@ -4136,7 +4118,6 @@ EFL_ADD_FEATURE([ECORE_AUDIO], [wasapiaudio]) EFL_LIB_END_OPTIONAL([Ecore_Audio]) AM_CONDITIONAL([HAVE_ECORE_AUDIO_PULSE], [test "x${want_pulseaudio}" = "xyes"]) AM_CONDITIONAL([HAVE_ECORE_AUDIO_SNDFILE], [test "x${want_sndfile}" = "xyes"]) -AM_CONDITIONAL([HAVE_ECORE_AUDIO_WASASPI], [test "x${want_wasapiaudio}" = "xyes"]) #### End of Ecore_Audio @@ -4498,7 +4479,7 @@ if test "x${want_xim}" = "xyes" && test "x${want_ecore_imf_xim}" = "xyes" ; then [X11 XOpenIM], [ have_ecore_imf_xim=yes - AC_DEFINE([ENABLE_XIM], [1], [Enable X Input Method]) + AC_DEFINE([BUILD_ECORE_IMF_XIM], [1], [Enable X Input Method]) ]) fi @@ -5843,52 +5824,52 @@ dbus-services/org.enlightenment.Ethumb.service systemd-services/ethumb.service $po_makefile_in cmakeconfig/EflConfig.cmake -cmakeconfig/EflConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EflConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EinaConfig.cmake -cmakeconfig/EinaConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EinaConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EioConfig.cmake -cmakeconfig/EioConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EioConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EezeConfig.cmake -cmakeconfig/EezeConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EezeConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EoConfig.cmake -cmakeconfig/EoConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EoConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EolianConfig.cmake -cmakeconfig/EolianConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EolianConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EolianHelper.cmake cmakeconfig/EolianCxxConfig.cmake -cmakeconfig/EolianCxxConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EolianCxxConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EinaCxxConfig.cmake -cmakeconfig/EinaCxxConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EinaCxxConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EoCxxConfig.cmake -cmakeconfig/EoCxxConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EoCxxConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EcoreCxxConfig.cmake -cmakeconfig/EcoreCxxConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EcoreCxxConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EvasCxxConfig.cmake -cmakeconfig/EvasCxxConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EvasCxxConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EetCxxConfig.cmake -cmakeconfig/EetCxxConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EetCxxConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EetConfig.cmake -cmakeconfig/EetConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EetConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EvasConfig.cmake -cmakeconfig/EvasConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EvasConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EcoreConfig.cmake -cmakeconfig/EcoreConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EcoreConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EdjeConfig.cmake -cmakeconfig/EdjeConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EdjeConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EldbusConfig.cmake -cmakeconfig/EldbusConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EldbusConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EfreetConfig.cmake -cmakeconfig/EfreetConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EfreetConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EthumbConfig.cmake -cmakeconfig/EthumbConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EthumbConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EthumbClientConfig.cmake -cmakeconfig/EthumbClientConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EthumbClientConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EmotionConfig.cmake -cmakeconfig/EmotionConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EmotionConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EluaConfig.cmake -cmakeconfig/EluaConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EluaConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/EmileConfig.cmake -cmakeconfig/EmileConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EmileConfigVersion.cmake:cmakeconfig/EflConfigVersion.cmake.in cmakeconfig/ElementaryConfigVersion.cmake cmakeconfig/ElementaryConfig.cmake ]) diff --git a/data/Makefile.am b/data/Makefile.am index a326711dc0..b1ba8de91a 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -225,6 +225,7 @@ elementary/objects/cursors.edj \ elementary/objects/font_preview.edj \ elementary/objects/postit_ent.edj \ elementary/objects/multibuttonentry.edj \ +elementary/objects/test_pager.edj \ elementary/objects/test_prefs.edj \ elementary/objects/test_prefs.epb \ elementary/objects/test_focus_style.edj \ @@ -276,6 +277,11 @@ elementary/objects/multibuttonentry.edj: elementary/objects/multibuttonentry.edc $(MKDIR_P) elementary/objects/; \ $(EDJE_CC) $(EDJE_CC_FLAGS) $< $@ +elementary/objects/test_pager.edj: elementary/objects/test_pager.edc + $(AM_V_EDJ) \ + $(MKDIR_P) elementary/objects/; \ + $(EDJE_CC) $(EDJE_CC_FLAGS) $< $@ + elementary/objects/test_prefs.edj: elementary/objects/test_prefs.edc $(AM_V_EDJ) \ $(MKDIR_P) elementary/objects/; \ diff --git a/data/elementary/config/default/base.src.in b/data/elementary/config/default/base.src.in index 20670544eb..79f7a1bb55 100644 --- a/data/elementary/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: 131092; + value "config_version" int: 131093; value "entry_select_allow" uchar: 1; value "engine" string: ""; value "vsync" uchar: 0; @@ -3153,5 +3153,106 @@ group "Elm_Config" struct { } } } + group "Elm_Config_Bindings_Widget" struct { + value "name" string: "Efl.Ui.Scroller"; + group "key_bindings" list { + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Left"; + value "action" string: "move"; + value "params" string: "left"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Left"; + value "action" string: "move"; + value "params" string: "left"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Right"; + value "action" string: "move"; + value "params" string: "right"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Right"; + value "action" string: "move"; + value "params" string: "right"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Up"; + value "action" string: "move"; + value "params" string: "up"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Up"; + value "action" string: "move"; + value "params" string: "up"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Down"; + value "action" string: "move"; + value "params" string: "down"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Down"; + value "action" string: "move"; + value "params" string: "down"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Home"; + value "action" string: "move"; + value "params" string: "first"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Home"; + value "action" string: "move"; + value "params" string: "first"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "End"; + value "action" string: "move"; + value "params" string: "last"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_End"; + value "action" string: "move"; + value "params" string: "last"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Prior"; + value "action" string: "move"; + value "params" string: "prior"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Prior"; + value "action" string: "move"; + value "params" string: "prior"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Next"; + value "action" string: "move"; + value "params" string: "next"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Next"; + value "action" string: "move"; + value "params" string: "next"; + } + } + } } } diff --git a/data/elementary/config/mobile/base.src.in b/data/elementary/config/mobile/base.src.in index 00de42f095..9397150576 100644 --- a/data/elementary/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: 131092; + value "config_version" int: 131093; value "entry_select_allow" uchar: 1; value "engine" string: ""; value "vsync" uchar: 0; @@ -3139,5 +3139,106 @@ group "Elm_Config" struct { } } } + group "Elm_Config_Bindings_Widget" struct { + value "name" string: "Efl.Ui.Scroller"; + group "key_bindings" list { + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Left"; + value "action" string: "move"; + value "params" string: "left"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Left"; + value "action" string: "move"; + value "params" string: "left"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Right"; + value "action" string: "move"; + value "params" string: "right"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Right"; + value "action" string: "move"; + value "params" string: "right"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Up"; + value "action" string: "move"; + value "params" string: "up"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Up"; + value "action" string: "move"; + value "params" string: "up"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Down"; + value "action" string: "move"; + value "params" string: "down"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Down"; + value "action" string: "move"; + value "params" string: "down"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Home"; + value "action" string: "move"; + value "params" string: "first"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Home"; + value "action" string: "move"; + value "params" string: "first"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "End"; + value "action" string: "move"; + value "params" string: "last"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_End"; + value "action" string: "move"; + value "params" string: "last"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Prior"; + value "action" string: "move"; + value "params" string: "prior"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Prior"; + value "action" string: "move"; + value "params" string: "prior"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Next"; + value "action" string: "move"; + value "params" string: "next"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Next"; + value "action" string: "move"; + value "params" string: "next"; + } + } + } } } diff --git a/data/elementary/config/standard/base.src.in b/data/elementary/config/standard/base.src.in index bf9aaf4c24..ccfa97b05e 100644 --- a/data/elementary/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: 131092; + value "config_version" int: 131093; value "entry_select_allow" uchar: 1; value "engine" string: ""; value "vsync" uchar: 0; @@ -3136,5 +3136,106 @@ group "Elm_Config" struct { } } } + group "Elm_Config_Bindings_Widget" struct { + value "name" string: "Efl.Ui.Scroller"; + group "key_bindings" list { + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Left"; + value "action" string: "move"; + value "params" string: "left"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Left"; + value "action" string: "move"; + value "params" string: "left"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Right"; + value "action" string: "move"; + value "params" string: "right"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Right"; + value "action" string: "move"; + value "params" string: "right"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Up"; + value "action" string: "move"; + value "params" string: "up"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Up"; + value "action" string: "move"; + value "params" string: "up"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Down"; + value "action" string: "move"; + value "params" string: "down"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Down"; + value "action" string: "move"; + value "params" string: "down"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Home"; + value "action" string: "move"; + value "params" string: "first"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Home"; + value "action" string: "move"; + value "params" string: "first"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "End"; + value "action" string: "move"; + value "params" string: "last"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_End"; + value "action" string: "move"; + value "params" string: "last"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Prior"; + value "action" string: "move"; + value "params" string: "prior"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Prior"; + value "action" string: "move"; + value "params" string: "prior"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "Next"; + value "action" string: "move"; + value "params" string: "next"; + } + group "Elm_Config_Binding_Key" struct { + value "context" int: 0; + value "key" string: "KP_Next"; + value "action" string: "move"; + value "params" string: "next"; + } + } + } } } diff --git a/data/elementary/edje_externals/meson.build b/data/elementary/edje_externals/meson.build index 445a673198..64fa05cdca 100644 --- a/data/elementary/edje_externals/meson.build +++ b/data/elementary/edje_externals/meson.build @@ -1,11 +1,11 @@ custom_target('edje_cc_edje_externals', input : 'icons.edc', output : '@BASENAME@.edj', - command : edje_cc_exe + [ '-beta', + command : edje_cc_exe + [ '-beta', '-fastcomp', '-id', join_paths(meson.current_source_dir()), '-id', elm_themes_image_include, '@INPUT@', '@OUTPUT@'], - depends : edje_cc, + depends : edje_depends, install : true, install_dir : join_paths(dir_data, 'elementary', 'edje_externals'), ) diff --git a/data/elementary/objects/Makefile.am b/data/elementary/objects/Makefile.am index ac8391f79a..c1325b8865 100644 --- a/data/elementary/objects/Makefile.am +++ b/data/elementary/objects/Makefile.am @@ -4,6 +4,7 @@ EXTRA_DIST += \ elementary/objects/test.edc \ elementary/objects/test_external.edc \ elementary/objects/test_masking.edc \ +elementary/objects/test_pager.edc \ elementary/objects/test_prefs.edc \ elementary/objects/test_prefs.epc \ elementary/objects/test_tab_pager.edc \ diff --git a/data/elementary/objects/meson.build b/data/elementary/objects/meson.build index 8fc5736c59..92020a7795 100644 --- a/data/elementary/objects/meson.build +++ b/data/elementary/objects/meson.build @@ -5,6 +5,7 @@ edc_files = [ 'test_masking.edc', 'test_tab_pager.edc', 'test_tooltip.edc', + 'test_pager.edc', 'test_prefs.edc', 'cursors.edc', 'font_preview.edc', @@ -19,13 +20,13 @@ foreach edc_file : edc_files elm_themes += custom_target('edje_cc_elm_' + edc_file, input : edc_file, output : '@BASENAME@.edj', - command : edje_cc_exe + [ '-beta', + command : edje_cc_exe + [ '-beta', '-fastcomp', '-sd', join_paths(meson.current_source_dir()), '-id', elm_themes_image_include, '-id', join_paths(meson.current_source_dir()), '-fd', join_paths(meson.current_source_dir()), '@INPUT@', '@OUTPUT@'], - depends : edje_cc, + depends : edje_depends, install : true, install_dir : join_paths(dir_data, 'elementary', 'objects'), ) diff --git a/data/elementary/objects/test_pager.edc b/data/elementary/objects/test_pager.edc new file mode 100644 index 0000000000..44f31c6648 --- /dev/null +++ b/data/elementary/objects/test_pager.edc @@ -0,0 +1,96 @@ +collections { + group { + name: "pager"; + parts { + rect { "bg"; + desc { "default"; + color: 0 0 0 0; + } + } + swallow { "pager"; + desc { "default"; + } + } + swallow { "prev_btn"; + desc { "default"; + rel1.relative: 0.0 0.5; + rel1.offset: 10 0; + rel2.relative: 0.0 0.5; + rel2.offset: 10 0; + align: 0.0 0.5; + min: 30 30; + } + } + swallow { "next_btn"; + desc { "default"; + rel1.relative: 1.0 0.5; + rel1.offset: -10 0; + rel2.relative: 1.0 0.5; + rel2.offset: -10 0; + align: 1.0 0.5; + min: 30 30; + } + } + } + } + group { + name: "page"; + parts { + rect { "bg"; + desc { "default"; + } + } + text { "tl"; + desc { "default"; + rel1.relative: 0 0; + rel2.relative: 0 0; + align: 0 0; + color: 0 0 0 255; + text { size: 10; + min: 1 1; + } + } + } + text { "tr"; + desc { "default"; + rel1.relative: 1 0; + rel2.relative: 1 0; + align: 1 0; + color: 0 0 0 255; + text { size: 10; + min: 1 1; + } + } + } + text { "bl"; + desc { "default"; + rel1.relative: 0 1; + rel2.relative: 0 1; + align: 0 1; + color: 0 0 0 255; + text { size: 10; + min: 1 1; + } + } + } + text { "br"; + desc { "default"; + rel1.relative: 1 1; + rel2.relative: 1 1; + align: 1 1; + color: 0 0 0 255; + text { size: 10; + min: 1 1; + } + } + } + text { "text"; + desc { "default"; + color: 0 0 0 255; + text { size: 20; + } + } + } + } + } +} diff --git a/data/elementary/themes/Makefile.am b/data/elementary/themes/Makefile.am index 243a265f61..e13a1530b5 100644 --- a/data/elementary/themes/Makefile.am +++ b/data/elementary/themes/Makefile.am @@ -6,7 +6,7 @@ EDJE_CC_ELM_FLAGS = \ -sd $(top_srcdir)/data/elementary/themes/snd \ -l $(top_srcdir)/COPYING \ -a $(top_srcdir)/AUTHORS \ --fastdecomp +-fastcomp elementary_themes_files = \ diff --git a/data/elementary/themes/edc/efl/pager.edc b/data/elementary/themes/edc/efl/pager.edc index d02be54b82..b6b286e999 100644 --- a/data/elementary/themes/edc/efl/pager.edc +++ b/data/elementary/themes/edc/efl/pager.edc @@ -13,8 +13,6 @@ group { "efl/pager"; swallow { "efl.page_root"; scale; desc { "default"; - rel1.relative: 0.0 1.0; - rel1.to: "efl.indicator"; } } swallow { "efl.indicator"; diff --git a/data/elementary/themes/edc/efl/popup.edc b/data/elementary/themes/edc/efl/popup.edc index a10f0d59d0..ac03f2642c 100644 --- a/data/elementary/themes/edc/efl/popup.edc +++ b/data/elementary/themes/edc/efl/popup.edc @@ -244,6 +244,18 @@ group { "efl/alert_popup/button_layout3"; } } +group { "efl/alert_popup/left_button"; + inherit: "efl/button"; + alias: "efl/scroll_alert_popup/left_button"; + alias: "efl/text_alert_popup/left_button"; +} + +group { "efl/alert_popup/right_button"; + inherit: "efl/button"; + alias: "efl/scroll_alert_popup/right_button"; + alias: "efl/text_alert_popup/right_button"; +} + group { "efl/alert_popup/button"; inherit: "efl/button"; alias: "efl/scroll_alert_popup/button"; diff --git a/data/elementary/themes/edc/elm/code.edc b/data/elementary/themes/edc/elm/code.edc index 608b16f671..c55e592c21 100644 --- a/data/elementary/themes/edc/elm/code.edc +++ b/data/elementary/themes/edc/elm/code.edc @@ -1,5 +1,6 @@ /* simple layout to pack our scrolling content into an elm_layout */ group { name: "elm/code/layout/default"; + alias: "efl/code/layout"; data { item: "font.name" "Mono"; item: "font.size" "10"; diff --git a/data/elementary/themes/edc/elm/panel.edc b/data/elementary/themes/edc/elm/panel.edc index 02dbdadf8f..3f34c7c52d 100644 --- a/data/elementary/themes/edc/elm/panel.edc +++ b/data/elementary/themes/edc/elm/panel.edc @@ -541,6 +541,21 @@ group { name: "elm/panel/left/default"; set_state(PART:"icn", "hidden", 0.0); } } + program { + signal: "elm,action,show,no_animate"; source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.event"; + target: "base"; + } + program { + signal: "elm,action,show,no_animate"; source: "elm"; + script { + if (get_int(is_rtl) == 0) + set_state(PART:"icn", "default", 0.0); + else + set_state(PART:"icn", "hidden", 0.0); + } + } program { signal: "edje,state,rtl"; source: "edje"; @@ -611,6 +626,46 @@ group { name: "elm/panel/left/default"; transition: ACCELERATE 0.3; target: "base"; } + program { + signal: "elm,action,hide,no_animate"; source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "elm.swallow.event"; + } + program { + signal: "elm,action,hide,no_animate"; source: "elm"; + script { + if (get_int(is_rtl) == 0) + set_state(PART:"icn", "hidden", 0.0); + else + set_state(PART:"icn", "default", 0.0); + } + } + program { name: "hide1_no_animate"; + signal: "elm,action,hide,no_animate"; source: "elm"; + script { + new x, y, w, h; + if (get_int(is_rtl) == 0) + { + custom_state(PART:"base", "default", 0.0); + set_state_val(PART:"base", STATE_REL1, -1.0, 0.0); + get_geometry(PART:"elm.swallow.event", x, y, w, h); + set_state_val(PART:"base", STATE_REL1_OFFSET, w, 0); + } + else + { + custom_state(PART:"base", "default", 0.0); + set_state_val(PART:"base", STATE_REL1, -1.0, 0.0); + set_state_val(PART:"base", STATE_REL2, -2.0, 1.0); + get_geometry(PART:"elm.swallow.event", x, y, w, h); + set_state_val(PART:"base", STATE_REL2_OFFSET, -w, 0); + } + } + after: "hide2_no_animate"; + } + program { name: "hide2_no_animate"; + action: STATE_SET "custom" 0.0; + target: "base"; + } program { signal: "elm,action,focus_highlight,show"; source: "elm"; action: STATE_SET "focused" 0.0; diff --git a/data/elementary/themes/meson.build b/data/elementary/themes/meson.build index 3e0ccc6a13..8a30c71cb9 100644 --- a/data/elementary/themes/meson.build +++ b/data/elementary/themes/meson.build @@ -11,14 +11,14 @@ foreach edc_file : edc_files input : edc_file, depfile: '@BASENAME@.edj.d', output : '@BASENAME@.edj', - command : edje_cc_exe + [ '-beta', + command : edje_cc_exe + [ '-beta', '-fastcomp', '-deps', '@DEPFILE@', '-sd', join_paths(meson.current_source_dir(), 'snd'), '-id', elm_themes_image_include, '-id', join_paths(meson.current_source_dir(), 'fdo'), '-fd', join_paths(meson.current_source_dir(), 'fnt'), '@INPUT@', '@OUTPUT@'], - depends : edje_cc, + depends : edje_depends, install : true, install_dir : join_paths(dir_data, 'elementary', 'themes'), ) @@ -37,3 +37,4 @@ install_subdir('fdo', join_paths('actions', '128-svg'), ] ) +elementary_img_data = join_paths(meson.current_source_dir()) diff --git a/data/eo/meson.build b/data/eo/meson.build index 8ccb578f7d..d7bac57695 100644 --- a/data/eo/meson.build +++ b/data/eo/meson.build @@ -9,5 +9,5 @@ configure_file( input: 'libeo-gdb.py.in', output: 'libeo.so.'+meson.project_version()+'-gdb.py', configuration: configuration, - install_dir: join_paths(dir_data, 'gdb', 'autoload', 'usr', 'lib') + install_dir: join_paths(dir_data, 'gdb', 'auto-load', 'usr', 'lib') ) diff --git a/data/ethumb/frames/meson.build b/data/ethumb/frames/meson.build index 2031fc4ea9..f10f982eee 100644 --- a/data/ethumb/frames/meson.build +++ b/data/ethumb/frames/meson.build @@ -3,12 +3,12 @@ ethumb_frame = files('default.edc') custom_target('edje_cc_ethumb_frame', input : ethumb_frame, output : '@BASENAME@.edj', - command : edje_cc_exe + [ '-beta', + command : edje_cc_exe + [ '-beta', '-fastcomp', '-sd', join_paths(meson.current_source_dir()), '-id', join_paths(meson.current_source_dir()), '-fd', join_paths(meson.current_source_dir()), '@INPUT@', '@OUTPUT@'], - depends : edje_cc, + depends : edje_depends, install : true, install_dir : join_paths(dir_data, 'ethumb', 'frames'), ) diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 970156898b..8eb5b96096 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -228,7 +228,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions # you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = x=C # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should @@ -1457,7 +1457,10 @@ PREDEFINED = EINA_MAGIC_DEBUG \ # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition that overrules the definition found in the source code. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = EINA_VALUE_CONVERT \ + EINA_VALUE_GET \ + EINA_VALUE_INIT \ + EINA_VALUE_NEW # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all references to function-like macros diff --git a/doc/docfx/default_efl/partials/class.header.tmpl.partial b/doc/docfx/default_efl/partials/class.header.tmpl.partial new file mode 100644 index 0000000000..1a445ab3ca --- /dev/null +++ b/doc/docfx/default_efl/partials/class.header.tmpl.partial @@ -0,0 +1,98 @@ +{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}} + +

{{>partials/title}}

+
{{{summary}}}
+
{{{conceptual}}}
+{{#inClass}} +
+
+
+ {{#inheritance}} +
+ {{/inheritance}} +
{{fullName.0.value}}
+ {{#derivedClasses}} +
{{{specName.0.value}}}
+ {{/derivedClasses}} +
+
+{{/inClass}} + +{{#inheritedMembers.0}} +
{{__global.namespace}}: {{{namespace.specName.0.value}}}
+
{{__global.assembly}}: {{assemblies.0}}.dll
+
{{__global.syntax}}
+
+
{{syntax.content.0.value}}
+
+{{#syntax.parameters.0}} +
{{__global.parameters}}
+ + + + + + + + + +{{/syntax.parameters.0}} +{{#syntax.parameters}} + + + + + +{{/syntax.parameters}} +{{#syntax.parameters.0}} + +
{{__global.type}}{{__global.name}}{{__global.description}}
{{{type.specName.0.value}}}{{{id}}}{{{description}}}
+{{/syntax.parameters.0}} +{{#syntax.return}} +
{{__global.returns}}
+ + + + + + + + + + + + + +
{{__global.type}}{{__global.description}}
{{{type.specName.0.value}}}{{{description}}}
+{{/syntax.return}} +{{#syntax.typeParameters.0}} +
{{__global.typeParameters}}
+ + + + + + + + +{{/syntax.typeParameters.0}} +{{#syntax.typeParameters}} + + + + +{{/syntax.typeParameters}} +{{#syntax.typeParameters.0}} + +
{{__global.name}}{{__global.description}}
{{{id}}}{{{description}}}
+{{/syntax.typeParameters.0}} +{{#remarks}} +
{{__global.remarks}}
+
{{{remarks}}}
+{{/remarks}} +{{#example.0}} +
{{__global.examples}}
+{{/example.0}} +{{#example}} +{{{.}}} +{{/example}} diff --git a/doc/docfx/default_efl/partials/class.tmpl.partial b/doc/docfx/default_efl/partials/class.tmpl.partial new file mode 100644 index 0000000000..42174d079e --- /dev/null +++ b/doc/docfx/default_efl/partials/class.tmpl.partial @@ -0,0 +1,242 @@ +{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}} + +{{>partials/class.header}} +{{#children}} +

+ +

+
+{{#children}} +{{^_disableContribution}} +{{#docurl}} + + | + {{__global.improveThisDoc}} +{{/docurl}} +{{#sourceurl}} + + {{__global.viewSource}} +{{/sourceurl}} +{{/_disableContribution}} +{{#overload}} + +{{/overload}} +

{{name.0.value}}

+
{{{summary}}}
+
{{{conceptual}}}
+
{{__global.declaration}}
+{{#syntax}} +
+
{{syntax.content.0.value}}
+
+{{#parameters.0}} +
{{__global.parameters}}
+ + + + + + + + + +{{/parameters.0}} +{{#parameters}} + + + + + +{{/parameters}} +{{#parameters.0}} + +
{{__global.type}}{{__global.name}}{{__global.description}}
{{{id}}}{{{description}}}
+{{/parameters.0}} +{{#return}} +
{{__global.returns}}
+ + + + + + + + + + + + + +
{{__global.type}}{{__global.description}}
{{{description}}}
+{{/return}} +{{#typeParameters.0}} +
{{__global.typeParameters}}
+ + + + + + + + +{{/typeParameters.0}} +{{#typeParameters}} + + + + +{{/typeParameters}} +{{#typeParameters.0}} + +
{{__global.name}}{{__global.description}}
{{{id}}}{{{description}}}
+{{/typeParameters.0}} +{{#fieldValue}} +
{{__global.fieldValue}}
+ + + + + + + + + + + + + +
{{__global.type}}{{__global.description}}
{{{description}}}
+{{/fieldValue}} +{{#propertyValue}} +
{{__global.propertyValue}}
+ + + + + + + + + + + + + +
{{__global.type}}{{__global.description}}
{{{description}}}
+{{/propertyValue}} +{{#eventType}} +
{{__global.eventType}}
+ + + + + + + + + + + + + +
{{__global.type}}{{__global.description}}
{{{description}}}
+{{/eventType}} +{{/syntax}} +{{#overridden}} +
{{__global.overrides}}
+
+{{/overridden}} +{{#remarks}} +
{{__global.remarks}}
+
{{{remarks}}}
+{{/remarks}} +{{#example.0}} +
{{__global.examples}}
+{{/example.0}} +{{#example}} +{{{.}}} +{{/example}} +{{#exceptions.0}} +
{{__global.exceptions}}
+ + + + + + + + +{{/exceptions.0}} +{{#exceptions}} + + + + +{{/exceptions}} +{{#exceptions.0}} + +
{{__global.type}}{{__global.condition}}
{{{description}}}
+{{/exceptions.0}} +{{#seealso.0}} +
{{__global.seealso}}
+
+{{/seealso.0}} +{{#seealso}} + {{#isCref}} +
+ {{/isCref}} + {{^isCref}} +
{{{url}}}
+ {{/isCref}} +{{/seealso}} +{{#seealso.0}} +
+{{/seealso.0}} +{{/children}} +
+{{/children}} +{{#implements.0}} +

+
+{{/implements.0}} +{{#implements}} +
+ {{#definition}} + + {{/definition}} + {{^definition}} + + {{/definition}} +
+{{/implements}} +
+{{#extensionMethods.0}} +

{{__global.extensionMethods}}

+{{/extensionMethods.0}} +{{#extensionMethods}} +
+ {{#definition}} + + {{/definition}} + {{^definition}} + + {{/definition}} +
+{{/extensionMethods}} +{{#seealso.0}} +

{{__global.seealso}}

+
+{{/seealso.0}} +{{#seealso}} + {{#isCref}} +
+ {{/isCref}} + {{^isCref}} +
{{{url}}}
+ {{/isCref}} +{{/seealso}} +{{#seealso.0}} +
+{{/seealso.0}} diff --git a/doc/docfx/default_efl/styles/docfx.css b/doc/docfx/default_efl/styles/docfx.css new file mode 100644 index 0000000000..f94c4b0377 --- /dev/null +++ b/doc/docfx/default_efl/styles/docfx.css @@ -0,0 +1,997 @@ +/* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License.txt in the project root for license information. */ +html, +body { + font-family: 'Segoe UI', Tahoma, Helvetica, sans-serif; + height: 100%; +} +button, +a { + color: #337ab7; + cursor: pointer; +} +button:hover, +button:focus, +a:hover, +a:focus { + color: #23527c; + text-decoration: none; +} +a.disable, +a.disable:hover { + text-decoration: none; + cursor: default; + color: #000000; +} + +h1, h2, h3, h4, h5, h6, .text-break { + word-wrap: break-word; + word-break: break-word; +} + +h1 mark, +h2 mark, +h3 mark, +h4 mark, +h5 mark, +h6 mark { + padding: 0; +} + +.inheritance .level0:before, +.inheritance .level1:before, +.inheritance .level2:before, +.inheritance .level3:before, +.inheritance .level4:before, +.inheritance .level5:before, +.inheritance .level6:before, +.inheritance .level7:before, +.inheritance .level8:before, +.inheritance .level9:before, +.inheritance .level10:before { + content: '↳'; + margin-right: 5px; +} + +.inheritance .level0 { + margin-left: 0em; +} + +.inheritance .level1 { + margin-left: 1em; +} + +.inheritance .level2 { + margin-left: 2em; +} + +.inheritance .level3 { + margin-left: 3em; +} + +.inheritance .level4 { + margin-left: 4em; +} + +.inheritance .level5 { + margin-left: 5em; +} + +.inheritance .level6 { + margin-left: 6em; +} + +.inheritance .level7 { + margin-left: 7em; +} + +.inheritance .level8 { + margin-left: 8em; +} + +.inheritance .level9 { + margin-left: 9em; +} + +.inheritance .level10 { + margin-left: 10em; +} + +span.parametername, +span.paramref, +span.typeparamref { + font-style: italic; +} +span.languagekeyword{ + font-weight: bold; +} + +svg:hover path { + fill: #ffffff; +} + +.hljs { + display: inline; + background-color: inherit; + padding: 0; +} +/* additional spacing fixes */ +.btn + .btn { + margin-left: 10px; +} +.btn.pull-right { + margin-left: 10px; + margin-top: 5px; +} +.table { + margin-bottom: 10px; +} +table p { + margin-bottom: 0; +} +table a { + display: inline-block; +} + +/* Make hidden attribute compatible with old browser.*/ +[hidden] { + display: none !important; +} + +h1, +.h1, +h2, +.h2, +h3, +.h3 { + margin-top: 15px; + margin-bottom: 10px; + font-weight: 400; +} +h4, +.h4, +h5, +.h5, +h6, +.h6 { + margin-top: 10px; + margin-bottom: 5px; +} +.navbar { + margin-bottom: 0; +} +#wrapper { + min-height: 100%; + position: relative; +} +/* blends header footer and content together with gradient effect */ +.grad-top { + /* For Safari 5.1 to 6.0 */ + /* For Opera 11.1 to 12.0 */ + /* For Firefox 3.6 to 15 */ + background: linear-gradient(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0)); + /* Standard syntax */ + height: 5px; +} +.grad-bottom { + /* For Safari 5.1 to 6.0 */ + /* For Opera 11.1 to 12.0 */ + /* For Firefox 3.6 to 15 */ + background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.05)); + /* Standard syntax */ + height: 5px; +} +.divider { + margin: 0 5px; + color: #cccccc; +} +hr { + border-color: #cccccc; +} +header { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 1000; +} +header .navbar { + border-width: 0 0 1px; + border-radius: 0; +} +.navbar-brand { + font-size: inherit; + padding: 0; +} +.navbar-collapse { + margin: 0 -15px; +} +.subnav { + min-height: 40px; +} + +.inheritance h5, .inheritedMembers h5{ + padding-bottom: 5px; + border-bottom: 1px solid #ccc; +} + +.implements h5{ + padding-bottom: 5px; + border-bottom: 1px solid #ccc; +} + +.expander:after { + content: "\002193"; + margin-left: 5px; + color: grey; +} + +.expander.collapsed:after { + content: "\002191"; +} + +article h1, article h2, article h3, article h4{ + margin-top: 25px; +} + +article h4{ + border-bottom: 1px solid #ccc; +} + +article span.small.pull-right{ + margin-top: 20px; +} + +article section { + margin-left: 1em; +} + +/*.expand-all { + padding: 10px 0; +}*/ +.breadcrumb { + margin: 0; + padding: 10px 0; + background-color: inherit; + white-space: nowrap; +} +.breadcrumb > li + li:before { + content: "\00a0/"; +} +#autocollapse.collapsed .navbar-header { + float: none; +} +#autocollapse.collapsed .navbar-toggle { + display: block; +} +#autocollapse.collapsed .navbar-collapse { + border-top: 1px solid transparent; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); +} +#autocollapse.collapsed .navbar-collapse.collapse { + display: none !important; +} +#autocollapse.collapsed .navbar-nav { + float: none !important; + margin: 7.5px -15px; +} +#autocollapse.collapsed .navbar-nav > li { + float: none; +} +#autocollapse.collapsed .navbar-nav > li > a { + padding-top: 10px; + padding-bottom: 10px; +} +#autocollapse.collapsed .collapse.in, +#autocollapse.collapsed .collapsing { + display: block !important; +} +#autocollapse.collapsed .collapse.in .navbar-right, +#autocollapse.collapsed .collapsing .navbar-right { + float: none !important; +} +#autocollapse .form-group { + width: 100%; +} +#autocollapse .form-control { + width: 100%; +} +#autocollapse .navbar-header { + margin-left: 0; + margin-right: 0; +} +#autocollapse .navbar-brand { + margin-left: 0; +} +.collapse.in, +.collapsing { + text-align: unset; +} +.collapsing .navbar-form { + margin: 0 auto; + max-width: 400px; + padding: 10px 15px; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); +} +.collapsed .collapse.in .navbar-form { + margin: 0 auto; + max-width: 400px; + padding: 10px 15px; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); +} +.navbar .navbar-nav { + display: inline-block; +} +.docs-search { + background: white; + vertical-align: middle; +} +.docs-search > .search-query { + font-size: 14px; + border: 0; + width: 120%; + color: #555; +} +.docs-search > .search-query:focus { + outline: 0; +} +.search-results-frame { + clear: both; + display: table; + width: 100%; +} +.search-results.ng-hide { + display: none; +} +.search-results-container { + padding-bottom: 1em; + border-top: 1px solid #111; + background: rgba(25, 25, 25, 0.5); +} +.search-results-container .search-results-group { + padding-top: 50px !important; + padding: 10px; +} +.search-results-group-heading { + font-family: "Open Sans"; + padding-left: 10px; + color: white; +} +.search-close { + position: absolute; + left: 50%; + margin-left: -100px; + color: white; + text-align: center; + padding: 5px; + background: #333; + border-top-right-radius: 5px; + border-top-left-radius: 5px; + width: 200px; + box-shadow: 0 0 10px #111; +} +#search { + display: none; +} + +/* Search results display*/ +#search-results { + max-width: 960px !important; + margin-top: 120px; + margin-bottom: 115px; + margin-left: auto; + margin-right: auto; + line-height: 1.8; + display: none; +} + +#search-results>.search-list { + text-align: center; + font-size: 2.5rem; + margin-bottom: 50px; +} + +#search-results p { + text-align: center; +} + +#search-results p .index-loading { + animation: index-loading 1.5s infinite linear; + -webkit-animation: index-loading 1.5s infinite linear; + -o-animation: index-loading 1.5s infinite linear; + font-size: 2.5rem; +} + +@keyframes index-loading { + from { transform: scale(1) rotate(0deg);} + to { transform: scale(1) rotate(360deg);} +} + +@-webkit-keyframes index-loading { + from { -webkit-transform: rotate(0deg);} + to { -webkit-transform: rotate(360deg);} +} + +@-o-keyframes index-loading { + from { -o-transform: rotate(0deg);} + to { -o-transform: rotate(360deg);} +} + +#search-results .sr-items { + font-size: 24px; +} + +.sr-item { + margin-bottom: 25px; +} + +.sr-item>.item-href { + font-size: 14px; + color: #093; +} + +.sr-item>.item-brief { + font-size: 13px; +} + +.pagination>li>a { + color: #47A7A0 +} + +.pagination>.active>a { + background-color: #47A7A0; + border-color: #47A7A0; +} + +.fixed_header { + position: fixed; + width: 100%; + padding-bottom: 10px; + padding-top: 10px; + margin: 0px; + top: 0; + z-index: 9999; + left: 0; +} + +.fixed_header+.toc{ + margin-top: 50px; + margin-left: 0; +} + +.sidenav, .fixed_header, .toc { + background-color: #f1f1f1; +} + +.sidetoc { + position: fixed; + width: 260px; + top: 150px; + bottom: 0; + overflow-x: hidden; + overflow-y: auto; + background-color: #f1f1f1; + border-left: 1px solid #e7e7e7; + border-right: 1px solid #e7e7e7; + z-index: 1; +} + +.sidetoc.shiftup { + bottom: 70px; +} + +body .toc{ + background-color: #f1f1f1; + overflow-x: hidden; +} + +.sidetoggle.ng-hide { + display: block !important; +} +.sidetoc-expand > .caret { + margin-left: 0px; + margin-top: -2px; +} +.sidetoc-expand > .caret-side { + border-left: 4px solid; + border-top: 4px solid transparent; + border-bottom: 4px solid transparent; + margin-left: 4px; + margin-top: -4px; +} +.sidetoc-heading { + font-weight: 500; +} + +.toc { + margin: 0px 0 0 10px; + padding: 0 10px; +} +.expand-stub { + position: absolute; + left: -10px; +} +.toc .nav > li > a.sidetoc-expand { + position: absolute; + top: 0; + left: 0; +} +.toc .nav > li > a { + color: #666666; + margin-left: 5px; + display: block; + padding: 0; +} +.toc .nav > li > a:hover, +.toc .nav > li > a:focus { + color: #000000; + background: none; + text-decoration: inherit; +} +.toc .nav > li.active > a { + color: #337ab7; +} +.toc .nav > li.active > a:hover, +.toc .nav > li.active > a:focus { + color: #23527c; +} + +.toc .nav > li> .expand-stub { + cursor: pointer; +} + +.toc .nav > li.active > .expand-stub::before, +.toc .nav > li.in > .expand-stub::before, +.toc .nav > li.in.active > .expand-stub::before, +.toc .nav > li.filtered > .expand-stub::before { + content: "-"; +} + +.toc .nav > li > .expand-stub::before, +.toc .nav > li.active > .expand-stub::before { + content: "+"; +} + +.toc .nav > li.filtered > ul, +.toc .nav > li.in > ul { + display: block; +} + +.toc .nav > li > ul { + display: none; +} + +.toc ul{ + font-size: 12px; + margin: 0 0 0 3px; +} + +.toc .level1 > li { + font-weight: bold; + margin-top: 10px; + position: relative; + font-size: 16px; +} +.toc .level2 { + font-weight: normal; + margin: 5px 0 0 15px; + font-size: 14px; +} +.toc-toggle { + display: none; + margin: 0 15px 0px 15px; +} +.sidefilter { + position: fixed; + top: 90px; + width: 260px; + background-color: #f1f1f1; + padding: 15px; + border-left: 1px solid #e7e7e7; + border-right: 1px solid #e7e7e7; + z-index: 1; +} +.toc-filter { + border-radius: 5px; + background: #fff; + color: #666666; + padding: 5px; + position: relative; + margin: 0 5px 0 5px; +} +.toc-filter > input { + border: 0; + color: #666666; + padding-left: 20px; + width: 100%; +} +.toc-filter > input:focus { + outline: 0; +} +.toc-filter > .filter-icon { + position: absolute; + top: 10px; + left: 5px; +} +.article { + margin-top: 120px; + margin-bottom: 115px; +} + +#_content>a{ + margin-top: 105px; +} + +.article.grid-right { + margin-left: 280px; +} + +.inheritance hr { + margin-top: 5px; + margin-bottom: 5px; +} +.article img { + max-width: 100%; +} +.sideaffix { + margin-top: 50px; + font-size: 12px; + max-height: 100%; + overflow: hidden; + top: 100px; + bottom: 10px; + position: fixed; +} +.sideaffix.shiftup { + bottom: 70px; +} +.affix { + position: relative; + height: 100%; +} +.sideaffix > div.contribution { + margin-bottom: 20px; +} +.sideaffix > div.contribution > ul > li > a.contribution-link { + padding: 6px 10px; + font-weight: bold; + font-size: 14px; +} +.sideaffix > div.contribution > ul > li > a.contribution-link:hover { + background-color: #ffffff; +} +.sideaffix ul.nav > li > a:focus { + background: none; +} +.affix h5 { + font-weight: bold; + text-transform: uppercase; + padding-left: 10px; + font-size: 12px; +} +.affix > ul.level1 { + overflow: hidden; + padding-bottom: 10px; + height: calc(100% - 100px); + margin-right: -20px; +} +.affix ul > li > a:before { + color: #cccccc; + position: absolute; +} +.affix ul > li > a:hover { + background: none; + color: #666666; +} +.affix ul > li.active > a, +.affix ul > li.active > a:before { + color: #337ab7; +} +.affix ul > li > a { + padding: 5px 12px; + color: #666666; +} +.affix > ul > li.active:last-child { + margin-bottom: 50px; +} +.affix > ul > li > a:before { + content: "|"; + font-size: 16px; + top: 1px; + left: 0; +} +.affix > ul > li.active > a, +.affix > ul > li.active > a:before { + color: #337ab7; + font-weight: bold; +} +.affix ul ul > li > a { + padding: 2px 15px; +} +.affix ul ul > li > a:before { + content: ">"; + font-size: 14px; + top: -1px; + left: 5px; +} +.affix ul > li > a:before, +.affix ul ul { + display: none; +} +.affix ul > li.active > ul, +.affix ul > li.active > a:before, +.affix ul > li > a:hover:before { + display: block; + white-space: nowrap; +} +.codewrapper { + position: relative; +} +.trydiv { + height: 0px; +} +.tryspan { + position: absolute; + top: 0px; + right: 0px; + border-style: solid; + border-radius: 0px 4px; + box-sizing: border-box; + border-width: 1px; + border-color: #cccccc; + text-align: center; + padding: 2px 8px; + background-color: white; + font-size: 12px; + cursor: pointer; + z-index: 100; + display: none; + color: #767676; +} +.tryspan:hover { + background-color: #3b8bd0; + color: white; + border-color: #3b8bd0; +} +.codewrapper:hover .tryspan { + display: block; +} +.sample-response .response-content{ + max-height: 200px; +} +footer { + position: absolute; + left: 0; + right: 0; + bottom: 0; + z-index: 1000; +} +.footer { + border-top: 1px solid #e7e7e7; + background-color: #f8f8f8; + padding: 15px 0; +} +@media (min-width: 768px) { + #sidetoggle.collapse { + display: block; + } + .topnav .navbar-nav { + float: none; + white-space: nowrap; + } + .topnav .navbar-nav > li { + float: none; + display: inline-block; + } +} +@media only screen and (max-width: 768px) { + #mobile-indicator { + display: block; + } + /* TOC display for responsive */ + .article { + margin-top: 30px !important; + } + header { + position: static; + } + .topnav { + text-align: center; + } + .sidenav { + padding: 15px 0; + margin-left: -15px; + margin-right: -15px; + } + .sidefilter { + position: static; + width: auto; + float: none; + border: none; + } + .sidetoc { + position: static; + width: auto; + float: none; + padding-bottom: 0px; + border: none; + } + .toc .nav > li, .toc .nav > li >a { + display: inline-block; + } + .toc li:after { + margin-left: -3px; + margin-right: 5px; + content: ", "; + color: #666666; + } + .toc .level1 > li { + display: block; + } + + .toc .level1 > li:after { + display: none; + } + .article.grid-right { + margin-left: 0; + } + .grad-top, + .grad-bottom { + display: none; + } + .toc-toggle { + display: block; + } + .sidetoggle.ng-hide { + display: none !important; + } + /*.expand-all { + display: none; + }*/ + .sideaffix { + display: none; + } + .mobile-hide { + display: none; + } + .breadcrumb { + white-space: inherit; + } + + /* workaround for #hashtag url is no longer needed*/ + h1:before, + h2:before, + h3:before, + h4:before { + content: ''; + display: none; + } +} + +/* For toc iframe */ +@media (max-width: 260px) { + .toc .level2 > li { + display: block; + } + + .toc .level2 > li:after { + display: none; + } +} + +/* For code snippet line highlight */ +pre > code .line-highlight { + background-color: #ffffcc; +} + +/* Alerts */ +.alert h5 { + text-transform: uppercase; + font-weight: bold; + margin-top: 0; +} + +.alert h5:before { + position:relative; + top:1px; + display:inline-block; + font-family:'Glyphicons Halflings'; + line-height:1; + -webkit-font-smoothing:antialiased; + -moz-osx-font-smoothing:grayscale; + margin-right: 5px; + font-weight: normal; +} + +.alert-info h5:before { + content:"\e086" +} + +.alert-warning h5:before { + content:"\e127" +} + +.alert-danger h5:before { + content:"\e107" +} + +/* For Embedded Video */ +div.embeddedvideo { + padding-top: 56.25%; + position: relative; + width: 100%; +} + +div.embeddedvideo iframe { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + width: 100%; + height: 100%; +} + +/* For printer */ +@media print{ + .article.grid-right { + margin-top: 0px; + margin-left: 0px; + } + .sideaffix { + display: none; + } + .mobile-hide { + display: none; + } + .footer { + display: none; + } +} + +/* For tabbed content */ + +.tabGroup { + margin-top: 1rem; } + .tabGroup ul[role="tablist"] { + margin: 0; + padding: 0; + list-style: none; } + .tabGroup ul[role="tablist"] > li { + list-style: none; + display: inline-block; } + .tabGroup a[role="tab"] { + color: #6e6e6e; + box-sizing: border-box; + display: inline-block; + padding: 5px 7.5px; + text-decoration: none; + border-bottom: 2px solid #fff; } + .tabGroup a[role="tab"]:hover, .tabGroup a[role="tab"]:focus, .tabGroup a[role="tab"][aria-selected="true"] { + border-bottom: 2px solid #0050C5; } + .tabGroup a[role="tab"][aria-selected="true"] { + color: #222; } + .tabGroup a[role="tab"]:hover, .tabGroup a[role="tab"]:focus { + color: #0050C5; } + .tabGroup a[role="tab"]:focus { + outline: 1px solid #0050C5; + outline-offset: -1px; } + @media (min-width: 768px) { + .tabGroup a[role="tab"] { + padding: 5px 15px; } } + .tabGroup section[role="tabpanel"] { + border: 1px solid #e0e0e0; + padding: 15px; + margin: 0; + overflow: hidden; } + .tabGroup section[role="tabpanel"] > .codeHeader, + .tabGroup section[role="tabpanel"] > pre { + margin-left: -16px; + margin-right: -16px; } + .tabGroup section[role="tabpanel"] > :first-child { + margin-top: 0; } + .tabGroup section[role="tabpanel"] > pre:last-child { + display: block; + margin-bottom: -16px; } + +.mainContainer[dir='rtl'] main ul[role="tablist"] { + margin: 0; } diff --git a/doc/docfx/docfx.json b/doc/docfx/docfx.json index 1c5009de69..b5354679eb 100644 --- a/doc/docfx/docfx.json +++ b/doc/docfx/docfx.json @@ -61,7 +61,8 @@ "globalMetadataFiles": [], "fileMetadataFiles": [], "template": [ - "default" + "default", + "default_efl" ], "postProcessors": [], "markdownEngineName": "markdig", diff --git a/doc/docfx/filterConfig.yml b/doc/docfx/filterConfig.yml index 3fe441259a..d6ddf9d5b4 100644 --- a/doc/docfx/filterConfig.yml +++ b/doc/docfx/filterConfig.yml @@ -1,4 +1,8 @@ apiRules: +- exclude: + uidRegex: ^.*NativeInherit$ +- exclude: + uidRegex: ^.*NativeStruct$ - include: uidRegex: ^Efl - include: diff --git a/doc/ecore_examples.dox b/doc/ecore_examples.dox index bf25fa3804..64542779d5 100644 --- a/doc/ecore_examples.dox +++ b/doc/ecore_examples.dox @@ -1575,7 +1575,7 @@ * @skip ecore_main_fd_handler_add * @until ; * - * If you don't remenber the parameters of @ref ecore_main_fd_handler_add, + * If you don't remember the parameters of @ref ecore_main_fd_handler_add, * please check its documentation. * * Now that we have our handler registered we will start the ecore's main loop: diff --git a/doc/elementary_examples.dox b/doc/elementary_examples.dox index af37ae2c62..dc7acbab47 100644 --- a/doc/elementary_examples.dox +++ b/doc/elementary_examples.dox @@ -617,7 +617,7 @@ * project's build system, we're assuming they are the canonical ones. * * After the program starts, elm_app_info_set() will actually run and - * then you'll see an intrincasy: Elementary does the prefix lookup @b + * then you'll see a problem: Elementary does the prefix lookup @b * twice. This is so because of the quicklaunch infrastructure in * Elementary (@ref Start), which will register a predefined prefix * for possible users of the launch schema. We're not hooking into a @@ -2112,7 +2112,7 @@ * We'll start this example in the same way * @ref map_example_01 "Map Example 1". Adding a map with buttons to control * zoom, so if you didn't read it yet, just do it now. Actually there is - * a change, that we're aligning buttons to the top, since we wan't a + * a change, that we're aligning buttons to the top, since we want a * vertical control box this time. * @dontinclude map_example_03.c * @skipline elm_map_add @@ -2125,8 +2125,8 @@ * @skipline horizontal_set * @until align_set * - * We'll add an entry with a preliminar address, that I know will - * find a coordinate, to examplify names work. But you can try + * We'll add an entry with a preliminary address, that I know will + * find a coordinate, to exemplify how names work. But you can try * lots of addresses. From city or country names to pubs, or whatever * you want. To try is enough to run the example, type the address and * press "Route" button. This button will call a function that will @@ -2220,7 +2220,7 @@ * We are just adding the diskselector, so as you can see, defaults for it are: * @li Only 3 items visible each time. * @li Only 3 characters are displayed for labels on side positions. - * @li The first added item remains centeres, i.e., it's the selected item. + * @li The first added item remains centered, i.e., it's the selected item. * * To add items, we are just appending it on a loop, using function * elm_diskselector_item_append(), that will be better explained on @@ -2307,7 +2307,7 @@ * The first parameter of elm_diskselector_item_append() is the diskselector * object, that we are receiving as data on our callback function. * The second one is a label, the string that will be placed in the center - * of our item. As we don't wan't icons or callback functions, we can + * of our item. As we don't want icons or callback functions, we can * send NULL as third, fourth and fifth parameters. * * Appending an item with icon: @@ -2543,7 +2543,7 @@ * The first parameter of elm_list_item_prepend() is the list * object, that we are receiving as data on our callback function. * The second one is a label, the string that will be placed in the center - * of our item. As we don't wan't icons or callback functions, we can + * of our item. As we don't want icons or callback functions, we can * send NULL as third, fourth, fifth and sixth parameters. * * Appending an item: @@ -3033,7 +3033,7 @@ * Note that we set on it both icon and label decorations. It's set to * list the contents of the @c "/tmp" directory, too, with * elm_fileselector_button_path_set(). What follows are checkboxes to - * exercise some of its API funtions: + * exercise some of its API functions: * @dontinclude fileselector_button_example.c * @skip ck = elm_check_add * @until evas_object_show(en) @@ -3107,7 +3107,7 @@ * decorations. It's set to exhibit the path of (and list the contents * of, when internal file selector is launched) the @c "/tmp" * directory, also, with elm_fileselector_entry_path_set(). What - * follows are checkboxes to exercise some of its API funtions: + * follows are checkboxes to exercise some of its API functions: * @dontinclude fileselector_entry_example.c * @skip ck = elm_check_add * @until callback_add(fs_entry @@ -3370,7 +3370,7 @@ * and what to do when the layout theme has its size changed. The full source * code for this example can be found at @ref layout_example_03_c. * - * In this exmaple we will use another group from the same layout theme file + * In this example we will use another group from the same layout theme file * used in @ref layout_example_01. Its instantiation and loading happens in the * following lines: * @@ -3909,7 +3909,7 @@ * It will get the last index item selected's data and find the * respective index item handle(#Elm_Object_Item) with elm_index_item_find(). * We need the latter to query the indexing letter string from, with - * elm_index_item_letter_get(). Next, comes the delition, itself, + * elm_index_item_letter_get(). Next, comes the deletion itself, * which will also trigger the @c _index_item_del callback function, * as said above. * @@ -4450,7 +4450,7 @@ * * We'll begin by showing a few structures used throught the program. First, * the application owns data that holds the main window and the main entry - * where the editting happens. Then, an auxiliar structure we'll use later + * where the editting happens. Then, an auxiliary structure we'll use later * when inserting icons in our text. * @dontinclude entry_example.c * @skip typedef @@ -5451,7 +5451,7 @@ * controls will exercise most of the slideshow's API functions. * * We create the slideshow, itself, first, making it @b loop on its - * image itens, when in slideshow mode: + * image items, when in slideshow mode: * @dontinclude slideshow_example.c * @skip slideshow = elm_slideshow_add * @until evas_object_show @@ -6218,7 +6218,7 @@ * @skipline } * @skipline } * - * Other @c INT type widget implementations may exist, as is exemplifyed + * Other @c INT type widget implementations may exist, as is exemplified * on the item that follows. * * @skip item { @@ -6877,4 +6877,4 @@ * @image latex screenshots/combobox_example_01.eps width=\textwidth * * @example combobox_example_01.c - */ \ No newline at end of file + */ diff --git a/doc/elementary_examples_cxx.dox b/doc/elementary_examples_cxx.dox index 7b45ed9ff4..6197450ac1 100644 --- a/doc/elementary_examples_cxx.dox +++ b/doc/elementary_examples_cxx.dox @@ -60,7 +60,7 @@ * With this tutorial we'll give you a better view of how the lambda * function can and will be constantly use in the C++ bindings. For a - * more broad aproach you should do a little web research. + * more broad approach you should do a little web research. * The syntax adopted for these examples: @@ -200,7 +200,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -323,7 +323,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -488,7 +488,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -660,7 +660,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -837,7 +837,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -1030,13 +1030,13 @@ * For the up button, we'll set to @p true the autorepeat, * autorepeat_initial_timeout, autoreapet_gap_timeout, the size hints - * for weight and alignement, choose our packing method and making out + * for weight and alignment, choose our packing method and making out * up button visible. * @skip up * @until visibility - * For this directional buttons we'll have a diferent repeated + * For this directional buttons we'll have a different repeated * callback that will insure the timeouts of our middle button in the * gap and initial timeout that is current setted. @@ -1123,7 +1123,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -1258,7 +1258,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -1441,7 +1441,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -1580,7 +1580,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -1825,7 +1825,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -1992,7 +1992,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -2127,7 +2127,7 @@ * @skip pack_end * @until visibility - * The second clock shows ther am/pm time, that we also create with + * The second clock shows the am/pm time, that we also create with * the C++ binding method, passing our window object as * parent. Setting show_am_pm to true and again choosing the packing * method and making clock visible. @@ -2205,7 +2205,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -2419,7 +2419,7 @@ * @until visibility * For our second datetime, we'll also set the size hints weight and - * align, but in this case, the filds YEAR, MONTH and DATE will be not + * align, but in this case, the fields YEAR, MONTH and DATE will be not * visible, and thus displaying in our datetime the hour, minute and * AM/PM. Finally we choose it's packing method and set the visibility * of datetime to @p true. @@ -2513,7 +2513,7 @@ * @until linked * In this function we load the vertex/fragment shaders, create the - * program object and finish our funtion. + * program object and finish our function. * @skip gld * @until return 1; @@ -2585,7 +2585,7 @@ * @skipline elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -2883,7 +2883,7 @@ * @skipline elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -3031,7 +3031,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -3248,7 +3248,7 @@ * @skipline elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -3462,7 +3462,7 @@ * @skipline elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -3604,7 +3604,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -3736,7 +3736,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -3997,7 +3997,7 @@ * @dontinclude separator_cxx_example_01.cc * Separator is a very thin object used to separate other objects, - * wich can be vertical or horizontal. + * which can be vertical or horizontal. * This example shows how to create a window and separate in two * parts, each one will be filled with a background color to show the @@ -4031,7 +4031,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -4268,7 +4268,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -4573,7 +4573,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -4874,7 +4874,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -4958,15 +4958,15 @@ * @li row - Row number - * @li colspan - Number of columns that the subobj will occuppy + * @li colspan - Number of columns that the subobj will occupy - * @li rowspan - Number of rows that the subobj will occuppy + * @li rowspan - Number of rows that the subobj will occupy * @note All positioning inside the table is relative to rows and * columns, so a value of 0 for @a column and @a row, means the top * left cell of the table. And for example, value of 2 for @a colspan and @a - * rowspan indicates that the subobj will occuppy two column and two rows, - * thus occuppying 4 cells in total. + * rowspan indicates that the subobj will occupy two columns and two rows, + * thus occupying 4 cells in total. * Finally we just have to make our window visible. Then run the elm * mainloop, starting to handle events and drawing operations. @@ -5018,7 +5018,7 @@ * @until elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -5075,7 +5075,7 @@ * @until homogeneous * For each cell of this table we are going to create a unique @p - * evas::rectangle, each with diferent colors and sizes. + * evas::rectangle, each with different colors and sizes. * Let's see a snip of the code on how we constructed our rectangles * and setted the colors. @@ -5120,15 +5120,15 @@ * @li row - Row number - * @li colspan - Number of columns that the subobj will occuppy + * @li colspan - Number of columns that the subobj will occupy - * @li rowspan - Number of rows that the subobj will occuppy + * @li rowspan - Number of rows that the subobj will occupy * @note All positioning inside the table is relative to rows and * columns, so a value of 0 for @a column and @a row, means the top * left cell of the table. And for example, value of 2 for @a colspan - * and @a rowspan indicates that the subobj will occuppy two column - * and two rows, thus occuppying 4 cells in total. + * and @a rowspan indicates that the subobj will occupy two column + * and two rows, thus occupying 4 cells in total. * So for each rectangle we are setting a specific location and how * many cells it's occupying, better seem below: @@ -5202,7 +5202,7 @@ * @skipline elm_policy_set * As you can see, the policy we chose was to quit when the last win - * is hidden as opose to examples with the C bindings where we + * is hidden as opposed to examples with the C bindings where we * perpetually set it to quit when last win was closed. This changed * was necessary because in C++ binding as the elm mainloop stop * running all object are destroyed, references are unreferenced and @@ -5329,4 +5329,4 @@ * @image latex screenshots/thumb_cxx_example_01.eps width=\textwidth * @example thumb_cxx_example_01.cc - */ \ No newline at end of file + */ diff --git a/doc/elementary_examples_js.dox b/doc/elementary_examples_js.dox index 37f867a638..bcd119bdab 100644 --- a/doc/elementary_examples_js.dox +++ b/doc/elementary_examples_js.dox @@ -627,7 +627,7 @@ * @skip pack_end * @until visible - * The second clock shows ther am/pm time, that we also create with + * The second clock shows the am/pm time, that we also create with * the JS binding method, passing our window object as * parent. Setting show_am_pm to true and again choosing the packing * method and making clock visible. @@ -701,7 +701,7 @@ * @dontinclude separator_example_01.js * Separator is a very thin object used to separate other objects, - * wich can be vertical or horizontal. + * which can be vertical or horizontal. * This example shows how to create a window and separate in two * parts, each one will be filled with a background color to show the @@ -1019,4 +1019,4 @@ * @image latex screenshots/icon_example_01.eps width=\textwidth * @example icon_example_01.js - */ \ No newline at end of file + */ diff --git a/examples_checks.py b/examples_checks.py new file mode 100755 index 0000000000..f456e6be58 --- /dev/null +++ b/examples_checks.py @@ -0,0 +1,203 @@ +#!/usr/bin/python3 +import os +import sys +import subprocess +import json +import time +import concurrent.futures +import argparse +import tempfile + +# +# preparation calls for the examples +# + +def prep_eina_file_02(): + f = tempfile.NamedTemporaryFile(delete=False) + f.write(b"Simulation") + return [f.name, "/tmp/copy_file"] + +def prep_eina_xattr_01(): + f = tempfile.NamedTemporaryFile(delete=False) + f.write(b"Simulation") + return ["list", f.name] + +def prep_eina_xattr_02(): + f1 = tempfile.NamedTemporaryFile(delete=False) + f1.write(b"Simulation") + f2 = tempfile.NamedTemporaryFile(delete=False) + f2.write(b"Simulation2") + return [f1.name, f2.name] + +def prep_eet_data_simple(): + f1 = tempfile.NamedTemporaryFile(delete=False) + f1.write(b"Simulation") + f2 = tempfile.NamedTemporaryFile(delete=False) + f2.write(b"Simulation2") + return [f1.name, f2.name] + +def prep_eet_data_nested(): + f1 = tempfile.NamedTemporaryFile(delete=False) + f1.write(b"Simulation") + f2 = tempfile.NamedTemporaryFile(delete=False) + f2.write(b"Simulation2") + return [f1.name, f2.name] + +def prep_eet_data_file_descriptor_01(): + f1 = tempfile.NamedTemporaryFile(delete=False) + f1.write(b"Simulation") + f2 = tempfile.NamedTemporaryFile(delete=False) + f2.write(b"Simulation2") + return [f1.name, f2.name, "acc", "Example-Simulation"] + +def prep_eet_data_file_descriptor_02(): + f1 = tempfile.NamedTemporaryFile(delete=False) + f1.write(b"Simulation") + f2 = tempfile.NamedTemporaryFile(delete=False) + f2.write(b"Simulation2") + return [f1.name, f2.name, "union", "5", "Example-Simulation"] + +def prep_ecore_getopt_example(): + return ["string-1", "120", "apple", "none-optional-arg"] + +def prep_eio_file_copy(): + f1 = tempfile.NamedTemporaryFile(delete=False) + f1.write(b"Simulation") + return [f1.name, "/tmp/eio_dst_file"] + +def prep_eio_file_ls(): + return ["/tmp/"] + +def prep_edje_color_class(): + return ["beta", "red", "green", "blue"] + +def prep_ecore_con_url_headers_example(): + return ["GET", "www.enlightenment.org"] + +def prep_ecore_con_url_download_example(): + return ["www.enlightenment.org"] + +def prep_ecore_con_url_cookies_example(): + return ["www.enlightenment.org"] + +def prep_ecore_con_client_example(): + return ["enlightenment.org", "80"] + +def prep_ecore_con_lookup_example(): + return ["enlightenment.org"] + +def prep_ecore_con_server_example(): + return ["enlightenment.org", "1234"] + +def prep_ecore_con_client_simple_example(): + return ["enlightenment.org", "80"] + +example_preparation = { + "eina_file_02" : prep_eina_file_02, + "eina_xattr_01" : prep_eina_xattr_01, + "eina_xattr_02" : prep_eina_xattr_02, + "eet-data-simple" : prep_eet_data_simple, + "eet-data-nested" : prep_eet_data_nested, + "eet-data-simple" : prep_eet_data_simple, + "eet-data-file_descriptor_01" : prep_eet_data_file_descriptor_01, + "eet-data-file_descriptor_02" : prep_eet_data_file_descriptor_02, + "ecore_getopt_example" : prep_ecore_getopt_example, + "eio_file_copy" : prep_eio_file_copy, + "eio_file_ls" : prep_eio_file_ls, + "edje-color-class" : prep_edje_color_class, + "ecore_con_url_headers_example" : prep_ecore_con_url_headers_example, + "ecore_con_url_download_example" : prep_ecore_con_url_download_example, + "ecore_con_url_cookies_example" : prep_ecore_con_url_cookies_example, + "ecore_con_client_example" : prep_ecore_con_client_example, + "ecore_con_lookup_example" : prep_ecore_con_lookup_example, + "ecore_con_server_example" : prep_ecore_con_server_example, + "ecore_con_client_simple_example" : prep_ecore_con_client_simple_example, +} + +# +# Holds up the state of the ran examples +# + +class State: + def __init__(self, examples): + self.max_n = examples + self.n = 1 + self.count_fail = 0 + self.count_success = 0 + self.count_err_output = 0 + print("Found "+str(self.max_n)+" Examples") + + def add_run(self, command, error_in_output, exitcode): + print("{}/{} {} {} {} ".format(self.n, self.max_n, ("SUCCESS" if exitcode == 0 else "FAIL"), ("CLEAN" if error_in_output == False else "ERR"), command)) + self.n = self.n + 1 + if exitcode != 0: + self.count_fail += 1 + if error_in_output == True: + self.count_err_output += 1 + if exitcode == 0 and error_in_output == False: + self.count_success += 1 + + def print_summary(self): + print("Summary") + print(" Failed: "+str(self.count_fail)+"/"+str(self.max_n)) + print(" Errored: "+str(self.count_err_output)+"/"+str(self.max_n)) + print(" Success: "+str(self.count_success)+"/"+str(self.max_n)) + +# +# this simulates the startup of the example, and the closing after 1s +# + +def simulate_example(example): + args = [] + if os.path.basename(example) in example_preparation: + args = example_preparation[os.path.basename(example)]() + + #meson changed behaviour from 0.49 to 0.50 so we need this: + if os.path.isabs(example): + example_dir = example + else: + example_dir = os.path.join(G.builddir, example) + + run = subprocess.Popen([example_dir] + args, + stdout = subprocess.PIPE, + stderr = subprocess.PIPE, + ) + time.sleep(1) + run.terminate() + try: + outs, errs = run.communicate(timeout=2) + except Exception as e: + run.kill() + return (example, True, -1) + else: + return (example, True if b'ERR' in outs or b'ERR' in errs else False, run.poll()) + +#meson changed behaviour from 0.49 to 0.50 so we need this: +def meson_fetch_filename(filename_object): + if isinstance(filename_object, str): + return filename_object + else: + return filename_object[0] + + +parser = argparse.ArgumentParser(description='Run the examples of efl') +parser.add_argument('builddir', metavar='build', help='the path where to find the meson build directory') + + +G = parser.parse_args() +#Run meson to fetch all examples +meson_introspect = subprocess.Popen(["meson", "introspect", G.builddir, "--targets"], + stdout = subprocess.PIPE, + stderr = subprocess.PIPE, +) +meson_introspect.poll() +build_targets = json.loads(meson_introspect.stdout.read()) +examples = [meson_fetch_filename(b["filename"]) for b in build_targets if "examples" in meson_fetch_filename(b["filename"]) and b["type"] == "executable"] +state = State(len(examples)) +#simulate all examples in parallel with up to 5 runners +with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor: + futures = [executor.submit(simulate_example, example) for example in examples] + for future in concurrent.futures.as_completed(futures): + example_run = future.result() + state.add_run(example_run[0], example_run[1], example_run[2]) +state.print_summary() diff --git a/header_checks/meson.build b/header_checks/meson.build index b23e774ec1..42d638fc6a 100644 --- a/header_checks/meson.build +++ b/header_checks/meson.build @@ -43,7 +43,6 @@ header_checks = [ 'sys/wait.h', 'sys/resource.h', 'sys/times.h', - 'dirent.h', 'longinfo.h', 'exotic.h', 'ieeefp.h', @@ -53,9 +52,22 @@ header_checks = [ 'langinfo.h', 'locale.h', 'uv.h', - 'ws2tcpip.h' + 'crt_externs.h' ] +#### The below is logically broken +#### the declaration of symbol + headers when you look the symbols up +#### in man pages you'll find that, for example, kevent needs you to +#### include ALL of the headers listed below. same for setxattr, +#### listxattr, pthread_getcpuclockid ... i stopped looking at this +#### point because it seems this is the pattern, but the foreach below +#### does not do this. it includes one header at a time from the list +#### then checks to see if the symbol exists. this leads to failures +#### in the checks (specifically i noticed kevent on bsd). so the whole +#### construct for this is wrong. it needs a rethink. i'm putting this +#### comment here as a note that this is the case for now as i'm just +#### trying to fix the meson build on freebsd for now + function_checks = [ # function name | headers that are needed | libraries to include | Defines that are needed ['alloca', ['alloca.h']], @@ -92,7 +104,6 @@ function_checks = [ #FIXME strlcpy is detected by meson but drops at compilation time # ['strlcpy', ['string.h']], ['siginfo_t', ['signal.h']], - ['strerror_r', ['string.h']], ['pthread_getcpuclockid', ['pthread.h', 'time.h']], ['timerfd_create', ['sys/timerfd.h']], ['kevent', ['sys/types.h', 'sys/event.h', 'sys/time.h']], @@ -190,10 +201,13 @@ if jpeg.found() == false jpeg = cc.find_library('jpeg') endif -if config_h.has('HAVE_KEVENT') +if sys_bsd == true config_h.set('HAVE_NOTIFY_KEVENT', '1') endif +if sys_osx == true + config_h.set('HAVE_NOTIFY_COCOA', '1') +endif config_h.set('SIZEOF_INT', cc.sizeof('int')) config_h.set('SIZEOF_LONG', cc.sizeof('long')) diff --git a/m4/efl.m4 b/m4/efl.m4 index d051155e56..a01c5b401c 100644 --- a/m4/efl.m4 +++ b/m4/efl.m4 @@ -424,7 +424,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_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}" 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/meson.build b/meson.build index 0e2a50c2c9..1ee603192a 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('efl', ['c','cpp'], - version: '1.21.99', - default_options : ['buildtype=plain', 'cpp_std=c++11'], + version: '1.22.99', + default_options : ['buildtype=release', 'cpp_std=c++11'], meson_version : '>=0.47' ) @@ -97,7 +97,6 @@ add_global_arguments(dev_cflags, language: 'cpp') foreach lang : ['c', 'objc', 'cpp'] add_global_arguments('-DHAVE_CONFIG_H=1', language: lang) add_global_arguments('-D_GNU_SOURCE=1', language: lang) - add_global_arguments('-DEFL_EO_API_SUPPORT=1', language: lang) add_global_arguments('-DEFL_BETA_API_SUPPORT=1', language: lang) add_global_arguments('-DNEED_RUN_IN_TREE=1', language: lang) add_global_arguments('-DEFL_BUILD=1', language: lang) @@ -121,6 +120,7 @@ foreach lang : ['c', 'objc', 'cpp'] else error('Version of targetted Windows incorrect') endif + add_global_arguments('-D__USE_MINGW_ANSI_STDIO', language: lang) endif endforeach @@ -210,6 +210,7 @@ elif sys_osx == true sys_lib_extension = 'dylib' sys_exe_extension = '' sys_mod_extension = 'dylib' + config_h.set('environ', '(*_NSGetEnviron())') else error('System '+host_machine.system()+' not known') endif @@ -241,6 +242,12 @@ endif ecore_evas_wayland_engine_include_dir = [] +boot_strap_eolian = [ + ['evil' ,[] , false, true, false, false, false, false, [], []], + ['eina' ,[] , false, true, false, false, false, false, [], []], + ['eolian' ,[] , false, true, true, false, false, false, ['eina'], []], +] + subprojects = [ # name | option | mod | lib | bin | bench | tests | examples | pkg-config options | name of static libs ['evil' ,[] , false, true, false, false, false, false, [], []], @@ -280,12 +287,12 @@ subprojects = [ ['efreet' ,[] , false, false, true, false, false, false, ['eina', 'efl', 'eo'], []], ['ecore_imf_evas' ,[] , false, true, false, false, false, false, ['eina', 'efl', 'eo'], []], ['ephysics' ,['physics'] , false, true, false, false, false, false, ['eina', 'efl', 'eo'], []], -['edje' ,[] , false, true, true, false, true, true, ['evas', 'eo', 'efl', 'luajit'], []], +['edje' ,[] , false, true, true, false, true, true, ['evas', 'eo', 'efl', get_option('lua-interpreter')], []], ['emotion' ,[] , true, true, false, false, true, true, ['eina', 'efl', 'eo'], []], ['ethumb' ,[] , true, true, true, false, false, false, ['eina', 'efl', 'eo'], []], ['ethumb_client' ,[] , false, true, true, false, false, true, ['eina', 'efl', 'eo', 'ethumb'], []], ['elocation' ,[] , false, true, false, false, false, false, ['ecore', 'eldbus'], []], -['elementary' ,[] , true, true, true, true, true, false, ['eina', 'efl', 'eo', 'eet', 'evas', 'ecore', 'ecore-evas', 'ecore-file', 'ecore-input', 'edje', 'ethumb-client', 'emotion', 'ecore-imf', 'ecore-con', 'eldbus', 'efreet', 'efreet-mime', 'efreet-trash', 'eio', 'elocation'], ['atspi']], +['elementary' ,[] , true, true, true, true, true, true, ['eina', 'efl', 'eo', 'eet', 'evas', 'ecore', 'ecore-evas', 'ecore-file', 'ecore-input', 'edje', 'ethumb-client', 'emotion', 'ecore-imf', 'ecore-con', 'eldbus', 'efreet', 'efreet-mime', 'efreet-trash', 'eio', 'elocation'], ['atspi']], ['efl_wl' ,['wl'] , false, true, true, false, false, false, ['evas', 'ecore'], []], ['elua' ,['elua'] , false, true, true, false, true, false, ['eina', 'luajit'], []], ['ecore_wayland' ,['wl-deprecated'] , false, true, false, false, false, false, ['eina'], []], @@ -303,6 +310,9 @@ test_dirs = [] example_dirs = [] tmp_empty = declare_dependency() +if get_option('eolian-bootstrap') + subprojects = boot_strap_eolian +endif foreach package : subprojects package_name = package[0] @@ -403,23 +413,26 @@ foreach package : subprojects endforeach -#build this later, as the debug services are depending on ecore -subdir(join_paths('src', 'bin', 'efl')) - -subdir(join_paths('src', 'generic', 'evas')) -subdir(join_paths('src', 'generic', 'emotion')) subdir('cmakeconfig') +#build this later, as the debug services are depending on ecore +if get_option('eolian-bootstrap') == false + subdir(join_paths('src', 'bin', 'efl')) -bindings = get_option('bindings') + subdir(join_paths('src', 'generic', 'evas')) + subdir(join_paths('src', 'generic', 'emotion')) -foreach binding : bindings - subdir(join_paths('src', 'bindings', binding)) -endforeach + bindings = get_option('bindings') + bindings_order = ['luajit', 'cxx', 'mono'] -subdir(join_paths('src', 'edje_external')) + foreach binding : bindings_order + if bindings.contains(binding) + subdir(join_paths('src', 'bindings', binding)) + endif + endforeach - -subdir(join_paths('data')) + subdir(join_paths('src', 'edje_external')) + subdir(join_paths('data')) +endif if get_option('build-tests') check = dependency('check') @@ -457,7 +470,6 @@ efl_config_h.set('EFL_VERSION_MICRO', version_micro) efl_config_h.set('EFL_BUILD_ID', get_option('build-id')) #FIXME placeholder -efl_config_h.set('EFL_API_EO_DEF', '#define EFL_API_EO_DEF "FIXME NOT IMPLEMENTED"') efl_config_h.set('EFL_API_LEGACY_DEF', '#define EFL_API_LEGACY_DEF "FIXME NOT IMPLEMENTED"') configure_file( diff --git a/meson/evas_loader_conf.sh b/meson/evas_loader_conf.sh index 4ff60c351b..5fd4259f8f 100755 --- a/meson/evas_loader_conf.sh +++ b/meson/evas_loader_conf.sh @@ -1,18 +1,22 @@ -#!/bin/bash +#!/bin/sh -original_loader=$1 -filename="$(basename $original_loader)" ext="${ext##*.}" -original_name="$(basename $original_loader .$ext)" -loader_dir="$(dirname $original_loader)" -loader="$(basename $original_loader)" -loader_name="$(echo $original_name | cut -f 1 -d '.')" +# skip trailing dot if any +case "$1" in + *.) original_loader=${1%?};; + *) original_loader=$1;; +esac +original_name="$(basename "$original_loader")" +loader_dir="$(dirname "$original_loader")" +loader="$(basename "$original_loader")" +loader_name="$(echo "$loader" | cut -f 1 -d '.')" -if [ ${original_loader: -3} == "$ext" ] - then +original_ext="$(echo "$loader" | tail -c 4)" +if test "$original_ext" = "$ext" ; then mv "$DESTDIR"/"$original_loader" "$DESTDIR"/"$loader_dir"/"$original_name" fi -for x in "${@:2}"; do +shift +for x in "$@"; do ln -sf "$original_name" "$DESTDIR"/"$loader_dir"/"$loader_name"."$x" done diff --git a/meson/meson_csharp_docs.sh b/meson/meson_csharp_docs.sh new file mode 100755 index 0000000000..4e6577a173 --- /dev/null +++ b/meson/meson_csharp_docs.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# Installer script needed to install documentation xml file +# as meson's library() call can't track files other than the generated +# efl_mono.dll + +cp $1 $2 diff --git a/meson_options.txt b/meson_options.txt index 651fbcc01e..0b6b0bb917 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -277,7 +277,7 @@ option('libmount', option('vnc-server', type : 'boolean', value : false, - description : 'use libmount support or not' + description : 'enable building a vnc-server for multiseat testing' ) option('v4l2', @@ -323,6 +323,19 @@ option('mono-beta', description: 'Flag for enabling @beta Eo methods in the api' ) +option('mono-examples-dir', + type: 'string', + value: '', + description: 'Directory where eolian_mono will search for examples to embed into the documentation' +) + +option('lua-interpreter', + type: 'combo', + choices: ['luajit', 'lua'], + value: 'luajit', + description: 'Select a type of lua interpreter to use it for edje and evas' +) + option('native-arch-optimization', type: 'boolean', value: true, @@ -353,3 +366,15 @@ option('elementary-base-dir', value : '.elementary', description : 'Put the name of a base directory for elementary data' ) + +option('eolian-bootstrap', + type : 'boolean', + value : false, + description : 'Only build efl up to eolian_gen and install eina libeolian and eolian_gen, usefull for cross compiles' +) + +option('install-eo-files', + type: 'boolean', + value: false, + description : 'Set this to false to not install any eo file' +) diff --git a/pc/efl-net.pc.in b/pc/efl-net.pc.in index b68328c213..176d8cf470 100644 --- a/pc/efl-net.pc.in +++ b/pc/efl-net.pc.in @@ -2,6 +2,8 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ +datarootdir=@datarootdir@ +datadir=@datadir@ eoincludedir=@datadir@/eolian/include eolian_flags=-I${pc_sysrootdir}${eoincludedir}/ecore-con-@VMAJ@ -I${pc_sysrootdir}${eoincludedir}/ecore-@VMAJ@ -I${pc_sysrootdir}${eoincludedir}/efl-@VMAJ@ -I${pc_sysrootdir}${eoincludedir}/eo-@VMAJ@ -I${pc_sysrootdir}${eoincludedir}/eet-@VMAJ@ -I${pc_sysrootdir}${eoincludedir}/emile-@VMAJ@ -I${pc_sysrootdir}${eoincludedir}/eina-@VMAJ@ diff --git a/po/ca.po b/po/ca.po index ede2ab544a..d74907342f 100644 --- a/po/ca.po +++ b/po/ca.po @@ -4,12 +4,12 @@ # Marc Furtià i Puig , 2013. # Joan Coll , 2013. # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: Elementary\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2015-02-10 09:34+0000\n" "Last-Translator: JoanColl \n" "Language-Team: Catalan\n" @@ -240,37 +240,37 @@ msgstr "Imatges" msgid "Videos" msgstr "Vídeos" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Amunt" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Carpeta personal" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "Cerca" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "Accepta" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Cancel·la" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "Estat: desactivat" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -305,15 +305,15 @@ msgstr "Enrere" msgid "Next" msgstr "Següent" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "Títol finestra emergent" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "Text de la finestra emergent" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -374,21 +374,21 @@ msgstr "mes del calendari" msgid "calendar year" msgstr "any del calendari" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "Estat: desactivat" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Estat" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "Comprova" @@ -438,7 +438,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -450,23 +450,23 @@ msgstr "selector de dia" msgid "diskselector item" msgstr "selector de disc" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Retalla" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Copia" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Enganxa" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Selecciona" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Entrada" @@ -510,20 +510,20 @@ msgstr "barra de progrés" msgid "Radio" msgstr "Opció" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "Estat: Seleccionat" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "Estat: No seleccionat" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "Element de control del segment" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "control lliscant" @@ -551,23 +551,23 @@ msgstr "botó de decrement del spinner" msgid "spinner text" msgstr "text rotatiu" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Seleccionat" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Separador" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "Té menú" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "No seleccionat" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "Element de barra d'eines" diff --git a/po/cs.po b/po/cs.po index fac0a1efb4..d84b91170d 100644 --- a/po/cs.po +++ b/po/cs.po @@ -5,12 +5,12 @@ # quaker66@gmail.com # Vít Pelčák , 2011. # Tomáš Čech , 2012. -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2014-05-22 22:44+0200\n" "Last-Translator: Tomáš Čech \n" "Language-Team: Czech \n" @@ -243,37 +243,37 @@ msgstr "Obrázky" msgid "Videos" msgstr "Videa" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Nahoru" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Domů" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "OK" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Zrušit" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "Stav: Zakázáno" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -308,15 +308,15 @@ msgstr "Zpět" msgid "Next" msgstr "Další" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "Titulek vyskakujícího okna" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "Text vyskakovacího okna" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -377,21 +377,21 @@ msgstr "kalendářní měsíc" msgid "calendar year" msgstr "kalendářní rok" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "Stav: Vypnuto" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Stav" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "Ověřit" @@ -441,7 +441,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -453,23 +453,23 @@ msgstr "položka výběru dne" msgid "diskselector item" msgstr "položka výběru disků" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Vyjmout" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Kopírovat" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Vložit" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Vybrat" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Vstup" @@ -513,20 +513,20 @@ msgstr "ukazatel průběhu" msgid "Radio" msgstr "Přepínač" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "Stav: Vybráno" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "Stav: Nevybráno" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "položka ovládání segmentu" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "šoupátko" @@ -555,23 +555,23 @@ msgstr "odečítací tlačítko spinneru" msgid "spinner text" msgstr "spinner" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Vybrané" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Oddělovač" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "Má nabídku" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Nevybrané" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "Položka panelu nástrojů" diff --git a/po/da.po b/po/da.po index 8635367bd3..25bbc265b3 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-2018. -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: efl 1.21\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2018-08-09 18:38+0200\n" "Last-Translator: scootergrisen\n" "Language-Team: Danish\n" @@ -237,37 +237,37 @@ msgstr "Billeder" msgid "Videos" msgstr "Videoer" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Op" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Hjem" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "Søg" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "OK" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Annuller" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "Tilstand: Deaktiveret" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "Svævemarkering" @@ -301,15 +301,15 @@ msgstr "Tilbage" msgid "Next" msgstr "Næste" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "Titel til pop op" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "Brødtekst til pop op" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "Besked" @@ -370,21 +370,21 @@ msgstr "kalender måned" msgid "calendar year" msgstr "kalender år" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "Tilstand: Fra" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Tilstand" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "Tilvælg" @@ -434,7 +434,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -446,23 +446,23 @@ msgstr "dagvælger-element" msgid "diskselector item" msgstr "diskvælger-element" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Klip" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Kopiér" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Indsæt" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Vælg" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Indtastning" @@ -506,20 +506,20 @@ msgstr "forløbslinje" msgid "Radio" msgstr "Radio" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "Tilstand: Valgt" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "Tilstand: Fravalgt" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "Segmentkontrol-element" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "skyder" @@ -547,23 +547,23 @@ msgstr "formindsk-knap til ruller" msgid "spinner text" msgstr "rullertekst" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Valgt" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Separator" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "Har menu" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Fravalgt" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "Værktøjslinje-element" diff --git a/po/de.po b/po/de.po index d195ca8eba..9a21732685 100644 --- a/po/de.po +++ b/po/de.po @@ -4,12 +4,12 @@ # Chris Leick , 2009. # Fabian Nowak , 2010. # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: elementary 0.7.0.57309\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2011-02-25 20:22+0100\n" "Last-Translator: Fabian Nowak \n" "Language-Team: German\n" @@ -241,37 +241,37 @@ msgstr "" msgid "Videos" msgstr "" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Aufwärts" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Persönlicher Ordner" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "OK" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Abbrechen" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -305,15 +305,15 @@ msgstr "" msgid "Next" msgstr "" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -374,21 +374,21 @@ msgstr "" msgid "calendar year" msgstr "" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "" @@ -438,7 +438,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -450,23 +450,23 @@ msgstr "" msgid "diskselector item" msgstr "" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Ausschneiden" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Kopieren" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Einfügen" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Auswählen" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "" @@ -510,21 +510,21 @@ msgstr "" msgid "Radio" msgstr "" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 #, fuzzy msgid "State: Unselected" msgstr "Auswählen" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "" @@ -552,24 +552,24 @@ msgstr "" msgid "spinner text" msgstr "" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 #, fuzzy msgid "Selected" msgstr "Auswählen" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 #, fuzzy msgid "Unselected" msgstr "Auswählen" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "" diff --git a/po/el.po b/po/el.po index 315427a190..d70548b9d6 100644 --- a/po/el.po +++ b/po/el.po @@ -6,12 +6,12 @@ # Alex-P. Natsios 2012 # Efstathios Iosifidis , 2012. # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: elementary\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2012-12-19 15:58+0200\n" "Last-Translator: Efstathios Iosifidis \n" "Language-Team: Ελληνικά, Σύγχρονα \n" @@ -244,37 +244,37 @@ msgstr "Εικόνες" msgid "Videos" msgstr "Βίντεο" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Πάνω" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Αρχική" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "Εντάξει" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Άκυρο" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "Κατάσταση: Απενεργοποιημένο" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -308,15 +308,15 @@ msgstr "" msgid "Next" msgstr "" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -383,21 +383,21 @@ msgstr "Μηνας Ημερολογίου" msgid "calendar year" msgstr "αντικείμενο ημερολογίου" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "Κατάσταση: Ανενεργό" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Κατάσταση" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "Επιλογή" @@ -449,7 +449,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -462,23 +462,23 @@ msgstr "επιλογή δίσκου" msgid "diskselector item" msgstr "επιλογή δίσκου" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Αποκοπή" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Αντιγραφή" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Επικόλληση" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Επιλογή" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Καταχώριση" @@ -522,21 +522,21 @@ msgstr "Μπάρα Προόδου" msgid "Radio" msgstr "Επιλογή" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "Κατάσταση: Επιλεγμένο" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 #, fuzzy msgid "State: Unselected" msgstr "Κατάσταση: Επιλεγμένο" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "μπάρα κύλισης" @@ -568,23 +568,23 @@ msgstr "κουμπί spinner προηγούμενο" msgid "spinner text" msgstr "spinner" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Επιλεγμένο" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Διαχωριστικό" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "Έχει μενού" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Μη Επιλεγμένο" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "Αντικείμενο μπάρας εργαλείων" diff --git a/po/eo.po b/po/eo.po index a04210d81d..6f19cab7bd 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 , 2012. # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: enlightenment\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2013-11-05 18:59+0000\n" "Last-Translator: Eliovir \n" "Language-Team: Esperanto \n" @@ -239,37 +239,37 @@ msgstr "Bildujo" msgid "Videos" msgstr "Videujo" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Supren" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Hejmo" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "Bone" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Nuligi" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "Stato: malŝaltita" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -304,15 +304,15 @@ msgstr "Reen" msgid "Next" msgstr "Antaŭen" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "Titolo de spruĉfenestro" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "Enhava teksto de spruĉfenestro" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -373,21 +373,21 @@ msgstr "monato de kalendaro" msgid "calendar year" msgstr "jara kalendaro" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "Stato: malŝaltita" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Stato" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "Kontroli" @@ -437,7 +437,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -449,23 +449,23 @@ msgstr "" msgid "diskselector item" msgstr "ero de diskelektilo" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Eltondi" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Kopii" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Alglui" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Elekti" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Ero" @@ -509,20 +509,20 @@ msgstr "progresbreto" msgid "Radio" msgstr "Radiobutono" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "Stato: elektita" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "Stato: ne elektita" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "ŝovilo" @@ -551,23 +551,23 @@ msgstr "dekrementa sago-butono" msgid "spinner text" msgstr "sago-butono" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Elektita" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Disigilo" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "Ĝi havas menuo" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Malelektita" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "Ilobretero" diff --git a/po/es.po b/po/es.po index 652b0618b2..4c913ce6c4 100644 --- a/po/es.po +++ b/po/es.po @@ -4,12 +4,12 @@ # Aníbal Garrido , 2012. # Adrián Arévalo , 2015. # Roy W. Reese 2015. -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: elementary\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2015-05-03 18:19+0100\n" "Last-Translator: Adrián Arévalo \n" "Language-Team: Enlightenment Team\n" @@ -239,37 +239,37 @@ msgstr "Imágenes" msgid "Videos" msgstr "Vídeos" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Arriba" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Carpeta personal" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "Buscar" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "Aceptar" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Cancelar" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "Estado: Desactivado" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -304,17 +304,17 @@ msgstr "Atrás" msgid "Next" msgstr "Siguiente" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 #, fuzzy msgid "Popup Title" msgstr "Nombre emergente" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 #, fuzzy msgid "Popup Body Text" msgstr "Texto emergente" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -377,21 +377,21 @@ 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:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "Estado: Desconectado" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Estado" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "Comprobar" @@ -442,7 +442,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -454,23 +454,23 @@ msgstr "Selector de día" msgid "diskselector item" msgstr "Selector de disco" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Cortar" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Copiar" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Pegar" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Seleccionar" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Entrada" @@ -514,20 +514,20 @@ msgstr "barra de progreso" msgid "Radio" msgstr "Radio" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "Estado: Seleccionado" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "Estado: No seleccionado" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "Elemento del control del segmento" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "deslizador" @@ -556,23 +556,23 @@ msgstr "botón de decremento del spinner" msgid "spinner text" msgstr "spinner" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Seleccionado" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Separador" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "Tiene menú" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Sin seleccionar" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "Elemento de la barra de herramientas" diff --git a/po/fi.po b/po/fi.po index e2f87954c8..950af55d7c 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 , 2014. # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: enlightenment\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2014-08-31 15:13+0000\n" "Last-Translator: Kai Huuhko \n" "Language-Team: Finnish \n" @@ -239,37 +239,37 @@ msgstr "Kuvat" msgid "Videos" msgstr "Videot" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Ylös" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Koti" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "OK" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Peruuta" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "Tila: Pois käytöstä" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -304,15 +304,15 @@ msgstr "Takaisin" msgid "Next" msgstr "Seuraava" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "Ponnahdusikkunan otsikko" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "Ponnahdusikkunan leipäteksti" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -373,21 +373,21 @@ msgstr "kalenterikuukausi" msgid "calendar year" msgstr "kalenterivuosi" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "Tila: pois päältä" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Tila" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "Valinta" @@ -437,7 +437,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -449,23 +449,23 @@ msgstr "päivyrin kohta" msgid "diskselector item" msgstr "kiekkovalitsimen kohta" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Leikkaa" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Kopioi" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Liitä" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Valitse" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Syöttökenttä" @@ -509,20 +509,20 @@ msgstr "Tilanneilmaisin" msgid "Radio" msgstr "Vaihtoehto" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "Tila: valittu" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "Tila: valitsematon" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "liukusäädin" @@ -551,23 +551,23 @@ msgstr "Pyörövalitsimen vähennä-nappi" msgid "spinner text" msgstr "pyörövalitsin" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Valittu" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Erotin" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "Valikollinen" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Valitsematon" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "Työkalupalkin kohta" diff --git a/po/fr.po b/po/fr.po index a41c2f990b..2c9b3b7ade 100644 --- a/po/fr.po +++ b/po/fr.po @@ -6,12 +6,12 @@ # Jerome Pinot , 2012. # Chidambar Zinnoury , 2013. # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: Elementary\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2014-05-25 20:18+0000\n" "Last-Translator: Eliovir \n" "Language-Team: French \n" @@ -245,37 +245,37 @@ msgstr "Images" msgid "Videos" msgstr "Vidéos" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Monter" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Home" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "OK" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Annuler" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "État : désactivé" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -310,15 +310,15 @@ msgstr "Retour" msgid "Next" msgstr "Suivant" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "Titre du Popup" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "Corps du texte du Popup" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -379,21 +379,21 @@ msgstr "Mois du calendrier" msgid "calendar year" msgstr "Année du calendrier" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "État : désactivé" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "État" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "À cocher" @@ -443,7 +443,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -455,23 +455,23 @@ msgstr "élement de choix de date" msgid "diskselector item" msgstr "élément de choix de disque" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Couper" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Copier" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Coller" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Sélectionner" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Entrée" @@ -515,20 +515,20 @@ msgstr "barre de progression" msgid "Radio" msgstr "Radio" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "État : sélectionné" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "État : désélectionné" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "Élément de contrôle de segment" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "curseur" @@ -557,22 +557,22 @@ msgstr "bouton fléché de décrémentation" msgid "spinner text" msgstr "bouton fléché" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Sélectionné" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Séparateur" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "Possède un menu" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Désélectionné" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "Élément de barre d'outils" diff --git a/po/gl.po b/po/gl.po index 3ef2282a91..da1df63d5a 100644 --- a/po/gl.po +++ b/po/gl.po @@ -2,12 +2,12 @@ # This file is put in the public domain. # Aníbal Garrido , 2012. # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: elementary\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2014-05-24 08:39+0000\n" "Last-Translator: Kaptan \n" "Language-Team: Galician \n" @@ -238,37 +238,37 @@ msgstr "Imaxes" msgid "Videos" msgstr "Vídeos" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Arriba" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Cartafol persoal" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "Aceptar" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Cancelar" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "Estado: Desactivado" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -303,15 +303,15 @@ msgstr "Atrás" msgid "Next" msgstr "Seguinte" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "Título da emerxente" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "Corpo de texto emerxente" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -372,21 +372,21 @@ msgstr "mes do calendario" msgid "calendar year" msgstr "ano do calendario" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "Estado: Desconectado" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Estado" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "Comprobar" @@ -436,7 +436,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -448,23 +448,23 @@ msgstr "selector de día" msgid "diskselector item" msgstr "Selector de disco" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Cortar" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Copiar" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Pegar" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Seleccionar" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Entrada" @@ -508,20 +508,20 @@ msgstr "barra de progreso" msgid "Radio" msgstr "Radio" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "Estado: Seleccionado" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "Estado: Sen seleccionar" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "Segmento de control" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "Barra de desprazamento" @@ -550,23 +550,23 @@ msgstr "botón de disminución" msgid "spinner text" msgstr "botón de spinner" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Seleccionado" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Separador" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "Ten menú" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Non seleccionado" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "Elemento da barra de ferramentas" diff --git a/po/hu.po b/po/hu.po index bde809fc70..adcd4a1649 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 , YEAR. # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: elementary 1.8.2\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2014-01-29 15:27+0100\n" "Last-Translator: rezso \n" "Language-Team: General\n" @@ -240,37 +240,37 @@ msgstr "Képek" msgid "Videos" msgstr "Videók" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Fel" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Kezdőlap" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "OK" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Mégsem" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "Állapot: letiltva" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -305,15 +305,15 @@ msgstr "Vissza" msgid "Next" msgstr "Következő" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "Popup címsora" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "Popup szövege" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -374,21 +374,21 @@ msgstr "naptár hónapja" msgid "calendar year" msgstr "naptár éve" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "Állapot: ki" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Állapot" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "Ellenőrzés" @@ -438,7 +438,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -450,23 +450,23 @@ msgstr "" msgid "diskselector item" msgstr "" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Kivágás" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Másolás" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Beillesztés" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Kiválaszt" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Bejegyzés" @@ -510,20 +510,20 @@ msgstr "folyamatjelző" msgid "Radio" msgstr "Rádió" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "Állapot: kijelölve" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "Állapot: nincs kijelölve" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "csúszka" @@ -551,22 +551,22 @@ msgstr "" msgid "spinner text" msgstr "" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Kiválasztva" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Elválasztó" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Nincs kijelölve" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "Eszköztár elem" diff --git a/po/it.po b/po/it.po index 207003c220..f861007734 100644 --- a/po/it.po +++ b/po/it.po @@ -3,12 +3,12 @@ # This file is put in the public domain. # Massimo Maiurana , 2013 # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: Elementary\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2018-04-01 19:01+0200\n" "Last-Translator: Massimo Maiurana \n" "Language-Team: General\n" @@ -238,37 +238,37 @@ msgstr "Immagini" msgid "Videos" msgstr "Video" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Su" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Home" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "Cerca" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "OK" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Annulla" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "Stato: disabilitato" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "Lista per bottone (hoversel)" @@ -302,15 +302,15 @@ msgstr "Indietro" msgid "Next" msgstr "Avanti" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "Titolo popup" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "Testo corpo popup" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "Allarme" @@ -371,21 +371,21 @@ msgstr "mese del calendario" msgid "calendar year" msgstr "anno del calendario" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "Stato: inattivo" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Stato" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "Controllo" @@ -435,7 +435,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -447,23 +447,23 @@ msgstr "oggetto selettore giorno" msgid "diskselector item" msgstr "selettore disco" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Taglia" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Copia" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Incolla" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Seleziona" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Voce" @@ -507,20 +507,20 @@ msgstr "barra avanzamento" msgid "Radio" msgstr "Opzione" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "Stato: selezionato" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "Stato: non selezionato" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "Oggetto controllo segmento" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "cursore" @@ -548,23 +548,23 @@ msgstr "bottone diminuzione spinner" msgid "spinner text" msgstr "testo spinner" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Selezionato" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Separatore" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "Include menù" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Non selezionato" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "Oggetto della barra strumenti" diff --git a/po/ja.po b/po/ja.po index 2bc55ffc0d..87e3e040b3 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:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: Efl\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2012-06-24 17:10+0900\n" "Last-Translator: Daichi Fukui\n" "Language-Team: Enlightenment Team\n" @@ -238,37 +238,37 @@ msgstr "Pictures" msgid "Videos" msgstr "Videos" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -302,15 +302,15 @@ msgstr "" msgid "Next" msgstr "" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -371,21 +371,21 @@ msgstr "" msgid "calendar year" msgstr "" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "" @@ -435,7 +435,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 #, fuzzy msgid "default:LTR" msgstr "default:LTR" @@ -448,23 +448,23 @@ msgstr "" msgid "diskselector item" msgstr "" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "" @@ -508,20 +508,20 @@ msgstr "" msgid "Radio" msgstr "" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "" @@ -549,22 +549,22 @@ msgstr "" msgid "spinner text" msgstr "" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "" diff --git a/po/ko.po b/po/ko.po index 0146bac6a7..027a3c5665 100644 --- a/po/ko.po +++ b/po/ko.po @@ -5,12 +5,12 @@ # Daniel Juyung Seo , 2011-2013 # Seong-ho Cho , 2012-2013 # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: Efl\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2014-11-10 01:01+0900\n" "Last-Translator: Daniel Juyung Seo \n" "Language-Team: Enlightenment Team\n" @@ -242,37 +242,37 @@ msgstr "사진" msgid "Videos" msgstr "영상" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -306,15 +306,15 @@ msgstr "" msgid "Next" msgstr "" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -375,21 +375,21 @@ msgstr "" msgid "calendar year" msgstr "" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "" @@ -439,7 +439,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 #, fuzzy msgid "default:LTR" msgstr "default:LTR" @@ -452,23 +452,23 @@ msgstr "" msgid "diskselector item" msgstr "" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "" @@ -512,20 +512,20 @@ msgstr "" msgid "Radio" msgstr "" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "" @@ -553,22 +553,22 @@ msgstr "" msgid "spinner text" msgstr "" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "" diff --git a/po/lt.po b/po/lt.po index 676baf9d97..7eb730f400 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 , 2010. # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: enlightenment\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2014-02-21 22:38+0000\n" "Last-Translator: Mantas Kriaučiūnas \n" "Language-Team: Lithuanian \n" @@ -239,37 +239,37 @@ msgstr "Paveikslėliai" msgid "Videos" msgstr "Video" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "Gerai" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Atsisakyti" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -303,15 +303,15 @@ msgstr "Atgal" msgid "Next" msgstr "" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -372,21 +372,21 @@ msgstr "" msgid "calendar year" msgstr "" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Būsena" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "" @@ -436,7 +436,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -448,23 +448,23 @@ msgstr "" msgid "diskselector item" msgstr "" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Iškirpti" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Kopijuoti" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Įdėti" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Pasirinkti" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "" @@ -508,20 +508,20 @@ msgstr "" msgid "Radio" msgstr "" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "šliaužiklis" @@ -549,22 +549,22 @@ msgstr "" msgid "spinner text" msgstr "" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Skirtukas" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "Turi meniu" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Nepasirinkta(s)" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "" diff --git a/po/meson.build b/po/meson.build index 68a4885e41..5135bb66b9 100644 --- a/po/meson.build +++ b/po/meson.build @@ -14,7 +14,7 @@ if get_option('nls') config_h.set('HAVE_GETTEXT', '1') config_h.set('ENABLE_NLS', '1') intl = cc.find_library('intl', required : false) - if cc.has_header('libintl.h', dependencies : intl) == false + if cc.compiles('#include ', dependencies : intl) == false error('libintl.h not found') endif else diff --git a/po/nl.po b/po/nl.po index e0b283aaf4..75e00ad89f 100644 --- a/po/nl.po +++ b/po/nl.po @@ -3,12 +3,12 @@ # This file is put in the public domain. # Fabian Nowak , 2011. # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: elementary 0.7.0.57309\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2011-06-19 16:41+0100\n" "Last-Translator: Heimen Stoffels \n" "Language-Team: Dutch \n" @@ -242,37 +242,37 @@ msgstr "" msgid "Videos" msgstr "" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Omhoog" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Persoonlijke map" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "OK" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Annuleren" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -306,15 +306,15 @@ msgstr "" msgid "Next" msgstr "" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -375,21 +375,21 @@ msgstr "" msgid "calendar year" msgstr "" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "" @@ -439,7 +439,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -451,23 +451,23 @@ msgstr "" msgid "diskselector item" msgstr "" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Knippen" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Kopiëren" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Plakken" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Selecteren" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "" @@ -511,21 +511,21 @@ msgstr "" msgid "Radio" msgstr "" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 #, fuzzy msgid "State: Unselected" msgstr "Selecteren" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "" @@ -553,24 +553,24 @@ msgstr "" msgid "spinner text" msgstr "" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 #, fuzzy msgid "Selected" msgstr "Selecteren" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 #, fuzzy msgid "Unselected" msgstr "Selecteren" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "" diff --git a/po/pl.po b/po/pl.po index 3f8384899a..1cacce7e14 100644 --- a/po/pl.po +++ b/po/pl.po @@ -3,12 +3,12 @@ # This file is put in the public domain. # Konrad Makowski , 2013 # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: elementary\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2013-11-23 14:48+0100\n" "Last-Translator: Konrad Makowski \n" "Language-Team: General\n" @@ -241,37 +241,37 @@ msgstr "Obrazy" msgid "Videos" msgstr "Wideo" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Do góry" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Początek" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "OK" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Anuluj" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "Statuj: wyłączony" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -306,15 +306,15 @@ msgstr "Cofnij" msgid "Next" msgstr "Następny" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "Tytuł okienka" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "Treść główna okienka" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -375,21 +375,21 @@ msgstr "kalendarz z miesiącami" msgid "calendar year" msgstr "kalendarz roczny" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "Stan: wyłączony" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Stan" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "Sprawdzony" @@ -439,7 +439,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -451,23 +451,23 @@ msgstr "wybór dni" msgid "diskselector item" msgstr "wybór dysków" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Wytnij" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Kopiuj" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Wklej" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Wybór" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Pozycja" @@ -511,20 +511,20 @@ msgstr "pasek postępu" msgid "Radio" msgstr "" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "Stan: wybrany" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "Stan: nie wybrany" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "Kontrola Segmentami" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "slajder" @@ -553,22 +553,22 @@ msgstr "przycisk zmniejszający typu spinner" msgid "spinner text" msgstr "spinner" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Wybrany" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Separator" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "Posiada menu" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Nie wybrany" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "Pasek narzędzi" diff --git a/po/pt.po b/po/pt.po index 3cacb45927..57711831a9 100644 --- a/po/pt.po +++ b/po/pt.po @@ -3,12 +3,12 @@ # This file is public domain. # Sérgio Marques , 2010-2014 # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: Elementary\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2013-11-05 14:11-0000\n" "Last-Translator: Sérgio Marques \n" "Language-Team: General\n" @@ -239,37 +239,37 @@ msgstr "Imagens" msgid "Videos" msgstr "Vídeos" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Para cima" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Pasta pessoal" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "Aceitar" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Cancelar" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "Estado: inativo" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -304,15 +304,15 @@ msgstr "Recuar" msgid "Next" msgstr "Avançar" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "Título do alerta" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "Texto do alerta" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -373,21 +373,21 @@ msgstr "mês do calendário" msgid "calendar year" msgstr "ano do calendário" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "Estado: desligado" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Estado" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "Seleção" @@ -437,7 +437,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -449,23 +449,23 @@ msgstr "item do seletor de dia" msgid "diskselector item" msgstr "item do seletor de disco" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Cortar" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Copiar" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Colar" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Selecionar" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Entrada" @@ -509,20 +509,20 @@ msgstr "barra de progresso" msgid "Radio" msgstr "Opção" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "Estado: selecionado" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "Estado: não selecionado" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "Item do controlo de segmento" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "barra deslizante" @@ -551,23 +551,23 @@ msgstr "botão de diminuição do spinner" msgid "spinner text" msgstr "spinner" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Selecionado" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Separador" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "Tem menu" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Não selecionado" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "Item da barra de ferramentas" diff --git a/po/ru.po b/po/ru.po index 2ffd124c7f..e2de39c7f1 100644 --- a/po/ru.po +++ b/po/ru.po @@ -4,12 +4,12 @@ # Danny Moshnakov , 2012. # Igor Murzov , 2015. # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: elementary 1.11\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2015-02-07 15:16+0300\n" "Last-Translator: Игорь Мурзов \n" "Language-Team: ru \n" @@ -240,37 +240,37 @@ msgstr "Изображения" msgid "Videos" msgstr "Видео" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Вверх" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Дом" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "Поиск" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "ОК" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Отмена" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "Состояние: Отключено" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -305,15 +305,15 @@ msgstr "Назад" msgid "Next" msgstr "Вперёд" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "Заголовок всплывающего окна" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "Текст всплывающего окна" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -374,21 +374,21 @@ msgstr "месяц календаря" msgid "calendar year" msgstr "год календаря" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "Состояние: Выключено" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Состояние" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "Флажок" @@ -438,7 +438,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -450,23 +450,23 @@ msgstr "элемент выбора дня" msgid "diskselector item" msgstr "элемент диска выбора" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Вырезать" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Копировать" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Вставить" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Выбрать" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Запись" @@ -510,20 +510,20 @@ msgstr "индикатор выполнения" msgid "Radio" msgstr "Радио флажок" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "Состояние: Выбрано" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "Состояние: Невыбрано" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "Элемент сегментного элемента управления" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "бегунок" @@ -552,23 +552,23 @@ msgstr "кнопка уменьшения счётчика" msgid "spinner text" msgstr "счётчик" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Выбрано" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Разделитель" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "С меню" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Невыбрано" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "Элемент панели инструментов" diff --git a/po/sl.po b/po/sl.po index 997d0f3ab1..cd379dcaf0 100644 --- a/po/sl.po +++ b/po/sl.po @@ -3,12 +3,12 @@ # This file is put in the public domain. # r1to , 2011. # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: Efl\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2016-09-21 17:00+0200\n" "Last-Translator: Renato Rener \n" "Language-Team: Enlightenment Team\n" @@ -238,37 +238,37 @@ msgstr "Slike" msgid "Videos" msgstr "Videi" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Gor" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Dom" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "Poišči" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "V redu" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Prekliči" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "Stanje: onemogočeno" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -303,15 +303,15 @@ msgstr "Nazaj" msgid "Next" msgstr "Naslednje" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "Naslov pojavnika" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "Besedilo telesa pojavnika" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -372,21 +372,21 @@ msgstr "mesečni koledar" msgid "calendar year" msgstr "letni koledar" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "Stanje: Izključeno" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Stanje" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "Preveri" @@ -436,7 +436,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -448,23 +448,23 @@ msgstr "izbirnik dneva" msgid "diskselector item" msgstr "izbirnik diska" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Izreži" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Kopiraj" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Prilepi" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Izberi" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Vnos" @@ -508,20 +508,20 @@ msgstr "vrstica poteka" msgid "Radio" msgstr "Radio" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "Stanje: Izbrano" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "Stanje: Neizbrano" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "Nadzornik segmenta" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "drsnik" @@ -549,23 +549,23 @@ msgstr "gumb za zniževanje vrtilnika" msgid "spinner text" msgstr "besedilo vrtilnika" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Izbrano" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Ločilnik" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "Ima meni" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Neizbrano" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "Predmet orodne vrstice" diff --git a/po/sr.po b/po/sr.po index 079ded283c..3f9e78f084 100644 --- a/po/sr.po +++ b/po/sr.po @@ -4,12 +4,12 @@ # FIRST AUTHOR , 2013. # Саша Петровић , 2013, 2015. # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: а\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2015-01-31 14:06+0100\n" "Last-Translator: Саша Петровић \n" "Language-Team: српски \n" @@ -242,37 +242,37 @@ msgstr "Слике" msgid "Videos" msgstr "Видео снимци" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Горе" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Лична фасцикла" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "Тражи" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "У реду" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Откажи" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "Стање: онемогућено" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -307,15 +307,15 @@ msgstr "Назад" msgid "Next" msgstr "Следеће" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "Искачући наслов" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "Тело искачућег текста" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -376,21 +376,21 @@ msgstr "месец календара" msgid "calendar year" msgstr "година календара" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "Стање: искључен" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Стање" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "Провера" @@ -440,7 +440,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -452,23 +452,23 @@ msgstr "ставка одабирач дана" msgid "diskselector item" msgstr "ставка одабира диска" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Исеци" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Умножи" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Прилепи" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Изаберите" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Улаз" @@ -512,20 +512,20 @@ msgstr "трака напретка" msgid "Radio" msgstr "Искључујуће дугме" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "Стање: означено" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "Стање: неозначено" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "Ставка провере дела" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "клизач" @@ -554,23 +554,23 @@ msgstr "стрелица избирача смањења" msgid "spinner text" msgstr "избирач са стрелицама" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Изабрано" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Одвајач" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "Има изборник" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Неозначено" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "Ставка траке алата" diff --git a/po/tr.po b/po/tr.po index a0cc346027..362df2c208 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 , 2010. # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: enlightenment\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2014-04-18 13:35+0000\n" "Last-Translator: Ali E.İMREK \n" "Language-Team: Turkish \n" @@ -239,37 +239,37 @@ msgstr "Resimler" msgid "Videos" msgstr "Videolar" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Yukarı" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Ev" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "Tamam" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "İptal" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "Durum: Kapalı" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -304,15 +304,15 @@ msgstr "Geri" msgid "Next" msgstr "Sonraki" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "Pencere başlığı" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "Pencere gövde metni" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -373,21 +373,21 @@ msgstr "takvim ayı" msgid "calendar year" msgstr "takvim yılı" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "Durum: Kapalı" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Durum" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "Kontrol et" @@ -437,7 +437,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -449,23 +449,23 @@ msgstr "gün seçici ögesi" msgid "diskselector item" msgstr "disk seçici öğesi" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Kes" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Kopyala" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Yapıştır" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Seç" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Girdi" @@ -509,20 +509,20 @@ msgstr "ilerleme çubuğu" msgid "Radio" msgstr "Radyo" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "Durum: Seçili" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "Bölge: Seçilmedi" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "Bölüm Kontrol Öğesi" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "kaydırıcı" @@ -551,23 +551,23 @@ msgstr "değiştirici azaltma düğmesi" msgid "spinner text" msgstr "değiştirici" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Seçili" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Ayraç" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "menü" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Seçili değil" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "Araç Çubuğu Öğesi" diff --git a/po/vi.po b/po/vi.po index a741f5d663..8660a5ac09 100644 --- a/po/vi.po +++ b/po/vi.po @@ -3,12 +3,12 @@ # This file is put in the public domain. # Thiep Ha , 2015. # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: elementary\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2015-09-29 18:06+0900\n" "Last-Translator: Thiep Ha \n" "Language-Team: General\n" @@ -240,37 +240,37 @@ msgstr "Hình Ảnh" msgid "Videos" msgstr "Video" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "Trên" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "Trang Chủ" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "Tìm Kiếm" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "Đồng Ý" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "Hủy" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "Trạng Thái: Không Khả Dụng" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -305,15 +305,15 @@ msgstr "Quay Lại" msgid "Next" msgstr "Tiếp" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "Tiêu Đề Hộp Thoại" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "Văn Bản Thân Hộp Thoại" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -374,21 +374,21 @@ msgstr "Lịch Tháng" msgid "calendar year" msgstr "Lịch Năm" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: 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:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "Trạng Thái" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "Chọn" @@ -438,7 +438,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -450,23 +450,23 @@ 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:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "Cắt" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "Sao Chép" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "Dán" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "Chọn" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "Bộ Nhập" @@ -510,20 +510,20 @@ msgstr "Thanh Trạng Thái" msgid "Radio" msgstr "Đài" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "Trạng Thái: Đã Chọn" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 msgid "State: Unselected" msgstr "Trạng Thái: Chưa Chọn" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "Mục Điều Khiển Đoạn" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "Thanh Trượt" @@ -551,23 +551,23 @@ msgstr "Nút Giảm Bộ Xoay" msgid "spinner text" msgstr "Văn Bản Bộ Xoay" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "Đã Chọn" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "Bộ Tách" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "Có Bảng Chọn" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "Không Chọn" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 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 f18f93f2c0..a7c568a692 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 , 2012. # -#: src/lib/elementary/elm_config.c:4306 +#: src/lib/elementary/elm_config.c:4135 msgid "" msgstr "" "Project-Id-Version: elementary\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-12-06 14:49+0000\n" +"POT-Creation-Date: 2019-04-15 12:03+0100\n" "PO-Revision-Date: 2012-12-22 03:55+0800\n" "Last-Translator: Aron Xu \n" "Language-Team: Chinese (simplified)\n" @@ -240,37 +240,37 @@ msgstr "图片" msgid "Videos" msgstr "视频" -#: src/lib/elementary/elc_fileselector.c:1799 +#: src/lib/elementary/elc_fileselector.c:1705 msgid "Up" msgstr "向上" -#: src/lib/elementary/elc_fileselector.c:1813 +#: src/lib/elementary/elc_fileselector.c:1719 msgid "Home" msgstr "主目录" -#: src/lib/elementary/elc_fileselector.c:1832 +#: src/lib/elementary/elc_fileselector.c:1738 msgid "Search" msgstr "" -#: src/lib/elementary/elc_fileselector.c:2104 +#: src/lib/elementary/elc_fileselector.c:2012 msgid "OK" msgstr "确定" -#: src/lib/elementary/elc_fileselector.c:2114 -#: src/lib/elementary/elm_entry.c:1739 src/lib/elementary/elm_entry.c:1764 +#: src/lib/elementary/elc_fileselector.c:2022 +#: src/lib/elementary/elm_entry.c:1759 src/lib/elementary/elm_entry.c:1784 msgid "Cancel" msgstr "取消" -#: 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:1523 -#: src/lib/elementary/elm_genlist.c:1764 src/lib/elementary/elm_list.c:2185 +#: src/lib/elementary/elc_hoversel.c:439 src/lib/elementary/efl_ui_button.c:208 +#: src/lib/elementary/efl_ui_check.c:187 src/lib/elementary/elm_gengrid.c:1532 +#: src/lib/elementary/elm_genlist.c:1769 src/lib/elementary/elm_list.c:2185 #: src/lib/elementary/efl_ui_radio.c:201 -#: src/lib/elementary/elm_segment_control.c:528 -#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2291 +#: src/lib/elementary/elm_segment_control.c:525 +#: src/lib/elementary/elm_spinner.c:1041 src/lib/elementary/elm_toolbar.c:2294 msgid "State: Disabled" msgstr "状态:已禁用" -#: src/lib/elementary/elc_hoversel.c:651 +#: src/lib/elementary/elc_hoversel.c:652 msgid "Hoversel" msgstr "" @@ -304,15 +304,15 @@ msgstr "" msgid "Next" msgstr "" -#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:992 +#: src/lib/elementary/elc_popup.c:320 src/lib/elementary/elc_popup.c:984 msgid "Popup Title" msgstr "" -#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1068 +#: src/lib/elementary/elc_popup.c:330 src/lib/elementary/elc_popup.c:1060 msgid "Popup Body Text" msgstr "" -#: src/lib/elementary/elc_popup.c:1842 +#: src/lib/elementary/elc_popup.c:1836 msgid "Alert" msgstr "" @@ -378,21 +378,21 @@ msgstr "日历月" msgid "calendar year" msgstr "日历条目" -#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:201 +#: src/lib/elementary/efl_ui_check.c:76 src/lib/elementary/efl_ui_check.c:200 #: 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:96 src/lib/elementary/efl_ui_check.c:213 +#: src/lib/elementary/efl_ui_check.c:96 src/lib/elementary/efl_ui_check.c:212 #: src/lib/elementary/efl_ui_radio.c:204 msgid "State: Off" msgstr "状态:关闭" -#: src/lib/elementary/efl_ui_check.c:197 src/lib/elementary/efl_ui_check.c:210 +#: src/lib/elementary/efl_ui_check.c:196 src/lib/elementary/efl_ui_check.c:209 msgid "State" msgstr "状态" -#: src/lib/elementary/efl_ui_check.c:349 +#: src/lib/elementary/efl_ui_check.c:348 msgid "Check" msgstr "检查" @@ -443,7 +443,7 @@ 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:4329 +#: src/lib/elementary/elm_config.c:4158 msgid "default:LTR" msgstr "default:LTR" @@ -456,23 +456,23 @@ msgstr "磁盘选择器项目" msgid "diskselector item" msgstr "磁盘选择器项目" -#: src/lib/elementary/elm_entry.c:1729 +#: src/lib/elementary/elm_entry.c:1749 msgid "Cut" msgstr "粘贴" -#: src/lib/elementary/elm_entry.c:1732 +#: src/lib/elementary/elm_entry.c:1752 msgid "Copy" msgstr "复制" -#: src/lib/elementary/elm_entry.c:1736 src/lib/elementary/elm_entry.c:1758 +#: src/lib/elementary/elm_entry.c:1756 src/lib/elementary/elm_entry.c:1778 msgid "Paste" msgstr "粘贴" -#: src/lib/elementary/elm_entry.c:1751 +#: src/lib/elementary/elm_entry.c:1771 msgid "Select" msgstr "选择" -#: src/lib/elementary/elm_entry.c:3910 +#: src/lib/elementary/elm_entry.c:3937 msgid "Entry" msgstr "条目" @@ -516,21 +516,21 @@ msgstr "进度条" msgid "Radio" msgstr "无线电" -#: src/lib/elementary/elm_segment_control.c:531 -#: src/lib/elementary/elm_toolbar.c:2293 +#: src/lib/elementary/elm_segment_control.c:528 +#: src/lib/elementary/elm_toolbar.c:2296 msgid "State: Selected" msgstr "状态:已选择" -#: src/lib/elementary/elm_segment_control.c:533 +#: src/lib/elementary/elm_segment_control.c:530 #, fuzzy msgid "State: Unselected" msgstr "状态:已选择" -#: src/lib/elementary/elm_segment_control.c:547 +#: src/lib/elementary/elm_segment_control.c:544 msgid "Segment Control Item" msgstr "" -#: src/lib/elementary/efl_ui_slider.c:681 +#: src/lib/elementary/efl_ui_slider.c:704 msgid "slider" msgstr "滑块" @@ -558,23 +558,23 @@ msgstr "" msgid "spinner text" msgstr "" -#: src/lib/elementary/elm_toolbar.c:1750 src/lib/elementary/elm_toolbar.c:2352 +#: src/lib/elementary/elm_toolbar.c:1753 src/lib/elementary/elm_toolbar.c:2355 msgid "Selected" msgstr "已选择" -#: src/lib/elementary/elm_toolbar.c:2289 +#: src/lib/elementary/elm_toolbar.c:2292 msgid "Separator" msgstr "分隔符" -#: src/lib/elementary/elm_toolbar.c:2295 +#: src/lib/elementary/elm_toolbar.c:2298 msgid "Has menu" msgstr "有菜单" -#: src/lib/elementary/elm_toolbar.c:2347 +#: src/lib/elementary/elm_toolbar.c:2350 msgid "Unselected" msgstr "未选择" -#: src/lib/elementary/elm_toolbar.c:2364 +#: src/lib/elementary/elm_toolbar.c:2367 msgid "Toolbar Item" msgstr "工具栏项目" diff --git a/src/Makefile.am b/src/Makefile.am index af4731821b..9675fc193b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,6 +2,7 @@ AUTOMAKE_OPTIONS= -Wno-portability MAINTAINERCLEANFILES = Makefile.in CLEANFILES = BUILT_SOURCES = +PHONIES = EOLIAN_FLAGS = -I$(srcdir) EOLIAN_GEN_FLAGS = -S @@ -101,7 +102,7 @@ endif include Makefile_Eolian_Js.am include Makefile_Efl_Js.am -.PHONY: benchmark examples +.PHONY: benchmark examples $(PHONIES) BENCHMARK_SUBDIRS = \ benchmarks/eina \ @@ -161,7 +162,6 @@ 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 diff --git a/src/Makefile_Cxx.am b/src/Makefile_Cxx.am index 7d38d643dc..a3cc88c1d8 100644 --- a/src/Makefile_Cxx.am +++ b/src/Makefile_Cxx.am @@ -103,7 +103,7 @@ nodist_installed_eocxxheaders_DATA = $(eo_eolian_cxx_hh) $(eo_eolian_cxx_impl_hh nodist_installed_eflcxxmainheaders_DATA = $(efl_eolian_cxx_hh) $(efl_eolian_cxx_impl_hh) lib/efl/Efl.eo.hh nodist_installed_elementarycxxmainheaders_DATA = $(elementary_eolian_cxx_hh) $(elementary_eolian_cxx_impl_hh) \ lib/elementary/Elementary.eo.hh -nodist_installed_eldbuscxxmainheaders_DATA = $(eldbus_eolian_cxx_hh) $(eldbus_eolian_cxx_impl_hh) lib/eldbus/Eldbus_Model.eo.hh +nodist_installed_eldbuscxxmainheaders_DATA = $(eldbus_eolian_cxx_hh) $(eldbus_eolian_cxx_impl_hh) lib/eldbus/Eldbus.eo.hh CLEANFILES += $(eo_eolian_cxx_hh) $(eo_eolian_cxx_impl_hh) @@ -144,12 +144,12 @@ CLEANFILES += $(evas_canvas_eolian_cxx_hh) $(evas_canvas_eolian_cxx_impl_hh) \ lib/evas/Evas.eo.hh -lib/eldbus/Eldbus_Model.eo.hh: $(eldbus_eolian_files) $(_EOLIAN_CXX_DEP) +lib/eldbus/Eldbus.eo.hh: $(eldbus_eolian_files) $(_EOLIAN_CXX_DEP) $(AM_V_EOLCXX) \ $(MKDIR_P) $(dir $@); \ $(EOLIAN_CXX) $(EOLIAN_FLAGS) -m -o $@ $(filter %.eo, $^) -CLEANFILES += $(eldbus_eolian_cxx_hh) $(eldbus_eolian_cxx_impl_hh) lib/eldbus/Eldbus_Model.eo.hh +CLEANFILES += $(eldbus_eolian_cxx_hh) $(eldbus_eolian_cxx_impl_hh) lib/eldbus/Eldbus.eo.hh ### Eet C++ diff --git a/src/Makefile_EPhysics.am b/src/Makefile_EPhysics.am index 708248a616..78d28d9f77 100644 --- a/src/Makefile_EPhysics.am +++ b/src/Makefile_EPhysics.am @@ -21,7 +21,7 @@ lib/ephysics/ephysics_quaternion.cpp \ lib/ephysics/ephysics_shape.cpp \ lib/ephysics/ephysics_world.cpp -lib_ephysics_libephysics_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @EPHYSICS_CFLAGS@ +lib_ephysics_libephysics_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @EPHYSICS_CFLAGS@ -DEFL_BUILD lib_ephysics_libephysics_la_LIBADD = @EPHYSICS_LIBS@ lib_ephysics_libephysics_la_DEPENDENCIES = @EPHYSICS_INTERNAL_LIBS@ lib_ephysics_libephysics_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am index 38aeab1f6c..649dbbec28 100644 --- a/src/Makefile_Ecore.am +++ b/src/Makefile_Ecore.am @@ -1,11 +1,9 @@ ### Library -ecore_eolian_files_legacy = \ - lib/ecore/ecore_exe.eo \ +ecore_eolian_files_priv = \ lib/ecore/ecore_event_message.eo \ - lib/ecore/ecore_event_message_handler.eo \ - lib/ecore/efl_loop_timer.eo + lib/ecore/ecore_event_message_handler.eo ecore_eolian_files_public = \ lib/ecore/efl_app.eo \ @@ -17,6 +15,7 @@ ecore_eolian_files_public = \ 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_loop_timer.eo \ lib/ecore/efl_exe.eo \ lib/ecore/efl_thread.eo \ lib/ecore/efl_threadio.eo \ @@ -41,33 +40,58 @@ ecore_eolian_files_public = \ lib/ecore/efl_bounce_interpolator.eo \ lib/ecore/efl_spring_interpolator.eo \ lib/ecore/efl_cubic_bezier_interpolator.eo \ - lib/ecore/efl_model_loop.eo \ - lib/ecore/efl_model_item.eo \ - lib/ecore/efl_model_container.eo \ - lib/ecore/efl_model_container_item.eo \ - lib/ecore/efl_model_composite_boolean.eo \ - lib/ecore/efl_model_composite_boolean_children.eo \ - lib/ecore/efl_model_composite_selection.eo \ - lib/ecore/efl_model_composite_selection_children.eo \ - lib/ecore/efl_model_composite.eo \ - lib/ecore/efl_model_view.eo + lib/ecore/efl_loop_model.eo \ + lib/ecore/efl_generic_model.eo \ + lib/ecore/efl_container_model.eo \ + lib/ecore/efl_boolean_model.eo \ + lib/ecore/efl_select_model.eo \ + lib/ecore/efl_composite_model.eo \ + lib/ecore/efl_view_model.eo \ + lib/ecore/efl_core_env.eo \ + lib/ecore/efl_core_proc_env.eo \ + lib/ecore/efl_core_command_line.eo + +ecore_test_eolian_files = \ + tests/ecore/efl_app_test_cml.eo \ + tests/ecore/ecore_audio_out_test.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) \ - $(ecore_eolian_files_legacy:%.eo=%.eo.legacy.h) +ecore_eolian_h = $(ecore_eolian_files:%.eo=%.eo.h) +ecore_test_c = $(ecore_test_eolian_files:%.eo=%.eo.c) +ecore_test_h = $(ecore_test_eolian_files:%.eo=%.eo.h) + +ecore_priv_c = $(ecore_eolian_files_priv:%.eo=%.eo.c) +ecore_priv_h = $(ecore_eolian_files_priv:%.eo=%.eo.h) BUILT_SOURCES += \ $(ecore_eolian_c) \ - $(ecore_eolian_h) + $(ecore_eolian_h) \ + $(ecore_test_c) \ + $(ecore_test_h) \ + $(ecore_priv_c) \ + $(ecore_priv_h) +if INSTALL_EO_FILES ecoreeolianfilesdir = $(datadir)/eolian/include/ecore-@VMAJ@ ecoreeolianfiles_DATA = $(ecore_eolian_files_public) lib/ecore/efl_loop_timer.eo +endif + +ecore_legacy_eo_c = \ +lib/ecore/ecore_exe_eo.c \ +lib/ecore/ecore_exe_eo.h \ +lib/ecore/efl_loop_timer_eo.legacy.c + +ecore_legacy_eo_h = \ +lib/ecore/ecore_exe_eo.legacy.h \ +lib/ecore/efl_loop_timer_eo.legacy.h EXTRA_DIST2 += $(ecore_eolian_files) +EXTRA_DIST2 += $(ecore_eolian_files_priv) +EXTRA_DIST2 += $(ecore_test_eolian_files) +EXTRA_DIST2 += $(ecore_legacy_eo_c) lib_LTLIBRARIES += lib/ecore/libecore.la @@ -79,7 +103,8 @@ lib/ecore/Ecore_Legacy.h \ lib/ecore/Ecore_Eo.h \ lib/ecore/Efl_Core.h \ lib/ecore/efl_general.h \ -lib/ecore/Ecore_Getopt.h +lib/ecore/Ecore_Getopt.h \ +$(ecore_legacy_eo_h) nodist_installed_ecoremainheaders_DATA = \ $(ecore_eolian_h) @@ -99,6 +124,9 @@ 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_core_command_line.c \ +lib/ecore/efl_core_env.c \ +lib/ecore/efl_core_proc_env.c \ lib/ecore/efl_app.c \ lib/ecore/efl_loop.c \ lib/ecore/efl_loop_consumer.c \ @@ -119,18 +147,16 @@ 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_model_loop.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_composite_private.h \ +lib/ecore/efl_loop_model.c \ +lib/ecore/efl_generic_model.c \ +lib/ecore/efl_container_model.c \ +lib/ecore/efl_composite_model.c \ +lib/ecore/efl_boolean_model.c \ +lib/ecore/efl_select_model.c \ +lib/ecore/efl_composite_model_private.h \ lib/ecore/efl_model_accessor_view.c \ lib/ecore/efl_model_accessor_view_private.h \ -lib/ecore/efl_model_view.c \ +lib/ecore/efl_view_model.c \ lib/ecore/efl_linear_interpolator.c \ lib/ecore/efl_accelerate_interpolator.c \ lib/ecore/efl_decelerate_interpolator.c \ @@ -181,6 +207,7 @@ lib_ecore_libecore_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_DATA_DIR=\"$(datadir)/ecore\" \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ -DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \ +-DEFL_BUILD \ @ECORE_CFLAGS@ lib_ecore_libecore_la_LIBADD = @ECORE_LIBS@ @EVIL_LIBS@ lib_ecore_libecore_la_DEPENDENCIES = @ECORE_INTERNAL_LIBS@ @@ -292,7 +319,7 @@ tests/ecore/ecore_test_args.c \ tests/ecore/ecore_test_pipe.c \ tests/ecore/ecore_suite.h -tests_ecore_ecore_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ +tests_ecore_ecore_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl -I$(top_builddir)/src/tests/ecore \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ -DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/ecore\" \ -DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/ecore\" \ @@ -336,10 +363,12 @@ 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_test_cml.c \ +tests/ecore/efl_app_test_env.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 \ +tests_ecore_efl_app_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl -I$(top_builddir)/src/tests/ecore \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ -DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/ecore\" \ -DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/ecore\" \ diff --git a/src/Makefile_Ecore_Audio.am b/src/Makefile_Ecore_Audio.am index 919104fc93..695879f170 100644 --- a/src/Makefile_Ecore_Audio.am +++ b/src/Makefile_Ecore_Audio.am @@ -20,11 +20,13 @@ BUILT_SOURCES += \ $(ecore_audio_eolian_c) \ $(ecore_audio_eolian_h) +if INSTALL_EO_FILES ecore_audioeolianfilesdir = $(datadir)/eolian/include/ecore-@VMAJ@ ecore_audioeolianfiles_DATA = $(ecore_audio_eolian_files) +endif EXTRA_DIST2 += \ - ${ecore_audioeolianfiles_DATA} + $(ecore_audio_eolian_files) lib_LTLIBRARIES += lib/ecore_audio/libecore_audio.la @@ -51,7 +53,7 @@ lib/ecore_audio/ecore_audio_obj_out.c \ lib/ecore_audio/ecore_audio_obj_in_tone.c \ lib/ecore_audio/ecore_audio_private.h -lib_ecore_audio_libecore_audio_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_AUDIO_CFLAGS@ @ECORE_AUDIO_ALSA_CFLAGS@ @ECORE_AUDIO_PULSE_CFLAGS@ @ECORE_AUDIO_SNDFILE_CFLAGS@ +lib_ecore_audio_libecore_audio_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_AUDIO_CFLAGS@ @ECORE_AUDIO_ALSA_CFLAGS@ @ECORE_AUDIO_PULSE_CFLAGS@ @ECORE_AUDIO_SNDFILE_CFLAGS@ -DEFL_BUILD lib_ecore_audio_libecore_audio_la_LIBADD = @ECORE_AUDIO_LIBS@ @ECORE_AUDIO_ALSA_LIBS@ lib_ecore_audio_libecore_audio_la_DEPENDENCIES = @ECORE_AUDIO_INTERNAL_LIBS@ lib_ecore_audio_libecore_audio_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ diff --git a/src/Makefile_Ecore_Avahi.am b/src/Makefile_Ecore_Avahi.am index 3dba43e6ca..0390020c78 100644 --- a/src/Makefile_Ecore_Avahi.am +++ b/src/Makefile_Ecore_Avahi.am @@ -10,7 +10,7 @@ lib/ecore_avahi/Ecore_Avahi.h lib_ecore_avahi_libecore_avahi_la_SOURCES = \ lib/ecore_avahi/ecore_avahi.c -lib_ecore_avahi_libecore_avahi_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_AVAHI_CFLAGS@ +lib_ecore_avahi_libecore_avahi_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_AVAHI_CFLAGS@ -DEFL_BUILD lib_ecore_avahi_libecore_avahi_la_LIBADD = @ECORE_AVAHI_LIBS@ lib_ecore_avahi_libecore_avahi_la_DEPENDENCIES = @ECORE_AVAHI_INTERNAL_LIBS@ lib_ecore_avahi_libecore_avahi_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ diff --git a/src/Makefile_Ecore_Con.am b/src/Makefile_Ecore_Con.am index 610328a1ef..594046b3c5 100644 --- a/src/Makefile_Ecore_Con.am +++ b/src/Makefile_Ecore_Con.am @@ -1,7 +1,7 @@ ### Library -ecore_con_eolian_files = \ +ecore_con_eolian_files_common = \ lib/ecore_con/efl_net_socket.eo \ lib/ecore_con/efl_net_socket_simple.eo \ lib/ecore_con/efl_net_socket_fd.eo \ @@ -28,21 +28,24 @@ ecore_con_eolian_files = \ lib/ecore_con/efl_net_control_technology.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 \ - lib/ecore_con/ecore_con_eet_server_obj.eo \ - lib/ecore_con/ecore_con_eet_client_obj.eo + lib/ecore_con/efl_net_ip_address.eo -if HAVE_WINDOWS -ecore_con_eolian_files += \ +ecore_con_eolian_files_windows = \ lib/ecore_con/efl_net_socket_windows.eo \ lib/ecore_con/efl_net_dialer_windows.eo \ lib/ecore_con/efl_net_server_windows.eo -else -ecore_con_eolian_files += \ + +ecore_con_eolian_files_unix = \ lib/ecore_con/efl_net_socket_unix.eo \ lib/ecore_con/efl_net_dialer_unix.eo \ lib/ecore_con/efl_net_server_unix.eo + +ecore_con_eolian_files = $(ecore_con_eolian_files_common) + +if HAVE_WINDOWS +ecore_con_eolian_files += $(ecore_con_eolian_files_windows) +else +ecore_con_eolian_files += $(ecore_con_eolian_files_unix) endif ecore_con_eolian_type_files = \ @@ -53,20 +56,24 @@ ecore_con_eolian_type_files = \ ecore_con_eolian_c = $(ecore_con_eolian_files:%.eo=%.eo.c) ecore_con_eolian_h = $(ecore_con_eolian_files:%.eo=%.eo.h) \ - $(ecore_con_eolian_type_files:%.eot=%.eot.h) \ - $(ecore_con_eolian_files:%.eo=%.eo.legacy.h) + $(ecore_con_eolian_type_files:%.eot=%.eot.h) BUILT_SOURCES += \ $(ecore_con_eolian_c) \ $(ecore_con_eolian_h) +if INSTALL_EO_FILES ecoreconeolianfilesdir = $(datadir)/eolian/include/ecore-@VMAJ@ ecoreconeolianfiles_DATA = \ $(ecore_con_eolian_files) \ $(ecore_con_eolian_type_files) +endif EXTRA_DIST2 += \ - ${ecoreconeolianfiles_DATA} +$(ecore_con_eolian_files_common) \ +$(ecore_con_eolian_files_unix) \ +$(ecore_con_eolian_files_windows) \ +$(ecore_con_eolian_type_files) lib_LTLIBRARIES += lib/ecore_con/libecore_con.la @@ -77,7 +84,14 @@ lib/ecore_con/Ecore_Con.h \ lib/ecore_con/Efl_Net.h \ lib/ecore_con/Ecore_Con_Eet.h \ lib/ecore_con/Ecore_Con_Eet_Legacy.h \ -lib/ecore_con/Ecore_Con_Eet_Eo.h +lib/ecore_con/Ecore_Con_Eet_Eo.h \ +lib/ecore_con/ecore_con_eet_base_eo.h \ +lib/ecore_con/ecore_con_eet_base_eo.legacy.h \ +lib/ecore_con/ecore_con_eet_client_obj_eo.h \ +lib/ecore_con/ecore_con_eet_client_obj_eo.legacy.h \ +lib/ecore_con/ecore_con_eet_server_obj_eo.h \ +lib/ecore_con/ecore_con_eet_server_obj_eo.legacy.h + nodist_installed_ecoreconmainheaders_DATA = \ $(ecore_con_eolian_h) @@ -145,6 +159,10 @@ endif # object Private Data and allows functions to # be all static EXTRA_DIST2 += \ +lib/ecore_con/ecore_con_eet_base_eo.c \ +lib/ecore_con/ecore_con_eet_base_eo.legacy.c \ +lib/ecore_con/ecore_con_eet_client_obj_eo.c \ +lib/ecore_con/ecore_con_eet_server_obj_eo.c \ lib/ecore_con/efl_net_ssl_conn-openssl.c \ lib/ecore_con/efl_net_ssl_conn-gnutls.c \ lib/ecore_con/efl_net_ssl_conn-none.c \ @@ -170,6 +188,7 @@ lib_ecore_con_libecore_con_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_DATA_DIR=\"$(datadir)/ecore\" \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ -DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \ +-DEFL_BUILD \ @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 0c3c335679..8f74f95b0b 100644 --- a/src/Makefile_Ecore_Evas.am +++ b/src/Makefile_Ecore_Evas.am @@ -34,6 +34,7 @@ lib_ecore_evas_libecore_evas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_DATA_DIR=\"$(datadir)/ecore_evas\" \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ -DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \ +-DEFL_BUILD \ @ECORE_EVAS_CFLAGS@ lib_ecore_evas_libecore_evas_la_LIBADD = @ECORE_EVAS_LIBS@ lib_ecore_evas_libecore_evas_la_DEPENDENCIES = @ECORE_EVAS_INTERNAL_LIBS@ @@ -83,6 +84,7 @@ $(install_ecoreevasenginexpkgLTLIBRARIES): install-libLTLIBRARIES modules_ecore_evas_engines_x_module_la_SOURCES = $(XSOURCES) modules_ecore_evas_engines_x_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ +-DEFL_BUILD \ @ECORE_EVAS_CFLAGS@ \ @ECORE_X_CFLAGS@ \ -I$(top_srcdir)/src/modules/evas/engines/software_x11 \ @@ -193,6 +195,7 @@ $(install_ecoreevasenginesdlpkgLTLIBRARIES): install-libLTLIBRARIES modules_ecore_evas_engines_sdl_module_la_SOURCES = $(SDLSOURCES) modules_ecore_evas_engines_sdl_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ +-DEFL_BUILD \ @ECORE_EVAS_CFLAGS@ \ @ECORE_SDL_CFLAGS@ \ -I$(top_srcdir)/src/modules/evas/engines/buffer \ @@ -220,6 +223,7 @@ $(install_ecoreevasengineswin32pkgLTLIBRARIES): install-libLTLIBRARIES modules_ecore_evas_engines_win32_module_la_SOURCES = $(WIN32SOURCES) modules_ecore_evas_engines_win32_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ +-DEFL_BUILD \ @ECORE_EVAS_CFLAGS@ \ @ECORE_WIN32_CFLAGS@ \ -I$(top_srcdir)/src/modules/evas/engines/software_ddraw \ diff --git a/src/Makefile_Ecore_File.am b/src/Makefile_Ecore_File.am index a31431508e..8f5924504f 100644 --- a/src/Makefile_Ecore_File.am +++ b/src/Makefile_Ecore_File.am @@ -27,7 +27,7 @@ lib/ecore_file/ecore_file_monitor_poll.c endif endif -lib_ecore_file_libecore_file_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_FILE_CFLAGS@ +lib_ecore_file_libecore_file_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_FILE_CFLAGS@ -DEFL_BUILD lib_ecore_file_libecore_file_la_LIBADD = @ECORE_FILE_LIBS@ lib_ecore_file_libecore_file_la_DEPENDENCIES = @ECORE_FILE_INTERNAL_LIBS@ lib_ecore_file_libecore_file_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ diff --git a/src/Makefile_Ecore_IMF.am b/src/Makefile_Ecore_IMF.am index c43f2a82c1..ac099c38bb 100644 --- a/src/Makefile_Ecore_IMF.am +++ b/src/Makefile_Ecore_IMF.am @@ -22,6 +22,7 @@ lib_ecore_imf_libecore_imf_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_DATA_DIR=\"$(datadir)/ecore_imf\" \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ -DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \ +-DEFL_BUILD \ @ECORE_IMF_CFLAGS@ lib_ecore_imf_libecore_imf_la_LIBADD = @ECORE_IMF_LIBS@ lib_ecore_imf_libecore_imf_la_DEPENDENCIES = @ECORE_IMF_INTERNAL_LIBS@ diff --git a/src/Makefile_Ecore_IMF_Evas.am b/src/Makefile_Ecore_IMF_Evas.am index abb3d57ae6..b2fd780713 100644 --- a/src/Makefile_Ecore_IMF_Evas.am +++ b/src/Makefile_Ecore_IMF_Evas.am @@ -9,7 +9,7 @@ lib_LTLIBRARIES += \ lib/ecore_imf_evas/libecore_imf_evas.la lib_ecore_imf_evas_libecore_imf_evas_la_SOURCES = lib/ecore_imf_evas/ecore_imf_evas.c -lib_ecore_imf_evas_libecore_imf_evas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_IMF_EVAS_CFLAGS@ +lib_ecore_imf_evas_libecore_imf_evas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_IMF_EVAS_CFLAGS@ -DEFL_BUILD lib_ecore_imf_evas_libecore_imf_evas_la_LIBADD = @ECORE_IMF_EVAS_LIBS@ lib_ecore_imf_evas_libecore_imf_evas_la_DEPENDENCIES = @ECORE_IMF_EVAS_INTERNAL_LIBS@ lib_ecore_imf_evas_libecore_imf_evas_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ diff --git a/src/Makefile_Ecore_Input.am b/src/Makefile_Ecore_Input.am index a664cfba6d..0dc407bab5 100644 --- a/src/Makefile_Ecore_Input.am +++ b/src/Makefile_Ecore_Input.am @@ -15,7 +15,7 @@ lib/ecore_input/ecore_input_joystick.c \ lib/ecore_input/ecore_input_compose.h \ lib/ecore_input/ecore_input_private.h -lib_ecore_input_libecore_input_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_INPUT_CFLAGS@ +lib_ecore_input_libecore_input_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_INPUT_CFLAGS@ -DEFL_BUILD lib_ecore_input_libecore_input_la_LIBADD = @ECORE_INPUT_LIBS@ lib_ecore_input_libecore_input_la_DEPENDENCIES = @ECORE_INPUT_INTERNAL_LIBS@ lib_ecore_input_libecore_input_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ diff --git a/src/Makefile_Ecore_Input_Evas.am b/src/Makefile_Ecore_Input_Evas.am index b56efc3741..23bcb92cda 100644 --- a/src/Makefile_Ecore_Input_Evas.am +++ b/src/Makefile_Ecore_Input_Evas.am @@ -12,7 +12,7 @@ lib_ecore_input_evas_libecore_input_evas_la_SOURCES = \ lib/ecore_input_evas/ecore_input_evas.c \ lib/ecore_input_evas/ecore_input_evas_private.h -lib_ecore_input_evas_libecore_input_evas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_INPUT_EVAS_CFLAGS@ +lib_ecore_input_evas_libecore_input_evas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_INPUT_EVAS_CFLAGS@ -DEFL_BUILD lib_ecore_input_evas_libecore_input_evas_la_LIBADD = @ECORE_INPUT_EVAS_LIBS@ lib_ecore_input_evas_libecore_input_evas_la_DEPENDENCIES = @ECORE_INPUT_EVAS_INTERNAL_LIBS@ lib_ecore_input_evas_libecore_input_evas_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ diff --git a/src/Makefile_Ecore_Ipc.am b/src/Makefile_Ecore_Ipc.am index 4740b76253..0f09209f47 100644 --- a/src/Makefile_Ecore_Ipc.am +++ b/src/Makefile_Ecore_Ipc.am @@ -11,7 +11,7 @@ lib_ecore_ipc_libecore_ipc_la_SOURCES = \ lib/ecore_ipc/ecore_ipc.c \ lib/ecore_ipc/ecore_ipc_private.h -lib_ecore_ipc_libecore_ipc_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_IPC_CFLAGS@ +lib_ecore_ipc_libecore_ipc_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_IPC_CFLAGS@ -DEFL_BUILD lib_ecore_ipc_libecore_ipc_la_LIBADD = @ECORE_IPC_LIBS@ @EVIL_LIBS@ lib_ecore_ipc_libecore_ipc_la_DEPENDENCIES = @ECORE_IPC_INTERNAL_LIBS@ lib_ecore_ipc_libecore_ipc_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ diff --git a/src/Makefile_Ecore_SDL.am b/src/Makefile_Ecore_SDL.am index 7262c2b324..88eec1bd10 100644 --- a/src/Makefile_Ecore_SDL.am +++ b/src/Makefile_Ecore_SDL.am @@ -13,7 +13,7 @@ lib/ecore_sdl/ecore_sdl.c \ lib/ecore_sdl/Ecore_Sdl_Keys.h \ lib/ecore_sdl/ecore_sdl_private.h -lib_ecore_sdl_libecore_sdl_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_SDL_CFLAGS@ +lib_ecore_sdl_libecore_sdl_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_SDL_CFLAGS@ -DEFL_BUILD lib_ecore_sdl_libecore_sdl_la_LIBADD = @ECORE_SDL_LIBS@ lib_ecore_sdl_libecore_sdl_la_DEPENDENCIES = @ECORE_SDL_INTERNAL_LIBS@ lib_ecore_sdl_libecore_sdl_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ diff --git a/src/Makefile_Ecore_Win32.am b/src/Makefile_Ecore_Win32.am index c230a8b8f1..817eabe90b 100644 --- a/src/Makefile_Ecore_Win32.am +++ b/src/Makefile_Ecore_Win32.am @@ -28,7 +28,7 @@ lib/ecore_win32/ecore_win32_dnd_drop_source.h \ lib/ecore_win32/ecore_win32_dnd_drop_target.h \ lib/ecore_win32/ecore_win32_keysym_table.h -lib_ecore_win32_libecore_win32_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_WIN32_CFLAGS@ +lib_ecore_win32_libecore_win32_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_WIN32_CFLAGS@ -DEFL_BUILD lib_ecore_win32_libecore_win32_la_LIBADD = @ECORE_WIN32_LIBS@ lib_ecore_win32_libecore_win32_la_DEPENDENCIES = @ECORE_WIN32_INTERNAL_LIBS@ lib_ecore_win32_libecore_win32_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ diff --git a/src/Makefile_Ecore_X.am b/src/Makefile_Ecore_X.am index 3b0252290b..636f745d90 100644 --- a/src/Makefile_Ecore_X.am +++ b/src/Makefile_Ecore_X.am @@ -49,6 +49,7 @@ lib/ecore_x/ecore_x_private.h lib_ecore_x_libecore_x_la_CPPFLAGS = \ -I$(top_builddir)/src/lib/efl \ +-DEFL_BUILD \ @ECORE_X_CFLAGS@ @ECORE_CON_CFLAGS@ \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ diff --git a/src/Makefile_Ector.am b/src/Makefile_Ector.am index ccd96d14d1..52a6047067 100644 --- a/src/Makefile_Ector.am +++ b/src/Makefile_Ector.am @@ -58,10 +58,12 @@ BUILT_SOURCES += \ $(ector_eolian_c) \ $(ector_eolian_h) +if INSTALL_EO_FILES ectoreolianfilesdir = $(datadir)/eolian/include/ector-@VMAJ@ ectoreolianfiles_DATA = $(ector_eolian_files) $(ector_eolian_type_files) +endif -EXTRA_DIST2 += $(ectoreolianfiles_DATA) \ +EXTRA_DIST2 += $(ector_eolian_files) $(ector_eolian_type_files) \ lib/ector/Ector.h \ lib/ector/ector_util.h \ lib/ector/ector_surface.h \ @@ -159,10 +161,12 @@ lib_ector_libector_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/static_libs/freetype \ -I$(top_srcdir)/src/static_libs/draw \ -I$(top_srcdir)/src/static_libs/triangulator \ +-DEFL_BUILD \ @ECTOR_CFLAGS@ \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/ector\" \ +-DEFL_BETA_API_SUPPORT=1 \ @VALGRIND_CFLAGS@ \ @SSE3_CFLAGS@ diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am index ae9e952881..aa1cd787e0 100644 --- a/src/Makefile_Edje.am +++ b/src/Makefile_Edje.am @@ -11,8 +11,7 @@ edje_eolian_files = \ lib/edje/efl_canvas_layout_part_external.eo \ lib/edje/efl_canvas_layout_part_swallow.eo \ lib/edje/efl_canvas_layout_part_table.eo \ - lib/edje/efl_canvas_layout_part_text.eo \ - lib/edje/edje_edit.eo + lib/edje/efl_canvas_layout_part_text.eo edje_eolian_type_files = \ lib/edje/edje_types.eot @@ -36,15 +35,19 @@ BUILT_SOURCES += \ $(edje_eolian_priv_c) \ $(edje_eolian_priv_h) +if INSTALL_EO_FILES edjeeolianfilesdir = $(datadir)/eolian/include/edje-@VMAJ@ edjeeolianfiles_DATA = \ - $(edje_eolian_files) \ - $(edje_eolian_type_files) +$(edje_eolian_files) \ +$(edje_eolian_type_files) +endif noinst_DATA += $(edje_eolian_priv_c) $(edje_eolian_priv_h) -EXTRA_DIST2 += ${edjeeolianfiles_DATA} \ - $(edje_eolian_priv_files) +EXTRA_DIST2 += \ +$(edje_eolian_files) \ +$(edje_eolian_type_files) \ +$(edje_eolian_priv_files) lib_LTLIBRARIES += lib/edje/libedje.la @@ -66,7 +69,16 @@ lib/edje/Edje.h \ lib/edje/Edje_Common.h \ lib/edje/Edje_Eo.h \ lib/edje/Edje_Legacy.h \ -lib/edje/Edje_Edit.h +lib/edje/Edje_Edit.h \ +lib/edje/edje_edit_eo.h \ +lib/edje/edje_edit_eo.legacy.h \ +lib/edje/efl_canvas_layout_eo.legacy.h \ +lib/edje/efl_layout_group_eo.legacy.h + +EXTRA_DIST2 += \ +lib/edje/edje_edit_eo.c \ +lib/edje/efl_canvas_layout_eo.legacy.c \ +lib/edje/efl_layout_group_eo.legacy.c nodist_installed_edjemainheaders_DATA = \ $(edje_eolian_h) \ @@ -115,7 +127,7 @@ 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_CPPFLAGS = -I$(top_builddir)/src/lib/efl $(EDJE_COMMON_CPPFLAGS) -DEFL_BUILD lib_edje_libedje_la_LIBADD = @EDJE_LIBS@ @EDJE_LUA_LIBS@ lib_edje_libedje_la_DEPENDENCIES = @EDJE_INTERNAL_LIBS@ lib_edje_libedje_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ diff --git a/src/Makefile_Eet.am b/src/Makefile_Eet.am index 6724cdb4a5..3dc86a5c6e 100644 --- a/src/Makefile_Eet.am +++ b/src/Makefile_Eet.am @@ -27,6 +27,7 @@ lib_eet_libeet_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/eet\" \ +-DEFL_BUILD \ @EET_CFLAGS@ \ @NEON_CFLAGS@ lib_eet_libeet_la_LIBADD = @EET_LIBS@ @EVIL_LIBS@ diff --git a/src/Makefile_Eeze.am b/src/Makefile_Eeze.am index 2e650d8069..5f8eb02605 100644 --- a/src/Makefile_Eeze.am +++ b/src/Makefile_Eeze.am @@ -53,6 +53,7 @@ lib_eeze_libeeze_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_DATA_DIR=\"$(datadir)/eeze\" \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ -DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \ +-DEFL_BUILD \ @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 b69f3b63b0..283c8b975c 100644 --- a/src/Makefile_Efl.am +++ b/src/Makefile_Efl.am @@ -4,7 +4,7 @@ efl_eolian_legacy_files = \ lib/efl/interfaces/efl_gfx_entity.eo \ lib/efl/interfaces/efl_gfx_color.eo \ lib/efl/interfaces/efl_gfx_image.eo \ - lib/efl/interfaces/efl_gfx_image_animation_controller.eo \ + lib/efl/interfaces/efl_gfx_frame_controller.eo \ lib/efl/interfaces/efl_input_device.eo \ lib/efl/interfaces/efl_ui_draggable.eo \ lib/efl/interfaces/efl_ui_clickable.eo \ @@ -23,6 +23,7 @@ efl_eolian_files = \ lib/efl/interfaces/efl_control.eo \ lib/efl/interfaces/efl_duplicate.eo \ lib/efl/interfaces/efl_file.eo \ + lib/efl/interfaces/efl_file_save.eo \ lib/efl/interfaces/efl_gfx_image_load_controller.eo \ lib/efl/interfaces/efl_part.eo \ lib/efl/interfaces/efl_playable.eo \ @@ -34,6 +35,7 @@ efl_eolian_files = \ lib/efl/interfaces/efl_text_cursor.eo \ lib/efl/interfaces/efl_text_annotate.eo \ lib/efl/interfaces/efl_text_markup.eo \ + lib/efl/interfaces/efl_text_markup_interactive.eo \ lib/efl/interfaces/efl_text_markup_util.eo \ lib/efl/interfaces/efl_gfx_stack.eo \ lib/efl/interfaces/efl_gfx_view.eo \ @@ -45,9 +47,8 @@ efl_eolian_files = \ lib/efl/interfaces/efl_gfx_gradient_radial.eo \ lib/efl/interfaces/efl_gfx_filter.eo \ lib/efl/interfaces/efl_gfx_blur.eo \ - lib/efl/interfaces/efl_gfx_size_hint.eo \ + lib/efl/interfaces/efl_gfx_hint.eo \ lib/efl/interfaces/efl_model.eo \ - lib/efl/interfaces/efl_animator.eo \ lib/efl/interfaces/efl_orientation.eo \ lib/efl/interfaces/efl_container.eo \ lib/efl/interfaces/efl_content.eo \ @@ -57,11 +58,14 @@ efl_eolian_files = \ lib/efl/interfaces/efl_pack_table.eo \ lib/efl/interfaces/efl_ui_i18n.eo \ lib/efl/interfaces/efl_ui_direction.eo \ + lib/efl/interfaces/efl_ui_direction_readonly.eo \ lib/efl/interfaces/efl_ui_drag.eo \ - lib/efl/interfaces/efl_ui_range.eo \ + lib/efl/interfaces/efl_ui_range_display.eo \ + lib/efl/interfaces/efl_ui_range_interactive.eo \ lib/efl/interfaces/efl_ui_view.eo \ - lib/efl/interfaces/efl_ui_model_connect.eo \ + lib/efl/interfaces/efl_ui_property_bind.eo \ lib/efl/interfaces/efl_ui_factory.eo \ + lib/efl/interfaces/efl_ui_factory_bind.eo \ lib/efl/interfaces/efl_screen.eo \ lib/efl/interfaces/efl_io_closer.eo \ lib/efl/interfaces/efl_io_positioner.eo \ @@ -93,23 +97,24 @@ efl_eolian_type_files = \ efl_eolian_files_h = $(efl_eolian_files:%.eo=%.eo.h) \ $(efl_eolian_type_files:%.eot=%.eot.h) efl_eolian_files_c = $(efl_eolian_files:%.eo=%.eo.c) -efl_eolian_legacy_files_h = $(efl_eolian_legacy_files:%.eo=%.eo.legacy.h) BUILT_SOURCES += \ $(efl_eolian_files_c) \ - $(efl_eolian_files_h) \ - $(efl_eolian_legacy_files_h) + $(efl_eolian_files_h) EXTRA_DIST2 += \ lib/efl/Efl_Config.h \ lib/efl/Efl_Config.h.in \ lib/efl/Efl.h \ + lib/efl/interfaces/efl_file.h \ lib/efl/interfaces/efl_common_internal.h \ $(efl_eolian_files) \ $(efl_eolian_type_files) +if INSTALL_EO_FILES efleolianfilesdir = $(datadir)/eolian/include/efl-@VMAJ@ efleolianfiles_DATA = $(efl_eolian_files) $(efl_eolian_type_files) +endif lib_LTLIBRARIES += lib/efl/libefl.la @@ -131,9 +136,10 @@ lib/efl/interfaces/efl_file.c \ lib/efl/interfaces/efl_ui_format.c \ lib/efl/interfaces/efl_gfx_color.c \ lib/efl/interfaces/efl_text_markup_util.c \ +lib/efl/interfaces/efl_ui_direction_readonly.c \ $(NULL) -lib_efl_libefl_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl -I$(top_srcdir)/src/lib/efl @EFL_CFLAGS@ -DEFL_GFX_FILTER_BETA +lib_efl_libefl_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl -I$(top_srcdir)/src/lib/efl @EFL_CFLAGS@ -DEFL_GFX_FILTER_BETA -DEFL_BUILD lib_efl_libefl_la_LIBADD = @EFL_LIBS@ lib_efl_libefl_la_DEPENDENCIES = @EFL_INTERNAL_LIBS@ lib_efl_libefl_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ @@ -147,7 +153,7 @@ dist_installed_eflheaders_DATA = \ installed_eflinterfacesdir = $(includedir)/efl-@VMAJ@/interfaces nodist_installed_eflinterfaces_DATA = \ $(efl_eolian_files_h) \ - $(efl_eolian_legacy_files_h) + lib/efl/interfaces/efl_file.h if HAVE_LUA_BINDINGS @@ -198,9 +204,9 @@ TESTS += tests/efl/efl_suite tests_efl_efl_suite_SOURCES = \ tests/efl/efl_suite.c \ -tests/efl/efl_test_model_container.c \ -tests/efl/efl_test_model_composite.c \ -tests/efl/efl_test_model_view.c \ +tests/efl/efl_test_container_model.c \ +tests/efl/efl_test_composite_model.c \ +tests/efl/efl_test_view_model.c \ tests/efl/efl_suite.h tests_efl_efl_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ diff --git a/src/Makefile_Efl_Mono.am b/src/Makefile_Efl_Mono.am index 8c7d2f0373..5c6d57e626 100644 --- a/src/Makefile_Efl_Mono.am +++ b/src/Makefile_Efl_Mono.am @@ -4,8 +4,25 @@ efl_custom_exports_mono_files = \ efl_eo_mono_files = \ bindings/mono/eo_mono/iwrapper.cs \ + bindings/mono/eo_mono/FunctionWrapper.cs \ + bindings/mono/eo_mono/NativeModule.cs \ bindings/mono/eo_mono/workaround.cs +if HAVE_WIN32 + +efl_eo_mono_files += \ + bindings/mono/eo_mono/FunctionWrapper_Windows.cs \ + bindings/mono/eo_mono/NativeModule_Windows.cs + +else + +efl_eo_mono_files += \ + bindings/mono/eo_mono/FunctionWrapper_Unix.cs \ + bindings/mono/eo_mono/NativeModule_Unix.cs + +endif + + efl_eina_mono_files = \ bindings/mono/eina_mono/eina_config.cs \ bindings/mono/eina_mono/eina_array.cs \ @@ -36,9 +53,6 @@ efl_eldbus_mono_files = \ bindings/mono/eldbus_mono/eldbus_proxy.cs \ bindings/mono/eldbus_mono/eldbus_service.cs -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 = \ @@ -46,14 +60,15 @@ lib_efl_mono_libefl_mono_dll_sources = \ bindings/mono/efl_mono/efl_csharp_application.cs \ $(efl_eo_mono_files) \ $(efl_eina_mono_files) \ - $(efl_eldbus_mono_files) \ - $(efl_ecore_evas_mono_files) + $(efl_eldbus_mono_files) efl_mono_test_files = \ tests/efl_mono/dummy_test_object.eo \ tests/efl_mono/dummy_test_iface.eo \ - tests/efl_mono/dummy_another_iface.eo \ + tests/efl_mono/dummy_inherit_iface.eo \ + tests/efl_mono/dummy_inherit_helper.eo \ tests/efl_mono/dummy_child.eo \ + tests/efl_mono/dummy_part_holder.eo \ tests/efl_mono/dummy_numberwrapper.eo \ tests/efl_mono/mono_test_driver.sh @@ -69,30 +84,34 @@ bin_PROGRAMS += bin/eolian_mono/eolian_mono bin_eolian_mono_eolian_mono_SOURCES = \ 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/alias_definition.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/blacklist.hh \ + bin/eolian_mono/eolian/mono/documentation.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/function_declaration.hh \ + bin/eolian_mono/eolian/mono/function_definition.hh \ + bin/eolian_mono/eolian/mono/function_helpers.hh \ + bin/eolian_mono/eolian/mono/function_pointer.hh \ + bin/eolian_mono/eolian/mono/function_registration.hh \ + bin/eolian_mono/eolian/mono/generation_contexts.hh \ + bin/eolian_mono/eolian/mono/helpers.hh \ + bin/eolian_mono/eolian/mono/klass.hh \ + bin/eolian_mono/eolian/mono/logging.hh \ + bin/eolian_mono/eolian/mono/marshall_annotation.hh \ + bin/eolian_mono/eolian/mono/marshall_type.hh \ + bin/eolian_mono/eolian/mono/marshall_type_impl.hh \ + bin/eolian_mono/eolian/mono/name_helpers.hh \ + bin/eolian_mono/eolian/mono/parameter.hh \ + bin/eolian_mono/eolian/mono/part_definition.hh \ + bin/eolian_mono/eolian/mono/struct_definition.hh \ + bin/eolian_mono/eolian/mono/struct_fields.hh \ + bin/eolian_mono/eolian/mono/type.hh \ + bin/eolian_mono/eolian/mono/type_impl.hh \ + bin/eolian_mono/eolian/mono/using_decl.hh \ + bin/eolian_mono/eolian/mono/utils.hh \ + bin/eolian_mono/eolian/mono/variable_definition.hh bin_eolian_mono_eolian_mono_CXXFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/eolian_cxx/ \ @@ -155,15 +174,19 @@ eo_eolian_blacklisted_files = \ lib/eo/efl_object_override.eo.cs elementary_eolian_blacklisted_files = \ -lib/elementary/elm_web.eo.cs \ -lib/elementary/elm_map.eo.cs \ +lib/elementary/elm_web_eo.cs \ +lib/elementary/elm_map_eo.cs \ lib/elementary/elm_combobox.eo.cs \ -lib/elementary/elm_list.eo.cs \ -lib/elementary/elm_genlist.eo.cs \ -lib/elementary/elm_view_list.eo.cs \ -lib/elementary/elm_genlist_item.eo.cs \ -lib/elementary/elm_gengrid.eo.cs \ -lib/elementary/elm_glview.eo.cs +lib/elementary/elm_list_eo.cs \ +lib/elementary/elm_genlist_eo.cs \ +lib/elementary/elm_view_list_eo.cs \ +lib/elementary/elm_genlist_item_eo.cs \ +lib/elementary/elm_gengrid_eo.cs \ +lib/elementary/elm_code_widget.eo.cs \ +lib/elementary/elm_multibuttonentry_part.eo.cs \ +lib/elementary/elm_atspi_bridge.eo.cs \ +lib/elementary/elm_atspi_app_object.eo.cs \ +lib/elementary/elm_glview_eo.cs efl_mono_blacklisted_files = \ $(evas_eolian_blacklisted_files) \ @@ -183,11 +206,9 @@ $(efl_eolian_type_files:%.eot=%.eot.cs) \ $(edje_eolian_type_files:%.eot=%.eot.cs) \ $(elm_eolian_type_files:%.eot=%.eot.cs) \ $(filter-out $(evas_eolian_blacklisted_files),$(evas_canvas_eolian_pub_files:%.eo=%.eo.cs)) \ -lib/evas/canvas/evas_box.eo.cs \ -lib/evas/canvas/evas_image.eo.cs \ +$(evas_gesture_eolian_pub_files:%.eo=%.eo.cs) \ +$(evas_gesture_eolian_type_files:%.eot=%.eot.cs) \ lib/evas/canvas/efl_canvas_image.eo.cs \ -lib/evas/canvas/evas_table.eo.cs \ -lib/evas/canvas/evas_text.eo.cs \ $(evas_canvas_eolian_type_files:%.eot=%.eot.cs) \ lib/eo/eina_types.eot.cs \ lib/ecore/efl_loop_timer.eo.cs @@ -223,6 +244,7 @@ lib_efl_mono_libeflcustomexportsmono_la_SOURCES = \ lib_efl_mono_libeflcustomexportsmono_la_CPPFLAGS = \ -DEFL_BETA_API_SUPPORT \ -I$(top_builddir)/src/lib/efl \ +-DEFL_BUILD \ @EFL_CUSTOM_EXPORTS_MONO_CFLAGS@ lib_efl_mono_libeflcustomexportsmono_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ lib_efl_mono_libeflcustomexportsmono_la_LIBADD = @EFL_CUSTOM_EXPORTS_MONO_LIBS@ @@ -300,7 +322,7 @@ msbuildcsprojs: ../libefl_mono.csproj done ### Some hard-coded runtime dependencies for tests and examples -TEST_PATHS = $(abs_top_builddir)/src/lib/efl_mono:$(abs_top_builddir)/src/lib/efl_mono/.libs:$(abs_top_builddir)/src/lib/eina/.libs:$(abs_top_builddir)/src/lib/ecore/.libs:$(abs_top_builddir)/src/lib/ecore_evas/.libs:$(abs_top_builddir)/src/lib/eo/.libs:$(abs_top_builddir)/src/lib/evas/.libs:$(abs_top_builddir)/src/lib/emile/.libs:$(abs_top_builddir)/src/lib/eet/.libs:$(abs_top_builddir)/src/lib/efl/.libs:$(abs_top_builddir)/src/ecore-file/.libs:$(abs_top_builddir)/src/lib/efl-input/.libs:$(abs_top_builddir)/src/lib/edje/.libs:$(abs_top_builddir)/src/lib/ethumb/.libs:$(abs_top_builddir)/src/lib/ethumb-client/.libs:$(abs_top_builddir)/src/lib/emotion/.libs:$(abs_top_builddir)/src/lib/ecore-imf/.libs:$(abs_top_builddir)/src/lib/ecore-con/.libs:$(abs_top_builddir)/src/lib/eldbus/.libs:$(abs_top_builddir)/src/lib/efreet/.libs:$(abs_top_builddir)/src/lib/efreet-mime/.libs:$(abs_top_builddir)/src/lib/efreet-trash/.libs:$(abs_top_builddir)/src/lib/eio/.libs:$(abs_top_builddir)/src/lib/elocation/.libs:$(abs_top_builddir)/src/lib/elementary/.libs +TEST_PATHS = $(abs_top_builddir)/src/lib/efl_mono:$(abs_top_builddir)/src/lib/efl_mono/.libs:$(abs_top_builddir)/src/lib/eina/.libs:$(abs_top_builddir)/src/lib/ecore/.libs:$(abs_top_builddir)/src/lib/ecore_evas/.libs:$(abs_top_builddir)/src/lib/eo/.libs:$(abs_top_builddir)/src/lib/evas/.libs:$(abs_top_builddir)/src/lib/emile/.libs:$(abs_top_builddir)/src/lib/eet/.libs:$(abs_top_builddir)/src/lib/efl/.libs:$(abs_top_builddir)/src/ecore-file/.libs:$(abs_top_builddir)/src/lib/efl-input/.libs:$(abs_top_builddir)/src/lib/edje/.libs:$(abs_top_builddir)/src/lib/ethumb/.libs:$(abs_top_builddir)/src/lib/ethumb-client/.libs:$(abs_top_builddir)/src/lib/emotion/.libs:$(abs_top_builddir)/src/lib/ecore-imf/.libs:$(abs_top_builddir)/src/lib/ecore-con/.libs:$(abs_top_builddir)/src/lib/eldbus/.libs:$(abs_top_builddir)/src/lib/efreet/.libs:$(abs_top_builddir)/src/lib/efreet-mime/.libs:$(abs_top_builddir)/src/lib/efreet-trash/.libs:$(abs_top_builddir)/src/lib/eio/.libs:$(abs_top_builddir)/src/lib/elocation/.libs:$(abs_top_builddir)/src/lib/elementary/.libs:$(abs_top_builddir)/src/tests/efl_mono/.libs WIN_ADD_TEST_PATHS = $(abs_top_builddir)/src/lib/evil/.libs:$(abs_top_builddir)/src/lib/ecore_win32/.libs:$(abs_top_builddir)/src/lib/ector/.libs:$(abs_top_builddir)/src/lib/ecore_con/.libs:$(abs_top_builddir)/src/lib/ecore_imf/.libs:$(abs_top_builddir)/src/lib/ecore_file/.libs:$(abs_top_builddir)/src/lib/ecore_input/.libs:$(abs_top_builddir)/src/ethumb_client/.libs:$(abs_top_builddir)/src/tests/efl_mono/.libs @@ -392,19 +414,25 @@ tests/efl_mono/libefl_mono_native_test.c: \ tests/efl_mono/dummy_test_object.eo.c \ tests/efl_mono/dummy_test_iface.eo.h \ tests/efl_mono/dummy_test_iface.eo.c \ - tests/efl_mono/dummy_another_iface.eo.h \ - tests/efl_mono/dummy_another_iface.eo.c \ tests/efl_mono/dummy_child.eo.h \ tests/efl_mono/dummy_child.eo.c \ + tests/efl_mono/dummy_part_holder.eo.h \ + tests/efl_mono/dummy_part_holder.eo.c \ tests/efl_mono/dummy_numberwrapper.eo.h \ - tests/efl_mono/dummy_numberwrapper.eo.c + tests/efl_mono/dummy_numberwrapper.eo.c \ + tests/efl_mono/dummy_inherit_iface.eo.h \ + tests/efl_mono/dummy_inherit_iface.eo.c \ + tests/efl_mono/dummy_inherit_helper.eo.h \ + tests/efl_mono/dummy_inherit_helper.eo.c # Intermediate C Sharp test DLL efl_mono_test_eolian_mono_files = tests/efl_mono/dummy_test_object.eo.cs \ tests/efl_mono/dummy_test_iface.eo.cs \ -tests/efl_mono/dummy_another_iface.eo.cs \ tests/efl_mono/dummy_child.eo.cs \ -tests/efl_mono/dummy_numberwrapper.eo.cs +tests/efl_mono/dummy_part_holder.eo.cs \ +tests/efl_mono/dummy_numberwrapper.eo.cs \ +tests/efl_mono/dummy_inherit_iface.eo.cs \ +tests/efl_mono/dummy_inherit_helper.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.config @rm -f tests/efl_mono/libefl_mono_test.dll @@ -454,10 +482,10 @@ tests_efl_mono_efl_mono_SOURCES = \ 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/Inheritance.cs \ tests/efl_mono/Parts.cs \ tests/efl_mono/Promises.cs \ tests/efl_mono/Strbuf.cs \ @@ -468,9 +496,15 @@ tests_efl_mono_efl_mono_SOURCES = \ tests/efl_mono/EinaTestData.cs \ tests/efl_mono/StructHelpers.cs +beta_mono_flags = + +if HAVE_CSHARP_BETA +beta_mono_flags += -define:EFL_BETA +endif + 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) $(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, $(^)) + $(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, $(^)) $(beta_mono_flags) # Rule for generating the .cs files tests/efl_mono/%.eo.cs: tests/efl_mono/%.eo $(_EOLIAN_MONO_DEP) @@ -478,7 +512,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/dummy_test_object.eo.cs tests/efl_mono/dummy_child.eo.cs tests/efl_mono/dummy_numberwrapper.eo.cs tests/efl_mono/dummy_test_object.eo.c tests/efl_mono/dummy_child.eo.c tests/efl_mono/dummy_numberwrapper.eo.c tests/efl_mono/dummy_test_object.eo.h tests/efl_mono/dummy_child.eo.h tests/efl_mono/dummy_numberwrapper.eo.h tests/efl_mono/efl_mono.config +CLEANFILES += tests/efl_mono/libefl_mono_test.dll tests/efl_mono/dummy_test_object.eo.cs tests/efl_mono/dummy_child.eo.cs tests/efl_mono/dummy_numberwrapper.eo.cs tests/efl_mono/dummy_test_object.eo.c tests/efl_mono/dummy_child.eo.c tests/efl_mono/dummy_numberwrapper.eo.c tests/efl_mono/dummy_test_object.eo.h tests/efl_mono/dummy_child.eo.h tests/efl_mono/dummy_part_holder.eo.cs tests/efl_mono/dummy_part_holder.eo.c tests/efl_mono/dummy_part_holder.eo.h tests/efl_mono/dummy_numberwrapper.eo.h tests/efl_mono/efl_mono.config endif diff --git a/src/Makefile_Efreet.am b/src/Makefile_Efreet.am index a8aa02ff2f..c0ad0d7b60 100644 --- a/src/Makefile_Efreet.am +++ b/src/Makefile_Efreet.am @@ -49,21 +49,21 @@ 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_CPPFLAGS = -I$(top_builddir)/src/lib/efl $(EFREET_COMMON_CPPFLAGS) -DEFL_BUILD lib_efreet_libefreet_la_LIBADD = @EFREET_LIBS@ @EVIL_LIBS@ lib_efreet_libefreet_la_DEPENDENCIES = @EFREET_INTERNAL_LIBS@ lib_efreet_libefreet_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ # libefreet_mime.la lib_efreet_libefreet_mime_la_SOURCES = lib/efreet/efreet_mime.c -lib_efreet_libefreet_mime_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl $(EFREET_COMMON_CPPFLAGS) +lib_efreet_libefreet_mime_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl $(EFREET_COMMON_CPPFLAGS) -DEFL_BUILD lib_efreet_libefreet_mime_la_LIBADD = @USE_EFREET_LIBS@ @EVIL_LIBS@ lib_efreet_libefreet_mime_la_DEPENDENCIES = @USE_EFREET_INTERNAL_LIBS@ lib_efreet_libefreet_mime_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ # libefreet_trash.la lib_efreet_libefreet_trash_la_SOURCES = lib/efreet/efreet_trash.c -lib_efreet_libefreet_trash_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl $(EFREET_COMMON_CPPFLAGS) +lib_efreet_libefreet_trash_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl $(EFREET_COMMON_CPPFLAGS) -DEFL_BUILD lib_efreet_libefreet_trash_la_LIBADD = @USE_EFREET_LIBS@ @EVIL_LIBS@ lib_efreet_libefreet_trash_la_DEPENDENCIES = @USE_EFREET_INTERNAL_LIBS@ lib_efreet_libefreet_trash_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ diff --git a/src/Makefile_Eina.am b/src/Makefile_Eina.am index 965bff34ae..40ef392965 100644 --- a/src/Makefile_Eina.am +++ b/src/Makefile_Eina.am @@ -210,7 +210,7 @@ einampchainedpool_LTLIBRARIES = modules/eina/mp/chained_pool/chained_pool_module install_einampchainedpoolLTLIBRARIES = install-einampchainedpoolLTLIBRARIES $(install_einampchainedpoolLTLIBRARIES): install-libLTLIBRARIES -modules_eina_mp_chained_pool_chained_pool_module_la_CFLAGS = $(EINA_MODULE_COMMON_CFLAGS) +modules_eina_mp_chained_pool_chained_pool_module_la_CFLAGS = $(EINA_MODULE_COMMON_CFLAGS) -DEFL_BUILD modules_eina_mp_chained_pool_chained_pool_module_la_LIBADD = @USE_EINA_LIBS@ modules_eina_mp_chained_pool_chained_pool_module_la_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ modules_eina_mp_chained_pool_chained_pool_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@ @@ -229,7 +229,7 @@ einamponebig_LTLIBRARIES = modules/eina/mp/one_big/one_big_module.la install_einamponebigLTLIBRARIES = install-einamponebigLTLIBRARIES $(install_einamponebigLTLIBRARIES): install-libLTLIBRARIES -modules_eina_mp_one_big_one_big_module_la_CFLAGS = $(EINA_MODULE_COMMON_CFLAGS) +modules_eina_mp_one_big_one_big_module_la_CFLAGS = $(EINA_MODULE_COMMON_CFLAGS) -DEFL_BUILD modules_eina_mp_one_big_one_big_module_la_LIBADD = @USE_EINA_LIBS@ modules_eina_mp_one_big_one_big_module_la_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ modules_eina_mp_one_big_one_big_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@ @@ -248,7 +248,7 @@ einamppassthrough_LTLIBRARIES = modules/eina/mp/pass_through/pass_through_module install_einamppassthroughLTLIBRARIES = install-einamppassthroughLTLIBRARIES $(install_einamppassthroughLTLIBRARIES): install-libLTLIBRARIES -modules_eina_mp_pass_through_pass_through_module_la_CFLAGS = $(EINA_MODULE_COMMON_CFLAGS) +modules_eina_mp_pass_through_pass_through_module_la_CFLAGS = $(EINA_MODULE_COMMON_CFLAGS) -DEFL_BUILD modules_eina_mp_pass_through_pass_through_module_la_LIBADD = @USE_EINA_LIBS@ modules_eina_mp_pass_through_pass_through_module_la_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ modules_eina_mp_pass_through_pass_through_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@ @@ -262,6 +262,7 @@ lib_eina_libeina_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/eina\" \ +-DEFL_BUILD \ @VALGRIND_CFLAGS@ lib_eina_libeina_la_LIBADD = @EINA_LIBS@ @UNWIND_LIBS@ @@ -296,7 +297,9 @@ bin_eina_eina_modinfo_eina_modinfo_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ ### Script -bin_SCRIPTS += scripts/eina/eina-bench-cmp +# disabled because its a pretty useless script that forces python as a +# a dependency and doesn't parse anything efl or test apps produce +# bin_SCRIPTS += scripts/eina/eina-bench-cmp ### Unit tests diff --git a/src/Makefile_Eio.am b/src/Makefile_Eio.am index 81a105441d..aa75c5fbcf 100644 --- a/src/Makefile_Eio.am +++ b/src/Makefile_Eio.am @@ -2,7 +2,7 @@ ### Library eio_eolian_files = \ - lib/eio/eio_model.eo \ + lib/eio/efl_io_model.eo \ lib/eio/efl_io_manager.eo \ lib/eio/eio_sentry.eo @@ -11,11 +11,13 @@ eio_eolian_c = $(eio_eolian_files:%.eo=%.eo.c) BUILT_SOURCES += $(eio_eolian_c) $(eio_eolian_h) +if INSTALL_EO_FILES eioeolianfilesdir = $(datadir)/eolian/include/eio-@VMAJ@ eioeolianfiles_DATA = $(eio_eolian_files) +endif lib_LTLIBRARIES += lib/eio/libeio.la -EXTRA_DIST2 += $(eioeolianfiles_DATA) +EXTRA_DIST2 += $(eio_eolian_files) installed_eiomainheadersdir = $(includedir)/eio-@VMAJ@ @@ -38,8 +40,8 @@ lib/eio/eio_monitor.c \ lib/eio/eio_monitor_poll.c \ lib/eio/eio_single.c \ lib/eio/eio_xattr.c \ -lib/eio/eio_model.c \ -lib/eio/eio_model_private.h \ +lib/eio/efl_io_model.c \ +lib/eio/efl_io_model_private.h \ lib/eio/eio_private.h \ lib/eio/eio_sentry_private.h @@ -59,7 +61,7 @@ endif endif endif -lib_eio_libeio_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @EIO_CFLAGS@ @EFL_CFLAGS@ +lib_eio_libeio_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @EIO_CFLAGS@ @EFL_CFLAGS@ -DEFL_BUILD lib_eio_libeio_la_LIBADD = @EIO_LIBS@ @EFL_LIBS@ lib_eio_libeio_la_DEPENDENCIES = @EIO_INTERNAL_LIBS@ @EFL_INTERNAL_LIBS@ lib_eio_libeio_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ @@ -74,8 +76,8 @@ TESTS += tests/eio/eio_suite tests_eio_eio_suite_SOURCES = \ tests/eio/eio_suite.c \ -tests/eio/eio_model_test_file.c \ -tests/eio/eio_model_test_monitor_add.c \ +tests/eio/efl_io_model_test_file.c \ +tests/eio/efl_io_model_test_monitor_add.c \ tests/eio/eio_test_monitor.c \ tests/eio/eio_test_sentry.c \ tests/eio/eio_test_file.c \ diff --git a/src/Makefile_Eldbus.am b/src/Makefile_Eldbus.am index 4e310fc386..dace370ec2 100644 --- a/src/Makefile_Eldbus.am +++ b/src/Makefile_Eldbus.am @@ -21,12 +21,16 @@ BUILT_SOURCES += \ $(eldbus_eolian_c) \ $(eldbus_eolian_h) +if INSTALL_EO_FILES eldbuseolianfilesdir = $(datadir)/eolian/include/eldbus-@VMAJ@ -eldbuseolianfiles_DATA = $(eldbus_eolian_files) \ - $(eldbus_eolian_type_files) +eldbuseolianfiles_DATA = \ +$(eldbus_eolian_files) \ +$(eldbus_eolian_type_files) +endif EXTRA_DIST2 += \ - ${eldbuseolianfiles_DATA} +$(eldbus_eolian_files) \ +$(eldbus_eolian_type_files) lib_LTLIBRARIES += lib/eldbus/libeldbus.la @@ -80,6 +84,7 @@ lib/eldbus/eldbus_introspection.c lib_eldbus_libeldbus_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -include $(top_builddir)/config.h \ +-DEFL_BUILD \ @ELDBUS_CFLAGS@ @EFL_CFLAGS@ lib_eldbus_libeldbus_la_LIBADD = @ELDBUS_LIBS@ @EFL_LIBS@ lib_eldbus_libeldbus_la_DEPENDENCIES = @ELDBUS_INTERNAL_LIBS@ @EFL_INTERNAL_LIBS@ diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index 872cd9b671..f0e2b638cf 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -5,8 +5,8 @@ elm_public_eolian_files = \ lib/elementary/efl_ui_widget.eo \ lib/elementary/efl_ui_bg.eo \ lib/elementary/efl_ui_button.eo \ - lib/elementary/efl_ui_calendar.eo \ - lib/elementary/efl_ui_calendar_item.eo \ + lib/elementary/efl_ui_calendar.eo \ + lib/elementary/efl_ui_calendar_item.eo \ lib/elementary/efl_ui_check.eo \ lib/elementary/efl_ui_flip.eo \ lib/elementary/efl_ui_frame.eo \ @@ -14,6 +14,7 @@ elm_public_eolian_files = \ lib/elementary/efl_ui_image.eo \ lib/elementary/efl_ui_image_zoomable.eo \ lib/elementary/efl_ui_layout.eo \ + lib/elementary/efl_ui_layout_base.eo \ lib/elementary/efl_ui_nstate.eo \ lib/elementary/efl_ui_navigation_bar.eo \ lib/elementary/efl_ui_navigation_bar_part.eo \ @@ -56,10 +57,8 @@ elm_public_eolian_files = \ 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_textpath_legacy.eo \ lib/elementary/efl_ui_l10n.eo \ lib/elementary/efl_ui_clock.eo \ - lib/elementary/efl_ui_cursor.eo \ lib/elementary/efl_ui_image_factory.eo \ lib/elementary/efl_ui_focus_manager.eo \ lib/elementary/efl_ui_focus_manager_calc.eo \ @@ -81,8 +80,6 @@ elm_public_eolian_files = \ lib/elementary/efl_ui_list_view.eo \ lib/elementary/efl_ui_list_view_model.eo \ lib/elementary/efl_ui_list_view_pan.eo \ - lib/elementary/efl_ui_list_view_seg_array.eo \ - lib/elementary/efl_ui_list_view_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 \ @@ -97,8 +94,6 @@ elm_public_eolian_files = \ lib/elementary/efl_ui_grid.eo \ lib/elementary/efl_ui_panes_part.eo \ lib/elementary/efl_ui_progressbar_part.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 \ @@ -135,6 +130,8 @@ elm_public_eolian_files = \ lib/elementary/efl_ui_widget_focus_manager.eo \ lib/elementary/efl_ui_text_part.eo \ lib/elementary/efl_ui_caching_factory.eo \ + lib/elementary/efl_ui_widget_factory.eo \ + lib/elementary/efl_ui_relative_layout.eo \ $(NULL) # More public files -- FIXME @@ -144,21 +141,9 @@ elm_public_eolian_files += \ 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 \ lib/elementary/efl_ui_image_zoomable_pan.eo \ - lib/elementary/elm_pan.eo \ - lib/elementary/elm_toolbar.eo \ - lib/elementary/elm_toolbar_item.eo \ - lib/elementary/elm_view_list.eo \ - lib/elementary/elm_view_form.eo \ - lib/elementary/elm_web.eo \ - lib/elementary/elm_widget_item.eo \ $(NULL) # Private classes (not exposed or shipped) @@ -169,78 +154,22 @@ elm_private_eolian_files = \ lib/elementary/efl_ui_win_part.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 \ + lib/elementary/efl_ui_state_model.eo \ tests/elementary/focus_test.eo \ tests/elementary/focus_test_sub_main.eo \ lib/elementary/efl_ui_selection_manager.eo \ lib/elementary/efl_datetime_manager.eo \ + lib/elementary/efl_ui_list_view_relayout.eo \ + lib/elementary/efl_ui_list_view_precise_layouter.eo \ + lib/elementary/efl_ui_size_model.eo \ + lib/elementary/efl_ui_homogeneous_model.eo \ + lib/elementary/efl_ui_exact_model.eo \ + lib/elementary/efl_ui_average_model.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_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 \ - lib/elementary/elm_clock.eo \ - lib/elementary/elm_colorselector.eo \ - lib/elementary/elm_conformant.eo \ - lib/elementary/elm_ctxpopup.eo \ - lib/elementary/elm_dayselector.eo \ - lib/elementary/elm_entry.eo \ - lib/elementary/elm_fileselector.eo \ - lib/elementary/elm_gengrid.eo \ - lib/elementary/elm_gengrid_pan.eo \ - lib/elementary/elm_genlist.eo \ - lib/elementary/elm_genlist_pan.eo \ - lib/elementary/elm_gesture_layer.eo \ - lib/elementary/elm_glview.eo \ - lib/elementary/elm_hover.eo \ - lib/elementary/elm_index.eo \ - lib/elementary/elm_label.eo \ - lib/elementary/elm_list.eo \ - lib/elementary/elm_map.eo \ - lib/elementary/elm_map_pan.eo \ - lib/elementary/elm_menu.eo \ - lib/elementary/elm_notify.eo \ - lib/elementary/elm_panel.eo \ - lib/elementary/elm_player.eo \ - lib/elementary/elm_plug.eo \ - lib/elementary/elm_popup.eo \ - lib/elementary/elm_route.eo \ - lib/elementary/elm_scroller.eo \ - lib/elementary/elm_sys_notify_interface.eo \ - lib/elementary/elm_sys_notify.eo \ - lib/elementary/elm_sys_notify_dbus.eo \ - lib/elementary/elm_systray.eo \ - lib/elementary/elm_color_item.eo \ - lib/elementary/elm_dayselector_item.eo \ - lib/elementary/elm_flipselector_item.eo \ - lib/elementary/elm_menu_item.eo \ - lib/elementary/elm_ctxpopup_item.eo \ - lib/elementary/elm_index_item.eo \ - lib/elementary/elm_widget_item_static_focus.eo \ - lib/elementary/elm_genlist_item.eo \ - lib/elementary/elm_gengrid_item.eo \ - lib/elementary/elm_list_item.eo \ - lib/elementary/elm_popup_item.eo \ lib/elementary/elm_ctxpopup_part.eo \ lib/elementary/elm_dayselector_part.eo \ lib/elementary/elm_entry_part.eo \ @@ -258,33 +187,6 @@ elm_legacy_eolian_files = \ lib/elementary/elm_actionslider_part.eo \ lib/elementary/elm_bubble_part.eo \ lib/elementary/elm_fileselector_part.eo \ - lib/elementary/elm_access.eo \ - lib/elementary/elm_actionslider.eo \ - lib/elementary/elm_box.eo \ - lib/elementary/elm_bubble.eo \ - lib/elementary/elm_diskselector.eo \ - lib/elementary/elm_diskselector_item.eo \ - lib/elementary/elm_fileselector_button.eo \ - lib/elementary/elm_fileselector_entry.eo \ - lib/elementary/elm_flipselector.eo \ - lib/elementary/elm_grid.eo \ - lib/elementary/elm_hoversel.eo \ - lib/elementary/elm_hoversel_item.eo \ - lib/elementary/elm_icon.eo \ - lib/elementary/elm_inwin.eo \ - lib/elementary/elm_mapbuf.eo \ - lib/elementary/elm_naviframe.eo \ - lib/elementary/elm_naviframe_item.eo \ - lib/elementary/elm_photo.eo \ - lib/elementary/elm_prefs.eo \ - lib/elementary/elm_segment_control.eo \ - lib/elementary/elm_segment_control_item.eo \ - lib/elementary/elm_separator.eo \ - lib/elementary/elm_slideshow.eo \ - lib/elementary/elm_slideshow_item.eo \ - lib/elementary/elm_table.eo \ - lib/elementary/elm_thumb.eo \ - lib/elementary/efl_ui_list_view_precise_layouter.eo \ $(NULL) elm_eolian_type_files = \ @@ -315,24 +217,437 @@ BUILT_SOURCES += \ $(elm_legacy_eolian_eo_h) \ $(elm_legacy_eolian_legacy_h) +if INSTALL_EO_FILES elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@ elementaryeolianfiles_DATA = $(elm_public_eolian_files) $(elm_eolian_type_files) +endif noinst_DATA += $(elm_legacy_eolian_eo_h) -EXTRA_DIST2 += ${elementaryeolianfiles_DATA} $(elm_legacy_eolian_files) $(elm_private_eolian_files) +elm_legacy_eo_files = \ +lib/elementary/efl_ui_bg_legacy_eo.c \ +lib/elementary/efl_ui_button_legacy_eo.c \ +lib/elementary/efl_ui_check_eo.legacy.c \ +lib/elementary/efl_ui_check_legacy_eo.c \ +lib/elementary/efl_ui_flip_legacy_eo.c \ +lib/elementary/efl_ui_flip_eo.legacy.c \ +lib/elementary/efl_ui_frame_legacy_eo.c \ +lib/elementary/efl_ui_frame_eo.legacy.c \ +lib/elementary/efl_ui_image_legacy_eo.c \ +lib/elementary/efl_ui_image_zoomable_eo.legacy.c \ +lib/elementary/efl_ui_image_zoomable_legacy_eo.c \ +lib/elementary/efl_ui_layout_legacy_eo.c \ +lib/elementary/efl_ui_panes_eo.legacy.c \ +lib/elementary/efl_ui_panes_legacy_eo.c \ +lib/elementary/efl_ui_progressbar_legacy_eo.c \ +lib/elementary/efl_ui_radio_eo.legacy.c \ +lib/elementary/efl_ui_radio_legacy_eo.c \ +lib/elementary/efl_ui_textpath_eo.legacy.c \ +lib/elementary/efl_ui_textpath_legacy_eo.c \ +lib/elementary/efl_ui_video_eo.legacy.c \ +lib/elementary/efl_ui_video_legacy_eo.c \ +lib/elementary/efl_ui_widget_eo.legacy.c \ +lib/elementary/efl_ui_win_inlined_legacy_eo.c \ +lib/elementary/efl_ui_win_legacy_eo.c \ +lib/elementary/efl_ui_win_socket_legacy_eo.c \ +lib/elementary/elm_access_eo.c \ +lib/elementary/elm_access_eo.legacy.c \ +lib/elementary/elm_actionslider_eo.c \ +lib/elementary/elm_actionslider_eo.legacy.c \ +lib/elementary/elm_atspi_app_object_eo.c \ +lib/elementary/elm_atspi_bridge_eo.c \ +lib/elementary/elm_atspi_bridge_eo.legacy.c \ +lib/elementary/elm_box_eo.c \ +lib/elementary/elm_box_eo.legacy.c \ +lib/elementary/elm_bubble_eo.c \ +lib/elementary/elm_bubble_eo.legacy.c \ +lib/elementary/elm_calendar_eo.c \ +lib/elementary/elm_calendar_eo.legacy.c \ +lib/elementary/elm_calendar_item_eo.c \ +lib/elementary/elm_clock_eo.c \ +lib/elementary/elm_clock_eo.legacy.c \ +lib/elementary/elm_code_widget_eo.legacy.c \ +lib/elementary/elm_code_widget_legacy_eo.c \ +lib/elementary/elm_color_item_eo.legacy.c \ +lib/elementary/elm_color_item_eo.c \ +lib/elementary/elm_colorselector_eo.legacy.c \ +lib/elementary/elm_colorselector_eo.c \ +lib/elementary/elm_conformant_eo.c \ +lib/elementary/elm_ctxpopup_eo.legacy.c \ +lib/elementary/elm_ctxpopup_eo.c \ +lib/elementary/elm_ctxpopup_item_eo.legacy.c \ +lib/elementary/elm_ctxpopup_item_eo.c \ +lib/elementary/elm_dayselector_eo.legacy.c \ +lib/elementary/elm_dayselector_eo.c \ +lib/elementary/elm_dayselector_item_eo.c \ +lib/elementary/elm_diskselector_eo.legacy.c \ +lib/elementary/elm_diskselector_eo.c \ +lib/elementary/elm_diskselector_item_eo.legacy.c \ +lib/elementary/elm_diskselector_item_eo.c \ +lib/elementary/elm_entry_eo.legacy.c \ +lib/elementary/elm_entry_eo.c \ +lib/elementary/elm_fileselector_button_eo.c \ +lib/elementary/elm_fileselector_entry_eo.c \ +lib/elementary/elm_fileselector_eo.legacy.c \ +lib/elementary/elm_fileselector_eo.c \ +lib/elementary/elm_flipselector_eo.legacy.c \ +lib/elementary/elm_flipselector_eo.c \ +lib/elementary/elm_flipselector_item_eo.legacy.c \ +lib/elementary/elm_flipselector_item_eo.c \ +lib/elementary/elm_gengrid_eo.legacy.c \ +lib/elementary/elm_gengrid_eo.c \ +lib/elementary/elm_gengrid_item_eo.legacy.c \ +lib/elementary/elm_gengrid_item_eo.c \ +lib/elementary/elm_gengrid_pan_eo.c \ +lib/elementary/elm_genlist_eo.legacy.c \ +lib/elementary/elm_genlist_eo.c \ +lib/elementary/elm_genlist_item_eo.legacy.c \ +lib/elementary/elm_genlist_item_eo.c \ +lib/elementary/elm_genlist_pan_eo.c \ +lib/elementary/elm_gesture_layer_eo.legacy.c \ +lib/elementary/elm_gesture_layer_eo.c \ +lib/elementary/elm_glview_eo.legacy.c \ +lib/elementary/elm_glview_eo.c \ +lib/elementary/elm_grid_eo.legacy.c \ +lib/elementary/elm_grid_eo.c \ +lib/elementary/elm_hover_eo.legacy.c \ +lib/elementary/elm_hover_eo.c \ +lib/elementary/elm_hoversel_eo.c \ +lib/elementary/elm_hoversel_eo.legacy.c \ +lib/elementary/elm_hoversel_item_eo.c \ +lib/elementary/elm_hoversel_item_eo.legacy.c \ +lib/elementary/elm_icon_eo.c \ +lib/elementary/elm_index_eo.c \ +lib/elementary/elm_index_eo.legacy.c \ +lib/elementary/elm_index_item_eo.c \ +lib/elementary/elm_index_item_eo.legacy.c \ +lib/elementary/elm_interface_fileselector_eo.c \ +lib/elementary/elm_inwin_eo.c \ +lib/elementary/elm_inwin_eo.legacy.c \ +lib/elementary/elm_label_eo.c \ +lib/elementary/elm_label_eo.legacy.c \ +lib/elementary/elm_list_eo.c \ +lib/elementary/elm_list_eo.legacy.c \ +lib/elementary/elm_list_item_eo.c \ +lib/elementary/elm_list_item_eo.legacy.c \ +lib/elementary/elm_mapbuf_eo.c \ +lib/elementary/elm_mapbuf_eo.legacy.c \ +lib/elementary/elm_map_eo.c \ +lib/elementary/elm_map_eo.legacy.c \ +lib/elementary/elm_map_pan_eo.c \ +lib/elementary/elm_menu_eo.c \ +lib/elementary/elm_menu_eo.legacy.c \ +lib/elementary/elm_menu_item_eo.c \ +lib/elementary/elm_menu_item_eo.legacy.c \ +lib/elementary/elm_multibuttonentry_eo.c \ +lib/elementary/elm_multibuttonentry_eo.legacy.c \ +lib/elementary/elm_multibuttonentry_item_eo.c \ +lib/elementary/elm_multibuttonentry_item_eo.legacy.c \ +lib/elementary/elm_naviframe_eo.c \ +lib/elementary/elm_naviframe_eo.legacy.c \ +lib/elementary/elm_naviframe_item_eo.c \ +lib/elementary/elm_naviframe_item_eo.legacy.c \ +lib/elementary/elm_notify_eo.c \ +lib/elementary/elm_notify_eo.legacy.c \ +lib/elementary/elm_panel_eo.c \ +lib/elementary/elm_panel_eo.legacy.c \ +lib/elementary/elm_pan_eo.c \ +lib/elementary/elm_pan_eo.legacy.c \ +lib/elementary/elm_photo_eo.c \ +lib/elementary/elm_player_eo.c \ +lib/elementary/elm_plug_eo.c \ +lib/elementary/elm_plug_eo.legacy.c \ +lib/elementary/elm_popup_eo.c \ +lib/elementary/elm_popup_eo.legacy.c \ +lib/elementary/elm_popup_item_eo.c \ +lib/elementary/elm_prefs_eo.c \ +lib/elementary/elm_prefs_eo.legacy.c \ +lib/elementary/elm_route_eo.c \ +lib/elementary/elm_route_eo.legacy.c \ +lib/elementary/elm_scroller_eo.c \ +lib/elementary/elm_scroller_eo.legacy.c \ +lib/elementary/elm_segment_control_eo.c \ +lib/elementary/elm_segment_control_eo.legacy.c \ +lib/elementary/elm_segment_control_item_eo.c \ +lib/elementary/elm_segment_control_item_eo.legacy.c \ +lib/elementary/elm_separator_eo.c \ +lib/elementary/elm_separator_eo.legacy.c \ +lib/elementary/elm_slider_eo.c \ +lib/elementary/elm_slider_part_indicator_eo.c \ +lib/elementary/elm_slideshow_eo.c \ +lib/elementary/elm_slideshow_eo.legacy.c \ +lib/elementary/elm_slideshow_item_eo.c \ +lib/elementary/elm_slideshow_item_eo.legacy.c \ +lib/elementary/elm_spinner_eo.c \ +lib/elementary/elm_spinner_eo.legacy.c \ +lib/elementary/elm_sys_notify_dbus_eo.c \ +lib/elementary/elm_sys_notify_eo.c \ +lib/elementary/elm_sys_notify_eo.legacy.c \ +lib/elementary/elm_sys_notify_interface_eo.c \ +lib/elementary/elm_sys_notify_interface_eo.legacy.c \ +lib/elementary/elm_systray_eo.c \ +lib/elementary/elm_systray_eo.legacy.c \ +lib/elementary/elm_table_eo.c \ +lib/elementary/elm_table_eo.legacy.c \ +lib/elementary/elm_thumb_eo.c \ +lib/elementary/elm_toolbar_eo.c \ +lib/elementary/elm_toolbar_eo.legacy.c \ +lib/elementary/elm_toolbar_item_eo.c \ +lib/elementary/elm_toolbar_item_eo.legacy.c \ +lib/elementary/elm_view_form_eo.c \ +lib/elementary/elm_view_list_eo.c \ +lib/elementary/elm_web_eo.c \ +lib/elementary/elm_web_eo.legacy.c \ +lib/elementary/elm_widget_item_container_eo.c \ +lib/elementary/elm_widget_item_eo.c \ +lib/elementary/elm_widget_item_eo.legacy.c \ +lib/elementary/elm_widget_item_static_focus_eo.c \ +lib/elementary/efl_ui_focus_parent_provider_gen_eo.c \ +$(NULL) + +elm_legacy_eo_headers_pub = \ +lib/elementary/efl_ui_bg_eo.legacy.h \ +lib/elementary/efl_ui_bg_legacy_eo.legacy.h \ +lib/elementary/efl_ui_button_eo.legacy.h \ +lib/elementary/efl_ui_button_legacy_eo.legacy.h \ +lib/elementary/efl_ui_check_eo.legacy.h \ +lib/elementary/efl_ui_check_legacy_eo.legacy.h \ +lib/elementary/efl_ui_flip_eo.legacy.h \ +lib/elementary/efl_ui_flip_legacy_eo.legacy.h \ +lib/elementary/efl_ui_frame_eo.legacy.h \ +lib/elementary/efl_ui_frame_legacy_eo.legacy.h \ +lib/elementary/efl_ui_image_legacy_eo.legacy.h \ +lib/elementary/efl_ui_image_zoomable_eo.legacy.h \ +lib/elementary/efl_ui_image_zoomable_legacy_eo.legacy.h \ +lib/elementary/efl_ui_layout_legacy_eo.legacy.h \ +lib/elementary/efl_ui_panes_eo.legacy.h \ +lib/elementary/efl_ui_panes_legacy_eo.legacy.h \ +lib/elementary/efl_ui_progressbar_legacy_eo.legacy.h \ +lib/elementary/efl_ui_radio_eo.legacy.h \ +lib/elementary/efl_ui_radio_legacy_eo.legacy.h \ +lib/elementary/efl_ui_textpath_eo.legacy.h \ +lib/elementary/efl_ui_textpath_legacy_eo.legacy.h \ +lib/elementary/efl_ui_video_eo.legacy.h \ +lib/elementary/efl_ui_video_legacy_eo.legacy.h \ +lib/elementary/efl_ui_widget_eo.legacy.h \ +lib/elementary/efl_ui_win_inlined_legacy_eo.legacy.h \ +lib/elementary/efl_ui_win_legacy_eo.legacy.h \ +lib/elementary/efl_ui_win_socket_legacy_eo.legacy.h \ +lib/elementary/elm_access_eo.legacy.h \ +lib/elementary/elm_actionslider_eo.legacy.h \ +lib/elementary/elm_atspi_app_object_eo.legacy.h \ +lib/elementary/elm_atspi_bridge_eo.legacy.h \ +lib/elementary/elm_box_eo.legacy.h \ +lib/elementary/elm_bubble_eo.legacy.h \ +lib/elementary/elm_calendar_eo.legacy.h \ +lib/elementary/elm_calendar_item_eo.legacy.h \ +lib/elementary/elm_clock_eo.legacy.h \ +lib/elementary/elm_code_widget_eo.legacy.h \ +lib/elementary/elm_code_widget_legacy_eo.legacy.h \ +lib/elementary/elm_color_item_eo.legacy.h \ +lib/elementary/elm_colorselector_eo.legacy.h \ +lib/elementary/elm_conformant_eo.legacy.h \ +lib/elementary/elm_ctxpopup_eo.legacy.h \ +lib/elementary/elm_ctxpopup_item_eo.legacy.h \ +lib/elementary/elm_dayselector_eo.legacy.h \ +lib/elementary/elm_dayselector_item_eo.legacy.h \ +lib/elementary/elm_diskselector_eo.legacy.h \ +lib/elementary/elm_diskselector_item_eo.legacy.h \ +lib/elementary/elm_entry_eo.legacy.h \ +lib/elementary/elm_fileselector_button_eo.legacy.h \ +lib/elementary/elm_fileselector_entry_eo.legacy.h \ +lib/elementary/elm_fileselector_eo.legacy.h \ +lib/elementary/elm_flipselector_eo.legacy.h \ +lib/elementary/elm_flipselector_item_eo.legacy.h \ +lib/elementary/elm_gengrid_eo.legacy.h \ +lib/elementary/elm_gengrid_item_eo.legacy.h \ +lib/elementary/elm_gengrid_pan_eo.legacy.h \ +lib/elementary/elm_genlist_eo.legacy.h \ +lib/elementary/elm_genlist_item_eo.legacy.h \ +lib/elementary/elm_genlist_pan_eo.legacy.h \ +lib/elementary/elm_gesture_layer_eo.legacy.h \ +lib/elementary/elm_glview_eo.legacy.h \ +lib/elementary/elm_grid_eo.legacy.h \ +lib/elementary/elm_hover_eo.legacy.h \ +lib/elementary/elm_hoversel_eo.legacy.h \ +lib/elementary/elm_hoversel_item_eo.legacy.h \ +lib/elementary/elm_icon_eo.legacy.h \ +lib/elementary/elm_index_eo.legacy.h \ +lib/elementary/elm_index_item_eo.legacy.h \ +lib/elementary/elm_interface_fileselector_eo.legacy.h \ +lib/elementary/elm_inwin_eo.legacy.h \ +lib/elementary/elm_label_eo.legacy.h \ +lib/elementary/elm_list_eo.legacy.h \ +lib/elementary/elm_list_item_eo.legacy.h \ +lib/elementary/elm_mapbuf_eo.legacy.h \ +lib/elementary/elm_map_eo.legacy.h \ +lib/elementary/elm_map_pan_eo.legacy.h \ +lib/elementary/elm_menu_eo.legacy.h \ +lib/elementary/elm_menu_item_eo.legacy.h \ +lib/elementary/elm_multibuttonentry_eo.legacy.h \ +lib/elementary/elm_multibuttonentry_item_eo.legacy.h \ +lib/elementary/elm_naviframe_eo.legacy.h \ +lib/elementary/elm_naviframe_item_eo.legacy.h \ +lib/elementary/elm_notify_eo.legacy.h \ +lib/elementary/elm_panel_eo.legacy.h \ +lib/elementary/elm_pan_eo.legacy.h \ +lib/elementary/elm_photo_eo.legacy.h \ +lib/elementary/elm_player_eo.legacy.h \ +lib/elementary/elm_plug_eo.legacy.h \ +lib/elementary/elm_popup_eo.legacy.h \ +lib/elementary/elm_popup_item_eo.legacy.h \ +lib/elementary/elm_prefs_eo.legacy.h \ +lib/elementary/elm_route_eo.legacy.h \ +lib/elementary/elm_scroller_eo.legacy.h \ +lib/elementary/elm_segment_control_eo.legacy.h \ +lib/elementary/elm_segment_control_item_eo.legacy.h \ +lib/elementary/elm_separator_eo.legacy.h \ +lib/elementary/elm_slider_eo.legacy.h \ +lib/elementary/elm_slider_part_indicator_eo.legacy.h \ +lib/elementary/elm_slideshow_eo.legacy.h \ +lib/elementary/elm_slideshow_item_eo.legacy.h \ +lib/elementary/elm_spinner_eo.legacy.h \ +lib/elementary/elm_sys_notify_dbus_eo.legacy.h \ +lib/elementary/elm_sys_notify_eo.legacy.h \ +lib/elementary/elm_sys_notify_interface_eo.legacy.h \ +lib/elementary/elm_systray_eo.legacy.h \ +lib/elementary/elm_table_eo.legacy.h \ +lib/elementary/elm_thumb_eo.legacy.h \ +lib/elementary/elm_toolbar_eo.legacy.h \ +lib/elementary/elm_toolbar_item_eo.legacy.h \ +lib/elementary/elm_view_form_eo.legacy.h \ +lib/elementary/elm_view_list_eo.legacy.h \ +lib/elementary/elm_view_form_eo.h \ +lib/elementary/elm_view_list_eo.h \ +lib/elementary/elm_web_eo.legacy.h \ +lib/elementary/elm_widget_item_container_eo.legacy.h \ +lib/elementary/elm_widget_item_container_eo.h \ +lib/elementary/elm_widget_item_eo.legacy.h \ +lib/elementary/elm_widget_item_static_focus_eo.legacy.h + +elm_legacy_eo_headers_priv = \ +lib/elementary/efl_ui_bg_legacy_eo.h \ +lib/elementary/efl_ui_button_legacy_eo.h \ +lib/elementary/efl_ui_check_legacy_eo.h \ +lib/elementary/efl_ui_flip_legacy_eo.h \ +lib/elementary/efl_ui_frame_legacy_eo.h \ +lib/elementary/efl_ui_image_legacy_eo.h \ +lib/elementary/efl_ui_image_zoomable_legacy_eo.h \ +lib/elementary/efl_ui_layout_legacy_eo.h \ +lib/elementary/efl_ui_panes_legacy_eo.h \ +lib/elementary/efl_ui_progressbar_legacy_eo.h \ +lib/elementary/efl_ui_radio_legacy_eo.h \ +lib/elementary/efl_ui_textpath_legacy_eo.h \ +lib/elementary/efl_ui_video_legacy_eo.h \ +lib/elementary/efl_ui_win_inlined_legacy_eo.h \ +lib/elementary/efl_ui_win_legacy_eo.h \ +lib/elementary/efl_ui_win_socket_legacy_eo.h \ +lib/elementary/elm_access_eo.h \ +lib/elementary/elm_actionslider_eo.h \ +lib/elementary/elm_atspi_app_object_eo.h \ +lib/elementary/elm_atspi_bridge_eo.h \ +lib/elementary/elm_box_eo.h \ +lib/elementary/elm_bubble_eo.h \ +lib/elementary/elm_calendar_eo.h \ +lib/elementary/elm_calendar_item_eo.h \ +lib/elementary/elm_clock_eo.h \ +lib/elementary/elm_code_widget_legacy_eo.h \ +lib/elementary/elm_color_item_eo.h \ +lib/elementary/elm_colorselector_eo.h \ +lib/elementary/elm_conformant_eo.h \ +lib/elementary/elm_ctxpopup_eo.h \ +lib/elementary/elm_ctxpopup_item_eo.h \ +lib/elementary/elm_dayselector_eo.h \ +lib/elementary/elm_dayselector_item_eo.h \ +lib/elementary/elm_diskselector_eo.h \ +lib/elementary/elm_diskselector_item_eo.h \ +lib/elementary/elm_entry_eo.h \ +lib/elementary/elm_fileselector_button_eo.h \ +lib/elementary/elm_fileselector_entry_eo.h \ +lib/elementary/elm_fileselector_eo.h \ +lib/elementary/elm_flipselector_eo.h \ +lib/elementary/elm_flipselector_item_eo.h \ +lib/elementary/elm_gengrid_eo.h \ +lib/elementary/elm_gengrid_item_eo.h \ +lib/elementary/elm_gengrid_pan_eo.h \ +lib/elementary/elm_gengrid_pan_eo.h \ +lib/elementary/elm_genlist_eo.h \ +lib/elementary/elm_genlist_item_eo.h \ +lib/elementary/elm_genlist_pan_eo.h \ +lib/elementary/elm_gesture_layer_eo.h \ +lib/elementary/elm_glview_eo.h \ +lib/elementary/elm_grid_eo.h \ +lib/elementary/elm_hover_eo.h \ +lib/elementary/elm_hoversel_eo.h \ +lib/elementary/elm_hoversel_item_eo.h \ +lib/elementary/elm_icon_eo.h \ +lib/elementary/elm_index_eo.h \ +lib/elementary/elm_index_item_eo.h \ +lib/elementary/elm_interface_fileselector_eo.h \ +lib/elementary/elm_inwin_eo.h \ +lib/elementary/elm_label_eo.h \ +lib/elementary/elm_list_eo.h \ +lib/elementary/elm_list_item_eo.h \ +lib/elementary/elm_mapbuf_eo.h \ +lib/elementary/elm_map_eo.h \ +lib/elementary/elm_map_pan_eo.h \ +lib/elementary/elm_menu_eo.h \ +lib/elementary/elm_menu_item_eo.h \ +lib/elementary/elm_multibuttonentry_eo.h \ +lib/elementary/elm_multibuttonentry_item_eo.h \ +lib/elementary/elm_naviframe_eo.h \ +lib/elementary/elm_naviframe_item_eo.h \ +lib/elementary/elm_notify_eo.h \ +lib/elementary/elm_panel_eo.h \ +lib/elementary/elm_pan_eo.h \ +lib/elementary/elm_photo_eo.h \ +lib/elementary/elm_player_eo.h \ +lib/elementary/elm_plug_eo.h \ +lib/elementary/elm_popup_eo.h \ +lib/elementary/elm_popup_item_eo.h \ +lib/elementary/elm_prefs_eo.h \ +lib/elementary/elm_route_eo.h \ +lib/elementary/elm_scroller_eo.h \ +lib/elementary/elm_segment_control_eo.h \ +lib/elementary/elm_segment_control_item_eo.h \ +lib/elementary/elm_separator_eo.h \ +lib/elementary/elm_slider_eo.h \ +lib/elementary/elm_slider_part_indicator_eo.h \ +lib/elementary/elm_slideshow_eo.h \ +lib/elementary/elm_slideshow_item_eo.h \ +lib/elementary/elm_spinner_eo.h \ +lib/elementary/elm_sys_notify_dbus_eo.h \ +lib/elementary/elm_sys_notify_eo.h \ +lib/elementary/elm_sys_notify_interface_eo.h \ +lib/elementary/elm_systray_eo.h \ +lib/elementary/elm_table_eo.h \ +lib/elementary/elm_thumb_eo.h \ +lib/elementary/elm_toolbar_eo.h \ +lib/elementary/elm_toolbar_item_eo.h \ +lib/elementary/elm_web_eo.h \ +lib/elementary/elm_widget_item_container_eo.h \ +lib/elementary/elm_widget_item_eo.h \ +lib/elementary/elm_widget_item_static_focus_eo.h \ +lib/elementary/efl_ui_focus_parent_provider_gen_eo.h \ +lib/elementary/elm_removed.h \ +lib/elementary/elm_widget_bg.h \ +lib/elementary/elm_widget_clipper.h \ +$(NULL) + + +EXTRA_DIST2 += $(elm_public_eolian_files) $(elm_eolian_type_files) $(elm_legacy_eolian_files) $(elm_private_eolian_files) $(elm_legacy_eo_files) $(elm_legacy_eo_headers_priv) lib_LTLIBRARIES += lib/elementary/libelementary.la includes_HEADERS = \ lib/elementary/Elementary.h \ lib/elementary/Elementary_Options.h \ -lib/elementary/Elementary_Cursor.h +lib/elementary/Elementary_Cursor.h \ +$(elm_legacy_eo_headers_pub) includesdir = $(includedir)/elementary-@VMAJ@ includesunstable_HEADERS = \ lib/elementary/elm_gen_common.h \ - lib/elementary/elm_atspi_bridge.h \ lib/elementary/efl_access_object.h \ lib/elementary/efl_access_text.h \ lib/elementary/efl_access_widget_action.h \ @@ -341,6 +656,7 @@ includesunstable_HEADERS = \ lib/elementary/elm_interface_scrollable.h \ lib/elementary/elm_interfaces.h \ lib/elementary/elm_widget.h \ + lib/elementary/efl_ui_widget_common.h \ lib/elementary/elm_widget_actionslider.h \ lib/elementary/elm_widget_box.h \ lib/elementary/elm_widget_bubble.h \ @@ -452,7 +768,8 @@ includesunstable_HEADERS = \ 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 + lib/elementary/efl_ui_tab_page_private.h \ + lib/elementary/efl_ui_relative_layout_private.h includesunstabledir = $(includedir)/elementary-@VMAJ@ nodist_includesunstable_HEADERS = \ @@ -487,6 +804,7 @@ includesub_HEADERS = \ lib/elementary/elm_actionslider_legacy.h \ lib/elementary/elm_app.h \ lib/elementary/elm_atspi_app_object.h \ + lib/elementary/elm_atspi_bridge.h \ lib/elementary/elm_authors.h \ lib/elementary/elm_bg.h \ lib/elementary/elm_bg_legacy.h \ @@ -673,6 +991,8 @@ includesub_HEADERS = \ includesubdir = $(includedir)/elementary-@VMAJ@/ +lib/elementary/elm_config.c: lib/elementary/elm_default_config.x + lib_elementary_libelementary_la_SOURCES = \ lib/elementary/elm_priv.h \ static_libs/atspi/atspi-constants.h \ @@ -809,6 +1129,7 @@ lib_elementary_libelementary_la_SOURCES = \ lib/elementary/elm_view_form.c \ lib/elementary/elm_web2.c \ lib/elementary/efl_ui_widget.c \ + lib/elementary/efl_ui_widget_common.c \ lib/elementary/efl_ui_win.c \ lib/elementary/efl_ui_win_inlined.c \ lib/elementary/efl_ui_win_socket.c \ @@ -817,6 +1138,8 @@ lib_elementary_libelementary_la_SOURCES = \ lib/elementary/els_cursor.c \ lib/elementary/els_tooltip.c \ lib/elementary/elu_ews_wm.c \ + lib/elementary/efl_ui_container_layout.c \ + lib/elementary/efl_ui_container_layout.h \ lib/elementary/efl_ui_box.c \ lib/elementary/efl_ui_box_flow.c \ lib/elementary/efl_ui_box_stack.c \ @@ -829,6 +1152,7 @@ lib_elementary_libelementary_la_SOURCES = \ lib/elementary/efl_ui_anchor_popup.c \ lib/elementary/efl_ui_table.c \ lib/elementary/efl_ui_table_static.c \ + lib/elementary/efl_ui_table_layout.c \ lib/elementary/efl_ui_table_private.h \ lib/elementary/efl_ui_text.c \ lib/elementary/efl_ui_text_factory_images.c \ @@ -885,6 +1209,12 @@ lib_elementary_libelementary_la_SOURCES = \ lib/elementary/efl_ui_tab_page.c \ lib/elementary/efl_ui_widget_focus_manager.c \ lib/elementary/efl_ui_caching_factory.c \ + lib/elementary/efl_ui_widget_factory.c \ + lib/elementary/efl_ui_size_model.c \ + lib/elementary/efl_ui_homogeneous_model.c \ + lib/elementary/efl_ui_exact_model.c \ + lib/elementary/efl_ui_average_model.c \ + lib/elementary/efl_ui_relative_layout.c \ $(NULL) @@ -913,7 +1243,7 @@ lib_elementary_libelementary_la_CPPFLAGS = \ -DLOCALE_DIR=\"$(localedir)\" \ -DICON_DIR=\"$(datadir)/icons\" \ -DELM_TOP_BUILD_DIR=\"$(top_builddir)\" \ --DELEMENTARY_BUILD \ +-DEFL_BUILD \ @ELEMENTARY_CFLAGS@ if HAVE_WINDOWS @@ -983,7 +1313,6 @@ bin/elementary/test_efl_anim_scale.c \ bin/elementary/test_efl_anim_translate.c \ bin/elementary/test_efl_anim_group_parallel.c \ bin/elementary/test_efl_anim_group_sequential.c \ -bin/elementary/test_efl_anim_event_anim.c \ bin/elementary/test_efl_anim_pause.c \ bin/elementary/test_efl_anim_repeat.c \ bin/elementary/test_efl_anim_start_delay.c \ @@ -995,7 +1324,7 @@ bin/elementary/test_entry_anchor2.c \ bin/elementary/test_events.c \ bin/elementary/test_evas_mask.c \ bin/elementary/test_evas_map.c \ -bin/elementary/test_efl_gfx_map.c \ +bin/elementary/test_efl_gfx_mapping.c \ bin/elementary/test_evas_snapshot.c \ bin/elementary/test_external.c \ bin/elementary/test_fileselector_button.c \ @@ -1081,6 +1410,7 @@ bin/elementary/test_tooltip.c \ bin/elementary/test_transit.c \ bin/elementary/test_transit_bezier.c \ bin/elementary/test_ui_box.c \ +bin/elementary/test_ui_box_stack.c \ bin/elementary/test_ui_clock.c \ bin/elementary/test_ui_table.c \ bin/elementary/test_ui_popup.c \ @@ -1101,6 +1431,9 @@ 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_ui_pager.c \ +bin/elementary/test_ui_pager_scroll.c \ +bin/elementary/test_ui_relative_layout.c \ bin/elementary/test.h bin_elementary_elementary_test_LDADD = @USE_ELEMENTARY_LIBS@ @@ -1225,6 +1558,7 @@ modules_elementary_access_output_module_la_CPPFLAGS = \ -I$(top_builddir)/src/lib/elementary \ -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ +-DEFL_BUILD \ @ELEMENTARY_CFLAGS@ modules_elementary_access_output_module_la_LIBADD = @USE_ELEMENTARY_LIBS@ modules_elementary_access_output_module_la_DEPENDENCIES = @USE_ELEMENTARY_INTERNAL_LIBS@ @@ -1252,6 +1586,7 @@ modules_elementary_clock_input_ctxpopup_module_la_CPPFLAGS = \ -I$(top_builddir)/src/lib/elementary \ -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ +-DEFL_BUILD \ @ELEMENTARY_CFLAGS@ modules_elementary_clock_input_ctxpopup_module_la_LIBADD = @USE_ELEMENTARY_LIBS@ modules_elementary_clock_input_ctxpopup_module_la_DEPENDENCIES = @USE_ELEMENTARY_INTERNAL_LIBS@ @@ -1267,7 +1602,7 @@ EXTRA_DIST2 += modules/elementary/prefs/elm_prefs_swallow.edc prefs_filesdir = $(libdir)/elementary/modules/prefs/$(MODULE_ARCH) prefs_files_DATA = modules/elementary/prefs/elm_prefs_swallow.edj -CLEANFILES += $(prefs_files_DATA) +CLEANFILES += $(prefs_files_DATA) lib/elementary/elm_default_config.x modules/elementary/prefs/elm_prefs_swallow.edj: modules/elementary/prefs/elm_prefs_swallow.edc bin/edje/edje_cc${EXEEXT} $(AM_V_EDJ) \ @@ -1307,6 +1642,7 @@ modules_elementary_prefs_module_la_CPPFLAGS = \ -I$(top_builddir)/src/lib/elementary \ -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ +-DEFL_BUILD \ @ELEMENTARY_CFLAGS@ if HAVE_WINDOWS @@ -1341,6 +1677,7 @@ modules_elementary_test_entry_module_la_CPPFLAGS = \ -I$(top_builddir)/src/lib/elementary \ -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ +-DEFL_BUILD \ @ELEMENTARY_CFLAGS@ modules_elementary_test_entry_module_la_LIBADD = @USE_ELEMENTARY_LIBS@ modules_elementary_test_entry_module_la_DEPENDENCIES = @USE_ELEMENTARY_INTERNAL_LIBS@ @@ -1367,6 +1704,7 @@ modules_elementary_test_map_module_la_CPPFLAGS = \ -I$(top_builddir)/src/lib/elementary \ -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ +-DEFL_BUILD \ @ELEMENTARY_CFLAGS@ modules_elementary_test_map_module_la_LIBADD = @USE_ELEMENTARY_LIBS@ modules_elementary_test_map_module_la_DEPENDENCIES = @USE_ELEMENTARY_INTERNAL_LIBS@ @@ -1383,13 +1721,10 @@ moduleweb_nonepkg_LTLIBRARIES = modules/elementary/web/none/module.la install_moduleweb_nonepkgLTLIBRARIES = install-moduleweb_nonepkgLTLIBRARIES $(install_moduleweb_nonepkgLTLIBRARIES): install-libLTLIBRARIES -elm_web_none_eolian_files = modules/elementary/web/none/elm_web_none.eo -elm_web_none_eolian_c = $(elm_web_none_eolian_files:%.eo=%.eo.c) -elm_web_none_eolian_h = $(elm_web_none_eolian_files:%.eo=%.eo.h) - -EXTRA_DIST2 += $(elm_web_none_eolian_files) -BUILT_SOURCES += $(elm_web_none_eolian_c) $(elm_web_none_eolian_h) +EXTRA_DIST2 += \ +modules/elementary/web/none/elm_web_none_eo.c \ +modules/elementary/web/none/elm_web_none_eo.h modules_elementary_web_none_module_la_SOURCES = \ modules/elementary/web/none/elm_web_none.c @@ -1405,6 +1740,7 @@ modules_elementary_web_none_module_la_CPPFLAGS = \ -I$(top_builddir)/src/modules/elementary/web/none \ -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ +-DEFL_BUILD \ @ELEMENTARY_CFLAGS@ modules_elementary_web_none_module_la_LIBADD = @USE_ELEMENTARY_LIBS@ modules_elementary_web_none_module_la_DEPENDENCIES = @USE_ELEMENTARY_INTERNAL_LIBS@ @@ -1474,6 +1810,7 @@ edje_external_elementary_module_la_CPPFLAGS = \ -I$(top_builddir)/src/edje_externals \ -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ +-DEFL_BUILD \ @ELEMENTARY_CFLAGS@ edje_external_elementary_module_la_LIBADD = @USE_ELEMENTARY_LIBS@ edje_external_elementary_module_la_DEPENDENCIES = @USE_ELEMENTARY_INTERNAL_LIBS@ @@ -1482,6 +1819,8 @@ edje_external_elementary_module_la_LIBTOOLFLAGS = --tag=disable-static testfilesdir = $(datadir)/elementary/ testfiles_DATA = \ + tests/elementary/testfile_entry.txt \ + tests/elementary/testfile_entry2.txt \ tests/elementary/testfile.txt \ tests/elementary/testfile-windows.txt \ tests/elementary/testfile-withblanks.txt \ @@ -1501,7 +1840,9 @@ 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/suite_helpers.c \ tests/elementary/elm_suite.c \ + tests/elementary/elm_suite_build.c \ tests/elementary/elm_test_atspi.c \ tests/elementary/elm_test_check.c \ tests/elementary/elm_test_colorselector.c \ @@ -1579,11 +1920,6 @@ tests_elementary_elm_suite_SOURCES = \ tests/elementary/elm_code_test_widget_text.c \ tests/elementary/elm_code_test_widget_selection.c \ tests/elementary/elm_code_test_widget_undo.c \ - tests/elementary/elm_test_focus_common.c \ - tests/elementary/elm_test_focus_common.h \ - tests/elementary/elm_test_focus.c \ - tests/elementary/elm_test_focus_sub.c \ - tests/elementary/efl_ui_test_grid.c \ tests/elementary/elm_test_widget_focus.c tests_elementary_elm_suite_CPPFLAGS = \ @@ -1604,9 +1940,32 @@ tests_elementary_elm_suite_LDADD = @CHECK_LIBS@ @USE_ELEMENTARY_LIBS@ tests_elementary_elm_suite_DEPENDENCIES = @USE_ELEMENTARY_INTERNAL_LIBS@ tests_elementary_efl_ui_suite_SOURCES = \ - tests/elementary/efl_ui_suite.c + tests/elementary/suite_helpers.c \ + tests/elementary/suite_helpers.h \ + tests/elementary/efl_ui_suite.c \ + tests/elementary/efl_ui_build.c \ + tests/elementary/elm_test_init.c \ + tests/elementary/efl_ui_test_atspi.c \ + tests/elementary/efl_ui_test_callback.c \ + tests/elementary/efl_ui_test_focus_common.c \ + tests/elementary/efl_ui_test_focus_common.h \ + tests/elementary/efl_ui_test_focus.c \ + tests/elementary/efl_ui_test_focus_sub.c \ + tests/elementary/efl_ui_test_box.c \ + tests/elementary/efl_ui_test_box_flow.c \ + tests/elementary/efl_ui_test_box_stack.c \ + tests/elementary/efl_ui_test_table.c \ + tests/elementary/efl_ui_test_relative_layout.c \ + tests/elementary/efl_ui_test_grid.c \ + tests/elementary/efl_ui_test_image.c \ + tests/elementary/efl_ui_test_image_zoomable.c \ + tests/elementary/efl_ui_test_layout.c \ + tests/elementary/efl_ui_test_widget.c \ + tests/elementary/efl_ui_suite.h \ + tests/elementary/efl_ui_model.c tests_elementary_efl_ui_suite_CPPFLAGS = \ +-DELM_INTERNAL_API_ARGESFSDFEFC=1 \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ -DTESTS_BUILD_DIR=\"${top_builddir}/src/tests/elementary\" \ -DTESTS_SRC_DIR=\"${top_srcdir}/src/tests/elementary\" \ @@ -1654,5 +2013,8 @@ EXTRA_DIST2 += \ tests/elementary/elm_suite.h \ lib/elementary/Elementary_Options.h.in \ lib/elementary/elm_code_widget_text.c \ -lib/elementary/elm_code_widget_undo.c +lib/elementary/elm_code_widget_undo.c \ +lib/elementary/config_embed +lib/elementary/elm_default_config.x: + $(top_srcdir)/src/lib/elementary/config_embed $(abs_top_srcdir)/data/elementary/config/standard/base.src.in $@ diff --git a/src/Makefile_Elocation.am b/src/Makefile_Elocation.am index 292f4738be..d9c5a489a8 100644 --- a/src/Makefile_Elocation.am +++ b/src/Makefile_Elocation.am @@ -17,7 +17,7 @@ lib/elocation/gen/eldbus_geo_clue2_client.c \ lib/elocation/gen/eldbus_geo_clue2_location.c \ lib/elocation/gen/eldbus_geo_clue2_manager.c -lib_elocation_libelocation_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ELOCATION_CFLAGS@ @EFL_CFLAGS@ +lib_elocation_libelocation_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ELOCATION_CFLAGS@ @EFL_CFLAGS@ -DEFL_BUILD lib_elocation_libelocation_la_LIBADD = @ELOCATION_LIBS@ lib_elocation_libelocation_la_DEPENDENCIES = @ELOCATION_INTERNAL_LIBS@ lib_elocation_libelocation_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ diff --git a/src/Makefile_Elput.am b/src/Makefile_Elput.am index d2b97930ce..a3abb335b3 100644 --- a/src/Makefile_Elput.am +++ b/src/Makefile_Elput.am @@ -19,6 +19,7 @@ lib/elput/elput_private.h lib_elput_libelput_la_CPPFLAGS = \ -I$(top_builddir)/src/lib/efl \ + -DEFL_BUILD \ @ELPUT_CFLAGS@ @EFL_CFLAGS@ \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DMODULE_ARCH=\"$(MODULE_ARCH)\" diff --git a/src/Makefile_Elua.am b/src/Makefile_Elua.am index bc2513f903..069a33c0ef 100644 --- a/src/Makefile_Elua.am +++ b/src/Makefile_Elua.am @@ -13,6 +13,7 @@ lib_elua_libelua_la_SOURCES = \ lib/elua/cache.c lib_elua_libelua_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ELUA_CFLAGS@ \ + -DEFL_BUILD \ -DLOCALE_DIR=\"@LOCALE_DIR@\" \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/elua\" @@ -123,13 +124,14 @@ tests/elua/elua_suite.c \ tests/elua/elua_suite.h tests_elua_elua_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ --DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/elua\" \ +-DTESTS_BUILD_DIR=\"$(abs_top_builddir)/src/tests/elua\" \ +-DTESTS_SRC_DIR=\"$(abs_top_srcdir)/src/tests/elua\" \ -DPACKAGE_DATA_DIR=\"$(top_srcdir)/src/tests/elua\" \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ -DELUA_BINDINGS_DIR=\"$(ELUA_BINDINGS_DIR)\" \ -DELUA_CORE_DIR=\"$(ELUA_CORE_DIR)\" \ -DELUA_MODULES_DIR=\"$(ELUA_MODULES_DIR)\" \ --DELUA_APPS_DIR=\"$(top_srcdir)/src/tests/elua/data/apps\" \ +-DELUA_APPS_DIR=\"$(abs_top_srcdir)/src/tests/elua/data/apps\" \ @CHECK_CFLAGS@ \ @ELUA_CFLAGS@ diff --git a/src/Makefile_Embryo.am b/src/Makefile_Embryo.am index f5e187c8f2..be764f4f92 100644 --- a/src/Makefile_Embryo.am +++ b/src/Makefile_Embryo.am @@ -20,6 +20,7 @@ lib_embryo_libembryo_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/embryo\" \ +-DEFL_BUILD \ @EMBRYO_CFLAGS@ lib_embryo_libembryo_la_LIBADD = @EMBRYO_LIBS@ lib_embryo_libembryo_la_DEPENDENCIES = @EMBRYO_INTERNAL_LIBS@ diff --git a/src/Makefile_Emile.am b/src/Makefile_Emile.am index 90834cfc3f..59ac7bb4e9 100644 --- a/src/Makefile_Emile.am +++ b/src/Makefile_Emile.am @@ -44,6 +44,7 @@ lib_emile_libemile_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/emile\" \ +-DEFL_BUILD \ @EMILE_CFLAGS@ \ @NEON_CFLAGS@ diff --git a/src/Makefile_Emotion.am b/src/Makefile_Emotion.am index 919edc0516..2de10651c2 100644 --- a/src/Makefile_Emotion.am +++ b/src/Makefile_Emotion.am @@ -4,25 +4,26 @@ emotion_eolian_files = \ lib/emotion/efl_canvas_video.eo emotion_eolian_c = $(emotion_eolian_files:%.eo=%.eo.c) -emotion_eolian_h = $(emotion_eolian_files:%.eo=%.eo.h) \ - $(emotion_eolian_files:%.eo=%.eo.legacy.h) +emotion_eolian_h = $(emotion_eolian_files:%.eo=%.eo.h) BUILT_SOURCES += \ $(emotion_eolian_c) \ $(emotion_eolian_h) - +if INSTALL_EO_FILES emotioneolianfilesdir = $(datadir)/eolian/include/emotion-@VMAJ@ emotioneolianfiles_DATA = \ $(emotion_eolian_files) - +endif EXTRA_DIST2 += \ - ${emotioneolianfiles_DATA} +lib/emotion/efl_canvas_video_eo.legacy.c \ + ${emotion_eolian_files} lib_LTLIBRARIES += \ lib/emotion/libemotion.la installed_emotionmainheadersdir = $(includedir)/emotion-@VMAJ@ dist_installed_emotionmainheaders_DATA = lib/emotion/Emotion.h \ + lib/emotion/efl_canvas_video_eo.legacy.h \ lib/emotion/Emotion_Legacy.h \ lib/emotion/Emotion_Eo.h @@ -46,6 +47,7 @@ lib_emotion_libemotion_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_DATA_DIR=\"$(datadir)/emotion\" \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ -DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \ +-DEFL_BUILD \ @EMOTION_CFLAGS@ lib_emotion_libemotion_la_LIBADD = @EMOTION_LIBS@ lib_emotion_libemotion_la_DEPENDENCIES = @EMOTION_INTERNAL_LIBS@ @@ -73,6 +75,7 @@ $(install_emotionmodulexineLTLIBRARIES): install-libLTLIBRARIES modules_emotion_xine_module_la_SOURCES = $(EMOTION_XINE_SOURCES) modules_emotion_xine_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ +-DEFL_BUILD \ @EMOTION_CFLAGS@ \ @EMOTION_MODULE_XINE_CFLAGS@ modules_emotion_xine_module_la_LIBADD = \ @@ -107,6 +110,7 @@ $(install_emotionmodulegstreamerLTLIBRARIES): install-libLTLIBRARIES modules_emotion_gstreamer_module_la_SOURCES = $(EMOTION_GSTREAMER_SOURCES) modules_emotion_gstreamer_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ +-DEFL_BUILD \ @EMOTION_CFLAGS@ \ @EMOTION_MODULE_GSTREAMER_CFLAGS@ modules_emotion_gstreamer_module_la_LIBADD = \ @@ -145,6 +149,7 @@ $(install_emotionmodulegstreamer1LTLIBRARIES): install-libLTLIBRARIES modules_emotion_gstreamer1_module_la_SOURCES = $(EMOTION_GSTREAMER1_SOURCES) modules_emotion_gstreamer1_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ +-DEFL_BUILD \ @EMOTION_CFLAGS@ \ @EMOTION_MODULE_GSTREAMER1_CFLAGS@ modules_emotion_gstreamer1_module_la_LIBADD = \ @@ -174,6 +179,7 @@ $(install_emotionmodulelibvlcLTLIBRARIES): install-libLTLIBRARIES modules_emotion_libvlc_module_la_SOURCES = $(EMOTION_LIBVLC_SOURCES) modules_emotion_libvlc_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ +-DEFL_BUILD \ @EMOTION_CFLAGS@ \ @EMOTION_MODULE_LIBVLC_CFLAGS@ modules_emotion_libvlc_module_la_LIBADD = \ @@ -204,6 +210,7 @@ $(install_emotionmodulegenericLTLIBRARIES): install-libLTLIBRARIES modules_emotion_generic_module_la_SOURCES = $(EMOTION_GENERIC_SOURCES) modules_emotion_generic_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ +-DEFL_BUILD \ @EMOTION_CFLAGS@ \ @EMOTION_MODULE_GENERIC_CFLAGS@ \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ @@ -236,6 +243,7 @@ $(install_emotionedjeexternalLTLIBRARIES): install-libLTLIBRARIES edje_external_emotion_module_la_SOURCES = \ edje_external/emotion/emotion.c edje_external_emotion_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ +-DEFL_BUILD \ @EDJE_CFLAGS@ \ @EMOTION_CFLAGS@ \ -DPACKAGE_DATA_DIR=\"$(datadir)/emotion\" diff --git a/src/Makefile_Eo.am b/src/Makefile_Eo.am index 43778be897..19179a78c3 100644 --- a/src/Makefile_Eo.am +++ b/src/Makefile_Eo.am @@ -4,8 +4,7 @@ eo_eolian_files = \ lib/eo/efl_object.eo \ lib/eo/efl_class.eo \ - lib/eo/efl_object_override.eo \ - lib/eo/efl_interface.eo + lib/eo/efl_object_override.eo eo_eolian_c = $(eo_eolian_files:%.eo=%.eo.c) eo_eolian_h = $(eo_eolian_files:%.eo=%.eo.h) @@ -36,6 +35,7 @@ lib/eo/eo_private.h lib_eo_libeo_la_CPPFLAGS = \ -I$(top_builddir)/src/lib/efl \ +-DEFL_BUILD \ @EO_CFLAGS@ \ @VALGRIND_CFLAGS@ lib_eo_libeo_la_LIBADD = @EO_LIBS@ @@ -44,7 +44,7 @@ lib_eo_libeo_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ ### The Eo debug build lib_eo_libeo_dbg_la_SOURCES = $(lib_eo_libeo_la_SOURCES) -lib_eo_libeo_dbg_la_CPPFLAGS = $(lib_eo_libeo_la_CPPFLAGS) -DEO_DEBUG +lib_eo_libeo_dbg_la_CPPFLAGS = $(lib_eo_libeo_la_CPPFLAGS) -DEO_DEBUG -DEFL_BUILD lib_eo_libeo_dbg_la_LIBADD = $(lib_eo_libeo_la_LIBADD) lib_eo_libeo_dbg_la_DEPENDENCIES = $(lib_eo_libeo_la_DEPENDENCIES) lib_eo_libeo_dbg_la_LDFLAGS = $(lib_eo_libeo_la_LDFLAGS) @@ -52,13 +52,15 @@ lib_eo_libeo_dbg_la_LDFLAGS = $(lib_eo_libeo_la_LDFLAGS) bin_SCRIPTS += scripts/eo/eo_debug ###### - +if INSTALL_EO_FILES eoeolianfilesdir = $(datadir)/eolian/include/eo-@VMAJ@ eoeolianfiles_DATA = \ $(eo_eolian_files) \ lib/eo/eina_types.eot # We don't generate .c/.h on purpose - -EXTRA_DIST2 += ${eoeolianfiles_DATA} +endif +EXTRA_DIST2 += \ +$(eo_eolian_files) \ +lib/eo/eina_types.eot ### Unit tests @@ -149,7 +151,8 @@ 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_lifecycle.c +tests/eo/suite/eo_test_lifecycle.c \ +tests/eo/suite/eo_test_reflection.c tests_eo_eo_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ @@ -230,7 +233,11 @@ TESTS += tests/eo/test_signals endif -EXTRA_DIST2 += tests/eo/eunit_tests.h lib/eo/eo_ptr_indirection.x +EXTRA_DIST2 += \ +tests/eo/eunit_tests.h \ +tests/eo/suite/eo_test_reflection_complex_class_structure.c \ +tests/eo/suite/eo_test_reflection_complex_class_structure.h \ +lib/eo/eo_ptr_indirection.x if HAVE_JS diff --git a/src/Makefile_Eolian.am b/src/Makefile_Eolian.am index 5e1e2d01af..c75394e03f 100644 --- a/src/Makefile_Eolian.am +++ b/src/Makefile_Eolian.am @@ -40,6 +40,7 @@ lib_eolian_libeolian_la_SOURCES = \ lib/eolian/eolian_aux.c lib_eolian_libeolian_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @EOLIAN_CFLAGS@ \ + -DEFL_BUILD \ -DPACKAGE_DATA_DIR=\"$(datadir)/eolian\" lib_eolian_libeolian_la_LIBADD = @EOLIAN_LIBS@ @@ -105,6 +106,8 @@ tests/eolian/data/function_types.eot \ tests/eolian/data/import_types.eot \ tests/eolian/data/class_requires.eo \ tests/eolian/data/mixins_require.eo \ +tests/eolian/data/iface.eo \ +tests/eolian/data/unimpl.eo \ tests/eolian/data_aux/aux_a.eo \ tests/eolian/data_aux/aux_b.eo \ tests/eolian/data_aux/aux_c.eo @@ -159,10 +162,8 @@ 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 \ -tests/eolian/data/class_simple_ref_legacy.h \ tests/eolian/data/import_types_ref.h \ tests/eolian/data/docs_ref.h \ -tests/eolian/data/docs_ref_legacy.h \ tests/eolian/data/function_types_ref.h \ tests/eolian/data/function_as_argument_impl_ref.c \ tests/eolian/data/function_as_argument_ref.c \ diff --git a/src/Makefile_Eolian_Cxx.am b/src/Makefile_Eolian_Cxx.am index f17c00d7bf..8ae97279af 100644 --- a/src/Makefile_Eolian_Cxx.am +++ b/src/Makefile_Eolian_Cxx.am @@ -99,6 +99,7 @@ tests/eolian_cxx/eolian_cxx_test_documentation.cc \ tests/eolian_cxx/eolian_cxx_test_cyclic.cc \ tests/eolian_cxx/complex.c \ tests/eolian_cxx/complex_cxx.cc \ +tests/eolian_cxx/beta_class.eo \ tests/eolian_cxx/eolian_cxx_suite.h if HAVE_AM_16 diff --git a/src/Makefile_Ethumb.am b/src/Makefile_Ethumb.am index 7e3897447f..6d9f0cb0ce 100644 --- a/src/Makefile_Ethumb.am +++ b/src/Makefile_Ethumb.am @@ -22,6 +22,7 @@ lib_ethumb_libethumb_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_DATA_DIR=\"$(datadir)/ethumb\" \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ -DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \ +-DEFL_BUILD \ @ETHUMB_CFLAGS@ lib_ethumb_libethumb_la_LIBADD = @ETHUMB_LIBS@ lib_ethumb_libethumb_la_DEPENDENCIES = @ETHUMB_INTERNAL_LIBS@ @@ -46,6 +47,7 @@ modules_ethumb_emotion_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/ethumb\" \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ +-DEFL_BUILD \ @EMOTION_CFLAGS@ \ @ETHUMB_CFLAGS@ modules_ethumb_emotion_module_la_LIBADD = \ @@ -64,11 +66,11 @@ modules/ethumb/emotion/template.edj: modules/ethumb/emotion/template.edc modules ethumbmoduleemotion_DATA = modules/ethumb/emotion/template.edj CLEANFILES += modules/ethumb/emotion/template.edj +endif EXTRA_DIST2 += \ modules/ethumb/emotion/template.edc \ modules/ethumb/emotion/placeholder.png -endif ### Binary diff --git a/src/Makefile_Ethumb_Client.am b/src/Makefile_Ethumb_Client.am index 6b37b34dbd..a319f5da02 100644 --- a/src/Makefile_Ethumb_Client.am +++ b/src/Makefile_Ethumb_Client.am @@ -9,7 +9,7 @@ lib/ethumb_client/Ethumb_Client.h # libethumb_client.la lib_ethumb_client_libethumb_client_la_SOURCES = lib/ethumb_client/ethumb_client.c -lib_ethumb_client_libethumb_client_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ETHUMB_CLIENT_CFLAGS@ +lib_ethumb_client_libethumb_client_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ETHUMB_CLIENT_CFLAGS@ -DEFL_BUILD lib_ethumb_client_libethumb_client_la_LIBADD = @ETHUMB_CLIENT_LIBS@ lib_ethumb_client_libethumb_client_la_DEPENDENCIES = @ETHUMB_CLIENT_INTERNAL_LIBS@ lib_ethumb_client_libethumb_client_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 12f9b31fd5..95d8022a2c 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -42,7 +42,7 @@ evas_canvas_eolian_pub_files = \ lib/evas/canvas/efl_input_pointer.eo \ 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_gfx_mapping.eo \ lib/evas/canvas/efl_canvas_animation.eo \ lib/evas/canvas/efl_canvas_animation_alpha.eo \ lib/evas/canvas/efl_canvas_animation_rotate.eo \ @@ -63,17 +63,6 @@ evas_gesture_eolian_pub_files = \ lib/evas/gesture/efl_canvas_gesture_manager.eo \ $(NULL) -evas_eolian_legacy_files = \ - lib/evas/canvas/evas_canvas.eo \ - lib/evas/canvas/evas_line.eo \ - lib/evas/canvas/evas_table.eo \ - lib/evas/canvas/evas_grid.eo \ - lib/evas/canvas/evas_box.eo\ - lib/evas/canvas/evas_text.eo \ - lib/evas/canvas/evas_textgrid.eo \ - lib/evas/canvas/evas_image.eo \ - $(NULL) - evas_canvas_eolian_priv_files = \ lib/evas/include/evas_ector_buffer.eo @@ -89,8 +78,7 @@ evas_gesture_eolian_type_files = \ 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) \ - $(evas_eolian_legacy_files:%.eo=%.eo.h) +evas_canvas_eolian_priv_h = $(evas_canvas_eolian_priv_files:%.eo=%.eo.h) evas_gesture_eolian_priv_c = $(evas_gesture_eolian_priv_files:%.eo=%.eo.c) evas_gesture_eolian_priv_h = $(evas_gesture_eolian_priv_files:%.eo=%.eo.h) @@ -105,36 +93,86 @@ evas_gesture_eolian_pub_h = $(evas_gesture_eolian_pub_files:%.eo=%.eo.h) \ $(evas_gesture_eolian_pub_files:%.eo=%.eo.legacy.h) \ $(evas_gesture_eolian_type_files:%.eot=%.eot.h) -evas_eolian_legacy_c = $(evas_eolian_legacy_files:%.eo=%.eo.c) -evas_eolian_legacy_h = $(evas_eolian_legacy_files:%.eo=%.eo.legacy.h) - evas_eolian_files = $(evas_canvas_eolian_pub_files) \ $(evas_canvas_eolian_type_files) \ $(evas_gesture_eolian_pub_files) \ $(evas_gesture_eolian_type_files) evas_eolian_internal_files = $(evas_canvas_eolian_priv_files) \ - $(evas_gesture_eolian_priv_files) \ - $(evas_eolian_legacy_files) + $(evas_gesture_eolian_priv_files) evas_eolian_c = $(evas_canvas_eolian_pub_c) $(evas_canvas_eolian_priv_c) \ - $(evas_gesture_eolian_pub_c) $(evas_gesture_eolian_priv_c) \ - $(evas_eolian_legacy_c) + $(evas_gesture_eolian_pub_c) $(evas_gesture_eolian_priv_c) evas_eolian_h = $(evas_canvas_eolian_pub_h) $(evas_canvas_eolian_priv_h) \ - $(evas_gesture_eolian_pub_h) $(evas_gesture_eolian_priv_h) \ - $(evas_eolian_legacy_h) + $(evas_gesture_eolian_pub_h) $(evas_gesture_eolian_priv_h) BUILT_SOURCES += \ $(evas_eolian_c) \ $(evas_eolian_h) +if INSTALL_EO_FILES evaseolianfilesdir = $(datadir)/eolian/include/evas-@VMAJ@ evaseolianfiles_DATA = $(evas_eolian_files) +endif + +evas_legacy_eo_h = \ +lib/evas/canvas/efl_canvas_event_grabber_eo.legacy.h \ +lib/evas/canvas/efl_canvas_group_eo.legacy.h \ +lib/evas/canvas/efl_canvas_object_eo.legacy.h \ +lib/evas/canvas/efl_canvas_text_eo.legacy.h \ +lib/evas/canvas/efl_canvas_vg_container_eo.legacy.h \ +lib/evas/canvas/efl_canvas_vg_node_eo.legacy.h \ +lib/evas/canvas/efl_canvas_vg_object_eo.legacy.h \ +lib/evas/canvas/efl_canvas_vg_shape_eo.legacy.h \ +lib/evas/canvas/evas_box_eo.legacy.h \ +lib/evas/canvas/evas_canvas_eo.legacy.h \ +lib/evas/canvas/evas_grid_eo.legacy.h \ +lib/evas/canvas/evas_image_eo.legacy.h \ +lib/evas/canvas/evas_line_eo.legacy.h \ +lib/evas/canvas/evas_table_eo.legacy.h \ +lib/evas/canvas/evas_text_eo.legacy.h \ +lib/evas/canvas/evas_textgrid_eo.legacy.h + +evas_legacy_eo_c = \ +lib/evas/canvas/efl_canvas_event_grabber_eo.legacy.c \ +lib/evas/canvas/efl_canvas_group_eo.legacy.c \ +lib/evas/canvas/efl_canvas_object_eo.legacy.c \ +lib/evas/canvas/efl_canvas_text_eo.legacy.c \ +lib/evas/canvas/efl_canvas_vg_container_eo.legacy.c \ +lib/evas/canvas/efl_canvas_vg_node_eo.legacy.c \ +lib/evas/canvas/efl_canvas_vg_object_eo.legacy.c \ +lib/evas/canvas/efl_canvas_vg_shape_eo.legacy.c \ +lib/evas/canvas/evas_box_eo.c \ +lib/evas/canvas/evas_box_eo.h \ +lib/evas/canvas/evas_box_eo.legacy.c \ +lib/evas/canvas/evas_canvas_eo.c \ +lib/evas/canvas/evas_canvas_eo.h \ +lib/evas/canvas/evas_canvas_eo.legacy.c \ +lib/evas/canvas/evas_grid_eo.c \ +lib/evas/canvas/evas_grid_eo.h \ +lib/evas/canvas/evas_grid_eo.legacy.c \ +lib/evas/canvas/evas_image_eo.c \ +lib/evas/canvas/evas_image_eo.h \ +lib/evas/canvas/evas_image_eo.legacy.c \ +lib/evas/canvas/evas_line_eo.c \ +lib/evas/canvas/evas_line_eo.h \ +lib/evas/canvas/evas_line_eo.legacy.c \ +lib/evas/canvas/evas_table_eo.c \ +lib/evas/canvas/evas_table_eo.h \ +lib/evas/canvas/evas_table_eo.legacy.c \ +lib/evas/canvas/evas_text_eo.c \ +lib/evas/canvas/evas_text_eo.h \ +lib/evas/canvas/evas_text_eo.legacy.c \ +lib/evas/canvas/evas_textgrid_eo.c \ +lib/evas/canvas/evas_textgrid_eo.h \ +lib/evas/canvas/evas_textgrid_eo.legacy.c + EXTRA_DIST2 += \ - $(evaseolianfiles_DATA) \ - $(evas_eolian_internal_files) + $(evas_eolian_files) \ + $(evas_eolian_internal_files) \ + $(evas_legacy_eo_c) lib_LTLIBRARIES += lib/evas/libevas.la @@ -148,9 +186,9 @@ lib/evas/Evas_GL.h \ lib/evas/Evas_Loader.h installed_evascanvasheadersdir = $(includedir)/evas-@VMAJ@/canvas -nodist_installed_evascanvasheaders_DATA = $(evas_canvas_eolian_pub_h) \ - $(evas_eolian_legacy_h) -dist_installed_evascanvasheaders_DATA = lib/evas/canvas/evas_textblock_legacy.h +nodist_installed_evascanvasheaders_DATA = $(evas_canvas_eolian_pub_h) +dist_installed_evascanvasheaders_DATA = lib/evas/canvas/evas_textblock_legacy.h \ +$(evas_legacy_eo_h) installed_evasgestureheadersdir = $(includedir)/evas-@VMAJ@/gesture nodist_installed_evasgestureheaders_DATA = $(evas_gesture_eolian_pub_h) @@ -264,7 +302,7 @@ lib/evas/canvas/efl_canvas_surface.c \ lib/evas/canvas/efl_canvas_surface_tbm.c \ lib/evas/canvas/efl_canvas_surface_x11.c \ lib/evas/canvas/efl_canvas_surface_wayland.c \ -lib/evas/canvas/efl_gfx_map.c \ +lib/evas/canvas/efl_gfx_mapping.c \ lib/evas/canvas/efl_input_event.c \ lib/evas/canvas/efl_input_key.c \ lib/evas/canvas/efl_input_pointer.c \ @@ -488,6 +526,7 @@ lib_evas_libevas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_DATA_DIR=\"$(datadir)/evas\" \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ -DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @VALGRIND_CFLAGS@ \ @NEON_CFLAGS@ \ @@ -502,6 +541,7 @@ lib/evas/common/evas_op_blend/op_blend_master_sse3.c \ static_libs/draw/draw_main_sse2.c lib_evas_common_libevas_op_blend_sse3_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ +-DEFL_BUILD \ $(lib_evas_libevas_la_CPPFLAGS) \ @SSE3_CFLAGS@ @@ -515,6 +555,7 @@ lib_evas_common_libevas_convert_rgb_32_la_SOURCES = \ lib/evas/common/evas_convert_rgb_32.c lib_evas_common_libevas_convert_rgb_32_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ +-DEFL_BUILD \ $(lib_evas_libevas_la_CPPFLAGS) \ @NEON_CFLAGS@ @@ -750,6 +791,7 @@ modules_evas_engines_software_generic_module_la_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src/lib/evas/filters \ -I$(top_builddir)/src/lib/evas/canvas \ -I$(top_builddir)/src/modules/evas/engines/software_generic \ +-DEFL_BUILD \ @EVAS_CFLAGS@ modules_evas_engines_software_generic_module_la_LIBADD = @USE_EVAS_LIBS@ modules_evas_engines_software_generic_module_la_DEPENDENCIES = @USE_EVAS_INTERNAL_LIBS@ @@ -777,6 +819,7 @@ $(install_enginebufferpkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_engines_buffer_module_la_SOURCES = $(BUFFER_SOURCES) modules_evas_engines_buffer_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ modules_evas_engines_buffer_module_la_LIBADD = @USE_EVAS_LIBS@ modules_evas_engines_buffer_module_la_DEPENDENCIES = @USE_EVAS_INTERNAL_LIBS@ @@ -988,6 +1031,7 @@ modules_evas_engines_gl_generic_module_la_CFLAGS = \ -I$(top_builddir)/src/modules/evas/engines/gl_generic \ -I$(top_builddir)/src/modules/evas/engines/software_generic \ @evas_engine_gl_common_cflags@ \ +-DEFL_BUILD \ @EVAS_CFLAGS@ modules_evas_engines_gl_generic_module_la_LIBADD = \ modules/evas/engines/gl_common/libevas_engine_gl_common.la \ @@ -1000,7 +1044,7 @@ modules_evas_engines_gl_generic_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@ modules_evas_engines_gl_generic_module_la_LIBTOOLFLAGS = --tag=disable-static if BUILD_ENGINE_GL_X11 -modules_evas_engines_gl_common_libevas_engine_gl_common_la_CPPFLAGS += @evas_engine_gl_xlib_cflags@ +modules_evas_engines_gl_common_libevas_engine_gl_common_la_CPPFLAGS += @evas_engine_gl_xlib_cflags@ -DEFL_BUILD endif if BUILD_ENGINE_WAYLAND_EGL modules_evas_engines_gl_common_libevas_engine_gl_common_la_CPPFLAGS += @evas_engine_wayland_egl_cflags@ @@ -1009,7 +1053,7 @@ if BUILD_ENGINE_GL_DRM modules_evas_engines_gl_common_libevas_engine_gl_common_la_CPPFLAGS += @evas_engine_gl_drm_cflags@ endif if BUILD_ENGINE_EGLFS -modules_evas_engines_gl_common_libevas_engine_gl_common_la_CPPFLAGS += @evas_engine_eglfs_cflags@ +modules_evas_engines_gl_common_libevas_engine_gl_common_la_CPPFLAGS += @evas_engine_eglfs_cflags@ -DEFL_BUILD endif if BUILD_ENGINE_GL_COCOA modules_evas_engines_gl_common_libevas_engine_gl_common_la_CPPFLAGS += @evas_engine_gl_cocoa_cflags@ @@ -1082,6 +1126,7 @@ modules_evas_engines_gl_sdl_module_la_SOURCES = $(GL_SDL_SOURCES) modules_evas_engines_gl_sdl_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ -I$(top_srcdir)/src/modules/evas/engines/gl_common \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_engine_gl_sdl_cflags@ modules_evas_engines_gl_sdl_module_la_LIBADD = \ @@ -1116,6 +1161,7 @@ $(install_engineglx11pkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_engines_gl_x11_module_la_SOURCES = $(GL_X11_SOURCES) modules_evas_engines_gl_x11_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_engine_gl_xlib_cflags@ modules_evas_engines_gl_x11_module_la_LIBADD = \ @@ -1161,6 +1207,7 @@ $(install_enginesoftwareddrawpkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_engines_software_ddraw_module_la_SOURCES = $(SOFTWARE_DDRAW_SOURCES) modules_evas_engines_software_ddraw_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_engine_software_ddraw_cflags@ modules_evas_engines_software_ddraw_module_la_CXXFLAGS = -fno-rtti -fno-exceptions @@ -1197,6 +1244,7 @@ $(install_enginesoftwaregdipkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_engines_software_gdi_module_la_SOURCES = $(SOFTWARE_GDI_SOURCES) modules_evas_engines_software_gdi_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_engine_software_gdi_cflags@ modules_evas_engines_software_gdi_module_la_LIBADD = \ @@ -1254,7 +1302,7 @@ install_enginesoftwarex11pkgLTLIBRARIES = install-enginesoftwarex11pkgLTLIBRARIE $(install_enginesoftwarex11pkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_engines_software_x11_module_la_SOURCES = $(SOFTWARE_X11_SOURCES) -modules_evas_engines_software_x11_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl $(SOFTWARE_X11_CPPFLAGS) +modules_evas_engines_software_x11_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl $(SOFTWARE_X11_CPPFLAGS) -DEFL_BUILD modules_evas_engines_software_x11_module_la_LIBADD = @USE_ECORE_X_LIBS@ @USE_EVAS_LIBS@ $(SOFTWARE_X11_LIBADD) modules_evas_engines_software_x11_module_la_DEPENDENCIES = @USE_ECORE_X_INTERNAL_LIBS@ @USE_EVAS_INTERNAL_LIBS@ modules_evas_engines_software_x11_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@ @@ -1438,6 +1486,7 @@ modules_evas_engines_eglfs_module_la_SOURCES = $(EGLFS_SOURCES) modules_evas_engines_eglfs_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ -I$(top_srcdir)/src/modules/evas/engines/eglfs \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @ECORE_DRM_CFLAGS@ \ @evas_engine_eglfs_cflags@ @@ -1476,6 +1525,7 @@ static_libs/vg_common/vg_common.h modules_evas_vg_loaders_svg_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ -I$(top_srcdir)/src/static_libs/vg_common \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_vg_loader_svg_cflags@ modules_evas_vg_loaders_svg_module_la_LIBADD = \ @@ -1499,6 +1549,7 @@ static_libs/vg_common/vg_common.h modules_evas_vg_savers_svg_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ -I$(top_srcdir)/src/static_libs/vg_common \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_vg_saver_svg_cflags@ modules_evas_vg_savers_svg_module_la_LIBADD = \ @@ -1527,6 +1578,7 @@ $(install_vgloadereetpkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_vg_loaders_eet_module_la_SOURCES = modules/evas/vg_loaders/eet/evas_vg_load_eet.c modules_evas_vg_loaders_eet_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_vg_loader_eet_cflags@ modules_evas_vg_loaders_eet_module_la_LIBADD = \ @@ -1547,6 +1599,7 @@ $(install_vgsavereetpkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_vg_savers_eet_module_la_SOURCES = modules/evas/vg_savers/eet/evas_vg_save_eet.c modules_evas_vg_savers_eet_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_vg_saver_eet_cflags@ modules_evas_vg_savers_eet_module_la_LIBADD = \ @@ -1576,6 +1629,7 @@ $(install_loaderbmppkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_loaders_bmp_module_la_SOURCES = modules/evas/image_loaders/bmp/evas_image_load_bmp.c modules_evas_image_loaders_bmp_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_bmp_cflags@ modules_evas_image_loaders_bmp_module_la_LIBADD = \ @@ -1610,6 +1664,7 @@ modules/evas/image_loaders/dds/s3tc_decoder.c \ modules/evas/image_loaders/dds/s3tc.h modules_evas_image_loaders_dds_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_dds_cflags@ modules_evas_image_loaders_dds_module_la_LIBADD = \ @@ -1638,6 +1693,7 @@ $(install_loadereetpkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_loaders_eet_module_la_SOURCES = modules/evas/image_loaders/eet/evas_image_load_eet.c modules_evas_image_loaders_eet_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_eet_cflags@ modules_evas_image_loaders_eet_module_la_LIBADD = \ @@ -1666,6 +1722,7 @@ $(install_loadergenericpkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_loaders_generic_module_la_SOURCES = modules/evas/image_loaders/generic/evas_image_load_generic.c modules_evas_image_loaders_generic_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_generic_cflags@ modules_evas_image_loaders_generic_module_la_LIBADD = \ @@ -1694,6 +1751,7 @@ $(install_loadergifpkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_loaders_gif_module_la_SOURCES = modules/evas/image_loaders/gif/evas_image_load_gif.c modules_evas_image_loaders_gif_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_gif_cflags@ modules_evas_image_loaders_gif_module_la_LIBADD = \ @@ -1722,6 +1780,7 @@ $(install_loadericopkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_loaders_ico_module_la_SOURCES = modules/evas/image_loaders/ico/evas_image_load_ico.c modules_evas_image_loaders_ico_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_ico_cflags@ modules_evas_image_loaders_ico_module_la_LIBADD = \ @@ -1751,6 +1810,7 @@ $(install_loaderjpegpkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_loaders_jpeg_module_la_SOURCES = modules/evas/image_loaders/jpeg/evas_image_load_jpeg.c modules_evas_image_loaders_jpeg_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_jpeg_cflags@ modules_evas_image_loaders_jpeg_module_la_LIBADD = \ @@ -1770,6 +1830,7 @@ $(install_saverjpegpkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_savers_jpeg_module_la_SOURCES = modules/evas/image_savers/jpeg/evas_image_save_jpeg.c modules_evas_image_savers_jpeg_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_jpeg_cflags@ modules_evas_image_savers_jpeg_module_la_LIBADD = \ @@ -1800,6 +1861,7 @@ modules_evas_image_loaders_jp2k_module_la_CPPFLAGS = \ @evas_image_loader_jp2k_cflags@ \ -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ modules_evas_image_loaders_jp2k_module_la_LIBADD = \ @USE_EVAS_LIBS@ \ @@ -1827,6 +1889,7 @@ $(install_loaderpmapspkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_loaders_pmaps_module_la_SOURCES = modules/evas/image_loaders/pmaps/evas_image_load_pmaps.c modules_evas_image_loaders_pmaps_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_pmaps_cflags@ modules_evas_image_loaders_pmaps_module_la_LIBADD = \ @@ -1855,6 +1918,7 @@ $(install_loaderpngpkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_loaders_png_module_la_SOURCES = modules/evas/image_loaders/png/evas_image_load_png.c modules_evas_image_loaders_png_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_png_cflags@ modules_evas_image_loaders_png_module_la_LIBADD = \ @@ -1875,6 +1939,7 @@ $(install_saverpngpkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_savers_png_module_la_SOURCES = modules/evas/image_savers/png/evas_image_save_png.c modules_evas_image_savers_png_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_png_cflags@ modules_evas_image_savers_png_module_la_LIBADD = \ @@ -1903,6 +1968,7 @@ $(install_loaderpsdpkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_loaders_psd_module_la_SOURCES = modules/evas/image_loaders/psd/evas_image_load_psd.c modules_evas_image_loaders_psd_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_psd_cflags@ modules_evas_image_loaders_psd_module_la_LIBADD = \ @@ -1931,6 +1997,7 @@ $(install_loadertgapkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_loaders_tga_module_la_SOURCES = modules/evas/image_loaders/tga/evas_image_load_tga.c modules_evas_image_loaders_tga_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_tga_cflags@ modules_evas_image_loaders_tga_module_la_LIBADD = \ @@ -1959,6 +2026,7 @@ $(install_loadertiffpkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_loaders_tiff_module_la_SOURCES = modules/evas/image_loaders/tiff/evas_image_load_tiff.c modules_evas_image_loaders_tiff_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_tiff_cflags@ modules_evas_image_loaders_tiff_module_la_LIBADD = \ @@ -1979,6 +2047,7 @@ $(install_savertiffpkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_savers_tiff_module_la_SOURCES = modules/evas/image_savers/tiff/evas_image_save_tiff.c modules_evas_image_savers_tiff_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_tiff_cflags@ modules_evas_image_savers_tiff_module_la_LIBADD = \ @@ -2007,6 +2076,7 @@ $(install_loaderwbmppkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_loaders_wbmp_module_la_SOURCES = modules/evas/image_loaders/wbmp/evas_image_load_wbmp.c modules_evas_image_loaders_wbmp_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_wbmp_cflags@ modules_evas_image_loaders_wbmp_module_la_LIBADD = \ @@ -2035,6 +2105,7 @@ $(install_loaderwebppkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_loaders_webp_module_la_SOURCES = modules/evas/image_loaders/webp/evas_image_load_webp.c modules_evas_image_loaders_webp_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_webp_cflags@ modules_evas_image_loaders_webp_module_la_LIBADD = \ @@ -2055,6 +2126,7 @@ $(install_saverwebppkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_savers_webp_module_la_SOURCES = modules/evas/image_savers/webp/evas_image_save_webp.c modules_evas_image_savers_webp_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_webp_cflags@ modules_evas_image_savers_webp_module_la_LIBADD = \ @@ -2083,6 +2155,7 @@ $(install_loaderxpmpkgLTLIBRARIES): install-libLTLIBRARIES modules_evas_image_loaders_xpm_module_la_SOURCES = modules/evas/image_loaders/xpm/evas_image_load_xpm.c modules_evas_image_loaders_xpm_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/include \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ @evas_image_loader_xpm_cflags@ modules_evas_image_loaders_xpm_module_la_LIBADD = \ @@ -2108,13 +2181,11 @@ static_libs/lz4/lz4hc.c \ static_libs/lz4/lz4hc.h endif lib_evas_libevas_la_CPPFLAGS += \ --I$(top_srcdir)/src/static_libs/rg_etc \ -@evas_image_loader_tgv_cflags@ +-I$(top_srcdir)/src/static_libs/rg_etc if ! ENABLE_LIBLZ4 lib_evas_libevas_la_CPPFLAGS += \ -I$(top_srcdir)/src/static_libs/lz4 endif -lib_evas_libevas_la_LIBADD += @evas_image_loader_tgv_libs@ endif else loadertgvpkgdir = $(libdir)/evas/modules/image_loaders/tgv/$(MODULE_ARCH) @@ -2139,16 +2210,15 @@ modules_evas_image_loaders_tgv_module_la_CPPFLAGS = \ -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/static_libs/rg_etc \ -I$(top_srcdir)/src/lib/evas/ \ +-DEFL_BUILD \ @EVAS_CFLAGS@ \ -@NEON_CFLAGS@ \ -@evas_image_loader_tgv_cflags@ +@NEON_CFLAGS@ if ! ENABLE_LIBLZ4 modules_evas_image_loaders_tgv_module_la_CPPFLAGS += \ -I$(top_srcdir)/src/static_libs/lz4 endif modules_evas_image_loaders_tgv_module_la_LIBADD = \ -@USE_EVAS_LIBS@ \ -@evas_image_loader_tgv_libs@ +@USE_EVAS_LIBS@ modules_evas_image_loaders_tgv_module_la_DEPENDENCIES = @USE_EVAS_INTERNAL_LIBS@ modules_evas_image_loaders_tgv_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@ modules_evas_image_loaders_tgv_module_la_LIBTOOLFLAGS = --tag=disable-static @@ -2177,15 +2247,15 @@ modules_evas_image_savers_tgv_module_la_CPPFLAGS = \ -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/static_libs/rg_etc \ -I$(top_srcdir)/src/lib/evas/ \ -@EVAS_CFLAGS@ \ -@evas_image_saver_tgv_cflags@ +-DEFL_BUILD \ +@EVAS_CFLAGS@ + if ! ENABLE_LIBLZ4 modules_evas_image_savers_tgv_module_la_CPPFLAGS += \ -I$(top_srcdir)/src/static_libs/lz4 endif modules_evas_image_savers_tgv_module_la_LIBADD = \ -@USE_EVAS_LIBS@ \ -@evas_image_saver_tgv_libs@ +@USE_EVAS_LIBS@ modules_evas_image_savers_tgv_module_la_DEPENDENCIES = @USE_EVAS_INTERNAL_LIBS@ modules_evas_image_savers_tgv_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@ modules_evas_image_savers_tgv_module_la_LIBTOOLFLAGS = --tag=disable-static @@ -2220,6 +2290,7 @@ tests/evas/evas_suite.h tests_evas_evas_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/ecore_evas \ -I$(top_builddir)/src/lib/evas/canvas \ +-I$(top_srcdir)/src/modules/evas/engines/buffer \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ -DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/evas\" \ -DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/evas\" \ @@ -2329,10 +2400,8 @@ GENERATED_JS_BINDINGS += $(generated_evas_js_bindings) endif if HAVE_CXX -evas_canvas_eolian_cxx_hh = $(evas_canvas_eolian_pub_files:%.eo=%.eo.hh) \ - $(evas_eolian_legacy_files:%.eo=%.eo.hh) -evas_canvas_eolian_cxx_impl_hh = $(evas_canvas_eolian_pub_files:%.eo=%.eo.impl.hh) \ - $(evas_eolian_legacy_files:%.eo=%.eo.impl.hh) +evas_canvas_eolian_cxx_hh = $(evas_canvas_eolian_pub_files:%.eo=%.eo.hh) +evas_canvas_eolian_cxx_impl_hh = $(evas_canvas_eolian_pub_files:%.eo=%.eo.impl.hh) evas_gesture_eolian_cxx_hh = $(evas_gesture_eolian_pub_files:%.eo=%.eo.hh) evas_gesture_eolian_cxx_impl_hh = $(evas_gesture_eolian_pub_files:%.eo=%.eo.impl.hh) endif diff --git a/src/Makefile_Evil.am b/src/Makefile_Evil.am index 7fbe99c79d..91dcc1c7f1 100644 --- a/src/Makefile_Evil.am +++ b/src/Makefile_Evil.am @@ -47,7 +47,7 @@ lib/evil/evil_util.c \ lib/evil/evil_private.h \ lib/evil/evil_fnmatch_private.h -lib_evil_libevil_la_CPPFLAGS = @EVIL_CPPFLAGS@ +lib_evil_libevil_la_CPPFLAGS = @EVIL_CPPFLAGS@ -DEFL_BUILD lib_evil_libevil_la_CFLAGS = @EVIL_CFLAGS@ @EVIL_CFLAGS_WRN@ -D__USE_MINGW_ANSI_STDIO lib_evil_libevil_la_LIBADD = @EVIL_LIBS@ lib_evil_libevil_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ @@ -91,6 +91,7 @@ tests/evil/evil_test_unistd.c tests_evil_evil_suite_CPPFLAGS = \ -I$(top_builddir)/src/lib/efl \ +-I$(top_builddir)/src/lib/eina \ -DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/evil\" \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/\" \ -DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/evil\" \ diff --git a/src/benchmarks/eina/ecore_hash.c b/src/benchmarks/eina/ecore_hash.c index 4d4058859b..374a0e08da 100644 --- a/src/benchmarks/eina/ecore_hash.c +++ b/src/benchmarks/eina/ecore_hash.c @@ -460,7 +460,7 @@ _ecore_hash_bucket_destroy(Ecore_Hash_Node *list, static int _ecore_hash_node_add(Ecore_Hash *hash, Ecore_Hash_Node *node) { - unsigned long hash_val; + size_t hash_val; CHECK_PARAM_POINTER_RETURN("hash", hash, FALSE); CHECK_PARAM_POINTER_RETURN("node", node, FALSE); @@ -471,7 +471,7 @@ _ecore_hash_node_add(Ecore_Hash *hash, Ecore_Hash_Node *node) /* Compute the position in the table */ if (!hash->hash_func) - hash_val = (unsigned long)node->key % ecore_prime_table[hash->size]; + hash_val = (size_t)node->key % ecore_prime_table[hash->size]; else hash_val = ECORE_COMPUTE_HASH(hash, node->key); @@ -522,14 +522,14 @@ ecore_hash_remove(Ecore_Hash *hash, const void *key) { Ecore_Hash_Node *node = NULL; Ecore_Hash_Node *list; - unsigned long hash_val; + size_t hash_val; void *ret = NULL; CHECK_PARAM_POINTER_RETURN("hash", hash, NULL); /* Compute the position in the table */ if (!hash->hash_func) - hash_val = (unsigned long )key % ecore_prime_table[hash->size]; + hash_val = (size_t)key % ecore_prime_table[hash->size]; else hash_val = ECORE_COMPUTE_HASH(hash, key); @@ -626,7 +626,7 @@ ecore_hash_find(Ecore_Hash *hash, Ecore_Compare_Cb compare, const void *value) static Ecore_Hash_Node * _ecore_hash_node_get(Ecore_Hash *hash, const void *key) { - unsigned long hash_val; + size_t hash_val; Ecore_Hash_Node *node = NULL; CHECK_PARAM_POINTER_RETURN("hash", hash, NULL); @@ -636,7 +636,7 @@ _ecore_hash_node_get(Ecore_Hash *hash, const void *key) /* Compute the position in the table */ if (!hash->hash_func) - hash_val = (unsigned long)key % ecore_prime_table[hash->size]; + hash_val = (size_t)key % ecore_prime_table[hash->size]; else hash_val = ECORE_COMPUTE_HASH(hash, key); diff --git a/src/benchmarks/eina/ecore_sheap.c b/src/benchmarks/eina/ecore_sheap.c index 448be97918..e86c10b510 100644 --- a/src/benchmarks/eina/ecore_sheap.c +++ b/src/benchmarks/eina/ecore_sheap.c @@ -4,6 +4,7 @@ #include #include +#include #include "Ecore_Data.h" @@ -452,10 +453,10 @@ _ecore_sheap_update_data(Ecore_Sheap *heap) int ecore_direct_compare(const void *key1, const void *key2) { - unsigned long k1, k2; + uintptr_t k1, k2; - k1 = (unsigned long)key1; - k2 = (unsigned long)key2; + k1 = (uintptr_t)key1; + k2 = (uintptr_t)key2; if (k1 > k2) return 1; diff --git a/src/bin/ecore_buffer/meson.build b/src/bin/ecore_buffer/meson.build index 86ee20a872..5e1a9d9381 100644 --- a/src/bin/ecore_buffer/meson.build +++ b/src/bin/ecore_buffer/meson.build @@ -1,5 +1,6 @@ -executable('bq_mgr', - ['bq_mgr_protocol.c', 'bq_mgr.c'], - dependencies: [ecore, ecore_buffer, ecore_buffer_deps], - install : true +executable('bqmgr', + ['bq_mgr_protocol.c', 'bq_mgr.c'], + dependencies: [ecore, ecore_buffer, ecore_buffer_deps], + install: true, + install_dir: join_paths(dir_lib, 'ecore_buffer', 'bin') ) diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c index c791e8d1c6..096631d5ec 100644 --- a/src/bin/edje/edje_cc_out.c +++ b/src/bin/edje/edje_cc_out.c @@ -1432,7 +1432,9 @@ data_write_vectors(Eet_File *ef, int *vector_num) if (!f) continue; eina_file_close(f); - if (!efl_file_set(vg, eina_strbuf_string_get(buf), NULL)) + if (efl_file_set(vg, eina_strbuf_string_get(buf))) + error_and_abort(ef, "Failed to parse svg : %s", vector->entry); + if (efl_file_load(vg)) error_and_abort(ef, "Failed to parse svg : %s", vector->entry); eina_strbuf_reset(buf); @@ -2190,7 +2192,8 @@ data_thread_script(void *data, Ecore_Thread *thread EINA_UNUSED) return; } - fseek(f, 0, SEEK_END); + if (fseek(f, 0, SEEK_END) < 0) + ERR("Error seeking"); size = ftell(f); rewind(f); diff --git a/src/bin/edje/edje_cc_parse.c b/src/bin/edje/edje_cc_parse.c index 3d9842c764..ad1a2c95ac 100644 --- a/src/bin/edje/edje_cc_parse.c +++ b/src/bin/edje/edje_cc_parse.c @@ -28,12 +28,16 @@ #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_1_22_SUPPORTED " -DEFL_VERSION_1_22=1 " +#define EDJE_1_23_SUPPORTED " -DEFL_VERSION_1_23=1 " #define EDJE_CC_EFL_VERSION_SUPPORTED \ EDJE_1_18_SUPPORTED \ EDJE_1_19_SUPPORTED \ EDJE_1_20_SUPPORTED \ - EDJE_1_21_SUPPORTED + EDJE_1_21_SUPPORTED \ + EDJE_1_22_SUPPORTED \ + EDJE_1_23_SUPPORTED static void new_object(void); static void new_statement(void); diff --git a/src/bin/edje/edje_cc_sources.c b/src/bin/edje/edje_cc_sources.c index a8bd949576..25ed765c02 100644 --- a/src/bin/edje/edje_cc_sources.c +++ b/src/bin/edje/edje_cc_sources.c @@ -63,9 +63,11 @@ source_fetch_file(const char *fil, const char *filname) exit(-1); } - fseek(f, 0, SEEK_END); + if (fseek(f, 0, SEEK_END) < 0) + ERR("Error seeking"); sz = ftell(f); - fseek(f, 0, SEEK_SET); + if (fseek(f, 0, SEEK_SET) < 0) + ERR("Error seeking"); sf = mem_alloc(SZ(SrcFile)); sf->name = mem_strdup(filname); sf->file = mem_alloc(sz + 1); @@ -80,7 +82,8 @@ source_fetch_file(const char *fil, const char *filname) } sf->file[sz] = '\0'; - fseek(f, 0, SEEK_SET); + if (fseek(f, 0, SEEK_SET) < 0) + ERR("Error seeking"); srcfiles.list = eina_list_append(srcfiles.list, sf); while (fgets(buf, sizeof(buf), f)) diff --git a/src/bin/edje/epp/cpplib.c b/src/bin/edje/epp/cpplib.c index c901a1e0ff..d7bde9de68 100644 --- a/src/bin/edje/epp/cpplib.c +++ b/src/bin/edje/epp/cpplib.c @@ -7405,7 +7405,7 @@ static void cpp_pedwarn_with_line(cpp_reader * pfile, int line, int column, const char *msg) { if (CPP_OPTIONS(pfile)->pedantic_errors) - cpp_error_with_line(pfile, column, line, msg); + cpp_error_with_line(pfile, line, column, msg); else cpp_warning_with_line(pfile, line, column, msg); } diff --git a/src/bin/edje/meson.build b/src/bin/edje/meson.build index 89d6382fae..b2f2e738b1 100644 --- a/src/bin/edje/meson.build +++ b/src/bin/edje/meson.build @@ -2,7 +2,7 @@ subdir('epp') edje_bin_deps = [ eina, eo, efl, m, - luajit, eet, evas, + lua, eet, evas, ecore_file, ecore_input, ecore_imf, ecore_imf_evas, embryo, efreet, eio, @@ -34,9 +34,11 @@ if meson.is_cross_build() _edje_cc = find_program('edje_cc', native: true) edje_cc_path = _edje_cc.path() edje_cc_exe = [_edje_cc] + edje_depends = [] else env = find_program('env', native: true) edje_cc_exe = [env, 'EFL_RUN_IN_TREE=1', edje_cc.full_path()] + edje_depends = [edje_cc, epp] endif edje_decc_src = [ @@ -81,6 +83,15 @@ edje_codegen = executable('edje_codegen', c_args : package_c_args, ) +if meson.is_cross_build() + _edje_codegen = find_program('edje_codegen', native: true) + edje_codegen_path = _edje_codegen.path() + edje_codegen_exe = [_edje_codegen] +else + env = find_program('env', native: true) + edje_codegen_exe = [env, 'EFL_RUN_IN_TREE=1', edje_codegen.full_path()] +endif + edje_pick = executable('edje_pick', 'edje_pick.c', dependencies: [edje_bin_deps, eet, ecore, eio, ecore_evas], diff --git a/src/bin/eeze/eeze_scanner/eeze_scanner.c b/src/bin/eeze/eeze_scanner/eeze_scanner.c index c4d23ea34f..9236b6ab3b 100644 --- a/src/bin/eeze/eeze_scanner/eeze_scanner.c +++ b/src/bin/eeze/eeze_scanner/eeze_scanner.c @@ -513,7 +513,7 @@ main(void) } efl_event_callback_add(server, EFL_NET_SERVER_EVENT_CLIENT_ADD, cl_add, NULL); - efl_event_callback_add(server, EFL_NET_SERVER_EVENT_ERROR, server_error, NULL); + efl_event_callback_add(server, EFL_NET_SERVER_EVENT_SERVER_ERROR, server_error, NULL); #ifdef EFL_NET_SERVER_UNIX_CLASS { diff --git a/src/bin/eeze/eeze_scanner_monitor/eeze_scanner_monitor.c b/src/bin/eeze/eeze_scanner_monitor/eeze_scanner_monitor.c index 02d22ecdb6..526a3761f6 100644 --- a/src/bin/eeze/eeze_scanner_monitor/eeze_scanner_monitor.c +++ b/src/bin/eeze/eeze_scanner_monitor/eeze_scanner_monitor.c @@ -3,7 +3,6 @@ #endif #define EFL_BETA_API_SUPPORT 1 -#define EFL_EO_API_SUPPORT 1 #include #include #include diff --git a/src/bin/efl/efl_debugd.c b/src/bin/efl/efl_debugd.c index fd2bc9e426..3962aa6a80 100644 --- a/src/bin/efl/efl_debugd.c +++ b/src/bin/efl/efl_debugd.c @@ -21,7 +21,6 @@ #endif #define EFL_BETA_API_SUPPORT 1 -#define EFL_EO_API_SUPPORT 1 #include #include "eina_debug_private.h" @@ -570,7 +569,7 @@ _local_server_create(void) } efl_event_callback_add(_local_server, EFL_NET_SERVER_EVENT_CLIENT_ADD, _client_add, NULL); - efl_event_callback_add(_local_server, EFL_NET_SERVER_EVENT_ERROR, _error, NULL); + efl_event_callback_add(_local_server, EFL_NET_SERVER_EVENT_SERVER_ERROR, _error, NULL); #ifdef EFL_NET_SERVER_UNIX_CLASS { @@ -620,7 +619,7 @@ _remote_server_create(void) efl_net_server_fd_reuse_address_set(inner_server, EINA_TRUE); } efl_event_callback_add(_remote_server, EFL_NET_SERVER_EVENT_CLIENT_ADD, _client_add, NULL); - efl_event_callback_add(_remote_server, EFL_NET_SERVER_EVENT_ERROR, _error, NULL); + efl_event_callback_add(_remote_server, EFL_NET_SERVER_EVENT_SERVER_ERROR, _error, NULL); sprintf(address, "127.0.0.1:%d", REMOTE_SERVER_PORT); err = efl_net_server_serve(_remote_server, address); diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c index 66cc0f6ec1..1ef7d339c2 100644 --- a/src/bin/efreet/efreetd.c +++ b/src/bin/efreet/efreetd.c @@ -20,6 +20,7 @@ #include "efreetd_ipc.h" int efreetd_log_dom = -1; +Eina_Mempool *efreetd_mp_stat = NULL; void quit(void) diff --git a/src/bin/efreet/efreetd_cache.h b/src/bin/efreet/efreetd_cache.h index 72a6f2bad8..991fcb18a8 100644 --- a/src/bin/efreet/efreetd_cache.h +++ b/src/bin/efreet/efreetd_cache.h @@ -1,7 +1,7 @@ #ifndef __EFREETD_CACHE_H #define __EFREETD_CACHE_H -Eina_Mempool *efreetd_mp_stat; +extern Eina_Mempool *efreetd_mp_stat; void cache_desktop_dir_add(const char *dir); void cache_icon_dir_add(const char *dir); diff --git a/src/bin/elementary/Makefile.am b/src/bin/elementary/Makefile.am index 290ea0e110..8100fb40a0 100644 --- a/src/bin/elementary/Makefile.am +++ b/src/bin/elementary/Makefile.am @@ -38,7 +38,6 @@ test_efl_anim_scale.c \ test_efl_anim_translate.c \ test_efl_anim_group_parallel.c \ test_efl_anim_group_sequential.c \ -test_efl_anim_event_anim.c \ test_efl_anim_pause.c \ test_efl_anim_repeat.c \ test_efl_anim_start_delay.c \ @@ -161,6 +160,8 @@ test_win_wm_rotation.c \ test_win_dialog.c \ test_gesture_framework.c \ test_ui_tab_pager.c \ +test_ui_pager.c \ +test_ui_pager_scroll.c \ test.h elementary_test_LDADD = $(top_builddir)/src/lib/libelementary.la \ diff --git a/src/bin/elementary/meson.build b/src/bin/elementary/meson.build index 008eab708f..0f7fa3d340 100644 --- a/src/bin/elementary/meson.build +++ b/src/bin/elementary/meson.build @@ -35,7 +35,6 @@ elementary_test_src = [ 'test_efl_anim_translate.c', 'test_efl_anim_group_parallel.c', 'test_efl_anim_group_sequential.c', - 'test_efl_anim_event_anim.c', 'test_efl_anim_pause.c', 'test_efl_anim_repeat.c', 'test_efl_anim_start_delay.c', @@ -47,7 +46,7 @@ elementary_test_src = [ 'test_events.c', 'test_evas_mask.c', 'test_evas_map.c', - 'test_efl_gfx_map.c', + 'test_efl_gfx_mapping.c', 'test_evas_snapshot.c', 'test_external.c', 'test_fileselector_button.c', @@ -99,6 +98,8 @@ elementary_test_src = [ 'test_panes.c', 'test_ui_panes.c', 'test_ui_panel.c', + 'test_ui_pager.c', + 'test_ui_pager_scroll.c', 'test_part_bg.c', 'test_part_shadow.c', 'test_photo.c', @@ -133,6 +134,7 @@ elementary_test_src = [ 'test_transit.c', 'test_transit_bezier.c', 'test_ui_box.c', + 'test_ui_box_stack.c', 'test_ui_clock.c', 'test_ui_table.c', 'test_ui_popup.c', @@ -153,6 +155,7 @@ elementary_test_src = [ 'test_win_indicator.c', 'test_gesture_framework.c', 'test_ui_tab_pager.c', + 'test_ui_relative_layout.c', 'test.h' ] @@ -212,6 +215,13 @@ elementary_codegen = executable('elementary_codegen', link_args: link_args ) +if meson.is_cross_build() + elementary_codegen_exe = [find_program('elementary_codegen', native: true)] +else + env = find_program('env', native: true) + elementary_codegen_exe = [env, 'EFL_RUN_IN_TREE=1', elementary_codegen.full_path()] +endif + elm_prefs_cc_src = [ 'elm_prefs_cc.h', 'elm_prefs_cc.c', diff --git a/src/bin/elementary/perf.c b/src/bin/elementary/perf.c index 3cca032d99..17f26b8c54 100644 --- a/src/bin/elementary/perf.c +++ b/src/bin/elementary/perf.c @@ -128,7 +128,7 @@ anim_tick(void *data, const Efl_Event *event EINA_UNUSED) ecore_animator_del(animator); animator = NULL; #else - efl_event_callback_del(win, EFL_EVENT_ANIMATOR_TICK, anim_tick, data); + efl_event_callback_del(win, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, anim_tick, data); #endif ecore_timer_add(0.5, next_test_delay, data); } @@ -168,7 +168,7 @@ all_tests(Evas *e) #ifdef ANIMATOR animator = ecore_animator_add(anim_tick, e); #else - efl_event_callback_add(win, EFL_EVENT_ANIMATOR_TICK, anim_tick, e); + efl_event_callback_add(win, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, anim_tick, e); #endif } diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c index de66b96582..146d7ef902 100644 --- a/src/bin/elementary/test.c +++ b/src/bin/elementary/test.c @@ -3,6 +3,7 @@ #endif #include +#include #include #include "test.h" #include "test_explode.h" @@ -28,8 +29,8 @@ void test_box_horiz(void *data, Evas_Object *obj, void *event_info); void test_box_homo(void *data, Evas_Object *obj, void *event_info); void test_box_transition(void *data, Evas_Object *obj, void *event_info); 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_ui_box_stack(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); @@ -211,6 +212,11 @@ void test_menu2(void *data, Evas_Object *obj, void *event_info); void test_panel(void *data, Evas_Object *obj, void *event_info); void test_panel2(void *data, Evas_Object *obj, void *event_info); void test_panes(void *data, Evas_Object *obj, void *event_info); +void test_panes_flush(void *data, Evas_Object *obj, void *event_info); +void test_panes_left_fold(void *data, Evas_Object *obj, void *event_info); +void test_panes_right_fold(void *data, Evas_Object *obj, void *event_info); +void test_panes_up_fold(void *data, Evas_Object *obj, void *event_info); +void test_panes_down_fold(void *data, Evas_Object *obj, void *event_info); void test_panes_minsize(void *data, Evas_Object *obj, void *event_info); void test_calendar(void *data, Evas_Object *obj, void *event_info); void test_calendar2(void *data, Evas_Object *obj, void *event_info); @@ -351,7 +357,7 @@ 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); void test_evas_map(void *data, Edje_Object *obj, void *event_info); -void test_efl_gfx_map(void *data, Edje_Object *obj, void *event_info); +void test_efl_gfx_mapping(void *data, Edje_Object *obj, void *event_info); void test_ui_textpath(void *data, Edje_Object *obj, void *event_info); void test_efl_anim_alpha(void *data, Evas_Object *obj, void *event_info); @@ -365,7 +371,6 @@ void test_efl_anim_translate(void *data, Evas_Object *obj, void *event_info); void test_efl_anim_translate_absolute(void *data, Evas_Object *obj, void *event_info); void test_efl_anim_group_parallel(void *data, Evas_Object *obj, void *event_info); void test_efl_anim_group_sequential(void *data, Evas_Object *obj, void *event_info); -void test_efl_anim_event_anim(void *data, Evas_Object *obj, void *event_info); void test_efl_anim_pause(void *data, Evas_Object *obj, void *event_info); void test_efl_anim_repeat(void *data, Evas_Object *obj, void *event_info); void test_efl_anim_start_delay(void *data, Evas_Object *obj, void *event_info); @@ -374,6 +379,10 @@ 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); +void test_ui_pager(void *data, Evas_Object *obj, void *event_info); +void test_ui_pager_scroll(void *data, Evas_Object *obj, void *event_info); + +void test_ui_relative_layout(void *data, Evas_Object *obj, void *event_info); static void _list_udpate(void); @@ -822,7 +831,6 @@ add_tests: ADD_TEST(NULL, "Containers", "Box Homogeneous", test_box_homo); ADD_TEST(NULL, "Containers", "Box Transition", test_box_transition); ADD_TEST(NULL, "Containers", "Box Align", test_box_align); - ADD_TEST(NULL, "Containers", "Box Stack", test_box_stack); ADD_TEST(NULL, "Containers", "Table", test_table); ADD_TEST(NULL, "Containers", "Table Homogeneous", test_table2); ADD_TEST(NULL, "Containers", "Table 3", test_table3); @@ -837,9 +845,11 @@ add_tests: //------------------------------// ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Box", test_ui_box); + ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Box_Stack", test_ui_box_stack); ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Table", test_ui_table); ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Table (Linear API)", test_ui_table_linear); ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Table_Static", test_ui_table_static); + ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Relative_Layout", test_ui_relative_layout); //------------------------------// ADD_TEST_EO(NULL, "Events", "Event Refeed", test_events); @@ -918,7 +928,6 @@ add_tests: ADD_TEST_EO(NULL, "Effects", "Efl.Animation.Translate Absolute", test_efl_anim_translate_absolute); ADD_TEST_EO(NULL, "Effects", "Efl.Animation.Group Parallel", test_efl_anim_group_parallel); ADD_TEST_EO(NULL, "Effects", "Efl.Animation.Group Sequential", test_efl_anim_group_sequential); - ADD_TEST_EO(NULL, "Effects", "Efl.Animation.Event Animation", test_efl_anim_event_anim); ADD_TEST_EO(NULL, "Effects", "Efl.Animation.Pause", test_efl_anim_pause); ADD_TEST_EO(NULL, "Effects", "Efl.Animation.Repeat", test_efl_anim_repeat); ADD_TEST_EO(NULL, "Effects", "Efl.Animation.Start Delay", test_efl_anim_start_delay); @@ -1092,6 +1101,8 @@ add_tests: //------------------------------// ADD_TEST_EO(NULL, "Tab Pager", "Efl.Ui.Tab_Pager", test_ui_tab_pager); + ADD_TEST_EO(NULL, "Pager", "Efl.Ui.Pager", test_ui_pager); + ADD_TEST_EO(NULL, "Scroll Pager", "Efl.Ui.Pager (Scroll)", test_ui_pager_scroll); //------------------------------// ADD_TEST(NULL, "Popups", "Ctxpopup", test_ctxpopup); @@ -1166,6 +1177,11 @@ add_tests: ADD_TEST(NULL, "Dividers", "Panel", test_panel); ADD_TEST(NULL, "Dividers", "Panel Scrollable", test_panel2); ADD_TEST(NULL, "Dividers", "Panes", test_panes); + ADD_TEST(NULL, "Dividers", "Panes Flush", test_panes_flush); + ADD_TEST(NULL, "Dividers", "Panes Left Fold", test_panes_left_fold); + ADD_TEST(NULL, "Dividers", "Panes Right Fold", test_panes_right_fold); + ADD_TEST(NULL, "Dividers", "Panes Up Fold", test_panes_up_fold); + ADD_TEST(NULL, "Dividers", "Panes Down Fold", test_panes_down_fold); ADD_TEST_EO(NULL, "Dividers", "Efl.Ui.Panes", test_panes_minsize); ADD_TEST_EO(NULL, "Dividers", "Efl.Ui.Panel", test_ui_panel); ADD_TEST_EO(NULL, "Dividers", "Efl.Ui.Panel Scrollable", test_ui_panel2); @@ -1206,7 +1222,7 @@ add_tests: ADD_TEST(NULL, "Evas", "Gfx Filters", test_gfx_filters); ADD_TEST(NULL, "Evas", "Snapshot", test_evas_snapshot); ADD_TEST(NULL, "Evas", "Map", test_evas_map); - ADD_TEST_EO(NULL, "Evas", "Efl.Gfx.Map", test_efl_gfx_map); + ADD_TEST_EO(NULL, "Evas", "Efl.Gfx.Mapping", test_efl_gfx_mapping); //------------------------------// ADD_TEST(NULL, "Widgets Disable/Enable", "Box", test_box_disable); diff --git a/src/bin/elementary/test_anim.c b/src/bin/elementary/test_anim.c index 4bcf1581ab..caad01431f 100644 --- a/src/bin/elementary/test_anim.c +++ b/src/bin/elementary/test_anim.c @@ -92,5 +92,5 @@ test_anim(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info evas_object_resize(win, 480, 800); evas_object_show(win); - efl_event_callback_add(win, EFL_EVENT_ANIMATOR_TICK, _anim_tick, NULL); + efl_event_callback_add(win, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _anim_tick, NULL); } diff --git a/src/bin/elementary/test_bg.c b/src/bin/elementary/test_bg.c index 1802a69f79..68e2ba9315 100644 --- a/src/bin/elementary/test_bg.c +++ b/src/bin/elementary/test_bg.c @@ -2,8 +2,9 @@ # include "elementary_config.h" #endif +#include #include -#include "elm_colorselector.eo.h" +#include "elm_colorselector_eo.h" static void _cb_size_radio_changed(void *data, Evas_Object *obj, void *event EINA_UNUSED) @@ -292,15 +293,15 @@ _file_cb(void *data, const Efl_Event *ev) const char *f, *k; // File API - efl_file_get(efl_part(win, "background"), &f, &k); + efl_file_simple_get(efl_part(win, "background"), &f, &k); if (f) { - efl_file_set(efl_part(win, "background"), NULL, NULL); + efl_file_simple_load(efl_part(win, "background"), NULL, NULL); } else { - efl_file_get(ev->object, &f, &k); - efl_file_set(efl_part(win, "background"), f, k); + efl_file_simple_get(ev->object, &f, &k); + efl_file_simple_load(efl_part(win, "background"), f, k); } } @@ -315,10 +316,11 @@ _image_cb(void *data, const Efl_Event *ev) efl_content_set(efl_part(win, "background"), NULL); else { - efl_file_get(ev->object, &f, &k); + efl_file_simple_get(ev->object, &f, &k); o = efl_add(EFL_UI_IMAGE_CLASS, win, efl_gfx_image_scale_type_set(efl_added, EFL_GFX_IMAGE_SCALE_TYPE_FIT_OUTSIDE), - efl_file_set(efl_added, f, k) + efl_file_set(efl_added, f), + efl_file_key_set(efl_added, k) ); efl_content_set(efl_part(win, "background"), o); } @@ -337,7 +339,7 @@ test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event box = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), - efl_gfx_size_hint_weight_set(efl_added, 1, 1), + efl_gfx_hint_weight_set(efl_added, 1, 1), efl_content_set(win, efl_added)); cs = elm_colorselector_add(win); @@ -353,17 +355,17 @@ test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get()); efl_add(EFL_UI_IMAGE_CLASS, win, - efl_file_set(efl_added, buf, NULL), - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(64, 64)), - efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5), + efl_file_set(efl_added, buf), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(64, 64)), + efl_gfx_hint_align_set(efl_added, 0.5, 0.5), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _file_cb, win), efl_pack(box, efl_added)); snprintf(buf, sizeof(buf), "%s/images/sky_04.jpg", elm_app_data_dir_get()); efl_add(EFL_UI_IMAGE_CLASS, win, - efl_file_set(efl_added, buf, NULL), - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(64, 64)), - efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5), + efl_file_set(efl_added, buf), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(64, 64)), + efl_gfx_hint_align_set(efl_added, 0.5, 0.5), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _image_cb, win), efl_pack(box, efl_added)); @@ -409,32 +411,32 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e efl_ui_win_alpha_set(efl_added, EINA_FALSE)); efl_add(EFL_UI_BG_CLASS, win, - efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND), + efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND), efl_content_set(win, efl_added)); box = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL), - efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND), + efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND), efl_content_set(win, efl_added)); snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get()); o_bg = efl_add(EFL_UI_BG_CLASS, box, - efl_file_set(efl_added, buf, NULL), - efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND), - efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), + efl_file_set(efl_added, buf), + efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), efl_pack(box, efl_added)); hbox = efl_add(EFL_UI_BOX_CLASS, box, efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), - efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, 0.0), - efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), + efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0.0), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), efl_pack(box, efl_added)); rdg = rd = efl_add(EFL_UI_RADIO_CLASS, hbox, 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_gfx_hint_weight_set(efl_added, EFL_GFX_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)); @@ -442,7 +444,7 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e 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), + efl_gfx_hint_weight_set(efl_added, EFL_GFX_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)); @@ -451,7 +453,7 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e 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), + efl_gfx_hint_weight_set(efl_added, EFL_GFX_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)); @@ -459,7 +461,7 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e 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), + efl_gfx_hint_weight_set(efl_added, EFL_GFX_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)); @@ -467,7 +469,7 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e 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_gfx_hint_weight_set(efl_added, EFL_GFX_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)); @@ -475,7 +477,7 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e efl_add(EFL_UI_CHECK_CLASS, hbox, efl_text_set(efl_added, "Bg Color"), - efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, 0.0), + efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0.0), efl_event_callback_add(efl_added, EFL_UI_CHECK_EVENT_CHANGED, _cb_check_changed_scale_type, o_bg), efl_pack(hbox, efl_added)); diff --git a/src/bin/elementary/test_box.c b/src/bin/elementary/test_box.c index f50dcb339f..893e96d716 100644 --- a/src/bin/elementary/test_box.c +++ b/src/bin/elementary/test_box.c @@ -2,6 +2,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include #define ICON_MAX 24 @@ -881,43 +882,3 @@ test_box_align(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, evas_object_resize(win, 300, 400); evas_object_show(win); } - -void -test_box_stack(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, - void *event_info EINA_UNUSED) -{ - Evas_Object *win, *bx, *o; - char buf[PATH_MAX]; - - 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)); - - efl_gfx_color_set(efl_part(win, "background"), 24, 24, 64, 255); - - /* stacked box, with items in the center-bottom. its default weight makes - * the window resizable */ - bx = efl_add(EFL_UI_BOX_STACK_CLASS, win, - efl_pack_align_set(efl_added, 0.5, 1.0)); - efl_content_set(win, bx); - - /* stretched rectangle */ - o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win, - efl_gfx_color_set(efl_added, 0, 64, 128, 255)); - efl_pack(bx, o); - - /* rectangle with a max size */ - o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win, - efl_gfx_color_set(efl_added, 64, 128, 64, 255), - efl_gfx_size_hint_max_set(efl_added, EINA_SIZE2D(128, 20))); - efl_pack(bx, o); - - /* image with a forced min size */ - snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get()); - o = 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_pack(bx, o); - - 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 ba37407c0f..9a5de374ee 100644 --- a/src/bin/elementary/test_calendar.c +++ b/src/bin/elementary/test_calendar.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include struct _api_data diff --git a/src/bin/elementary/test_code.c b/src/bin/elementary/test_code.c index bb010ce5e6..076ef6d27d 100644 --- a/src/bin/elementary/test_code.c +++ b/src/bin/elementary/test_code.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include static Evas_Object *_test_code_win_create(const char *id, const char *name) @@ -69,7 +70,7 @@ _elm_code_test_welcome_setup(Evas_Object *parent) evas_object_show(widget); efl_event_callback_add(widget, &ELM_CODE_EVENT_LINE_LOAD_DONE, _elm_code_test_line_done_cb, NULL); - efl_event_callback_add(widget, ELM_OBJ_CODE_WIDGET_EVENT_LINE_CLICKED, _elm_code_test_line_clicked_cb, code); + efl_event_callback_add(widget, EFL_UI_CODE_WIDGET_EVENT_LINE_CLICKED, _elm_code_test_line_clicked_cb, code); _append_line(code->file, "❤ Hello World, Elm Code! ❤"); _append_line(code->file, "*** Currently experimental ***"); @@ -103,10 +104,10 @@ _elm_code_test_editor_setup(Evas_Object *parent, Eina_Bool log) evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(widget); - elm_obj_code_widget_font_set(widget, NULL, 14); - elm_obj_code_widget_editable_set(widget, EINA_TRUE); - elm_obj_code_widget_show_whitespace_set(widget, EINA_TRUE); - elm_obj_code_widget_line_numbers_set(widget, EINA_TRUE); + efl_ui_code_widget_font_set(widget, NULL, 14); + efl_ui_code_widget_editable_set(widget, EINA_TRUE); + efl_ui_code_widget_show_whitespace_set(widget, EINA_TRUE); + efl_ui_code_widget_line_numbers_set(widget, EINA_TRUE); if (!log) { @@ -135,11 +136,11 @@ _elm_code_test_syntax_setup(Evas_Object *parent) evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(widget); - elm_obj_code_widget_editable_set(widget, EINA_TRUE); - elm_obj_code_widget_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); + efl_ui_code_widget_editable_set(widget, EINA_TRUE); + efl_ui_code_widget_syntax_enabled_set(widget, EINA_TRUE); + efl_ui_code_widget_code_get(widget)->file->mime = "text/x-csrc"; + efl_ui_code_widget_show_whitespace_set(widget, EINA_TRUE); + efl_ui_code_widget_line_numbers_set(widget, EINA_TRUE); _append_line(code->file, "#include "); _append_line(code->file, "int main(int argc, char **argv)"); @@ -163,13 +164,13 @@ _elm_code_test_syntax_tabbed_setup(Evas_Object *parent) 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); + widget = efl_add(ELM_CODE_WIDGET_CLASS, parent, efl_ui_code_widget_code_set(efl_added, code)); + efl_ui_code_widget_editable_set(widget, EINA_TRUE); + efl_ui_code_widget_syntax_enabled_set(widget, EINA_TRUE); + efl_ui_code_widget_code_get(widget)->file->mime = "text/x-csrc"; + efl_ui_code_widget_show_whitespace_set(widget, EINA_TRUE); + efl_ui_code_widget_line_numbers_set(widget, EINA_TRUE); + efl_ui_code_widget_tab_inserts_spaces_set(widget, EINA_FALSE); _append_line(code->file, "#include "); _append_line(code->file, "int main(int argc, char **argv)"); @@ -199,8 +200,8 @@ _elm_code_test_mirror_setup(Elm_Code *code, char *font_name, Evas_Object *parent evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(widget); - elm_obj_code_widget_font_set(widget, font_name, 11); - elm_obj_code_widget_line_numbers_set(widget, EINA_TRUE); + efl_ui_code_widget_font_set(widget, font_name, 11); + efl_ui_code_widget_line_numbers_set(widget, EINA_TRUE); return widget; } @@ -326,7 +327,7 @@ test_code_log(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ o = elm_button_add(screen); elm_object_text_set(o, "log"); - evas_object_smart_callback_add(o, "clicked", _elm_code_test_log_clicked, elm_obj_code_widget_code_get(code)); + evas_object_smart_callback_add(o, "clicked", _elm_code_test_log_clicked, efl_ui_code_widget_code_get(code)); elm_box_pack_end(screen, o); evas_object_show(o); @@ -348,7 +349,7 @@ test_code_mirror(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve evas_object_size_hint_weight_set(screen, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); widget = _elm_code_test_editor_setup(screen, EINA_FALSE); - code = elm_obj_code_widget_code_get(widget); + code = efl_ui_code_widget_code_get(widget); elm_box_pack_end(screen, widget); elm_box_pack_end(screen, _elm_code_test_mirror_setup(code, "Mono:style=Oblique", screen)); diff --git a/src/bin/elementary/test_ctxpopup.c b/src/bin/elementary/test_ctxpopup.c index 9293647d28..f547f08951 100644 --- a/src/bin/elementary/test_ctxpopup.c +++ b/src/bin/elementary/test_ctxpopup.c @@ -39,10 +39,11 @@ _print_current_dir(Evas_Object *obj) } static void -_btn_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, +_btn_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { printf("Button Clicked\n"); + elm_object_disabled_set(data, !elm_object_disabled_get(data)); } static void diff --git a/src/bin/elementary/test_efl_anim_event_anim.c b/src/bin/elementary/test_efl_anim_event_anim.c deleted file mode 100644 index b4c351888c..0000000000 --- a/src/bin/elementary/test_efl_anim_event_anim.c +++ /dev/null @@ -1,91 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include "elementary_config.h" -#endif -#include - -typedef struct _App_Data -{ - Efl_Canvas_Animation_Player *target; - - Eina_Bool is_btn_visible; -} App_Data; - -static void -_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) -{ - App_Data *ad = data; - - ad->is_btn_visible = !(ad->is_btn_visible); - - if (ad->is_btn_visible) - { - //Start animtion by showing button - evas_object_show(ad->target); - elm_object_text_set(obj, "Hide Button"); - } - else - { - //Start animtion by hiding button - evas_object_hide(ad->target); - elm_object_text_set(obj, "Show Button"); - } -} - -static void -_win_del_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) -{ - App_Data *ad = data; - free(ad); -} - -void -test_efl_anim_event_anim(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) -{ - App_Data *ad = calloc(1, sizeof(App_Data)); - if (!ad) return; - - Evas_Object *win = elm_win_add(NULL, "Efl Animation Event Animation", ELM_WIN_BASIC); - elm_win_title_set(win, "Efl Animation Event Animation"); - elm_win_autodel_set(win, EINA_TRUE); - evas_object_smart_callback_add(win, "delete,request", _win_del_cb, ad); - - //Button to be animated - Evas_Object *btn = elm_button_add(win); - elm_object_text_set(btn, "Button"); - evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_resize(btn, 200, 200); - evas_object_move(btn, 100, 50); - - //Show Animation - 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_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_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_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; - ad->is_btn_visible = EINA_TRUE; - - //Button to start animation - Evas_Object *btn2 = elm_button_add(win); - elm_object_text_set(btn2, "Hide Button"); - evas_object_smart_callback_add(btn2, "clicked", _btn_clicked_cb, ad); - evas_object_size_hint_weight_set(btn2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_resize(btn2, 200, 50); - evas_object_move(btn2, 100, 300); - evas_object_show(btn2); - - evas_object_resize(win, 400, 400); - evas_object_show(win); -} diff --git a/src/bin/elementary/test_efl_gfx_map.c b/src/bin/elementary/test_efl_gfx_mapping.c similarity index 50% rename from src/bin/elementary/test_efl_gfx_map.c rename to src/bin/elementary/test_efl_gfx_mapping.c index 72d7db139d..c4080c1b94 100644 --- a/src/bin/elementary/test_efl_gfx_map.c +++ b/src/bin/elementary/test_efl_gfx_mapping.c @@ -1,34 +1,35 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include static void _map_set(Evas_Object *obj) { - efl_gfx_map_reset(obj); - efl_gfx_map_point_count_set(obj, 8); + efl_gfx_mapping_reset(obj); + efl_gfx_mapping_point_count_set(obj, 8); //1st rect - efl_gfx_map_coord_absolute_set(obj, 0, 100, 0, 0); - efl_gfx_map_coord_absolute_set(obj, 1, 200, 0, 0); - efl_gfx_map_coord_absolute_set(obj, 2, 200, 100, 0); - efl_gfx_map_coord_absolute_set(obj, 3, 100, 100, 0); + efl_gfx_mapping_coord_absolute_set(obj, 0, 100, 0, 0); + efl_gfx_mapping_coord_absolute_set(obj, 1, 200, 0, 0); + efl_gfx_mapping_coord_absolute_set(obj, 2, 200, 100, 0); + efl_gfx_mapping_coord_absolute_set(obj, 3, 100, 100, 0); //2nd rect - efl_gfx_map_coord_absolute_set(obj, 4, 200, 0, 0); - efl_gfx_map_coord_absolute_set(obj, 5, 100, 200, 0); - efl_gfx_map_coord_absolute_set(obj, 6, 100, 300, 0); - efl_gfx_map_coord_absolute_set(obj, 7, 200, 100, 0); + efl_gfx_mapping_coord_absolute_set(obj, 4, 200, 0, 0); + efl_gfx_mapping_coord_absolute_set(obj, 5, 100, 200, 0); + efl_gfx_mapping_coord_absolute_set(obj, 6, 100, 300, 0); + efl_gfx_mapping_coord_absolute_set(obj, 7, 200, 100, 0); //uv: 1st rect: uv: [0-1] - efl_gfx_map_uv_set(obj, 0, 0, 0); - efl_gfx_map_uv_set(obj, 1, 0.5, 0); - efl_gfx_map_uv_set(obj, 2, 0.5, 1); - efl_gfx_map_uv_set(obj, 3, 0, 1); + efl_gfx_mapping_uv_set(obj, 0, 0, 0); + efl_gfx_mapping_uv_set(obj, 1, 0.5, 0); + efl_gfx_mapping_uv_set(obj, 2, 0.5, 1); + efl_gfx_mapping_uv_set(obj, 3, 0, 1); //uv: 2nd rect - efl_gfx_map_uv_set(obj, 4, 0.5, 0); - efl_gfx_map_uv_set(obj, 5, 1, 0); - efl_gfx_map_uv_set(obj, 6, 1, 1); - efl_gfx_map_uv_set(obj, 7, 0.5, 1); + efl_gfx_mapping_uv_set(obj, 4, 0.5, 0); + efl_gfx_mapping_uv_set(obj, 5, 1, 0); + efl_gfx_mapping_uv_set(obj, 6, 1, 1); + efl_gfx_mapping_uv_set(obj, 7, 0.5, 1); } static void @@ -38,7 +39,7 @@ _image_resize_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, } void -test_efl_gfx_map(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, +test_efl_gfx_mapping(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { const Evas_Coord W = 300, H = 300; @@ -52,8 +53,8 @@ test_efl_gfx_map(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, /* image with a min size */ snprintf(buf, sizeof(buf), "%s/images/rock_02.jpg", elm_app_data_dir_get()); 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_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(64, 64)), + efl_file_set(efl_added, buf)); 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); diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index f8280f0612..120eca7a81 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -2,6 +2,7 @@ # include "elementary_config.h" #endif #define EO_BETA_API +#include #include static void @@ -41,7 +42,7 @@ test_efl_ui_text_label(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi char *markup; win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl Canvas_Layout"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); @@ -71,7 +72,7 @@ test_efl_ui_text_label(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi efl_text_multiline_set(en, EINA_TRUE); en = _create_label(win, bx); - markup = efl_text_markup_util_text_to_markup(EFL_TEXT_MARKUP_UTIL_CLASS, + markup = efl_text_markup_util_text_to_markup( "You can use the text -> markup helper\nto make coding easier."); efl_text_markup_set(en, markup); free(markup); @@ -80,7 +81,7 @@ test_efl_ui_text_label(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi efl_text_multiline_set(en, EINA_TRUE); en = _create_label(win, bx); - markup = efl_text_markup_util_markup_to_text(EFL_TEXT_MARKUP_UTIL_CLASS, + markup = efl_text_markup_util_markup_to_text( "You can use markup -> text helpersto make coding easier."); efl_text_set(en, markup); free(markup); @@ -145,12 +146,12 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve Eo *bt; win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl Ui Text"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); bx = efl_add(EFL_UI_BOX_CLASS, win); - efl_gfx_size_hint_weight_set(bx, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); + efl_gfx_hint_weight_set(bx, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND); efl_content_set(win, bx); en = efl_add(EFL_UI_TEXT_CLASS, bx, @@ -174,24 +175,24 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve "occaecat cupidatat non proident, sunt in culpa qui officia deserunt\n" "mollit anim id est laborum"); - efl_gfx_size_hint_min_set(en, EINA_SIZE2D(300, 100)); + efl_gfx_hint_size_min_set(en, EINA_SIZE2D(300, 100)); efl_pack(bx, en); bx2 = efl_add(EFL_UI_BOX_CLASS, bx); - efl_gfx_size_hint_weight_set(bx2, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); + efl_gfx_hint_weight_set(bx2, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND); efl_ui_direction_set(bx2, EFL_UI_DIR_HORIZONTAL); bt = efl_add(EFL_UI_BUTTON_CLASS, bx2); efl_text_set(bt, "Sel"); efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _on_bt3_clicked, en); - efl_gfx_size_hint_weight_set(bt, EFL_GFX_SIZE_HINT_EXPAND, 0.0); + efl_gfx_hint_weight_set(bt, EFL_GFX_HINT_EXPAND, 0.0); efl_pack(bx2, bt); elm_object_focus_allow_set(bt, EINA_FALSE); bt = efl_add(EFL_UI_BUTTON_CLASS, bx2); efl_text_set(bt, "Wr"); efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _on_bt6_clicked, en); - efl_gfx_size_hint_weight_set(bt, EFL_GFX_SIZE_HINT_EXPAND, 0.0); + efl_gfx_hint_weight_set(bt, EFL_GFX_HINT_EXPAND, 0.0); efl_pack(bx2, bt); elm_object_focus_allow_set(bt, EINA_FALSE); @@ -204,12 +205,12 @@ test_efl_ui_text_inputfield(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED Eo *win, *bx, *en; win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl Ui Text Input Field"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); bx = efl_add(EFL_UI_BOX_CLASS, win); - efl_gfx_size_hint_weight_set(bx, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); + efl_gfx_hint_weight_set(bx, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND); efl_content_set(win, bx); en = efl_add(EFL_UI_TEXT_CLASS, bx, @@ -251,7 +252,7 @@ _on_factory_bt_image_clicked(void *data, const Efl_Event *event EINA_UNUSED) image_idx = (image_idx + 1) % IMAGES_SZ; efl_text_cursor_item_insert(en, - efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_MAIN), + efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_TYPE_MAIN), images[image_idx], "size=32x32"); printf("Inserted image: key = %s\n", images[image_idx]); } @@ -260,7 +261,7 @@ static void _on_factory_bt_emoticon_clicked(void *data, const Efl_Event *event EINA_UNUSED) { Evas_Object *en = data; - efl_text_cursor_item_insert(en, efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_MAIN), + efl_text_cursor_item_insert(en, efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_TYPE_MAIN), "emoticon/evil-laugh", "size=32x32"); } @@ -294,7 +295,7 @@ test_ui_text_item_factory(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, Eina_File *f; win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl Ui Text Item Factory"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); @@ -353,7 +354,7 @@ test_ui_text_item_factory(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 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); + main_cur = efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_TYPE_MAIN); cur = efl_text_cursor_new(en); efl_text_cursor_position_set(en, cur, 2); @@ -370,27 +371,27 @@ test_ui_text_item_factory(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, elm_object_focus_set(en, EINA_TRUE); bx2 = efl_add(EFL_UI_BOX_CLASS, bx); - efl_gfx_size_hint_weight_set(bx2, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); + efl_gfx_hint_weight_set(bx2, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND); efl_ui_direction_set(bx2, EFL_UI_DIR_HORIZONTAL); bt = efl_add(EFL_UI_BUTTON_CLASS, bx2); efl_text_set(bt, "Image"); efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _on_factory_bt_image_clicked, en); - efl_gfx_size_hint_weight_set(bt, EFL_GFX_SIZE_HINT_EXPAND, 0.0); + efl_gfx_hint_weight_set(bt, EFL_GFX_HINT_EXPAND, 0.0); efl_pack(bx2, bt); elm_object_focus_allow_set(bt, EINA_FALSE); bt = efl_add(EFL_UI_BUTTON_CLASS, bx2); efl_text_set(bt, "Emoticon"); efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _on_factory_bt_emoticon_clicked, en); - efl_gfx_size_hint_weight_set(bt, EFL_GFX_SIZE_HINT_EXPAND, 0.0); + efl_gfx_hint_weight_set(bt, EFL_GFX_HINT_EXPAND, 0.0); efl_pack(bx2, bt); elm_object_focus_allow_set(bt, EINA_FALSE); bt = efl_add(EFL_UI_BUTTON_CLASS, bx2); efl_text_set(bt, "Factory"); efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _on_factory_bt_factory_clicked, en); - efl_gfx_size_hint_weight_set(bt, EFL_GFX_SIZE_HINT_EXPAND, 0.0); + efl_gfx_hint_weight_set(bt, EFL_GFX_HINT_EXPAND, 0.0); efl_pack(bx2, bt); elm_object_focus_allow_set(bt, EINA_FALSE); diff --git a/src/bin/elementary/test_entry.c b/src/bin/elementary/test_entry.c index cf3b1484d0..56264ccde7 100644 --- a/src/bin/elementary/test_entry.c +++ b/src/bin/elementary/test_entry.c @@ -5,8 +5,8 @@ #include // FIXME: elm_entry is not part of EO API, the below test cases may be useless -#include "elm_entry.eo.h" -#include "elm_popup.eo.h" +#include "elm_entry_eo.h" +#include "elm_popup_eo.h" static void my_entry_bt_1(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) diff --git a/src/bin/elementary/test_evas_map.c b/src/bin/elementary/test_evas_map.c index 7e25aafba7..3cabe96061 100644 --- a/src/bin/elementary/test_evas_map.c +++ b/src/bin/elementary/test_evas_map.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include static void @@ -60,8 +61,9 @@ test_evas_map(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, /* image with a min size */ snprintf(buf, sizeof(buf), "%s/images/rock_02.jpg", elm_app_data_dir_get()); 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_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(64, 64)), + efl_file_set(efl_added, buf), + efl_file_load(efl_added)); 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); diff --git a/src/bin/elementary/test_evas_mask.c b/src/bin/elementary/test_evas_mask.c index 7ce8933806..223d657b4c 100644 --- a/src/bin/elementary/test_evas_mask.c +++ b/src/bin/elementary/test_evas_mask.c @@ -2,6 +2,7 @@ # include "elementary_config.h" #endif #include +#include static Evas_Object * @@ -81,12 +82,12 @@ _toggle_map(void *data, const Efl_Event *ev EINA_UNUSED) { Eo *ly = data; - if (!efl_gfx_map_has(ly)) + if (!efl_gfx_mapping_has(ly)) { - efl_gfx_map_zoom(ly, 0.8, 0.8, NULL, 0.5, 0.5); - efl_gfx_map_rotate(ly, 45, NULL, 0.5, 0.5); + efl_gfx_mapping_zoom(ly, 0.8, 0.8, NULL, 0.5, 0.5); + efl_gfx_mapping_rotate(ly, 45, NULL, 0.5, 0.5); } - else efl_gfx_map_reset(ly); + else efl_gfx_mapping_reset(ly); } static void @@ -118,19 +119,20 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event // FIXME: No API to set background as "tile" :( snprintf(buf, sizeof(buf), "%s/images/pm_fill.png", elm_app_data_dir_get()); - efl_file_set(efl_part(win, "background"), buf, NULL); + efl_file_simple_load(efl_part(win, "background"), buf, NULL); // 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, - efl_file_set(efl_added, buf, "masking")); + efl_file_set(efl_added, buf), + efl_file_key_set(efl_added, "masking")); efl_pack(box, ly); // FIXME: No genlist in EO API o = gl = elm_genlist_add(win); elm_genlist_homogeneous_set(gl, 1); - efl_gfx_size_hint_align_set(o, -1, -1); - efl_gfx_size_hint_weight_set(o, 1, 1); + efl_gfx_hint_align_set(o, -1, -1); + efl_gfx_hint_weight_set(o, 1, 1); itc = elm_genlist_item_class_new(); itc->item_style = "default"; @@ -154,26 +156,26 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event box2 = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_LTR), - efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), + efl_gfx_hint_weight_set(efl_added, 1.0, 0.0), efl_pack(box, efl_added)); // FIXME: button EO API efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Toggle mask"), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _toggle_mask, ly), - efl_gfx_size_hint_weight_set(efl_added, 0.0, 0.0), + efl_gfx_hint_weight_set(efl_added, 0.0, 0.0), efl_pack(box2, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Toggle map"), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _toggle_map, ly), - efl_gfx_size_hint_weight_set(efl_added, 0.0, 0.0), + efl_gfx_hint_weight_set(efl_added, 0.0, 0.0), efl_pack(box2, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Rotate Window"), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _rotate_win, win), - efl_gfx_size_hint_weight_set(efl_added, 0.0, 0.0), + efl_gfx_hint_weight_set(efl_added, 0.0, 0.0), efl_pack(box2, efl_added)); 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 96b7bc4478..855c33a949 100644 --- a/src/bin/elementary/test_evas_snapshot.c +++ b/src/bin/elementary/test_evas_snapshot.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include #define TABLE_SIZE 10 @@ -29,8 +30,9 @@ static inline Eo * _image_create(Eo *win, const char *path) { return efl_add(EFL_UI_IMAGE_CLASS, win, - efl_file_set(efl_added, path, NULL), - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(20, 20))); + efl_file_set(efl_added, path), + efl_file_load(efl_added), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(20, 20))); } static void @@ -104,12 +106,12 @@ _toggle_map(void *data, const Efl_Event *ev EINA_UNUSED) Eo *snap; snap = efl_key_wref_get(win, "snap"); - if (!efl_gfx_map_has(snap)) + if (!efl_gfx_mapping_has(snap)) { - efl_gfx_map_zoom(snap, 0.8, 0.8, NULL, 0.5, 0.5); - efl_gfx_map_rotate(snap, 20.0, NULL, 0.5, 0.5); + efl_gfx_mapping_zoom(snap, 0.8, 0.8, NULL, 0.5, 0.5); + efl_gfx_mapping_rotate(snap, 20.0, NULL, 0.5, 0.5); } - else efl_gfx_map_reset(snap); + else efl_gfx_mapping_reset(snap); } void @@ -169,36 +171,36 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e elm_slider_min_max_set(efl_added, 0, 64), elm_slider_value_set(efl_added, 5), elm_slider_unit_format_set(efl_added, "%.0f px"), - efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), + efl_gfx_hint_weight_set(efl_added, 1.0, 0.0), efl_pack_table(table, efl_added, 0, TABLE_SIZE, TABLE_SIZE, 1), efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _radius_set, win)); box = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), - efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), efl_pack_table(table, efl_added, 0, TABLE_SIZE + 1, TABLE_SIZE, 1)); efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Toggle animation"), - efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), + efl_gfx_hint_weight_set(efl_added, 1.0, 0.0), efl_pack(box, efl_added), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _anim_toggle, win)); efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Save to file"), - efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), + efl_gfx_hint_weight_set(efl_added, 1.0, 0.0), efl_pack(box, efl_added), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _save_image, win)); efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Map"), - efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), + efl_gfx_hint_weight_set(efl_added, 1.0, 0.0), efl_pack(box, efl_added), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _toggle_map, win)); efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Close"), - efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), + efl_gfx_hint_weight_set(efl_added, 1.0, 0.0), efl_pack(box, efl_added), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _close_do, win)); diff --git a/src/bin/elementary/test_events.c b/src/bin/elementary/test_events.c index 1eba66c2dc..e81fca52e2 100644 --- a/src/bin/elementary/test_events.c +++ b/src/bin/elementary/test_events.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include #define EFL_INTERNAL_UNSTABLE diff --git a/src/bin/elementary/test_flip_page_eo.c b/src/bin/elementary/test_flip_page_eo.c index a1ce5f5b66..e313e2848c 100644 --- a/src/bin/elementary/test_flip_page_eo.c +++ b/src/bin/elementary/test_flip_page_eo.c @@ -88,34 +88,34 @@ _slice_apply(State *st, Slice *sl, Evas_Coord x EINA_UNUSED, Evas_Coord y EINA_UNUSED, Evas_Coord w, Evas_Coord h EINA_UNUSED, Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh) { - efl_gfx_map_reset(sl->obj); - efl_gfx_map_smooth_set(sl->obj, EINA_TRUE); - efl_gfx_map_color_set(sl->obj, -1, 255, 255, 255, 255); + efl_gfx_mapping_reset(sl->obj); + efl_gfx_mapping_smooth_set(sl->obj, EINA_TRUE); + efl_gfx_mapping_color_set(sl->obj, -1, 255, 255, 255, 255); for (int i = 0; i < 4; i++) { if (st->dir == 0) { int p[4] = { 0, 1, 2, 3 }; - efl_gfx_map_coord_absolute_set(sl->obj, i, ox + sl->x[p[i]], oy + sl->y[p[i]], sl->z[p[i]]); - efl_gfx_map_uv_set(sl->obj, i, sl->u[p[i]] , sl->v[p[i]]); + efl_gfx_mapping_coord_absolute_set(sl->obj, i, ox + sl->x[p[i]], oy + sl->y[p[i]], sl->z[p[i]]); + efl_gfx_mapping_uv_set(sl->obj, i, sl->u[p[i]] , sl->v[p[i]]); } else if (st->dir == 1) { int p[4] = { 1, 0, 3, 2 }; - efl_gfx_map_coord_absolute_set(sl->obj, i, ox + (w - sl->x[p[i]]), oy + sl->y[p[i]], sl->z[p[i]]); - efl_gfx_map_uv_set(sl->obj, i, 1. - sl->u[p[i]] , sl->v[p[i]]); + efl_gfx_mapping_coord_absolute_set(sl->obj, i, ox + (w - sl->x[p[i]]), oy + sl->y[p[i]], sl->z[p[i]]); + efl_gfx_mapping_uv_set(sl->obj, i, 1. - sl->u[p[i]] , sl->v[p[i]]); } else if (st->dir == 2) { int p[4] = { 1, 0, 3, 2 }; - efl_gfx_map_coord_absolute_set(sl->obj, i, ox + sl->y[p[i]], oy + sl->x[p[i]], sl->z[p[i]]); - efl_gfx_map_uv_set(sl->obj, i, sl->v[p[i]] , sl->u[p[i]]); + efl_gfx_mapping_coord_absolute_set(sl->obj, i, ox + sl->y[p[i]], oy + sl->x[p[i]], sl->z[p[i]]); + efl_gfx_mapping_uv_set(sl->obj, i, sl->v[p[i]] , sl->u[p[i]]); } else if (st->dir == 3) { int p[4] = { 0, 1, 2, 3 }; - efl_gfx_map_coord_absolute_set(sl->obj, i, ox + sl->y[p[i]], oy + (w - sl->x[p[i]]), sl->z[p[i]]); - efl_gfx_map_uv_set(sl->obj, i, sl->v[p[i]] , 1. - sl->u[p[i]]); + efl_gfx_mapping_coord_absolute_set(sl->obj, i, ox + sl->y[p[i]], oy + (w - sl->x[p[i]]), sl->z[p[i]]); + efl_gfx_mapping_uv_set(sl->obj, i, sl->v[p[i]] , 1. - sl->u[p[i]]); } } evas_object_image_fill_set(sl->obj, 0, 0, ow, oh); @@ -125,22 +125,22 @@ static void _slice_3d(State *st EINA_UNUSED, Slice *sl, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) { // vanishing point is center of page, and focal dist is 1024 - efl_gfx_map_perspective_3d_absolute(sl->obj, x + (w / 2), y + (h / 2), 0, 1024); + efl_gfx_mapping_perspective_3d_absolute(sl->obj, x + (w / 2), y + (h / 2), 0, 1024); for (int i = 0; i < 4; i++) { double xx, yy; - 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_mapping_coord_absolute_get(sl->obj, i, &xx, &yy, NULL); + efl_gfx_mapping_coord_absolute_set(sl->obj, i, xx, yy, 0); } - efl_gfx_entity_visible_set(sl->obj, efl_gfx_map_clockwise_get(sl->obj)); + efl_gfx_entity_visible_set(sl->obj, efl_gfx_mapping_clockwise_get(sl->obj)); } static void _slice_light(State *st EINA_UNUSED, Slice *sl, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) { - efl_gfx_map_lightning_3d_absolute(sl->obj, + efl_gfx_mapping_lighting_3d_absolute(sl->obj, // light position // (centered over page 10 * h toward camera) x + (w / 2), y + (h / 2), -10000, @@ -153,11 +153,11 @@ _slice_light(State *st EINA_UNUSED, Slice *sl, Evas_Coord x, Evas_Coord y, Evas_ { int r, g, b, a; - efl_gfx_map_color_get(sl->obj, i, &r, &g, &b, &a); + efl_gfx_mapping_color_get(sl->obj, i, &r, &g, &b, &a); r = (double)r * 1.2; if (r > 255) r = 255; g = (double)g * 1.2; if (g > 255) g = 255; b = (double)b * 1.2; if (b > 255) b = 255; - efl_gfx_map_color_set(sl->obj, i, r, g, b, a); + efl_gfx_mapping_color_set(sl->obj, i, r, g, b, a); } } @@ -253,7 +253,7 @@ _slice_obj_color_sum(Slice *s, int p, int *r, int *g, int *b, int *a) int rr = 0, gg = 0, bb = 0, aa = 0; if (!s) return 0; - efl_gfx_map_color_get(s->obj, p, &rr, &gg, &bb, &aa); + efl_gfx_mapping_color_get(s->obj, p, &rr, &gg, &bb, &aa); *r += rr; *g += gg; *b += bb; *a += aa; return 1; } @@ -262,7 +262,7 @@ static void _slice_obj_color_set(Slice *s, int p, int r, int g, int b, int a) { if (!s) return; - efl_gfx_map_color_set(s->obj, p, r, g, b, a); + efl_gfx_mapping_color_set(s->obj, p, r, g, b, a); } static void diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c index 58fd21c4a5..49372190d6 100644 --- a/src/bin/elementary/test_gfx_filters.c +++ b/src/bin/elementary/test_gfx_filters.c @@ -3,7 +3,8 @@ #endif #include -#include "elm_colorselector.eo.h" +#include +#include "elm_spinner_eo.h" static const int default_font_size = 48; @@ -248,7 +249,7 @@ _text_resize(void *data EINA_UNUSED, const Efl_Event *ev) Eina_Size2D sz; sz = efl_gfx_entity_size_get(ev->object); - efl_gfx_size_hint_min_set(ev->object, sz); + efl_gfx_hint_size_min_set(ev->object, sz); } static void @@ -258,7 +259,7 @@ _textblock_resize(void *data EINA_UNUSED, const Efl_Event *ev) evas_object_textblock_size_native_get(ev->object, &w, &h); evas_object_textblock_style_insets_get(ev->object, &l, &r, &t, &b); - efl_gfx_size_hint_min_set(ev->object, EINA_SIZE2D(w + l + r, h + t + b)); + efl_gfx_hint_size_min_set(ev->object, EINA_SIZE2D(w + l + r, h + t + b)); } static void @@ -307,7 +308,7 @@ _flip_click(void *data, const Efl_Event *ev EINA_UNUSED) Eo *flip = efl_key_wref_get(win, "flip"); /* FIXME: The flip APIs don't make sense for N items (front!?) */ - efl_ui_flip_go(flip, EFL_UI_FLIP_CROSS_FADE); + efl_ui_flip_go(flip, EFL_UI_FLIP_MODE_CROSS_FADE); } static void @@ -345,28 +346,28 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve { box2 = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), - efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), - efl_gfx_size_hint_align_set(efl_added, 0.5, 0.0), - efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE)); + efl_gfx_hint_weight_set(efl_added, 1.0, 0.0), + efl_gfx_hint_align_set(efl_added, 0.5, 0.0), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE)); efl_pack(box, box2); /* FIXME: Efl.Ui.Text doesn't work as expected. */ o = efl_add(EFL_UI_TEXT_CLASS, win, - efl_gfx_size_hint_weight_set(efl_added, 0.0, 1.0), - efl_gfx_size_hint_align_set(efl_added, 1.0, 0.5)); + efl_gfx_hint_weight_set(efl_added, 0.0, 1.0), + efl_gfx_hint_align_set(efl_added, 1.0, 0.5)); efl_text_set(o, "Filter:"); efl_pack(box2, o); o = spinner = elm_spinner_add(win); - efl_gfx_size_hint_weight_set(o, 1.0, 1.0); - efl_gfx_size_hint_align_set(o, -1.0, 0.5); + efl_gfx_hint_weight_set(o, 1.0, 1.0); + efl_gfx_hint_align_set(o, -1.0, 0.5); _spinner_fill(o); efl_pack(box2, o); evas_object_show(o); o = elm_spinner_add(win); - efl_gfx_size_hint_weight_set(o, 0.0, 1.0); - efl_gfx_size_hint_align_set(o, -1.0, 0.5); + efl_gfx_hint_weight_set(o, 0.0, 1.0); + efl_gfx_hint_align_set(o, -1.0, 0.5); elm_spinner_min_max_set(o, 6, 120); elm_spinner_value_set(o, default_font_size); efl_event_callback_add(o, ELM_SPINNER_EVENT_DELAY_CHANGED, _font_size_change, win); @@ -375,8 +376,8 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve o = efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Flip"), - efl_gfx_size_hint_weight_set(efl_added, 0.0, 1.0), - efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), + efl_gfx_hint_weight_set(efl_added, 0.0, 1.0), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _flip_click, win)); efl_pack(box2, o); } @@ -384,10 +385,10 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve { box2 = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), - efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), - efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), + efl_gfx_hint_weight_set(efl_added, 1.0, 0.0), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_pack_padding_set(efl_added, 5, 5, 1), - efl_gfx_size_hint_margin_set(efl_added, 5, 5, 5, 5), + efl_gfx_hint_margin_set(efl_added, 5, 5, 5, 5), efl_pack_align_set(efl_added, 0, 0.5)); efl_pack(box, box2); @@ -399,11 +400,11 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve if (!images[k].path) break; snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), images[k].path); o = efl_add(EFL_UI_IMAGE_CLASS, win, - efl_gfx_size_hint_weight_set(efl_added, 0.0, 0.0), - efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5), - efl_gfx_size_hint_max_set(efl_added, size), - efl_gfx_size_hint_min_set(efl_added, size), - efl_file_set(efl_added, buf, NULL), + efl_gfx_hint_weight_set(efl_added, 0.0, 0.0), + efl_gfx_hint_align_set(efl_added, 0.5, 0.5), + efl_gfx_hint_size_max_set(efl_added, size), + efl_gfx_hint_size_min_set(efl_added, size), + efl_file_set(efl_added, buf), efl_name_set(efl_added, images[k].src_name), elm_object_tooltip_text_set(efl_added, images[k].src_name)); if (efl_player_playable_get(o)) @@ -429,10 +430,10 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve }; o = elm_colorselector_add(win); - efl_gfx_size_hint_weight_set(o, 1.0, 0); - efl_gfx_size_hint_align_set(o, -1.0, 0); + efl_gfx_hint_weight_set(o, 1.0, 0); + efl_gfx_hint_align_set(o, -1.0, 0); elm_colorselector_mode_set(o, ELM_COLORSELECTOR_PALETTE); - efl_gfx_size_hint_max_set(o, maxsz); + efl_gfx_hint_size_max_set(o, maxsz); efl_name_set(o, "myColor"); elm_object_tooltip_text_set(o, "Pick a color to use as variable 'myColor'"); evas_object_smart_callback_add(o, "changed", _colsel_cb, win); @@ -453,14 +454,14 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve box2 = efl_add(EFL_UI_BOX_STACK_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), - efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), - efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), + efl_gfx_hint_weight_set(efl_added, 1.0, 0.0), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), efl_pack_align_set(efl_added, 0.5, 0.5)); efl_pack(flip, box2); // 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_ENTITY_EVENT_RESIZE, _text_resize, NULL); + efl_event_callback_add(o, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _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"); @@ -469,8 +470,8 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve o = box2 = efl_add(EFL_UI_BOX_STACK_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), - efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), - efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), + efl_gfx_hint_weight_set(efl_added, 1.0, 0.0), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), efl_pack_align_set(efl_added, 0.5, 0.5)); efl_pack(flip, box2); @@ -492,7 +493,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_ENTITY_EVENT_RESIZE, _textblock_resize, NULL); + efl_event_callback_add(o, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _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++) diff --git a/src/bin/elementary/test_glview.c b/src/bin/elementary/test_glview.c index 8df1fddc8d..2ddb819561 100644 --- a/src/bin/elementary/test_glview.c +++ b/src/bin/elementary/test_glview.c @@ -1,8 +1,8 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif -#include +#include #include #ifndef M_PI #define M_PI 3.14159265 @@ -249,7 +249,7 @@ draw_gear(GLData *gld, Gear *gear, GLfloat *m, gl->glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), NULL); gl->glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, - 6 * sizeof(GLfloat), (GLfloat *)(0 + 3 * sizeof(GLfloat *))); + 6 * sizeof(GLfloat), (GLfloat *)(0 + 3 * sizeof(GLfloat))); gl->glEnableVertexAttribArray(0); gl->glEnableVertexAttribArray(1); gl->glDrawArrays(GL_TRIANGLE_STRIP, 0, gear->count); @@ -428,6 +428,7 @@ _init_gl(Evas_Object *obj) { GLData *gld = evas_object_data_get(obj, "gld"); + gld->glapi = elm_glview_gl_api_get(obj); printf("GL_VERSION: %s\n", gld->glapi->glGetString(GL_VERSION)); fflush(stdout); @@ -630,7 +631,7 @@ _test_glview_do(Evas_GL_Context_Version version) if (!(gld = calloc(1, sizeof(GLData)))) return; gldata_init(gld); -#if 0 +#if 1 // add a Z-depth buffer to the window and try to use GL Eina_Stringshare *accel; accel = eina_stringshare_add(elm_config_accel_preference_get()); @@ -684,7 +685,6 @@ _test_glview_do(Evas_GL_Context_Version version) // Animator and other vars ani = ecore_animator_add(_anim, gl); - gld->glapi = elm_glview_gl_api_get(gl); evas_object_data_set(gl, "ani", ani); evas_object_data_set(gl, "gld", gld); evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _del, gl); @@ -729,6 +729,7 @@ _test_glview_do(Evas_GL_Context_Version version) evas_object_smart_callback_add(bt, "clicked", _on_done, win); evas_object_resize(win, 320, 480); + evas_object_show(win); } void diff --git a/src/bin/elementary/test_glview_manygears.c b/src/bin/elementary/test_glview_manygears.c index 6161341325..31084b78ec 100644 --- a/src/bin/elementary/test_glview_manygears.c +++ b/src/bin/elementary/test_glview_manygears.c @@ -461,7 +461,7 @@ draw_gear(GLData *gld, Gear *gear, GLfloat *transform, // Set up the position of the attributes in the vertex buffer object gl->glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), NULL); - gl->glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), (GLfloat *)(0 + 3 * sizeof(GLfloat *))); + gl->glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), (GLfloat *)(0 + 3 * sizeof(GLfloat))); // Enable the attributes gl->glEnableVertexAttribArray(0); @@ -673,6 +673,7 @@ _init_gl(Evas_Object *obj) { GLData *gld = evas_object_data_get(obj, "gld"); if (!gld) return; + gld->glapi = elm_glview_gl_api_get(obj); gears_init(gld); } @@ -841,10 +842,18 @@ test_glview_manygears(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void if (!(gld = calloc(1, sizeof(GLData)))) return; gldata_init(gld); + // add a Z-depth buffer to the window and try to use GL + Eina_Stringshare *accel; + accel = eina_stringshare_add(elm_config_accel_preference_get()); + elm_config_accel_preference_set("gl:depth"); + // new window - do the usual and give it a name, title and delete handler win = elm_win_util_standard_add("glview_manygears", "GLView Many Gears"); elm_win_autodel_set(win, EINA_TRUE); + // restore previous accel preference + elm_config_accel_preference_set(accel); + eina_stringshare_del(accel); // add an image bg bg = elm_bg_add(win); @@ -892,7 +901,6 @@ test_glview_manygears(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void // Add animator for rendering ani = ecore_animator_add(_anim, gl); - gld->glapi = elm_glview_gl_api_get(gl); evas_object_data_set(gl, "ani", ani); evas_object_data_set(gl, "gld", gld); evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _del, gl); diff --git a/src/bin/elementary/test_glview_simple.c b/src/bin/elementary/test_glview_simple.c index ae6eece316..9e34afe17f 100644 --- a/src/bin/elementary/test_glview_simple.c +++ b/src/bin/elementary/test_glview_simple.c @@ -121,6 +121,7 @@ static void _init_gl(Evas_Object *obj) { GL_Data *gld = evas_object_data_get(obj, "gld"); + gld->glapi = elm_glview_gl_api_get(obj); Evas_GL_API *gl = gld->glapi; GLfloat vVertices[] = { 0.0f, 0.5f, 0.0f, -0.5f, -0.5f, 0.0f, @@ -232,10 +233,19 @@ test_glview_simple(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e if (!(gld = calloc(1, sizeof(GL_Data)))) return; + // add a Z-depth buffer to the window and try to use GL + Eina_Stringshare *accel; + accel = eina_stringshare_add(elm_config_accel_preference_get()); + elm_config_accel_preference_set("gl:depth"); + win = elm_win_util_standard_add("glview-simple", "GLView Simple"); elm_win_autodel_set(win, EINA_TRUE); evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _win_free_cb, gld); + // restore previous accel preference + elm_config_accel_preference_set(accel); + eina_stringshare_del(accel); + 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); @@ -259,7 +269,6 @@ test_glview_simple(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e elm_object_focus_set(gl, EINA_TRUE); ani = ecore_animator_add(_anim, gl); - gld->glapi = elm_glview_gl_api_get(gl); evas_object_data_set(gl, "gld", gld); evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _gl_del_cb, ani); } diff --git a/src/bin/elementary/test_image.c b/src/bin/elementary/test_image.c index c6d5f7a888..986767b1bb 100644 --- a/src/bin/elementary/test_image.c +++ b/src/bin/elementary/test_image.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include static const struct { diff --git a/src/bin/elementary/test_nstate.c b/src/bin/elementary/test_nstate.c index 4da3b21ac9..717828eb40 100644 --- a/src/bin/elementary/test_nstate.c +++ b/src/bin/elementary/test_nstate.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include static void diff --git a/src/bin/elementary/test_panes.c b/src/bin/elementary/test_panes.c index 21eb3dcf5b..8560daa504 100644 --- a/src/bin/elementary/test_panes.c +++ b/src/bin/elementary/test_panes.c @@ -38,8 +38,8 @@ _clicked_double(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) elm_panes_content_left_size_set(obj, *size); } -void -test_panes(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +static void +_test_panes(const char *style) { Evas_Object *win, *bg, *panes, *panes_h, *bt; static double vbar_size = 0.0; @@ -56,6 +56,7 @@ test_panes(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_inf evas_object_show(bg); panes = elm_panes_add(win); + elm_object_style_set(panes, style); evas_object_size_hint_weight_set(panes, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_panes_content_left_min_size_set(panes, 100); elm_panes_content_left_size_set(panes, 0.7); @@ -76,6 +77,7 @@ test_panes(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_inf // add panes panes_h = elm_panes_add(win); + elm_object_style_set(panes_h, style); elm_panes_horizontal_set(panes_h, EINA_TRUE); elm_panes_content_right_min_size_set(panes_h, 100); elm_panes_content_right_size_set(panes_h, 0.3); @@ -102,4 +104,43 @@ test_panes(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_inf evas_object_resize(win, 320, 400); evas_object_show(win); -} \ No newline at end of file +} + +void +test_panes(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + _test_panes("default"); +} + +void +test_panes_flush(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + _test_panes("flush"); +} + +void +test_panes_left_fold(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + _test_panes("left-fold"); +} + +void +test_panes_right_fold(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + _test_panes("right-fold"); +} + +void +test_panes_up_fold(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + _test_panes("up-fold"); +} + +void +test_panes_down_fold(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + _test_panes("down-fold"); +} + + + diff --git a/src/bin/elementary/test_part_bg.c b/src/bin/elementary/test_part_bg.c index 60a83a8c8a..2724870f24 100644 --- a/src/bin/elementary/test_part_bg.c +++ b/src/bin/elementary/test_part_bg.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include #define MAX_NUM_OF_CONTENT 18 @@ -18,7 +19,7 @@ _reset_cb(void *data, const Efl_Event *ev EINA_UNUSED) target = evas_object_data_get(radio, "data"); efl_gfx_color_set(efl_part(target, "background"), 0, 0, 0, 0); - efl_file_set(efl_part(target, "background"), NULL, NULL); + efl_file_simple_load(efl_part(target, "background"), NULL, NULL); } static void @@ -46,7 +47,7 @@ _scale_type_cb(void *data, const Efl_Event *ev EINA_UNUSED) target = evas_object_data_get(radio, "data"); snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get()); - efl_file_set(efl_part(target, "background"), buf, NULL); + efl_file_simple_load(efl_part(target, "background"), buf, NULL); type = efl_gfx_image_scale_type_get(efl_part(target, "background")); type = (type + 1) % 5; efl_gfx_image_scale_type_set(efl_part(target, "background"), type); @@ -63,12 +64,12 @@ _create_box_contents(Evas_Object *box) hbox = efl_add(EFL_UI_BOX_CLASS, box, efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), - efl_gfx_size_hint_weight_set(efl_added, 1, 1), + efl_gfx_hint_weight_set(efl_added, 1, 1), efl_pack_end(box, efl_added)); radio_group = radio = efl_add(EFL_UI_RADIO_CLASS, hbox, efl_pack_end(hbox, efl_added), - efl_gfx_size_hint_weight_set(efl_added, 0, 0), + efl_gfx_hint_weight_set(efl_added, 0, 0), efl_ui_radio_state_value_set(efl_added, 0)); content = efl_add(EFL_UI_BOX_CLASS, hbox, @@ -92,7 +93,7 @@ _create_box_contents(Evas_Object *box) efl_ui_radio_group_add(efl_added, radio_group), efl_pack_end(hbox, efl_added), efl_ui_radio_state_value_set(efl_added, i + 1), - efl_gfx_size_hint_weight_set(efl_added, 0, 0)); + efl_gfx_hint_weight_set(efl_added, 0, 0)); content = efl_add(content_class[i], hbox, efl_pack_end(hbox, efl_added)); @@ -103,7 +104,7 @@ _create_box_contents(Evas_Object *box) if (efl_isa(content, EFL_UI_IMAGE_CLASS)) { snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get()); - efl_file_set(content, buf, NULL); + efl_file_simple_load(content, buf, NULL); } evas_object_data_set(radio, "data", content); @@ -147,12 +148,12 @@ test_part_background(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void efl_ui_win_autodel_set(efl_added, EINA_TRUE)); vbox = efl_add(EFL_UI_BOX_CLASS, win, - efl_gfx_size_hint_weight_set(efl_added, 1, 1), + efl_gfx_hint_weight_set(efl_added, 1, 1), efl_content_set(win, efl_added)); hbox = efl_add(EFL_UI_BOX_CLASS, vbox, efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), - efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), + efl_gfx_hint_weight_set(efl_added, 1.0, 0.0), efl_pack_end(vbox, efl_added)); reset_btn = efl_add(EFL_UI_BUTTON_CLASS, hbox, @@ -172,7 +173,7 @@ test_part_background(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void efl_pack_end(vbox, scr); vbox = efl_add(EFL_UI_BOX_CLASS, scr, - efl_gfx_size_hint_weight_set(efl_added, 1, 1), + efl_gfx_hint_weight_set(efl_added, 1, 1), efl_content_set(scr, efl_added)); radio_group = _create_box_contents(vbox); diff --git a/src/bin/elementary/test_part_shadow.c b/src/bin/elementary/test_part_shadow.c index 2df5f6766b..a0e1165a7a 100644 --- a/src/bin/elementary/test_part_shadow.c +++ b/src/bin/elementary/test_part_shadow.c @@ -3,6 +3,7 @@ #endif #define EFL_UI_WIDGET_PROTECTED +#include #include typedef struct Test_Data @@ -45,7 +46,7 @@ pulse_start(void *data, const Efl_Event *ev EINA_UNUSED) efl_ui_widget_disabled_set(td->btn_start, EINA_TRUE); efl_ui_widget_disabled_set(td->btn_stop, EINA_FALSE); - efl_event_callback_add(td->ico, EFL_EVENT_ANIMATOR_TICK, animate, td); + efl_event_callback_add(td->ico, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, animate, td); } static void @@ -62,7 +63,7 @@ pulse_stop(void *data, const Efl_Event *ev EINA_UNUSED) efl_ui_widget_disabled_set(td->btn_start, EINA_FALSE); efl_ui_widget_disabled_set(td->btn_stop, EINA_TRUE); - efl_event_callback_del(td->ico, EFL_EVENT_ANIMATOR_TICK, animate, td); + efl_event_callback_del(td->ico, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, animate, td); } static void @@ -94,7 +95,7 @@ test_part_shadow(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve efl_content_set(win, bx); pb = efl_add(EFL_UI_PROGRESSBAR_CLASS, win); - efl_gfx_size_hint_weight_set(pb, EFL_GFX_SIZE_HINT_EXPAND, 0); + efl_gfx_hint_weight_set(pb, EFL_GFX_HINT_EXPAND, 0); efl_ui_progressbar_pulse_mode_set(pb, EINA_TRUE); efl_pack(bx, pb); td->pb1 = pb; @@ -109,7 +110,7 @@ test_part_shadow(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve ic = efl_add(EFL_UI_IMAGE_CLASS, win); snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get()); - efl_file_set(ic, buf, NULL); + efl_file_simple_load(ic, buf, NULL); efl_pack(bx, ic); td->ico = ic; @@ -122,7 +123,7 @@ test_part_shadow(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve pb = efl_add(EFL_UI_PROGRESSBAR_CLASS, win); efl_ui_progressbar_pulse_mode_set(pb, EINA_TRUE); - efl_gfx_size_hint_weight_set(pb, EFL_GFX_SIZE_HINT_EXPAND, 0); + efl_gfx_hint_weight_set(pb, EFL_GFX_HINT_EXPAND, 0); efl_pack(bx, pb); td->pb4 = pb; @@ -143,7 +144,7 @@ test_part_shadow(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve hbx = efl_add(EFL_UI_BOX_CLASS, win); efl_ui_direction_set(hbx, EFL_UI_DIR_HORIZONTAL); - efl_gfx_size_hint_weight_set(hbx, EFL_GFX_SIZE_HINT_EXPAND, 0); + efl_gfx_hint_weight_set(hbx, EFL_GFX_HINT_EXPAND, 0); efl_pack(bx, hbx); // FIXME: Needs wheel progressbar class @@ -176,7 +177,7 @@ test_part_shadow(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve bt_bx = efl_add(EFL_UI_BOX_CLASS, win); efl_ui_direction_set(bt_bx, EFL_UI_DIR_HORIZONTAL); - efl_gfx_size_hint_weight_set(bt_bx, EFL_GFX_SIZE_HINT_EXPAND, 0); + efl_gfx_hint_weight_set(bt_bx, EFL_GFX_HINT_EXPAND, 0); efl_pack(bx, bt_bx); bt = efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Start")); diff --git a/src/bin/elementary/test_photocam.c b/src/bin/elementary/test_photocam.c index f6c2e9711b..cbfb79a43e 100644 --- a/src/bin/elementary/test_photocam.c +++ b/src/bin/elementary/test_photocam.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include static const struct { @@ -142,7 +143,7 @@ my_bt_open(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) if (eina_list_count(grps) > 0) { const char *grp = eina_list_nth(grps, 0); - efl_file_set(ph, file, grp); + efl_file_simple_load(ph, file, grp); printf("Successfully set the edje file: %s, group: %s\n", file, grp); } else printf("Failed to set edje file\n"); @@ -805,7 +806,7 @@ test_image_zoomable_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE 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_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl.Ui.Image_Zoomable animation"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); @@ -816,14 +817,15 @@ 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_text_interactive_editable_set(efl_added, EINA_FALSE), - efl_gfx_size_hint_weight_set(efl_added, 1, 0), + efl_gfx_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) ); snprintf(buf, sizeof(buf), "%s/images/animated_logo.gif", elm_app_data_dir_get()); zoomable = efl_add(EFL_UI_IMAGE_ZOOMABLE_CLASS, win, - efl_file_set(efl_added, buf, NULL), + efl_file_set(efl_added, buf), + efl_file_load(efl_added), efl_pack(bx, efl_added), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _zoomable_clicked_cb, NULL) ); @@ -836,14 +838,14 @@ test_image_zoomable_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win, efl_gfx_color_set(efl_added, 0, 0, 0, 0), - efl_gfx_stack_raise(efl_added), + efl_gfx_stack_raise_to_top(efl_added), efl_canvas_object_repeat_events_set(efl_added, EINA_TRUE), efl_event_callback_add(efl_added, EFL_EVENT_POINTER_WHEEL, _zoomable_mouse_wheel_cb, zoomable) ); // add move/resize callbacks to resize rect manually - 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_event_callback_add(zoomable, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _zoomable_move_resize_cb, rect); + efl_event_callback_add(zoomable, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _zoomable_move_resize_cb, rect); efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 320)); } diff --git a/src/bin/elementary/test_systray.c b/src/bin/elementary/test_systray.c index f4ade32c01..1b159aa337 100644 --- a/src/bin/elementary/test_systray.c +++ b/src/bin/elementary/test_systray.c @@ -6,7 +6,7 @@ // FIXME: systray has no proper legacy API and clearly isn't ready for prime // time with EO either. -#include "elm_systray.eo.h" +#include "elm_systray_eo.h" #define WIDTH 320 #define HEIGHT 160 diff --git a/src/bin/elementary/test_ui_box.c b/src/bin/elementary/test_ui_box.c index 58194a4099..0021be5603 100644 --- a/src/bin/elementary/test_ui_box.c +++ b/src/bin/elementary/test_ui_box.c @@ -4,6 +4,7 @@ #endif #define EFL_PACK_LAYOUT_PROTECTED +#include #include #include @@ -26,36 +27,36 @@ weights_cb(void *data, const Efl_Event *event) switch (mode) { case NONE: - efl_gfx_size_hint_align_set(data, 0.5, 0.5); + efl_gfx_hint_align_set(data, 0.5, 0.5); for (int i = 0; i < CNT; i++) - efl_gfx_size_hint_weight_set(objects[i], 0, 0); + efl_gfx_hint_weight_set(objects[i], 0, 0); break; case NONE_BUT_FILL: - efl_gfx_size_hint_align_set(data, -1, -1); + efl_gfx_hint_align_set(data, -1, -1); for (int i = 0; i < CNT; i++) - efl_gfx_size_hint_weight_set(objects[i], 0, 0); + efl_gfx_hint_weight_set(objects[i], 0, 0); break; case EQUAL: - efl_gfx_size_hint_align_set(data, 0.5, 0.5); + efl_gfx_hint_align_set(data, 0.5, 0.5); for (int i = 0; i < CNT; i++) - efl_gfx_size_hint_weight_set(objects[i], 1, 1); + efl_gfx_hint_weight_set(objects[i], 1, 1); break; case ONE: - efl_gfx_size_hint_align_set(data, 0.5, 0.5); + efl_gfx_hint_align_set(data, 0.5, 0.5); for (int i = 0; i < 6; i++) - efl_gfx_size_hint_weight_set(objects[i], 0, 0); - efl_gfx_size_hint_weight_set(objects[6], 1, 1); + efl_gfx_hint_weight_set(objects[i], 0, 0); + efl_gfx_hint_weight_set(objects[6], 1, 1); for (int i = 7; i < CNT; i++) - efl_gfx_size_hint_weight_set(objects[i], 0, 0); + efl_gfx_hint_weight_set(objects[i], 0, 0); break; case TWO: - efl_gfx_size_hint_align_set(data, 0.5, 0.5); + efl_gfx_hint_align_set(data, 0.5, 0.5); for (int i = 0; i < 5; i++) - efl_gfx_size_hint_weight_set(objects[i], 0, 0); - efl_gfx_size_hint_weight_set(objects[5], 1, 1); - efl_gfx_size_hint_weight_set(objects[6], 1, 1); + efl_gfx_hint_weight_set(objects[i], 0, 0); + efl_gfx_hint_weight_set(objects[5], 1, 1); + efl_gfx_hint_weight_set(objects[6], 1, 1); for (int i = 7; i < CNT; i++) - efl_gfx_size_hint_weight_set(objects[i], 0, 0); + efl_gfx_hint_weight_set(objects[i], 0, 0); break; } } @@ -65,7 +66,7 @@ user_min_slider_cb(void *data EINA_UNUSED, const Efl_Event *event) { int val = elm_slider_value_get(event->object); - efl_gfx_size_hint_min_set(objects[3], EINA_SIZE2D(val, val)); + efl_gfx_hint_size_min_set(objects[3], EINA_SIZE2D(val, val)); } static void @@ -85,7 +86,7 @@ margin_slider_cb(void *data, const Efl_Event *event) Eo *win = data, *box; box = efl_key_wref_get(win, "box"); - efl_gfx_size_hint_margin_set(box, val, val, val, val); + efl_gfx_hint_margin_set(box, val, val, val, val); } static void @@ -120,8 +121,8 @@ alignh_btn_slider_cb(void *data, const Efl_Event *event) btn = efl_key_wref_get(win, "button"); val = elm_slider_value_get(event->object); - efl_gfx_size_hint_align_get(btn, NULL, &av); - efl_gfx_size_hint_align_set(btn, val, av); + efl_gfx_hint_align_get(btn, NULL, &av); + efl_gfx_hint_align_set(btn, val, av); } static void @@ -132,8 +133,8 @@ alignv_btn_slider_cb(void *data, const Efl_Event *event) btn = efl_key_wref_get(win, "button"); val = elm_slider_value_get(event->object); - efl_gfx_size_hint_align_get(btn, &ah, NULL); - efl_gfx_size_hint_align_set(btn, ah, val); + efl_gfx_hint_align_get(btn, &ah, NULL); + efl_gfx_hint_align_set(btn, ah, val); } static void @@ -178,15 +179,7 @@ homo_check_cb(void *data, const Efl_Event *event) { Eina_Bool chk = elm_check_selected_get(event->object); Eo *box = efl_key_wref_get(data, "box"); - efl_ui_box_flow_homogenous_set(box, chk); -} - -static void -max_size_check_cb(void *data, const Efl_Event *event) -{ - Eina_Bool chk = elm_check_selected_get(event->object); - Eo *box = efl_key_wref_get(data, "box"); - efl_ui_box_flow_max_size_set(box, chk); + efl_ui_box_homogeneous_set(box, chk); } static void @@ -209,7 +202,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); + r.size = efl_gfx_hint_size_combined_min_get(sobj); efl_gfx_entity_geometry_set(sobj, r); i++; } @@ -248,15 +241,15 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in 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); + efl_gfx_hint_margin_set(vbox, 5, 5, 5, 5); elm_win_resize_object_add(win, vbox); /* controls */ f = elm_frame_add(win); elm_object_text_set(f, "Controls"); - efl_gfx_size_hint_align_set(f, -1, -1); - efl_gfx_size_hint_weight_set(f, 1, 0); + efl_gfx_hint_align_set(f, -1, -1); + efl_gfx_hint_weight_set(f, 1, 0); efl_pack(vbox, f); efl_gfx_entity_visible_set(f, 1); @@ -269,14 +262,14 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in /* weights radio group */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, 0.5); - efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); + efl_gfx_hint_align_set(bx, 0, 0.5); + efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); efl_pack(hbox, bx); chk = o = elm_radio_add(win); elm_object_text_set(o, "No weight"); efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, win); - efl_gfx_size_hint_align_set(o, 0, 0.5); + efl_gfx_hint_align_set(o, 0, 0.5); elm_radio_state_value_set(o, NONE); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); @@ -284,7 +277,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in o = elm_radio_add(win); elm_object_text_set(o, "No weight + box fill"); efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, win); - efl_gfx_size_hint_align_set(o, 0, 0.5); + efl_gfx_hint_align_set(o, 0, 0.5); elm_radio_state_value_set(o, NONE_BUT_FILL); elm_radio_group_add(o, chk); efl_pack(bx, o); @@ -293,7 +286,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in o = elm_radio_add(win); elm_object_text_set(o, "Equal weights"); efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, win); - efl_gfx_size_hint_align_set(o, 0, 0.5); + efl_gfx_hint_align_set(o, 0, 0.5); elm_radio_state_value_set(o, EQUAL); elm_radio_group_add(o, chk); efl_pack(bx, o); @@ -302,7 +295,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in o = elm_radio_add(win); elm_object_text_set(o, "One weight only"); efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, win); - efl_gfx_size_hint_align_set(o, 0, 0.5); + efl_gfx_hint_align_set(o, 0, 0.5); elm_radio_state_value_set(o, ONE); elm_radio_group_add(o, chk); efl_pack(bx, o); @@ -311,7 +304,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in o = elm_radio_add(win); elm_object_text_set(o, "Two weights"); efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, win); - efl_gfx_size_hint_align_set(o, 0, 0.5); + efl_gfx_hint_align_set(o, 0, 0.5); elm_radio_state_value_set(o, TWO); elm_radio_group_add(o, chk); efl_pack(bx, o); @@ -323,9 +316,9 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in /* misc */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, 0.5); - efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); - efl_gfx_size_hint_weight_set(bx, 0, 1); + efl_gfx_hint_align_set(bx, 0, 0.5); + efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); + efl_gfx_hint_weight_set(bx, 0, 1); efl_pack(hbox, bx); o = elm_label_add(win); @@ -337,7 +330,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in elm_check_selected_set(o, 0); elm_object_text_set(o, "Flow"); efl_event_callback_add(o, EFL_UI_CHECK_EVENT_CHANGED, flow_check_cb, win); - efl_gfx_size_hint_align_set(o, 0, 0); + efl_gfx_hint_align_set(o, 0, 0); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); @@ -345,7 +338,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in elm_check_selected_set(o, 1); elm_object_text_set(o, "Horizontal"); efl_event_callback_add(o, EFL_UI_CHECK_EVENT_CHANGED, horiz_check_cb, win); - efl_gfx_size_hint_align_set(o, 0, 0); + efl_gfx_hint_align_set(o, 0, 0); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); @@ -353,15 +346,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in elm_check_selected_set(o, 0); elm_object_text_set(o, "Homogenous"); 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_entity_visible_set(o, 1); - - o = elm_check_add(win); - elm_check_selected_set(o, 0); - elm_object_text_set(o, "Homogenous + Max"); - 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_gfx_hint_align_set(o, 0, 0); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); @@ -369,8 +354,8 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in elm_check_selected_set(o, 0); elm_object_text_set(o, "Custom layout"); efl_event_callback_add(o, EFL_UI_CHECK_EVENT_CHANGED, custom_check_cb, win); - efl_gfx_size_hint_align_set(o, 0, 0); - efl_gfx_size_hint_weight_set(o, 0, 1); + efl_gfx_hint_align_set(o, 0, 0); + efl_gfx_hint_weight_set(o, 0, 1); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); @@ -378,9 +363,9 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in /* user min size setter */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, 0.5); - efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); - efl_gfx_size_hint_weight_set(bx, 0, 1); + efl_gfx_hint_align_set(bx, 0, 0.5); + efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); + efl_gfx_hint_weight_set(bx, 0, 1); efl_pack(hbox, bx); o = elm_label_add(win); @@ -392,8 +377,8 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in elm_slider_indicator_format_set(o, "%.0fpx"); elm_slider_indicator_show_set(o, 1); elm_slider_horizontal_set(o, 0); - efl_gfx_size_hint_align_set(o, 0.5, -1); - efl_gfx_size_hint_weight_set(o, 1, 1); + efl_gfx_hint_align_set(o, 0.5, -1); + efl_gfx_hint_weight_set(o, 1, 1); efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, user_min_slider_cb, NULL); elm_slider_min_max_set(o, 0, 250); elm_slider_inverted_set(o, 1); @@ -405,9 +390,9 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in /* inner box padding */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, 0.5); - efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); - efl_gfx_size_hint_weight_set(bx, 0, 1); + efl_gfx_hint_align_set(bx, 0, 0.5); + efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); + efl_gfx_hint_weight_set(bx, 0, 1); efl_pack(hbox, bx); o = elm_label_add(win); @@ -419,8 +404,8 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in elm_slider_indicator_format_set(o, "%.0fpx"); elm_slider_indicator_show_set(o, 1); elm_slider_horizontal_set(o, 0); - efl_gfx_size_hint_align_set(o, 0.5, -1); - efl_gfx_size_hint_weight_set(o, 1, 1); + efl_gfx_hint_align_set(o, 0.5, -1); + efl_gfx_hint_weight_set(o, 1, 1); efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, padding_slider_cb, win); elm_slider_min_max_set(o, 0, 40); elm_slider_inverted_set(o, 1); @@ -432,9 +417,9 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in /* outer margin */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, 0.5); - efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); - efl_gfx_size_hint_weight_set(bx, 0, 1); + efl_gfx_hint_align_set(bx, 0, 0.5); + efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); + efl_gfx_hint_weight_set(bx, 0, 1); efl_pack(hbox, bx); o = elm_label_add(win); @@ -446,8 +431,8 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in elm_slider_indicator_format_set(o, "%.0fpx"); elm_slider_indicator_show_set(o, 1); elm_slider_horizontal_set(o, 0); - efl_gfx_size_hint_align_set(o, 0.5, -1); - efl_gfx_size_hint_weight_set(o, 1, 1); + efl_gfx_hint_align_set(o, 0.5, -1); + efl_gfx_hint_weight_set(o, 1, 1); efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, margin_slider_cb, win); elm_slider_min_max_set(o, 0, 40); elm_slider_inverted_set(o, 1); @@ -459,9 +444,9 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in /* Box align */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, 0.5); - efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); - efl_gfx_size_hint_weight_set(bx, 1, 1); + efl_gfx_hint_align_set(bx, 0, 0.5); + efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); + efl_gfx_hint_weight_set(bx, 1, 1); efl_pack(hbox, bx); o = elm_label_add(win); @@ -473,8 +458,8 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in elm_slider_indicator_format_set(o, "%.1f"); elm_slider_indicator_show_set(o, 1); elm_slider_horizontal_set(o, 0); - efl_gfx_size_hint_align_set(o, 0.5, -1); - efl_gfx_size_hint_weight_set(o, 1, 1); + efl_gfx_hint_align_set(o, 0.5, -1); + efl_gfx_hint_weight_set(o, 1, 1); efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignv_slider_cb, win); elm_slider_min_max_set(o, -0.1, 1.0); elm_slider_step_set(o, 0.1); @@ -486,9 +471,9 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in elm_slider_indicator_format_set(o, "%.1f"); elm_slider_indicator_show_set(o, 1); elm_slider_horizontal_set(o, 1); - efl_gfx_size_hint_align_set(o, 0.5, -1); - efl_gfx_size_hint_weight_set(o, 1, 0); - efl_gfx_size_hint_min_set(o, EINA_SIZE2D(100, 0)); + efl_gfx_hint_align_set(o, 0.5, -1); + efl_gfx_hint_weight_set(o, 1, 0); + efl_gfx_hint_size_min_set(o, EINA_SIZE2D(100, 0)); efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignh_slider_cb, win); elm_slider_min_max_set(o, -0.1, 1.0); elm_slider_step_set(o, 0.1); @@ -499,9 +484,9 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in /* Button align */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, 0.5); - efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); - efl_gfx_size_hint_weight_set(bx, 1, 1); + efl_gfx_hint_align_set(bx, 0, 0.5); + efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); + efl_gfx_hint_weight_set(bx, 1, 1); efl_pack(hbox, bx); o = elm_label_add(win); @@ -513,8 +498,8 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in elm_slider_indicator_format_set(o, "%.1f"); elm_slider_indicator_show_set(o, 1); elm_slider_horizontal_set(o, 0); - efl_gfx_size_hint_align_set(o, 0.5, -1); - efl_gfx_size_hint_weight_set(o, 1, 1); + efl_gfx_hint_align_set(o, 0.5, -1); + efl_gfx_hint_weight_set(o, 1, 1); efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignv_btn_slider_cb, win); elm_slider_min_max_set(o, 0.0, 1.0); elm_slider_step_set(o, 0.1); @@ -526,9 +511,9 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in elm_slider_indicator_format_set(o, "%.1f"); elm_slider_indicator_show_set(o, 1); elm_slider_horizontal_set(o, 1); - efl_gfx_size_hint_align_set(o, 0.5, -1); - efl_gfx_size_hint_weight_set(o, 1, 0); - efl_gfx_size_hint_min_set(o, EINA_SIZE2D(100, 0)); + efl_gfx_hint_align_set(o, 0.5, -1); + efl_gfx_hint_weight_set(o, 1, 0); + efl_gfx_hint_size_min_set(o, EINA_SIZE2D(100, 0)); efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignh_btn_slider_cb, win); elm_slider_min_max_set(o, -0.1, 1.0); elm_slider_step_set(o, 0.1); @@ -540,8 +525,8 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in /* contents */ f = elm_frame_add(win); elm_object_text_set(f, "Contents"); - efl_gfx_size_hint_align_set(f, -1, -1); - efl_gfx_size_hint_weight_set(f, 1, 1); + efl_gfx_hint_align_set(f, -1, -1); + efl_gfx_hint_weight_set(f, 1, 1); efl_pack(vbox, f); efl_gfx_entity_visible_set(f, 1); @@ -549,82 +534,82 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL)); efl_key_wref_set(win, "box", bx); efl_pack_padding_set(bx, 10, 10, EINA_TRUE); - efl_gfx_size_hint_align_set(bx, 0.5, 0.5); - efl_gfx_size_hint_weight_set(bx, 1, 1); + efl_gfx_hint_align_set(bx, 0.5, 0.5); + efl_gfx_hint_weight_set(bx, 1, 1); efl_content_set(f, bx); objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx); efl_text_set(o, "Btn1"); - efl_gfx_size_hint_weight_set(o, 0, 0); - efl_gfx_size_hint_align_set(o, 0.5, 0.5); - efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); + efl_gfx_hint_weight_set(o, 0, 0); + efl_gfx_hint_align_set(o, 0.5, 0.5); + efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx); efl_text_set(o, "Button 2"); - efl_gfx_size_hint_weight_set(o, 0, 0); + efl_gfx_hint_weight_set(o, 0, 0); efl_pack(bx, o); 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_gfx_hint_align_set(o, 0.5, 0.5); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx); efl_text_set(o, "Min size"); - efl_gfx_size_hint_weight_set(o, 0, 0); - efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); - 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_gfx_hint_weight_set(o, 0, 0); + efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE); + efl_gfx_hint_align_set(o, 0.5, 1.0); + efl_gfx_hint_aspect_set(o, EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 1)); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx); efl_text_set(o, "Quit!"); - efl_gfx_size_hint_weight_set(o, 0, 0); - efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); - efl_gfx_size_hint_align_set(o, 0.5, 0.0); + efl_gfx_hint_weight_set(o, 0, 0); + efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE); + efl_gfx_hint_align_set(o, 0.5, 0.0); efl_pack(bx, o); 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
is marked as align=fill."); - efl_gfx_size_hint_align_set(o, -1, -1); + efl_gfx_hint_align_set(o, -1, -1); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx); efl_key_wref_set(win, "button", o); efl_text_set(o, "Button with a quite long text."); - efl_gfx_size_hint_weight_set(o, 0, 0); - efl_gfx_size_hint_max_set(o, EINA_SIZE2D(200, 100)); + efl_gfx_hint_weight_set(o, 0, 0); + efl_gfx_hint_size_max_set(o, EINA_SIZE2D(200, 100)); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx); efl_text_set(o, "BtnA"); - efl_gfx_size_hint_weight_set(o, 0, 0); - efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); - efl_gfx_size_hint_aspect_set(o, EFL_GFX_SIZE_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 2)); + efl_gfx_hint_weight_set(o, 0, 0); + efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE); + efl_gfx_hint_aspect_set(o, EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 2)); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx); efl_text_set(o, "BtnB"); - efl_gfx_size_hint_weight_set(o, 0, 0); - efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); + efl_gfx_hint_weight_set(o, 0, 0); + efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx); efl_text_set(o, "BtnC"); - efl_gfx_size_hint_weight_set(o, 0, 0); - efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); + efl_gfx_hint_weight_set(o, 0, 0); + efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); diff --git a/src/bin/elementary/test_ui_box_stack.c b/src/bin/elementary/test_ui_box_stack.c new file mode 100644 index 0000000000..1b5d579d1c --- /dev/null +++ b/src/bin/elementary/test_ui_box_stack.c @@ -0,0 +1,44 @@ +#include "test.h" +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif +#include + +void +test_ui_box_stack(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Evas_Object *win, *bx, *o; + char buf[PATH_MAX]; + + 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)); + + efl_gfx_color_set(efl_part(win, "background"), 24, 24, 64, 255); + + bx = efl_add(EFL_UI_BOX_STACK_CLASS, win); + efl_content_set(win, bx); + + /* stretched rectangle */ + o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win, + efl_gfx_color_set(efl_added, 0, 64, 128, 255)); + efl_pack(bx, o); + + /* rectangle with a max size */ + o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win, + efl_gfx_color_set(efl_added, 64, 128, 64, 255), + efl_gfx_hint_size_max_set(efl_added, EINA_SIZE2D(128, 20)), + efl_gfx_hint_align_set(efl_added, 0.5, 1.0)); + efl_pack(bx, o); + + /* image with a forced min size */ + snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get()); + o = efl_add(EFL_UI_IMAGE_CLASS, win, + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(64, 64)), + efl_file_set(efl_added, buf), + efl_file_load(efl_added)); + efl_pack(bx, o); + + efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 300)); +} diff --git a/src/bin/elementary/test_ui_button.c b/src/bin/elementary/test_ui_button.c index f5aa340ad6..1696a6d9ee 100644 --- a/src/bin/elementary/test_ui_button.c +++ b/src/bin/elementary/test_ui_button.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include static void @@ -28,7 +29,7 @@ test_ui_button(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event 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_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl.Ui.Button"), efl_ui_win_autodel_set(efl_added, EINA_TRUE) ); @@ -55,7 +56,7 @@ test_ui_button(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event 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_file_set(efl_added, buf), efl_content_set(btn, efl_added) ); @@ -69,7 +70,7 @@ test_ui_button(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event 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_file_set(efl_added, buf), efl_content_set(btn, efl_added) ); diff --git a/src/bin/elementary/test_ui_clock.c b/src/bin/elementary/test_ui_clock.c index fc20112c04..936efd1d3b 100644 --- a/src/bin/elementary/test_ui_clock.c +++ b/src/bin/elementary/test_ui_clock.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H #include "elementary_config.h" #endif +#include #include /* A simple test, just displaying clock in its default format */ @@ -48,17 +49,17 @@ test_ui_clock(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ Evas_Object *win, *bx; win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl.Ui.Clock"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); bx = efl_add(EFL_UI_BOX_CLASS, win, efl_content_set(win, efl_added), - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(360, 240))); + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(360, 240))); dt1 = efl_add(EFL_UI_CLOCK_CLASS, bx, - efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), - efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_HOUR, EINA_FALSE), efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_MINUTE, EINA_FALSE), efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_AMPM, EINA_FALSE), @@ -69,8 +70,8 @@ test_ui_clock(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ efl_pack(bx, efl_added)); dt2 = efl_add(EFL_UI_CLOCK_CLASS, bx, - efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), - efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_YEAR, EINA_FALSE), efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_MONTH, EINA_FALSE), efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_DATE, EINA_FALSE), @@ -80,21 +81,21 @@ test_ui_clock(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ elm_object_disabled_set(dt2, EINA_TRUE); dt3 = efl_add(EFL_UI_CLOCK_CLASS, bx, - efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), - efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_pack(bx, efl_added)); efl_add(EFL_UI_TEXT_CLASS, bx, efl_text_set(efl_added, "Editable Clock:"), - efl_gfx_size_hint_weight_set(efl_added, 0.0, 0.0), - efl_gfx_size_hint_align_set(efl_added, 0, 0.5), - efl_gfx_size_hint_fill_set(efl_added, EINA_FALSE, EINA_TRUE), - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(100, 25)), + efl_gfx_hint_weight_set(efl_added, 0.0, 0.0), + efl_gfx_hint_align_set(efl_added, 0, 0.5), + efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_TRUE), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 25)), efl_pack(bx, efl_added)); dt4 = efl_add(EFL_UI_CLOCK_CLASS, bx, - efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), - efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_ui_clock_edit_mode_set(efl_added, EINA_TRUE), efl_ui_clock_pause_set(efl_added, EINA_TRUE), efl_pack(bx, efl_added)); diff --git a/src/bin/elementary/test_ui_datepicker.c b/src/bin/elementary/test_ui_datepicker.c index 1eb04612b1..3fe625101c 100644 --- a/src/bin/elementary/test_ui_datepicker.c +++ b/src/bin/elementary/test_ui_datepicker.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include static void @@ -18,7 +19,7 @@ test_ui_datepicker(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e 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_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl.Ui.Datepicker"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); diff --git a/src/bin/elementary/test_ui_pager.c b/src/bin/elementary/test_ui_pager.c new file mode 100644 index 0000000000..32bc1d775a --- /dev/null +++ b/src/bin/elementary/test_ui_pager.c @@ -0,0 +1,785 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif +#define EO_BETA_API +#define EFL_UI_WIDGET_PROTECTED + +#include +#include + + +#define PAGE_NUM 3 + + +/** |----------panes----------| + * ||--left---| |---right---|| + * || | | layout || + * || | ||---------||| + * ||naviframe| || pager ||| + * || | || ||| + * || | ||---------||| + * ||---------| |-----------|| + * |-------------------------| + * + */ + + +typedef enum _Page_Type { + LAYOUT, + LIST, + BUTTON +} Page_Type; + +typedef enum _Pack_Type { + PACK_BEGIN, + PACK_END, + PACK_BEFORE, + PACK_AFTER, + PACK_AT, + UNPACK_AT, + CLEAR +} Pack_Type; + +typedef struct _Params { + Evas_Object *navi; + Eo *pager; + Eo *indicator; + int w, h; + Eina_Bool wfill, hfill; +} Params; + +typedef struct _Page_Set_Params { + Eo *pager; + Eo *spinner; +} Page_Set_Params; + +typedef struct _Pack_Params { + Pack_Type type; + Eo *pager; + Eo *pack_sp; + Eo *unpack_sp; + Eo *unpack_btn; +} Pack_Params; + +typedef struct _Size_Params { + Eo *pager; + Eo *slider; + Params *params; +} Size_Params; + + + +static Eo *page_add(Page_Type p, Eo *parent) +{ + Eo *page; + char buf[PATH_MAX]; + int i; + + switch (p) { + case LAYOUT: + snprintf(buf, sizeof(buf), "%s/objects/test_pager.edj", + elm_app_data_dir_get()); + page = efl_add(EFL_UI_LAYOUT_CLASS, parent, + efl_file_set(efl_added, buf), + efl_file_key_set(efl_added, "page"), + efl_file_load(efl_added), + efl_text_set(efl_part(efl_added, "text"), "Layout Page")); + efl_gfx_hint_fill_set(page, EINA_TRUE, EINA_TRUE); + break; + case LIST: + page = elm_list_add(parent); + elm_list_select_mode_set(page, ELM_OBJECT_SELECT_MODE_ALWAYS); + evas_object_show(page); + for (i = 0; i < 20; i++) { + snprintf(buf, sizeof(buf), "List Page - Item #%d", i); + elm_list_item_append(page, buf, NULL, NULL, NULL, NULL); + } + evas_object_size_hint_weight_set(page, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(page, EVAS_HINT_FILL, + EVAS_HINT_FILL); + break; + case BUTTON: + page = efl_add(EFL_UI_BUTTON_CLASS, parent, + efl_text_set(efl_added, "Button Page")); + efl_gfx_hint_fill_set(page, EINA_TRUE, EINA_TRUE); + break; + default: + snprintf(buf, sizeof(buf), "%s/objects/test_pager.edj", + elm_app_data_dir_get()); + page = efl_add(EFL_UI_LAYOUT_CLASS, parent, + efl_file_set(efl_added, buf), + efl_file_key_set(efl_added, "page"), + efl_file_load(efl_added), + efl_text_set(efl_part(efl_added, "text"), "Layout Page")); + efl_gfx_hint_fill_set(page, EINA_TRUE, EINA_TRUE); + break; + } + + return page; +} + +static void prev_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + Eo *pager = data; + int curr_page = efl_ui_pager_current_page_get(pager); + + efl_ui_pager_current_page_set(pager, (curr_page - 1)); +} + +static void next_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + Eo *pager = data; + int curr_page = efl_ui_pager_current_page_get(pager); + + efl_ui_pager_current_page_set(pager, (curr_page + 1)); +} + +static void back_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + elm_naviframe_item_pop(data); +} + +static void list_del_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + free(data); +} + +static void width_slider_cb(void *data, const Efl_Event *ev) +{ + Params *params = data; + int h; + + if (params->hfill) h = -1; + else h = params->h; + + params->w = efl_ui_range_value_get(ev->object); + efl_ui_pager_page_size_set(params->pager, EINA_SIZE2D(params->w, h)); +} + +static void height_slider_cb(void *data, const Efl_Event *ev) +{ + Params *params = data; + int w; + + if (params->wfill) w = -1; + else w = params->w; + + params->h = efl_ui_range_value_get(ev->object); + efl_ui_pager_page_size_set(params->pager, EINA_SIZE2D(w, params->h)); +} + +static void width_check_cb(void *data, const Efl_Event *ev) +{ + Size_Params *params = data; + Eina_Bool ck = elm_check_selected_get(ev->object); + int w, h; + + elm_object_disabled_set(params->slider, ck); + + params->params->wfill = ck; + + if (params->params->wfill) w = -1; + else w = params->params->w; + + if (params->params->hfill) h = -1; + else h = params->params->h; + + efl_ui_pager_page_size_set(params->pager, EINA_SIZE2D(w, h)); +} + +static void height_check_cb(void *data, const Efl_Event *ev) +{ + Size_Params *params = data; + Eina_Bool ck = elm_check_selected_get(ev->object); + int w, h; + + elm_object_disabled_set(params->slider, ck); + + params->params->hfill = ck; + + if (params->params->wfill) w = -1; + else w = params->params->w; + + if (params->params->hfill) h = -1; + else h = params->params->h; + + efl_ui_pager_page_size_set(params->pager, EINA_SIZE2D(w, h)); +} + +static void check_del_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + free(data); +} + +static void pack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + Pack_Params *param = data; + Eo *pager = param->pager; + Eo *page = NULL, *curr_page; + int index, cnt; + + if ((param->type != UNPACK_AT) && (param->type != CLEAR)) { + index = efl_content_count(pager); + + switch (index % 3) { + case 0: + page = page_add(LAYOUT, pager); + break; + case 1: + page = page_add(LIST, pager); + break; + case 2: + page = page_add(BUTTON, pager); + break; + default: + page = page_add(LAYOUT, pager); + break; + } + } + + switch (param->type) { + case PACK_BEGIN: + efl_pack_begin(pager, page); + break; + case PACK_END: + efl_pack_end(pager, page); + break; + case PACK_BEFORE: + index = efl_ui_pager_current_page_get(pager); + curr_page = efl_pack_content_get(pager, index); + efl_pack_before(pager, page, curr_page); + break; + case PACK_AFTER: + index = efl_ui_pager_current_page_get(pager); + curr_page = efl_pack_content_get(pager, index); + efl_pack_after(pager, page, curr_page); + break; + case PACK_AT: + index = efl_ui_range_value_get(param->pack_sp); + efl_pack_at(pager, page, index); + break; + case UNPACK_AT: + index = efl_ui_range_value_get(param->unpack_sp); + page = efl_pack_unpack_at(pager, index); + efl_del(page); + break; + case CLEAR: + efl_pack_clear(pager); + break; + } + + cnt = efl_content_count(pager); + + index = efl_ui_range_value_get(param->pack_sp); + if (index > cnt) + efl_ui_range_value_set(param->pack_sp, cnt); + efl_ui_range_min_max_set(param->pack_sp, 0, cnt); + + if (cnt > 0) + { + elm_object_disabled_set(param->unpack_btn, EINA_FALSE); + elm_object_disabled_set(param->unpack_sp, EINA_FALSE); + + cnt -= 1; + index = efl_ui_range_value_get(param->unpack_sp); + if (index > cnt) + efl_ui_range_value_set(param->unpack_sp, cnt); + efl_ui_range_min_max_set(param->unpack_sp, 0, cnt); + } + else + { + elm_object_disabled_set(param->unpack_btn, EINA_TRUE); + elm_object_disabled_set(param->unpack_sp, EINA_TRUE); + } +} + +static void pack_btn_del_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + free(data); +} + +static void page_set_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + Page_Set_Params *psp = data; + + efl_ui_pager_current_page_set(psp->pager, + efl_ui_range_value_get(psp->spinner)); +} + +static void page_set_btn_del_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + free(data); +} + +static void indicator_icon_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + Params *params = data; + + params->indicator = efl_add(EFL_PAGE_INDICATOR_ICON_CLASS, params->pager); + efl_ui_pager_indicator_set(params->pager, params->indicator); +} + +static void indicator_none_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + Params *params = data; + efl_ui_pager_indicator_set(params->pager, NULL); +} + +static void page_size_cb(void *data, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Params *params = data; + Size_Params *size_params; + Evas_Object *navi = params->navi; + Eo *btn, *box, *fr, *inbox, *ck, *sl; + + btn = efl_add(EFL_UI_BUTTON_CLASS, navi, + efl_text_set(efl_added, "Back"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + back_btn_cb, navi)); + + box = efl_add(EFL_UI_BOX_CLASS, navi, + elm_naviframe_item_push(navi, "Page Size", btn, NULL, + efl_added, NULL)); + + // Width + fr = elm_frame_add(box); + elm_object_text_set(fr, "Width"); + efl_gfx_hint_align_set(fr, -1, -1); + efl_gfx_hint_weight_set(fr, 1, 1); + efl_pack(box, fr); + efl_gfx_entity_visible_set(fr, 1); + + inbox = efl_add(EFL_UI_BOX_CLASS, fr, + efl_content_set(fr, efl_added)); + + ck = elm_check_add(inbox); + elm_object_text_set(ck, "Fill"); + efl_pack_end(inbox, ck); + efl_gfx_entity_visible_set(ck, 1); + + sl = efl_add(EFL_UI_SLIDER_CLASS, inbox, + efl_ui_range_min_max_set(efl_added, 100, 200), + efl_ui_range_value_set(efl_added, params->w), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 0)), + efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, + width_slider_cb, params), + efl_pack_end(inbox, efl_added)); + + size_params = calloc(1, sizeof(Size_Params)); + if (!size_params) return; + + size_params->slider = sl; + size_params->pager = params->pager; + size_params->params = params; + + efl_event_callback_add(ck, EFL_UI_CHECK_EVENT_CHANGED, width_check_cb, + size_params); + efl_event_callback_add(ck, EFL_EVENT_DEL, check_del_cb, size_params); + + if (params->wfill) + { + elm_check_state_set(ck, EINA_TRUE); + elm_object_disabled_set(sl, EINA_TRUE); + } + + // Height + fr = elm_frame_add(box); + elm_object_text_set(fr, "Height"); + efl_gfx_hint_align_set(fr, -1, -1); + efl_gfx_hint_weight_set(fr, 1, 1); + efl_pack(box, fr); + efl_gfx_entity_visible_set(fr, 1); + + inbox = efl_add(EFL_UI_BOX_CLASS, fr, + efl_content_set(fr, efl_added)); + + ck = elm_check_add(inbox); + elm_object_text_set(ck, "Fill"); + efl_pack_end(inbox, ck); + efl_gfx_entity_visible_set(ck, 1); + + sl = efl_add(EFL_UI_SLIDER_CLASS, inbox, + efl_ui_range_min_max_set(efl_added, 100, 300), + efl_ui_range_value_set(efl_added, params->h), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 0)), + efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, + height_slider_cb, params), + efl_pack_end(inbox, efl_added)); + + size_params = calloc(1, sizeof(Size_Params)); + if (!size_params) return; + + size_params->slider = sl; + size_params->pager = params->pager; + size_params->params = params; + + efl_event_callback_add(ck, EFL_UI_CHECK_EVENT_CHANGED, height_check_cb, + size_params); + efl_event_callback_add(ck, EFL_EVENT_DEL, check_del_cb, size_params); + + if (params->hfill) + { + elm_check_state_set(ck, EINA_TRUE); + elm_object_disabled_set(sl, EINA_TRUE); + } +} + +static void pack_cb(void *data, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Params *params = (Params *)data; + Evas_Object *navi = params->navi; + Eo *pager = params->pager; + Eo *btn, *box, *in_box1, *in_box2, *sp1, *sp2; + Pack_Params *pack_param; + + btn = efl_add(EFL_UI_BUTTON_CLASS, navi, + efl_text_set(efl_added, "Back"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + back_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)); + + in_box1 = 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)); + + sp1 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box1, + efl_ui_range_min_max_set(efl_added, 0, + efl_content_count(pager)), + efl_ui_range_value_set(efl_added, + efl_ui_pager_current_page_get(pager))); + + in_box2 = 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)); + + sp2 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box2); + + btn = efl_add(EFL_UI_BUTTON_CLASS, in_box2, + efl_text_set(efl_added, "Unpack At")); + + // Pack Begin + pack_param = calloc(1, sizeof(Pack_Params)); + if (!pack_param) return; + + pack_param->pager = pager; + pack_param->pack_sp = sp1; + pack_param->unpack_sp = sp2; + pack_param->unpack_btn = btn; + pack_param->type = PACK_BEGIN; + + 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_btn_cb, pack_param), + efl_event_callback_add(efl_added, EFL_EVENT_DEL, + pack_btn_del_cb, pack_param), + efl_pack_end(box, efl_added)); + + // Pack End + pack_param = calloc(1, sizeof(Pack_Params)); + if (!pack_param) return; + + pack_param->pager = pager; + pack_param->pack_sp = sp1; + pack_param->unpack_sp = sp2; + pack_param->unpack_btn = btn; + pack_param->type = PACK_END; + + 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_btn_cb, pack_param), + efl_event_callback_add(efl_added, EFL_EVENT_DEL, + pack_btn_del_cb, pack_param), + efl_pack_end(box, efl_added)); + + // Pack Before + pack_param = calloc(1, sizeof(Pack_Params)); + if (!pack_param) return; + + pack_param->pager = pager; + pack_param->pack_sp = sp1; + pack_param->unpack_sp = sp2; + pack_param->unpack_btn = btn; + pack_param->type = PACK_BEFORE; + + efl_add(EFL_UI_BUTTON_CLASS, box, + efl_text_set(efl_added, "Pack Before Current Page"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + pack_btn_cb, pack_param), + efl_event_callback_add(efl_added, EFL_EVENT_DEL, + pack_btn_del_cb, pack_param), + efl_pack_end(box, efl_added)); + + // Pack After + pack_param = calloc(1, sizeof(Pack_Params)); + if (!pack_param) return; + + pack_param->pager = pager; + pack_param->pack_sp = sp1; + pack_param->unpack_sp = sp2; + pack_param->unpack_btn = btn; + pack_param->type = PACK_AFTER; + + efl_add(EFL_UI_BUTTON_CLASS, box, + efl_text_set(efl_added, "Pack After Current Page"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + pack_btn_cb, pack_param), + efl_event_callback_add(efl_added, EFL_EVENT_DEL, + pack_btn_del_cb, pack_param), + efl_pack_end(box, efl_added)); + + // Pack At + pack_param = calloc(1, sizeof(Pack_Params)); + if (!pack_param) return; + + pack_param->pager = pager; + pack_param->pack_sp = sp1; + pack_param->unpack_sp = sp2; + pack_param->unpack_btn = btn; + pack_param->type = PACK_AT; + + efl_add(EFL_UI_BUTTON_CLASS, in_box1, + efl_text_set(efl_added, "Pack At"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + pack_btn_cb, pack_param), + efl_event_callback_add(efl_added, EFL_EVENT_DEL, + pack_btn_del_cb, pack_param), + efl_pack_end(in_box1, efl_added)); + + efl_pack_end(box, in_box1); + efl_pack_end(in_box1, sp1); + + // Unpack At + pack_param = calloc(1, sizeof(Pack_Params)); + if (!pack_param) return; + + pack_param->pager = pager; + pack_param->pack_sp = sp1; + pack_param->unpack_sp = sp2; + pack_param->unpack_btn = btn; + pack_param->type = UNPACK_AT; + + efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, + pack_btn_cb, pack_param); + efl_event_callback_add(btn, EFL_EVENT_DEL, + pack_btn_del_cb, pack_param); + + if (efl_content_count(pager) > 0) + { + efl_ui_range_min_max_set(sp2, 0, + (efl_content_count(pager) - 1)); + efl_ui_range_value_set(sp2, + efl_ui_pager_current_page_get(pager)); + } + else + { + elm_object_disabled_set(btn, EINA_TRUE); + elm_object_disabled_set(sp2, EINA_TRUE); + } + + efl_pack_end(box, in_box2); + efl_pack_end(in_box2, btn); + efl_pack_end(in_box2, sp2); + + // Clear + pack_param = calloc(1, sizeof(Pack_Params)); + if (!pack_param) return; + + pack_param->pager = pager; + pack_param->pack_sp = sp1; + pack_param->unpack_sp = sp2; + pack_param->unpack_btn = btn; + pack_param->type = CLEAR; + + efl_add(EFL_UI_BUTTON_CLASS, box, + efl_text_set(efl_added, "Clear"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + pack_btn_cb, pack_param), + efl_event_callback_add(efl_added, EFL_EVENT_DEL, + pack_btn_del_cb, pack_param), + efl_pack_end(box, efl_added)); + +} + +static void current_page_cb(void *data, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Params *params = (Params *)data; + Evas_Object *navi = params->navi; + Eo *pager = params->pager; + Eo *btn, *box, *sp; + Page_Set_Params *psp = calloc(1, sizeof(Page_Set_Params)); + if (!psp) return; + + btn = efl_add(EFL_UI_BUTTON_CLASS, navi, + efl_text_set(efl_added, "Back"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + back_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 Page", btn, NULL, + efl_added, NULL)); + + btn = efl_add(EFL_UI_BUTTON_CLASS, box, + efl_text_set(efl_added, "Set Current Page As"), + efl_pack_end(box, efl_added)); + + sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, box, + efl_gfx_hint_align_set(efl_added, -1, -1), + efl_pack_end(box, efl_added)); + + if (efl_content_count(pager) > 0) + { + efl_ui_range_min_max_set(sp, 0, + (efl_content_count(pager) - 1)); + efl_ui_range_value_set(sp, + efl_ui_pager_current_page_get(pager)); + } + else + { + elm_object_disabled_set(btn, EINA_TRUE); + elm_object_disabled_set(sp, EINA_TRUE); + } + + psp->pager = pager; + psp->spinner = sp; + + efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, page_set_btn_cb, psp); + efl_event_callback_add(btn, EFL_EVENT_DEL, page_set_btn_del_cb, psp); +} + +static void indicator_cb(void *data, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Params *params = (Params *)data; + Evas_Object *navi = params->navi; + Eo *btn, *box; + + btn = efl_add(EFL_UI_BUTTON_CLASS, navi, + efl_text_set(efl_added, "Back"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + back_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, "Indicator", btn, NULL, + efl_added, NULL)); + + efl_add(EFL_UI_BUTTON_CLASS, box, + efl_text_set(efl_added, "Icon Type"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + indicator_icon_btn_cb, params), + efl_pack_end(box, efl_added)); + + efl_add(EFL_UI_BUTTON_CLASS, box, + efl_text_set(efl_added, "None"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + indicator_none_btn_cb, params), + efl_pack_end(box, efl_added)); +} + +void test_ui_pager(void *data EINA_UNUSED, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Eo *win, *panes, *navi, *list, *layout, *pager, *page; + Params *params = 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_TYPE_BASIC), + efl_text_set(efl_added, "Pager"), + efl_ui_win_autodel_set(efl_added, EINA_TRUE)); + + panes = efl_add(EFL_UI_PANES_CLASS, win, + efl_gfx_hint_weight_set(efl_added, 1, 1), + efl_ui_panes_split_ratio_set(efl_added, 0.3), + efl_content_set(win, efl_added)); + + navi = elm_naviframe_add(panes); + evas_object_show(navi); + efl_content_set(efl_part(panes, "first"), navi); + + list = elm_list_add(navi); + elm_list_horizontal_set(list, EINA_FALSE); + elm_list_select_mode_set(list, ELM_OBJECT_SELECT_MODE_ALWAYS); + elm_naviframe_item_push(navi, "Properties", NULL, NULL, list, NULL); + evas_object_show(list); + + snprintf(buf, sizeof(buf), "%s/objects/test_pager.edj", + elm_app_data_dir_get()); + layout = efl_add(EFL_UI_LAYOUT_CLASS, panes, + efl_file_set(efl_added, buf), + efl_file_key_set(efl_added, "pager"), + efl_file_load(efl_added), + efl_content_set(efl_part(panes, "second"), efl_added)); + + pager = efl_add(EFL_UI_PAGER_CLASS, layout, + efl_content_set(efl_part(layout, "pager"), efl_added), + efl_ui_pager_page_size_set(efl_added, EINA_SIZE2D(200, 300))); + + efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_text_set(efl_added, "Prev"), + efl_event_callback_add(efl_added, + EFL_UI_EVENT_CLICKED, prev_btn_cb, pager), + efl_content_set(efl_part(layout, "prev_btn"), efl_added)); + + efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_text_set(efl_added, "Next"), + efl_event_callback_add(efl_added, + EFL_UI_EVENT_CLICKED, next_btn_cb, pager), + efl_content_set(efl_part(layout, "next_btn"), efl_added)); + + params = calloc(1, sizeof(Params)); + if (!params) return; + + params->navi = navi; + params->pager = pager; + params->indicator = NULL; + params->w = 200; + params->h = 300; + params->wfill = EINA_FALSE; + params->hfill = EINA_FALSE; + + elm_list_item_append(list, "Page Size", NULL, NULL, page_size_cb, params); + elm_list_item_append(list, "Pack / Unpack", NULL, NULL, pack_cb, params); + elm_list_item_append(list, "Current Page", NULL, NULL, current_page_cb, params); + elm_list_item_append(list, "Indicator", NULL, NULL, indicator_cb, params); + elm_list_go(list); + + efl_event_callback_add(list, EFL_EVENT_DEL, list_del_cb, params); + + for (i = 0; i < PAGE_NUM; i++) { + switch (i % 3) { + case 0: + page = page_add(LAYOUT, pager); + break; + case 1: + page = page_add(LIST, pager); + break; + case 2: + page = page_add(BUTTON, pager); + break; + default: + page = page_add(LAYOUT, pager); + break; + } + efl_pack_end(pager, page); + } + + efl_gfx_entity_size_set(win, EINA_SIZE2D(580, 320)); +} diff --git a/src/bin/elementary/test_ui_pager_scroll.c b/src/bin/elementary/test_ui_pager_scroll.c new file mode 100644 index 0000000000..8df58c6570 --- /dev/null +++ b/src/bin/elementary/test_ui_pager_scroll.c @@ -0,0 +1,1002 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif +#define EO_BETA_API +#define EFL_UI_WIDGET_PROTECTED + +#include +#include + + +#define PAGE_NUM 3 + + +/** |----------panes----------| + * ||--left---| |---right---|| + * || | | layout || + * || | ||---------||| + * ||naviframe| || pager ||| + * || | || ||| + * || | ||---------||| + * ||---------| |-----------|| + * |-------------------------| + * + */ + + +typedef enum _Page_Type { + LAYOUT, + LIST, + BUTTON +} Page_Type; + +typedef enum _Pack_Type { + PACK_BEGIN, + PACK_END, + PACK_BEFORE, + PACK_AFTER, + PACK_AT, + UNPACK_AT, + CLEAR +} Pack_Type; + +typedef struct _Params { + Evas_Object *navi; + Eo *pager; + Eo *transition; + Eo *indicator; + int w, h; + int padding; + int side_page_num; + int curr_page; + Eina_Bool prev_block, next_block; + Eina_Bool wfill, hfill; +} Params; + +typedef struct _Page_Set_Params { + Eo *pager; + Eo *spinner; +} Page_Set_Params; + +typedef struct _Pack_Params { + Pack_Type type; + Eo *pager; + Eo *pack_sp; + Eo *unpack_sp; + Eo *unpack_btn; +} Pack_Params; + +typedef struct _Size_Params { + Eo *pager; + Eo *slider; + Params *params; +} Size_Params; + + + +static Eo *page_add(Page_Type p, Eo *parent) +{ + Eo *page; + char buf[PATH_MAX]; + int i; + + switch (p) { + case LAYOUT: + snprintf(buf, sizeof(buf), "%s/objects/test_pager.edj", + elm_app_data_dir_get()); + page = efl_add(EFL_UI_LAYOUT_CLASS, parent, + efl_file_set(efl_added, buf), + efl_file_key_set(efl_added, "page"), + efl_file_load(efl_added), + efl_text_set(efl_part(efl_added, "text"), "Layout Page")); + efl_gfx_hint_fill_set(page, EINA_TRUE, EINA_TRUE); + break; + case LIST: + page = elm_list_add(parent); + elm_list_select_mode_set(page, ELM_OBJECT_SELECT_MODE_ALWAYS); + evas_object_show(page); + for (i = 0; i < 20; i++) { + snprintf(buf, sizeof(buf), "List Page - Item #%d", i); + elm_list_item_append(page, buf, NULL, NULL, NULL, NULL); + } + evas_object_size_hint_weight_set(page, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(page, EVAS_HINT_FILL, + EVAS_HINT_FILL); + break; + case BUTTON: + page = efl_add(EFL_UI_BUTTON_CLASS, parent, + efl_text_set(efl_added, "Button Page")); + efl_gfx_hint_fill_set(page, EINA_TRUE, EINA_TRUE); + break; + default: + snprintf(buf, sizeof(buf), "%s/objects/test_pager.edj", + elm_app_data_dir_get()); + page = efl_add(EFL_UI_LAYOUT_CLASS, parent, + efl_file_set(efl_added, buf), + efl_file_key_set(efl_added, "page"), + efl_file_load(efl_added), + efl_text_set(efl_part(efl_added, "text"), "Layout Page")); + efl_gfx_hint_fill_set(page, EINA_TRUE, EINA_TRUE); + break; + } + + return page; +} + +static void prev_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + Eo *pager = data; + int curr_page = efl_ui_pager_current_page_get(pager); + + efl_ui_pager_current_page_set(pager, (curr_page - 1)); +} + +static void next_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + Eo *pager = data; + int curr_page = efl_ui_pager_current_page_get(pager); + + efl_ui_pager_current_page_set(pager, (curr_page + 1)); +} + +static void back_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + elm_naviframe_item_pop(data); +} + +static void list_del_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + free(data); +} + +static void width_slider_cb(void *data, const Efl_Event *ev) +{ + Params *params = data; + int h; + + if (params->hfill) h = -1; + else h = params->h; + + params->w = efl_ui_range_value_get(ev->object); + efl_ui_pager_page_size_set(params->pager, EINA_SIZE2D(params->w, h)); +} + +static void height_slider_cb(void *data, const Efl_Event *ev) +{ + Params *params = data; + int w; + + if (params->wfill) w = -1; + else w = params->w; + + params->h = efl_ui_range_value_get(ev->object); + efl_ui_pager_page_size_set(params->pager, EINA_SIZE2D(w, params->h)); +} + +static void width_check_cb(void *data, const Efl_Event *ev) +{ + Size_Params *params = data; + Eina_Bool ck = elm_check_selected_get(ev->object); + int w, h; + + elm_object_disabled_set(params->slider, ck); + + params->params->wfill = ck; + + if (params->params->wfill) w = -1; + else w = params->params->w; + + if (params->params->hfill) h = -1; + else h = params->params->h; + + efl_ui_pager_page_size_set(params->pager, EINA_SIZE2D(w, h)); +} + +static void height_check_cb(void *data, const Efl_Event *ev) +{ + Size_Params *params = data; + Eina_Bool ck = elm_check_selected_get(ev->object); + int w, h; + + elm_object_disabled_set(params->slider, ck); + + params->params->hfill = ck; + + if (params->params->wfill) w = -1; + else w = params->params->w; + + if (params->params->hfill) h = -1; + else h = params->params->h; + + efl_ui_pager_page_size_set(params->pager, EINA_SIZE2D(w, h)); +} + +static void check_del_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + free(data); +} + +static void padding_slider_cb(void *data, const Efl_Event *ev) +{ + Params *params = (Params *) data; + + params->padding = efl_ui_range_value_get(ev->object); + efl_ui_pager_padding_set(params->pager, params->padding); +} + +static void side_page_num_slider_cb(void *data, const Efl_Event *ev) +{ + Params *params = (Params *) data; + + params->side_page_num = efl_ui_range_value_get(ev->object); + efl_page_transition_scroll_side_page_num_set(params->transition, + params->side_page_num); +} + +static void pack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + Pack_Params *param = data; + Eo *pager = param->pager; + Eo *page = NULL, *curr_page; + int index, cnt; + + if ((param->type != UNPACK_AT) && (param->type != CLEAR)) { + index = efl_content_count(pager); + + switch (index % 3) { + case 0: + page = page_add(LAYOUT, pager); + break; + case 1: + page = page_add(LIST, pager); + break; + case 2: + page = page_add(BUTTON, pager); + break; + default: + page = page_add(LAYOUT, pager); + break; + } + } + + switch (param->type) { + case PACK_BEGIN: + efl_pack_begin(pager, page); + break; + case PACK_END: + efl_pack_end(pager, page); + break; + case PACK_BEFORE: + index = efl_ui_pager_current_page_get(pager); + curr_page = efl_pack_content_get(pager, index); + efl_pack_before(pager, page, curr_page); + break; + case PACK_AFTER: + index = efl_ui_pager_current_page_get(pager); + curr_page = efl_pack_content_get(pager, index); + efl_pack_after(pager, page, curr_page); + break; + case PACK_AT: + index = efl_ui_range_value_get(param->pack_sp); + efl_pack_at(pager, page, index); + break; + case UNPACK_AT: + index = efl_ui_range_value_get(param->unpack_sp); + page = efl_pack_unpack_at(pager, index); + efl_del(page); + break; + case CLEAR: + efl_pack_clear(pager); + break; + } + + cnt = efl_content_count(pager); + + index = efl_ui_range_value_get(param->pack_sp); + if (index > cnt) + efl_ui_range_value_set(param->pack_sp, cnt); + efl_ui_range_min_max_set(param->pack_sp, 0, cnt); + + if (cnt > 0) + { + elm_object_disabled_set(param->unpack_btn, EINA_FALSE); + elm_object_disabled_set(param->unpack_sp, EINA_FALSE); + + cnt -= 1; + index = efl_ui_range_value_get(param->unpack_sp); + if (index > cnt) + efl_ui_range_value_set(param->unpack_sp, cnt); + efl_ui_range_min_max_set(param->unpack_sp, 0, cnt); + } + else + { + elm_object_disabled_set(param->unpack_btn, EINA_TRUE); + elm_object_disabled_set(param->unpack_sp, EINA_TRUE); + } +} + +static void pack_btn_del_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + free(data); +} + +static void page_set_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + Page_Set_Params *psp = data; + + efl_ui_pager_current_page_set(psp->pager, + efl_ui_range_value_get(psp->spinner)); +} + +static void page_set_btn_del_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + free(data); +} + +static void prev_block_check_cb(void *data, const Efl_Event *ev) +{ + Eo *pager = data; + Eina_Bool prev, next; + + prev = efl_ui_nstate_value_get(ev->object); + + efl_ui_pager_scroll_block_get(pager, NULL, &next); + efl_ui_pager_scroll_block_set(pager, prev, next); +} + +static void next_block_check_cb(void *data, const Efl_Event *ev) +{ + Eo *pager = data; + Eina_Bool prev, next; + + next = efl_ui_nstate_value_get(ev->object); + + efl_ui_pager_scroll_block_get(pager, &prev, NULL); + efl_ui_pager_scroll_block_set(pager, prev, next); +} + +static void loop_radio_cb(void *data, const Efl_Event *ev) +{ + Eo *pager = data; + int state = efl_ui_nstate_value_get(ev->object); + + efl_ui_pager_loop_mode_set(pager, state); +} + +static void indicator_icon_btn_cb(void *data, + const Efl_Event *ev EINA_UNUSED) +{ + Params *params = data; + + params->indicator = efl_add(EFL_PAGE_INDICATOR_ICON_CLASS, params->pager); + efl_ui_pager_indicator_set(params->pager, params->indicator); +} + +static void indicator_none_btn_cb(void *data, + const Efl_Event *ev EINA_UNUSED) +{ + Params *params = data; + efl_ui_pager_indicator_set(params->pager, NULL); +} + +static void page_size_cb(void *data, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Params *params = data; + Size_Params *size_params; + Evas_Object *navi = params->navi; + Eo *btn, *box, *fr, *inbox, *ck, *sl; + + btn = efl_add(EFL_UI_BUTTON_CLASS, navi, + efl_text_set(efl_added, "Back"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + back_btn_cb, navi)); + + box = efl_add(EFL_UI_BOX_CLASS, navi, + elm_naviframe_item_push(navi, "Page Size", btn, NULL, + efl_added, NULL)); + + // Width + fr = elm_frame_add(box); + elm_object_text_set(fr, "Width"); + efl_gfx_hint_align_set(fr, -1, -1); + efl_gfx_hint_weight_set(fr, 1, 1); + efl_pack(box, fr); + efl_gfx_entity_visible_set(fr, 1); + + inbox = efl_add(EFL_UI_BOX_CLASS, fr, + efl_content_set(fr, efl_added)); + + ck = elm_check_add(inbox); + elm_object_text_set(ck, "Fill"); + efl_pack_end(inbox, ck); + efl_gfx_entity_visible_set(ck, 1); + + sl = efl_add(EFL_UI_SLIDER_CLASS, inbox, + efl_ui_range_min_max_set(efl_added, 100, 200), + efl_ui_range_value_set(efl_added, params->w), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 0)), + efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, + width_slider_cb, params), + efl_pack_end(inbox, efl_added)); + + size_params = calloc(1, sizeof(Size_Params)); + if (!size_params) return; + + size_params->slider = sl; + size_params->pager = params->pager; + size_params->params = params; + + efl_event_callback_add(ck, EFL_UI_CHECK_EVENT_CHANGED, width_check_cb, + size_params); + efl_event_callback_add(ck, EFL_EVENT_DEL, check_del_cb, size_params); + + if (params->wfill) + { + elm_check_state_set(ck, EINA_TRUE); + elm_object_disabled_set(sl, EINA_TRUE); + } + + // Height + fr = elm_frame_add(box); + elm_object_text_set(fr, "Height"); + efl_gfx_hint_align_set(fr, -1, -1); + efl_gfx_hint_weight_set(fr, 1, 1); + efl_pack(box, fr); + efl_gfx_entity_visible_set(fr, 1); + + inbox = efl_add(EFL_UI_BOX_CLASS, fr, + efl_content_set(fr, efl_added)); + + ck = elm_check_add(inbox); + elm_object_text_set(ck, "Fill"); + efl_pack_end(inbox, ck); + efl_gfx_entity_visible_set(ck, 1); + + sl = efl_add(EFL_UI_SLIDER_CLASS, inbox, + efl_ui_range_min_max_set(efl_added, 100, 300), + efl_ui_range_value_set(efl_added, params->h), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 0)), + efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, + height_slider_cb, params), + efl_pack_end(inbox, efl_added)); + + size_params = calloc(1, sizeof(Size_Params)); + if (!size_params) return; + + size_params->slider = sl; + size_params->pager = params->pager; + size_params->params = params; + + efl_event_callback_add(ck, EFL_UI_CHECK_EVENT_CHANGED, height_check_cb, + size_params); + efl_event_callback_add(ck, EFL_EVENT_DEL, check_del_cb, size_params); + + if (params->hfill) + { + elm_check_state_set(ck, EINA_TRUE); + elm_object_disabled_set(sl, EINA_TRUE); + } +} + +static void padding_cb(void *data, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Params *params = (Params *)data; + Evas_Object *navi = params->navi; + Eo *btn, *box; + + btn = efl_add(EFL_UI_BUTTON_CLASS, navi, + efl_text_set(efl_added, "Back"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + back_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, "Padding Size", btn, NULL, + efl_added, NULL)); + + efl_add(EFL_UI_SLIDER_CLASS, box, + efl_ui_range_min_max_set(efl_added, 0, 50), + efl_ui_range_value_set(efl_added, params->padding), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 0)), + efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, + padding_slider_cb, params), + efl_pack_end(box, efl_added)); +} + +static void side_page_num_cb(void *data, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Params *params = (Params *)data; + Evas_Object *navi = params->navi; + Eo *btn, *box; + + btn = efl_add(EFL_UI_BUTTON_CLASS, navi, + efl_text_set(efl_added, "Back"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + back_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, "Side Page Num", btn, NULL, + efl_added, NULL)); + + efl_add(EFL_UI_SLIDER_CLASS, box, + efl_text_set(efl_added, "side page num"), + efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"), + efl_ui_range_min_max_set(efl_added, 0, 3), + efl_ui_range_value_set(efl_added, params->side_page_num), + efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL), + efl_gfx_hint_weight_set(efl_added, 1, 1), + efl_gfx_hint_align_set(efl_added, -1, -1), + efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, + side_page_num_slider_cb, params), + efl_pack_end(box, efl_added)); +} + +static void pack_cb(void *data, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Params *params = (Params *)data; + Evas_Object *navi = params->navi; + Eo *pager = params->pager; + Eo *btn, *box, *in_box1, *in_box2, *sp1, *sp2; + Pack_Params *pack_param; + + btn = efl_add(EFL_UI_BUTTON_CLASS, navi, + efl_text_set(efl_added, "Back"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + back_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)); + + in_box1 = 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)); + + sp1 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box1, + efl_ui_range_min_max_set(efl_added, 0, + efl_content_count(pager)), + efl_ui_range_value_set(efl_added, + efl_ui_pager_current_page_get(pager))); + + in_box2 = 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)); + + sp2 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box2); + + btn = efl_add(EFL_UI_BUTTON_CLASS, in_box2, + efl_text_set(efl_added, "Unpack At")); + + // Pack Begin + pack_param = calloc(1, sizeof(Pack_Params)); + if (!pack_param) return; + + pack_param->pager = pager; + pack_param->pack_sp = sp1; + pack_param->unpack_sp = sp2; + pack_param->unpack_btn = btn; + pack_param->type = PACK_BEGIN; + + 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_btn_cb, pack_param), + efl_event_callback_add(efl_added, EFL_EVENT_DEL, + pack_btn_del_cb, pack_param), + efl_pack_end(box, efl_added)); + + // Pack End + pack_param = calloc(1, sizeof(Pack_Params)); + if (!pack_param) return; + + pack_param->pager = pager; + pack_param->pack_sp = sp1; + pack_param->unpack_sp = sp2; + pack_param->unpack_btn = btn; + pack_param->type = PACK_END; + + 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_btn_cb, pack_param), + efl_event_callback_add(efl_added, EFL_EVENT_DEL, + pack_btn_del_cb, pack_param), + efl_pack_end(box, efl_added)); + + // Pack Before + pack_param = calloc(1, sizeof(Pack_Params)); + if (!pack_param) return; + + pack_param->pager = pager; + pack_param->pack_sp = sp1; + pack_param->unpack_sp = sp2; + pack_param->unpack_btn = btn; + pack_param->type = PACK_BEFORE; + + efl_add(EFL_UI_BUTTON_CLASS, box, + efl_text_set(efl_added, "Pack Before Current Page"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + pack_btn_cb, pack_param), + efl_event_callback_add(efl_added, EFL_EVENT_DEL, + pack_btn_del_cb, pack_param), + efl_pack_end(box, efl_added)); + + // Pack After + pack_param = calloc(1, sizeof(Pack_Params)); + if (!pack_param) return; + + pack_param->pager = pager; + pack_param->pack_sp = sp1; + pack_param->unpack_sp = sp2; + pack_param->unpack_btn = btn; + pack_param->type = PACK_AFTER; + + efl_add(EFL_UI_BUTTON_CLASS, box, + efl_text_set(efl_added, "Pack After Current Page"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + pack_btn_cb, pack_param), + efl_event_callback_add(efl_added, EFL_EVENT_DEL, + pack_btn_del_cb, pack_param), + efl_pack_end(box, efl_added)); + + // Pack At + pack_param = calloc(1, sizeof(Pack_Params)); + if (!pack_param) return; + + pack_param->pager = pager; + pack_param->pack_sp = sp1; + pack_param->unpack_sp = sp2; + pack_param->unpack_btn = btn; + pack_param->type = PACK_AT; + + efl_add(EFL_UI_BUTTON_CLASS, in_box1, + efl_text_set(efl_added, "Pack At"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + pack_btn_cb, pack_param), + efl_event_callback_add(efl_added, EFL_EVENT_DEL, + pack_btn_del_cb, pack_param), + efl_pack_end(in_box1, efl_added)); + + efl_pack_end(box, in_box1); + efl_pack_end(in_box1, sp1); + + // Unpack At + pack_param = calloc(1, sizeof(Pack_Params)); + if (!pack_param) return; + + pack_param->pager = pager; + pack_param->pack_sp = sp1; + pack_param->unpack_sp = sp2; + pack_param->unpack_btn = btn; + pack_param->type = UNPACK_AT; + + efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, + pack_btn_cb, pack_param); + efl_event_callback_add(btn, EFL_EVENT_DEL, + pack_btn_del_cb, pack_param); + + if (efl_content_count(pager) > 0) + { + efl_ui_range_min_max_set(sp2, 0, + (efl_content_count(pager) - 1)); + efl_ui_range_value_set(sp2, + efl_ui_pager_current_page_get(pager)); + } + else + { + elm_object_disabled_set(btn, EINA_TRUE); + elm_object_disabled_set(sp2, EINA_TRUE); + } + + efl_pack_end(box, in_box2); + efl_pack_end(in_box2, btn); + efl_pack_end(in_box2, sp2); + + // Clear + pack_param = calloc(1, sizeof(Pack_Params)); + if (!pack_param) return; + + pack_param->pager = pager; + pack_param->pack_sp = sp1; + pack_param->unpack_sp = sp2; + pack_param->unpack_btn = btn; + pack_param->type = CLEAR; + + efl_add(EFL_UI_BUTTON_CLASS, box, + efl_text_set(efl_added, "Clear"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + pack_btn_cb, pack_param), + efl_event_callback_add(efl_added, EFL_EVENT_DEL, + pack_btn_del_cb, pack_param), + efl_pack_end(box, efl_added)); +} + +static void current_page_cb(void *data, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Params *params = (Params *)data; + Evas_Object *navi = params->navi; + Eo *pager = params->pager; + Eo *btn, *box, *sp; + Page_Set_Params *psp = calloc(1, sizeof(Page_Set_Params)); + if (!psp) return; + + btn = efl_add(EFL_UI_BUTTON_CLASS, navi, + efl_text_set(efl_added, "Back"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + back_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 Page", btn, NULL, + efl_added, NULL)); + + btn = efl_add(EFL_UI_BUTTON_CLASS, box, + efl_text_set(efl_added, "Set Current Page As"), + efl_pack_end(box, efl_added)); + + sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, box, + efl_gfx_hint_align_set(efl_added, -1, -1), + efl_pack_end(box, efl_added)); + + if (efl_content_count(pager) > 0) + { + efl_ui_range_min_max_set(sp, 0, + (efl_content_count(pager) - 1)); + efl_ui_range_value_set(sp, + efl_ui_pager_current_page_get(pager)); + } + else + { + elm_object_disabled_set(btn, EINA_TRUE); + elm_object_disabled_set(sp, EINA_TRUE); + } + + psp->pager = pager; + psp->spinner = sp; + + efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, page_set_btn_cb, psp); + efl_event_callback_add(btn, EFL_EVENT_DEL, page_set_btn_del_cb, psp); +} + +static void scroll_block_cb(void *data, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Params *params = (Params *)data; + Evas_Object *navi = params->navi; + Eo *pager = params->pager; + Eo *btn, *box; + Eina_Bool prev, next; + + btn = efl_add(EFL_UI_BUTTON_CLASS, navi, + efl_text_set(efl_added, "Back"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + back_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, "Scroll Block", btn, NULL, + efl_added, NULL)); + + efl_ui_pager_scroll_block_get(pager, &prev, &next); + + efl_add(EFL_UI_CHECK_CLASS, box, + efl_ui_widget_style_set(efl_added, "toggle"), + efl_text_set(efl_added, "Prev Block"), + efl_ui_nstate_value_set(efl_added, prev), + efl_event_callback_add(efl_added, EFL_UI_CHECK_EVENT_CHANGED, + prev_block_check_cb, pager), + efl_pack_end(box, efl_added)); + + efl_add(EFL_UI_CHECK_CLASS, box, + efl_ui_widget_style_set(efl_added, "toggle"), + efl_text_set(efl_added, "Next Block"), + efl_ui_nstate_value_set(efl_added, next), + efl_event_callback_add(efl_added, EFL_UI_CHECK_EVENT_CHANGED, + next_block_check_cb, pager), + efl_pack_end(box, efl_added)); +} + +static void loop_cb(void *data EINA_UNUSED, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Params *params = (Params *)data; + Evas_Object *navi = params->navi; + Eo *pager = params->pager; + Eo *btn, *box, *rd; + Efl_Ui_Pager_Loop loop; + + btn = efl_add(EFL_UI_BUTTON_CLASS, navi, + efl_text_set(efl_added, "Back"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + back_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, "Loop", btn, NULL, + efl_added, NULL)); + + rd = efl_add(EFL_UI_RADIO_CLASS, box, + efl_ui_radio_state_value_set(efl_added, EFL_UI_PAGER_LOOP_DISABLED), + efl_text_set(efl_added, "Disabled"), + efl_gfx_hint_weight_set(efl_added, 1, 0), + efl_event_callback_add(efl_added, EFL_UI_RADIO_EVENT_CHANGED, + loop_radio_cb, pager), + efl_pack(box, efl_added)); + + rd = efl_add(EFL_UI_RADIO_CLASS, box, + efl_ui_radio_state_value_set(efl_added, EFL_UI_PAGER_LOOP_ENABLED), + efl_ui_radio_group_add(efl_added, rd), + efl_text_set(efl_added, "Enabled"), + efl_gfx_hint_weight_set(efl_added, 1, 0), + efl_event_callback_add(efl_added, EFL_UI_RADIO_EVENT_CHANGED, + loop_radio_cb, pager), + efl_pack(box, efl_added)); + + loop = efl_ui_pager_loop_mode_get(pager); + + efl_ui_nstate_value_set(rd, loop); + + if (loop == EFL_UI_PAGER_LOOP_DISABLED) + { + Eina_Bool ret = efl_ui_pager_loop_mode_set(pager, EFL_UI_PAGER_LOOP_ENABLED); + if (!ret) + elm_object_disabled_set(rd, EINA_TRUE); + else + efl_ui_pager_loop_mode_set(pager, EFL_UI_PAGER_LOOP_DISABLED); + } +} + +static void indicator_cb(void *data EINA_UNUSED, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Params *params = (Params *)data; + Evas_Object *navi = params->navi; + Eo *btn, *box; + + btn = efl_add(EFL_UI_BUTTON_CLASS, navi, + efl_text_set(efl_added, "Back"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + back_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, "Indicator", btn, NULL, + efl_added, NULL)); + + efl_add(EFL_UI_BUTTON_CLASS, box, + efl_text_set(efl_added, "Icon Type"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + indicator_icon_btn_cb, params), + efl_pack_end(box, efl_added)); + + efl_add(EFL_UI_BUTTON_CLASS, box, + efl_text_set(efl_added, "None"), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + indicator_none_btn_cb, params), + efl_pack_end(box, efl_added)); +} + +void test_ui_pager_scroll(void *data EINA_UNUSED, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Eo *win, *panes, *navi, *list, *layout, *pager, *page, *tran; + Params *params = 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_TYPE_BASIC), + efl_text_set(efl_added, "Pager"), + efl_ui_win_autodel_set(efl_added, EINA_TRUE)); + + panes = efl_add(EFL_UI_PANES_CLASS, win, + efl_gfx_hint_weight_set(efl_added, 1, 1), + efl_ui_panes_split_ratio_set(efl_added, 0.3), + efl_content_set(win, efl_added)); + + navi = elm_naviframe_add(panes); + evas_object_show(navi); + efl_content_set(efl_part(panes, "first"), navi); + + list = elm_list_add(navi); + elm_list_horizontal_set(list, EINA_FALSE); + elm_list_select_mode_set(list, ELM_OBJECT_SELECT_MODE_ALWAYS); + elm_naviframe_item_push(navi, "Properties", NULL, NULL, list, NULL); + evas_object_show(list); + + snprintf(buf, sizeof(buf), "%s/objects/test_pager.edj", + elm_app_data_dir_get()); + layout = efl_add(EFL_UI_LAYOUT_CLASS, panes, + efl_file_set(efl_added, buf), + efl_file_key_set(efl_added, "pager"), + efl_file_load(efl_added), + efl_content_set(efl_part(panes, "second"), efl_added)); + + pager = efl_add(EFL_UI_PAGER_CLASS, layout, + efl_content_set(efl_part(layout, "pager"), efl_added), + efl_ui_pager_page_size_set(efl_added, EINA_SIZE2D(200, 300)), + efl_ui_pager_padding_set(efl_added, 20)); + + efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_text_set(efl_added, "Prev"), + efl_event_callback_add(efl_added, + EFL_UI_EVENT_CLICKED, prev_btn_cb, pager), + efl_content_set(efl_part(layout, "prev_btn"), efl_added)); + + efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_text_set(efl_added, "Next"), + efl_event_callback_add(efl_added, + EFL_UI_EVENT_CLICKED, next_btn_cb, pager), + efl_content_set(efl_part(layout, "next_btn"), efl_added)); + + tran = efl_add(EFL_PAGE_TRANSITION_SCROLL_CLASS, pager, + efl_ui_pager_transition_set(pager, efl_added)); + + params = calloc(1, sizeof(Params)); + if (!params) return; + + params->navi = navi; + params->pager = pager; + params->transition = NULL; + params->indicator = NULL; + params->w = 200; + params->h = 300; + params->padding = 20; + params->side_page_num = efl_page_transition_scroll_side_page_num_get(tran); + params->curr_page = 0; + params->wfill = EINA_FALSE; + params->hfill = EINA_FALSE; + params->prev_block = EINA_FALSE; + params->next_block = EINA_FALSE; + params->transition = tran; + + elm_list_item_append(list, "Page Size", NULL, NULL, page_size_cb, params); + elm_list_item_append(list, "Padding", NULL, NULL, padding_cb, params); + elm_list_item_append(list, "Side Page Num", NULL, NULL, side_page_num_cb, params); + elm_list_item_append(list, "Pack / Unpack", NULL, NULL, pack_cb, params); + elm_list_item_append(list, "Current Page", NULL, NULL, current_page_cb, params); + elm_list_item_append(list, "Scroll Block", NULL, NULL, scroll_block_cb, params); + elm_list_item_append(list, "Loop", NULL, NULL, loop_cb, params); + elm_list_item_append(list, "Indicator", NULL, NULL, indicator_cb, params); + + elm_list_go(list); + + efl_event_callback_add(list, EFL_EVENT_DEL, list_del_cb, params); + + for (i = 0; i < PAGE_NUM; i++) { + switch (i % 3) { + case 0: + page = page_add(LAYOUT, pager); + break; + case 1: + page = page_add(LIST, pager); + break; + case 2: + page = page_add(BUTTON, pager); + break; + default: + page = page_add(LAYOUT, pager); + break; + } + efl_pack_end(pager, page); + } + + efl_gfx_entity_size_set(win, EINA_SIZE2D(580, 320)); +} diff --git a/src/bin/elementary/test_ui_panel.c b/src/bin/elementary/test_ui_panel.c index eed8d14759..a9c3cafbf8 100644 --- a/src/bin/elementary/test_ui_panel.c +++ b/src/bin/elementary/test_ui_panel.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include void @@ -10,7 +11,7 @@ test_ui_panel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ Eo *win, *table, *panel; win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl.Ui.Panel"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); @@ -19,9 +20,9 @@ test_ui_panel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get()); efl_add(EFL_UI_IMAGE_CLASS, table, - efl_file_set(efl_added, buf, NULL), - 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_file_set(efl_added, buf), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), + efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL), efl_pack_table(table, efl_added, 0, 0, 4, 5)); // Top Panel @@ -103,7 +104,7 @@ test_ui_panel2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event Eo *win, *box, *check, *btn, *table, *list, *panel; win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl.Ui.Panel"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); @@ -114,17 +115,17 @@ test_ui_panel2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event efl_ui_check_selected_set(efl_added, elm_config_scroll_thumbscroll_enabled_get()), efl_text_set(efl_added, "Enable thumb scroll (temporarily"), efl_event_callback_add(efl_added, EFL_UI_NSTATE_EVENT_CHANGED, _check_changed, NULL), - efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0), efl_pack(box, efl_added)); check = efl_add(EFL_UI_CHECK_CLASS, box, efl_text_set(efl_added, "Reset content on toggle"), - efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0), efl_pack(box, efl_added)); btn = efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "toggle"), - efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0), efl_pack(box, efl_added)); table = efl_add(EFL_UI_TABLE_CLASS, box, diff --git a/src/bin/elementary/test_ui_panes.c b/src/bin/elementary/test_ui_panes.c index 4e6d3373e0..a9d0c80606 100644 --- a/src/bin/elementary/test_ui_panes.c +++ b/src/bin/elementary/test_ui_panes.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include void @@ -9,7 +10,7 @@ test_panes_minsize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e Eo *win, *panes, *panes_h; win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl.Ui.Panes"), efl_ui_win_autodel_set(efl_added, EINA_TRUE) ); @@ -21,7 +22,7 @@ test_panes_minsize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Left - user set min size(110,110)"), - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(110, 110)), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(110, 110)), efl_content_set(efl_part(panes, "first"), efl_added) ); @@ -31,14 +32,14 @@ test_panes_minsize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e ); efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Up - user set min size(10,0)"), - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(10, 0)), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(10, 0)), efl_content_set(efl_part(panes_h, "first"), efl_added) ); efl_ui_panes_part_hint_min_allow_set(efl_part(panes_h, "first"), EINA_TRUE); efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Down - min size 50 40"), - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(50, 40)), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(50, 40)), efl_content_set(efl_part(panes_h, "second"), efl_added) ); diff --git a/src/bin/elementary/test_ui_popup.c b/src/bin/elementary/test_ui_popup.c index 3f59a4a28f..d70592c70a 100644 --- a/src/bin/elementary/test_ui_popup.c +++ b/src/bin/elementary/test_ui_popup.c @@ -4,6 +4,7 @@ #define EFL_UI_ANCHOR_POPUP_BETA #define EFL_UI_SCROLL_ALERT_POPUP_BETA +#include #include #define POPUP_POINT_MAX 8 @@ -85,12 +86,12 @@ _backwall_cb(void *data EINA_UNUSED, const Efl_Event *ev) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get()); - efl_file_set(efl_part(p_data->efl_ui_popup, "backwall"), buf, NULL); + efl_file_simple_load(efl_part(p_data->efl_ui_popup, "backwall"), buf, NULL); efl_text_set(ev->object, "Backwall UnSet"); } else { - efl_file_set(efl_part(p_data->efl_ui_popup, "backwall"), NULL, NULL); + efl_file_simple_load(efl_part(p_data->efl_ui_popup, "backwall"), NULL, NULL); efl_text_set(ev->object, "Backwall Set"); } k = !k; @@ -365,7 +366,7 @@ test_ui_alert_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void * Eo *layout = efl_add(EFL_UI_LAYOUT_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"); + efl_file_simple_load(layout, buf, "efl_ui_popup_scroll_content"); efl_content_set(efl_ui_popup, layout); efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_POSITIVE, "Yes", NULL); @@ -386,7 +387,7 @@ _alert_scroll_case1_cb(void *data, const Efl_Event *ev EINA_UNUSED) Eo *layout = efl_add(EFL_UI_LAYOUT_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"); + efl_file_simple_load(layout, buf, "efl_ui_popup_scroll_content"); efl_content_set(efl_ui_popup, layout); @@ -410,7 +411,7 @@ _alert_scroll_case2_cb(void *data, const Efl_Event *ev EINA_UNUSED) Eo *layout = efl_add(EFL_UI_LAYOUT_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"); + efl_file_simple_load(layout, buf, "efl_ui_popup_scroll_content"); efl_content_set(efl_ui_popup, layout); @@ -436,7 +437,7 @@ _alert_scroll_case3_cb(void *data, const Efl_Event *ev EINA_UNUSED) Eo *layout = efl_add(EFL_UI_LAYOUT_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"); + efl_file_simple_load(layout, buf, "efl_ui_popup_scroll_content"); efl_content_set(efl_ui_popup, layout); @@ -462,7 +463,7 @@ _alert_scroll_case4_cb(void *data, const Efl_Event *ev EINA_UNUSED) Eo *layout = efl_add(EFL_UI_LAYOUT_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"); + efl_file_simple_load(layout, buf, "efl_ui_popup_scroll_content"); efl_content_set(efl_ui_popup, layout); @@ -488,7 +489,7 @@ _alert_scroll_case5_cb(void *data, const Efl_Event *ev EINA_UNUSED) Eo *layout = efl_add(EFL_UI_LAYOUT_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"); + efl_file_simple_load(layout, buf, "efl_ui_popup_scroll_content"); efl_content_set(efl_ui_popup, layout); @@ -1008,8 +1009,8 @@ test_ui_anchor_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win); snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get()); - efl_file_set(layout, buf, "efl_ui_anchor_popup_layout"); - efl_gfx_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + efl_file_simple_load(layout, buf, "efl_ui_anchor_popup_layout"); + efl_gfx_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); efl_content_set(win, layout); Eo *efl_ui_popup = efl_add(EFL_UI_ANCHOR_POPUP_CLASS, win); @@ -1034,7 +1035,7 @@ test_ui_anchor_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void { btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(btn, "anchor"); - efl_gfx_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + efl_gfx_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _anchor_set_cb, efl_ui_popup); snprintf(buf, sizeof(buf), "anchor%d", i+1); @@ -1043,52 +1044,52 @@ test_ui_anchor_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(btn, "anchor none"); - efl_gfx_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + efl_gfx_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _anchor_unset_cb, efl_ui_popup); efl_content_set(efl_part(layout, "anchor_none"), btn); Eo *table = efl_add(EFL_UI_TABLE_CLASS, efl_ui_popup); - efl_gfx_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + efl_gfx_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup); efl_text_set(btn, "Center Align"); - efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(70, 35)); + efl_gfx_hint_size_min_set(btn, EINA_SIZE2D(70, 35)); efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _center_align_cb, p_data); efl_pack_table(table, btn, 0, 0, 2, 1); btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup); efl_text_set(btn, "Top Align"); - efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(70, 35)); + efl_gfx_hint_size_min_set(btn, EINA_SIZE2D(70, 35)); efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _top_align_cb, p_data); efl_pack_table(table, btn, 2, 0, 2, 1); btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup); efl_text_set(btn, "Bottom Align"); - efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(70, 35)); + efl_gfx_hint_size_min_set(btn, EINA_SIZE2D(70, 35)); efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _bottom_align_cb, p_data); efl_pack_table(table, btn, 4, 0, 2, 1); btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup); efl_text_set(btn, "Left Align"); - efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(100, 35)); + efl_gfx_hint_size_min_set(btn, EINA_SIZE2D(100, 35)); efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _left_align_cb, p_data); efl_pack_table(table, btn, 0, 1, 3, 1); btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup); efl_text_set(btn, "Right Align"); - efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(100, 35)); + efl_gfx_hint_size_min_set(btn, EINA_SIZE2D(100, 35)); efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _right_align_cb, p_data); efl_pack_table(table, btn, 3, 1, 3, 1); btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup); efl_text_set(btn, "Position Set"); - efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(100, 35)); + efl_gfx_hint_size_min_set(btn, EINA_SIZE2D(100, 35)); efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _position_set_cb, p_data); efl_pack_table(table, btn, 0, 2, 3, 1); btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup); efl_text_set(btn, "Resize"); - efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(100, 35)); + efl_gfx_hint_size_min_set(btn, EINA_SIZE2D(100, 35)); efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _popup_resize_cb, p_data); efl_pack_table(table, btn, 3, 2, 3, 1); diff --git a/src/bin/elementary/test_ui_progressbar.c b/src/bin/elementary/test_ui_progressbar.c index 09a0e704c0..e85176998f 100644 --- a/src/bin/elementary/test_ui_progressbar.c +++ b/src/bin/elementary/test_ui_progressbar.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include typedef struct _pbdata @@ -118,7 +119,7 @@ test_ui_progressbar(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_inf 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_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_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, @@ -133,12 +134,13 @@ test_ui_progressbar(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_inf 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)) + efl_gfx_hint_size_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_file_set(efl_added, buf), + efl_file_load(efl_added), efl_content_set(pd->pb1, efl_added) ); @@ -146,7 +148,7 @@ test_ui_progressbar(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_inf 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_gfx_hint_size_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) ); diff --git a/src/bin/elementary/test_ui_relative_layout.c b/src/bin/elementary/test_ui_relative_layout.c new file mode 100644 index 0000000000..e6481ec97e --- /dev/null +++ b/src/bin/elementary/test_ui_relative_layout.c @@ -0,0 +1,320 @@ +#include "test.h" +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include +#include + +static Eo *layout, *btn1, *btn2, *btn3; + +typedef enum { + LEFT, + RIGHT, + TOP, + BOTTOM +} Options; + +static void +_btn_clicked_to_cb(void *data, const Efl_Event *event) +{ + Eo *to, *btn, *obj = event->object; + Options opt = (Options)data; + double relative; + + btn = efl_key_wref_get(obj, "btn"); + to = efl_key_wref_get(obj, "to"); + + do + { + if (to == layout) + to = btn1; + else if (to == btn1) + to = btn2; + else if (to == btn2) + to = btn3; + else if (to == btn3) + to = layout; + } + while (btn == to); + efl_key_wref_set(obj, "to", to); + + switch (opt) + { + case LEFT: + efl_ui_relative_layout_relation_left_get(layout, btn, NULL, &relative); + efl_ui_relative_layout_relation_left_set(layout, btn, to, relative); + break; + case RIGHT: + efl_ui_relative_layout_relation_right_get(layout, btn, NULL, &relative); + efl_ui_relative_layout_relation_right_set(layout, btn, to, relative); + break; + case TOP: + efl_ui_relative_layout_relation_top_get(layout, btn, NULL, &relative); + efl_ui_relative_layout_relation_top_set(layout, btn, to, relative); + break; + case BOTTOM: + efl_ui_relative_layout_relation_bottom_get(layout, btn, NULL, &relative); + efl_ui_relative_layout_relation_bottom_set(layout, btn, to, relative); + break; + } + efl_text_set(obj, ((to == layout) ? "parent" : (char *)efl_text_get(to))); + efl_pack_layout_request(layout); +} + +static void +_slider_changed_relative_cb(void *data, const Efl_Event *event) +{ + Options opt = (Options)data; + Eo *btn, *slider = event->object; + double val; + + btn = efl_key_wref_get(slider, "btn"); + val = efl_ui_range_value_get(slider); + + switch (opt) + { + case LEFT: + efl_ui_relative_layout_relation_left_set(layout, btn, NULL, val); + break; + case RIGHT: + efl_ui_relative_layout_relation_right_set(layout, btn, NULL, val); + break; + case TOP: + efl_ui_relative_layout_relation_top_set(layout, btn, NULL, val); + break; + case BOTTOM: + efl_ui_relative_layout_relation_bottom_set(layout, btn, NULL, val); + break; + } + efl_pack_layout_request(layout); +} + +static void +_slider_changed_align_cb(void *data, const Efl_Event *event) +{ + char opt = (char)(uintptr_t)data; + Eo *btn, *slider = event->object; + double val, x, y; + + btn = efl_key_wref_get(slider, "btn"); + val = efl_ui_range_value_get(slider); + + efl_gfx_hint_align_get(btn, &x, &y); + if (opt == 'x') + efl_gfx_hint_align_set(btn, val, y); + else if (opt == 'y') + efl_gfx_hint_align_set(btn, x, val); + + efl_pack_layout_request(layout); +} + +static void +_setter_add(Eo *vbox, Eo *btn, Options option) +{ + Eo *to, *hbox; + char *text = NULL, *btn_text; + double relative; + + switch (option) + { + case LEFT: + text = "left"; + efl_ui_relative_layout_relation_left_get(layout, btn, &to, &relative); + break; + case RIGHT: + text = "right"; + efl_ui_relative_layout_relation_right_get(layout, btn, &to, &relative); + break; + case TOP: + text = "top"; + efl_ui_relative_layout_relation_top_get(layout, btn, &to, &relative); + break; + case BOTTOM: + text = "bottom"; + efl_ui_relative_layout_relation_bottom_get(layout, btn, &to, &relative); + break; + } + btn_text = ((to == layout) ? "parent" : (char *)efl_text_get(to)); + + hbox = efl_add(EFL_UI_BOX_CLASS, vbox, + efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), + efl_pack_padding_set(efl_added, 2, 2, EINA_TRUE), + efl_pack(vbox, efl_added)); + + efl_add(EFL_UI_TEXT_CLASS, hbox, + efl_text_set(efl_added, text), + efl_text_interactive_editable_set(efl_added, EINA_FALSE), + efl_text_valign_set(efl_added, 0.5), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(40, 0)), + efl_gfx_hint_weight_set(efl_added, 0, EFL_GFX_HINT_EXPAND), + efl_pack(hbox, efl_added)); + + efl_add(EFL_UI_BUTTON_CLASS, hbox, + efl_text_set(efl_added, btn_text), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(60, 0)), + efl_key_wref_set(efl_added, "to", to), + efl_key_wref_set(efl_added, "btn", btn), + efl_gfx_hint_weight_set(efl_added, 0, EFL_GFX_HINT_EXPAND), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_clicked_to_cb, (void *)option), + efl_pack(hbox, efl_added)); + + efl_add(EFL_UI_SLIDER_CLASS, hbox, + efl_ui_range_min_max_set(efl_added, 0.0, 1.0), + efl_ui_range_step_set(efl_added, 0.1), + efl_ui_range_value_set(efl_added, relative), + efl_key_wref_set(efl_added, "btn", btn), + efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _slider_changed_relative_cb, (void *)option), + efl_pack(hbox, efl_added)); +} + +static void +_button_frame_add(Eo *box, Eo *btn) +{ + Eo *f, *vbox, *hbox; + double align_x, align_y; + + f = efl_add(EFL_UI_FRAME_CLASS, box, + efl_text_set(efl_added, efl_text_get(btn)), + efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0), + efl_pack(box, efl_added)); + + vbox = efl_add(EFL_UI_BOX_CLASS, f, + efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL), + efl_pack_padding_set(efl_added, 2, 2, EINA_TRUE), + efl_gfx_hint_margin_set(efl_added, 2, 2, 2, 2), + efl_content_set(f, efl_added)); + + hbox = efl_add(EFL_UI_BOX_CLASS, vbox, + efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), + efl_pack_padding_set(efl_added, 2, 2, EINA_TRUE), + efl_pack(vbox, efl_added)); + + efl_add(EFL_CANVAS_RECTANGLE_CLASS, hbox, + efl_gfx_color_set(efl_added, 0, 0, 0, 0), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(40, 0)), + efl_gfx_hint_weight_set(efl_added, 0, EFL_GFX_HINT_EXPAND), + efl_pack(hbox, efl_added)); + + efl_add(EFL_UI_TEXT_CLASS, hbox, + efl_text_set(efl_added, "to"), + efl_text_interactive_editable_set(efl_added, EINA_FALSE), + efl_text_halign_set(efl_added, 0.5), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(60, 0)), + efl_gfx_hint_weight_set(efl_added, 0, EFL_GFX_HINT_EXPAND), + efl_pack(hbox, efl_added)); + + efl_add(EFL_UI_TEXT_CLASS, hbox, + efl_text_set(efl_added, "relative"), + efl_text_halign_set(efl_added, 0.5), + efl_text_interactive_editable_set(efl_added, EINA_FALSE), + efl_pack(hbox, efl_added)); + + _setter_add(vbox, btn, LEFT); + _setter_add(vbox, btn, RIGHT); + _setter_add(vbox, btn, TOP); + _setter_add(vbox, btn, BOTTOM); + + /* align setter */ + efl_gfx_hint_align_get(btn, &align_x, &align_y); + + hbox = efl_add(EFL_UI_BOX_CLASS, vbox, + efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), + efl_pack_padding_set(efl_added, 2, 2, EINA_TRUE), + efl_pack(vbox, efl_added)); + + efl_add(EFL_UI_TEXT_CLASS, hbox, + efl_text_set(efl_added, "align_x"), + efl_text_interactive_editable_set(efl_added, EINA_FALSE), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(40, 0)), + efl_gfx_hint_weight_set(efl_added, 0, EFL_GFX_HINT_EXPAND), + efl_pack(hbox, efl_added)); + + efl_add(EFL_UI_SLIDER_CLASS, hbox, + efl_ui_range_min_max_set(efl_added, 0.0, 1.0), + efl_ui_range_step_set(efl_added, 0.1), + efl_ui_range_value_set(efl_added, align_x), + efl_key_wref_set(efl_added, "btn", btn), + efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _slider_changed_align_cb, (void *)'x'), + efl_pack(hbox, efl_added)); + + hbox = efl_add(EFL_UI_BOX_CLASS, vbox, + efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), + efl_pack_padding_set(efl_added, 2, 2, EINA_TRUE), + efl_pack(vbox, efl_added)); + + efl_add(EFL_UI_TEXT_CLASS, hbox, + efl_text_set(efl_added, "align_y"), + efl_text_interactive_editable_set(efl_added, EINA_FALSE), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(40, 0)), + efl_gfx_hint_weight_set(efl_added, 0, EFL_GFX_HINT_EXPAND), + efl_pack(hbox, efl_added)); + + efl_add(EFL_UI_SLIDER_CLASS, hbox, + efl_ui_range_min_max_set(efl_added, 0.0, 1.0), + efl_ui_range_step_set(efl_added, 0.1), + efl_ui_range_value_set(efl_added, align_y), + efl_key_wref_set(efl_added, "btn", btn), + efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _slider_changed_align_cb, (void *)'y'), + efl_pack(hbox, efl_added)); +} + +void +test_ui_relative_layout(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + Eo *win, *vbox, *f, *hbox; + + win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), + efl_text_set(efl_added, "Efl.Ui.Relative_Layout"), + efl_ui_win_autodel_set(efl_added, EINA_TRUE)); + + vbox = efl_add(EFL_UI_BOX_CLASS, win, + efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL), + efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_hint_margin_set(efl_added, 5, 5, 5, 5), + efl_content_set(win, efl_added)); + + /* controls */ + f = efl_add(EFL_UI_FRAME_CLASS, vbox, + efl_text_set(efl_added, "Controls"), + efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0), + efl_pack(vbox, efl_added)); + + hbox = efl_add(EFL_UI_BOX_CLASS, f, + efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), + efl_pack_padding_set(efl_added, 10, 0, EINA_TRUE), + efl_content_set(f, efl_added)); + + /* contents */ + f = efl_add(EFL_UI_FRAME_CLASS, vbox, + efl_text_set(efl_added, "Contents"), + efl_pack(vbox, efl_added)); + + layout = efl_add(EFL_UI_RELATIVE_LAYOUT_CLASS, f, + efl_content_set(f, efl_added)); + + btn1 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_text_set(efl_added, "button1"), + efl_gfx_hint_align_set(efl_added, 0.0, 0.0), + efl_ui_relative_layout_relation_right_set(layout, efl_added, layout, 0.0), + efl_ui_relative_layout_relation_bottom_set(layout, efl_added, layout, 0.0)); + + btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_text_set(efl_added, "button2"), + efl_gfx_hint_align_set(efl_added, 0.5, 0.0), + efl_ui_relative_layout_relation_left_set(layout, efl_added, btn1, 1.0), + efl_ui_relative_layout_relation_bottom_set(layout, efl_added, layout, 0.0)); + + btn3 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_text_set(efl_added, "button3"), + efl_ui_relative_layout_relation_left_set(layout, efl_added, btn2, 0.0), + efl_ui_relative_layout_relation_top_set(layout, efl_added, btn2, 1.0)); + + _button_frame_add(hbox, btn1); + _button_frame_add(hbox, btn2); + _button_frame_add(hbox, btn3); + + efl_gfx_entity_size_set(win, EINA_SIZE2D(600, 400)); + efl_gfx_entity_visible_set(win, EINA_TRUE); +} diff --git a/src/bin/elementary/test_ui_scroller.c b/src/bin/elementary/test_ui_scroller.c index 2cbceb77f3..9864e77eb9 100644 --- a/src/bin/elementary/test_ui_scroller.c +++ b/src/bin/elementary/test_ui_scroller.c @@ -2,6 +2,7 @@ # include "elementary_config.h" #endif +#include #include static void @@ -31,34 +32,34 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void int i, j; win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl Ui Scroller"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 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), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), efl_event_callback_add(efl_added, EFL_UI_EVENT_SCROLL_START, _scroll_start_cb, NULL), efl_event_callback_add(efl_added, EFL_UI_EVENT_SCROLL_STOP, _scroll_stop_cb, NULL), efl_content_set(win, efl_added)); bx = efl_add(EFL_UI_BOX_CLASS, sc, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN), - efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0), - efl_gfx_size_hint_align_set(efl_added, 0.5, 0), - efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0), + efl_gfx_hint_align_set(efl_added, 0.5, 0), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), 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_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 0)), efl_pack(bx, efl_added)); for (i = 0; i < 3; i++) { efl_add(EFL_UI_BUTTON_CLASS, bx, efl_text_set(efl_added, "Vertical"), - efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), - efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL), efl_pack(bx, efl_added)); } @@ -83,25 +84,25 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void { efl_add(EFL_UI_BUTTON_CLASS, bx, efl_text_set(efl_added, "Vertical"), - efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), - efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL), efl_pack(bx, efl_added)); } gd = efl_add(EFL_UI_TABLE_CLASS, bx, - efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), - efl_gfx_size_hint_align_set(efl_added, 0.5, 0), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), + efl_gfx_hint_align_set(efl_added, 0.5, 0), efl_pack(bx, efl_added)); efl_add(EFL_CANVAS_RECTANGLE_CLASS, win, efl_gfx_color_set(efl_added, 0, 0, 0, 0), - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(200, 120)), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(200, 120)), efl_pack_table(gd, efl_added, 0, 0, 1, 1)); sc3 = efl_add(EFL_UI_SCROLLER_CLASS, win, - efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), - efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), efl_pack_table(gd, efl_added, 0, 0, 1, 1)); gd2 = efl_add(EFL_UI_TABLE_CLASS, sc3, @@ -122,8 +123,8 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void { efl_add(EFL_UI_BUTTON_CLASS, bx, efl_text_set(efl_added, "Vertical"), - efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), - efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL), efl_pack(bx, efl_added)); } diff --git a/src/bin/elementary/test_ui_slider.c b/src/bin/elementary/test_ui_slider.c index 9f54a9d365..305177f453 100644 --- a/src/bin/elementary/test_ui_slider.c +++ b/src/bin/elementary/test_ui_slider.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include static double @@ -33,7 +34,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event double step; win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl.Ui.Slider"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); @@ -46,8 +47,8 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event 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_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 0)), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), efl_pack(bx, efl_added)); efl_add(EFL_UI_TEXT_CLASS, bx, @@ -56,8 +57,8 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event 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_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 0)), + efl_gfx_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)); @@ -68,8 +69,8 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event 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_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(120, 0)), + efl_gfx_hint_align_set(efl_added, 0.5, 0.5), efl_ui_range_step_set(efl_added, step), efl_pack(bx, efl_added)); @@ -79,7 +80,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event 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_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(120, 0)), efl_ui_range_min_max_set(efl_added, 10, 145), efl_ui_range_step_set(efl_added, step), elm_object_disabled_set(efl_added, EINA_TRUE), @@ -95,7 +96,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event efl_pack(bx, efl_added)); efl_add(EFL_UI_SLIDER_CLASS, hbx, - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(0, 160)), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(0, 160)), efl_ui_range_min_max_set(efl_added, 10, 145), efl_ui_range_step_set(efl_added, step), efl_ui_range_value_set(efl_added, 70), @@ -103,7 +104,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event efl_pack(hbx, efl_added)); efl_add(EFL_UI_SLIDER_CLASS, hbx, - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(0, 160)), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(0, 160)), efl_ui_range_min_max_set(efl_added, 10, 145), efl_ui_range_step_set(efl_added, step), efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL), @@ -111,7 +112,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event efl_pack(hbx, efl_added)); efl_add(EFL_UI_SLIDER_CLASS, hbx, - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(0, 160)), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(0, 160)), efl_ui_range_min_max_set(efl_added, 10, 145), efl_ui_range_value_set(efl_added, 35), efl_ui_range_step_set(efl_added, step), @@ -124,7 +125,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event efl_pack(bx, efl_added)); efl_add(EFL_UI_SLIDER_CLASS, bx, - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(260, 0)), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(260, 0)), efl_ui_range_min_max_set(efl_added, 0, 150), efl_ui_range_step_set(efl_added, step), efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _slider_changed_cb, NULL), diff --git a/src/bin/elementary/test_ui_slider_interval.c b/src/bin/elementary/test_ui_slider_interval.c index 3973b3d846..3e4bdcd2ee 100644 --- a/src/bin/elementary/test_ui_slider_interval.c +++ b/src/bin/elementary/test_ui_slider_interval.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include static double @@ -33,7 +34,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void double step; win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl.Ui.Slider_Interval"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); @@ -46,7 +47,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void 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_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 0)), efl_ui_slider_interval_value_set(efl_added, 0.4, 0.9), efl_pack(bx, efl_added)); @@ -57,7 +58,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void step = _step_size_calculate(0, 9); efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, bx, - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(120, 0)), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(120, 0)), efl_ui_slider_interval_value_set(efl_added, 0.4, 0.9), efl_ui_range_step_set(efl_added, step), efl_pack(bx, efl_added)); @@ -68,7 +69,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void 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_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(120, 0)), efl_ui_range_min_max_set(efl_added, 10, 145), efl_ui_slider_interval_value_set(efl_added, 50, 100), efl_ui_range_step_set(efl_added, step), @@ -85,7 +86,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void efl_pack(bx, efl_added)); efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, hbx, - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(0, 160)), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(0, 160)), efl_ui_range_min_max_set(efl_added, 10, 145), efl_ui_slider_interval_value_set(efl_added, 50, 100), efl_ui_range_step_set(efl_added, step), @@ -93,7 +94,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void efl_pack(hbx, efl_added)); efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, hbx, - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(0, 160)), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(0, 160)), efl_ui_range_min_max_set(efl_added, 10, 145), efl_ui_slider_interval_value_set(efl_added, 50, 100), efl_ui_range_step_set(efl_added, step), @@ -107,7 +108,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void efl_pack(bx, efl_added)); efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, bx, - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(260, 0)), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(260, 0)), efl_ui_range_min_max_set(efl_added, 0, 600), efl_ui_slider_interval_value_set(efl_added, 100, 500), efl_ui_range_step_set(efl_added, step), diff --git a/src/bin/elementary/test_ui_spin.c b/src/bin/elementary/test_ui_spin.c index 85945a3101..7c606069aa 100644 --- a/src/bin/elementary/test_ui_spin.c +++ b/src/bin/elementary/test_ui_spin.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include static void @@ -37,7 +38,7 @@ test_ui_spin(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i Eo *win, *bx, *sp; win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl.Ui.Spin"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); diff --git a/src/bin/elementary/test_ui_spin_button.c b/src/bin/elementary/test_ui_spin_button.c index 0e008203c5..b6e4381dff 100644 --- a/src/bin/elementary/test_ui_spin_button.c +++ b/src/bin/elementary/test_ui_spin_button.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include #define NUM_OF_VALS 12 @@ -28,7 +29,7 @@ test_ui_spin_button(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void * eina_array_push(array, &values[i]); win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl.Ui.Spin_Button"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); diff --git a/src/bin/elementary/test_ui_stack.c b/src/bin/elementary/test_ui_stack.c index 1cb3041ce9..087e51f6ab 100644 --- a/src/bin/elementary/test_ui_stack.c +++ b/src/bin/elementary/test_ui_stack.c @@ -2,6 +2,7 @@ # include "elementary_config.h" #endif +#include #include static void _third_layout_push(void *data, const Efl_Event *ev EINA_UNUSED); diff --git a/src/bin/elementary/test_ui_tab_pager.c b/src/bin/elementary/test_ui_tab_pager.c index 84bef407af..c85b4b7fd2 100644 --- a/src/bin/elementary/test_ui_tab_pager.c +++ b/src/bin/elementary/test_ui_tab_pager.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include #define TAB_LABEL_COUNT 15 @@ -86,10 +87,12 @@ content_add(Eo *parent, char *text) snprintf(buf, sizeof(buf), "%s/objects/test_tab_pager.edj", elm_app_data_dir_get()); page = efl_add(EFL_UI_LAYOUT_CLASS, parent, - efl_file_set(efl_added, buf, "page_layout"), + efl_file_set(efl_added, buf), + efl_file_key_set(efl_added, "page_layout"), + efl_file_load(efl_added), 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_fill_set(efl_added, EINA_TRUE, EINA_TRUE)); + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE)); return page; } @@ -122,31 +125,32 @@ test_ui_tab_pager(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev 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_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_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_CLASS, win, - efl_file_set(efl_added, buf, "tab_page_layout"), + efl_file_set(efl_added, buf), + efl_file_key_set(efl_added, "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_gfx_hint_weight_set(navi, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + efl_gfx_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); + efl_gfx_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + efl_gfx_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_fill_set(efl_added, EINA_TRUE, EINA_TRUE), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), 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)); @@ -395,6 +399,7 @@ _unpack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) 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); + efl_del(tab_page); } static void @@ -443,6 +448,7 @@ _unpack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) 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_ui_widget_disabled_set(efl_added, EINA_TRUE), //Soon to be implemented efl_pack_end(box, efl_added)); /* Unpack */ @@ -455,6 +461,7 @@ _unpack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) 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_ui_widget_disabled_set(efl_added, EINA_TRUE), //Soon to be implemented efl_pack_end(box, efl_added)); in_box = efl_add(EFL_UI_BOX_CLASS, box, @@ -475,6 +482,7 @@ _unpack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) 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_ui_widget_disabled_set(efl_added, EINA_TRUE), //Soon to be implemented efl_pack_end(in_box, efl_added)); } diff --git a/src/bin/elementary/test_ui_table.c b/src/bin/elementary/test_ui_table.c index 9f1a20ef11..d11cefe43b 100644 --- a/src/bin/elementary/test_ui_table.c +++ b/src/bin/elementary/test_ui_table.c @@ -3,6 +3,7 @@ #endif #define EFL_PACK_LAYOUT_PROTECTED +#include #include static void _custom_layout_update(Eo *pack, void *_pd EINA_UNUSED); @@ -33,32 +34,32 @@ weights_cb(void *data, const Efl_Event *event) switch (mode) { case NONE: - efl_gfx_size_hint_align_set(table, 0.5, 0.5); - for (int i = 0; i < 7; i++) - efl_gfx_size_hint_weight_set(objects[i], 0, 0); + efl_gfx_hint_align_set(table, 0.5, 0.5); + for (int i = 1; i < 7; i++) + efl_gfx_hint_weight_set(objects[i], 0, 0); break; case NONE_BUT_FILL: - efl_gfx_size_hint_fill_set(table, EINA_TRUE, EINA_TRUE); - for (int i = 0; i < 7; i++) - efl_gfx_size_hint_weight_set(objects[i], 0, 0); + efl_gfx_hint_fill_set(table, EINA_TRUE, EINA_TRUE); + for (int i = 1; i < 7; i++) + efl_gfx_hint_weight_set(objects[i], 0, 0); break; case EQUAL: - efl_gfx_size_hint_align_set(table, 0.5, 0.5); - for (int i = 0; i < 7; i++) - efl_gfx_size_hint_weight_set(objects[i], 1, 1); + efl_gfx_hint_align_set(table, 0.5, 0.5); + for (int i = 1; i < 7; i++) + efl_gfx_hint_weight_set(objects[i], 1, 1); break; case ONE: - efl_gfx_size_hint_align_set(table, 0.5, 0.5); - for (int i = 0; i < 6; i++) - efl_gfx_size_hint_weight_set(objects[i], 0, 0); - efl_gfx_size_hint_weight_set(objects[6], 1, 1); + efl_gfx_hint_align_set(table, 0.5, 0.5); + for (int i = 1; i < 7; i++) + efl_gfx_hint_weight_set(objects[i], 0, 0); + efl_gfx_hint_weight_set(objects[2], 1, 1); break; case TWO: - efl_gfx_size_hint_align_set(table, 0.5, 0.5); - for (int i = 0; i < 5; i++) - efl_gfx_size_hint_weight_set(objects[i], 0, 0); - efl_gfx_size_hint_weight_set(objects[5], 1, 1); - efl_gfx_size_hint_weight_set(objects[6], 1, 1); + efl_gfx_hint_align_set(table, 0.5, 0.5); + for (int i = 1; i < 7; i++) + efl_gfx_hint_weight_set(objects[i], 0, 0); + efl_gfx_hint_weight_set(objects[2], 1, 1); + efl_gfx_hint_weight_set(objects[3], 1, 1); break; case CUSTOM: efl_object_override(table, &custom_layout_ops); @@ -71,7 +72,7 @@ user_min_slider_cb(void *data EINA_UNUSED, const Efl_Event *event) { int val = elm_slider_value_get(event->object); for (int i = 0; i < 6; i++) - efl_gfx_size_hint_min_set(objects[i], EINA_SIZE2D(val, val)); + efl_gfx_hint_size_min_set(objects[i], EINA_SIZE2D(val, val)); } static void @@ -85,15 +86,15 @@ static void margin_slider_cb(void *data, const Efl_Event *event) { int val = elm_slider_value_get(event->object); - efl_gfx_size_hint_margin_set(data, val, val, val, val); + efl_gfx_hint_margin_set(data, val, val, val, val); } static void -btnmargins_slider_cb(void *data, const Efl_Event *event) +btnmargins_slider_cb(void *data EINA_UNUSED, const Efl_Event *event) { int val = elm_slider_value_get(event->object); for (int i = 1; i < 7; i++) - efl_gfx_size_hint_margin_set(data, val, val, val, val); + efl_gfx_hint_margin_set(objects[i], val, val, val, val); } static void @@ -102,8 +103,8 @@ alignv_slider_cb(void *data EINA_UNUSED, const Efl_Event *event) double ax, val; val = elm_slider_value_get(event->object); - efl_gfx_size_hint_align_get(objects[1], &ax, NULL); - efl_gfx_size_hint_align_set(objects[1], ax, val); + efl_gfx_hint_align_get(objects[1], &ax, NULL); + efl_gfx_hint_align_set(objects[1], ax, val); } static void @@ -112,8 +113,8 @@ alignh_slider_cb(void *data EINA_UNUSED, const Efl_Event *event) double ay, val; val = elm_slider_value_get(event->object); - efl_gfx_size_hint_align_get(objects[1], NULL, &ay); - efl_gfx_size_hint_align_set(objects[1], val, ay); + efl_gfx_hint_align_get(objects[1], NULL, &ay); + efl_gfx_hint_align_set(objects[1], val, ay); } static void @@ -173,7 +174,7 @@ _custom_layout_update(Eo *pack, void *_pd EINA_UNUSED) 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); + m.size = efl_gfx_hint_size_combined_min_get(item); efl_gfx_entity_geometry_set(item, m); gmw = MAX(gmw, m.w); @@ -183,7 +184,7 @@ _custom_layout_update(Eo *pack, void *_pd EINA_UNUSED) eina_iterator_free(it); end: - efl_gfx_size_hint_min_set(pack, EINA_SIZE2D(gmw * cols, gmh * rows)); + efl_gfx_hint_size_min_set(pack, EINA_SIZE2D(gmw * cols, gmh * rows)); } void @@ -199,8 +200,8 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ 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_weight_set(vbox, 1, 1); - efl_gfx_size_hint_margin_set(vbox, 5, 5, 5, 5); + efl_gfx_hint_weight_set(vbox, 1, 1); + efl_gfx_hint_margin_set(vbox, 5, 5, 5, 5); elm_win_resize_object_add(win, vbox); @@ -211,8 +212,8 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ /* controls */ f = elm_frame_add(win); elm_object_text_set(f, "Controls"); - efl_gfx_size_hint_align_set(f, -1, -1); - efl_gfx_size_hint_weight_set(f, 1, 0); + efl_gfx_hint_align_set(f, -1, -1); + efl_gfx_hint_weight_set(f, 1, 0); efl_pack(vbox, f); efl_gfx_entity_visible_set(f, 1); @@ -225,14 +226,14 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ /* weights radio group */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, 0.5); - efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); + efl_gfx_hint_align_set(bx, 0, 0.5); + efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); efl_pack(hbox, bx); chk = o = elm_radio_add(win); elm_object_text_set(o, "No weight"); efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, table); - efl_gfx_size_hint_align_set(o, 0, 0.5); + efl_gfx_hint_align_set(o, 0, 0.5); elm_radio_state_value_set(o, NONE); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); @@ -240,7 +241,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ o = elm_radio_add(win); elm_object_text_set(o, "No weight + table fill"); efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, table); - efl_gfx_size_hint_align_set(o, 0, 0.5); + efl_gfx_hint_align_set(o, 0, 0.5); elm_radio_state_value_set(o, NONE_BUT_FILL); elm_radio_group_add(o, chk); efl_pack(bx, o); @@ -249,7 +250,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ o = elm_radio_add(win); elm_object_text_set(o, "Equal weights"); efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, table); - efl_gfx_size_hint_align_set(o, 0, 0.5); + efl_gfx_hint_align_set(o, 0, 0.5); elm_radio_state_value_set(o, EQUAL); elm_radio_group_add(o, chk); efl_pack(bx, o); @@ -258,7 +259,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ o = elm_radio_add(win); elm_object_text_set(o, "One weight only"); efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, table); - efl_gfx_size_hint_align_set(o, 0, 0.5); + efl_gfx_hint_align_set(o, 0, 0.5); elm_radio_state_value_set(o, ONE); elm_radio_group_add(o, chk); efl_pack(bx, o); @@ -267,7 +268,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ o = elm_radio_add(win); elm_object_text_set(o, "Two weights"); efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, table); - efl_gfx_size_hint_align_set(o, 0, 0.5); + efl_gfx_hint_align_set(o, 0, 0.5); elm_radio_state_value_set(o, TWO); elm_radio_group_add(o, chk); efl_pack(bx, o); @@ -276,7 +277,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ o = elm_radio_add(win); elm_object_text_set(o, "Custom layout"); efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, table); - efl_gfx_size_hint_align_set(o, 0, 0.5); + efl_gfx_hint_align_set(o, 0, 0.5); elm_radio_state_value_set(o, CUSTOM); elm_radio_group_add(o, chk); efl_pack(bx, o); @@ -288,8 +289,8 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ /* min size setter */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); - efl_gfx_size_hint_weight_set(bx, 0, 1); + efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); + efl_gfx_hint_weight_set(bx, 0, 1); efl_pack(hbox, bx); o = elm_label_add(win); @@ -301,8 +302,8 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ elm_slider_indicator_format_set(o, "%.0fpx"); elm_slider_indicator_show_set(o, 1); elm_slider_horizontal_set(o, 0); - efl_gfx_size_hint_align_set(o, 0.5, -1); - efl_gfx_size_hint_weight_set(o, 1, 1); + efl_gfx_hint_align_set(o, 0.5, -1); + efl_gfx_hint_weight_set(o, 1, 1); efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, user_min_slider_cb, NULL); elm_slider_min_max_set(o, 0, 250); elm_slider_inverted_set(o, 1); @@ -314,9 +315,9 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ /* inner box padding */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, 0.5); - efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); - efl_gfx_size_hint_weight_set(bx, 0, 1); + efl_gfx_hint_align_set(bx, 0, 0.5); + efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); + efl_gfx_hint_weight_set(bx, 0, 1); efl_pack(hbox, bx); o = elm_label_add(win); @@ -328,12 +329,12 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ elm_slider_indicator_format_set(o, "%.0fpx"); elm_slider_indicator_show_set(o, 1); elm_slider_horizontal_set(o, 0); - efl_gfx_size_hint_align_set(o, 0.5, -1); - efl_gfx_size_hint_weight_set(o, 1, 1); + efl_gfx_hint_align_set(o, 0.5, -1); + efl_gfx_hint_weight_set(o, 1, 1); efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, padding_slider_cb, table); elm_slider_min_max_set(o, 0, 40); elm_slider_inverted_set(o, 1); - elm_slider_value_set(o, 10); + elm_slider_value_set(o, 0); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); @@ -341,8 +342,8 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ /* outer margin */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); - efl_gfx_size_hint_weight_set(bx, 0, 1); + efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); + efl_gfx_hint_weight_set(bx, 0, 1); efl_pack(hbox, bx); o = elm_label_add(win); @@ -354,12 +355,12 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ elm_slider_indicator_format_set(o, "%.0fpx"); elm_slider_indicator_show_set(o, 1); elm_slider_horizontal_set(o, 0); - efl_gfx_size_hint_align_set(o, 0.5, -1); - efl_gfx_size_hint_weight_set(o, 1, 1); + efl_gfx_hint_align_set(o, 0.5, -1); + efl_gfx_hint_weight_set(o, 1, 1); efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, margin_slider_cb, table); elm_slider_min_max_set(o, 0, 40); elm_slider_inverted_set(o, 1); - elm_slider_value_set(o, 10); + elm_slider_value_set(o, 0); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); @@ -367,9 +368,9 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ /* button margins */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, 0.5); - efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); - efl_gfx_size_hint_weight_set(bx, 1, 1); + efl_gfx_hint_align_set(bx, 0, 0.5); + efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); + efl_gfx_hint_weight_set(bx, 1, 1); efl_pack(hbox, bx); o = elm_label_add(win); @@ -381,12 +382,12 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ elm_slider_indicator_format_set(o, "%.0fpx"); elm_slider_indicator_show_set(o, 1); elm_slider_horizontal_set(o, 0); - efl_gfx_size_hint_align_set(o, 0.5, -1); - efl_gfx_size_hint_weight_set(o, 1, 1); + efl_gfx_hint_align_set(o, 0.5, -1); + efl_gfx_hint_weight_set(o, 1, 1); efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, btnmargins_slider_cb, table); elm_slider_min_max_set(o, 0, 40); elm_slider_inverted_set(o, 1); - elm_slider_value_set(o, 10); + elm_slider_value_set(o, 0); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); @@ -394,9 +395,9 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ /* button1 aligns */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, 0.5); - efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); - efl_gfx_size_hint_weight_set(bx, 1, 1); + efl_gfx_hint_align_set(bx, 0, 0.5); + efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); + efl_gfx_hint_weight_set(bx, 1, 1); efl_pack(hbox, bx); o = elm_label_add(win); @@ -408,8 +409,8 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ elm_slider_indicator_format_set(o, "%.1f"); elm_slider_indicator_show_set(o, 1); elm_slider_horizontal_set(o, 0); - efl_gfx_size_hint_align_set(o, 0.5, -1); - efl_gfx_size_hint_weight_set(o, 1, 1); + efl_gfx_hint_align_set(o, 0.5, -1); + efl_gfx_hint_weight_set(o, 1, 1); efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignv_slider_cb, NULL); elm_slider_min_max_set(o, 0, 1); elm_slider_value_set(o, 0.3); @@ -420,8 +421,8 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ elm_slider_indicator_format_set(o, "%.1f"); elm_slider_indicator_show_set(o, 1); elm_slider_horizontal_set(o, 1); - efl_gfx_size_hint_align_set(o, -1, -1); - efl_gfx_size_hint_weight_set(o, 1, 0); + efl_gfx_hint_align_set(o, -1, -1); + efl_gfx_hint_weight_set(o, 1, 0); efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignh_slider_cb, NULL); elm_slider_min_max_set(o, 0, 1); elm_slider_value_set(o, 0.3); @@ -431,9 +432,9 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ /* ro info */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, 0.5); - efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); - efl_gfx_size_hint_weight_set(bx, 1, 1); + efl_gfx_hint_align_set(bx, 0, 0.5); + efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); + efl_gfx_hint_weight_set(bx, 1, 1); efl_pack(hbox, bx); o = elm_label_add(win); @@ -449,8 +450,8 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ o = elm_label_add(win); efl_event_callback_add(table, EFL_CONTAINER_EVENT_CONTENT_ADDED, child_evt_cb, o); efl_event_callback_add(table, EFL_CONTAINER_EVENT_CONTENT_REMOVED, child_evt_cb, o); - efl_gfx_size_hint_align_set(o, 0.5, 0); - efl_gfx_size_hint_weight_set(o, 1, 1); + efl_gfx_hint_align_set(o, 0.5, 0); + efl_gfx_hint_weight_set(o, 1, 1); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); @@ -458,61 +459,61 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ /* contents */ f = elm_frame_add(win); elm_object_text_set(f, "Contents"); - efl_gfx_size_hint_align_set(f, -1, -1); - efl_gfx_size_hint_weight_set(f, 1, 1); + efl_gfx_hint_align_set(f, -1, -1); + efl_gfx_hint_weight_set(f, 1, 1); efl_pack(vbox, f); efl_gfx_entity_visible_set(f, 1); - efl_gfx_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + efl_gfx_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_content_set(f, table); 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)); + efl_gfx_hint_size_min_set(o, EINA_SIZE2D(10, 10)); efl_gfx_color_set(o, 64, 96, 128, 255); efl_pack_table(table, o, 0, 0, 3, 1); objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table); efl_text_set(o, "Button 1"); - efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_gfx_size_hint_fill_set(o, EINA_TRUE, EINA_TRUE); - efl_gfx_size_hint_align_set(o, 0.3, 0.3); - efl_gfx_size_hint_max_set(o, EINA_SIZE2D(100, 100)); + efl_gfx_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + efl_gfx_hint_fill_set(o, EINA_TRUE, EINA_TRUE); + efl_gfx_hint_align_set(o, 0.3, 0.3); + efl_gfx_hint_size_max_set(o, EINA_SIZE2D(100, 100)); efl_pack_table(table, o, 0, 0, 1, 1); efl_gfx_entity_visible_set(o, 1); objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table); efl_text_set(o, "Button 2"); - efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_gfx_size_hint_fill_set(o, EINA_TRUE, EINA_TRUE); + efl_gfx_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + efl_gfx_hint_fill_set(o, EINA_TRUE, EINA_TRUE); efl_pack_table(table, o, 1, 0, 1, 1); efl_gfx_entity_visible_set(o, 1); objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table); efl_text_set(o, "Button 3"); - efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_gfx_size_hint_fill_set(o, EINA_TRUE, EINA_TRUE); + efl_gfx_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + efl_gfx_hint_fill_set(o, EINA_TRUE, EINA_TRUE); efl_pack_table(table, o, 2, 0, 1, 1); efl_gfx_entity_visible_set(o, 1); objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table); efl_text_set(o, "Button 4"); - efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_gfx_size_hint_fill_set(o, EINA_TRUE, EINA_TRUE); + efl_gfx_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + efl_gfx_hint_fill_set(o, EINA_TRUE, EINA_TRUE); efl_pack_table(table, o, 0, 1, 2, 1); efl_gfx_entity_visible_set(o, 1); objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table); efl_text_set(o, "Button 5"); - efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_gfx_size_hint_fill_set(o, EINA_TRUE, EINA_TRUE); + efl_gfx_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + efl_gfx_hint_fill_set(o, EINA_TRUE, EINA_TRUE); efl_pack_table(table, o, 2, 1, 1, 2); efl_gfx_entity_visible_set(o, 1); objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table); efl_text_set(o, "Button 6"); - efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_gfx_size_hint_fill_set(o, EINA_TRUE, EINA_TRUE); + efl_gfx_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + efl_gfx_hint_fill_set(o, EINA_TRUE, EINA_TRUE); efl_pack_table(table, o, 0, 2, 2, 1); efl_gfx_entity_visible_set(o, 1); @@ -540,11 +541,11 @@ append_cb(void *data, const Efl_Event *ev EINA_UNUSED) Eo *table = data; Eo *o = efl_add(EFL_UI_BUTTON_CLASS, table); efl_text_set(o, btn_text("appended")); - efl_gfx_size_hint_weight_set(o, 0, 0); - efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); + efl_gfx_hint_weight_set(o, 0, 0); + efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE); 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_pack(table, o); efl_gfx_entity_visible_set(o, 1); } @@ -568,7 +569,7 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 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); + efl_gfx_hint_margin_set(vbox, 5, 5, 5, 5); elm_win_resize_object_add(win, vbox); efl_gfx_entity_visible_set(vbox, 1); @@ -580,8 +581,8 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, /* controls */ f = elm_frame_add(win); elm_object_text_set(f, "Controls"); - efl_gfx_size_hint_align_set(f, -1, -1); - efl_gfx_size_hint_weight_set(f, 1, 0); + efl_gfx_hint_align_set(f, -1, -1); + efl_gfx_hint_weight_set(f, 1, 0); efl_pack(vbox, f); efl_gfx_entity_visible_set(f, 1); @@ -613,9 +614,9 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, /* ro info */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, 0.5); - efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); - efl_gfx_size_hint_weight_set(bx, 1, 1); + efl_gfx_hint_align_set(bx, 0, 0.5); + efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); + efl_gfx_hint_weight_set(bx, 1, 1); efl_pack(hbox, bx); efl_gfx_entity_visible_set(bx, 1); @@ -632,8 +633,8 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, o = elm_label_add(win); efl_event_callback_add(table, EFL_CONTAINER_EVENT_CONTENT_ADDED, child_evt_cb, o); efl_event_callback_add(table, EFL_CONTAINER_EVENT_CONTENT_REMOVED, child_evt_cb, o); - efl_gfx_size_hint_align_set(o, 0.5, 0); - efl_gfx_size_hint_weight_set(o, 1, 1); + efl_gfx_hint_align_set(o, 0.5, 0); + efl_gfx_hint_weight_set(o, 1, 1); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); @@ -641,37 +642,37 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, /* contents */ f = elm_frame_add(win); elm_object_text_set(f, "Contents"); - efl_gfx_size_hint_align_set(f, -1, -1); - efl_gfx_size_hint_weight_set(f, 1, 1); + efl_gfx_hint_align_set(f, -1, -1); + efl_gfx_hint_weight_set(f, 1, 1); efl_pack(vbox, f); 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); + efl_gfx_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_content_set(f, table); efl_gfx_entity_visible_set(table, 1); o = efl_add(EFL_UI_BUTTON_CLASS, table); efl_text_set(o, btn_text(NULL)); - efl_gfx_size_hint_weight_set(o, 0, 0); - efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); + efl_gfx_hint_weight_set(o, 0, 0); + efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE); efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL); efl_pack(table, o); efl_gfx_entity_visible_set(o, 1); o = efl_add(EFL_UI_BUTTON_CLASS, table); efl_text_set(o, btn_text(NULL)); - efl_gfx_size_hint_weight_set(o, 0, 0); - efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); + efl_gfx_hint_weight_set(o, 0, 0); + efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE); efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL); efl_pack(table, o); efl_gfx_entity_visible_set(o, 1); o = efl_add(EFL_UI_BUTTON_CLASS, table); efl_text_set(o, btn_text(NULL)); - efl_gfx_size_hint_weight_set(o, 0, 0); - efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); + efl_gfx_hint_weight_set(o, 0, 0); + efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE); efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL); efl_pack(table, o); efl_gfx_entity_visible_set(o, 1); diff --git a/src/bin/elementary/test_ui_table_static.c b/src/bin/elementary/test_ui_table_static.c index 369236fde7..d21d6b6c7d 100644 --- a/src/bin/elementary/test_ui_table_static.c +++ b/src/bin/elementary/test_ui_table_static.c @@ -2,6 +2,7 @@ # include "elementary_config.h" #endif +#include #include struct _Api_Data diff --git a/src/bin/elementary/test_ui_tags.c b/src/bin/elementary/test_ui_tags.c index 2c8b3e6fb5..410c7b24cd 100644 --- a/src/bin/elementary/test_ui_tags.c +++ b/src/bin/elementary/test_ui_tags.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include static void @@ -59,7 +60,7 @@ test_ui_tags(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_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_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl.Ui.Tags"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); diff --git a/src/bin/elementary/test_ui_textpath.c b/src/bin/elementary/test_ui_textpath.c index b865775b8d..0042f2b6a2 100644 --- a/src/bin/elementary/test_ui_textpath.c +++ b/src/bin/elementary/test_ui_textpath.c @@ -3,6 +3,7 @@ # include "elementary_config.h" #endif +#include #include #define CX 180 @@ -99,8 +100,8 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve box = elm_box_add(win); 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, EVAS_HINT_FILL, EVAS_HINT_FILL); + efl_gfx_hint_weight_set(box, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND); + efl_gfx_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); efl_gfx_entity_visible_set(box, EINA_TRUE); txtpath = efl_add(EFL_UI_TEXTPATH_CLASS, win); @@ -114,8 +115,8 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve 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, EVAS_HINT_FILL, EVAS_HINT_FILL); + efl_gfx_hint_weight_set(hbox, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND); + efl_gfx_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL); efl_gfx_entity_visible_set(hbox, EINA_TRUE); elm_box_pack_end(box, hbox); @@ -141,8 +142,8 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve 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, EVAS_HINT_FILL, EVAS_HINT_FILL); + efl_gfx_hint_weight_set(hbox, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND); + efl_gfx_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL); efl_gfx_entity_visible_set(hbox, EINA_TRUE); elm_box_pack_end(box, hbox); @@ -150,9 +151,9 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve elm_object_text_set(sld, "Angle"); elm_slider_min_max_set(sld, 0, 360); elm_slider_value_set(sld, 0); - efl_gfx_size_hint_align_set(sld, 0.5, EVAS_HINT_FILL); - efl_gfx_size_hint_weight_set(sld, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); - efl_gfx_size_hint_min_set(sld, EINA_SIZE2D(150, 0)); + efl_gfx_hint_align_set(sld, 0.5, EVAS_HINT_FILL); + efl_gfx_hint_weight_set(sld, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND); + efl_gfx_hint_size_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_entity_visible_set(sld, EINA_TRUE); @@ -162,9 +163,9 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve elm_object_text_set(sld, "Slice No"); elm_slider_min_max_set(sld, 20, 300); elm_slider_value_set(sld, 99); - efl_gfx_size_hint_align_set(sld, 0.5, EVAS_HINT_FILL); - efl_gfx_size_hint_weight_set(sld, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); - efl_gfx_size_hint_min_set(sld, EINA_SIZE2D(150, 0)); + efl_gfx_hint_align_set(sld, 0.5, EVAS_HINT_FILL); + efl_gfx_hint_weight_set(sld, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND); + efl_gfx_hint_size_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_entity_visible_set(sld, EINA_TRUE); @@ -172,8 +173,8 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve 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, EVAS_HINT_FILL, EVAS_HINT_FILL); + efl_gfx_hint_weight_set(hbox, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND); + efl_gfx_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL); efl_gfx_entity_visible_set(hbox, EINA_TRUE); elm_box_pack_end(box, hbox); diff --git a/src/bin/elementary/test_ui_timepicker.c b/src/bin/elementary/test_ui_timepicker.c index cb88ef508b..60464d0b00 100644 --- a/src/bin/elementary/test_ui_timepicker.c +++ b/src/bin/elementary/test_ui_timepicker.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include static void @@ -19,7 +20,7 @@ test_ui_timepicker(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e 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_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl.Ui.Timepicker"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); diff --git a/src/bin/elementary/test_win_dialog.c b/src/bin/elementary/test_win_dialog.c index 6858cf85a9..ef8a67b133 100644 --- a/src/bin/elementary/test_win_dialog.c +++ b/src/bin/elementary/test_win_dialog.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include static void @@ -29,21 +30,21 @@ _bt2_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_ Eina_Size2D size = { 300, 150 }; dia = efl_add(EFL_UI_WIN_CLASS, parent, - efl_ui_win_type_set(efl_added, EFL_UI_WIN_DIALOG_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_DIALOG_BASIC), efl_ui_win_name_set(efl_added, "window-dia-2"), efl_ui_win_autodel_set(efl_added, EINA_TRUE), efl_text_set(efl_added, "A Fixed Size Dialog")); // Notes: // - All objects have 0 weight, this makes the window not resizable. - // - With EO APIs, efl_gfx_size_hint_min_set() is safe to call as EFL will + // - With EO APIs, efl_gfx_hint_size_min_set() is safe to call as EFL will // only set the restricted min size (and combine them for calculation). lb = efl_add(EFL_UI_TEXT_CLASS, dia, efl_text_set(efl_added, "This is a non-resizable dialog."), - efl_gfx_size_hint_min_set(efl_added, size), - efl_gfx_size_hint_max_set(efl_added, size), - efl_gfx_size_hint_weight_set(efl_added, 0, 0)); + efl_gfx_hint_size_min_set(efl_added, size), + efl_gfx_hint_size_max_set(efl_added, size), + efl_gfx_hint_weight_set(efl_added, 0, 0)); // Swallow in the label as the default content, this will make it visible. efl_content_set(dia, lb); @@ -57,9 +58,9 @@ _size_update(void *data, const Efl_Event *ev) Eo *dia = ev->object; Eo *lbl = data; - 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); + cmin = efl_gfx_hint_size_combined_min_get(dia); + min = efl_gfx_hint_size_min_get(dia); + max = efl_gfx_hint_size_max_get(dia); sz = efl_gfx_entity_size_get(dia); sprintf(buf, "This is a dialog with min/max size
" @@ -76,24 +77,24 @@ _bt3_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_ Efl_Canvas_Object *dia, *lb, *parent = data; dia = efl_add(EFL_UI_WIN_CLASS, parent, - efl_ui_win_type_set(efl_added, EFL_UI_WIN_DIALOG_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_DIALOG_BASIC), efl_ui_win_name_set(efl_added, "window-dia-3"), efl_ui_win_autodel_set(efl_added, EINA_TRUE), efl_text_set(efl_added, "Min/Max Size Dialog")); //lb = efl_add(EFL_UI_TEXT_CLASS, dia);, lb = elm_label_add(dia); - 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); + efl_event_callback_add(dia, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _size_update, lb); + efl_event_callback_add(dia, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _size_update, lb); elm_object_text_set(lb, "This is a Dialog Window"); - efl_gfx_size_hint_weight_set(lb, 1.0, 1.0); + efl_gfx_hint_weight_set(lb, 1.0, 1.0); // Swallow in the label as the default content, this will make it visible. efl_content_set(dia, lb); // Set min & max size (app-side) - efl_gfx_size_hint_min_set(dia, EINA_SIZE2D(ELM_SCALE_SIZE(0), ELM_SCALE_SIZE(100))); - efl_gfx_size_hint_max_set(dia, EINA_SIZE2D(ELM_SCALE_SIZE(800), ELM_SCALE_SIZE(600))); + efl_gfx_hint_size_min_set(dia, EINA_SIZE2D(ELM_SCALE_SIZE(0), ELM_SCALE_SIZE(100))); + efl_gfx_hint_size_max_set(dia, EINA_SIZE2D(ELM_SCALE_SIZE(800), ELM_SCALE_SIZE(600))); } static void @@ -102,7 +103,7 @@ _bt4_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *even Efl_Canvas_Object *dia, *lb; dia = efl_add_ref(EFL_UI_WIN_CLASS, NULL, - efl_ui_win_type_set(efl_added, EFL_UI_WIN_DIALOG_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_DIALOG_BASIC), efl_ui_win_name_set(efl_added, "window-dia-4"), efl_ui_win_autodel_set(efl_added, EINA_TRUE), efl_text_set(efl_added, "Min/Max Size Dialog") @@ -110,17 +111,17 @@ _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_ENTITY_EVENT_CHANGE_SIZE_HINTS, _size_update, lb); - efl_event_callback_add(dia, EFL_GFX_ENTITY_EVENT_RESIZE, _size_update, lb); + efl_event_callback_add(dia, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _size_update, lb); + efl_event_callback_add(dia, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _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); + efl_gfx_hint_weight_set(lb, 1.0, 1.0); // Swallow in the label as the default content, this will make it visible. efl_content_set(dia, lb); // Set min & max size (app-side) - efl_gfx_size_hint_min_set(dia, EINA_SIZE2D(ELM_SCALE_SIZE(0), ELM_SCALE_SIZE(100))); - efl_gfx_size_hint_max_set(dia, EINA_SIZE2D(ELM_SCALE_SIZE(800), ELM_SCALE_SIZE(600))); + efl_gfx_hint_size_min_set(dia, EINA_SIZE2D(ELM_SCALE_SIZE(0), ELM_SCALE_SIZE(100))); + efl_gfx_hint_size_max_set(dia, EINA_SIZE2D(ELM_SCALE_SIZE(800), ELM_SCALE_SIZE(600))); efl_ui_win_center(dia, EINA_TRUE, EINA_TRUE); } diff --git a/src/bin/elementary/test_win_indicator.c b/src/bin/elementary/test_win_indicator.c index 99f54c589e..0ebb30bf0f 100644 --- a/src/bin/elementary/test_win_indicator.c +++ b/src/bin/elementary/test_win_indicator.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include static void @@ -38,8 +39,8 @@ _create_indicator(void) efl_content_set(win, efl_added)); efl_add(EFL_UI_CLOCK_CLASS, bx, - efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), - efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), + efl_gfx_hint_align_set(efl_added, 0.5, 0.5), efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_HOUR, EINA_FALSE), efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_MINUTE, EINA_FALSE), efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_AMPM, EINA_FALSE), @@ -56,25 +57,25 @@ _create_indicator(void) static void _off_clicked(void *data, const Efl_Event *ev EINA_UNUSED) { - efl_ui_win_indicator_mode_set(data, EFL_UI_WIN_INDICATOR_OFF); + efl_ui_win_indicator_mode_set(data, EFL_UI_WIN_INDICATOR_MODE_OFF); } static void _opaque_clicked(void *data, const Efl_Event *ev EINA_UNUSED) { - efl_ui_win_indicator_mode_set(data, EFL_UI_WIN_INDICATOR_BG_OPAQUE); + efl_ui_win_indicator_mode_set(data, EFL_UI_WIN_INDICATOR_MODE_BG_OPAQUE); } static void _transparent_clicked(void *data, const Efl_Event *ev EINA_UNUSED) { - efl_ui_win_indicator_mode_set(data, EFL_UI_WIN_INDICATOR_BG_TRANSPARENT); + efl_ui_win_indicator_mode_set(data, EFL_UI_WIN_INDICATOR_MODE_BG_TRANSPARENT); } static void _hidden_clicked(void *data, const Efl_Event *ev EINA_UNUSED) { - efl_ui_win_indicator_mode_set(data, EFL_UI_WIN_INDICATOR_HIDDEN); + efl_ui_win_indicator_mode_set(data, EFL_UI_WIN_INDICATOR_MODE_HIDDEN); } static void @@ -92,15 +93,15 @@ test_win_indicator(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e // FIXME: Resizing window should no cause sizing issues! win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl.Win.Indicator"), - efl_gfx_size_hint_max_set(efl_added, EINA_SIZE2D(300, -1)), + efl_gfx_hint_size_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_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)), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(300, 0)), efl_content_set(win, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, win, diff --git a/src/bin/elementary/test_win_inline.c b/src/bin/elementary/test_win_inline.c index 5209b20014..122f2d474d 100644 --- a/src/bin/elementary/test_win_inline.c +++ b/src/bin/elementary/test_win_inline.c @@ -1,6 +1,7 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif +#include #include static void @@ -235,7 +236,7 @@ test_win_inline(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *even elm_win_alpha_set(win2, EINA_TRUE); evas_object_size_hint_weight_set(elm_win_inlined_image_object_get(win2), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(elm_win_inlined_image_object_get(win2), EVAS_HINT_FILL, EVAS_HINT_FILL); - efl_gfx_size_hint_margin_set(elm_win_inlined_image_object_get(win2), 20, 20, 20, 20); + efl_gfx_hint_margin_set(elm_win_inlined_image_object_get(win2), 20, 20, 20, 20); efl_pack(box, elm_win_inlined_image_object_get(win2)); evas_object_resize(win2, 300, 200); diff --git a/src/bin/elementary/test_win_plug.c b/src/bin/elementary/test_win_plug.c index 867e5c4003..615e6fa8d5 100644 --- a/src/bin/elementary/test_win_plug.c +++ b/src/bin/elementary/test_win_plug.c @@ -4,7 +4,7 @@ #include // FIXME: use smart cb -#include "elm_notify.eo.h" +#include "elm_notify_eo.h" #define MAX_TRY 40 diff --git a/src/bin/elementary/test_win_stack.c b/src/bin/elementary/test_win_stack.c index d13072d041..c16c07b037 100644 --- a/src/bin/elementary/test_win_stack.c +++ b/src/bin/elementary/test_win_stack.c @@ -4,6 +4,7 @@ // Stack API is still beta (and EO only) #define EFL_UI_WIN_BETA +#include #include static int level = 0; @@ -20,13 +21,13 @@ _win_new(Evas_Object *stack_top, const char *title) if (level >= 3) 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_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_NAVIFRAME_BASIC), efl_text_set(efl_added, title), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); else 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_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_DIALOG_BASIC), efl_text_set(efl_added, title), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); diff --git a/src/bin/elementary/test_win_state.c b/src/bin/elementary/test_win_state.c index b4d084e733..f1b9af34cc 100644 --- a/src/bin/elementary/test_win_state.c +++ b/src/bin/elementary/test_win_state.c @@ -263,39 +263,39 @@ _bt_pressed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) { case 1: printf("Top Left\n"); - res = elm_win_move_resize_start(win, EFL_UI_WIN_MOVE_RESIZE_TOP | EFL_UI_WIN_MOVE_RESIZE_LEFT); + res = elm_win_move_resize_start(win, ELM_WIN_MOVE_RESIZE_TOP | ELM_WIN_MOVE_RESIZE_LEFT); break; case 2: printf("Top\n"); - res = elm_win_move_resize_start(win, EFL_UI_WIN_MOVE_RESIZE_TOP); + res = elm_win_move_resize_start(win, ELM_WIN_MOVE_RESIZE_TOP); break; case 3: printf("Top Right\n"); - res = elm_win_move_resize_start(win, EFL_UI_WIN_MOVE_RESIZE_TOP | EFL_UI_WIN_MOVE_RESIZE_RIGHT); + res = elm_win_move_resize_start(win, ELM_WIN_MOVE_RESIZE_TOP | ELM_WIN_MOVE_RESIZE_RIGHT); break; case 4: printf("Left\n"); - res = elm_win_move_resize_start(win, EFL_UI_WIN_MOVE_RESIZE_LEFT); + res = elm_win_move_resize_start(win, ELM_WIN_MOVE_RESIZE_LEFT); break; case 5: printf("Move win\n"); - res = elm_win_move_resize_start(win, EFL_UI_WIN_MOVE_RESIZE_MOVE); + res = elm_win_move_resize_start(win, ELM_WIN_MOVE_RESIZE_MOVE); break; case 6: printf("Right\n"); - res = elm_win_move_resize_start(win, EFL_UI_WIN_MOVE_RESIZE_RIGHT); + res = elm_win_move_resize_start(win, ELM_WIN_MOVE_RESIZE_RIGHT); break; case 7: printf("Bottom Left\n"); - res = elm_win_move_resize_start(win, EFL_UI_WIN_MOVE_RESIZE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_LEFT); + res = elm_win_move_resize_start(win, ELM_WIN_MOVE_RESIZE_BOTTOM | ELM_WIN_MOVE_RESIZE_LEFT); break; case 8: printf("Bottom\n"); - res = elm_win_move_resize_start(win, EFL_UI_WIN_MOVE_RESIZE_BOTTOM); + res = elm_win_move_resize_start(win, ELM_WIN_MOVE_RESIZE_BOTTOM); break; case 9: printf("Bottom Right\n"); - res = elm_win_move_resize_start(win, EFL_UI_WIN_MOVE_RESIZE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_RIGHT); + res = elm_win_move_resize_start(win, ELM_WIN_MOVE_RESIZE_BOTTOM | ELM_WIN_MOVE_RESIZE_RIGHT); break; default: printf("No action\n"); diff --git a/src/bin/elua/meson.build b/src/bin/elua/meson.build index 3a4908d754..a43eca2766 100644 --- a/src/bin/elua/meson.build +++ b/src/bin/elua/meson.build @@ -1,5 +1,6 @@ executable('elua', 'main.c', dependencies: [eina, ecore, elua, intl], + link_args : bin_linker_args, install: true, ) diff --git a/src/bin/embryo/embryo_cc_sc.h b/src/bin/embryo/embryo_cc_sc.h index d088d0cd3b..f6271afec0 100644 --- a/src/bin/embryo/embryo_cc_sc.h +++ b/src/bin/embryo/embryo_cc_sc.h @@ -156,7 +156,7 @@ typedef struct __s_symbol /* Possible entries for "usage" * - * This byte is used as a serie of bits, the syntax is different for + * This byte is used as a series of bits, the syntax is different for * functions and other symbols: * * VARIABLE diff --git a/src/bin/eolian/docs.c b/src/bin/eolian/docs.c index 60ccf1b1b2..39fa89a429 100644 --- a/src/bin/eolian/docs.c +++ b/src/bin/eolian/docs.c @@ -28,6 +28,13 @@ _generate_ref(const Eolian_State *state, const char *refn, Eina_Strbuf *wbuf, char *n = strdup(eolian_object_name_get(decl)); char *p = n; while ((p = strchr(p, '.'))) *p = '_'; + if (eolian_object_type_get(decl) == EOLIAN_OBJECT_VARIABLE) + { + const Eolian_Variable *v = (const Eolian_Variable *)decl; + /* constants are emitted as macros */ + if (eolian_variable_type_get(v) == EOLIAN_VAR_CONSTANT) + eina_str_toupper(&n); + } eina_strbuf_append(wbuf, n); free(n); return; @@ -104,7 +111,7 @@ _generate_ref(const Eolian_State *state, const char *refn, Eina_Strbuf *wbuf, if (!fn) goto noref; - Eina_Stringshare *fcn = eolian_function_full_c_name_get(fn, ftype, use_legacy); + Eina_Stringshare *fcn = eolian_function_full_c_name_get(fn, ftype); if (!fcn) goto noref; eina_strbuf_append(wbuf, fcn); eina_stringshare_del(fcn); @@ -401,8 +408,7 @@ eo_gen_docs_event_gen(const Eolian_State *state, const Eolian_Event *ev, 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) + Eolian_Function_Type ftype, int indent) { const Eolian_Function_Parameter *par = NULL; const Eolian_Function_Parameter *vpar = NULL; @@ -420,28 +426,7 @@ eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid, int curl = 0; - const char *group = NULL; - char legacy_group_name[1024]; - if (use_legacy) - { - // Generate legacy doxygen group name - const char *prefix = - eolian_class_legacy_prefix_get(eolian_function_class_get(fid)); - unsigned int i; - snprintf(legacy_group_name, sizeof(legacy_group_name), - "%s_Group", prefix); - for (i = 0; i < strlen(legacy_group_name); i++) - { - if ((i == 0) || (legacy_group_name[i - 1] == '_')) - legacy_group_name[i] = toupper(legacy_group_name[i]); - } - group = legacy_group_name; - } - else - { - group = eolian_class_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); if (ftype == EOLIAN_METHOD) @@ -532,7 +517,7 @@ eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid, if (!desc && !par && !vpar && !rdoc && (ftype == EOLIAN_METHOD || !pdoc)) { _gen_doc_brief(state, sum ? sum : "No description supplied.", since, group, - NULL, indent, buf, use_legacy); + NULL, indent, buf, EINA_FALSE); return buf; } @@ -543,7 +528,7 @@ eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid, eina_strbuf_append(buf, " * @brief "); curl += sizeof(" * @brief ") - 1; _append_section(state, sum ? sum : "No description supplied.", - indent, curl, buf, wbuf, use_legacy); + indent, curl, buf, wbuf, EINA_FALSE); eina_strbuf_append_char(buf, '\n'); if (desc || since || par || rdoc || pdoc) @@ -556,7 +541,7 @@ eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid, { curl = _indent_line(buf, indent); eina_strbuf_append(buf, " * "); - _append_section(state, desc, indent, curl + 3, buf, wbuf, use_legacy); + _append_section(state, desc, indent, curl + 3, buf, wbuf, EINA_FALSE); eina_strbuf_append_char(buf, '\n'); if (par || rdoc || pdoc || since) { @@ -571,7 +556,7 @@ eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid, curl = _indent_line(buf, indent); eina_strbuf_append(buf, " * "); _append_section(state, eolian_documentation_summary_get(pdoc), indent, - curl + 3, buf, wbuf, use_legacy); + curl + 3, buf, wbuf, EINA_FALSE); eina_strbuf_append_char(buf, '\n'); if (pdesc) { @@ -579,7 +564,7 @@ eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid, eina_strbuf_append(buf, " *\n"); curl = _indent_line(buf, indent); eina_strbuf_append(buf, " * "); - _append_section(state, pdesc, indent, curl + 3, buf, wbuf, use_legacy); + _append_section(state, pdesc, indent, curl + 3, buf, wbuf, EINA_FALSE); eina_strbuf_append_char(buf, '\n'); } if (par || rdoc || since) @@ -634,7 +619,7 @@ eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid, eina_strbuf_append_char(buf, ' '); curl += 1; _append_section(state, eolian_documentation_summary_get(adoc), - indent, curl, buf, wbuf, use_legacy); + indent, curl, buf, wbuf, EINA_FALSE); } eina_strbuf_append_char(buf, '\n'); @@ -667,7 +652,7 @@ eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid, eina_strbuf_append(buf, " * @return "); curl += sizeof(" * @return ") - 1; _append_section(state, eolian_documentation_summary_get(rdoc), indent, - curl, buf, wbuf, use_legacy); + curl, buf, wbuf, EINA_FALSE); eina_strbuf_append_char(buf, '\n'); if (since) { diff --git a/src/bin/eolian/docs.h b/src/bin/eolian/docs.h index 79112f9758..91866ec012 100644 --- a/src/bin/eolian/docs.h +++ b/src/bin/eolian/docs.h @@ -22,12 +22,11 @@ Eina_Strbuf *eo_gen_docs_full_gen(const Eolian_State *state, const Eolian_Docume * @param[in] fid te function * @param[in] type the function type (either METHOD, PROP_GET, PROP_SET) * @param[in] indent by how many spaces to indent the comment from second line - * @param[in] use_legacy whether to use legacy names * * @return A documentation comment * */ -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); +Eina_Strbuf *eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid, Eolian_Function_Type ftype, int indent); /* * @brief Generate event documentation diff --git a/src/bin/eolian/headers.c b/src/bin/eolian/headers.c index 4ebf9a7fdd..cc3b0ee293 100644 --- a/src/bin/eolian/headers.c +++ b/src/bin/eolian/headers.c @@ -67,10 +67,9 @@ eo_gen_params(Eina_Iterator *itr, Eina_Strbuf *buf, static void _gen_func(const Eolian_State *state, const Eolian_Function *fid, - Eolian_Function_Type ftype, Eina_Strbuf *buf, char *cname, - char *cnameu, Eina_Bool legacy) + Eolian_Function_Type ftype, Eina_Strbuf *buf, char *cnameu) { - Eina_Stringshare *fcn = eolian_function_full_c_name_get(fid, ftype, legacy); + Eina_Stringshare *fcn = eolian_function_full_c_name_get(fid, ftype); if (!fcn) return; @@ -90,11 +89,9 @@ _gen_func(const Eolian_State *state, const Eolian_Function *fid, Eolian_Object_Scope fsc = eolian_function_scope_get(fid, ftype); - /* this one will never be satisfied in legacy */ if (eolian_function_is_beta(fid)) - eina_strbuf_append_printf(buf, "#ifdef %s_BETA\n", cnameu); - /* XXX: is this right? we expose potentially internal stuff into legacy */ - if (!legacy && (fsc == EOLIAN_SCOPE_PROTECTED)) + eina_strbuf_append(buf, "#ifdef EFL_BETA_API_SUPPORT\n"); + if (fsc == EOLIAN_SCOPE_PROTECTED) eina_strbuf_append_printf(buf, "#ifdef %s_PROTECTED\n", cnameu); const Eolian_Implement *fimp = eolian_function_implement_get(fid); @@ -104,12 +101,12 @@ _gen_func(const Eolian_State *state, const Eolian_Function *fid, hasdoc = !!eolian_implement_documentation_get(fimp, EOLIAN_PROPERTY); if (hasdoc) { - Eina_Strbuf *dbuf = eo_gen_docs_func_gen(state, fid, ftype, 0, legacy); + Eina_Strbuf *dbuf = eo_gen_docs_func_gen(state, fid, ftype, 0); eina_strbuf_append(buf, eina_strbuf_string_get(dbuf)); eina_strbuf_append_char(buf, '\n'); eina_strbuf_free(dbuf); } - eina_strbuf_append(buf, legacy ? "EAPI " : "EOAPI "); + eina_strbuf_append(buf, "EOAPI "); if (rtp) { Eina_Stringshare *rtps = eolian_type_c_type_get(rtp, EOLIAN_C_TYPE_RETURN); @@ -125,7 +122,7 @@ _gen_func(const Eolian_State *state, const Eolian_Function *fid, eina_stringshare_del(fcn); Eina_Strbuf *flagbuf = NULL; - int nidx = !legacy || !eolian_function_is_class(fid); + int nidx = !eolian_function_is_class(fid); eina_strbuf_append_char(buf, '('); if (nidx) @@ -135,10 +132,7 @@ _gen_func(const Eolian_State *state, const Eolian_Function *fid, { eina_strbuf_append(buf, "const "); } - if (legacy) - eina_strbuf_append_printf(buf, "%s *obj", cname); - else - eina_strbuf_append(buf, "Eo *obj"); + eina_strbuf_append(buf, "Eo *obj"); } eo_gen_params(eolian_property_keys_get(fid, ftype), buf, &flagbuf, &nidx, EOLIAN_PROPERTY); @@ -174,131 +168,129 @@ _gen_func(const Eolian_State *state, const Eolian_Function *fid, } eina_strbuf_append(buf, ";\n"); + if (fsc == EOLIAN_SCOPE_PROTECTED) + eina_strbuf_append_printf(buf, "#endif\n"); if (eolian_function_is_beta(fid)) - eina_strbuf_append_printf(buf, "#endif\n"); - if (!legacy && (fsc == EOLIAN_SCOPE_PROTECTED)) - eina_strbuf_append_printf(buf, "#endif\n"); + eina_strbuf_append_printf(buf, "#endif /* EFL_BETA_API_SUPPORT */\n"); } void eo_gen_header_gen(const Eolian_State *state, const Eolian_Class *cl, Eina_Strbuf *buf, Eina_Bool legacy) { - if (!cl) + if (!cl || legacy) return; - char *cname = NULL, *cnameu = NULL; - eo_gen_class_names_get(cl, &cname, &cnameu, NULL); + Eina_Iterator *itr; + Eolian_Event *ev; + char *cnameu = NULL; + eo_gen_class_names_get(cl, NULL, &cnameu, NULL); /* class definition */ - if (!legacy) + if (eolian_class_is_beta(cl)) { - const Eolian_Documentation *doc = eolian_class_documentation_get(cl); - if (doc) + eina_strbuf_append(buf, "#ifdef EFL_BETA_API_SUPPORT\n"); + } + const Eolian_Documentation *doc = eolian_class_documentation_get(cl); + if (doc) + { + Eina_Strbuf *cdoc = eo_gen_docs_full_gen(state, doc, + eolian_class_name_get(cl), 0, EINA_FALSE); + if (cdoc) { - 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)); - eina_strbuf_append_char(buf, '\n'); - eina_strbuf_free(cdoc); - } + eina_strbuf_append(buf, eina_strbuf_string_get(cdoc)); + eina_strbuf_append_char(buf, '\n'); + eina_strbuf_free(cdoc); } - - Eina_Stringshare *mname = eolian_class_c_name_get(cl); - Eina_Stringshare *gname = eolian_class_c_get_function_name_get(cl); - eina_strbuf_append_printf(buf, "#define %s %s()\n\n", mname, gname); - eina_stringshare_del(mname); - - eina_strbuf_append_printf(buf, "EWAPI const Efl_Class *%s(void);\n", gname); - eina_stringshare_del(gname); } - /* method section */ - { - Eina_Iterator *itr = eolian_class_implements_get(cl); - if (!itr) - goto events; + Eina_Stringshare *mname = eolian_class_c_name_get(cl); + Eina_Stringshare *gname = eolian_class_c_get_function_name_get(cl); + eina_strbuf_append_printf(buf, "#define %s %s()\n\n", mname, gname); + eina_stringshare_del(mname); - const Eolian_Implement *imp; - EINA_ITERATOR_FOREACH(itr, imp) - { - if (eolian_implement_class_get(imp) != cl) - continue; - Eolian_Function_Type ftype = EOLIAN_UNRESOLVED; - const Eolian_Function *fid = eolian_implement_function_get(imp, &ftype); - /* beta can only exist for eo api */ - if (legacy && eolian_function_is_beta(fid)) - continue; - eina_strbuf_append_char(buf, '\n'); - switch (ftype) - { - case EOLIAN_PROP_GET: - case EOLIAN_PROP_SET: - _gen_func(state, fid, ftype, buf, cname, cnameu, legacy); - break; - case EOLIAN_PROPERTY: - _gen_func(state, fid, EOLIAN_PROP_SET, buf, cname, cnameu, legacy); - eina_strbuf_append_char(buf, '\n'); - _gen_func(state, fid, EOLIAN_PROP_GET, buf, cname, cnameu, legacy); - break; - default: - _gen_func(state, fid, EOLIAN_METHOD, buf, cname, cnameu, legacy); - } - } - eina_iterator_free(itr); - } + eina_strbuf_append_printf(buf, "EWAPI const Efl_Class *%s(void);\n", gname); + eina_stringshare_del(gname); + + /* method section */ + itr = eolian_class_implements_get(cl); + if (!itr) + goto events; + + const Eolian_Implement *imp; + EINA_ITERATOR_FOREACH(itr, imp) + { + if (eolian_implement_class_get(imp) != cl) + continue; + Eolian_Function_Type ftype = EOLIAN_UNRESOLVED; + const Eolian_Function *fid = eolian_implement_function_get(imp, &ftype); + eina_strbuf_append_char(buf, '\n'); + switch (ftype) + { + case EOLIAN_PROP_GET: + case EOLIAN_PROP_SET: + _gen_func(state, fid, ftype, buf, cnameu); + break; + case EOLIAN_PROPERTY: + _gen_func(state, fid, EOLIAN_PROP_SET, buf, cnameu); + eina_strbuf_append_char(buf, '\n'); + _gen_func(state, fid, EOLIAN_PROP_GET, buf, cnameu); + break; + default: + _gen_func(state, fid, EOLIAN_METHOD, buf, cnameu); + } + } + eina_iterator_free(itr); events: /* event section */ - if (!legacy) + itr = eolian_class_events_get(cl); + EINA_ITERATOR_FOREACH(itr, ev) { - Eina_Iterator *itr = eolian_class_events_get(cl); - Eolian_Event *ev; - EINA_ITERATOR_FOREACH(itr, ev) + Eina_Stringshare *evn = eolian_event_c_name_get(ev); + Eolian_Object_Scope evs = eolian_event_scope_get(ev); + + if (evs == EOLIAN_SCOPE_PRIVATE) + continue; + + if (eolian_event_is_beta(ev)) { - Eina_Stringshare *evn = eolian_event_c_name_get(ev); - Eolian_Object_Scope evs = eolian_event_scope_get(ev); - - if (evs == EOLIAN_SCOPE_PRIVATE) - continue; - - if (eolian_event_is_beta(ev)) - { - eina_strbuf_append_printf(buf, "\n#ifdef %s_BETA\n", cnameu); - } - if (evs == EOLIAN_SCOPE_PROTECTED) - { - if (!eolian_event_is_beta(ev)) - eina_strbuf_append_char(buf, '\n'); - eina_strbuf_append_printf(buf, "#ifdef %s_PROTECTED\n", cnameu); - } - - if (!eolian_event_is_beta(ev) && evs == EOLIAN_SCOPE_PUBLIC) - eina_strbuf_append_char(buf, '\n'); - - eina_strbuf_append_printf(buf, "EWAPI extern const " - "Efl_Event_Description _%s;\n\n", evn); - - 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); - eina_strbuf_append_printf(buf, "#define %s (&(_%s))\n", evn, evn); - - if (evs == EOLIAN_SCOPE_PROTECTED) - eina_strbuf_append(buf, "#endif\n"); - if (eolian_event_is_beta(ev)) - eina_strbuf_append(buf, "#endif\n"); - - eina_stringshare_del(evn); + eina_strbuf_append(buf, "#ifdef EFL_BETA_API_SUPPORT\n"); } - eina_iterator_free(itr); + if (evs == EOLIAN_SCOPE_PROTECTED) + { + if (!eolian_event_is_beta(ev)) + eina_strbuf_append_char(buf, '\n'); + eina_strbuf_append_printf(buf, "#ifdef %s_PROTECTED\n", cnameu); + } + + if (!eolian_event_is_beta(ev) && evs == EOLIAN_SCOPE_PUBLIC) + eina_strbuf_append_char(buf, '\n'); + + eina_strbuf_append_printf(buf, "EWAPI extern const " + "Efl_Event_Description _%s;\n\n", evn); + + 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); + eina_strbuf_append_printf(buf, "#define %s (&(_%s))\n", evn, evn); + + if (evs == EOLIAN_SCOPE_PROTECTED) + eina_strbuf_append(buf, "#endif\n"); + if (eolian_event_is_beta(ev)) + eina_strbuf_append(buf, "#endif /* EFL_BETA_API_SUPPORT */\n"); + + eina_stringshare_del(evn); + } + eina_iterator_free(itr); + + if (eolian_class_is_beta(cl)) + { + eina_strbuf_append(buf, "#endif /* EFL_BETA_API_SUPPORT */\n"); } - free(cname); free(cnameu); } diff --git a/src/bin/eolian/main.c b/src/bin/eolian/main.c index 95d81a7e04..06f32fd418 100644 --- a/src/bin/eolian/main.c +++ b/src/bin/eolian/main.c @@ -15,12 +15,13 @@ enum GEN_H_STUB = 1 << 2, GEN_C = 1 << 3, GEN_C_IMPL = 1 << 4, - GEN_D = 1 << 5 + GEN_D = 1 << 5, + GEN_D_FULL = 1 << 6 }; -static const char *_dexts[6] = +static const char *_dexts[7] = { - ".h", ".legacy.h", ".stub.h", ".c", ".c", ".d" + ".h", ".legacy.h", ".stub.h", ".c", ".c", ".d", ".d" }; static int @@ -51,7 +52,8 @@ _print_usage(const char *progn, FILE *outf) " s: Stub C header file (.eo.stub.h/.eot.stub.h)\n" " c: C source file (.eo.c)\n" " i: Implementation file (.c, merged with existing)\n" - " d: Make-style dependencies (.d)\n" + " d: Make-style dependencies, only for headers (.d)\n" + " D: Like 'd' but for all generated files (.d)\n" "\n" "By default, the 'hc' set is used ('h' for .eot files).\n\n" "The system-wide Eolian directory is scanned for eo files\n" @@ -103,6 +105,11 @@ _try_set_out(char t, char **outs, const char *val, int *what) case 'd': pos = _get_bit_pos(GEN_D); *what |= GEN_D; + break; + case 'D': + pos = _get_bit_pos(GEN_D_FULL); + *what |= GEN_D_FULL; + break; } if (pos < 0) return EINA_FALSE; @@ -389,21 +396,21 @@ _write_source(const Eolian_State *eos, const char *ofname, { INF("generating source: %s", ofname); Eina_Strbuf *buf = eina_strbuf_new(); + Eina_Bool ret = EINA_FALSE; 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)) - { - eina_strbuf_free(buf); - return EINA_TRUE; - } + if (!_write_file(ofname, buf)) + goto done; + ret = EINA_TRUE; } +done: eina_strbuf_free(buf); - return EINA_FALSE; + return ret; } static Eina_Bool @@ -471,8 +478,12 @@ _write_deps(const Eolian_State *eos, const char *ofname, const char *ifname, _append_dep_line(buf, dbuf, outs, gen_what, GEN_H); _append_dep_line(buf, dbuf, outs, gen_what, GEN_H_LEGACY); _append_dep_line(buf, dbuf, outs, gen_what, GEN_H_STUB); - _append_dep_line(buf, dbuf, outs, gen_what, GEN_C); - _append_dep_line(buf, dbuf, outs, gen_what, GEN_C_IMPL); + + if (gen_what & GEN_D_FULL) + { + _append_dep_line(buf, dbuf, outs, gen_what, GEN_C); + _append_dep_line(buf, dbuf, outs, gen_what, GEN_C_IMPL); + } ret = _write_file(ofname, buf); result: @@ -486,7 +497,9 @@ main(int argc, char **argv) { int pret = 1; - char *outs[6] = { NULL, NULL, NULL, NULL, NULL, NULL }; + char *outs[sizeof(_dexts) / sizeof(void *)] = { + NULL, NULL, NULL, NULL, NULL, NULL, NULL + }; char *basen = NULL; Eina_List *includes = NULL; @@ -542,6 +555,9 @@ main(int argc, char **argv) case 'd': gen_what |= GEN_D; break; + case 'D': + gen_what |= GEN_D_FULL; + break; default: fprintf(stderr, "unknown type: '%c'\n", *wstr); goto end; @@ -639,7 +655,10 @@ main(int argc, char **argv) succ = _write_source(eos, outs[_get_bit_pos(GEN_C)], eobn, !strcmp(ext, ".eot")); if (succ && (gen_what & GEN_C_IMPL)) succ = _write_impl(eos, outs[_get_bit_pos(GEN_C_IMPL)], eobn); - if (succ && (gen_what & GEN_D)) + + if (succ && (gen_what & GEN_D_FULL)) + succ = _write_deps(eos, outs[_get_bit_pos(GEN_D_FULL)], eobn, outs, gen_what); + else if (succ && (gen_what & GEN_D)) succ = _write_deps(eos, outs[_get_bit_pos(GEN_D)], eobn, outs, gen_what); if (!succ) diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c index d80ca74abe..265dc75d92 100644 --- a/src/bin/eolian/sources.c +++ b/src/bin/eolian/sources.c @@ -194,11 +194,6 @@ _generate_iterative_free(Eina_Strbuf **buf, const Eolian_Type *type, const Eolia //generate the field definition 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) - { - eina_strbuf_append(*buf, "*"); - } eina_strbuf_append_buffer(*buf, iter_param); eina_strbuf_append(*buf, ";\n"); @@ -212,24 +207,6 @@ _generate_iterative_free(Eina_Strbuf **buf, const Eolian_Type *type, const Eolia eina_strbuf_append(*buf, ")\n"); _generate_loop_content(buf, inner_type, iter_param); } - else if (t == EOLIAN_TYPE_BUILTIN_INARRAY) - { - eina_strbuf_append_printf(*buf, " EINA_INARRAY_FOREACH("); - eina_strbuf_append_buffer(*buf, param); - eina_strbuf_append_char(*buf, ','); - eina_strbuf_append_buffer(*buf, iter_param); - eina_strbuf_append(*buf, ")\n"); - _generate_loop_content(buf, inner_type, iter_param); - } - else if (t == EOLIAN_TYPE_BUILTIN_INLIST) - { - eina_strbuf_append_printf(*buf, " EINA_INLIST_FREE("); - eina_strbuf_append_buffer(*buf, param); - eina_strbuf_append_char(*buf, ','); - eina_strbuf_append_buffer(*buf, iter_param); - eina_strbuf_append(*buf, ")\n"); - _generate_loop_content(buf, inner_type, iter_param); - } else if (t == EOLIAN_TYPE_BUILTIN_ITERATOR) { eina_strbuf_append_printf(*buf, " EINA_ITERATOR_FOREACH("); @@ -258,6 +235,18 @@ _generate_iterative_free(Eina_Strbuf **buf, const Eolian_Type *type, const Eolia eina_strbuf_append_buffer(*buf, param); eina_strbuf_append(*buf, ");\n"); } + else if (t == EOLIAN_TYPE_BUILTIN_ARRAY) + { + eina_strbuf_append_printf(*buf, " while(("); + eina_strbuf_append_buffer(*buf, iter_param); + eina_strbuf_append_printf(*buf, " = eina_array_pop("); + eina_strbuf_append_buffer(*buf, param); + eina_strbuf_append_printf(*buf, ")))\n"); + _generate_loop_content(buf, inner_type, iter_param); + eina_strbuf_append_printf(*buf, " eina_array_free("); + eina_strbuf_append_buffer(*buf, param); + eina_strbuf_append_printf(*buf, ");\n"); + } else { printf("Error, container unknown?! %d\n", (int)t); @@ -310,11 +299,157 @@ _gen_function_param_fallback(Eina_Iterator *itr, Eina_Strbuf *fallback_free_owne return owners; } +static const char * +_get_reflect_initf(const Eolian_Type *abtp) +{ + Eolian_Type_Builtin_Type btp = eolian_type_builtin_type_get(abtp); + const char *initf = NULL; + switch (btp) + { + case EOLIAN_TYPE_BUILTIN_BYTE: + case EOLIAN_TYPE_BUILTIN_CHAR: + initf = "char"; break; + case EOLIAN_TYPE_BUILTIN_UBYTE: + initf = "uchar"; break; + case EOLIAN_TYPE_BUILTIN_SHORT: + case EOLIAN_TYPE_BUILTIN_USHORT: + case EOLIAN_TYPE_BUILTIN_INT: + case EOLIAN_TYPE_BUILTIN_UINT: + case EOLIAN_TYPE_BUILTIN_LONG: + case EOLIAN_TYPE_BUILTIN_ULONG: + case EOLIAN_TYPE_BUILTIN_INT64: + case EOLIAN_TYPE_BUILTIN_UINT64: + case EOLIAN_TYPE_BUILTIN_TIME: + case EOLIAN_TYPE_BUILTIN_FLOAT: + case EOLIAN_TYPE_BUILTIN_DOUBLE: + case EOLIAN_TYPE_BUILTIN_BOOL: + case EOLIAN_TYPE_BUILTIN_STRING: + case EOLIAN_TYPE_BUILTIN_STRINGSHARE: + initf = eolian_type_name_get(abtp); break; + default: + break; + } + return initf; +} + +static void +_gen_reflect_get(Eina_Strbuf *buf, const char *cnamel, const Eolian_Type *valt, + const Eolian_Function *fid, Eina_Hash *refh) +{ + if (eolian_type_is_ptr(valt)) + return; + + const Eolian_Type *abtp = eolian_type_aliased_base_get(valt); + const char *initf = _get_reflect_initf(abtp); + if (!initf) + return; + + Eolian_Function_Type et = (Eolian_Function_Type)eina_hash_find(refh, &fid); + if (et == EOLIAN_PROP_SET) + eina_hash_set(refh, &fid, (void *)EOLIAN_PROPERTY); + else + eina_hash_set(refh, &fid, (void *)EOLIAN_PROP_GET); + + eina_strbuf_append(buf, "\nstatic Eina_Value\n"); + eina_strbuf_append_printf(buf, "__eolian_%s_%s_get_reflect(const Eo *obj)\n", + cnamel, eolian_function_name_get(fid)); + eina_strbuf_append(buf, "{\n"); + + Eina_Stringshare *ct = eolian_type_c_type_get(valt, EOLIAN_C_TYPE_RETURN); + const char *starsp = (ct[strlen(ct) - 1] != '*') ? " " : ""; + + Eina_Stringshare *fcn = eolian_function_full_c_name_get(fid, EOLIAN_PROP_GET); + eina_strbuf_append_printf(buf, " %s%sval = %s(obj);\n", ct, starsp, fcn); + eina_stringshare_del(fcn); + eina_stringshare_del(ct); + + eina_strbuf_append_printf(buf, " return eina_value_%s_init(val);\n", initf); + eina_strbuf_append(buf, "}\n\n"); +} + +static void +_gen_reflect_set(Eina_Strbuf *buf, const char *cnamel, const Eolian_Type *valt, + const Eolian_Function *fid, Eina_Hash *refh) +{ + if (eolian_type_is_ptr(valt)) + return; + + const Eolian_Type *abtp = eolian_type_aliased_base_get(valt); + const char *initf = _get_reflect_initf(abtp); + if (!initf) + return; + + Eolian_Function_Type et = (Eolian_Function_Type)eina_hash_find(refh, &fid); + if (et == EOLIAN_PROP_GET) + eina_hash_set(refh, &fid, (void *)EOLIAN_PROPERTY); + else + eina_hash_set(refh, &fid, (void *)EOLIAN_PROP_SET); + + eina_strbuf_append(buf, "\nstatic Eina_Error\n"); + eina_strbuf_append_printf(buf, "__eolian_%s_%s_set_reflect(Eo *obj, Eina_Value val)\n", + cnamel, eolian_function_name_get(fid)); + eina_strbuf_append(buf, "{\n"); + eina_strbuf_append(buf, " Eina_Error r = 0;"); + + Eina_Stringshare *ct = eolian_type_c_type_get(valt, EOLIAN_C_TYPE_PARAM); + const char *starsp = (ct[strlen(ct) - 1] != '*') ? " " : ""; + eina_strbuf_append_printf(buf, " %s%scval;\n", ct, starsp); + eina_stringshare_del(ct); + + eina_strbuf_append_printf(buf, " if (!eina_value_%s_convert(&val, &cval))\n", initf); + eina_strbuf_append(buf, " {\n"); + eina_strbuf_append(buf, " r = EINA_ERROR_VALUE_FAILED;\n"); + eina_strbuf_append(buf, " goto end;\n"); + eina_strbuf_append(buf, " }\n"); + + Eina_Stringshare *fcn = eolian_function_full_c_name_get(fid, EOLIAN_PROP_SET); + eina_strbuf_append_printf(buf, " %s(obj, cval);\n", fcn); + eina_stringshare_del(fcn); + + eina_strbuf_append(buf, " end:\n"); + eina_strbuf_append(buf, " eina_value_flush(&val);\n"); + eina_strbuf_append(buf, " return r;\n"); + + eina_strbuf_append(buf, "}\n\n"); +} + +static void +_emit_class_function(Eina_Strbuf *buf, const Eolian_Function *fid, const Eolian_Type *rtp, Eina_Strbuf *params_full, + const char *ocnamel, const char *func_suffix, Eina_Strbuf *params, const char *function_name) +{ + eina_strbuf_append(buf, "EOAPI "); + if (rtp) + eina_strbuf_append(buf, eolian_type_c_type_get(rtp, EOLIAN_C_TYPE_RETURN)); + else + eina_strbuf_append(buf, "void"); + eina_strbuf_append(buf, " "); + eina_strbuf_append(buf, function_name); + eina_strbuf_append(buf, "("); + if (eina_strbuf_length_get(params_full) == 0) + eina_strbuf_append(buf, "void"); + else + eina_strbuf_append_buffer(buf, params_full); + eina_strbuf_append(buf, ")\n"); + eina_strbuf_append(buf, "{\n"); + eina_strbuf_append_printf(buf, " %s();\n", eolian_class_c_get_function_name_get(eolian_function_class_get(fid))); + if (rtp) + eina_strbuf_append(buf, " return "); + else + eina_strbuf_append(buf, " "); + eina_strbuf_append_printf(buf, "_%s", ocnamel); + eina_strbuf_append_char(buf, '_'); + eina_strbuf_append(buf, eolian_function_name_get(fid)); + eina_strbuf_append(buf, func_suffix); + eina_strbuf_append(buf, "("); + eina_strbuf_append_buffer(buf, params); + eina_strbuf_append(buf, ");\n"); + eina_strbuf_append(buf, "}\n"); +} static void _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, Eolian_Function_Type ftype, Eina_Strbuf *buf, - const Eolian_Implement *impl, Eina_Strbuf *lbuf) + const Eolian_Implement *impl, Eina_Hash *refh) { Eina_Bool is_empty = eolian_implement_is_empty(impl, ftype); Eina_Bool is_auto = eolian_implement_is_auto(impl, ftype); @@ -324,6 +459,8 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, Eina_Bool is_prop = (ftype == EOLIAN_PROP_GET || ftype == EOLIAN_PROP_SET); Eina_Bool var_as_ret = EINA_FALSE; + /* assume we're not generating reflection api by default */ + const Eolian_Type *reflect_type = NULL; const Eolian_Expression *def_ret = NULL; const Eolian_Type *rtp = eolian_function_return_type_get(fid, ftype); @@ -345,6 +482,8 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, { Eolian_Function_Parameter *pr = d1; rtp = eolian_parameter_type_get(pr); + /* reflect only when returning 1 val */ + reflect_type = rtp; var_as_ret = EINA_TRUE; def_ret = eolian_parameter_default_value_get(pr); } @@ -352,7 +491,18 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, } } else if (ftype == EOLIAN_PROP_SET) - func_suffix = "_set"; + { + func_suffix = "_set"; + Eina_Iterator *itr = eolian_property_values_get(fid, ftype); + void *d1, *d2; + /* reflect with 1 value */ + if (eina_iterator_next(itr, &d1) && !eina_iterator_next(itr, &d2)) + { + Eolian_Function_Parameter *pr = d1; + reflect_type = eolian_parameter_type_get(pr); + } + eina_iterator_free(itr); + } Eina_Strbuf *params = eina_strbuf_new(); /* par1, par2, par3, ... */ Eina_Strbuf *params_full = eina_strbuf_new(); /* T par1, U par2, ... for decl */ @@ -363,6 +513,8 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, /* property keys */ { Eina_Iterator *itr = eolian_property_keys_get(fid, ftype); + if (itr) /* has keys: no reflection */ + reflect_type = NULL; Eolian_Function_Parameter *pr; EINA_ITERATOR_FOREACH(itr, pr) { @@ -374,8 +526,14 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, eina_strbuf_append(params, ", "); eina_strbuf_append(params, prn); - eina_strbuf_append_printf(params_full, ", %s", ptn); - eina_strbuf_append_printf(params_full_imp, ", %s", ptn); + if (eina_strbuf_length_get(params_full) || !eolian_function_is_class(fid)) + { + eina_strbuf_append(params_full, ", "); + eina_strbuf_append(params_full_imp, ", "); + } + eina_strbuf_append_printf(params_full, "%s", ptn); + eina_strbuf_append_printf(params_full_imp, "%s", ptn); + if (ptn[strlen(ptn) - 1] != '*') { eina_strbuf_append_char(params_full, ' '); @@ -458,7 +616,8 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, if (eina_strbuf_length_get(params)) eina_strbuf_append(params, ", "); - eina_strbuf_append(params_full_imp, ", "); + if (eina_strbuf_length_get(params_full_imp) || !eolian_function_is_class(fid)) + eina_strbuf_append(params_full_imp, ", "); eina_strbuf_append(params_full_imp, ptn); if (!had_star) eina_strbuf_append_char(params_full_imp, ' '); @@ -468,7 +627,8 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, eina_strbuf_append(params_full_imp, " EINA_UNUSED"); eina_strbuf_append(params, prn); - eina_strbuf_append(params_full, ", "); + if (eina_strbuf_length_get(params_full) || !eolian_function_is_class(fid)) + eina_strbuf_append(params_full, ", "); eina_strbuf_append(params_full, ptn); if (!had_star) eina_strbuf_append_char(params_full, ' '); @@ -547,12 +707,17 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, eina_strbuf_append(buf, func_suffix); /* ([const ]Eo *obj, Data_Type *pd, impl_full_params); */ eina_strbuf_append_char(buf, '('); - 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); - eina_strbuf_append(buf, " *pd"); + if (!eolian_function_is_class(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); + eina_strbuf_append(buf, " *pd"); + } eina_strbuf_append(buf, eina_strbuf_string_get(params_full_imp)); + if (eina_strbuf_length_get(params_full_imp) == 0 && eolian_function_is_class(fid)) + eina_strbuf_append(buf, "void"); eina_strbuf_append(buf, ");\n\n"); } @@ -623,8 +788,17 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, eina_stringshare_del(dt); } - if (impl_same_class) + if (impl_same_class && !eolian_function_is_class(fid)) { + /* generate reflection implementation */ + if (reflect_type) + { + if (ftype == EOLIAN_PROP_GET) + _gen_reflect_get(buf, cnamel, reflect_type, fid, refh); + else + _gen_reflect_set(buf, cnamel, reflect_type, fid, refh); + } + void *data; Eina_Iterator *itr = eolian_property_keys_get(fid, ftype); Eina_Bool has_params = eina_iterator_next(itr, &data); @@ -644,7 +818,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, { //we have owned parameters we need to take care of eina_strbuf_append_printf(buf, "static void\n"); - eina_strbuf_append_printf(buf, "_%s_ownership_fallback(%s)\n{\n", eolian_function_full_c_name_get(fid, ftype, EINA_FALSE), eina_strbuf_string_get(params_full) + 2); + eina_strbuf_append_printf(buf, "_%s_ownership_fallback(%s)\n{\n", eolian_function_full_c_name_get(fid, ftype), eina_strbuf_string_get(params_full) + 2); eina_strbuf_append_buffer(buf, fallback_free_ownership); eina_strbuf_append_printf(buf, "}\n\n"); @@ -667,7 +841,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, eina_strbuf_append_char(buf, '('); - Eina_Stringshare *eofn = eolian_function_full_c_name_get(fid, ftype, EINA_FALSE); + Eina_Stringshare *eofn = eolian_function_full_c_name_get(fid, ftype); eina_strbuf_append(buf, eofn); if (strcmp(rtpn, "void")) @@ -677,7 +851,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, } if (fallback_free_ownership) - eina_strbuf_append_printf(buf, ", _%s_ownership_fallback(%s);", eolian_function_full_c_name_get(fid, ftype, EINA_FALSE), eina_strbuf_string_get(params)); + eina_strbuf_append_printf(buf, ", _%s_ownership_fallback(%s);", eolian_function_full_c_name_get(fid, ftype), eina_strbuf_string_get(params)); if (has_params) { @@ -689,51 +863,10 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, eina_strbuf_append(buf, ");\n"); - /* now try legacy */ - Eina_Stringshare *lfn = eolian_function_full_c_name_get(fid, ftype, EINA_TRUE); - if (!eolian_function_is_beta(fid) && lfn) - { - eina_strbuf_append(lbuf, "\nEAPI "); - eina_strbuf_append(lbuf, rtpn); - eina_strbuf_append_char(lbuf, '\n'); - eina_strbuf_append(lbuf, lfn); - /* param list */ - eina_strbuf_append_char(lbuf, '('); - /* for class funcs, offset the params to remove comma */ - int poff = 2; - if (!eolian_function_is_class(fid)) - { - /* non-class funcs have the obj though */ - poff = 0; - if ((ftype == EOLIAN_PROP_GET) || eolian_function_object_is_const(fid)) - eina_strbuf_append(lbuf, "const "); - eina_strbuf_append_printf(lbuf, "%s *obj", cname); - } - eina_strbuf_append(lbuf, eina_strbuf_string_get(params_full) + poff); - eina_strbuf_append(lbuf, ")\n{\n"); - /* body */ - if (strcmp(rtpn, "void")) - eina_strbuf_append(lbuf, " return "); - else - eina_strbuf_append(lbuf, " "); - eina_strbuf_append(lbuf, eofn); - eina_strbuf_append_char(lbuf, '('); - if (!eolian_function_is_class(fid)) - eina_strbuf_append(lbuf, "obj"); - else - { - Eina_Stringshare *mname = eolian_class_c_name_get(cl); - eina_strbuf_append(lbuf, mname); - eina_stringshare_del(mname); - } - if (has_params) - eina_strbuf_append_printf(lbuf, ", %s", eina_strbuf_string_get(params)); - eina_strbuf_append(lbuf, ");\n}\n"); - } - - eina_stringshare_del(lfn); eina_stringshare_del(eofn); } + if (impl_same_class && eolian_function_is_class(fid)) + _emit_class_function(buf, fid, rtp, params_full, ocnamel, func_suffix, params, eolian_function_full_c_name_get(fid, ftype)); free(cname); free(cnamel); @@ -754,7 +887,7 @@ _gen_opfunc(const Eolian_Function *fid, Eolian_Function_Type ftype, Eina_Strbuf *buf, const Eolian_Implement *impl, Eina_Bool pinit, const char *cnamel, const char *ocnamel) { - Eina_Stringshare *fnm = eolian_function_full_c_name_get(fid, ftype, EINA_FALSE); + Eina_Stringshare *fnm = eolian_function_full_c_name_get(fid, ftype); eina_strbuf_append(buf, " EFL_OBJECT_OP_FUNC("); eina_strbuf_append(buf, fnm); eina_strbuf_append(buf, ", "); @@ -777,7 +910,33 @@ _gen_opfunc(const Eolian_Function *fid, Eolian_Function_Type ftype, } static void -_gen_initializer(const Eolian_Class *cl, Eina_Strbuf *buf) +_gen_reflop(const Eolian_Function *fid, Eina_Strbuf *buf, const char *cnamel, Eina_Hash *refh) +{ + Eolian_Function_Type aftype = (Eolian_Function_Type)eina_hash_find(refh, &fid); + if (aftype == EOLIAN_UNRESOLVED) + return; + + eina_strbuf_append_printf(buf, " {\"%s\", ", eolian_function_name_get(fid)); + + if (aftype == EOLIAN_PROP_SET || aftype == EOLIAN_PROPERTY) + { + eina_strbuf_append_printf(buf, "__eolian_%s_%s_set_reflect, ", + cnamel, eolian_function_name_get(fid)); + } + else + eina_strbuf_append(buf, "NULL, "); + + if (aftype == EOLIAN_PROP_GET || aftype == EOLIAN_PROPERTY) + { + eina_strbuf_append_printf(buf, "__eolian_%s_%s_get_reflect},\n", + cnamel, eolian_function_name_get(fid)); + } + else + eina_strbuf_append(buf, "NULL},\n"); +} + +static void +_gen_initializer(const Eolian_Class *cl, Eina_Strbuf *buf, Eina_Hash *refh) { char *cnamel = NULL, *cnameu = NULL; eo_gen_class_names_get(cl, NULL, &cnameu, &cnamel); @@ -785,9 +944,11 @@ _gen_initializer(const Eolian_Class *cl, Eina_Strbuf *buf) eina_strbuf_append(buf, "\nstatic Eina_Bool\n_"); eina_strbuf_append(buf, cnamel); eina_strbuf_append(buf, "_class_initializer(Efl_Class *klass)\n{\n"); - eina_strbuf_append(buf, " const Efl_Object_Ops *opsp = NULL, *copsp = NULL;\n\n"); + eina_strbuf_append(buf, " const Efl_Object_Ops *opsp = NULL;\n\n"); + eina_strbuf_append(buf, " const Efl_Object_Property_Reflection_Ops *ropsp = NULL;\n\n"); - Eina_Strbuf *ops = eina_strbuf_new(), *cops = eina_strbuf_new(); + Eina_Strbuf *ops = eina_strbuf_new(); + Eina_Strbuf *refls = eina_strbuf_new(); /* start over with clean itearator */ const Eolian_Implement *imp; @@ -798,13 +959,10 @@ _gen_initializer(const Eolian_Class *cl, Eina_Strbuf *buf) Eolian_Function_Type ftype; const Eolian_Function *fid = eolian_implement_function_get(imp, &ftype); - Eina_Strbuf *obuf = ops; - if (eolian_function_is_class(fid)) - obuf = cops; + if (eolian_function_is_class(fid)) continue; - if (!eina_strbuf_length_get(obuf)) - eina_strbuf_append_printf(obuf, " EFL_OPS_DEFINE(%s,\n", - (obuf == ops) ? "ops" : "cops"); + if (!eina_strbuf_length_get(ops)) + eina_strbuf_append_printf(ops, " EFL_OPS_DEFINE(ops,\n"); Eina_Bool found_get = !!eina_hash_find(_funcs_params_init_get, &imp); Eina_Bool found_set = !!eina_hash_find(_funcs_params_init_set, &imp); @@ -815,17 +973,20 @@ _gen_initializer(const Eolian_Class *cl, Eina_Strbuf *buf) switch (ftype) { case EOLIAN_PROP_GET: - _gen_opfunc(fid, EOLIAN_PROP_GET, obuf, imp, found_get, cnamel, ocnamel); + _gen_opfunc(fid, EOLIAN_PROP_GET, ops, imp, found_get, cnamel, ocnamel); + _gen_reflop(fid, refls, cnamel, refh); break; case EOLIAN_PROP_SET: - _gen_opfunc(fid, EOLIAN_PROP_SET, obuf, imp, found_set, cnamel, ocnamel); + _gen_opfunc(fid, EOLIAN_PROP_SET, ops, imp, found_set, cnamel, ocnamel); + _gen_reflop(fid, refls, cnamel, refh); break; case EOLIAN_PROPERTY: - _gen_opfunc(fid, EOLIAN_PROP_SET, obuf, imp, found_set, cnamel, ocnamel); - _gen_opfunc(fid, EOLIAN_PROP_GET, obuf, imp, found_get, cnamel, ocnamel); + _gen_opfunc(fid, EOLIAN_PROP_SET, ops, imp, found_set, cnamel, ocnamel); + _gen_opfunc(fid, EOLIAN_PROP_GET, ops, imp, found_get, cnamel, ocnamel); + _gen_reflop(fid, refls, cnamel, refh); break; default: - _gen_opfunc(fid, EOLIAN_METHOD, obuf, imp, found_get, cnamel, ocnamel); + _gen_opfunc(fid, EOLIAN_METHOD, ops, imp, found_get, cnamel, ocnamel); break; } @@ -852,28 +1013,22 @@ _gen_initializer(const Eolian_Class *cl, Eina_Strbuf *buf) eina_strbuf_append(buf, " opsp = &ops;\n"); eina_strbuf_append(buf, "#endif\n\n"); } - if (eina_strbuf_length_get(cops)) - { - eina_strbuf_append_printf(buf, "#ifndef %s_EXTRA_CLASS_OPS\n", cnameu); - eina_strbuf_append_printf(buf, "#define %s_EXTRA_CLASS_OPS\n", cnameu); - eina_strbuf_append(buf, "#endif\n\n"); - eina_strbuf_append_printf(cops, " %s_EXTRA_CLASS_OPS\n );\n", cnameu); - eina_strbuf_append(buf, eina_strbuf_string_get(cops)); - eina_strbuf_append(buf, " copsp = &cops;\n\n"); - } - else + if (eina_strbuf_length_get(refls)) { - eina_strbuf_append_printf(buf, "#ifdef %s_EXTRA_CLASS_OPS\n", cnameu); - eina_strbuf_append_printf(buf, " EFL_OPS_DEFINE(cops, %s_EXTRA_CLASS_OPS);\n", cnameu); - eina_strbuf_append(buf, " copsp = &cops;\n"); - eina_strbuf_append(buf, "#endif\n\n"); + eina_strbuf_append(buf, " static const Efl_Object_Property_Reflection refl_table[] = {\n"); + eina_strbuf_append_buffer(buf, refls); + eina_strbuf_append(buf, " };\n"); + eina_strbuf_append(buf, " static const Efl_Object_Property_Reflection_Ops rops = {\n"); + eina_strbuf_append(buf, " refl_table, EINA_C_ARRAY_LENGTH(refl_table)\n"); + eina_strbuf_append(buf, " };\n"); + eina_strbuf_append(buf, " ropsp = &rops;\n\n"); } - eina_strbuf_append(buf, " return efl_class_functions_set(klass, opsp, copsp);\n"); + eina_strbuf_append(buf, " return efl_class_functions_set(klass, opsp, ropsp);\n"); eina_strbuf_free(ops); - eina_strbuf_free(cops); + eina_strbuf_free(refls); eina_strbuf_append(buf, "}\n\n"); @@ -913,7 +1068,10 @@ eo_gen_source_gen(const Eolian_Class *cl, Eina_Strbuf *buf) eina_iterator_free(itr); } - Eina_Strbuf *lbuf = eina_strbuf_new(); + /* Eolian_Function -> Eolian_Function_Type + * maps which parts of which functions are qualified for reflection + */ + Eina_Hash *refh = eina_hash_pointer_new(NULL); /* method section */ { @@ -927,21 +1085,22 @@ eo_gen_source_gen(const Eolian_Class *cl, Eina_Strbuf *buf) { case EOLIAN_PROP_GET: case EOLIAN_PROP_SET: - _gen_func(cl, fid, ftype, buf, imp, lbuf); + _gen_func(cl, fid, ftype, buf, imp, refh); break; case EOLIAN_PROPERTY: - _gen_func(cl, fid, EOLIAN_PROP_SET, buf, imp, lbuf); - _gen_func(cl, fid, EOLIAN_PROP_GET, buf, imp, lbuf); + _gen_func(cl, fid, EOLIAN_PROP_SET, buf, imp, refh); + _gen_func(cl, fid, EOLIAN_PROP_GET, buf, imp, refh); break; default: - _gen_func(cl, fid, EOLIAN_METHOD, buf, imp, lbuf); + _gen_func(cl, fid, EOLIAN_METHOD, buf, imp, refh); } } eina_iterator_free(itr); } /* class initializer - contains method defs */ - _gen_initializer(cl, buf); + _gen_initializer(cl, buf, refh); + eina_hash_free(refh); /* class description */ eina_strbuf_append(buf, "static const Efl_Class_Description _"); @@ -1021,11 +1180,6 @@ eo_gen_source_gen(const Eolian_Class *cl, Eina_Strbuf *buf) /* terminate inherits */ eina_strbuf_append(buf, ", NULL);\n"); - /* append legacy if there */ - eina_strbuf_append(buf, eina_strbuf_string_get(lbuf)); - - eina_strbuf_free(lbuf); - /* and we're done */ free(cnamel); eina_hash_free(_funcs_params_init_get); @@ -1187,7 +1341,7 @@ _gen_proto(const Eolian_Class *cl, const Eolian_Function *fid, if (strlen(efname) >= (sizeof("destructor") - 1) && !impl_same_class) if (!strcmp(efname + strlen(efname) - sizeof("destructor") + 1, "destructor")) { - Eina_Stringshare *fcn = eolian_function_full_c_name_get(fid, ftype, EINA_FALSE); + Eina_Stringshare *fcn = eolian_function_full_c_name_get(fid, ftype); Eina_Stringshare *mname = eolian_class_c_name_get(cl); eina_strbuf_append(buf, " "); eina_strbuf_append(buf, fcn); diff --git a/src/bin/eolian/types.c b/src/bin/eolian/types.c index b8f7b98452..c2a2ea654f 100644 --- a/src/bin/eolian/types.c +++ b/src/bin/eolian/types.c @@ -156,6 +156,12 @@ _type_generate(const Eolian_State *state, const Eolian_Typedecl *tp, eina_strbuf_reset(buf); break; } + eina_strbuf_append_char(buf, ';'); + if (eolian_typedecl_is_beta(tp)) + { + eina_strbuf_prepend(buf, "#ifdef EFL_BETA_API_SUPPORT\n"); + eina_strbuf_append(buf, "\n#endif /* EFL_BETA_API_SUPPORT */"); + } return buf; } @@ -200,6 +206,11 @@ _var_generate(const Eolian_State *state, const Eolian_Variable *vr, Eina_Bool le eina_stringshare_del(ct); } free(fn); + if (eolian_variable_is_beta(vr)) + { + eina_strbuf_prepend(buf, "#ifdef EFL_BETA_API_SUPPORT\n"); + eina_strbuf_append(buf, "\n#endif /* EFL_BETA_API_SUPPORT */"); + } return buf; } @@ -252,7 +263,7 @@ void eo_gen_types_header_gen(const Eolian_State *state, if (tbuf) { eina_strbuf_append(buf, eina_strbuf_string_get(tbuf)); - eina_strbuf_append(buf, ";\n\n"); + eina_strbuf_append(buf, "\n\n"); eina_strbuf_free(tbuf); } } diff --git a/src/bin/eolian_mono/eolian/mono/blacklist.hh b/src/bin/eolian_mono/eolian/mono/blacklist.hh index c11437b2df..02cda670d9 100644 --- a/src/bin/eolian_mono/eolian/mono/blacklist.hh +++ b/src/bin/eolian_mono/eolian/mono/blacklist.hh @@ -16,6 +16,7 @@ inline bool is_function_blacklisted(std::string const& c_name) { return c_name == "efl_event_callback_array_priority_add" + || c_name == "efl_constructor" || c_name == "efl_player_position_get" || c_name == "efl_ui_widget_focus_set" || c_name == "efl_ui_widget_focus_get" @@ -52,7 +53,7 @@ inline bool is_function_blacklisted(std::string const& c_name) } template -inline bool is_function_blacklisted(attributes::function_def const& func, Context context) +inline bool is_function_blacklisted(attributes::function_def const& func, Context const& context) { auto options = efl::eolian::grammar::context_find_tag(context); auto c_name = func.c_name; @@ -67,6 +68,7 @@ inline bool is_function_blacklisted(attributes::function_def const& func, Contex // Blacklist structs that require some kind of manual binding. inline bool is_struct_blacklisted(std::string const& full_name) { + // For now, these manual structs are blacklisted regardless of beta status return full_name == "Efl.Event_Description" || full_name == "Eina.Binbuf" || full_name == "Eina.Strbuf" @@ -78,11 +80,28 @@ inline bool is_struct_blacklisted(std::string const& full_name) || full_name == "Eina.Future"; } -inline bool is_struct_blacklisted(attributes::struct_def const& struct_) +template +inline bool is_struct_blacklisted(attributes::struct_def const& struct_, Context const& context) { + auto options = efl::eolian::grammar::context_find_tag(context); + if (struct_.is_beta && !options.want_beta) + return true; + return is_struct_blacklisted(name_helpers::struct_full_eolian_name(struct_)); } +// Struct as type_def is for places where the struct is used as a struct field or parameter/return. +template +inline bool is_struct_blacklisted(attributes::type_def const& struct_, Context const& context) +{ + auto options = efl::eolian::grammar::context_find_tag(context); + if (struct_.is_beta && !options.want_beta) + return true; + + auto regular = efl::eina::get(struct_.original_type); + return is_struct_blacklisted(name_helpers::type_full_eolian_name(regular)); +} + inline bool is_struct_blacklisted(attributes::regular_type_def const& struct_) { return is_struct_blacklisted(name_helpers::type_full_eolian_name(struct_)); @@ -97,11 +116,11 @@ inline bool is_property_blacklisted(std::string const& name) { return name == "Efl.Input.Key.Key" || name == "Efl.Input.Hold.Hold" - || name == "Efl.Text.Text"; + || name == "Efl.IText.Text"; } template -inline bool is_property_blacklisted(attributes::property_def const& property, Context context) +inline bool is_property_blacklisted(attributes::property_def const& property, Context const& context) { auto name = name_helpers::klass_full_concrete_or_interface_name(property.klass) + "." + name_helpers::property_managed_name(property); @@ -114,6 +133,47 @@ inline bool is_property_blacklisted(attributes::property_def const& property, Co return is_property_blacklisted(name); } +template +inline bool is_property_blacklisted(attributes::property_def const& property, + attributes::klass_def const& implementing_class, + Context const& context) +{ + std::string property_name = name_helpers::property_managed_name(property); + std::string klass_name = name_helpers::klass_concrete_or_interface_name(implementing_class); + + // This property wrapper is invalidated as it would clash with the implementing + // class constructor. CS + if (property_name == klass_name) + return true; + + return is_property_blacklisted(property, context); +} + +template +inline bool is_class_blacklisted(attributes::klass_def const& cls, Context const& context) +{ + auto options = efl::eolian::grammar::context_find_tag(context); + + return cls.is_beta && !options.want_beta; +} + +template +inline bool is_class_blacklisted(attributes::klass_name const& cls, Context const& context) +{ + auto options = efl::eolian::grammar::context_find_tag(context); + + return cls.is_beta && !options.want_beta; +} + + +template +inline bool is_event_blacklisted(attributes::event_def const& evt, Context const& context) +{ + auto options = efl::eolian::grammar::context_find_tag(context); + + return evt.beta && !options.want_beta; +} + } } diff --git a/src/bin/eolian_mono/eolian/mono/documentation.hh b/src/bin/eolian_mono/eolian/mono/documentation.hh index 3acec94102..9646fd314f 100644 --- a/src/bin/eolian_mono/eolian/mono/documentation.hh +++ b/src/bin/eolian_mono/eolian/mono/documentation.hh @@ -37,6 +37,24 @@ struct documentation_generator return n; } + // Gets the eolian ref for the given class, prepending I for interfaces. + static std::string object_ref_conversion(const Eolian_Object *cls) + { + auto klass_type = ::eolian_class_type_get((const Eolian_Class *)cls); + auto full_eolian_name = name_helpers::managed_namespace(::eolian_object_name_get(cls)); + if (klass_type == EOLIAN_CLASS_MIXIN || klass_type == EOLIAN_CLASS_INTERFACE) + { + size_t pos = full_eolian_name.rfind("."); + if (pos == std::string::npos) + pos = 0; + else + pos++; + full_eolian_name.insert(pos, "I"); + } + return full_eolian_name; + } + + // Turns a function name from EO convention to EFL# convention. // The name_tail parameter is the last 4 chars of the original string, which // could be ".set" or ".get" and in this case they are ignored by Eolian. @@ -45,29 +63,33 @@ struct documentation_generator { ::Eolian_Function_Type ftype = ::eolian_function_type_get(function); const char* eo_name = ::eolian_function_name_get(function); - std::string name = name_helpers::managed_namespace(::eolian_object_name_get(klass)); + std::string name = object_ref_conversion(klass); + + // Klass is needed to check the property naming rulles + attributes::klass_def klass_d((const ::Eolian_Class *)klass, eolian_object_unit_get(klass)); + switch(ftype) { case ::EOLIAN_METHOD: if (blacklist::is_function_blacklisted( - ::eolian_function_full_c_name_get(function, ftype, EINA_FALSE))) return ""; + ::eolian_function_full_c_name_get(function, ftype))) return ""; name += "."; name += name_helpers::managed_method_name( ::eolian_object_short_name_get(klass), eo_name); break; case ::EOLIAN_PROP_SET: name += ".Set"; - name += name_helpers::property_managed_name(eo_name); + name += name_helpers::property_managed_name(klass_d, eo_name); break; case ::EOLIAN_PROP_GET: name += ".Get"; - name += name_helpers::property_managed_name(eo_name); + name += name_helpers::property_managed_name(klass_d, eo_name); break; case ::EOLIAN_PROPERTY: { int getter_params = property_num_parameters(function, ::EOLIAN_PROP_GET); int setter_params = property_num_parameters(function, ::EOLIAN_PROP_SET); - std::string short_name = name_helpers::property_managed_name(eo_name); + std::string short_name = name_helpers::property_managed_name(klass_d, eo_name); bool blacklisted = blacklist::is_property_blacklisted(name + "." + short_name); // EO properties with keys, with more than one value, or blacklisted, are not // converted into C# properties. @@ -84,6 +106,28 @@ struct documentation_generator return name; } + static std::string function_conversion(attributes::function_def const& func) + { + std::string name = name_helpers::klass_full_concrete_or_interface_name(func.klass); + switch (func.type) + { + // managed_method_name takes care of reordering the function name so the get/set goes first + // for properties + case attributes::function_type::method: + case attributes::function_type::prop_set: + case attributes::function_type::prop_get: + if (blacklist::is_function_blacklisted(func.c_name))return ""; + if (!name.empty()) name += "."; + name += name_helpers::managed_method_name(func.klass.eolian_name, func.name); + break; + default: + // No need to deal with property as function_defs are converted to get/set when building a given klass_def. + break; + } + + return name; + } + // Turns an Eolian reference like @Efl.Input.Pointer.tool into a tag static std::string ref_conversion(const ::Eolian_Doc_Token *token, const Eolian_State *state, std::string name_tail) { @@ -100,7 +144,7 @@ struct documentation_generator if (blacklist::is_struct_blacklisted(ref)) return ""; break; case ::EOLIAN_OBJECT_EVENT: - ref = name_helpers::managed_namespace(::eolian_object_name_get(data)); + ref = object_ref_conversion(data); ref += "."; ref += name_helpers::managed_event_name(::eolian_object_name_get(data2)); break; @@ -112,10 +156,25 @@ struct documentation_generator case ::EOLIAN_OBJECT_FUNCTION: ref += function_conversion(data, (const ::Eolian_Function *)data2, name_tail); break; + case ::EOLIAN_OBJECT_VARIABLE: + if (::eolian_variable_type_get((::Eolian_Variable *)data) == ::EOLIAN_VAR_CONSTANT) + { + auto names = utils::split(name_helpers::managed_namespace(::eolian_object_name_get(data)), '.'); + names.pop_back(); // Remove var name + ref = name_helpers::join_namespaces(names, '.'); + ref += "Constants."; + ref += name_helpers::managed_name(::eolian_object_short_name_get(data)); + } + // Otherwise, do nothing and no tag will be generated. Because, who would + // reference a global (non-constant) variable in the docs? + break; case ::EOLIAN_OBJECT_UNKNOWN: // If the reference cannot be resolved, just return an empty string and // it won't be converted into a tag. break; + case ::EOLIAN_OBJECT_CLASS: + ref = object_ref_conversion(data); + break; default: ref = name_helpers::managed_namespace(::eolian_object_name_get(data)); break; @@ -189,7 +248,19 @@ struct documentation_generator /// Tag generator helpers template - bool generate_tag(OutputIterator sink, std::string const& tag, std::string const &text, Context const& context, std::string tag_params = "") const + bool generate_opening_tag(OutputIterator sink, std::string const& tag, Context const& context, std::string tag_params = "") const + { + return as_generator("<" << tag << tag_params << ">").generate(sink, attributes::unused, context); + } + + template + bool generate_closing_tag(OutputIterator sink, std::string const& tag, Context const& context) const + { + return as_generator("").generate(sink, attributes::unused, context); + } + + template + bool generate_escaped_content(OutputIterator sink, std::string const &text, Context const& context) const { std::string new_text; if (!as_generator(html_escaped_string).generate(std::back_inserter(new_text), text, context)) @@ -201,14 +272,24 @@ struct documentation_generator std::istringstream ss(new_text); std::string para; - std::string final_text = "<" + tag + tag_params + ">"; + std::string final_text; bool first = true; while (std::getline(ss, para)) { if (first) final_text += para; else final_text += "\n" + tabs + para; first = false; } - return as_generator(scope_tab(scope_size) << "/// " << final_text << "\n").generate(sink, attributes::unused, context); + return as_generator(final_text).generate(sink, attributes::unused, context); + } + + template + bool generate_tag(OutputIterator sink, std::string const& tag, std::string const &text, Context const& context, std::string tag_params = "") const + { + if (!as_generator(scope_tab(scope_size) << "/// ").generate(sink, attributes::unused, context)) return false; + if (!generate_opening_tag(sink, tag, context, tag_params)) return false; + if (!generate_escaped_content(sink, text, context)) return false; + if (!generate_closing_tag(sink, tag, context)) return false; + return as_generator("\n").generate(sink, attributes::unused, context); } template @@ -229,6 +310,53 @@ struct documentation_generator return generate_tag(sink, "returns", text, context); } + template + bool generate_tag_value(OutputIterator sink, std::string const& text, Context const& context) const + { + return generate_tag(sink, "value", text, context); + } + + template + bool generate_tag_example(OutputIterator sink, std::string const& full_object_name, Context const& context) const + { + auto options = efl::eolian::grammar::context_find_tag(context); + // Example embedding not requested + if (options.examples_dir.empty()) return true; + std::string file_name = options.examples_dir + full_object_name + ".cs"; + std::ifstream exfile(file_name); + // There is no example file for this class or method, just return + if (!exfile.good()) return true; + std::stringstream example_buff; + // Start with a newline so the first line renders with same indentation as the rest + example_buff << std::endl << exfile.rdbuf(); + + if (!as_generator(scope_tab(scope_size) << "/// ").generate(sink, attributes::unused, context)) return false; + if (!generate_opening_tag(sink, "example", context)) return false; + if (!generate_opening_tag(sink, "code", context)) return false; + if (!generate_escaped_content(sink, example_buff.str(), context)) return false; + if (!generate_closing_tag(sink, "code", context)) return false; + if (!generate_closing_tag(sink, "example", context)) return false; + return as_generator("\n").generate(sink, attributes::unused, context); + } + + template + bool generate_all_tag_examples(OutputIterator sink, std::string const & full_class_name, std::string const& object_name, Context const& context) const + { + // Take example from derived class + auto derived_klass = efl::eolian::grammar::context_find_tag(context); + std::string derived_full_name = + derived_klass.name.empty() ? object_name : derived_klass.name + "." + object_name; + std::string base_full_name = + full_class_name.empty() ? object_name : full_class_name + "." + object_name; + if (!derived_klass.name.empty()) + { + if (!generate_tag_example(sink, derived_full_name, context)) return false; + } + if (derived_full_name.compare(base_full_name) == 0) return true; + // Take example from base class + return generate_tag_example(sink, base_full_name, context); + } + // Actual exported generators template bool generate(OutputIterator sink, Attribute const& attr, Context const& context) const @@ -236,6 +364,36 @@ struct documentation_generator return generate(sink, attr.documentation, context); } + template + bool generate(OutputIterator sink, attributes::klass_def const& klass, Context const& context) const + { + if (!generate(sink, klass.documentation, context)) return false; + + std::string klass_name = name_helpers::klass_full_concrete_or_interface_name(klass); + return generate_tag_example(sink, klass_name, context); + } + + template + bool generate(OutputIterator sink, attributes::property_def const& prop, Context const& context) const + { + if (!generate(sink, prop.documentation, context)) + return false; + + std::string text; + if (prop.setter.is_engaged()) + text = prop.setter->parameters[0].documentation.full_text; + else if (prop.getter.is_engaged()) + text = prop.getter->return_documentation.full_text; + // If there are no docs at all, do not generate tag + if (!text.empty()) + if (!generate_tag_value(sink, text, context)) return false; + + return generate_all_tag_examples(sink, + name_helpers::klass_full_concrete_or_interface_name(prop.klass), + name_helpers::property_managed_name(prop), + context); + } + template bool generate(OutputIterator sink, attributes::function_def const& func, Context const& context) const { @@ -269,7 +427,10 @@ struct documentation_generator if (!generate_tag_return(sink, func.return_documentation.full_text, context)) return false; - return true; + return generate_all_tag_examples(sink, + name_helpers::klass_full_concrete_or_interface_name(func.klass), + name_helpers::managed_method_name(func.klass.eolian_name, func.name), + context); } template @@ -285,7 +446,10 @@ struct documentation_generator if (!generate_tag_return(sink, func.return_documentation.full_text, context)) return false; - return true; + return generate_all_tag_examples(sink, + name_helpers::klass_full_concrete_or_interface_name(func.klass), + name_helpers::managed_method_name(func.klass.eolian_name, func.name), + context); } template @@ -297,7 +461,35 @@ struct documentation_generator template bool generate(OutputIterator sink, attributes::documentation_def const& doc, Context const& context) const { - return generate_tag_summary(sink, doc.full_text, context); + std::string str = doc.full_text; + if (!doc.since.empty()) + str += "\n(Since EFL " + doc.since + ")"; + return generate_tag_summary(sink, str, context); + } + + template + bool generate(OutputIterator sink, attributes::constructor_def const& ctor, Context const& context) const + { + // Not sure if this is the best way to generate a reference outside the full doc generator. + auto unit = (const Eolian_Unit*) context_find_tag(context).state; + auto func = ctor.function; + auto eolian_klass = get_klass(func.klass, unit); + attributes::klass_def klass(eolian_klass, unit); + std::string summary; + + if (func.type == attributes::function_type::prop_set) + summary = func.property_documentation.summary; + else + summary = func.documentation.summary; + + for (auto &¶m : ctor.function.parameters) + { + if (!as_generator( + scope_tab << "///" << summary << " See \n" + ).generate(sink, param, 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 index c9cb686803..56a22d7823 100644 --- a/src/bin/eolian_mono/eolian/mono/events.hh +++ b/src/bin/eolian_mono/eolian/mono/events.hh @@ -30,7 +30,7 @@ struct unpack_event_args_visitor // Structs are usually passed by pointer to events, like having a ptr<> modifier // Uses implicit conversion from IntPtr return as_generator( - " evt.Info;" + " evt.Info" ).generate(sink, attributes::unused, *context); } else if (type.is_ptr) @@ -51,6 +51,7 @@ struct unpack_event_args_visitor , {"int", [&arg] { return arg + ".ToInt32()"; }} , {"uint", [&arg] { return "(uint)" + arg + ".ToInt32()";}} , {"string", [&arg] { return "Eina.StringConversion.NativeUtf8ToManagedString(" + arg + ")"; }} + , {"stringshare", [&arg] { return "Eina.StringConversion.NativeUtf8ToManagedString(" + arg + ")"; }} , {"Eina.Error", [&arg] { return "(Eina.Error)Marshal.PtrToStructure(" + arg + ", typeof(Eina.Error))"; }} }; @@ -72,11 +73,121 @@ struct unpack_event_args_visitor } 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); + return as_generator("(Efl.Eo.Globals.CreateWrapperFor(evt.Info) as " + name_helpers::klass_full_concrete_name(cls) + ")").generate(sink, attributes::unused, *context); } bool operator()(attributes::complex_type_def const&) const { - return as_generator("UNSUPPORTED").generate(sink, attributes::unused, *context); + return as_generator("new " << eolian_mono::type << "(evt.Info, false, false)").generate(sink, type, *context); + } +}; + +template +struct pack_event_info_and_call_visitor +{ + mutable OutputIterator sink; + Context const* context; + attributes::type_def const& type; + + static auto constexpr native_call = "Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);\n"; + + typedef pack_event_info_and_call_visitor visitor_type; + typedef bool result_type; + + bool operator()(grammar::attributes::regular_type_def const& regular) const + { + std::string arg_type = name_helpers::type_full_managed_name(regular); + + auto const& indent = current_indentation(*context); + + if (regular.is_struct()) + { + return as_generator( + indent << "IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));\n" + << indent << "try\n" + << indent << "{\n" + << indent << scope_tab << "Marshal.StructureToPtr(e.arg, info, false);\n" + << indent << scope_tab << this->native_call + << indent << "}\n" + << indent << "finally\n" + << indent << "{\n" + << indent << scope_tab << "Marshal.FreeHGlobal(info);\n" + << indent << "}\n" + ).generate(sink, attributes::unused, *context); + } + + using attributes::regular_type_def; + struct match + { + eina::optional name; + std::function function; + }; + + std::string full_type_name = name_helpers::type_full_eolian_name(regular); + auto filter_func = [®ular, &full_type_name] (match const& m) + { + return (!m.name || *m.name == regular.base_type || *m.name == full_type_name); + }; + + match const str_table[] = + { + {"string", [] { return "e.arg"; }} + , {"stringshare", [] { return "e.arg"; }} + }; + + auto str_accept_func = [&](std::string const& conversion) + { + return as_generator( + indent << "IntPtr info = Eina.StringConversion.ManagedStringToNativeUtf8Alloc(" << conversion << ");\n" + << indent << "try\n" + << indent << "{\n" + << indent << scope_tab << this->native_call + << indent << "}\n" + << indent << "finally\n" + << indent << "{\n" + << indent << scope_tab << "Eina.MemoryNative.Free(info);\n" + << indent << "}\n").generate(sink, attributes::unused, *context); + }; + + if (eina::optional b = call_match(str_table, filter_func, str_accept_func)) + return *b; + + match const value_table [] = + { + {"bool", [] { return "e.arg ? (byte) 1 : (byte) 0"; }} + , {"Eina.Error", [] { return "(int)e.arg"; }} + , {nullptr, [] { return "e.arg"; }} + }; + + auto value_accept_func = [&](std::string const& conversion) + { + return as_generator( + indent << "IntPtr info = Eina.PrimitiveConversion.ManagedToPointerAlloc(" << conversion << ");\n" + << indent << "try\n" + << indent << "{\n" + << indent << scope_tab << this->native_call + << indent << "}\n" + << indent << "finally\n" + << indent << "{\n" + << indent << scope_tab << "Marshal.FreeHGlobal(info);\n" + << indent << "}\n").generate(sink, attributes::unused, *context); + }; + + if (eina::optional b = call_match(value_table, filter_func, value_accept_func)) + return *b; + + return value_accept_func("e.args"); + } + bool operator()(grammar::attributes::klass_name const&) const + { + auto const& indent = current_indentation(*context); + return as_generator(indent << "IntPtr info = e.arg.NativeHandle;\n" + << indent << this->native_call).generate(sink, attributes::unused, *context); + } + bool operator()(attributes::complex_type_def const&) const + { + auto const& indent = current_indentation(*context); + return as_generator(indent << "IntPtr info = e.arg.Handle;\n" + << indent << this->native_call).generate(sink, attributes::unused, *context); } }; @@ -92,6 +203,9 @@ struct event_argument_wrapper_generator if (!etype.is_engaged()) return true; + if (blacklist::is_event_blacklisted(evt, context)) + return true; + std::string evt_name = name_helpers::managed_event_name(evt.name); return as_generator("///Event argument wrapper for event "; @@ -131,7 +248,7 @@ struct event_declaration_generator } } const event_declaration {}; -struct event_registration_generator +struct event_definition_generator { attributes::klass_def const& klass; attributes::klass_def const& leaf_klass; @@ -140,38 +257,11 @@ struct event_registration_generator template bool generate(OutputIterator sink, attributes::event_def const& evt, Context const& context) const { - std::string wrapper_event_name; + if (blacklist::is_event_blacklisted(evt, context)) + return true; - if (is_inherited_event && !helpers::is_unique_event(evt, leaf_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.EventCb(on_" << wrapper_event_name << "_NativeCallback);\n" - ).generate(sink, attributes::unused, context); - } -}; - -struct event_registration_parameterized -{ - event_registration_generator operator()(attributes::klass_def const& klass, attributes::klass_def const& leaf_klass) const - { - bool is_inherited_event = klass != leaf_klass; - return {klass, leaf_klass, is_inherited_event}; - } -} const event_registration; - -struct event_definition_generator -{ - attributes::klass_def const& klass; - attributes::klass_def const& leaf_klass; - bool is_inherited_event; - - template - bool generate(OutputIterator sink, attributes::event_def const& evt, Context context) const - { std::string managed_evt_name = name_helpers::managed_event_name(evt.name); + auto const& indent = current_indentation(context); bool is_unique = helpers::is_unique_event(evt, leaf_klass); bool use_explicit_impl = is_inherited_event && !is_unique; @@ -192,20 +282,35 @@ struct event_definition_generator std::string wrapper_args_type = "EventArgs"; std::string wrapper_args_template = ""; std::string event_args = "EventArgs args = EventArgs.Empty;\n"; + std::string event_native_call; efl::eina::optional etype = evt.type; - if (etype.is_engaged()) + if (!etype.is_engaged()) + { + auto event_call_site_sink = std::back_inserter(event_native_call); + if (!as_generator(indent.inc().inc() << "Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);\n") + .generate(event_call_site_sink, attributes::unused, context)) + return false; + } + else { 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 = "; + std::string arg_initializer; auto arg_initializer_sink = std::back_inserter(arg_initializer); + auto event_call_site_sink = std::back_inserter(event_native_call); - if (!(*etype).original_type.visit(unpack_event_args_visitor{arg_initializer_sink, &context, *etype})) + auto sub_context = change_indentation(indent.inc().inc(), context); + + if (!as_generator(scope_tab(6) << wrapper_args_type << " args = new " << wrapper_args_type << "();\n" + << scope_tab(6) << "args.arg = ").generate(arg_initializer_sink, attributes::unused, context)) + return false; + if (!(*etype).original_type.visit(unpack_event_args_visitor{arg_initializer_sink, &sub_context, *etype})) + return false; + + if (!(*etype).original_type.visit(pack_event_info_and_call_visitor{event_call_site_sink, &sub_context, *etype})) return false; arg_initializer += ";\n"; @@ -213,10 +318,6 @@ struct event_definition_generator event_args = arg_initializer; } - if(!as_generator("private static object " << wrapper_evt_name << "Key = new object();\n") - .generate(sink, attributes::unused, context)) - return false; - if(!as_generator(documentation(1)).generate(sink, evt, context)) return false; @@ -243,31 +344,10 @@ struct event_definition_generator return false; } - if (!generate_event_add_remove(sink, evt, wrapper_evt_name, context)) + if (!generate_event_add_remove(sink, evt, event_args, context)) return false; - if (!generate_event_trigger(sink, wrapper_evt_name, wrapper_args_type, wrapper_args_template, context)) - return false; - - // Store the delegate for this event in this instance. This is initialized in register_event_proxies() - // We can't initialize them directly here as they depend on the member methods being valid (i.e. - // the constructor being called). - if (!as_generator(scope_tab << "Efl.EventCb evt_" << wrapper_evt_name << "_delegate;\n").generate(sink, attributes::unused, context)) - return false; - - // Callback to be given to C's callback_priority_add - if (!as_generator( - scope_tab << "private void on_" << wrapper_evt_name << "_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal 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.UNHANDLED_EXCEPTION);\n" - << scope_tab << scope_tab << "}\n" - << scope_tab << "}\n\n" - ).generate(sink, attributes::unused, context)) + if (!generate_event_trigger(sink, evt, wrapper_evt_name, wrapper_args_type, event_native_call, context)) return false; return true; @@ -275,21 +355,26 @@ struct event_definition_generator template bool generate_event_trigger(OutputIterator sink + , attributes::event_def const &evt , std::string const& event_name , std::string const& event_args_type - , std::string const& event_template_args - , Context context) const + , std::string const& event_native_call + , Context const& context) const { - auto delegate_type = "EventHandler" + event_template_args; + auto library_name = context_find_tag(context).actual_library_name(klass.filename); + std::string upper_c_name = utils::to_uppercase(evt.c_name); if (!as_generator( scope_tab << "///Method to raise event "<< event_name << ".\n" - << scope_tab << "public void On_" << event_name << "(" << event_args_type << " e)\n" + << scope_tab << "public void On" << event_name << "(" << event_args_type << " e)\n" << scope_tab << "{\n" - << scope_tab << scope_tab << delegate_type << " evt;\n" - << scope_tab << scope_tab << "lock (eventLock) {\n" - << scope_tab << scope_tab << "evt = (" << delegate_type << ")eventHandlers[" << event_name << "Key];\n" - << scope_tab << scope_tab << "}\n" - << scope_tab << scope_tab << "evt?.Invoke(this, e);\n" + << scope_tab << scope_tab << "var key = \"_" << upper_c_name << "\";\n" + << scope_tab << scope_tab << "IntPtr desc = Efl.EventDescription.GetNative(" << library_name << ", key);\n" + << scope_tab << scope_tab << "if (desc == IntPtr.Zero)\n" + << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Failed to get native event {key}\");\n" + << scope_tab << scope_tab << scope_tab << "return;\n" + << scope_tab << scope_tab << "}\n\n" + << event_native_call << scope_tab << "}\n" ).generate(sink, nullptr, context)) return false; @@ -298,27 +383,49 @@ struct event_definition_generator } template - bool generate_event_add_remove(OutputIterator sink, attributes::event_def const &evt, const std::string& event_name, Context context) const + bool generate_event_add_remove(OutputIterator sink + , attributes::event_def const &evt + , std::string const& event_args + , Context const& context) const { std::string upper_c_name = utils::to_uppercase(evt.c_name); + auto unit = (const Eolian_Unit*) context_find_tag(context).state; + attributes::klass_def klass(get_klass(evt.klass, unit), unit); + auto library_name = context_find_tag(context).actual_library_name(klass.filename); return as_generator( scope_tab << "{\n" - << scope_tab << scope_tab << "add {\n" - << scope_tab << scope_tab << scope_tab << "lock (eventLock) {\n" + << scope_tab << scope_tab << "add\n" + << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << "lock (eventLock)\n" + << scope_tab << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "var wRef = new WeakReference(this);\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "var obj = wRef.Target as Efl.Eo.IWrapper;\n" + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "if (obj != null)\n" + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << event_args + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "try\n" + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "value?.Invoke(obj, args);\n" + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "}\n" + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "catch (Exception e)\n" + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Error(e.ToString());\n" + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);\n" + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "}\n" + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "}\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "};\n\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 << "eventHandlers.AddHandler(" << event_name << "Key , 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 << scope_tab << "AddNativeEventHandler(" << library_name << ", key, callerCb, value);\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 << "}\n\n" + << scope_tab << scope_tab << "remove\n" + << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << "lock (eventLock)\n" + << scope_tab << scope_tab << scope_tab << "{\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 << "eventHandlers.RemoveHandler(" << event_name << "Key , 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 << scope_tab << "RemoveNativeEventHandler(" << library_name << ", key, value);\n" << scope_tab << scope_tab << scope_tab << "}\n" // End of lock block << scope_tab << scope_tab << "}\n" << scope_tab << "}\n" @@ -349,13 +456,6 @@ struct is_eager_generator : s template <> struct is_generator : std::true_type {}; -template <> -struct is_eager_generator : std::true_type {}; -template <> -struct is_generator : std::true_type {}; -template <> -struct is_generator : std::true_type {}; - template <> struct is_eager_generator : std::true_type {}; template <> @@ -369,10 +469,6 @@ struct attributes_needed template <> struct attributes_needed : std::integral_constant {}; template <> -struct attributes_needed : std::integral_constant {}; -template <> -struct attributes_needed : std::integral_constant {}; -template <> struct attributes_needed : std::integral_constant {}; template <> struct attributes_needed : std::integral_constant {}; diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh index 5a78bc735f..23025480c0 100644 --- a/src/bin/eolian_mono/eolian/mono/function_definition.hh +++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh @@ -32,41 +32,50 @@ struct native_function_definition_generator bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const { EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "native_function_definition_generator: " << f.c_name << std::endl; - if(blacklist::is_function_blacklisted(f, context) || f.is_static) // Only Concrete classes implement static methods. + if(blacklist::is_function_blacklisted(f, context)) return true; else { if(!as_generator ("\n\n" << scope_tab - << eolian_mono::marshall_native_annotation(true) + << eolian_mono::marshall_annotation(true) << " private delegate " << eolian_mono::marshall_type(true) << " " << string - << "_delegate(System.IntPtr obj, System.IntPtr pd" - << *grammar::attribute_reorder<-1, -1> + << "_delegate(" << (f.is_static ? "" : "System.IntPtr obj, System.IntPtr pd") + << ((!f.is_static && f.parameters.size() > 0) ? ", " : "") + << (grammar::attribute_reorder<-1, -1> ( - (", " << marshall_native_annotation << " " << marshall_parameter) - ) + (marshall_annotation << " " << marshall_parameter) + ) % ", ") << ");\n") .generate(sink, std::make_tuple(f.return_type, f.return_type, f.c_name, f.parameters), context)) return false; if(!as_generator - (scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag(context).actual_library_name(f.filename) << ")] " - << eolian_mono::marshall_native_annotation(true) - << " private static extern " + ("\n\n" << scope_tab + << eolian_mono::marshall_annotation(true) + << " public delegate " << eolian_mono::marshall_type(true) - << " " << string - << "(System.IntPtr obj" - << *grammar::attribute_reorder<-1, -1> + << " " + << string << "_api_delegate(" << (f.is_static ? "" : "System.IntPtr obj") + << ((!f.is_static && f.parameters.size() > 0) ? ", " : "") + << (grammar::attribute_reorder<-1, -1> ( - (", " << marshall_native_annotation << " " << marshall_parameter) - ) + (marshall_annotation << " " << marshall_parameter) + ) % ", ") << ");\n") .generate(sink, std::make_tuple(f.return_type, f.return_type, f.c_name, f.parameters), context)) return false; + if(!as_generator + (scope_tab + << " public static Efl.Eo.FunctionWrapper<" << string << "_api_delegate> " << string << "_ptr = new Efl.Eo.FunctionWrapper<" + << string << "_api_delegate>(_Module, \"" << string << "\");\n") + .generate(sink, std::make_tuple(f.c_name, f.c_name, f.c_name, f.c_name), context)) + return false; + std::string return_type; if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context)) return false; @@ -77,6 +86,11 @@ struct native_function_definition_generator else klass_cast_name = name_helpers::klass_interface_name(*klass); + std::string self = "Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))"; + + if (f.is_static) + self = ""; + if(!as_generator (scope_tab << " private static " @@ -89,11 +103,12 @@ struct native_function_definition_generator /****/ << scope_tab << scope_tab << "Eina.Log.Debug(\"function " << string << " was called\");\n" /****/ - << scope_tab << scope_tab << "Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);\n" + << scope_tab << scope_tab << "Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);\n" << 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 = " : "") << "((" << klass_cast_name << ")wrapper)." << string + << scope_tab << scope_tab << scope_tab << scope_tab << (return_type != "void" ? "_ret_var = " : "") + << (f.is_static ? "" : "((") << klass_cast_name << (f.is_static ? "." : ")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" @@ -101,8 +116,8 @@ struct native_function_definition_generator << scope_tab << scope_tab << scope_tab << "}\n" << 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, " << "Efl.Eo.Globals.efl_class_get(obj))" << *(", " << argument) << ");\n" + << scope_tab << scope_tab << scope_tab << (return_type != "void" ? "return " : "") << string + << "_ptr.Value.Delegate(" << self << ((!f.is_static && f.parameters.size() > 0) ? ", " : "") << (argument % ", ") << ");\n" << scope_tab << scope_tab << "}\n" << scope_tab << "}\n" ) @@ -118,9 +133,13 @@ struct native_function_definition_generator , context)) return false; + // Static functions do not need to be called from C + if (f.is_static) + return true; + // This is the delegate that will be passed to Eo to be called from C. if(!as_generator( - scope_tab << "private " << f.c_name << "_delegate " << f.c_name << "_static_delegate;\n" + scope_tab << "private static " << f.c_name << "_delegate " << f.c_name << "_static_delegate;\n" ).generate(sink, attributes::unused, context)) return false; return true; @@ -141,21 +160,6 @@ struct function_definition_generator if(blacklist::is_function_blacklisted(f, context)) return true; - if(!as_generator - ("\n\n" << scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag(context).actual_library_name(f.filename) << ")]\n" - << scope_tab << eolian_mono::marshall_annotation(true) - << (do_super ? " protected " : " private ") << "static extern " - << eolian_mono::marshall_type(true) - << " " << string - << "(System.IntPtr obj" - << *grammar::attribute_reorder<-1, -1> - ( - (", " << marshall_annotation << " " << marshall_parameter) - ) - << ");\n") - .generate(sink, std::make_tuple(f.return_type, f.return_type, f.c_name, f.parameters), context)) - return false; - std::string return_type; if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context)) return false; @@ -169,15 +173,17 @@ struct function_definition_generator // inherited is set in the constructor, true if this instance is from a pure C# class (not generated). if (do_super && !f.is_static) self = "(inherited ? Efl.Eo.Globals.efl_super(" + self + ", this.NativeClass) : " + self + ")"; - else - self = name_helpers::klass_get_full_name(f.klass) + "()"; + else if (f.is_static) + self = ""; if(!as_generator (scope_tab << ((do_super && !f.is_static) ? "virtual " : "") << "public " << (f.is_static ? "static " : "") << return_type << " " << string << "(" << (parameter % ", ") << ") {\n " - << eolian_mono::function_definition_preamble() << string << "(" + << eolian_mono::function_definition_preamble() + << klass_full_native_inherit_name(f.klass) << "." << string << "_ptr.Value.Delegate(" << self - << *(", " << argument_invocation ) << ");\n" + << ((!f.is_static && (f.parameters.size() > 0)) ? "," : "") + << (argument_invocation % ", ") << ");\n" << eolian_mono::function_definition_epilogue() << " }\n") .generate(sink, std::make_tuple(name_helpers::managed_method_name(f), f.parameters, f, f.c_name, f.parameters, f), context)) @@ -211,9 +217,9 @@ struct native_function_definition_parameterized struct property_wrapper_definition_generator { template - bool generate(OutputIterator sink, attributes::property_def const& property, Context context) const + bool generate(OutputIterator sink, attributes::property_def const& property, Context const& context) const { - if (blacklist::is_property_blacklisted(property, context)) + if (blacklist::is_property_blacklisted(property, *implementing_klass, context)) return true; bool interface = context_find_tag(context).current_wrapper_kind == class_context::interface; @@ -261,12 +267,12 @@ struct property_wrapper_definition_generator return false; if (property.getter.is_engaged()) - if (!as_generator(scope_tab << scope_tab << "get " << (interface ? ";" : "{ return Get" + managed_name + "(); }") << "\n" + if (!as_generator(scope_tab << scope_tab << "get " << (interface ? ";" : "{ return " + name_helpers::managed_method_name(*property.getter) + "(); }") << "\n" ).generate(sink, attributes::unused, context)) return false; if (property.setter.is_engaged()) - if (!as_generator(scope_tab << scope_tab << "set " << (interface ? ";" : "{ Set" + managed_name + "(" + dir_mod + "value); }") << "\n" + if (!as_generator(scope_tab << scope_tab << "set " << (interface ? ";" : "{ " + name_helpers::managed_method_name(*property.setter) + "(" + dir_mod + "value); }") << "\n" ).generate(sink, attributes::unused, context)) return false; @@ -275,7 +281,19 @@ struct property_wrapper_definition_generator return true; } + attributes::klass_def const* implementing_klass; +}; +struct property_wrapper_definition_parameterized +{ + property_wrapper_definition_generator operator()(attributes::klass_def const& klass) const + { + return {&klass}; + } } const property_wrapper_definition; +property_wrapper_definition_generator as_generator(property_wrapper_definition_parameterized) +{ + return {}; +} } @@ -288,6 +306,8 @@ struct is_eager_generator< ::eolian_mono::native_function_definition_generator> template <> struct is_eager_generator< ::eolian_mono::property_wrapper_definition_generator> : std::true_type {}; template <> +struct is_eager_generator< ::eolian_mono::property_wrapper_definition_parameterized> : std::true_type {}; +template <> struct is_generator< ::eolian_mono::function_definition_generator> : std::true_type {}; template <> struct is_generator< ::eolian_mono::native_function_definition_generator> : std::true_type {}; @@ -295,6 +315,8 @@ template <> struct is_generator< ::eolian_mono::function_definition_parameterized> : std::true_type {}; template <> struct is_generator< ::eolian_mono::property_wrapper_definition_generator> : std::true_type {}; +template <> +struct is_generator< ::eolian_mono::property_wrapper_definition_parameterized> : std::true_type {}; namespace type_traits { template <> @@ -308,6 +330,8 @@ struct attributes_needed< ::eolian_mono::native_function_definition_generator> : template <> struct attributes_needed< ::eolian_mono::property_wrapper_definition_generator> : std::integral_constant {}; +template <> +struct attributes_needed< ::eolian_mono::property_wrapper_definition_parameterized> : std::integral_constant {}; } } } } diff --git a/src/bin/eolian_mono/eolian/mono/function_pointer.hh b/src/bin/eolian_mono/eolian/mono/function_pointer.hh index 2c62abeb12..f724d8029e 100644 --- a/src/bin/eolian_mono/eolian/mono/function_pointer.hh +++ b/src/bin/eolian_mono/eolian/mono/function_pointer.hh @@ -9,15 +9,17 @@ #include "function_helpers.hh" #include "documentation.hh" #include "generation_contexts.hh" +#include "blacklist.hh" namespace eolian_mono { // Blacklist structs that require some kind of manual binding. -static bool is_function_ptr_blacklisted(attributes::function_def const& func) +template +static bool is_function_ptr_blacklisted(attributes::function_def const& func, Context const& context) { std::string name = name_helpers::function_ptr_full_eolian_name(func); - return false; + return blacklist::is_function_blacklisted(func, context); } struct function_pointer { @@ -28,13 +30,13 @@ struct function_pointer { // FIXME export Typedecl in eolian_cxx API auto funcptr_ctx = context_add_tag(class_context{class_context::function_ptr}, context); + if (is_function_ptr_blacklisted(f, context)) + return true; + 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; - if (!name_helpers::open_namespaces(sink, f.namespaces, funcptr_ctx)) return false; @@ -47,14 +49,14 @@ struct function_pointer { .generate(sink, std::make_tuple(f, f.return_type, f_name, f.parameters), funcptr_ctx)) return false; // "Internal" delegate, 1-to-1 with the Unamaged function type - if (!as_generator(marshall_native_annotation(true) + if (!as_generator(marshall_annotation(true) << "public delegate " << marshall_type(true) << " " << string // public? - << "Internal(IntPtr data" << *grammar::attribute_reorder<-1, -1>((", " << marshall_native_annotation << " " << marshall_parameter)) << ");\n") + << "Internal(IntPtr data" << *grammar::attribute_reorder<-1, -1>((", " << marshall_annotation << " " << marshall_parameter)) << ");\n") .generate(sink, std::make_tuple(f.return_type, f.return_type, f_name, f.parameters), funcptr_ctx)) return false; // Wrapper type, with callback matching the Unamanaged one - if (!as_generator("internal class " << f_name << "Wrapper\n" + if (!as_generator("internal class " << f_name << "Wrapper : IDisposable\n" << "{\n\n" << scope_tab << "private " << f_name << "Internal _cb;\n" << scope_tab << "private IntPtr _cb_data;\n" @@ -69,8 +71,31 @@ struct function_pointer { << scope_tab << "~" << f_name << "Wrapper()\n" << scope_tab << "{\n" + << scope_tab << scope_tab << "Dispose(false);\n" + << scope_tab << "}\n\n" + + << scope_tab << "protected virtual void Dispose(bool disposing)\n" + << scope_tab << "{\n" << scope_tab << scope_tab << "if (this._cb_free_cb != null)\n" - << scope_tab << scope_tab << scope_tab << "this._cb_free_cb(this._cb_data);\n" + << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << "if (disposing)\n" + << scope_tab << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "this._cb_free_cb(this._cb_data);\n" + << scope_tab << scope_tab << scope_tab << "}\n" + << scope_tab << scope_tab << scope_tab << "else\n" + << scope_tab << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "Efl.Eo.Globals.ThreadSafeFreeCbExec(this._cb_free_cb, this._cb_data);\n" + << scope_tab << scope_tab << scope_tab << "}\n" + << scope_tab << scope_tab << scope_tab << "this._cb_free_cb = null;\n" + << scope_tab << scope_tab << scope_tab << "this._cb_data = IntPtr.Zero;\n" + << scope_tab << scope_tab << scope_tab << "this._cb = null;\n" + << scope_tab << scope_tab << "}\n" + << scope_tab << "}\n\n" + + << scope_tab << "public void Dispose()\n" + << scope_tab << "{\n" + << scope_tab << scope_tab << "Dispose(true);\n" + << scope_tab << scope_tab << "GC.SuppressFinalize(this);\n" << scope_tab << "}\n\n" << scope_tab << "internal " << type << " ManagedCb(" << (parameter % ",") << ")\n" @@ -80,14 +105,14 @@ struct function_pointer { << scope_tab << "}\n\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 << marshall_annotation(true) + << scope_tab << "internal static " << marshall_type(true) << " Cb(IntPtr cb_data" << *grammar::attribute_reorder<-1, -1>((", " << marshall_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" << 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 << 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.UNHANDLED_EXCEPTION);\n" diff --git a/src/bin/eolian_mono/eolian/mono/function_registration.hh b/src/bin/eolian_mono/eolian/mono/function_registration.hh index 90cbbc485d..fc044e6b72 100644 --- a/src/bin/eolian_mono/eolian/mono/function_registration.hh +++ b/src/bin/eolian_mono/eolian/mono/function_registration.hh @@ -37,21 +37,25 @@ struct function_registration_generator // auto index = index_generator(); if(!as_generator( - scope_tab << scope_tab << f.c_name << "_static_delegate = new " << f.c_name << "_delegate(" << + scope_tab << scope_tab << "if (" << f.c_name << "_static_delegate == null)\n" + << scope_tab << scope_tab << scope_tab << f.c_name << "_static_delegate = new " << f.c_name << "_delegate(" << escape_keyword(f.name) << ");\n" ).generate(sink, attributes::unused, context)) return false; if(!as_generator - (scope_tab << scope_tab << "descs.Add(new Efl_Op_Description() {" + (scope_tab << scope_tab + << "if (methods.FirstOrDefault(m => m.Name == \"" << string << "\") != null)\n" + << scope_tab << scope_tab << scope_tab + << "descs.Add(new Efl_Op_Description() {" #ifdef _WIN32 << "api_func = Marshal.StringToHGlobalAnsi(\"" << string << "\")" #else - << "api_func = Efl.Eo.Globals.dlsym(Efl.Eo.Globals.RTLD_DEFAULT, \"" << string << "\")" + << "api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, \"" << string << "\")" #endif - ", func = Marshal.GetFunctionPointerForDelegate(" << string << "_static_delegate)});\n" + << ", func = Marshal.GetFunctionPointerForDelegate(" << string << "_static_delegate)});\n" ) - .generate(sink, std::make_tuple(f.c_name, f.c_name), context)) + .generate(sink, std::make_tuple(name_helpers::managed_method_name(f), 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 9a1493ab25..dc72696342 100644 --- a/src/bin/eolian_mono/eolian/mono/generation_contexts.hh +++ b/src/bin/eolian_mono/eolian/mono/generation_contexts.hh @@ -1,6 +1,9 @@ #ifndef EOLIAN_MONO_GENERATION_CONTEXTS_HH #define EOLIAN_MONO_GENERATION_CONTEXTS_HH +#include "grammar/context.hpp" +#include "grammar/indentation.hpp" + namespace eolian_mono { struct class_context @@ -14,10 +17,39 @@ struct class_context enums, function_ptr, alias, + variables, }; wrapper_kind current_wrapper_kind; + std::string name; }; +struct indentation_context +{ + constexpr indentation_context(indentation_context const& other) = default; + constexpr indentation_context(efl::eolian::grammar::scope_tab_generator indent) + : indent(indent) + {} + constexpr indentation_context(int n) + : indent(n) + {} + constexpr indentation_context(int n, int m) + : indent(n, m) + {} + efl::eolian::grammar::scope_tab_generator indent; +}; + +template +inline constexpr efl::eolian::grammar::scope_tab_generator const& current_indentation(Context const& context) +{ + return efl::eolian::grammar::context_find_tag(context).indent; +} + +template +inline constexpr Context change_indentation(efl::eolian::grammar::scope_tab_generator const& indent, Context const& context) +{ + return efl::eolian::grammar::context_replace_tag(indentation_context(indent), context); +} + struct library_context { std::string library_name; @@ -47,6 +79,7 @@ struct eolian_state_context { struct options_context { bool want_beta; + std::string examples_dir; }; } diff --git a/src/bin/eolian_mono/eolian/mono/helpers.hh b/src/bin/eolian_mono/eolian/mono/helpers.hh index ed72345009..dffb38b820 100644 --- a/src/bin/eolian_mono/eolian/mono/helpers.hh +++ b/src/bin/eolian_mono/eolian/mono/helpers.hh @@ -102,8 +102,10 @@ std::set interfa // Returns the set of interfaces implemented by this type that haven't been implemented // by a regular parent class. -std::set non_implemented_interfaces(attributes::klass_def const& cls) +template +std::set non_implemented_interfaces(attributes::klass_def const& cls, Context const& context) { + auto options = efl::eolian::grammar::context_find_tag(context); std::set implemented_interfaces; std::set interfaces; @@ -114,6 +116,9 @@ std::set non_imp attributes::klass_def c(get_klass(klass, cls.unit), cls.unit); for(auto&& inherit : c.immediate_inherits) { + if (inherit.is_beta && !options.want_beta) + continue; + switch(inherit.type) { case attributes::class_type::mixin: @@ -221,6 +226,12 @@ inline bool is_unique_event(attributes::event_def const& evt }); } +inline std::vector reorder_constructors(std::vector constructors) +{ + auto is_required = [](attributes::constructor_def const& ctr) { return !ctr.is_optional; }; + std::stable_partition(constructors.begin(), constructors.end(), is_required); + return constructors; +} } // namespace helpers diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh index 6a2c8186eb..fd4c629ffd 100644 --- a/src/bin/eolian_mono/eolian/mono/klass.hh +++ b/src/bin/eolian_mono/eolian/mono/klass.hh @@ -31,20 +31,6 @@ namespace eolian_mono { -template -static bool generate_static_cast_method(OutputIterator sink, grammar::attributes::klass_def const& cls, Context const &context) -{ - return as_generator( - scope_tab << "///Casts obj into an instance of this type.\n" - << scope_tab << "public " << (helpers::has_regular_ancestor(cls) ? "new " : "") <<"static " << name_helpers::klass_concrete_name(cls) << " static_cast(Efl.Object 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 " << name_helpers::klass_concrete_name(cls) << "(obj.NativeHandle);\n" - << scope_tab << "}\n" - ).generate(sink, nullptr, context); -} - template static bool generate_equals_method(OutputIterator sink, Context const &context) { @@ -95,6 +81,13 @@ struct klass 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; + + if (blacklist::is_class_blacklisted(cls, context)) + { + EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "class " << cls.eolian_name << " is blacklisted. Skipping." << std::endl; + return true; + } + std::string suffix, class_type; switch(cls.type) { @@ -103,7 +96,7 @@ struct klass suffix = "CLASS"; break; case attributes::class_type::abstract_: - class_type = "class"; + class_type = "abstract class"; suffix = "CLASS"; break; case attributes::class_type::mixin: @@ -124,7 +117,9 @@ struct klass // Interface class if(class_type == "interface") { - auto iface_cxt = context_add_tag(class_context{class_context::interface}, context); + auto iface_cxt = context_add_tag(class_context{class_context::interface, + name_helpers::klass_full_concrete_or_interface_name(cls)}, + context); if(!as_generator(documentation).generate(sink, cls, iface_cxt)) return false; @@ -170,7 +165,7 @@ struct klass ).generate(sink, p, iface_cxt)) return false; - if (!as_generator(*(property_wrapper_definition)).generate(sink, cls.properties, iface_cxt)) + if (!as_generator(*(property_wrapper_definition(cls))).generate(sink, cls.properties, iface_cxt)) return false; // End of interface declaration @@ -183,7 +178,7 @@ struct klass return false; bool root = !helpers::has_regular_ancestor(cls); - std::set inherit_interfaces = helpers::non_implemented_interfaces(cls); + std::set inherit_interfaces = helpers::non_implemented_interfaces(cls, context); std::vector inherit_classes; std::copy_if(cls.immediate_inherits.begin(), cls.immediate_inherits.end() , std::back_inserter(inherit_classes) @@ -200,16 +195,18 @@ struct klass }); // Concrete class for interfaces, mixins, etc. - if(class_type != "class") + if(class_type != "class" && class_type != "abstract class") { - auto concrete_cxt = context_add_tag(class_context{class_context::concrete}, context); + auto concrete_cxt = context_add_tag(class_context{class_context::concrete, + name_helpers::klass_full_concrete_or_interface_name(cls)}, + 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 " << concrete_name << " : " << "\n" + << "sealed internal class " << concrete_name << " : " << "\n" << (klass_full_concrete_or_interface_name % ",") << "\n" << (inherit_classes.size() > 0 ? ", " : "" ) << interface_name << "\n" << scope_tab << *(", " << name_helpers::klass_full_concrete_or_interface_name) << "\n" @@ -220,16 +217,16 @@ struct klass if (!generate_fields(sink, cls, concrete_cxt)) return false; + bool root = !helpers::has_regular_ancestor(cls); if (!as_generator ( scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag(concrete_cxt).actual_library_name(cls.filename) << ")] internal static extern System.IntPtr\n" << scope_tab << scope_tab << name_helpers::klass_get_name(cls) << "();\n" - << scope_tab << "///Constructs an instance from a native pointer.\n" - << scope_tab << "public " << concrete_name << "(System.IntPtr raw)\n" + << scope_tab << "///Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.\n" + << scope_tab << "private " << concrete_name << "(System.IntPtr raw)" << (root ? "" : " : base(raw)") << "\n" << scope_tab << "{\n" - << scope_tab << scope_tab << "handle = raw;\n" - << scope_tab << scope_tab << "register_event_proxies();\n" + << scope_tab << scope_tab << (root ? "handle = raw;\n" : "") << scope_tab << "}\n" ) .generate(sink, attributes::unused, concrete_cxt)) @@ -238,18 +235,12 @@ struct klass if (!generate_dispose_methods(sink, cls, concrete_cxt)) return false; - if (!generate_static_cast_method(sink, cls, concrete_cxt)) - return false; - if (!generate_equals_method(sink, concrete_cxt)) return false; if (!generate_events(sink, cls, concrete_cxt)) return false; - if (!generate_events_registration(sink, cls, concrete_cxt)) - return false; - // Parts if(!as_generator(*(part_definition)) .generate(sink, cls.parts, concrete_cxt)) return false; @@ -264,24 +255,35 @@ struct klass return false; // Property wrappers - if (!as_generator(*(property_wrapper_definition)).generate(sink, cls.properties, concrete_cxt)) + if (!as_generator(*(property_wrapper_definition(cls))).generate(sink, cls.properties, concrete_cxt)) return false; - for (auto&& klass : helpers::non_implemented_interfaces(cls)) + for (auto&& klass : helpers::non_implemented_interfaces(cls, concrete_cxt)) { attributes::klass_def c(get_klass(klass, cls.unit), cls.unit); - if (!as_generator(*(property_wrapper_definition)).generate(sink, c.properties, concrete_cxt)) + if (!as_generator(*(property_wrapper_definition(cls))).generate(sink, c.properties, concrete_cxt)) return false; } + // Copied from nativeinherit class, used when setting up providers. + if(!as_generator( + scope_tab << "private static IntPtr GetEflClassStatic()\n" + << scope_tab << "{\n" + << scope_tab << scope_tab << "return " << name_helpers::klass_get_full_name(cls) << "();\n" + << scope_tab << "}\n" + ).generate(sink, attributes::unused, concrete_cxt)) + return false; + if(!as_generator("}\n").generate(sink, attributes::unused, concrete_cxt)) return false; } // Inheritable class - if(class_type == "class") + if(class_type == "class" || class_type == "abstract class") { - auto inherit_cxt = context_add_tag(class_context{class_context::inherit}, context); + auto inherit_cxt = context_add_tag(class_context{class_context::inherit, + name_helpers::klass_full_concrete_or_interface_name(cls)}, + context); // Class header if(!as_generator @@ -310,18 +312,12 @@ struct klass if (!generate_dispose_methods(sink, cls, inherit_cxt)) return false; - if (!generate_static_cast_method(sink, cls, inherit_cxt)) - return false; - if (!generate_equals_method(sink, inherit_cxt)) return false; if (!generate_events(sink, cls, inherit_cxt)) return false; - if (!generate_events_registration(sink, cls, inherit_cxt)) - return false; - // Parts if(!as_generator(*(part_definition)) .generate(sink, cls.parts, inherit_cxt)) return false; @@ -336,25 +332,37 @@ struct klass return false; // Property wrappers - if (!as_generator(*(property_wrapper_definition)).generate(sink, cls.properties, inherit_cxt)) + if (!as_generator(*(property_wrapper_definition(cls))).generate(sink, cls.properties, inherit_cxt)) return false; - for (auto&& klass : helpers::non_implemented_interfaces(cls)) + for (auto&& klass : helpers::non_implemented_interfaces(cls, inherit_cxt)) { attributes::klass_def c(get_klass(klass, cls.unit), cls.unit); - if (!as_generator(*(property_wrapper_definition)).generate(sink, c.properties, inherit_cxt)) + if (!as_generator(*(property_wrapper_definition(cls))).generate(sink, c.properties, inherit_cxt)) return false; } + // Copied from nativeinherit class, used when setting up providers. + if(!as_generator( + scope_tab << "private static IntPtr GetEflClassStatic()\n" + << scope_tab << "{\n" + << scope_tab << scope_tab << "return " << name_helpers::klass_get_full_name(cls) << "();\n" + << scope_tab << "}\n" + ).generate(sink, attributes::unused, inherit_cxt)) + return false; + if(!as_generator("}\n").generate(sink, attributes::unused, inherit_cxt)) return false; } // Native Inherit class //if(class_type == "class") { - auto inative_cxt = context_add_tag(class_context{class_context::inherit_native}, context); + auto inative_cxt = context_add_tag(class_context{class_context::inherit_native, + name_helpers::klass_full_concrete_or_interface_name(cls)}, + context); auto native_inherit_name = name_helpers::klass_native_inherit_name(cls); auto inherit_name = name_helpers::klass_inherit_name(cls); + auto implementable_methods = helpers::get_all_implementable_methods(cls); std::string base_name; if(!root) { @@ -364,9 +372,10 @@ struct klass if(!as_generator ( - "public class " << native_inherit_name << " " << (root ? ": Efl.Eo.NativeClass" : (": " + base_name)) <<"{\n" - // << scope_tab << (root ? "protected IntPtr EoKlass { get; set; }\n" : "\n") - << scope_tab << "public " << /*(root ? "" : "new ")*/ "override " << "System.Collections.Generic.List GetEoOps(System.Type type)\n" + "public class " << native_inherit_name << " " << (root ? " : Efl.Eo.NativeClass" : (": " + base_name)) <<"{\n" + << scope_tab << "public " << (root ? "" : "new ") << " static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(" + << context_find_tag(context).actual_library_name(cls.filename) << ");\n" + << scope_tab << "public override System.Collections.Generic.List GetEoOps(System.Type type)\n" << scope_tab << "{\n" << scope_tab << scope_tab << "var descs = new System.Collections.Generic.List();\n" ) @@ -374,8 +383,20 @@ struct klass return false; // Native wrapper registration + // We write them first to a temporary function as the implementable function list may contain + // only non-registrable methods like class functions, leading to unused `methods` variable. + std::string tmp_registration; if(!as_generator(*(function_registration(cls))) - .generate(sink, helpers::get_all_implementable_methods(cls), inative_cxt)) return false; + .generate(std::back_inserter(tmp_registration), implementable_methods, inative_cxt)) + return false; + + if (tmp_registration.find("methods") != std::string::npos) + if (!as_generator( + scope_tab << scope_tab << "var methods = Efl.Eo.Globals.GetUserMethods(type);\n" + << tmp_registration + ).generate(sink, attributes::unused, inative_cxt)) + return false; + if(!root) if(!as_generator(scope_tab << scope_tab << "descs.AddRange(base.GetEoOps(type));\n").generate(sink, attributes::unused, inative_cxt)) @@ -403,10 +424,10 @@ struct klass << scope_tab << "}\n" ).generate(sink, attributes::unused, inative_cxt)) return false; - + // Native method definitions if(!as_generator(*(native_function_definition(cls))) - .generate(sink, helpers::get_all_implementable_methods(cls), inative_cxt)) return false; + .generate(sink, implementable_methods, inative_cxt)) return false; if(!as_generator("}\n").generate(sink, attributes::unused, inative_cxt)) return false; } @@ -428,18 +449,6 @@ struct klass std::string native_inherit_full_name = name_helpers::klass_full_native_inherit_name(cls); auto inherit_name = name_helpers::klass_concrete_name(cls); - // The klass field is static but there is no problem if multiple C# classes inherit from this generated one - // as it is just a simple wrapper, forwarding the Eo calls either to the user API (where C#'s virtual method - // resolution kicks in) or to the base implementation (efl_super). - if (is_inherit) - { - if(!as_generator( - scope_tab << "public " << (root ? "" : "new ") << "static System.IntPtr klass = System.IntPtr.Zero;\n" - << scope_tab << "public " << (root ? "" : "new ") << "static " << native_inherit_full_name << " nativeInherit = new " << native_inherit_full_name << "();\n" - ).generate(sink, attributes::unused, context)) - return false; - } - std::string raw_klass_modifier; if (!root) raw_klass_modifier = "override "; @@ -453,7 +462,7 @@ struct klass << scope_tab << scope_tab << scope_tab << "if (((object)this).GetType() == typeof (" << inherit_name << "))\n" << scope_tab << scope_tab << scope_tab << scope_tab << "return " << native_inherit_full_name << ".GetEflClassStatic();\n" << scope_tab << scope_tab << scope_tab << "else\n" - << scope_tab << scope_tab << scope_tab << scope_tab << "return Efl.Eo.Globals.klasses[((object)this).GetType()];\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];\n" << scope_tab << scope_tab << "}\n" << scope_tab << "}\n" ).generate(sink, attributes::unused, context)) @@ -464,22 +473,21 @@ struct klass return true; if (cls.get_all_events().size() > 0) - if (!as_generator(scope_tab << (is_inherit ? "protected " : "private ") << "EventHandlerList eventHandlers = new EventHandlerList();\n").generate(sink, attributes::unused, context)) + if (!as_generator(scope_tab << visibility << "Dictionary<(IntPtr desc, object evtDelegate), (IntPtr evtCallerPtr, Efl.EventCb evtCaller)> eoEvents = new Dictionary<(IntPtr desc, object evtDelegate), (IntPtr evtCallerPtr, Efl.EventCb evtCaller)>();\n" + << scope_tab << visibility << "readonly object eventLock = new object();\n") + .generate(sink, attributes::unused, context)) return false; if (is_inherit) { if (!as_generator( - scope_tab << "private static readonly object klassAllocLock = new object();\n" - << scope_tab << "protected bool inherited;\n" + scope_tab << "protected bool inherited;\n" ).generate(sink, attributes::unused, context)) return false; } return as_generator( scope_tab << visibility << " System.IntPtr handle;\n" - << scope_tab << "public Dictionary cached_strings = new Dictionary();" << "\n" - << scope_tab << "public Dictionary cached_stringshares = new Dictionary();" << "\n" << scope_tab << "///Pointer to the native instance.\n" << scope_tab << "public System.IntPtr NativeHandle {\n" << scope_tab << scope_tab << "get { return handle; }\n" @@ -495,91 +503,90 @@ struct klass auto native_inherit_name = name_helpers::klass_native_inherit_name(cls); if(!as_generator( - scope_tab << "///Delegate for function to be called from inside the native constructor.\n" - << scope_tab << "public" << (root ? "" : " new") << " delegate void ConstructingMethod(" << inherit_name << " obj);\n" - << scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag(context).actual_library_name(cls.filename) + scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag(context).actual_library_name(cls.filename) << ")] internal static extern System.IntPtr\n" << scope_tab << scope_tab << name_helpers::klass_get_name(cls) << "();\n" ).generate(sink, attributes::unused, context)) return false; + auto all_constructors = helpers::reorder_constructors(cls.get_all_constructors()); + decltype (all_constructors) constructors; - if (!root) - { - return as_generator( + std::copy_if(all_constructors.cbegin(), all_constructors.cend(), std::back_inserter(constructors), [&context](attributes::constructor_def const& ctor) { + return !blacklist::is_function_blacklisted(ctor.function, context); + }); + + // Public (API) constructors + if (!as_generator( scope_tab << "///Creates a new instance.\n" << scope_tab << "///Parent instance.\n" - << scope_tab << "///Delegate to call constructing methods that should be run inside the constructor.\n" - << scope_tab << "public " << inherit_name << "(Efl.Object parent = null, ConstructingMethod init_cb=null) : " - "base(\"" << inherit_name << "\", " << name_helpers::klass_get_name(cls) << "(), typeof(" << inherit_name << "), parent)\n" + << *(documentation) + // For constructors with arguments, the parent is also required, as optional parameters can't come before non-optional paramenters. + << scope_tab << "public " << inherit_name << "(Efl.Object parent" << ((constructors.size() > 0) ? "" : "= null") << "\n" + << scope_tab << scope_tab << scope_tab << *(", " << constructor_param ) << ") :\n" + << scope_tab << scope_tab << (root ? "this" : "base") << "(" << name_helpers::klass_get_name(cls) << "(), typeof(" << inherit_name << "), parent)\n" << scope_tab << "{\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 << constructor_invocation << "\n" ) << scope_tab << scope_tab << "FinishInstantiation();\n" << scope_tab << "}\n" - - << scope_tab << "///Internal constructor to forward the wrapper initialization to the root class.\n" - << scope_tab << "protected " << inherit_name << "(String klass_name, IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(klass_name, base_klass, managed_type, parent) {}\n" - - << scope_tab << "///Constructs an instance from a native pointer.\n" - << scope_tab << "public " << inherit_name << "(System.IntPtr raw)" << (root ? "" : " : base(raw)") << "\n" + << scope_tab << "///Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.\n" + << scope_tab << "protected " << inherit_name << "(System.IntPtr raw)" << (root ? "" : " : base(raw)") << "\n" << scope_tab << "{\n" << scope_tab << scope_tab << (root ? "handle = raw;\n" : "") - << scope_tab << scope_tab << "register_event_proxies();\n" << scope_tab << "}\n" + ).generate(sink, std::make_tuple(constructors, constructors, constructors), context)) + return false; + + // Some abstract classes (like Efl.App) have a simple regular class that is used to instantiate them + // in a controlled manner. These fake-private classes can be returned from C and we use a similarly-named + // private class to be able to instantiate them when they get to the C# world. + if (cls.type == attributes::class_type::abstract_) + { + if (!as_generator( + scope_tab << "[Efl.Eo.PrivateNativeClass]\n" + << scope_tab << "private class " << inherit_name << "Realized : " << inherit_name << "\n" + << scope_tab << "{\n" + << scope_tab << scope_tab << "private " << inherit_name << "Realized(IntPtr ptr) : base(ptr)\n" + << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << "}\n" + << scope_tab << "}\n" + ).generate(sink, attributes::unused, context)) + return false; + } + + // Internal constructors + if (!root) + { + return as_generator( + scope_tab << "///Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.\n" + << scope_tab << "protected " << inherit_name << "(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {}\n" ).generate(sink, attributes::unused, context); - } + + } // Detailed constructors go only in root classes. return as_generator( - scope_tab << "///Creates a new instance.\n" - << scope_tab << "///Parent instance.\n" - << scope_tab << "///Delegate to call constructing methods that should be run inside the constructor.\n" - << scope_tab << "public " << inherit_name << "(Efl.Object parent = null, ConstructingMethod init_cb=null) : this(\"" << inherit_name << "\", " << name_helpers::klass_get_name(cls) << "(), typeof(" << inherit_name << "), parent)\n" - << scope_tab << "{\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 << "FinishInstantiation();\n" - << scope_tab << "}\n" - - << scope_tab << "protected " << inherit_name << "(String klass_name, IntPtr base_klass, System.Type managed_type, Efl.Object parent)\n" + /// Actual root costructor that creates class and instantiates + scope_tab << "protected " << inherit_name << "(IntPtr base_klass, System.Type managed_type, Efl.Object parent)\n" << scope_tab << "{\n" << scope_tab << scope_tab << "inherited = ((object)this).GetType() != managed_type;\n" << scope_tab << scope_tab << "IntPtr actual_klass = base_klass;\n" << scope_tab << scope_tab << "if (inherited) {\n" - << scope_tab << scope_tab << scope_tab << "if (!Efl.Eo.Globals.klasses.ContainsKey(((object)this).GetType())) {\n" - << scope_tab << scope_tab << scope_tab << scope_tab << "lock (klassAllocLock) {\n" - << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "actual_klass = Efl.Eo.Globals.register_class(klass_name, base_klass, ((object)this).GetType());\n" - << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "if (actual_klass == System.IntPtr.Zero) {\n" - << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "throw new System.InvalidOperationException(\"Failed to initialize class '" << inherit_name << "'\");\n" - << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "}\n" - << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "Efl.Eo.Globals.klasses[((object)this).GetType()] = actual_klass;\n" - << scope_tab << scope_tab << scope_tab << scope_tab << "}\n" - << scope_tab << scope_tab << scope_tab << "}\n" - << scope_tab << scope_tab << scope_tab << "else\n" - << scope_tab << scope_tab << scope_tab << scope_tab << "actual_klass = Efl.Eo.Globals.klasses[((object)this).GetType()];\n" + << scope_tab << scope_tab << scope_tab << "actual_klass = Efl.Eo.ClassRegister.GetInheritKlassOrRegister(base_klass, ((object)this).GetType());\n" << scope_tab << scope_tab << "}\n" << scope_tab << scope_tab << "handle = Efl.Eo.Globals.instantiate_start(actual_klass, parent);\n" - << scope_tab << scope_tab << "register_event_proxies();\n" + << scope_tab << scope_tab << "if (inherited)\n" + << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << "Efl.Eo.Globals.PrivateDataSet(this);\n" + << scope_tab << scope_tab << "}\n" << scope_tab << "}\n" << scope_tab << "protected void FinishInstantiation()\n" << scope_tab << "{\n" - << scope_tab << scope_tab << "if (inherited) {\n" - << scope_tab << scope_tab << scope_tab << "Efl.Eo.Globals.data_set(this);\n" - << scope_tab << scope_tab << "}\n" << scope_tab << scope_tab << "handle = Efl.Eo.Globals.instantiate_end(handle);\n" << scope_tab << scope_tab << "Eina.Error.RaiseIfUnhandledException();\n" << scope_tab << "}\n" - << scope_tab << "///Constructs an instance from a native pointer.\n" - << scope_tab << "public " << inherit_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" ).generate(sink, attributes::unused, context); } @@ -587,7 +594,6 @@ struct klass template bool generate_dispose_methods(OutputIterator sink, attributes::klass_def const& cls, Context const& context) const { - std::string name = join_namespaces(cls.namespaces, '.') + cls.eolian_name; if (helpers::has_regular_ancestor(cls)) return true; @@ -595,86 +601,64 @@ struct klass auto inherit_name = name_helpers::klass_concrete_name(cls); + std::string events_gchandle; + if (cls.get_all_events().size() > 0) + { + auto events_gchandle_sink = std::back_inserter(events_gchandle); + if (!as_generator(scope_tab << scope_tab << scope_tab << "if (eoEvents.Count != 0)\n" + << scope_tab << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "GCHandle gcHandle = GCHandle.Alloc(eoEvents);\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "gcHandlePtr = GCHandle.ToIntPtr(gcHandle);\n" + << scope_tab << scope_tab << scope_tab << "}\n\n") + .generate(events_gchandle_sink, attributes::unused, context)) + return false; + } + return as_generator( scope_tab << "///Destructor.\n" << scope_tab << "~" << inherit_name << "()\n" << scope_tab << "{\n" << scope_tab << scope_tab << "Dispose(false);\n" - << scope_tab << "}\n" + << scope_tab << "}\n\n" << scope_tab << "///Releases the underlying native instance.\n" << scope_tab << visibility << "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" - << scope_tab << scope_tab << scope_tab << "handle = System.IntPtr.Zero;\n" + << scope_tab << scope_tab << "if (handle != System.IntPtr.Zero)\n" + << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << "IntPtr h = handle;\n" + << scope_tab << scope_tab << scope_tab << "handle = IntPtr.Zero;\n\n" + + << scope_tab << scope_tab << scope_tab << "IntPtr gcHandlePtr = IntPtr.Zero;\n" + << events_gchandle + + << scope_tab << scope_tab << scope_tab << "if (disposing)\n" + << scope_tab << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "Efl.Eo.Globals.efl_mono_native_dispose(h, gcHandlePtr);\n" + << scope_tab << scope_tab << scope_tab << "}\n" + << scope_tab << scope_tab << scope_tab << "else\n" + << scope_tab << scope_tab << scope_tab << "{\n" + + << scope_tab << scope_tab << scope_tab << scope_tab << "Monitor.Enter(Efl.All.InitLock);\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "if (Efl.All.MainLoopInitialized)\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "Efl.Eo.Globals.efl_mono_thread_safe_native_dispose(h, gcHandlePtr);\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "}\n\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "Monitor.Exit(Efl.All.InitLock);\n" + << scope_tab << scope_tab << scope_tab << "}\n" << scope_tab << scope_tab << "}\n" - << scope_tab << "}\n" + << scope_tab << "}\n\n" << scope_tab << "///Releases the underlying native instance.\n" << scope_tab << "public void Dispose()\n" << scope_tab << "{\n" - << scope_tab << "Efl.Eo.Globals.free_dict_values(cached_strings);" << "\n" - << scope_tab << "Efl.Eo.Globals.free_stringshare_values(cached_stringshares);" << "\n" << scope_tab << scope_tab << "Dispose(true);\n" << scope_tab << scope_tab << "GC.SuppressFinalize(this);\n" - << scope_tab << "}\n" + << scope_tab << "}\n\n" ).generate(sink, attributes::unused, context); } - template - bool generate_events_registration(OutputIterator sink, attributes::klass_def const& cls, Context const& context) const - { - bool root = !helpers::has_regular_ancestor(cls); - std::string virtual_modifier = " "; - - if (!root) - virtual_modifier = "override "; - else - { - if (is_inherit_context(context)) - virtual_modifier = "virtual "; - } - - // Event proxy registration - if (!as_generator( - scope_tab << (is_inherit_context(context) || !root ? "protected " : "") << virtual_modifier << "void register_event_proxies()\n" - << scope_tab << "{\n" - ) - .generate(sink, NULL, context)) - return false; - - // Generate event registrations here - - if (!root) - if (!as_generator(scope_tab << scope_tab << "base.register_event_proxies();\n").generate(sink, NULL, context)) - return false; - - // Assigning the delegates - if (!as_generator(*(event_registration(cls, cls))).generate(sink, cls.events, context)) - return false; - - for (auto&& c : helpers::non_implemented_interfaces(cls)) - { - // Only non-regular types (which declare events through interfaces) need to register them. - if (c.type == attributes::class_type::regular) - continue; - - attributes::klass_def klass(get_klass(c, cls.unit), cls.unit); - - if (!as_generator(*(event_registration(klass, cls))).generate(sink, klass.events, context)) - return false; - } - - if (!as_generator( - scope_tab << "}\n" - ).generate(sink, NULL, context)) - return false; - - return true; - } - template bool generate_events(OutputIterator sink, attributes::klass_def const& cls, Context const& context) const { @@ -686,59 +670,70 @@ struct klass if (!helpers::has_regular_ancestor(cls)) { - if (!as_generator(scope_tab << visibility << "readonly object eventLock = new object();\n" - << scope_tab << visibility << "Dictionary event_cb_count = new Dictionary();\n") - .generate(sink, NULL, context)) - return false; - // Callback registration functions if (!as_generator( - scope_tab << visibility << "bool add_cpp_event_handler(string key, Efl.EventCb evt_delegate) {\n" - << scope_tab << scope_tab << "int event_count = 0;\n" - << 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 == 0) {\n" + scope_tab << "///Adds a new event handler, registering it to the native event. For internal use only.\n" + << scope_tab << "///The name of the native library definining the event.\n" + << scope_tab << "///The name of the native event.\n" + << scope_tab << "///Delegate to be called by native code on event raising.\n" + << scope_tab << "///Managed delegate that will be called by evtCaller on event raising.\n" + << scope_tab << visibility << "void AddNativeEventHandler(string lib, string key, Efl.EventCb evtCaller, object evtDelegate)\n" + << scope_tab << "{\n" - << scope_tab << scope_tab << scope_tab << "IntPtr desc = Efl.EventDescription.GetNative(key);\n" - << scope_tab << scope_tab << scope_tab << "if (desc == IntPtr.Zero) {\n" - << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Failed to get native event {key}\");\n" - << scope_tab << scope_tab << scope_tab << scope_tab << "return false;\n" - << scope_tab << scope_tab << scope_tab << "}\n" + << scope_tab << scope_tab << "IntPtr desc = Efl.EventDescription.GetNative(lib, key);\n" + << scope_tab << scope_tab << "if (desc == IntPtr.Zero)\n" + << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Failed to get native event {key}\");\n" + << scope_tab << scope_tab << "}\n\n" - << scope_tab << scope_tab << scope_tab << " bool result = Efl.Eo.Globals.efl_event_callback_priority_add(handle, desc, 0, 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 add event proxy for event {key}\");\n" - << scope_tab << scope_tab << scope_tab << scope_tab << "return false;\n" - << scope_tab << scope_tab << scope_tab << "}\n" - << scope_tab << scope_tab << scope_tab << "Eina.Error.RaiseIfUnhandledException();\n" - << scope_tab << scope_tab << "} \n" - << scope_tab << scope_tab << "event_cb_count[key]++;\n" - << scope_tab << scope_tab << "return true;\n" - << scope_tab << "}\n" - << scope_tab << visibility << "bool remove_cpp_event_handler(string key, Efl.EventCb evt_delegate) {\n" - << scope_tab << scope_tab << "int event_count = 0;\n" - << 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 << "if (eoEvents.ContainsKey((desc, evtDelegate)))\n" + << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << "Eina.Log.Warning($\"Event proxy for event {key} already registered!\");\n" + << scope_tab << scope_tab << scope_tab << "return;\n" + << scope_tab << scope_tab << "}\n\n" - << scope_tab << scope_tab << scope_tab << "IntPtr desc = Efl.EventDescription.GetNative(key);\n" - << scope_tab << scope_tab << scope_tab << "if (desc == IntPtr.Zero) {\n" - << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Failed to get native event {key}\");\n" - << scope_tab << scope_tab << scope_tab << scope_tab << "return false;\n" - << scope_tab << scope_tab << scope_tab << "}\n" + << scope_tab << scope_tab << "IntPtr evtCallerPtr = Marshal.GetFunctionPointerForDelegate(evtCaller);\n" + << scope_tab << scope_tab << "if (!Efl.Eo.Globals.efl_event_callback_priority_add(handle, desc, 0, evtCallerPtr, IntPtr.Zero))\n" + << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Failed to add event proxy for event {key}\");\n" + << scope_tab << scope_tab << scope_tab << "return;\n" + << scope_tab << scope_tab << "}\n\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 << "eoEvents[(desc, evtDelegate)] = (evtCallerPtr, evtCaller);\n" + << scope_tab << scope_tab << "Eina.Error.RaiseIfUnhandledException();\n" + << scope_tab << "}\n\n" + + << scope_tab << "///Removes the given event handler for the given event. For internal use only.\n" + << scope_tab << "///The name of the native library definining the event.\n" + << scope_tab << "///The name of the native event.\n" + << scope_tab << "///The delegate to be removed.\n" + << scope_tab << visibility << "void RemoveNativeEventHandler(string lib, string key, object evtDelegate)\n" + << scope_tab << "{\n" + + << scope_tab << scope_tab << "IntPtr desc = Efl.EventDescription.GetNative(lib, key);\n" + << scope_tab << scope_tab << "if (desc == IntPtr.Zero)\n" + << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Failed to get native event {key}\");\n" + << scope_tab << scope_tab << scope_tab << "return;\n" + << scope_tab << scope_tab << "}\n\n" + + << scope_tab << scope_tab << "var evtPair = (desc, evtDelegate);\n" + << scope_tab << scope_tab << "if (eoEvents.TryGetValue(evtPair, out var caller))\n" + << scope_tab << scope_tab << "{\n" + + << scope_tab << scope_tab << scope_tab << "if (!Efl.Eo.Globals.efl_event_callback_del(handle, desc, caller.evtCallerPtr, IntPtr.Zero))\n" + << scope_tab << scope_tab << scope_tab << "{\n" << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Failed to remove event proxy for event {key}\");\n" - << scope_tab << scope_tab << scope_tab << scope_tab << "return false;\n" - << scope_tab << scope_tab << scope_tab << "}\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "return;\n" + << scope_tab << scope_tab << scope_tab << "}\n\n" + + << scope_tab << scope_tab << scope_tab << "eoEvents.Remove(evtPair);\n" << scope_tab << scope_tab << scope_tab << "Eina.Error.RaiseIfUnhandledException();\n" - << scope_tab << scope_tab << "} else if (event_count == 0) {\n" - << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Trying to remove proxy for event {key} when there is nothing registered.\");\n" - << scope_tab << scope_tab << scope_tab << "return false;\n" - << scope_tab << scope_tab << "} \n" - << scope_tab << scope_tab << "event_cb_count[key]--;\n" - << scope_tab << scope_tab << "return true;\n" + << scope_tab << scope_tab << "}\n" + << scope_tab << scope_tab << "else\n" + << scope_tab << scope_tab << "{\n" + << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Trying to remove proxy for event {key} when it is nothing registered.\");\n" + << scope_tab << scope_tab << "}\n" << scope_tab << "}\n" ) .generate(sink, NULL, context)) @@ -752,7 +747,7 @@ struct klass // Inherited events // For now, as mixins can inherit from regular classes, we can't filter out inherited events. - auto inherits = helpers::non_implemented_interfaces(cls); + auto inherits = helpers::non_implemented_interfaces(cls, context); for (auto&& c : inherits) { attributes::klass_def klass(get_klass(c, cls.unit), cls.unit); diff --git a/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh b/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh index 6ddb990da8..296b59c04c 100644 --- a/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh +++ b/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh @@ -90,7 +90,7 @@ struct marshall_annotation_visitor_generate {"string", true, [&] { return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]"; }}, - {"string", false, [&] { + {"string", nullptr, [&] { return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]"; }}, {"mstring", true, [&] { @@ -112,10 +112,10 @@ struct marshall_annotation_visitor_generate return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))]"; }}, {"strbuf", true, [&] { - return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufPassOwnershipMarshaler))]"; + return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufPassOwnershipMarshaler))]"; }}, {"strbuf", false, [&] { - return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))]"; + return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))]"; }}, }; @@ -142,12 +142,22 @@ struct marshall_annotation_visitor_generate } bool operator()(attributes::klass_name const& klass_name) const { - 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<"; - return as_generator - ((is_return ? return_prefix : no_return_prefix) - << string << ", Efl.Eo." << (klass_name.base_qualifier & qualifier_info::is_own ? "OwnTag" : "NonOwnTag") << ">))]" - ).generate(sink, name_helpers::klass_full_concrete_name(klass_name), *context); + const char *return_prefix = is_return ? "return:" : ""; + const char *marshal_prefix = "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof("; + + std::string name = name_helpers::klass_full_concrete_name(klass_name); + + if (name == "Efl.Class") + name = "Efl.Eo.MarshalEflClass"; + else + { + std::string own = klass_name.base_qualifier & qualifier_info::is_own ? "OwnTag" : "NonOwnTag"; + name = "Efl.Eo.MarshalEo"; + } + + return as_generator( + lit("[") << return_prefix << marshal_prefix << name << "))]" + ).generate(sink, name, *context); } bool operator()(attributes::complex_type_def const& c) const { @@ -159,118 +169,6 @@ struct marshall_annotation_visitor_generate return true; } }; - -template -struct marshall_native_annotation_visitor_generate -{ - mutable OutputIterator sink; - Context const* context; - std::string c_type; - bool is_out; - bool is_return; - bool is_ptr; - - typedef marshall_type_visitor_generate visitor_type; - typedef bool result_type; - - bool operator()(attributes::regular_type_def const& regular) const - { - using attributes::regular_type_def; - struct match - { - eina::optional name; - eina::optional has_own; - std::function function; - }; - match const parameter_match_table[] = - { - // signed primitives - {"bool", nullptr, [&] { return " [MarshalAs(UnmanagedType.U1)]"; }}, - {"string", true, [&] { - return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]"; - }}, - {"string", false, [&] { - if (is_out) - return ""; - return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]"; - }}, - {"stringshare", true, [&] { - return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringsharePassOwnershipMarshaler))]"; - }}, - {"stringshare", false, [&] { - if (is_out) - 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[] = - { - // signed primitives - {"bool", nullptr, [&] { return " [return: MarshalAs(UnmanagedType.U1)]"; }}, - {"string", true, [&] { - return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]"; - }}, - {"string", false, [&] { return ""; }}, - {"stringshare", true, [&] { - 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 b = call_annotation_match - ((is_return ? return_match_table : parameter_match_table) - , [&] (match const& m) - { - return (!m.name || *m.name == regular.base_type) - && (!m.has_own || *m.has_own == (bool)(regular.base_qualifier & qualifier_info::is_own)) - ; - } - , [&] (std::string const& string) - { - std::copy(string.begin(), string.end(), sink); - return true; - })) - { - return *b; - } - else - { - return true; - } - } - bool operator()(attributes::klass_name const& klass_name) const - { - 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<"; - return as_generator - ((is_return ? return_prefix : no_return_prefix) - << 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& 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; - } -}; - - } } #endif diff --git a/src/bin/eolian_mono/eolian/mono/marshall_type.hh b/src/bin/eolian_mono/eolian/mono/marshall_type.hh index add954ade2..5c350adebe 100644 --- a/src/bin/eolian_mono/eolian/mono/marshall_type.hh +++ b/src/bin/eolian_mono/eolian/mono/marshall_type.hh @@ -13,8 +13,6 @@ template struct marshall_type_visitor_generate; template struct marshall_annotation_visitor_generate; -template -struct marshall_native_annotation_visitor_generate; } /* @@ -73,26 +71,6 @@ struct marshall_annotation_generator bool is_return; }; -struct marshall_native_annotation_generator -{ - marshall_native_annotation_generator(bool is_return = false) - : is_return(is_return) {} - - template - bool generate(OutputIterator sink, attributes::type_def const& type, Context const& context) const - { - return type.original_type.visit(detail::marshall_native_annotation_visitor_generate{sink, &context, type.c_type, false, is_return, type.is_ptr}); - } - template - bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const - { - return param.type.original_type.visit(detail::marshall_native_annotation_visitor_generate{sink, &context, param.type.c_type - , param.direction != attributes::parameter_direction::in, false, param.type.is_ptr}); - } - - bool is_return; -}; - struct marshall_type_terminal { marshall_type_generator const operator()(bool is_return) const @@ -120,19 +98,6 @@ marshall_annotation_generator const as_generator(marshall_annotation_terminal) } -struct marshall_native_annotation_terminal -{ - marshall_native_annotation_generator const operator()(bool is_return) const - { - return marshall_native_annotation_generator(is_return); - } -} const marshall_native_annotation = {}; - -marshall_native_annotation_generator const as_generator(marshall_native_annotation_terminal) -{ - return marshall_native_annotation_generator{}; -} - } namespace efl { namespace eolian { namespace grammar { @@ -158,23 +123,12 @@ struct is_generator< ::eolian_mono::marshall_annotation_generator> : std::true_t template <> struct is_generator< ::eolian_mono::marshall_annotation_terminal> : std::true_type {}; -template <> -struct is_eager_generator< ::eolian_mono::marshall_native_annotation_generator> : std::true_type {}; -template <> -struct is_generator< ::eolian_mono::marshall_native_annotation_generator> : std::true_type {}; -template <> -struct is_generator< ::eolian_mono::marshall_native_annotation_terminal> : std::true_type {}; - namespace type_traits { template <> struct attributes_needed< ::eolian_mono::marshall_annotation_generator> : std::integral_constant {}; template <> struct attributes_needed< ::eolian_mono::marshall_annotation_terminal> : std::integral_constant {}; -template <> -struct attributes_needed< ::eolian_mono::marshall_native_annotation_generator> : std::integral_constant {}; -template <> -struct attributes_needed< ::eolian_mono::marshall_native_annotation_terminal> : std::integral_constant {}; } } } } 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 e14369ad7b..b50c88f768 100644 --- a/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh +++ b/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh @@ -32,7 +32,6 @@ struct marshall_type_visitor_generate bool operator()(attributes::regular_type_def const& regular) const { using attributes::regular_type_def; - bool is_inherit_native = context_find_tag(*context).current_wrapper_kind == class_context::inherit_native; struct match { @@ -47,66 +46,55 @@ struct marshall_type_visitor_generate { regular_type_def r = regular; r.base_qualifier.qualifier ^= qualifier_info::is_ref; - // if(is_out || is_return) - return replace_base_type(r, " System.String"); - // else return replace_base_type(r, " ::efl::eina::string_view"); + return replace_base_type(r, "System.String"); }} , {"string", false, [&] { regular_type_def r = regular; r.base_qualifier.qualifier ^= qualifier_info::is_ref; - if (is_inherit_native && (is_return || is_out)) - return replace_base_type(r, " System.IntPtr"); - return replace_base_type(r, " System.String"); + return replace_base_type(r, "System.String"); }} , {"mstring", true, [&] { regular_type_def r = regular; r.base_qualifier.qualifier ^= qualifier_info::is_ref; - // if(is_out || is_return) - return replace_base_type(r, " System.String"); - // else return replace_base_type(r, " ::efl::eina::string_view"); + return replace_base_type(r, "System.String"); }} , {"mstring", false, [&] { regular_type_def r = regular; r.base_qualifier.qualifier ^= qualifier_info::is_ref; - if (is_inherit_native && (is_return || is_out)) - return replace_base_type(r, " System.IntPtr"); - return replace_base_type(r, " System.String"); + return replace_base_type(r, "System.String"); }} , {"stringshare", true, [&] { regular_type_def r = regular; r.base_qualifier.qualifier ^= qualifier_info::is_ref; - return replace_base_type(r, " System.String"); + return replace_base_type(r, "System.String"); }} , {"stringshare", false, [&] { regular_type_def r = regular; r.base_qualifier.qualifier ^= qualifier_info::is_ref; - if (is_inherit_native && (is_return || is_out)) - return replace_base_type(r, " System.IntPtr"); - else - return replace_base_type(r, " System.String"); + 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"); + return replace_base_type(r, "Eina.Strbuf"); }} , {"Binbuf", true, [&] { regular_type_def r = regular; - r.base_type = " System.IntPtr"; + r.base_type = "System.IntPtr"; r.namespaces.clear(); return r; }} , {"Binbuf", false, [&] { regular_type_def r = regular; - r.base_type = " System.IntPtr"; + r.base_type = "System.IntPtr"; r.namespaces.clear(); return r; }} @@ -115,9 +103,9 @@ struct marshall_type_visitor_generate regular_type_def r = regular; r.namespaces.clear(); if (is_ptr) - r.base_type = " Eina.Value"; + r.base_type = "Eina.Value"; else - r.base_type = " Eina.ValueNative"; + r.base_type = "Eina.ValueNative"; return r; }} , {"any_value", false, [&] @@ -125,23 +113,23 @@ struct marshall_type_visitor_generate regular_type_def r = regular; r.namespaces.clear(); if (is_ptr) - r.base_type = " Eina.Value"; + r.base_type = "Eina.Value"; else - r.base_type = " Eina.ValueNative"; + r.base_type = "Eina.ValueNative"; return r; }} , {"any_value_ptr", true, [&] { regular_type_def r = regular; r.namespaces.clear(); - r.base_type = " Eina.Value"; + r.base_type = "Eina.Value"; return r; }} , {"any_value_ptr", false, [&] { regular_type_def r = regular; r.namespaces.clear(); - r.base_type = " Eina.Value"; + r.base_type = "Eina.Value"; return r; }} , {"void", nullptr, [&] @@ -149,9 +137,9 @@ struct marshall_type_visitor_generate regular_type_def r = regular; r.namespaces.clear(); if (is_out) // @inout too - r.base_type = " System.IntPtr"; + r.base_type = "System.IntPtr"; else - r.base_type = " void"; + r.base_type = "void"; return r; }} }; @@ -159,8 +147,8 @@ struct marshall_type_visitor_generate if (regular.is_struct() && !blacklist::is_struct_blacklisted(regular) && !(bool)(regular.base_qualifier & qualifier_info::is_own)) { if ((is_out || is_return) && is_ptr) - return as_generator(" System.IntPtr").generate(sink, attributes::unused, *context); - return as_generator(string << "_StructInternal") + return as_generator("System.IntPtr").generate(sink, attributes::unused, *context); + return as_generator(string << ".NativeStruct") .generate(sink, name_helpers::type_full_managed_name(regular), *context); } else if (eina::optional b = call_match @@ -173,7 +161,7 @@ struct marshall_type_visitor_generate } , [&] (attributes::type_def::variant_type const& v) { - return v.visit(*this); // we want to keep is_out info + return v.visit(visitor_regular_type_def_printer{sink, context}); // we want to keep is_out info })) { return *b; @@ -181,7 +169,7 @@ struct marshall_type_visitor_generate else if (is_ptr && helpers::need_pointer_conversion(®ular)) { regular_type_def r = regular; - r.base_type = " System.IntPtr"; + r.base_type = "System.IntPtr"; r.namespaces.clear(); return visitor_generate{sink, context, c_type, is_out, is_return, is_ptr}(r); } @@ -193,7 +181,6 @@ struct marshall_type_visitor_generate bool operator()(attributes::klass_name klass_name) const { return visitor_generate{sink, context, c_type, is_out, is_return, is_ptr}(klass_name); - // return as_generator(" System.IntPtr").generate(sink, attributes::unused, *context); } bool operator()(attributes::complex_type_def const& complex) const { @@ -209,37 +196,27 @@ struct marshall_type_visitor_generate { {"array", nullptr, nullptr, [&] { - return regular_type_def{" System.IntPtr", complex.outer.base_qualifier, {}}; - } - } - ,{"inarray", nullptr, nullptr, [&] - { - return regular_type_def{" System.IntPtr", complex.outer.base_qualifier, {}}; + return regular_type_def{"System.IntPtr", complex.outer.base_qualifier, {}}; } } ,{"list", nullptr, nullptr, [&] { - return regular_type_def{" System.IntPtr", complex.outer.base_qualifier, {}}; - } - } - ,{"inlist", nullptr, nullptr, [&] - { - return regular_type_def{" System.IntPtr", complex.outer.base_qualifier, {}}; + return regular_type_def{"System.IntPtr", complex.outer.base_qualifier, {}}; } } ,{"hash", nullptr, nullptr, [&] { - return regular_type_def{" System.IntPtr", complex.outer.base_qualifier, {}}; + return regular_type_def{"System.IntPtr", complex.outer.base_qualifier, {}}; } } ,{"iterator", nullptr, nullptr, [&] { - return regular_type_def{" System.IntPtr", complex.outer.base_qualifier, {}}; + return regular_type_def{"System.IntPtr", complex.outer.base_qualifier, {}}; } } ,{"accessor", nullptr, nullptr, [&] { - return regular_type_def{" System.IntPtr", complex.outer.base_qualifier, {}}; + return regular_type_def{"System.IntPtr", complex.outer.base_qualifier, {}}; } } }; @@ -247,14 +224,8 @@ struct marshall_type_visitor_generate auto default_match = [&] (attributes::complex_type_def const& complex) { regular_type_def no_pointer_regular = complex.outer; - // std::vector pointers; - // pointers.swap(no_pointer_regular.pointers); - // if(is_out) - // pointers.push_back({{attributes::qualifier_info::is_none, {}}, true}); return visitor_type{sink, context, c_type, false}(no_pointer_regular) - && as_generator("<" << (type % ", ") << ">").generate(sink, complex.subtypes, *context) - ; - // && detail::generate_pointers(sink, pointers, *context, false); + && as_generator("<" << (type % ", ") << ">").generate(sink, complex.subtypes, *context); }; if(eina::optional b = call_match @@ -279,12 +250,9 @@ struct marshall_type_visitor_generate return *b; } - //return default_match(complex); return visitor_generate{sink, context, c_type, is_out, is_return, is_ptr}(complex); - // return as_generator(" System.IntPtr").generate(sink, attributes::unused, *context); } }; - } } #endif diff --git a/src/bin/eolian_mono/eolian/mono/name_helpers.hh b/src/bin/eolian_mono/eolian/mono/name_helpers.hh index 8910447ae1..6e913556a2 100644 --- a/src/bin/eolian_mono/eolian/mono/name_helpers.hh +++ b/src/bin/eolian_mono/eolian/mono/name_helpers.hh @@ -38,6 +38,10 @@ inline bool is_equal(std::string const& lhs, std::string const& rhs) } } +// Forward declarations +template +inline std::string klass_concrete_or_interface_name(T const& klass); + inline std::string identity(std::string const& str) { return str; @@ -184,9 +188,21 @@ inline std::string managed_method_name(std::string const& klass, std::string con if (candidate == klass) candidate = "Do" + candidate; + // Avoid clashing with System.Object.GetType + if (candidate == "GetType" || candidate == "SetType") + { + candidate.insert(3, klass); + } + return candidate; } +inline std::string managed_name(std::string const& name, char separator='_') +{ + auto tokens = utils::split(name, separator); + return utils::to_pascal_case(tokens); +} + inline std::string managed_method_name(attributes::function_def const& f) { return managed_method_name(f.klass.eolian_name, f.name); @@ -246,17 +262,26 @@ inline std::string to_field_name(std::string const& in) return utils::capitalize(in); } -inline std::string property_managed_name(const std::string name) + + +template +inline std::string property_managed_name(T const& klass, std::string const& name) { auto names = utils::split(name, '_'); // No need to escape keyword here as it will be capitalized and already // namespaced inside the owner class. - return utils::to_pascal_case(names); + auto managed_name = utils::to_pascal_case(names); + auto managed_klass_name = klass_concrete_or_interface_name(klass); + + if (managed_name == "Type") + managed_name = managed_klass_name + managed_name; + + return managed_name; } inline std::string property_managed_name(attributes::property_def const& property) { - return property_managed_name(property.name); + return property_managed_name(property.klass, property.name); } inline std::string managed_part_name(attributes::part_def const& part) @@ -272,7 +297,11 @@ struct klass_interface_name_generator template std::string operator()(T const& klass) const { - return utils::remove_all(klass.eolian_name, '_'); + std::string name = utils::remove_all(klass.eolian_name, '_'); + if (klass.type == attributes::class_type::mixin || klass.type == attributes::class_type::interface_) + return "I" + name; + else + return name; } template @@ -300,10 +329,23 @@ struct klass_full_interface_name_generator template inline std::string klass_concrete_name(T const& klass) { - std::string name = utils::remove_all(klass.eolian_name, '_'); - if (klass.type == attributes::class_type::regular || klass.type == attributes::class_type::abstract_) - return name; - return name + "Concrete"; + if (klass.type == attributes::class_type::mixin || klass.type == attributes::class_type::interface_) + return klass_interface_name(klass) + "Concrete"; + + return utils::remove_all(klass.eolian_name, '_'); +} + +template +inline std::string klass_concrete_or_interface_name(T const& klass) +{ + switch(klass.type) + { + case attributes::class_type::abstract_: + case attributes::class_type::regular: + return klass_concrete_name(klass); + default: + return klass_interface_name(klass); + } } struct klass_full_concrete_name_generator @@ -358,13 +400,27 @@ inline std::string klass_inherit_name(T const& klass) template inline std::string klass_native_inherit_name(T const& klass) { - return klass_concrete_name(klass) + "NativeInherit"; + switch(klass.type) + { + case attributes::class_type::abstract_: + case attributes::class_type::regular: + return klass_concrete_name(klass) + "NativeInherit"; + default: + return klass_interface_name(klass) + "NativeInherit"; + } } template inline std::string klass_full_native_inherit_name(T const& klass) { - return klass_full_concrete_name(klass) + "NativeInherit"; + switch(klass.type) + { + case attributes::class_type::abstract_: + case attributes::class_type::regular: + return klass_full_concrete_name(klass) + "NativeInherit"; + default: + return klass_full_interface_name(klass) + "NativeInherit"; + } } template @@ -382,13 +438,13 @@ inline std::string klass_get_full_name(T const& clsname) // Events inline std::string managed_event_name(std::string const& name) { - return utils::to_pascal_case(utils::split(name, ','), "") + "Evt"; + return utils::to_pascal_case(utils::split(name, "_,"), "") + "Evt"; } inline std::string managed_event_args_short_name(attributes::event_def const& evt) { std::string ret; - ret = klass_interface_name(evt.klass); + ret = klass_concrete_or_interface_name(evt.klass); return ret + name_helpers::managed_event_name(evt.name) + "_Args"; } @@ -405,7 +461,7 @@ inline std::string translate_inherited_event_name(const attributes::event_def &e // Open/close namespaces template -bool open_namespaces(OutputIterator sink, std::vector namespaces, Context context) +bool open_namespaces(OutputIterator sink, std::vector namespaces, Context const& context) { std::transform(namespaces.begin(), namespaces.end(), namespaces.begin(), managed_namespace); @@ -414,13 +470,18 @@ bool open_namespaces(OutputIterator sink, std::vector namespaces, C } template -bool close_namespaces(OutputIterator sink, std::vector const& namespaces, Context context) +bool close_namespaces(OutputIterator sink, std::vector const& namespaces, Context const& context) { auto close_namespace = *(lit("} ")) << "\n"; return as_generator(close_namespace).generate(sink, namespaces, context); } +std::string constructor_managed_name(std::string full_name) +{ + auto tokens = utils::split(full_name, '.'); + return managed_name(tokens.at(tokens.size()-1)); +} } // namespace name_helpers diff --git a/src/bin/eolian_mono/eolian/mono/parameter.hh b/src/bin/eolian_mono/eolian/mono/parameter.hh index 416cacbe69..acd0c5dfe1 100644 --- a/src/bin/eolian_mono/eolian/mono/parameter.hh +++ b/src/bin/eolian_mono/eolian/mono/parameter.hh @@ -3,6 +3,7 @@ #include "grammar/generator.hpp" #include "grammar/klass_def.hpp" +#include "grammar/attribute_reorder.hpp" #include "grammar/case.hpp" #include "helpers.hh" #include "marshall_type.hh" @@ -34,6 +35,10 @@ namespace eolian_mono { struct native_convert_return_variable_generator; struct convert_function_pointer_generator; struct native_convert_function_pointer_generator; + struct constructor_param_generator; + struct constructor_invocation_generator; + struct constructor_parameter_name_generator; + struct constructor_parameter_name_paremeterized; } namespace efl { namespace eolian { namespace grammar { @@ -232,6 +237,38 @@ template <> struct attributes_needed< ::eolian_mono::native_convert_function_pointer_generator> : std::integral_constant {}; } +template <> +struct is_eager_generator< ::eolian_mono::constructor_param_generator> : std::true_type {}; +template <> +struct is_generator< ::eolian_mono::constructor_param_generator> : std::true_type {}; + +namespace type_traits { +template <> +struct attributes_needed< ::eolian_mono::constructor_param_generator> : std::integral_constant {}; +} + +template <> +struct is_eager_generator< ::eolian_mono::constructor_invocation_generator> : std::true_type {}; +template <> +struct is_generator< ::eolian_mono::constructor_invocation_generator> : std::true_type {}; + +namespace type_traits { +template <> +struct attributes_needed< ::eolian_mono::constructor_invocation_generator> : std::integral_constant {}; +} + +template <> +struct is_eager_generator< ::eolian_mono::constructor_parameter_name_generator> : std::true_type {}; +template <> +struct is_generator< ::eolian_mono::constructor_parameter_name_generator> : std::true_type {}; +template <> +struct is_generator< ::eolian_mono::constructor_parameter_name_paremeterized> : std::true_type {}; + +namespace type_traits { +template <> +struct attributes_needed< ::eolian_mono::constructor_parameter_name_generator> : std::integral_constant {}; +} + } } } namespace eolian_mono { @@ -263,18 +300,10 @@ inline bool param_should_use_out_var(attributes::parameter_def const& param, boo || param_is_acceptable(param, "Eina_Array *", WANT_OWN, WANT_OUT) || param_is_acceptable(param, "const Eina_Array *", !WANT_OWN, WANT_OUT) || param_is_acceptable(param, "const Eina_Array *", WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "Eina_Inarray *", !WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "Eina_Inarray *", WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "const Eina_Inarray *", !WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "const Eina_Inarray *", WANT_OWN, WANT_OUT) || param_is_acceptable(param, "Eina_List *", !WANT_OWN, WANT_OUT) || param_is_acceptable(param, "Eina_List *", WANT_OWN, WANT_OUT) || param_is_acceptable(param, "const Eina_List *", !WANT_OWN, WANT_OUT) || 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, "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) @@ -315,22 +344,14 @@ inline bool param_should_use_in_var(attributes::parameter_def const& param, bool || param_is_acceptable(param, "Eina_Array *", WANT_OWN, !WANT_OUT) || param_is_acceptable(param, "const Eina_Array *", !WANT_OWN, !WANT_OUT) || param_is_acceptable(param, "const Eina_Array *", WANT_OWN, !WANT_OUT) - || param_is_acceptable(param, "Eina_Inarray *", !WANT_OWN, !WANT_OUT) - || param_is_acceptable(param, "Eina_Inarray *", WANT_OWN, !WANT_OUT) - || param_is_acceptable(param, "const Eina_Inarray *", !WANT_OWN, !WANT_OUT) - || param_is_acceptable(param, "const Eina_Inarray *", WANT_OWN, !WANT_OUT) || param_is_acceptable(param, "Eina_List *", !WANT_OWN, !WANT_OUT) || param_is_acceptable(param, "Eina_List *", WANT_OWN, !WANT_OUT) || param_is_acceptable(param, "const Eina_List *", !WANT_OWN, !WANT_OUT) || 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) || param_is_acceptable(param, "Eina_Hash *", WANT_OWN, !WANT_OUT) || param_is_acceptable(param, "const Eina_Hash *", !WANT_OWN, !WANT_OUT) @@ -559,8 +580,8 @@ struct native_convert_in_variable_generator else if (helpers::need_struct_conversion(regular)) { return as_generator( - "var " << string << " = " << type << "_StructConversion.ToManaged(" << escape_keyword(param.param_name) << ");\n" - ).generate(sink, std::make_tuple(in_variable_name(param.param_name), param.type), context); + type << " " << string << " = " << escape_keyword(param.param_name) << ";\n" + ).generate(sink, std::make_tuple(param.type, in_variable_name(param.param_name)), context); } else if (param.type.c_type == "Eina_Binbuf *" || param.type.c_type == "const Eina_Binbuf *") { @@ -582,9 +603,7 @@ struct native_convert_in_variable_generator ).generate(sink, std::make_tuple(in_variable_name(param.param_name), param.type), context); } else if (param.type.c_type == "Eina_Array *" || param.type.c_type == "const Eina_Array *" - || param.type.c_type == "Eina_Inarray *" || param.type.c_type == "const Eina_Inarray *" || 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 *" ) @@ -628,8 +647,8 @@ struct convert_in_variable_generator else if (helpers::need_struct_conversion(regular)) { return as_generator( - "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); + marshall_type << " " << string << " = " << escape_keyword(param.param_name) << ";\n" + ).generate(sink, std::make_tuple(param.type, in_variable_name(param.param_name)), context); } else if (param.type.c_type == "Eina_Binbuf *" || param.type.c_type == "const Eina_Binbuf *") { @@ -670,9 +689,7 @@ struct convert_in_variable_generator return false; } else if (param.type.c_type == "Eina_Array *" || param.type.c_type == "const Eina_Array *" - || param.type.c_type == "Eina_Inarray *" || param.type.c_type == "const Eina_Inarray *" || 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 *" ) @@ -741,18 +758,10 @@ struct convert_out_variable_generator || param_is_acceptable(param, "Eina_Array *", !WANT_OWN, WANT_OUT) || param_is_acceptable(param, "const Eina_Array *", WANT_OWN, WANT_OUT) || param_is_acceptable(param, "const Eina_Array *", !WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "Eina_Inarray *", WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "Eina_Inarray *", !WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "const Eina_Inarray *", WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "const Eina_Inarray *", !WANT_OWN, WANT_OUT) || param_is_acceptable(param, "Eina_List *", WANT_OWN, WANT_OUT) || param_is_acceptable(param, "Eina_List *", !WANT_OWN, WANT_OUT) || param_is_acceptable(param, "const Eina_List *", WANT_OWN, WANT_OUT) || 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, "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) @@ -820,18 +829,10 @@ struct native_convert_out_variable_generator || param_is_acceptable(param, "Eina_Array *", !WANT_OWN, WANT_OUT) || param_is_acceptable(param, "const Eina_Array *", WANT_OWN, WANT_OUT) || param_is_acceptable(param, "const Eina_Array *", !WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "Eina_Inarray *", WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "Eina_Inarray *", !WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "const Eina_Inarray *", WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "const Eina_Inarray *", !WANT_OWN, WANT_OUT) || param_is_acceptable(param, "Eina_List *", WANT_OWN, WANT_OUT) || param_is_acceptable(param, "Eina_List *", !WANT_OWN, WANT_OUT) || param_is_acceptable(param, "const Eina_List *", WANT_OWN, WANT_OUT) || 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, "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) @@ -898,8 +899,8 @@ struct convert_out_assign_generator else if (helpers::need_struct_conversion(regular)) { return as_generator( - string << " = " << type << "_StructConversion.ToManaged(" << out_variable_name(param.param_name) << ");\n" - ).generate(sink, std::make_tuple(escape_keyword(param.param_name), param.type), context); + string << " = " << out_variable_name(param.param_name) << ";\n" + ).generate(sink, escape_keyword(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) @@ -932,18 +933,10 @@ struct convert_out_assign_generator || param_is_acceptable(param, "Eina_Array *", !WANT_OWN, WANT_OUT) || param_is_acceptable(param, "const Eina_Array *", WANT_OWN, WANT_OUT) || param_is_acceptable(param, "const Eina_Array *", !WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "Eina_Inarray *", WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "Eina_Inarray *", !WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "const Eina_Inarray *", WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "const Eina_Inarray *", !WANT_OWN, WANT_OUT) || param_is_acceptable(param, "Eina_List *", WANT_OWN, WANT_OUT) || param_is_acceptable(param, "Eina_List *", !WANT_OWN, WANT_OUT) || param_is_acceptable(param, "const Eina_List *", WANT_OWN, WANT_OUT) || 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, "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) @@ -985,8 +978,8 @@ struct native_convert_in_ptr_assign_generator 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); + string << " = " << in_variable_name(param.param_name) << ";\n" + ).generate(sink, escape_keyword(param.param_name), context); } return true; @@ -1002,8 +995,8 @@ struct convert_in_ptr_assign_generator 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.ToManaged(" << in_variable_name(param.param_name) << ");\n" - ).generate(sink, std::make_tuple(escape_keyword(param.param_name), param.type), context); + string << " = " << in_variable_name(param.param_name) << ";\n" + ).generate(sink, escape_keyword(param.param_name), context); } return true; @@ -1040,8 +1033,8 @@ struct convert_return_generator else if (helpers::need_struct_conversion(regular)) { return as_generator( - "return " << type << "_StructConversion.ToManaged(_ret_var);\n" - ).generate(sink, ret_type, context); + "return _ret_var;\n" + ).generate(sink, nullptr, context); } else if (ret_type.c_type == "Eina_Binbuf *" || ret_type.c_type == "const Eina_Binbuf *") { @@ -1063,9 +1056,7 @@ struct convert_return_generator return false; } else if (ret_type.c_type == "Eina_Array *" || ret_type.c_type == "const Eina_Array *" - || ret_type.c_type == "Eina_Inarray *" || ret_type.c_type == "const Eina_Inarray *" || 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 *" ) @@ -1110,8 +1101,8 @@ struct native_convert_out_assign_generator else if (helpers::need_struct_conversion(regular)) { return as_generator( - 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); + string << " = " << 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_Stringshare *", !WANT_OWN, WANT_OUT)) { @@ -1121,7 +1112,7 @@ struct native_convert_out_assign_generator return false; } return as_generator( - string << "= Efl.Eo.Globals.cached_stringshare_to_intptr(((" << name_helpers::klass_inherit_name(*klass) << ")wrapper).cached_stringshares, " << string << ");\n" + string << "= " << 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)) @@ -1132,7 +1123,7 @@ struct native_convert_out_assign_generator return false; } return as_generator( - string << "= Efl.Eo.Globals.cached_string_to_intptr(((" << name_helpers::klass_inherit_name(*klass) << ")wrapper).cached_strings, " << string << ");\n" + string << " = " << 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) @@ -1182,18 +1173,10 @@ struct native_convert_out_assign_generator || param_is_acceptable(param, "Eina_Array *", !WANT_OWN, WANT_OUT) || param_is_acceptable(param, "const Eina_Array *", WANT_OWN, WANT_OUT) || param_is_acceptable(param, "const Eina_Array *", !WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "Eina_Inarray *", WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "Eina_Inarray *", !WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "const Eina_Inarray *", WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "const Eina_Inarray *", !WANT_OWN, WANT_OUT) || param_is_acceptable(param, "Eina_List *", WANT_OWN, WANT_OUT) || param_is_acceptable(param, "Eina_List *", !WANT_OWN, WANT_OUT) || param_is_acceptable(param, "const Eina_List *", WANT_OWN, WANT_OUT) || 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, "const Eina_Inlist *", WANT_OWN, WANT_OUT) - || param_is_acceptable(param, "const Eina_Inlist *", !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) @@ -1257,8 +1240,8 @@ struct native_convert_return_generator else if (helpers::need_struct_conversion(regular)) { return as_generator( - "return " << type << "_StructConversion.ToInternal(_ret_var);\n" - ).generate(sink, ret_type, context); + "return _ret_var;\n" + ).generate(sink, nullptr, context); } else if (ret_type.c_type == "const char *") { @@ -1270,7 +1253,7 @@ struct native_convert_return_generator return false; } return as_generator( - "return Efl.Eo.Globals.cached_string_to_intptr(((" << name_helpers::klass_inherit_name(*klass) << ")wrapper).cached_strings, _ret_var);\n" + "return _ret_var;\n" ).generate(sink, attributes::unused, context); } else @@ -1288,7 +1271,7 @@ struct native_convert_return_generator return false; } return as_generator( - "return Efl.Eo.Globals.cached_stringshare_to_intptr(((" << name_helpers::klass_inherit_name(*klass) << ")wrapper).cached_stringshares, _ret_var);\n" + "return _ret_var;\n" ).generate(sink, attributes::unused, context); } else @@ -1325,9 +1308,7 @@ struct native_convert_return_generator .generate(sink, attributes::unused, context); } else if (ret_type.c_type == "Eina_Array *" || ret_type.c_type == "const Eina_Array *" - || ret_type.c_type == "Eina_Inarray *" || ret_type.c_type == "const Eina_Inarray *" || 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 *" ) @@ -1436,6 +1417,89 @@ struct native_convert_function_pointer_generator } const native_convert_function_pointer {}; +struct constructor_parameter_name_generator +{ + + template + bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const + { + auto target_name = name_helpers::constructor_managed_name(ctor.name); + + // Only multi-valued constructing methods get their actual parameter names + if (ctor.function.parameters.size() > 1) + target_name += '_' + param.param_name; + + auto name = name_helpers::managed_name(target_name); + name[0] = std::tolower(name[0]); + + return as_generator(string).generate(sink, name, context); + } + + attributes::constructor_def const& ctor; +}; + +struct constructor_parameter_name_parameterized +{ + constructor_parameter_name_generator const operator()(attributes::constructor_def const& ctor) const + { + return {ctor}; + } +} const constructor_parameter_name; + +// Generates the parameters for the given constructor +// If the constructor receives multiple parameters, they get the name +// of the constructor plus the name of the parameter (e.g. DefineParentData, DefineIndex) +struct constructor_param_generator +{ + template + bool generate(OutputIterator sink, attributes::constructor_def const& ctor, Context const& context) const + { + auto params = ctor.function.parameters; + + if (!as_generator( + efl::eolian::grammar::attribute_reorder<1, -1> + (type(false, ctor.is_optional) << " " << constructor_parameter_name(ctor) << (ctor.is_optional ? " = null" : "")) % "," + ).generate(sink, params, context)) + return false; + // } + return true; + } + +} const constructor_param; + +// Generates the invocation of the given parameter +struct constructor_invocation_generator +{ + template + bool generate(OutputIterator sink, attributes::constructor_def const& ctor, Context const& context) const + { + auto params = ctor.function.parameters; + if (!as_generator( + "if (" << + (efl::eolian::grammar::attribute_reorder<-1> + ("Efl.Eo.Globals.ParamHelperCheck(" << constructor_parameter_name(ctor) << ")") % "||") << ")\n" + << scope_tab << scope_tab << scope_tab << name_helpers::managed_method_name(ctor.function) << "(" + ).generate(sink, params, context)) + return false; + + size_t idx = 0; + + for (auto&& param : params) + { + idx++; + if (!as_generator( + "Efl.Eo.Globals.GetParamHelper(" << constructor_parameter_name(ctor) << ")" << ((idx < params.size()) ? ", " : "") + ).generate(sink, param, context)) + return false; + } + + if (!as_generator(");").generate(sink, attributes::unused, context)) + return false; + return true; + } + +} const constructor_invocation; + } #endif diff --git a/src/bin/eolian_mono/eolian/mono/part_definition.hh b/src/bin/eolian_mono/eolian/mono/part_definition.hh index bd12ee2a40..06cdf1584f 100644 --- a/src/bin/eolian_mono/eolian/mono/part_definition.hh +++ b/src/bin/eolian_mono/eolian/mono/part_definition.hh @@ -18,14 +18,16 @@ struct part_definition_generator template bool generate(OutputIterator sink, attributes::part_def const& part, Context const& context) const { + if (blacklist::is_class_blacklisted(part.klass, context)) + return true; + auto part_klass_name = name_helpers::klass_full_concrete_or_interface_name(part.klass); return as_generator(scope_tab << documentation << scope_tab << "public " << part_klass_name << " " << name_helpers::managed_part_name(part) << "\n" << scope_tab << "{\n" << scope_tab << scope_tab << "get\n" << scope_tab << scope_tab << "{\n" - << scope_tab << scope_tab << scope_tab << "Efl.Object obj = efl_part_get(NativeHandle, \"" << part.name << "\");\n" - << scope_tab << scope_tab << scope_tab << "return " << part_klass_name << ".static_cast(obj);\n" + << scope_tab << scope_tab << scope_tab << "return Efl.IPartNativeInherit.efl_part_get_ptr.Value.Delegate(NativeHandle, \"" << part.name << "\") as " << part_klass_name << ";\n" << scope_tab << scope_tab << "}\n" << scope_tab << "}\n" ).generate(sink, part.documentation, context); diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh index 0eda387668..d8f03118e7 100644 --- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh +++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh @@ -21,96 +21,258 @@ inline std::string binding_struct_name(attributes::struct_def const& struct_) return name_helpers::typedecl_managed_name(struct_); } -inline std::string binding_struct_internal_name(attributes::struct_def const& struct_) +inline std::string struct_internal_decl_name() { - return binding_struct_name(struct_) + "_StructInternal"; + return "NativeStruct"; } -struct struct_definition_generator +inline std::string binding_struct_internal_name(attributes::struct_def const& struct_) { - template - 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 - ( - "[StructLayout(LayoutKind.Sequential)]\n" - "public struct " << string << "\n{\n" - ) - .generate(sink, binding_struct_name(struct_), context)) - return false; + return binding_struct_name(struct_) + "." + struct_internal_decl_name(); +} - // iterate struct fields - for (auto const& field : struct_.fields) - { - auto field_name = field.name; - field_name[0] = std::toupper(field_name[0]); // Hack to allow 'static' as a field name - if (!as_generator - ( - documentation(1) - << scope_tab(1) << "public " << type << " " << string << ";\n" - ) - .generate(sink, std::make_tuple(field, field.type, name_helpers::to_field_name(field.name)), context)) - return false; - } +// Conversors generation // - auto struct_name = binding_struct_name(struct_); +struct to_internal_field_convert_generator +{ + template + bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const + { + auto const& indent = current_indentation(context); + auto field_name = name_helpers::to_field_name(field.name); + // FIXME Replace need_struct_conversion(regular) with need_struct_conversion(type) + auto regular = efl::eina::get(&field.type.original_type); + auto klass = efl::eina::get(&field.type.original_type); + auto complex = efl::eina::get(&field.type.original_type); - // Check whether this is an extern struct without declared fields in .eo file and generate a - // placeholder field if positive. - // Mono's JIT is picky when generating function pointer for delegates with empty structs, leading to - // those 'mini-amd64.c condition fields not met' crashes. - if (struct_.fields.size() == 0) - { - if (!as_generator("///Placeholder field\npublic IntPtr field;\n").generate(sink, nullptr, context)) + if (klass) + { + if (!as_generator( + indent << scope_tab << scope_tab << "_internal_struct." << string << " = _external_struct." << string << "?.NativeHandle ?? System.IntPtr.Zero;\n") + .generate(sink, std::make_tuple(field_name, field_name), context)) return false; - } - else - { - // Constructor with default parameters for easy struct initialization - if(!as_generator( - scope_tab << "///Constructor for " << string << ".\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; - } + } + else if ((complex && (complex->outer.base_type == "array" + || complex->outer.base_type == "list" + || complex->outer.base_type == "iterator" + || complex->outer.base_type == "hash")) + || field.type.c_type == "Eina_Binbuf *" || field.type.c_type == "const Eina_Binbuf *") + { + // Always assumes pointer + if (!as_generator( + indent << scope_tab << scope_tab << "_internal_struct." << string << " = _external_struct." << string << ".Handle;\n") + .generate(sink, std::make_tuple(field_name, field_name), context)) + return false; + } + else if (field.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion(regular)) + { + if (!as_generator( + indent << 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 (helpers::need_struct_conversion(regular)) + { + if (!as_generator( + indent << scope_tab << scope_tab << "_internal_struct." << string << " = _external_struct." << string << ";\n") + .generate(sink, std::make_tuple(field_name, field_name), context)) + return false; + } + else if (regular && (regular->base_type == "string" || regular->base_type == "mstring")) + { + if (!as_generator( + indent << scope_tab << scope_tab << "_internal_struct." << string << " = Eina.MemoryNative.StrDup(_external_struct." << string << ");\n") + .generate(sink, std::make_tuple(field_name, field_name), context)) + return false; + } + else if (regular && regular->base_type == "stringshare") + { + if (!as_generator( + indent << scope_tab << scope_tab << "_internal_struct." << string << " = Eina.Stringshare.eina_stringshare_add(_external_struct." << string << ");\n") + .generate(sink, std::make_tuple(field_name, field_name), context)) + return false; + } + else if (field.type.c_type == "Eina_Slice" || field.type.c_type == "const Eina_Slice" + || field.type.c_type == "Eina_Rw_Slice" || field.type.c_type == "const Eina_Rw_Slice") + { + if (!as_generator( + "\n" << + indent << scope_tab << scope_tab << "_internal_struct." << field_name << ".Len = _external_struct." << field_name << ".Len;\n" << + indent << scope_tab << scope_tab << "_internal_struct." << field_name << ".Mem = _external_struct." << field_name << ".Mem;\n") + .generate(sink, attributes::unused, context)) + return false; + } + else if (field.type.c_type == "Eina_Value" || field.type.c_type == "const Eina_Value") + { + if (!as_generator( + indent << scope_tab << scope_tab << "_internal_struct." << string << " = _external_struct." << string << ".GetNative();\n" + ).generate(sink, std::make_tuple(field_name, field_name), context)) + return false; + } + else if (field.type.c_type == "Eina_Value *" || field.type.c_type == "const Eina_Value *") + { + if (!as_generator( + indent << scope_tab << scope_tab << "_internal_struct." << string << " = _external_struct." << string << "?.NativeHandle ?? System.IntPtr.Zero;\n" + ).generate(sink, std::make_tuple(field_name, field_name), context)) + return false; + } + else if (!field.type.is_ptr && regular && regular->base_type == "bool") + { + if (!as_generator( + indent << scope_tab << scope_tab << "_internal_struct." << string << " = _external_struct." << string << " ? (byte)1 : (byte)0;\n") + .generate(sink, std::make_tuple(field_name, field_name), context)) + return false; + } + else if (!field.type.is_ptr && regular && regular->base_type == "char") + { + if (!as_generator( + indent << scope_tab << scope_tab << "_internal_struct." << string << " = (byte)_external_struct." << string << ";\n") + .generate(sink, std::make_tuple(field_name, field_name), context)) + return false; + } + else // primitives and enums + { + if (!as_generator( + indent << scope_tab << scope_tab << "_internal_struct." << string << " = _external_struct." << string << ";\n") + .generate(sink, std::make_tuple(field_name, field_name), context)) + return false; + } + return true; + } +} const to_internal_field_convert {}; - if(!as_generator( - "public static implicit operator " << struct_name << "(IntPtr ptr)\n" - << scope_tab << "{\n" - << scope_tab << scope_tab << "var tmp = (" << struct_name << "_StructInternal)Marshal.PtrToStructure(ptr, typeof(" << struct_name << "_StructInternal));\n" - << scope_tab << scope_tab << "return " << struct_name << "_StructConversion.ToManaged(tmp);\n" - << scope_tab << "}\n" - ).generate(sink, attributes::unused, context)) - return false; +struct to_external_field_convert_generator +{ + template + bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const + { + auto const& indent = current_indentation(context); + auto field_name = name_helpers::to_field_name(field.name); + auto regular = efl::eina::get(&field.type.original_type); + auto klass = efl::eina::get(&field.type.original_type); + auto complex = efl::eina::get(&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" + << indent << scope_tab << scope_tab << "_external_struct." << string + << " = (" << concrete_name << ") Efl.Eo.Globals.CreateWrapperFor(_internal_struct." << string << ");\n" + ).generate(sink, std::make_tuple(field_name, field_name), context)) + return false; + } + else if (field.type.c_type == "Eina_Binbuf *" || field.type.c_type == "const Eina_Binbuf *") + { + if (!as_generator( + indent << scope_tab << scope_tab << "_external_struct." << string << " = new " << type << "(_internal_struct." << string << ", false);\n") + .generate(sink, std::make_tuple(field_name, field.type, field_name), context)) + return false; + } + else if (complex && (complex->outer.base_type == "array" + || complex->outer.base_type == "list" + || complex->outer.base_type == "iterator")) + { + // Always assumes pointer + if (!as_generator( + indent << scope_tab << scope_tab << "_external_struct." << string << " = new " << type << "(_internal_struct." << string << ", false, false);\n") + .generate(sink, std::make_tuple(field_name, field.type, field_name), context)) + return false; + } + else if (complex && complex->outer.base_type == "hash") + { + if (!as_generator( + indent << scope_tab << scope_tab << "_external_struct." << string << " = new " << type << "(_internal_struct." << string << ", false, false, false);\n") + .generate(sink, std::make_tuple(field_name, field.type, field_name), context)) + return false; + } + else if (field.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion(regular)) + { + if (!as_generator( + indent << 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 (helpers::need_struct_conversion(regular)) + { + if (!as_generator( + indent << scope_tab << scope_tab << "_external_struct." << string << " = _internal_struct." << string << ";\n") + .generate(sink, std::make_tuple(field_name, field_name), context)) + return false; + } + else if (regular && (regular->base_type == "string" || regular->base_type == "mstring" || regular->base_type == "stringshare")) + { + if (!as_generator( + indent << scope_tab << scope_tab << "_external_struct." << string << " = Eina.StringConversion.NativeUtf8ToManagedString(_internal_struct." << string << ");\n") + .generate(sink, std::make_tuple(field_name, field_name), context)) + return false; + } + else if (field.type.c_type == "Eina_Slice" || field.type.c_type == "const Eina_Slice" + || field.type.c_type == "Eina_Rw_Slice" || field.type.c_type == "const Eina_Rw_Slice") + { + if (!as_generator( + "\n" << + indent << scope_tab << scope_tab << "_external_struct." << field_name << ".Len = _internal_struct." << field_name << ".Len;\n" << + indent << scope_tab << scope_tab << "_external_struct." << field_name << ".Mem = _internal_struct." << field_name << ".Mem;\n") + .generate(sink, attributes::unused, context)) + return false; + } + else if (field.type.c_type == "Eina_Value" || field.type.c_type == "const Eina_Value") + { + if (!as_generator( + indent << scope_tab << scope_tab << "_external_struct." << string << " = new Eina.Value(_internal_struct." << string << ");\n" + ).generate(sink, std::make_tuple(field_name, field_name), context)) + return false; + } + else if (field.type.c_type == "Eina_Value *" || field.type.c_type == "const Eina_Value *") + { + if (!as_generator( + indent << 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; + } + else if (!field.type.is_ptr && regular && regular->base_type == "bool") + { + if (!as_generator( + indent << scope_tab << scope_tab << "_external_struct." << string << " = _internal_struct." << string << " != 0;\n" + ).generate(sink, std::make_tuple(field_name, field_name), context)) + return false; + } + else if (!field.type.is_ptr && regular && regular->base_type == "char") + { + if (!as_generator( + indent << scope_tab << scope_tab << "_external_struct." << string << " = (char)_internal_struct." << string << ";\n" + ).generate(sink, std::make_tuple(field_name, field_name), context)) + return false; + } + else // primitives and enums + { + if (!as_generator( + indent << scope_tab << scope_tab << "_external_struct." << string << " = _internal_struct." << string << ";\n") + .generate(sink, std::make_tuple(field_name, field_name), context)) + return false; + } + return true; + } +} const to_external_field_convert {}; - if(!as_generator("}\n").generate(sink, attributes::unused, context)) return false; - - return true; - } -} const struct_definition {}; - +// Internal Struct // struct struct_internal_definition_generator { template bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const { + auto const& indent = current_indentation(context); if (!as_generator ( - "///Internal wrapper for struct " << string << ".\n" - "[StructLayout(LayoutKind.Sequential)]\n" - "public struct " << string << "\n{\n" + indent << "///Internal wrapper for struct " << string << ".\n" + << indent << "[StructLayout(LayoutKind.Sequential)]\n" + << indent << "public struct " << string << "\n" + << indent << "{\n" ) - .generate(sink, std::make_tuple<>(binding_struct_name(struct_), binding_struct_internal_name(struct_)), context)) + .generate(sink, std::make_tuple<>(binding_struct_name(struct_), struct_internal_decl_name()), context)) return false; // iterate struct fields @@ -126,13 +288,29 @@ struct struct_internal_definition_generator || regular->base_type == "stringshare" || regular->base_type == "any_value_ptr"))) { - if (!as_generator("///Internal wrapper for field " << field_name << "\n" - << "public System.IntPtr " << field_name << ";\n") + if (!as_generator(indent << scope_tab << "///Internal wrapper for field " << field_name << "\n" + << indent << scope_tab << "public System.IntPtr " << field_name << ";\n") .generate(sink, nullptr, context)) return false; } - else if (!as_generator(scope_tab << eolian_mono::marshall_annotation(false) << "\n" - << scope_tab << "public " << eolian_mono::marshall_type(false) << " " << string << ";\n") + else if (regular && !(regular->base_qualifier & efl::eolian::grammar::attributes::qualifier_info::is_ref) + && regular->base_type == "bool") + { + if (!as_generator(indent << scope_tab << "///Internal wrapper for field " << field_name << "\n" + << indent << scope_tab << "public System.Byte " << field_name << ";\n") + .generate(sink, nullptr, context)) + return false; + } + else if (regular && !(regular->base_qualifier & efl::eolian::grammar::attributes::qualifier_info::is_ref) + && regular->base_type == "char") + { + if (!as_generator(indent << scope_tab << "///Internal wrapper for field " << field_name << "\n" + << indent << scope_tab << "public System.Byte " << field_name << ";\n") + .generate(sink, nullptr, context)) + return false; + } + else if (!as_generator(indent << scope_tab << eolian_mono::marshall_annotation(false) << "\n" + << indent << scope_tab << "public " << eolian_mono::marshall_type(false) << " " << string << ";\n") .generate(sink, std::make_tuple(field.type, field.type, field_name), context)) return false; } @@ -143,261 +321,20 @@ struct struct_internal_definition_generator // those 'mini-amd64.c condition fields not met' crashes. if (struct_.fields.size() == 0) { - if (!as_generator("internal IntPtr field;\n").generate(sink, nullptr, context)) + if (!as_generator(indent << scope_tab << "internal IntPtr field;\n").generate(sink, nullptr, context)) return false; } auto external_name = binding_struct_name(struct_); auto internal_name = binding_struct_internal_name(struct_); - if(!as_generator( - scope_tab << "///Implicit conversion to the internal/marshalling representation.\n" - << scope_tab << "public static implicit operator " << string << "(" << string << " struct_)\n" - << scope_tab << "{\n" - << scope_tab << scope_tab << "return " << string << "_StructConversion.ToManaged(struct_);\n" - << scope_tab << "}\n" - << scope_tab << "///Implicit conversion to the managed representation.\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; - } -} const struct_internal_definition {}; - - -// Conversors generation // - -struct to_internal_field_convert_generator -{ - template - bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const - { - auto field_name = name_helpers::to_field_name(field.name); - auto regular = efl::eina::get(&field.type.original_type); - auto klass = efl::eina::get(&field.type.original_type); - auto complex = efl::eina::get(&field.type.original_type); - - if (klass) - { - if (!as_generator( - scope_tab << scope_tab << "_internal_struct." << string << " = _external_struct." << string << ".NativeHandle;\n") - .generate(sink, std::make_tuple(field_name, field_name), context)) - return false; - } - else if ((complex && (complex->outer.base_type == "array" - || complex->outer.base_type == "inarray" - || complex->outer.base_type == "list" - || complex->outer.base_type == "inlist" - || complex->outer.base_type == "iterator" - || complex->outer.base_type == "hash")) - || field.type.c_type == "Eina_Binbuf *" || field.type.c_type == "const Eina_Binbuf *") - { - // Always assumes pointer - if (!as_generator( - scope_tab << scope_tab << "_internal_struct." << string << " = _external_struct." << string << ".Handle;\n") - .generate(sink, std::make_tuple(field_name, field_name), context)) - return false; - } - 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 (helpers::need_struct_conversion(regular)) - { - if (!as_generator( - 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; - } - else if (regular && (regular->base_type == "string" || regular->base_type == "mstring")) - { - if (!as_generator( - scope_tab << scope_tab << "_internal_struct." << string << " = Eina.MemoryNative.StrDup(_external_struct." << string << ");\n") - .generate(sink, std::make_tuple(field_name, field_name), context)) - return false; - } - else if (regular && regular->base_type == "stringshare") - { - if (!as_generator( - scope_tab << scope_tab << "_internal_struct." << string << " = Eina.Stringshare.eina_stringshare_add(_external_struct." << string << ");\n") - .generate(sink, std::make_tuple(field_name, field_name), context)) - return false; - } - else if (field.type.c_type == "Eina_Slice" || field.type.c_type == "const Eina_Slice" - || field.type.c_type == "Eina_Rw_Slice" || field.type.c_type == "const Eina_Rw_Slice") - { - if (!as_generator( - "\n" << - scope_tab << scope_tab << "_internal_struct." << field_name << ".Len = _external_struct." << field_name << ".Len;\n" << - scope_tab << scope_tab << "_internal_struct." << field_name << ".Mem = _external_struct." << field_name << ".Mem;\n\n") - .generate(sink, attributes::unused, context)) - return false; - } - 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 << ".GetNative();\n" - ).generate(sink, std::make_tuple(field_name, field_name), context)) - return false; - } - 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 << ".NativeHandle;\n" - ).generate(sink, std::make_tuple(field_name, field_name), context)) - return false; - } - else // primitives and enums - { - if (!as_generator( - scope_tab << scope_tab << "_internal_struct." << string << " = _external_struct." << string << ";\n") - .generate(sink, std::make_tuple(field_name, field_name), context)) - return false; - } - return true; - } -} const to_internal_field_convert {}; - -struct to_external_field_convert_generator -{ - template - bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const - { - auto field_name = name_helpers::to_field_name(field.name); - auto regular = efl::eina::get(&field.type.original_type); - auto klass = efl::eina::get(&field.type.original_type); - auto complex = efl::eina::get(&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 - << " = (" << concrete_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_name, field_name), context)) - return false; - } - else if (field.type.c_type == "Eina_Binbuf *" || field.type.c_type == "const Eina_Binbuf *") - { - if (!as_generator( - scope_tab << scope_tab << "_external_struct." << string << " = new " << type << "(_internal_struct." << string << ", false);\n") - .generate(sink, std::make_tuple(field_name, field.type, field_name), context)) - return false; - } - else if (complex && (complex->outer.base_type == "array" - || complex->outer.base_type == "inarray" - || complex->outer.base_type == "list" - || complex->outer.base_type == "inlist" - || complex->outer.base_type == "iterator")) - { - // Always assumes pointer - if (!as_generator( - scope_tab << scope_tab << "_external_struct." << string << " = new " << type << "(_internal_struct." << string << ", false, false);\n") - .generate(sink, std::make_tuple(field_name, field.type, field_name), context)) - return false; - } - else if (complex && complex->outer.base_type == "hash") - { - if (!as_generator( - scope_tab << scope_tab << "_external_struct." << string << " = new " << type << "(_internal_struct." << string << ", false, false, false);\n") - .generate(sink, std::make_tuple(field_name, field.type, field_name), context)) - return false; - } - 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 (helpers::need_struct_conversion(regular)) - { - if (!as_generator( - scope_tab << scope_tab << "_external_struct." << string << " = " << type << "_StructConversion.ToManaged(_internal_struct." << string << ");\n") - .generate(sink, std::make_tuple(field_name, field.type, field_name), context)) - return false; - } - else if (regular && (regular->base_type == "string" || regular->base_type == "mstring" || regular->base_type == "stringshare")) - { - if (!as_generator( - scope_tab << scope_tab << "_external_struct." << string << " = Eina.StringConversion.NativeUtf8ToManagedString(_internal_struct." << string << ");\n") - .generate(sink, std::make_tuple(field_name, field_name), context)) - return false; - } - else if (field.type.c_type == "Eina_Slice" || field.type.c_type == "const Eina_Slice" - || field.type.c_type == "Eina_Rw_Slice" || field.type.c_type == "const Eina_Rw_Slice") - { - if (!as_generator( - "\n" << - scope_tab << scope_tab << "_external_struct." << field_name << ".Len = _internal_struct." << field_name << ".Len;\n" << - scope_tab << scope_tab << "_external_struct." << field_name << ".Mem = _internal_struct." << field_name << ".Mem;\n\n") - .generate(sink, attributes::unused, context)) - return false; - } - 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 << ");\n" - ).generate(sink, std::make_tuple(field_name, field_name), context)) - return false; - } - 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.Ownership.Unmanaged);\n" - ).generate(sink, std::make_tuple(field_name, field_name), context)) - return false; - } - else // primitives and enums - { - if (!as_generator( - scope_tab << scope_tab << "_external_struct." << string << " = _internal_struct." << string << ";\n") - .generate(sink, std::make_tuple(field_name, field_name), context)) - return false; - } - return true; - } -} const to_external_field_convert {}; - -struct struct_binding_conversion_functions_generator -{ - template - bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const - { - // Open conversion class - if (!as_generator - ( - "/// Conversion class for struct " << name_helpers::typedecl_managed_name(struct_) << "\n" - "public static class " << name_helpers::typedecl_managed_name(struct_) << "_StructConversion\n{\n" - ) - .generate(sink, nullptr, context)) - return false; - // to internal - if (!as_generator - ( - scope_tab << "internal static " << string << " ToInternal(" << string << " _external_struct)\n" - << scope_tab << "{\n" - << scope_tab << scope_tab << "var _internal_struct = new " << string << "();\n\n" - ) - .generate(sink, std::make_tuple(binding_struct_internal_name(struct_) - , binding_struct_name(struct_) - , binding_struct_internal_name(struct_) - ), context)) + if (!as_generator( + indent << scope_tab << "///Implicit conversion to the internal/marshalling representation.\n" + << indent << scope_tab << "public static implicit operator " << string << "(" << string << " _external_struct)\n" + << indent << scope_tab << "{\n" + << indent << scope_tab << scope_tab << "var _internal_struct = new " << string << "();\n" + ).generate(sink, std::make_tuple(internal_name, external_name, internal_name), context)) return false; for (auto const& field : struct_.fields) @@ -406,26 +343,17 @@ struct struct_binding_conversion_functions_generator return false; } - if (!as_generator - ( - "\n" - << scope_tab << scope_tab << "return _internal_struct;\n" - << scope_tab << "}\n\n" - ) - .generate(sink, attributes::unused, context)) + if (!as_generator(indent << scope_tab << scope_tab << "return _internal_struct;\n" + << indent << scope_tab << "}\n\n").generate(sink, nullptr, context)) return false; - // to external - if (!as_generator - ( - scope_tab << "internal static " << string << " ToManaged(" << string << " _internal_struct)\n" - << scope_tab << "{\n" - << scope_tab << scope_tab << "var _external_struct = new " << string << "();\n\n" - ) - .generate(sink, std::make_tuple(binding_struct_name(struct_) - , binding_struct_internal_name(struct_) - , binding_struct_name(struct_) - ), context)) + // to managed + if (!as_generator( + indent << scope_tab << "///Implicit conversion to the managed representation.\n" + << indent << scope_tab << "public static implicit operator " << string << "(" << string << " _internal_struct)\n" + << indent << scope_tab << "{\n" + << indent << scope_tab << scope_tab << "var _external_struct = new " << string << "();\n" + ).generate(sink, std::make_tuple(external_name, internal_name, external_name), context)) return false; for (auto const& field : struct_.fields) @@ -434,44 +362,110 @@ struct struct_binding_conversion_functions_generator return false; } - if (!as_generator - ( - "\n" - << scope_tab << scope_tab << "return _external_struct;\n" - << scope_tab << "}\n\n" - ) - .generate(sink, attributes::unused, context)) + if (!as_generator(indent << scope_tab << scope_tab << "return _external_struct;\n" + << indent << scope_tab << "}\n\n").generate(sink, nullptr, context)) return false; - // Close conversion class - if (!as_generator("}\n").generate(sink, attributes::unused, context)) - return false; + // close internal class + if(!as_generator(indent << "}\n\n").generate(sink, attributes::unused, context)) return false; return true; } -} const struct_binding_conversion_functions {}; +} const struct_internal_definition {}; + +// Managed Struct // + +struct struct_definition_generator +{ + template + 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; + auto const& indent = current_indentation(context); + if(!as_generator(documentation).generate(sink, struct_, context)) + return false; + if(!as_generator + ( + indent << "[StructLayout(LayoutKind.Sequential)]\n" + << indent << "public struct " << string << "\n" + << indent << "{\n" + ) + .generate(sink, binding_struct_name(struct_), context)) + return false; + + // iterate struct fields + for (auto const& field : struct_.fields) + { + auto field_name = field.name; + field_name[0] = std::toupper(field_name[0]); // Hack to allow 'static' as a field name + if (!as_generator + ( + indent << scope_tab << documentation + << indent << scope_tab << "public " << type << " " << string << ";\n" + ) + .generate(sink, std::make_tuple(field, field.type, name_helpers::to_field_name(field.name)), context)) + return false; + } + + auto struct_name = binding_struct_name(struct_); + + // Check whether this is an extern struct without declared fields in .eo file and generate a + // placeholder field if positive. + // Mono's JIT is picky when generating function pointer for delegates with empty structs, leading to + // those 'mini-amd64.c condition fields not met' crashes. + if (struct_.fields.size() == 0) + { + if (!as_generator(indent << scope_tab << "///Placeholder field\n" + << indent << scope_tab << "public IntPtr field;\n").generate(sink, nullptr, context)) + return false; + } + else + { + // Constructor with default parameters for easy struct initialization + if(!as_generator( + indent << scope_tab << "///Constructor for " << string << ".\n" + << indent << scope_tab << "public " << string << "(\n" + << ((indent << scope_tab << scope_tab << field_argument_default) % ",\n") + << indent << scope_tab << ")\n" + << indent << scope_tab << "{\n" + << *(indent << scope_tab << scope_tab << field_argument_assignment << ";\n") + << indent << scope_tab << "}\n\n") + .generate(sink, std::make_tuple(struct_name, struct_name, struct_.fields, struct_.fields), context)) + return false; + } + + if(!as_generator( + indent << scope_tab << "public static implicit operator " << struct_name << "(IntPtr ptr)\n" + << indent << scope_tab << "{\n" + << indent << scope_tab << scope_tab << "var tmp = (" << struct_name << ".NativeStruct)Marshal.PtrToStructure(ptr, typeof(" << struct_name << ".NativeStruct));\n" + << indent << scope_tab << scope_tab << "return tmp;\n" + << indent << scope_tab << "}\n\n" + ).generate(sink, attributes::unused, context)) + return false; + + if (!struct_internal_definition.generate(sink, struct_, change_indentation(indent.inc(), context))) + return false; + + if(!as_generator(indent << "}\n\n").generate(sink, attributes::unused, context)) return false; + + return true; + } +} const struct_definition {}; struct struct_entities_generator { template bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const { - if (blacklist::is_struct_blacklisted(struct_)) + if (blacklist::is_struct_blacklisted(struct_, context)) return true; - if (!name_helpers::open_namespaces(sink, struct_.namespaces, context)) return false; if (!struct_definition.generate(sink, struct_, context)) return false; - if (!struct_internal_definition.generate(sink, struct_, context)) - return false; - - if (!struct_binding_conversion_functions.generate(sink, struct_, context)) - return false; - return name_helpers::close_namespaces(sink, struct_.namespaces, context); } @@ -501,11 +495,6 @@ struct is_eager_generator< ::eolian_mono::to_external_field_convert_generator> : template <> struct is_generator< ::eolian_mono::to_external_field_convert_generator> : std::true_type {}; -template <> -struct is_eager_generator< ::eolian_mono::struct_binding_conversion_functions_generator> : std::true_type {}; -template <> -struct is_generator< ::eolian_mono::struct_binding_conversion_functions_generator> : std::true_type {}; - template <> struct is_eager_generator< ::eolian_mono::struct_entities_generator> : std::true_type {}; template <> @@ -524,9 +513,6 @@ struct attributes_needed< ::eolian_mono::to_internal_field_convert_generator> : template <> struct attributes_needed< ::eolian_mono::to_external_field_convert_generator> : std::integral_constant {}; -template <> -struct attributes_needed< ::eolian_mono::struct_binding_conversion_functions_generator> : std::integral_constant {}; - template <> struct attributes_needed< ::eolian_mono::struct_entities_generator> : std::integral_constant {}; } diff --git a/src/bin/eolian_mono/eolian/mono/type.hh b/src/bin/eolian_mono/eolian/mono/type.hh index b968d9e0bc..f6a52853d0 100644 --- a/src/bin/eolian_mono/eolian/mono/type.hh +++ b/src/bin/eolian_mono/eolian/mono/type.hh @@ -14,29 +14,29 @@ struct visitor_generate; struct type_generator { - type_generator(bool is_return = false) - : is_return(is_return) {} + type_generator(bool is_return = false, bool is_optional = false) + : is_return(is_return), is_optional(is_optional) {} template bool generate(OutputIterator sink, attributes::type_def const& type, Context const& context) const { - return type.original_type.visit(visitor_generate{sink, &context, type.c_type, false, is_return, type.is_ptr}); + return type.original_type.visit(visitor_generate{sink, &context, type.c_type, false, is_return, type.is_ptr, is_optional}); } template bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const { return param.type.original_type.visit(visitor_generate{sink, &context, param.type.c_type - , param.direction != attributes::parameter_direction::in, false, param.type.is_ptr}); + , param.direction != attributes::parameter_direction::in, false, param.type.is_ptr, is_optional}); } - bool is_return; + bool is_return, is_optional; }; struct type_terminal { - type_generator const operator()(bool is_return) const + type_generator const operator()(bool is_return, bool is_optional = false) const { - return type_generator(is_return); + return type_generator(is_return, is_optional); } } const type = {}; diff --git a/src/bin/eolian_mono/eolian/mono/type_impl.hh b/src/bin/eolian_mono/eolian/mono/type_impl.hh index 3e4ae8d124..4b3f097dd4 100644 --- a/src/bin/eolian_mono/eolian/mono/type_impl.hh +++ b/src/bin/eolian_mono/eolian/mono/type_impl.hh @@ -26,14 +26,28 @@ attributes::regular_type_def replace_base_integer(attributes::regular_type_def v bool s = std::is_signed::value; switch (sizeof(T)) { - case 1: return s ? replace_base_type(v, " sbyte") : replace_base_type(v, " byte"); - case 2: return s ? replace_base_type(v, " short") : replace_base_type(v, " ushort"); - case 4: return s ? replace_base_type(v, " int") : replace_base_type(v, " uint"); - case 8: return s ? replace_base_type(v, " long") : replace_base_type(v, " ulong"); + case 1: return s ? replace_base_type(v, "sbyte") : replace_base_type(v, "byte"); + case 2: return s ? replace_base_type(v, "short") : replace_base_type(v, "ushort"); + case 4: return s ? replace_base_type(v, "int") : replace_base_type(v, "uint"); + case 8: return s ? replace_base_type(v, "long") : replace_base_type(v, "ulong"); default: return v; } } +template +attributes::regular_type_def replace_base_opt_integer(attributes::regular_type_def v) +{ + bool s = std::is_signed::value; + switch (sizeof(T)) + { + case 1: return s ? replace_base_type(v, "sbyte?") : replace_base_type(v, "byte?"); + case 2: return s ? replace_base_type(v, "short?") : replace_base_type(v, "ushort?"); + case 4: return s ? replace_base_type(v, "int?") : replace_base_type(v, "uint?"); + case 8: return s ? replace_base_type(v, "long?") : replace_base_type(v, "ulong?"); + default: return v; + } +} + inline attributes::complex_type_def replace_outer(attributes::complex_type_def v, attributes::regular_type_def const& regular) { @@ -53,7 +67,28 @@ eina::optional call_match(Array const (&array)[N], F f, A a) } return {nullptr}; } - + +template +struct visitor_regular_type_def_printer +{ + typedef visitor_regular_type_def_printer visitor_type; + typedef bool result_type; + + mutable OutputIterator sink; + Context const* context; + + bool operator()(grammar::attributes::regular_type_def const ®ular) const + { + return as_generator(string).generate(sink, name_helpers::type_full_managed_name(regular), *context); + } + + template + bool operator()(T const&) const + { + return true; + } +}; + template struct visitor_generate { @@ -63,6 +98,7 @@ struct visitor_generate bool is_out; bool is_return; bool is_ptr; + mutable bool is_optional; typedef visitor_generate visitor_type; typedef bool result_type; @@ -76,83 +112,140 @@ struct visitor_generate eina::optional has_own; std::function function; } + const optional_match_table[] = + { + // signed primitives + {"byte", nullptr, [&] { return replace_base_type(regular, "sbyte?"); }} + , {"float", nullptr, [&] { return replace_base_type(regular, "float?"); }} + , {"double", nullptr, [&] { return replace_base_type(regular, "double?"); }} + , {"bool", nullptr, [&] { return replace_base_type(regular, "bool?"); }} + , {"short", nullptr, [&] { return replace_base_opt_integer(regular); }} + , {"int", nullptr, [&] { return replace_base_opt_integer(regular); }} + , {"long", nullptr, [&] { return replace_base_opt_integer(regular); }} + , {"llong", nullptr, [&] { return replace_base_opt_integer(regular); }} + , {"int8", nullptr, [&] { return replace_base_type(regular, "sbyte?"); }} + , {"int16", nullptr, [&] { return replace_base_type(regular, "short?"); }} + , {"int32", nullptr, [&] { return replace_base_type(regular, "int?"); }} + , {"int64", nullptr, [&] { return replace_base_type(regular, "long?"); }} + , {"ssize", nullptr, [&] { return replace_base_opt_integer(regular); }} + // unsigned primitives + , {"ubyte", nullptr, [&] { return replace_base_type(regular, "byte?"); }} + , {"ushort", nullptr, [&] { return replace_base_opt_integer(regular); }} + , {"uint", nullptr, [&] { return replace_base_opt_integer(regular); }} + , {"ulong", nullptr, [&] { return replace_base_opt_integer(regular); }} + , {"ullong", nullptr, [&] { return replace_base_opt_integer(regular); }} + , {"uint8", nullptr, [&] { return replace_base_type(regular, "byte?"); }} + , {"uint16", nullptr, [&] { return replace_base_type(regular, "ushort?"); }} + , {"uint32", nullptr, [&] { return replace_base_type(regular, "uint?"); }} + , {"uint64", nullptr, [&] { return replace_base_type(regular, "ulong?"); }} + , {"size", nullptr, [&] { return replace_base_opt_integer(regular); }} + + , {"ptrdiff", nullptr, [&] { return replace_base_opt_integer(regular); }} + , {"intptr", nullptr, [&] { return replace_base_type(regular, "System.IntPtr?"); }} + , {"uintptr", nullptr, [&] { return replace_base_type(regular, "System.IntPtr?"); }} + , {"void_ptr", nullptr, [&] { return replace_base_type(regular, "System.IntPtr?"); }} + }; + struct match const match_table[] = { // signed primitives - {"byte", nullptr, [&] { return replace_base_type(regular, " sbyte"); }} + {"byte", nullptr, [&] { return replace_base_type(regular, "sbyte"); }} , {"short", nullptr, [&] { return replace_base_integer(regular); }} , {"int", nullptr, [&] { return replace_base_integer(regular); }} , {"long", nullptr, [&] { return replace_base_integer(regular); }} , {"llong", nullptr, [&] { return replace_base_integer(regular); }} - , {"int8", nullptr, [&] { return replace_base_type(regular, " sbyte"); }} - , {"int16", nullptr, [&] { return replace_base_type(regular, " short"); }} - , {"int32", nullptr, [&] { return replace_base_type(regular, " int"); }} - , {"int64", nullptr, [&] { return replace_base_type(regular, " long"); }} + , {"int8", nullptr, [&] { return replace_base_type(regular, "sbyte"); }} + , {"int16", nullptr, [&] { return replace_base_type(regular, "short"); }} + , {"int32", nullptr, [&] { return replace_base_type(regular, "int"); }} + , {"int64", nullptr, [&] { return replace_base_type(regular, "long"); }} , {"ssize", nullptr, [&] { return replace_base_integer(regular); }} // unsigned primitives - , {"ubyte", nullptr, [&] { return replace_base_type(regular, " byte"); }} + , {"ubyte", nullptr, [&] { return replace_base_type(regular, "byte"); }} , {"ushort", nullptr, [&] { return replace_base_integer(regular); }} , {"uint", nullptr, [&] { return replace_base_integer(regular); }} , {"ulong", nullptr, [&] { return replace_base_integer(regular); }} , {"ullong", nullptr, [&] { return replace_base_integer(regular); }} - , {"uint8", nullptr, [&] { return replace_base_type(regular, " byte"); }} - , {"uint16", nullptr, [&] { return replace_base_type(regular, " ushort"); }} - , {"uint32", nullptr, [&] { return replace_base_type(regular, " uint"); }} - , {"uint64", nullptr, [&] { return replace_base_type(regular, " ulong"); }} + , {"uint8", nullptr, [&] { return replace_base_type(regular, "byte"); }} + , {"uint16", nullptr, [&] { return replace_base_type(regular, "ushort"); }} + , {"uint32", nullptr, [&] { return replace_base_type(regular, "uint"); }} + , {"uint64", nullptr, [&] { return replace_base_type(regular, "ulong"); }} , {"size", nullptr, [&] { return replace_base_integer(regular); }} , {"ptrdiff", nullptr, [&] { return replace_base_integer(regular); }} - , {"intptr", nullptr, [&] { return replace_base_type(regular, " System.IntPtr"); }} - , {"uintptr", nullptr, [&] { return replace_base_type(regular, " System.IntPtr"); }} - , {"void_ptr", nullptr, [&] { return replace_base_type(regular, " System.IntPtr"); }} + , {"intptr", nullptr, [&] { return replace_base_type(regular, "System.IntPtr"); }} + , {"uintptr", nullptr, [&] { return replace_base_type(regular, "System.IntPtr"); }} + , {"void_ptr", nullptr, [&] { return replace_base_type(regular, "System.IntPtr"); }} , {"void", nullptr, [&] { regular_type_def r = regular; r.namespaces.clear(); if (is_out) // @inout too - r.base_type = " System.IntPtr"; + r.base_type = "System.IntPtr"; else - r.base_type = " void"; + r.base_type = "void"; return r; }} , {"Eina.Error", nullptr, [&] // Eina.Error { - return regular_type_def{" Eina.Error", regular.base_qualifier, {}}; + return regular_type_def{"Eina.Error", regular.base_qualifier, {}}; }} // TODO , {"string", nullptr, [&] { regular_type_def r = regular; r.base_qualifier.qualifier ^= qualifier_info::is_ref; - return replace_base_type(r, " System.String"); + return replace_base_type(r, "System.String"); }} , {"mstring", nullptr, [&] { regular_type_def r = regular; r.base_qualifier.qualifier ^= qualifier_info::is_ref; - return replace_base_type(r, " System.String"); + return replace_base_type(r, "System.String"); }} , {"stringshare", nullptr, [&] { regular_type_def r = regular; r.base_qualifier.qualifier ^= qualifier_info::is_ref; - return replace_base_type(r, " System.String"); + return replace_base_type(r, "System.String"); }} , {"strbuf", nullptr, [&] { - return regular_type_def{" Eina.Strbuf", regular.base_qualifier, {}}; + return regular_type_def{"Eina.Strbuf", regular.base_qualifier, {}}; }} , {"any_value", true, [&] - { return regular_type_def{" Eina.Value", regular.base_qualifier, {}}; + { return regular_type_def{"Eina.Value", regular.base_qualifier, {}}; }} , {"any_value", false, [&] - { return regular_type_def{" Eina.Value", regular.base_qualifier, {}}; + { return regular_type_def{"Eina.Value", regular.base_qualifier, {}}; }} , {"any_value_ptr", nullptr, [&] - { return regular_type_def{" Eina.Value", regular.base_qualifier, {}}; + { return regular_type_def{"Eina.Value", regular.base_qualifier, {}}; }} // FIXME add proper support for any_value_ptr }; std::string full_type_name = name_helpers::type_full_eolian_name(regular); if(eina::optional b = call_match + (optional_match_table + , [&] (match const& m) + { + return is_optional + && (!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)) + ; + } + , [&] (attributes::type_def::variant_type const& v) + { + return v.visit(*this); // we want to keep is_out info + })) + { + return *b; + } + else if (is_optional && (regular.is_struct() || regular.is_enum() || regular.is_struct_opaque())) + { + attributes::regular_type_def r = regular; + r.base_type.push_back('?'); + is_optional = false; + return (*this)(r); + } + else if(eina::optional b = call_match (match_table , [&] (match const& m) { @@ -162,7 +255,7 @@ struct visitor_generate } , [&] (attributes::type_def::variant_type const& v) { - return v.visit(*this); // we want to keep is_out info + return v.visit(visitor_regular_type_def_printer{sink, context}); // we want to keep is_out info })) { return *b; @@ -237,6 +330,9 @@ struct visitor_generate } bool operator()(attributes::klass_name klass) const { + // Efl.Class is manually handled in a custom marshall to be represented by a System.Type. + if (name_helpers::klass_full_concrete_name(klass) == "Efl.Class") + return as_generator(lit("Type")).generate(sink, attributes::unused, *context); if(klass.type == attributes::class_type::regular || klass.type == attributes::class_type::abstract_) return as_generator(string).generate(sink, name_helpers::klass_full_concrete_name(klass), *context); else @@ -261,24 +357,12 @@ struct visitor_generate c.outer.base_type = "Eina.List"; return c; }} - , {"inlist", nullptr, nullptr, [&] - { - complex_type_def c = complex; - c.outer.base_type = "Eina.Inlist"; - return c; - }} , {"array", nullptr, nullptr, [&] { complex_type_def c = complex; c.outer.base_type = "Eina.Array"; return c; }} - , {"inarray", nullptr, nullptr, [&] - { - complex_type_def c = complex; - c.outer.base_type = "Eina.Inarray"; - return c; - }} , {"hash", nullptr, nullptr , [&] { diff --git a/src/bin/eolian_mono/eolian/mono/utils.hh b/src/bin/eolian_mono/eolian/mono/utils.hh index 0912db8a71..392cb00f11 100644 --- a/src/bin/eolian_mono/eolian/mono/utils.hh +++ b/src/bin/eolian_mono/eolian/mono/utils.hh @@ -30,20 +30,30 @@ namespace eolian_mono { namespace utils { return ret; } - std::vector split(std::string const &input, char delim) + std::vector split(std::string const &input, std::string delims) { - std::stringstream ss(input); - std::string name; std::vector names; + size_t pos = 0; - while (std::getline(ss, name, delim)) + while(pos != std::string::npos) { - if (!name.empty()) - names.push_back(name); + size_t newpos = input.find_first_of(delims, pos); + names.push_back(input.substr(pos, newpos-pos)); + pos = newpos; + + if (pos != std::string::npos) + pos++; } + return names; } + std::vector split(std::string const &input, char delim) + { + return split(input, {1, delim}); + } + + std::string to_pascal_case(const std::vector &names, std::string const& delim="") { std::vector outv(names.size()); @@ -70,6 +80,14 @@ namespace eolian_mono { namespace utils { name.erase(std::remove(name.begin(), name.end(), target), name.end()); return name; } + + inline bool ends_with(std::string const& source, std::string suffix) + { + if (source.size() > suffix.size()) + return (0 == source.compare(source.size() - suffix.size(), suffix.size(), suffix)); + else + return false; + } } } #endif diff --git a/src/bin/eolian_mono/eolian/mono/variable_definition.hh b/src/bin/eolian_mono/eolian/mono/variable_definition.hh new file mode 100644 index 0000000000..f13efdecc2 --- /dev/null +++ b/src/bin/eolian_mono/eolian/mono/variable_definition.hh @@ -0,0 +1,99 @@ +#ifndef EOLIAN_MONO_VARIABLE_DEFINITION_HH +#define EOLIAN_MONO_VARIABLE_DEFINITION_HH + +#include + +#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 constant_definition_generator +{ + template + bool generate(OutputIterator sink, attributes::variable_def constant, Context const& context) const + { + // Open partial class + if (!name_helpers::open_namespaces(sink, constant.namespaces, context)) + return false; + + if (!as_generator("public partial class Constants {\n").generate(sink, attributes::unused, context)) + return false; + + std::string literal; + if (constant.expression_value.type == EOLIAN_EXPR_NULL) + literal = "null"; + else if (constant.expression_value.type == EOLIAN_EXPR_BOOL) + literal = (constant.expression_value.value.b ? "true" : "false"); + else + { + auto lit = ::eolian_expression_value_to_literal(&constant.expression_value); + if (!lit) + return false; + + literal = lit; + ::eina_stringshare_del(lit); + + // Cleanup suffix. Roslyn does not accept ULL/LL as it has only longs. + if (utils::ends_with(literal, "LL") || utils::ends_with(literal, "ll")) + literal = literal.substr(0, literal.size() -1); + + } + + // declare variable + if (!as_generator(scope_tab(1) + << "public static readonly " << type + << " " << utils::remove_all(constant.name, '_') + << " = " << literal << ";\n") + .generate(sink, constant.base_type, context)) + return false; + + // FIXME missing documentation generator + + // Close partial class + if (!as_generator("}\n").generate(sink, attributes::unused, context)) + return false; + + if (!name_helpers::close_namespaces(sink, constant.namespaces, context)) + return false; + + return true; + + + } +} const constant_definition; + +} + +namespace efl { namespace eolian { namespace grammar { + +template <> +struct is_eager_generator< ::eolian_mono::constant_definition_generator> : std::true_type {}; +template <> +struct is_generator< ::eolian_mono::constant_definition_generator> : std::true_type {}; + +namespace type_traits { +template <> +struct attributes_needed< ::eolian_mono::constant_definition_generator> : std::integral_constant {}; +} + +} } } + +#endif diff --git a/src/bin/eolian_mono/eolian_mono.cc b/src/bin/eolian_mono/eolian_mono.cc index 235f25082f..8f24f762f0 100644 --- a/src/bin/eolian_mono/eolian_mono.cc +++ b/src/bin/eolian_mono/eolian_mono.cc @@ -33,6 +33,7 @@ #include #include #include +#include namespace eolian_mono { @@ -42,6 +43,7 @@ struct options_type std::vector include_dirs; std::string in_file; std::string out_file; + std::string examples_dir; std::string dllimport; mutable Eolian_State* state; mutable Eolian_Unit const* unit; @@ -133,21 +135,24 @@ run(options_type const& opts) "using System.Runtime.InteropServices;\n" "using System.Collections.Generic;\n" "using System.Linq;\n" + "using System.Threading;\n" "using System.ComponentModel;\n") .generate(iterator, efl::eolian::grammar::attributes::unused, efl::eolian::grammar::context_null())) { throw std::runtime_error("Failed to generate file preamble"); } - auto lib_context = efl::eolian::grammar::context_add_tag(eolian_mono::library_context{opts.dllimport, - opts.v_major, - opts.v_minor, - opts.references_map}, - efl::eolian::grammar::context_null()); + using efl::eolian::grammar::context_add_tag; - auto options_context = efl::eolian::grammar::context_add_tag(eolian_mono::options_context{opts.want_beta}, lib_context); - - auto context = efl::eolian::grammar::context_add_tag(eolian_mono::eolian_state_context{opts.state}, options_context); + auto context = context_add_tag(eolian_mono::indentation_context{0}, + context_add_tag(eolian_mono::eolian_state_context{opts.state}, + context_add_tag(eolian_mono::options_context{opts.want_beta, + opts.examples_dir}, + context_add_tag(eolian_mono::library_context{opts.dllimport, + opts.v_major, + opts.v_minor, + opts.references_map}, + efl::eolian::grammar::context_null())))); EINA_ITERATOR_FOREACH(aliases, tp) { @@ -168,6 +173,20 @@ run(options_type const& opts) } } + // Constants + { + auto var_cxt = context_add_tag(class_context{class_context::variables}, context); + for (efl::eina::iterator var_iterator( ::eolian_state_constants_by_file_get(opts.state, basename_input.c_str())) + , var_last; var_iterator != var_last; ++var_iterator) + { + efl::eolian::grammar::attributes::variable_def var(&*var_iterator, opts.unit); + if (!eolian_mono::constant_definition.generate(iterator, var, var_cxt)) + { + throw std::runtime_error("Failed to generate enum"); + } + } + } + if (klass) { efl::eolian::grammar::attributes::klass_def klass_def(klass, opts.unit); @@ -272,11 +291,12 @@ _usage(const char *progname) << " -c, --class The Eo class name to generate code for." << std::endl << " -D, --out-dir Output directory where generated code will be written." << std::endl << " -I, --in The source containing the .eo descriptions." << std::endl - << " -o, --out-file The output file name. [default: .eo.hh]" << std::endl - << " -n, --namespace Wrap generated code in a namespace. [Eg: efl::ecore::file]" << std::endl + << " -o, --out-file The output file name. [default: .eo.cs]" << std::endl + << " -n, --namespace Wrap generated code in a namespace. [Eg: Efl.Ui.Widget]" << std::endl << " -r, --recurse Recurse input directories loading .eo files." << std::endl << " -v, --version Print the version." << std::endl << " -b, --beta Enable @beta methods." << std::endl + << " -e, --example-dir Folder to search for example files." << std::endl << " -h, --help Print this help." << std::endl; exit(EXIT_FAILURE); } @@ -294,7 +314,7 @@ _assert_not_dup(std::string option, std::string value) static eolian_mono::options_type opts_get(int argc, char **argv) { - eolian_mono::options_type opts; + eolian_mono::options_type opts{}; const struct option long_options[] = { @@ -307,9 +327,10 @@ opts_get(int argc, char **argv) { "vmin", required_argument, 0, 'm' }, { "references", required_argument, 0, 'r'}, { "beta", no_argument, 0, 'b'}, + { "example-dir", required_argument, 0, 'e' }, { 0, 0, 0, 0 } }; - const char* options = "I:D:o:c:M:m:ar:vhb"; + const char* options = "I:D:o:c:M:m:ar:vhbe:"; int c, idx; while ( (c = getopt_long(argc, argv, options, long_options, &idx)) != -1) @@ -365,6 +386,11 @@ opts_get(int argc, char **argv) { opts.want_beta = true; } + else if (c == 'e') + { + opts.examples_dir = optarg; + if (!opts.examples_dir.empty() && opts.examples_dir.back() != '/') opts.examples_dir += "/"; + } } if (optind == argc-1) { diff --git a/src/bindings/cxx/eina_cxx/eina_variant.hh b/src/bindings/cxx/eina_cxx/eina_variant.hh index 358688a0bb..4885c80236 100644 --- a/src/bindings/cxx/eina_cxx/eina_variant.hh +++ b/src/bindings/cxx/eina_cxx/eina_variant.hh @@ -6,6 +6,7 @@ #include #include #include +#include #include @@ -149,6 +150,17 @@ struct destroy_visitor } }; +struct ostream_visitor +{ + std::ostream* s; + typedef std::ostream& result_type; + template + std::ostream& operator()(T const& other) const + { + return *s << other; + } +}; + template struct get_visitor { @@ -295,6 +307,10 @@ private: && (rhs.type == -1 || rhs.visit(compare_equal_visitor{&lhs.buffer})); } + friend std::ostream& operator<<(std::ostream& s, variant const& rhs) + { + return rhs.visit(ostream_visitor{&s}); + } int type; /** diff --git a/src/bindings/cxx/eldbus_cxx/Eldbus_Model.hh b/src/bindings/cxx/eldbus_cxx/Eldbus_Model.hh index f2aa9e1a2c..7d8bb27892 100644 --- a/src/bindings/cxx/eldbus_cxx/Eldbus_Model.hh +++ b/src/bindings/cxx/eldbus_cxx/Eldbus_Model.hh @@ -5,7 +5,7 @@ #ifdef EFL_BETA_API_SUPPORT -#include +#include #endif #endif diff --git a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh index 019a417d14..4af1c56efd 100644 --- a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh +++ b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh @@ -34,6 +34,10 @@ template <> struct in_traits { typedef eina::stringshare type; }; template <> struct in_traits { typedef eina::stringshare const type; }; +template <> +struct in_traits { typedef efl::eina::strbuf type; }; +template <> +struct in_traits { typedef efl::eina::strbuf const type; }; template struct in_traits { typedef T& type; }; template @@ -531,6 +535,10 @@ inline const char* convert_to_c_impl(efl::eina::stringshare x, tag) +{ + return x.native_handle(); +} template T* convert_to_c_impl(std::unique_ptr& v, tag>) { @@ -699,6 +707,10 @@ inline efl::eina::value_view convert_to_return(Eina_Value* value, tag) +{ + return efl::eina::value_view{const_cast(value)}; +} template T convert_to_return(U* value, tag, typename std::enable_if::value || is_container::value>::type* = 0) { diff --git a/src/bindings/cxx/meson.build b/src/bindings/cxx/meson.build index 0a209b527d..8697473f09 100644 --- a/src/bindings/cxx/meson.build +++ b/src/bindings/cxx/meson.build @@ -30,7 +30,7 @@ foreach lib : cxx_sublibs '-DNEED_RUN_IN_TREE=1' ] - dir_package_include = join_paths(dir_include, package_version_name) + dir_package_include = package_version_name dir_package_modules = join_paths(dir_lib, package_name, 'modules') cxx_generator_target = [] cxx_header_src = [] diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua index 99d596106c..0b99715ed9 100644 --- a/src/bindings/luajit/eolian.lua +++ b/src/bindings/luajit/eolian.lua @@ -17,6 +17,7 @@ ffi.cdef [[ typedef struct _Eolian_Object Eolian_Object; typedef struct _Eolian_Class Eolian_Class; typedef struct _Eolian_Function Eolian_Function; + typedef struct _Eolian_Part Eolian_Part; typedef struct _Eolian_Type Eolian_Type; typedef struct _Eolian_Typedecl Eolian_Typedecl; typedef struct _Eolian_Function_Parameter Eolian_Function_Parameter; @@ -31,6 +32,9 @@ ffi.cdef [[ typedef struct _Eolian_Value Eolian_Value; typedef struct _Eolian_Unit Eolian_Unit; + typedef void (*Eolian_Panic_Cb)(const Eolian_State *state, const char *msg); + typedef void (*Eolian_Error_Cb)(const Eolian_Object *obj, const char *msg, void *data); + typedef enum { EOLIAN_OBJECT_UNKNOWN = 0, EOLIAN_OBJECT_CLASS, @@ -142,22 +146,25 @@ ffi.cdef [[ EOLIAN_TYPE_BUILTIN_BOOL, + EOLIAN_TYPE_BUILTIN_SLICE, + EOLIAN_TYPE_BUILTIN_RW_SLICE, + EOLIAN_TYPE_BUILTIN_VOID, 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_FUTURE, - EOLIAN_TYPE_BUILTIN_ANY_VALUE, EOLIAN_TYPE_BUILTIN_ANY_VALUE_PTR, EOLIAN_TYPE_BUILTIN_MSTRING, EOLIAN_TYPE_BUILTIN_STRING, EOLIAN_TYPE_BUILTIN_STRINGSHARE, + EOLIAN_TYPE_BUILTIN_STRBUF, EOLIAN_TYPE_BUILTIN_VOID_PTR, EOLIAN_TYPE_BUILTIN_FREE_CB @@ -285,13 +292,18 @@ ffi.cdef [[ int eolian_shutdown(void); Eolian_State *eolian_state_new(void); void eolian_state_free(Eolian_State *state); + Eolian_Panic_Cb eolian_state_panic_cb_set(Eolian_State *state, Eolian_Panic_Cb cb); + Eolian_Error_Cb eolian_state_error_cb_set(Eolian_State *state, Eolian_Error_Cb cb); + void *eolian_state_error_data_set(Eolian_State *state, void *data); Eolian_Object_Type eolian_object_type_get(const Eolian_Object *obj); + const Eolian_Unit *eolian_object_unit_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_object_is_beta(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); @@ -305,8 +317,10 @@ ffi.cdef [[ 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); + const Eolian_State *eolian_unit_state_get(const Eolian_Unit *unit); Eina_Iterator *eolian_unit_children_get(const Eolian_Unit *unit); const char *eolian_unit_file_get(const Eolian_Unit *unit); + const char *eolian_unit_file_path_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); @@ -331,21 +345,19 @@ ffi.cdef [[ Eolian_Class_Type eolian_class_type_get(const Eolian_Class *klass); 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); + const char *eolian_class_event_prefix_get(const Eolian_Class *klass); const char *eolian_class_data_type_get(const Eolian_Class *klass); const Eolian_Class *eolian_class_parent_get(const Eolian_Class *klass); + Eina_Iterator *eolian_class_requires_get(const Eolian_Class *klass); Eina_Iterator *eolian_class_extensions_get(const Eolian_Class *klass); 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_full_c_name_get(const Eolian_Function *function_id, Eolian_Function_Type ftype, Eina_Bool use_legacy); + const char *eolian_function_full_c_name_get(const Eolian_Function *function_id, Eolian_Function_Type ftype); 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); Eina_Bool eolian_function_is_class(const Eolian_Function *function_id); - Eina_Bool eolian_function_is_beta(const Eolian_Function *function_id); Eina_Bool eolian_function_is_constructor(const Eolian_Function *function_id, const Eolian_Class *klass); Eina_Bool eolian_function_is_function_pointer(const Eolian_Function *function_id); Eina_Iterator *eolian_property_keys_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype); @@ -363,6 +375,7 @@ 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 Eolian_Class *eolian_function_class_get(const Eolian_Function *function_id); const Eolian_Class *eolian_implement_class_get(const Eolian_Implement *impl); const Eolian_Class *eolian_implement_implementing_class_get(const Eolian_Implement *impl); const Eolian_Function *eolian_implement_function_get(const Eolian_Implement *impl, Eolian_Function_Type *func_type); @@ -376,21 +389,27 @@ ffi.cdef [[ 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_Bool eolian_constructor_is_ctor_param(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 Eolian_Type *eolian_event_type_get(const Eolian_Event *event); const Eolian_Class *eolian_event_class_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); - Eina_Bool eolian_event_is_beta(const Eolian_Event *event); Eina_Bool eolian_event_is_hot(const Eolian_Event *event); Eina_Bool eolian_event_is_restart(const Eolian_Event *event); + Eina_Iterator *eolian_class_parts_get(const Eolian_Class *klass); const char *eolian_event_c_name_get(const Eolian_Event *event); + const Eolian_Class *eolian_part_class_get(const Eolian_Part *part); + const Eolian_Documentation *eolian_part_documentation_get(const Eolian_Part *part); + const Eolian_Event *eolian_class_event_by_name_get(const Eolian_Class *klass, const char *event_name); 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); Eolian_Type_Type eolian_type_type_get(const Eolian_Type *tp); Eolian_Type_Builtin_Type eolian_type_builtin_type_get(const Eolian_Type *tp); + const char *eolian_class_c_name_get(const Eolian_Class *klass); + const char *eolian_class_c_data_type_get(const Eolian_Class *klass); 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); @@ -535,6 +554,14 @@ local object_idx, wrap_object = gen_wrap { return tonumber(eolian.eolian_object_type_get(cast_obj(self))) end, + unit_get = function(self) + local v = eolian.eolian_object_unit_get(cast_obj(self)) + if v == nil then + return nil + end + return v + end, + line_get = function(self) return tonumber(eolian.eolian_object_line_get(cast_obj(self))) end, @@ -570,12 +597,22 @@ local object_idx, wrap_object = gen_wrap { namespaces_get = function(self) return iterator.String_Iterator( eolian.eolian_object_namespaces_get(cast_obj(self))) + end, + + is_beta = function(self) + return eolian.eolian_object_is_beta(cast_obj(self)) ~= 0 end } ffi.metatype("Eolian_Object", { __index = object_idx }) local unit_idx, wrap_unit = gen_wrap { + state_get = function(self) + local v = eolian.eolian_unit_state_get(cast_unit(self)) + if v == nil then return nil end + return v + end, + children_get = function(self) return Ptr_Iterator("const Eolian_Unit*", eolian.eolian_unit_children_get(cast_unit(self))) @@ -587,6 +624,12 @@ local unit_idx, wrap_unit = gen_wrap { return ffi.string(v) end, + file_path_get = function(self) + local v = eolian.eolian_unit_file_path_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 @@ -667,8 +710,43 @@ local unit_idx, wrap_unit = gen_wrap { ffi.metatype("Eolian_Unit", { __index = unit_idx }) +local panic_cbs = {} +local error_cbs = {} + +local obj_to_idx = function(obj) + return tonumber(ffi.cast("size_t", obj)) +end + +local panic_cb, err_cb + +panic_cb = ffi.gc(ffi.cast("Eolian_Panic_Cb", function(state, msg) + local pcb = panic_cbs[obj_to_idx(self)] + assert(pcb, "internal error: no prror cb") + pcb(state, ffi.string(msg)) +end), function(cb) + cb:free() +end) + +err_cb = ffi.gc(ffi.cast("Eolian_Panic_Cb", function(obj, msg, data) + local ecb = error_cbs[obj_to_idx(self)] + assert(ecb, "internal error: no error cb") + ecb(obj, ffi.string(msg)) +end), function(cb) + cb:free() +end) + ffi.metatype("Eolian_State", { __index = wrap_unit { + panic_cb_set = function(self, cb) + panic_cbs[obj_to_idx(self)] = cb + eolian.eolian_state_panic_cb_set(self, panic_cb) + end, + + error_cb_set = function(self, cb) + error_cbs[obj_to_idx(self)] = cb + eolian.eolian_state_error_cb_set(self, err_cb) + end, + directory_add = function(self, dir) return eolian.eolian_state_directory_add(self, dir) ~= 0 end, @@ -767,6 +845,9 @@ ffi.metatype("Eolian_State", { end }, __gc = function(self) + local idx = obj_to_idx(self) + panic_cbs[idx] = nil + error_cbs[idx] = nil eolian.eolian_state_free(self) end }) @@ -822,25 +903,28 @@ M.type_builtin_type = { BOOL = 30, - VOID = 31, + SLICE = 31, + RW_SLICE = 32, - ACCESSOR = 32, - ARRAY = 33, - ITERATOR = 34, - HASH = 35, - LIST = 36, + VOID = 33, - FUTURE = 37, + ACCESSOR = 34, + ARRAY = 35, + FUTURE = 36, + ITERATOR = 37, + HASH = 38, + LIST = 39, - ANY_VALUE = 38, - ANY_VALUE_PTR = 39, + ANY_VALUE = 40, + ANY_VALUE_PTR = 41, - MSTRING = 40, - STRING = 41, - STRINGSHARE = 42, + MSTRING = 42, + STRING = 43, + STRINGSHARE = 44, + STRBUF = 45, - VOID_PTR = 43, - FREE_CB = 44 + VOID_PTR = 46, + FREE_CB = 47 } M.typedecl_type = { @@ -1057,36 +1141,22 @@ M.Function = ffi.metatype("Eolian_Function", { return tonumber(eolian.eolian_function_scope_get(self, ftype)) 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) + full_c_name_get = function(self, ftype) + local v = eolian.eolian_function_full_c_name_get(self, ftype) if v == nil then return nil end return ffi_stringshare(v) end, - legacy_get = function(self, ftype) - local v = eolian.eolian_function_legacy_get(self, ftype) - if v == nil then return nil end - return ffi.string(v) - end, - implement_get = function(self) local v = eolian.eolian_function_implement_get(self) if v == nil then return nil end return v end, - is_legacy_only = function(self, ftype) - return eolian.eolian_function_is_legacy_only(self, ftype) ~= 0 - end, - is_class = function(self) return eolian.eolian_function_is_class(self) ~= 0 end, - is_beta = function(self) - return eolian.eolian_function_is_beta(self) ~= 0 - end, - is_constructor = function(self, klass) return eolian.eolian_function_is_constructor(self, klass) ~= 0 end, @@ -1135,6 +1205,12 @@ M.Function = ffi.metatype("Eolian_Function", { is_const = function(self) return eolian.eolian_function_object_is_const(self) ~= 0 + end, + + class_get = function(self) + local v = eolian.eolian_function_class_get(self) + if v == nil then return nil end + return v end } }) @@ -1249,6 +1325,10 @@ ffi.metatype("Eolian_Constructor", { is_optional = function(self) return eolian.eolian_constructor_is_optional(self) ~= 0 + end, + + is_ctor_param = function(self) + return eolian.eolian_constructor_is_ctor_param(self) ~= 0 end } }) @@ -1283,10 +1363,6 @@ ffi.metatype("Eolian_Event", { return ffi_stringshare(v) end, - is_beta = function(self) - return eolian.eolian_event_is_beta(self) ~= 0 - end, - is_hot = function(self) return eolian.eolian_event_is_hot(self) ~= 0 end, @@ -1297,6 +1373,22 @@ ffi.metatype("Eolian_Event", { } }) +ffi.metatype("Eolian_Part", { + __index = wrap_object { + class_get = function(self) + local v = eolian.eolian_part_class_get(self) + if v == nil then return nil end + return v + end, + + documentation_get = function(self) + local v = eolian.eolian_part_documentation_get(self) + if v == nil then return nil end + return v + end + } +}) + M.class_type = { UNKNOWN = 0, REGULAR = 1, @@ -1317,12 +1409,6 @@ M.Class = ffi.metatype("Eolian_Class", { return v end, - legacy_prefix_get = function(self) - local v = eolian.eolian_class_legacy_prefix_get(self) - if v == nil then return nil end - return ffi.string(v) - end, - eo_prefix_get = function(self) local v = eolian.eolian_class_eo_prefix_get(self) if v == nil then @@ -1333,6 +1419,14 @@ M.Class = ffi.metatype("Eolian_Class", { return ffi.string(v) end, + event_prefix_get = function(self) + local v = eolian.eolian_class_event_prefix_get(self) + if v == nil then + return self:eo_prefix_get() + end + return ffi.string(v) + end, + data_type_get = function(self) local v = eolian.eolian_class_data_type_get(self) if v == nil then return nil end @@ -1350,6 +1444,11 @@ M.Class = ffi.metatype("Eolian_Class", { eolian.eolian_class_extensions_get(self)) end, + requires_get = function(self) + return Ptr_Iterator("const Eolian_Class*", + eolian.eolian_class_requires_get(self)) + end, + functions_get = function(self, func_type) return Ptr_Iterator("const Eolian_Function*", eolian.eolian_class_functions_get(self, func_type)) @@ -1377,6 +1476,17 @@ M.Class = ffi.metatype("Eolian_Class", { eolian.eolian_class_events_get(self)) end, + event_by_name_get = function(self, name) + local v = eolian.eolian_class_event_by_name_get(self, name) + if v == nil then return nil end + return v + end, + + parts_get = function(self) + return Ptr_Iterator("const Eolian_Part*", + eolian.eolian_class_parts_get(self)) + end, + ctor_enable_get = function(self) return eolian.eolian_class_ctor_enable_get(self) ~= 0 end, @@ -1389,6 +1499,18 @@ M.Class = ffi.metatype("Eolian_Class", { local v = eolian.eolian_class_c_get_function_name_get(self) if v == nil then return nil end return ffi_stringshare(v) + end, + + c_name_get = function(self) + local v = eolian.eolian_class_c_name_get(self) + if v == nil then return nil end + return ffi_stringshare(v) + end, + + c_data_type_get = function(self) + local v = eolian.eolian_class_c_data_type_get(self) + if v == nil then return nil end + return ffi_stringshare(v) end } }) diff --git a/src/bindings/mono/ecore_evas_mono/ecore_evas.cs b/src/bindings/mono/ecore_evas_mono/ecore_evas.cs deleted file mode 100644 index fbbea7d9e1..0000000000 --- a/src/bindings/mono/ecore_evas_mono/ecore_evas.cs +++ /dev/null @@ -1,38 +0,0 @@ -#pragma warning disable 1591 - -using System; -using System.Runtime.InteropServices; -using System.Threading; - -public class EcoreEvas -{ - [DllImport(efl.Libs.EcoreEvas)] static extern void ecore_evas_init(); - // [DllImport(efl.Libs.EcoreEvas)] static extern IntPtr ecore_evas_new([MarshalAs(UnmanagedType.LPStr)] String engine_name, int x, int y, int w, int h - // , [MarshalAs(UnmanagedType.LPStr)] String extra_options); - [DllImport(efl.Libs.EcoreEvas)] static extern IntPtr ecore_evas_new(IntPtr engine_name, int x, int y, int w, int h - , IntPtr extra_options); - [DllImport(efl.Libs.EcoreEvas)] static extern IntPtr ecore_evas_get(IntPtr ecore_evas); - [DllImport(efl.Libs.EcoreEvas)] static extern IntPtr ecore_evas_show(IntPtr ecore_evas); - - IntPtr handle; - public EcoreEvas() - { -#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) - throw new InvalidOperationException("UI Applications require STAThreadAttribute in Main()"); -#endif - ecore_evas_init(); - handle = ecore_evas_new(IntPtr.Zero, 0, 0, 640, 480, IntPtr.Zero); - if(handle == IntPtr.Zero) - System.Console.WriteLine("Couldn't create a ecore evas"); - ecore_evas_show(handle); - } - - public Efl.Canvas.Object canvas - { - get { return new Efl.Canvas.Object(ecore_evas_get(handle)); } - } - -} - diff --git a/src/bindings/mono/ecore_evas_mono/meson.build b/src/bindings/mono/ecore_evas_mono/meson.build deleted file mode 100644 index 6020a63a75..0000000000 --- a/src/bindings/mono/ecore_evas_mono/meson.build +++ /dev/null @@ -1 +0,0 @@ -mono_files += files('ecore_evas.cs') diff --git a/src/bindings/mono/efl_mono/efl_all.cs b/src/bindings/mono/efl_mono/efl_all.cs index a8436bd8e5..9a49730093 100644 --- a/src/bindings/mono/efl_mono/efl_all.cs +++ b/src/bindings/mono/efl_mono/efl_all.cs @@ -6,81 +6,132 @@ using System.Threading; using static Efl.UnsafeNativeMethods; -namespace Efl { +namespace Efl +{ -static class UnsafeNativeMethods { +static class UnsafeNativeMethods +{ + private delegate void init_func_delegate(); [DllImport(efl.Libs.Ecore)] public static extern void ecore_init(); [DllImport(efl.Libs.Ecore)] public static extern void ecore_shutdown(); - [DllImport(efl.Libs.Evas)] public static extern void evas_init(); + // dotnet loads libraries from DllImport with RTLD_LOCAL. Due to the + // way evas modules are built with meson, currently they do not link directly + // with libevas, leading to symbol not found errors when trying to open them. + // The call to FunctionWrapper makes sure evas is loaded with RTLD_GLOBAL, + // allowing the symbols to remain visible for the modules until the build + // is sorted out. + private static Efl.Eo.FunctionWrapper _evas_init; [DllImport(efl.Libs.Evas)] public static extern void evas_shutdown(); [DllImport(efl.Libs.Elementary)] public static extern int elm_init(int argc, IntPtr argv); [DllImport(efl.Libs.Elementary)] public static extern void elm_policy_set(int policy, int policy_detail); [DllImport(efl.Libs.Elementary)] public static extern void elm_shutdown(); [DllImport(efl.Libs.Elementary)] public static extern void elm_run(); [DllImport(efl.Libs.Elementary)] public static extern void elm_exit(); + + static UnsafeNativeMethods() + { + _evas_init = new Efl.Eo.FunctionWrapper("evas", "evas_init"); + } + + public static void evas_init() + { + _evas_init.Value.Delegate(); + } } -public enum Components { - Basic, - Ui -} - -public static class All { +public static class All +{ private static bool InitializedUi = false; - public static void Init(Efl.Components components=Components.Basic) { + public static bool MainLoopInitialized { + get; + private set; + } + + public static readonly object InitLock = new object(); + + public static void Init(Efl.Csharp.Components components = Efl.Csharp.Components.Basic) + { Eina.Config.Init(); Efl.Eo.Config.Init(); ecore_init(); evas_init(); eldbus.Config.Init(); - if (components == Components.Ui) { + if (components == Efl.Csharp.Components.Ui) + { Efl.Ui.Config.Init(); InitializedUi = true; } + Monitor.Enter(InitLock); + MainLoopInitialized = true; + Monitor.Exit(InitLock); } /// Shutdowns all EFL subsystems. - public static void Shutdown() { + public static void Shutdown() + { // Try to cleanup everything before actually shutting down. + Eina.Log.Debug("Calling GC before shutdown"); System.GC.Collect(); System.GC.WaitForPendingFinalizers(); + Monitor.Enter(InitLock); + MainLoopInitialized = false; + Monitor.Exit(InitLock); + if (InitializedUi) + { + Eina.Log.Debug("Shutting down Elementary"); Efl.Ui.Config.Shutdown(); + } + + Eina.Log.Debug("Shutting down Eldbus"); eldbus.Config.Shutdown(); + Eina.Log.Debug("Shutting down Evas"); evas_shutdown(); + Eina.Log.Debug("Shutting down Ecore"); ecore_shutdown(); + Eina.Log.Debug("Shutting down Eo"); Efl.Eo.Config.Shutdown(); + Eina.Log.Debug("Shutting down Eina"); Eina.Config.Shutdown(); } } // Placeholder. Will move to elm_config.cs later -namespace Ui { +namespace Ui +{ -public static class Config { - public static void Init() { +public static class Config +{ + public static void Init() + { // 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 (System.Threading.Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) + { throw new InvalidOperationException("UI Applications require STAThreadAttribute in Main()"); + } #endif elm_init(0, IntPtr.Zero); elm_policy_set((int)Elm.Policy.Quit, (int)Elm.PolicyQuit.LastWindowHidden); } - public static void Shutdown() { + + public static void Shutdown() + { elm_shutdown(); } - public static void Run() { + public static void Run() + { elm_run(); } - public static void Exit() { + public static void Exit() + { elm_exit(); } } diff --git a/src/bindings/mono/efl_mono/efl_csharp_application.cs b/src/bindings/mono/efl_mono/efl_csharp_application.cs index 2b2c55c75e..1e63d62c4a 100644 --- a/src/bindings/mono/efl_mono/efl_csharp_application.cs +++ b/src/bindings/mono/efl_mono/efl_csharp_application.cs @@ -3,129 +3,164 @@ using System.Runtime.InteropServices; using System.Threading; using static Efl.UnsafeNativeMethods; -static class UnsafeNativeMethods { - [DllImport(efl.Libs.Ecore)] public static extern void ecore_init(); - [DllImport(efl.Libs.Ecore)] public static extern void ecore_shutdown(); - [DllImport(efl.Libs.Elementary)] public static extern int elm_init(int argc, IntPtr argv); - [DllImport(efl.Libs.Elementary)] public static extern void elm_policy_set(int policy, int policy_detail); - [DllImport(efl.Libs.Elementary)] public static extern void elm_shutdown(); - [DllImport(efl.Libs.Elementary)] public static extern void elm_exit(); +namespace Efl +{ + +namespace Csharp +{ + +///The components to be initialized. +public enum Components +{ + ///Basic components: Eina, Eo, Ecore, Evas and DBus. + Basic, + ///The same components of and the Elementary widget toolkit. + Ui, } -namespace Efl { - namespace Csharp { - public enum Components { - Basic, - Ui, - } - /// - /// This represents the entry point for the EFL framework - /// You can use this class to implement the 4 abstract methods which will then be called accordingly - /// All subsystems of efl are booted up correctly when the abstract methods of this class are called. - /// - /// - /// Calls to efl outside those efl-callbacks or outside the mainloop are not allowed and will lead to issues - /// - /// - /// UserApp is the class that implements the Application abstract - /// - /// public static void Main() { - /// UserApp editor = new UserApp(); - /// editor.Launch(editor); - /// } - /// - /// - public abstract class Application { - //the initializied components - private static Components initComponent; - //what follows are 3 private functions to boot up the internals of efl - private static void Init(Efl.Csharp.Components component) { +/// +/// This represents the entry point for the EFL framework +/// You can use this class to implement the 4 abstract methods which will then be called accordingly +/// All subsystems of efl are booted up correctly when the abstract methods of this class are called. +/// +/// +/// Calls to efl outside those efl-callbacks or outside the mainloop are not allowed and will lead to issues +/// +/// +/// UserApp is the class that implements the Application abstract +/// +/// public static void Main() +/// { +/// UserApp editor = new UserApp(); +/// editor.Launch(editor); +/// } +/// +/// +public abstract class Application +{ + //the initializied components + private static Components initComponent; + //what follows are 3 private functions to boot up the internals of efl + private static void Init(Efl.Csharp.Components component) + { Eina.Config.Init(); Efl.Eo.Config.Init(); ecore_init(); evas_init(); eldbus.Config.Init(); - if (component == Components.Ui) { - // 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 (System.Threading.Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) - throw new InvalidOperationException("UI Applications require STAThreadAttribute in Main()"); + if (component == Components.Ui) + { + // 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 (System.Threading.Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) + { + throw new InvalidOperationException("UI Applications require STAThreadAttribute in Main()"); + } #endif - elm_init(0, IntPtr.Zero); + elm_init(0, IntPtr.Zero); - elm_policy_set((int)Elm.Policy.Quit, (int)Elm.PolicyQuit.LastWindowHidden); + elm_policy_set((int)Elm.Policy.Quit, (int)Elm.PolicyQuit.LastWindowHidden); } + initComponent = component; - } - private static void Shutdown() { + } + + private static void Shutdown() + { // Try to cleanup everything before actually shutting down. System.GC.Collect(); System.GC.WaitForPendingFinalizers(); - if (initComponent == Components.Ui) { - elm_shutdown(); + if (initComponent == Components.Ui) + { + elm_shutdown(); } + eldbus.Config.Shutdown(); evas_shutdown(); ecore_shutdown(); Efl.Eo.Config.Shutdown(); Eina.Config.Shutdown(); - } - /// - /// Called when the application is started. Arguments from the command line are passed here. - /// - protected abstract void OnInitialize(Eina.Array args); - /// - /// Arguments are passed here, Additional calls to this function may occure, - /// but then the initialization flag is set to false. - /// - /// - /// When Initialize is true then OnInitialize is also called - /// - protected virtual void OnArguments(Efl.LoopArguments args) { } - /// - /// Called when the application is not going to be displayed, or is not used by a user for some time. - /// - protected virtual void OnPause() { } - /// - /// Called before an application is used again after a call to OnPause(). - /// - protected virtual void OnResume() { } - /// - /// Called before starting the shutdown of the application. - /// - protected virtual void OnTerminate() { } - /// - /// This function initializices everything in EFL and runs your application. - /// This call will result in a call to OnInitialize(), which you application should override. - /// - public void Launch(Efl.Csharp.Components components=Components.Ui) { + } + + /// + /// Called when the application is started. Arguments from the command line are passed here. + /// + protected abstract void OnInitialize(Eina.Array args); + + /// + /// Arguments are passed here, Additional calls to this function may occure, + /// but then the initialization flag is set to false. + /// + /// + /// When Initialize is true then OnInitialize is also called + /// + protected virtual void OnArguments(Efl.LoopArguments args) + { + } + + /// + /// Called when the application is not going to be displayed, or is not used by a user for some time. + /// + protected virtual void OnPause() + { + } + + /// + /// Called before an application is used again after a call to OnPause(). + /// + protected virtual void OnResume() + { + } + + /// + /// Called before starting the shutdown of the application. + /// + protected virtual void OnTerminate() + { + } + + /// + /// This function initializices everything in EFL and runs your application. + /// This call will result in a call to OnInitialize(), which you application should override. + /// + public void Launch(Efl.Csharp.Components components = Components.Ui) + { Init(components); Efl.App app = Efl.App.AppMain; - foreach (var arg in Environment.GetCommandLineArgs()) - app.AppendArg(arg); - app.ArgumentsEvt += (object sender, LoopArgumentsEvt_Args evt) => { - if (evt.arg.Initialization) { - OnInitialize(evt.arg.Argv); - } - OnArguments(evt.arg); + Eina.Array command_line = new Eina.Array(); + command_line.Append(Environment.GetCommandLineArgs()); +#if EFL_BETA + app.SetCommandArray(command_line); +#endif + app.ArgumentsEvt += (object sender, LoopArgumentsEvt_Args evt) => + { + if (evt.arg.Initialization) + { + OnInitialize(evt.arg.Argv); + } + + OnArguments(evt.arg); }; - app.PauseEvt += (object sender, EventArgs e) => { - OnPause(); + app.PauseEvt += (object sender, EventArgs e) => + { + OnPause(); }; - app.ResumeEvt += (object sender, EventArgs e) => { - OnResume(); + app.ResumeEvt += (object sender, EventArgs e) => + { + OnResume(); }; - app.TerminateEvt += (object sender, EventArgs e) => { - OnTerminate(); + app.TerminateEvt += (object sender, EventArgs e) => + { + OnTerminate(); }; app.Begin(); Shutdown(); - } } - } } +} +} diff --git a/src/bindings/mono/efl_mono/efl_libs.cs.in b/src/bindings/mono/efl_mono/efl_libs.cs.in index 86742641fe..0aa56908ff 100644 --- a/src/bindings/mono/efl_mono/efl_libs.cs.in +++ b/src/bindings/mono/efl_mono/efl_libs.cs.in @@ -12,12 +12,27 @@ public class Libs { public const string Eo = "@EO_DL_MONO@"; public const string Evas = "@EVAS_DL_MONO@"; public const string Evil = "@EVIL_DL_MONO@"; - public const string EcoreEvas = "@ECORE_EVAS_DL_MONO@"; public const string Edje = "@EDJE_DL_MONO@"; public const string Elementary = "@ELEMENTARY_DL_MONO@"; public const string Eldbus = "@ELDBUS_DL_MONO@"; public const string CustomExports = "@CUSTOM_EXPORTS_MONO_DL_MONO@"; + + public const string Libdl = "libdl.so"; + public const string Kernel32 = "kernel32.dll"; + + public static Efl.Eo.NativeModule EflModule = new Efl.Eo.NativeModule(Efl); + public static Efl.Eo.NativeModule CoreModule = new Efl.Eo.NativeModule(Ecore); + public static Efl.Eo.NativeModule EinaModule = new Efl.Eo.NativeModule(Eina); + public static Efl.Eo.NativeModule EoModule = new Efl.Eo.NativeModule(Eo); + public static Efl.Eo.NativeModule EvasModule = new Efl.Eo.NativeModule(Evas); + public static Efl.Eo.NativeModule EvilModule = new Efl.Eo.NativeModule(Evil); + public static Efl.Eo.NativeModule EdjeModule = new Efl.Eo.NativeModule(Edje); + public static Efl.Eo.NativeModule ElementaryModule = new Efl.Eo.NativeModule(Elementary); + public static Efl.Eo.NativeModule EldbusModule = new Efl.Eo.NativeModule(Eldbus); + public static Efl.Eo.NativeModule CustomExportsModule = new Efl.Eo.NativeModule(CustomExports); + public static Efl.Eo.NativeModule LibdlModule = new Efl.Eo.NativeModule(Libdl); + public static Efl.Eo.NativeModule Kernel32Module = new Efl.Eo.NativeModule(Kernel32); } } diff --git a/src/bindings/mono/efl_mono/meson.build b/src/bindings/mono/efl_mono/meson.build index acfeb4bc3f..3edefb3c0c 100644 --- a/src/bindings/mono/efl_mono/meson.build +++ b/src/bindings/mono/efl_mono/meson.build @@ -8,13 +8,6 @@ bash = find_program('bash') map = run_command('map_generate.sh').stdout() -efl_mono_lib = library('eflcustomexportsmono', - join_paths('..', '..', '..', 'lib', 'efl_mono', 'efl_custom_exports_mono.c'), - install : true, - install_dir : join_paths(dir_lib, 'efl-mono-'+version_major), - dependencies : [eo, eina] -) - efl_libs = configuration_data() efl_libs.set('EFL_MONO_LIBRARY_MAP', map) efl_libs.set('CUSTOM_EXPORTS_MONO_DL_MONO', 'eflcustomexportsmono') diff --git a/src/bindings/mono/eina_mono/eina_accessor.cs b/src/bindings/mono/eina_mono/eina_accessor.cs index c3c09c4966..bafbbd84fe 100644 --- a/src/bindings/mono/eina_mono/eina_accessor.cs +++ b/src/bindings/mono/eina_mono/eina_accessor.cs @@ -7,7 +7,8 @@ using static Eina.TraitFunctions; using static Eina.AccessorNativeFunctions; -namespace Eina { +namespace Eina +{ internal class AccessorNativeFunctions { @@ -27,6 +28,7 @@ public class Accessor : IEnumerable, IDisposable private Ownership Ownership { get; set; } // FIXME Part of the implicit EFL Container interface. Need to make it explicit. + ///Whether this wrapper owns the native accessor. public bool Own { get @@ -40,13 +42,19 @@ public class Accessor : IEnumerable, IDisposable } /// Create a new accessor wrapping the given pointer. - public Accessor(IntPtr handle, Ownership owner=Ownership.Managed) + /// The native handle to be wrapped. + /// Whether this wrapper owns the native accessor. + public Accessor(IntPtr handle, Ownership owner = Ownership.Managed) { Handle = handle; Ownership = owner; } - public Accessor(IntPtr handle, bool own, bool ownContent=false) + /// Create a new accessor wrapping the given pointer. + /// The native handle to be wrapped. + /// Whether this wrapper owns the native accessor. + /// For compatibility with other EFL# containers. Ignored in acessors. + public Accessor(IntPtr handle, bool own, bool ownContent = false) : this(handle, own ? Ownership.Managed : Ownership.Unmanaged) { } @@ -57,36 +65,55 @@ public class Accessor : IEnumerable, IDisposable Dispose(true); } + /// Disposes of this wrapper, releasing the native accessor if owned. + /// True if this was called from public method. False if + /// called from the C# finalizer. protected virtual void Dispose(bool disposing) { if (Ownership == Ownership.Managed && Handle != IntPtr.Zero) { - eina_accessor_free(Handle); + if (disposing) + { + eina_accessor_free(Handle); + } + else + { + Efl.Eo.Globals.ThreadSafeFreeCbExec(eina_accessor_free, Handle); + } Handle = IntPtr.Zero; } } + /// Finalizer to be called from the Garbage Collector. ~Accessor() { Dispose(false); } - public virtual T Convert(IntPtr data) + /// Convert the native data into managed. This is used when returning the data through a + /// . + /// The data to be converted + /// The managed data representing data. + protected virtual T Convert(IntPtr data) { return NativeToManaged(data); } /// Returns an enumerator that iterates throught this accessor. + /// An enumerator to walk through the acessor items. public IEnumerator 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)) + while (eina_accessor_data_get(Handle, position, tmp)) { IntPtr data = (IntPtr)Marshal.PtrToStructure(tmp, typeof(IntPtr)); yield return Convert(data); @@ -105,19 +132,41 @@ public class Accessor : IEnumerable, IDisposable } } +///Accessor for Inlists. public class AccessorInList : Accessor { - public AccessorInList(IntPtr handle, Ownership own): base(handle, own) {} - public override T Convert(IntPtr data) + /// Create a new accessor wrapping the given pointer. + /// The native handle to be wrapped. + /// Whether this wrapper owns the native accessor. + public AccessorInList(IntPtr handle, Ownership own) : base(handle, own) + { + } + + /// Convert the native data into managed. This is used when returning the data through a + /// . + /// The data to be converted + /// The managed data representing data. + protected override T Convert(IntPtr data) { return NativeToManagedInlistNode(data); } } +///Accessor for Inarrays. public class AccessorInArray : Accessor { - public AccessorInArray(IntPtr handle, Ownership own): base(handle, own) {} - public override T Convert(IntPtr data) + /// Create a new accessor wrapping the given pointer. + /// The native handle to be wrapped. + /// Whether this wrapper owns the native accessor. + public AccessorInArray(IntPtr handle, Ownership own) : base(handle, own) + { + } + + /// Convert the native data into managed. This is used when returning the data through a + /// . + /// The data to be converted + /// The managed data representing data. + protected override T Convert(IntPtr data) { return NativeToManagedInplace(data); } diff --git a/src/bindings/mono/eina_mono/eina_array.cs b/src/bindings/mono/eina_mono/eina_array.cs index f4dd49d69e..e3bd852e2b 100644 --- a/src/bindings/mono/eina_mono/eina_array.cs +++ b/src/bindings/mono/eina_mono/eina_array.cs @@ -7,7 +7,8 @@ using System.Collections.Generic; using static Eina.TraitFunctions; using static Eina.ArrayNativeFunctions; -namespace Eina { +namespace Eina +{ public static class ArrayNativeFunctions { @@ -64,7 +65,9 @@ public class Array : IEnumerable, IDisposable Own = true; OwnContent = true; if (Handle == IntPtr.Zero) + { throw new SEHException("Could not alloc array"); + } } internal bool InternalPush(IntPtr ele) @@ -99,6 +102,11 @@ public class Array : IEnumerable, IDisposable public Array(IntPtr handle, bool own) { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException("Handle can't be null"); + } + Handle = handle; Own = own; OwnContent = own; @@ -106,6 +114,11 @@ public class Array : IEnumerable, IDisposable public Array(IntPtr handle, bool own, bool ownContent) { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException("Handle can't be null"); + } + Handle = handle; Own = own; OwnContent = ownContent; @@ -121,19 +134,30 @@ public class Array : IEnumerable, IDisposable IntPtr h = Handle; Handle = IntPtr.Zero; if (h == IntPtr.Zero) + { return; + } if (OwnContent) { int len = (int)eina_array_count_custom_export_mono(h); - for(int i = 0; i < len; ++i) + for (int i = 0; i < len; ++i) { NativeFree(eina_array_data_get_custom_export_mono(h, (uint)i)); } } if (Own) - eina_array_free(h); + { + if (disposing) + { + eina_array_free(h); + } + else + { + Efl.Eo.Globals.ThreadSafeFreeCbExec(eina_array_free, h); + } + } } public void Dispose() @@ -159,7 +183,7 @@ public class Array : IEnumerable, IDisposable if (OwnContent) { int len = Length; - for(int i = 0; i < len; ++i) + for (int i = 0; i < len; ++i) { NativeFree(InternalDataGet(i)); } @@ -180,7 +204,7 @@ public class Array : IEnumerable, IDisposable public int Count() { - return (int) eina_array_count_custom_export_mono(Handle); + return (int)eina_array_count_custom_export_mono(Handle); } public void SetOwnership(bool ownAll) @@ -200,7 +224,10 @@ public class Array : IEnumerable, IDisposable IntPtr ele = ManagedToNativeAlloc(val); var r = InternalPush(ele); if (!r) + { NativeFree(ele); + } + return r; } @@ -208,7 +235,9 @@ public class Array : IEnumerable, IDisposable // public void Add(T val) // { // if (!Push(val)) -// throw; +// { +// throw; +// } // } public T Pop() @@ -216,7 +245,10 @@ public class Array : IEnumerable, IDisposable IntPtr ele = InternalPop(); var r = NativeToManaged(ele); if (OwnContent && ele != IntPtr.Zero) + { NativeFree(ele); + } + return r; } @@ -235,7 +267,10 @@ public class Array : IEnumerable, IDisposable { IntPtr ele = InternalDataGet(idx); // TODO: check bondaries ?? if (OwnContent && ele != IntPtr.Zero) + { NativeFree(ele); + } + ele = ManagedToNativeAlloc(val); InternalDataSet(idx, ele); } @@ -256,18 +291,24 @@ public class Array : IEnumerable, IDisposable { int len = Length; var managed = new T[len]; - for(int i = 0; i < len; ++i) + for (int i = 0; i < len; ++i) { managed[i] = DataGet(i); } + return managed; } public bool Append(T[] values) { - foreach(T v in values) + foreach (T v in values) + { if (!Push(v)) + { return false; + } + } + return true; } @@ -280,7 +321,7 @@ public class Array : IEnumerable, IDisposable public IEnumerator GetEnumerator() { int len = Length; - for(int i = 0; i < len; ++i) + for (int i = 0; i < len; ++i) { yield return DataGet(i); } diff --git a/src/bindings/mono/eina_mono/eina_binbuf.cs b/src/bindings/mono/eina_mono/eina_binbuf.cs index 20a4c2d0ce..e5dc817085 100644 --- a/src/bindings/mono/eina_mono/eina_binbuf.cs +++ b/src/bindings/mono/eina_mono/eina_binbuf.cs @@ -3,7 +3,8 @@ using System; using System.Runtime.InteropServices; -namespace Eina { +namespace Eina +{ public class Binbuf : IDisposable { @@ -43,7 +44,7 @@ public class Binbuf : IDisposable public int Length { - get { return (int) GetLength(); } + get { return (int)GetLength(); } } private void InitNew() @@ -51,7 +52,9 @@ public class Binbuf : IDisposable Handle = eina_binbuf_new(); Own = true; if (Handle == IntPtr.Zero) + { throw new SEHException("Could not alloc binbuf"); + } } public Binbuf() @@ -98,8 +101,16 @@ public class Binbuf : IDisposable { IntPtr h = Handle; Handle = IntPtr.Zero; - if (Own && h != IntPtr.Zero) { - eina_binbuf_free(Handle); + if (Own && h != IntPtr.Zero) + { + if (disposing) + { + eina_binbuf_free(Handle); + } + else + { + Efl.Eo.Globals.ThreadSafeFreeCbExec(eina_binbuf_free, Handle); + } } } @@ -180,7 +191,9 @@ public class Binbuf : IDisposable { var ptr = eina_binbuf_string_get(Handle); if (ptr == IntPtr.Zero) + { return null; + } var size = (int)(this.GetLength()); byte[] mArray = new byte[size]; diff --git a/src/bindings/mono/eina_mono/eina_common.cs b/src/bindings/mono/eina_mono/eina_common.cs index e2ddc70978..199b92bc06 100644 --- a/src/bindings/mono/eina_mono/eina_common.cs +++ b/src/bindings/mono/eina_mono/eina_common.cs @@ -6,6 +6,7 @@ using System.Runtime.InteropServices; namespace Eina { + namespace Callbacks { @@ -41,7 +42,8 @@ internal static class NativeCustomExportFunctions } /// Wrapper around native memory DllImport'd functions -public static class MemoryNative { +public static class MemoryNative +{ public static void Free(IntPtr ptr) { NativeCustomExportFunctions.efl_mono_native_free(ptr); @@ -95,12 +97,6 @@ public static class MemoryNative { } } -[StructLayout(LayoutKind.Sequential)] -public struct ConvertWrapper -{ - public T val; -} - public static class PrimitiveConversion { public static T PointerToManaged(IntPtr nat) @@ -111,8 +107,8 @@ public static class PrimitiveConversion return default(T); } - var w = Marshal.PtrToStructure >(nat); - return w.val; + var w = Marshal.PtrToStructure(nat); + return w; } public static IntPtr ManagedToPointerAlloc(T man) @@ -128,7 +124,9 @@ public static class StringConversion public static IntPtr ManagedStringToNativeUtf8Alloc(string managedString) { if (managedString == null) + { return IntPtr.Zero; + } byte[] strbuf = Encoding.UTF8.GetBytes(managedString); IntPtr native = MemoryNative.Alloc(strbuf.Length + 1); @@ -140,11 +138,15 @@ public static class StringConversion public static string NativeUtf8ToManagedString(IntPtr pNativeData) { if (pNativeData == IntPtr.Zero) + { return null; + } int len = 0; while (Marshal.ReadByte(pNativeData, len) != 0) + { ++len; + } byte[] strbuf = new byte[len]; Marshal.Copy(pNativeData, strbuf, 0, strbuf.Length); @@ -153,7 +155,8 @@ public static class StringConversion } /// Enum to handle resource ownership between managed and unmanaged code. -public enum Ownership { +public enum Ownership +{ /// The resource is owned by the managed code. It should free the handle on disposal. Managed, /// The resource is owned by the unmanaged code. It won't be freed on disposal. diff --git a/src/bindings/mono/eina_mono/eina_config.cs b/src/bindings/mono/eina_mono/eina_config.cs index ee0bb5bd0e..9f3028f62d 100644 --- a/src/bindings/mono/eina_mono/eina_config.cs +++ b/src/bindings/mono/eina_mono/eina_config.cs @@ -3,18 +3,24 @@ using System; using System.Runtime.InteropServices; -namespace Eina { +namespace Eina +{ -public class Config { +public class Config +{ [DllImport(efl.Libs.Eina)] private static extern int eina_init(); [DllImport(efl.Libs.Eina)] private static extern int eina_shutdown(); - public static void Init() { + public static void Init() + { if (eina_init() == 0) + { throw (new Efl.EflException("Failed to initialize Eina")); + } } - public static int Shutdown() { + public static int Shutdown() + { return eina_shutdown(); } @@ -24,15 +30,15 @@ public class Config { /// Wrapper class for pointers that need some cleanup afterwards /// like strings. /// -public class DisposableIntPtr : IDisposable { - +public class DisposableIntPtr : IDisposable +{ public IntPtr Handle { get; set; } private bool ShouldFree; private bool Disposed; /// Wraps a new ptr what will be freed based on the /// value of shouldFree - public DisposableIntPtr(IntPtr ptr, bool shouldFree=false) + public DisposableIntPtr(IntPtr ptr, bool shouldFree = false) { Handle = ptr; ShouldFree = shouldFree; @@ -46,9 +52,11 @@ public class DisposableIntPtr : IDisposable { protected virtual void Dispose(bool disposing) { - if (!Disposed && ShouldFree) { + if (!Disposed && ShouldFree) + { MemoryNative.Free(this.Handle); } + Disposed = true; } @@ -57,4 +65,5 @@ public class DisposableIntPtr : IDisposable { Dispose(false); } } + } diff --git a/src/bindings/mono/eina_mono/eina_container_common.cs b/src/bindings/mono/eina_mono/eina_container_common.cs index 838a7edb07..630b084207 100644 --- a/src/bindings/mono/eina_mono/eina_container_common.cs +++ b/src/bindings/mono/eina_mono/eina_container_common.cs @@ -4,22 +4,23 @@ using System; using System.Linq; using System.Runtime.InteropServices; using System.Collections.Generic; +using System.Reflection; using Eina.Callbacks; using static Eina.HashNativeFunctions; using static Eina.InarrayNativeFunctions; using static Eina.InlistNativeFunctions; using static Eina.NativeCustomExportFunctions; -using static Eina.ContainerCommonData; -namespace Eina { - -public enum ElementType { NumericType, StringType, ObjectType }; - -public static class ContainerCommonData +namespace Eina { - public static IBaseElementTraits intPtrTraits = null; -} + +public enum ElementType +{ + NumericType, + StringType, + ObjectType +}; [StructLayout(LayoutKind.Sequential)] public struct InlistMem @@ -36,21 +37,17 @@ public struct InlistNode public T Val {get;set;} } - public interface IBaseElementTraits { IntPtr ManagedToNativeAlloc(T man); - IntPtr ManagedToNativeAllocRef(T man, bool refs); IntPtr ManagedToNativeAllocInlistNode(T man); - IntPtr ManagedToNativeAllocInplace(T man); + void ManagedToNativeCopyTo(T man, IntPtr mem); void NativeFree(IntPtr nat); - void NativeFreeRef(IntPtr nat, bool unrefs); void NativeFreeInlistNodeElement(IntPtr nat); void NativeFreeInlistNode(IntPtr nat, bool freeElement); void NativeFreeInplace(IntPtr nat); void ResidueFreeInplace(IntPtr nat); T NativeToManaged(IntPtr nat); - T NativeToManagedRef(IntPtr nat); T NativeToManagedInlistNode(IntPtr nat); T NativeToManagedInplace(IntPtr nat); IntPtr EinaCompareCb(); @@ -60,67 +57,67 @@ public interface IBaseElementTraits IntPtr EinaHashIteratorKeyNew(IntPtr hash); } -public class StringElementTraits : IBaseElementTraits +public class StringElementTraits : IBaseElementTraits { - public StringElementTraits() { - if (intPtrTraits == null) - intPtrTraits = TraitFunctions.GetTypeTraits(); } - public IntPtr ManagedToNativeAlloc(T man) + public IntPtr ManagedToNativeAlloc(string man) { - return MemoryNative.StrDup((string)(object)man); + IntPtr newstring = MemoryNative.StrDup(man); + return newstring; } - public IntPtr ManagedToNativeAllocRef(T man, bool refs) - { - // Keep alloc on C# ? - return ManagedToNativeAlloc(man); - } - - public IntPtr ManagedToNativeAllocInlistNode(T man) + public IntPtr ManagedToNativeAllocInlistNode(string man) { var node = new InlistNode(); node.Val = ManagedToNativeAlloc(man); GCHandle pinnedData = GCHandle.Alloc(node, GCHandleType.Pinned); IntPtr ptr = pinnedData.AddrOfPinnedObject(); - IntPtr nat = MemoryNative.AllocCopy(ptr, Marshal.SizeOf >()); + IntPtr nat = MemoryNative.AllocCopy(ptr, Marshal.SizeOf() + Marshal.SizeOf()); pinnedData.Free(); return nat; } - public IntPtr ManagedToNativeAllocInplace(T man) + public void ManagedToNativeCopyTo(string man, IntPtr mem) { - return intPtrTraits.ManagedToNativeAlloc(ManagedToNativeAlloc(man)); + IntPtr stringptr = ManagedToNativeAlloc(man); + Marshal.WriteIntPtr(mem, stringptr); } public void NativeFree(IntPtr nat) { if (nat != IntPtr.Zero) + { MemoryNative.Free(nat); - } - - public void NativeFreeRef(IntPtr nat, bool unrefs) - { - NativeFree(nat); + } } public void NativeFreeInlistNodeElement(IntPtr nat) { if (nat == IntPtr.Zero) + { return; - var node = Marshal.PtrToStructure< InlistNode >(nat); - NativeFree(node.Val); + } + + var val = Marshal.PtrToStructure + (nat + Marshal.SizeOf()); + NativeFree(val); } public void NativeFreeInlistNode(IntPtr nat, bool freeElement) { if (nat == IntPtr.Zero) + { return; + } + if (freeElement) + { NativeFreeInlistNodeElement(nat); + } + MemoryNative.Free(nat); } @@ -131,37 +128,45 @@ public class StringElementTraits : IBaseElementTraits public void ResidueFreeInplace(IntPtr nat) { - intPtrTraits.NativeFree(nat); } - public T NativeToManaged(IntPtr nat) + public string NativeToManaged(IntPtr nat) { if (nat == IntPtr.Zero) - return default(T); - return (T)(object)StringConversion.NativeUtf8ToManagedString(nat); + { + return default(string); + } + + return StringConversion.NativeUtf8ToManagedString(nat); } - public T NativeToManagedRef(IntPtr nat) - { - return NativeToManaged(nat); - } - - public T NativeToManagedInlistNode(IntPtr nat) + public string NativeToManagedInlistNode(IntPtr nat) { if (nat == IntPtr.Zero) { Eina.Log.Error("Null pointer for Inlist node."); - return default(T); + return default(string); } - var w = Marshal.PtrToStructure< InlistNode >(nat); - return NativeToManaged(w.Val); + + IntPtr ptr_location = nat + Marshal.SizeOf(); + return NativeToManaged(Marshal.ReadIntPtr(ptr_location)); } - public T NativeToManagedInplace(IntPtr nat) + // Strings inplaced are always a pointer, because they are variable-sized + public string NativeToManagedInplace(IntPtr nat) { if (nat == IntPtr.Zero) - return default(T); - return NativeToManaged(intPtrTraits.NativeToManaged(nat)); + { + return default(string); + } + + nat = Marshal.ReadIntPtr(nat); + if (nat == IntPtr.Zero) + { + return default(string); + } + + return NativeToManaged(nat); } public IntPtr EinaCompareCb() @@ -192,28 +197,15 @@ public class StringElementTraits : IBaseElementTraits public class EflObjectElementTraits : IBaseElementTraits { - private System.Type concreteType = null; - - public EflObjectElementTraits(System.Type concrete) - { - if (intPtrTraits == null) - intPtrTraits = TraitFunctions.GetTypeTraits(); - - concreteType = concrete; - } - public IntPtr ManagedToNativeAlloc(T man) { IntPtr h = ((Efl.Eo.IWrapper)man).NativeHandle; if (h == IntPtr.Zero) + { return h; - return Efl.Eo.Globals.efl_ref(h); - } + } - public IntPtr ManagedToNativeAllocRef(T man, bool refs) - { - IntPtr h = refs ? ManagedToNativeAlloc(man) : ((Efl.Eo.IWrapper)man).NativeHandle; - return intPtrTraits.ManagedToNativeAlloc(h); + return Efl.Eo.Globals.efl_ref(h); } public IntPtr ManagedToNativeAllocInlistNode(T man) @@ -222,68 +214,87 @@ public class EflObjectElementTraits : IBaseElementTraits node.Val = ManagedToNativeAlloc(man); GCHandle pinnedData = GCHandle.Alloc(node, GCHandleType.Pinned); IntPtr ptr = pinnedData.AddrOfPinnedObject(); - IntPtr nat = MemoryNative.AllocCopy(ptr, Marshal.SizeOf >()); + IntPtr nat = MemoryNative.AllocCopy(ptr, Marshal.SizeOf() + Marshal.SizeOf()); pinnedData.Free(); return nat; } - public IntPtr ManagedToNativeAllocInplace(T man) + public void ManagedToNativeCopyTo(T man, IntPtr mem) { - return intPtrTraits.ManagedToNativeAlloc(ManagedToNativeAlloc(man)); + IntPtr v = ManagedToNativeAlloc(man); + Marshal.WriteIntPtr(mem, v); } public void NativeFree(IntPtr nat) { if (nat != IntPtr.Zero) - Efl.Eo.Globals.efl_unref(nat); + { + Efl.Eo.Globals.efl_mono_thread_safe_efl_unref(nat); + } } public void NativeFreeRef(IntPtr nat, bool unrefs) { if (unrefs) - NativeFree(intPtrTraits.NativeToManaged(nat)); - intPtrTraits.NativeFree(nat); + { + NativeFree(nat); + } } public void NativeFreeInlistNodeElement(IntPtr nat) { if (nat == IntPtr.Zero) + { return; - var node = Marshal.PtrToStructure< InlistNode >(nat); - NativeFree(node.Val); + } + + var val = Marshal.PtrToStructure + (nat + Marshal.SizeOf()); + NativeFree(val); } public void NativeFreeInlistNode(IntPtr nat, bool freeElement) { if (nat == IntPtr.Zero) + { return; + } + if (freeElement) + { NativeFreeInlistNodeElement(nat); + } + MemoryNative.Free(nat); } public void NativeFreeInplace(IntPtr nat) { - NativeFree(intPtrTraits.NativeToManaged(nat)); + NativeFree(nat); } public void ResidueFreeInplace(IntPtr nat) { - intPtrTraits.NativeFree(nat); } public T NativeToManaged(IntPtr nat) { if (nat == IntPtr.Zero) + { return default(T); - return (T) Activator.CreateInstance(concreteType, Efl.Eo.Globals.efl_ref(nat)); + } + + return (T) Efl.Eo.Globals.CreateWrapperFor(nat, shouldIncRef: true); } public T NativeToManagedRef(IntPtr nat) { if (nat == IntPtr.Zero) + { return default(T); - return NativeToManaged(intPtrTraits.NativeToManaged(nat)); + } + + return NativeToManaged(nat); } public T NativeToManagedInlistNode(IntPtr nat) @@ -293,15 +304,26 @@ public class EflObjectElementTraits : IBaseElementTraits Eina.Log.Error("Null pointer for Inlist node."); return default(T); } - var w = Marshal.PtrToStructure< InlistNode >(nat); - return NativeToManaged(w.Val); + + IntPtr ptr_location = nat + Marshal.SizeOf(); + return NativeToManaged(Marshal.ReadIntPtr(ptr_location)); } + // EFL objects inplaced are always a pointer, because they are variable-sized public T NativeToManagedInplace(IntPtr nat) { if (nat == IntPtr.Zero) + { return default(T); - return NativeToManaged(intPtrTraits.NativeToManaged(nat)); + } + + nat = Marshal.ReadIntPtr(nat); + if (nat == IntPtr.Zero) + { + return default(T); + } + + return NativeToManaged(nat); } public IntPtr EinaCompareCb() @@ -345,16 +367,12 @@ public abstract class PrimitiveElementTraits node.Val = man; GCHandle pinnedData = GCHandle.Alloc(node, GCHandleType.Pinned); IntPtr ptr = pinnedData.AddrOfPinnedObject(); - IntPtr nat = MemoryNative.AllocCopy(ptr, Marshal.SizeOf< InlistNode >()); + int Tsize = Marshal.SizeOf() < Marshal.SizeOf() ? Marshal.SizeOf() : Marshal.SizeOf(); + IntPtr nat = MemoryNative.AllocCopy(ptr, Marshal.SizeOf() + Tsize); pinnedData.Free(); return nat; } - public IntPtr ManagedToNativeAllocInplace(T man) - { - return ManagedToNativeAlloc(man); - } - public void NativeFree(IntPtr nat) { MemoryNative.Free(nat); @@ -387,6 +405,7 @@ public abstract class PrimitiveElementTraits Eina.Log.Error("Null pointer on primitive/struct container."); return default(T); } + return PrimitiveConversion.PointerToManaged(nat); } @@ -395,16 +414,6 @@ public abstract class PrimitiveElementTraits return NativeToManaged(nat); } - public T NativeToManagedInlistNode(IntPtr nat) - { - if (nat == IntPtr.Zero) - { - Eina.Log.Error("Null pointer for Inlist node."); - return default(T); - } - var w = Marshal.PtrToStructure< InlistNode >(nat); - return w.Val; - } public T NativeToManagedInplace(IntPtr nat) { @@ -413,7 +422,7 @@ public abstract class PrimitiveElementTraits private int PrimitiveCompareCb(IntPtr ptr1, IntPtr ptr2) { - var m1 = (IComparable) NativeToManaged(ptr1); + var m1 = (IComparable)NativeToManaged(ptr1); var m2 = NativeToManaged(ptr2); return m1.CompareTo(m2); } @@ -421,7 +430,10 @@ public abstract class PrimitiveElementTraits public IntPtr EinaCompareCb() { if (dlgt == null) + { dlgt = new Eina_Compare_Cb(PrimitiveCompareCb); + } + return Marshal.GetFunctionPointerForDelegate(dlgt); } @@ -441,19 +453,28 @@ public abstract class PrimitiveElementTraits } } -public class Primitive32ElementTraits : PrimitiveElementTraits, IBaseElementTraits +abstract public class Primitive32ElementTraits : PrimitiveElementTraits, IBaseElementTraits { private static IBaseElementTraits int32Traits = null; public Primitive32ElementTraits() { if (int32Traits == null) + { if (typeof(T) == typeof(Int32)) // avoid infinite recursion + { int32Traits = (IBaseElementTraits)this; + } else + { int32Traits = TraitFunctions.GetTypeTraits(); + } + } } + public abstract void ManagedToNativeCopyTo(T man, IntPtr mem); + public abstract T NativeToManagedInlistNode(IntPtr nat); + public IntPtr ManagedToNativeAllocRef(T man, bool refs) { return int32Traits.ManagedToNativeAlloc(Convert.ToInt32((object)man)); @@ -470,19 +491,28 @@ public class Primitive32ElementTraits : PrimitiveElementTraits, IBaseEleme } } -public class Primitive64ElementTraits : PrimitiveElementTraits, IBaseElementTraits +abstract public class Primitive64ElementTraits : PrimitiveElementTraits, IBaseElementTraits { private static IBaseElementTraits int64Traits = null; public Primitive64ElementTraits() { if (int64Traits == null) + { if (typeof(T) == typeof(Int64)) // avoid infinite recursion + { int64Traits = (IBaseElementTraits)this; + } else + { int64Traits = TraitFunctions.GetTypeTraits(); + } + } } + public abstract void ManagedToNativeCopyTo(T man, IntPtr mem); + public abstract T NativeToManagedInlistNode(IntPtr nat); + public IntPtr ManagedToNativeAllocRef(T man, bool refs) { return int64Traits.ManagedToNativeAlloc(Convert.ToInt64((object)man)); @@ -499,6 +529,174 @@ public class Primitive64ElementTraits : PrimitiveElementTraits, IBaseEleme } } +public class IntElementTraits : Primitive32ElementTraits, IBaseElementTraits +{ + override public void ManagedToNativeCopyTo(int man, IntPtr mem) + { + var arr = new int[1]; + arr[0] = man; + Marshal.Copy(arr, 0, mem, 1); + } + + override public int NativeToManagedInlistNode(IntPtr nat) + { + if (nat == IntPtr.Zero) + { + Eina.Log.Error("Null pointer for Inlist node."); + return default(int); + } + + IntPtr loc = nat + Marshal.SizeOf(); + var v = new int[1]; + Marshal.Copy(loc, v, 0, 1); + return v[0]; + } +} + +public class CharElementTraits : Primitive32ElementTraits, IBaseElementTraits +{ + override public void ManagedToNativeCopyTo(char man, IntPtr mem) + { + var arr = new char[1]; + arr[0] = man; + Marshal.Copy(arr, 0, mem, 1); + } + + override public char NativeToManagedInlistNode(IntPtr nat) + { + if (nat == IntPtr.Zero) + { + Eina.Log.Error("Null pointer for Inlist node."); + return default(char); + } + + IntPtr loc = nat + Marshal.SizeOf(); + var v = new char[1]; + Marshal.Copy(loc, v, 0, 1); + return v[0]; + } +} + +public class LongElementTraits : Primitive64ElementTraits, IBaseElementTraits +{ + override public void ManagedToNativeCopyTo(long man, IntPtr mem) + { + var arr = new long[1]; + arr[0] = man; + Marshal.Copy(arr, 0, mem, 1); + } + + override public long NativeToManagedInlistNode(IntPtr nat) + { + if (nat == IntPtr.Zero) + { + Eina.Log.Error("Null pointer for Inlist node."); + return default(long); + } + + IntPtr loc = nat + Marshal.SizeOf(); + var v = new long[1]; + Marshal.Copy(loc, v, 0, 1); + return v[0]; + } +} + +public class ShortElementTraits : Primitive32ElementTraits, IBaseElementTraits +{ + override public void ManagedToNativeCopyTo(short man, IntPtr mem) + { + var arr = new short[1]; + arr[0] = man; + Marshal.Copy(arr, 0, mem, 1); + } + + override public short NativeToManagedInlistNode(IntPtr nat) + { + if (nat == IntPtr.Zero) + { + Eina.Log.Error("Null pointer for Inlist node."); + return default(short); + } + + IntPtr loc = nat + Marshal.SizeOf(); + var v = new short[1]; + Marshal.Copy(loc, v, 0, 1); + return v[0]; + } +} + +public class FloatElementTraits : Primitive32ElementTraits, IBaseElementTraits +{ + override public void ManagedToNativeCopyTo(float man, IntPtr mem) + { + var arr = new float[1]; + arr[0] = man; + Marshal.Copy(arr, 0, mem, 1); + } + + override public float NativeToManagedInlistNode(IntPtr nat) + { + if (nat == IntPtr.Zero) + { + Eina.Log.Error("Null pointer for Inlist node."); + return default(float); + } + + IntPtr loc = nat + Marshal.SizeOf(); + var v = new float[1]; + Marshal.Copy(loc, v, 0, 1); + return v[0]; + } +} + +public class DoubleElementTraits : Primitive64ElementTraits, IBaseElementTraits +{ + override public void ManagedToNativeCopyTo(double man, IntPtr mem) + { + var arr = new double[1]; + arr[0] = man; + Marshal.Copy(arr, 0, mem, 1); + } + + override public double NativeToManagedInlistNode(IntPtr nat) + { + if (nat == IntPtr.Zero) + { + Eina.Log.Error("Null pointer for Inlist node."); + return default(double); + } + + IntPtr loc = nat + Marshal.SizeOf(); + var v = new double[1]; + Marshal.Copy(loc, v, 0, 1); + return v[0]; + } +} + +public class ByteElementTraits : Primitive32ElementTraits, IBaseElementTraits +{ + override public void ManagedToNativeCopyTo(byte man, IntPtr mem) + { + var arr = new byte[1]; + arr[0] = man; + Marshal.Copy(arr, 0, mem, 1); + } + + override public byte NativeToManagedInlistNode(IntPtr nat) + { + if (nat == IntPtr.Zero) + { + Eina.Log.Error("Null pointer for Inlist node."); + return default(byte); + } + + IntPtr loc = nat + Marshal.SizeOf(); + var v = new byte[1]; + Marshal.Copy(loc, v, 0, 1); + return v[0]; + } +} + public static class TraitFunctions { public static bool IsEflObject(System.Type type) @@ -514,11 +712,17 @@ public static class TraitFunctions public static Eina.ElementType GetElementTypeCode(System.Type type) { if (IsEflObject(type)) + { return ElementType.ObjectType; + } else if (IsString(type)) + { return ElementType.StringType; + } else + { return ElementType.NumericType; + } } private static IDictionary register = new Dictionary(); @@ -526,51 +730,79 @@ public static class TraitFunctions 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); + string fullName = type.FullName + "Concrete"; 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. + return type; // Not interface, so it should be a concrete. } public static object RegisterTypeTraits() { + Eina.Log.Debug($"Finding TypeTraits for {typeof(T).Name}"); object traits; var type = typeof(T); if (IsEflObject(type)) { 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(concrete); + } + + // No need to pass concrete as the traits class will use reflection to get the actually most + // derived type returned. + traits = new EflObjectElementTraits(); } else if (IsString(type)) - traits = new StringElementTraits(); + { + traits = new StringElementTraits(); + } else if (type.IsValueType) { - if (Marshal.SizeOf() <= 4) - traits = new Primitive32ElementTraits(); + if (type == typeof(int)) + { + traits = new IntElementTraits(); + } + else if (type == typeof(char)) + { + traits = new CharElementTraits(); + } + else if (type == typeof(long)) + { + traits = new LongElementTraits(); + } + else if (type == typeof(short)) + { + traits = new ShortElementTraits(); + } + else if (type == typeof(float)) + { + traits = new FloatElementTraits(); + } + else if (type == typeof(double)) + { + traits = new DoubleElementTraits(); + } + else if (type == typeof(byte)) + { + traits = new ByteElementTraits(); + } else - traits = new Primitive64ElementTraits(); + { + throw new Exception("No traits registered for this type"); + } } else + { throw new Exception("No traits registered for this type"); + } register[type] = traits; return traits; @@ -586,8 +818,11 @@ public static class TraitFunctions { object traits; if (!register.TryGetValue(typeof(T), out traits)) + { traits = RegisterTypeTraits(); - return (IBaseElementTraits) traits; + } + + return (IBaseElementTraits)traits; } // // @@ -601,14 +836,9 @@ public static class TraitFunctions return GetTypeTraits().ManagedToNativeAlloc(man); } - public static IntPtr ManagedToNativeAllocRef(T man, bool refs = false) + public static void ManagedToNativeCopyTo(T man, IntPtr mem) { - return GetTypeTraits().ManagedToNativeAllocRef(man, refs); - } - - public static IntPtr ManagedToNativeAllocInplace(T man) - { - return GetTypeTraits().ManagedToNativeAllocInplace(man); + GetTypeTraits().ManagedToNativeCopyTo(man, mem); } public static IntPtr ManagedToNativeAllocInlistNode(T man) @@ -621,11 +851,6 @@ public static class TraitFunctions GetTypeTraits().NativeFree(nat); } - public static void NativeFreeRef(IntPtr nat, bool unrefs = false) - { - GetTypeTraits().NativeFreeRef(nat, unrefs); - } - public static void NativeFreeInlistNodeElement(IntPtr nat) { GetTypeTraits().NativeFreeInlistNodeElement(nat); @@ -651,11 +876,6 @@ public static class TraitFunctions return GetTypeTraits().NativeToManaged(nat); } - public static T NativeToManagedRef(IntPtr nat) - { - return GetTypeTraits().NativeToManagedRef(nat); - } - public static T NativeToManagedInlistNode(IntPtr nat) { return GetTypeTraits().NativeToManagedInlistNode(nat); diff --git a/src/bindings/mono/eina_mono/eina_error.cs b/src/bindings/mono/eina_mono/eina_error.cs index 07760fd395..0247cb64db 100644 --- a/src/bindings/mono/eina_mono/eina_error.cs +++ b/src/bindings/mono/eina_mono/eina_error.cs @@ -3,7 +3,8 @@ using System; using System.Runtime.InteropServices; -namespace Eina { +namespace Eina +{ public struct Error : IComparable { @@ -21,19 +22,26 @@ public struct Error : IComparable public static Error ENOENT = new Error(2); public static Error ECANCELED = new Error(125); - public Error(int value) { code = value; } + public Error(int value) + { + code = value; + } + static public implicit operator Error(int val) { return new Error(val); } + static public implicit operator int(Error error) { return error.code; } + public int CompareTo(Error err) { return code.CompareTo(err.code); } + public override string ToString() { return "Eina.Error(" + code + ")"; @@ -80,7 +88,9 @@ public struct Error : IComparable public static void Raise(Error e) { if (e != 0) + { throw (new Efl.EflException(MsgGet(e))); + } } public static void Clear() @@ -93,4 +103,5 @@ public struct Error : IComparable return eina_error_msg_register(msg); } } + } diff --git a/src/bindings/mono/eina_mono/eina_hash.cs b/src/bindings/mono/eina_mono/eina_hash.cs index 590033e7ab..8b3c1e7db5 100644 --- a/src/bindings/mono/eina_mono/eina_hash.cs +++ b/src/bindings/mono/eina_mono/eina_hash.cs @@ -137,8 +137,10 @@ public class Hash : IEnumerable>, IDi public bool OwnKey {get; set;} public bool OwnValue {get; set;} - public int Count { - get { + public int Count + { + get + { return Population(); } } @@ -179,10 +181,21 @@ public class Hash : IEnumerable>, IDi IntPtr h = Handle; Handle = IntPtr.Zero; if (h == IntPtr.Zero) + { return; + } if (Own) - eina_hash_free(h); + { + if (disposing) + { + eina_hash_free(h); + } + else + { + Efl.Eo.Globals.ThreadSafeFreeCbExec(eina_hash_free, h); + } + } } public void Dispose() @@ -218,7 +231,9 @@ public class Hash : IEnumerable>, IDi OwnValue = ownValue; if (ownValue) + { eina_hash_free_cb_set(Handle, EinaFreeCb()); + } } public void SetOwnership(bool ownAll) @@ -242,10 +257,13 @@ public class Hash : IEnumerable>, IDi public bool AddNew(TKey key, TValue val) { - var nk = ManagedToNativeAllocRef(key, true); - var nv = ManagedToNativeAlloc(val); + IntPtr gchnk = CopyNativeObject(key, ForceRefKey()); + IntPtr nk = GetNativePtr(gchnk, ForceRefKey()); + IntPtr gchnv = CopyNativeObject(val, false); + IntPtr nv = GetNativePtr(gchnv, false); var r = eina_hash_add(Handle, nk, nv); - NativeFreeRef(nk); + FreeNativeIndirection(gchnk, ForceRefKey()); + FreeNativeIndirection(gchnv, false); return r; } @@ -256,17 +274,20 @@ public class Hash : IEnumerable>, IDi public bool DelByKey(TKey key) { - var nk = ManagedToNativeAllocRef(key); + IntPtr gchnk = CopyNativeObject(key, ForceRefKey()); + IntPtr nk = GetNativePtr(gchnk, ForceRefKey()); var r = eina_hash_del_by_key(Handle, nk); - NativeFreeRef(nk, OwnKey && r); + FreeNativeIndirection(gchnk, ForceRefKey()); + // NativeFreeRef(nk, OwnKey && r); return r; } public bool DelByValue(TValue val) { - var nv = ManagedToNativeAlloc(val); + IntPtr gchnv = CopyNativeObject(val, false); + IntPtr nv = GetNativePtr(gchnv, false); var r = eina_hash_del_by_data(Handle, nv); - NativeFree(nv); + FreeNativeIndirection(gchnv, false); return r; } @@ -277,60 +298,151 @@ public class Hash : IEnumerable>, IDi public TValue Find(TKey key) { - var nk = ManagedToNativeAllocRef(key); + var gchnk = CopyNativeObject(key, ForceRefKey()); + var nk = GetNativePtr(gchnk, ForceRefKey()); var found = eina_hash_find(Handle, nk); - NativeFreeRef(nk); + //NativeFreeRef(nk); + FreeNativeIndirection(gchnk, ForceRefKey()); if (found == IntPtr.Zero) + { throw new KeyNotFoundException(); - return NativeToManaged(found); + } + + return NativeToManaged(IndirectNative(found, false)); } public bool TryGetValue(TKey key, out TValue val) { - var nk = ManagedToNativeAllocRef(key); + var gchnk = CopyNativeObject(key, ForceRefKey()); + var nk = GetNativePtr(gchnk, ForceRefKey()); var found = eina_hash_find(Handle, nk); - NativeFreeRef(nk); + FreeNativeIndirection(gchnk, ForceRefKey()); if (found == IntPtr.Zero) { val = default(TValue); return false; } - val = NativeToManaged(found); + + val = NativeToManaged(IndirectNative(found, false)); return true; } public bool ContainsKey(TKey key) { - var nk = ManagedToNativeAllocRef(key); + var gchnk = CopyNativeObject(key, ForceRefKey()); + var nk = GetNativePtr(gchnk, ForceRefKey()); + // var nk = ManagedToNativeAllocRef(key); var found = eina_hash_find(Handle, nk); - NativeFreeRef(nk); + // NativeFreeRef(nk); + FreeNativeIndirection(gchnk, ForceRefKey()); return found != IntPtr.Zero; } public bool Modify(TKey key, TValue val) { - var nk = ManagedToNativeAllocRef(key); - var nv = ManagedToNativeAlloc(val); + var gchnk = CopyNativeObject(key, ForceRefKey()); + var nk = GetNativePtr(gchnk, ForceRefKey()); + var gchnv = CopyNativeObject(val, false); + var nv = GetNativePtr(gchnv, false); var old = eina_hash_modify(Handle, nk, nv); - NativeFreeRef(nk); + FreeNativeIndirection(gchnk, ForceRefKey()); + // NativeFreeRef(nk); if (old == IntPtr.Zero) { NativeFree(nv); return false; } + if (OwnValue) + { NativeFree(old); + } + return true; } + private static bool ForceRefKey() + { + return (!typeof(T).IsValueType) && (typeof(T) != typeof(string)); + } + + private static IntPtr CopyNativeObject(T value, bool forceRef) + { + if (!IsEflObject(typeof(T)) && forceRef) + { + GCHandle gch = GCHandle.Alloc(new byte[Marshal.SizeOf()], GCHandleType.Pinned); + IntPtr pin = gch.AddrOfPinnedObject(); + + ManagedToNativeCopyTo(value, pin); + + return GCHandle.ToIntPtr(gch); + } + else if (IsEflObject(typeof(T)) && forceRef) + { + GCHandle gch = GCHandle.Alloc(new byte[Marshal.SizeOf()], GCHandleType.Pinned); + IntPtr pin = gch.AddrOfPinnedObject(); + + ManagedToNativeCopyTo(value, pin); + + return GCHandle.ToIntPtr(gch); + } + else + { + return ManagedToNativeAlloc(value); + } + } + + private static IntPtr GetNativePtr(IntPtr gchptr, bool forceRef) + { + if (forceRef) + { + GCHandle gch = GCHandle.FromIntPtr(gchptr); + IntPtr pin = gch.AddrOfPinnedObject(); + + return pin; + } + else + { + return gchptr; + } + } + + private static void FreeNativeIndirection(IntPtr gchptr, bool forceRef) + { + if (forceRef) + { + GCHandle gch = GCHandle.FromIntPtr(gchptr); + gch.Free(); + } + } + + private static IntPtr IndirectNative(IntPtr ptr, bool forceRef) + { + if (forceRef) + { + IntPtr val = Marshal.ReadIntPtr(ptr); + return val; + } + else + { + return ptr; + } + } + public void Set(TKey key, TValue val) { - var nk = ManagedToNativeAllocRef(key, true); - var nv = ManagedToNativeAlloc(val); - var old = eina_hash_set(Handle, nk, nv); - NativeFreeRef(nk, old != IntPtr.Zero); - if (old != IntPtr.Zero && OwnValue) + IntPtr gchnk = CopyNativeObject(key, ForceRefKey()); + IntPtr nk = GetNativePtr(gchnk, ForceRefKey()); + + IntPtr gchnv = CopyNativeObject(val, false); + IntPtr nv = GetNativePtr(gchnv, false); + IntPtr old = eina_hash_set(Handle, nk, nv); + FreeNativeIndirection(gchnk, ForceRefKey()); + FreeNativeIndirection(gchnv, false); + if (OwnValue || old != IntPtr.Zero) + { NativeFree(old); + } } public TValue this[TKey key] @@ -347,11 +459,17 @@ public class Hash : IEnumerable>, IDi public bool Move(TKey key_old, TKey key_new) { - var nk_old = ManagedToNativeAllocRef(key_old); - var nk_new = ManagedToNativeAllocRef(key_new, true); - var r = eina_hash_move(Handle, nk_old, nk_new); - NativeFreeRef(nk_old, OwnKey && r); - NativeFreeRef(nk_new, !r); + IntPtr gchnko = CopyNativeObject(key_old, ForceRefKey()); + IntPtr nko = GetNativePtr(gchnko, ForceRefKey()); + IntPtr gchnk = CopyNativeObject(key_new, ForceRefKey()); + IntPtr nk = GetNativePtr(gchnk, ForceRefKey()); + // var nk_old = ManagedToNativeAllocRef(key_old); + // var nk_new = ManagedToNativeAllocRef(key_new, true); + var r = eina_hash_move(Handle, nko, nk); + FreeNativeIndirection(gchnko, ForceRefKey()); + FreeNativeIndirection(gchnk, ForceRefKey()); + // NativeFreeRef(nk_old, OwnKey && r); + // NativeFreeRef(nk_new, !r); return r; } @@ -383,7 +501,8 @@ public class Hash : IEnumerable>, IDi for (IntPtr tuplePtr; eina_iterator_next(itr, out tuplePtr);) { var tuple = Marshal.PtrToStructure(tuplePtr); - var key = NativeToManagedRef(tuple.key); + IntPtr ikey = IndirectNative(tuple.key, ForceRefKey()); + var key = NativeToManaged(ikey); var val = NativeToManaged(tuple.data); yield return new KeyValuePair(key, val); } @@ -401,4 +520,3 @@ public class Hash : IEnumerable>, IDi } } - diff --git a/src/bindings/mono/eina_mono/eina_inarray.cs b/src/bindings/mono/eina_mono/eina_inarray.cs index d81f2ad239..c7f3151ac1 100644 --- a/src/bindings/mono/eina_mono/eina_inarray.cs +++ b/src/bindings/mono/eina_mono/eina_inarray.cs @@ -7,7 +7,8 @@ using System.Collections.Generic; using static Eina.TraitFunctions; using static Eina.InarrayNativeFunctions; -namespace Eina { +namespace Eina +{ public static class InarrayNativeFunctions { @@ -86,7 +87,9 @@ public class Inarray : IEnumerable, IDisposable Own = true; OwnContent = true; if (Handle == IntPtr.Zero) + { throw new SEHException("Could not alloc inarray"); + } } public Inarray() @@ -123,19 +126,30 @@ public class Inarray : IEnumerable, IDisposable IntPtr h = Handle; Handle = IntPtr.Zero; if (h == IntPtr.Zero) + { return; + } if (OwnContent) { uint len = eina_inarray_count(h); - for(uint i = 0; i < len; ++i) + for (uint i = 0; i < len; ++i) { NativeFreeInplace(eina_inarray_nth(h, i)); } } if (Own) - eina_inarray_free(h); + { + if (disposing) + { + eina_inarray_free(h); + } + else + { + Efl.Eo.Globals.ThreadSafeFreeCbExec(eina_inarray_free, h); + } + } } public void Dispose() @@ -176,7 +190,7 @@ public class Inarray : IEnumerable, IDisposable public int Count() { - return (int) eina_inarray_count(Handle); + return (int)eina_inarray_count(Handle); } public void SetOwnership(bool ownAll) @@ -193,11 +207,20 @@ public class Inarray : IEnumerable, IDisposable public int Push(T val) { - IntPtr ele = ManagedToNativeAllocInplace(val); - var r = eina_inarray_push(Handle, ele); + IntPtr ele = IntPtr.Zero; + GCHandle gch = GCHandle.Alloc(ele, GCHandleType.Pinned); + IntPtr ind = gch.AddrOfPinnedObject(); + + ManagedToNativeCopyTo(val, ind); + + var r = eina_inarray_push(Handle, ind); if (r == -1) + { NativeFreeInplace(ele); + } + ResidueFreeInplace(ele); + gch.Free(); return r; } @@ -205,7 +228,9 @@ public class Inarray : IEnumerable, IDisposable // public void Add(T val) // { // if (!Push(val)) -// throw; +// { +// throw; +// } // } public T Pop() @@ -213,7 +238,10 @@ public class Inarray : IEnumerable, IDisposable IntPtr ele = eina_inarray_pop(Handle); var r = NativeToManagedInplace(ele); if (OwnContent && ele != IntPtr.Zero) + { NativeFreeInplace(ele); + } + return r; } @@ -230,10 +258,18 @@ public class Inarray : IEnumerable, IDisposable public bool InsertAt(uint idx, T val) { - IntPtr ele = ManagedToNativeAllocInplace(val); - var r = eina_inarray_insert_at(Handle, idx, ele); + IntPtr ele = IntPtr.Zero; + GCHandle gch = GCHandle.Alloc(ele, GCHandleType.Pinned); + IntPtr ind = gch.AddrOfPinnedObject(); + + ManagedToNativeCopyTo(val, ind); + + var r = eina_inarray_insert_at(Handle, idx, ind); if (!r) + { NativeFreeInplace(ele); + } + ResidueFreeInplace(ele); return r; } @@ -242,11 +278,22 @@ public class Inarray : IEnumerable, IDisposable { var old = eina_inarray_nth(Handle, idx); if (old == IntPtr.Zero) + { return false; + } + if (OwnContent) + { NativeFreeInplace(old); - var ele = ManagedToNativeAllocInplace(val); - var r = eina_inarray_replace_at(Handle, idx, ele); + } + + var ele = IntPtr.Zero; + GCHandle gch = GCHandle.Alloc(ele, GCHandleType.Pinned); + IntPtr ind = gch.AddrOfPinnedObject(); + + ManagedToNativeCopyTo(val, ind); + + var r = eina_inarray_replace_at(Handle, idx, ind); ResidueFreeInplace(ele); return r; } @@ -267,9 +314,14 @@ public class Inarray : IEnumerable, IDisposable { IntPtr ele = eina_inarray_nth(Handle, idx); if (ele == IntPtr.Zero) + { return false; + } + if (OwnContent) + { NativeFreeInplace(ele); + } return eina_inarray_remove_at(Handle, idx); } @@ -283,18 +335,24 @@ public class Inarray : IEnumerable, IDisposable { int len = Length; var managed = new T[len]; - for(int i = 0; i < len; ++i) + for (int i = 0; i < len; ++i) { managed[i] = At(i); } + return managed; } public bool Append(T[] values) { - foreach(T v in values) + foreach (T v in values) + { if (Push(v) == -1) + { return false; + } + } + return true; } @@ -311,7 +369,7 @@ public class Inarray : IEnumerable, IDisposable public IEnumerator GetEnumerator() { int len = Length; - for(int i = 0; i < len; ++i) + for (int i = 0; i < len; ++i) { yield return At(i); } diff --git a/src/bindings/mono/eina_mono/eina_inlist.cs b/src/bindings/mono/eina_mono/eina_inlist.cs index 0bf09d0b85..0cc9bae6a0 100644 --- a/src/bindings/mono/eina_mono/eina_inlist.cs +++ b/src/bindings/mono/eina_mono/eina_inlist.cs @@ -8,7 +8,8 @@ using static Eina.TraitFunctions; using static Eina.InlistNativeFunctions; using Eina.Callbacks; -namespace Eina { +namespace Eina +{ public static class InlistNativeFunctions { @@ -111,11 +112,16 @@ public class Inlist : IEnumerable, IDisposable private IntPtr InternalAt(int idx) { if (idx < 0) + { return IntPtr.Zero; + } IntPtr curr = Handle; for (int n = 0; n != idx && curr != IntPtr.Zero; ++n) + { curr = InternalNext(curr); + } + return curr; } @@ -159,11 +165,13 @@ public class Inlist : IEnumerable, IDisposable IntPtr h = Handle; Handle = IntPtr.Zero; if (h == IntPtr.Zero) + { return; + } if (OwnContent) { - for(IntPtr curr = h; curr != IntPtr.Zero; curr = InternalNext(curr)) + for (IntPtr curr = h; curr != IntPtr.Zero; curr = InternalNext(curr)) { NativeFreeInlistNodeElement(curr); } @@ -212,7 +220,7 @@ public class Inlist : IEnumerable, IDisposable public int Count() { - return (int) eina_inlist_count(Handle); + return (int)eina_inlist_count(Handle); } public void Clean() @@ -248,7 +256,10 @@ public class Inlist : IEnumerable, IDisposable { IntPtr node = InternalAt(idx); if (node == IntPtr.Zero) + { throw new IndexOutOfRangeException(); + } + return NativeToManagedInlistNode(node); } @@ -256,7 +267,9 @@ public class Inlist : IEnumerable, IDisposable { IntPtr old = InternalAt(idx); if (old == IntPtr.Zero) + { throw new IndexOutOfRangeException(); + } IntPtr new_node = ManagedToNativeAllocInlistNode(val); @@ -282,17 +295,20 @@ public class Inlist : IEnumerable, IDisposable { var managed = new T[Count()]; int i = 0; - for(IntPtr curr = Handle; curr != IntPtr.Zero; ++i, curr = InternalNext(curr)) + for (IntPtr curr = Handle; curr != IntPtr.Zero; ++i, curr = InternalNext(curr)) { managed[i] = NativeToManagedInlistNode(curr); } + return managed; } public void AppendArray(T[] values) { foreach (T v in values) + { Append(v); + } } @@ -303,7 +319,7 @@ public class Inlist : IEnumerable, IDisposable public IEnumerator GetEnumerator() { - for(IntPtr curr = Handle; curr != IntPtr.Zero; curr = InternalNext(curr)) + for (IntPtr curr = Handle; curr != IntPtr.Zero; curr = InternalNext(curr)) { yield return NativeToManagedInlistNode(curr); } diff --git a/src/bindings/mono/eina_mono/eina_iterator.cs b/src/bindings/mono/eina_mono/eina_iterator.cs index 56ebab3f0c..05b5408606 100644 --- a/src/bindings/mono/eina_mono/eina_iterator.cs +++ b/src/bindings/mono/eina_mono/eina_iterator.cs @@ -7,7 +7,8 @@ using System.Collections.Generic; using static Eina.TraitFunctions; using static Eina.IteratorNativeFunctions; -namespace Eina { +namespace Eina +{ public static class IteratorNativeFunctions { @@ -58,18 +59,29 @@ public class Iterator : IEnumerable, IDisposable var h = Handle; Handle = IntPtr.Zero; if (h == IntPtr.Zero) + { return; + } if (OwnContent) { - for(IntPtr data; eina_iterator_next(h, out data);) + for (IntPtr data; eina_iterator_next(h, out data);) { NativeFree(data); } } if (Own) - eina_iterator_free(h); + { + if (disposing) + { + eina_iterator_free(h); + } + else + { + Efl.Eo.Globals.ThreadSafeFreeCbExec(eina_iterator_free, h); + } + } } public void Dispose() @@ -114,7 +126,9 @@ public class Iterator : IEnumerable, IDisposable res = NativeToManaged(data); if (OwnContent) + { NativeFree(data); + } return true; } @@ -131,7 +145,7 @@ public class Iterator : IEnumerable, IDisposable public IEnumerator GetEnumerator() { - for(T curr; Next(out curr);) + for (T curr; Next(out curr);) { yield return curr; } diff --git a/src/bindings/mono/eina_mono/eina_list.cs b/src/bindings/mono/eina_mono/eina_list.cs index 8ad4a2f6cf..4b9e5f5856 100644 --- a/src/bindings/mono/eina_mono/eina_list.cs +++ b/src/bindings/mono/eina_mono/eina_list.cs @@ -8,7 +8,8 @@ using static Eina.TraitFunctions; using static Eina.ListNativeFunctions; using Eina.Callbacks; -namespace Eina { +namespace Eina +{ public static class ListNativeFunctions { @@ -44,6 +45,8 @@ public static class ListNativeFunctions eina_list_move_list(ref IntPtr to, ref IntPtr from, IntPtr data); [DllImport(efl.Libs.Eina)] public static extern IntPtr eina_list_free(IntPtr list); + [DllImport(efl.Libs.CustomExports)] public static extern void + efl_mono_thread_safe_eina_list_free(IntPtr list); [DllImport(efl.Libs.Eina)] public static extern IntPtr eina_list_nth(IntPtr list, uint n); [DllImport(efl.Libs.Eina)] public static extern IntPtr @@ -175,18 +178,29 @@ public class List : IEnumerable, IDisposable IntPtr h = Handle; Handle = IntPtr.Zero; if (h == IntPtr.Zero) + { return; + } if (OwnContent) { - for(IntPtr curr = h; curr != IntPtr.Zero; curr = InternalNext(curr)) + for (IntPtr curr = h; curr != IntPtr.Zero; curr = InternalNext(curr)) { NativeFree(InternalDataGet(curr)); } } if (Own) - eina_list_free(h); + { + if (disposing) + { + eina_list_free(h); + } + else + { + efl_mono_thread_safe_eina_list_free(h); + } + } } public void Dispose() @@ -221,7 +235,7 @@ public class List : IEnumerable, IDisposable public int Count() { - return (int) eina_list_count_custom_export_mono(Handle); + return (int)eina_list_count_custom_export_mono(Handle); } public void Append(T val) @@ -274,9 +288,15 @@ public class List : IEnumerable, IDisposable { IntPtr pos = eina_list_nth_list(Handle, (uint)idx); if (pos == IntPtr.Zero) + { throw new IndexOutOfRangeException(); + } + if (OwnContent) + { NativeFree(InternalDataGet(pos)); + } + IntPtr ele = ManagedToNativeAlloc(val); InternalDataSet(pos, ele); } @@ -314,17 +334,20 @@ public class List : IEnumerable, IDisposable { var managed = new T[Count()]; int i = 0; - for(IntPtr curr = Handle; curr != IntPtr.Zero; curr = InternalNext(curr), ++i) + for (IntPtr curr = Handle; curr != IntPtr.Zero; curr = InternalNext(curr), ++i) { managed[i] = NativeToManaged(InternalDataGet(curr)); } + return managed; } public void AppendArray(T[] values) { foreach (T v in values) + { Append(v); + } } @@ -340,7 +363,7 @@ public class List : IEnumerable, IDisposable public IEnumerator GetEnumerator() { - for(IntPtr curr = Handle; curr != IntPtr.Zero; curr = InternalNext(curr)) + for (IntPtr curr = Handle; curr != IntPtr.Zero; curr = InternalNext(curr)) { yield return NativeToManaged(InternalDataGet(curr)); } diff --git a/src/bindings/mono/eina_mono/eina_log.cs b/src/bindings/mono/eina_mono/eina_log.cs index c17f02b8e5..56882b9000 100644 --- a/src/bindings/mono/eina_mono/eina_log.cs +++ b/src/bindings/mono/eina_mono/eina_log.cs @@ -5,7 +5,9 @@ using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Diagnostics.Contracts; -namespace Eina { // Manual wrappers around eina functions +namespace Eina +{ +// Manual wrappers around eina functions public class Log { @@ -55,44 +57,54 @@ public class Log static Log() { - const String name="mono"; - const String color="\033[32;1m"; + const String name = "mono"; + const String color = "\033[32;1m"; // Maybe move this check outside when other eina stuff get support? domain = eina_log_domain_register(name, color); if (domain < 0) - Console.WriteLine("Error: Couldn't register Eina log domain for name {0}.", name); + { + Console.WriteLine("Error: Couldn't register Eina log domain for name {0}.", name); + } else - Info($"Registered mono domain with number {domain}"); + { + Info($"Registered mono domain with number {domain}"); + } } private static void EnsureDomainRegistered() { if (domain < 0) - throw new InvalidOperationException("Log domain is not registered."); + { + throw new InvalidOperationException("Log domain is not registered."); + } } - public static void Critical(String message, [CallerLineNumber] int line=0, [CallerFilePath] string file=null, [CallerMemberName] string member = null) + public static void Critical(String message, [CallerLineNumber] int line = 0, [CallerFilePath] string file = null, [CallerMemberName] string member = null) { EnsureDomainRegistered(); eina_log_print(domain, Level.Critical, file, member, line, message); } - public static void Error(String message, [CallerLineNumber] int line=0, [CallerFilePath] string file=null, [CallerMemberName] string member = null) + + public static void Error(String message, [CallerLineNumber] int line = 0, [CallerFilePath] string file = null, [CallerMemberName] string member = null) { EnsureDomainRegistered(); eina_log_print(domain, Level.Error, file, member, line, message); } - public static void Warning(String message, [CallerLineNumber] int line=0, [CallerFilePath] string file=null, [CallerMemberName] string member = null) + + public static void Warning(String message, [CallerLineNumber] int line = 0, [CallerFilePath] string file = null, [CallerMemberName] string member = null) { EnsureDomainRegistered(); eina_log_print(domain, Level.Warning, file, member, line, message); } - public static void Info(String message, [CallerLineNumber] int line=0, [CallerFilePath] string file=null, [CallerMemberName] string member = null) + + public static void Info(String message, [CallerLineNumber] int line = 0, [CallerFilePath] string file = null, [CallerMemberName] string member = null) { EnsureDomainRegistered(); eina_log_print(domain, Level.Info, file, member, line, message); } - public static void Debug(String message, [CallerLineNumber] int line=0, [CallerFilePath] string file=null, [CallerMemberName] string member = null) + + public static void Debug(String message, [CallerLineNumber] int line = 0, [CallerFilePath] string file = null, [CallerMemberName] string member = null) { EnsureDomainRegistered(); eina_log_print(domain, Level.Debug, file, member, line, message); @@ -108,4 +120,5 @@ public class Log return eina_log_level_get(); } } + } diff --git a/src/bindings/mono/eina_mono/eina_promises.cs b/src/bindings/mono/eina_mono/eina_promises.cs index 8be5f9d6cb..25077a3c97 100644 --- a/src/bindings/mono/eina_mono/eina_promises.cs +++ b/src/bindings/mono/eina_mono/eina_promises.cs @@ -6,9 +6,11 @@ using System.Linq; using static Eina.EinaNative.PromiseNativeMethods; -namespace Eina { +namespace Eina +{ -namespace EinaNative { +namespace EinaNative +{ static internal class PromiseNativeMethods { @@ -26,6 +28,9 @@ static internal class PromiseNativeMethods [DllImport(efl.Libs.Eina)] internal static extern void eina_promise_reject(IntPtr scheduler, Eina.Error reason); + [DllImport(efl.Libs.CustomExports)] + internal static extern void efl_mono_thread_safe_promise_reject(IntPtr scheduler, Eina.Error reason); + [DllImport(efl.Libs.Eina)] internal static extern IntPtr eina_future_new(IntPtr promise); @@ -80,7 +85,7 @@ public class Promise : IDisposable /// 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). /// - public Promise(CancelCb cancelCb=null) + public Promise(CancelCb cancelCb = null) { Efl.Loop loop = Efl.App.AppMain; @@ -90,10 +95,13 @@ public class Promise : IDisposable IntPtr cb_data = IntPtr.Zero; // A safety clean callback to mark this wrapper as invalid - CancelCb safetyCb = () => { + CancelCb safetyCb = () => + { Handle = IntPtr.Zero; if (cancelCb != null) + { cancelCb(); + } }; CleanupHandle = GCHandle.Alloc(safetyCb); @@ -105,14 +113,21 @@ public class Promise : IDisposable 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(); } @@ -129,11 +144,21 @@ public class Promise : IDisposable Dispose(false); } + /// Disposes of this wrapper, rejecting the native promise with + /// True if this was called from public method. False if + /// called from the C# finalizer. protected virtual void Dispose(bool disposing) { if (Handle != IntPtr.Zero) { - eina_promise_reject(Handle, Eina.Error.ECANCELED); + if (disposing) + { + eina_promise_reject(Handle, Eina.Error.ECANCELED); + } + else + { + efl_mono_thread_safe_promise_reject(Handle, Eina.Error.ECANCELED); + } Handle = IntPtr.Zero; } } @@ -141,7 +166,9 @@ public class Promise : IDisposable private void SanityChecks() { if (this.Handle == IntPtr.Zero) + { throw new ObjectDisposedException(GetType().Name); + } } /// @@ -190,14 +217,15 @@ public class Future /// public delegate Eina.Value ResolvedCb(Eina.Value value); - public IntPtr Handle { get; internal set; } + internal IntPtr Handle; /// /// Creates a Future from a native pointer. /// public Future(IntPtr handle) { - Handle = ThenRaw(handle, (Eina.Value value) => { + Handle = ThenRaw(handle, (Eina.Value value) => + { Handle = IntPtr.Zero; return value; }); @@ -209,12 +237,16 @@ public class Future /// Optionally a resolved callback may be provided. If so, it will be chained /// before the returned future. /// - public Future(Promise promise, ResolvedCb cb=null) + public Future(Promise promise, ResolvedCb cb = null) { IntPtr intermediate = eina_future_new(promise.Handle); - Handle = ThenRaw(intermediate, (Eina.Value value) => { + Handle = ThenRaw(intermediate, (Eina.Value value) => + { if (cb != null) + { value = cb(value); + } + Handle = IntPtr.Zero; return value; }); @@ -223,7 +255,9 @@ public class Future private void SanityChecks() { if (this.Handle == IntPtr.Zero) + { throw new ObjectDisposedException(GetType().Name); + } } /// @@ -263,14 +297,20 @@ public class Future desc.data = GCHandle.ToIntPtr(handle); return eina_future_then_from_desc(previous, desc); } + private static Eina.ValueNative NativeResolvedCb(IntPtr data, Eina.ValueNative 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; } @@ -305,48 +345,79 @@ public class Future 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)); } } +/// Custom marshaler to convert between managed and native . +/// Internal usage in generated code. public class FutureMarshaler : ICustomMarshaler { + ///Wrap the native future with a managed wrapper. + ///Handle to the native future. + ///An wrapping the native future. public object MarshalNativeToManaged(IntPtr pNativeData) { return new Future(pNativeData); } + ///Extracts the native future from a managed wrapper. + ///The managed wrapper. If it is not an , the value returned + ///is . + ///A pointing to the native future. public IntPtr MarshalManagedToNative(object managedObj) { Future f = managedObj as Future; if (f == null) + { return IntPtr.Zero; + } + return f.Handle; } - public void CleanUpNativeData(IntPtr pNativeData) { } + ///Not implemented. The code receiving the native data is in charge of releasing it. + ///The native pointer to be released. + public void CleanUpNativeData(IntPtr pNativeData) + { + } - public void CleanUpManagedData(object managedObj) { } + ///Not implemented. The runtime takes care of releasing it. + ///The managed object to be cleaned. + public void CleanUpManagedData(object managedObj) + { + } + ///Size of the native data size returned + ///The size of the data. public int GetNativeDataSize() { return -1; } - public static ICustomMarshaler GetInstance(string cookie) { + ///Gets an instance of this marshaller. + ///A name that could be used to customize the returned marshaller. Currently not used. + ///The instance that will marshall the data. + public static ICustomMarshaler GetInstance(string cookie) + { if (marshaler == null) { marshaler = new FutureMarshaler(); } + return marshaler; } diff --git a/src/bindings/mono/eina_mono/eina_slice.cs b/src/bindings/mono/eina_mono/eina_slice.cs index 649ffc5d98..cb6249c019 100644 --- a/src/bindings/mono/eina_mono/eina_slice.cs +++ b/src/bindings/mono/eina_mono/eina_slice.cs @@ -3,7 +3,8 @@ using System; using System.Runtime.InteropServices; -namespace Eina { +namespace Eina +{ public interface ISliceBase { @@ -21,8 +22,8 @@ public struct Slice : ISliceBase public int Length { - get { return (int) Len; } - set { Len = (UIntPtr) value; } + get { return (int)Len; } + set { Len = (UIntPtr)value; } } public Slice(IntPtr mem, UIntPtr len) @@ -47,8 +48,8 @@ public struct RwSlice : ISliceBase public int Length { - get { return (int) Len; } - set { Len = (UIntPtr) value; } + get { return (int)Len; } + set { Len = (UIntPtr)value; } } public RwSlice(IntPtr mem, UIntPtr len) diff --git a/src/bindings/mono/eina_mono/eina_strbuf.cs b/src/bindings/mono/eina_mono/eina_strbuf.cs index 9d7a982abb..a538de0fd2 100644 --- a/src/bindings/mono/eina_mono/eina_strbuf.cs +++ b/src/bindings/mono/eina_mono/eina_strbuf.cs @@ -5,8 +5,10 @@ using static Eina.EinaNative.StrbufNativeMethods; namespace Eina { + namespace EinaNative { + static internal class StrbufNativeMethods { [DllImport(efl.Libs.Eina)] @@ -48,7 +50,7 @@ public class Strbuf : IDisposable private bool Disposed; ///Creates a new Strbuf. By default its lifetime is managed. - public Strbuf(Ownership ownership=Ownership.Managed) + public Strbuf(Ownership ownership = Ownership.Managed) { this.Handle = eina_strbuf_new(); this.Ownership = ownership; @@ -89,9 +91,20 @@ public class Strbuf : IDisposable return; } - if (!Disposed && (Handle != IntPtr.Zero)) { - eina_strbuf_free(Handle); + if (!Disposed && (Handle != IntPtr.Zero)) + { + if (disposing) + { + eina_strbuf_free(Handle); + } + else + { + Efl.Eo.Globals.ThreadSafeFreeCbExec(eina_strbuf_free, Handle); + } + + Handle = IntPtr.Zero; } + Disposed = true; } @@ -115,7 +128,10 @@ public class Strbuf : IDisposable public void Reset() { if (Disposed) + { throw new ObjectDisposedException(base.GetType().Name); + } + eina_strbuf_reset(Handle); } @@ -123,7 +139,10 @@ public class Strbuf : IDisposable public bool Append(string text) { if (Disposed) + { throw new ObjectDisposedException(base.GetType().Name); + } + return eina_strbuf_append(Handle, text); } @@ -131,7 +150,10 @@ public class Strbuf : IDisposable public bool AppendEscaped(string text) { if (Disposed) + { throw new ObjectDisposedException(base.GetType().Name); + } + return eina_strbuf_append_escaped(Handle, text); } @@ -139,7 +161,10 @@ public class Strbuf : IDisposable public bool Append(char c) { if (Disposed) + { throw new ObjectDisposedException(base.GetType().Name); + } + return eina_strbuf_append_char(Handle, c); } @@ -147,10 +172,12 @@ public class Strbuf : IDisposable 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_stringshare.cs b/src/bindings/mono/eina_mono/eina_stringshare.cs index 83ea31ee6d..3b41bfbe3f 100644 --- a/src/bindings/mono/eina_mono/eina_stringshare.cs +++ b/src/bindings/mono/eina_mono/eina_stringshare.cs @@ -4,9 +4,11 @@ using System; using System.Runtime.InteropServices; -namespace Eina { +namespace Eina +{ -public class Stringshare { +public class Stringshare +{ [DllImport(efl.Libs.Eina)] public static extern System.IntPtr eina_stringshare_add_length(string str, System.UInt32 slen); [DllImport(efl.Libs.Eina)] public static extern System.IntPtr @@ -16,4 +18,3 @@ public class Stringshare { } } - diff --git a/src/bindings/mono/eina_mono/eina_value.cs b/src/bindings/mono/eina_mono/eina_value.cs index 6fae14b022..627c7cb343 100644 --- a/src/bindings/mono/eina_mono/eina_value.cs +++ b/src/bindings/mono/eina_mono/eina_value.cs @@ -14,9 +14,11 @@ using static Eina.EinaNative.UnsafeNativeMethods; using static Eina.TraitFunctions; -namespace Eina { +namespace Eina +{ -namespace EinaNative { +namespace EinaNative +{ // Structs to be passed from/to C when dealing with containers and // optional values. @@ -36,8 +38,8 @@ struct Value_List } [SuppressUnmanagedCodeSecurityAttribute] -static internal class UnsafeNativeMethods { - +static internal class UnsafeNativeMethods +{ [DllImport(efl.Libs.Eina)] internal static extern IntPtr eina_value_new(IntPtr type); @@ -178,7 +180,47 @@ static internal class UnsafeNativeMethods { [DllImport(efl.Libs.CustomExports)] [return: MarshalAsAttribute(UnmanagedType.U1)] - internal static extern bool eina_value_array_append_wrapper(IntPtr handle, IntPtr data); + internal static extern bool eina_value_container_append_wrapper_string(IntPtr handle, string data); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_append_wrapper_char(IntPtr handle, sbyte data); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_append_wrapper_uchar(IntPtr handle, byte data); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_append_wrapper_short(IntPtr handle, short data); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_append_wrapper_ushort(IntPtr handle, ushort data); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_append_wrapper_int(IntPtr handle, int data); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_append_wrapper_uint(IntPtr handle, uint data); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_append_wrapper_long(IntPtr handle, long data); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_append_wrapper_ulong(IntPtr handle, ulong data); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_append_wrapper_float(IntPtr handle, float data); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_append_wrapper_double(IntPtr handle, double data); [DllImport(efl.Libs.CustomExports)] [return: MarshalAsAttribute(UnmanagedType.U1)] @@ -186,7 +228,47 @@ static internal class UnsafeNativeMethods { [DllImport(efl.Libs.CustomExports)] [return: MarshalAsAttribute(UnmanagedType.U1)] - internal static extern bool eina_value_array_get_wrapper(IntPtr handle, int index, out IntPtr output); + internal static extern bool eina_value_container_get_wrapper(IntPtr handle, int index, out IntPtr output); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_get_wrapper(IntPtr handle, int index, out sbyte output); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_get_wrapper(IntPtr handle, int index, out byte output); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_get_wrapper(IntPtr handle, int index, out short output); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_get_wrapper(IntPtr handle, int index, out ushort output); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_get_wrapper(IntPtr handle, int index, out int output); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_get_wrapper(IntPtr handle, int index, out uint output); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_get_wrapper(IntPtr handle, int index, out long output); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_get_wrapper(IntPtr handle, int index, out ulong output); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_get_wrapper(IntPtr handle, int index, out float output); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_get_wrapper(IntPtr handle, int index, out double output); [DllImport(efl.Libs.CustomExports)] [return: MarshalAsAttribute(UnmanagedType.U1)] @@ -194,11 +276,47 @@ static internal class UnsafeNativeMethods { [DllImport(efl.Libs.CustomExports)] [return: MarshalAsAttribute(UnmanagedType.U1)] - internal static extern bool eina_value_array_set_wrapper(IntPtr handle, int index, IntPtr value); + internal static extern bool eina_value_container_set_wrapper_string(IntPtr handle, int index, string value); [DllImport(efl.Libs.CustomExports)] [return: MarshalAsAttribute(UnmanagedType.U1)] - internal static extern bool eina_value_list_set_wrapper(IntPtr handle, int index, IntPtr value); + internal static extern bool eina_value_container_set_wrapper_uchar(IntPtr handle, int index, byte value); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_set_wrapper_char(IntPtr handle, int index, sbyte value); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_set_wrapper_short(IntPtr handle, int index, short value); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_set_wrapper_ushort(IntPtr handle, int index, ushort value); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_set_wrapper_int(IntPtr handle, int index, int value); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_set_wrapper_uint(IntPtr handle, int index, uint value); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_set_wrapper_long(IntPtr handle, int index, long value); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_set_wrapper_ulong(IntPtr handle, int index, ulong value); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_set_wrapper_float(IntPtr handle, int index, float value); + + [DllImport(efl.Libs.CustomExports)] + [return: MarshalAsAttribute(UnmanagedType.U1)] + internal static extern bool eina_value_container_set_wrapper_double(IntPtr handle, int index, double value); [DllImport(efl.Libs.CustomExports)] internal static extern IntPtr eina_value_array_subtype_get_wrapper(IntPtr handle); @@ -397,7 +515,7 @@ static internal class UnsafeNativeMethods { public struct ValueNative { public IntPtr Type; - public IntPtr Value; // Atually an Eina_Value_Union, but it is padded to 8 bytes. + public IntPtr Value; // Actually an Eina_Value_Union, but it is padded to 8 bytes. public override string ToString() { @@ -410,13 +528,24 @@ public struct ValueNative public class SetItemFailedException : Exception { /// Default constructor. - public SetItemFailedException() : base () { } + public SetItemFailedException() : base() + { + } + /// Most commonly used contructor. - public SetItemFailedException(string msg) : base(msg) { } + public SetItemFailedException(string msg) : base(msg) + { + } + /// Wraps an inner exception. - public SetItemFailedException(string msg, Exception inner) : base(msg, inner) { } + public SetItemFailedException(string msg, Exception inner) : base(msg, inner) + { + } + /// Serializable constructor. - protected SetItemFailedException(SerializationInfo info, StreamingContext context) : base(info, context) { } + protected SetItemFailedException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } } /// Exception for methods that must have been called on a container. @@ -424,18 +553,30 @@ public class SetItemFailedException : Exception public class InvalidValueTypeException: Exception { /// Default constructor. - public InvalidValueTypeException() : base () { } + public InvalidValueTypeException() : base() + { + } + /// Most commonly used contructor. - public InvalidValueTypeException(string msg) : base(msg) { } + public InvalidValueTypeException(string msg) : base(msg) + { + } + /// Wraps an inner exception. - public InvalidValueTypeException(string msg, Exception inner) : base(msg, inner) { } + public InvalidValueTypeException(string msg, Exception inner) : base(msg, inner) + { + } + /// Serializable constructor. - protected InvalidValueTypeException(SerializationInfo info, StreamingContext context) : base(info, context) { } + protected InvalidValueTypeException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } } /// Managed-side Enum to represent Eina_Value_Type constants -public enum ValueType { +public enum ValueType +{ /// Signed 8 bit integer. Same as 'sbyte' SByte, /// Unsigned 8 bit integer. Same as 'byte' @@ -476,10 +617,12 @@ public enum ValueType { Empty, } -static class ValueTypeMethods { +static class ValueTypeMethods +{ public static bool IsNumeric(this ValueType val) { - switch (val) { + switch (val) + { case ValueType.SByte: case ValueType.Byte: case ValueType.Short: @@ -500,7 +643,8 @@ static class ValueTypeMethods { public static bool IsString(this ValueType val) { - switch(val) { + switch (val) + { case ValueType.String: return true; default: @@ -510,7 +654,8 @@ static class ValueTypeMethods { public static bool IsContainer(this ValueType val) { - switch(val) { + switch (val) + { case ValueType.Array: case ValueType.List: case ValueType.Hash: @@ -533,7 +678,8 @@ static class ValueTypeMethods { /// Returns the Marshal.SizeOf for the given ValueType native structure. public static int MarshalSizeOf(this ValueType val) { - switch (val) { + switch (val) + { case ValueType.Array: return Marshal.SizeOf(typeof(EinaNative.Value_Array)); case ValueType.List: @@ -543,6 +689,7 @@ static class ValueTypeMethods { } } } + static class ValueTypeBridge { private static Dictionary ManagedToNative = new Dictionary(); @@ -552,7 +699,9 @@ static class ValueTypeBridge public static ValueType GetManaged(IntPtr native) { if (!TypesLoaded) + { LoadTypes(); + } return NativeToManaged[native]; } @@ -560,7 +709,9 @@ static class ValueTypeBridge public static IntPtr GetNative(ValueType valueType) { if (!TypesLoaded) + { LoadTypes(); + } return ManagedToNative[valueType]; } @@ -627,14 +778,14 @@ static class ValueTypeBridge } } -/// Wrapper around Eina_Value generic storage. +/// Wrapper around Eina.Value generic storage. /// -/// Eina_Value is EFL's main workhorse to deal with storing generic data in -/// an uniform way. +/// Eina.Value is EFL's main workhorse to deal with storing generic data in +/// a uniform way. /// -/// It comes with predefined types for numbers, strings, array, list, hash, -/// blob and structs. It is able to convert between data types, including -/// to string. +/// It comes with predefined types for numbers, strings, arrays, lists, hashes, +/// blobs and structs. It is able to convert between data types, including +/// to and from strings. /// public class Value : IDisposable, IComparable, IEquatable { @@ -663,14 +814,20 @@ public class Value : IDisposable, IComparable, IEquatable internal IntPtr Handle { get; set;} + /// Whether this wrapper owns (can free) the native value. public Ownership Ownership { get; protected set;} + private bool Disposed; + /// Whether this is an Optional value (meaning it can have a value or not). - public bool Optional { - get { + public bool Optional + { + get + { return GetValueType() == Eina.ValueType.Optional; } + /* protected set { // Should we expose this? // Something like { @@ -679,23 +836,32 @@ public class Value : IDisposable, IComparable, IEquatable // } } */ } + /// Whether this wrapper is actually empty/uninitialized (zeroed). This is different from an empty optional value. - public bool Empty { - get { + public bool Empty + { + get + { SanityChecks(); return GetValueType() == Eina.ValueType.Empty; } } /// Whether this optional value is empty. - public bool OptionalEmpty { - get { + public bool OptionalEmpty + { + get + { OptionalSanityChecks(); bool empty; if (!eina_value_optional_empty_is_wrapper(this.Handle, out empty)) + { throw new System.InvalidOperationException("Couldn't get the empty information"); + } else + { return empty; + } } } @@ -710,12 +876,14 @@ public class Value : IDisposable, IComparable, IEquatable } // Constructor to be used by the "FromContainerDesc" methods. - private Value() { + private Value() + { this.Handle = Alloc(); this.Ownership = Ownership.Managed; } - public Value(IntPtr handle, Ownership ownership=Ownership.Managed) { + public Value(IntPtr handle, Ownership ownership = Ownership.Managed) + { this.Handle = handle; this.Ownership = ownership; } @@ -724,11 +892,15 @@ public class Value : IDisposable, IComparable, IEquatable public Value(ValueType type) { if (type.IsContainer()) + { throw new ArgumentException("To use container types you must provide a subtype"); + } this.Handle = Alloc(); 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()); @@ -738,10 +910,12 @@ public class Value : IDisposable, IComparable, IEquatable } /// Constructor for container values, like Array, Hash. - public Value(ValueType containerType, ValueType subtype, uint step=0) + public Value(ValueType containerType, ValueType subtype, uint step = 0) { if (!containerType.IsContainer()) + { throw new ArgumentException("First type must be a container type."); + } this.Handle = Alloc(); this.Ownership = Ownership.Managed; @@ -754,7 +928,9 @@ public class Value : IDisposable, IComparable, IEquatable { Handle = Alloc(); if (!eina_value_copy(v.Handle, this.Handle)) + { throw new System.InvalidOperationException("Failed to copy value to managed memory."); + } Disposed = false; Ownership = Ownership.Managed; @@ -764,10 +940,13 @@ public class Value : IDisposable, IComparable, IEquatable public Value(ValueNative value) { IntPtr tmp = IntPtr.Zero; - try { + try + { this.Handle = Alloc(); if (value.Type == IntPtr.Zero) // Got an EINA_VALUE_EMPTY by value. + { MemoryNative.Memset(this.Handle, 0, Marshal.SizeOf(typeof(ValueNative))); + } else { // We allocate this intermediate ValueNative using malloc to allow freeing with @@ -779,14 +958,22 @@ public class Value : IDisposable, IComparable, IEquatable // 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 { + } + catch + { Free(this.Handle); throw; - } finally { + } + finally + { if (tmp != IntPtr.Zero) + { MemoryNative.Free(tmp); + } } this.Ownership = Ownership.Managed; @@ -796,77 +983,99 @@ public class Value : IDisposable, IComparable, IEquatable public Value(byte x) : this(ValueType.Byte) { if (!Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } } /// Type-specific constructor, for convenience. public Value(sbyte x) : this(ValueType.SByte) { if (!Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } } /// Type-specific constructor, for convenience. public Value(short x) : this(ValueType.Short) { if (!Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } } /// Type-specific constructor, for convenience. public Value(ushort x) : this(ValueType.UShort) { if (!Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } } /// Type-specific constructor, for convenience. public Value(int x) : this(ValueType.Int32) { if (!Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } } /// Type-specific constructor, for convenience. public Value(uint x) : this(ValueType.UInt32) { if (!Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } } /// Type-specific constructor, for convenience. public Value(long x) : this(ValueType.Long) { if (!Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } } /// Type-specific constructor, for convenience. public Value(ulong x) : this(ValueType.ULong) { if (!Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } } /// Type-specific constructor, for convenience. public Value(float x) : this(ValueType.Float) { if (!Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } } /// Type-specific constructor, for convenience. public Value(double x) : this(ValueType.Double) { if (!Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } } /// Type-specific constructor, for convenience. public Value(string x) : this(ValueType.String) { if (!Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } } /// Implicit conversion from managed value to native struct representation. @@ -886,7 +1095,10 @@ public class Value : IDisposable, IComparable, IEquatable { var v = new Eina.Value(ValueType.Byte); if (!v.Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } + return v; } @@ -895,7 +1107,10 @@ public class Value : IDisposable, IComparable, IEquatable { byte b; if (!v.Get(out b)) + { throw new InvalidOperationException("Couldn't get value."); + } + return b; } @@ -904,7 +1119,10 @@ public class Value : IDisposable, IComparable, IEquatable { var v = new Eina.Value(ValueType.SByte); if (!v.Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } + return v; } @@ -913,7 +1131,10 @@ public class Value : IDisposable, IComparable, IEquatable { sbyte b; if (!v.Get(out b)) + { throw new InvalidOperationException("Couldn't get value."); + } + return b; } @@ -922,7 +1143,10 @@ public class Value : IDisposable, IComparable, IEquatable { var v = new Eina.Value(ValueType.Short); if (!v.Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } + return v; } @@ -931,7 +1155,10 @@ public class Value : IDisposable, IComparable, IEquatable { short b; if (!v.Get(out b)) + { throw new InvalidOperationException("Couldn't get value."); + } + return b; } @@ -940,7 +1167,10 @@ public class Value : IDisposable, IComparable, IEquatable { var v = new Eina.Value(ValueType.UShort); if (!v.Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } + return v; } @@ -949,7 +1179,10 @@ public class Value : IDisposable, IComparable, IEquatable { ushort b; if (!v.Get(out b)) + { throw new InvalidOperationException("Couldn't get value."); + } + return b; } @@ -958,7 +1191,10 @@ public class Value : IDisposable, IComparable, IEquatable { var v = new Eina.Value(ValueType.Int32); if (!v.Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } + return v; } @@ -967,7 +1203,10 @@ public class Value : IDisposable, IComparable, IEquatable { int b; if (!v.Get(out b)) + { throw new InvalidOperationException("Couldn't get value."); + } + return b; } @@ -976,7 +1215,10 @@ public class Value : IDisposable, IComparable, IEquatable { var v = new Eina.Value(ValueType.UInt32); if (!v.Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } + return v; } @@ -985,7 +1227,10 @@ public class Value : IDisposable, IComparable, IEquatable { uint b; if (!v.Get(out b)) + { throw new InvalidOperationException("Couldn't get value."); + } + return b; } @@ -994,7 +1239,10 @@ public class Value : IDisposable, IComparable, IEquatable { var v = new Eina.Value(ValueType.Long); if (!v.Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } + return v; } @@ -1003,7 +1251,10 @@ public class Value : IDisposable, IComparable, IEquatable { long b; if (!v.Get(out b)) + { throw new InvalidOperationException("Couldn't get value."); + } + return b; } @@ -1012,7 +1263,10 @@ public class Value : IDisposable, IComparable, IEquatable { var v = new Eina.Value(ValueType.ULong); if (!v.Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } + return v; } @@ -1021,7 +1275,10 @@ public class Value : IDisposable, IComparable, IEquatable { ulong b; if (!v.Get(out b)) + { throw new InvalidOperationException("Couldn't get value."); + } + return b; } @@ -1030,7 +1287,10 @@ public class Value : IDisposable, IComparable, IEquatable { var v = new Eina.Value(ValueType.Float); if (!v.Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } + return v; } @@ -1039,7 +1299,10 @@ public class Value : IDisposable, IComparable, IEquatable { float b; if (!v.Get(out b)) + { throw new InvalidOperationException("Couldn't get value."); + } + return b; } @@ -1048,7 +1311,10 @@ public class Value : IDisposable, IComparable, IEquatable { var v = new Eina.Value(ValueType.Double); if (!v.Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } + return v; } @@ -1057,7 +1323,10 @@ public class Value : IDisposable, IComparable, IEquatable { double b; if (!v.Get(out b)) + { throw new InvalidOperationException("Couldn't get value."); + } + return b; } @@ -1066,7 +1335,10 @@ public class Value : IDisposable, IComparable, IEquatable { var v = new Eina.Value(ValueType.String); if (!v.Set(x)) + { throw new InvalidOperationException("Couldn't set value."); + } + return v; } @@ -1075,7 +1347,10 @@ public class Value : IDisposable, IComparable, IEquatable { string b; if (!v.Get(out b)) + { throw new InvalidOperationException("Couldn't get value."); + } + return b; } @@ -1121,15 +1396,25 @@ public class Value : IDisposable, IComparable, IEquatable /// Actually free the wrapped eina value. Can be called from Dispose() or through the GC. protected virtual void Dispose(bool disposing) { - if (this.Ownership == Ownership.Unmanaged) { + if (this.Ownership == Ownership.Unmanaged) + { Disposed = true; return; } - if (!Disposed && (Handle != IntPtr.Zero)) { + if (!Disposed && (Handle != IntPtr.Zero)) + { // No need to call flush as eina_value_free already calls it for us. - Free(this.Handle); + if (disposing) + { + Free(this.Handle); + } + else + { + Efl.Eo.Globals.ThreadSafeFreeCbExec(eina_value_free, this.Handle); + } } + Disposed = true; } @@ -1140,10 +1425,15 @@ public class Value : IDisposable, IComparable, IEquatable } /// Returns the native handle wrapped by this object. - public IntPtr NativeHandle { - get { + public IntPtr NativeHandle + { + get + { if (Disposed) + { throw new ObjectDisposedException(base.GetType().Name); + } + return this.Handle; } } @@ -1152,14 +1442,18 @@ public class Value : IDisposable, IComparable, IEquatable public bool Setup(ValueType type) { 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()); @@ -1167,15 +1461,19 @@ public class Value : IDisposable, IComparable, IEquatable } if (type.IsContainer()) + { throw new ArgumentException("To setup a container you must provide a subtype."); + } return eina_value_setup_wrapper(this.Handle, ValueTypeBridge.GetNative(type)); } - public bool Setup(ValueType containerType, ValueType subtype, uint step=0) { + public bool Setup(ValueType containerType, ValueType subtype, uint step = 0) + { IntPtr native_subtype = ValueTypeBridge.GetNative(subtype); bool ret = false; - switch (containerType) { + switch (containerType) + { case ValueType.Array: ret = eina_value_array_setup_wrapper(this.Handle, native_subtype, step); break; @@ -1190,22 +1488,29 @@ public class Value : IDisposable, IComparable, IEquatable private void SanityChecks() { if (Disposed) + { throw new ObjectDisposedException(GetType().Name); + } } - private void ContainerSanityChecks(int targetIndex=-1) + private void ContainerSanityChecks(int targetIndex = -1) { SanityChecks(); uint size = 0; ValueType type = GetValueType(); if (!type.IsContainer()) + { throw new InvalidValueTypeException("Value type must be a container"); + } if (targetIndex == -1) // Some methods (e.g. append) don't care about size + { return; + } - switch (type) { + switch (type) + { case ValueType.Array: size = eina_value_array_count_wrapper(this.Handle); break; @@ -1215,8 +1520,10 @@ public class Value : IDisposable, IComparable, IEquatable } if (targetIndex >= size) + { throw new System.ArgumentOutOfRangeException( $"Index {targetIndex} is larger than max array index {size-1}"); + } } private void OptionalSanityChecks() @@ -1225,7 +1532,9 @@ public class Value : IDisposable, IComparable, IEquatable ValueType type = GetValueType(); if (!type.IsOptional()) + { throw new InvalidValueTypeException("Value is not an Optional one"); + } } /// Get a ValueNative struct with the *value* pointed by this Eina.Value. @@ -1240,13 +1549,18 @@ public class Value : IDisposable, IComparable, IEquatable SanityChecks(); if (this.Optional) + { return eina_value_optional_pset(this.Handle, ValueTypeBridge.GetNative(ValueType.Byte), ref value); + } if (!GetValueType().IsNumeric()) + { throw (new ArgumentException( "Trying to set numeric value on a non-numeric Eina.Value")); + } + return eina_value_set_wrapper_uchar(this.Handle, value); } @@ -1255,13 +1569,18 @@ public class Value : IDisposable, IComparable, IEquatable SanityChecks(); if (this.Optional) + { return eina_value_optional_pset(this.Handle, ValueTypeBridge.GetNative(ValueType.SByte), ref value); + } if (!GetValueType().IsNumeric()) + { throw (new ArgumentException( "Trying to set numeric value on a non-numeric Eina.Value")); + } + return eina_value_set_wrapper_char(this.Handle, value); } @@ -1270,13 +1589,18 @@ public class Value : IDisposable, IComparable, IEquatable SanityChecks(); if (this.Optional) + { return eina_value_optional_pset(this.Handle, ValueTypeBridge.GetNative(ValueType.Short), ref value); + } if (!GetValueType().IsNumeric()) + { throw (new ArgumentException( "Trying to set numeric value on a non-numeric Eina.Value")); + } + return eina_value_set_wrapper_short(this.Handle, value); } @@ -1285,13 +1609,18 @@ public class Value : IDisposable, IComparable, IEquatable SanityChecks(); if (this.Optional) + { return eina_value_optional_pset(this.Handle, ValueTypeBridge.GetNative(ValueType.UShort), ref value); + } if (!GetValueType().IsNumeric()) + { throw (new ArgumentException( "Trying to set numeric value on a non-numeric Eina.Value")); + } + return eina_value_set_wrapper_ushort(this.Handle, value); } @@ -1301,13 +1630,18 @@ public class Value : IDisposable, IComparable, IEquatable SanityChecks(); if (this.Optional) + { return eina_value_optional_pset(this.Handle, ValueTypeBridge.GetNative(ValueType.UInt32), ref value); + } if (!GetValueType().IsNumeric()) + { throw (new ArgumentException( "Trying to set numeric value on a non-numeric Eina.Value")); + } + return eina_value_set_wrapper_uint(this.Handle, value); } @@ -1317,13 +1651,18 @@ public class Value : IDisposable, IComparable, IEquatable SanityChecks(); if (this.Optional) + { return eina_value_optional_pset(this.Handle, ValueTypeBridge.GetNative(ValueType.Int32), ref value); + } if (!GetValueType().IsNumeric()) + { throw (new ArgumentException( "Trying to set numeric value on a non-numeric Eina.Value")); + } + return eina_value_set_wrapper_int(this.Handle, value); } @@ -1333,13 +1672,18 @@ public class Value : IDisposable, IComparable, IEquatable SanityChecks(); if (this.Optional) + { return eina_value_optional_pset(this.Handle, ValueTypeBridge.GetNative(ValueType.ULong), ref value); + } if (!GetValueType().IsNumeric()) + { throw (new ArgumentException( "Trying to set numeric value on a non-numeric Eina.Value")); + } + return eina_value_set_wrapper_ulong(this.Handle, value); } @@ -1349,13 +1693,18 @@ public class Value : IDisposable, IComparable, IEquatable SanityChecks(); if (this.Optional) + { return eina_value_optional_pset(this.Handle, ValueTypeBridge.GetNative(ValueType.Long), ref value); + } if (!GetValueType().IsNumeric()) + { throw (new ArgumentException( "Trying to set numeric value on a non-numeric Eina.Value")); + } + return eina_value_set_wrapper_long(this.Handle, value); } @@ -1365,13 +1714,17 @@ public class Value : IDisposable, IComparable, IEquatable SanityChecks(); if (this.Optional) + { return eina_value_optional_pset(this.Handle, ValueTypeBridge.GetNative(ValueType.Float), ref value); + } if (!GetValueType().IsNumeric()) + { throw (new ArgumentException( "Trying to set numeric value on a non-numeric Eina.Value")); + } return eina_value_set_wrapper_float(this.Handle, value); } @@ -1382,13 +1735,18 @@ public class Value : IDisposable, IComparable, IEquatable SanityChecks(); if (this.Optional) + { return eina_value_optional_pset(this.Handle, ValueTypeBridge.GetNative(ValueType.Double), ref value); + } if (!GetValueType().IsNumeric()) + { throw (new ArgumentException( "Trying to set numeric value on a non-numeric Eina.Value")); + } + return eina_value_set_wrapper_double(this.Handle, value); } @@ -1398,13 +1756,18 @@ public class Value : IDisposable, IComparable, IEquatable SanityChecks(); if (this.Optional) + { return eina_value_optional_pset(this.Handle, ValueTypeBridge.GetNative(ValueType.String), ref value); + } if (!GetValueType().IsString()) + { throw (new ArgumentException( "Trying to set non-string value on a string Eina.Value")); + } + // No need to worry about ownership as eina_value_set will copy the passed string. return eina_value_set_wrapper_string(this.Handle, value); } @@ -1417,9 +1780,11 @@ public class Value : IDisposable, IComparable, IEquatable 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); } @@ -1433,20 +1798,28 @@ public class Value : IDisposable, IComparable, IEquatable IntPtr ptr_val = MemoryNative.Alloc(subtype.MarshalSizeOf()); IntPtr native_type = ValueTypeBridge.GetNative(subtype); - try { - switch (subtype) { + try + { + switch (subtype) + { // PSet on Container types require an Eina_Value_, which is the structure // that contains subtype, etc. case ValueType.Array: EinaNative.Value_Array value_array; if (!eina_value_get_wrapper(value.Handle, out value_array)) + { return false; + } + Marshal.StructureToPtr(value_array, ptr_val, false); break; case ValueType.List: EinaNative.Value_List value_list; if (!eina_value_get_wrapper(value.Handle, out value_list)) + { return false; + } + Marshal.StructureToPtr(value_list, ptr_val, false); break; default: @@ -1454,7 +1827,9 @@ public class Value : IDisposable, IComparable, IEquatable } return eina_value_optional_pset(this.Handle, native_type, ptr_val); - } finally { + } + finally + { MemoryNative.Free(ptr_val); } } @@ -1464,9 +1839,13 @@ public class Value : IDisposable, IComparable, IEquatable { SanityChecks(); if (this.Optional) + { return eina_value_optional_pget(this.Handle, out value); + } else + { return eina_value_get_wrapper(this.Handle, out value); + } } /// Gets the currently stored value as a sbyte. @@ -1474,9 +1853,13 @@ public class Value : IDisposable, IComparable, IEquatable { SanityChecks(); if (this.Optional) + { return eina_value_optional_pget(this.Handle, out value); + } else + { return eina_value_get_wrapper(this.Handle, out value); + } } /// Gets the currently stored value as a short. @@ -1484,9 +1867,13 @@ public class Value : IDisposable, IComparable, IEquatable { SanityChecks(); if (this.Optional) + { return eina_value_optional_pget(this.Handle, out value); + } else + { return eina_value_get_wrapper(this.Handle, out value); + } } /// Gets the currently stored value as an ushort. @@ -1494,9 +1881,13 @@ public class Value : IDisposable, IComparable, IEquatable { SanityChecks(); if (this.Optional) + { return eina_value_optional_pget(this.Handle, out value); + } else + { return eina_value_get_wrapper(this.Handle, out value); + } } /// Gets the currently stored value as an int. @@ -1504,9 +1895,13 @@ public class Value : IDisposable, IComparable, IEquatable { SanityChecks(); if (this.Optional) + { return eina_value_optional_pget(this.Handle, out value); + } else + { return eina_value_get_wrapper(this.Handle, out value); + } } /// Gets the currently stored value as an uint. @@ -1514,9 +1909,13 @@ public class Value : IDisposable, IComparable, IEquatable { SanityChecks(); if (this.Optional) + { return eina_value_optional_pget(this.Handle, out value); + } else + { return eina_value_get_wrapper(this.Handle, out value); + } } /// Gets the currently stored value as a long. @@ -1524,9 +1923,13 @@ public class Value : IDisposable, IComparable, IEquatable { SanityChecks(); if (this.Optional) + { return eina_value_optional_pget(this.Handle, out value); + } else + { return eina_value_get_wrapper(this.Handle, out value); + } } /// Gets the currently stored value as an ulong. @@ -1534,9 +1937,13 @@ public class Value : IDisposable, IComparable, IEquatable { SanityChecks(); if (this.Optional) + { return eina_value_optional_pget(this.Handle, out value); + } else + { return eina_value_get_wrapper(this.Handle, out value); + } } /// Gets the currently stored value as a float. @@ -1544,9 +1951,13 @@ public class Value : IDisposable, IComparable, IEquatable { SanityChecks(); if (this.Optional) + { return eina_value_optional_pget(this.Handle, out value); + } else + { return eina_value_get_wrapper(this.Handle, out value); + } } /// Gets the currently stored value as a double. @@ -1554,9 +1965,13 @@ public class Value : IDisposable, IComparable, IEquatable { SanityChecks(); if (this.Optional) + { return eina_value_optional_pget(this.Handle, out value); + } else + { return eina_value_get_wrapper(this.Handle, out value); + } } /// Gets the currently stored value as a string. @@ -1564,15 +1979,20 @@ public class Value : IDisposable, IComparable, IEquatable { SanityChecks(); IntPtr output = IntPtr.Zero; - if (this.Optional) { - if (!eina_value_optional_pget(this.Handle, out output)) { + if (this.Optional) + { + if (!eina_value_optional_pget(this.Handle, out output)) + { value = String.Empty; return false; } - } else if (!eina_value_get_wrapper(this.Handle, out output)) { + } + else if (!eina_value_get_wrapper(this.Handle, out output)) + { value = String.Empty; return false; } + value = StringConversion.NativeUtf8ToManagedString(output); return true; } @@ -1584,9 +2004,13 @@ public class Value : IDisposable, IComparable, IEquatable 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; @@ -1600,24 +2024,33 @@ public class Value : IDisposable, IComparable, IEquatable value = null; if (!this.Optional) + { throw new InvalidValueTypeException("Values can only be retreived"); + } IntPtr nativeType = eina_value_optional_type_get_wrapper(this.Handle); ValueType managedType = ValueTypeBridge.GetManaged(nativeType); - switch (managedType) { + switch (managedType) + { case ValueType.Array: Eina.EinaNative.Value_Array array_desc; if (!eina_value_optional_pget(this.Handle, out array_desc)) + { return false; + } + value = Value.FromArrayDesc(array_desc); break; case ValueType.List: Eina.EinaNative.Value_List list_desc; if (!eina_value_optional_pget(this.Handle, out list_desc)) + { return false; + } + value = Value.FromListDesc(list_desc); break; } @@ -1629,7 +2062,10 @@ public class Value : IDisposable, IComparable, IEquatable public ValueType GetValueType() { if (Disposed) + { throw new ObjectDisposedException(base.GetType().Name); + } + IntPtr native_type = eina_value_type_get_wrapper(this.Handle); return ValueTypeBridge.GetManaged(native_type); } @@ -1639,7 +2075,9 @@ public class Value : IDisposable, IComparable, IEquatable public bool ConvertTo(Value target) { if (target == null) + { return false; + } SanityChecks(); @@ -1650,7 +2088,10 @@ public class Value : IDisposable, IComparable, IEquatable public int CompareTo(Value other) { if (other == null) + { return 1; + } + SanityChecks(); other.SanityChecks(); return eina_value_compare_wrapper(this.Handle, other.Handle); @@ -1664,20 +2105,27 @@ public class Value : IDisposable, IComparable, IEquatable public override bool Equals(object obj) { if (obj == null) + { return false; + } Value v = obj as Value; if (v == null) + { return false; + } return this.Equals(v); } public bool Equals(Value other) { - try { + try + { return this.CompareTo(other) == 0; - } catch (ObjectDisposedException) { + } + catch (ObjectDisposedException) + { return false; } } @@ -1690,7 +2138,9 @@ public class Value : IDisposable, IComparable, IEquatable public static bool operator==(Value x, Value y) { if (object.ReferenceEquals(x, null)) + { return object.ReferenceEquals(y, null); + } return x.Equals(y); } @@ -1698,21 +2148,30 @@ public class Value : IDisposable, IComparable, IEquatable public static bool operator!=(Value x, Value y) { if (object.ReferenceEquals(x, null)) + { return !object.ReferenceEquals(y, null); + } + return !x.Equals(y); } public static bool operator>(Value x, Value y) { if (object.ReferenceEquals(x, null) || object.ReferenceEquals(y, null)) + { return false; + } + return x.CompareTo(y) > 0; } public static bool operator<(Value x, Value y) { if (object.ReferenceEquals(x, null) || object.ReferenceEquals(y, null)) + { return false; + } + return x.CompareTo(y) < 0; } @@ -1735,77 +2194,275 @@ public class Value : IDisposable, IComparable, IEquatable } // Container methods methods - public int Count() { + public int Count() + { ContainerSanityChecks(); - switch(GetValueType()) { + switch (GetValueType()) + { case ValueType.Array: return (int)eina_value_array_count_wrapper(this.Handle); case ValueType.List: return (int)eina_value_list_count_wrapper(this.Handle); } + return -1; } - public bool Append(object o) { + + public bool Append(object o) + { ContainerSanityChecks(); - using (DisposableIntPtr marshalled_value = MarshalValue(o)) { - switch (GetValueType()) { - case ValueType.Array: - return eina_value_array_append_wrapper(this.Handle, marshalled_value.Handle); - case ValueType.List: - return eina_value_list_append_wrapper(this.Handle, marshalled_value.Handle); - } + + switch (GetValueSubType()) + { + case ValueType.SByte: + { + sbyte b = Convert.ToSByte(o); + return eina_value_container_append_wrapper_char(this.Handle, b); + } + + case ValueType.Byte: + { + byte b = Convert.ToByte(o); + return eina_value_container_append_wrapper_uchar(this.Handle, b); + } + + case ValueType.Short: + { + short b = Convert.ToInt16(o); + return eina_value_container_append_wrapper_short(this.Handle, b); + } + + case ValueType.UShort: + { + ushort b = Convert.ToUInt16(o); + return eina_value_container_append_wrapper_ushort(this.Handle, b); + } + + case ValueType.Int32: + { + int x = Convert.ToInt32(o); + return eina_value_container_append_wrapper_int(this.Handle, x); + } + + case ValueType.UInt32: + { + uint x = Convert.ToUInt32(o); + return eina_value_container_append_wrapper_uint(this.Handle, x); + } + + case ValueType.Long: + case ValueType.Int64: + { + long x = Convert.ToInt64(o); + return eina_value_container_append_wrapper_long(this.Handle, x); + } + + case ValueType.ULong: + case ValueType.UInt64: + { + ulong x = Convert.ToUInt64(o); + return eina_value_container_append_wrapper_ulong(this.Handle, x); + } + + case ValueType.Float: + { + float x = Convert.ToSingle(o); + return eina_value_container_append_wrapper_float(this.Handle, x); + } + + case ValueType.Double: + { + double x = Convert.ToDouble(o); + return eina_value_container_append_wrapper_double(this.Handle, x); + } + + case ValueType.String: + { + string x = Convert.ToString(o); + return eina_value_container_append_wrapper_string(this.Handle, x); + } } + return false; } public object this[int i] { - get { + get + { ContainerSanityChecks(i); - IntPtr output = IntPtr.Zero; - switch (GetValueType()) { - case ValueType.Array: - if (!eina_value_array_get_wrapper(this.Handle, i, out output)) - return null; - break; - case ValueType.List: - if (!eina_value_list_get_wrapper(this.Handle, i, out output)) - return null; - break; + switch (GetValueSubType()) + { + case ValueType.SByte: + { + sbyte ret = default(sbyte); + eina_value_container_get_wrapper(this.Handle, i, out ret); + return ret; + } + + case ValueType.Byte: + { + byte ret = default(byte); + eina_value_container_get_wrapper(this.Handle, i, out ret); + return ret; + } + + case ValueType.Short: + { + short ret = default(short); + eina_value_container_get_wrapper(this.Handle, i, out ret); + return ret; + } + + case ValueType.UShort: + { + ushort ret = default(ushort); + eina_value_container_get_wrapper(this.Handle, i, out ret); + return ret; + } + + case ValueType.Int32: + { + int ret = default(int); + eina_value_container_get_wrapper(this.Handle, i, out ret); + return ret; + } + + case ValueType.UInt32: + { + uint ret = default(uint); + eina_value_container_get_wrapper(this.Handle, i, out ret); + return ret; + } + + case ValueType.Long: + case ValueType.Int64: + { + long ret = default(long); + eina_value_container_get_wrapper(this.Handle, i, out ret); + return ret; + } + + case ValueType.ULong: + case ValueType.UInt64: + { + ulong ret = default(ulong); + eina_value_container_get_wrapper(this.Handle, i, out ret); + return ret; + } + + case ValueType.Float: + { + float ret = default(float); + eina_value_container_get_wrapper(this.Handle, i, out ret); + return ret; + } + + case ValueType.Double: + { + double ret = default(double); + eina_value_container_get_wrapper(this.Handle, i, out ret); + return ret; + } + + case ValueType.String: + { + // Using intptr as using string as the arg type in the DllImport'd function would + // make mono take ownership of the string. + IntPtr ptr = IntPtr.Zero; + eina_value_container_get_wrapper(this.Handle, i, out ptr); + return Eina.StringConversion.NativeUtf8ToManagedString(ptr); + } + + default: + throw new InvalidOperationException("Subtype not supported."); } - return UnMarshalPtr(output); } - set { + set + { ContainerSanityChecks(i); - switch (GetValueType()) { - case ValueType.Array: - ArraySet(i, value); - break; - case ValueType.List: - ListSet(i, value); - break; - } - } - } + switch (GetValueSubType()) + { + case ValueType.SByte: + { + sbyte v = Convert.ToSByte(value); + eina_value_container_set_wrapper_char(this.Handle, i, v); + break; + } - private void ArraySet(int i, object value) { - using (DisposableIntPtr marshalled_value = MarshalValue(value)) - { - if (!eina_value_array_set_wrapper(this.Handle, i, - marshalled_value.Handle)) { - throw new SetItemFailedException($"Failed to set item at index {i}"); - } - } - } + case ValueType.Byte: + { + byte v = Convert.ToByte(value); + eina_value_container_set_wrapper_uchar(this.Handle, i, v); + break; + } - private void ListSet(int i, object value) { - using (DisposableIntPtr marshalled_value = MarshalValue(value)) - { - if (!eina_value_list_set_wrapper(this.Handle, i, - marshalled_value.Handle)) { - throw new SetItemFailedException($"Failed to set item at index {i}"); + case ValueType.Short: + { + short x = Convert.ToInt16(value); + eina_value_container_set_wrapper_short(this.Handle, i, x); + break; + } + + case ValueType.UShort: + { + ushort x = Convert.ToUInt16(value); + eina_value_container_set_wrapper_ushort(this.Handle, i, x); + break; + } + + case ValueType.Int32: + { + int x = Convert.ToInt32(value); + eina_value_container_set_wrapper_int(this.Handle, i, x); + break; + } + + case ValueType.UInt32: + { + uint x = Convert.ToUInt32(value); + eina_value_container_set_wrapper_uint(this.Handle, i, x); + break; + } + + case ValueType.Long: + case ValueType.Int64: + { + long x = Convert.ToInt64(value); + eina_value_container_set_wrapper_long(this.Handle, i, x); + break; + } + + case ValueType.ULong: + case ValueType.UInt64: + { + ulong x = Convert.ToUInt64(value); + eina_value_container_set_wrapper_ulong(this.Handle, i, x); + break; + } + + case ValueType.Float: + { + float x = Convert.ToSingle(value); + eina_value_container_set_wrapper_float(this.Handle, i, x); + break; + } + + case ValueType.Double: + { + double x = Convert.ToDouble(value); + eina_value_container_set_wrapper_double(this.Handle, i, x); + break; + } + + case ValueType.String: + { + string x = Convert.ToString(value); + eina_value_container_set_wrapper_string(this.Handle, i, x); + break; + } } } } @@ -1816,7 +2473,8 @@ public class Value : IDisposable, IComparable, IEquatable IntPtr native_subtype = IntPtr.Zero; - switch (GetValueType()) { + switch (GetValueType()) + { case ValueType.Array: native_subtype = eina_value_array_subtype_get_wrapper(this.Handle); break; @@ -1824,134 +2482,113 @@ public class Value : IDisposable, IComparable, IEquatable native_subtype = eina_value_list_subtype_get_wrapper(this.Handle); break; } + return ValueTypeBridge.GetManaged(native_subtype); } - - private DisposableIntPtr MarshalValue(object value) - { - IntPtr ret = IntPtr.Zero; - bool shouldFree = false; - switch(GetValueSubType()) { - case ValueType.Int32: - { - int x = Convert.ToInt32(value); - ret = new IntPtr(x); - } - break; - case ValueType.UInt32: - { - uint x = Convert.ToUInt32(value); - ret = new IntPtr((int)x); - } - break; - case ValueType.String: - { - string x = value as string; - if (x == null) - ret = IntPtr.Zero; - else { - ret = StringConversion.ManagedStringToNativeUtf8Alloc(x); - shouldFree = true; - } - } - break; - } - - return new DisposableIntPtr(ret, shouldFree); - } - - private object UnMarshalPtr(IntPtr data) - { - switch(GetValueSubType()) { - case ValueType.Int32: - return Convert.ToInt32(data.ToInt32()); - case ValueType.UInt32: - return Convert.ToUInt32(data.ToInt32()); - case ValueType.String: - return StringConversion.NativeUtf8ToManagedString(data); - default: - return null; - } - } - } /// Custom marshaler to convert value pointers to managed values and back, /// without changing ownership. -public class ValueMarshaler : ICustomMarshaler { - +public class ValueMarshaler : ICustomMarshaler +{ /// Creates a managed value from a C pointer, whitout taking ownership of it. - public object MarshalNativeToManaged(IntPtr pNativeData) { + public object MarshalNativeToManaged(IntPtr pNativeData) + { return new Value(pNativeData, Ownership.Unmanaged); } /// Retrieves the C pointer from a given managed value, /// keeping the managed ownership. - public IntPtr MarshalManagedToNative(object managedObj) { - try { + public IntPtr MarshalManagedToNative(object managedObj) + { + try + { Value v = (Value)managedObj; return v.Handle; - } catch (InvalidCastException) { + } + catch (InvalidCastException) + { return IntPtr.Zero; } } - public void CleanUpNativeData(IntPtr pNativeData) { + public void CleanUpNativeData(IntPtr pNativeData) + { } - public void CleanUpManagedData(object managedObj) { + public void CleanUpManagedData(object managedObj) + { } - public int GetNativeDataSize() { + public int GetNativeDataSize() + { return -1; } - public static ICustomMarshaler GetInstance(string cookie) { - if (marshaler == null) { + public static ICustomMarshaler GetInstance(string cookie) + { + if (marshaler == null) + { marshaler = new ValueMarshaler(); } + return marshaler; } + static private ValueMarshaler marshaler; } /// Custom marshaler to convert value pointers to managed values and back, /// also transferring the ownership to the other side. -public class ValueMarshalerOwn : ICustomMarshaler { +public class ValueMarshalerOwn : ICustomMarshaler +{ /// Creates a managed value from a C pointer, taking the ownership. - public object MarshalNativeToManaged(IntPtr pNativeData) { + public object MarshalNativeToManaged(IntPtr pNativeData) + { return new Value(pNativeData, Ownership.Managed); } /// Retrieves the C pointer from a given managed value, /// transferring the ownership to the unmanaged side, which should release it /// when not needed. - public IntPtr MarshalManagedToNative(object managedObj) { - try { + public IntPtr MarshalManagedToNative(object managedObj) + { + try + { Value v = (Value)managedObj; v.ReleaseOwnership(); return v.Handle; - } catch (InvalidCastException) { + } + catch (InvalidCastException) + { return IntPtr.Zero; } } - public void CleanUpNativeData(IntPtr pNativeData) { + public void CleanUpNativeData(IntPtr pNativeData) + { } - public void CleanUpManagedData(object managedObj) { + public void CleanUpManagedData(object managedObj) + { } - public int GetNativeDataSize() { + public int GetNativeDataSize() + { return -1; } - public static ICustomMarshaler GetInstance(string cookie) { - if (marshaler == null) { + public static ICustomMarshaler GetInstance(string cookie) + { + if (marshaler == null) + { marshaler = new ValueMarshalerOwn(); } + return marshaler; } + static private ValueMarshalerOwn marshaler; } + } diff --git a/src/bindings/mono/eldbus_mono/eldbus_common.cs b/src/bindings/mono/eldbus_mono/eldbus_common.cs index 30e3b0be8e..39c2d039d6 100644 --- a/src/bindings/mono/eldbus_mono/eldbus_common.cs +++ b/src/bindings/mono/eldbus_mono/eldbus_common.cs @@ -5,7 +5,8 @@ using System.Runtime.InteropServices; using static eldbus.EldbusMessageNativeFunctions; -namespace eldbus { +namespace eldbus +{ public static class Timeout { @@ -26,6 +27,7 @@ public struct ObjectPath { return new ObjectPath(str); } + public static implicit operator string(ObjectPath path) { return path.value; @@ -46,6 +48,7 @@ public struct SignatureString { return new SignatureString(str); } + public static implicit operator string(SignatureString sig) { return sig.value; @@ -66,6 +69,7 @@ public struct UnixFd { return new UnixFd(fd); } + public static implicit operator Int32(UnixFd unix_fd) { return unix_fd.value; @@ -75,23 +79,107 @@ public struct UnixFd public static class Argument { - public class ByteType { public const char Code = 'y'; public const string Signature = "y"; } - public class BooleanType { public const char Code = 'b'; public const string Signature = "b"; } - public class Int16Type { public const char Code = 'n'; public const string Signature = "n"; } - public class UInt16Type { public const char Code = 'q'; public const string Signature = "q"; } - public class Int32Type { public const char Code = 'i'; public const string Signature = "i"; } - public class UInt32Type { public const char Code = 'u'; public const string Signature = "u"; } - public class Int64Type { public const char Code = 'x'; public const string Signature = "x"; } - public class UInt64Type { public const char Code = 't'; public const string Signature = "t"; } - public class DoubleType { public const char Code = 'd'; public const string Signature = "d"; } - public class StringType { public const char Code = 's'; public const string Signature = "s"; } - public class ObjectPathType { public const char Code = 'o'; public const string Signature = "o"; } - public class SignatureType { public const char Code = 'g'; public const string Signature = "g"; } - public class ArrayType { public const char Code = 'a'; public const string Signature = "a"; } - public class StructType { public const char Code = 'r'; public const string Signature = "r"; } - public class VariantType { public const char Code = 'v'; public const string Signature = "v"; } - public class DictEntryType { public const char Code = 'e'; public const string Signature = "e"; } - public class UnixFdType { public const char Code = 'h'; public const string Signature = "h"; } + public class ByteType + { + public const char Code = 'y'; + public const string Signature = "y"; + } + + public class BooleanType + { + public const char Code = 'b'; + public const string Signature = "b"; + } + + public class Int16Type + { + public const char Code = 'n'; + public const string Signature = "n"; + } + + public class UInt16Type + { + public const char Code = 'q'; + public const string Signature = "q"; + } + + public class Int32Type + { + public const char Code = 'i'; + public const string Signature = "i"; + } + + public class UInt32Type + { + public const char Code = 'u'; + public const string Signature = "u"; + } + + public class Int64Type + { + public const char Code = 'x'; + public const string Signature = "x"; + } + + public class UInt64Type + { + public const char Code = 't'; + public const string Signature = "t"; + } + + public class DoubleType + { + public const char Code = 'd'; + public const string Signature = "d"; + } + + public class StringType + { + public const char Code = 's'; + public const string Signature = "s"; + } + + public class ObjectPathType + { + public const char Code = 'o'; + public const string Signature = "o"; + } + + public class SignatureType + { + public const char Code = 'g'; + public const string Signature = "g"; + } + + public class ArrayType + { + public const char Code = 'a'; + public const string Signature = "a"; + } + + public class StructType + { + public const char Code = 'r'; + public const string Signature = "r"; + } + + public class VariantType + { + public const char Code = 'v'; + public const string Signature = "v"; + } + + public class DictEntryType + { + public const char Code = 'e'; + public const string Signature = "e"; + } + + public class UnixFdType + { + public const char Code = 'h'; + public const string Signature = "h"; + } // public static readonly ByteType ByteT = new ByteType(); // public static readonly BooleanType BooleanT = new BooleanType(); @@ -135,13 +223,17 @@ public abstract class BasicMessageArgument public void AppendTo(eldbus.Message msg) { if (!InternalAppendTo(msg)) + { throw new SEHException("Eldbus: could not append basic type to eldbus.Message"); + } } public void AppendTo(eldbus.MessageIterator iter) { if (!InternalAppendTo(iter)) + { throw new SEHException("Eldbus: could not append basic type to eldbus.MessageIterator"); + } } public abstract char TypeCode {get;} @@ -219,8 +311,15 @@ public class ByteMessageArgument : BasicMessageArgument value = arg; } - public override char TypeCode { get { return Argument.ByteType.Code; } } - public override string Signature { get { return Argument.ByteType.Signature; } } + public override char TypeCode + { + get { return Argument.ByteType.Code; } + } + + public override string Signature + { + get { return Argument.ByteType.Signature; } + } protected override bool InternalAppendTo(eldbus.Message msg) { @@ -242,8 +341,15 @@ public class BoolMessageArgument : BasicMessageArgument value = Convert.ToInt32(arg); } - public override char TypeCode { get { return Argument.BooleanType.Code; } } - public override string Signature { get { return Argument.ByteType.Signature; } } + public override char TypeCode + { + get { return Argument.BooleanType.Code; } + } + + public override string Signature + { + get { return Argument.ByteType.Signature; } + } protected override bool InternalAppendTo(eldbus.Message msg) { @@ -265,8 +371,15 @@ public class Int16MessageArgument : BasicMessageArgument value = arg; } - public override char TypeCode { get { return Argument.Int16Type.Code; } } - public override string Signature { get { return Argument.ByteType.Signature; } } + public override char TypeCode + { + get { return Argument.Int16Type.Code; } + } + + public override string Signature + { + get { return Argument.ByteType.Signature; } + } protected override bool InternalAppendTo(eldbus.Message msg) { @@ -288,8 +401,15 @@ public class UInt16MessageArgument : BasicMessageArgument value = arg; } - public override char TypeCode { get { return Argument.UInt16Type.Code; } } - public override string Signature { get { return Argument.ByteType.Signature; } } + public override char TypeCode + { + get { return Argument.UInt16Type.Code; } + } + + public override string Signature + { + get { return Argument.ByteType.Signature; } + } protected override bool InternalAppendTo(eldbus.Message msg) { @@ -311,8 +431,15 @@ public class Int32MessageArgument : BasicMessageArgument value = arg; } - public override char TypeCode { get { return Argument.Int32Type.Code; } } - public override string Signature { get { return Argument.ByteType.Signature; } } + public override char TypeCode + { + get { return Argument.Int32Type.Code; } + } + + public override string Signature + { + get { return Argument.ByteType.Signature; } + } protected override bool InternalAppendTo(eldbus.Message msg) { @@ -334,8 +461,15 @@ public class UInt32MessageArgument : BasicMessageArgument value = arg; } - public override char TypeCode { get { return Argument.UInt32Type.Code; } } - public override string Signature { get { return Argument.ByteType.Signature; } } + public override char TypeCode + { + get { return Argument.UInt32Type.Code; } + } + + public override string Signature + { + get { return Argument.ByteType.Signature; } + } protected override bool InternalAppendTo(eldbus.Message msg) { @@ -357,8 +491,15 @@ public class Int64MessageArgument : BasicMessageArgument value = arg; } - public override char TypeCode { get { return Argument.Int64Type.Code; } } - public override string Signature { get { return Argument.ByteType.Signature; } } + public override char TypeCode + { + get { return Argument.Int64Type.Code; } + } + + public override string Signature + { + get { return Argument.ByteType.Signature; } + } protected override bool InternalAppendTo(eldbus.Message msg) { @@ -380,8 +521,15 @@ public class UInt64MessageArgument : BasicMessageArgument value = arg; } - public override char TypeCode { get { return Argument.UInt64Type.Code; } } - public override string Signature { get { return Argument.ByteType.Signature; } } + public override char TypeCode + { + get { return Argument.UInt64Type.Code; } + } + + public override string Signature + { + get { return Argument.ByteType.Signature; } + } protected override bool InternalAppendTo(eldbus.Message msg) { @@ -403,8 +551,15 @@ public class DoubleMessageArgument : BasicMessageArgument value = arg; } - public override char TypeCode { get { return Argument.DoubleType.Code; } } - public override string Signature { get { return Argument.ByteType.Signature; } } + public override char TypeCode + { + get { return Argument.DoubleType.Code; } + } + + public override string Signature + { + get { return Argument.ByteType.Signature; } + } protected override bool InternalAppendTo(eldbus.Message msg) { @@ -439,32 +594,53 @@ public abstract class StringLikeMessageArgument : BasicMessageArgument public class StringMessageArgument : StringLikeMessageArgument { - public StringMessageArgument(string arg) - : base(arg) - {} + public StringMessageArgument(string arg) : base(arg) + { + } - public override char TypeCode { get { return Argument.StringType.Code; } } - public override string Signature { get { return Argument.ByteType.Signature; } } + public override char TypeCode + { + get { return Argument.StringType.Code; } + } + + public override string Signature + { + get { return Argument.ByteType.Signature; } + } } public class ObjectPathMessageArgument : StringLikeMessageArgument { - public ObjectPathMessageArgument(ObjectPath arg) - : base(arg.value) - {} + public ObjectPathMessageArgument(ObjectPath arg) : base(arg.value) + { + } - public override char TypeCode { get { return Argument.ObjectPathType.Code; } } - public override string Signature { get { return Argument.ByteType.Signature; } } + public override char TypeCode + { + get { return Argument.ObjectPathType.Code; } + } + + public override string Signature + { + get { return Argument.ByteType.Signature; } + } } public class SignatureMessageArgument : StringLikeMessageArgument { - public SignatureMessageArgument(SignatureString arg) - : base(arg.value) - {} + public SignatureMessageArgument(SignatureString arg) : base(arg.value) + { + } - public override char TypeCode { get { return Argument.SignatureType.Code; } } - public override string Signature { get { return Argument.ByteType.Signature; } } + public override char TypeCode + { + get { return Argument.SignatureType.Code; } + } + + public override string Signature + { + get { return Argument.ByteType.Signature; } + } } public class UnixFdMessageArgument : BasicMessageArgument @@ -476,8 +652,15 @@ public class UnixFdMessageArgument : BasicMessageArgument value = arg.value; } - public override char TypeCode { get { return Argument.UnixFdType.Code; } } - public override string Signature { get { return Argument.ByteType.Signature; } } + public override char TypeCode + { + get { return Argument.UnixFdType.Code; } + } + + public override string Signature + { + get { return Argument.ByteType.Signature; } + } protected override bool InternalAppendTo(eldbus.Message msg) { @@ -497,7 +680,10 @@ public static class Common public static void RaiseNullHandle() { if (NullHandleError == 0) + { NullHandleError = Eina.Error.Register("Eldbus: null handle"); + } + Eina.Error.Raise(NullHandleError); } @@ -511,7 +697,10 @@ public static class Common public static Eldbus_Message_Cb GetMessageCbWrapper() { if (message_cb_wrapper == null) + { message_cb_wrapper = new Eldbus_Message_Cb(MessageCbWrapper); + } + return message_cb_wrapper; } @@ -532,7 +721,7 @@ public static class Common msg = new eldbus.Message(msg_hdl, false); pending = new eldbus.Pending(pending_hdl, false); } - catch(Exception e) + catch (Exception e) { Eina.Log.Error("Eldbus: could not convert Eldbus_Message_Cb parameters. Exception: " + e.ToString()); return; @@ -542,7 +731,7 @@ public static class Common { dlgt(msg, pending); } - catch(Exception e) + catch (Exception e) { Eina.Log.Error("Eldbus: Eldbus_Message_Cb delegate error. Exception: " + e.ToString()); } @@ -553,5 +742,3 @@ public static class Common } } - - diff --git a/src/bindings/mono/eldbus_mono/eldbus_config.cs b/src/bindings/mono/eldbus_mono/eldbus_config.cs index c5bae0767b..08d2386f9b 100644 --- a/src/bindings/mono/eldbus_mono/eldbus_config.cs +++ b/src/bindings/mono/eldbus_mono/eldbus_config.cs @@ -3,7 +3,8 @@ using System; using System.Runtime.InteropServices; -namespace eldbus { +namespace eldbus +{ public static class Config { @@ -13,7 +14,9 @@ public static class Config public static void Init() { if (eldbus_init() == 0) + { throw new Efl.EflException("Failed to initialize Eldbus"); + } } public static void Shutdown() diff --git a/src/bindings/mono/eldbus_mono/eldbus_connection.cs b/src/bindings/mono/eldbus_mono/eldbus_connection.cs index 099582ede5..f88f0ac598 100644 --- a/src/bindings/mono/eldbus_mono/eldbus_connection.cs +++ b/src/bindings/mono/eldbus_mono/eldbus_connection.cs @@ -5,8 +5,8 @@ using System.Runtime.InteropServices; using static eldbus.EldbusConnectionNativeFunctions; -namespace eldbus { - +namespace eldbus +{ public static class EldbusConnectionNativeFunctions { @@ -155,10 +155,21 @@ public class Connection : IDisposable IntPtr h = Handle; Handle = IntPtr.Zero; if (h == IntPtr.Zero) + { return; + } if (Own) - eldbus_connection_unref(h); + { + if (disposing) + { + eldbus_connection_unref(h); + } + else + { + Efl.Eo.Globals.ThreadSafeFreeCbExec(eldbus_connection_unref, h); + } + } } public void Dispose() @@ -184,15 +195,19 @@ public class Connection : IDisposable CheckHandle(); if (msg == null) + { throw new ArgumentNullException("msg"); + } IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr()); IntPtr cb_data = (dlgt == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(dlgt)); var pending_hdl = eldbus_connection_send(Handle, msg.Handle, cb_wrapper, cb_data, timeout); - if(pending_hdl == IntPtr.Zero) + if (pending_hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Pending' object from eldbus_connection_send"); + } msg.Ref(); @@ -204,8 +219,11 @@ public class Connection : IDisposable CheckHandle(); var ptr = eldbus_connection_unique_name_get(Handle); if (ptr == IntPtr.Zero) + { return null; - return Marshal.PtrToStringAuto(ptr); + } + + return Eina.StringConversion.NativeUtf8ToManagedString(ptr); } public eldbus.Pending NameRequest(string bus, uint flags, eldbus.MessageDelegate dlgt = null) @@ -213,15 +231,19 @@ public class Connection : IDisposable CheckHandle(); if (bus == null) + { throw new ArgumentNullException("bus"); + } IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr()); IntPtr cb_data = (dlgt == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(dlgt)); var pending_hdl = eldbus_name_request(Handle, bus, flags, cb_wrapper, cb_data); - if(pending_hdl == IntPtr.Zero) + if (pending_hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Pending' object from eldbus_name_request"); + } return new eldbus.Pending(pending_hdl, false); } @@ -231,15 +253,19 @@ public class Connection : IDisposable CheckHandle(); if (bus == null) + { throw new ArgumentNullException("bus"); + } IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr()); IntPtr cb_data = (dlgt == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(dlgt)); var pending_hdl = eldbus_name_release(Handle, bus, cb_wrapper, cb_data); - if(pending_hdl == IntPtr.Zero) + if (pending_hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Pending' object from eldbus_name_release"); + } return new eldbus.Pending(pending_hdl, false); } @@ -249,15 +275,19 @@ public class Connection : IDisposable CheckHandle(); if (bus == null) + { throw new ArgumentNullException("bus"); + } IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr()); IntPtr cb_data = (dlgt == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(dlgt)); var pending_hdl = eldbus_name_owner_get(Handle, bus, cb_wrapper, cb_data); - if(pending_hdl == IntPtr.Zero) + if (pending_hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Pending' object from eldbus_name_owner_get"); + } return new eldbus.Pending(pending_hdl, false); } @@ -267,15 +297,19 @@ public class Connection : IDisposable CheckHandle(); if (bus == null) + { throw new ArgumentNullException("bus"); + } IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr()); IntPtr cb_data = (dlgt == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(dlgt)); var pending_hdl = eldbus_name_owner_has(Handle, bus, cb_wrapper, cb_data); - if(pending_hdl == IntPtr.Zero) + if (pending_hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Pending' object from eldbus_name_owner_has"); + } return new eldbus.Pending(pending_hdl, false); } @@ -289,8 +323,10 @@ public class Connection : IDisposable var pending_hdl = eldbus_names_list(Handle, cb_wrapper, cb_data); - if(pending_hdl == IntPtr.Zero) + if (pending_hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Pending' object from eldbus_names_list"); + } return new eldbus.Pending(pending_hdl, false); } @@ -304,8 +340,10 @@ public class Connection : IDisposable var pending_hdl = eldbus_names_activatable_list(Handle, cb_wrapper, cb_data); - if(pending_hdl == IntPtr.Zero) + if (pending_hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Pending' object from eldbus_names_activatable_list"); + } return new eldbus.Pending(pending_hdl, false); } @@ -319,8 +357,10 @@ public class Connection : IDisposable var pending_hdl = eldbus_hello(Handle, cb_wrapper, cb_data); - if(pending_hdl == IntPtr.Zero) + if (pending_hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Pending' object from eldbus_hello"); + } return new eldbus.Pending(pending_hdl, false); } @@ -330,15 +370,19 @@ public class Connection : IDisposable CheckHandle(); if (bus == null) + { throw new ArgumentNullException("bus"); + } IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr()); IntPtr cb_data = (dlgt == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(dlgt)); var pending_hdl = eldbus_name_start(Handle, bus, flags, cb_wrapper, cb_data); - if(pending_hdl == IntPtr.Zero) + if (pending_hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Pending' object from eldbus_name_start"); + } return new eldbus.Pending(pending_hdl, false); } diff --git a/src/bindings/mono/eldbus_mono/eldbus_message.cs b/src/bindings/mono/eldbus_mono/eldbus_message.cs index b3826d6e13..559c2f10b9 100644 --- a/src/bindings/mono/eldbus_mono/eldbus_message.cs +++ b/src/bindings/mono/eldbus_mono/eldbus_message.cs @@ -5,7 +5,8 @@ using System.Runtime.InteropServices; using static eldbus.EldbusMessageNativeFunctions; -namespace eldbus { +namespace eldbus +{ public static class EldbusMessageNativeFunctions { @@ -223,10 +224,21 @@ public class Message : IDisposable IntPtr h = Handle; Handle = IntPtr.Zero; if (h == IntPtr.Zero) + { return; + } if (Own) - eldbus_message_unref(h); + { + if (disposing) + { + eldbus_message_unref(h); + } + else + { + Efl.Eo.Globals.ThreadSafeFreeCbExec(eldbus_message_unref, h); + } + } } public void Dispose() @@ -251,7 +263,10 @@ public class Message : IDisposable { var ptr = eldbus_message_method_call_new(dest, path, iface, method); if (ptr == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Message' object from eldbus_message_method_call_new"); + } + return new eldbus.Message(ptr, true); } @@ -259,7 +274,10 @@ public class Message : IDisposable { var ptr = eldbus_message_signal_new(path, _interface, name); if (ptr == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Message' object from eldbus_message_signal_new"); + } + return new eldbus.Message(ptr, true); } @@ -279,42 +297,42 @@ public class Message : IDisposable { CheckHandle(); var ptr = eldbus_message_path_get(Handle); - return Marshal.PtrToStringAuto(ptr); + return Eina.StringConversion.NativeUtf8ToManagedString(ptr); } public string GetInterface() { CheckHandle(); var ptr = eldbus_message_interface_get(Handle); - return Marshal.PtrToStringAuto(ptr); + return Eina.StringConversion.NativeUtf8ToManagedString(ptr); } public string GetMember() { CheckHandle(); var ptr = eldbus_message_member_get(Handle); - return Marshal.PtrToStringAuto(ptr); + return Eina.StringConversion.NativeUtf8ToManagedString(ptr); } public string GetDestination() { CheckHandle(); var ptr = eldbus_message_destination_get(Handle); - return Marshal.PtrToStringAuto(ptr); + return Eina.StringConversion.NativeUtf8ToManagedString(ptr); } public string GetSender() { CheckHandle(); var ptr = eldbus_message_sender_get(Handle); - return Marshal.PtrToStringAuto(ptr); + return Eina.StringConversion.NativeUtf8ToManagedString(ptr); } public string GetSignature() { CheckHandle(); var ptr = eldbus_message_signature_get(Handle); - return Marshal.PtrToStringAuto(ptr); + return Eina.StringConversion.NativeUtf8ToManagedString(ptr); } public eldbus.Message NewError(string error_name, string error_msg) @@ -322,7 +340,10 @@ public class Message : IDisposable CheckHandle(); var ptr = eldbus_message_error_new(Handle, error_name, error_msg); if (ptr == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Message' object from eldbus_message_error_new"); + } + return new eldbus.Message(ptr, false); } @@ -331,7 +352,10 @@ public class Message : IDisposable CheckHandle(); var ptr = eldbus_message_method_return_new(Handle); if (ptr == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Message' object from eldbus_message_method_return_new"); + } + return new eldbus.Message(ptr, false); } @@ -341,8 +365,8 @@ public class Message : IDisposable IntPtr name_ptr; IntPtr text_ptr; bool r = eldbus_message_error_get(Handle, out name_ptr, out text_ptr); - name = Marshal.PtrToStringAuto(name_ptr); - text = Marshal.PtrToStringAuto(text_ptr); + name = Eina.StringConversion.NativeUtf8ToManagedString(name_ptr); + text = Eina.StringConversion.NativeUtf8ToManagedString(text_ptr); return r; } @@ -408,7 +432,7 @@ public class Message : IDisposable CheckHandle(); IntPtr aux; var r = eldbus_message_arguments_get(Handle, Argument.StringType.Signature, out aux); - val = Marshal.PtrToStringAuto(aux); + val = Eina.StringConversion.NativeUtf8ToManagedString(aux); return r; } @@ -417,7 +441,7 @@ public class Message : IDisposable CheckHandle(); IntPtr aux; var r = eldbus_message_arguments_get(Handle, Argument.ObjectPathType.Signature, out aux); - val = Marshal.PtrToStringAuto(aux); + val = Eina.StringConversion.NativeUtf8ToManagedString(aux); return r; } @@ -426,7 +450,7 @@ public class Message : IDisposable CheckHandle(); IntPtr aux; var r = eldbus_message_arguments_get(Handle, Argument.SignatureType.Signature, out aux); - val = Marshal.PtrToStringAuto(aux); + val = Eina.StringConversion.NativeUtf8ToManagedString(aux); return r; } @@ -459,7 +483,10 @@ public class Message : IDisposable CheckHandle(); var ptr = eldbus_message_iter_get(Handle); if (ptr == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `MessageIterator' object from eldbus_message_iter_get"); + } + return new eldbus.MessageIterator(ptr, IntPtr.Zero); } } @@ -514,12 +541,18 @@ public class MessageIterator IntPtr new_iter = IntPtr.Zero; if (signature[0] == 'v') + { new_iter = eldbus_message_iter_container_new(Handle, 'v', signature.Substring(1)); + } else if (!eldbus_message_iter_arguments_append(Handle, signature, out new_iter)) + { throw new SEHException("Eldbus: could not append container type"); + } if (new_iter == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `MessageIterator' object from eldbus_message_iter_arguments_append"); + } return new eldbus.MessageIterator(new_iter, Handle); } @@ -531,7 +564,9 @@ public class MessageIterator IntPtr new_iter = eldbus_message_iter_container_new(Handle, type, contained_signature); if (new_iter == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `MessageIterator' object from eldbus_message_iter_container_new"); + } return new eldbus.MessageIterator(new_iter, Handle); } @@ -541,10 +576,14 @@ public class MessageIterator CheckHandle(); if (Parent == IntPtr.Zero) + { throw new SEHException("Eldbus: can not close MessageIterator open container without a parent"); + } if (!eldbus_message_iter_container_close(Parent, Handle)) + { throw new SEHException("Eldbus: could not close MessageIterator"); + } Handle = IntPtr.Zero; Parent = IntPtr.Zero; @@ -617,7 +656,7 @@ public class MessageIterator CheckHandle(); IntPtr aux; bool r = eldbus_message_iter_get_and_next(Handle, Argument.StringType.Code, out aux); - val = Marshal.PtrToStringAuto(aux); + val = Eina.StringConversion.NativeUtf8ToManagedString(aux); return r; } @@ -626,7 +665,7 @@ public class MessageIterator CheckHandle(); IntPtr aux; bool r = eldbus_message_iter_get_and_next(Handle, Argument.ObjectPathType.Code, out aux); - val = Marshal.PtrToStringAuto(aux); + val = Eina.StringConversion.NativeUtf8ToManagedString(aux); return r; } @@ -635,7 +674,7 @@ public class MessageIterator CheckHandle(); IntPtr aux; bool r = eldbus_message_iter_get_and_next(Handle, Argument.SignatureType.Code, out aux); - val = Marshal.PtrToStringAuto(aux); + val = Eina.StringConversion.NativeUtf8ToManagedString(aux); return r; } @@ -654,7 +693,10 @@ public class MessageIterator IntPtr hdl = IntPtr.Zero; bool r = eldbus_message_iter_get_and_next(Handle, typecode, out hdl); if (hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get argument"); + } + iter = new eldbus.MessageIterator(hdl, Handle); return r; @@ -665,7 +707,10 @@ public class MessageIterator CheckHandle(); IntPtr hdl = IntPtr.Zero; if (!eldbus_message_iter_arguments_get(Handle, signatue, out hdl) || hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get argument"); + } + iter = new eldbus.MessageIterator(hdl, Handle); return Next(); @@ -732,7 +777,7 @@ public class MessageIterator CheckHandle(); IntPtr aux; eldbus_message_iter_basic_get(Handle, out aux); - val = Marshal.PtrToStringAuto(aux); + val = Eina.StringConversion.NativeUtf8ToManagedString(aux); } public void Get(out eldbus.ObjectPath val) @@ -740,7 +785,7 @@ public class MessageIterator CheckHandle(); IntPtr aux; eldbus_message_iter_basic_get(Handle, out aux); - val = Marshal.PtrToStringAuto(aux); + val = Eina.StringConversion.NativeUtf8ToManagedString(aux); } public void Get(out eldbus.SignatureString val) @@ -748,7 +793,7 @@ public class MessageIterator CheckHandle(); IntPtr aux; eldbus_message_iter_basic_get(Handle, out aux); - val = Marshal.PtrToStringAuto(aux); + val = Eina.StringConversion.NativeUtf8ToManagedString(aux); } public void Get(out eldbus.UnixFd val) @@ -764,7 +809,10 @@ public class MessageIterator CheckHandle(); IntPtr hdl = IntPtr.Zero; if (!eldbus_message_iter_arguments_get(Handle, signatue, out hdl) || hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get argument"); + } + iter = new eldbus.MessageIterator(hdl, Handle); } @@ -789,7 +837,9 @@ public class MessageIterator CheckHandle(); if (!eldbus_message_iter_fixed_array_get(Handle, type_code, out value, out n_elements)) + { throw new SEHException("Eldbus: could not get fixed array"); + } } public void GetFixedArray(out byte[] array) @@ -880,4 +930,3 @@ public class MessageIterator } } - diff --git a/src/bindings/mono/eldbus_mono/eldbus_object.cs b/src/bindings/mono/eldbus_mono/eldbus_object.cs index 44888532ef..682fda6565 100644 --- a/src/bindings/mono/eldbus_mono/eldbus_object.cs +++ b/src/bindings/mono/eldbus_mono/eldbus_object.cs @@ -7,8 +7,8 @@ using static eldbus.EldbusObjectNativeFunctions; using IntPtr = System.IntPtr; -namespace eldbus { - +namespace eldbus +{ public static class EldbusObjectNativeFunctions { @@ -112,16 +112,26 @@ public class Object : System.IDisposable public Object(eldbus.Connection conn, string bus, string path) { if (conn == null) + { throw new System.ArgumentNullException("conn"); + } + if (bus == null) + { throw new System.ArgumentNullException("bus"); + } + if (path == null) + { throw new System.ArgumentNullException("path"); + } var handle = eldbus_object_get(conn.Handle, bus, path); if (handle == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Object' object from eldbus_object_get"); + } InitNew(handle, true); } @@ -136,10 +146,21 @@ public class Object : System.IDisposable IntPtr h = Handle; Handle = IntPtr.Zero; if (h == IntPtr.Zero) + { return; + } if (Own) - eldbus_object_unref(h); + { + if (disposing) + { + eldbus_object_unref(h); + } + else + { + Efl.Eo.Globals.ThreadSafeFreeCbExec(eldbus_object_unref, h); + } + } } public void Dispose() @@ -166,7 +187,9 @@ public class Object : System.IDisposable var conn = eldbus_object_connection_get(Handle); if (conn == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Connection' object from eldbus_object_connection_get"); + } return new eldbus.Connection(conn, false); } @@ -175,14 +198,14 @@ public class Object : System.IDisposable { CheckHandle(); var ptr = eldbus_object_bus_name_get(Handle); - return Marshal.PtrToStringAuto(ptr); + return Eina.StringConversion.NativeUtf8ToManagedString(ptr); } public string GetPath() { CheckHandle(); var ptr = eldbus_object_path_get(Handle); - return Marshal.PtrToStringAuto(ptr); + return Eina.StringConversion.NativeUtf8ToManagedString(ptr); } public void Ref() @@ -202,7 +225,9 @@ public class Object : System.IDisposable CheckHandle(); if (msg == null) + { throw new System.ArgumentNullException("msg"); + } IntPtr cb_wrapper = dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr(); IntPtr cb_data = dlgt == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(dlgt); @@ -210,7 +235,9 @@ public class Object : System.IDisposable var pending_hdl = eldbus_object_send(Handle, msg.Handle, cb_wrapper, cb_data, timeout); if (pending_hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Pending' object from eldbus_object_send"); + } return new eldbus.Pending(pending_hdl, false); } @@ -222,7 +249,9 @@ public class Object : System.IDisposable var hdl = eldbus_object_method_call_new(Handle, _interface, member); if (hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Message' object from eldbus_object_method_call_new"); + } return new eldbus.Message(hdl, false); } @@ -237,7 +266,9 @@ public class Object : System.IDisposable var pending_hdl = eldbus_object_peer_ping(Handle, cb_wrapper, cb_data); if (pending_hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Pending' object from eldbus_object_peer_ping"); + } return new eldbus.Pending(pending_hdl, false); } @@ -252,7 +283,9 @@ public class Object : System.IDisposable var pending_hdl = eldbus_object_peer_machine_id_get(Handle, cb_wrapper, cb_data); if (pending_hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Pending' object from eldbus_object_peer_machine_id_get"); + } return new eldbus.Pending(pending_hdl, false); } @@ -267,7 +300,9 @@ public class Object : System.IDisposable var pending_hdl = eldbus_object_introspect(Handle, cb_wrapper, cb_data); if (pending_hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Pending' object from eldbus_object_introspect"); + } return new eldbus.Pending(pending_hdl, false); } @@ -282,12 +317,12 @@ public class Object : System.IDisposable var pending_hdl = eldbus_object_managed_objects_get(Handle, cb_wrapper, cb_data); if (pending_hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Pending' object from eldbus_object_managed_objects_get"); + } return new eldbus.Pending(pending_hdl, false); } - } - } diff --git a/src/bindings/mono/eldbus_mono/eldbus_pending.cs b/src/bindings/mono/eldbus_mono/eldbus_pending.cs index f5afa05700..fbd8f35be9 100644 --- a/src/bindings/mono/eldbus_mono/eldbus_pending.cs +++ b/src/bindings/mono/eldbus_mono/eldbus_pending.cs @@ -5,7 +5,8 @@ using System.Runtime.InteropServices; using static eldbus.EldbusPendingNativeFunctions; -namespace eldbus { +namespace eldbus +{ public static class EldbusPendingNativeFunctions { @@ -82,30 +83,29 @@ public class Pending { CheckHandle(); var ptr = eldbus_pending_destination_get(Handle); - return Marshal.PtrToStringAuto(ptr); + return Eina.StringConversion.NativeUtf8ToManagedString(ptr); } public string GetPath() { CheckHandle(); var ptr = eldbus_pending_path_get(Handle); - return Marshal.PtrToStringAuto(ptr); + return Eina.StringConversion.NativeUtf8ToManagedString(ptr); } public string GetInterface() { CheckHandle(); var ptr = eldbus_pending_interface_get(Handle); - return Marshal.PtrToStringAuto(ptr); + return Eina.StringConversion.NativeUtf8ToManagedString(ptr); } public string GetMethod() { CheckHandle(); var ptr = eldbus_pending_method_get(Handle); - return Marshal.PtrToStringAuto(ptr); + return Eina.StringConversion.NativeUtf8ToManagedString(ptr); } } } - diff --git a/src/bindings/mono/eldbus_mono/eldbus_proxy.cs b/src/bindings/mono/eldbus_mono/eldbus_proxy.cs index fa34ce307b..f5eec40d43 100644 --- a/src/bindings/mono/eldbus_mono/eldbus_proxy.cs +++ b/src/bindings/mono/eldbus_mono/eldbus_proxy.cs @@ -5,7 +5,8 @@ using System.Runtime.InteropServices; using static eldbus.EldbusProxyNativeFunctions; -namespace eldbus { +namespace eldbus +{ public static class EldbusProxyNativeFunctions { @@ -104,10 +105,21 @@ public class Proxy : IDisposable IntPtr h = Handle; Handle = IntPtr.Zero; if (h == IntPtr.Zero) + { return; + } if (Own) - eldbus_proxy_unref(h); + { + if (disposing) + { + eldbus_proxy_unref(h); + } + else + { + Efl.Eo.Globals.ThreadSafeFreeCbExec(eldbus_proxy_unref, h); + } + } } public void Dispose() @@ -133,7 +145,10 @@ public class Proxy : IDisposable CheckHandle(); var ptr = eldbus_proxy_object_get(Handle); if (ptr == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Object' object from eldbus_proxy_object_get"); + } + return new eldbus.Object(ptr, false); } @@ -141,7 +156,7 @@ public class Proxy : IDisposable { CheckHandle(); var ptr = eldbus_proxy_interface_get(Handle); - return Marshal.PtrToStringAuto(ptr); + return Eina.StringConversion.NativeUtf8ToManagedString(ptr); } eldbus.Message NewMethodCall(string member) @@ -149,11 +164,16 @@ public class Proxy : IDisposable CheckHandle(); if (member == null) + { throw new ArgumentNullException("member"); + } var ptr = eldbus_proxy_method_call_new(Handle, member); if (ptr == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Message' object from eldbus_proxy_method_call_new"); + } + return new eldbus.Message(ptr, false); } @@ -162,7 +182,9 @@ public class Proxy : IDisposable CheckHandle(); if (msg == null) + { throw new ArgumentNullException("msg"); + } IntPtr cb_wrapper = dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr(); IntPtr cb_data = dlgt == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(dlgt); @@ -170,7 +192,9 @@ public class Proxy : IDisposable var pending_hdl = eldbus_proxy_send(Handle, msg.Handle, cb_wrapper, cb_data, timeout); if (pending_hdl == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Pending' object from eldbus_proxy_send"); + } return new eldbus.Pending(pending_hdl, false); } @@ -180,7 +204,10 @@ public class Proxy : IDisposable CheckHandle(); var ptr = eldbus_proxy_send_and_block(Handle, msg.Handle, timeout); if (ptr == IntPtr.Zero) + { throw new SEHException("Eldbus: could not get `Message' object from eldbus_proxy_send_and_block"); + } + return new eldbus.Message(ptr, true); } @@ -205,4 +232,3 @@ public class Proxy : IDisposable } } - diff --git a/src/bindings/mono/eldbus_mono/eldbus_service.cs b/src/bindings/mono/eldbus_mono/eldbus_service.cs index 33c3acb194..6e089720e1 100644 --- a/src/bindings/mono/eldbus_mono/eldbus_service.cs +++ b/src/bindings/mono/eldbus_mono/eldbus_service.cs @@ -5,7 +5,8 @@ using System.Runtime.InteropServices; using static eldbus.EldbusServiceNativeFunctions; -namespace eldbus { +namespace eldbus +{ public static class EldbusServiceNativeFunctions { @@ -65,4 +66,3 @@ public static class EldbusServiceNativeFunctions } } - diff --git a/src/bindings/mono/eo_mono/FunctionWrapper.cs b/src/bindings/mono/eo_mono/FunctionWrapper.cs new file mode 100644 index 0000000000..bdbca77d93 --- /dev/null +++ b/src/bindings/mono/eo_mono/FunctionWrapper.cs @@ -0,0 +1,159 @@ +using System; +using System.Runtime.InteropServices; + +namespace Efl +{ + +namespace Eo +{ + +///Class to load functions pointers from a native module. +/// +///This class has a platform-dependent implementation on whether it +///is compiled for Windows (using LoadLibrary/GetProcAddress) or Unix +///(dlopen/dlsym). +public partial class FunctionInterop +{ + ///Loads a function pointer from the given module. + ///The name of the module containing the function. + ///The name of the function to search for. + ///A function pointer that can be used with delegates. + public static IntPtr LoadFunctionPointer(string moduleName, string functionName) + { + NativeModule module = new NativeModule(moduleName); + Eina.Log.Debug($"searching {module.Module} for {functionName}"); + var s = FunctionInterop.dlsym(module.Module, functionName); + Eina.Log.Debug($"searching {module.Module} for{functionName}, result {s}"); + return s; + } + + ///Loads a function pointer from the default module. + ///The name of the function to search for. + ///A function pointer that can be used with delegates. + public static IntPtr LoadFunctionPointer(string functionName) + { + Eina.Log.Debug($"searching {null} for {functionName}"); + var s = FunctionInterop.dlsym(IntPtr.Zero, functionName); + Eina.Log.Debug($"searching {null} for {functionName}, result {s}"); + return s; + } +} + +///Wraps a native function in a portable manner. +/// +///This is intended as a workaround DllImport limitations when switching between mono and dotnet. +/// +///The parameter T must be a delegate. +/// +public class FunctionWrapper // NOTE: When supporting C# >=7.3, add a where T: System.Delegate? +{ + private Lazy> loadResult; +#pragma warning disable 0414 + private NativeModule module; // so it doesn't get unloaded +#pragma warning restore 0414 + + private static FunctionLoadResult LazyInitialization(NativeModule module, string functionName) + { + if (module.Module == IntPtr.Zero) + { + return new FunctionLoadResult(FunctionLoadResultKind.LibraryNotFound); + } + else + { + IntPtr funcptr = FunctionInterop.LoadFunctionPointer(module.Module, functionName); + if (funcptr == IntPtr.Zero) + { + return new FunctionLoadResult(FunctionLoadResultKind.FunctionNotFound); + } + else + { + return new FunctionLoadResult(Marshal.GetDelegateForFunctionPointer(funcptr)); + } + } + } + + ///Creates a wrapper for the given function of the given module. + ///The name of the module containing the function. + ///The name of the function to search for. + public FunctionWrapper(string moduleName, string functionName) + : this(new NativeModule(moduleName), functionName) + { + } + + ///Creates a wrapper for the given function of the given module. + ///The module wrapper containing the function. + ///The name of the function to search for. + public FunctionWrapper(NativeModule module, string functionName) + { + this.module = module; + loadResult = new Lazy> + (() => + { + return LazyInitialization(module, functionName); + }); + } + + ///Retrieves the result of function load. + ///The load result. + public FunctionLoadResult Value + { + get + { + return loadResult.Value; + } + } +} + +///The outcome of the function load process. +public enum FunctionLoadResultKind +{ + ///Function was loaded successfully. + Success, + ///Library was not found. + LibraryNotFound, + ///Function symbol was not found in the given module. + FunctionNotFound +} + +///Represents the result of loading a function pointer. +public class FunctionLoadResult +{ + ///The status of the load. + public FunctionLoadResultKind Kind; + private T _Delegate; + + ///The delegate wrapping the loaded function pointer. + /// + ///Throws InvalidOperationException if trying to access while not loaded. + public T Delegate + { + get + { + if (_Delegate == null) + { + throw new InvalidOperationException($"Trying to get Delegate while not loaded. Load result: {Kind}"); + } + + return _Delegate; + } + } + + ///Creates a new load result of the given kind. + ///The outcome of the load process. + public FunctionLoadResult(FunctionLoadResultKind kind) + { + this.Kind = kind; + } + + ///Creates a new load result with the given delegate. + ///The delegate wrapping the native function. + public FunctionLoadResult(T Delegate) + { + this._Delegate = Delegate; + this.Kind = FunctionLoadResultKind.Success; + } +} + +} + +} diff --git a/src/bindings/mono/eo_mono/FunctionWrapper_Unix.cs b/src/bindings/mono/eo_mono/FunctionWrapper_Unix.cs new file mode 100644 index 0000000000..13a3cac865 --- /dev/null +++ b/src/bindings/mono/eo_mono/FunctionWrapper_Unix.cs @@ -0,0 +1,30 @@ +using System; +using System.Runtime.InteropServices; + +namespace Efl +{ + +namespace Eo +{ + +public partial class FunctionInterop +{ + [DllImport(efl.Libs.Libdl)] + private static extern IntPtr dlsym(IntPtr handle, string symbol); + + ///Loads a function pointer from the given module. + ///The module containing the function. + ///The name of the function to search for. + ///A function pointer that can be used with delegates. + public static IntPtr LoadFunctionPointer(IntPtr nativeLibraryHandle, string functionName) + { + Eina.Log.Debug("searching {nativeLibraryHandle} for {functionName}"); + var s = FunctionInterop.dlsym(nativeLibraryHandle, functionName); + Eina.Log.Debug("searching {nativeLibraryHandle} for {functionName}, result {s}"); + return s; + } +} + +} + +} diff --git a/src/bindings/mono/eo_mono/FunctionWrapper_Windows.cs b/src/bindings/mono/eo_mono/FunctionWrapper_Windows.cs new file mode 100644 index 0000000000..dcf2091b71 --- /dev/null +++ b/src/bindings/mono/eo_mono/FunctionWrapper_Windows.cs @@ -0,0 +1,21 @@ +using System; +using System.Runtime.InteropServices; + +namespace Efl +{ + +namespace Eo +{ + +public partial class FunctionInterop +{ + [DllImport(efl.Libs.Libdl)] + public static extern IntPtr GetProcAddress(IntPtr handle, string symbol); + + private static IntPtr LoadFunctionPointer(IntPtr nativeLibraryHandle, string functionName) + => FunctionInterop.GetProcAddress(nativeLibraryHandle, functionName); +} + +} + +} diff --git a/src/bindings/mono/eo_mono/NativeModule.cs b/src/bindings/mono/eo_mono/NativeModule.cs new file mode 100644 index 0000000000..41f663e282 --- /dev/null +++ b/src/bindings/mono/eo_mono/NativeModule.cs @@ -0,0 +1,44 @@ +using System; + +namespace Efl +{ + +namespace Eo +{ + +///Wraps a native module that was opened with dlopen/LoadLibrary. +public partial class NativeModule : IDisposable +{ + private Lazy module; + + ///Lazily tries to load the module with the given name. + ///The name of the module to load. + public NativeModule(string libName) + { + module = new Lazy + (() => + { + return LoadLibrary(libName); + }); + } + + ///The module that was loaded. + public IntPtr Module + { + get + { + return module.Value; + } + } + + ///Unload and released the handle to the wrapped module. + public void Dispose() + { + UnloadLibrary(module.Value); + module = null; + } +} + +} + +} diff --git a/src/bindings/mono/eo_mono/NativeModule_Unix.cs b/src/bindings/mono/eo_mono/NativeModule_Unix.cs new file mode 100644 index 0000000000..e63b9ba111 --- /dev/null +++ b/src/bindings/mono/eo_mono/NativeModule_Unix.cs @@ -0,0 +1,74 @@ +using System; +using System.Runtime.InteropServices; + +namespace Efl +{ + +namespace Eo +{ + +public partial class NativeModule +{ + private const int RTLD_NOW = 0x002; + // Currently we are using GLOBAL due to issues + // with the way evas modules are built. + private const int RTLD_GLOBAL = 0x100; + + [DllImport(efl.Libs.Libdl)] + private static extern IntPtr dlopen(string fileName, int flag); + [DllImport(efl.Libs.Libdl)] + private static extern int dlclose(IntPtr handle); + + ///Closes the library handle. + ///The handle to the library. + public static void UnloadLibrary(IntPtr handle) + { + dlclose(handle); + } + + ///Loads the given library. + /// + ///It attempts to load using the following list of names based on the filename + ///parameter: + /// + /// + /// + ///filename + /// + /// + ///libfilename + /// + /// + ///filename.so + /// + /// + ///libfilename.so + /// + /// + /// + ///The name to search for. + ///The loaded library handle or on failure. + public static IntPtr LoadLibrary(string filename) + { + Eina.Log.Debug($"Loading library {filename}"); + var r = dlopen(filename, RTLD_NOW | RTLD_GLOBAL); + if (r == IntPtr.Zero) + { + r = dlopen("lib" + filename, RTLD_NOW | RTLD_GLOBAL); + if (r == IntPtr.Zero) + { + r = dlopen(filename + ".so", RTLD_NOW | RTLD_GLOBAL); + if (r == IntPtr.Zero) + { + r = dlopen("lib" + filename + ".so", RTLD_NOW | RTLD_GLOBAL); + } + } + } + + return r; + } +} + +} + +} diff --git a/src/bindings/mono/eo_mono/NativeModule_Windows.cs b/src/bindings/mono/eo_mono/NativeModule_Windows.cs new file mode 100644 index 0000000000..1db8340cba --- /dev/null +++ b/src/bindings/mono/eo_mono/NativeModule_Windows.cs @@ -0,0 +1,18 @@ +using System; +using System.Runtime.InteropServices; + +namespace Efl +{ + +namespace Eo +{ + +public class partial NativeModule +{ + [DllImport(efl.Libs.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)] + public static extern IntPtr LoadLibrary(string libFilename); +} + +} + +} diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs index fe96088626..a410a091bb 100644 --- a/src/bindings/mono/eo_mono/iwrapper.cs +++ b/src/bindings/mono/eo_mono/iwrapper.cs @@ -2,29 +2,85 @@ using System; using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; using System.Collections.Generic; using System.Diagnostics; +using System.Reflection; using System.Threading; using static Eina.NativeCustomExportFunctions; using EoG = Efl.Eo.Globals; -namespace Efl { namespace Eo { +namespace Efl +{ -public class Globals { - [DllImport(efl.Libs.Eo)] public static extern void efl_object_init(); - [DllImport(efl.Libs.Eo)] public static extern void efl_object_shutdown(); +namespace Eo +{ + +public class Globals +{ + /// Represents the type of the native Efl_Class. + public enum EflClassType + { + /// Regular EFL classes. + Regular = 0, + /// Non-instantiable efl classes (i.e. Abstracts). + RegularNoInstant, + /// Interface types. + Interface, + /// Mixins types. + Mixin, + /// Invalid class type. + Invalid + } + + [return: MarshalAs(UnmanagedType.U1)] + public delegate bool efl_object_init_delegate(); + public static FunctionWrapper efl_object_init_ptr = + new FunctionWrapper(efl.Libs.EoModule, "efl_object_init"); + public static bool efl_object_init() => efl_object_init_ptr.Value.Delegate(); + + public delegate void efl_object_shutdown_delegate(); + public static FunctionWrapper efl_object_shutdown_ptr = new FunctionWrapper(efl.Libs.EoModule, "efl_object_shutdown"); + public static void efl_object_shutdown() => efl_object_shutdown_ptr.Value.Delegate(); + // [DllImport(efl.Libs.Eo)] public static extern void efl_object_shutdown(); + public static FunctionWrapper<_efl_add_internal_start_delegate> _efl_add_internal_start_ptr = new FunctionWrapper<_efl_add_internal_start_delegate>(efl.Libs.EoModule, "_efl_add_internal_start"); + public delegate IntPtr + _efl_add_internal_start_delegate([MarshalAs(UnmanagedType.LPStr)] String file, int line, + IntPtr klass, IntPtr parent, byte is_ref, byte is_fallback); [DllImport(efl.Libs.Eo)] public static extern IntPtr _efl_add_internal_start([MarshalAs(UnmanagedType.LPStr)] String file, int line, IntPtr klass, IntPtr parent, byte is_ref, byte is_fallback); + public delegate IntPtr + _efl_add_end_delegate(IntPtr eo, byte is_ref, byte is_fallback); [DllImport(efl.Libs.Eo)] public static extern IntPtr _efl_add_end(IntPtr eo, byte is_ref, byte is_fallback); + public delegate IntPtr + efl_ref_delegate(IntPtr eo); [DllImport(efl.Libs.Eo)] public static extern IntPtr efl_ref(IntPtr eo); + public delegate void + efl_unref_delegate(IntPtr eo); [DllImport(efl.Libs.CustomExports)] public static extern void efl_unref(IntPtr eo); + public delegate int + efl_ref_count_delegate(IntPtr eo); [DllImport(efl.Libs.Eo)] public static extern int efl_ref_count(IntPtr eo); + [DllImport(efl.Libs.CustomExports)] public static extern void + efl_mono_gchandle_callbacks_set(Efl.FreeGCHandleCb freeGCHandleCb, Efl.RemoveEventsCb removeEventsCb); + [DllImport(efl.Libs.CustomExports)] public static extern void + efl_mono_native_dispose(IntPtr eo, IntPtr gcHandle); + [DllImport(efl.Libs.CustomExports)] public static extern void + efl_mono_thread_safe_native_dispose(IntPtr eo, IntPtr gcHandle); + [DllImport(efl.Libs.CustomExports)] public static extern void + efl_mono_thread_safe_efl_unref(IntPtr eo); + + [DllImport(efl.Libs.CustomExports)] public static extern void + efl_mono_thread_safe_free_cb_exec(IntPtr free_cb, IntPtr cb_data); + + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_name_get(IntPtr eo); [DllImport(efl.Libs.Eo)] public static extern IntPtr efl_class_new(IntPtr class_description, IntPtr parent, IntPtr term); [DllImport(efl.Libs.Eo)] public static extern IntPtr @@ -123,40 +179,52 @@ public class Globals { efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr extn36, IntPtr extn37, IntPtr extn38, IntPtr extn39, IntPtr extn40, IntPtr extn41, IntPtr extn42, IntPtr extn43, IntPtr extn44, IntPtr extn45, IntPtr extn46, IntPtr extn47, IntPtr term); [DllImport(efl.Libs.Eo)] public static extern IntPtr efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr extn36, IntPtr extn37, IntPtr extn38, IntPtr extn39, IntPtr extn40, IntPtr extn41, IntPtr extn42, IntPtr extn43, IntPtr extn44, IntPtr extn45, IntPtr extn46, IntPtr extn47, IntPtr extn48, IntPtr term); + + public delegate byte efl_class_functions_set_delegate(IntPtr klass_id, IntPtr object_ops, IntPtr class_ops); [DllImport(efl.Libs.Eo)] public static extern byte efl_class_functions_set(IntPtr klass_id, IntPtr object_ops, IntPtr class_ops); + public delegate IntPtr efl_data_scope_get_delegate(IntPtr obj, IntPtr klass); [DllImport(efl.Libs.Eo)] public static extern IntPtr efl_data_scope_get(IntPtr obj, IntPtr klass); + public delegate IntPtr efl_super_delegate(IntPtr obj, IntPtr klass); [DllImport(efl.Libs.Eo)] public static extern IntPtr efl_super(IntPtr obj, IntPtr klass); + public delegate IntPtr efl_class_get_delegate(IntPtr obj); [DllImport(efl.Libs.Eo)] public static extern IntPtr efl_class_get(IntPtr obj); -#if WIN32 - public static IntPtr RTLD_DEFAULT = new IntPtr(1); -#else - public static IntPtr RTLD_DEFAULT = new IntPtr(0); -#endif + [DllImport(efl.Libs.Eo)] public static extern EflClassType efl_class_type_get(IntPtr klass); + public delegate IntPtr dlerror_delegate(); [DllImport(efl.Libs.Evil)] public static extern IntPtr dlerror(); - [DllImport(efl.Libs.Evil)] public static extern IntPtr dlsym - (IntPtr handle, [MarshalAs(UnmanagedType.LPStr)] String name); - [DllImport(efl.Libs.Eo)] public static extern bool efl_event_callback_priority_add( - System.IntPtr obj, - IntPtr desc, - short priority, - Efl.EventCb cb, - System.IntPtr data); - [DllImport(efl.Libs.Eo)] public static extern bool efl_event_callback_del( - System.IntPtr obj, - IntPtr desc, - Efl.EventCb cb, - System.IntPtr data); - [DllImport(efl.Libs.Eo)] public static extern IntPtr - efl_object_legacy_only_event_description_get([MarshalAs(UnmanagedType.LPStr)] String name); + [DllImport(efl.Libs.Eo)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool + efl_event_callback_priority_add(IntPtr obj, IntPtr desc, short priority, IntPtr cb, IntPtr data); + + [DllImport(efl.Libs.Eo)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool + efl_event_callback_del(IntPtr obj, IntPtr desc, IntPtr cb, IntPtr data); + + [DllImport(efl.Libs.Eo)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool + efl_event_callback_call(IntPtr obj, IntPtr desc, IntPtr event_info); - public static System.Collections.Concurrent.ConcurrentDictionary klasses - = new System.Collections.Concurrent.ConcurrentDictionary(); - public const int RTLD_NOW = 2; public delegate byte class_initializer(IntPtr klass); + public static T GetParamHelper(Nullable v) where T : struct + { + return v.Value; + } + + public static U GetParamHelper(U v) + { + return v; + } + + public static bool ParamHelperCheck(Nullable v) where T : struct + { + return v.HasValue; + } + + public static bool ParamHelperCheck(U v) + { + return v != null; + } + public static IntPtr register_class(String class_name, IntPtr base_klass, System.Type type) { ClassDescription description; @@ -169,10 +237,10 @@ public class Globals { description.class_destructor = IntPtr.Zero; class_initializer init = (IntPtr kls) => - { - return Globals.class_initializer_call(kls, type); - }; - + { + return Globals.class_initializer_call(kls, type); + }; + description.class_initializer = Marshal.GetFunctionPointerForDelegate(init); IntPtr description_ptr = Eina.MemoryNative.Alloc(Marshal.SizeOf(description)); @@ -180,23 +248,24 @@ public class Globals { var interface_list = EoG.get_efl_interfaces(type); - System.Console.WriteLine ("Interafaces: {0}", interface_list.Count); - - Eina.Log.Debug("Going to register!"); + Eina.Log.Debug($"Going to register new class named {class_name}"); IntPtr klass = EoG.call_efl_class_new(description_ptr, base_klass, interface_list); - if(klass == IntPtr.Zero) + if (klass == IntPtr.Zero) { Eina.Log.Error("klass was not registered"); - Console.WriteLine("klass was not registered"); } else + { Eina.Log.Debug("Registered class successfully"); + } + return klass; } + public static List get_efl_interfaces(System.Type type) { System.Type base_type = type.BaseType; - + var ifaces_lst = new List(); var base_ifaces = base_type.GetInterfaces(); var ifaces = type.GetInterfaces(); @@ -204,37 +273,66 @@ public class Globals { { if (!System.Array.Exists(base_ifaces, element => element == iface)) { - var attrs = System.Attribute.GetCustomAttributes(iface); - foreach (var attr in attrs) - { - if (attr is Efl.Eo.NativeClass) { - ifaces_lst.Add(((Efl.Eo.NativeClass)attr).GetEflClass()); - break; - } - } + var attrs = System.Attribute.GetCustomAttributes(iface); + foreach (var attr in attrs) + { + if (attr is Efl.Eo.NativeClass) + { + ifaces_lst.Add(((Efl.Eo.NativeClass)attr).GetEflClass()); + break; + } + } } } + return ifaces_lst; } - private static Efl.Eo.NativeClass get_native_class(System.Type type) + + private static Efl.Eo.NativeClass GetNativeClass(System.Type type) { - var attrs = System.Attribute.GetCustomAttributes(type); + var attrs = System.Attribute.GetCustomAttributes(type, false); foreach (var attr in attrs) { - if (attr is Efl.Eo.NativeClass) { + if (attr is Efl.Eo.NativeClass) + { return (Efl.Eo.NativeClass)attr; } } + return null; } + + public static System.Collections.Generic.List + GetUserMethods(System.Type type) + { + var r = new System.Collections.Generic.List(); + var flags = System.Reflection.BindingFlags.Instance + | System.Reflection.BindingFlags.DeclaredOnly + | System.Reflection.BindingFlags.Public + | System.Reflection.BindingFlags.NonPublic; + r.AddRange(type.GetMethods(flags)); + var base_type = type.BaseType; + + for (;base_type != null; base_type = base_type.BaseType) + { + if (IsGeneratedClass(base_type)) + { + return r; + } + + r.AddRange(base_type.GetMethods(flags)); + } + return r; + } + public static byte class_initializer_call(IntPtr klass, System.Type type) { - Console.WriteLine("class_intiailizer_call 0x{1} {0}", type, klass); - Efl.Eo.NativeClass nativeClass = get_native_class(type.BaseType); + Eina.Log.Debug($"called with 0x{klass.ToInt64():x} {type}"); + Efl.Eo.NativeClass nativeClass = GetNativeClass(type.BaseType); if (nativeClass != null) { - Console.WriteLine("nativeClass != null"); + Eina.Log.Debug("nativeClass != null"); var descs = nativeClass.GetEoOps(type); var count = descs.Count; @@ -244,24 +342,31 @@ public class Globals { { if (!System.Array.Exists(base_interfaces, element => element == iface)) { - var nc = get_native_class(iface); - if(nc != null) + var nc = GetNativeClass(iface); + if (nc != null) { var moredescs = nc.GetEoOps(type); - Console.WriteLine("adding {0} more descs to registration", moredescs.Count); + Eina.Log.Debug($"adding {moredescs.Count} more descs to registration"); descs.AddRange(moredescs); count = descs.Count; } } } - - IntPtr descs_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(descs[0])*count); + + IntPtr descs_ptr = IntPtr.Zero; + + if (count > 0) + { + descs_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(descs[0]) * count); + } + IntPtr ptr = descs_ptr; - for(int i = 0; i != count; ++i) + for (int i = 0; i != count; ++i) { Marshal.StructureToPtr(descs[i], ptr, false); ptr = IntPtr.Add(ptr, Marshal.SizeOf(descs[0])); } + Efl_Object_Ops ops; ops.descs = descs_ptr; ops.count = (UIntPtr)count; @@ -271,151 +376,131 @@ public class Globals { //EoKlass = klass; } else - Console.WriteLine("nativeClass == null"); - + { + Eina.Log.Debug("nativeClass == null"); + } + return 1; } + public static IntPtr call_efl_class_new(IntPtr desc, IntPtr bk, List il = null) { IntPtr nul = IntPtr.Zero; int iface_list_count = (il == null ? 0 : il.Count); - switch(iface_list_count) + switch (iface_list_count) { - default: return nul; - case 0: return EoG.efl_class_new(desc, bk, nul); - case 1: return EoG.efl_class_new(desc, bk, il[0], nul); - case 2: return EoG.efl_class_new(desc, bk, il[0], il[1], nul); - case 3: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], nul); - case 4: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], nul); - case 5: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], nul); - case 6: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], nul); - case 7: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], nul); - case 8: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], nul); - case 9: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], nul); - case 10: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], nul); - case 11: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], nul); - case 12: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], nul); - case 13: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], nul); - case 14: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], nul); - case 15: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], nul); - case 16: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], nul); - case 17: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], nul); - case 18: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], nul); - case 19: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], nul); - case 20: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], nul); - case 21: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], nul); - case 22: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], nul); - case 23: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], nul); - case 24: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], nul); - case 25: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], nul); - case 26: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], nul); - case 27: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], nul); - case 28: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], nul); - case 29: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], nul); - case 30: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], nul); - case 31: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], nul); - case 32: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], nul); - case 33: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], nul); - case 34: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], nul); - case 35: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], nul); - case 36: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], nul); - case 37: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], nul); - case 38: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], nul); - case 39: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], nul); - case 40: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], nul); - case 41: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], nul); - case 42: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], nul); - case 43: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], nul); - case 44: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], nul); - case 45: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], nul); - case 46: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], il[45], nul); - case 47: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], il[45], il[46], nul); - case 48: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], il[45], il[46], il[47], nul); + default: return nul; + case 0: return EoG.efl_class_new(desc, bk, nul); + case 1: return EoG.efl_class_new(desc, bk, il[0], nul); + case 2: return EoG.efl_class_new(desc, bk, il[0], il[1], nul); + case 3: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], nul); + case 4: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], nul); + case 5: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], nul); + case 6: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], nul); + case 7: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], nul); + case 8: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], nul); + case 9: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], nul); + case 10: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], nul); + case 11: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], nul); + case 12: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], nul); + case 13: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], nul); + case 14: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], nul); + case 15: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], nul); + case 16: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], nul); + case 17: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], nul); + case 18: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], nul); + case 19: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], nul); + case 20: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], nul); + case 21: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], nul); + case 22: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], nul); + case 23: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], nul); + case 24: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], nul); + case 25: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], nul); + case 26: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], nul); + case 27: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], nul); + case 28: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], nul); + case 29: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], nul); + case 30: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], nul); + case 31: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], nul); + case 32: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], nul); + case 33: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], nul); + case 34: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], nul); + case 35: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], nul); + case 36: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], nul); + case 37: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], nul); + case 38: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], nul); + case 39: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], nul); + case 40: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], nul); + case 41: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], nul); + case 42: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], nul); + case 43: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], nul); + case 44: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], nul); + case 45: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], nul); + case 46: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], il[45], nul); + case 47: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], il[45], il[46], nul); + case 48: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], il[45], il[46], il[47], nul); } } - public static IntPtr instantiate_start(IntPtr klass, Efl.Object parent) + + public static IntPtr instantiate_start(IntPtr klass, Efl.Object parent, + [CallerFilePath] string file = null, + [CallerLineNumber] int line = 0) { Eina.Log.Debug($"Instantiating from klass 0x{klass.ToInt64():x}"); - Console.WriteLine($"Instantiating from klass 0x{klass.ToInt64():x}"); System.IntPtr parent_ptr = System.IntPtr.Zero; - if(parent != null) + if (parent != null) + { parent_ptr = parent.NativeHandle; + } - System.IntPtr eo = Efl.Eo.Globals._efl_add_internal_start("file", 0, klass, parent_ptr, 1, 0); + System.IntPtr eo = Efl.Eo.Globals._efl_add_internal_start(file, line, klass, parent_ptr, 1, 0); if (eo == System.IntPtr.Zero) { throw new Exception("Instantiation failed"); } - - Console.WriteLine($"Eo instance right after internal_start 0x{eo.ToInt64():x} with refcount {Efl.Eo.Globals.efl_ref_count(eo)}"); - Console.WriteLine($"Parent was 0x{parent_ptr.ToInt64()}"); + + Eina.Log.Debug($"Eo instance right after internal_start 0x{eo.ToInt64():x} with refcount {Efl.Eo.Globals.efl_ref_count(eo)}"); + Eina.Log.Debug($"Parent was 0x{parent_ptr.ToInt64()}"); return eo; } - public static IntPtr instantiate_end(IntPtr eo) { + public static IntPtr instantiate_end(IntPtr eo) + { Eina.Log.Debug("calling efl_add_internal_end"); eo = Efl.Eo.Globals._efl_add_end(eo, 1, 0); Eina.Log.Debug($"efl_add_end returned eo 0x{eo.ToInt64():x}"); return eo; } - public static void data_set(Efl.Eo.IWrapper obj) + + public static void PrivateDataSet(Efl.Eo.IWrapper obj) { - Eina.Log.Debug($"Calling data_scope_get with obj {obj.NativeHandle.ToInt64():x} and klass {obj.NativeClass.ToInt64():x}"); - IntPtr pd = Efl.Eo.Globals.efl_data_scope_get(obj.NativeHandle, obj.NativeClass); - { - GCHandle gch = GCHandle.Alloc(obj); - EolianPD epd; - epd.pointer = GCHandle.ToIntPtr(gch); - Marshal.StructureToPtr(epd, pd, false); - } + Eina.Log.Debug($"Calling data_scope_get with obj {obj.NativeHandle.ToInt64():x} and klass {obj.NativeClass.ToInt64():x}"); + IntPtr pd = Efl.Eo.Globals.efl_data_scope_get(obj.NativeHandle, obj.NativeClass); + { + GCHandle gch = GCHandle.Alloc(obj); + EolianPD epd; + epd.pointer = GCHandle.ToIntPtr(gch); + Marshal.StructureToPtr(epd, pd, false); + } } - public static Efl.Eo.IWrapper data_get(IntPtr pd) + + public static Efl.Eo.IWrapper PrivateDataGet(IntPtr pd) { EolianPD epd = (EolianPD)Marshal.PtrToStructure(pd, typeof(EolianPD)); - if(epd.pointer != IntPtr.Zero) + if (epd.pointer != IntPtr.Zero) { GCHandle gch = GCHandle.FromIntPtr(epd.pointer); return (Efl.Eo.IWrapper)gch.Target; } else + { return null; - } - - public static IntPtr cached_string_to_intptr(Dictionary dict, String str) - { - IntPtr ptr = IntPtr.Zero; - - if (str == null) - return ptr; - - if (!dict.TryGetValue(str, out ptr)) - { - ptr = Eina.StringConversion.ManagedStringToNativeUtf8Alloc(str); - dict[str] = ptr; } - - return ptr; - } - - public static IntPtr cached_stringshare_to_intptr(Dictionary dict, String str) - { - IntPtr ptr = IntPtr.Zero; - - if (str == null) - return ptr; - - if (!dict.TryGetValue(str, out ptr)) - { - ptr = Eina.Stringshare.eina_stringshare_add(str); - dict[str] = ptr; - } - - return ptr; } public static void free_dict_values(Dictionary dict) { - foreach(IntPtr ptr in dict.Values) + foreach (IntPtr ptr in dict.Values) { Eina.MemoryNative.Free(ptr); } @@ -423,7 +508,7 @@ public class Globals { public static void free_stringshare_values(Dictionary dict) { - foreach(IntPtr ptr in dict.Values) + foreach (IntPtr ptr in dict.Values) { Eina.Stringshare.eina_stringshare_del(ptr); } @@ -444,47 +529,207 @@ public class Globals { // Flag to be passed to the cancell callback bool fulfilled = false; - future.Then((Eina.Value received) => { - lock (future) + future.Then((Eina.Value received) => + { + lock (future) + { + // Convert an failed Future to a failed Task. + if (received.GetValueType() == Eina.ValueType.Error) { - // 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) { - Eina.Error err; - received.Get(out err); - if (err == Eina.Error.ECANCELED) - tcs.SetCanceled(); - else - tcs.TrySetException(new Efl.FutureException(received)); + tcs.SetCanceled(); } else { - // Will mark the returned task below as completed. - tcs.SetResult(received); + tcs.TrySetException(new Efl.FutureException(received)); } - fulfilled = true; - return 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) + token.Register(() => + { + lock (future) + { + // Will trigger the Then callback above with an Eina.Error + if (!fulfilled) { - // Will trigger the Then callback above with an Eina.Error - if (!fulfilled) - future.Cancel(); + future.Cancel(); } + } }); return tcs.Task; } + + /// Returns whether the given type was generated by eolian-mono + /// The type to check. + /// True if generated by eolian-mono. False otherwise. + private static bool IsGeneratedClass(System.Type managedType) + { + return GetNativeClass(managedType) != null; + } + + /// Creates a new wrapper for the given Eo id. + /// + /// If the Eo was created from a non-generated class (i.e. C#-pure class), it returns + /// the C# instance handle stored in the Eo's private data. + /// + /// For generated-class Eo instance, we use reflection to get the correct C# type to re-wrap + /// it. + /// + /// + /// The Eo id to be wrapped. + /// Whether we should increase the refcount of the Eo instance. + /// The C# wrapper for this instance. + public static Efl.Eo.IWrapper CreateWrapperFor(System.IntPtr handle, bool shouldIncRef=true) + { + + if (handle == IntPtr.Zero) + { + return null; + } + + IntPtr eoKlass = efl_class_get(handle); + + if (eoKlass == IntPtr.Zero) + { + throw new InvalidOperationException($"Can't get Eo class for object handle 0x{handle.ToInt64():x}"); + } + + var managedType = ClassRegister.GetManagedType(eoKlass); + + if (managedType == null) + { + IntPtr nativeName = efl_class_name_get(eoKlass); + var name = Eina.StringConversion.NativeUtf8ToManagedString(nativeName); + + throw new InvalidOperationException($"Can't get Managed class for object handle 0x{handle.ToInt64():x} with native class [{name}]"); + } + + // Pure C# classes that inherit from generated classes store their C# instance in their + // Eo private data field. + if (!IsGeneratedClass(managedType)) + { + Efl.Eo.IWrapper instance = null; + IntPtr pd = efl_data_scope_get(handle, eoKlass); + + if (pd != IntPtr.Zero) + { + instance = PrivateDataGet(pd); + } + + return instance; + } + + System.Reflection.ConstructorInfo constructor = null; + + try + { + var flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; + constructor = managedType.GetConstructor(flags, null, new Type[1] { typeof(System.IntPtr) }, null); + } + catch (InvalidOperationException) + { + throw new InvalidOperationException($"Can't get constructor for type {managedType}"); + } + + var ret = constructor.Invoke(new object[1] { handle }) as Efl.Eo.IWrapper; + + if (ret != null && shouldIncRef) + Efl.Eo.Globals.efl_ref(handle); + + return ret; + } + + private static Efl.FreeGCHandleCb FreeGCHandleCallbackDelegate = new Efl.FreeGCHandleCb(FreeGCHandleCallback); + public static void FreeGCHandleCallback(IntPtr gcHandlePtr) + { + try + { + GCHandle gcHandle = GCHandle.FromIntPtr(gcHandlePtr); + gcHandle.Free(); + } + catch (Exception e) + { + Eina.Log.Error(e.ToString()); + Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + } + } + + private static Efl.RemoveEventsCb RemoveEventsCallbackDelegate = new Efl.RemoveEventsCb(RemoveEventsCallback); + public static void RemoveEventsCallback(IntPtr obj, IntPtr gcHandlePtr) + { + try + { + GCHandle gcHandle = GCHandle.FromIntPtr(gcHandlePtr); + var eoEvents = gcHandle.Target as Dictionary<(IntPtr desc, object evtDelegate), (IntPtr evtCallerPtr, Efl.EventCb evtCaller)>; + if (eoEvents == null) + { + Eina.Log.Error($"Invalid event dictionary [GCHandle pointer: {gcHandlePtr}]"); + return; + } + + foreach (var item in eoEvents) + { + if (!efl_event_callback_del(obj, item.Key.desc, item.Value.evtCallerPtr, IntPtr.Zero)) + { + Eina.Log.Error($"Failed to remove event proxy for event {item.Key.desc} [cb: {item.Value.evtCallerPtr}]"); + } + } + } + catch (Exception e) + { + Eina.Log.Error(e.ToString()); + Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + } + } + + public static void SetNativeDisposeCallbacks() + { + efl_mono_gchandle_callbacks_set(FreeGCHandleCallbackDelegate, RemoveEventsCallbackDelegate); + } + + public static void ThreadSafeFreeCbExec(EinaFreeCb cbFreeCb, IntPtr cbData) + { + EinaFreeCb cb = (IntPtr gcHandlePtr) => { + cbFreeCb(cbData); + GCHandle gcHandle = GCHandle.FromIntPtr(gcHandlePtr); + gcHandle.Free(); + }; + + Monitor.Enter(Efl.All.InitLock); + if (Efl.All.MainLoopInitialized) + { + IntPtr cbPtr = Marshal.GetFunctionPointerForDelegate(cb); + var handle = GCHandle.Alloc(cb); + var handlePtr = GCHandle.ToIntPtr(handle); + + efl_mono_thread_safe_free_cb_exec(cbPtr, handlePtr); + } + Monitor.Exit(Efl.All.InitLock); + } + } // Globals public static class Config { + public static void Init() { Globals.efl_object_init(); + Globals.SetNativeDisposeCallbacks(); } public static void Shutdown() @@ -496,7 +741,7 @@ public static class Config [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, AllowMultiple = false, - Inherited = true) + Inherited = false) ] public abstract class NativeClass : System.Attribute { @@ -504,6 +749,22 @@ public abstract class NativeClass : System.Attribute public abstract System.Collections.Generic.List GetEoOps(System.Type type); } +/// Attribute for private native classes. +/// +/// For internal usage by generated code only. +public class PrivateNativeClass : NativeClass +{ + public override IntPtr GetEflClass() + { + return IntPtr.Zero; + } + + public override System.Collections.Generic.List GetEoOps(System.Type type) + { + return null; + } +} + public interface IWrapper { /// Pointer to internal Eo instance. @@ -511,13 +772,193 @@ public interface IWrapper { get; } + /// Pointer to internal Eo class. - IntPtr NativeClass + IntPtr NativeClass { get; } } +public static class ClassRegister +{ + public static System.Type GetManagedType(IntPtr klass) + { + System.Type t; + if (Efl.Eo.ClassRegister.typeFromKlass.TryGetValue(klass, out t)) + { + return t; + } + + // If it isn't on the dictionary then it is a Native binding class + IntPtr namePtr = Efl.Eo.Globals.efl_class_name_get(klass); + if (namePtr == IntPtr.Zero) + { + throw new System.InvalidOperationException($"Could not get Native class name. Handle: {klass}"); + } + + string name = Eina.StringConversion.NativeUtf8ToManagedString(namePtr) + .Replace("_", ""); // Convert Efl C name to C# name + + var klass_type = Efl.Eo.Globals.efl_class_type_get(klass); + + // Check if this is an internal implementation of an abstract class + var abstract_impl_suffix = "Realized"; + if (name.EndsWith(abstract_impl_suffix)) + { + name = name.Substring(0, name.Length - abstract_impl_suffix.Length); + var lastDot = name.LastIndexOf("."); + var klassName = name.Substring(lastDot + 1); + name += "+" + klassName + abstract_impl_suffix; // '+' is the separator for nested classes + } + + // When converting to managed, interfaces and mixins gets the 'I' prefix. + if (klass_type == Efl.Eo.Globals.EflClassType.Interface || klass_type == Efl.Eo.Globals.EflClassType.Mixin) + { + var pos = name.LastIndexOf("."); + name = name.Insert(pos + 1, "I"); // -1 if not found, inserts at 0 normally + } + + var curr_asm = typeof(IWrapper).Assembly; + t = curr_asm.GetType(name); + if (t == null) + { + foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) + { + if (assembly == curr_asm) + { + continue; + } + + t = assembly.GetType(name); + if (t != null) + { + break; + } + } + + if (t == null) + { + return typeof(Efl.Object); + } + } + + AddToKlassTypeBiDictionary(klass, t); // Cache it in the dictionary + return t; + } + + public static IntPtr GetKlass(System.Type objectType) + { + IntPtr klass; + if (klassFromType.TryGetValue(objectType, out klass)) + { + return klass; + } + + // Check if it is a Native binding class + klass = GetNativeKlassPtr(objectType); + if (klass != IntPtr.Zero) + { + // Add to the dictionary cache + AddToKlassTypeBiDictionary(klass, objectType); + return klass; + } + + // Unregistered Inherited class, let's register it + IntPtr baseKlass = GetNativeBaseKlassPtr(objectType); + if (baseKlass == IntPtr.Zero) + { + throw new System.InvalidOperationException($"Could not get base C# binding class for Inherited type: {objectType.FullName}"); + } + + return RegisterKlass(baseKlass, objectType); + } + + public static IntPtr GetInheritKlassOrRegister(IntPtr baseKlass, System.Type objectType) + { + IntPtr klass; + if (klassFromType.TryGetValue(objectType, out klass)) + { + return klass; + } + + return RegisterKlass(baseKlass, objectType); + } + + private static IntPtr RegisterKlass(IntPtr baseKlass, System.Type objectType) + { + lock (klassAllocLock) + { + IntPtr newKlass = Efl.Eo.Globals.register_class(objectType.FullName, baseKlass, objectType); + if (newKlass == IntPtr.Zero) + { + throw new System.InvalidOperationException($"Failed to register class '{objectType.FullName}'"); + } + + AddToKlassTypeBiDictionary(newKlass, objectType); + return newKlass; + } + } + + private static IntPtr GetNativeBaseKlassPtr(System.Type objectType) + { + for (System.Type t = objectType.BaseType; t != null; t = t.BaseType) + { + var ptr = GetNativeKlassPtr(t); + if (ptr != IntPtr.Zero) + { + return ptr; + } + } + + throw new System.InvalidOperationException($"Class '{objectType.FullName}' is not an Efl object"); + } + + private static IntPtr GetNativeKlassPtr(System.Type objectType) + { + if (objectType == null) + { + return IntPtr.Zero; + } + + if (objectType.IsInterface) + { + // Try to get the *Concrete class + var assembly = objectType.Assembly; + objectType = assembly.GetType(objectType.FullName + "Concrete"); + + if (objectType == null) + { + return IntPtr.Zero; + } + } + + var method = objectType.GetMethod("GetEflClassStatic", + System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic); + + if (method == null) + { + return IntPtr.Zero; + } + + return (IntPtr)(method.Invoke(null, null)); + } + + public static void AddToKlassTypeBiDictionary(IntPtr klassPtr, System.Type objectType) + { + klassFromType[objectType] = klassPtr; + typeFromKlass[klassPtr] = objectType; + } + + public static System.Collections.Concurrent.ConcurrentDictionary klassFromType + = new System.Collections.Concurrent.ConcurrentDictionary(); + + public static System.Collections.Concurrent.ConcurrentDictionary typeFromKlass + = new System.Collections.Concurrent.ConcurrentDictionary(); + + private static readonly object klassAllocLock = new object(); +} + public interface IOwnershipTag { } @@ -530,235 +971,346 @@ public class NonOwnTag : IOwnershipTag { } -public class MarshalTest : ICustomMarshaler +public class MarshalEo : ICustomMarshaler where U : IOwnershipTag { public static ICustomMarshaler GetInstance(string cookie) { - Eina.Log.Debug("MarshalTest.GetInstace cookie " + cookie); - return new MarshalTest(); + Eina.Log.Debug("MarshalEo.GetInstace cookie " + cookie); + return new MarshalEo(); } + public void CleanUpManagedData(object ManagedObj) { - //Eina.Log.Warning("MarshalTest.CleanUpManagedData not implemented"); + //Eina.Log.Warning("MarshalEo.CleanUpManagedData not implemented"); //throw new NotImplementedException(); } public void CleanUpNativeData(IntPtr pNativeData) { - //Eina.Log.Warning("MarshalTest.CleanUpNativeData not implemented"); + //Eina.Log.Warning("MarshalEo.CleanUpNativeData not implemented"); //throw new NotImplementedException(); } public int GetNativeDataSize() { - Eina.Log.Debug("MarshalTest.GetNativeDataSize"); + Eina.Log.Debug("MarshalEo.GetNativeDataSize"); return 0; //return 8; } public IntPtr MarshalManagedToNative(object ManagedObj) { - Eina.Log.Debug("MarshalTest.MarshallManagedToNative"); + Eina.Log.Debug("MarshalEo.MarshallManagedToNative"); + + if (ManagedObj == null) + { + return IntPtr.Zero; + } + var r = ((IWrapper)ManagedObj).NativeHandle; if (typeof(U) == typeof(OwnTag)) + { Efl.Eo.Globals.efl_ref(r); + } + return r; } public object MarshalNativeToManaged(IntPtr pNativeData) { - Eina.Log.Debug("MarshalTest.MarshalNativeToManaged"); - if (typeof(U) != typeof(OwnTag)) - Efl.Eo.Globals.efl_ref(pNativeData); - return Activator.CreateInstance(typeof(T), new System.Object[] {pNativeData}); -// return null; + return Efl.Eo.Globals.CreateWrapperFor(pNativeData, shouldIncRef : typeof(U) != typeof(OwnTag)); } } -public class StringPassOwnershipMarshaler : ICustomMarshaler { - public object MarshalNativeToManaged(IntPtr pNativeData) { +///Marshals between System.Type instances and Eo classes (IntPtrs). +public class MarshalEflClass : ICustomMarshaler +{ + public static ICustomMarshaler GetInstance(string cookie) + { + Eina.Log.Debug("MarshalEflClass.GetInstance cookie " + cookie); + return new MarshalEflClass(); + } + + public void CleanUpManagedData(object ManagedObj) + { + } + + public void CleanUpNativeData(IntPtr pNativeData) + { + } + + public int GetNativeDataSize() + { + Eina.Log.Debug("MarshalEflClass.GetNativeDataSize"); + return 0; + } + + public IntPtr MarshalManagedToNative(object ManagedObj) + { + Eina.Log.Debug("MarshalEflClass.MarshallManagedToNative"); + if (ManagedObj == null) + { + return IntPtr.Zero; + } + + var t = (System.Type)ManagedObj; + return Efl.Eo.ClassRegister.GetKlass(t); + } + + public object MarshalNativeToManaged(IntPtr pNativeData) + { + Eina.Log.Debug("MarshalEflClass.MarshalNativeToManaged"); + if (pNativeData == IntPtr.Zero) + { + return null; + } + + return Efl.Eo.ClassRegister.GetManagedType(pNativeData); + } +} + +public class StringPassOwnershipMarshaler : ICustomMarshaler +{ + public object MarshalNativeToManaged(IntPtr pNativeData) + { var ret = Eina.StringConversion.NativeUtf8ToManagedString(pNativeData); Eina.MemoryNative.Free(pNativeData); return ret; } - public IntPtr MarshalManagedToNative(object managedObj) { + public IntPtr MarshalManagedToNative(object managedObj) + { return Eina.MemoryNative.StrDup((string)managedObj); } - public void CleanUpNativeData(IntPtr pNativeData) { + public void CleanUpNativeData(IntPtr pNativeData) + { // No need to cleanup. C will take care of it. } - public void CleanUpManagedData(object managedObj) { + public void CleanUpManagedData(object managedObj) + { } - public int GetNativeDataSize() { + public int GetNativeDataSize() + { return -1; } - public static ICustomMarshaler GetInstance(string cookie) { - if (marshaler == null) { + public static ICustomMarshaler GetInstance(string cookie) + { + if (marshaler == null) + { marshaler = new StringPassOwnershipMarshaler(); } + return marshaler; } + static private StringPassOwnershipMarshaler marshaler; } -public class StringKeepOwnershipMarshaler: ICustomMarshaler { - public object MarshalNativeToManaged(IntPtr pNativeData) { +public class StringKeepOwnershipMarshaler: ICustomMarshaler +{ + public object MarshalNativeToManaged(IntPtr pNativeData) + { return Eina.StringConversion.NativeUtf8ToManagedString(pNativeData); } - public IntPtr MarshalManagedToNative(object managedObj) { + public IntPtr MarshalManagedToNative(object managedObj) + { return Eina.StringConversion.ManagedStringToNativeUtf8Alloc((string)managedObj); } - public void CleanUpNativeData(IntPtr pNativeData) { + public void CleanUpNativeData(IntPtr pNativeData) + { // No need to free. The Native side will keep the ownership. } - public void CleanUpManagedData(object managedObj) { + public void CleanUpManagedData(object managedObj) + { } - public int GetNativeDataSize() { + public int GetNativeDataSize() + { return -1; } - public static ICustomMarshaler GetInstance(string cookie) { - if (marshaler == null) { + public static ICustomMarshaler GetInstance(string cookie) + { + if (marshaler == null) + { marshaler = new StringKeepOwnershipMarshaler(); } + return marshaler; } + static private StringKeepOwnershipMarshaler marshaler; } -public class StringsharePassOwnershipMarshaler : ICustomMarshaler { - public object MarshalNativeToManaged(IntPtr pNativeData) { +public class StringsharePassOwnershipMarshaler : ICustomMarshaler +{ + public object MarshalNativeToManaged(IntPtr pNativeData) + { var ret = Eina.StringConversion.NativeUtf8ToManagedString(pNativeData); Eina.Stringshare.eina_stringshare_del(pNativeData); return ret; } - public IntPtr MarshalManagedToNative(object managedObj) { + public IntPtr MarshalManagedToNative(object managedObj) + { return Eina.Stringshare.eina_stringshare_add((string)managedObj); } - public void CleanUpNativeData(IntPtr pNativeData) { + public void CleanUpNativeData(IntPtr pNativeData) + { // No need to free as it's for own() parameters. } - public void CleanUpManagedData(object managedObj) { + public void CleanUpManagedData(object managedObj) + { } - public int GetNativeDataSize() { + public int GetNativeDataSize() + { return -1; } - public static ICustomMarshaler GetInstance(string cookie) { - if (marshaler == null) { + public static ICustomMarshaler GetInstance(string cookie) + { + if (marshaler == null) + { marshaler = new StringsharePassOwnershipMarshaler(); } + return marshaler; } + static private StringsharePassOwnershipMarshaler marshaler; } -public class StringshareKeepOwnershipMarshaler : ICustomMarshaler { - public object MarshalNativeToManaged(IntPtr pNativeData) { +public class StringshareKeepOwnershipMarshaler : ICustomMarshaler +{ + public object MarshalNativeToManaged(IntPtr pNativeData) + { return Eina.StringConversion.NativeUtf8ToManagedString(pNativeData); } - public IntPtr MarshalManagedToNative(object managedObj) { + public IntPtr MarshalManagedToNative(object managedObj) + { return Eina.Stringshare.eina_stringshare_add((string)managedObj); } - public void CleanUpNativeData(IntPtr pNativeData) { + public void CleanUpNativeData(IntPtr pNativeData) + { // No need to free, as the native side will keep ownership. } - public void CleanUpManagedData(object managedObj) { + public void CleanUpManagedData(object managedObj) + { } - public int GetNativeDataSize() { + public int GetNativeDataSize() + { return -1; } - public static ICustomMarshaler GetInstance(string cookie) { - if (marshaler == null) { + public static ICustomMarshaler GetInstance(string cookie) + { + if (marshaler == null) + { marshaler = new StringshareKeepOwnershipMarshaler(); } + return marshaler; } + static private StringshareKeepOwnershipMarshaler marshaler; } -public class StrbufPassOwnershipMarshaler : ICustomMarshaler { - public object MarshalNativeToManaged(IntPtr pNativeData) { +public class StrbufPassOwnershipMarshaler : ICustomMarshaler +{ + public object MarshalNativeToManaged(IntPtr pNativeData) + { return new Eina.Strbuf(pNativeData, Eina.Ownership.Managed); } - public IntPtr MarshalManagedToNative(object managedObj) { + public IntPtr MarshalManagedToNative(object managedObj) + { Eina.Strbuf buf = managedObj as Eina.Strbuf; buf.ReleaseOwnership(); return buf.Handle; } - public void CleanUpNativeData(IntPtr pNativeData) { + public void CleanUpNativeData(IntPtr pNativeData) + { // No need to cleanup. C will take care of it. } - public void CleanUpManagedData(object managedObj) { + public void CleanUpManagedData(object managedObj) + { } - public int GetNativeDataSize() { + public int GetNativeDataSize() + { return -1; } - public static ICustomMarshaler GetInstance(string cookie) { - if (marshaler == null) { + 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) { +public class StrbufKeepOwnershipMarshaler: ICustomMarshaler +{ + public object MarshalNativeToManaged(IntPtr pNativeData) + { return new Eina.Strbuf(pNativeData, Eina.Ownership.Unmanaged); } - public IntPtr MarshalManagedToNative(object managedObj) { + public IntPtr MarshalManagedToNative(object managedObj) + { Eina.Strbuf buf = managedObj as Eina.Strbuf; return buf.Handle; } - public void CleanUpNativeData(IntPtr pNativeData) { + public void CleanUpNativeData(IntPtr pNativeData) + { // No need to free. The Native side will keep the ownership. } - public void CleanUpManagedData(object managedObj) { + public void CleanUpManagedData(object managedObj) + { } - public int GetNativeDataSize() { + public int GetNativeDataSize() + { return -1; } - public static ICustomMarshaler GetInstance(string cookie) { - if (marshaler == null) { + public static ICustomMarshaler GetInstance(string cookie) + { + if (marshaler == null) + { marshaler = new StrbufKeepOwnershipMarshaler(); } + return marshaler; } + static private StrbufKeepOwnershipMarshaler marshaler; } - - } // namespace eo /// General exception for errors inside the binding. @@ -780,7 +1332,10 @@ public class FutureException : EflException 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; diff --git a/src/bindings/mono/eo_mono/meson.build b/src/bindings/mono/eo_mono/meson.build index 4fbdf51360..8aca4004df 100644 --- a/src/bindings/mono/eo_mono/meson.build +++ b/src/bindings/mono/eo_mono/meson.build @@ -1,4 +1,12 @@ mono_files += files( 'iwrapper.cs', - 'workaround.cs' + 'workaround.cs', + 'FunctionWrapper.cs', + 'NativeModule.cs' ) + +if host_machine.system() == 'windows' + mono_files += files('FunctionWrapper_Windows.cs', 'NativeModule_Windows.cs') +else + mono_files += files('FunctionWrapper_Unix.cs', 'NativeModule_Unix.cs') +endif diff --git a/src/bindings/mono/eo_mono/workaround.cs b/src/bindings/mono/eo_mono/workaround.cs index 99fb53b7e4..e32c921862 100644 --- a/src/bindings/mono/eo_mono/workaround.cs +++ b/src/bindings/mono/eo_mono/workaround.cs @@ -51,28 +51,35 @@ public struct EolianPD } #pragma warning disable 0169 + public struct EvasObjectBoxLayout { IntPtr o; IntPtr priv; IntPtr user_data; }; + [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)] public struct EvasObjectBoxData { } -public struct EvasObjectBoxOption { + +public struct EvasObjectBoxOption +{ IntPtr obj; [MarshalAsAttribute(UnmanagedType.U1)] bool max_reached; [MarshalAsAttribute(UnmanagedType.U1)] bool min_reached; Evas.Coord alloc_size; }; + #pragma warning restore 0169 -namespace Efl { +namespace Efl +{ [StructLayout(LayoutKind.Sequential)] -public struct EventDescription { +public struct EventDescription +{ public IntPtr Name; [MarshalAs(UnmanagedType.U1)] public bool Unfreezable; [MarshalAs(UnmanagedType.U1)] public bool Legacy_is; @@ -80,34 +87,40 @@ public struct EventDescription { private static Dictionary descriptions = new Dictionary(); - public EventDescription(string name) + public EventDescription(string module, string name) { - this.Name = GetNative(name); + this.Name = GetNative(module, name); this.Unfreezable = false; this.Legacy_is = false; this.Restart = false; } - public static IntPtr GetNative(string name) + public static IntPtr GetNative(string module, string name) { if (!descriptions.ContainsKey(name)) { - IntPtr data = Efl.Eo.Globals.dlsym(Efl.Eo.Globals.RTLD_DEFAULT, name); + IntPtr data = Efl.Eo.FunctionInterop.LoadFunctionPointer(module, name); - if (data == IntPtr.Zero) { + if (data == IntPtr.Zero) + { string error = Eina.StringConversion.NativeUtf8ToManagedString(Efl.Eo.Globals.dlerror()); throw new Exception(error); } + descriptions.Add(name, data); } + return descriptions[name]; } }; -public delegate void EventCb(System.IntPtr data, ref Event_StructInternal evt); +public delegate void EventCb(System.IntPtr data, ref Event.NativeStruct evt); +public delegate void FreeGCHandleCb(System.IntPtr gcHandle); +public delegate void RemoveEventsCb(System.IntPtr obj, System.IntPtr gcHandle); [StructLayout(LayoutKind.Sequential)] -public struct TextCursorCursor { +public struct TextCursorCursor +{ IntPtr obj; UIntPtr pos; // UIntPtr to automatically change size_t between 32/64 IntPtr node; @@ -115,7 +128,8 @@ public struct TextCursorCursor { } [StructLayout(LayoutKind.Sequential)] -public struct TextAnnotateAnnotation { +public struct TextAnnotateAnnotation +{ IntPtr list; IntPtr obj; IntPtr start_node; @@ -125,9 +139,11 @@ public struct TextAnnotateAnnotation { public delegate void SignalCb(IntPtr data, IntPtr obj, IntPtr emission, IntPtr source); -namespace Access { +namespace Access +{ -public struct ActionData { +public struct ActionData +{ public IntPtr name; public IntPtr action; public IntPtr param; @@ -138,16 +154,25 @@ public struct ActionData { } // namespace Efl -namespace Evas { +namespace Evas +{ -public struct Coord { +public struct Coord +{ int val; - public Coord(int value) { val = value; } - static public implicit operator Coord(int val) { + public Coord(int value) + { + val = value; + } + + static public implicit operator Coord(int val) + { return new Coord(val); } - static public implicit operator int(Coord coord) { + + static public implicit operator int(Coord coord) + { return coord.val; } } @@ -155,44 +180,44 @@ public struct Coord { /* Copied from Evas_Legacy.h */ public enum TextStyleType { - /// plain, standard text. - Plain = 0, - /// text with shadow underneath. - Shadow, - /// text with an outline. - Outline, - /// text with a soft outline. - SoftOutline, - /// text with a glow effect. - Glow, - /// text with both outline and shadow effects. - OutlineShadow, - /// text with (far) shadow underneath. - FarShadow, - /// text with outline and soft shadow effects combined. - OutlineSoftShadow, - /// text with (soft) shadow underneath. - SoftShadow, - /// text with (far soft) shadow underneath. - FarSoftShadow, + /// plain, standard text. + Plain = 0, + /// text with shadow underneath. + Shadow, + /// text with an outline. + Outline, + /// text with a soft outline. + SoftOutline, + /// text with a glow effect. + Glow, + /// text with both outline and shadow effects. + OutlineShadow, + /// text with (far) shadow underneath. + FarShadow, + /// text with outline and soft shadow effects combined. + OutlineSoftShadow, + /// text with (soft) shadow underneath. + SoftShadow, + /// text with (far soft) shadow underneath. + FarSoftShadow, - // Shadow direction modifiers - /// shadow growing to bottom right. - ShadowDirectionBottomRight = 0 /* 0 >> 4 */, - /// shadow growing to the bottom. - ShadowDirectionBottom= 16 /* 1 >> 4 */, - /// shadow growing to bottom left. - ShadowDirectionBottomLeft = 32 /* 2 >> 4 */, - /// shadow growing to the left. - ShadowDirectionLeft = 48 /* 3 >> 4 */, - /// shadow growing to top left. - ShadowDirectionTopLeft = 64 /* 4 >> 4 */, - /// shadow growing to the top. - ShadowDirectionTop = 80 /* 5 >> 4 */, - /// shadow growing to top right. - ShadowDirectionTopRight = 96 /* 6 >> 4 */, - /// shadow growing to the right. - ShadowDirectionRight = 112 /* 7 >> 4 */ + // Shadow direction modifiers + /// shadow growing to bottom right. + ShadowDirectionBottomRight = 0 /* 0 >> 4 */, + /// shadow growing to the bottom. + ShadowDirectionBottom = 16 /* 1 >> 4 */, + /// shadow growing to bottom left. + ShadowDirectionBottomLeft = 32 /* 2 >> 4 */, + /// shadow growing to the left. + ShadowDirectionLeft = 48 /* 3 >> 4 */, + /// shadow growing to top left. + ShadowDirectionTopLeft = 64 /* 4 >> 4 */, + /// shadow growing to the top. + ShadowDirectionTop = 80 /* 5 >> 4 */, + /// shadow growing to top right. + ShadowDirectionTopRight = 96 /* 6 >> 4 */, + /// shadow growing to the right. + ShadowDirectionRight = 112 /* 7 >> 4 */ }; } // namespace Evas @@ -201,8 +226,8 @@ public enum TextStyleType public delegate int Eina_Compare_Cb(IntPtr a, IntPtr b); public delegate void ElmInterfaceScrollableCb(IntPtr obj, IntPtr data); public delegate void ElmInterfaceScrollableMinLimitCb(IntPtr obj, - [MarshalAsAttribute(UnmanagedType.U1)]bool w, - [MarshalAsAttribute(UnmanagedType.U1)]bool h); + [MarshalAsAttribute(UnmanagedType.U1)]bool w, + [MarshalAsAttribute(UnmanagedType.U1)]bool h); public delegate void ElmInterfaceScrollableResizeCb(IntPtr obj, Evas.Coord w, Evas.Coord h); [return: MarshalAsAttribute(UnmanagedType.U1)] public delegate bool ElmMultibuttonentryItemFilterCb(IntPtr obj, IntPtr item_label, IntPtr item_data, IntPtr data); diff --git a/src/bindings/mono/meson.build b/src/bindings/mono/meson.build index b9d6879998..e7c5e00d9a 100644 --- a/src/bindings/mono/meson.build +++ b/src/bindings/mono/meson.build @@ -1,5 +1,33 @@ add_languages('cs') + +runtime_assemblies = [] + +# Check if we should use dotnet options +cs_is_dotnet = meson.get_compiler('cs').get_id().contains('dotnet') + +if (cs_is_dotnet) + +warning('Dotnet support is still not upstream in meson.') + +runtime_assemblies += [ + '-r:System.Console.dll', + '-r:Microsoft.CSharp.dll', + '-r:System.Collections.dll', + '-r:System.Collections.Concurrent.dll', + '-r:System.ComponentModel.Primitives.dll', + '-r:System.ComponentModel.Primitives.dll', + '-r:System.Diagnostics.Debug.dll', + '-r:System.Diagnostics.TraceSource.dll', + '-r:System.Dynamic.Runtime.dll', + '-r:System.Linq.dll', + '-r:System.Runtime.dll', + '-r:System.Runtime.Extensions.dll', + '-r:System.Security.dll', +] + +endif + mono_sublibs = [ ['Eina', true, ], # ['Eolian', true, ], # @@ -9,11 +37,11 @@ mono_sublibs = [ ['Evas', false, ], # ['Edje', false, ], # ['Eldbus', true, ], # - ['Ecore_Evas', true, ], # ['Elementary', false, ] # ] blacklisted_files = [ + 'efl_class.eo', 'efl_canvas_text.eo', 'efl_canvas_scene3d.eo', 'evas_canvas3d_camera.eo', @@ -34,7 +62,6 @@ blacklisted_files = [ 'efl_vg_root_node.eo', 'efl_vg_shape.eo.cs', 'efl_io_buffer.eo', - 'efl_io_positioner.eo', 'efl_io_queue.eo', 'efl_io_sizer.eo', 'efl_io_closer_fd.eo', @@ -57,13 +84,18 @@ blacklisted_files = [ 'elm_view_list.eo', 'elm_genlist_item.eo', 'elm_gengrid.eo', - 'elm_glview.eo.cs' + 'elm_glview_eo.cs', + 'elm_code_widget.eo', + 'elm_multibuttonentry_part.eo', + 'elm_atspi_bridge.eo', + 'elm_atspi_app_object.eo', ] efl_mono_lib = library('eflcustomexportsmono', join_paths('..', '..', 'lib', 'efl_mono', 'efl_custom_exports_mono.c'), install : true, - dependencies : [eo, eina] + install_dir : join_paths(dir_lib, 'efl-mono-'+version_major), + dependencies : [eo, eina, ecore] ) beta_option = [] @@ -95,6 +127,7 @@ foreach lib : mono_sublibs command : [eolian_mono_gen, beta_option, '-I', meson.current_source_dir(), eolian_include_directories, '--dllimport', package_name, '-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'), + '-e', get_option('mono-examples-dir'), '@INPUT@']) endif endforeach @@ -105,18 +138,6 @@ foreach lib : mono_sublibs endif endforeach -legacy_evas_required_by_mono = ['evas_box.eo', 'evas_image.eo', 'evas_table.eo', 'evas_text.eo'] -subdir_file_location = join_paths('..', '..', 'lib', 'evas', 'canvas') -foreach mono_gen_file : legacy_evas_required_by_mono - mono_generator_target += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'', - input : join_paths(subdir_file_location, mono_gen_file), - output : [mono_gen_file + '.cs'], - command : [eolian_mono_gen, beta_option, '-I', meson.current_source_dir(), eolian_include_directories, - '--dllimport', 'evas', - '-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'), - '@INPUT@']) -endforeach - efl_mono_conf_data = configuration_data() efl_mono_conf_data.set('EINA', eina_lib.full_path()) efl_mono_conf_data.set('EFL', efl_lib.full_path()) @@ -126,16 +147,30 @@ efl_mono_conf_data.set('EVAS', evas_lib.full_path()) efl_mono_conf_data.set('ELDBUS', eldbus_lib.full_path()) efl_mono_conf_data.set('ELEMENTARY', elementary_lib.full_path()) -configure_file(input : 'efl_mono.dll.config.in', - output : 'efl_mono.dll.config', - configuration : efl_mono_conf_data) +efl_mono_dll_config = configure_file(input : 'efl_mono.dll.config.in', + output : 'efl_mono.dll.config', + configuration : efl_mono_conf_data) + +extra_cs_args = runtime_assemblies + +if get_option('mono-beta') + extra_cs_args += '-d:EFL_BETA' +endif + +efl_mono_install_dir = join_paths(dir_lib, 'efl-mono-'+version_major) +efl_mono_xml_doc = join_paths(meson.current_build_dir(), 'efl_mono.xml') efl_mono = library('efl_mono', mono_generator_target + mono_files + [efl_src], install : true, - install_dir : join_paths(dir_lib, 'efl-mono-'+version_major) + install_dir : efl_mono_install_dir, + cs_args : extra_cs_args + ['-doc:' + efl_mono_xml_doc] ) +meson.add_install_script(join_paths(meson.source_root(), 'meson', 'meson_csharp_docs.sh'), + efl_mono_xml_doc, + efl_mono_install_dir) + efl_mono_test_suite_path=join_paths(meson.current_build_dir()) pkgconfig.generate( diff --git a/src/examples/ecore/ecore_evas_vnc_example.c b/src/examples/ecore/ecore_evas_vnc_example.c index c3d1ac7cfd..2796771a9c 100644 --- a/src/examples/ecore/ecore_evas_vnc_example.c +++ b/src/examples/ecore/ecore_evas_vnc_example.c @@ -1,4 +1,3 @@ -#define EFL_EO_API_SUPPORT #define EFL_BETA_API_SUPPORT #include diff --git a/src/examples/ecore/ecore_evas_wayland_multiseat_example.c b/src/examples/ecore/ecore_evas_wayland_multiseat_example.c index 3aec0fa524..dc1d537478 100644 --- a/src/examples/ecore/ecore_evas_wayland_multiseat_example.c +++ b/src/examples/ecore/ecore_evas_wayland_multiseat_example.c @@ -1,4 +1,3 @@ -#define EFL_EO_API_SUPPORT #define EFL_BETA_API_SUPPORT #include diff --git a/src/examples/ecore/ecore_fd_handler_gnutls_example.c b/src/examples/ecore/ecore_fd_handler_gnutls_example.c index 6cd5ba1eb1..30fd6bcce2 100644 --- a/src/examples/ecore/ecore_fd_handler_gnutls_example.c +++ b/src/examples/ecore/ecore_fd_handler_gnutls_example.c @@ -108,7 +108,7 @@ tcp_connect(void) memset(&sa, '\0', sizeof (sa)); sa.sin_family = AF_INET; - sa.sin_port = htons(atoi(PORT)); + sa.sin_port = eina_htons(atoi(PORT)); inet_pton(AF_INET, SERVER, &sa.sin_addr); /* connects to server diff --git a/src/examples/ecore/ecore_promise2_example.c b/src/examples/ecore/ecore_promise2_example.c index 7ddb426b1a..a88b1ff13e 100644 --- a/src/examples/ecore/ecore_promise2_example.c +++ b/src/examples/ecore/ecore_promise2_example.c @@ -1,3 +1,4 @@ +#define EFL_BETA_API_SUPPORT 1 #include #include #include @@ -58,7 +59,7 @@ _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 = efl_loop_promise_new(loop, NULL); + ctx->p = efl_loop_promise_new(loop); EINA_SAFETY_ON_NULL_GOTO(ctx->p, err_timer); ctx->value = v; return ctx; diff --git a/src/examples/ecore/efl_exe.c b/src/examples/ecore/efl_exe.c new file mode 100644 index 0000000000..f435bcadd2 --- /dev/null +++ b/src/examples/ecore/efl_exe.c @@ -0,0 +1,69 @@ +#define EFL_BETA_API_SUPPORT + +#include +#include + +#include +#include +#include + +static void _read_change(void *data EINA_UNUSED, const Efl_Event *ev); +static Eina_Value _task_exit(void *data, Eina_Value v, const Eina_Future *dead EINA_UNUSED); + +static void +_read_change(void *data EINA_UNUSED, const Efl_Event *ev) +{ + // read output from exe status changed - read what we can + Eo *obj = ev->object; + char buf[4096]; + Eina_Rw_Slice rw_slice = EINA_SLICE_ARRAY(buf); + + while (efl_io_reader_can_read_get(obj)) + { + Eina_Error err = efl_io_reader_read(obj, &rw_slice); + if (!err) + { + buf[rw_slice.len] = 0; + printf("--- READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf); + } + } +} + +static Eina_Value +_task_exit(void *data, Eina_Value v, const Eina_Future *dead EINA_UNUSED) +{ + // called when the task says it has completed and exited. + // all output to read has stopped + Eo *obj = data; + printf("--- [%p] EXITED exit_code=%i\n", obj, efl_task_exit_code_get(obj)); + efl_loop_quit(efl_provider_find(obj, EFL_LOOP_CLASS), eina_value_int_init(99)); + efl_del(obj); + return v; +} + +EAPI_MAIN void +efl_main(void *data EINA_UNUSED, const Efl_Event *ev) +{ + Eo *app = ev->object; + + const Efl_Version *v = efl_app_build_efl_version_get(app); + printf("--- EFL %i.%i.%i\n", v->major, v->minor, v->micro); + Eina_Array *args = eina_array_new(1); + eina_array_push(args, eina_stringshare_add("./efl_exe_test.sh")); + Eo *env = efl_duplicate(efl_env_self()); + efl_core_env_set(env, "BLAH", "blahvalue"); + Eo *obj = efl_add(EFL_EXE_CLASS, app, + efl_core_command_line_command_array_set(efl_added, args), + efl_exe_env_set(efl_added, env), + efl_task_flags_set(efl_added, EFL_TASK_FLAGS_USE_STDOUT | EFL_TASK_FLAGS_USE_STDIN), + efl_event_callback_add(efl_added, EFL_IO_READER_EVENT_CAN_READ_CHANGED, _read_change, NULL), + eina_future_then(efl_task_run(efl_added), _task_exit, efl_added) + ); + efl_unref(env); + + char *buf2 = "sample-input\n"; + Eina_Slice slice = { strlen(buf2), buf2 }; + Eina_Error err = efl_io_writer_write(obj, &slice, NULL); + if (!err) printf("--- WRITE [%p] [%s] ok %i bytes\n", obj, efl_core_command_line_command_get(obj), (int)slice.len); +} +EFL_MAIN() diff --git a/src/examples/ecore/efl_exe_test.sh b/src/examples/ecore/efl_exe_test.sh new file mode 100755 index 0000000000..a2f4db1e13 --- /dev/null +++ b/src/examples/ecore/efl_exe_test.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +echo "BLAH is $BLAH" +sleep 1 +read IN +sleep 1 +echo "INPUT is $IN" +sleep 1 +exit 7 diff --git a/src/examples/ecore/efl_io_buffered_stream_example.c b/src/examples/ecore/efl_io_buffered_stream_example.c index 3338bae396..1f816c7072 100644 --- a/src/examples/ecore/efl_io_buffered_stream_example.c +++ b/src/examples/ecore/efl_io_buffered_stream_example.c @@ -1,3 +1,4 @@ +#define EFL_BETA_API_SUPPORT #include #include @@ -235,7 +236,7 @@ efl_main(void *data EINA_UNUSED, /* The TCP client to use to send/receive network data */ 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)); + efl_event_callback_add(efl_added, EFL_NET_DIALER_EVENT_DIALER_CONNECTED, _dialer_connected, NULL)); if (!dialer) { fprintf(stderr, "ERROR: could not create Efl_Net_Dialer_Tcp\n"); diff --git a/src/examples/ecore/efl_io_copier_example.c b/src/examples/ecore/efl_io_copier_example.c index b7e526bd3c..d4e36b7070 100644 --- a/src/examples/ecore/efl_io_copier_example.c +++ b/src/examples/ecore/efl_io_copier_example.c @@ -1,3 +1,4 @@ +#define EFL_BETA_API_SUPPORT #include #include #include @@ -76,9 +77,9 @@ _dialer_connected(void *data EINA_UNUSED, const Efl_Event *event) } EFL_CALLBACKS_ARRAY_DEFINE(dialer_cbs, - { EFL_NET_DIALER_EVENT_RESOLVED, _dialer_resolved }, - { EFL_NET_DIALER_EVENT_ERROR, _dialer_error }, - { EFL_NET_DIALER_EVENT_CONNECTED, _dialer_connected }); + { EFL_NET_DIALER_EVENT_DIALER_RESOLVED, _dialer_resolved }, + { EFL_NET_DIALER_EVENT_DIALER_ERROR, _dialer_error }, + { EFL_NET_DIALER_EVENT_DIALER_CONNECTED, _dialer_connected }); static void _http_headers_done(void *data EINA_UNUSED, const Efl_Event *event) @@ -663,7 +664,7 @@ efl_main(void *data EINA_UNUSED, { /* regular file, open with flags: read-only and close-on-exec */ input = efl_add_ref(EFL_IO_FILE_CLASS, NULL, - efl_file_set(efl_added, input_fname, NULL), /* mandatory */ + efl_file_set(efl_added, input_fname), /* 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. */ efl_event_callback_array_add(efl_added, input_cbs(), NULL) /* optional */ @@ -939,7 +940,7 @@ efl_main(void *data EINA_UNUSED, * create if did not exist and truncate if exist. */ output = efl_add_ref(EFL_IO_FILE_CLASS, NULL, - efl_file_set(efl_added, output_fname, NULL), /* mandatory */ + efl_file_set(efl_added, output_fname), /* 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. */ efl_io_file_mode_set(efl_added, 0644), /* mandatory for write */ diff --git a/src/examples/ecore/efl_io_copier_simple_example.c b/src/examples/ecore/efl_io_copier_simple_example.c index ee945cce7b..0a1fd65297 100644 --- a/src/examples/ecore/efl_io_copier_simple_example.c +++ b/src/examples/ecore/efl_io_copier_simple_example.c @@ -1,3 +1,4 @@ +#define EFL_BETA_API_SUPPORT #include static void diff --git a/src/examples/ecore/efl_io_queue_example.c b/src/examples/ecore/efl_io_queue_example.c index 9367716729..7a22feb631 100644 --- a/src/examples/ecore/efl_io_queue_example.c +++ b/src/examples/ecore/efl_io_queue_example.c @@ -1,3 +1,4 @@ +#define EFL_BETA_API_SUPPORT #include #include @@ -304,7 +305,7 @@ efl_main(void *data EINA_UNUSED, /* The TCP client to use to send/receive network data */ dialer = efl_add(EFL_NET_DIALER_TCP_CLASS, loop, efl_name_set(efl_added, "dialer"), - efl_event_callback_add(efl_added, EFL_NET_DIALER_EVENT_CONNECTED, _dialer_connected, NULL)); + efl_event_callback_add(efl_added, EFL_NET_DIALER_EVENT_DIALER_CONNECTED, _dialer_connected, NULL)); if (!dialer) { fprintf(stderr, "ERROR: could not create Efl_Net_Dialer_Tcp\n"); diff --git a/src/examples/ecore/efl_mono_loop_timer_example.cs b/src/examples/ecore/efl_mono_loop_timer_example.cs index 8c692753a4..a6ad05b491 100644 --- a/src/examples/ecore/efl_mono_loop_timer_example.cs +++ b/src/examples/ecore/efl_mono_loop_timer_example.cs @@ -4,6 +4,7 @@ using System.Runtime.CompilerServices; class TestMain { +#if EFL_BETA private Efl.Loop loop; private int count; @@ -18,17 +19,15 @@ class TestMain Efl.All.Init(); var loop = new Efl.Loop(); - var timer = new Efl.LoopTimer(loop, (Efl.LoopTimer t) => { - t.SetInterval(1.0); - }); + var timer = new Efl.LoopTimer(loop, 1.0); TestMain listener = new TestMain(loop); Console.WriteLine("Starting MainLoop"); - timer.TickEvt += listener.on_tick; - timer.TickEvt += listener.another_callback; - timer.TickEvt -= listener.another_callback; + timer.TimerTickEvt += listener.on_tick; + timer.TimerTickEvt += listener.another_callback; + timer.TimerTickEvt -= listener.another_callback; loop.Begin(); @@ -50,6 +49,11 @@ class TestMain { Console.WriteLine("Ooops. Should not have been called..."); } +#else + public static void Main() + { + } +#endif } diff --git a/src/examples/ecore/efl_net_control_example.c b/src/examples/ecore/efl_net_control_example.c index 3053c87cad..408ea8e6c9 100644 --- a/src/examples/ecore/efl_net_control_example.c +++ b/src/examples/ecore/efl_net_control_example.c @@ -1,6 +1,7 @@ #ifdef HAVE_SYS_SOCKET_H #include #endif +#define EFL_BETA_API_SUPPORT #include #include #include diff --git a/src/examples/ecore/efl_net_dialer_http_example.c b/src/examples/ecore/efl_net_dialer_http_example.c index f1a97eefe9..1289fb01ba 100644 --- a/src/examples/ecore/efl_net_dialer_http_example.c +++ b/src/examples/ecore/efl_net_dialer_http_example.c @@ -1,3 +1,4 @@ +#define EFL_BETA_API_SUPPORT #include #include #include @@ -70,9 +71,9 @@ _http_headers_done(void *data EINA_UNUSED, const Efl_Event *event) EFL_CALLBACKS_ARRAY_DEFINE(dialer_cbs, { EFL_NET_DIALER_HTTP_EVENT_HEADERS_DONE, _http_headers_done }, - { EFL_NET_DIALER_EVENT_CONNECTED, _connected }, - { EFL_NET_DIALER_EVENT_RESOLVED, _resolved }, - { EFL_NET_DIALER_EVENT_ERROR, _error }, + { EFL_NET_DIALER_EVENT_DIALER_CONNECTED, _connected }, + { EFL_NET_DIALER_EVENT_DIALER_RESOLVED, _resolved }, + { EFL_NET_DIALER_EVENT_DIALER_ERROR, _error }, { EFL_IO_CLOSER_EVENT_CLOSED, _closed }, { EFL_IO_READER_EVENT_EOS, _eos }); @@ -320,7 +321,7 @@ efl_main(void *data EINA_UNUSED, { input = efl_add(EFL_IO_FILE_CLASS, loop, efl_name_set(efl_added, "input"), - efl_file_set(efl_added, input_fname, NULL), + efl_file_set(efl_added, input_fname), efl_io_file_flags_set(efl_added, O_RDONLY), 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. */ efl_event_callback_add(efl_added, EFL_IO_READER_EVENT_EOS, _eos, NULL)); @@ -335,7 +336,7 @@ efl_main(void *data EINA_UNUSED, { output = efl_add(EFL_IO_FILE_CLASS, loop, efl_name_set(efl_added, "output"), - efl_file_set(efl_added, output_fname, NULL), + efl_file_set(efl_added, output_fname), efl_io_file_mode_set(efl_added, 0644), efl_io_file_flags_set(efl_added, O_WRONLY | O_TRUNC | O_CREAT), 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. */ diff --git a/src/examples/ecore/efl_net_dialer_simple_example.c b/src/examples/ecore/efl_net_dialer_simple_example.c index 219da892f1..40243cc11f 100644 --- a/src/examples/ecore/efl_net_dialer_simple_example.c +++ b/src/examples/ecore/efl_net_dialer_simple_example.c @@ -1,3 +1,4 @@ +#define EFL_BETA_API_SUPPORT #include #include #include @@ -175,8 +176,8 @@ _done(void *data EINA_UNUSED, const Efl_Event *event) } EFL_CALLBACKS_ARRAY_DEFINE(dialer_cbs, - { EFL_NET_DIALER_EVENT_CONNECTED, _connected }, /* optional */ - { EFL_NET_DIALER_EVENT_RESOLVED, _resolved }, /* optional */ + { EFL_NET_DIALER_EVENT_DIALER_CONNECTED, _connected }, /* optional */ + { EFL_NET_DIALER_EVENT_DIALER_RESOLVED, _resolved }, /* optional */ { EFL_IO_READER_EVENT_CAN_READ_CHANGED, _can_read }, /* optional, can be used to read data, here just for monitoring */ { EFL_IO_READER_EVENT_EOS, _eos }, /* recommended, notifies no more incoming data */ { EFL_IO_BUFFERED_STREAM_EVENT_LINE, _line }, /* optional, could use 'slice,changed' or 'can_read,changed' instead */ diff --git a/src/examples/ecore/efl_net_dialer_udp_example.c b/src/examples/ecore/efl_net_dialer_udp_example.c index 3b13a60ca7..3fef035eef 100644 --- a/src/examples/ecore/efl_net_dialer_udp_example.c +++ b/src/examples/ecore/efl_net_dialer_udp_example.c @@ -1,3 +1,4 @@ +#define EFL_BETA_API_SUPPORT #include #include #include @@ -155,9 +156,9 @@ _error(void *data EINA_UNUSED, const Efl_Event *event) } EFL_CALLBACKS_ARRAY_DEFINE(dialer_cbs, - { EFL_NET_DIALER_EVENT_CONNECTED, _connected }, - { EFL_NET_DIALER_EVENT_RESOLVED, _resolved }, - { EFL_NET_DIALER_EVENT_ERROR, _error }, + { EFL_NET_DIALER_EVENT_DIALER_CONNECTED, _connected }, + { EFL_NET_DIALER_EVENT_DIALER_RESOLVED, _resolved }, + { EFL_NET_DIALER_EVENT_DIALER_ERROR, _error }, { EFL_IO_READER_EVENT_CAN_READ_CHANGED, _can_read }, { EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, _can_write } ); diff --git a/src/examples/ecore/efl_net_dialer_unix_example.c b/src/examples/ecore/efl_net_dialer_unix_example.c index b610dd42a6..8cfb2213e1 100644 --- a/src/examples/ecore/efl_net_dialer_unix_example.c +++ b/src/examples/ecore/efl_net_dialer_unix_example.c @@ -1,3 +1,4 @@ +#define EFL_BETA_API_SUPPORT #include #include #include @@ -107,9 +108,9 @@ _error(void *data EINA_UNUSED, const Efl_Event *event) } EFL_CALLBACKS_ARRAY_DEFINE(dialer_cbs, - { EFL_NET_DIALER_EVENT_CONNECTED, _connected }, - { EFL_NET_DIALER_EVENT_RESOLVED, _resolved }, - { EFL_NET_DIALER_EVENT_ERROR, _error }, + { EFL_NET_DIALER_EVENT_DIALER_CONNECTED, _connected }, + { EFL_NET_DIALER_EVENT_DIALER_RESOLVED, _resolved }, + { EFL_NET_DIALER_EVENT_DIALER_ERROR, _error }, { EFL_IO_READER_EVENT_EOS, _eos }, { EFL_IO_READER_EVENT_CAN_READ_CHANGED, _can_read }, { EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, _can_write } diff --git a/src/examples/ecore/efl_net_dialer_websocket_autobahntestee.c b/src/examples/ecore/efl_net_dialer_websocket_autobahntestee.c index fd0c09818c..45a3ed2ae4 100644 --- a/src/examples/ecore/efl_net_dialer_websocket_autobahntestee.c +++ b/src/examples/ecore/efl_net_dialer_websocket_autobahntestee.c @@ -1,3 +1,4 @@ +#define EFL_BETA_API_SUPPORT #include #include #include @@ -246,8 +247,8 @@ EFL_CALLBACKS_ARRAY_DEFINE(dialer_cbs, { EFL_NET_DIALER_WEBSOCKET_EVENT_CLOSED_REASON, _ws_closed_reason }, { EFL_NET_DIALER_WEBSOCKET_EVENT_MESSAGE_TEXT, _ws_message_text }, { EFL_NET_DIALER_WEBSOCKET_EVENT_MESSAGE_BINARY, _ws_message_binary }, - { EFL_NET_DIALER_EVENT_CONNECTED, _connected }, - { EFL_NET_DIALER_EVENT_ERROR, _error }, + { EFL_NET_DIALER_EVENT_DIALER_CONNECTED, _connected }, + { EFL_NET_DIALER_EVENT_DIALER_ERROR, _error }, { EFL_IO_CLOSER_EVENT_CLOSED, _closed }, { EFL_IO_READER_EVENT_EOS, _eos }, { EFL_EVENT_DEL, _del }); diff --git a/src/examples/ecore/efl_net_dialer_websocket_example.c b/src/examples/ecore/efl_net_dialer_websocket_example.c index e0b72e4991..a74323b3db 100644 --- a/src/examples/ecore/efl_net_dialer_websocket_example.c +++ b/src/examples/ecore/efl_net_dialer_websocket_example.c @@ -1,3 +1,4 @@ +#define EFL_BETA_API_SUPPORT #include #include #include @@ -144,9 +145,9 @@ EFL_CALLBACKS_ARRAY_DEFINE(dialer_cbs, { EFL_NET_DIALER_WEBSOCKET_EVENT_CLOSED_REASON, _ws_closed_reason }, { EFL_NET_DIALER_WEBSOCKET_EVENT_MESSAGE_TEXT, _ws_message_text }, { EFL_NET_DIALER_WEBSOCKET_EVENT_MESSAGE_BINARY, _ws_message_binary }, - { EFL_NET_DIALER_EVENT_CONNECTED, _connected }, - { EFL_NET_DIALER_EVENT_RESOLVED, _resolved }, - { EFL_NET_DIALER_EVENT_ERROR, _error }, + { EFL_NET_DIALER_EVENT_DIALER_CONNECTED, _connected }, + { EFL_NET_DIALER_EVENT_DIALER_RESOLVED, _resolved }, + { EFL_NET_DIALER_EVENT_DIALER_ERROR, _error }, { EFL_IO_CLOSER_EVENT_CLOSED, _closed }, { EFL_IO_READER_EVENT_EOS, _eos }); diff --git a/src/examples/ecore/efl_net_dialer_windows_example.c b/src/examples/ecore/efl_net_dialer_windows_example.c index 44daab0bfa..e5be598eac 100644 --- a/src/examples/ecore/efl_net_dialer_windows_example.c +++ b/src/examples/ecore/efl_net_dialer_windows_example.c @@ -106,9 +106,9 @@ _error(void *data EINA_UNUSED, const Efl_Event *event) } EFL_CALLBACKS_ARRAY_DEFINE(dialer_cbs, - { EFL_NET_DIALER_EVENT_CONNECTED, _connected }, - { EFL_NET_DIALER_EVENT_RESOLVED, _resolved }, - { EFL_NET_DIALER_EVENT_ERROR, _error }, + { EFL_NET_DIALER_EVENT_DIALER_CONNECTED, _connected }, + { EFL_NET_DIALER_EVENT_DIALER_RESOLVED, _resolved }, + { EFL_NET_DIALER_EVENT_DIALER_ERROR, _error }, { EFL_IO_READER_EVENT_EOS, _eos }, { EFL_IO_READER_EVENT_CAN_READ_CHANGED, _can_read }, { EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, _can_write } diff --git a/src/examples/ecore/efl_net_ip_address_example.c b/src/examples/ecore/efl_net_ip_address_example.c index ee1595b6c3..b2bc9c6675 100644 --- a/src/examples/ecore/efl_net_ip_address_example.c +++ b/src/examples/ecore/efl_net_ip_address_example.c @@ -1,5 +1,4 @@ #define EFL_BETA_API_SUPPORT 1 -#define EFL_EO_API_SUPPORT 1 #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -43,13 +42,13 @@ _print_ip_addr_info(const Eo *o) { struct sockaddr_in *a = (struct sockaddr_in *)sa; inet_ntop(sa->sa_family, &a->sin_addr, buf, sizeof(buf)); - port = ntohs(a->sin_port); + port = eina_ntohs(a->sin_port); } else { struct sockaddr_in6 *a = (struct sockaddr_in6 *)sa; inet_ntop(sa->sa_family, &a->sin6_addr, buf, sizeof(buf)); - port = ntohs(a->sin6_port); + port = eina_ntohs(a->sin6_port); } printf("INFO: - sockaddr=%p (%d, '%s', %u)\n", @@ -123,7 +122,7 @@ main(int argc, char *argv[]) for (i = 1; i < argc; i++) { const char *address = argv[i]; - Eo *o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, address); + Eo *o = efl_net_ip_address_parse( address); if (o) { _print_ip_addr_info(o); @@ -131,7 +130,7 @@ main(int argc, char *argv[]) } else { - Eina_Future *f = efl_net_ip_address_resolve(EFL_NET_IP_ADDRESS_CLASS, address, 0, 0); + Eina_Future *f = efl_net_ip_address_resolve( 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 d98e66bb35..4c3f200339 100644 --- a/src/examples/ecore/efl_net_server_example.c +++ b/src/examples/ecore/efl_net_server_example.c @@ -1,3 +1,4 @@ +#define EFL_BETA_API_SUPPORT #include #include #include @@ -449,7 +450,7 @@ _server_serving(void *data EINA_UNUSED, const Efl_Event *event) EFL_CALLBACKS_ARRAY_DEFINE(server_cbs, { EFL_NET_SERVER_EVENT_CLIENT_ADD, _server_client_add }, { EFL_NET_SERVER_EVENT_CLIENT_REJECTED, _server_client_rejected }, - { EFL_NET_SERVER_EVENT_ERROR, _server_error }, + { EFL_NET_SERVER_EVENT_SERVER_ERROR, _server_error }, { EFL_NET_SERVER_EVENT_SERVING, _server_serving }); static const char * protocols[] = { diff --git a/src/examples/ecore/efl_net_server_simple_example.c b/src/examples/ecore/efl_net_server_simple_example.c index a68e9b9fb9..36a2d8c06d 100644 --- a/src/examples/ecore/efl_net_server_simple_example.c +++ b/src/examples/ecore/efl_net_server_simple_example.c @@ -1,3 +1,4 @@ +#define EFL_BETA_API_SUPPORT #include #include #include @@ -253,7 +254,7 @@ _server_serving(void *data EINA_UNUSED, const Efl_Event *event) EFL_CALLBACKS_ARRAY_DEFINE(server_cbs, { EFL_NET_SERVER_EVENT_CLIENT_ADD, _server_client_add }, { EFL_NET_SERVER_EVENT_CLIENT_REJECTED, _server_client_rejected }, - { EFL_NET_SERVER_EVENT_ERROR, _server_error }, + { EFL_NET_SERVER_EVENT_SERVER_ERROR, _server_error }, { EFL_NET_SERVER_EVENT_SERVING, _server_serving }); static const char * protocols[] = { diff --git a/src/examples/ecore/efl_net_session_example.c b/src/examples/ecore/efl_net_session_example.c index 683f3414e0..fbefb21791 100644 --- a/src/examples/ecore/efl_net_session_example.c +++ b/src/examples/ecore/efl_net_session_example.c @@ -1,3 +1,4 @@ +#define EFL_BETA_API_SUPPORT #include #include 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 10cec47dda..1ade6bc9c2 100644 --- a/src/examples/ecore/efl_net_socket_ssl_dialer_example.c +++ b/src/examples/ecore/efl_net_socket_ssl_dialer_example.c @@ -1,3 +1,4 @@ +#define EFL_BETA_API_SUPPORT #include #include #include @@ -176,9 +177,9 @@ _error(void *data EINA_UNUSED, const Efl_Event *event) } EFL_CALLBACKS_ARRAY_DEFINE(dialer_cbs, - { EFL_NET_DIALER_EVENT_CONNECTED, _connected }, - { EFL_NET_DIALER_EVENT_RESOLVED, _resolved }, - { EFL_NET_DIALER_EVENT_ERROR, _error }); + { EFL_NET_DIALER_EVENT_DIALER_CONNECTED, _connected }, + { EFL_NET_DIALER_EVENT_DIALER_RESOLVED, _resolved }, + { EFL_NET_DIALER_EVENT_DIALER_ERROR, _error }); static char * @@ -464,7 +465,7 @@ efl_main(void *data EINA_UNUSED, efl_net_ssl_context_hostname_set(efl_added, hostname_override), efl_net_ssl_context_setup(efl_added, cipher, EINA_TRUE)); #else - ssl_ctx = efl_net_ssl_context_default_dialer_get(EFL_NET_SSL_CONTEXT_CLASS); + ssl_ctx = efl_net_ssl_context_default_dialer_get(); fprintf(stderr, "INFO: using default context for dialers.\n"); #endif 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 2babc8b6a0..6d826b6047 100644 --- a/src/examples/ecore/efl_net_socket_ssl_server_example.c +++ b/src/examples/ecore/efl_net_socket_ssl_server_example.c @@ -1,3 +1,4 @@ +#define EFL_BETA_API_SUPPORT #include #include #include @@ -152,7 +153,7 @@ _server_serving(void *data EINA_UNUSED, const Efl_Event *event) EFL_CALLBACKS_ARRAY_DEFINE(server_cbs, { EFL_NET_SERVER_EVENT_CLIENT_ADD, _server_client_add }, - { EFL_NET_SERVER_EVENT_ERROR, _server_error }, + { EFL_NET_SERVER_EVENT_SERVER_ERROR, _server_error }, { EFL_NET_SERVER_EVENT_SERVING, _server_serving }); static const char *ciphers_strs[] = { diff --git a/src/examples/ecore/efl_thread.c b/src/examples/ecore/efl_thread.c new file mode 100644 index 0000000000..0298be15d0 --- /dev/null +++ b/src/examples/ecore/efl_thread.c @@ -0,0 +1,192 @@ +#define EFL_BETA_API_SUPPORT + +#include +#include + +#include +#include +#include + +static void _th_read_change(void *data EINA_UNUSED, const Efl_Event *ev); +static void _th_main(void *data EINA_UNUSED, const Efl_Event *ev); +static void _read_change(void *data EINA_UNUSED, const Efl_Event *ev); +static Eina_Value _task_exit(void *data, Eina_Value v, const Eina_Future *dead EINA_UNUSED); + +//////////////////////////////////////////////////////////////////////////// +//// thread side of code +static void +_th_timeout(void *data EINA_UNUSED, const Efl_Event *ev) +{ + Eo *obj = data; + + printf("--- START EXIT [%p]\n", obj); + efl_threadio_outdata_set(obj, (void *)0x9876); + efl_loop_quit(obj, eina_value_int_init(99)); +} + +static void +_th_read_change(void *data EINA_UNUSED, const Efl_Event *ev) +{ + // read input from parent thread/loop status chnaged - read what we can + Eo *obj = ev->object; + char buf[4096]; + Eina_Rw_Slice rw_slice = EINA_SLICE_ARRAY(buf); + + while (efl_io_reader_can_read_get(obj)) + { + Eina_Error err = efl_io_reader_read(obj, &rw_slice); + if (!err) + { + buf[rw_slice.len] = 0; + printf("--- TH READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf); + + char *buf2 = "yes-im-here "; + Eina_Slice slice = { strlen(buf2), buf2 }; + Eina_Error err = efl_io_writer_write(obj, &slice, NULL); + if (!err) + { + Eina_Accessor *args_access = efl_core_command_line_command_access(obj); + printf("--- TH WRITE [%p] [%s] ok %i bytes\n", obj, efl_core_command_line_command_get(obj), (int)slice.len); + void *s = ""; + eina_accessor_data_get(args_access, 1, &s); + if (!strcmp(s, "one")) + efl_add(EFL_LOOP_TIMER_CLASS, obj, + efl_loop_timer_interval_set(efl_added, 2.0), + efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, _th_timeout, obj)); + else + efl_add(EFL_LOOP_TIMER_CLASS, obj, + efl_loop_timer_interval_set(efl_added, 1.0), + efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, _th_timeout, obj)); + eina_accessor_free(args_access); + } + } + } +} + +static void +_th_main(void *data EINA_UNUSED, const Efl_Event *ev) +{ + // the "main function" of the thread thayt gets called with arguments + // just like eflm_main for the main loop + Eo *obj = ev->object; + Eina_Accessor *args_access = efl_core_command_line_command_access(obj); + void *s = "", *ss = ""; + eina_accessor_data_get(args_access, 0, &s); + eina_accessor_data_get(args_access, 1, &ss); + printf("--- TH main %p, '%s' '%s' indata=%p\n", obj, s, ss, efl_threadio_indata_get(obj)); + efl_event_callback_add + (obj, EFL_IO_READER_EVENT_CAN_READ_CHANGED, _th_read_change, NULL); + if (!strcmp(s, "one")) + { + Eina_Array *args = eina_array_new(1); + eina_array_push(args, eina_stringshare_add("number")); + eina_array_push(args, eina_stringshare_add("one")); + Eo *obj2 = efl_add(EFL_THREAD_CLASS, obj, + efl_threadio_indata_set(efl_added, (void *)0x1234), + efl_core_command_line_command_array_set(efl_added, args), + efl_task_flags_set(efl_added, EFL_TASK_FLAGS_USE_STDOUT | EFL_TASK_FLAGS_USE_STDIN), + efl_event_callback_add(efl_added, EFL_LOOP_EVENT_ARGUMENTS, _th_main, NULL), + efl_event_callback_add(efl_added, EFL_IO_READER_EVENT_CAN_READ_CHANGED, _read_change, NULL), + eina_future_then(efl_task_run(efl_added), _task_exit, efl_added) + ); + + char *buf2 = "hello-out-there2 "; + Eina_Slice slice = { strlen(buf2), buf2 }; + Eina_Error err = efl_io_writer_write(obj2, &slice, NULL); + if (!err) printf("--- WRITE [%p] [%s] ok %i bytes\n", obj2, efl_core_command_line_command_get(obj), (int)slice.len); + } + eina_accessor_free(args_access); +} + +//////////////////////////////////////////////////////////////////////////// +//// main loop side of code +static void +_read_change(void *data EINA_UNUSED, const Efl_Event *ev) +{ + // read output from thread status chnaged - read what we can + Eo *obj = ev->object; + char buf[4096]; + Eina_Rw_Slice rw_slice = EINA_SLICE_ARRAY(buf); + + while (efl_io_reader_can_read_get(obj)) + { + Eina_Error err = efl_io_reader_read(obj, &rw_slice); + if (!err) + { + buf[rw_slice.len] = 0; + printf("--- READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf); + } + } +} + +static Eina_Value +_task_exit(void *data, Eina_Value v, const Eina_Future *dead EINA_UNUSED) +{ + // called when the task says it has completed and exited. + // all output to read has stopped + Eo *obj = data; + printf("--- [%p] EXITED exit_code=%i outdata=%p\n", obj, efl_task_exit_code_get(obj), efl_threadio_outdata_get(obj)); + efl_del(obj); + return v; +} + +//////////////////////////////////////////////////////////////////////////// +// just main loop input handling +static void +_stdin_read_change(void *data EINA_UNUSED, const Efl_Event *ev) +{ + // read output from thread status chnaged - read what we can + Eo *obj = ev->object; + char buf[4096]; + Eina_Rw_Slice rw_slice = EINA_SLICE_ARRAY(buf); + + while (efl_io_reader_can_read_get(obj)) + { + Eina_Error err = efl_io_reader_read(obj, &rw_slice); + if (!err) + { + buf[rw_slice.len] = 0; + printf("--- STDIN READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf); + } + } +} + +EAPI_MAIN void +efl_main(void *data EINA_UNUSED, const Efl_Event *ev) +{ + Eo *app = ev->object; + int threads = 2, i; + Eina_Accessor *args_access = efl_core_command_line_command_access(app); + void *s; + + const Efl_Version *v = efl_app_build_efl_version_get(app); + printf("--- EFL %i.%i.%i\n", v->major, v->minor, v->micro); + s = NULL; + eina_accessor_data_get(args_access, 2, &s); + if (s && (!strcmp(s, "-stdinwatch"))) + efl_event_callback_add(app, EFL_IO_READER_EVENT_CAN_READ_CHANGED, + _stdin_read_change, NULL); + s = NULL; + eina_accessor_data_get(args_access, 1, &s); + if (s) threads = atoi(s); + for (i = 0; i < threads; i++) + { + Eina_Array *args = eina_array_new(1); + eina_array_push(args, eina_stringshare_add("number")); + eina_array_push(args, eina_stringshare_add("one")); + Eo *obj = efl_add(EFL_THREAD_CLASS, app, + efl_threadio_indata_set(efl_added, (void *)0x5678), + efl_core_command_line_command_array_set(efl_added, args), + efl_task_flags_set(efl_added, EFL_TASK_FLAGS_USE_STDOUT | EFL_TASK_FLAGS_USE_STDIN), + efl_event_callback_add(efl_added, EFL_LOOP_EVENT_ARGUMENTS, _th_main, NULL), + efl_event_callback_add(efl_added, EFL_IO_READER_EVENT_CAN_READ_CHANGED, _read_change, NULL), + eina_future_then(efl_task_run(efl_added), _task_exit, efl_added) + ); + + char *buf2 = "hello-out-there "; + Eina_Slice slice = { strlen(buf2), buf2 }; + Eina_Error err = efl_io_writer_write(obj, &slice, NULL); + if (!err) printf("--- WRITE [%p] [%s] ok %i bytes\n", obj, efl_core_command_line_command_get(obj), (int)slice.len); + } +} +EFL_MAIN() diff --git a/src/examples/edje/animations.edc b/src/examples/edje/animations.edc index f25296fdb2..cfb5de09f7 100644 --- a/src/examples/edje/animations.edc +++ b/src/examples/edje/animations.edc @@ -68,8 +68,6 @@ collections { } program { name: "animation,state1"; - signal: "animation,start"; - source: ""; in: 1.0 0.0; action: STATE_SET "invert" 1.0; target: "part_one"; @@ -80,8 +78,6 @@ collections { } program { name: "animation,state2"; - signal: "animation,start"; - source: ""; in: 1.0 0.0; action: STATE_SET "default" 0.0; target: "part_one"; diff --git a/src/examples/edje/edje-swallow2.c b/src/examples/edje/edje-swallow2.c index fe3f95632d..c393ad811c 100644 --- a/src/examples/edje/edje-swallow2.c +++ b/src/examples/edje/edje-swallow2.c @@ -19,6 +19,11 @@ #define PACKAGE_DATA_DIR "." #endif +#ifndef PACKAGE_SOURCE_DATA_DIR +#define PACKAGE_SOURCE_DATA_DIR "." +#endif + + #include #include #include @@ -36,7 +41,7 @@ int main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED) { const char *edje_file = PACKAGE_DATA_DIR"/swallow.edj"; - const char *img_file = PACKAGE_DATA_DIR"/bubble.png"; + const char *img_file = PACKAGE_SOURCE_DATA_DIR"/bubble.png"; Ecore_Evas *ee; Evas *evas; Evas_Object *bg; diff --git a/src/examples/edje/meson.build b/src/examples/edje/meson.build index 0a8b159d0a..21910ad389 100644 --- a/src/examples/edje/meson.build +++ b/src/examples/edje/meson.build @@ -42,7 +42,8 @@ edc_files = [ 'table.edc', 'text.edc', 'textblock-hyphen.edc', - 'toggle_using_filter.edc' + 'toggle_using_filter.edc', + 'multisense.edc', ] if (get_option('physics')) @@ -62,7 +63,7 @@ foreach edc_file : edc_files themes += custom_target('edje_cc_' + edc_file, input : edc_file, output : '@BASENAME@.edj', - command : edje_cc_exe + [ '-beta', + command : edje_cc_exe + [ '-beta', '-fastcomp', '-id', meson.current_source_dir(), '-fd', meson.current_source_dir(), '-sd', meson.current_source_dir(), @@ -71,13 +72,13 @@ foreach edc_file : edc_files '-md', meson.current_source_dir(), '-td', meson.current_source_dir(), '@INPUT@', '@OUTPUT@'], - depends : edje_cc, ) + depends : edje_depends, ) endforeach codegen = custom_target('edje_cc_codegen_edc', input : 'codegen.edc', output : '@BASENAME@.edj', - command : edje_cc_exe + [ '-beta', + command : edje_cc_exe + [ '-beta', '-fastcomp', '-id', meson.current_source_dir(), '-fd', meson.current_source_dir(), '-sd', meson.current_source_dir(), @@ -86,13 +87,12 @@ codegen = custom_target('edje_cc_codegen_edc', '-md', meson.current_source_dir(), '-td', meson.current_source_dir(), '@INPUT@', '@OUTPUT@'], - depends : edje_cc, ) + depends : edje_depends, ) themes += custom_target('edje_codegen_codegen.edj', input : codegen, output : ['@BASENAME@_example_generated.c', '@BASENAME@_example_generated.h'], - command : ['/usr/bin/env', 'EFL_RUN_IN_TREE=1', edje_codegen.full_path(), - '--prefix=codegen_example', '@INPUT@', + command : edje_codegen_exe + [ '--prefix=codegen_example', '@INPUT@', 'example_group', '@OUTPUT0@', '@OUTPUT1@'], depends : [edje_codegen, themes]) @@ -131,6 +131,7 @@ foreach edje_example : edje_examples executable(edje_example, [edje_example + '.c'] + themes, dependencies: [edje, ecore_evas], - c_args: ['-DPACKAGE_DATA_DIR="'+ meson.current_build_dir()+'"',] + c_args: ['-DPACKAGE_DATA_DIR="'+ meson.current_build_dir()+'"', + '-DPACKAGE_SOURCE_DATA_DIR="'+ meson.current_source_dir()+'"',] ) endforeach diff --git a/src/examples/eina/eina_list_03.c b/src/examples/eina/eina_list_03.c index 2097954496..a7d942d6bd 100644 --- a/src/examples/eina/eina_list_03.c +++ b/src/examples/eina/eina_list_03.c @@ -17,14 +17,14 @@ main(int argc, char **argv) eina_init(); list = eina_list_append(list, "caprica"); - list = eina_list_append(list, "sagitarius"); + list = eina_list_append(list, "sagittarius"); list = eina_list_append(list, "aerilon"); list = eina_list_append(list, "gemenon"); list = eina_list_promote_list(list, eina_list_nth_list(list, 2)); list = eina_list_demote_list(list, eina_list_nth_list(list, 2)); - list = eina_list_remove(list, "sagitarius"); + list = eina_list_remove(list, "sagittarius"); l = eina_list_data_find_list(list, "aerilon"); eina_list_data_set(l, "aquarius"); diff --git a/src/examples/elementary.mk b/src/examples/elementary.mk index 0d817258dc..dcae89bb90 100644 --- a/src/examples/elementary.mk +++ b/src/examples/elementary.mk @@ -64,7 +64,7 @@ elementary/label_example_03.c \ elementary/layout_example_01.c \ elementary/layout_example_02.c \ elementary/layout_example_03.c \ -elementary/layout_model_connect.c \ +elementary/layout_property_bind.c \ elementary/list_example_01.c \ elementary/list_example_02.c \ elementary/list_example_03.c \ @@ -125,7 +125,9 @@ elementary/efl_ui_list_view_example_2.c \ elementary/efl_ui_list_view_example_3.c \ elementary/efl_canvas_layout_text.c \ elementary/efl_ui_theme_example_01.c \ -elementary/efl_ui_theme_example_02.c +elementary/efl_ui_theme_example_02.c \ +elementary/efl_ui_relative_layout_example_01.c \ +elementary/efl_ui_relative_layout_example_02.c ELM_SRCS += \ elementary/bg_cxx_example_01.cc \ @@ -283,7 +285,7 @@ elementary/label_example_03 \ elementary/layout_example_01 \ elementary/layout_example_02 \ elementary/layout_example_03 \ -elementary/layout_model_connect \ +elementary/layout_property_bind \ elementary/list_example_01 \ elementary/list_example_02 \ elementary/list_example_03 \ @@ -344,7 +346,9 @@ elementary/efl_ui_list_view_example_2 \ elementary/efl_ui_list_view_example_3 \ elementary/efl_canvas_layout_text \ elementary/efl_ui_theme_example_01 \ -elementary/efl_ui_theme_example_02 +elementary/efl_ui_theme_example_02 \ +elementary/efl_ui_relative_layout_example_01 \ +elementary/efl_ui_relative_layout_example_02 #benchmark3d #sphere-hunter diff --git a/src/examples/elementary/.gitignore b/src/examples/elementary/.gitignore index 54d71c14a0..06e20555aa 100644 --- a/src/examples/elementary/.gitignore +++ b/src/examples/elementary/.gitignore @@ -58,7 +58,7 @@ /layout_example_01 /layout_example_02 /layout_example_03 -/layout_model_connect +/layout_property_bind /list_example_01 /list_example_02 /list_example_03 @@ -169,3 +169,5 @@ /efl_ui_list_view_example_3 /efl_ui_theme_example_01 /efl_ui_theme_example_02 +/efl_ui_relative_layout_example_01 +/efl_ui_relative_layout_example_02 diff --git a/src/examples/elementary/bg_cxx_example_01.cc b/src/examples/elementary/bg_cxx_example_01.cc index 7e0724c3ca..1b3ae91736 100644 --- a/src/examples/elementary/bg_cxx_example_01.cc +++ b/src/examples/elementary/bg_cxx_example_01.cc @@ -1,4 +1,5 @@ #define EFL_CXXPERIMENTAL // for background part +#define EFL_BETA_API_SUPPORT #include using efl::eo::instantiate; @@ -10,7 +11,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}); - win.background().color_set(139, 69, 19, 255); + //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 71c3540d98..f88329d2eb 100644 --- a/src/examples/elementary/bg_cxx_example_02.cc +++ b/src/examples/elementary/bg_cxx_example_02.cc @@ -6,6 +6,7 @@ */ #define EFL_CXXPERIMENTAL +#define EFL_BETA_API_SUPPORT #include @@ -31,7 +32,8 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev) efl::ui::Bg bg(instantiate, win); bg.scale_type_set(EFL_GFX_IMAGE_SCALE_TYPE_FILL); - bg.file_set(path, nullptr); + bg.file_set(path); + bg.load(); win.content_set(bg); win.size_set({640, 400}); diff --git a/src/examples/elementary/button_cxx_example_00.cc b/src/examples/elementary/button_cxx_example_00.cc index d44f18a924..a0cdb1c566 100644 --- a/src/examples/elementary/button_cxx_example_00.cc +++ b/src/examples/elementary/button_cxx_example_00.cc @@ -1,6 +1,7 @@ // g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` button_cxx_example_00.cc -o button_cxx_example_00 #define EFL_CXXPERIMENTAL +#define EFL_BETA_API_SUPPORT #include #include diff --git a/src/examples/elementary/button_cxx_example_01.cc b/src/examples/elementary/button_cxx_example_01.cc index 7f85e19593..3136f6ac04 100644 --- a/src/examples/elementary/button_cxx_example_01.cc +++ b/src/examples/elementary/button_cxx_example_01.cc @@ -1,6 +1,7 @@ // g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` button_cxx_example_01.cc -o button_cxx_example_01 #define EFL_CXXPERIMENTAL +#define EFL_BETA_API_SUPPORT #include using efl::eo::instantiate; @@ -27,7 +28,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl::ui::Box box_initial(instantiate, win); box_initial.direction_set(EFL_UI_DIR_HORIZONTAL); - box_initial.hint_weight_set(EFL_GFX_SIZE_HINT_EXPAND, 0.0); + box_initial.hint_weight_set(EFL_GFX_HINT_EXPAND, 0.0); box.pack_end(box_initial); efl::ui::Button btn(instantiate, win); @@ -78,7 +79,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl::ui::Box box_gap(instantiate, win); box_gap.direction_set(EFL_UI_DIR_HORIZONTAL); - box_gap.hint_weight_set(EFL_GFX_SIZE_HINT_EXPAND, 0.0); + box_gap.hint_weight_set(EFL_GFX_HINT_EXPAND, 0.0); box.pack_end(box_gap); efl::ui::Button btn4(instantiate, win); @@ -99,7 +100,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) up.autorepeat_enabled_set(true); up.autorepeat_initial_timeout_set(1.0); up.autorepeat_gap_timeout_set(0.5); - up.hint_weight_set(EFL_GFX_SIZE_HINT_EXPAND, 0.0); + up.hint_weight_set(EFL_GFX_HINT_EXPAND, 0.0); up.hint_fill_set(true, false); up.hint_align_set(0.5, 0.0); box.pack_end(up); @@ -180,7 +181,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) left.autorepeat_enabled_set(true); left.autorepeat_initial_timeout_set(1.0); left.autorepeat_gap_timeout_set(0.5); - left.hint_weight_set(0.0, EFL_GFX_SIZE_HINT_EXPAND); + left.hint_weight_set(0.0, EFL_GFX_HINT_EXPAND); left.hint_fill_set(false, true); left.hint_align_set(0.0, 0.5); box_inferior.pack_end(left); @@ -200,7 +201,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) right.autorepeat_enabled_set(true); right.autorepeat_initial_timeout_set(1.0); right.autorepeat_gap_timeout_set(0.5); - right.hint_weight_set(0.0, EFL_GFX_SIZE_HINT_EXPAND); + right.hint_weight_set(0.0, EFL_GFX_HINT_EXPAND); right.hint_fill_set(false, true); right.hint_align_set(0.0, 0.5); box_inferior.pack_end(right); @@ -214,7 +215,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) down.autorepeat_enabled_set(true); down.autorepeat_initial_timeout_set(1.0); down.autorepeat_gap_timeout_set(0.5); - down.hint_weight_set(EFL_GFX_SIZE_HINT_EXPAND, 0.0); + down.hint_weight_set(EFL_GFX_HINT_EXPAND, 0.0); down.hint_fill_set(true, false); down.hint_align_set(0.5, 0.0); box.pack_end(down); diff --git a/src/examples/elementary/combobox_example_01.c b/src/examples/elementary/combobox_example_01.c index 186e17e68c..ca450b26a4 100644 --- a/src/examples/elementary/combobox_example_01.c +++ b/src/examples/elementary/combobox_example_01.c @@ -1,7 +1,8 @@ //Compile with: //gcc -o combobox_example_01 combobox_example_01.c -g `pkg-config --cflags --libs elementary` - -#define _GNU_SOURCE +#ifndef _GNU_SOURCE +# define _GNU_SOURCE +#endif #include #include diff --git a/src/examples/elementary/efl_canvas_layout_text.c b/src/examples/elementary/efl_canvas_layout_text.c index 8e89403d19..bb4fa7b97c 100644 --- a/src/examples/elementary/efl_canvas_layout_text.c +++ b/src/examples/elementary/efl_canvas_layout_text.c @@ -6,10 +6,10 @@ # include "elementary_config.h" #else # define EFL_BETA_API_SUPPORT 1 -# define EFL_EO_API_SUPPORT 1 #endif #include +#include #include #include @@ -37,17 +37,6 @@ static struct { EFL_TEXT_FORMAT_WRAP_MIXED, "mixed" } }; -static struct -{ - Efl_Text_Format_Wrap wrap; - const char *desc; -} group[] = -{ - { EFL_TEXT_FORMAT_WRAP_NONE, "none" }, - { EFL_TEXT_FORMAT_WRAP_WORD, "word" }, - { EFL_TEXT_FORMAT_WRAP_CHAR, "char" }, - { EFL_TEXT_FORMAT_WRAP_MIXED, "mixed" } -}; static struct { Efl_Canvas_Layout_Part_Text_Expand expand; @@ -88,7 +77,7 @@ _on_key_down(void *data, const Efl_Event *event) { // edje group group_itr = (group_itr + 1) % 2; - efl_file_set(layout, edjefile, groups[group_itr]); + efl_file_simple_load(layout, edjefile, groups[group_itr]); printf("Changed layout group to: %s\n", groups[group_itr]); } else if (!strcmp(key, "w")) @@ -125,21 +114,21 @@ _on_key_down(void *data, const Efl_Event *event) EAPI_MAIN void efl_main(void *data EINA_UNUSED, - const Efl_Event *ev) + const Efl_Event *ev EINA_UNUSED) { Eo *layout; Eo *win; win = efl_add(EFL_UI_WIN_CLASS, NULL, - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl Canvas_Layout"), efl_ui_win_autodel_set(efl_added, EINA_TRUE), efl_event_callback_add(efl_added, EFL_UI_WIN_EVENT_DELETE_REQUEST, _on_win_delete, NULL)); layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, win); - efl_file_set(layout, edjefile, groups[group_itr]); + efl_file_simple_load(layout, edjefile, groups[group_itr]); efl_content_set(win, layout); efl_gfx_entity_size_set(win, EINA_SIZE2D(110, 100)); diff --git a/src/examples/elementary/efl_ui_grid_example_1.c b/src/examples/elementary/efl_ui_grid_example_1.c index 257f5daf39..6fe455c904 100644 --- a/src/examples/elementary/efl_ui_grid_example_1.c +++ b/src/examples/elementary/efl_ui_grid_example_1.c @@ -4,9 +4,9 @@ #include "elementary_config.h" #else #define EFL_BETA_API_SUPPORT 1 -#define EFL_EO_API_SUPPORT 1 #endif +#include #include #include #include @@ -23,8 +23,8 @@ EoGenerate(const Efl_Class *klass, Eo *parent, Efl_Ui_Dir dir) { Eo* obj = efl_add(klass, parent); if (dir != EFL_UI_DIR_DEFAULT) efl_ui_direction_set(obj, dir); - efl_gfx_size_hint_weight_set(obj, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); - efl_gfx_size_hint_fill_set(obj, EINA_TRUE, EINA_TRUE); + efl_gfx_hint_weight_set(obj, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND); + efl_gfx_hint_fill_set(obj, EINA_TRUE, EINA_TRUE); return obj; } @@ -39,7 +39,7 @@ elm_main(int argc, char **argv) Grid_Event_Data *gd = calloc(sizeof(Grid_Event_Data *), 1); win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl.Ui.Grid"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); @@ -47,8 +47,8 @@ elm_main(int argc, char **argv) elm_win_resize_object_add(win, box); Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, box); - efl_gfx_size_hint_weight_set(btn, 0.3, 0.3); - efl_gfx_size_hint_fill_set(btn, EINA_TRUE, EINA_TRUE); + efl_gfx_hint_weight_set(btn, 0.3, 0.3); + efl_gfx_hint_fill_set(btn, EINA_TRUE, EINA_TRUE); efl_text_set(btn, "BUTTON"); efl_pack_end(box, btn); diff --git a/src/examples/elementary/efl_ui_list_example_1.c b/src/examples/elementary/efl_ui_list_example_1.c index c2bb8946dc..29475f98bf 100644 --- a/src/examples/elementary/efl_ui_list_example_1.c +++ b/src/examples/elementary/efl_ui_list_example_1.c @@ -5,9 +5,9 @@ # include "elementary_config.h" #else # define EFL_BETA_API_SUPPORT 1 -# define EFL_EO_API_SUPPORT 1 #endif +#include #include #include #include @@ -24,7 +24,7 @@ List_Scroll_Data priv_d; static void -_list_selected(void *data, const Efl_Event *ev) +_list_selected(void *data EINA_UNUSED, const Efl_Event *ev) { Eo *list = ev->object; Eo *item = ev->info, *tmp; @@ -39,28 +39,28 @@ _list_selected(void *data, const Efl_Event *ev) } static void -_list_unselected(void *data, const Efl_Event *ev) +_list_unselected(void *data EINA_UNUSED, const Efl_Event *ev) { 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")); } static void -_list_pressed(void *data, const Efl_Event *ev) +_list_pressed(void *data EINA_UNUSED, const Efl_Event *ev) { Eo *item = ev->info; printf("list item [%p : %d] is pressed\n", item, efl_ui_item_index_get(item)); } static void -_list_unpressed(void *data, const Efl_Event *ev) +_list_unpressed(void *data EINA_UNUSED, const Efl_Event *ev) { Eo *item = ev->info; printf("list item [%p : %d] is unpressed\n", item, efl_ui_item_index_get(item)); } static void -_list_longpressed(void *data, const Efl_Event *ev) +_list_longpressed(void *data EINA_UNUSED, const Efl_Event *ev) { Eo *item = ev->info; printf("list item [%p : %d] is longpressed\n", item, efl_ui_item_index_get(item)); @@ -74,13 +74,13 @@ _select_radio_changed(void *data, const Efl_Event *ev) } static void -_anim_radio_changed(void *data, const Efl_Event *ev) +_anim_radio_changed(void *data EINA_UNUSED, 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) +_scrl_btn_clicked(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) { 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); @@ -88,7 +88,7 @@ _scrl_btn_clicked(void *data, const Efl_Event *ev) } static void -_scrl_align_btn_clicked(void *data, const Efl_Event *ev) +_scrl_align_btn_clicked(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) { 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); @@ -97,7 +97,7 @@ _scrl_align_btn_clicked(void *data, const Efl_Event *ev) } EAPI_MAIN int -elm_main(int argc, char **argv) +elm_main(int argc EINA_UNUSED, char **argv) { Eo *win, *list; Eo *wbox, *ibox, *bbox, *rbox; @@ -115,18 +115,18 @@ elm_main(int argc, char **argv) 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_fill_set(wbox, EINA_TRUE, EINA_TRUE); + efl_gfx_hint_weight_set(wbox, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND); + efl_gfx_hint_fill_set(wbox, EINA_TRUE, EINA_TRUE); 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_gfx_hint_weight_set(list, EFL_GFX_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_ITEM_SELECTED, _list_selected, NULL); + efl_event_callback_add(list, EFL_UI_EVENT_ITEM_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); @@ -145,7 +145,7 @@ elm_main(int argc, char **argv) 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_gfx_hint_weight_set(txt, 0.95, EFL_GFX_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); @@ -153,7 +153,7 @@ elm_main(int argc, char **argv) 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_gfx_hint_weight_set(check, 0.05, EFL_GFX_HINT_EXPAND); efl_pack_end(ibox, check); if (i % 2) @@ -197,13 +197,13 @@ elm_main(int argc, char **argv) break; case 40: - efl_file_set(efl_part(item, "background"), "./sky_01.jpg", NULL); + efl_file_simple_load(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_file_simple_load(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; @@ -223,7 +223,7 @@ elm_main(int argc, char **argv) /*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_gfx_hint_weight_set(txt, EFL_GFX_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"); @@ -231,28 +231,28 @@ elm_main(int argc, char **argv) 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); + efl_gfx_hint_weight_set(bbox, EFL_GFX_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_ui_radio_state_value_set(radio, EFL_UI_SELECT_MODE_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_state_value_set(radio, EFL_UI_SELECT_MODE_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_state_value_set(radio, EFL_UI_SELECT_MODE_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_state_value_set(radio, EFL_UI_SELECT_MODE_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); @@ -260,7 +260,7 @@ elm_main(int argc, char **argv) /* 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_gfx_hint_weight_set(txt, EFL_GFX_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"); @@ -268,27 +268,27 @@ elm_main(int argc, char **argv) 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_gfx_hint_weight_set(slider, 0.0, 0.05); + efl_gfx_hint_align_set(slider, 0.5, 0.5); + efl_gfx_hint_size_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); + efl_gfx_hint_weight_set(bbox, EFL_GFX_HINT_EXPAND, 0.05); rbox = efl_add(EFL_UI_BOX_CLASS, bbox); efl_ui_direction_set(rbox, EFL_UI_DIR_VERTICAL); anim_radio = radio = efl_add(EFL_UI_RADIO_CLASS, rbox); - efl_gfx_size_hint_align_set(radio, 0.5, 0.5); + efl_gfx_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_gfx_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); @@ -301,15 +301,15 @@ elm_main(int argc, char **argv) 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_gfx_hint_align_set(scrl_btn, 0.5, 0.5); + efl_gfx_hint_size_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); 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_gfx_hint_align_set(scrl_btn, 0.5, 0.5); + efl_gfx_hint_size_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); diff --git a/src/examples/elementary/efl_ui_list_view_example.edc b/src/examples/elementary/efl_ui_list_view_example.edc index 75bafe1b83..1957fbf6a3 100644 --- a/src/examples/elementary/efl_ui_list_view_example.edc +++ b/src/examples/elementary/efl_ui_list_view_example.edc @@ -35,7 +35,7 @@ group { } program { signal: "efl,state,odd"; source: "efl"; - action: STATE_SET "odd" 1.0; + action: STATE_SET "odd" 0.0; target: "base"; } program { diff --git a/src/examples/elementary/efl_ui_list_view_example_1.c b/src/examples/elementary/efl_ui_list_view_example_1.c index e432fe1d66..04ae147f2a 100644 --- a/src/examples/elementary/efl_ui_list_view_example_1.c +++ b/src/examples/elementary/efl_ui_list_view_example_1.c @@ -4,9 +4,9 @@ # include "elementary_config.h" #else # define EFL_BETA_API_SUPPORT 1 -# define EFL_EO_API_SUPPORT 1 #endif +#include #include #include #include @@ -45,11 +45,11 @@ static Efl_Model* _make_model(Evas_Object *win) { Eina_Value vtext; - Efl_Model_Item *model, *child; + Efl_Generic_Model *model, *child; unsigned int i, s; char buf[256]; - model = efl_add(EFL_MODEL_ITEM_CLASS, win); + model = efl_add(EFL_GENERIC_MODEL_CLASS, win); eina_value_setup(&vtext, EINA_VALUE_TYPE_STRING); for (i = 0; i < (NUM_ITEMS); i++) @@ -74,7 +74,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) Efl_Ui_Factory *factory; Evas_Object *win, *li; Eo *model; - Efl_Model_Composite_Selection *selmodel; + Efl_Select_Model *selmodel; win = elm_win_util_standard_add("list_view", "List_View"); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); @@ -82,14 +82,14 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) elm_win_autodel_set(win, EINA_TRUE); model = _make_model(win); - selmodel = efl_add(EFL_MODEL_COMPOSITE_SELECTION_CLASS, efl_main_loop_get() + selmodel = efl_add(EFL_SELECT_MODEL_CLASS, efl_main_loop_get() , efl_ui_view_model_set(efl_added, model) ); factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win); - efl_ui_model_connect(factory, "signal/efl,state,%v", "odd_style"); - efl_ui_model_connect(factory, "signal/efl,state,%{selected;unselected}", "selected"); - efl_ui_model_connect(factory, "efl.text", "name"); + efl_ui_property_bind(factory, "signal/efl,state,%v", "odd_style"); + efl_ui_property_bind(factory, "signal/efl,state,%{selected;unselected}", "selected"); + efl_ui_property_bind(factory, "efl.text", "name"); efl_ui_layout_factory_theme_config(factory, "list_item", NULL, "default"); li = efl_add(EFL_UI_LIST_VIEW_CLASS, win diff --git a/src/examples/elementary/efl_ui_list_view_example_2.c b/src/examples/elementary/efl_ui_list_view_example_2.c index ca56f37d33..a843f6ed9c 100644 --- a/src/examples/elementary/efl_ui_list_view_example_2.c +++ b/src/examples/elementary/efl_ui_list_view_example_2.c @@ -4,9 +4,9 @@ # include "config.h" #else # define EFL_BETA_API_SUPPORT 1 -# define EFL_EO_API_SUPPORT 1 #endif +#include #include #include #include @@ -31,9 +31,9 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) if (argv[1] != NULL) dirname = argv[1]; else dirname = EFL_MODEL_TEST_FILENAME_PATH; - model = efl_add(EIO_MODEL_CLASS, win, eio_model_path_set(efl_added, dirname)); + model = efl_add(EFL_IO_MODEL_CLASS, win, efl_io_model_path_set(efl_added, dirname)); factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win); - efl_ui_model_connect(factory, "efl.text", "filename"); + efl_ui_property_bind(factory, "efl.text", "filename"); efl_ui_layout_factory_theme_config(factory, "list_item", NULL, "default"); li = efl_add(EFL_UI_LIST_VIEW_CLASS, win); @@ -45,8 +45,8 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) imgf = efl_add(EFL_UI_IMAGE_FACTORY_CLASS, win); - efl_ui_model_connect(imgf, "", "path"); //connect to "path" property - efl_ui_factory_model_connect(factory, "efl.icon", imgf); + efl_ui_property_bind(imgf, "", "path"); //connect to "path" property + efl_ui_factory_bind(factory, "efl.icon", imgf); elm_win_resize_object_add(win, li); diff --git a/src/examples/elementary/efl_ui_list_view_example_3.c b/src/examples/elementary/efl_ui_list_view_example_3.c index eaf5dc975a..c027856df7 100644 --- a/src/examples/elementary/efl_ui_list_view_example_3.c +++ b/src/examples/elementary/efl_ui_list_view_example_3.c @@ -4,12 +4,12 @@ # include "config.h" #else # define EFL_BETA_API_SUPPORT 1 -# define EFL_EO_API_SUPPORT 1 #endif #define ELM_INTERFACE_ATSPI_SELECTION_PROTECTED #include +#include #include #include #include @@ -70,7 +70,7 @@ _bt_add_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_ { Priv_Data *priv = (Priv_Data*)data; Eina_Value vtext, value; - Efl_Model_Item *child; + Efl_Generic_Model *child; eina_value_setup(&vtext, EINA_VALUE_TYPE_STRING); eina_value_setup(&value, EINA_VALUE_TYPE_UCHAR); @@ -150,8 +150,8 @@ _realized_1_cb(void *data EINA_UNUSED, const Efl_Event *event) 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, "efl.text", "name"); - efl_ui_model_connect(ie->layout, "signal/efl,state,%v", "odd_style"); + efl_ui_property_bind(ie->layout, "efl.text", "name"); + efl_ui_property_bind(ie->layout, "signal/efl,state,%v", "odd_style"); } static void @@ -163,17 +163,17 @@ _realized_2_cb(void *data EINA_UNUSED, const Efl_Event *event) 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, "efl.text", "occupation"); + efl_ui_property_bind(ie->layout, "efl.text", "occupation"); } static Efl_Model* _make_model() { Eina_Value vtext, value; - Efl_Model_Item *model, *child; + Efl_Generic_Model *model, *child; unsigned int i, len; - model = efl_add(EFL_MODEL_ITEM_CLASS, efl_main_loop_get()); + model = efl_add(EFL_GENERIC_MODEL_CLASS, efl_main_loop_get()); eina_value_setup(&vtext, EINA_VALUE_TYPE_STRING); eina_value_setup(&value, EINA_VALUE_TYPE_UCHAR); @@ -222,7 +222,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) priv->model = _make_model(); factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win); - efl_ui_model_connect(factory, "efl.text", "filename"); + efl_ui_property_bind(factory, "efl.text", "filename"); efl_ui_layout_factory_theme_config(factory, "list_item", NULL, "default"); priv->list1 = efl_add(EFL_UI_LIST_VIEW_CLASS, win, efl_ui_view_model_set(efl_added, priv->model)); @@ -233,8 +233,8 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) efl_ui_list_view_layout_factory_set(priv->list1, factory); factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win); - efl_ui_model_connect(factory, "efl.text", "filename"); - efl_ui_model_connect(factory, "signal/efl,state,%v", "selected"); + efl_ui_property_bind(factory, "efl.text", "filename"); + efl_ui_property_bind(factory, "signal/efl,state,%v", "selected"); efl_ui_layout_factory_theme_config(factory, "list_item", NULL, "default"); priv->list2 = efl_add(EFL_UI_LIST_VIEW_CLASS, win, efl_ui_view_model_set(efl_added, priv->model)); efl_event_callback_add(priv->list2, EFL_UI_LIST_VIEW_EVENT_ITEM_REALIZED, _realized_2_cb, priv->list2); @@ -313,7 +313,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) elm_box_pack_end(vbx, bt); elm_box_pack_end(bx, priv->list2); - efl_event_callback_add(priv->list2, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED, _focused ,priv); + efl_event_callback_add(priv->list2, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _focused ,priv); evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _cleanup_cb, priv); diff --git a/src/examples/elementary/efl_ui_relative_layout_example_01.c b/src/examples/elementary/efl_ui_relative_layout_example_01.c new file mode 100644 index 0000000000..e2d2af7948 --- /dev/null +++ b/src/examples/elementary/efl_ui_relative_layout_example_01.c @@ -0,0 +1,51 @@ +// gcc -o efl_ui_relative_layout_example_01 efl_ui_relative_layout_example_01.c `pkg-config --cflags --libs elementary` + +#ifdef HAVE_CONFIG_H +#include "elementary_config.h" +#else +#define EFL_BETA_API_SUPPORT 1 +#endif + +#include +#include +#include + +EAPI_MAIN int +elm_main(int argc, char **argv) +{ + Eo *win, *layout, *btn1, *btn2, *btn3; + + win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), + efl_text_set(efl_added, "Efl.Ui.Relative_Layout"), + efl_ui_win_autodel_set(efl_added, EINA_TRUE)); + + layout = efl_add(EFL_UI_RELATIVE_LAYOUT_CLASS, win, + efl_content_set(win, efl_added)); + + btn1 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_text_set(efl_added, "btn1"), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)), + efl_gfx_hint_align_set(efl_added, 0, 0), + efl_gfx_hint_margin_set(efl_added, 10, 30, 20, 40), + efl_ui_relative_layout_relation_right_set(layout, efl_added, layout, 0.0), + efl_ui_relative_layout_relation_bottom_set(layout, efl_added, layout, 0.0)); + + btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_text_set(efl_added, "btn2"), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(0, 200)), + efl_gfx_hint_align_set(efl_added, 0.5, 0), + efl_ui_relative_layout_relation_left_set(layout, efl_added, btn1, 1.0), + efl_ui_relative_layout_relation_bottom_set(layout, efl_added, layout, 0.0)); + + btn3 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_text_set(efl_added, "btn3"), + efl_ui_relative_layout_relation_left_set(layout, efl_added, btn2, 0.0), + efl_ui_relative_layout_relation_top_set(layout, efl_added, btn2, 1.0)); + + efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 300)); + + elm_run(); + return 0; +} +ELM_MAIN() diff --git a/src/examples/elementary/efl_ui_relative_layout_example_02.c b/src/examples/elementary/efl_ui_relative_layout_example_02.c new file mode 100644 index 0000000000..fe254633bb --- /dev/null +++ b/src/examples/elementary/efl_ui_relative_layout_example_02.c @@ -0,0 +1,45 @@ +// gcc -o efl_ui_relative_layout_example_02 efl_ui_relative_layout_example_02.c `pkg-config --cflags --libs elementary` + +#ifdef HAVE_CONFIG_H +#include "elementary_config.h" +#else +#define EFL_BETA_API_SUPPORT 1 +#endif + +#include +#include +#include + +EAPI_MAIN int +elm_main(int argc, char **argv) +{ + Eo *win, *layout, *btn1, *btn2; + + win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), + efl_text_set(efl_added, "Efl.Ui.Relative_Layout"), + efl_ui_win_autodel_set(efl_added, EINA_TRUE)); + + layout = efl_add(EFL_UI_RELATIVE_LAYOUT_CLASS, win, + efl_content_set(win, efl_added)); + + btn1 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_text_set(efl_added, "btn1"), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100))); + + btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_text_set(efl_added, "btn2"), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(0, 100))); + + efl_ui_relative_layout_relation_right_set(layout, btn1, btn2, 0.0); + efl_ui_relative_layout_relation_bottom_set(layout, btn1, btn2, 0.0); + + efl_ui_relative_layout_relation_left_set(layout, btn2, btn1, 1.0); + efl_ui_relative_layout_relation_top_set(layout, btn2, btn1, 1.0); + + efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 300)); + + elm_run(); + return 0; +} +ELM_MAIN() diff --git a/src/examples/elementary/efl_ui_scroller_example.c b/src/examples/elementary/efl_ui_scroller_example.c index 4de4d216a3..90e6f55941 100644 --- a/src/examples/elementary/efl_ui_scroller_example.c +++ b/src/examples/elementary/efl_ui_scroller_example.c @@ -2,8 +2,8 @@ //gcc -g efl_ui_scroller_example.c -o efl_ui_scroller_example `pkg-config --cflags --libs elementary` #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT +#include #include EAPI_MAIN void @@ -24,7 +24,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_file_simple_load(content, buf, NULL); efl_gfx_entity_size_set(content, EINA_SIZE2D(5000, 5000)); efl_content_set(scroller, content); } diff --git a/src/examples/elementary/efl_ui_slider_mono.cs b/src/examples/elementary/efl_ui_slider_mono.cs index 3ef10cbb0e..c2a3232f14 100644 --- a/src/examples/elementary/efl_ui_slider_mono.cs +++ b/src/examples/elementary/efl_ui_slider_mono.cs @@ -2,6 +2,7 @@ using System; public class Example { +#if EFL_BETA public static Efl.Ui.Button CreateButton(Efl.Object parent, string text, int w, int h, @@ -73,5 +74,10 @@ public class Example Efl.All.Shutdown(); } +#else + public static void Main() + { + } +#endif } diff --git a/src/examples/elementary/efl_ui_theme_example_01.c b/src/examples/elementary/efl_ui_theme_example_01.c index 1c901a59b4..15e1017e50 100644 --- a/src/examples/elementary/efl_ui_theme_example_01.c +++ b/src/examples/elementary/efl_ui_theme_example_01.c @@ -3,9 +3,9 @@ * gcc -o efl_ui_theme_example_01 efl_ui_theme_example_01.c `pkg-config --cflags --libs elementary` */ #define EFL_BETA_API_SUPPORT 1 -#define EFL_EO_API_SUPPORT 1 #define EFL_UI_WIDGET_PROTECTED +#include #include #define EXAMPLE_EDJ_FILE_PATH "./efl_ui_theme_example.edj" @@ -16,7 +16,7 @@ _btn_extension_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event) static Eina_Bool loaded = EINA_TRUE; Efl_Ui_Theme *default_theme; - default_theme = efl_ui_theme_default_get(efl_ui_theme_class_get()); + default_theme = efl_ui_theme_default_get(); if (loaded) { @@ -48,11 +48,11 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl_exit(0); } - default_theme = efl_ui_theme_default_get(efl_ui_theme_class_get()); + default_theme = efl_ui_theme_default_get(); efl_ui_theme_extension_add(default_theme, EXAMPLE_EDJ_FILE_PATH); win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl.Ui.Theme example"), efl_ui_win_autodel_set(efl_added, EINA_TRUE) ); diff --git a/src/examples/elementary/efl_ui_theme_example_02.c b/src/examples/elementary/efl_ui_theme_example_02.c index f742d1d266..0d0390b82c 100644 --- a/src/examples/elementary/efl_ui_theme_example_02.c +++ b/src/examples/elementary/efl_ui_theme_example_02.c @@ -3,9 +3,9 @@ * gcc -o efl_ui_theme_example_02 efl_ui_theme_example_02.c `pkg-config --cflags --libs elementary` */ #define EFL_BETA_API_SUPPORT 1 -#define EFL_EO_API_SUPPORT 1 #define EFL_UI_WIDGET_PROTECTED +#include #include #define EXAMPLE_EDJ_FILE_PATH "./efl_ui_theme_example.edj" @@ -16,7 +16,7 @@ _btn_overlay_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event) static Eina_Bool loaded = EINA_TRUE; Efl_Ui_Theme *default_theme; - default_theme = efl_ui_theme_default_get(efl_ui_theme_class_get()); + default_theme = efl_ui_theme_default_get(); if (loaded) { @@ -48,11 +48,11 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl_exit(0); } - default_theme = efl_ui_theme_default_get(efl_ui_theme_class_get()); + default_theme = efl_ui_theme_default_get(); efl_ui_theme_overlay_add(default_theme, EXAMPLE_EDJ_FILE_PATH); win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), - efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Efl.Ui.Theme example"), efl_ui_win_autodel_set(efl_added, EINA_TRUE) ); diff --git a/src/examples/elementary/efl_ui_unit_converter.cs b/src/examples/elementary/efl_ui_unit_converter.cs index 5bbbe1723a..3460af3f5f 100644 --- a/src/examples/elementary/efl_ui_unit_converter.cs +++ b/src/examples/elementary/efl_ui_unit_converter.cs @@ -2,7 +2,7 @@ using System; public class Example { - +#if EFL_BETA private static double KMS_PER_MILE = 1.609344; private static double KmsToMiles(double kms) @@ -146,5 +146,10 @@ public class Example Efl.All.Shutdown(); } +#else + public static void Main() + { + } +#endif } diff --git a/src/examples/elementary/evas3d_map_example.c b/src/examples/elementary/evas3d_map_example.c index 5426d30966..f0859e30ac 100644 --- a/src/examples/elementary/evas3d_map_example.c +++ b/src/examples/elementary/evas3d_map_example.c @@ -1,5 +1,6 @@ -#define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT +#ifndef EFL_BETA_API_SUPPORT +# define EFL_BETA_API_SUPPORT +#endif #include diff --git a/src/examples/elementary/evas3d_map_example.edc b/src/examples/elementary/evas3d_map_example.edc index 06a409dc60..2d4573a788 100644 --- a/src/examples/elementary/evas3d_map_example.edc +++ b/src/examples/elementary/evas3d_map_example.edc @@ -166,6 +166,9 @@ group { name: "elm/scroller/base/evas3d"; inherit: "default" 0.0; min: 0 0; } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + } } part { name: "sb_vbar_a1"; type: RECT; clip_to: "sb_vbar"; @@ -224,7 +227,6 @@ group { name: "elm/scroller/base/evas3d"; program { signal: "mouse,down,1*"; source: "sb_vbar_a1"; action: STATE_SET "clicked" 0.0; - target: "sb_vbar_a1"; target: "arrow1_vbar"; } program { @@ -235,13 +237,11 @@ group { name: "elm/scroller/base/evas3d"; program { signal: "mouse,up,1"; source: "sb_vbar_a1"; action: STATE_SET "default" 0.0; - target: "sb_vbar_a1"; target: "arrow1_vbar"; } program { signal: "mouse,down,1*"; source: "sb_vbar_a2"; action: STATE_SET "clicked" 0.0; - target: "sb_vbar_a2"; target: "arrow2_vbar"; } program { @@ -252,7 +252,6 @@ group { name: "elm/scroller/base/evas3d"; program { signal: "mouse,up,1"; source: "sb_vbar_a2"; action: STATE_SET "default" 0.0; - target: "sb_vbar_a2"; target: "arrow2_vbar"; } program { @@ -344,6 +343,9 @@ group { name: "elm/scroller/base/evas3d"; inherit: "default" 0.0; min: 0 0; } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + } } part { name: "sb_hbar_a1"; type: RECT; clip_to: "sb_hbar"; @@ -402,7 +404,6 @@ group { name: "elm/scroller/base/evas3d"; program { signal: "mouse,down,1*"; source: "sb_hbar_a1"; action: STATE_SET "clicked" 0.0; - target: "sb_hbar_a1"; target: "arrow1_hbar"; } program { @@ -413,13 +414,11 @@ group { name: "elm/scroller/base/evas3d"; program { signal: "mouse,up,1"; source: "sb_hbar_a1"; action: STATE_SET "default" 0.0; - target: "sb_hbar_a1"; target: "arrow1_hbar"; } program { signal: "mouse,down,1*"; source: "sb_hbar_a2"; action: STATE_SET "clicked" 0.0; - target: "sb_hbar_a2"; target: "arrow2_hbar"; } program { @@ -430,7 +429,6 @@ group { name: "elm/scroller/base/evas3d"; program { signal: "mouse,up,1"; source: "sb_hbar_a2"; action: STATE_SET "default" 0.0; - target: "sb_hbar_a2"; target: "arrow2_hbar"; } program { diff --git a/src/examples/elementary/evas3d_object_on_button_example.c b/src/examples/elementary/evas3d_object_on_button_example.c index e77d74be3d..fe458eb454 100644 --- a/src/examples/elementary/evas3d_object_on_button_example.c +++ b/src/examples/elementary/evas3d_object_on_button_example.c @@ -5,10 +5,9 @@ * Compile with: * gcc -o evas3d_object_on_button_example evas3d_object_on_button_example.c -g `pkg-config --libs --cflags evas ecore eo elementary` */ - - -#define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT +#ifndef EFL_BETA_API_SUPPORT +# define EFL_BETA_API_SUPPORT +#endif #include #include diff --git a/src/examples/elementary/evas3d_scene_on_button_example.c b/src/examples/elementary/evas3d_scene_on_button_example.c index 8f47c7e080..267e45b7e9 100644 --- a/src/examples/elementary/evas3d_scene_on_button_example.c +++ b/src/examples/elementary/evas3d_scene_on_button_example.c @@ -5,9 +5,9 @@ * Compile with: * gcc -o evas3d_scene_on_button_example evas3d_scene_on_button_example.c -g `pkg-config --libs --cflags evas ecore eo elementary` */ - -#define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT +#ifndef EFL_BETA_API_SUPPORT +# define EFL_BETA_API_SUPPORT +#endif #define WIDTH 500 #define HEIGHT 500 diff --git a/src/examples/elementary/filemvc.c b/src/examples/elementary/filemvc.c index 6935e9387b..dfe73c8b2b 100644 --- a/src/examples/elementary/filemvc.c +++ b/src/examples/elementary/filemvc.c @@ -4,13 +4,12 @@ # include "config.h" #else # define EFL_BETA_API_SUPPORT 1 -# define EFL_EO_API_SUPPORT 1 #endif #include #include #include -#include +#include #include #include #include @@ -38,7 +37,7 @@ _cleanup_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void } static int -_filter_cb(void *data EINA_UNUSED, Eio_Model *model, Eina_File_Direct_Info *info) +_filter_cb(void *data EINA_UNUSED, Efl_Io_Model *model EINA_UNUSED, Eina_File_Direct_Info *info) { if (info->type == EINA_FILE_DIR && info->path[info->name_start] != '.') return 1; @@ -124,8 +123,8 @@ 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, win, eio_model_path_set(efl_added, dirname)); - eio_model_children_filter_set(priv.treemodel, NULL, _filter_cb, NULL); + priv.treemodel = efl_add(EFL_IO_MODEL_CLASS, win, efl_io_model_path_set(efl_added, dirname)); + efl_io_model_children_filter_set(priv.treemodel, NULL, _filter_cb, NULL); //treeview genlist = elm_genlist_add(win); diff --git a/src/examples/elementary/fileviewlist.c b/src/examples/elementary/fileviewlist.c index 716fdb3f79..ffbaca57b5 100644 --- a/src/examples/elementary/fileviewlist.c +++ b/src/examples/elementary/fileviewlist.c @@ -5,13 +5,12 @@ # include "config.h" #else # define EFL_BETA_API_SUPPORT 1 -# define EFL_EO_API_SUPPORT 1 #endif #include #include #include -#include +#include #include #define EFL_MODEL_TEST_FILENAME_PATH "/tmp" @@ -54,7 +53,7 @@ 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, win, eio_model_path_set(efl_added, dirname)); + priv.filemodel = efl_add(EFL_IO_MODEL_CLASS, win, efl_io_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/hoversel_example_01.c b/src/examples/elementary/hoversel_example_01.c index 289996cf24..7ce97bb503 100644 --- a/src/examples/elementary/hoversel_example_01.c +++ b/src/examples/elementary/hoversel_example_01.c @@ -4,7 +4,6 @@ #include static void _print_items(void *data, Evas_Object *obj, void *event_info); -static void _free(void *data, Evas_Object *obj, void *event_info); static void _add_item(void *data, Evas_Object *obj, void *event_info); static void @@ -108,21 +107,12 @@ static void _add_item(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) { static int num = 0; - char *str = malloc(sizeof(char) * 11); - Elm_Object_Item *hoversel_it; + Eina_Slstr *str; if(is_eng) - snprintf(str, 11, "item %d", ++num); + str = eina_slstr_printf("item %d", ++num); else - snprintf(str, 11, "بند %d", ++num); + str = eina_slstr_printf("بند %d", ++num); - hoversel_it = elm_hoversel_item_add(obj, str, NULL, ELM_ICON_NONE, NULL, - str); - elm_object_item_del_cb_set(hoversel_it, _free); -} - -static void -_free(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) -{ - free(data); + elm_hoversel_item_add(obj, str, NULL, ELM_ICON_NONE, NULL, str); } diff --git a/src/examples/elementary/icon_cxx_example_01.cc b/src/examples/elementary/icon_cxx_example_01.cc index 88f9f95502..6252ce1cc0 100644 --- a/src/examples/elementary/icon_cxx_example_01.cc +++ b/src/examples/elementary/icon_cxx_example_01.cc @@ -14,8 +14,8 @@ elm_main (int argc EINA_UNUSED, char **argv EINA_UNUSED) efl::ui::Image icon(instantiate, win); icon.icon_set("home"); - efl::eina::string_view path, group; - icon.file_get(path, group); + efl::eina::string_view path = icon.file_get(); + efl::eina::string_view group = icon.key_get(); std::cout << "path = " << path << ", group = "<< group; std::cout << ", name = " << icon.icon_get() << std::endl; diff --git a/src/examples/elementary/index_example_02.c b/src/examples/elementary/index_example_02.c index 820f095e29..84cd1498f9 100644 --- a/src/examples/elementary/index_example_02.c +++ b/src/examples/elementary/index_example_02.c @@ -87,7 +87,7 @@ elm_main(int argc EINA_UNUSED, Elm_Object_Item *gg_it; unsigned int i; - Elm_Gengrid_Item_Class gic; + Elm_Gengrid_Item_Class gic = { 0 }; elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); elm_app_info_set(elm_main, "elementary", "images"); diff --git a/src/examples/elementary/inwin_example.c b/src/examples/elementary/inwin_example.c index 48b9820246..2a893921d5 100644 --- a/src/examples/elementary/inwin_example.c +++ b/src/examples/elementary/inwin_example.c @@ -134,7 +134,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) evas_object_smart_callback_add(o, "clicked", _btn_click_cb, NULL); - if (!strncmp(elm_config_engine_get(), "shot", 4)) + if (eina_streq(getenv("ELM_ENGINE"), "shot")) ecore_timer_add(0.1, _screenshot_hack_cb, o); evas_object_resize(win, 400, 400); diff --git a/src/examples/elementary/layout_model_connect.c b/src/examples/elementary/layout_property_bind.c similarity index 83% rename from src/examples/elementary/layout_model_connect.c rename to src/examples/elementary/layout_property_bind.c index acc74bccb9..2b911018ef 100644 --- a/src/examples/elementary/layout_model_connect.c +++ b/src/examples/elementary/layout_property_bind.c @@ -4,9 +4,9 @@ # include "config.h" #else # define EFL_BETA_API_SUPPORT 1 -# define EFL_EO_API_SUPPORT 1 #endif +#include #include #include #include @@ -22,9 +22,24 @@ struct _Layout_Model_Data Evas_Object *entry; Evas_Object *img; Evas_Object *bt; + Evas_Object *bxr; }; typedef struct _Layout_Model_Data Layout_Model_Data; +static Eina_Value +_wait_for_image(Eo *o EINA_UNUSED, void *data, const Eina_Value v) +{ + Layout_Model_Data *priv = data; + + priv->img = eina_value_object_get(&v); + elm_box_pack_end(priv->bxr, priv->img); + evas_object_size_hint_weight_set(priv->img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(priv->img, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(priv->img); + + return v; +} + static void _cleanup_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { @@ -46,7 +61,6 @@ _list_selected_cb(void *data EINA_UNUSED, const Efl_Event *event) efl_ui_view_model_set(priv->bt, child); } - static void _update_cb(void *data, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED) { @@ -78,7 +92,6 @@ _label_init(Evas_Object *win, Evas_Object *box, const char *text) return widget; } - static void _signal_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, @@ -111,10 +124,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, win, eio_model_path_set(efl_added, dirname)); + priv->model = efl_add_ref(EFL_IO_MODEL_CLASS, win, efl_io_model_path_set(efl_added, dirname)); genlist = elm_genlist_add(win); - priv->fileview = efl_add(ELM_VIEW_LIST_CLASS, win, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_NONE, NULL)); + priv->fileview = efl_add_ref(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); @@ -123,17 +136,18 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) efl_event_callback_add(priv->fileview, ELM_VIEW_LIST_EVENT_MODEL_SELECTED, _list_selected_cb, priv); bxr = elm_box_add(win); + priv->bxr = bxr; _widget_init(bxr); elm_object_part_content_set(panes, "right", bxr); /*Label widget */ _label_init(win, bxr, "FILENAME:"); priv->label = _label_init(win, bxr, ""); - efl_ui_model_connect(priv->label, "default", "path"); //connect "default" to "filename" property + efl_ui_property_bind(priv->label, "default", "path"); //connect "default" to "filename" property /* Entry widget */ priv->entry = elm_entry_add(win); - efl_ui_model_connect(priv->entry, "elm.text", "path"); //connect "elm.text" to "path" property + efl_ui_property_bind(priv->entry, "elm.text", "path"); //connect "elm.text" to "path" property elm_entry_single_line_set(priv->entry, EINA_TRUE); elm_box_pack_end(bxr, priv->entry); evas_object_size_hint_weight_set(priv->entry, EVAS_HINT_FILL, 0); @@ -146,19 +160,17 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) elm_object_text_set(priv->bt, "update model"); evas_object_smart_callback_add(priv->bt, "clicked", _update_cb, priv); edje_object_signal_callback_add(priv->bt, "test*" , "*", _signal_cb, priv); - efl_ui_model_connect(priv->bt, "signal/test-%v", "size"); + efl_ui_property_bind(priv->bt, "signal/test-%v", "size"); evas_object_show(priv->bt); /* 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_factory_model_connect(priv->bt, "icon", img_factory); + efl_ui_property_bind(img_factory, "", "path"); //connect to "path" property + efl_ui_factory_bind(priv->bt, "icon", img_factory); - priv->img = efl_ui_factory_create(img_factory, NULL, win); - elm_box_pack_end(bxr, priv->img); - evas_object_size_hint_weight_set(priv->img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(priv->img, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(priv->img); + efl_future_then(win, efl_ui_factory_create(img_factory, NULL, win), + .success = _wait_for_image, + .data = priv); evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _cleanup_cb, priv); //showall @@ -167,8 +179,8 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) evas_object_show(win); elm_run(); + elm_shutdown(); - ecore_shutdown(); return 0; } diff --git a/src/examples/elementary/location_example_01.c b/src/examples/elementary/location_example_01.c index 96ca818069..7b8ad6f897 100644 --- a/src/examples/elementary/location_example_01.c +++ b/src/examples/elementary/location_example_01.c @@ -1,7 +1,9 @@ //Compile with: //gcc -o location_example_01 location_example_01.c -g `pkg-config --cflags --libs elementary elocation` +#ifndef EFL_BETA_API_SUPPORT +# define EFL_BETA_API_SUPPORT +#endif -#define EFL_BETA_API_SUPPORT #include #ifdef ELM_ELOCATION #include @@ -57,7 +59,7 @@ _print_address(Elocation_Address *address) } static Eina_Bool -_position_changed(void *data, int ev_type, void *event) +_position_changed(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event) { Elocation_Position *position; diff --git a/src/examples/elementary/meson.build b/src/examples/elementary/meson.build new file mode 100644 index 0000000000..67286d95f8 --- /dev/null +++ b/src/examples/elementary/meson.build @@ -0,0 +1,164 @@ +examples = [ + 'actionslider_example_01', + 'bg_example_01', + 'bg_example_02', + 'bg_example_03', + 'box_example_02', + 'bubble_example_01', + 'button_example_00', + 'button_example_01', + 'calendar_example_01', + 'calendar_example_02', + 'calendar_example_03', + 'calendar_example_04', + 'calendar_example_05', + 'calendar_example_06', + 'check_example_01', + 'clock_example', + 'colorselector_example_01', + 'conformant_example_01', + 'conformant_example_02', + 'combobox_example_01', + 'ctxpopup_example_01', + 'datetime_example', + 'dayselector_example', + 'diskselector_example_01', + 'diskselector_example_02', + 'entry_example', + 'fileselector_button_example', + 'fileselector_entry_example', + 'fileselector_example', + 'fileviewlist', + 'filemvc', + 'flip_example_01', + 'flipselector_example', + 'frame_example_01', + 'general_funcs_example', + 'gengrid_example', + 'genlist_example_01', + 'genlist_example_02', + 'genlist_example_03', + 'genlist_example_04', + 'genlist_example_05', + 'glview_example_01', + 'hover_example_01', + 'hoversel_example_01', + 'icon_example_01', + 'image_example_01', + 'index_example_01', + 'index_example_02', + 'inwin_example', + 'label_example_01', + 'label_example_02', + 'label_example_03', + 'layout_example_01', + 'layout_example_02', + 'layout_example_03', + 'layout_property_bind', + 'list_example_01', + 'list_example_02', + 'list_example_03', + 'location_example_01', + 'map_example_01', + 'map_example_02', + 'map_example_03', + 'mapbuf_example', + 'menu_example_01', + 'naviframe_example', + 'notify_example_01', + 'panes_example', + 'panel_example_01', + 'photocam_example_01', + 'prefs_example_01', + 'prefs_example_02', + 'prefs_example_03', + 'popup_example_01', + 'popup_example_02', + 'popup_example_03', + 'progressbar_example', + 'radio_example_01', + 'radio_example_02', + 'segment_control_example', + 'separator_example_01', + 'slider_example', + 'slideshow_example', + 'spinner_example', + 'scroller_example_01', + 'table_example_01', + 'table_example_02', + 'theme_example_01', + 'theme_example_02', + 'thumb_example_01', + 'toolbar_example_01', + 'toolbar_example_02', + 'toolbar_example_03', + 'transit_example_01', + 'transit_example_02', + 'transit_example_03', + 'transit_example_04', + 'web_example_01', + 'web_example_02', + 'win_example', + 'track_example_01', + 'evas3d_object_on_button_example', + 'evas3d_scene_on_button_example', + 'evas3d_map_example', + 'efl_thread_1', + 'efl_thread_2', + 'efl_thread_3', + 'efl_thread_4', + 'efl_thread_5', + 'efl_thread_6', + 'efl_ui_list_example_1', + 'efl_ui_list_view_example_1', + 'efl_ui_list_view_example_2', + 'efl_ui_list_view_example_3', + 'efl_canvas_layout_text', + 'efl_ui_theme_example_01', + 'efl_ui_theme_example_02' +] + +foreach example : examples + executable(example, example + '.c', dependencies: [elementary, ecore, eio]) +endforeach + +edc_files = [ + 'codegen_example.edc', + 'efl_ui_theme_example.edc' +] + +themes = [] + +foreach edc_file : edc_files + themes += custom_target('edje_cc_' + edc_file, + depends : edje_depends, + input : edc_file, + output : '@BASENAME@.edj', + command : edje_cc_exe + ['-beta', + '-id', meson.current_source_dir(), + '-fd', meson.current_source_dir(), + '-sd', meson.current_source_dir(), + '-vd', meson.current_source_dir(), + '-dd', meson.current_source_dir(), + '-md', meson.current_source_dir(), + '-td', meson.current_source_dir(), + '@INPUT@', '@OUTPUT@'], + ) +endforeach + + +codegen = custom_target('elementary_codegen_examples', + depends : [themes, elementary_codegen], + input : themes[0], + output : ['codegen_example_generated.c', 'codegen_example_generated.h'], + command : elementary_codegen_exe + ['-p=codegen_example', '@INPUT@', 'elm/example/mylayout/default', '@OUTPUT0@', '@OUTPUT1@'], +) + +executable('codegen_example', + ['codegen_example.c'] + [codegen], + dependencies: [elementary], + include_directories : include_directories('..') +) + +subdir('sphere_hunter') +subdir('performance') diff --git a/src/examples/elementary/performance/camera_light.c b/src/examples/elementary/performance/camera_light.c index 3c8f93b981..98be8c24ef 100644 --- a/src/examples/elementary/performance/camera_light.c +++ b/src/examples/elementary/performance/camera_light.c @@ -226,7 +226,7 @@ init_panel_camera_light(Evas_Object *win, Eo *camera_node, Eo *light_node, doubl } static void -_camera_light_changeX_cb(void *data, Evas_Object *obj, void *event_info) +_camera_light_changeX_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) { Evas_Real x, y, z; @@ -238,7 +238,7 @@ _camera_light_changeX_cb(void *data, Evas_Object *obj, void *event_info) } } static void -_camera_light_changeY_cb(void *data, Evas_Object *obj, void *event_info) +_camera_light_changeY_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) { Evas_Real x, y, z; @@ -250,7 +250,7 @@ _camera_light_changeY_cb(void *data, Evas_Object *obj, void *event_info) } } static void -_camera_light_changeZ_cb(void *data, Evas_Object *obj, void *event_info) +_camera_light_changeZ_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) { Evas_Real x, y, z; @@ -262,7 +262,7 @@ _camera_light_changeZ_cb(void *data, Evas_Object *obj, void *event_info) } } static void -_camera_light_angle_change_cb(void *data, Evas_Object *obj, void *event_info) +_camera_light_angle_change_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) { Axis_Key *key = evas_object_data_get(obj, axiskeys); Evas_Real aw = 0; @@ -274,7 +274,7 @@ _camera_light_angle_change_cb(void *data, Evas_Object *obj, void *event_info) } } static void -_camera_light_axisX_change_cb(void *data, Evas_Object *obj, void *event_info) +_camera_light_axisX_change_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) { Evas_Object *fsa = (Evas_Object*)data; Axis_Key *key = evas_object_data_get(fsa, axiskeys); @@ -282,7 +282,7 @@ _camera_light_axisX_change_cb(void *data, Evas_Object *obj, void *event_info) key->x = elm_spinner_value_get(obj); } static void -_camera_light_axisY_change_cb(void *data, Evas_Object *obj, void *event_info) +_camera_light_axisY_change_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) { Evas_Object *fsa = (Evas_Object*)data; Axis_Key *key = evas_object_data_get(fsa, axiskeys); @@ -290,7 +290,7 @@ _camera_light_axisY_change_cb(void *data, Evas_Object *obj, void *event_info) key->y = elm_spinner_value_get(obj); } static void -_camera_light_axisZ_change_cb(void *data, Evas_Object *obj, void *event_info) +_camera_light_axisZ_change_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) { Evas_Object *fsa = (Evas_Object*)data; Axis_Key *key = evas_object_data_get(fsa, axiskeys); diff --git a/src/examples/elementary/performance/graphical.c b/src/examples/elementary/performance/graphical.c index 06959ea2e7..c3a87683b7 100644 --- a/src/examples/elementary/performance/graphical.c +++ b/src/examples/elementary/performance/graphical.c @@ -1,5 +1,6 @@ -#define EFL_EO_API_SUPPORT -#define EFL_BETA_API_SUPPORT +#ifndef EFL_BETA_API_SUPPORT +# define EFL_BETA_API_SUPPORT +#endif #include #include @@ -323,7 +324,7 @@ _change_scene_setup() } else { - efl_file_set(globalGraphical.mesh, globalGraphical.model_path, NULL); + efl_file_simple_load(globalGraphical.mesh, globalGraphical.model_path, NULL); evas_canvas3d_mesh_frame_material_set(globalGraphical.mesh, 0, globalGraphical.material); evas_canvas3d_mesh_shader_mode_set(globalGraphical.mesh, EVAS_CANVAS3D_SHADER_MODE_PHONG); } @@ -427,7 +428,7 @@ _init_scene(Evas_Object *img) globalGraphical.material = efl_add(EVAS_CANVAS3D_MATERIAL_CLASS, globalGraphical.evas); globalGraphical.texture = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, globalGraphical.evas); - efl_file_set(globalGraphical.texture, "target_texture.png", NULL); + efl_file_simple_load(globalGraphical.texture, "target_texture.png", NULL); evas_canvas3d_texture_filter_set(globalGraphical.texture, EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR, EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR); evas_canvas3d_texture_wrap_set(globalGraphical.texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); evas_canvas3d_material_texture_set(globalGraphical.material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, globalGraphical.texture); @@ -460,7 +461,7 @@ _init_scene(Evas_Object *img) } else { - efl_file_set(globalGraphical.mesh, globalGraphical.model_path, NULL); + efl_file_simple_load(globalGraphical.mesh, globalGraphical.model_path, NULL); evas_canvas3d_mesh_frame_material_set(globalGraphical.mesh, 0, globalGraphical.material); evas_canvas3d_mesh_shader_mode_set(globalGraphical.mesh, EVAS_CANVAS3D_SHADER_MODE_PHONG); } @@ -492,7 +493,7 @@ _init_scene(Evas_Object *img) } static Eina_Bool -_xml_attr_data(void *data, const char *key, const char *value) +_xml_attr_data(void *data EINA_UNUSED, const char *key, const char *value) { char *format = NULL, *tmp = NULL, *a = NULL; int i; @@ -533,8 +534,8 @@ _xml_attr_data(void *data, const char *key, const char *value) } static Eina_Bool -_xml_get_data(void *data, Eina_Simple_XML_Type type, const char *content, - unsigned offset, unsigned length) +_xml_get_data(void *data EINA_UNUSED, Eina_Simple_XML_Type type, const char *content, + unsigned offset EINA_UNUSED, unsigned length) { char str[512]; switch (type) diff --git a/src/examples/elementary/performance/meson.build b/src/examples/elementary/performance/meson.build new file mode 100644 index 0000000000..cd209955a8 --- /dev/null +++ b/src/examples/elementary/performance/meson.build @@ -0,0 +1,31 @@ +examples = [ + 'performance.c', + 'camera_light.c', + 'graphical.c', +] + +edc_files = [ + 'layout.edc' +] + +themes = [] + +foreach edc_file : edc_files + themes += custom_target('edje_cc_' + edc_file, + depends : edje_depends, + input : edc_file, + output : '@BASENAME@.edj', + command : edje_cc_exe + ['-beta', + '-id', meson.current_source_dir(), + '-fd', meson.current_source_dir(), + '-sd', meson.current_source_dir(), + '-vd', meson.current_source_dir(), + '-dd', meson.current_source_dir(), + '-md', meson.current_source_dir(), + '-td', meson.current_source_dir(), + '@INPUT@', '@OUTPUT@'], + ) +endforeach + +executable(example, [examples] + themes, dependencies: [elementary, ecore]) + diff --git a/src/examples/elementary/performance/performance.c b/src/examples/elementary/performance/performance.c index 0ed4c5f559..7508a93de1 100644 --- a/src/examples/elementary/performance/performance.c +++ b/src/examples/elementary/performance/performance.c @@ -19,9 +19,6 @@ * @endverbatim */ -#define EFL_EO_API_SUPPORT -#define EFL_BETA_API_SUPPORT - /*enable automation test*/ #ifdef ENABLE_ATPORT #include "at_port.h" @@ -33,6 +30,9 @@ #include #include +#ifndef EFL_BETA_API_SUPPORT +# define EFL_BETA_API_SUPPORT +#endif #include #include @@ -44,7 +44,6 @@ #include "graphical_struct.h" -#define CONVERT 20 #define WIDTH 1000 #define HEIGHT 600 @@ -53,24 +52,15 @@ Graphical globalGraphical; /*Variable for fps*/ int fps_frames = 0; -void _clear_buf(char *buf) +Eina_Slstr * _value_int_to_char(int value, const char *description) { - int i; - for (i = 0; i < CONVERT; i++) - buf[i] = '\0'; -} - -void _value_int_to_char(char *buf, int value, const char *description) -{ - _clear_buf(buf); if (description) - sprintf(buf, "%s %d", description, value); - else - sprintf(buf, "%d", value); + return eina_slstr_printf("%s %d", description, value); + return eina_slstr_printf("%d", value); } static Eina_Bool -_timer_update(void *data) +_timer_update(void *data EINA_UNUSED) { printf(" frame rate = %f fps\n", fps_frames / 10.0); fps_frames = 0; @@ -165,19 +155,19 @@ _on_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, } } static void -_btnstart_cb(void *data, Evas_Object *obj, void *event_info) +_btnstart_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { globalGraphical.change_scene_setup(); } static void -_btnexit_cb(void *data, Evas_Object *obj, void *event_info) +_btnexit_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { elm_exit(); } static void -_btnstop_cb(void *data, Evas_Object *obj, void *event_info) +_btnstop_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) { const char *status = NULL; status = elm_object_text_get(obj); @@ -193,7 +183,7 @@ _btnstop_cb(void *data, Evas_Object *obj, void *event_info) } } static void -_node_orientation_change_cb(void *data, Evas_Object *obj, void *event_info) +_node_orientation_change_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Elm_Object_Item *it; Eina_List *l; @@ -211,7 +201,7 @@ _node_orientation_change_cb(void *data, Evas_Object *obj, void *event_info) } } static void -_node_position_change_cb(void *data, Evas_Object *obj, void *event_info) +_node_position_change_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Elm_Object_Item *it; Eina_List *l; @@ -229,7 +219,7 @@ _node_position_change_cb(void *data, Evas_Object *obj, void *event_info) } } static void -_node_scale_change_cb(void *data, Evas_Object *obj, void *event_info) +_node_scale_change_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Elm_Object_Item *it; Eina_List *l; @@ -247,9 +237,9 @@ _node_scale_change_cb(void *data, Evas_Object *obj, void *event_info) } } static void -_countdec10_cb(void *data, Evas_Object *obj, void *event_info) +_countdec10_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - char buf[CONVERT]; + Eina_Slstr *buf; int tmp; globalGraphical.count -= 10; @@ -257,187 +247,188 @@ _countdec10_cb(void *data, Evas_Object *obj, void *event_info) else tmp = ((globalGraphical.count + 1) * (globalGraphical.count + 1)); - _value_int_to_char(buf, ((tmp <= 1) ? 0 : tmp), "quantity:"); + buf = _value_int_to_char(((tmp <= 1) ? 0 : tmp), "quantity:"); elm_object_text_set((Evas_Object*)data, buf); } static void -_countdec_cb(void *data, Evas_Object *obj, void *event_info) +_countdec_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - char buf[CONVERT]; - int tmp; + Eina_Slstr *buf; + int tmp; + globalGraphical.count--; if (globalGraphical.count < 0) tmp = globalGraphical.count = 0; else tmp = ((globalGraphical.count + 1) * (globalGraphical.count + 1)); - _value_int_to_char(buf, ((tmp <= 1) ? 0 : tmp), "quantity:"); + buf = _value_int_to_char(((tmp <= 1) ? 0 : tmp), "quantity:"); elm_object_text_set((Evas_Object*)data, buf); } static void -_countinc_cb(void *data, Evas_Object *obj, void *event_info) +_countinc_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - char buf[CONVERT]; + Eina_Slstr *buf; globalGraphical.count++; - _value_int_to_char(buf, ((globalGraphical.count + 1) * (globalGraphical.count + 1)), "quantity:"); + buf = _value_int_to_char(((globalGraphical.count + 1) * (globalGraphical.count + 1)), "quantity:"); elm_object_text_set((Evas_Object*)data, buf); } static void -_countinc10_cb(void *data, Evas_Object *obj, void *event_info) +_countinc10_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - char buf[CONVERT]; + Eina_Slstr *buf; globalGraphical.count += 10; - _value_int_to_char(buf, ((globalGraphical.count + 1) * (globalGraphical.count + 1)), "quantity:"); + buf = _value_int_to_char(((globalGraphical.count + 1) * (globalGraphical.count + 1)), "quantity:"); elm_object_text_set((Evas_Object*)data, buf); } static void -_speeddec10_cb(void *data, Evas_Object *obj, void *event_info) +_speeddec10_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - char buf[CONVERT]; + Eina_Slstr *buf; globalGraphical.speed -= 10; if (globalGraphical.speed <= 0) globalGraphical.speed = 10; - _value_int_to_char(buf, globalGraphical.speed, "speed:"); + buf = _value_int_to_char(globalGraphical.speed, "speed:"); elm_object_text_set((Evas_Object*)data, buf); } static void -_speeddec_cb(void *data, Evas_Object *obj, void *event_info) +_speeddec_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - char buf[CONVERT]; + Eina_Slstr *buf; globalGraphical.speed--; if (globalGraphical.speed <= 0) globalGraphical.speed = 10; - _value_int_to_char(buf, globalGraphical.speed, "speed:"); + buf = _value_int_to_char(globalGraphical.speed, "speed:"); elm_object_text_set((Evas_Object*)data, buf); } static void -_speedinc_cb(void *data, Evas_Object *obj, void *event_info) +_speedinc_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - char buf[CONVERT]; + Eina_Slstr *buf; globalGraphical.speed++; - _value_int_to_char(buf, globalGraphical.speed, "speed:"); + buf = _value_int_to_char(globalGraphical.speed, "speed:"); elm_object_text_set((Evas_Object*)data, buf); } static void -_speedinc10_cb(void *data, Evas_Object *obj, void *event_info) +_speedinc10_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - char buf[CONVERT]; + Eina_Slstr *buf; globalGraphical.speed += 10; - _value_int_to_char(buf, globalGraphical.speed, "speed:"); + buf = _value_int_to_char(globalGraphical.speed, "speed:"); elm_object_text_set((Evas_Object*)data, buf); } static void -_precisiondec10_cb(void *data, Evas_Object *obj, void *event_info) +_precisiondec10_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - char buf[CONVERT]; + Eina_Slstr *buf; globalGraphical.precision -= 10; if (globalGraphical.precision <= 0) globalGraphical.precision = 10; - _value_int_to_char(buf, globalGraphical.precision, "precision:"); + buf = _value_int_to_char(globalGraphical.precision, "precision:"); elm_object_text_set((Evas_Object*)data, buf); } static void -_precisiondec_cb(void *data, Evas_Object *obj, void *event_info) +_precisiondec_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - char buf[CONVERT]; + Eina_Slstr *buf; globalGraphical.precision--; if (globalGraphical.precision <= 0) globalGraphical.precision = 10; - _value_int_to_char(buf, globalGraphical.precision, "precision:"); + buf = _value_int_to_char(globalGraphical.precision, "precision:"); elm_object_text_set((Evas_Object*)data, buf); } static void -_precisioninc_cb(void *data, Evas_Object *obj, void *event_info) +_precisioninc_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - char buf[CONVERT]; + Eina_Slstr *buf; globalGraphical.precision++; - _value_int_to_char(buf, globalGraphical.precision, "precision:"); + buf = _value_int_to_char(globalGraphical.precision, "precision:"); elm_object_text_set((Evas_Object*)data, buf); } static void -_precisioninc10_cb(void *data, Evas_Object *obj, void *event_info) +_precisioninc10_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - char buf[CONVERT]; + Eina_Slstr *buf; globalGraphical.precision += 10; - _value_int_to_char(buf, globalGraphical.precision, "precision:"); + buf = _value_int_to_char(globalGraphical.precision, "precision:"); elm_object_text_set((Evas_Object*)data, buf); - } static void -_angledec10_cb(void *data, Evas_Object *obj, void *event_info) +_angledec10_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - char buf[CONVERT]; + Eina_Slstr *buf; globalGraphical.angle -= 10; if (globalGraphical.angle <= 0) globalGraphical.angle = 10; - _value_int_to_char(buf, globalGraphical.angle, "angle:"); + buf = _value_int_to_char(globalGraphical.angle, "angle:"); elm_object_text_set((Evas_Object*)data, buf); } static void -_angledec_cb(void *data, Evas_Object *obj, void *event_info) +_angledec_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - char buf[CONVERT]; + Eina_Slstr *buf; globalGraphical.angle--; if (globalGraphical.angle <= 0) globalGraphical.angle = 10; - _value_int_to_char(buf, globalGraphical.angle, "angle:"); + buf = _value_int_to_char(globalGraphical.angle, "angle:"); elm_object_text_set((Evas_Object*)data, buf); } static void -_angleinc_cb(void *data, Evas_Object *obj, void *event_info) +_angleinc_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - char buf[CONVERT]; + Eina_Slstr *buf; globalGraphical.angle++; if (globalGraphical.angle >= 180) globalGraphical.angle = 180; - _value_int_to_char(buf, globalGraphical.angle, "angle:"); + + buf = _value_int_to_char(globalGraphical.angle, "angle:"); elm_object_text_set((Evas_Object*)data, buf); } static void -_angleinc10_cb(void *data, Evas_Object *obj, void *event_info) +_angleinc10_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - char buf[CONVERT]; + Eina_Slstr *buf; globalGraphical.angle += 10; if (globalGraphical.angle >= 180) globalGraphical.angle = 180; - _value_int_to_char(buf, globalGraphical.angle, "angle:"); + buf = _value_int_to_char(globalGraphical.angle, "angle:"); elm_object_text_set((Evas_Object*)data, buf); } static void -_shadow_enable(void *data, Evas_Object *obj, void *event_info) +_shadow_enable(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) { if (elm_check_state_get(obj)) globalGraphical.flags.shadow_enable = EINA_TRUE; @@ -446,7 +437,7 @@ _shadow_enable(void *data, Evas_Object *obj, void *event_info) } static void -_colorpick_enable(void *data, Evas_Object *obj, void *event_info) +_colorpick_enable(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) { if (elm_check_state_get(obj)) globalGraphical.flags.colorpick_enable = EINA_TRUE; @@ -455,7 +446,7 @@ _colorpick_enable(void *data, Evas_Object *obj, void *event_info) } static void -_fog_enable(void *data, Evas_Object *obj, void *event_info) +_fog_enable(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) { if (elm_check_state_get(obj)) globalGraphical.flags.fog_enable = EINA_TRUE; @@ -464,7 +455,7 @@ _fog_enable(void *data, Evas_Object *obj, void *event_info) } static void -_blend_enable(void *data, Evas_Object *obj, void *event_info) +_blend_enable(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) { if (elm_check_state_get(obj)) globalGraphical.flags.blend_enable = EINA_TRUE; @@ -473,7 +464,7 @@ _blend_enable(void *data, Evas_Object *obj, void *event_info) } static void -_cb_fps_enable(void *data, Evas_Object *obj, void *event_info) +_cb_fps_enable(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) { if (elm_check_state_get(obj)) { @@ -578,7 +569,7 @@ EAPI_MAIN Evas_Object *navigation = NULL; Evas_Object *fs_node = NULL, *bt_orientation = NULL, *bt_position = NULL, *bt_scale = NULL; Ecore_Timer *fps_timer = NULL; - char buf[CONVERT]; + Eina_Slstr *buf; #ifdef ENABLE_ATPORT at_port_h mf_at_port = NULL; @@ -693,7 +684,7 @@ EAPI_MAIN evas_object_show(controlbox); vcount = elm_label_add(win); - _value_int_to_char(buf, 121, "quantity:"); + buf = _value_int_to_char(121, "quantity:"); elm_object_text_set(vcount, buf); countdec10 = elm_button_add(win); @@ -732,7 +723,7 @@ EAPI_MAIN evas_object_smart_callback_add(countinc10, "clicked", _countinc10_cb, vcount); vspeed = elm_label_add(win); - _value_int_to_char(buf, 30, "speed:"); + buf = _value_int_to_char(30, "speed:"); elm_object_text_set(vspeed, buf); speeddec10 = elm_button_add(win); @@ -771,7 +762,7 @@ EAPI_MAIN evas_object_smart_callback_add(speedinc10, "clicked", _speedinc10_cb, vspeed); vprecision = elm_label_add(win); - _value_int_to_char(buf, 100, "precision:"); + buf = _value_int_to_char(100, "precision:"); elm_object_text_set(vprecision, buf); precisiondec10 = elm_button_add(win); @@ -810,7 +801,7 @@ EAPI_MAIN evas_object_smart_callback_add(precisioninc10, "clicked", _precisioninc10_cb, vprecision); vangle = elm_label_add(win); - _value_int_to_char(buf, 120, "angle:"); + buf = _value_int_to_char(120, "angle:"); elm_object_text_set(vangle, buf); angledec10 = elm_button_add(win); @@ -914,13 +905,13 @@ EAPI_MAIN image = init_graphical_window(image); /*Update data for count, speed, precision, angle*/ - _value_int_to_char(buf, (globalGraphical.count + 1) * (globalGraphical.count + 1), "quantity:"); + buf = _value_int_to_char((globalGraphical.count + 1) * (globalGraphical.count + 1), "quantity:"); elm_object_text_set(vcount, buf); - _value_int_to_char(buf, globalGraphical.speed, "speed:"); + buf = _value_int_to_char(globalGraphical.speed, "speed:"); elm_object_text_set(vspeed, buf); - _value_int_to_char(buf, globalGraphical.precision, "precision:"); + buf = _value_int_to_char(globalGraphical.precision, "precision:"); elm_object_text_set(vprecision, buf); - _value_int_to_char(buf, globalGraphical.angle, "angle:"); + buf = _value_int_to_char(globalGraphical.angle, "angle:"); elm_object_text_set(vangle, buf); if (globalGraphical.model_path) evas_object_smart_callback_call(fs_bt, "file,chosen", (void *)globalGraphical.model_path); diff --git a/src/examples/elementary/performance/tools_private.h b/src/examples/elementary/performance/tools_private.h index 05c3c26d0e..40d6f12afc 100644 --- a/src/examples/elementary/performance/tools_private.h +++ b/src/examples/elementary/performance/tools_private.h @@ -1,5 +1,6 @@ -#define EFL_EO_API_SUPPORT -#define EFL_BETA_API_SUPPORT +#ifndef EFL_BETA_API_SUPPORT +# define EFL_BETA_API_SUPPORT +#endif #include #include diff --git a/src/examples/elementary/popup_cxx_example.cc b/src/examples/elementary/popup_cxx_example.cc index b6c78322f9..a6a29ed955 100644 --- a/src/examples/elementary/popup_cxx_example.cc +++ b/src/examples/elementary/popup_cxx_example.cc @@ -3,6 +3,7 @@ #define EFL_CXXPERIMENTAL #include +#include #include #include @@ -207,11 +208,11 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) backwall_visible = !backwall_visible; if (backwall_visible) { - efl::eo::downcast(g_popup.part_get("backwall")).file_set("./sky_01.jpg", nullptr); + efl::eo::downcast(g_popup.part_get("backwall")).file_set("./sky_01.jpg"); backwall_btn.text_set("Unset Backwall"); } else { - efl::eo::downcast(g_popup.part_get("backwall")).file_set(nullptr, nullptr); + efl::eo::downcast(g_popup.part_get("backwall")).file_set(nullptr); backwall_btn.text_set("Set Backwall"); } })); diff --git a/src/examples/elementary/radio_cxx_example_01.cc b/src/examples/elementary/radio_cxx_example_01.cc index 5a3f30c75e..e72fe9f55e 100644 --- a/src/examples/elementary/radio_cxx_example_01.cc +++ b/src/examples/elementary/radio_cxx_example_01.cc @@ -1,6 +1,7 @@ // g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` radio_cxx_example_01.cc -o radio_cxx_example_01 #define EFL_CXXPERIMENTAL +#define EFL_BETA_API_SUPPORT #include #include diff --git a/src/examples/elementary/slider_cxx_example.cc b/src/examples/elementary/slider_cxx_example.cc index 90d815f9de..82846257cf 100644 --- a/src/examples/elementary/slider_cxx_example.cc +++ b/src/examples/elementary/slider_cxx_example.cc @@ -1,7 +1,7 @@ // g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` slider_cxx_example.cc -o slider_cxx_example #define EFL_CXXPERIMENTAL - +#define EFL_BETA_API_SUPPORT #include using namespace std::placeholders; @@ -27,23 +27,18 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl::ui::Slider sl2(instantiate, win); efl::ui::Image ic(instantiate, win); - ic.icon_set("home"); + ic.icon_set("folder"); ic.scalable_set(false, false); - sl2.content_set(ic); - - efl::ui::Image ic2(instantiate, win); - ic2.icon_set("folder"); - ic2.scalable_set(false, false); // FIXME: C++ part API needs special reference handling! This will show ERR! efl::eo::downcast(sl2.part_get("elm.swallow.end")) - .content_set(ic2); + .content_set(ic); sl2.hint_fill_set(true, false); bx.pack_end(sl2); efl::ui::Slider sl3(instantiate, win); sl3.range_value_set(1); - sl3.hint_min_set({220, 0}); + sl3.hint_size_min_set({220, 0}); sl3.hint_fill_set(true, false); bx.pack_end(sl3); @@ -57,14 +52,14 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) sl5.range_step_set(1); sl5.direction_set(EFL_UI_DIR_UP); sl5.hint_fill_set(true, false); - sl5.hint_min_set({0, 120}); + sl5.hint_size_min_set({0, 120}); bx.pack_end(sl5); efl::ui::Slider sl6(instantiate, win); sl6.direction_set(EFL_UI_DIR_HORIZONTAL); sl6.range_min_max_set(0, 10); sl6.hint_fill_set(false, true); - sl6.hint_weight_set(0, EFL_GFX_SIZE_HINT_EXPAND); + sl6.hint_weight_set(0, EFL_GFX_HINT_EXPAND); bx.pack_end(sl6); efl::ui::Slider sl7(instantiate, win); 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 bceb165b83..5120154715 100644 --- a/src/examples/elementary/sphere_hunter/evas_3d_sphere_hunter.c +++ b/src/examples/elementary/sphere_hunter/evas_3d_sphere_hunter.c @@ -14,8 +14,9 @@ * edje_cc sphere_hunter.edc * gcc -o evas_3d_sphere_hunter evas_3d_sphere_hunter.c -g `pkg-config --libs --cflags evas ecore elementary eina eo` -lm */ - -#define EFL_BETA_API_SUPPORT +#ifndef EFL_BETA_API_SUPPORT +# define EFL_BETA_API_SUPPORT +#endif #include #include @@ -323,7 +324,7 @@ _sphere_init(int precision) } static void -_restart_level(void *data, Evas_Object *btn, void *ev) +_restart_level(void *data, Evas_Object *btn EINA_UNUSED, void *ev EINA_UNUSED) { Eina_List *l = NULL; Eo *item = NULL; @@ -778,7 +779,7 @@ _animate_cubes(void *data) } EAPI_MAIN int -elm_main(int argc, char **argv) +elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) { Scene_Data data; Eina_Bool r = EINA_TRUE; diff --git a/src/examples/elementary/sphere_hunter/meson.build b/src/examples/elementary/sphere_hunter/meson.build new file mode 100644 index 0000000000..4ef08822ea --- /dev/null +++ b/src/examples/elementary/sphere_hunter/meson.build @@ -0,0 +1,31 @@ +examples = [ + 'evas_3d_sphere_hunter' +] + +edc_files = [ + 'sphere_hunter.edc' +] + +themes = [] + +foreach edc_file : edc_files + themes += custom_target('edje_cc_' + edc_file, + depends : edje_depends, + input : edc_file, + output : '@BASENAME@.edj', + command : edje_cc_exe + ['-beta', + '-id', elementary_img_data, + '-id', meson.current_source_dir(), + '-fd', meson.current_source_dir(), + '-sd', meson.current_source_dir(), + '-vd', meson.current_source_dir(), + '-dd', meson.current_source_dir(), + '-md', meson.current_source_dir(), + '-td', meson.current_source_dir(), + '@INPUT@', '@OUTPUT@'], + ) +endforeach + +foreach example : examples + executable(example, [example + '.c'] + themes, dependencies: [elementary, ecore]) +endforeach diff --git a/src/examples/elementary/table_cxx_example_02.cc b/src/examples/elementary/table_cxx_example_02.cc index 986cefc2e3..472fbef89d 100644 --- a/src/examples/elementary/table_cxx_example_02.cc +++ b/src/examples/elementary/table_cxx_example_02.cc @@ -20,22 +20,22 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl::canvas::Rectangle rect(instantiate, win); rect.color_set(255, 0, 0, 255); - rect.hint_min_set({100, 50}); + rect.hint_size_min_set({100, 50}); table.pack_table(rect, 0, 0, 2, 1); efl::canvas::Rectangle rect2(instantiate, win); rect2.color_set(0, 255, 0, 255); - rect2.hint_min_set({50, 100}); + rect2.hint_size_min_set({50, 100}); table.pack_table(rect2, 0, 1, 1, 2); efl::canvas::Rectangle rect3(instantiate, win); rect3.color_set(0, 0, 255, 255); - rect3.hint_min_set({50, 50}); + rect3.hint_size_min_set({50, 50}); table.pack_table(rect3, 1, 1, 1, 1); efl::canvas::Rectangle rect4(instantiate, win); rect4.color_set(255, 255, 0, 255); - rect4.hint_min_set({50, 50}); + rect4.hint_size_min_set({50, 50}); table.pack_table(rect4, 1, 2, 1, 1); } EFL_MAIN() diff --git a/src/examples/elementary/toolbar_cxx_example_01.cc b/src/examples/elementary/toolbar_cxx_example_01.cc index 5a884b96f7..6f4e83be89 100644 --- a/src/examples/elementary/toolbar_cxx_example_01.cc +++ b/src/examples/elementary/toolbar_cxx_example_01.cc @@ -7,6 +7,7 @@ #warning This example requires yet unfinished EO APIs +#define EFL_BETA_API_SUPPORT #include EAPI int @@ -22,7 +23,7 @@ elm_main(int argc, char* argv[]) { win_1.text_set("Toolbar"); win_1.win_name_set("toolbar"); - win_1.win_type_set(EFL_UI_WIN_BASIC); + win_1.win_type_set(EFL_UI_WIN_TYPE_BASIC); }); #if 0 @@ -77,7 +78,7 @@ elm_main(int argc, char* argv[]) elm::Widget photo_1(elm_photo_add(win_1._eo_ptr())); elm_photo_size_set(photo_1._eo_ptr(), 40); - efl_file_set(photo_1._eo_ptr(), "/opt/e/share/elementary/images/plant_01.jpg", nullptr); + efl_file_simple_load(photo_1._eo_ptr(), "/opt/e/share/elementary/images/plant_01.jpg", nullptr); photo_1.hint_weight_set(1, 1); photo_1.hint_align_set(0.5, 0.5); photo_1.visible_set(true); @@ -92,7 +93,7 @@ elm_main(int argc, char* argv[]) elm_table_pack(table_1._eo_ptr(), photo_2._eo_ptr(), 1, 0, 1, 1); elm::Widget photo_3(elm_photo_add(win_1._eo_ptr())); elm_photo_size_set(photo_3._eo_ptr(), 20); - efl_file_set(photo_3._eo_ptr(), "/opt/e/share/elementary/images/sky_01.jpg", nullptr); + efl_file_simple_load(photo_3._eo_ptr(), "/opt/e/share/elementary/images/sky_01.jpg", nullptr); photo_3.hint_weight_set(1, 1); photo_3.hint_align_set(0.5, 0.5); photo_3.visible_set(true); @@ -100,7 +101,7 @@ elm_main(int argc, char* argv[]) elm_table_pack(table_1._eo_ptr(), photo_3._eo_ptr(), 0, 1, 1, 1); elm::Widget photo_4(elm_photo_add(win_1._eo_ptr())); elm_photo_size_set(photo_4._eo_ptr(), 60); - efl_file_set(photo_4._eo_ptr(), "/opt/e/share/elementary/images/sky_02.jpg", nullptr); + efl_file_simple_load(photo_4._eo_ptr(), "/opt/e/share/elementary/images/sky_02.jpg", nullptr); photo_4.hint_weight_set(1, 1); photo_4.hint_align_set(0.5, 0.5); photo_4.visible_set(true); @@ -111,22 +112,22 @@ elm_main(int argc, char* argv[]) win_1.content_set(box_1); auto _item_2_selected_cb = std::bind([&] () { - efl_file_set(photo_1._eo_ptr(), "/opt/e/share/elementary/images/rock_01.jpg", nullptr); + efl_file_simple_load(photo_1._eo_ptr(), "/opt/e/share/elementary/images/rock_01.jpg", nullptr); }); efl::eolian::event_add(efl::ui::Selectable::selected_event, item_2, _item_2_selected_cb); auto _item_3_selected_cb = std::bind([&] () { - efl_file_set(photo_4._eo_ptr(), "/opt/e/share/elementary/images/wood_01.jpg", nullptr); + efl_file_simple_load(photo_4._eo_ptr(), "/opt/e/share/elementary/images/wood_01.jpg", nullptr); }); efl::eolian::event_add(efl::ui::Selectable::selected_event, item_3, _item_3_selected_cb); auto _item_4_selected_cb = std::bind([&] () { - efl_file_set(photo_4._eo_ptr(), "/opt/e/share/elementary/images/sky_03.jpg", nullptr); + efl_file_simple_load(photo_4._eo_ptr(), "/opt/e/share/elementary/images/sky_03.jpg", nullptr); }); efl::eolian::event_add(efl::ui::Selectable::selected_event, item_4, _item_4_selected_cb); auto _item_5_selected_cb = std::bind([&] () { - efl_file_set(photo_4._eo_ptr(), nullptr, nullptr); + efl_file_simple_load(photo_4._eo_ptr(), nullptr, nullptr); }); efl::eolian::event_add(efl::ui::Selectable::selected_event, item_5, _item_5_selected_cb); diff --git a/src/examples/elementary/web_example_01.c b/src/examples/elementary/web_example_01.c index 82b53053dd..7e38bbfba1 100644 --- a/src/examples/elementary/web_example_01.c +++ b/src/examples/elementary/web_example_01.c @@ -1,8 +1,10 @@ /* * gcc -o web_example_01 web_example_01.c `pkg-config --cflags --libs elementary ewebkit` -D_GNU_SOURCE */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE +#endif -#define _GNU_SOURCE #include #ifdef HAVE_ELEMENTARY_WEB #include diff --git a/src/examples/elementary/web_example_02.c b/src/examples/elementary/web_example_02.c index 9cffc3f854..3658583cab 100644 --- a/src/examples/elementary/web_example_02.c +++ b/src/examples/elementary/web_example_02.c @@ -1,8 +1,10 @@ /* * gcc -o web_example_02 web_example_02.c `pkg-config --cflags --libs elementary ewebkit` -D_GNU_SOURCE */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE +#endif -#define _GNU_SOURCE #include #ifdef HAVE_ELEMENTARY_WEB #include diff --git a/src/examples/emotion/emotion_basic_example.c b/src/examples/emotion/emotion_basic_example.c index 8f470041a7..04df0e802c 100644 --- a/src/examples/emotion/emotion_basic_example.c +++ b/src/examples/emotion/emotion_basic_example.c @@ -1,9 +1,6 @@ //Compile with: // gcc -o emotion_basic_example emotion_basic_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eo` -#ifndef EFL_EO_API_SUPPORT -# define EFL_EO_API_SUPPORT -#endif #ifndef EFL_BETA_API_SUPPORT # define EFL_BETA_API_SUPPORT #endif diff --git a/src/examples/emotion/emotion_border_example.c b/src/examples/emotion/emotion_border_example.c index 7a24b8dae5..8ece2d298a 100644 --- a/src/examples/emotion/emotion_border_example.c +++ b/src/examples/emotion/emotion_border_example.c @@ -1,8 +1,5 @@ //Compile with: // gcc -o emotion_border_example emotion_border_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eina eo` -#ifndef EFL_EO_API_SUPPORT -# define EFL_EO_API_SUPPORT -#endif #ifndef EFL_BETA_API_SUPPORT # define EFL_BETA_API_SUPPORT #endif diff --git a/src/examples/emotion/emotion_generic_example.c b/src/examples/emotion/emotion_generic_example.c index 0bd722a0cd..4ac996f33a 100644 --- a/src/examples/emotion/emotion_generic_example.c +++ b/src/examples/emotion/emotion_generic_example.c @@ -1,8 +1,5 @@ //Compile with: // gcc -o emotion_generic_example emotion_generic_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eina eo` -#ifndef EFL_EO_API_SUPPORT -# define EFL_EO_API_SUPPORT -#endif #ifndef EFL_BETA_API_SUPPORT # define EFL_BETA_API_SUPPORT #endif diff --git a/src/examples/emotion/emotion_generic_subtitle_example.c b/src/examples/emotion/emotion_generic_subtitle_example.c index 07c8973641..40543f44b2 100644 --- a/src/examples/emotion/emotion_generic_subtitle_example.c +++ b/src/examples/emotion/emotion_generic_subtitle_example.c @@ -1,9 +1,6 @@ //Compile with: // gcc -o emotion_generic_subtitle_example emotion_generic_subtitle_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eo` -#ifndef EFL_EO_API_SUPPORT -# define EFL_EO_API_SUPPORT -#endif #ifndef EFL_BETA_API_SUPPORT # define EFL_BETA_API_SUPPORT #endif diff --git a/src/examples/emotion/emotion_signals_example.c b/src/examples/emotion/emotion_signals_example.c index b5dc6257c7..dbc7a5b969 100644 --- a/src/examples/emotion/emotion_signals_example.c +++ b/src/examples/emotion/emotion_signals_example.c @@ -1,9 +1,6 @@ //Compile with: // gcc -o emotion_signals_example emotion_signals_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eo` -#ifndef EFL_EO_API_SUPPORT -# define EFL_EO_API_SUPPORT -#endif #ifndef EFL_BETA_API_SUPPORT # define EFL_BETA_API_SUPPORT #endif diff --git a/src/examples/eolian_cxx/ns_colourable.eo b/src/examples/eolian_cxx/ns_colourable.eo index 8fce408cf6..977dc4f3fc 100644 --- a/src/examples/eolian_cxx/ns_colourable.eo +++ b/src/examples/eolian_cxx/ns_colourable.eo @@ -5,7 +5,6 @@ class Ns.Colourable extends Efl.Object methods { rgb_24bits_constructor { [[RGB Constructor.]] - legacy: null; params { @in rgb: int; [[24-bit RGB Component.]] } diff --git a/src/examples/eolian_cxx/ns_colourablesquare.eo b/src/examples/eolian_cxx/ns_colourablesquare.eo index 733701f705..7ebc260798 100644 --- a/src/examples/eolian_cxx/ns_colourablesquare.eo +++ b/src/examples/eolian_cxx/ns_colourablesquare.eo @@ -14,7 +14,6 @@ class Ns.ColourableSquare extends Ns.Colourable } } size_constructor { - legacy: null; params { @in size: int; } diff --git a/src/examples/evas.mk b/src/examples/evas.mk index 3c6974ebb1..2e490cdb33 100644 --- a/src/examples/evas.mk +++ b/src/examples/evas.mk @@ -221,62 +221,6 @@ $(AM_CPPFLAGS) @EVAS_CFLAGS@ endif -if HAVE_CSHARP - -EXTRA_PROGRAMS += \ - evas/evas_mono_box_csharp \ - evas/evas_mono_image_csharp \ - evas/evas_mono_image2_csharp \ - evas/evas_mono_rectangle_csharp \ - evas/evas_mono_table_csharp \ - evas/evas_mono_text_csharp - - -evas_evas_mono_box_csharp_SOURCES = \ - evas/evas_mono_box.cs - -evas/evas_mono_box_csharp$(EXEEXT): $(evas_evas_mono_box_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll - $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^)) - -evas_evas_mono_image_csharp_SOURCES = \ - evas/evas_mono_image.cs - -evas/evas_mono_image_csharp$(EXEEXT): $(evas_evas_mono_image_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll - @rm -f $@ - $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^)) - -evas_evas_mono_image2_csharp_SOURCES = \ - evas/evas_mono_image2.cs - -evas/evas_mono_image2_csharp$(EXEEXT): $(evas_evas_mono_image2_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll - @rm -f $@ - $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^)) - -evas_evas_mono_rectangle_csharp_SOURCES = \ - evas/evas_mono_rectangle.cs - -evas/evas_mono_rectangle_csharp$(EXEEXT): $(evas_evas_mono_rectangle_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll - @rm -f $@ - $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^)) - -evas_evas_mono_table_csharp_SOURCES = \ - evas/evas_mono_table.cs - -evas/evas_mono_table_csharp$(EXEEXT): $(evas_evas_mono_table_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll - @rm -f $@ - $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^)) - -evas_evas_mono_text_csharp_SOURCES = \ - evas/evas_mono_text.cs - -evas/evas_mono_text_csharp$(EXEEXT): $(evas_evas_mono_text_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll - @rm -f $@ - $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^)) - -endif - - - EVAS_SRCS = \ evas/evas-aspect-hints.c \ evas/evas-box.c \ diff --git a/src/examples/evas/evas-3d-aabb.c b/src/examples/evas/evas-3d-aabb.c index dd4c1f0f27..99e3b98cce 100644 --- a/src/examples/evas/evas-3d-aabb.c +++ b/src/examples/evas/evas-3d-aabb.c @@ -14,7 +14,6 @@ #else #define PACKAGE_EXAMPLES_DIR "." #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include @@ -170,12 +169,12 @@ main(void) mesh = efl_add(EVAS_CANVAS3D_MESH_CLASS, evas); material = efl_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); - efl_file_set(mesh, model_path, NULL); + efl_file_simple_load(mesh, model_path, NULL); evas_canvas3d_mesh_frame_material_set(mesh, 0, material); evas_canvas3d_mesh_shader_mode_set(mesh, EVAS_CANVAS3D_SHADER_MODE_PHONG); texture = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); - efl_file_set(texture, image_path, NULL); + efl_file_simple_load(texture, image_path, NULL); evas_canvas3d_texture_filter_set(texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); evas_canvas3d_texture_wrap_set(texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); evas_canvas3d_material_texture_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture); diff --git a/src/examples/evas/evas-3d-blending.c b/src/examples/evas/evas-3d-blending.c index 667b671197..47271ff460 100644 --- a/src/examples/evas/evas-3d-blending.c +++ b/src/examples/evas/evas-3d-blending.c @@ -14,7 +14,6 @@ #include "config.h" #else #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include diff --git a/src/examples/evas/evas-3d-colorpick.c b/src/examples/evas/evas-3d-colorpick.c index 8c9ea3b54f..138ceb089a 100644 --- a/src/examples/evas/evas-3d-colorpick.c +++ b/src/examples/evas/evas-3d-colorpick.c @@ -19,7 +19,6 @@ #else #define PACKAGE_EXAMPLES_DIR "." #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include @@ -256,7 +255,7 @@ _init_sphere(void *this, const char *texture) evas_canvas3d_mesh_color_pick_enable_set(sphere->mesh, EINA_TRUE); sphere->texture = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); - efl_file_set(sphere->texture, texture, NULL); + efl_file_simple_load(sphere->texture, texture, NULL); evas_canvas3d_texture_filter_set(sphere->texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); evas_canvas3d_texture_wrap_set(sphere->texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); evas_canvas3d_material_texture_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, sphere->texture); diff --git a/src/examples/evas/evas-3d-cube-rotate.c b/src/examples/evas/evas-3d-cube-rotate.c index 25889024d1..d5b89b3037 100644 --- a/src/examples/evas/evas-3d-cube-rotate.c +++ b/src/examples/evas/evas-3d-cube-rotate.c @@ -16,7 +16,6 @@ #include "config.h" #else #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include diff --git a/src/examples/evas/evas-3d-cube.c b/src/examples/evas/evas-3d-cube.c index e8d04d4ea9..3fba86a147 100644 --- a/src/examples/evas/evas-3d-cube.c +++ b/src/examples/evas/evas-3d-cube.c @@ -12,7 +12,6 @@ #include "config.h" #else #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include diff --git a/src/examples/evas/evas-3d-cube2.c b/src/examples/evas/evas-3d-cube2.c index c8558b622b..493cea98ce 100644 --- a/src/examples/evas/evas-3d-cube2.c +++ b/src/examples/evas/evas-3d-cube2.c @@ -11,7 +11,6 @@ #else #define PACKAGE_EXAMPLES_DIR "." #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include @@ -168,7 +167,7 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_texture_data_set(data->texture0, EVAS_COLORSPACE_ARGB8888, 4, 4, &pixels0[0]); evas_canvas3d_texture_data_set(data->texture1, EVAS_COLORSPACE_ARGB8888, 4, 4, &pixels1[0]); - efl_file_set(data->texture_normal, normal_map_path, NULL); + efl_file_simple_load(data->texture_normal, normal_map_path, NULL); evas_canvas3d_material_texture_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture0); evas_canvas3d_material_texture_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture1); diff --git a/src/examples/evas/evas-3d-eet.c b/src/examples/evas/evas-3d-eet.c index da94e06d7e..5ecd79e350 100644 --- a/src/examples/evas/evas-3d-eet.c +++ b/src/examples/evas/evas-3d-eet.c @@ -18,7 +18,6 @@ #else #define PACKAGE_EXAMPLES_DIR "." #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include @@ -146,7 +145,7 @@ main(void) mesh2 = efl_add(EVAS_CANVAS3D_MESH_CLASS, evas); material = efl_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); - efl_file_set(mesh, input_model_path, NULL); + efl_file_simple_load(mesh, input_model_path, NULL); evas_canvas3d_mesh_frame_material_set(mesh, 0, material); evas_canvas3d_mesh_shader_mode_set(mesh, EVAS_CANVAS3D_SHADER_MODE_PHONG); @@ -165,7 +164,7 @@ main(void) efl_file_save(mesh, output_model_path, NULL, NULL); - efl_file_set(mesh2, output_model_path, NULL); + efl_file_simple_load(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_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH)); diff --git a/src/examples/evas/evas-3d-fog.c b/src/examples/evas/evas-3d-fog.c index 4c69dcac94..8bcd51b94e 100644 --- a/src/examples/evas/evas-3d-fog.c +++ b/src/examples/evas/evas-3d-fog.c @@ -10,7 +10,6 @@ #include "config.h" #else #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include diff --git a/src/examples/evas/evas-3d-frustum.c b/src/examples/evas/evas-3d-frustum.c index 02f5bba05e..6aacecc825 100644 --- a/src/examples/evas/evas-3d-frustum.c +++ b/src/examples/evas/evas-3d-frustum.c @@ -20,7 +20,6 @@ #else #define PACKAGE_EXAMPLES_DIR "." #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include @@ -352,7 +351,7 @@ _mesh_setup_model(Scene_Data *data) data->material_model = efl_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); data->texture_model = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); - efl_file_set(data->texture_model, texture_path, NULL); + efl_file_simple_load(data->texture_model, texture_path, NULL); evas_canvas3d_texture_filter_set(data->texture_model, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); evas_canvas3d_texture_wrap_set(data->texture_model, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); @@ -367,7 +366,7 @@ _mesh_setup_model(Scene_Data *data) evas_canvas3d_material_texture_set(data->material_model, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture_model); evas_canvas3d_material_shininess_set(data->material_model, 100.0); - efl_file_set(data->mesh_model, mesh_path, NULL); + efl_file_simple_load(data->mesh_model, mesh_path, NULL); evas_canvas3d_mesh_frame_material_set(data->mesh_model, 0, data->material_model); evas_canvas3d_mesh_shader_mode_set(data->mesh_model, EVAS_CANVAS3D_SHADER_MODE_DIFFUSE); } diff --git a/src/examples/evas/evas-3d-hull.c b/src/examples/evas/evas-3d-hull.c index 0e13705c36..6ca12837dc 100644 --- a/src/examples/evas/evas-3d-hull.c +++ b/src/examples/evas/evas-3d-hull.c @@ -18,7 +18,6 @@ #else #define PACKAGE_EXAMPLES_DIR "." #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include @@ -87,7 +86,7 @@ int rr; #define MODEL_MESH_INIT(name, model, shade) \ data->mesh_##name = efl_add(EVAS_CANVAS3D_MESH_CLASS, evas); \ - efl_file_set(data->mesh_##name, model, NULL); \ + efl_file_simple_load(data->mesh_##name, model, NULL); \ evas_canvas3d_mesh_vertex_assembly_set(data->mesh_##name, EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES); \ evas_canvas3d_mesh_shader_mode_set(data->mesh_##name, EVAS_CANVAS3D_SHADER_MODE_##shade); \ evas_canvas3d_mesh_frame_material_set(data->mesh_##name, 0, data->material); diff --git a/src/examples/evas/evas-3d-md2.c b/src/examples/evas/evas-3d-md2.c index adfb6962a0..4c93b54ec0 100644 --- a/src/examples/evas/evas-3d-md2.c +++ b/src/examples/evas/evas-3d-md2.c @@ -11,7 +11,6 @@ #else #define PACKAGE_EXAMPLES_DIR "." #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include @@ -124,12 +123,12 @@ main(void) mesh = efl_add(EVAS_CANVAS3D_MESH_CLASS, evas); material = efl_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); - efl_file_set(mesh, model_path, NULL); + efl_file_simple_load(mesh, model_path, NULL); evas_canvas3d_mesh_frame_material_set(mesh, 0, material); evas_canvas3d_mesh_shader_mode_set(mesh, EVAS_CANVAS3D_SHADER_MODE_PHONG); texture = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); - efl_file_set(texture, image_path, NULL); + efl_file_simple_load(texture, image_path, NULL); evas_canvas3d_texture_filter_set(texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); evas_canvas3d_texture_wrap_set(texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); evas_canvas3d_material_texture_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture); diff --git a/src/examples/evas/evas-3d-mmap-set.c b/src/examples/evas/evas-3d-mmap-set.c index 360555501e..df8bdbdd4d 100644 --- a/src/examples/evas/evas-3d-mmap-set.c +++ b/src/examples/evas/evas-3d-mmap-set.c @@ -15,7 +15,6 @@ #else #define PACKAGE_EXAMPLES_DIR "." #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include @@ -33,7 +32,7 @@ snprintf(buffer, PATH_MAX, "%s%s", template_path, #extention); \ extention##_file = eina_file_open(buffer , 0); \ mesh_##extention = efl_add(EVAS_CANVAS3D_MESH_CLASS, evas); \ - efl_file_mmap_set(mesh_##extention, extention##_file, NULL); \ + efl_file_simple_mmap_load(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_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH)); \ diff --git a/src/examples/evas/evas-3d-obj.c b/src/examples/evas/evas-3d-obj.c index 65f57ecffd..6bf668ba09 100644 --- a/src/examples/evas/evas-3d-obj.c +++ b/src/examples/evas/evas-3d-obj.c @@ -19,7 +19,6 @@ #else #define PACKAGE_EXAMPLES_DIR "." #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include @@ -47,7 +46,7 @@ #define ADD_OBJ_MESH(path, Y, Z, num, shade_mode, name_of_material) \ mesh[num] = efl_add(EVAS_CANVAS3D_MESH_CLASS, evas); \ snprintf(full_file_path, sizeof(full_file_path), "%s.obj", path); \ - efl_file_set(mesh[num], full_file_path, NULL); \ + efl_file_simple_load(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_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH)); \ @@ -65,7 +64,7 @@ #define ADD_TEXTURE(name, path) \ name = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); \ - efl_file_set(name, path, NULL); \ + efl_file_simple_load(name, path, NULL); \ evas_canvas3d_texture_filter_set(name, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, \ EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); \ evas_canvas3d_texture_wrap_set(name, EVAS_CANVAS3D_WRAP_MODE_REPEAT, \ diff --git a/src/examples/evas/evas-3d-parallax-occlusion.c b/src/examples/evas/evas-3d-parallax-occlusion.c index 83188c0538..65d1880559 100644 --- a/src/examples/evas/evas-3d-parallax-occlusion.c +++ b/src/examples/evas/evas-3d-parallax-occlusion.c @@ -13,7 +13,6 @@ #else #define PACKAGE_EXAMPLES_DIR "." #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include @@ -138,9 +137,9 @@ _mesh_setup(Scene_Data *data) data->texture_rocks = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); data->texture_rocks_n = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); - efl_file_set(data->texture_rocks, rock_diffuse, NULL); + efl_file_simple_load(data->texture_rocks, rock_diffuse, NULL); evas_canvas3d_texture_wrap_set(data->texture_rocks, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); - efl_file_set(data->texture_rocks_n, rock_n_and_height_map, NULL); + efl_file_simple_load(data->texture_rocks_n, rock_n_and_height_map, NULL); evas_canvas3d_texture_wrap_set(data->texture_rocks_n, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); evas_canvas3d_material_texture_set(data->material_rocks, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, data->texture_rocks_n); @@ -160,9 +159,9 @@ _mesh_setup(Scene_Data *data) data->texture_wood = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); data->texture_four_n = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); - efl_file_set(data->texture_wood, wood_diffuse, NULL); + efl_file_simple_load(data->texture_wood, wood_diffuse, NULL); evas_canvas3d_texture_wrap_set(data->texture_wood, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); - efl_file_set(data->texture_four_n, wood_n_and_height_map, NULL); + efl_file_simple_load(data->texture_four_n, wood_n_and_height_map, NULL); evas_canvas3d_texture_wrap_set(data->texture_four_n, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); evas_canvas3d_material_texture_set(data->material_wood, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, data->texture_four_n); diff --git a/src/examples/evas/evas-3d-pick.c b/src/examples/evas/evas-3d-pick.c index 1e2f3d6ead..5ed8067dc3 100644 --- a/src/examples/evas/evas-3d-pick.c +++ b/src/examples/evas/evas-3d-pick.c @@ -15,7 +15,6 @@ #else #define PACKAGE_EXAMPLES_DIR "." #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include @@ -143,7 +142,7 @@ main(void) material = efl_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); texture_diffuse = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); - efl_file_set(texture_diffuse, image_path, NULL); + efl_file_simple_load(texture_diffuse, image_path, NULL); evas_canvas3d_texture_filter_set(texture_diffuse, EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR, EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR); evas_canvas3d_material_texture_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture_diffuse); evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); diff --git a/src/examples/evas/evas-3d-ply.c b/src/examples/evas/evas-3d-ply.c index 821195b30e..ba0b912d0b 100644 --- a/src/examples/evas/evas-3d-ply.c +++ b/src/examples/evas/evas-3d-ply.c @@ -16,7 +16,6 @@ #else #define PACKAGE_EXAMPLES_DIR "." #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include @@ -159,7 +158,7 @@ main(void) material = efl_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); texture = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); - efl_file_set(texture, image_path, NULL); + efl_file_simple_load(texture, image_path, NULL); evas_canvas3d_texture_filter_set(texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); evas_canvas3d_texture_wrap_set(texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); evas_canvas3d_material_texture_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture); @@ -182,7 +181,7 @@ main(void) mesh[i] = efl_add(EVAS_CANVAS3D_MESH_CLASS, evas); snprintf(buffer, PATH_MAX, "%s%s", input_template, file_name[i % 8]); - efl_file_set(mesh[i], buffer, NULL); + efl_file_simple_load(mesh[i], buffer, NULL); evas_canvas3d_mesh_frame_material_set(mesh[i], 0, material); evas_canvas3d_mesh_shader_mode_set(mesh[i], draw_mode[(i % 8)]); @@ -191,7 +190,7 @@ main(void) if (i > 15) { - efl_file_set(mesh[i], buffer, NULL); + efl_file_simple_load(mesh[i], buffer, NULL); evas_canvas3d_mesh_frame_material_set(mesh[i], 0, material); evas_canvas3d_mesh_shader_mode_set(mesh[i], draw_mode[(i % 8)]); } diff --git a/src/examples/evas/evas-3d-proxy.c b/src/examples/evas/evas-3d-proxy.c index 6445ee9564..1a671f811d 100644 --- a/src/examples/evas/evas-3d-proxy.c +++ b/src/examples/evas/evas-3d-proxy.c @@ -12,7 +12,6 @@ #include "config.h" #else #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include diff --git a/src/examples/evas/evas-3d-shadows.c b/src/examples/evas/evas-3d-shadows.c index ae06a3631a..eaa2f02f55 100644 --- a/src/examples/evas/evas-3d-shadows.c +++ b/src/examples/evas/evas-3d-shadows.c @@ -31,7 +31,6 @@ #else #define PACKAGE_EXAMPLES_DIR "." #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include @@ -262,12 +261,12 @@ _fence_setup(Body_3D *fence) Eo *texture = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); evas_canvas3d_texture_atlas_enable_set(texture, EINA_FALSE); - efl_file_set(texture, PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/grid.png", NULL); + efl_file_simple_load(texture, PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/grid.png", NULL); evas_canvas3d_texture_filter_set(texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); evas_canvas3d_texture_wrap_set(texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); Eo *texture1 = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); evas_canvas3d_texture_atlas_enable_set(texture1, EINA_FALSE); - efl_file_set(texture1, PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/grid_n.png", NULL); + efl_file_simple_load(texture1, PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/grid_n.png", NULL); evas_canvas3d_texture_filter_set(texture1, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); evas_canvas3d_texture_wrap_set(texture1, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); fence->material = efl_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); @@ -344,7 +343,7 @@ static void _model_setup(Body_3D *model) { model->texture = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); - efl_file_set(model->texture, image_path, NULL); + efl_file_simple_load(model->texture, image_path, NULL); evas_canvas3d_texture_filter_set(model->texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); evas_canvas3d_texture_wrap_set(model->texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); model->material = efl_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); @@ -358,7 +357,7 @@ _model_setup(Body_3D *model) model->mesh = efl_add(EVAS_CANVAS3D_MESH_CLASS, evas); - efl_file_set(model->mesh, model_path, NULL); + efl_file_simple_load(model->mesh, model_path, NULL); evas_canvas3d_mesh_frame_material_set(model->mesh, 0, model->material); evas_canvas3d_mesh_shader_mode_set(model->mesh, EVAS_CANVAS3D_SHADER_MODE_PHONG); @@ -373,7 +372,7 @@ static void _billboard_setup(Scene_Data *data) { data->billboard.texture = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); - efl_file_set(data->billboard.texture, b_image_path, NULL); + efl_file_simple_load(data->billboard.texture, b_image_path, NULL); evas_canvas3d_texture_filter_set(data->billboard.texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); evas_canvas3d_texture_wrap_set(data->billboard.texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); diff --git a/src/examples/evas/evas-3d-static-lod.c b/src/examples/evas/evas-3d-static-lod.c index d7672a48b5..3b08380f1c 100644 --- a/src/examples/evas/evas-3d-static-lod.c +++ b/src/examples/evas/evas-3d-static-lod.c @@ -16,7 +16,6 @@ #else #define PACKAGE_EXAMPLES_DIR "." #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include @@ -179,14 +178,14 @@ _mesh_setup(Scene_Data *data) Eo *mesh = efl_add(EVAS_CANVAS3D_MESH_CLASS, evas); Eina_Stringshare *str = eina_stringshare_printf("%s%d%s", model_path, i, ".obj"); - efl_file_set(mesh, str, NULL); + efl_file_simple_load(mesh, str, NULL); evas_canvas3d_mesh_frame_material_set(mesh, 0, data->material); evas_canvas3d_mesh_shader_mode_set(mesh, EVAS_CANVAS3D_SHADER_MODE_PHONG); evas_canvas3d_mesh_lod_boundary_set(mesh, distances[i], distances[i + 1]); evas_canvas3d_node_mesh_add(data->lod_mesh_node1, mesh); mesh = efl_add(EVAS_CANVAS3D_MESH_CLASS, evas); - efl_file_set(mesh, str, NULL); + efl_file_simple_load(mesh, str, NULL); evas_canvas3d_mesh_frame_material_set(mesh, 0, data->material); evas_canvas3d_mesh_shader_mode_set(mesh, EVAS_CANVAS3D_SHADER_MODE_PHONG); evas_canvas3d_mesh_lod_boundary_set(mesh, m_distances[i], m_distances[i + 1]); diff --git a/src/examples/evas/evas-hints.c b/src/examples/evas/evas-hints.c index d5f1d37b21..2e55da773a 100644 --- a/src/examples/evas/evas-hints.c +++ b/src/examples/evas/evas-hints.c @@ -119,7 +119,7 @@ _print_rect_stats(Evas_Object *rect) printf("\talign hints: h(%f), v(%f)\n", x, y); - cmin = efl_gfx_size_hint_combined_min_get(rect); + cmin = efl_gfx_hint_size_combined_min_get(rect); printf("\tmin. size hints: h(%d), v(%d)\n", cmin.w, cmin.h); diff --git a/src/examples/evas/evas-map-aa-eo.c b/src/examples/evas/evas-map-aa-eo.c index 5a68393c75..b8156ad2b9 100644 --- a/src/examples/evas/evas-map-aa-eo.c +++ b/src/examples/evas/evas-map-aa-eo.c @@ -16,10 +16,6 @@ # define EFL_BETA_API_SUPPORT #endif -#ifndef EFL_EO_API_SUPPORT -# define EFL_EO_API_SUPPORT -#endif - #include #include #include @@ -60,15 +56,15 @@ static struct example_data d = static void update(void) { - efl_gfx_map_coord_absolute_set(d.target1, 0, d.px1, d.py1, 0); - efl_gfx_map_coord_absolute_set(d.target1, 1, d.px2, d.py2, 0); - efl_gfx_map_coord_absolute_set(d.target1, 2, d.px3, d.py3, 0); - efl_gfx_map_coord_absolute_set(d.target1, 3, d.px4, d.py4, 0); + efl_gfx_mapping_coord_absolute_set(d.target1, 0, d.px1, d.py1, 0); + efl_gfx_mapping_coord_absolute_set(d.target1, 1, d.px2, d.py2, 0); + efl_gfx_mapping_coord_absolute_set(d.target1, 2, d.px3, d.py3, 0); + efl_gfx_mapping_coord_absolute_set(d.target1, 3, d.px4, d.py4, 0); - efl_gfx_map_coord_absolute_set(d.target2, 0, d.px1 + 400, d.py1, 0); - efl_gfx_map_coord_absolute_set(d.target2, 1, d.px2 + 400, d.py2, 0); - efl_gfx_map_coord_absolute_set(d.target2, 2, d.px3 + 400, d.py3, 0); - efl_gfx_map_coord_absolute_set(d.target2, 3, d.px4 + 400, d.py4, 0); + efl_gfx_mapping_coord_absolute_set(d.target2, 0, d.px1 + 400, d.py1, 0); + efl_gfx_mapping_coord_absolute_set(d.target2, 1, d.px2 + 400, d.py2, 0); + efl_gfx_mapping_coord_absolute_set(d.target2, 2, d.px3 + 400, d.py3, 0); + efl_gfx_mapping_coord_absolute_set(d.target2, 3, d.px4 + 400, d.py4, 0); } static void diff --git a/src/examples/evas/evas-map-utils-eo.c b/src/examples/evas/evas-map-utils-eo.c index e1767cd1c3..1ea812bed1 100644 --- a/src/examples/evas/evas-map-utils-eo.c +++ b/src/examples/evas/evas-map-utils-eo.c @@ -19,10 +19,6 @@ # define EFL_BETA_API_SUPPORT #endif -#ifndef EFL_EO_API_SUPPORT -# define EFL_EO_API_SUPPORT -#endif - #include #include @@ -83,68 +79,68 @@ _anim_cb(void *data) evas_output_size_get(ad->canvas, &win_w, &win_h); o = evas_object_name_find(ad->canvas, "obj1"); - efl_gfx_map_reset(o); - efl_gfx_map_rotate(o, 3 * f, NULL, 0.5, 0.5); - 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_mapping_reset(o); + efl_gfx_mapping_rotate(o, 3 * f, NULL, 0.5, 0.5); + efl_gfx_mapping_smooth_set(o, ad->smooth); + efl_gfx_mapping_alpha_set(o, ad->alpha); + efl_gfx_mapping_color_set(o, -1, r, g, b, a); o = evas_object_name_find(ad->canvas, "obj2"); 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. / size.h, 0); + efl_gfx_mapping_reset(o); + efl_gfx_mapping_smooth_set(o, ad->smooth); + efl_gfx_mapping_alpha_set(o, ad->alpha); + efl_gfx_mapping_color_set(o, -1, r, g, b, a); + efl_gfx_mapping_translate(o, 0, 0, 100); + efl_gfx_mapping_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., + efl_gfx_mapping_lighting_3d(o, ad->canvas, 0.5, 0.5, -100., 255, 255, 255, 0, 0, 0); } o = evas_object_name_find(ad->canvas, "obj3"); 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, size.h/2, -20); - efl_gfx_map_rotate_3d(o, 20, f * 6, 0, NULL, 0.5, 0.5, size.w / 2); + efl_gfx_mapping_reset(o); + efl_gfx_mapping_smooth_set(o, ad->smooth); + efl_gfx_mapping_alpha_set(o, ad->alpha); + efl_gfx_mapping_color_set(o, -1, r, g, b, a); + efl_gfx_mapping_translate(o, 0, size.h/2, -20); + efl_gfx_mapping_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); + efl_gfx_mapping_perspective_3d(o, NULL, 0.5, 0.5, 0, 256); if (ad->apply_lighting) { evas_pointer_canvas_xy_get(ad->canvas, &mx, &my); - efl_gfx_map_lightning_3d(o, ad->canvas, + efl_gfx_mapping_lighting_3d(o, ad->canvas, (double) mx / win_w, (double) my / win_h, -256, 255, 255, 255, 0, 0, 0); } if (ad->backface_culling) - efl_gfx_entity_visible_set(o, efl_gfx_map_clockwise_get(o)); + efl_gfx_entity_visible_set(o, efl_gfx_mapping_clockwise_get(o)); else efl_gfx_entity_visible_set(o, 1); o = evas_object_name_find(ad->canvas, "obj4"); 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); - efl_gfx_map_coord_absolute_set(o, 0, rect.x, rect.y + rect.h, 0); - efl_gfx_map_coord_absolute_set(o, 1, rect.x + rect.w, rect.y + rect.h, 0); - efl_gfx_map_coord_absolute_set(o, 2, win_w - 10, win_h - 30, 0); - efl_gfx_map_coord_absolute_set(o, 3, (win_w / 2) + 10, win_h - 30, 0); - efl_gfx_map_uv_set(o, 0, 0, 1); - efl_gfx_map_uv_set(o, 1, 1, 1); - efl_gfx_map_uv_set(o, 2, 1, 2. / 3.); - efl_gfx_map_uv_set(o, 3, 0, 2. / 3.); - efl_gfx_map_color_set(o, 0, 200, 200, 200, 150); - efl_gfx_map_color_set(o, 1, 200, 200, 200, 150); - efl_gfx_map_color_set(o, 2, 0, 0, 0, 0); - efl_gfx_map_color_set(o, 3, 0, 0, 0, 0); + efl_gfx_mapping_reset(o); + efl_gfx_mapping_smooth_set(o, ad->smooth); + efl_gfx_mapping_alpha_set(o, ad->alpha); + efl_gfx_mapping_coord_absolute_set(o, 0, rect.x, rect.y + rect.h, 0); + efl_gfx_mapping_coord_absolute_set(o, 1, rect.x + rect.w, rect.y + rect.h, 0); + efl_gfx_mapping_coord_absolute_set(o, 2, win_w - 10, win_h - 30, 0); + efl_gfx_mapping_coord_absolute_set(o, 3, (win_w / 2) + 10, win_h - 30, 0); + efl_gfx_mapping_uv_set(o, 0, 0, 1); + efl_gfx_mapping_uv_set(o, 1, 1, 1); + efl_gfx_mapping_uv_set(o, 2, 1, 2. / 3.); + efl_gfx_mapping_uv_set(o, 3, 0, 2. / 3.); + efl_gfx_mapping_color_set(o, 0, 200, 200, 200, 150); + efl_gfx_mapping_color_set(o, 1, 200, 200, 200, 150); + efl_gfx_mapping_color_set(o, 2, 0, 0, 0, 0); + efl_gfx_mapping_color_set(o, 3, 0, 0, 0, 0); ad->frame = (ad->frame + 1) % 60; diff --git a/src/examples/evas/evas-object-manipulation-eo.c b/src/examples/evas/evas-object-manipulation-eo.c index 551d2873f7..7ba391acc9 100644 --- a/src/examples/evas/evas-object-manipulation-eo.c +++ b/src/examples/evas/evas-object-manipulation-eo.c @@ -14,7 +14,6 @@ #include "config.h" #else #define PACKAGE_EXAMPLES_DIR "." -#define EFL_EO_API_SUPPORT #define EFL_BETA_API_SUPPORT #endif @@ -122,15 +121,15 @@ _on_keydown(void *data EINA_UNUSED, printf("Toggling clipping "); Evas_Object *clip = NULL; - clip = efl_canvas_object_clip_get(d.img); + clip = efl_canvas_object_clipper_get(d.img); if (clip == d.clipper) { - efl_canvas_object_clip_set(d.img, NULL); + efl_canvas_object_clipper_set(d.img, NULL); printf("off\n"); } else { - efl_canvas_object_clip_set(d.img, d.clipper); + efl_canvas_object_clipper_set(d.img, d.clipper); printf("on\n"); } return; @@ -193,8 +192,9 @@ main(void) * So it's possible to decrement refcount, and 'image' object * will be deleted automatically by parent.*/ - efl_file_set(d.img, img_path, NULL); - err = efl_file_load_error_get(d.img); + if (efl_file_set(d.img, img_path)) goto panic; + + err = efl_file_load(d.img); if (err != EVAS_LOAD_ERROR_NONE) { @@ -211,8 +211,8 @@ main(void) /* border on the image's clipper, here just to emphasize its position */ d.clipper_border = efl_add(EFL_CANVAS_IMAGE_CLASS, d.canvas); - efl_file_set(d.clipper_border, border_img_path, NULL); - err = efl_file_load_error_get(d.clipper_border); + if (efl_file_set(d.clipper_border, border_img_path)) goto panic; + err = efl_file_load(d.clipper_border); if (err != EVAS_LOAD_ERROR_NONE) { @@ -236,7 +236,7 @@ main(void) 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); + efl_canvas_object_clipper_set(d.img, d.clipper); printf("%s", commands); diff --git a/src/examples/evas/evas-vg-batman.c b/src/examples/evas/evas-vg-batman.c index 650709f250..8625366962 100644 --- a/src/examples/evas/evas-vg-batman.c +++ b/src/examples/evas/evas-vg-batman.c @@ -22,10 +22,6 @@ #define EFL_BETA_API_SUPPORT #endif -#ifndef EFL_EO_API_SUPPORT -#define EFL_EO_API_SUPPORT -#endif - #include #include #include diff --git a/src/examples/evas/evas-vg-simple.c b/src/examples/evas/evas-vg-simple.c index 36b8baaf55..ef128d511e 100644 --- a/src/examples/evas/evas-vg-simple.c +++ b/src/examples/evas/evas-vg-simple.c @@ -43,10 +43,6 @@ #define EFL_BETA_API_SUPPORT #endif -#ifndef EFL_EO_API_SUPPORT -#define EFL_EO_API_SUPPORT -#endif - #include #include #include diff --git a/src/examples/evas/evas_cxx_rectangle.cc b/src/examples/evas/evas_cxx_rectangle.cc index 464bed96aa..7966d62e1b 100644 --- a/src/examples/evas/evas_cxx_rectangle.cc +++ b/src/examples/evas/evas_cxx_rectangle.cc @@ -14,8 +14,8 @@ #include #include -#include "canvas/evas_canvas.eo.hh" -#include "canvas/evas_image.eo.hh" +#include "canvas/evas_canvas_eo.hh" +#include "canvas/evas_image_eo.hh" #include "canvas/evas_rectangle.eo.hh" #define WIDTH (320) diff --git a/src/examples/evas/evas_mono_box.cs b/src/examples/evas/evas_mono_box.cs deleted file mode 100644 index dbfd15e372..0000000000 --- a/src/examples/evas/evas_mono_box.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Runtime.CompilerServices; - -public class MyBox : Evas.Box -{ - public MyBox(Efl.Object 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); - [DllImport("evas")] static extern void evas_object_box_layout_horizontal(IntPtr obj, IntPtr data, IntPtr privdata); - [DllImport("evas")] static extern IntPtr evas_object_evas_get(IntPtr obj); - [DllImport("evas")] static extern void evas_event_freeze(IntPtr obj); - [DllImport("evas")] static extern void evas_event_thaw(IntPtr obj); - - override public void CalculateGroup() - { - IntPtr evas = evas_object_evas_get(NativeHandle); - evas_event_freeze(evas); - Console.WriteLine("called group_calculate"); - /* layouting_set(true); */ - evas_obj_box_layout_vertical(NativeHandle, IntPtr.Zero, IntPtr.Zero); - /* layouting_set(false); */ - /* children_changed_set(false); */ - evas_event_thaw(evas); - } -} - -class TestMain -{ - static void Main(string[] args) - { - Efl.All.Init(); - - Efl.Loop loop = new Efl.Loop(); - - - EcoreEvas ecore_evas = new EcoreEvas(); - - Efl.Canvas.Object canvas = ecore_evas.canvas; - canvas.SetVisible(true); - - Efl.Object parent = canvas.GetParent(); - System.Diagnostics.Debug.Assert(parent.NativeHandle != IntPtr.Zero); - - Evas.Box box = new MyBox(canvas); - Eina.Size2D size = new Eina.Size2D(); - - size.W = 320; - size.H = 240; - - box.SetSize(size); - box.SetVisible(true); - - Efl.Canvas.Rectangle rect = new Efl.Canvas.Rectangle(canvas); - rect.SetColor(0, 0, 255, 255); - size.W = 320; - size.H = 120; - rect.SetSize(size); - rect.SetVisible(true); - box.Append(rect); - - Efl.Canvas.Rectangle rect2 = new Efl.Canvas.Rectangle(canvas); - rect2.SetColor(0, 255, 0, 255); - rect2.SetSize(size); - rect2.SetVisible(true); - box.Append(rect2); - - loop.Begin(); - - Efl.All.Shutdown(); - } -} diff --git a/src/examples/evas/evas_mono_image.cs b/src/examples/evas/evas_mono_image.cs deleted file mode 100644 index 865aa42502..0000000000 --- a/src/examples/evas/evas_mono_image.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Runtime.CompilerServices; - -class TestMain -{ - static int WIDTH = 320; - static int HEIGHT = 240; - - Evas.Image image; - - - static string ImagePath([CallerFilePath] string folder="") - { - return System.IO.Path.GetDirectoryName(folder); - } - - public TestMain(Evas.Image image) - { - this.image = image; - } - - static void Main(string[] args) - { - Efl.All.Init(); - - Efl.Loop loop = new Efl.Loop(); - - EcoreEvas ecore_evas = new EcoreEvas(); - Eina.Size2D size = new Eina.Size2D(); - - Efl.Canvas.Object canvas = ecore_evas.canvas; - canvas.SetVisible(true); - - Efl.Object parent = canvas.GetParent(); - System.Diagnostics.Debug.Assert(parent.NativeHandle != IntPtr.Zero); - - Efl.Canvas.Rectangle bg = new Efl.Canvas.Rectangle(canvas); - bg.SetColor(255, 255, 255, 255); - size.W = WIDTH; - size.H = HEIGHT; - bg.SetSize(size); - bg.SetVisible(true); - - string valid_path = args[0]; - Evas.Image image = new Evas.Image(canvas); - image.SetFile(valid_path, null); - - /* FIXME evas-image uses error handling code from - * evas_object_image_load_error_get, which seems to be not available - * Efl.image.load.State state = image.load_error_get(); */ - - // FIXME missing move - Eina.Rect rect = new Eina.Rect(); - - rect.X = 0; - rect.Y = 0; - rect.W = WIDTH / 2; - rect.H = HEIGHT / 2; - image.SetFill(rect); - - size.W = WIDTH / 2; - size.H = HEIGHT / 2; - image.SetSize(size); - image.SetVisible(true); - - rect = image.GetFill(); - rect.Y -= 50; - rect.W += 100; - image.SetFill(rect); - - TestMain listener = new TestMain(image); - - // TODO handle key events in order to alter the image like the C - // example. Meanwhile, just set some w fill - /* EventListener callback = new EventListener(); */ - - /* bg.key_focus_set(true); */ - /* bg.event_callback_priority_add(Evas.Callback_Type.Key_down, */ - /* Efl.Callback_Priority.Default, */ - /* callback, null); */ - - loop.Begin(); - - Efl.All.Shutdown(); - } - - public void on_key_down(object sender, EventArgs e) - { - Console.WriteLine("on_key_down called"); - } -} - - diff --git a/src/examples/evas/evas_mono_image2.cs b/src/examples/evas/evas_mono_image2.cs deleted file mode 100644 index 0ad8fb0872..0000000000 --- a/src/examples/evas/evas_mono_image2.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Runtime.CompilerServices; - -class TestMain -{ - static int WIDTH = 320; - static int HEIGHT = 240; - - - static void Main(string[] args) - { - Efl.All.Init(); - - 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; - canvas.SetVisible(true); - - Efl.Canvas.Rectangle bg = new Efl.Canvas.Rectangle(canvas); - bg.SetColor(255, 255, 255, 255); - pos.X = 0; - pos.Y = 0; - bg.SetPosition(pos); - size.W = WIDTH; - size.H = HEIGHT; - bg.SetSize(size); - bg.SetVisible(true); - - string path = args[0]; - Evas.Image logo = new Evas.Image(canvas); - logo.SetFillAuto(true); - - // TODO add preloaded support (depends on events) - - logo.SetFile(path, null); - size.W = WIDTH / 2; - size.H = HEIGHT / 2; - logo.SetSize(size); - - // TODO add a bunch of key/mouse handlers - - logo.SetVisible(true); - - int[] pixels = new int[(WIDTH/4) * (HEIGHT / 4)]; - System.Random generator = new System.Random(); - for (int i = 0; i < pixels.Length; i++) { - pixels[i] = generator.Next(); - } - - Evas.Image noise_img = new Evas.Image(canvas); - size.W = WIDTH / 4; - size.H = HEIGHT / 4; - noise_img.SetSize(size); - // FIXME Add a way to set the pixels. - // noise_img.data_set(pixels); - noise_img.SetFillAuto(true); - pos.X = WIDTH * 5 / 8; - pos.Y = HEIGHT / 8; - noise_img.SetPosition(pos); - 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.Proxy(canvas); - proxy_img.SetSource(noise_img); - pos.X = WIDTH / 2; - pos.Y = HEIGHT / 2; - proxy_img.SetPosition(pos); - size.W = WIDTH / 2; - size.H = HEIGHT / 2; - proxy_img.SetSize(size); - proxy_img.SetVisible(true); - - loop.Begin(); - } -} - - diff --git a/src/examples/evas/evas_mono_rectangle.cs b/src/examples/evas/evas_mono_rectangle.cs deleted file mode 100644 index 85afbd2e61..0000000000 --- a/src/examples/evas/evas_mono_rectangle.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; - -class TestMain -{ - private static int[,] colors = new int[,] { - {255, 0, 0}, - {0, 255, 0}, - {0, 0, 255} - }; - - static void Main(string[] args) - { - int color_index = 0; - - Efl.All.Init(); - - Efl.Loop loop = new Efl.Loop(); - EcoreEvas ecore_evas = new EcoreEvas(); - Efl.Canvas.Object canvas = ecore_evas.canvas; - canvas.SetVisible(true); - - Efl.Object parent = canvas.GetParent(); - System.Diagnostics.Debug.Assert(parent.NativeHandle != IntPtr.Zero); - - 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; - size.H = 480; - rect.SetSize(size); - rect.SetVisible(true); - - canvas.KeyDownEvt += (object sender, Efl.Input.InterfaceKeyDownEvt_Args e) => { - color_index = (color_index + 1) % 3; - Console.WriteLine("Key Down"); - Console.WriteLine("Got key obj at {0}", e.arg.NativeHandle.ToString("X")); - Console.WriteLine("Got key_get() == [{0}]", e.arg.GetKey()); - rect.SetColor(colors[color_index, 0], - colors[color_index, 1], - colors[color_index, 2], 255); - }; - - loop.Begin(); - - Efl.All.Shutdown(); - } -} diff --git a/src/examples/evas/evas_mono_table.cs b/src/examples/evas/evas_mono_table.cs deleted file mode 100644 index b42057d651..0000000000 --- a/src/examples/evas/evas_mono_table.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Runtime.CompilerServices; - -class TestMain -{ - static int WIDTH = 100; - static int HEIGHT = 150; - - static void Main(string[] args) - { - Efl.All.Init(); - - Efl.Loop loop = new Efl.Loop(); - - EcoreEvas ecore_evas = new EcoreEvas(); - - Eina.Size2D size = new Eina.Size2D(); - size.W = WIDTH; - size.H = HEIGHT; - - Eina.Size2D hint = new Eina.Size2D(); - - Efl.Canvas.Object canvas = ecore_evas.canvas; - canvas.SetVisible(true); - - Efl.Object parent = canvas.GetParent(); - System.Diagnostics.Debug.Assert(parent.NativeHandle != IntPtr.Zero); - - 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.Table(canvas); - table.SetHomogeneous(Evas.ObjectTable.HomogeneousMode.None); - table.SetPadding(0, 0); - table.SetSize(size); - table.SetVisible(true); - - Efl.Canvas.Rectangle rect = new Efl.Canvas.Rectangle(canvas); - rect.SetColor(255, 0, 0, 255); - hint.W = 100; - hint.H = 50; - rect.SetHintMin(hint); - rect.SetVisible(true); - table.Pack(rect, 1, 1, 2, 1); - - rect = new Efl.Canvas.Rectangle(canvas); - rect.SetColor(0, 255, 0, 255); - hint.W = 50; - hint.H = 100; - rect.SetHintMin(hint); - rect.SetVisible(true); - table.Pack(rect, 1, 2, 1, 2); - - rect = new Efl.Canvas.Rectangle(canvas); - rect.SetColor(0, 0, 255, 255); - hint.W = 50; - hint.H = 50; - rect.SetHintMin(hint); - rect.SetVisible(true); - table.Pack(rect, 2, 2, 1, 1); - - rect = new Efl.Canvas.Rectangle(canvas); - rect.SetColor(255, 255, 0, 255); - rect.SetHintMin(hint); - rect.SetVisible(true); - table.Pack(rect, 2, 3, 1, 1); - - loop.Begin(); - - Efl.All.Shutdown(); - } -} - diff --git a/src/examples/evas/evas_mono_text.cs b/src/examples/evas/evas_mono_text.cs deleted file mode 100644 index 52b89f2f10..0000000000 --- a/src/examples/evas/evas_mono_text.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; -using System.Linq; -using System.Collections.Generic; - -static class Extensions -{ - public static IEnumerable Circle(this IEnumerable list, int index=0) - { - var count = list.Count(); - index = index % count; - - while (true) { - yield return list.ElementAt(index); - index = (index + 1) % count; - } - } -} - -class TestMain -{ - static int WIDTH = 320; - static int HEIGHT = 240; - - private EcoreEvas ecore_evas; - private Efl.Canvas.Object canvas; - private Efl.Canvas.Rectangle bg; - private Evas.Text text; - private Evas.Image border; - - public TestMain(String border_file) { - ecore_evas = new EcoreEvas(); - Eina.Size2D size = new Eina.Size2D(); - Eina.Position2D position = new Eina.Position2D(); - canvas = ecore_evas.canvas; - canvas.SetVisible(true); - - bg = new Efl.Canvas.Rectangle(canvas); - bg.SetColor(255, 255, 255, 255); - position.X = 0; - position.Y = 0; - bg.SetPosition(position); - size.W = WIDTH; - size.H = HEIGHT; - bg.SetSize(size); - bg.SetVisible(true); - bg.SetKeyFocus(true); - - /* ((Efl.Input.Interface)bg).KeyDownEvt += On_KeyDown; */ - bg.KeyDownEvt += On_KeyDown; - - text = new Evas.Text(canvas); - text.SetStyle(Evas.TextStyleType.OutlineSoftShadow); - - text.SetColor(0, 0, 0, 255); - text.SetGlowColor(255, 0, 0, 255); - text.SetOutlineColor(0, 0, 255, 255); - text.SetShadowColor(0, 255,255, 255); - text.SetFont("Courier", 30); - - text.SetText("sample text"); - size.W = 3*WIDTH / 4; - size.H = HEIGHT / 4; - text.SetSize(size); - position.X = WIDTH / 8; - position.Y = 3 * HEIGHT / 8; - text.SetPosition(position); - text.SetVisible(true); - - Efl.Font.Size font_size = 0; - String font = String.Empty; - text.GetFont(out font, out font_size); - Console.WriteLine("Adding text object with font {0} and size {1}", font, size); - - // setup border - border = new Evas.Image(canvas); - border.SetFile(border_file, null); - border.SetBorder(3, 3, 3, 3); - border.SetBorderCenterFill(0); - - size.W = 3 * WIDTH / 4 + 3; - size.H = HEIGHT / 4 + 3; - border.SetSize(size); - position.X = WIDTH / 8 - 3; - position.Y = 3 * HEIGHT / 8 - 3; - border.SetPosition(position); - border.SetVisible(true); - - - } - - private void On_KeyDown(object sender, Efl.Input.InterfaceKeyDownEvt_Args e) - { - var key = e.arg.GetKey(); - - if (key == "h") { - Console.WriteLine(commands); - } else if (key == "t") { - Evas.TextStyleType type = text.GetStyle(); - type = (Evas.TextStyleType)(((int)type + 1) % 10); // 10 hardcoded from C example - text.SetStyle(type); - } - } - - static string commands = @"commands are: - t - change text's current style - h - print help"; - - - static void Main(string[] args) - { - Efl.All.Init(); - - String border_path = "./src/examples/evas/resources/images/red.png"; - - if (args.Length >= 1) - border_path = args[0]; - - Efl.Loop loop = new Efl.Loop(); - TestMain t = new TestMain(border_path); - - loop.Begin(); - - Efl.All.Shutdown(); - } -} - - diff --git a/src/examples/evas/meson.build b/src/examples/evas/meson.build index c07587dec6..34c8bd3463 100644 --- a/src/examples/evas/meson.build +++ b/src/examples/evas/meson.build @@ -51,7 +51,9 @@ examples = [ ] foreach example : examples - executable(example, example + '.c', + executable(example, example + '.c', dependencies: [eina, ecore_evas, ecore_file, m], c_args : ['-DPACKAGE_EXAMPLES_DIR="'+meson.current_source_dir()+'"']) endforeach + +subdir('shooter') diff --git a/src/examples/evas/shooter/evas-3d-shooter-header.h b/src/examples/evas/shooter/evas-3d-shooter-header.h index 13600ec121..cd30fde209 100644 --- a/src/examples/evas/shooter/evas-3d-shooter-header.h +++ b/src/examples/evas/shooter/evas-3d-shooter-header.h @@ -5,7 +5,6 @@ #else #define PACKAGE_EXAMPLES_DIR "." #define EFL_BETA_API_SUPPORT -#define EFL_EO_API_SUPPORT #endif #include @@ -114,9 +113,9 @@ typedef struct _Scene_Data Eina_Bool normal; } Scene_Data; -static Evas *evas = NULL; -static Eo *background = NULL; -static Eo *image = NULL; +extern Evas *evas; +extern Eo *background; +extern Eo *image; static const vec2 tex_scale = {1, 1}; diff --git a/src/examples/evas/shooter/evas-3d-shooter-macros.h b/src/examples/evas/shooter/evas-3d-shooter-macros.h index 9cb92a6cf8..94980ec2e3 100644 --- a/src/examples/evas/shooter/evas-3d-shooter-macros.h +++ b/src/examples/evas/shooter/evas-3d-shooter-macros.h @@ -150,13 +150,13 @@ typedef struct _vec2 #define MATERIAL_TEXTURE_SET(Object, Name, file, image) \ - efl_file_set(data->mesh_##Name, file, NULL); \ + efl_file_simple_load(data->mesh_##Name, file, NULL); \ \ SETUP_DEFAULT_MESH(Object, Name, PHONG) \ data->texture_diffuse_##Object = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); \ \ evas_canvas3d_texture_atlas_enable_set(data->texture_diffuse_##Object, EINA_FALSE); \ - efl_file_set(data->texture_diffuse_##Object, image, NULL); \ + efl_file_simple_load(data->texture_diffuse_##Object, image, NULL); \ evas_canvas3d_texture_filter_set(data->texture_diffuse_##Object, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, \ EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); \ evas_canvas3d_texture_wrap_set(data->texture_diffuse_##Object, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); \ @@ -175,7 +175,7 @@ typedef struct _vec2 data->texture_diffuse_##Object = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); \ \ evas_canvas3d_texture_atlas_enable_set(data->texture_diffuse_##Object, EINA_FALSE); \ - efl_file_set(data->texture_diffuse_##Object, image, NULL); \ + efl_file_simple_load(data->texture_diffuse_##Object, image, NULL); \ evas_canvas3d_texture_filter_set(data->texture_diffuse_##Object, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, \ EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); \ evas_canvas3d_texture_wrap_set(data->texture_diffuse_##Object, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); \ @@ -190,7 +190,7 @@ typedef struct _vec2 data->texture_normal_##Object = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); \ \ evas_canvas3d_texture_atlas_enable_set(data->texture_normal_##Object, EINA_FALSE); \ - efl_file_set(data->texture_normal_##Object, normal, NULL); \ + efl_file_simple_load(data->texture_normal_##Object, normal, NULL); \ evas_canvas3d_texture_filter_set(data->texture_normal_##Object, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, \ EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); \ evas_canvas3d_texture_wrap_set(data->texture_normal_##Object, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); \ diff --git a/src/examples/evas/shooter/evas-3d-shooter.c b/src/examples/evas/shooter/evas-3d-shooter.c index ae6bedee7f..2dcad1db61 100644 --- a/src/examples/evas/shooter/evas-3d-shooter.c +++ b/src/examples/evas/shooter/evas-3d-shooter.c @@ -19,6 +19,11 @@ #define LOCAL_IMAGE_FOLDER PACKAGE_EXAMPLES_DIR "" EVAS_PROJECT_IMAGE_FOLDER #define LOCAL_MODEL_FOLDER PACKAGE_EXAMPLES_DIR "" EVAS_PROJECT_MODEL_FOLDER + +Evas *evas = NULL; +Eo *background = NULL; +Eo *image = NULL; + static const char *gray_brick_n_path = LOCAL_IMAGE_FOLDER "/brick-stone_n.jpg"; static const char *gray_brick_path = LOCAL_IMAGE_FOLDER "/brick-stone.jpg"; static const char *red_brick_n_path = LOCAL_IMAGE_FOLDER "/bricks_n.jpg"; @@ -133,14 +138,14 @@ _key_down(void *data, if (!scene->blending) { scene->blending = EINA_TRUE; - efl_file_set(scene->texture_diffuse_carpet, gazebo_t_trans_path, NULL); + efl_file_simple_load(scene->texture_diffuse_carpet, gazebo_t_trans_path, NULL); evas_canvas3d_mesh_blending_enable_set(scene->mesh_carpet, EINA_TRUE); evas_canvas3d_mesh_blending_func_set(scene->mesh_carpet, EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA, EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_SRC_ALPHA); } else { scene->blending = EINA_FALSE; - efl_file_set(scene->texture_diffuse_carpet, gazebo_t_path, NULL); + efl_file_simple_load(scene->texture_diffuse_carpet, gazebo_t_path, NULL); evas_canvas3d_mesh_blending_enable_set(scene->mesh_carpet, EINA_FALSE); } } @@ -733,7 +738,7 @@ _mesh_setup_gun_planet(Scene_Data *data) ADD_MESH(tommy, tommy, 0.0, 0.3, 1.0) SETUP_MESH_NODE(tommy) - efl_file_set(data->mesh_tommy, gun_path, NULL); + efl_file_simple_load(data->mesh_tommy, gun_path, NULL); efl_file_save(data->mesh_tommy, "try.obj", NULL, NULL); evas_canvas3d_mesh_shader_mode_set(data->mesh_tommy, EVAS_CANVAS3D_SHADER_MODE_PHONG); evas_canvas3d_mesh_frame_material_set(data->mesh_tommy, 0, data->material_tommy); @@ -763,7 +768,7 @@ _mesh_setup_gun_planet(Scene_Data *data) if (data->blending) { evas_canvas3d_texture_atlas_enable_set(data->texture_diffuse_carpet, EINA_FALSE); - efl_file_set(data->texture_diffuse_carpet, gazebo_t_trans_path, NULL); + efl_file_simple_load(data->texture_diffuse_carpet, gazebo_t_trans_path, NULL); evas_canvas3d_mesh_blending_enable_set(data->mesh_carpet, EINA_TRUE); evas_canvas3d_mesh_blending_func_set(data->mesh_carpet, EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA, EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_SRC_ALPHA); } @@ -888,7 +893,7 @@ _mesh_setup_column(Scene_Data *data, int index) data->texture_diffuse_column = efl_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); - efl_file_set(data->texture_diffuse_column, red_brick_path, NULL); + efl_file_simple_load(data->texture_diffuse_column, red_brick_path, NULL); evas_canvas3d_texture_atlas_enable_set(data->texture_diffuse_column, EINA_FALSE); evas_canvas3d_texture_filter_set(data->texture_diffuse_column, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); evas_canvas3d_texture_wrap_set(data->texture_diffuse_column, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); diff --git a/src/examples/evas/shooter/meson.build b/src/examples/evas/shooter/meson.build new file mode 100644 index 0000000000..abb782d540 --- /dev/null +++ b/src/examples/evas/shooter/meson.build @@ -0,0 +1,5 @@ +executable('evas-3d-shooter', + ['evas-3d-shooter-header.c', 'evas-3d-shooter.c'], + dependencies: [ecore_evas], + c_args : ['-DPACKAGE_EXAMPLES_DIR="'+meson.current_source_dir()+'"'] +) diff --git a/src/generic/evas/raw/main.c b/src/generic/evas/raw/main.c index 275815b3cb..70a1625b75 100644 --- a/src/generic/evas/raw/main.c +++ b/src/generic/evas/raw/main.c @@ -11,10 +11,6 @@ #include "shmfile.h" #include "timeout.h" -#ifdef HAVE_NETINET_IN_H -# include -#endif - #ifdef HAVE_UNISTD_H # include #endif @@ -142,7 +138,7 @@ read_raw_data() if (image->colors != 3) goto clean_image; #define SWAP(a, b) { a ^= b; a = (b ^=a); } - if ((image->bits == 16) && (htons(0x55aa) != 0x55aa)) + if ((image->bits == 16) && (eina_htons(0x55aa) != 0x55aa)) for (count = 0; count < image->data_size; count +=2) SWAP(image->data[count], image->data[count + 1]); #undef SWAP diff --git a/src/generic/evas/xcf/main.c b/src/generic/evas/xcf/main.c index c5ef6a82d6..65e5e1b5b3 100644 --- a/src/generic/evas/xcf/main.c +++ b/src/generic/evas/xcf/main.c @@ -45,14 +45,11 @@ Ok, hope this helps with understanding XCF. -- cK. */ +#include #include "common.h" #include "shmfile.h" #include "timeout.h" -#ifdef _WIN32 -# include /* for ntohl() */ -#endif - #define FREE(X) { free(X); X = NULL; } #define TILE_WIDTH 64 @@ -479,7 +476,7 @@ xcf_read_int32(void *fp, xcf_read_int8(fp, (DATA8*) data, count * 4); while (count--) { - *data = (DATA32)ntohl(*data); + *data = (DATA32)eina_ntohl(*data); data++; } } diff --git a/src/generic/evas/xcf/meson.build b/src/generic/evas/xcf/meson.build index 0f5fb208c5..169469b679 100644 --- a/src/generic/evas/xcf/meson.build +++ b/src/generic/evas/xcf/meson.build @@ -4,5 +4,5 @@ generic_src = files([ 'pixelfuncs.c' ]) -generic_deps = [dependency('zlib')] -generic_support = ['xcf.gz'] \ No newline at end of file +generic_deps = [eina, dependency('zlib')] +generic_support = ['xcf.gz'] diff --git a/src/lib/ecore/Ecore.h b/src/lib/ecore/Ecore.h index e31252a380..cfc6dd7660 100644 --- a/src/lib/ecore/Ecore.h +++ b/src/lib/ecore/Ecore.h @@ -330,9 +330,7 @@ extern "C" { #ifndef EFL_NOLEGACY_API_SUPPORT #include "Ecore_Legacy.h" #endif -#ifdef EFL_EO_API_SUPPORT #include "Ecore_Eo.h" -#endif #ifdef __cplusplus } diff --git a/src/lib/ecore/Ecore_Common.h b/src/lib/ecore/Ecore_Common.h index cccb5b736c..1530036e63 100644 --- a/src/lib/ecore/Ecore_Common.h +++ b/src/lib/ecore/Ecore_Common.h @@ -67,7 +67,7 @@ EAPI int ecore_shutdown(void); * should call ecore_init() first, then register your callback on * @c EFL_LOOP_EVENT_ARGUMENTS and finally call ecore_init_ex(). * - * Once you are shuting down your program, you should symetrically + * Once you are shuting down your program, you should symmetrically * call ecore_shutdown_ex(). */ EAPI unsigned int ecore_init_ex(int argc, char **argv); @@ -87,8 +87,6 @@ EAPI unsigned int ecore_init_ex(int argc, char **argv); */ EAPI unsigned int ecore_shutdown_ex(void); - -#ifdef EFL_BETA_API_SUPPORT /** * @brief Inform EFL of the version this application was built for. * @@ -97,7 +95,6 @@ EAPI unsigned int ecore_shutdown_ex(void); * @since 1.18 (as beta) */ EWAPI void efl_build_version_set(int vmaj, int vmin, int vmic, int revision, const char *flavor, const char *build_id); -#endif /** * @} @@ -1035,7 +1032,7 @@ enum _Ecore_Exe_Win32_Priority }; typedef enum _Ecore_Exe_Win32_Priority Ecore_Exe_Win32_Priority; -#include "ecore_exe.eo.legacy.h" +#include "ecore_exe_eo.legacy.h" #define _ECORE_EXE_EO_CLASS_TYPE @@ -1115,7 +1112,7 @@ EAPI int ecore_exe_run_priority_get(void); * @param data Data to attach to the returned process handle. * @return A process handle to the spawned process. * @note When you use this function you will have no permissions - * to write or read on the pipe that connects you with the spwaned process. + * to write or read on the pipe that connects you with the spawned process. * If you need to do that use ecore_exe_pipe_run() with the * appropriated flags. * @@ -1388,7 +1385,13 @@ enum _Ecore_Fd_Handler_Flags { ECORE_FD_READ = 1, /**< Fd Read mask */ ECORE_FD_WRITE = 2, /**< Fd Write mask */ - ECORE_FD_ERROR = 4 /**< Fd Error mask */ + ECORE_FD_ERROR = 4, /**< Fd Error mask */ + /* ECORE_FD_ALWAYS is intended to fix a problem with wayland + * and threads. It causes the fd handler to be called + * in any state, so wayland libs can call read_cancel + * if nothing is available to read. Everyone else should + * stay away. */ + ECORE_FD_ALWAYS = 8, /**< Fd Always mask - DO NOT USE! */ }; typedef enum _Ecore_Fd_Handler_Flags Ecore_Fd_Handler_Flags; @@ -2507,9 +2510,9 @@ EAPI void ecore_pipe_freeze(Ecore_Pipe *p); * @brief Waits from another thread on the read side of a pipe. * * @param p The pipe to watch on. - * @param message_count The minimal number of message to wait before exiting. - * @param wait The amount of time in second to wait before exiting. - * @return the number of message catched during that wait call. + * @param message_count The minimum number of messages to wait for before exiting. + * @param wait The amount of time in seconds to wait before exiting. + * @return The number of message caught during the wait call. * @since 1.1 * * Negative value for @p wait means infite wait. @@ -2908,7 +2911,7 @@ EAPI double ecore_animator_pos_map(double pos, Ecore_Pos_Map map, double v1, dou * @li ECORE_POS_MAP_SPRING - Start at 0.0 then "wobble" like a spring rest * position 1.0, and wobble v2 times, with decay factor of v[0] * @li ECORE_POS_MAP_CUBIC_BEZIER - Use an interpolated cubic-bezier curve - * ajusted with parameters from v[0] to v[3]. + * adjusted with parameters from v[0] to v[3]. * @note When not listed v has no effect. * * @image html ecore-pos-map.png diff --git a/src/lib/ecore/Ecore_Eo.h b/src/lib/ecore/Ecore_Eo.h index f8d8626848..6e872d9d2c 100644 --- a/src/lib/ecore/Ecore_Eo.h +++ b/src/lib/ecore/Ecore_Eo.h @@ -26,6 +26,10 @@ * @{ */ +#include "efl_core_env.eo.h" +#include "efl_core_proc_env.eo.h" +#include "efl_core_command_line.eo.h" + #include "efl_loop_message.eo.h" #include "efl_loop_message_handler.eo.h" @@ -109,16 +113,13 @@ EAPI Eo *efl_main_loop_get(void); * @{ */ -#include "efl_model_loop.eo.h" -#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" -#include "efl_model_composite_selection_children.eo.h" -#include "efl_model_view.eo.h" +#include "efl_loop_model.eo.h" +#include "efl_generic_model.eo.h" +#include "efl_container_model.eo.h" +#include "efl_composite_model.eo.h" +#include "efl_boolean_model.eo.h" +#include "efl_select_model.eo.h" +#include "efl_view_model.eo.h" /** * @} diff --git a/src/lib/ecore/Ecore_Getopt.h b/src/lib/ecore/Ecore_Getopt.h index a4f188c8c2..7a038f744a 100644 --- a/src/lib/ecore/Ecore_Getopt.h +++ b/src/lib/ecore/Ecore_Getopt.h @@ -1215,4 +1215,7 @@ EAPI Eina_Bool ecore_getopt_callback_size_parse(const Ecore_Getopt *parser, con * @} */ +#undef EAPI +#define EAPI + #endif /* _ECORE_GETOPT_H */ diff --git a/src/lib/ecore/Ecore_Legacy.h b/src/lib/ecore/Ecore_Legacy.h index 94c4250d51..9c951f5a93 100644 --- a/src/lib/ecore/Ecore_Legacy.h +++ b/src/lib/ecore/Ecore_Legacy.h @@ -295,7 +295,7 @@ EAPI Eina_Bool ecore_timer_freeze_get(Ecore_Timer *timer); */ EAPI void ecore_timer_thaw(Ecore_Timer *timer); -#include "efl_loop_timer.eo.legacy.h" +#include "efl_loop_timer_eo.legacy.h" /** * @} @@ -392,7 +392,7 @@ EAPI void *ecore_idle_exiter_del(Ecore_Idle_Exiter *idle_exiter); * @{ */ -#include "ecore_exe.eo.legacy.h" +#include "ecore_exe_eo.legacy.h" /** * @} diff --git a/src/lib/ecore/Efl_Core.h b/src/lib/ecore/Efl_Core.h index 92ff448cae..c735b333fc 100644 --- a/src/lib/ecore/Efl_Core.h +++ b/src/lib/ecore/Efl_Core.h @@ -3,14 +3,9 @@ #include -#ifndef EFL_BETA_API_SUPPORT -#define EFL_BETA_API_SUPPORT -#endif - #include #include #include - #ifdef EAPI # undef EAPI #endif diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c index d28de1a955..ceb3021019 100644 --- a/src/lib/ecore/ecore.c +++ b/src/lib/ecore/ecore.c @@ -106,8 +106,6 @@ 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; @@ -266,8 +264,6 @@ ecore_init(void) goto shutdown_log_dom; } - eina_lock_new(&_environ_lock); - efl_object_init(); if (getenv("ECORE_FPS_DEBUG")) _ecore_fps_debug = 1; @@ -325,7 +321,7 @@ ecore_init(void) efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(), efl_loop_timer_interval_set(efl_added, sec / 2), efl_event_callback_add(efl_added, - EFL_LOOP_TIMER_EVENT_TICK, + EFL_LOOP_TIMER_EVENT_TIMER_TICK, _systemd_watchdog_cb, NULL)); unsetenv("WATCHDOG_USEC"); @@ -471,8 +467,6 @@ ecore_shutdown(void) efl_object_shutdown(); - eina_lock_free(&_environ_lock); - eina_evlog("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 something is supsend, then the mainloop will be blocked until until thread is calling ecore_thread_main_loop_end() + //if something tries to join a thread as callback, ensure that we remove this + if (call->suspend || (call->cb.async == (Ecore_Cb)&_ecore_thread_join)) + { + _thread_cb = eina_list_remove_list(_thread_cb, l); + free(call); + } } if (_thread_cb) ecore_pipe_write(_thread_call, &wakeup, sizeof (int)); } @@ -692,7 +689,7 @@ ecore_thread_main_loop_begin(void) return ++_thread_loop; } - order = malloc(sizeof (Ecore_Safe_Call)); + order = calloc(1, sizeof (Ecore_Safe_Call)); if (!order) return -1; eina_lock_take(&_thread_id_lock); diff --git a/src/lib/ecore/ecore_event_message.eo b/src/lib/ecore/ecore_event_message.eo index 80ec98587b..ca39084c17 100644 --- a/src/lib/ecore/ecore_event_message.eo +++ b/src/lib/ecore/ecore_event_message.eo @@ -1,4 +1,4 @@ -class Ecore.Event.Message extends Efl.Loop_Message +class @beta Ecore.Event.Message extends 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 60ab2c9395..49a78c5b8a 100644 --- a/src/lib/ecore/ecore_event_message_handler.c +++ b/src/lib/ecore/ecore_event_message_handler.c @@ -86,10 +86,12 @@ _ecore_event_filters_call(Eo *obj, Efl_Loop_Data *pd) { Filter *f; Ecore_Event_Message_Handler_Data *eemhd; - Eo *ecore_event_handler = efl_loop_message_handler_get - (EFL_LOOP_CLASS, obj, ECORE_EVENT_MESSAGE_HANDLER_CLASS); - + Eo *ecore_event_handler = efl_provider_find(obj, ECORE_EVENT_MESSAGE_HANDLER_CLASS); + /* If this is not != NULL, then _ecore_event_init was not called yet, which means, + there cannot be any registered events yet + */ if (!ecore_event_handler) return; + eemhd = efl_data_scope_get(ecore_event_handler, MY_CLASS); if (!eemhd) return; if (!eemhd->filters) return; diff --git a/src/lib/ecore/ecore_event_message_handler.eo b/src/lib/ecore/ecore_event_message_handler.eo index c2bc6b909f..ca2228b969 100644 --- a/src/lib/ecore/ecore_event_message_handler.eo +++ b/src/lib/ecore/ecore_event_message_handler.eo @@ -1,4 +1,4 @@ -class Ecore.Event.Message.Handler extends Efl.Loop_Message_Handler +class @beta Ecore.Event.Message.Handler extends Efl.Loop_Message_Handler { [[ For Legacy API usage Only This class is rather hacky/messy as it's really internal glue diff --git a/src/lib/ecore/ecore_events.c b/src/lib/ecore/ecore_events.c index 258e10e663..15667e9bd9 100644 --- a/src/lib/ecore/ecore_events.c +++ b/src/lib/ecore/ecore_events.c @@ -245,10 +245,9 @@ _ecore_event_init(void) const char *choice = getenv("EINA_MEMPOOL"); if ((!choice) || (!choice[0])) choice = "chained_mempool"; - _event_msg_handler = - efl_loop_message_handler_get(EFL_LOOP_CLASS, - _mainloop_singleton, - ECORE_EVENT_MESSAGE_HANDLER_CLASS); + _event_msg_handler = efl_add(ECORE_EVENT_MESSAGE_HANDLER_CLASS, _mainloop_singleton); + efl_loop_register(_mainloop_singleton, ECORE_EVENT_MESSAGE_HANDLER_CLASS, _event_msg_handler); + if (!_event_msg_handler) { ERR("Cannot create legacy ecore event message handler"); diff --git a/src/lib/ecore/ecore_exe.c b/src/lib/ecore/ecore_exe.c index 674ca51dc6..9bd1dece31 100644 --- a/src/lib/ecore/ecore_exe.c +++ b/src/lib/ecore/ecore_exe.c @@ -414,4 +414,4 @@ _ecore_exe_event_add_free(void *data EINA_UNUSED, free(e); } -#include "ecore_exe.eo.c" +#include "ecore_exe_eo.c" diff --git a/src/lib/ecore/ecore_exe.eo b/src/lib/ecore/ecore_exe.eo deleted file mode 100644 index 899d8a0443..0000000000 --- a/src/lib/ecore/ecore_exe.eo +++ /dev/null @@ -1,87 +0,0 @@ -/* FIXME: The structures are not namespaced correctly. */ - -struct Ecore.Exe.Event_Data.Line -{ - [[A structure which stores information on lines data from a child process.]] - line: ptr(char); [[The bytes of a line of buffered data]] - size: int; [[The size of the line buffer in bytes]] -} - -/** - * @struct _Ecore_Exe_Event_Data - * @brief A structure that stores information of data from a child process event. - */ -struct Ecore.Exe.Event_Data -{ - [[Ecore exe event data structure]] - exe: Efl.Object; [[The handle to the process. FIXME: should actually be Ecore.Exe, workaround cyclic]] - data: void_ptr; [[The raw binary data from the child process received]] - size: int; [[The size of this data in bytes]] - lines: ptr(Ecore.Exe.Event_Data.Line); [[An array of line data if line buffered. The last one has its line member set to $NULL]] -} - -enum Ecore.Exe_Flags -{ - [[Flags for executing a child with its stdin and/or stdout piped back.]] - legacy: ECORE_EXE; - - none = 0, [[No exe flags at all]] - pipe_read = 1, [[Exe Pipe Read mask]] - pipe_write = 2, [[Exe Pipe Write mask]] - pipe_error = 4, [[Exe Pipe error mask]] - pipe_read_line_buffered = 8, [[Reads are buffered until a newline and split 1 line per Ecore_Exe_Event_Data_Line]] - pipe_error_line_buffered = 16, [[Errors are buffered until a newline and split 1 line per Ecore_Exe_Event_Data_Line]] - pipe_auto = 32, [[stdout and stderr are buffered automatically]] - respawn = 64, [[FIXME: Exe is restarted if it dies]] - use_sh = 128, [[Use /bin/sh to run the command.]] - not_leader = 256, [[Do not use setsid() to set the executed process as its own session leader]] - term_with_parent = 512, [[Makes child receive SIGTERM when parent dies.]] - isolate_io = 1024, [[Try and isolate stdin/out and err of the process so it isn't shared with the parent.]] -} - -class Ecore.Exe extends Efl.Object implements Efl.Control -{ - [[Ecore.Exe is responsible for managing portable process spawning. - - With this module you are able to spawn, pause and quit spawned processes. - Interaction between your process and those spawned is possible using pipes or signals. - ]] - - legacy_prefix: ecore_exe; - eo_prefix: ecore_obj_exe; - event_prefix: ecore_exe; - methods { - @property command { - [[Controls the command that's executed. FIXME: May need a split/rename.]] - set { - legacy: null; - } - get { - legacy: null; - } - values { - exe_cmd: string; [[The command to execute.]] - flags: Ecore.Exe_Flags; [[The execution flags.]] - } - } - } - implements { - Efl.Object.destructor; - Efl.Object.finalize; - Efl.Control.suspend { set; } - } - constructors { - .command; - } - events { - data,get: Ecore.Exe.Event_Data; [[Data received event from the child process]] - data,error: Ecore.Exe.Event_Data; [[Error received event from the child process]] - } -} - -/* FIXME: Notes: - Should run_priority be a class function? - Instead of having quit, interrupt, bla bla bla, just have an enum and one function? As it's essentially a signal send. - - Rename the events. -*/ diff --git a/src/lib/ecore/ecore_exe_eo.c b/src/lib/ecore/ecore_exe_eo.c new file mode 100644 index 0000000000..6a1775a678 --- /dev/null +++ b/src/lib/ecore/ecore_exe_eo.c @@ -0,0 +1,57 @@ +EWAPI const Efl_Event_Description _ECORE_EXE_EVENT_DATA_GET = + EFL_EVENT_DESCRIPTION("data,get"); +EWAPI const Efl_Event_Description _ECORE_EXE_EVENT_DATA_ERROR = + EFL_EVENT_DESCRIPTION("data,error"); + +void _ecore_exe_command_set(Eo *obj, Ecore_Exe_Data *pd, const char *exe_cmd, Ecore_Exe_Flags flags); + +EOAPI EFL_VOID_FUNC_BODYV(ecore_obj_exe_command_set, EFL_FUNC_CALL(exe_cmd, flags), const char *exe_cmd, Ecore_Exe_Flags flags); + +void _ecore_exe_command_get(const Eo *obj, Ecore_Exe_Data *pd, const char **exe_cmd, Ecore_Exe_Flags *flags); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(ecore_obj_exe_command_get, EFL_FUNC_CALL(exe_cmd, flags), const char **exe_cmd, Ecore_Exe_Flags *flags); + +void _ecore_exe_efl_object_destructor(Eo *obj, Ecore_Exe_Data *pd); + + +Efl_Object *_ecore_exe_efl_object_finalize(Eo *obj, Ecore_Exe_Data *pd); + + +void _ecore_exe_efl_control_suspend_set(Eo *obj, Ecore_Exe_Data *pd, Eina_Bool suspend); + + +static Eina_Bool +_ecore_exe_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ECORE_EXE_EXTRA_OPS +#define ECORE_EXE_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(ecore_obj_exe_command_set, _ecore_exe_command_set), + EFL_OBJECT_OP_FUNC(ecore_obj_exe_command_get, _ecore_exe_command_get), + EFL_OBJECT_OP_FUNC(efl_destructor, _ecore_exe_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_finalize, _ecore_exe_efl_object_finalize), + EFL_OBJECT_OP_FUNC(efl_control_suspend_set, _ecore_exe_efl_control_suspend_set), + ECORE_EXE_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _ecore_exe_class_desc = { + EO_VERSION, + "Ecore.Exe", + EFL_CLASS_TYPE_REGULAR, + sizeof(Ecore_Exe_Data), + _ecore_exe_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(ecore_exe_class_get, &_ecore_exe_class_desc, EFL_OBJECT_CLASS, EFL_CONTROL_INTERFACE, NULL); diff --git a/src/lib/ecore/ecore_exe_eo.h b/src/lib/ecore/ecore_exe_eo.h new file mode 100644 index 0000000000..fa8ecb026a --- /dev/null +++ b/src/lib/ecore/ecore_exe_eo.h @@ -0,0 +1,121 @@ +#ifndef _ECORE_EXE_EO_H_ +#define _ECORE_EXE_EO_H_ + +#ifndef _ECORE_EXE_EO_CLASS_TYPE +#define _ECORE_EXE_EO_CLASS_TYPE + +typedef Eo Ecore_Exe; + +#endif + +#ifndef _ECORE_EXE_EO_TYPES +#define _ECORE_EXE_EO_TYPES + +/** A structure which stores information on lines data from a child process. + * + * @ingroup Ecore_Exe_Event_Data + */ +typedef struct _Ecore_Exe_Event_Data_Line +{ + char *line; /**< The bytes of a line of buffered data */ + int size; /**< The size of the line buffer in bytes */ +} Ecore_Exe_Event_Data_Line; + +/** Ecore exe event data structure + * + * @ingroup Ecore_Exe + */ +typedef struct _Ecore_Exe_Event_Data +{ + Efl_Object *exe; /**< The handle to the process. FIXME: should actually be + * Ecore.Exe, workaround cyclic */ + void *data; /**< The raw binary data from the child process received */ + int size; /**< The size of this data in bytes */ + Ecore_Exe_Event_Data_Line *lines; /**< An array of line data if line buffered. + * The last one has its line member set to + * @c NULL */ +} Ecore_Exe_Event_Data; + +/** Flags for executing a child with its stdin and/or stdout piped back. + * + * @ingroup Ecore + */ +typedef enum +{ + ECORE_EXE_NONE = 0, /**< No exe flags at all */ + ECORE_EXE_PIPE_READ = 1, /**< Exe Pipe Read mask */ + ECORE_EXE_PIPE_WRITE = 2, /**< Exe Pipe Write mask */ + ECORE_EXE_PIPE_ERROR = 4, /**< Exe Pipe error mask */ + ECORE_EXE_PIPE_READ_LINE_BUFFERED = 8, /**< Reads are buffered until a newline + * and split 1 line per + * Ecore_Exe_Event_Data_Line */ + ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = 16, /**< Errors are buffered until a + * newline and split 1 line per + * Ecore_Exe_Event_Data_Line */ + ECORE_EXE_PIPE_AUTO = 32, /**< stdout and stderr are buffered automatically */ + ECORE_EXE_RESPAWN = 64, /**< FIXME: Exe is restarted if it dies */ + ECORE_EXE_USE_SH = 128, /**< Use /bin/sh to run the command. */ + ECORE_EXE_NOT_LEADER = 256, /**< Do not use setsid() to set the executed + * process as its own session leader */ + ECORE_EXE_TERM_WITH_PARENT = 512, /**< Makes child receive SIGTERM when parent + * dies. */ + ECORE_EXE_ISOLATE_IO = 1024 /**< Try and isolate stdin/out and err of the + * process so it isn't shared with the parent. */ +} Ecore_Exe_Flags; + + +#endif +/** + * @brief Ecore.Exe is responsible for managing portable process spawning. + * + * With this module you are able to spawn, pause and quit spawned processes. + * Interaction between your process and those spawned is possible using pipes + * or signals. + * + * @ingroup Ecore_Exe + */ +#define ECORE_EXE_CLASS ecore_exe_class_get() + +EWAPI const Efl_Class *ecore_exe_class_get(void); + +/** + * @brief Controls the command that's executed. FIXME: May need a split/rename. + * + * @param[in] obj The object. + * @param[in] exe_cmd The command to execute. + * @param[in] flags The execution flags. + * + * @ingroup Ecore_Exe + */ +EOAPI void ecore_obj_exe_command_set(Eo *obj, const char *exe_cmd, Ecore_Exe_Flags flags); + +/** + * @brief Controls the command that's executed. FIXME: May need a split/rename. + * + * @param[in] obj The object. + * @param[out] exe_cmd The command to execute. + * @param[out] flags The execution flags. + * + * @ingroup Ecore_Exe + */ +EOAPI void ecore_obj_exe_command_get(const Eo *obj, const char **exe_cmd, Ecore_Exe_Flags *flags); + +EWAPI extern const Efl_Event_Description _ECORE_EXE_EVENT_DATA_GET; + +/** Data received event from the child process + * @return Ecore_Exe_Event_Data + * + * @ingroup Ecore_Exe + */ +#define ECORE_EXE_EVENT_DATA_GET (&(_ECORE_EXE_EVENT_DATA_GET)) + +EWAPI extern const Efl_Event_Description _ECORE_EXE_EVENT_DATA_ERROR; + +/** Error received event from the child process + * @return Ecore_Exe_Event_Data + * + * @ingroup Ecore_Exe + */ +#define ECORE_EXE_EVENT_DATA_ERROR (&(_ECORE_EXE_EVENT_DATA_ERROR)) + +#endif diff --git a/src/lib/ecore/ecore_exe_eo.legacy.h b/src/lib/ecore/ecore_exe_eo.legacy.h new file mode 100644 index 0000000000..e4dfca8619 --- /dev/null +++ b/src/lib/ecore/ecore_exe_eo.legacy.h @@ -0,0 +1,71 @@ +#ifndef _ECORE_EXE_EO_LEGACY_H_ +#define _ECORE_EXE_EO_LEGACY_H_ + +#ifndef _ECORE_EXE_EO_CLASS_TYPE +#define _ECORE_EXE_EO_CLASS_TYPE + +typedef Eo Ecore_Exe; + +#endif + +#ifndef _ECORE_EXE_EO_TYPES +#define _ECORE_EXE_EO_TYPES + +/** A structure which stores information on lines data from a child process. + * + * @ingroup Ecore_Exe_Event_Data + */ +typedef struct _Ecore_Exe_Event_Data_Line +{ + char *line; /**< The bytes of a line of buffered data */ + int size; /**< The size of the line buffer in bytes */ +} Ecore_Exe_Event_Data_Line; + +/** Ecore exe event data structure + * + * @ingroup Ecore_Exe + */ +typedef struct _Ecore_Exe_Event_Data +{ + Efl_Object *exe; /**< The handle to the process. FIXME: should actually be + * Ecore.Exe, workaround cyclic */ + void *data; /**< The raw binary data from the child process received */ + int size; /**< The size of this data in bytes */ + Ecore_Exe_Event_Data_Line *lines; /**< An array of line data if line buffered. + * The last one has its line member set to + * @c NULL */ +} Ecore_Exe_Event_Data; + +/** Flags for executing a child with its stdin and/or stdout piped back. + * + * @ingroup Ecore + */ +typedef enum +{ + ECORE_EXE_NONE = 0, /**< No exe flags at all */ + ECORE_EXE_PIPE_READ = 1, /**< Exe Pipe Read mask */ + ECORE_EXE_PIPE_WRITE = 2, /**< Exe Pipe Write mask */ + ECORE_EXE_PIPE_ERROR = 4, /**< Exe Pipe error mask */ + ECORE_EXE_PIPE_READ_LINE_BUFFERED = 8, /**< Reads are buffered until a newline + * and split 1 line per + * Ecore_Exe_Event_Data_Line */ + ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = 16, /**< Errors are buffered until a + * newline and split 1 line per + * Ecore_Exe_Event_Data_Line */ + ECORE_EXE_PIPE_AUTO = 32, /**< stdout and stderr are buffered automatically */ + ECORE_EXE_RESPAWN = 64, /**< FIXME: Exe is restarted if it dies */ + ECORE_EXE_USE_SH = 128, /**< Use /bin/sh to run the command. */ + ECORE_EXE_NOT_LEADER = 256, /**< Do not use setsid() to set the executed + * process as its own session leader */ + ECORE_EXE_TERM_WITH_PARENT = 512, /**< Makes child receive SIGTERM when parent + * dies. */ + ECORE_EXE_ISOLATE_IO = 1024 /**< Try and isolate stdin/out and err of the + * process so it isn't shared with the parent. */ +} Ecore_Exe_Flags; + + +#endif + + + +#endif diff --git a/src/lib/ecore/ecore_exe_posix.c b/src/lib/ecore/ecore_exe_posix.c index a9332d1832..6a0cc3b79e 100644 --- a/src/lib/ecore/ecore_exe_posix.c +++ b/src/lib/ecore/ecore_exe_posix.c @@ -858,7 +858,7 @@ _impl_ecore_exe_kill(Ecore_Exe *obj EINA_UNUSED, Ecore_Exe_Data *exe) efl_del(exe->doomsday_clock); exe->doomsday_clock = efl_add(EFL_LOOP_TIMER_CLASS, obj, efl_event_callback_add(efl_added, - EFL_LOOP_TIMER_EVENT_TICK, + EFL_LOOP_TIMER_EVENT_TIMER_TICK, _ecore_exe_make_sure_its_really_dead, obj), efl_loop_timer_interval_set(efl_added, 10.0)); @@ -896,7 +896,7 @@ _ecore_exe_make_sure_its_dead(void *data, const Efl_Event *event) INF("Sending KILL signal to allegedly dead PID %d.", exe->pid); exe->doomsday_clock = efl_add(EFL_LOOP_TIMER_CLASS, exe_obj, efl_event_callback_add(efl_added, - EFL_LOOP_TIMER_EVENT_TICK, + EFL_LOOP_TIMER_EVENT_TIMER_TICK, _ecore_exe_make_sure_its_really_dead, exe_obj), efl_loop_timer_interval_set(efl_added, 10.0)); @@ -1295,7 +1295,7 @@ _ecore_exe_dead_attach(Ecore_Exe *obj) if (exe->doomsday_clock) return; exe->doomsday_clock = efl_add(EFL_LOOP_TIMER_CLASS, obj, efl_event_callback_add(efl_added, - EFL_LOOP_TIMER_EVENT_TICK, + EFL_LOOP_TIMER_EVENT_TIMER_TICK, _ecore_exe_make_sure_its_dead, obj), efl_loop_timer_interval_set(efl_added, 10.0)); diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index 2c1a2ef868..42d554cf0f 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -248,7 +248,7 @@ _ecore_try_add_to_call_list(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd, Ecore_Fd_Han DBG("next_ready"); return; } - if (fdh->read_active || fdh->write_active || fdh->error_active) + if (fdh->read_active || fdh->write_active || fdh->error_active || (fdh->flags & ECORE_FD_ALWAYS)) { DBG("added"); // make sure next_ready is non-null by pointing to ourselves @@ -583,6 +583,10 @@ _ecore_main_fdh_epoll_mark_active(Eo *obj, Efl_Loop_Data *pd) fdh->write_active = EINA_TRUE; fdh->error_active = EINA_TRUE; } + /* We'll add this one anyway outside this function, + don't want it twice */ + if (fdh->flags & ECORE_FD_ALWAYS) + continue; _ecore_try_add_to_call_list(obj, pd, fdh); } @@ -1357,6 +1361,9 @@ _ecore_main_fd_handler_add(Eo *obj, if (is_file) pd->file_fd_handlers = eina_list_append (pd->file_fd_handlers, fdh); + if (fdh->flags & ECORE_FD_ALWAYS) + pd->always_fd_handlers = eina_list_append + (pd->always_fd_handlers, fdh); pd->fd_handlers = (Ecore_Fd_Handler *) eina_inlist_append(EINA_INLIST_GET(pd->fd_handlers), EINA_INLIST_GET(fdh)); @@ -1664,6 +1671,9 @@ _ecore_main_content_clear(Eo *obj, Efl_Loop_Data *pd) if (pd->file_fd_handlers) pd->file_fd_handlers = eina_list_free(pd->file_fd_handlers); + if (pd->always_fd_handlers) + pd->always_fd_handlers = + eina_list_free(pd->always_fd_handlers); if (pd->fd_handlers_to_delete) pd->fd_handlers_to_delete = eina_list_free(pd->fd_handlers_to_delete); @@ -1741,7 +1751,7 @@ _ecore_main_select(Eo *obj, Efl_Loop_Data *pd, double timeout) fd_set rfds, wfds, exfds; Ecore_Fd_Handler *fdh; Eina_List *l; - int max_fd, ret; + int max_fd, ret, outval; #ifndef _WIN32 int err_no; #endif @@ -1785,17 +1795,17 @@ _ecore_main_select(Eo *obj, Efl_Loop_Data *pd, double timeout) { if (!fdh->delete_me) { - if (fdh->flags & ECORE_FD_READ) + if ((fdh->flags & ECORE_FD_READ) || (fdh->flags & ECORE_FD_ALWAYS)) { FD_SET(fdh->fd, &rfds); if (fdh->fd > max_fd) max_fd = fdh->fd; } - if (fdh->flags & ECORE_FD_WRITE) + if ((fdh->flags & ECORE_FD_WRITE) || (fdh->flags & ECORE_FD_ALWAYS)) { FD_SET(fdh->fd, &wfds); if (fdh->fd > max_fd) max_fd = fdh->fd; } - if (fdh->flags & ECORE_FD_ERROR) + if ((fdh->flags & ECORE_FD_ERROR) || (fdh->flags & ECORE_FD_ALWAYS)) { FD_SET(fdh->fd, &exfds); if (fdh->fd > max_fd) max_fd = fdh->fd; @@ -1815,17 +1825,17 @@ _ecore_main_select(Eo *obj, Efl_Loop_Data *pd, double timeout) { if (!fdh->delete_me) { - if (fdh->flags & ECORE_FD_READ) + if ((fdh->flags & ECORE_FD_READ) || (fdh->flags & ECORE_FD_ALWAYS)) { FD_SET(fdh->fd, &rfds); if (fdh->fd > max_fd) max_fd = fdh->fd; } - if (fdh->flags & ECORE_FD_WRITE) + if ((fdh->flags & ECORE_FD_WRITE) || (fdh->flags & ECORE_FD_ALWAYS)) { FD_SET(fdh->fd, &wfds); if (fdh->fd > max_fd) max_fd = fdh->fd; } - if (fdh->flags & ECORE_FD_ERROR) + if ((fdh->flags & ECORE_FD_ERROR) || (fdh->flags & ECORE_FD_ALWAYS)) { FD_SET(fdh->fd, &exfds); if (fdh->fd > max_fd) max_fd = fdh->fd; @@ -1851,7 +1861,11 @@ _ecore_main_select(Eo *obj, Efl_Loop_Data *pd, double timeout) if (ret < 0) { #ifndef _WIN32 - if (err_no == EINTR) return -1; + if (err_no == EINTR) + { + outval = -1; + goto BAIL; + } else if (err_no == EBADF) _ecore_main_fd_handlers_bads_rem(obj, pd); #endif } @@ -1890,13 +1904,22 @@ _ecore_main_select(Eo *obj, Efl_Loop_Data *pd, double timeout) _ecore_try_add_to_call_list(obj, pd, fdh); } } + outval = 1; + goto BAIL; + } + outval = 0; +BAIL: + EINA_LIST_FOREACH(pd->always_fd_handlers, l, fdh) + _ecore_try_add_to_call_list(obj, pd, fdh); + + if (ret > 0) + { _ecore_main_fd_handlers_cleanup(obj, pd); #ifdef _WIN32 _ecore_main_win32_handlers_cleanup(obj, pd); #endif - return 1; } - return 0; + return outval || pd->always_fd_handlers; } #endif @@ -2017,6 +2040,8 @@ _ecore_main_fd_handlers_cleanup(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd) EINA_INLIST_GET(fdh)); if (fdh->file) pd->file_fd_handlers = eina_list_remove(pd->file_fd_handlers, fdh); + if (fdh->flags & ECORE_FD_ALWAYS) + pd->always_fd_handlers = eina_list_remove(pd->always_fd_handlers, fdh); ECORE_MAGIC_SET(fdh, ECORE_MAGIC_NONE); ecore_fd_handler_mp_free(fdh); pd->fd_handlers_to_delete = eina_list_remove_list @@ -2074,7 +2099,8 @@ _ecore_main_fd_handlers_call(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd) { if ((fdh->read_active) || (fdh->write_active) || - (fdh->error_active)) + (fdh->error_active) || + (fdh->flags & ECORE_FD_ALWAYS)) { fdh->references++; if (!_ecore_call_fd_cb(fdh->func, fdh->data, fdh)) diff --git a/src/lib/ecore/ecore_private.h b/src/lib/ecore/ecore_private.h index c29f73d189..2022526182 100644 --- a/src/lib/ecore/ecore_private.h +++ b/src/lib/ecore/ecore_private.h @@ -5,7 +5,7 @@ #include "ecore_internal.h" -#include "ecore_exe.eo.h" +#include "ecore_exe_eo.h" #include "ecore_event_message.eo.h" #include "ecore_event_message_handler.eo.h" @@ -94,15 +94,8 @@ 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; -struct _Message_Handler -{ - Eo *handler; - const Eo *klass; -}; - struct _Message { EINA_INLIST; @@ -138,6 +131,7 @@ struct _Efl_Loop_Data Ecore_Fd_Handler *fd_handlers; Eina_List *fd_handlers_with_prep; Eina_List *file_fd_handlers; + Eina_List *always_fd_handlers; Eina_List *fd_handlers_with_buffer; Eina_List *fd_handlers_to_delete; Ecore_Fd_Handler *fd_handlers_to_call; @@ -149,7 +143,6 @@ struct _Efl_Loop_Data Eina_List *win32_handlers_to_delete; # endif - Eina_Inarray *message_handlers; Eina_Inlist *message_queue; unsigned int message_walking; @@ -188,7 +181,6 @@ struct _Efl_Task_Data { Eina_Stringshare *command; Eina_Array *args; - Eina_Hash *env; Efl_Task_Priority priority; int exit_code; Efl_Task_Flags flags; diff --git a/src/lib/ecore/ecore_signal.c b/src/lib/ecore/ecore_signal.c index f970842d31..e16694b55a 100644 --- a/src/lib/ecore/ecore_signal.c +++ b/src/lib/ecore/ecore_signal.c @@ -247,7 +247,9 @@ _ecore_signal_pipe_init(void) } eina_file_close_on_exec(sig_pipe[0], EINA_TRUE); eina_file_close_on_exec(sig_pipe[1], EINA_TRUE); - fcntl(sig_pipe[0], F_SETFL, O_NONBLOCK); + if (fcntl(sig_pipe[0], F_SETFL, O_NONBLOCK) < 0) + ERR("can't set pipe to NONBLOCK"); + } _signalhandler_setup(); if (!sig_pipe_handler) @@ -445,7 +447,7 @@ _ecore_signal_waitpid(Eina_Bool once, siginfo_t info) efl_add(EFL_LOOP_TIMER_CLASS, ML_OBJ, efl_loop_timer_interval_set(efl_added, 0.1), efl_event_callback_add - (efl_added, EFL_LOOP_TIMER_EVENT_TICK, + (efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, _ecore_signal_exe_exit_delay, e)); _ecore_exe_doomsday_clock_set(e->exe, doomsday_clock); } diff --git a/src/lib/ecore/ecore_time.c b/src/lib/ecore/ecore_time.c index c7c79b1ad5..303295b796 100644 --- a/src/lib/ecore/ecore_time.c +++ b/src/lib/ecore/ecore_time.c @@ -2,6 +2,8 @@ # include #endif +#define EFL_LOOP_PROTECTED + #include #include diff --git a/src/lib/ecore/ecore_timer.c b/src/lib/ecore/ecore_timer.c index 1beae5d0a4..37280e8ee3 100644 --- a/src/lib/ecore/ecore_timer.c +++ b/src/lib/ecore/ecore_timer.c @@ -79,7 +79,7 @@ _check_timer_event_catcher_add(void *data, const Efl_Event *event) for (i = 0; array[i].desc != NULL; i++) { - if (array[i].desc == EFL_LOOP_TIMER_EVENT_TICK) + if (array[i].desc == EFL_LOOP_TIMER_EVENT_TIMER_TICK) { if (timer->listening++ > 0) return; _efl_loop_timer_util_instanciate(timer->loop_data, timer); @@ -99,7 +99,7 @@ _check_timer_event_catcher_del(void *data, const Efl_Event *event) for (i = 0; array[i].desc != NULL; i++) { - if (array[i].desc == EFL_LOOP_TIMER_EVENT_TICK) + if (array[i].desc == EFL_LOOP_TIMER_EVENT_TIMER_TICK) { if ((--timer->listening) > 0) return; _efl_loop_timer_util_instanciate(timer->loop_data, timer); @@ -164,7 +164,7 @@ _ecore_timer_legacy_tick(void *data, const Efl_Event *event) } EFL_CALLBACKS_ARRAY_DEFINE(legacy_timer, - { EFL_LOOP_TIMER_EVENT_TICK, _ecore_timer_legacy_tick }, + { EFL_LOOP_TIMER_EVENT_TIMER_TICK, _ecore_timer_legacy_tick }, { EFL_EVENT_DEL, _ecore_timer_legacy_del }); EAPI Ecore_Timer * @@ -240,26 +240,26 @@ ecore_timer_del(Ecore_Timer *timer) } EOLIAN static void -_efl_loop_timer_interval_set(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer, double in) +_efl_loop_timer_timer_interval_set(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer, double in) { if (in < 0.0) in = 0.0; timer->in = in; } EOLIAN static double -_efl_loop_timer_interval_get(const Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer) +_efl_loop_timer_timer_interval_get(const Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer) { return timer->in; } EOLIAN static void -_efl_loop_timer_delay(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *pd, double add) +_efl_loop_timer_timer_delay(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *pd, double add) { _efl_loop_timer_util_delay(pd, add); } EOLIAN static void -_efl_loop_timer_reset(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer) +_efl_loop_timer_timer_reset(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer) { double now, add; @@ -280,7 +280,7 @@ _efl_loop_timer_reset(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer) } EOLIAN static void -_efl_loop_timer_loop_reset(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer) +_efl_loop_timer_timer_loop_reset(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer) { double now, add; @@ -301,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(const Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer) +_efl_loop_timer_time_pending_get(const Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer) { double now, ret = 0.0; @@ -639,7 +639,7 @@ _efl_loop_timer_expired_call(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd, double when efl_ref(timer->object); eina_evlog("+timer", timer, 0.0, NULL); - efl_event_callback_call(timer->object, EFL_LOOP_TIMER_EVENT_TICK, NULL); + efl_event_callback_call(timer->object, EFL_LOOP_TIMER_EVENT_TIMER_TICK, NULL); eina_evlog("-timer", timer, 0.0, NULL); // may have changed in recursive main loops @@ -670,3 +670,4 @@ _efl_loop_timer_set(Efl_Loop_Timer_Data *timer, double at, double in) } #include "efl_loop_timer.eo.c" +#include "efl_loop_timer_eo.legacy.c" diff --git a/src/lib/ecore/efl_accelerate_interpolator.eo b/src/lib/ecore/efl_accelerate_interpolator.eo index 793f8b6212..9af36694af 100644 --- a/src/lib/ecore/efl_accelerate_interpolator.eo +++ b/src/lib/ecore/efl_accelerate_interpolator.eo @@ -1,4 +1,4 @@ -class Efl.Accelerate_Interpolator extends Efl.Object implements Efl.Interpolator +class @beta Efl.Accelerate_Interpolator extends Efl.Object implements Efl.Interpolator { [[Efl accelerate interpolator class diff --git a/src/lib/ecore/efl_app.c b/src/lib/ecore/efl_app.c index 8c5bf7ca8b..01ae3447e9 100644 --- a/src/lib/ecore/efl_app.c +++ b/src/lib/ecore/efl_app.c @@ -2,13 +2,10 @@ # include #endif -#define EFL_IO_READER_PROTECTED 1 -#define EFL_IO_WRITER_PROTECTED 1 -#define EFL_IO_CLOSER_PROTECTED 1 - #include #include "ecore_private.h" +#include "eo_internal.h" #ifndef _WIN32 # include @@ -16,108 +13,27 @@ #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_CLASS_SIMPLE_CLASS(efl_app, "Efl.App", EFL_APP_CLASS) Efl_Version _app_efl_version = { 0, 0, 0, 0, NULL, NULL }; -////////////////////////////////////////////////////////////////////////// - EOLIAN static Efl_App* -_efl_app_app_main_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED) +_efl_app_app_main_get(void) { if (_mainloop_singleton) return _mainloop_singleton; - _mainloop_singleton = efl_add_ref(EFL_APP_CLASS, NULL); + _mainloop_singleton = efl_add_ref(efl_app_realized_class_get(), NULL); _mainloop_singleton_data = efl_data_scope_get(_mainloop_singleton, EFL_LOOP_CLASS); return _mainloop_singleton; } -////////////////////////////////////////////////////////////////////////// - -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 const Efl_Version * -_efl_app_build_efl_version_get(const Eo *obj EINA_UNUSED, Efl_App_Data *pd EINA_UNUSED) +_efl_app_build_efl_version_get(const Eo *obj EINA_UNUSED, void *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) +_efl_app_efl_version_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED) { /* vanilla EFL: flavor = NULL */ static const Efl_Version version = { @@ -131,217 +47,6 @@ _efl_app_efl_version_get(const Eo *obj EINA_UNUSED, Efl_App_Data *pd EINA_UNUSED 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] = @@ -355,7 +60,7 @@ static const signed char primap[EFL_TASK_PRIORITY_ULTRA + 1] = #endif EOLIAN static void -_efl_app_efl_task_priority_set(Eo *obj, Efl_App_Data *pd EINA_UNUSED, Efl_Task_Priority priority) +_efl_app_efl_task_priority_set(Eo *obj, void *pd EINA_UNUSED, Efl_Task_Priority priority) { efl_task_priority_set(efl_super(obj, MY_CLASS), priority); #ifdef _WIN32 @@ -371,7 +76,7 @@ _efl_app_efl_task_priority_set(Eo *obj, Efl_App_Data *pd EINA_UNUSED, Efl_Task_P } EOLIAN static Efl_Task_Priority -_efl_app_efl_task_priority_get(const Eo *obj, Efl_App_Data *pd EINA_UNUSED) +_efl_app_efl_task_priority_get(const Eo *obj, void *pd EINA_UNUSED) { Efl_Task_Priority pri = EFL_TASK_PRIORITY_NORMAL; #ifdef _WIN32 diff --git a/src/lib/ecore/efl_app.eo b/src/lib/ecore/efl_app.eo index 30f0e987d3..7197c295bf 100644 --- a/src/lib/ecore/efl_app.eo +++ b/src/lib/ecore/efl_app.eo @@ -1,8 +1,12 @@ import efl_types; -class Efl.App extends Efl.Loop +abstract Efl.App extends Efl.Loop implements Efl.Core.Command_Line { - [[ ]] + [[Object representing the application itself. + + @since 1.22 + ]] + data: null; methods { @property app_main @class { [[ Returns the app object that is representing this process @@ -22,7 +26,7 @@ class Efl.App extends Efl.Loop ]] get {} values { - @cref version: Efl.Version; [[Efl version]] + @cref version: Efl.Version; [[Efl build version]] } } @property efl_version { @@ -46,15 +50,6 @@ class Efl.App extends Efl.Loop 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 index 250d879118..c02fd11903 100644 --- a/src/lib/ecore/efl_appthread.c +++ b/src/lib/ecore/efl_appthread.c @@ -37,10 +37,10 @@ _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); +// 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); @@ -139,7 +139,7 @@ _efl_appthread_efl_io_reader_can_read_set(Eo *obj, Efl_Appthread_Data *pd, Eina_ 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); + efl_event_callback_call(obj, EFL_IO_READER_EVENT_CAN_READ_CHANGED, &can_read); } EOLIAN static Eina_Bool @@ -231,7 +231,7 @@ _efl_appthread_efl_io_writer_can_write_set(Eo *obj, Efl_Appthread_Data *pd, Eina 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); + efl_event_callback_call(obj, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, &can_write); } EOLIAN static Eina_Bool diff --git a/src/lib/ecore/efl_appthread.eo b/src/lib/ecore/efl_appthread.eo index 964d128937..076a1506ee 100644 --- a/src/lib/ecore/efl_appthread.eo +++ b/src/lib/ecore/efl_appthread.eo @@ -1,4 +1,4 @@ -class Efl.Appthread extends Efl.Loop implements Efl.ThreadIO +class @beta Efl.Appthread extends Efl.Loop implements Efl.ThreadIO, Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer, Efl.Core.Command_Line { [[ ]] methods { diff --git a/src/lib/ecore/efl_boolean_model.c b/src/lib/ecore/efl_boolean_model.c new file mode 100644 index 0000000000..da9d3bdf96 --- /dev/null +++ b/src/lib/ecore/efl_boolean_model.c @@ -0,0 +1,210 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#include "efl_composite_model_private.h" + +typedef struct _Efl_Boolean_Model_Data Efl_Boolean_Model_Data; +typedef struct _Efl_Boolean_Model_Value Efl_Boolean_Model_Value; + +struct _Efl_Boolean_Model_Data +{ + Efl_Boolean_Model_Data *parent; + Eina_Hash *values; +}; + +struct _Efl_Boolean_Model_Value +{ + Eina_Stringshare *property; + + // 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_Iterator * +_efl_boolean_model_efl_model_properties_get(const Eo *obj, + Efl_Boolean_Model_Data *pd) +{ + EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(props, + obj, EFL_BOOLEAN_MODEL_CLASS, + eina_hash_iterator_key_new(pd->parent->values)); + return props; +} + +static Eina_Value * +_efl_boolean_model_efl_model_property_get(const Eo *obj, + Efl_Boolean_Model_Data *pd, + const char *property) +{ + Efl_Boolean_Model_Value *v; + Eina_Stringshare *s; + Eina_Bool flag; + unsigned int index; + + if (property == NULL) return NULL; + + // If we do not have a parent set that his a BOOLEAN, then we should just forward up the call + if (!pd->parent) + return efl_model_property_get(efl_super(obj, EFL_BOOLEAN_MODEL_CLASS), property); + + // Check if this is requesting a defined boolean property + // Property are defined and their value are stored on the parent BOOLEAN + s = eina_stringshare_add(property); + v = eina_hash_find(pd->parent->values, s); + eina_stringshare_del(s); + + if (!v) // Not a property handle by this object, forward + return efl_model_property_get(efl_super(obj, EFL_BOOLEAN_MODEL_CLASS), property); + + index = efl_composite_model_index_get(obj); + + // As an optimization we do optimistically allocate the boolean array + // Better would be to have a sparse boolean array + if ((index >> 3) >= v->buffer_count) + flag = v->default_value; + else + flag = v->buffer[index >> 3] & (((unsigned char)1) << (index & 0x7)); + + return eina_value_bool_new(!!flag); +} + +static Eina_Future * +_efl_boolean_model_efl_model_property_set(Eo *obj, + Efl_Boolean_Model_Data *pd, + const char *property, Eina_Value *value) +{ + Efl_Boolean_Model_Value *v; + Eina_Stringshare *s; + Eina_Bool flag; + unsigned int index; + + if (!property) + return efl_loop_future_rejected(obj, + EFL_MODEL_ERROR_UNKNOWN); + + // If we do not have a parent set that his a BOOLEAN, then we should just forward up the call + if (!pd->parent) + return efl_model_property_set(efl_super(obj, EFL_BOOLEAN_MODEL_CLASS), + property, value); + + // Check if this is requesting a defined boolean property + // Property are defined and their value are stored on the parent BOOLEAN + s = eina_stringshare_add(property); + v = eina_hash_find(pd->parent->values, s); + eina_stringshare_del(s); + + if (!v) + return efl_model_property_set(efl_super(obj, EFL_BOOLEAN_MODEL_CLASS), + property, value); + + if (!eina_value_bool_convert(value, &flag)) + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_UNKNOWN); + + index = efl_composite_model_index_get(obj); + + // We are optimistically allocating the boolean buffer now. + // Aligning it on 64bits + if (v->buffer_count < (((index) >> 3) | 0x7) + 1) + { + unsigned int rcount = (((index | 0xF) >> 3) | 0x7) + 1; + unsigned char *tmp; + + tmp = realloc(v->buffer, rcount); + if (!tmp) return efl_loop_future_rejected(obj, ENOMEM); + v->buffer = tmp; + memset(v->buffer + v->buffer_count, 0, rcount - v->buffer_count); + v->buffer_count = rcount; + } + + // It is assumed that during slice get the buffer is properly sized + if (flag) + v->buffer[index >> 3] |= ((unsigned char)1) << (index & 0x7); + else + v->buffer[index >> 3] &= ~(((unsigned char)1) << (index & 0x7)); + + // Calling "properties,changed" event + efl_model_properties_changed(obj, property); + + // Return fulfilled future + return efl_loop_future_resolved(obj, eina_value_bool_init(!!flag)); +} + +static void +_boolean_value_free(void *data) +{ + Efl_Boolean_Model_Value *value = data; + + eina_stringshare_del(value->property); + value->property = NULL; + + free(value->buffer); + value->buffer = NULL; + value->buffer_count = 0; + + free(value); +} + +static Eo * +_efl_boolean_model_efl_object_constructor(Eo *obj, Efl_Boolean_Model_Data *pd) +{ + Eo *parent; + obj = efl_constructor(efl_super(obj, EFL_BOOLEAN_MODEL_CLASS)); + + if (!obj) return NULL; + + pd->values = eina_hash_stringshared_new(_boolean_value_free); + // Only add a reference to the parent if it is actually a BOOLEAN_MODEL_CLASS + // The root typically doesn't have any boolean property, only its child do + parent = efl_parent_get(obj); + if (efl_isa(parent, EFL_BOOLEAN_MODEL_CLASS)) + pd->parent = efl_data_scope_get(parent, EFL_BOOLEAN_MODEL_CLASS); + + return obj; +} + +static void +_efl_boolean_model_efl_object_destructor(Eo *obj, Efl_Boolean_Model_Data *pd) +{ + eina_hash_free(pd->values); + + efl_destructor(efl_super(obj, EFL_BOOLEAN_MODEL_CLASS)); +} + +static void +_efl_boolean_model_boolean_add(Eo *obj EINA_UNUSED, + Efl_Boolean_Model_Data *pd, + const char *name, Eina_Bool default_value) +{ + Efl_Boolean_Model_Value *value; + + if (!name) return ; + + value = calloc(1, sizeof (Efl_Boolean_Model_Value)); + if (!value) return ; + + value->property = eina_stringshare_add(name); + value->default_value = default_value; + + eina_hash_direct_add(pd->values, value->property, value); +} + +static void +_efl_boolean_model_boolean_del(Eo *obj EINA_UNUSED, + Efl_Boolean_Model_Data *pd, + const char *name) +{ + Eina_Stringshare *s; + + s = eina_stringshare_add(name); + eina_hash_del(pd->values, s, NULL); + eina_stringshare_del(s); +} + +#include "efl_boolean_model.eo.c" diff --git a/src/lib/ecore/efl_model_composite_boolean.eo b/src/lib/ecore/efl_boolean_model.eo similarity index 72% rename from src/lib/ecore/efl_model_composite_boolean.eo rename to src/lib/ecore/efl_boolean_model.eo index 47c7e3cfb6..19f8f02935 100644 --- a/src/lib/ecore/efl_model_composite_boolean.eo +++ b/src/lib/ecore/efl_boolean_model.eo @@ -1,6 +1,6 @@ -class Efl.Model_Composite_Boolean extends Efl.Model_Composite +class @beta Efl.Boolean_Model extends Efl.Composite_Model { - [[Efl model composite boolean class]] + [[Efl boolean model class]] methods { boolean_add { [[Add a new named boolean property with a defined default value.]] @@ -17,8 +17,9 @@ class Efl.Model_Composite_Boolean extends Efl.Model_Composite } } implements { + Efl.Model.properties { get; } + Efl.Model.property { get; set; } Efl.Object.constructor; Efl.Object.destructor; - Efl.Model.children_slice_get; } } diff --git a/src/lib/ecore/efl_bounce_interpolator.eo b/src/lib/ecore/efl_bounce_interpolator.eo index 85dc219ec2..d6b1147d17 100644 --- a/src/lib/ecore/efl_bounce_interpolator.eo +++ b/src/lib/ecore/efl_bounce_interpolator.eo @@ -1,4 +1,4 @@ -class Efl.Bounce_Interpolator extends Efl.Object implements Efl.Interpolator +class @beta Efl.Bounce_Interpolator extends Efl.Object implements Efl.Interpolator { [[Efl bounce interpolator class]] data: Efl_Bounce_Interpolator_Data; diff --git a/src/lib/ecore/efl_composite_model.c b/src/lib/ecore/efl_composite_model.c new file mode 100644 index 0000000000..668b382dfb --- /dev/null +++ b/src/lib/ecore/efl_composite_model.c @@ -0,0 +1,396 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#include "ecore_private.h" + +#include "efl_composite_model.eo.h" + +#define _CHILD_INDEX "child.index" + +typedef struct _Efl_Composite_Model_Data Efl_Composite_Model_Data; + +struct _Efl_Composite_Model_Data +{ + EINA_RBTREE; + + Efl_Composite_Model *self; + Efl_Model *source; + Eina_Rbtree *indexed; + + unsigned int index; + + Eina_Bool need_index : 1; + Eina_Bool set_index : 1; + Eina_Bool inserted : 1; +}; + +static Eina_Rbtree_Direction +_children_indexed_cmp(const Efl_Composite_Model_Data *left, + const Efl_Composite_Model_Data *right, + void *data EINA_UNUSED) +{ + if (left->index < right->index) + return EINA_RBTREE_LEFT; + return EINA_RBTREE_RIGHT; +} + +static int +_children_indexed_key(const Efl_Composite_Model_Data *node, + const int *key, int length EINA_UNUSED, void *data EINA_UNUSED) +{ + return node->index - *key; +} + +static void +_efl_composite_model_efl_object_destructor(Eo *obj, Efl_Composite_Model_Data *pd) +{ + if (pd->source) + { + efl_event_callback_forwarder_del(pd->source, EFL_MODEL_EVENT_CHILD_ADDED, obj); + efl_event_callback_forwarder_del(pd->source, EFL_MODEL_EVENT_CHILD_REMOVED, obj); + efl_event_callback_forwarder_del(pd->source, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, obj); + efl_event_callback_forwarder_del(pd->source, EFL_MODEL_EVENT_PROPERTIES_CHANGED, obj); + + efl_unref(pd->source); + pd->source = NULL; + } + + efl_destructor(efl_super(obj, EFL_COMPOSITE_MODEL_CLASS)); +} + +static void +_efl_composite_model_efl_object_invalidate(Eo *obj, Efl_Composite_Model_Data *pd) +{ + if (pd->inserted) + { + Eo *parent; + + parent = efl_parent_get(obj); + if (efl_isa(parent, EFL_COMPOSITE_MODEL_CLASS)) + { + Efl_Composite_Model_Data *ppd; + + ppd = efl_data_scope_get(parent, EFL_COMPOSITE_MODEL_CLASS); + ppd->indexed = eina_rbtree_inline_remove(ppd->indexed, EINA_RBTREE_GET(pd), + EINA_RBTREE_CMP_NODE_CB(_children_indexed_cmp), NULL); + pd->inserted = EINA_FALSE; + } + else + { + ERR("Unexpected parent change during the life of object: %s this might lead to crash.", efl_debug_name_get(obj)); + } + } + + efl_invalidate(efl_super(obj, EFL_COMPOSITE_MODEL_CLASS)); +} + +static Efl_Object * +_efl_composite_model_efl_object_finalize(Eo *obj, Efl_Composite_Model_Data *pd) +{ + Eo *parent; + + if (pd->source == NULL) + { + ERR("Source of the composite model wasn't defined at construction time."); + return NULL; + } + + pd->self = obj; + + parent = efl_parent_get(obj); + if (efl_isa(parent, EFL_COMPOSITE_MODEL_CLASS) && !pd->inserted) + { + Efl_Composite_Model_Data *ppd = efl_data_scope_get(parent, EFL_COMPOSITE_MODEL_CLASS); + Efl_Composite_Model_Data *lookup; + + lookup = (void*) eina_rbtree_inline_lookup(ppd->indexed, &pd->index, sizeof (int), + EINA_RBTREE_CMP_KEY_CB(_children_indexed_key), NULL); + if (lookup) + { + // There is already an object at this index, we should not + // build anything different than what exist. Returning existing one. + return lookup->self; + } + else + { + ppd->indexed = eina_rbtree_inline_insert(ppd->indexed, EINA_RBTREE_GET(pd), + EINA_RBTREE_CMP_NODE_CB(_children_indexed_cmp), NULL); + + pd->inserted = EINA_TRUE; + } + } + + return obj; +} + +static void +_efl_composite_model_index_set(Eo *obj EINA_UNUSED, Efl_Composite_Model_Data *pd, unsigned int index) +{ + if (pd->set_index || !pd->source) + return ; + pd->index = index; + pd->set_index = EINA_TRUE; +} + +static unsigned int +_efl_composite_model_index_get(const Eo *obj, Efl_Composite_Model_Data *pd) +{ + Eina_Value *fetch = NULL; + unsigned int r = 0xFFFFFFFF; + + if (pd->set_index) + return pd->index; + if (pd->need_index) + return 0xFFFFFFFF; + + fetch = efl_model_property_get(obj, _CHILD_INDEX); + if (!eina_value_uint_convert(fetch, &r)) + return 0xFFFFFFFF; + eina_value_free(fetch); + + return r; +} + +static void +_efl_composite_model_efl_ui_view_model_set(Eo *obj EINA_UNUSED, Efl_Composite_Model_Data *pd, Efl_Model *model) +{ + Eina_Iterator *properties; + const char *property; + + if (pd->source != NULL) + { + ERR("Source already set for composite model. It can only be set once."); + return ; + } + pd->source = efl_ref(model); + + efl_event_callback_forwarder_priority_add(model, EFL_MODEL_EVENT_CHILD_ADDED, EFL_CALLBACK_PRIORITY_BEFORE, obj); + efl_event_callback_forwarder_priority_add(model, EFL_MODEL_EVENT_CHILD_REMOVED, EFL_CALLBACK_PRIORITY_BEFORE, obj); + efl_event_callback_forwarder_priority_add(model, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, EFL_CALLBACK_PRIORITY_BEFORE, obj); + efl_event_callback_forwarder_priority_add(model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, EFL_CALLBACK_PRIORITY_BEFORE, obj); + + pd->need_index = EINA_TRUE; + + properties = efl_model_properties_get(pd->source); + EINA_ITERATOR_FOREACH(properties, property) + { + if (!strcmp(property, _CHILD_INDEX)) + { + pd->need_index = EINA_FALSE; + break; + } + } + eina_iterator_free(properties); +} + +static Efl_Model * +_efl_composite_model_efl_ui_view_model_get(const Eo *obj EINA_UNUSED, Efl_Composite_Model_Data *pd) +{ + return pd->source; +} + +static Eina_Future * +_efl_composite_model_efl_model_property_set(Eo *obj, Efl_Composite_Model_Data *pd, + const char *property, Eina_Value *value) +{ + if (pd->need_index && !strcmp(property, _CHILD_INDEX)) + { + if (pd->set_index || !pd->source) + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_READ_ONLY); + if (!eina_value_uint_convert(value, &pd->index)) + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_UNKNOWN); + pd->set_index = EINA_TRUE; + return efl_loop_future_resolved(obj, eina_value_uint_init(pd->index)); + } + return efl_model_property_set(pd->source, property, value); +} + +static Eina_Value * +_efl_composite_model_efl_model_property_get(const Eo *obj EINA_UNUSED, Efl_Composite_Model_Data *pd, + const char *property) +{ + if (pd->need_index && !strcmp(property, _CHILD_INDEX)) + { + if (pd->set_index) + return eina_value_uint_new(pd->index); + return eina_value_error_new(EAGAIN); + } + return efl_model_property_get(pd->source, property); +} + +static Eina_Iterator * +_efl_composite_model_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Composite_Model_Data *pd) +{ + if (pd->need_index) + { + static const char *composite_properties[] = { + _CHILD_INDEX + }; + + return eina_multi_iterator_new(efl_model_properties_get(pd->source), + EINA_C_ARRAY_ITERATOR_NEW(composite_properties)); + } + return efl_model_properties_get(pd->source); +} + +static unsigned int +_efl_composite_model_efl_model_children_count_get(const Eo *obj EINA_UNUSED, Efl_Composite_Model_Data *pd) +{ + return efl_model_children_count_get(pd->source); +} + +typedef struct _Efl_Composite_Model_Slice_Request Efl_Composite_Model_Slice_Request; +struct _Efl_Composite_Model_Slice_Request +{ + const Efl_Class *self; + Eo *parent; + unsigned int start; + unsigned int dummy_need; +}; + +static Eina_Value +_efl_composite_model_then(Eo *o EINA_UNUSED, void *data, const Eina_Value v) +{ + Efl_Composite_Model_Slice_Request *req = data; + unsigned int i, len; + Eina_Value r = EINA_VALUE_EMPTY; + Eo *target = NULL; + + eina_value_array_setup(&r, EINA_VALUE_TYPE_OBJECT, 4); + + EINA_VALUE_ARRAY_FOREACH(&v, len, i, target) + { + Eo *composite; + + // First set the Model to be used as a source so that we the newly object + // can know if it needs to retain the information regarding its index. + composite = efl_add_ref(req->self, req->parent, + efl_ui_view_model_set(efl_added, target), + efl_composite_model_index_set(efl_added, req->start + i), + efl_loop_model_volatile_make(efl_added)); + + eina_value_array_append(&r, composite); + // Dropping this scope reference + efl_unref(composite); + } + + while (req->dummy_need) + { + Eo *dummy, *dummy_proxy; + + // Create a dummy object and its proxy + dummy = efl_add(EFL_GENERIC_MODEL_CLASS, req->parent); + dummy_proxy = efl_add_ref(req->self, req->parent, + efl_ui_view_model_set(efl_added, dummy), + efl_composite_model_index_set(efl_added, req->start + i), + efl_loop_model_volatile_make(efl_added)); + efl_parent_set(dummy, dummy_proxy); + + eina_value_array_append(&r, dummy_proxy); + efl_unref(dummy_proxy); + + req->dummy_need--; + i++; + } + + return r; +} + +static void +_efl_composite_model_clean(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED) +{ + Efl_Composite_Model_Slice_Request *req = data; + + efl_unref(req->parent); + free(data); +} + +static Eina_Future * +_efl_composite_model_efl_model_children_slice_get(Eo *obj, + Efl_Composite_Model_Data *pd, + unsigned int start, + unsigned int count) +{ + Efl_Composite_Model_Slice_Request *req; + Eina_Future *f; + unsigned int source_count, self_count; + unsigned int req_count; + + source_count = efl_model_children_count_get(pd->source); + self_count = efl_model_children_count_get(obj); + + if (start + count > source_count && + start + count > self_count) + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE); + + if (start > source_count) + { + Eina_Value r = EINA_VALUE_EMPTY; + unsigned int i = 0; + + eina_value_array_setup(&r, EINA_VALUE_TYPE_OBJECT, 4); + + while (count) + { + Eo *dummy, *dummy_proxy; + + // Create a dummy object and its proxy + dummy = efl_add(EFL_GENERIC_MODEL_CLASS, obj); + dummy_proxy = efl_add_ref(efl_class_get(obj), obj, + efl_ui_view_model_set(efl_added, dummy), + efl_composite_model_index_set(efl_added, start + i), + efl_loop_model_volatile_make(efl_added)); + efl_parent_set(dummy, dummy_proxy); + + eina_value_array_append(&r, dummy_proxy); + efl_unref(dummy_proxy); + + count--; + i++; + } + + return efl_loop_future_resolved(obj, r); + } + + req_count = start + count > source_count ? source_count - start : count; + f = efl_model_children_slice_get(pd->source, start, req_count); + if (!f) return NULL; + + req = malloc(sizeof (Efl_Composite_Model_Slice_Request)); + if (!req) return efl_loop_future_rejected(obj, ENOMEM); + + req->self = efl_class_get(obj); + req->parent = efl_ref(obj); + req->start = start; + if (start + count < source_count) + req->dummy_need = 0; + else + req->dummy_need = count - (source_count - start); + + return efl_future_then(obj, f, .success_type = EINA_VALUE_TYPE_ARRAY, + .success = _efl_composite_model_then, + .free = _efl_composite_model_clean, + .data = req); +} + +static Efl_Object * +_efl_composite_model_efl_model_child_add(Eo *obj EINA_UNUSED, + Efl_Composite_Model_Data *pd) +{ + return efl_model_child_add(pd->source); +} + +static void +_efl_composite_model_efl_model_child_del(Eo *obj EINA_UNUSED, + Efl_Composite_Model_Data *pd, + Efl_Object *child) +{ + efl_model_child_del(pd->source, child); +} + +#include "efl_composite_model.eo.c" diff --git a/src/lib/ecore/efl_composite_model.eo b/src/lib/ecore/efl_composite_model.eo new file mode 100644 index 0000000000..34a77fa9dc --- /dev/null +++ b/src/lib/ecore/efl_composite_model.eo @@ -0,0 +1,38 @@ +class @beta Efl.Composite_Model extends Efl.Loop_Model implements Efl.Ui.View +{ + [[Efl model for all composite class which provide a unified API to set source of data. + + This class also provide an @Efl.Model.property "$child.index" that match the value of @.index.]] + methods { + @property index { + [[Position of this object in the parent model.]] + set { + [[Set the index. It can only be set before the object is finalized, + but after the Model it compose is set and only if that Model does + not provide an index already.]] + } + get { + [[Get the index. It will only work after the object has been finalized.]] + } + values { + index: uint; [[Index of the object in the parent model. The index is uniq and start from zero.]] + } + } + } + implements { + Efl.Object.destructor; + Efl.Object.invalidate; + 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; + } + constructors { + .index @optional; + Efl.Ui.View.model; + } +} diff --git a/src/lib/ecore/efl_model_composite_private.h b/src/lib/ecore/efl_composite_model_private.h similarity index 80% rename from src/lib/ecore/efl_model_composite_private.h rename to src/lib/ecore/efl_composite_model_private.h index 0b0f042349..c9e3783b9d 100644 --- a/src/lib/ecore/efl_model_composite_private.h +++ b/src/lib/ecore/efl_composite_model_private.h @@ -1,15 +1,15 @@ -#define EFL_MODEL_COMPOSITE_PROPERTIES(name, dyn, sta, ...) \ - EFL_MODEL_COMPOSITE_PROPERTIES_SUPER(name, NULL, NULL, (dyn), sta, ##__VA_ARGS__) +#define EFL_COMPOSITE_MODEL_PROPERTIES(name, dyn, sta, ...) \ + EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(name, NULL, NULL, (dyn), sta, ##__VA_ARGS__) -#define EFL_MODEL_COMPOSITE_PROPERTIES_SUPER(name, obj, klass, dyn, ...) \ +#define EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(name, obj, klass, dyn, ...) \ Eina_Iterator *name; \ do \ { \ static const char *static_props__[] = { \ __VA_ARGS__ \ }; \ - name = _efl_model_composite_properties_mix( \ + name = _efl_composite_model_properties_mix( \ ((obj) ? efl_model_properties_get(efl_super((obj), (klass))) : NULL), \ (dyn), \ EINA_C_ARRAY_ITERATOR_NEW(static_props__)); \ @@ -18,7 +18,7 @@ static inline Eina_Iterator * -_efl_model_composite_properties_mix(Eina_Iterator *super, Eina_Iterator *dyn, Eina_Iterator *sta) +_efl_composite_model_properties_mix(Eina_Iterator *super, Eina_Iterator *dyn, Eina_Iterator *sta) { Eina_Iterator *its[3]; int i = 0; diff --git a/src/lib/ecore/efl_container_model.c b/src/lib/ecore/efl_container_model.c new file mode 100644 index 0000000000..08c1b65d7b --- /dev/null +++ b/src/lib/ecore/efl_container_model.c @@ -0,0 +1,313 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include + +#include "ecore_internal.h" +#include "efl_composite_model_private.h" + +typedef struct _Efl_Container_Property_Data Efl_Container_Property_Data; +typedef struct _Efl_Container_Model_Data Efl_Container_Model_Data; + +struct _Efl_Container_Property_Data +{ + Eina_Stringshare *name; + + const Eina_Value_Type *type; + Eina_Array *values; +}; + +struct _Efl_Container_Model_Data +{ + Efl_Container_Model_Data *parent; + + Eina_Hash *properties; // All properties value for children + unsigned int children_count; +}; + +static void +_property_values_free(Eina_Array *values) +{ + Eina_Value *v; + + while ((v = eina_array_pop(values))) + eina_value_free(v); + eina_array_free(values); +} + +static void +_property_data_free_cb(void *data) +{ + Efl_Container_Property_Data *cpd = data; + + eina_stringshare_del(cpd->name); + _property_values_free(cpd->values); + free(cpd); +} + +static Efl_Object * +_efl_container_model_efl_object_constructor(Eo *obj, + Efl_Container_Model_Data *sd) +{ + Eo *parent; + + obj = efl_constructor(efl_super(obj, EFL_CONTAINER_MODEL_CLASS)); + if (!obj) return NULL; + + parent = efl_parent_get(obj); + if (efl_isa(parent, EFL_CONTAINER_MODEL_CLASS)) + sd->parent = efl_data_scope_get(parent, EFL_CONTAINER_MODEL_CLASS); + + sd->properties = eina_hash_stringshared_new(_property_data_free_cb); + + return obj; +} + +static Efl_Object * +_efl_container_model_efl_object_finalize(Eo *obj, Efl_Container_Model_Data *sd EINA_UNUSED) +{ + if (!efl_ui_view_model_get(obj)) + { + // Add a dummy object as source if there isn't any to allow using this class without source. + efl_ui_view_model_set(obj, efl_add(EFL_GENERIC_MODEL_CLASS, obj)); + } + return efl_finalize(efl_super(obj, EFL_CONTAINER_MODEL_CLASS)); +} + +static void +_efl_container_model_efl_object_destructor(Eo *obj, + Efl_Container_Model_Data *sd) +{ + eina_hash_free(sd->properties); + + efl_destructor(efl_super(obj, EFL_CONTAINER_MODEL_CLASS)); +} + +static const Eina_Value_Type * +_efl_container_model_child_property_value_type_get(Eo *obj EINA_UNUSED, + Efl_Container_Model_Data *sd, + const char *property) +{ + Efl_Container_Property_Data *cpd; + Eina_Stringshare *key; + + key = eina_stringshare_add(property); + cpd = eina_hash_find(sd->properties, key); + eina_stringshare_del(key); + + if (!cpd) return NULL; + return cpd->type; +} + +static Eina_Bool +_efl_container_model_child_property_add(Eo *obj, + Efl_Container_Model_Data *sd, + const char *name, + const Eina_Value_Type *type, + Eina_Iterator *values) +{ + Eina_Array *arr = NULL; + void *original; + Efl_Container_Property_Data *cpd = NULL; + unsigned int i; + Eina_Error err = EFL_MODEL_ERROR_INCORRECT_VALUE; + + name = eina_stringshare_add(name); + + if (!type || !values) + { + EINA_LOG_WARN("Invalid input data"); + goto on_error; + } + + err = ENOMEM; + arr = eina_array_new(4); + if (!arr) goto on_error; + + EINA_ITERATOR_FOREACH(values, original) + { + Eina_Value *copy = eina_value_new(type); + Eina_Bool r; + + if (type == EINA_VALUE_TYPE_STRINGSHARE || + type == EINA_VALUE_TYPE_STRING) + r = eina_value_set(copy, original); + else + r = eina_value_pset(copy, original); + + if (!r) + { + eina_value_free(copy); + copy = eina_value_error_new(EINA_ERROR_VALUE_FAILED); + } + + eina_array_push(arr, copy); + } + eina_iterator_free(values); + + err = EFL_MODEL_ERROR_UNKNOWN; + + cpd = eina_hash_find(sd->properties, name); + if (!cpd) + { + cpd = calloc(1, sizeof(Efl_Container_Property_Data)); + if (!cpd) + goto on_error; + + cpd->name = eina_stringshare_ref(name); + cpd->type = type; + cpd->values = arr; + + if (!eina_hash_direct_add(sd->properties, name, cpd)) + goto on_error; + } + else + { + _property_values_free(cpd->values); + + cpd->type = type; + cpd->values = arr; + } + + for (i = sd->children_count; i < eina_array_count(arr); ++i) + { + Efl_Model_Children_Event cevt = { 0 }; + + cevt.index = i; + + efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILD_ADDED, &cevt); + } + + if (eina_array_count(arr) > sd->children_count) + { + sd->children_count = eina_array_count(arr); + efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, NULL); + } + + eina_stringshare_del(name); + return EINA_TRUE; + + on_error: + eina_stringshare_del(name); + + if (cpd) free(cpd); + if (arr) _property_values_free(arr); + eina_error_set(err); + return EINA_FALSE; +} + +static Eina_Iterator * +_efl_container_model_efl_model_properties_get(const Eo *obj EINA_UNUSED, + Efl_Container_Model_Data *sd) +{ + EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(props, + obj, EFL_CONTAINER_MODEL_CLASS, + eina_hash_iterator_key_new(sd->parent->properties)); + return props; +} + +static Eina_Future * +_efl_container_model_efl_model_property_set(Eo *obj, + Efl_Container_Model_Data *pd, + const char *property, + Eina_Value *value) +{ + if (pd->parent) + { + Efl_Container_Property_Data *cpd; + Eina_Stringshare *name; + unsigned int index; + Eina_Value r = EINA_VALUE_EMPTY; + + name = eina_stringshare_add(property); + cpd = eina_hash_find(pd->parent->properties, name); + eina_stringshare_del(name); + + // Check if this is a property of this object + if (!cpd) goto not_mine; + // Check if we can get the expected type for this property + if (!cpd->values) + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE); + + index = efl_composite_model_index_get(obj); + + // Try converting the type before touching any data inside the Model + if (eina_value_type_get(value) != cpd->type) + { + eina_value_setup(&r, cpd->type); + + if (!eina_value_convert(value, &r)) + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE); + } + else + { + eina_value_copy(&r, value); + } + + // Expand the array to have enough space for this value if it wasn't already the case + while (index >= eina_array_count(cpd->values)) + eina_array_push(cpd->values, eina_value_error_new(EFL_MODEL_ERROR_INCORRECT_VALUE)); + + // Clean the previous value and introduce the new one + eina_value_free(eina_array_data_get(cpd->values, index)); + // Same type as the expected type, we can just replace the value + eina_array_data_set(cpd->values, index, eina_value_dup(&r)); + + eina_value_free(value); + return efl_loop_future_resolved(obj, r); + } + + not_mine: + return efl_model_property_set(efl_super(obj, EFL_CONTAINER_MODEL_CLASS), property, value); +} + +static Eina_Value * +_efl_container_model_efl_model_property_get(const Eo *obj, + Efl_Container_Model_Data *pd, + const char *property) +{ + if (pd->parent) + { + Efl_Container_Property_Data *cpd; + Eina_Stringshare *name; + Eina_Value *copy; + unsigned int index; + + name = eina_stringshare_add(property); + cpd = eina_hash_find(pd->parent->properties, name); + eina_stringshare_del(name); + + // Check if this is a property of this object + if (!cpd) goto not_mine; + // Check if we can get the expected type for this property + if (!cpd->values) return eina_value_error_new(EFL_MODEL_ERROR_INCORRECT_VALUE); + + index = efl_composite_model_index_get(obj); + + if (index >= eina_array_count(cpd->values)) + return eina_value_error_new(EFL_MODEL_ERROR_INCORRECT_VALUE); + + copy = eina_value_dup(eina_array_data_get(cpd->values, index)); + + return copy; + } + + not_mine: + return efl_model_property_get(efl_super(obj, EFL_CONTAINER_MODEL_CLASS), property); +} + +static unsigned int +_efl_container_model_efl_model_children_count_get(const Eo *obj EINA_UNUSED, Efl_Container_Model_Data *sd) +{ + unsigned int pcount; + + pcount = efl_model_children_count_get(efl_super(obj, EFL_CONTAINER_MODEL_CLASS)); + + return pcount > sd->children_count ? pcount : sd->children_count; +} + +#include "efl_container_model.eo.c" diff --git a/src/lib/ecore/efl_model_container.eo b/src/lib/ecore/efl_container_model.eo similarity index 75% rename from src/lib/ecore/efl_model_container.eo rename to src/lib/ecore/efl_container_model.eo index 04fbdf8ae3..0c49805816 100644 --- a/src/lib/ecore/efl_model_container.eo +++ b/src/lib/ecore/efl_container_model.eo @@ -1,12 +1,12 @@ import eina_types; -class Efl.Model_Container extends Efl.Model_Loop +class @beta Efl.Container_Model extends Efl.Composite_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. The data in the given containers are copied and stored internally. @@ -21,14 +21,6 @@ class Efl.Model_Container extends Efl.Model_Loop } return: ptr(const(Eina.Value_Type)); [[Property type]] } - child_property_values_get { - [[Gets the values for the given property.]] - params { - name: string; [[Property name]] - } - return: iterator @owned @warn_unused; - [[The currently wrapped values]] - } child_property_add { [[Adds the given property to child objects and supply the values. @@ -48,12 +40,10 @@ class Efl.Model_Container extends Efl.Model_Loop } implements { Efl.Object.constructor; + Efl.Object.finalize; Efl.Object.destructor; Efl.Model.properties { get; } Efl.Model.property { set; get; } - Efl.Model.child_add; - Efl.Model.child_del; - Efl.Model.children_slice_get; Efl.Model.children_count { get; } } } diff --git a/src/lib/ecore/efl_core_command_line.c b/src/lib/ecore/efl_core_command_line.c new file mode 100644 index 0000000000..1c084030f1 --- /dev/null +++ b/src/lib/ecore/efl_core_command_line.c @@ -0,0 +1,276 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#define EFL_CORE_COMMAND_LINE_PROTECTED + +#include + +#define MY_CLASS EFL_CORE_COMMAND_LINE_MIXIN + +typedef struct { + Eina_Bool filled; + char *string_command; + Eina_Array *command; +} Efl_Core_Command_Line_Data; + +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': + case ' ': + need_quote = EINA_TRUE; + default: + break; + } + } + + d = s2; + if (need_quote) + { + *d = '\"'; + d++; + } + for (p = s; *p; p++, d++) + { + switch (*p) + { + case '\\': + case '\'': + case '\"': + *d = '\\'; + d++; + EINA_FALLTHROUGH + default: + *d = *p; + break; + } + } + if (need_quote) + { + *d = '\"'; + d++; + } + *d = 0; + return s2; +} + +EOLIAN static const char * +_efl_core_command_line_command_get(const Eo *obj EINA_UNUSED, Efl_Core_Command_Line_Data *pd) +{ + return pd->string_command; +} + +EOLIAN static Eina_Accessor * +_efl_core_command_line_command_access(Eo *obj EINA_UNUSED, Efl_Core_Command_Line_Data *pd) +{ + return pd->command ? eina_array_accessor_new(pd->command) : NULL; +} + +static void +_remove_invalid_chars(char *command) +{ + for (unsigned int i = 0; i < strlen(command); ++i) + { + char c = command[i]; + if (c < 0x20 || c == 0x7f) + command[i] = '\x12'; + } +} + +EOLIAN static Eina_Bool +_efl_core_command_line_command_array_set(Eo *obj EINA_UNUSED, Efl_Core_Command_Line_Data *pd, Eina_Array *array) +{ + EINA_SAFETY_ON_TRUE_RETURN_VAL(pd->filled, EINA_FALSE); + Eina_Strbuf *command = eina_strbuf_new(); + unsigned int i = 0; + + pd->command = eina_array_new(array ? eina_array_count(array) : 0); + for (i = 0; i < (array ? eina_array_count(array) : 0); ++i) + { + char *content = eina_array_data_get(array, i); + char *param = calloc(1, strlen(content) + 1); + + if (!param) + { + free(param); + while (eina_array_count(pd->command) > 0) + eina_stringshare_del(eina_array_pop(pd->command)); + eina_array_free(pd->command); + pd->command = NULL; + for (;i < eina_array_count(array); ++i) + { + content = eina_array_data_get(array, i); + eina_stringshare_del(content); + } + eina_array_free(array); + eina_strbuf_free(command); + return EINA_FALSE; + } + + //build the command + if (i != 0) + eina_strbuf_append(command, " "); + eina_strbuf_append(command, _escape(content)); + //convert string to stringshare + strcpy(param, content); + _remove_invalid_chars(param); + eina_array_push(pd->command, eina_stringshare_add(param)); + free(param); + eina_stringshare_del(content); + } + pd->string_command = eina_strbuf_release(command); + pd->filled = EINA_TRUE; + eina_array_free(array); + + return EINA_TRUE; +} + +EOLIAN static Eina_Bool +_efl_core_command_line_command_string_set(Eo *obj EINA_UNUSED, Efl_Core_Command_Line_Data *pd, const char *str) +{ + EINA_SAFETY_ON_TRUE_RETURN_VAL(pd->filled, EINA_FALSE); + + pd->string_command = eina_strdup(str); + + if (pd->string_command) + _remove_invalid_chars(pd->string_command); + pd->command = _unescape(str); + if (!pd->command) + { + if (pd->string_command) + free(pd->string_command); + pd->string_command = NULL; + return EINA_FALSE; + } + pd->filled = EINA_TRUE; + + return EINA_TRUE; +} + +#include "efl_core_command_line.eo.c" diff --git a/src/lib/ecore/efl_core_command_line.eo b/src/lib/ecore/efl_core_command_line.eo new file mode 100644 index 0000000000..54efbdb870 --- /dev/null +++ b/src/lib/ecore/efl_core_command_line.eo @@ -0,0 +1,80 @@ +mixin @beta Efl.Core.Command_Line { + [[A mixin that implements standard functions for command lines. + + This object parses the command line that gets passed, later the object can be accessed via accessor or the string directly. + ]] + 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 { + + } + values { + commandline : string; + } + } + command_access { + [[ Get the accessor which enables access to each argument that got passed to this object. ]] + return : accessor; + } + @property command_array { + [[ Use an array to fill this object + + Every element of a string is a argument. + ]] + set { + return : bool; [[On success $true, $false otherwise]] + } + values { + array : array @owned; [[An array where every array field is an argument]] + } + } + @property command_string { + [[ Use a string to fill this object + + The string will be split at every unescaped ' ', every resulting substring will be a new argument to the command line. + ]] + set { + return : bool; [[On success $true, $false otherwise]] + } + values { + str : string; [[A command in form of a string]] + } + + } + } +} diff --git a/src/lib/ecore/efl_core_env.c b/src/lib/ecore/efl_core_env.c new file mode 100644 index 0000000000..1a4de58c91 --- /dev/null +++ b/src/lib/ecore/efl_core_env.c @@ -0,0 +1,105 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#include "ecore_private.h" + +#define MY_CLASS EFL_CORE_ENV_CLASS + +typedef struct { + Eina_Hash *env; +} Efl_Core_Env_Data; + +static inline Eina_Bool +str_valid(const char *var) +{ + return var && var[0] != '\0'; +} + +static inline Eina_Bool +key_valid(const char *key) +{ + if (!key || key[0] == '\0') return EINA_FALSE; + + if (isdigit(key[0])) return EINA_FALSE; + + for (int i = 0; key[i] != '\0'; ++i) { + if (!isalnum(key[i]) && key[i] != '_') return EINA_FALSE; + } + + return EINA_TRUE; +} + +EOLIAN static void +_efl_core_env_env_set(Eo *obj EINA_UNUSED, Efl_Core_Env_Data *pd, const char *var, const char *value) +{ + EINA_SAFETY_ON_FALSE_RETURN(key_valid(var)); + if (str_valid(value)) + { + Eina_Stringshare *share; + share = eina_hash_set(pd->env, var, eina_stringshare_add(value)); + if (share) eina_stringshare_del(share); + } + else + eina_hash_del(pd->env, var, NULL); +} + +EOLIAN static const char* +_efl_core_env_env_get(const Eo *obj EINA_UNUSED, Efl_Core_Env_Data *pd, const char *var) +{ + EINA_SAFETY_ON_FALSE_RETURN_VAL(key_valid(var), NULL); + + return eina_hash_find(pd->env, var); +} + +EOLIAN static void +_efl_core_env_unset(Eo *obj EINA_UNUSED, Efl_Core_Env_Data *pd, const char *var) +{ + EINA_SAFETY_ON_FALSE_RETURN(key_valid(var)); + eina_hash_del_by_key(pd->env, var); +} + +EOLIAN static void +_efl_core_env_clear(Eo *obj EINA_UNUSED, Efl_Core_Env_Data *pd) +{ + eina_hash_free_buckets(pd->env); +} + +EOLIAN static Efl_Core_Env* +_efl_core_env_efl_duplicate_duplicate(const Eo *obj EINA_UNUSED, Efl_Core_Env_Data *pd) +{ + Efl_Core_Env *fork = efl_add_ref(MY_CLASS, NULL); + Eina_Iterator *iter; + Eina_Hash_Tuple *tuple; + + iter = eina_hash_iterator_tuple_new(pd->env); + + EINA_ITERATOR_FOREACH(iter, tuple) + { + efl_core_env_set(fork, tuple->key, tuple->data); + } + + eina_iterator_free(iter); + return fork; +} + +EOLIAN static Efl_Object* +_efl_core_env_efl_object_constructor(Eo *obj, Efl_Core_Env_Data *pd) +{ + pd->env = eina_hash_string_superfast_new((Eina_Free_Cb)eina_stringshare_del); + + return efl_constructor(efl_super(obj, MY_CLASS)); +} + +EOLIAN static Eina_Iterator* +_efl_core_env_content_get(const Eo *obj EINA_UNUSED, Efl_Core_Env_Data *pd) +{ + Eina_Iterator *iter = eina_hash_iterator_key_new(pd->env); + return iter; +} + + +#include "efl_core_env.eo.c" diff --git a/src/lib/ecore/efl_core_env.eo b/src/lib/ecore/efl_core_env.eo new file mode 100644 index 0000000000..5aaaa3a263 --- /dev/null +++ b/src/lib/ecore/efl_core_env.eo @@ -0,0 +1,57 @@ +class @beta Efl.Core.Env extends Efl.Object implements Efl.Duplicate { + [[This object can maintain a set of key value pairs + + A object of this type alone does not apply the object to the system. + For getting the value into the system, see @Efl.Core.Proc_Env. + + A object can be forked, which will only copy its values, changes to the returned object will not change the object where it is forked off. + ]] + methods { + @property env { + [[ Stored var value pairs of this object. + + Var must contain only: underscores ('_'), letters ('a-z', 'A-Z'), + numbers ('0-9'), but the first character may not be a number. + ]] + set { + [[ Add a new pair to this object ]] + } + get { + [[ Get the value of the $var, or $null if no such $var exists in the object]] + } + keys { + var: string; [[ The name of the variable ]] + } + 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 ]] + } + } + unset { + [[ Remove the pair with the matching $var from this object]] + params { + var : string; [[ The name of the variable ]] + } + } + clear { + [[ Remove all pairs from this object]] + } + @property content { + [[ Get the content of this object. + + This will return a iterator that contains all keys that are part of this object. + ]] + get { + + } + values { + iter : iterator; + } + } + } + implements { + Efl.Object.constructor; + Efl.Duplicate.duplicate; + } +} diff --git a/src/lib/ecore/efl_core_proc_env.c b/src/lib/ecore/efl_core_proc_env.c new file mode 100644 index 0000000000..10ad1f9845 --- /dev/null +++ b/src/lib/ecore/efl_core_proc_env.c @@ -0,0 +1,149 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#ifdef HAVE_CRT_EXTERNS_H +# include +#endif +#include "ecore_private.h" + +#define MY_CLASS EFL_CORE_PROC_ENV_CLASS + +extern char **environ; + +static Efl_Core_Env *env = NULL; + +typedef struct { + Eina_Bool in_sync; +} Efl_Core_Proc_Env_Data; + +static void +_sync(Efl_Core_Env *obj, Efl_Core_Proc_Env_Data *pd) +{ + Eina_List *existing_keys = NULL, *n; + Eina_Iterator *content; + const char *key; + + pd->in_sync = EINA_TRUE; + content = efl_core_env_content_get(obj); + + EINA_ITERATOR_FOREACH(content, key) + { + existing_keys = eina_list_append(existing_keys, key); + } + + if (environ) + { + char **p; + + for (p = environ; *p; p++) + { + char **values; + + values = eina_str_split(*p, "=", 2); + efl_core_env_set(obj, values[0], values[1]); + + EINA_LIST_FOREACH(existing_keys, n, key) + { + if (!strcmp(key, values[0])) + { + existing_keys = eina_list_remove_list(existing_keys, n); + break; + } + } + } + } + EINA_LIST_FOREACH(existing_keys, n, key) + { + efl_core_env_unset(obj, key); + } + pd->in_sync = EINA_FALSE; +} + +EOLIAN static const char* +_efl_core_proc_env_efl_core_env_env_get(const Eo *obj, Efl_Core_Proc_Env_Data *pd, const char *var) +{ + if (!pd->in_sync) + _sync((Eo*)obj, pd); + return efl_core_env_get(efl_super(obj, MY_CLASS), var); +} + +EOLIAN static void +_efl_core_proc_env_efl_core_env_env_set(Eo *obj, Efl_Core_Proc_Env_Data *pd, const char *var, const char *value) +{ + efl_core_env_set(efl_super(obj, MY_CLASS), var, value); + if (!pd->in_sync) + { + if (value) + setenv(var, value, 1); + else + unsetenv(var); + } +} + +EOLIAN static void +_efl_core_proc_env_efl_core_env_unset(Eo *obj, Efl_Core_Proc_Env_Data *pd, const char *key) +{ + efl_core_env_unset(efl_super(obj, MY_CLASS), key); + if (!pd->in_sync) + { + unsetenv(key); + } +} + +EOLIAN static void +_efl_core_proc_env_efl_core_env_clear(Eo *obj, Efl_Core_Proc_Env_Data *pd) +{ + efl_core_env_clear(efl_super(obj, MY_CLASS)); + if (!pd->in_sync) + { +#ifdef HAVE_CLEARENV + clearenv(); +#else + environ = NULL; +#endif + } +} + + +EOLIAN static Efl_Duplicate* +_efl_core_proc_env_efl_duplicate_duplicate(const Eo *obj, Efl_Core_Proc_Env_Data *pd) +{ + if (!pd->in_sync) + _sync((Eo*) obj, pd); + return efl_duplicate(efl_super(obj, MY_CLASS)); +} + +EOLIAN static Eina_Iterator* +_efl_core_proc_env_efl_core_env_content_get(const Eo *obj, Efl_Core_Proc_Env_Data *pd) +{ + if (!pd->in_sync) + _sync((Eo*) obj, pd); + return efl_core_env_content_get(efl_super(obj, MY_CLASS)); +} + +EOLIAN static Efl_Object* +_efl_core_proc_env_efl_object_constructor(Eo *obj, Efl_Core_Proc_Env_Data *pd EINA_UNUSED) +{ + EINA_SAFETY_ON_TRUE_RETURN_VAL(!!env, NULL); + + obj = efl_constructor(efl_super(obj, MY_CLASS)); + return obj; +} + +EOLIAN static Efl_Core_Env* +_efl_core_proc_env_self(void) +{ + if (!env) + { + efl_domain_current_push(EFL_ID_DOMAIN_SHARED); + env = efl_add_ref(EFL_CORE_PROC_ENV_CLASS, NULL); + efl_domain_current_pop(); + efl_wref_add(env, &env); + } + + return env; +} + +#include "efl_core_proc_env.eo.c" diff --git a/src/lib/ecore/efl_core_proc_env.eo b/src/lib/ecore/efl_core_proc_env.eo new file mode 100644 index 0000000000..07840548dd --- /dev/null +++ b/src/lib/ecore/efl_core_proc_env.eo @@ -0,0 +1,21 @@ +class @beta Efl.Core.Proc_Env extends Efl.Core.Env +{ + eo_prefix : efl_env; + methods { + self @class { + [[Get a instance of this object + + The object will apply the environment operations onto this process. + ]] + return : Efl.Core.Env; + } + } + implements { + Efl.Core.Env.env { set; get; } + Efl.Core.Env.content { get; } + Efl.Core.Env.unset; + Efl.Core.Env.clear; + Efl.Duplicate.duplicate; + Efl.Object.constructor; + } +} diff --git a/src/lib/ecore/efl_cubic_bezier_interpolator.eo b/src/lib/ecore/efl_cubic_bezier_interpolator.eo index a4dd964bb6..c6dd1449d2 100644 --- a/src/lib/ecore/efl_cubic_bezier_interpolator.eo +++ b/src/lib/ecore/efl_cubic_bezier_interpolator.eo @@ -1,4 +1,4 @@ -class Efl.Cubic_Bezier_Interpolator extends Efl.Object implements Efl.Interpolator +class @beta Efl.Cubic_Bezier_Interpolator extends Efl.Object implements Efl.Interpolator { [[Efl cubic_bezier interpolator class]] data: Efl_Cubic_Bezier_Interpolator_Data; diff --git a/src/lib/ecore/efl_decelerate_interpolator.eo b/src/lib/ecore/efl_decelerate_interpolator.eo index 3e376f8976..802d409b2d 100644 --- a/src/lib/ecore/efl_decelerate_interpolator.eo +++ b/src/lib/ecore/efl_decelerate_interpolator.eo @@ -1,4 +1,4 @@ -class Efl.Decelerate_Interpolator extends Efl.Object implements Efl.Interpolator +class @beta Efl.Decelerate_Interpolator extends Efl.Object implements Efl.Interpolator { [[Efl decelerate interpolator class diff --git a/src/lib/ecore/efl_divisor_interpolator.eo b/src/lib/ecore/efl_divisor_interpolator.eo index f9baae503c..848c44bf6e 100644 --- a/src/lib/ecore/efl_divisor_interpolator.eo +++ b/src/lib/ecore/efl_divisor_interpolator.eo @@ -1,4 +1,4 @@ -class Efl.Divisor_Interpolator extends Efl.Object implements Efl.Interpolator +class @beta Efl.Divisor_Interpolator extends Efl.Object implements Efl.Interpolator { [[Efl divisor interpolator class]] data: Efl_Divisor_Interpolator_Data; diff --git a/src/lib/ecore/efl_exe.c b/src/lib/ecore/efl_exe.c index a6f9f5f506..b7cba7292f 100644 --- a/src/lib/ecore/efl_exe.c +++ b/src/lib/ecore/efl_exe.c @@ -40,6 +40,7 @@ typedef struct _Efl_Exe_Data Efl_Exe_Data; struct _Efl_Exe_Data { + Efl_Core_Env *env; int exit_signal; Efl_Exe_Flags flags; #ifdef _WIN32 @@ -165,22 +166,6 @@ _exec(const char *cmd, Efl_Exe_Flags flags) } } -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) { @@ -206,7 +191,7 @@ _exe_exit_eval(Eo *obj, Efl_Exe_Data *pd) // 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 @@ -300,6 +285,25 @@ _run_clean_cb(Efl_Loop_Consumer *consumer EINA_UNUSED, ////////////////////////////////////////////////////////////////////////// + +EOLIAN static void +_efl_exe_env_set(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd, Efl_Core_Env *env) +{ + if (pd->env == env) return; + + if (!pd->env) + efl_unref(pd->env); + pd->env = env; + if (pd->env) + efl_ref(pd->env); +} + +EOLIAN static Efl_Core_Env* +_efl_exe_env_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd) +{ + return pd->env; +} + EOLIAN static void _efl_exe_signal(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd, Efl_Exe_Signal sig) { @@ -391,7 +395,7 @@ _efl_exe_efl_task_priority_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd) } EOLIAN static Eina_Future * -_efl_exe_efl_task_run(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd) +_efl_exe_efl_task_run(Eo *obj, Efl_Exe_Data *pd) { #ifdef _WIN32 return EINA_FALSE; @@ -410,7 +414,7 @@ _efl_exe_efl_task_run(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd) if (!td) return NULL; // get a cmdline to run - cmd = efl_task_command_get(obj); + cmd = efl_core_command_line_command_get(obj); if (!cmd) return NULL; ret = pipe(pipe_exited); @@ -564,17 +568,28 @@ _efl_exe_efl_task_run(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd) // 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 + // actually setenv the env object (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); + if (pd->env) + { + Eina_Iterator *itr; + const char *key; + +# ifdef HAVE_CLEARENV + clearenv(); +# else + environ = NULL; +# endif + itr = efl_core_env_content_get(pd->env); + + EINA_ITERATOR_FOREACH(itr, key) + { + setenv(key, efl_core_env_get(pd->env, key) , 1); + } + efl_unref(pd->env); + pd->env = NULL; + } // actually execute! _exec(cmd, pd->flags); @@ -744,7 +759,7 @@ _efl_exe_efl_io_reader_can_read_set(Eo *obj, Efl_Exe_Data *pd, Eina_Bool can_rea 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); + efl_event_callback_call(obj, EFL_IO_READER_EVENT_CAN_READ_CHANGED, &can_read); } EOLIAN static Eina_Bool @@ -842,7 +857,7 @@ _efl_exe_efl_io_writer_can_write_set(Eo *obj, Efl_Exe_Data *pd, Eina_Bool can_wr 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); + efl_event_callback_call(obj, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, &can_write); } EOLIAN static Eina_Bool diff --git a/src/lib/ecore/efl_exe.eo b/src/lib/ecore/efl_exe.eo index 54249dae32..cd71af6a0c 100644 --- a/src/lib/ecore/efl_exe.eo +++ b/src/lib/ecore/efl_exe.eo @@ -1,4 +1,4 @@ -enum Efl.Exe_Signal { +enum @beta Efl.Exe_Signal { [[ ]] int, quit, @@ -11,7 +11,7 @@ enum Efl.Exe_Signal { usr2 } -enum Efl.Exe_Flags { +enum @beta Efl.Exe_Flags { [[ ]] none = 0, group_leader = 1, @@ -19,7 +19,7 @@ enum Efl.Exe_Flags { hide_io = 4 } -class Efl.Exe extends Efl.Task +class @beta Efl.Exe extends Efl.Task implements Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer, Efl.Core.Command_Line { [[ ]] methods { @@ -42,6 +42,23 @@ class Efl.Exe extends Efl.Task sig: int; [[ The exit signal, or -1 if no exit signal happened ]] } } + @property env { + [[ If $env is $null then the process created by this object is + going to inherit the environment of this process. + + In case $env is not $null then the environment variables declared + in this object will represent the environment passed to the new process. + ]] + get { + [[ Get the object assosiated with this object ]] + } + set { + [[ Set the object assosiated with this object ]] + } + values { + env : Efl.Core.Env; [[$env will be referenced until this object does not need it anymore.]] + } + } } implements { Efl.Object.constructor; diff --git a/src/lib/ecore/efl_general.h b/src/lib/ecore/efl_general.h index 222c799c2c..70d594d60a 100644 --- a/src/lib/ecore/efl_general.h +++ b/src/lib/ecore/efl_general.h @@ -31,8 +31,6 @@ # define __EFL_NET(...) #endif -#ifdef EFL_BETA_API_SUPPORT - // This file is designed to be included again and again // so cleanup last inclusion before generating this one. #undef _EFL_VERSION_MICRO @@ -127,5 +125,3 @@ ecore_shutdown(); \ return real__; \ } - -#endif /* EFL_BETA_API_SUPPORT */ diff --git a/src/lib/ecore/efl_model_item.c b/src/lib/ecore/efl_generic_model.c similarity index 74% rename from src/lib/ecore/efl_model_item.c rename to src/lib/ecore/efl_generic_model.c index 7e009e364c..35d26374a8 100644 --- a/src/lib/ecore/efl_model_item.c +++ b/src/lib/ecore/efl_generic_model.c @@ -7,10 +7,10 @@ #include "ecore_internal.h" -#define MY_CLASS EFL_MODEL_ITEM_CLASS +#define MY_CLASS EFL_GENERIC_MODEL_CLASS -typedef struct _Efl_Model_Item_Data Efl_Model_Item_Data; -struct _Efl_Model_Item_Data +typedef struct _Efl_Generic_Model_Data Efl_Generic_Model_Data; +struct _Efl_Generic_Model_Data { Eina_Hash *properties; Eina_List *childrens; @@ -30,7 +30,7 @@ _stringshared_keys_free(const Eina_Hash *hash EINA_UNUSED, const void *key, void } static Efl_Object * -_efl_model_item_efl_object_constructor(Eo *obj, Efl_Model_Item_Data *sd) +_efl_generic_model_efl_object_constructor(Eo *obj, Efl_Generic_Model_Data *sd) { obj = efl_constructor(efl_super(obj, MY_CLASS)); if (!obj) @@ -42,7 +42,7 @@ _efl_model_item_efl_object_constructor(Eo *obj, Efl_Model_Item_Data *sd) } static void -_efl_model_item_efl_object_destructor(Eo *obj, Efl_Model_Item_Data *sd) +_efl_generic_model_efl_object_destructor(Eo *obj, Efl_Generic_Model_Data *sd) { eina_list_free(sd->childrens); eina_hash_foreach(sd->properties, _stringshared_keys_free, NULL); @@ -52,13 +52,13 @@ _efl_model_item_efl_object_destructor(Eo *obj, Efl_Model_Item_Data *sd) } static Eina_Iterator * -_efl_model_item_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Item_Data *pd) +_efl_generic_model_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Generic_Model_Data *pd) { return eina_hash_iterator_key_new(pd->properties); } static Eina_Future * -_efl_model_item_efl_model_property_set(Eo *obj, Efl_Model_Item_Data *pd, const char *property, Eina_Value *value) +_efl_generic_model_efl_model_property_set(Eo *obj, Efl_Generic_Model_Data *pd, const char *property, Eina_Value *value) { Eina_Stringshare *prop; Eina_Value *exist; @@ -110,9 +110,9 @@ _efl_model_item_efl_model_property_set(Eo *obj, Efl_Model_Item_Data *pd, const c } static Eina_Value * -_efl_model_item_efl_model_property_get(const Eo *obj EINA_UNUSED, - Efl_Model_Item_Data *pd, - const char *property) +_efl_generic_model_efl_model_property_get(const Eo *obj EINA_UNUSED, + Efl_Generic_Model_Data *pd, + const char *property) { Eina_Stringshare *prop; Eina_Value *value; @@ -128,7 +128,7 @@ _efl_model_item_efl_model_property_get(const Eo *obj EINA_UNUSED, } 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_generic_model_efl_model_children_slice_get(Eo *obj, Efl_Generic_Model_Data *pd, unsigned int start, unsigned int count) { Eina_Value v; @@ -137,21 +137,21 @@ _efl_model_item_efl_model_children_slice_get(Eo *obj, Efl_Model_Item_Data *pd, u } static unsigned int -_efl_model_item_efl_model_children_count_get(const Eo *obj EINA_UNUSED, Efl_Model_Item_Data *pd) +_efl_generic_model_efl_model_children_count_get(const Eo *obj EINA_UNUSED, Efl_Generic_Model_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_generic_model_efl_model_child_add(Eo *obj, Efl_Generic_Model_Data *sd) { Efl_Model_Children_Event cevt; Efl_Model *child; - child = efl_add(EFL_MODEL_ITEM_CLASS, obj); + child = efl_add(EFL_GENERIC_MODEL_CLASS, obj); if (!child) { - EINA_LOG_ERR("Could not allocate Efl.Model.Item"); + EINA_LOG_ERR("Could not allocate Efl.Generic_Model"); eina_error_set(EFL_MODEL_ERROR_UNKNOWN); return NULL; } @@ -166,7 +166,7 @@ _efl_model_item_efl_model_child_add(Eo *obj, Efl_Model_Item_Data *sd) } static void -_efl_model_item_efl_model_child_del(Eo *obj, Efl_Model_Item_Data *sd, Eo *child) +_efl_generic_model_efl_model_child_del(Eo *obj, Efl_Generic_Model_Data *sd, Eo *child) { Efl_Model *data; Eina_List *l; @@ -194,4 +194,4 @@ _efl_model_item_efl_model_child_del(Eo *obj, Efl_Model_Item_Data *sd, Eo *child) } } -#include "efl_model_item.eo.c" +#include "efl_generic_model.eo.c" diff --git a/src/lib/ecore/efl_model_item.eo b/src/lib/ecore/efl_generic_model.eo similarity index 92% rename from src/lib/ecore/efl_model_item.eo rename to src/lib/ecore/efl_generic_model.eo index 8543eec758..bb67dafbc5 100644 --- a/src/lib/ecore/efl_model_item.eo +++ b/src/lib/ecore/efl_generic_model.eo @@ -1,4 +1,4 @@ -class Efl.Model_Item extends Efl.Model_Loop +class @beta Efl.Generic_Model extends Efl.Loop_Model { [[ Generic model that allows any property to be manually set. diff --git a/src/lib/ecore/efl_io_buffered_stream.c b/src/lib/ecore/efl_io_buffered_stream.c index 53b1edaf1d..77e0ccd145 100644 --- a/src/lib/ecore/efl_io_buffered_stream.c +++ b/src/lib/ecore/efl_io_buffered_stream.c @@ -273,7 +273,7 @@ _efl_io_buffered_stream_efl_io_reader_can_read_set(Eo *o, Efl_Io_Buffered_Stream EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o)); if (pd->can_read == can_read) return; pd->can_read = can_read; - efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, &can_read); } EOLIAN static Eina_Bool @@ -339,7 +339,7 @@ _efl_io_buffered_stream_efl_io_writer_can_write_set(Eo *o, Efl_Io_Buffered_Strea EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o)); if (pd->can_write == can_write) return; pd->can_write = can_write; - efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, &can_write); } EOLIAN static void diff --git a/src/lib/ecore/efl_io_buffered_stream.eo b/src/lib/ecore/efl_io_buffered_stream.eo index 8e22b828af..5271006422 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 extends Efl.Loop_Consumer implements Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer { +class @beta Efl.Io.Buffered_Stream extends Efl.Loop_Consumer implements 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 @@ -31,8 +31,6 @@ class Efl.Io.Buffered_Stream extends Efl.Loop_Consumer implements Efl.Io.Reader, and can be retrieved with @.inner_io.get, which should be used with care -- calling @Efl.Io.Reader.read and @Efl.Io.Writer.write on it may produce unexpected results. - - @since 1.19 ]] methods { diff --git a/src/lib/ecore/efl_io_closer_fd.eo b/src/lib/ecore/efl_io_closer_fd.eo index e601f582ad..2d59703205 100644 --- a/src/lib/ecore/efl_io_closer_fd.eo +++ b/src/lib/ecore/efl_io_closer_fd.eo @@ -1,7 +1,5 @@ -mixin Efl.Io.Closer_Fd requires Efl.Object extends Efl.Io.Closer { +mixin @beta Efl.Io.Closer_Fd requires Efl.Object extends Efl.Io.Closer { [[Close fd using close(2). - - @since 1.19 ]] methods { diff --git a/src/lib/ecore/efl_io_copier.eo b/src/lib/ecore/efl_io_copier.eo index 2565fba66f..f4ef7679c4 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 extends Efl.Loop_Consumer implements Efl.Io.Closer { +class @beta Efl.Io.Copier extends Efl.Loop_Consumer implements Efl.Io.Closer { [[Copy from an @Efl.Io.Reader source to @Efl.Io.Writer destination. During usage it will keep reference to @.source and @@ -59,8 +59,6 @@ class Efl.Io.Copier extends Efl.Loop_Consumer implements Efl.Io.Closer { @Efl.Io.Closer.close_on_exec and @Efl.Io.Closer.close_on_invalidate are respected and applied to both source and destination. Both default to $true. - - @since 1.19 ]] methods { diff --git a/src/lib/ecore/efl_io_file.c b/src/lib/ecore/efl_io_file.c index c8716d2935..041db19e95 100644 --- a/src/lib/ecore/efl_io_file.c +++ b/src/lib/ecore/efl_io_file.c @@ -29,7 +29,6 @@ typedef struct _Efl_Io_File_Data { - const char *path; uint32_t flags; uint32_t mode; uint64_t last_position; @@ -123,7 +122,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) +_efl_io_file_efl_object_destructor(Eo *o, Efl_Io_File_Data *pd EINA_UNUSED) { if (efl_io_closer_close_on_invalidate_get(o) && (!efl_io_closer_closed_get(o))) @@ -134,8 +133,6 @@ _efl_io_file_efl_object_destructor(Eo *o, Efl_Io_File_Data *pd) } efl_destructor(efl_super(o, MY_CLASS)); - - eina_stringshare_del(pd->path); } EOLIAN static Efl_Object * @@ -144,17 +141,18 @@ _efl_io_file_efl_object_finalize(Eo *o, Efl_Io_File_Data *pd) int fd = efl_loop_fd_file_get(o); if (fd < 0) { - EINA_SAFETY_ON_NULL_RETURN_VAL(pd->path, NULL); + const char *path = efl_file_get(o); + EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL); if (pd->mode) - fd = open(pd->path, pd->flags, pd->mode); + fd = open(path, pd->flags, pd->mode); else - fd = open(pd->path, pd->flags); + fd = open(path, pd->flags); if (fd < 0) { eina_error_set(errno); - ERR("Could not open file '%s': %s", pd->path, strerror(errno)); + ERR("Could not open file '%s': %s", path, strerror(errno)); return NULL; } @@ -164,22 +162,6 @@ _efl_io_file_efl_object_finalize(Eo *o, Efl_Io_File_Data *pd) return efl_finalize(efl_super(o, MY_CLASS)); } -EOLIAN static Eina_Bool -_efl_io_file_efl_file_file_set(Eo *o, Efl_Io_File_Data *pd, const char *file, const char *key EINA_UNUSED) -{ - EINA_SAFETY_ON_TRUE_RETURN_VAL(efl_finalized_get(o), EINA_FALSE); - - eina_stringshare_replace(&pd->path, file); - return EINA_TRUE; -} - -EOLIAN static void -_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; -} - EOLIAN static Eina_Error _efl_io_file_efl_io_reader_read(Eo *o, Efl_Io_File_Data *pd, Eina_Rw_Slice *rw_slice) { diff --git a/src/lib/ecore/efl_io_file.eo b/src/lib/ecore/efl_io_file.eo index c0b48c381d..c0a968741e 100644 --- a/src/lib/ecore/efl_io_file.eo +++ b/src/lib/ecore/efl_io_file.eo @@ -1,11 +1,9 @@ -class Efl.Io.File extends Efl.Loop_Fd implements Efl.File, Efl.Io.Reader_Fd, Efl.Io.Writer_Fd, Efl.Io.Closer_Fd, Efl.Io.Sizer_Fd, Efl.Io.Positioner_Fd { +class @beta Efl.Io.File extends Efl.Loop_Fd implements 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_invalidate are respected and default to $true. @Efl.Io.Closer.close_on_exec.set sets flag O_CLOEXEC. - - @since 1.19 ]] methods { @@ -51,7 +49,6 @@ class Efl.Io.File extends Efl.Loop_Fd implements Efl.File, Efl.Io.Reader_Fd, Efl Efl.Object.destructor; Efl.Object.finalize; Efl.Loop_Fd.fd_file { set; } - Efl.File.file { get; set; } Efl.Io.Reader.read; Efl.Io.Writer.write; Efl.Io.Closer.close; diff --git a/src/lib/ecore/efl_io_positioner_fd.eo b/src/lib/ecore/efl_io_positioner_fd.eo index ed9cd22f15..dba9042f1b 100644 --- a/src/lib/ecore/efl_io_positioner_fd.eo +++ b/src/lib/ecore/efl_io_positioner_fd.eo @@ -1,7 +1,5 @@ -mixin Efl.Io.Positioner_Fd extends Efl.Io.Positioner { +mixin @beta Efl.Io.Positioner_Fd extends Efl.Io.Positioner { [[Positions fd using lseek(2). - - @since 1.19 ]] methods { diff --git a/src/lib/ecore/efl_io_reader_fd.c b/src/lib/ecore/efl_io_reader_fd.c index 670a22f20e..c0267af4cf 100644 --- a/src/lib/ecore/efl_io_reader_fd.c +++ b/src/lib/ecore/efl_io_reader_fd.c @@ -79,7 +79,7 @@ _efl_io_reader_fd_efl_io_reader_can_read_set(Eo *o, Efl_Io_Reader_Fd_Data *pd, E EINA_SAFETY_ON_TRUE_RETURN(efl_io_reader_fd_get(o) < 0 && can_read); if (pd->can_read == can_read) return; pd->can_read = can_read; - efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, &can_read); } EOLIAN static Eina_Bool diff --git a/src/lib/ecore/efl_io_reader_fd.eo b/src/lib/ecore/efl_io_reader_fd.eo index 30b95b31ef..d32dfb486e 100644 --- a/src/lib/ecore/efl_io_reader_fd.eo +++ b/src/lib/ecore/efl_io_reader_fd.eo @@ -1,7 +1,5 @@ -mixin Efl.Io.Reader_Fd extends Efl.Io.Reader { +mixin @beta Efl.Io.Reader_Fd extends Efl.Io.Reader { [[Reads fd using read(2). - - @since 1.19 ]] methods { diff --git a/src/lib/ecore/efl_io_sizer_fd.eo b/src/lib/ecore/efl_io_sizer_fd.eo index 9320324447..9dc98de9ed 100644 --- a/src/lib/ecore/efl_io_sizer_fd.eo +++ b/src/lib/ecore/efl_io_sizer_fd.eo @@ -1,7 +1,5 @@ -mixin Efl.Io.Sizer_Fd extends Efl.Io.Sizer { +mixin @beta Efl.Io.Sizer_Fd extends Efl.Io.Sizer { [[Resizes fd usign ftruncate(2). - - @since 1.19 ]] methods { diff --git a/src/lib/ecore/efl_io_stderr.eo b/src/lib/ecore/efl_io_stderr.eo index c8ecff3dd4..626a99de95 100644 --- a/src/lib/ecore/efl_io_stderr.eo +++ b/src/lib/ecore/efl_io_stderr.eo @@ -1,7 +1,5 @@ -class Efl.Io.Stderr extends Efl.Loop_Fd implements Efl.Io.Writer_Fd { +class @beta Efl.Io.Stderr extends Efl.Loop_Fd implements Efl.Io.Writer_Fd { [[Application's standard error (stderr). - - @since 1.19 ]] data: null; diff --git a/src/lib/ecore/efl_io_stdin.eo b/src/lib/ecore/efl_io_stdin.eo index 1d4b914e60..d081bb1075 100644 --- a/src/lib/ecore/efl_io_stdin.eo +++ b/src/lib/ecore/efl_io_stdin.eo @@ -1,7 +1,5 @@ -class Efl.Io.Stdin extends Efl.Loop_Fd implements Efl.Io.Reader_Fd { +class @beta Efl.Io.Stdin extends Efl.Loop_Fd implements Efl.Io.Reader_Fd { [[Application's standard input (stdin). - - @since 1.19 ]] data: null; diff --git a/src/lib/ecore/efl_io_stdout.eo b/src/lib/ecore/efl_io_stdout.eo index 1bc7099397..5d419550d3 100644 --- a/src/lib/ecore/efl_io_stdout.eo +++ b/src/lib/ecore/efl_io_stdout.eo @@ -1,7 +1,5 @@ -class Efl.Io.Stdout extends Efl.Loop_Fd implements Efl.Io.Writer_Fd { +class @beta Efl.Io.Stdout extends Efl.Loop_Fd implements Efl.Io.Writer_Fd { [[Application's standard output (stdout). - - @since 1.19 ]] data: null; diff --git a/src/lib/ecore/efl_io_writer_fd.c b/src/lib/ecore/efl_io_writer_fd.c index 091bb1bb9d..a1174bc091 100644 --- a/src/lib/ecore/efl_io_writer_fd.c +++ b/src/lib/ecore/efl_io_writer_fd.c @@ -83,7 +83,7 @@ _efl_io_writer_fd_efl_io_writer_can_write_set(Eo *o, Efl_Io_Writer_Fd_Data *pd, EINA_SAFETY_ON_TRUE_RETURN(efl_io_writer_fd_get(o) < 0 && can_write); if (pd->can_write == can_write) return; pd->can_write = can_write; - efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, &can_write); } #include "efl_io_writer_fd.eo.c" diff --git a/src/lib/ecore/efl_io_writer_fd.eo b/src/lib/ecore/efl_io_writer_fd.eo index b43b8b1d0d..2f7b46156b 100644 --- a/src/lib/ecore/efl_io_writer_fd.eo +++ b/src/lib/ecore/efl_io_writer_fd.eo @@ -1,7 +1,5 @@ -mixin Efl.Io.Writer_Fd extends Efl.Io.Writer { +mixin @beta Efl.Io.Writer_Fd extends Efl.Io.Writer { [[Writes fd using write(2). - - @since 1.19 ]] methods { diff --git a/src/lib/ecore/efl_linear_interpolator.eo b/src/lib/ecore/efl_linear_interpolator.eo index 748a3be384..e22e980552 100644 --- a/src/lib/ecore/efl_linear_interpolator.eo +++ b/src/lib/ecore/efl_linear_interpolator.eo @@ -1,4 +1,4 @@ -class Efl.Linear_Interpolator extends Efl.Object implements Efl.Interpolator +class @beta Efl.Linear_Interpolator extends Efl.Object implements Efl.Interpolator { [[Efl linear interpolator class]] data: Efl_Linear_Interpolator_Data; diff --git a/src/lib/ecore/efl_loop.c b/src/lib/ecore/efl_loop.c index 5a7166cb48..7a61cabdd7 100644 --- a/src/lib/ecore/efl_loop.c +++ b/src/lib/ecore/efl_loop.c @@ -2,6 +2,8 @@ # include #endif +#define EFL_LOOP_PROTECTED + #include #include #include @@ -15,8 +17,6 @@ #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; @@ -30,38 +30,13 @@ struct _Efl_Loop_Promise_Simple_Data }; GENERIC_ALLOC_SIZE_DECLARE(Efl_Loop_Promise_Simple_Data); -EOLIAN static Efl_Loop_Message_Handler * -_efl_loop_message_handler_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Loop *loop, const Efl_Class *klass) -{ - Message_Handler mh = { 0 }, *mh2; - Efl_Loop_Data *ld = efl_data_scope_get(loop, EFL_LOOP_CLASS); - unsigned int i, n; - - if (!ld) return NULL; - n = eina_inarray_count(ld->message_handlers); - for (i = 0; i < n; i++) - { - mh2 = eina_inarray_nth(ld->message_handlers, i); - if (mh2->klass == klass) return mh2->handler; - } - mh.klass = klass; - mh.handler = efl_add(klass, loop); - eina_inarray_push(ld->message_handlers, &mh); - return mh.handler; -} - Eo *_mainloop_singleton = NULL; Efl_Loop_Data *_mainloop_singleton_data = NULL; -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_app_main_get(EFL_APP_CLASS); + return efl_app_main_get(); } EOLIAN static void @@ -173,6 +148,7 @@ efl_loop_exit_code_process(Eina_Value *value) out = stderr; } fprintf(out, "%s\n", msg); + free(msg); } return r; } @@ -216,7 +192,7 @@ _check_event_catcher_add(void *data, const Efl_Event *event) pd->poll_high = efl_add (EFL_LOOP_TIMER_CLASS, event->object, efl_event_callback_add(efl_added, - EFL_LOOP_TIMER_EVENT_TICK, + EFL_LOOP_TIMER_EVENT_TIMER_TICK, _poll_trigger, EFL_LOOP_EVENT_POLL_HIGH), efl_loop_timer_interval_set(efl_added, 1.0 / 60.0)); @@ -230,7 +206,7 @@ _check_event_catcher_add(void *data, const Efl_Event *event) pd->poll_medium = efl_add (EFL_LOOP_TIMER_CLASS, event->object, efl_event_callback_add(efl_added, - EFL_LOOP_TIMER_EVENT_TICK, + EFL_LOOP_TIMER_EVENT_TIMER_TICK, _poll_trigger, EFL_LOOP_EVENT_POLL_MEDIUM), efl_loop_timer_interval_set(efl_added, 6)); @@ -244,7 +220,7 @@ _check_event_catcher_add(void *data, const Efl_Event *event) pd->poll_low = efl_add (EFL_LOOP_TIMER_CLASS, event->object, efl_event_callback_add(efl_added, - EFL_LOOP_TIMER_EVENT_TICK, + EFL_LOOP_TIMER_EVENT_TIMER_TICK, _poll_trigger, EFL_LOOP_EVENT_POLL_LOW), efl_loop_timer_interval_set(efl_added, 66)); @@ -311,11 +287,11 @@ _efl_loop_efl_object_constructor(Eo *obj, Efl_Loop_Data *pd) pd->loop_time = ecore_time_get(); pd->providers = eina_hash_pointer_new(EINA_FREE_CB(efl_unref)); - pd->message_handlers = eina_inarray_new(sizeof(Message_Handler), 32); pd->epoll_fd = -1; pd->timer_fd = -1; - pd->future_message_handler = efl_loop_message_handler_get - (EFL_LOOP_CLASS, obj, EFL_LOOP_MESSAGE_FUTURE_HANDLER_CLASS); + pd->future_message_handler = efl_add(EFL_LOOP_MESSAGE_FUTURE_HANDLER_CLASS, obj); + efl_loop_register(obj, EFL_LOOP_MESSAGE_FUTURE_HANDLER_CLASS, pd->future_message_handler); + return obj; } @@ -334,12 +310,6 @@ _efl_loop_efl_object_invalidate(Eo *obj, Efl_Loop_Data *pd) pd->poll_medium = NULL; pd->poll_high = NULL; - if (pd->message_handlers) - { - eina_inarray_free(pd->message_handlers); - pd->message_handlers = NULL; - } - // After invalidate, it won't be possible to parent to the singleton anymore if (obj == _mainloop_singleton) { @@ -353,14 +323,6 @@ _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)); } @@ -397,17 +359,22 @@ _efl_loop_arguments_cleanup(Eo *o EINA_UNUSED, void *data, const Eina_Future *de EAPI void ecore_loop_arguments_send(int argc, const char **argv) { - Eina_Array *arga; + Eina_Array *arga, *cml; int i = 0; - efl_task_arg_reset(efl_main_loop_get()); arga = eina_array_new(argc); + cml = eina_array_new(argc); for (i = 0; i < argc; i++) { - eina_array_push(arga, eina_stringshare_add(argv[i])); - efl_task_arg_append(efl_main_loop_get(), argv[i]); + Eina_Stringshare *arg; + + arg = eina_stringshare_add(argv[i]); + eina_array_push(arga, arg); + arg = eina_stringshare_add(argv[i]); + eina_array_push(cml, arg); } + efl_core_command_line_command_array_set(efl_app_main_get(), cml); efl_future_then(efl_main_loop_get(), efl_loop_job(efl_main_loop_get()), .success = _efl_loop_arguments_send, .free = _efl_loop_arguments_cleanup, @@ -526,7 +493,7 @@ _efl_loop_timeout(Eo *obj, Efl_Loop_Data *pd EINA_UNUSED, double tim) d->timer = efl_add(EFL_LOOP_TIMER_CLASS, obj, efl_loop_timer_interval_set(efl_added, tim), efl_event_callback_add(efl_added, - EFL_LOOP_TIMER_EVENT_TICK, + EFL_LOOP_TIMER_EVENT_TIMER_TICK, _efl_loop_timeout_done, d), efl_event_callback_add(efl_added, EFL_EVENT_DEL, @@ -671,178 +638,6 @@ efl_build_version_set(int vmaj, int vmin, int vmic, int revision, _app_efl_version.build_id = build_id ? strdup(build_id) : NULL; } -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) -{ - 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 void -_efl_loop_efl_task_env_set(Eo *obj, Efl_Loop_Data *pd EINA_UNUSED, const char *var, const char *value) -{ - 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) { diff --git a/src/lib/ecore/efl_loop.eo b/src/lib/ecore/efl_loop.eo index fe9cbd9a5d..7e1bc107ae 100644 --- a/src/lib/ecore/efl_loop.eo +++ b/src/lib/ecore/efl_loop.eo @@ -1,10 +1,13 @@ struct Efl.Loop_Arguments { - [[EFL loop arguments data structure]] + [[EFL loop arguments data structure + + @since 1.22 + ]] argv: const(array); [[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 extends Efl.Task +abstract Efl.Loop extends Efl.Task { [[The Efl Main Loop @@ -15,6 +18,8 @@ class Efl.Loop extends Efl.Task It serializes these and allows for greater responsiveness without the need for threads (or any other concurrency). However you can provide these if you need to. + + @since 1.22 ]] methods { iterate { @@ -59,11 +64,26 @@ class Efl.Loop extends Efl.Task } } @property time { - [[The time point when the loop was logically woken.]] - set {} - get {} + [[Retrieves the time at which the last loop stopped waiting for timeouts or events.]] + set @protected { + [[You should never need/call this, unless you are implementing a custom + tick source for an animator. + + Note: The time point must match whatever zero time you get from ecore_time_get() and @.time.get() (same 0 point). + What this point is is undefined, so unless your source uses the same 0 time, then you may have to adjust and do some guessing. + ]] + } + get { + [[This gets the time that the main loop ceased waiting for timouts and/or + events to come in or for signals or any other interrupt source. This should + be considered a reference point for all time based activity that should + calculate its timepoint from the return of ecore_loop_time_get(). Note that this + time is meant to be used as relative to other times obtained on this run. + If you need absolute time references, use a unix timestamp instead. + ]] + } values { - timepoint: double; [[Time in seconds since process specific start point]] + timepoint: double; [[Time in seconds]] } } idle { @@ -98,17 +118,6 @@ class Efl.Loop extends Efl.Task } return: bool; [[$true if successfully unregistered, $false otherwise.]] } - message_handler_get @class { - [[Get a message handler object that is created by and owned by - the Efl.Loop object, so you can listen to this message type by - listening to message events on the handler as well as send - objects as events.]] - params { - @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.]] - } } events { idle,enter @restart: void; [[Event occurs once the main loop enters the idle state.]] @@ -125,8 +134,6 @@ class Efl.Loop extends Efl.Task 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.eo b/src/lib/ecore/efl_loop_consumer.eo index def99ef035..c5828648b6 100644 --- a/src/lib/ecore/efl_loop_consumer.eo +++ b/src/lib/ecore/efl_loop_consumer.eo @@ -1,8 +1,11 @@ abstract Efl.Loop_Consumer extends Efl.Object { - [[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.]] + [[An @Efl.Loop_Consumer is a class which requires one of the parents to provide + an @Efl.Loop interface when performing @Efl.Object.provider_find. It will enforce this by + only allowing parents which provide such an interface or $NULL. + + @since 1.22 + ]] eo_prefix: efl_loop; methods { @property loop { diff --git a/src/lib/ecore/efl_loop_fd.eo b/src/lib/ecore/efl_loop_fd.eo index 5ced4e709f..7c8faa1b39 100644 --- a/src/lib/ecore/efl_loop_fd.eo +++ b/src/lib/ecore/efl_loop_fd.eo @@ -1,4 +1,4 @@ -class Efl.Loop_Fd extends Efl.Loop_Consumer +class @beta Efl.Loop_Fd extends Efl.Loop_Consumer { [[Fds are objects that watch the activity on a given file descriptor. This file descriptor can be a diff --git a/src/lib/ecore/efl_loop_handler.eo b/src/lib/ecore/efl_loop_handler.eo index aab8443132..8779324ef3 100644 --- a/src/lib/ecore/efl_loop_handler.eo +++ b/src/lib/ecore/efl_loop_handler.eo @@ -1,4 +1,4 @@ -enum Efl.Loop_Handler_Flags { +enum @beta Efl.Loop_Handler_Flags { [[ A set of flags that can be OR'd together to indicate which are desired ]] none = 0, [[ No I/O is desired (generally useless) ]] @@ -7,7 +7,7 @@ enum Efl.Loop_Handler_Flags { error = 4, [[ Error channel input is desired ]] } -class Efl.Loop_Handler extends Efl.Object +class @beta Efl.Loop_Handler extends 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 diff --git a/src/lib/ecore/efl_loop_message.eo b/src/lib/ecore/efl_loop_message.eo index ef5ec0ce2a..5a1877c424 100644 --- a/src/lib/ecore/efl_loop_message.eo +++ b/src/lib/ecore/efl_loop_message.eo @@ -1,4 +1,4 @@ -class Efl.Loop_Message extends Efl.Object +class @beta Efl.Loop_Message extends Efl.Object { [[Base message payload object class. Inherit this and extend for specific message types.]] diff --git a/src/lib/ecore/efl_loop_message_future.eo b/src/lib/ecore/efl_loop_message_future.eo index 047c1c4b6a..f1c508d18f 100644 --- a/src/lib/ecore/efl_loop_message_future.eo +++ b/src/lib/ecore/efl_loop_message_future.eo @@ -1,4 +1,4 @@ -class Efl.Loop_Message_Future extends Efl.Loop_Message +class @beta Efl.Loop_Message_Future extends 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 a676555aca..34e0a5982e 100644 --- a/src/lib/ecore/efl_loop_message_future_handler.eo +++ b/src/lib/ecore/efl_loop_message_future_handler.eo @@ -1,4 +1,4 @@ -class Efl.Loop_Message_Future_Handler extends Efl.Loop_Message_Handler +class @beta Efl.Loop_Message_Future_Handler extends Efl.Loop_Message_Handler { [[ Internal use for future on an efl loop - replacing legacy ecore events ]] methods { diff --git a/src/lib/ecore/efl_loop_message_handler.eo b/src/lib/ecore/efl_loop_message_handler.eo index 291b0bc6af..3fb60a8168 100644 --- a/src/lib/ecore/efl_loop_message_handler.eo +++ b/src/lib/ecore/efl_loop_message_handler.eo @@ -1,4 +1,4 @@ -class Efl.Loop_Message_Handler extends Efl.Object +class @beta Efl.Loop_Message_Handler extends Efl.Object { [[Message handlers represent a single message type on the Efl.Loop parent object. These message handlers can be used to listen for diff --git a/src/lib/ecore/efl_model_loop.c b/src/lib/ecore/efl_loop_model.c similarity index 63% rename from src/lib/ecore/efl_model_loop.c rename to src/lib/ecore/efl_loop_model.c index 3303f96c89..0f212f1283 100644 --- a/src/lib/ecore/efl_model_loop.c +++ b/src/lib/ecore/efl_loop_model.c @@ -7,11 +7,12 @@ #include #include "Eo.h" -#include "efl_model_loop.eo.h" +#include "ecore_private.h" +#include "efl_loop_model.eo.h" -typedef struct _Efl_Model_Loop_Watcher_Data Efl_Model_Loop_Watcher_Data; +typedef struct _Efl_Loop_Model_Watcher_Data Efl_Loop_Model_Watcher_Data; -struct _Efl_Model_Loop_Watcher_Data +struct _Efl_Loop_Model_Watcher_Data { const char *property; Eina_Promise *p; @@ -21,7 +22,7 @@ struct _Efl_Model_Loop_Watcher_Data static void _propagate_future(void *data, const Efl_Event *event); static void -_efl_model_loop_wathcer_free(Efl_Model_Loop_Watcher_Data *wd) +_efl_loop_model_wathcer_free(Efl_Loop_Model_Watcher_Data *wd) { efl_event_callback_del(wd->obj, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _propagate_future, wd); @@ -36,7 +37,7 @@ _propagate_future(void *data, const Efl_Event *event) const char *property; unsigned int i; Eina_Array_Iterator it; - Efl_Model_Loop_Watcher_Data *wd = data; + Efl_Loop_Model_Watcher_Data *wd = data; EINA_ARRAY_ITER_NEXT(ev->changed_properties, i, property, it) if (property == wd->property || !strcmp(property, wd->property)) @@ -60,7 +61,7 @@ _propagate_future(void *data, const Efl_Event *event) } eina_value_free(v); - _efl_model_loop_wathcer_free(wd); + _efl_loop_model_wathcer_free(wd); break ; } } @@ -68,11 +69,11 @@ _propagate_future(void *data, const Efl_Event *event) static void _event_cancel(void *data, const Eina_Promise *dead_ptr EINA_UNUSED) { - _efl_model_loop_wathcer_free(data); + _efl_loop_model_wathcer_free(data); } static Eina_Future * -_efl_model_loop_efl_model_property_ready_get(Eo *obj, void *pd EINA_UNUSED, const char *property) +_efl_loop_model_efl_model_property_ready_get(Eo *obj, void *pd EINA_UNUSED, const char *property) { Eina_Value *value = efl_model_property_get(obj, property); Eina_Future *f; @@ -86,7 +87,7 @@ _efl_model_loop_efl_model_property_ready_get(Eo *obj, void *pd EINA_UNUSED, cons if (err == EAGAIN) { - Efl_Model_Loop_Watcher_Data *wd = calloc(1, sizeof (Efl_Model_Loop_Watcher_Data)); + Efl_Loop_Model_Watcher_Data *wd = calloc(1, sizeof (Efl_Loop_Model_Watcher_Data)); wd->obj = obj; wd->property = eina_stringshare_add(property); @@ -106,4 +107,30 @@ _efl_model_loop_efl_model_property_ready_get(Eo *obj, void *pd EINA_UNUSED, cons return efl_future_then(obj, f); } -#include "efl_model_loop.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); + // For safety reason and in case multiple call to volatile has been made + // we check that there is still a parent at this point in EFL_EVENT_NOREF + efl_del(event->object); +} + +static void +_efl_loop_model_volatile_make(Eo *obj, void *pd EINA_UNUSED) +{ + // Just to make sure we do not double register this callback, we first remove + // any potentially previous one. + efl_event_callback_del(obj, EFL_EVENT_NOREF, _noref_death, NULL); + efl_event_callback_add(obj, EFL_EVENT_NOREF, _noref_death, NULL); +} + +static void +_efl_loop_model_efl_object_invalidate(Eo *obj, void *pd EINA_UNUSED) +{ + efl_event_callback_del(obj, EFL_EVENT_NOREF, _noref_death, NULL); + + efl_invalidate(efl_super(obj, EFL_LOOP_MODEL_CLASS)); +} + +#include "efl_loop_model.eo.c" diff --git a/src/lib/ecore/efl_loop_model.eo b/src/lib/ecore/efl_loop_model.eo new file mode 100644 index 0000000000..362b8bff09 --- /dev/null +++ b/src/lib/ecore/efl_loop_model.eo @@ -0,0 +1,18 @@ +abstract @beta Efl.Loop_Model extends Efl.Loop_Consumer implements Efl.Model +{ + data: null; + methods { + volatile_make { + [[To be called when a Child model is created by @Efl.Model.children_slice_get by the one creating the child object. + + This function is used to properly define the lifecycle of the new Child Model object + and make sure that once it has 0 ref except its parent Model, it will be destroyed. + This function should only be called once per child. It is useful for @Efl.Model who + have a lot of children and shouldn't keep more than what is used in memory.]] + } + } + implements { + Efl.Object.invalidate; + Efl.Model.property_ready_get; + } +} diff --git a/src/lib/ecore/efl_loop_timer.eo b/src/lib/ecore/efl_loop_timer.eo index 44841d8068..d726c1ad5f 100644 --- a/src/lib/ecore/efl_loop_timer.eo +++ b/src/lib/ecore/efl_loop_timer.eo @@ -6,10 +6,13 @@ class Efl.Loop_Timer extends Efl.Loop_Consumer Timers require the ecore main loop to be running and functioning properly. They do not guarantee exact timing but try to work on a "best effort" basis. + + The @Efl.Object.event_freeze and @Efl.Object.event_thaw calls are used to pause and unpause the timer. + + @since 1.22 ]] - legacy_prefix: ecore_timer; methods { - @property interval { + @property timer_interval { [[Interval the timer ticks on.]] set { [[If set during a timer call this will affect the next interval.]] @@ -20,31 +23,24 @@ class Efl.Loop_Timer extends Efl.Loop_Consumer in: double(-1.0); [[The new interval in seconds]] } } - @property pending { + @property time_pending { [[Pending time regarding a timer.]] get { return: double; [[Pending time]] } } - reset { - /* FIXME-doc: - * @note This is equivalent to (but faster than) - * @code - * ecore_timer_delay(timer, ecore_timer_interval_get(timer) - ecore_timer_pending_get(timer)); - * @endcode - */ + timer_reset { [[Resets a timer to its full interval. This effectively makes the timer start ticking off from zero now. - @since 1.2 + This is equal to delaying the timer by the already passed time, since the timer started ticking ]] } - loop_reset { + timer_loop_reset { [[This effectively resets a timer but based on the time when this iteration of the main loop started. - @since 1.18 - ]] + ]] } - delay { + timer_delay { [[Adds a delay to the next occurrence of a timer. This doesn't affect the timer interval. ]] @@ -54,7 +50,10 @@ class Efl.Loop_Timer extends Efl.Loop_Consumer } } events { - tick: void; [[Event triggered when the specified time as passed.]] + timer,tick: void; [[Event triggered when the specified time as passed.]] + } + constructors { + .timer_interval; } implements { Efl.Object.constructor; @@ -62,34 +61,7 @@ class Efl.Loop_Timer extends Efl.Loop_Consumer Efl.Object.finalize; Efl.Object.event_freeze; Efl.Object.parent { set; } - /* XXX: can't document overridden methods - * Pauses a running timer. - * - * @param timer The timer to be paused. - * - * The timer callback won't be called while the timer is paused. The remaining - * time until the timer expires will be saved so the timer can be resumed with - * that same remaining time to expire, instead of expiring instantly. Use - * ecore_timer_thaw() to resume. - * - * @note Nothing happens if the timer was already paused. - * - * @see ecore_timer_thaw() - */ Efl.Object.event_freeze_count { get; } Efl.Object.event_thaw; - /* XXX: can't document overridden methods - * Resumes a frozen (paused) timer. - * - * @param timer The timer to be resumed. - * - * The timer will be resumed from its previous relative position. This - * means if it had X seconds remaining until expiry when paused, it will - * now start with those same X seconds remaining. - * The interval time won't be affected by this call nor by - * ecore_timer_freeze(). - * - * @see ecore_timer_freeze() - */ } } diff --git a/src/lib/ecore/efl_loop_timer_eo.legacy.c b/src/lib/ecore/efl_loop_timer_eo.legacy.c new file mode 100644 index 0000000000..b3d2765122 --- /dev/null +++ b/src/lib/ecore/efl_loop_timer_eo.legacy.c @@ -0,0 +1,36 @@ + +EAPI void +ecore_timer_interval_set(Efl_Loop_Timer *obj, double in) +{ + efl_loop_timer_interval_set(obj, in); +} + +EAPI double +ecore_timer_interval_get(const Efl_Loop_Timer *obj) +{ + return efl_loop_timer_interval_get(obj); +} + +EAPI double +ecore_timer_pending_get(const Efl_Loop_Timer *obj) +{ + return efl_loop_timer_time_pending_get(obj); +} + +EAPI void +ecore_timer_reset(Efl_Loop_Timer *obj) +{ + efl_loop_timer_reset(obj); +} + +EAPI void +ecore_timer_loop_reset(Efl_Loop_Timer *obj) +{ + efl_loop_timer_loop_reset(obj); +} + +EAPI void +ecore_timer_delay(Efl_Loop_Timer *obj, double add) +{ + efl_loop_timer_delay(obj, add); +} diff --git a/src/lib/ecore/efl_loop_timer_eo.legacy.h b/src/lib/ecore/efl_loop_timer_eo.legacy.h new file mode 100644 index 0000000000..43c372a5d7 --- /dev/null +++ b/src/lib/ecore/efl_loop_timer_eo.legacy.h @@ -0,0 +1,86 @@ +#ifndef _EFL_LOOP_TIMER_EO_LEGACY_H_ +#define _EFL_LOOP_TIMER_EO_LEGACY_H_ + +#ifndef _EFL_LOOP_TIMER_EO_CLASS_TYPE +#define _EFL_LOOP_TIMER_EO_CLASS_TYPE + +typedef Eo Efl_Loop_Timer; + +#endif + +#ifndef _EFL_LOOP_TIMER_EO_TYPES +#define _EFL_LOOP_TIMER_EO_TYPES + + +#endif + +/** + * @brief Interval the timer ticks on. + * + * If set during a timer call this will affect the next interval. + * + * @param[in] obj The object. + * @param[in] in The new interval in seconds + * + * @ingroup Ecore_Timer_Group + */ +EAPI void ecore_timer_interval_set(Efl_Loop_Timer *obj, double in); + +/** + * @brief Interval the timer ticks on. + * + * @param[in] obj The object. + * + * @return The new interval in seconds + * + * @ingroup Ecore_Timer_Group + */ +EAPI double ecore_timer_interval_get(const Efl_Loop_Timer *obj); + +/** + * @brief Pending time regarding a timer. + * + * @param[in] obj The object. + * + * @return Pending time + * + * @ingroup Ecore_Timer_Group + */ +EAPI double ecore_timer_pending_get(const Efl_Loop_Timer *obj); + +/** + * @brief Resets a timer to its full interval. This effectively makes the timer + * start ticking off from zero now. + * + * This is equal to delaying the timer by the already passed time, since the + * timer started ticking + * + * @param[in] obj The object. + * + * @since 1.2 + * + * @ingroup Ecore_Timer_Group + */ +EAPI void ecore_timer_reset(Efl_Loop_Timer *obj); + +/** This effectively resets a timer but based on the time when this iteration + * of the main loop started. + * + * @since 1.18 + * + * @ingroup Ecore_Timer_Group + */ +EAPI void ecore_timer_loop_reset(Efl_Loop_Timer *obj); + +/** + * @brief Adds a delay to the next occurrence of a timer. This doesn't affect + * the timer interval. + * + * @param[in] obj The object. + * @param[in] add The amount of time by which to delay the timer in seconds + * + * @ingroup Ecore_Timer_Group + */ +EAPI void ecore_timer_delay(Efl_Loop_Timer *obj, double add); + +#endif diff --git a/src/lib/ecore/efl_model_composite.c b/src/lib/ecore/efl_model_composite.c deleted file mode 100644 index 2803675b36..0000000000 --- a/src/lib/ecore/efl_model_composite.c +++ /dev/null @@ -1,121 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include - -#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) -{ - if (pd->source) - { - efl_event_callback_forwarder_del(pd->source, EFL_MODEL_EVENT_CHILD_ADDED, obj); - efl_event_callback_forwarder_del(pd->source, EFL_MODEL_EVENT_CHILD_REMOVED, obj); - efl_event_callback_forwarder_del(pd->source, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, obj); - efl_event_callback_forwarder_del(pd->source, EFL_MODEL_EVENT_PROPERTIES_CHANGED, obj); - - 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); - - efl_event_callback_forwarder_priority_add(model, EFL_MODEL_EVENT_CHILD_ADDED, EFL_CALLBACK_PRIORITY_BEFORE, obj); - efl_event_callback_forwarder_priority_add(model, EFL_MODEL_EVENT_CHILD_REMOVED, EFL_CALLBACK_PRIORITY_BEFORE, obj); - efl_event_callback_forwarder_priority_add(model, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, EFL_CALLBACK_PRIORITY_BEFORE, obj); - efl_event_callback_forwarder_priority_add(model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, EFL_CALLBACK_PRIORITY_BEFORE, obj); -} - -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_Iterator * -_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 deleted file mode 100644 index d353a2e9f4..0000000000 --- a/src/lib/ecore/efl_model_composite.eo +++ /dev/null @@ -1,15 +0,0 @@ -class Efl.Model_Composite extends Efl.Model_Loop implements 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 deleted file mode 100644 index 2db0bc768e..0000000000 --- a/src/lib/ecore/efl_model_composite_boolean.c +++ /dev/null @@ -1,307 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#include "efl_model_composite_boolean_children.eo.h" -#include "efl_model_composite_private.h" - -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; - -struct _Efl_Model_Composite_Boolean_Data -{ - Eina_Hash *values; -}; - -struct _Efl_Model_Composite_Boolean_Value -{ - Eina_Stringshare *property; - - // 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; -}; - -struct _Efl_Model_Composite_Boolean_Children_Data -{ - Efl_Model_Composite_Boolean_Data *parent; - unsigned int index; -}; - -/**************** efl_mmodel_composite_boolean_children **************/ - -static void -_efl_model_composite_boolean_children_index_set(Eo *obj EINA_UNUSED, - Efl_Model_Composite_Boolean_Children_Data *pd, - unsigned int index) -{ - if (pd->parent) // This is set during finalize - return ; - - pd->index = index; -} - -static unsigned int -_efl_model_composite_boolean_children_index_get(const Eo *obj EINA_UNUSED, - Efl_Model_Composite_Boolean_Children_Data *pd) -{ - return pd->index; -} - -static Efl_Object * -_efl_model_composite_boolean_children_efl_object_finalize(Eo *obj, - Efl_Model_Composite_Boolean_Children_Data *pd) -{ - Eo *parent; - - parent = efl_parent_get(obj); - if (!parent) return NULL; - pd->parent = efl_data_scope_get(parent, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS); - - return obj; -} - -static Eina_Iterator * -_efl_model_composite_boolean_children_efl_model_properties_get(const Eo *obj, - Efl_Model_Composite_Boolean_Children_Data *pd) -{ - EFL_MODEL_COMPOSITE_PROPERTIES_SUPER(props, - obj, EFL_MODEL_COMPOSITE_BOOLEAN_CHILDREN_CLASS, - eina_hash_iterator_key_new(pd->parent->values), - "child.index"); - return props; -} - -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 - flag = v->buffer[pd->index >> 3] & (((unsigned char)1) << (pd->index & 0x7)); - - return eina_value_bool_new(!!flag); -} - -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) -{ - Efl_Model_Composite_Boolean_Value *v; - Eina_Stringshare *s; - Eina_Value b = EINA_VALUE_EMPTY; - Eina_Bool flag; - - if (!property) - return efl_loop_future_rejected(obj, - EFL_MODEL_ERROR_UNKNOWN); - if (strcmp(property, "child.index") == 0) - return efl_loop_future_rejected(obj, - EFL_MODEL_ERROR_READ_ONLY); - - s = eina_stringshare_add(property); - v = eina_hash_find(pd->parent->values, s); - eina_stringshare_del(s); - - if (!v) - return efl_model_property_set(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CHILDREN_CLASS), - property, value); - - eina_value_setup(&b, EINA_VALUE_TYPE_BOOL); - if (!eina_value_convert(value, &b)) - return efl_loop_future_rejected(obj, - EFL_MODEL_ERROR_UNKNOWN); - if (!eina_value_get(value, &flag)) - return efl_loop_future_rejected(obj, - EFL_MODEL_ERROR_UNKNOWN); - - eina_value_flush(&b); - - // We are optimistically allocating the boolean buffer now. - // Aligning it on 64bits - if (v->buffer_count < (((pd->index) >> 3) | 0x7) + 1) - { - unsigned int rcount = (((pd->index | 0xF) >> 3) | 0x7) + 1; - unsigned char *tmp; - - tmp = realloc(v->buffer, rcount); - if (!tmp) return efl_loop_future_rejected(obj, ENOMEM); - v->buffer = tmp; - memset(v->buffer + v->buffer_count, 0, rcount - v->buffer_count); - v->buffer_count = rcount; - } - - // It is assumed that during slice get the buffer is properly sized - if (flag) - v->buffer[pd->index >> 3] |= ((unsigned char)1) << (pd->index & 0x7); - else - v->buffer[pd->index >> 3] &= ~(((unsigned char)1) << (pd->index & 0x7)); - - // Calling "properties,changed" event - efl_model_properties_changed(obj, property); - - // Return fulfilled future - return efl_loop_future_resolved(obj, eina_value_bool_init(!!flag)); -} - -/**************** efl_model_composite_boolean **************/ -typedef struct _Efl_Model_Slice_Request Efl_Model_Slice_Request; -struct _Efl_Model_Slice_Request -{ - Eo *parent; - unsigned int start; -}; - -static Eina_Value -_efl_model_composite_boolean_then(Eo *o EINA_UNUSED, void *data, const Eina_Value v) -{ - Efl_Model_Slice_Request *req = data; - unsigned int i, len; - Eina_Value r = EINA_VALUE_EMPTY; - Eo *target = NULL; - - eina_value_array_setup(&r, EINA_VALUE_TYPE_OBJECT, 4); - - EINA_VALUE_ARRAY_FOREACH(&v, len, i, target) - { - Eo *composite; - - // 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)); - - eina_value_array_append(&r, composite); - } - - return r; -} - -static void -_efl_model_composite_boolean_clean(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED) -{ - Efl_Model_Slice_Request *req = data; - - efl_unref(req->parent); - free(req); -} - -static void -_boolean_value_free(void *data) -{ - Efl_Model_Composite_Boolean_Value *value = data; - - eina_stringshare_del(value->property); - value->property = NULL; - - free(value->buffer); - value->buffer = NULL; - value->buffer_count = 0; - - free(value); -} - -static Eo * -_efl_model_composite_boolean_efl_object_constructor(Eo *obj, Efl_Model_Composite_Boolean_Data *pd) -{ - obj = efl_constructor(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS)); - - if (!obj) return NULL; - - pd->values = eina_hash_stringshared_new(_boolean_value_free); - - return obj; -} - -static void -_efl_model_composite_boolean_efl_object_destructor(Eo *obj, Efl_Model_Composite_Boolean_Data *pd) -{ - eina_hash_free(pd->values); - - efl_destructor(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS)); -} - -static void -_efl_model_composite_boolean_boolean_add(Eo *obj EINA_UNUSED, - Efl_Model_Composite_Boolean_Data *pd, - const char *name, Eina_Bool default_value) -{ - Efl_Model_Composite_Boolean_Value *value; - - if (!name) return ; - - value = calloc(1, sizeof (Efl_Model_Composite_Boolean_Value)); - if (!value) return ; - - value->property = eina_stringshare_add(name); - value->default_value = default_value; - - eina_hash_direct_add(pd->values, value->property, 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; - - s = eina_stringshare_add(name); - eina_hash_del(pd->values, s, NULL); - eina_stringshare_del(s); -} - -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_Model_Slice_Request *req; - Eina_Future *f; - - f = efl_model_children_slice_get(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS), - start, count); - - req = malloc(sizeof (Efl_Model_Slice_Request)); - if (!req) return efl_loop_future_rejected(obj, - ENOMEM); - req->parent = efl_ref(obj); - req->start = start; - - return efl_future_then(obj, f, .success_type = EINA_VALUE_TYPE_ARRAY, - .success = _efl_model_composite_boolean_then, - .free = _efl_model_composite_boolean_clean, - .data = req); -} - -#include "efl_model_composite_boolean.eo.c" -#include "efl_model_composite_boolean_children.eo.c" diff --git a/src/lib/ecore/efl_model_composite_boolean_children.eo b/src/lib/ecore/efl_model_composite_boolean_children.eo deleted file mode 100644 index d06a9cc424..0000000000 --- a/src/lib/ecore/efl_model_composite_boolean_children.eo +++ /dev/null @@ -1,23 +0,0 @@ -class Efl.Model_Composite_Boolean_Children extends 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.Model.properties { get; } - 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 deleted file mode 100644 index 18db24cfc3..0000000000 --- a/src/lib/ecore/efl_model_composite_selection.c +++ /dev/null @@ -1,490 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include "Eina.h" -#include "Efl.h" -#include -#include "Eo.h" - -#include "efl_model_composite_selection.eo.h" -#include "efl_model_accessor_view_private.h" -#include "efl_model_composite_private.h" - -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 -{ - unsigned long last; - - Eina_Bool exclusive : 1; - Eina_Bool none : 1; -}; - -struct _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) -{ - 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 Eina_Value -_commit_change(Eo *child, void *data EINA_UNUSED, const Eina_Value v) -{ - Efl_Model_Composite_Selection_Data *pd; - 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 -_clear_child(Eo *child, - void *data EINA_UNUSED, - const Eina_Future *dead_future EINA_UNUSED) -{ - efl_del(child); -} - -static Efl_Model * -_select_child_get(const Eina_Value *array, unsigned int idx) -{ - Efl_Model *ret = NULL; - - 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 Eina_Future * -_check_child_change(Efl_Model *child, Eina_Bool value) -{ - 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 = efl_loop_future_resolved(child, eina_value_bool_init(value)); - } - else - { - r = efl_model_property_set(child, "selected", eina_value_bool_new(!!value)); - r = efl_future_then(child, r, .success = _commit_change, .free = _clear_child); - } - - return r; -} - -static Eina_Future * -_select_child(Efl_Model *child) -{ - return _check_child_change(child, EINA_TRUE); -} - -static Eina_Future * -_unselect_child(Efl_Model *child) -{ - return _check_child_change(child, EINA_FALSE); -} - -static Eina_Value -_select_slice_then(Eo *obj EINA_UNUSED, - void *data EINA_UNUSED, - const Eina_Value v) -{ - 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_Value -_unselect_slice_then(Eo *obj EINA_UNUSED, - void *data EINA_UNUSED, - const Eina_Value v) -{ - 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 Eina_Iterator * -_efl_model_composite_selection_efl_model_properties_get(const Eo *obj, - Efl_Model_Composite_Selection_Data *pd EINA_UNUSED) -{ - EFL_MODEL_COMPOSITE_PROPERTIES_SUPER(props, - obj, EFL_MODEL_COMPOSITE_SELECTION_CLASS, - NULL, - "selected", "exclusive"); - return props; -} - -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) -{ - Eina_Value vf = EINA_VALUE_EMPTY; - - if (!strcmp("exclusive", property)) - { - Eina_Bool exclusive = pd->exclusive; - Eina_Bool changed; - - vf = eina_value_bool_init(exclusive); - eina_value_convert(value, &vf); - eina_value_bool_get(&vf, &exclusive); - - changed = (!pd->exclusive != !exclusive); - pd->exclusive = !!exclusive; - - if (changed) efl_model_properties_changed(obj, "exclusive"); - - return efl_loop_future_resolved(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 efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE); - - return efl_future_then(obj, efl_model_children_slice_get(obj, l, 1), - .success = _select_slice_then, - .success_type = EINA_VALUE_TYPE_ARRAY); - } - - return efl_model_property_set(efl_super(obj, EFL_MODEL_COMPOSITE_SELECTION_CLASS), - property, value); -} - -static Eina_Value * -_efl_model_composite_selection_efl_model_property_get(const Eo *obj, Efl_Model_Composite_Selection_Data *pd, const char *property) -{ - 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 Eina_Value -_regenerate_error(void *data, - const Eina_Value v, - const Eina_Future *dead_future EINA_UNUSED) -{ - 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 Eina_Value -_untangle_array(void *data EINA_UNUSED, - const Eina_Value v) -{ - Eina_Value va = EINA_VALUE_EMPTY; - - // Only return the commit change, not the result of the unselect - eina_value_array_get(&v, 0, &va); - return va; -} - -static Eina_Iterator * -_efl_model_composite_selection_children_efl_model_properties_get(const Eo *obj, - Efl_Model_Composite_Selection_Children_Data *pd EINA_UNUSED) -{ - EFL_MODEL_COMPOSITE_PROPERTIES_SUPER(props, - obj, EFL_MODEL_COMPOSITE_SELECTION_CHILDREN_CLASS, - NULL, - "selected"); - return props; -} - -static Eina_Value -_untangle_error(void *data, Eina_Error err) -{ - Efl_Model *child = data; - Eina_Future *f; - - // 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 - *error = err; - f = eina_future_then(f, _regenerate_error, error, NULL); - - return eina_future_as_value(f); -} - -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) -{ - 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 efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE); - - // Nothing changed - if (newflag == prevflag) - return efl_loop_future_resolved(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) - { - // 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) - { - 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 - { - Eo *parent; - Eina_Value *vs; - unsigned long selected = 0; - - // 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) - { - eina_value_free(vs); - goto commit_change; - } - success = eina_value_ulong_get(vs, &selected); - eina_value_free(vs); - - if (!success) - return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE); - - // There was, need to unselect the previous one along setting the new value - parent = efl_parent_get(obj); - chain = eina_future_all(chain, - efl_future_then(parent, efl_model_children_slice_get(parent, selected, 1), - .success = _unselect_slice_then, - .success_type = EINA_VALUE_TYPE_ARRAY)); - - chain = eina_future_then_easy(chain, - .success_type = EINA_VALUE_TYPE_ARRAY, - .success = _untangle_array, - .data = obj, - .error = _untangle_error); - } - } - - commit_change: - return efl_future_then(obj, chain, - .success = _commit_change); -} - -typedef struct _Selection_Children_Request Selection_Children_Request; -struct _Selection_Children_Request -{ - Efl_Model *parent; - - unsigned int start; -}; - -static Eina_Value -_slice_get(Eo *o EINA_UNUSED, - void *data, - const Eina_Value v) -{ - Selection_Children_Request *req = data; - unsigned int length, it; - Eo *composited = NULL; - Eina_Value r = EINA_VALUE_EMPTY; - - 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); - } - - return r; -} - -static void -_slice_clean(Eo *o EINA_UNUSED, - void *data, - const Eina_Future *dead_future EINA_UNUSED) -{ - Selection_Children_Request *req = data; - - efl_unref(req->parent); - free(req); -} - -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) -{ - Selection_Children_Request *req; - Eina_Future *f; - - req = calloc(1, sizeof (Selection_Children_Request)); - if (!req) return efl_loop_future_rejected(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); - - return efl_future_then(obj, f, - .success_type = EINA_VALUE_TYPE_ARRAY, - .success = _slice_get, - .free = _slice_clean, - .data = req); -} - -#include "efl_model_composite_selection.eo.c" -#include "efl_model_composite_selection_children.eo.c" diff --git a/src/lib/ecore/efl_model_composite_selection_children.eo b/src/lib/ecore/efl_model_composite_selection_children.eo deleted file mode 100644 index ce59ea2b16..0000000000 --- a/src/lib/ecore/efl_model_composite_selection_children.eo +++ /dev/null @@ -1,9 +0,0 @@ -class Efl.Model_Composite_Selection_Children extends Efl.Model_Composite_Boolean_Children -{ - [[Efl model composite selection children class]] - implements { - Efl.Model.property { set; } - Efl.Model.properties { get; } - } - /* FIXME: emitting Efl.Model_Composite_Selection.Selected. Use a default selection event! */ -} diff --git a/src/lib/ecore/efl_model_container.c b/src/lib/ecore/efl_model_container.c deleted file mode 100644 index b69f3f23db..0000000000 --- a/src/lib/ecore/efl_model_container.c +++ /dev/null @@ -1,282 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#include - -#include "ecore_internal.h" - -#include "efl_model_container_private.h" - -#define MY_CLASS EFL_MODEL_CONTAINER_CLASS - -void * -_value_copy_alloc(void *v, const Eina_Value_Type *type) -{ - if (!v) - return v; - - if (type == EINA_VALUE_TYPE_STRINGSHARE) - return (void*) eina_stringshare_ref(v); - else if (type == EINA_VALUE_TYPE_STRING) - return (void*) strdup(v); - else - { - void *ret = malloc(type->value_size); - memcpy(ret, v, type->value_size); - return ret; - } -} - -void -_value_free(void *v, const Eina_Value_Type *type) -{ - if (!v) - return; - - if (type == EINA_VALUE_TYPE_STRINGSHARE) - return eina_stringshare_del(v); - else - free(v); -} - -static void -_values_free(Eina_Array *values, const Eina_Value_Type *type) -{ - unsigned int i; - void *v; - Eina_Array_Iterator it; - EINA_ARRAY_ITER_NEXT(values, i, v, it) - { - _value_free(v, type); - } - eina_array_free(values); -} - -static void -_property_data_free_cb(void *data) -{ - Child_Property_Data *cpd = data; - _values_free(cpd->values, cpd->type); - free(cpd); -} - -static Efl_Object * -_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->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) -{ - Eina_Stringshare *key; - Eina_Iterator *it; - - eina_list_free(sd->childrens); - - it = eina_hash_iterator_key_new(sd->properties); - EINA_ITERATOR_FOREACH(it, key) - eina_stringshare_del(key); - eina_iterator_free(it); - - 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) -{ - Child_Property_Data *cpd; - Eina_Stringshare *key; - - key = eina_stringshare_add(property); - cpd = eina_hash_find(sd->properties, key); - eina_stringshare_del(key); - - 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) -{ - Child_Property_Data *cpd; - Eina_Stringshare *key; - - key = eina_stringshare_add(property); - cpd = eina_hash_find(sd->properties, key); - eina_stringshare_del(key); - - 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) -{ - Eina_Array *arr = NULL; - void *data = 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"); - goto on_error; - } - - err = ENOMEM; - arr = eina_array_new(4); - if (!arr) goto on_error; - - EINA_ITERATOR_FOREACH(values, data) - { - void *new_data = _value_copy_alloc(data, type); - if ((data && !new_data) || !eina_array_push(arr, new_data)) - { - if (new_data) - _value_free(new_data, type); - goto on_error; - } - } - eina_iterator_free(values); - - err = EFL_MODEL_ERROR_UNKNOWN; - - cpd = eina_hash_find(sd->properties, name); - if (!cpd) - { - cpd = calloc(1, sizeof(Child_Property_Data)); - if (!cpd) - goto on_error; - - cpd->type = type; - cpd->values = arr; - - if (!eina_hash_direct_add(sd->properties, name, cpd)) - goto on_error; - } - else - { - eina_stringshare_del(name); - _values_free(cpd->values, cpd->type); - - cpd->type = type; - cpd->values = arr; - } - - in_count = eina_array_count(arr); - children_count = eina_list_count(sd->childrens); - - for (i = children_count; i < in_count; ++i) - { - Efl_Model_Children_Event cevt = { 0 }; - Efl_Model *child; - - child = efl_add(EFL_MODEL_CONTAINER_ITEM_CLASS, obj, - efl_model_container_item_define(efl_added, sd, i)); - sd->childrens = eina_list_append(sd->childrens, 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, NULL); - - return EINA_TRUE; - - on_error: - eina_stringshare_del(name); - if (cpd) free(cpd); - if (arr) - _values_free(arr, type); - eina_error_set(err); - return EINA_FALSE; -} - -static Eina_Iterator * -_efl_model_container_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd) -{ - return eina_hash_iterator_key_new(sd->properties); -} - -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) -{ - return efl_loop_future_rejected(obj, - EFL_MODEL_ERROR_NOT_FOUND); -} - -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) -{ - return eina_value_error_new(EFL_MODEL_ERROR_NOT_FOUND); -} - -static Eina_Future * -_efl_model_container_efl_model_children_slice_get(Eo *obj, - Efl_Model_Container_Data *sd, - unsigned int start, - unsigned int count) -{ - Eina_Value v; - - v = efl_model_list_value_get(sd->childrens, start, count); - return efl_loop_future_resolved(obj, v); -} - -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 * -_efl_model_container_efl_model_child_add(Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd EINA_UNUSED) -{ - EINA_LOG_WARN("child_add not supported by Efl.Model.Container"); - eina_error_set(EFL_MODEL_ERROR_NOT_SUPPORTED); - - return NULL; -} - -static void -_efl_model_container_efl_model_child_del(Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd EINA_UNUSED, Eo *child EINA_UNUSED) -{ - EINA_LOG_WARN("child_del not supported by Efl.Model.Container"); - eina_error_set(EFL_MODEL_ERROR_NOT_SUPPORTED); -} - -#include "efl_model_container.eo.c" diff --git a/src/lib/ecore/efl_model_container_item.c b/src/lib/ecore/efl_model_container_item.c deleted file mode 100644 index ec61f8ea28..0000000000 --- a/src/lib/ecore/efl_model_container_item.c +++ /dev/null @@ -1,164 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include - -#include "efl_model_container_private.h" - -#define MY_CLASS EFL_MODEL_CONTAINER_ITEM_CLASS - -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; - sd->index = index; -} - -EOLIAN static void -_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; -} - -static Eina_Iterator * -_efl_model_container_item_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Container_Item_Data *sd) -{ - // 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 obj; -} - -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 *name; - Child_Property_Data *cpd; - Eina_Value v = EINA_VALUE_EMPTY; - void *data, *new_data; - - - name = eina_stringshare_add(property); - cpd = eina_hash_find(sd->parent_data->properties, name); - eina_stringshare_del(name); - - if (!cpd || !cpd->values || - sd->index >= eina_array_count_get(cpd->values)) - return efl_loop_future_rejected(obj, - EFL_MODEL_ERROR_NOT_FOUND); - - eina_value_setup(&v,cpd->type); - if (!eina_value_convert(value, &v)) - return efl_loop_future_rejected(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->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 efl_loop_future_resolved(obj, v); - - on_error: - eina_value_flush(&v); - free(data); - - return efl_loop_future_rejected(obj, - EFL_MODEL_ERROR_UNKNOWN); -} - -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 *name; - Child_Property_Data *cpd; - Eina_Value *value; - void *data; - Eina_Bool r = EINA_FALSE; - - name = eina_stringshare_add(property); - cpd = eina_hash_find(sd->parent_data->properties, name); - eina_stringshare_del(name); - - if (!cpd || !cpd->values || - sd->index >= eina_array_count_get(cpd->values)) - return eina_value_error_new(EFL_MODEL_ERROR_NOT_FOUND); - - 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_value_free(value); - value = eina_value_error_new(EFL_MODEL_ERROR_UNKNOWN); - } - return value; -} - -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) -{ - return efl_loop_future_resolved(obj, EINA_VALUE_EMPTY); -} - -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) -{ - 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) -{ - EINA_LOG_WARN("child_add not supported by Efl.Model.Container.Item"); - eina_error_set(EFL_MODEL_ERROR_NOT_SUPPORTED); - - return NULL; -} - -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) -{ - EINA_LOG_WARN("child_del not supported by Efl.Model.Container.Item"); - eina_error_set(EFL_MODEL_ERROR_NOT_SUPPORTED); -} - -#include "efl_model_container_item.eo.c" diff --git a/src/lib/ecore/efl_model_container_item.eo b/src/lib/ecore/efl_model_container_item.eo deleted file mode 100644 index f085043d12..0000000000 --- a/src/lib/ecore/efl_model_container_item.eo +++ /dev/null @@ -1,34 +0,0 @@ -class Efl.Model_Container_Item extends Efl.Object implements Efl.Model -{ - [[ - Used as a child 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.]] - 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 - children.]] - } - } - } - implements { - Efl.Object.finalize; - Efl.Model.properties { 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.Object.invalidate; - } - constructors { - .define; - } -} diff --git a/src/lib/ecore/efl_model_container_private.h b/src/lib/ecore/efl_model_container_private.h deleted file mode 100644 index b1fe4c2245..0000000000 --- a/src/lib/ecore/efl_model_container_private.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef EFL_MODEL_CONTAINER_PRIVATE_H__ -#define EFL_MODEL_CONTAINER_PRIVATE_H__ - -typedef struct _Child_Property_Data Child_Property_Data; -struct _Child_Property_Data -{ - 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 *properties; - - Eina_List *childrens; -}; - - -typedef struct _Efl_Model_Container_Item_Data Efl_Model_Container_Item_Data; -struct _Efl_Model_Container_Item_Data -{ - Efl_Model_Container_Data *parent_data; - unsigned int index; -}; - -void *_value_copy_alloc(void *v, const Eina_Value_Type *type); - -void _value_free(void *v, const Eina_Value_Type *type); - -#endif diff --git a/src/lib/ecore/efl_model_loop.eo b/src/lib/ecore/efl_model_loop.eo deleted file mode 100644 index f0b34ab078..0000000000 --- a/src/lib/ecore/efl_model_loop.eo +++ /dev/null @@ -1,7 +0,0 @@ -class Efl.Model_Loop extends Efl.Loop_Consumer implements Efl.Model -{ - data: null; - implements { - Efl.Model.property_ready_get; - } -} diff --git a/src/lib/ecore/efl_select_model.c b/src/lib/ecore/efl_select_model.c new file mode 100644 index 0000000000..52100e681c --- /dev/null +++ b/src/lib/ecore/efl_select_model.c @@ -0,0 +1,386 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "Eina.h" +#include "Efl.h" +#include +#include "Eo.h" + +#include "efl_select_model.eo.h" +#include "efl_model_accessor_view_private.h" +#include "efl_composite_model_private.h" + +typedef struct _Efl_Select_Model_Data Efl_Select_Model_Data; + +struct _Efl_Select_Model_Data +{ + Efl_Select_Model_Data *parent; + unsigned long last; + + Eina_Bool exclusive : 1; + Eina_Bool none : 1; +}; + +static Eo* +_efl_select_model_efl_object_constructor(Eo *obj, + Efl_Select_Model_Data *pd EINA_UNUSED) +{ + Eo *parent; + + obj = efl_constructor(efl_super(obj, EFL_SELECT_MODEL_CLASS)); + + efl_boolean_model_boolean_add(obj, "selected", EINA_FALSE); + + pd->last = -1; + + parent = efl_parent_get(obj); + if (efl_isa(parent, EFL_SELECT_MODEL_CLASS)) + pd->parent = efl_data_scope_get(parent, EFL_SELECT_MODEL_CLASS); + + return obj; +} + +static Eina_Value +_commit_change(Eo *child, void *data EINA_UNUSED, const Eina_Value v) +{ + Efl_Select_Model_Data *pd; + Eina_Value *selected = NULL; + Eina_Bool selflag = EINA_FALSE; + + if (v.type == EINA_VALUE_TYPE_ERROR) + goto on_error; + + selected = efl_model_property_get(child, "selected"); + + pd = efl_data_scope_get(efl_parent_get(child), EFL_SELECT_MODEL_CLASS); + if (!pd) goto on_error; + + eina_value_bool_get(selected, &selflag); + if (selflag) + { + // select case + pd->none = EINA_FALSE; + pd->last = efl_composite_model_index_get(child); + efl_event_callback_call(child, EFL_SELECT_MODEL_EVENT_SELECTED, child); + } + else + { + // unselect case + unsigned long last; + + last = efl_composite_model_index_get(child); + if (pd->last == last) + { + pd->last = 0; + pd->none = EINA_TRUE; + } + efl_event_callback_call(child, EFL_SELECT_MODEL_EVENT_UNSELECTED, child); + } + + on_error: + eina_value_free(selected); + return v; +} + +static void +_clear_child(Eo *child, + void *data EINA_UNUSED, + const Eina_Future *dead_future EINA_UNUSED) +{ + efl_unref(child); +} + +static Efl_Model * +_select_child_get(const Eina_Value *array, unsigned int idx) +{ + Efl_Model *ret = NULL; + + 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 Eina_Future * +_check_child_change(Efl_Model *child, Eina_Bool value) +{ + 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 = efl_loop_future_resolved(child, eina_value_bool_init(value)); + } + else + { + r = efl_model_property_set(child, "selected", eina_value_bool_new(!!value)); + r = efl_future_then(efl_ref(child), r, + .success = _commit_change, + .free = _clear_child); + } + + return r; +} + +static Eina_Future * +_select_child(Efl_Model *child) +{ + return _check_child_change(child, EINA_TRUE); +} + +static Eina_Future * +_unselect_child(Efl_Model *child) +{ + return _check_child_change(child, EINA_FALSE); +} + +static Eina_Value +_select_slice_then(Eo *obj EINA_UNUSED, + void *data EINA_UNUSED, + const Eina_Value v) +{ + 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_Value +_unselect_slice_then(Eo *obj EINA_UNUSED, + void *data EINA_UNUSED, + const Eina_Value v) +{ + 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 Eina_Value +_regenerate_error(void *data, + const Eina_Value v, + const Eina_Future *dead_future EINA_UNUSED) +{ + 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 Eina_Value +_untangle_array(void *data EINA_UNUSED, + const Eina_Value v) +{ + Eina_Value va = EINA_VALUE_EMPTY; + + // Only return the commit change, not the result of the unselect + eina_value_array_get(&v, 0, &va); + return va; +} + +static Eina_Value +_untangle_error(void *data, Eina_Error err) +{ + Efl_Model *child = data; + Eina_Future *f; + + // 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_SELECT_MODEL_CLASS), + "selected", eina_value_bool_new(EINA_FALSE)); + // Once this is done, we need to repropagate the error + *error = err; + f = eina_future_then(f, _regenerate_error, error, NULL); + + return eina_future_as_value(f); +} + +static void +_untangle_free(void *data, + const Eina_Future *dead_future EINA_UNUSED) +{ + Eo *obj = data; + + efl_unref(obj); +} + +static Eina_Iterator * +_efl_select_model_efl_model_properties_get(const Eo *obj, + Efl_Select_Model_Data *pd EINA_UNUSED) +{ + EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(props, + obj, EFL_SELECT_MODEL_CLASS, + NULL, + "self.selected", "child.selected", "exclusive"); + return props; +} + +static Eina_Future * +_efl_select_model_efl_model_property_set(Eo *obj, + Efl_Select_Model_Data *pd, + const char *property, Eina_Value *value) +{ + Eina_Value vf = EINA_VALUE_EMPTY; + + if (!strcmp("exclusive", property)) + { + Eina_Bool exclusive = pd->exclusive; + Eina_Bool changed; + + vf = eina_value_bool_init(exclusive); + eina_value_convert(value, &vf); + eina_value_bool_get(&vf, &exclusive); + + changed = (!pd->exclusive != !exclusive); + pd->exclusive = !!exclusive; + + if (changed) efl_model_properties_changed(obj, "exclusive"); + + return efl_loop_future_resolved(obj, vf); + } + + if (!strcmp("child.selected", property)) + { + unsigned long l = 0; + + if (!eina_value_ulong_convert(value, &l)) + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE); + + return efl_future_then(efl_ref(obj), efl_model_children_slice_get(obj, l, 1), + .success = _select_slice_then, + .success_type = EINA_VALUE_TYPE_ARRAY, + .free = _clear_child); + } + + if (pd->parent && !strcmp("self.selected", property)) + { + Eina_Bool prevflag = EINA_FALSE, newflag = EINA_FALSE; + Eina_Bool exclusive = EINA_FALSE; + Eina_Bool success; + Eina_Value *prev; + Eina_Future *chain; + + prev = efl_model_property_get(efl_super(obj, EFL_SELECT_MODEL_CLASS), "selected"); + success = eina_value_bool_get(prev, &prevflag); + success &= eina_value_bool_convert(value, &newflag); + + if (!success) return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE); + + // Nothing changed + if (newflag == prevflag) + return efl_loop_future_resolved(obj, eina_value_bool_init(newflag)); + + exclusive = pd->parent->exclusive; + + // First store the new value in the boolean model we inherit from + chain = efl_model_property_set(efl_super(obj, EFL_SELECT_MODEL_CLASS), + "selected", value); + + // Now act ! + if (exclusive) + { + // 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) + { + unsigned int i; + + i = efl_composite_model_index_get(obj); + if (pd->parent->last == i && !newflag) + pd->parent->none = EINA_TRUE; + } + else + { + Eo *parent; + unsigned long selected = 0; + + // In this case we need to first unselect the previously selected one + // and then commit the change to this one. + selected = pd->parent->last; + + // There was, need to unselect the previous one along setting the new value + parent = efl_parent_get(obj); + chain = eina_future_all(chain, + efl_future_then(efl_ref(parent), + efl_model_children_slice_get(parent, selected, 1), + .success = _unselect_slice_then, + .success_type = EINA_VALUE_TYPE_ARRAY, + .free = _clear_child)); + chain = eina_future_then_easy(chain, + .success_type = EINA_VALUE_TYPE_ARRAY, + .success = _untangle_array, + .data = efl_ref(obj), + .error = _untangle_error, + .free = _untangle_free); + } + } + + return efl_future_then(efl_ref(obj), chain, + .success = _commit_change, + .free = _clear_child); + } + + return efl_model_property_set(efl_super(obj, EFL_SELECT_MODEL_CLASS), + property, value); +} + +static Eina_Value * +_efl_select_model_efl_model_property_get(const Eo *obj, Efl_Select_Model_Data *pd, const char *property) +{ + if (!strcmp("exclusive", property)) + return eina_value_bool_new(pd->exclusive); + // Last selected child + if (!strcmp("child.selected", property)) + { + if (pd->none) + return eina_value_error_new(EFL_MODEL_ERROR_INCORRECT_VALUE); + else + return eina_value_ulong_new(pd->last); + } + // Redirect to are we ourself selected + if (pd->parent && !strcmp("self.selected", property)) + { + return efl_model_property_get(efl_super(obj, EFL_SELECT_MODEL_CLASS), "selected"); + } + + return efl_model_property_get(efl_super(obj, EFL_SELECT_MODEL_CLASS), property); +} + +#include "efl_select_model.eo.c" diff --git a/src/lib/ecore/efl_model_composite_selection.eo b/src/lib/ecore/efl_select_model.eo similarity index 70% rename from src/lib/ecore/efl_model_composite_selection.eo rename to src/lib/ecore/efl_select_model.eo index 35ecc270af..ed7821fa68 100644 --- a/src/lib/ecore/efl_model_composite_selection.eo +++ b/src/lib/ecore/efl_select_model.eo @@ -1,9 +1,8 @@ -class Efl.Model_Composite_Selection extends Efl.Model_Composite_Boolean +class @beta Efl.Select_Model extends Efl.Boolean_Model { - [[Efl model composite selection class]] + [[Efl select model class]] implements { Efl.Object.constructor; - Efl.Model.children_slice_get; Efl.Model.property { get; set; } Efl.Model.properties { get; } } diff --git a/src/lib/ecore/efl_sinusoidal_interpolator.eo b/src/lib/ecore/efl_sinusoidal_interpolator.eo index 2f644ff354..e0701aa5d3 100644 --- a/src/lib/ecore/efl_sinusoidal_interpolator.eo +++ b/src/lib/ecore/efl_sinusoidal_interpolator.eo @@ -1,4 +1,4 @@ -class Efl.Sinusoidal_Interpolator extends Efl.Object implements Efl.Interpolator +class @beta Efl.Sinusoidal_Interpolator extends Efl.Object implements Efl.Interpolator { [[Efl sinusoidal interpolator class diff --git a/src/lib/ecore/efl_spring_interpolator.eo b/src/lib/ecore/efl_spring_interpolator.eo index 14593425a4..5549046ff4 100644 --- a/src/lib/ecore/efl_spring_interpolator.eo +++ b/src/lib/ecore/efl_spring_interpolator.eo @@ -1,4 +1,4 @@ -class Efl.Spring_Interpolator extends Efl.Object implements Efl.Interpolator +class @beta Efl.Spring_Interpolator extends Efl.Object implements Efl.Interpolator { [[Efl spring interpolator class]] data: Efl_Spring_Interpolator_Data; diff --git a/src/lib/ecore/efl_task.c b/src/lib/ecore/efl_task.c index 6442669efd..d610fcbf8b 100644 --- a/src/lib/ecore/efl_task.c +++ b/src/lib/ecore/efl_task.c @@ -12,344 +12,6 @@ ////////////////////////////////////////////////////////////////////////// -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) { @@ -385,33 +47,13 @@ _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) +_efl_task_efl_object_parent_set(Eo *obj, Efl_Task_Data *pd EINA_UNUSED, 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); - } - } } ////////////////////////////////////////////////////////////////////////// diff --git a/src/lib/ecore/efl_task.eo b/src/lib/ecore/efl_task.eo index 0a425d9f94..9731bebe2f 100644 --- a/src/lib/ecore/efl_task.eo +++ b/src/lib/ecore/efl_task.eo @@ -1,5 +1,7 @@ enum Efl.Task_Priority { - [[ ]] + [[ + @since 1.22 + ]] normal, background, low, @@ -8,114 +10,21 @@ enum Efl.Task_Priority { } enum Efl.Task_Flags { - [[ ]] + [[ + @since 1.22 + ]] none = 0, use_stdin = 1, use_stdout = 2, no_exit_code_error = 4, } -abstract Efl.Task extends Efl.Object implements Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer +abstract Efl.Task extends Efl.Loop_Consumer { - [[ ]] + [[ + @since 1.22 + ]] 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 { } diff --git a/src/lib/ecore/efl_thread.c b/src/lib/ecore/efl_thread.c index 8e4cd978fb..c9badf716a 100644 --- a/src/lib/ecore/efl_thread.c +++ b/src/lib/ecore/efl_thread.c @@ -25,10 +25,7 @@ typedef struct int in, out; Eo *in_handler, *out_handler; } fd, ctrl; - struct { - unsigned int argc; - const char **argv; - } args; + Eina_Array *argv; Efl_Callback_Array_Item_Full *event_cb; void *indata, *outdata; } Thread_Data; @@ -151,24 +148,31 @@ _efl_loop_arguments_send(Eo *obj, void *data EINA_UNUSED, const Eina_Value v) Efl_Loop_Arguments arge; Eina_Array *arga; Eina_Stringshare *s; - unsigned int argc = efl_task_arg_count_get(obj); - unsigned int i; + Eina_Accessor *accessor; + const char *argv; + int i = 0; - arga = eina_array_new(argc); - - for (i = 0; i < argc; i++) + accessor = efl_core_command_line_command_access(obj); + if (accessor) { - const char *argv = efl_task_arg_value_get(obj, i); - if (argv) - eina_array_push(arga, eina_stringshare_add(argv)); + arga = eina_array_new(10); + + EINA_ACCESSOR_FOREACH(accessor, i, argv) + { + eina_array_push(arga, eina_stringshare_add(argv)); + } + arge.argv = arga; } - arge.argv = arga; + else arge.argv = NULL; arge.initialization = EINA_TRUE; efl_event_callback_call(obj, EFL_LOOP_EVENT_ARGUMENTS, &arge); - - while ((s = eina_array_pop(arga))) eina_stringshare_del(s); - eina_array_free(arga); + if (accessor) + { + while ((s = eina_array_pop(arga))) eina_stringshare_del(s); + eina_array_free(arga); + eina_accessor_free(accessor); + } return v; } @@ -229,7 +233,6 @@ _efl_thread_main(void *data, Eina_Thread t) Eo *obj; Eina_Value *ret; Control_Data cmd; - unsigned int i; int real; Efl_Callback_Array_Item_Full *it; @@ -280,16 +283,11 @@ _efl_thread_main(void *data, Eina_Thread t) 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]); + if (thdat->argv) efl_core_command_line_command_array_set(obj, thdat->argv); + thdat->argv = NULL; efl_future_then(obj, efl_loop_job(obj), .success = _efl_loop_arguments_send); - - 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); @@ -537,10 +535,10 @@ _efl_thread_efl_object_destructor(Eo *obj, Efl_Thread_Data *pd) 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); +// 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); @@ -575,7 +573,7 @@ _efl_thread_efl_task_run(Eo *obj, Efl_Thread_Data *pd) const char *name; int pipe_to_thread[2]; int pipe_from_thread[2]; - unsigned int argc, i, num; + unsigned int num; Efl_Callback_Array_Item_Full *it; Efl_Task_Data *td = efl_data_scope_get(obj, EFL_TASK_CLASS); @@ -618,8 +616,10 @@ _efl_thread_efl_task_run(Eo *obj, Efl_Thread_Data *pd) 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); + if (fcntl(thdat->fd.in, F_SETFL, O_NONBLOCK) < 0) + ERR("can't set pipe to NONBLOCK"); + if (fcntl(pd->fd.out, F_SETFL, O_NONBLOCK) < 0) + ERR("can't set pipe to NONBLOCK"); pd->fd.out_handler = efl_add(EFL_LOOP_HANDLER_CLASS, obj, efl_loop_handler_fd_set(efl_added, pd->fd.out), @@ -634,8 +634,10 @@ _efl_thread_efl_task_run(Eo *obj, Efl_Thread_Data *pd) 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); + if (fcntl(thdat->fd.out, F_SETFL, O_NONBLOCK) < 0) + ERR("can't set pipe to NONBLOCK"); + if (fcntl(pd->fd.in, F_SETFL, O_NONBLOCK) < 0) + ERR("can't set pipe to NONBLOCK"); pd->fd.in_handler = efl_add(EFL_LOOP_HANDLER_CLASS, obj, efl_loop_handler_fd_set(efl_added, pd->fd.in), @@ -682,10 +684,14 @@ _efl_thread_efl_task_run(Eo *obj, Efl_Thread_Data *pd) 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); + if (fcntl(thdat->ctrl.in, F_SETFL, O_NONBLOCK) < 0) + ERR("can't set pipe to NONBLOCK"); + if (fcntl(thdat->ctrl.out, F_SETFL, O_NONBLOCK) < 0) + ERR("can't set pipe to NONBLOCK"); + if (fcntl(pd->ctrl.in, F_SETFL, O_NONBLOCK) < 0) + ERR("can't set pipe to NONBLOCK"); + if (fcntl(pd->ctrl.out, F_SETFL, O_NONBLOCK) < 0) + ERR("can't set pipe to 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); @@ -721,24 +727,23 @@ _efl_thread_efl_task_run(Eo *obj, Efl_Thread_Data *pd) 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? - } + { + Eina_Accessor *acc; + int i = 0; + const char *argv; + + acc = efl_core_command_line_command_access(obj); + if (acc) + { + thdat->argv = eina_array_new(1); + EINA_ACCESSOR_FOREACH(acc, i, argv) + { + eina_array_push(thdat->argv, eina_stringshare_add(argv)); + } + } + + } + if (pd->event_cb) { num = 0; @@ -754,9 +759,8 @@ _efl_thread_efl_task_run(Eo *obj, Efl_Thread_Data *pd) 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); + while (eina_array_count(thdat->argv)) eina_stringshare_del(eina_array_pop(thdat->argv)); + eina_array_free(thdat->argv); efl_del(pd->fd.in_handler); efl_del(pd->fd.out_handler); efl_del(pd->ctrl.in_handler); @@ -888,7 +892,7 @@ _efl_thread_efl_io_reader_can_read_set(Eo *obj, Efl_Thread_Data *pd, Eina_Bool c 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); + efl_event_callback_call(obj, EFL_IO_READER_EVENT_CAN_READ_CHANGED, &can_read); } EOLIAN static Eina_Bool @@ -982,7 +986,7 @@ _efl_thread_efl_io_writer_can_write_set(Eo *obj, Efl_Thread_Data *pd, Eina_Bool 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); + efl_event_callback_call(obj, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, &can_write); } EOLIAN static Eina_Bool diff --git a/src/lib/ecore/efl_thread.eo b/src/lib/ecore/efl_thread.eo index aedc0c2dec..b935077d8e 100644 --- a/src/lib/ecore/efl_thread.eo +++ b/src/lib/ecore/efl_thread.eo @@ -1,4 +1,4 @@ -class Efl.Thread extends Efl.Task implements Efl.ThreadIO +class @beta Efl.Thread extends Efl.Task implements Efl.ThreadIO, Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer, Efl.Core.Command_Line { methods { } diff --git a/src/lib/ecore/efl_threadio.eo b/src/lib/ecore/efl_threadio.eo index 1d3af45cdc..2049ad86d6 100644 --- a/src/lib/ecore/efl_threadio.eo +++ b/src/lib/ecore/efl_threadio.eo @@ -1,13 +1,13 @@ import efl_object; -function EFlThreadIOCall { +function @beta EFlThreadIOCall { [[ A Function to call on the "other end" of a thread obvject ]] params { @cref event: Efl.Event; [[ ]] } }; -function EFlThreadIOCallSync { +function @beta EFlThreadIOCallSync { [[ A Function to call on the "other end" of a thread obvject ]] params { @cref event: Efl.Event; [[ ]] @@ -15,7 +15,7 @@ function EFlThreadIOCallSync { return: void_ptr; [[ ]] }; -mixin Efl.ThreadIO +mixin @beta Efl.ThreadIO { [[ ]] methods { diff --git a/src/lib/ecore/efl_model_view.c b/src/lib/ecore/efl_view_model.c similarity index 62% rename from src/lib/ecore/efl_model_view.c rename to src/lib/ecore/efl_view_model.c index 855eb17272..7bb9a34673 100644 --- a/src/lib/ecore/efl_model_view.c +++ b/src/lib/ecore/efl_view_model.c @@ -9,22 +9,22 @@ #include "ecore_internal.h" -#include "efl_model_composite_private.h" +#include "efl_composite_model_private.h" -typedef struct _Efl_Model_View_Data Efl_Model_View_Data; -typedef struct _Efl_Model_View_Bind Efl_Model_View_Bind; -typedef struct _Efl_Model_View_Logic Efl_Model_View_Logic; -typedef struct _Efl_Model_View_Property_Ref Efl_Model_View_Property_Ref; +typedef struct _Efl_View_Model_Data Efl_View_Model_Data; +typedef struct _Efl_View_Model_Bind Efl_View_Model_Bind; +typedef struct _Efl_View_Model_Logic Efl_View_Model_Logic; +typedef struct _Efl_View_Model_Property_Ref Efl_View_Model_Property_Ref; -struct _Efl_Model_View_Data +struct _Efl_View_Model_Data { // FIXME: If parent is set, always access parent... recursively? - Efl_Model_View_Data *parent; + Efl_View_Model_Data *parent; - Eina_Hash *bound; // Stringhash of Efl_Model_View_Bind - Eina_Hash *logics; // Stringhash of Efl_Model_View_Logic + Eina_Hash *bound; // Stringhash of Efl_View_Model_Bind + Eina_Hash *logics; // Stringhash of Efl_View_Model_Logic - Eina_Hash *deduplication; // Stringhash of Efl_Model_View_Property_Ref + Eina_Hash *deduplication; // Stringhash of Efl_View_Model_Property_Ref struct { Eina_Bool property_changed : 1; @@ -35,21 +35,21 @@ struct _Efl_Model_View_Data Eina_Bool children_bind : 1; // Define if child object should be automatically binded }; -struct _Efl_Model_View_Bind +struct _Efl_View_Model_Bind { Eina_Stringshare *source; Eina_List *destinations; }; -struct _Efl_Model_View_Logic +struct _Efl_View_Model_Logic { struct { - EflModelViewPropertyGet fct; + EflViewModelPropertyGet fct; Eina_Free_Cb free_cb; void *data; } get; struct { - EflModelViewPropertySet fct; + EflViewModelPropertySet fct; Eina_Free_Cb free_cb; void *data; } set; @@ -59,7 +59,7 @@ struct _Efl_Model_View_Logic Eina_Stringshare *property; }; -struct _Efl_Model_View_Property_Ref +struct _Efl_View_Model_Property_Ref { EINA_REFCOUNT; Eina_Stringshare *property; @@ -68,21 +68,21 @@ struct _Efl_Model_View_Property_Ref static void _ref_free(void *data) { - Efl_Model_View_Property_Ref *r = data; + Efl_View_Model_Property_Ref *r = data; eina_stringshare_del(r->property); free(r); } static void -_ref_add(Efl_Model_View_Data *pd, Eina_Stringshare *property) +_ref_add(Efl_View_Model_Data *pd, Eina_Stringshare *property) { - Efl_Model_View_Property_Ref *r; + Efl_View_Model_Property_Ref *r; r = eina_hash_find(pd->deduplication, property); if (!r) { - r = calloc(1, sizeof (Efl_Model_View_Property_Ref)); + r = calloc(1, sizeof (Efl_View_Model_Property_Ref)); if (!r) return ; r->property = eina_stringshare_ref(property); @@ -93,9 +93,9 @@ _ref_add(Efl_Model_View_Data *pd, Eina_Stringshare *property) } static void -_ref_del(Efl_Model_View_Data *pd, Eina_Stringshare *property) +_ref_del(Efl_View_Model_Data *pd, Eina_Stringshare *property) { - Efl_Model_View_Property_Ref *r; + Efl_View_Model_Property_Ref *r; r = eina_hash_find(pd->deduplication, property); if (!r) return ; @@ -107,14 +107,14 @@ _ref_del(Efl_Model_View_Data *pd, Eina_Stringshare *property) static void _logic_free(void *data) { - Efl_Model_View_Logic *logic = data; + Efl_View_Model_Logic *logic = data; Eina_Stringshare *source; if (logic->get.free_cb) logic->get.free_cb(logic->get.data); if (logic->set.free_cb) logic->set.free_cb(logic->set.data); EINA_LIST_FREE(logic->sources, source) { - efl_model_view_property_unbind(logic->object, source, logic->property); + efl_view_model_property_unbind(logic->object, source, logic->property); eina_stringshare_del(source); } eina_stringshare_del(logic->property); @@ -122,30 +122,30 @@ _logic_free(void *data) } static Eina_Value * -_efl_model_view_property_dummy_get(void *data EINA_UNUSED, - const Efl_Model_View *model_view EINA_UNUSED, +_efl_view_model_property_dummy_get(void *data EINA_UNUSED, + const Efl_View_Model *view_model EINA_UNUSED, Eina_Stringshare *property EINA_UNUSED) { return eina_value_error_new(EFL_MODEL_ERROR_NOT_SUPPORTED); } static Eina_Future * -_efl_model_view_property_dummy_set(void *data EINA_UNUSED, - Efl_Model_View *model_view, +_efl_view_model_property_dummy_set(void *data EINA_UNUSED, + Efl_View_Model *view_model, Eina_Stringshare *property EINA_UNUSED, Eina_Value *value EINA_UNUSED) { - return efl_loop_future_rejected(model_view, EFL_MODEL_ERROR_READ_ONLY); + return efl_loop_future_rejected(view_model, EFL_MODEL_ERROR_READ_ONLY); } static Eina_Error -_efl_model_view_property_logic_add(Eo *obj, Efl_Model_View_Data *pd, +_efl_view_model_property_logic_add(Eo *obj, Efl_View_Model_Data *pd, const char *property, - void *get_data, EflModelViewPropertyGet get, Eina_Free_Cb get_free_cb, - void *set_data, EflModelViewPropertySet set, Eina_Free_Cb set_free_cb, + void *get_data, EflViewModelPropertyGet get, Eina_Free_Cb get_free_cb, + void *set_data, EflViewModelPropertySet set, Eina_Free_Cb set_free_cb, Eina_Iterator *bound) { - Efl_Model_View_Logic *logic; + Efl_View_Model_Logic *logic; Eina_Stringshare *prop; const char *source; @@ -157,15 +157,15 @@ _efl_model_view_property_logic_add(Eo *obj, Efl_Model_View_Data *pd, return EFL_MODEL_ERROR_INCORRECT_VALUE; } - logic = calloc(1, sizeof (Efl_Model_View_Logic)); + logic = calloc(1, sizeof (Efl_View_Model_Logic)); if (!logic) return ENOMEM; logic->object = obj; logic->property = prop; - logic->get.fct = get ? get : _efl_model_view_property_dummy_get; + logic->get.fct = get ? get : _efl_view_model_property_dummy_get; logic->get.free_cb = get_free_cb; logic->get.data = get_data; - logic->set.fct = set ? set : _efl_model_view_property_dummy_set; + logic->set.fct = set ? set : _efl_view_model_property_dummy_set; logic->set.free_cb = set_free_cb; logic->set.data = set_data; @@ -174,17 +174,17 @@ _efl_model_view_property_logic_add(Eo *obj, Efl_Model_View_Data *pd, EINA_ITERATOR_FOREACH(bound, source) { logic->sources = eina_list_append(logic->sources, eina_stringshare_add(source)); - efl_model_view_property_bind(obj, source, property); + efl_view_model_property_bind(obj, source, property); } return 0; } static Eina_Error -_efl_model_view_property_logic_del(Eo *obj EINA_UNUSED, Efl_Model_View_Data *pd, +_efl_view_model_property_logic_del(Eo *obj EINA_UNUSED, Efl_View_Model_Data *pd, const char *property) { - Efl_Model_View_Logic *logic; + Efl_View_Model_Logic *logic; logic = eina_hash_find(pd->logics, property); if (!logic) return EFL_MODEL_ERROR_INCORRECT_VALUE; @@ -193,10 +193,10 @@ _efl_model_view_property_logic_del(Eo *obj EINA_UNUSED, Efl_Model_View_Data *pd, } static void -_efl_model_view_property_bind(Eo *obj EINA_UNUSED, Efl_Model_View_Data *pd, +_efl_view_model_property_bind(Eo *obj EINA_UNUSED, Efl_View_Model_Data *pd, const char *source, const char *destination) { - Efl_Model_View_Bind *bind; + Efl_View_Model_Bind *bind; Eina_Stringshare *src; Eina_Stringshare *dst; @@ -206,7 +206,7 @@ _efl_model_view_property_bind(Eo *obj EINA_UNUSED, Efl_Model_View_Data *pd, bind = eina_hash_find(pd->bound, src); if (!bind) { - bind = calloc(1, sizeof (Efl_Model_View_Bind)); + bind = calloc(1, sizeof (Efl_View_Model_Bind)); if (!bind) goto on_error; bind->source = eina_stringshare_ref(src); @@ -222,10 +222,10 @@ _efl_model_view_property_bind(Eo *obj EINA_UNUSED, Efl_Model_View_Data *pd, } static void -_efl_model_view_property_unbind(Eo *obj EINA_UNUSED, Efl_Model_View_Data *pd, +_efl_view_model_property_unbind(Eo *obj EINA_UNUSED, Efl_View_Model_Data *pd, const char *source, const char *destination) { - Efl_Model_View_Bind *bind; + Efl_View_Model_Bind *bind; Eina_Stringshare *src; Eina_Stringshare *dst; Eina_Stringshare *cmp; @@ -258,7 +258,7 @@ _efl_model_view_property_unbind(Eo *obj EINA_UNUSED, Efl_Model_View_Data *pd, static void _bind_free(void *data) { - Efl_Model_View_Bind *bind = data; + Efl_View_Model_Bind *bind = data; Eina_Stringshare *dst; eina_stringshare_del(bind->source); @@ -269,20 +269,20 @@ _bind_free(void *data) free(bind); } -static Efl_Model_View_Bind * -_efl_model_view_property_bind_lookup(Efl_Model_View_Data *pd, Eina_Stringshare *src) +static Efl_View_Model_Bind * +_efl_view_model_property_bind_lookup(Efl_View_Model_Data *pd, Eina_Stringshare *src) { - Efl_Model_View_Bind *bind; + Efl_View_Model_Bind *bind; bind = eina_hash_find(pd->bound, src); - if (!bind && pd->parent) return _efl_model_view_property_bind_lookup(pd->parent, src); + if (!bind && pd->parent) return _efl_view_model_property_bind_lookup(pd->parent, src); return bind; } static void -_efl_model_view_property_changed(void *data, const Efl_Event *event) +_efl_view_model_property_changed(void *data, const Efl_Event *event) { - Efl_Model_View_Data *pd = data; + Efl_View_Model_Data *pd = data; Efl_Model_Property_Event *ev = event->info; Efl_Model_Property_Event nev = { 0 }; const char *property; @@ -300,12 +300,12 @@ _efl_model_view_property_changed(void *data, const Efl_Event *event) EINA_ARRAY_ITER_NEXT(ev->changed_properties, i, property, iterator) { - Efl_Model_View_Bind *bind; + Efl_View_Model_Bind *bind; eina_array_push(nev.changed_properties, property); - src = eina_stringshare_add(property); - bind = _efl_model_view_property_bind_lookup(pd, src); + src = eina_stringshare_ref(property); + bind = _efl_view_model_property_bind_lookup(pd, src); if (bind) { Eina_Stringshare *dest; @@ -324,7 +324,7 @@ _efl_model_view_property_changed(void *data, const Efl_Event *event) } static void -_efl_model_view_children_bind_set(Eo *obj EINA_UNUSED, Efl_Model_View_Data *pd, Eina_Bool enable) +_efl_view_model_children_bind_set(Eo *obj EINA_UNUSED, Efl_View_Model_Data *pd, Eina_Bool enable) { if (pd->finalized) return; @@ -332,46 +332,46 @@ _efl_model_view_children_bind_set(Eo *obj EINA_UNUSED, Efl_Model_View_Data *pd, } static Eina_Bool -_efl_model_view_children_bind_get(const Eo *obj EINA_UNUSED, Efl_Model_View_Data *pd) +_efl_view_model_children_bind_get(const Eo *obj EINA_UNUSED, Efl_View_Model_Data *pd) { return pd->children_bind; } static void -_efl_model_view_parent_data(Efl_Model_View *child, Efl_Model_View_Data *ppd) +_efl_view_model_parent_data(Efl_View_Model *child, Efl_View_Model_Data *ppd) { - Efl_Model_View_Data *cpd; + Efl_View_Model_Data *cpd; - cpd = efl_data_scope_get(child, EFL_MODEL_VIEW_CLASS); + cpd = efl_data_scope_get(child, EFL_VIEW_MODEL_CLASS); cpd->parent = ppd; cpd->propagating = ppd->propagating; } -static Efl_Model_View * -_efl_model_view_child_lookup(Efl_Model_View_Data *pd, Efl_Object *parent, Efl_Model *view) +static Efl_View_Model * +_efl_view_model_child_lookup(Efl_View_Model_Data *pd, Efl_Object *parent, Efl_Model *view) { - Efl_Model_View *co; + Efl_View_Model *co; - co = efl_key_wref_get(view, "_efl.model_view"); + co = efl_key_wref_get(view, "_efl.view_model"); if (co) return co; - co = efl_add(EFL_MODEL_VIEW_CLASS, parent, + co = efl_add(EFL_VIEW_MODEL_CLASS, parent, efl_ui_view_model_set(efl_added, view), - _efl_model_view_parent_data(efl_added, pd)); + _efl_view_model_parent_data(efl_added, pd)); if (!co) return NULL; - efl_key_wref_set(view, "_efl.model_view", co); + efl_key_wref_set(view, "_efl.view_model", co); return co; } static void -_efl_model_view_child_added(void *data, const Efl_Event *event) +_efl_view_model_child_added(void *data, const Efl_Event *event) { Efl_Model_Children_Event *ev = event->info; Efl_Model_Children_Event nevt = { 0 }; - Efl_Model_View_Data *pd = data; - Efl_Model_View *co; + Efl_View_Model_Data *pd = data; + Efl_View_Model *co; if (pd->propagating.child_added) return ; if (!pd->children_bind) return; @@ -382,7 +382,7 @@ _efl_model_view_child_added(void *data, const Efl_Event *event) // Our strategy is to rebuild a new Child_Add and cancel the current one. efl_event_callback_stop(event->object); - co = _efl_model_view_child_lookup(pd, event->object, ev->child); + co = _efl_view_model_child_lookup(pd, event->object, ev->child); if (!co) return; nevt.index = ev->index; @@ -394,12 +394,12 @@ _efl_model_view_child_added(void *data, const Efl_Event *event) } static void -_efl_model_view_child_removed(void *data, const Efl_Event *event) +_efl_view_model_child_removed(void *data, const Efl_Event *event) { Efl_Model_Children_Event *ev = event->info; Efl_Model_Children_Event nevt = { 0 }; - Efl_Model_View_Data *pd = data; - Efl_Model_View *co; + Efl_View_Model_Data *pd = data; + Efl_View_Model *co; if (pd->propagating.child_removed) return ; if (!pd->children_bind) return; @@ -410,7 +410,7 @@ _efl_model_view_child_removed(void *data, const Efl_Event *event) // Our strategy is to rebuild a new Child_Add and cancel the current one. efl_event_callback_stop(event->object); - co = _efl_model_view_child_lookup(pd, event->object, ev->child); + co = _efl_view_model_child_lookup(pd, event->object, ev->child); if (!co) return; nevt.index = ev->index; @@ -418,44 +418,44 @@ _efl_model_view_child_removed(void *data, const Efl_Event *event) efl_event_callback_call(event->object, EFL_MODEL_EVENT_CHILD_REMOVED, &nevt); - // The object is being destroyed, there is no point in us keeping the ModelView proxy alive. + // The object is being destroyed, there is no point in us keeping the ViewModel proxy alive. efl_del(co); pd->propagating.child_removed = EINA_FALSE; } -EFL_CALLBACKS_ARRAY_DEFINE(efl_model_view_intercept, - { EFL_MODEL_EVENT_PROPERTIES_CHANGED, _efl_model_view_property_changed }, - { EFL_MODEL_EVENT_CHILD_ADDED, _efl_model_view_child_added }, - { EFL_MODEL_EVENT_CHILD_REMOVED, _efl_model_view_child_removed }) +EFL_CALLBACKS_ARRAY_DEFINE(efl_view_model_intercept, + { EFL_MODEL_EVENT_PROPERTIES_CHANGED, _efl_view_model_property_changed }, + { EFL_MODEL_EVENT_CHILD_ADDED, _efl_view_model_child_added }, + { EFL_MODEL_EVENT_CHILD_REMOVED, _efl_view_model_child_removed }) static Efl_Object * -_efl_model_view_efl_object_constructor(Eo *obj, Efl_Model_View_Data *pd) +_efl_view_model_efl_object_constructor(Eo *obj, Efl_View_Model_Data *pd) { - obj = efl_constructor(efl_super(obj, EFL_MODEL_VIEW_CLASS)); + obj = efl_constructor(efl_super(obj, EFL_VIEW_MODEL_CLASS)); pd->children_bind = EINA_TRUE; pd->bound = eina_hash_stringshared_new(_bind_free); pd->logics = eina_hash_stringshared_new(_logic_free); pd->deduplication = eina_hash_stringshared_new(_ref_free); - efl_event_callback_array_priority_add(obj, efl_model_view_intercept(), EFL_CALLBACK_PRIORITY_BEFORE, pd); + efl_event_callback_array_priority_add(obj, efl_view_model_intercept(), EFL_CALLBACK_PRIORITY_BEFORE, pd); return obj; } static Efl_Object * -_efl_model_view_efl_object_finalize(Eo *obj, Efl_Model_View_Data *pd) +_efl_view_model_efl_object_finalize(Eo *obj, Efl_View_Model_Data *pd) { pd->finalized = EINA_TRUE; - return efl_finalize(efl_super(obj, EFL_MODEL_VIEW_CLASS)); + return efl_finalize(efl_super(obj, EFL_VIEW_MODEL_CLASS)); } static void -_efl_model_view_efl_object_destructor(Eo *obj, Efl_Model_View_Data *pd) +_efl_view_model_efl_object_destructor(Eo *obj, Efl_View_Model_Data *pd) { - efl_event_callback_array_del(obj, efl_model_view_intercept(), pd); + efl_event_callback_array_del(obj, efl_view_model_intercept(), pd); eina_hash_free(pd->bound); pd->bound = NULL; @@ -463,78 +463,78 @@ _efl_model_view_efl_object_destructor(Eo *obj, Efl_Model_View_Data *pd) eina_hash_free(pd->logics); pd->logics = NULL; - efl_destructor(efl_super(obj, EFL_MODEL_VIEW_CLASS)); + efl_destructor(efl_super(obj, EFL_VIEW_MODEL_CLASS)); } -static Efl_Model_View_Logic * -_efl_model_view_property_logic_lookup(Efl_Model_View_Data *pd, Eina_Stringshare *property) +static Efl_View_Model_Logic * +_efl_view_model_property_logic_lookup(Efl_View_Model_Data *pd, Eina_Stringshare *property) { - Efl_Model_View_Logic *logic; + Efl_View_Model_Logic *logic; if (!pd) return NULL; logic = eina_hash_find(pd->logics, property); - if (!logic) return _efl_model_view_property_logic_lookup(pd->parent, property); + if (!logic) return _efl_view_model_property_logic_lookup(pd->parent, property); return logic; } static Eina_Future * -_efl_model_view_efl_model_property_set(Eo *obj, Efl_Model_View_Data *pd, +_efl_view_model_efl_model_property_set(Eo *obj, Efl_View_Model_Data *pd, const char *property, Eina_Value *value) { - Efl_Model_View_Logic *logic; + Efl_View_Model_Logic *logic; Eina_Stringshare *prop; Eina_Future *f; prop = eina_stringshare_add(property); - logic = _efl_model_view_property_logic_lookup(pd, prop); + logic = _efl_view_model_property_logic_lookup(pd, prop); if (logic) f = logic->set.fct(logic->get.data, obj, prop, value); else - f = efl_model_property_set(efl_super(obj, EFL_MODEL_VIEW_CLASS), property, value); + f = efl_model_property_set(efl_super(obj, EFL_VIEW_MODEL_CLASS), property, value); eina_stringshare_del(prop); return f; } static Eina_Value * -_efl_model_view_efl_model_property_get(const Eo *obj, Efl_Model_View_Data *pd, +_efl_view_model_efl_model_property_get(const Eo *obj, Efl_View_Model_Data *pd, const char *property) { - Efl_Model_View_Logic *logic; + Efl_View_Model_Logic *logic; Eina_Stringshare *prop; Eina_Value *r; prop = eina_stringshare_add(property); - logic = _efl_model_view_property_logic_lookup(pd, prop); + logic = _efl_view_model_property_logic_lookup(pd, prop); if (logic) r = logic->get.fct(logic->get.data, obj, prop); else - r = efl_model_property_get(efl_super(obj, EFL_MODEL_VIEW_CLASS), property); + r = efl_model_property_get(efl_super(obj, EFL_VIEW_MODEL_CLASS), property); eina_stringshare_del(prop); return r; } static Eina_Iterator * -_efl_model_view_efl_model_properties_get(const Eo *obj, Efl_Model_View_Data *pd) +_efl_view_model_efl_model_properties_get(const Eo *obj, Efl_View_Model_Data *pd) { - EFL_MODEL_COMPOSITE_PROPERTIES_SUPER(props, obj, EFL_MODEL_VIEW_CLASS, + EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(props, obj, EFL_VIEW_MODEL_CLASS, eina_hash_iterator_key_new(pd->deduplication)); return props; } -typedef struct _Efl_Model_View_Slice_Request Efl_Model_View_Slice_Request; -struct _Efl_Model_View_Slice_Request +typedef struct _Efl_View_Model_Slice_Request Efl_View_Model_Slice_Request; +struct _Efl_View_Model_Slice_Request { - Efl_Model_View_Data *pd; + Efl_View_Model_Data *pd; unsigned int start; }; static Eina_Value -_efl_model_view_slice_then(Eo *o, void *data, const Eina_Value v) +_efl_view_model_slice_then(Eo *o, void *data, const Eina_Value v) { - Efl_Model_View_Slice_Request *req = data; + Efl_View_Model_Slice_Request *req = data; Eo *target; Eina_Value r = EINA_VALUE_EMPTY; unsigned int i, len; @@ -545,7 +545,7 @@ _efl_model_view_slice_then(Eo *o, void *data, const Eina_Value v) { Eo *composite; - composite = _efl_model_view_child_lookup(req->pd, o, target); + composite = _efl_view_model_child_lookup(req->pd, o, target); eina_value_array_append(&r, composite); } @@ -553,21 +553,21 @@ _efl_model_view_slice_then(Eo *o, void *data, const Eina_Value v) } static void -_efl_model_view_slice_clean(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED) +_efl_view_model_slice_clean(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED) { free(data); } static Eina_Future * -_efl_model_view_efl_model_children_slice_get(Eo *obj, Efl_Model_View_Data *pd, +_efl_view_model_efl_model_children_slice_get(Eo *obj, Efl_View_Model_Data *pd, unsigned int start, unsigned int count) { - Efl_Model_View_Slice_Request *req; + Efl_View_Model_Slice_Request *req; Eina_Future *f; - f = efl_model_children_slice_get(efl_super(obj, EFL_MODEL_VIEW_CLASS), start, count); + f = efl_model_children_slice_get(efl_super(obj, EFL_VIEW_MODEL_CLASS), start, count); - req = malloc(sizeof (Efl_Model_View_Slice_Request)); + req = malloc(sizeof (Efl_View_Model_Slice_Request)); if (!req) { eina_future_cancel(f); @@ -578,9 +578,9 @@ _efl_model_view_efl_model_children_slice_get(Eo *obj, Efl_Model_View_Data *pd, req->start = start; return efl_future_then(obj, f, .success_type = EINA_VALUE_TYPE_ARRAY, - .success = _efl_model_view_slice_then, - .free = _efl_model_view_slice_clean, + .success = _efl_view_model_slice_then, + .free = _efl_view_model_slice_clean, .data = req); } -#include "efl_model_view.eo.c" +#include "efl_view_model.eo.c" diff --git a/src/lib/ecore/efl_model_view.eo b/src/lib/ecore/efl_view_model.eo similarity index 87% rename from src/lib/ecore/efl_model_view.eo rename to src/lib/ecore/efl_view_model.eo index ccfa354346..d7092b3b7a 100644 --- a/src/lib/ecore/efl_model_view.eo +++ b/src/lib/ecore/efl_view_model.eo @@ -1,23 +1,23 @@ -function EflModelViewPropertyGet { +function @beta EflViewModelPropertyGet { [[Function called when a property is get.]] params { - @in model_view: const(Efl.Model_View); [[The ModelView object the @.property.get is issued on.]] + @in view_model: const(Efl.View_Model); [[The ViewModel object the @.property.get is issued on.]] @in property: stringshare; [[The property name the @.property.get is issued on.]] } return: any_value_ptr; [[The property value.]] }; -function EflModelViewPropertySet { +function @beta EflViewModelPropertySet { [[Function called when a property is set.]] params { - @in model_view: Efl.Model_View; [[The ModelView object the @.property.set is issued on.]] + @in view_model: Efl.View_Model; [[The ViewModel object the @.property.set is issued on.]] @in property: stringshare; [[The property name the @.property.set is issued on.]] @in value: any_value_ptr @owned; [[The new value to set.]] } return: future; [[The value that was finally set.]] }; -class Efl.Model_View extends Efl.Model_Composite +class @beta Efl.View_Model extends Efl.Composite_Model { [[Efl model providing helpers for custom properties used when linking a model to a view and you need to generate/adapt values for display. @@ -34,8 +34,8 @@ class Efl.Model_View extends Efl.Model_Composite ]] params { property: string; [[The property to bind on to.]] - get: EflModelViewPropertyGet; [[Define the get callback called when the @Efl.Model.property.get is called with the above property name.]] - set: EflModelViewPropertySet; [[Define the set callback called when the @Efl.Model.property.set is called with the above property name.]] + get: EflViewModelPropertyGet; [[Define the get callback called when the @Efl.Model.property.get is called with the above property name.]] + set: EflViewModelPropertySet; [[Define the set callback called when the @Efl.Model.property.set is called with the above property name.]] binded: iterator; [[Iterator of property name to bind with this defined property see @.property_bind.]] } return: Eina.Error; @@ -60,7 +60,7 @@ class Efl.Model_View extends Efl.Model_Composite ]] params { @in source: string; [[Property name in the composited model.]] - @in destination: string; [[Property name in the @Efl.Model_View]] + @in destination: string; [[Property name in the @Efl.View_Model]] } } property_unbind { @@ -70,12 +70,12 @@ class Efl.Model_View extends Efl.Model_Composite ]] params { @in source: string; [[Property name in the composited model.]] - @in destination: string; [[Property name in the @Efl.Model_View]] + @in destination: string; [[Property name in the @Efl.View_Model]] } } @property children_bind { [[Define if we will intercept all childrens object reference and - bind them through the ModelView with the same property logic as this + bind them through the ViewModel with the same property logic as this one. Be careful of recursivity. This can only be applied at construction time.]] @@ -99,6 +99,6 @@ class Efl.Model_View extends Efl.Model_Composite Efl.Model.property { set; get; } } constructors { - Efl.Model_View.children_bind; + Efl.View_Model.children_bind @optional; } } diff --git a/src/lib/ecore/meson.build b/src/lib/ecore/meson.build index 6fc4b2c38f..64d255fe73 100644 --- a/src/lib/ecore/meson.build +++ b/src/lib/ecore/meson.build @@ -2,10 +2,8 @@ ecore_deps = [intl] ecore_pub_deps = [eina, eo, efl] pub_legacy_eo_files = [ - 'ecore_exe.eo', 'ecore_event_message.eo', 'ecore_event_message_handler.eo', - 'efl_loop_timer.eo' ] pub_eo_file_target = [] @@ -21,16 +19,6 @@ foreach eo_file : pub_legacy_eo_files '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'), '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'), '-gchd', '@INPUT@']) - pub_eo_file_target += custom_target('eolian_gen_legacy_' + eo_file, - input : eo_file, - output : [eo_file + '.legacy.h'], - depfile : eo_file + '.legacy.d', - install : true, - install_dir : dir_package_include, - command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories, - '-o', 'l:' + join_paths(meson.current_build_dir(), eo_file + '.legacy.h'), - '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.legacy.d'), - '-gld', '@INPUT@']) endforeach pub_eo_files = [ @@ -67,16 +55,17 @@ pub_eo_files = [ 'efl_cubic_bezier_interpolator.eo', 'efl_loop_message_future_handler.eo', 'efl_loop_message_future.eo', - 'efl_model_loop.eo', - 'efl_model_item.eo', - 'efl_model_container.eo', - 'efl_model_container_item.eo', - 'efl_model_composite_boolean.eo', - 'efl_model_composite_boolean_children.eo', - 'efl_model_composite_selection.eo', - 'efl_model_composite_selection_children.eo', - 'efl_model_composite.eo', - 'efl_model_view.eo' + 'efl_loop_model.eo', + 'efl_generic_model.eo', + 'efl_container_model.eo', + 'efl_boolean_model.eo', + 'efl_select_model.eo', + 'efl_composite_model.eo', + 'efl_view_model.eo', + 'efl_core_env.eo', + 'efl_core_proc_env.eo', + 'efl_core_command_line.eo', + 'efl_loop_timer.eo', ] foreach eo_file : pub_eo_files @@ -93,9 +82,6 @@ foreach eo_file : pub_eo_files '-gchd', '@INPUT@']) endforeach -# special handling, because this is already eo API and legacy API -pub_eo_files += ['efl_loop_timer.eo'] - pub_eo_types_files = [] eolian_include_directories += ['-I', meson.current_source_dir()] @@ -107,7 +93,10 @@ ecore_header_src = [ 'Ecore_Eo.h', 'Efl_Core.h', 'efl_general.h', - 'Ecore_Getopt.h' + 'Ecore_Getopt.h', + 'ecore_exe_eo.h', + 'ecore_exe_eo.legacy.h', + 'efl_loop_timer_eo.legacy.h', ] ecore_src = [ @@ -146,18 +135,16 @@ ecore_src = [ 'efl_io_file.c', 'efl_io_copier.c', 'efl_io_buffered_stream.c', - 'efl_model_loop.c', - 'efl_model_item.c', - 'efl_model_container.c', - 'efl_model_container_item.c', - 'efl_model_container_private.h', - 'efl_model_composite.c', - 'efl_model_composite_boolean.c', - 'efl_model_composite_selection.c', - 'efl_model_composite_private.h', + 'efl_loop_model.c', + 'efl_generic_model.c', + 'efl_container_model.c', + 'efl_composite_model.c', + 'efl_boolean_model.c', + 'efl_select_model.c', + 'efl_composite_model_private.h', 'efl_model_accessor_view.c', 'efl_model_accessor_view_private.h', - 'efl_model_view.c', + 'efl_view_model.c', 'efl_linear_interpolator.c', 'efl_accelerate_interpolator.c', 'efl_decelerate_interpolator.c', @@ -180,8 +167,12 @@ ecore_src = [ 'ecore_main_common.h', 'efl_exe.c', 'efl_thread.c', + 'efl_appthread.c', 'efl_threadio.c', 'efl_appthread.c', + 'efl_core_env.c', + 'efl_core_proc_env.c', + 'efl_core_command_line.c', ] if sys_windows == true @@ -229,9 +220,11 @@ ecore = declare_dependency( eolian_ecore_dir = join_paths(eolian_include_dir, package_version_name) -install_data(pub_eo_files + pub_eo_types_files, - install_dir: eolian_ecore_dir -) +if get_option('install-eo-files') + install_data(pub_eo_files + pub_eo_types_files, + install_dir: eolian_ecore_dir + ) +endif install_headers(ecore_header_src, install_dir : dir_package_include, diff --git a/src/lib/ecore_audio/ecore_audio.eo b/src/lib/ecore_audio/ecore_audio.eo index c93726f800..93409d21cb 100644 --- a/src/lib/ecore_audio/ecore_audio.eo +++ b/src/lib/ecore_audio/ecore_audio.eo @@ -1,7 +1,7 @@ type @extern Ecore.Audio.Vio: __undefined_type; [[Ecore audio vio type]] /* FIXME: Had function pointer members. */ type @extern efl_key_data_free_func: __undefined_type; [[Efl key data free function type]] /* FIXME: Function pointers not allowed. */ -enum Ecore.Audio.Format { +enum @beta Ecore.Audio.Format { [[Ecore audio format type]] auto, [[Automatically detect the format (for inputs)]] raw, [[RAW samples (float)]] @@ -12,7 +12,7 @@ enum Ecore.Audio.Format { last [[Sentinel value to indicate last enum field during iteration]] } -abstract Ecore.Audio extends Efl.Object +abstract @beta Ecore.Audio extends Efl.Object { [[Convenience audio class.]] @@ -21,8 +21,6 @@ abstract Ecore.Audio extends Efl.Object methods { @property paused { [[Pauses state of the object - - @since 1.8 ]] set { } @@ -34,8 +32,6 @@ abstract Ecore.Audio extends Efl.Object } @property volume { [[Volume of the object - - @since 1.8 ]] set { } @@ -51,8 +47,6 @@ abstract Ecore.Audio extends Efl.Object What sources are supported depends on the actual object. For example, the libsndfile class accepts WAV, OGG, FLAC files as source. - - @since 1.8 ]] set { return: bool; [[$true if the source was set correctly (i.e. the file @@ -71,8 +65,6 @@ abstract Ecore.Audio extends Efl.Object What formats are supported depends on the actual object. Default is ECORE_AUDIO_FORMAT_AUTO - - @since 1.8 ]] return: bool; [[$true if the format was supported, $false otherwise]] } @@ -81,8 +73,6 @@ abstract Ecore.Audio extends Efl.Object After setting the source if the format was ECORE_AUDIO_FORMAT_AUTO this function will now return the actual format. - - @since 1.8 ]] } values { @@ -91,8 +81,6 @@ abstract Ecore.Audio extends Efl.Object } vio_set @pure_virtual { [[Sets the virtual IO functions - - @since 1.8 ]] params { vio: ptr(Ecore.Audio.Vio); [[The @Ecore.Audio.Vio struct with diff --git a/src/lib/ecore_audio/ecore_audio_in.eo b/src/lib/ecore_audio/ecore_audio_in.eo index 9b79e62ddd..bbee8e1910 100644 --- a/src/lib/ecore_audio/ecore_audio_in.eo +++ b/src/lib/ecore_audio/ecore_audio_in.eo @@ -1,4 +1,4 @@ -class Ecore.Audio.In extends Ecore.Audio +class @beta Ecore.Audio.In extends Ecore.Audio { [[Ecore Audio input object.]] eo_prefix: ecore_audio_obj_in; @@ -7,8 +7,6 @@ class Ecore.Audio.In extends Ecore.Audio methods { @property speed { [[Playback speed of the input. - - @since 1.8 ]] set { } @@ -20,8 +18,6 @@ class Ecore.Audio.In extends Ecore.Audio } @property samplerate { [[Sample-rate of the input - - @since 1.8 ]] set { } @@ -33,8 +29,6 @@ class Ecore.Audio.In extends Ecore.Audio } @property channels { [[Amount of channels the input has - - @since 1.8 ]] set { } @@ -46,8 +40,6 @@ class Ecore.Audio.In extends Ecore.Audio } @property preloaded { [[Preloaded state of the input - - @since 1.8 ]] set { } @@ -63,8 +55,6 @@ class Ecore.Audio.In extends Ecore.Audio If the input is looped and reaches the end it will start from the beginning again. At the same time the event \@ref ECORE_AUDIO_EV_IN_LOOPED will be emitted - - @since 1.8 ]] set { } @@ -79,8 +69,6 @@ class Ecore.Audio.In extends Ecore.Audio This function is only implemented by some classes (i.e. ECORE_AUDIO_OBJ_IN_TONE_CLASS) - - @since 1.8 ]] set { } @@ -93,8 +81,6 @@ class Ecore.Audio.In extends Ecore.Audio @property output { get { [[Gets the output that this input is attached to - - @since 1.8 ]] } values { @@ -104,8 +90,6 @@ class Ecore.Audio.In extends Ecore.Audio @property remaining { get { [[Gets the remaining time of the input - - @since 1.8 ]] } values { @@ -114,8 +98,6 @@ class Ecore.Audio.In extends Ecore.Audio } read { [[Reads from the input - - @since 1.8 ]] return: ssize; [[The amount of samples written to buf]] params { @@ -125,8 +107,6 @@ class Ecore.Audio.In extends Ecore.Audio } read_internal { [[Internal read function - - @since 1.8 ]] return: ssize; [[The amount of samples written to buf]] params { @@ -136,8 +116,6 @@ class Ecore.Audio.In extends Ecore.Audio } seek { [[Seeks within the input - - @since 1.8 ]] return: double; [[The current absolute position in seconds within the input]] @@ -156,6 +134,8 @@ class Ecore.Audio.In extends Ecore.Audio @empty .length {set;} @empty .preloaded {set; get;} @empty .seek; + @empty Ecore.Audio.source {set; get;} + @empty Ecore.Audio.format {set; get;} } events { in,looped: void; [[Called when an input has looped.]] diff --git a/src/lib/ecore_audio/ecore_audio_in_sndfile.eo b/src/lib/ecore_audio/ecore_audio_in_sndfile.eo index 76aeb42f51..cb1476029c 100644 --- a/src/lib/ecore_audio/ecore_audio_in_sndfile.eo +++ b/src/lib/ecore_audio/ecore_audio_in_sndfile.eo @@ -1,4 +1,4 @@ -class Ecore.Audio.In.Sndfile extends Ecore.Audio.In +class @beta Ecore.Audio.In.Sndfile extends Ecore.Audio.In { [[Ecore Audio sndfile input.]] eo_prefix: ecore_audio_obj_in_sndfile; diff --git a/src/lib/ecore_audio/ecore_audio_in_tone.eo b/src/lib/ecore_audio/ecore_audio_in_tone.eo index 8e6e3d48e6..0fc51c13c5 100644 --- a/src/lib/ecore_audio/ecore_audio_in_tone.eo +++ b/src/lib/ecore_audio/ecore_audio_in_tone.eo @@ -1,4 +1,4 @@ -class Ecore.Audio.In.Tone extends Ecore.Audio.In +class @beta Ecore.Audio.In.Tone extends Ecore.Audio.In { [[Ecore Audio tone input.]] eo_prefix: ecore_audio_obj_in_tone; diff --git a/src/lib/ecore_audio/ecore_audio_out.eo b/src/lib/ecore_audio/ecore_audio_out.eo index 72d65d142c..f18dd8dc0e 100644 --- a/src/lib/ecore_audio/ecore_audio_out.eo +++ b/src/lib/ecore_audio/ecore_audio_out.eo @@ -1,4 +1,4 @@ -class Ecore.Audio.Out extends Ecore.Audio +abstract @beta Ecore.Audio.Out extends Ecore.Audio { [[Ecore Audio output object.]] @@ -7,8 +7,6 @@ class Ecore.Audio.Out extends Ecore.Audio methods { input_attach { [[Attaches an input to an output - - @since 1.8 ]] return: bool; [[$true if the input was attached, $false otherwise]] params { @@ -17,8 +15,6 @@ class Ecore.Audio.Out extends Ecore.Audio } input_detach { [[Detaches an input from an output - - @since 1.8 ]] return: bool; [[$true if the input was detached, $false otherwise]] params { @@ -27,8 +23,6 @@ class Ecore.Audio.Out extends Ecore.Audio } inputs_get { [[Returns the list of all attached inputs - - @since 1.8 ]] return: list; [[A list of the inputs that are attached to the output]] } diff --git a/src/lib/ecore_audio/ecore_audio_out_pulse.eo b/src/lib/ecore_audio/ecore_audio_out_pulse.eo index 6d28e7edbf..0729a752e8 100644 --- a/src/lib/ecore_audio/ecore_audio_out_pulse.eo +++ b/src/lib/ecore_audio/ecore_audio_out_pulse.eo @@ -1,4 +1,4 @@ -class Ecore.Audio.Out.Pulse extends Ecore.Audio.Out +class @beta Ecore.Audio.Out.Pulse extends Ecore.Audio.Out { [[Ecore audio ouput for PulseAudio.]] eo_prefix: ecore_audio_obj_out_pulse; @@ -7,6 +7,8 @@ class Ecore.Audio.Out.Pulse extends Ecore.Audio.Out Efl.Object.constructor; Efl.Object.destructor; Ecore.Audio.volume { set; } + @empty Ecore.Audio.format { set; get; } + @empty Ecore.Audio.source { set; get; } Ecore.Audio.Out.input_attach; Ecore.Audio.Out.input_detach; } diff --git a/src/lib/ecore_audio/ecore_audio_out_sndfile.eo b/src/lib/ecore_audio/ecore_audio_out_sndfile.eo index e5358d543b..9b57d83fa4 100644 --- a/src/lib/ecore_audio/ecore_audio_out_sndfile.eo +++ b/src/lib/ecore_audio/ecore_audio_out_sndfile.eo @@ -1,4 +1,4 @@ -class Ecore.Audio.Out.Sndfile extends Ecore.Audio.Out +class @beta Ecore.Audio.Out.Sndfile extends Ecore.Audio.Out { [[Ecore audio output to the sndfile library.]] eo_prefix: ecore_audio_obj_out_sndfile; diff --git a/src/lib/ecore_audio/ecore_audio_out_wasapi.eo b/src/lib/ecore_audio/ecore_audio_out_wasapi.eo index 00c503dd7c..ab50a980b8 100644 --- a/src/lib/ecore_audio/ecore_audio_out_wasapi.eo +++ b/src/lib/ecore_audio/ecore_audio_out_wasapi.eo @@ -1,4 +1,4 @@ -class Ecore.Audio.Out.Wasapi extends Ecore.Audio.Out +class @beta Ecore.Audio.Out.Wasapi extends Ecore.Audio.Out { [[Ecore audio ouput for WasapiAudio.]] eo_prefix: ecore_audio_obj_out_wasapi; @@ -7,6 +7,8 @@ class Ecore.Audio.Out.Wasapi extends Ecore.Audio.Out Efl.Object.constructor; Efl.Object.destructor; Ecore.Audio.volume { set;} + @empty Ecore.Audio.format { set; get; } + @empty Ecore.Audio.source { set; get; } Ecore.Audio.Out.input_attach; Ecore.Audio.Out.input_detach; } diff --git a/src/lib/ecore_audio/meson.build b/src/lib/ecore_audio/meson.build index bc3215e62c..cbcaca4931 100644 --- a/src/lib/ecore_audio/meson.build +++ b/src/lib/ecore_audio/meson.build @@ -92,9 +92,11 @@ ecore_audio = declare_dependency( dependencies: ecore_audio_pub_deps, ) -install_data(pub_eo_files + pub_eo_types_files, - install_dir: eolian_ecore_dir -) +if get_option('install-eo-files') + install_data(pub_eo_files + pub_eo_types_files, + install_dir: eolian_ecore_dir + ) +endif install_headers(ecore_audio_header_src, install_dir : dir_package_include, diff --git a/src/lib/ecore_cocoa/Ecore_Cocoa.h b/src/lib/ecore_cocoa/Ecore_Cocoa.h index e0baf8c6d2..36f17b490b 100644 --- a/src/lib/ecore_cocoa/Ecore_Cocoa.h +++ b/src/lib/ecore_cocoa/Ecore_Cocoa.h @@ -47,7 +47,7 @@ typedef struct _Ecore_Cocoa_Screen Ecore_Cocoa_Screen; /** * @typedef Ecore_Cocoa_Object - * Opaque handler to refer to an objective-c object (aka id) + * Opaque handler to refer to an objective-c object (a.k.a. id) * @since 1.18 */ typedef void Ecore_Cocoa_Object; diff --git a/src/lib/ecore_con/Ecore_Con_Eet_Eo.h b/src/lib/ecore_con/Ecore_Con_Eet_Eo.h index 52b1a4b9ed..ae751987d3 100644 --- a/src/lib/ecore_con/Ecore_Con_Eet_Eo.h +++ b/src/lib/ecore_con/Ecore_Con_Eet_Eo.h @@ -1,3 +1,3 @@ -#include "ecore_con_eet_base.eo.h" -#include "ecore_con_eet_server_obj.eo.h" -#include "ecore_con_eet_client_obj.eo.h" +#include "ecore_con_eet_base_eo.h" +#include "ecore_con_eet_server_obj_eo.h" +#include "ecore_con_eet_client_obj_eo.h" diff --git a/src/lib/ecore_con/Ecore_Con_Eet_Legacy.h b/src/lib/ecore_con/Ecore_Con_Eet_Legacy.h index 34047283c6..6bd6bf58d6 100644 --- a/src/lib/ecore_con/Ecore_Con_Eet_Legacy.h +++ b/src/lib/ecore_con/Ecore_Con_Eet_Legacy.h @@ -1,3 +1,3 @@ -#include "ecore_con_eet_base.eo.legacy.h" -#include "ecore_con_eet_client_obj.eo.legacy.h" -#include "ecore_con_eet_server_obj.eo.legacy.h" +#include "ecore_con_eet_base_eo.legacy.h" +#include "ecore_con_eet_client_obj_eo.legacy.h" +#include "ecore_con_eet_server_obj_eo.legacy.h" diff --git a/src/lib/ecore_con/ecore_con.c b/src/lib/ecore_con/ecore_con.c index d8dbd37a58..a781025d7b 100644 --- a/src/lib/ecore_con/ecore_con.c +++ b/src/lib/ecore_con/ecore_con.c @@ -38,11 +38,8 @@ # include #endif -#ifdef HAVE_WS2TCPIP_H -# include -#endif - #ifdef _WIN32 +# include # include #endif @@ -201,7 +198,7 @@ efl_net_unix_fmt(char *buf, size_t buflen, SOCKET fd, const struct sockaddr_un * int r = snprintf(buf, buflen, "unnamed:" SOCKET_FMT, fd); if (r < 0) { - ERR("snprintf(): %s", strerror(errno)); + ERR("snprintf(): %s", eina_error_msg_get(errno)); return EINA_FALSE; } else if ((size_t)r > buflen) @@ -288,13 +285,13 @@ efl_net_ip_port_parse_split(const char *host, const char *port, struct sockaddr_ if (storage->ss_family == AF_INET6) { struct sockaddr_in6 *a = (struct sockaddr_in6 *)storage; - a->sin6_port = htons(p); + a->sin6_port = eina_htons(p); x = inet_pton(AF_INET6, host, &a->sin6_addr); } else { struct sockaddr_in *a = (struct sockaddr_in *)storage; - a->sin_port = htons(p); + a->sin_port = eina_htons(p); x = inet_pton(AF_INET, host, &a->sin_addr); } @@ -313,13 +310,13 @@ efl_net_ip_port_fmt(char *buf, size_t buflen, const struct sockaddr *addr) { const struct sockaddr_in *a = (const struct sockaddr_in *)addr; mem = &a->sin_addr; - port = ntohs(a->sin_port); + port = eina_ntohs(a->sin_port); } else if (addr->sa_family == AF_INET6) { const struct sockaddr_in6 *a = (const struct sockaddr_in6 *)addr; mem = &a->sin6_addr; - port = ntohs(a->sin6_port); + port = eina_ntohs(a->sin6_port); } else { @@ -330,7 +327,7 @@ efl_net_ip_port_fmt(char *buf, size_t buflen, const struct sockaddr *addr) if (!inet_ntop(addr->sa_family, mem, p, sizeof(p))) { ERR("inet_ntop(%d, %p, %p, %zd): %s", - addr->sa_family, mem, p, sizeof(p), strerror(errno)); + addr->sa_family, mem, p, sizeof(p), eina_error_msg_get(errno)); return EINA_FALSE; } @@ -341,7 +338,7 @@ efl_net_ip_port_fmt(char *buf, size_t buflen, const struct sockaddr *addr) if (r < 0) { - ERR("could not snprintf(): %s", strerror(errno)); + ERR("could not snprintf(): %s", eina_error_msg_get(errno)); return EINA_FALSE; } else if ((size_t)r > buflen) diff --git a/src/lib/ecore_con/ecore_con_eet.c b/src/lib/ecore_con/ecore_con_eet.c index e5d07d5d9d..bd7aed5ec5 100644 --- a/src/lib/ecore_con/ecore_con_eet.c +++ b/src/lib/ecore_con/ecore_con_eet.c @@ -11,10 +11,6 @@ # endif #endif -#ifdef HAVE_ARPA_INET_H -# include -#endif - #include #include "Ecore.h" @@ -318,11 +314,11 @@ _ecore_con_eet_data(Ecore_Con_Reply *n, void *data, unsigned int size) unsigned int *tmp = data; size -= 4 * sizeof (unsigned int); - if (ntohl(tmp[0]) == ECORE_CON_EET_RAW_MAGIC) + if (eina_ntohl(tmp[0]) == ECORE_CON_EET_RAW_MAGIC) { - unsigned int protocol_length = ntohl(tmp[1]); - unsigned int section_length = ntohl(tmp[2]); - unsigned int data_length = ntohl(tmp[3]); + unsigned int protocol_length = eina_ntohl(tmp[1]); + unsigned int section_length = eina_ntohl(tmp[2]); + unsigned int data_length = eina_ntohl(tmp[3]); if (protocol_length > 1 && section_length > 1 && protocol_length + section_length <= size && data_length < 10 * 1024 * 1024) { @@ -559,10 +555,10 @@ _ecore_con_eet_base_raw_send(Eo *obj EINA_UNUSED, Ecore_Con_Eet_Base_Data *pd, E if (protocol_length == 1) return; section_length = strlen(section) + 1; - protocol[0] = htonl(ECORE_CON_EET_RAW_MAGIC); - protocol[1] = htonl(protocol_length); - protocol[2] = htonl(section_length); - protocol[3] = htonl(length); + protocol[0] = eina_htonl(ECORE_CON_EET_RAW_MAGIC); + protocol[1] = eina_htonl(protocol_length); + protocol[2] = eina_htonl(section_length); + protocol[3] = eina_htonl(length); size = sizeof (protocol) + protocol_length + section_length; tmp = alloca(size); @@ -959,6 +955,6 @@ ecore_con_eet_raw_send(Ecore_Con_Reply *reply, const char *protocol_name, const eina_binbuf_free(buf); } -#include "ecore_con_eet_base.eo.c" -#include "ecore_con_eet_server_obj.eo.c" -#include "ecore_con_eet_client_obj.eo.c" +#include "ecore_con_eet_base_eo.c" +#include "ecore_con_eet_server_obj_eo.c" +#include "ecore_con_eet_client_obj_eo.c" diff --git a/src/lib/ecore_con/ecore_con_eet_base.eo b/src/lib/ecore_con/ecore_con_eet_base.eo deleted file mode 100644 index 26717efa04..0000000000 --- a/src/lib/ecore_con/ecore_con_eet_base.eo +++ /dev/null @@ -1,95 +0,0 @@ -struct @extern Ecore_Con_Server; [[Ecore connection server structure]] -type @extern Ecore_Con_Eet_Data_Cb: __undefined_type; [[Ecore connection eet data callback type]] /* FIXME: function pointers not supported. */ -type @extern Ecore_Con_Eet_Raw_Data_Cb: __undefined_type; [[Ecore connection eet raw data callback type]]/* FIXME: function pointers not supported. */ - -struct @extern Eet.Data.Descriptor; [[Eet data descriptor data structure]] -struct Ecore.Con.Reply; [[Ecore connection reply data structure]] - -class Ecore.Con.Eet.Base extends Efl.Object { - [[Ecore Connection Eet Base class. - - This class provides Eet data serialization features to Ecore Connection objects.]] - - methods { - @property server { - [[The server object to which we send and receive.]] - set { - } - get { - } - values { - data: ptr(Ecore_Con_Server); [[Server object]] - } - } - @property data_callback { - [[A callback function which should be called when data is - received by ecore_con_eet_object.]] - set { - } - values { - name: string; [[The name of the eet stream.]] - func: Ecore_Con_Eet_Data_Cb; [[The callback function.]] - data: const(void_ptr); [[The data (if any) that should be - passed to callback function.]] - } - } - @property raw_data_callback { - [[A callback function which should be calledn when raw data - is received by ecore_con_eet_object.]] - set { - } - values { - name: string; [[The name of the eet stream.]] - func: Ecore_Con_Eet_Raw_Data_Cb; [[The callback function.]] - data: const(void_ptr); [[The data (if any) that should be - passed to callback function.]] - } - } - data_callback_del { - [[Function to delete the @.data_callback.]] - params { - name: string; [[The name of the eet stream.]] - } - } - raw_data_callback_del { - [[Function to delete the @.raw_data_callback.]] - params { - name: string; [[The name of the eet stream.]] - } - } - register { - [[Function to register a \@ref Eet.Data.Descriptor to the - ecore_con_eet object.]] - legacy: ecore_con_eet; - params { - name: string; [[The name of the eet stream.]] - edd: ptr(Eet.Data.Descriptor); [[The Eet.Data.Descriptor that - is to be registered.]] - } - } - send { - [[Function to send data.]] - params { - reply: ptr(Ecore.Con.Reply); [[Contains the ecore_con_eet object - to which the data has to be sent.]] - name: string; [[The name of the eet stream.]] - value: void_ptr; [[Actual data]] - } - } - raw_send { - [[Function to send raw data.]] - params { - reply: ptr(Ecore.Con.Reply); [[Contains the ecore_con_eet 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.]] - section_data: ptr(Eina.Binbuf); - } - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Efl.Object.finalize; - } -} diff --git a/src/lib/ecore_con/ecore_con_eet_base_eo.c b/src/lib/ecore_con/ecore_con_eet_base_eo.c new file mode 100644 index 0000000000..7e1e6913c1 --- /dev/null +++ b/src/lib/ecore_con/ecore_con_eet_base_eo.c @@ -0,0 +1,90 @@ + +void _ecore_con_eet_base_server_set(Eo *obj, Ecore_Con_Eet_Base_Data *pd, Ecore_Con_Server *data); + +EOAPI EFL_VOID_FUNC_BODYV(ecore_con_eet_base_server_set, EFL_FUNC_CALL(data), Ecore_Con_Server *data); + +Ecore_Con_Server *_ecore_con_eet_base_server_get(const Eo *obj, Ecore_Con_Eet_Base_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(ecore_con_eet_base_server_get, Ecore_Con_Server *, NULL); + +void _ecore_con_eet_base_data_callback_set(Eo *obj, Ecore_Con_Eet_Base_Data *pd, const char *name, Ecore_Con_Eet_Data_Cb func, const void *data); + +EOAPI EFL_VOID_FUNC_BODYV(ecore_con_eet_base_data_callback_set, EFL_FUNC_CALL(name, func, data), const char *name, Ecore_Con_Eet_Data_Cb func, const void *data); + +void _ecore_con_eet_base_raw_data_callback_set(Eo *obj, Ecore_Con_Eet_Base_Data *pd, const char *name, Ecore_Con_Eet_Raw_Data_Cb func, const void *data); + +EOAPI EFL_VOID_FUNC_BODYV(ecore_con_eet_base_raw_data_callback_set, EFL_FUNC_CALL(name, func, data), const char *name, Ecore_Con_Eet_Raw_Data_Cb func, const void *data); + +void _ecore_con_eet_base_data_callback_del(Eo *obj, Ecore_Con_Eet_Base_Data *pd, const char *name); + +EOAPI EFL_VOID_FUNC_BODYV(ecore_con_eet_base_data_callback_del, EFL_FUNC_CALL(name), const char *name); + +void _ecore_con_eet_base_raw_data_callback_del(Eo *obj, Ecore_Con_Eet_Base_Data *pd, const char *name); + +EOAPI EFL_VOID_FUNC_BODYV(ecore_con_eet_base_raw_data_callback_del, EFL_FUNC_CALL(name), const char *name); + +void _ecore_con_eet_base_register(Eo *obj, Ecore_Con_Eet_Base_Data *pd, const char *name, Eet_Data_Descriptor *edd); + +EOAPI EFL_VOID_FUNC_BODYV(ecore_con_eet_base_register, EFL_FUNC_CALL(name, edd), const char *name, Eet_Data_Descriptor *edd); + +void _ecore_con_eet_base_send(Eo *obj, Ecore_Con_Eet_Base_Data *pd, Ecore_Con_Reply *reply, const char *name, void *value); + +EOAPI EFL_VOID_FUNC_BODYV(ecore_con_eet_base_send, EFL_FUNC_CALL(reply, name, value), Ecore_Con_Reply *reply, const char *name, void *value); + +void _ecore_con_eet_base_raw_send(Eo *obj, Ecore_Con_Eet_Base_Data *pd, Ecore_Con_Reply *reply, const char *protocol_name, const char *section, Eina_Binbuf *section_data); + +EOAPI EFL_VOID_FUNC_BODYV(ecore_con_eet_base_raw_send, EFL_FUNC_CALL(reply, protocol_name, section, section_data), Ecore_Con_Reply *reply, const char *protocol_name, const char *section, Eina_Binbuf *section_data); + +Efl_Object *_ecore_con_eet_base_efl_object_constructor(Eo *obj, Ecore_Con_Eet_Base_Data *pd); + + +void _ecore_con_eet_base_efl_object_destructor(Eo *obj, Ecore_Con_Eet_Base_Data *pd); + + +Efl_Object *_ecore_con_eet_base_efl_object_finalize(Eo *obj, Ecore_Con_Eet_Base_Data *pd); + + +static Eina_Bool +_ecore_con_eet_base_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ECORE_CON_EET_BASE_EXTRA_OPS +#define ECORE_CON_EET_BASE_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(ecore_con_eet_base_server_set, _ecore_con_eet_base_server_set), + EFL_OBJECT_OP_FUNC(ecore_con_eet_base_server_get, _ecore_con_eet_base_server_get), + EFL_OBJECT_OP_FUNC(ecore_con_eet_base_data_callback_set, _ecore_con_eet_base_data_callback_set), + EFL_OBJECT_OP_FUNC(ecore_con_eet_base_raw_data_callback_set, _ecore_con_eet_base_raw_data_callback_set), + EFL_OBJECT_OP_FUNC(ecore_con_eet_base_data_callback_del, _ecore_con_eet_base_data_callback_del), + EFL_OBJECT_OP_FUNC(ecore_con_eet_base_raw_data_callback_del, _ecore_con_eet_base_raw_data_callback_del), + EFL_OBJECT_OP_FUNC(ecore_con_eet_base_register, _ecore_con_eet_base_register), + EFL_OBJECT_OP_FUNC(ecore_con_eet_base_send, _ecore_con_eet_base_send), + EFL_OBJECT_OP_FUNC(ecore_con_eet_base_raw_send, _ecore_con_eet_base_raw_send), + EFL_OBJECT_OP_FUNC(efl_constructor, _ecore_con_eet_base_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _ecore_con_eet_base_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_finalize, _ecore_con_eet_base_efl_object_finalize), + ECORE_CON_EET_BASE_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _ecore_con_eet_base_class_desc = { + EO_VERSION, + "Ecore.Con.Eet.Base", + EFL_CLASS_TYPE_REGULAR, + sizeof(Ecore_Con_Eet_Base_Data), + _ecore_con_eet_base_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(ecore_con_eet_base_class_get, &_ecore_con_eet_base_class_desc, EFL_OBJECT_CLASS, NULL); + +#include "ecore_con_eet_base_eo.legacy.c" diff --git a/src/lib/ecore_con/ecore_con_eet_base_eo.h b/src/lib/ecore_con/ecore_con_eet_base_eo.h new file mode 100644 index 0000000000..6c8176861f --- /dev/null +++ b/src/lib/ecore_con/ecore_con_eet_base_eo.h @@ -0,0 +1,142 @@ +#ifndef _ECORE_CON_EET_BASE_EO_H_ +#define _ECORE_CON_EET_BASE_EO_H_ + +#ifndef _ECORE_CON_EET_BASE_EO_CLASS_TYPE +#define _ECORE_CON_EET_BASE_EO_CLASS_TYPE + +typedef Eo Ecore_Con_Eet_Base; + +#endif + +#ifndef _ECORE_CON_EET_BASE_EO_TYPES +#define _ECORE_CON_EET_BASE_EO_TYPES + +/** Ecore connection reply data structure + * + * @ingroup Ecore_Con + */ +typedef struct _Ecore_Con_Reply Ecore_Con_Reply; + + +#endif +/** + * @brief Ecore Connection Eet Base class. + * + * This class provides Eet data serialization features to Ecore Connection + * objects. + * + * @ingroup Ecore_Con_Eet_Base + */ +#define ECORE_CON_EET_BASE_CLASS ecore_con_eet_base_class_get() + +EWAPI const Efl_Class *ecore_con_eet_base_class_get(void); + +/** + * @brief The server object to which we send and receive. + * + * @param[in] obj The object. + * @param[in] data Server object + * + * @ingroup Ecore_Con_Eet_Base + */ +EOAPI void ecore_con_eet_base_server_set(Eo *obj, Ecore_Con_Server *data); + +/** + * @brief The server object to which we send and receive. + * + * @param[in] obj The object. + * + * @return Server object + * + * @ingroup Ecore_Con_Eet_Base + */ +EOAPI Ecore_Con_Server *ecore_con_eet_base_server_get(const Eo *obj); + +/** + * @brief A callback function which should be called when data is received by + * ecore_con_eet_object. + * + * @param[in] obj The object. + * @param[in] name The name of the eet stream. + * @param[in] func The callback function. + * @param[in] data The data (if any) that should be passed to callback + * function. + * + * @ingroup Ecore_Con_Eet_Base + */ +EOAPI void ecore_con_eet_base_data_callback_set(Eo *obj, const char *name, Ecore_Con_Eet_Data_Cb func, const void *data); + +/** + * @brief A callback function which should be calledn when raw data is received + * by ecore_con_eet_object. + * + * @param[in] obj The object. + * @param[in] name The name of the eet stream. + * @param[in] func The callback function. + * @param[in] data The data (if any) that should be passed to callback + * function. + * + * @ingroup Ecore_Con_Eet_Base + */ +EOAPI void ecore_con_eet_base_raw_data_callback_set(Eo *obj, const char *name, Ecore_Con_Eet_Raw_Data_Cb func, const void *data); + +/** + * @brief Function to delete the @ref ecore_con_eet_base_data_callback_set. + * + * @param[in] obj The object. + * @param[in] name The name of the eet stream. + * + * @ingroup Ecore_Con_Eet_Base + */ +EOAPI void ecore_con_eet_base_data_callback_del(Eo *obj, const char *name); + +/** + * @brief Function to delete the @ref ecore_con_eet_base_raw_data_callback_set. + * + * @param[in] obj The object. + * @param[in] name The name of the eet stream. + * + * @ingroup Ecore_Con_Eet_Base + */ +EOAPI void ecore_con_eet_base_raw_data_callback_del(Eo *obj, const char *name); + +/** + * @brief Function to register a @ref Eet.Data.Descriptor to the ecore_con_eet + * object. + * + * @param[in] obj The object. + * @param[in] name The name of the eet stream. + * @param[in] edd The Eet.Data.Descriptor that is to be registered. + * + * @ingroup Ecore_Con_Eet_Base + */ +EOAPI void ecore_con_eet_base_register(Eo *obj, const char *name, Eet_Data_Descriptor *edd); + +/** + * @brief Function to send data. + * + * @param[in] obj The object. + * @param[in] reply Contains the ecore_con_eet object to which the data has to + * be sent. + * @param[in] name The name of the eet stream. + * @param[in] value Actual data + * + * @ingroup Ecore_Con_Eet_Base + */ +EOAPI void ecore_con_eet_base_send(Eo *obj, Ecore_Con_Reply *reply, const char *name, void *value); + +/** + * @brief Function to send raw data. + * + * @param[in] obj The object. + * @param[in] reply Contains the ecore_con_eet object to which the data has to + * be sent. + * @param[in] protocol_name The name of the eet stream. + * @param[in] section Name of section in the eet descriptor. + * @param[in] section_data + * + * @ingroup Ecore_Con_Eet_Base + */ +EOAPI void ecore_con_eet_base_raw_send(Eo *obj, Ecore_Con_Reply *reply, const char *protocol_name, const char *section, Eina_Binbuf *section_data); + +#endif diff --git a/src/lib/ecore_con/ecore_con_eet_base_eo.legacy.c b/src/lib/ecore_con/ecore_con_eet_base_eo.legacy.c new file mode 100644 index 0000000000..696028a9c8 --- /dev/null +++ b/src/lib/ecore_con/ecore_con_eet_base_eo.legacy.c @@ -0,0 +1,6 @@ + +EAPI void +ecore_con_eet(Ecore_Con_Eet_Base *obj, const char *name, Eet_Data_Descriptor *edd) +{ + ecore_con_eet_base_register(obj, name, edd); +} diff --git a/src/lib/ecore_con/ecore_con_eet_base_eo.legacy.h b/src/lib/ecore_con/ecore_con_eet_base_eo.legacy.h new file mode 100644 index 0000000000..4636f095bb --- /dev/null +++ b/src/lib/ecore_con/ecore_con_eet_base_eo.legacy.h @@ -0,0 +1,43 @@ +#ifndef _ECORE_CON_EET_BASE_EO_LEGACY_H_ +#define _ECORE_CON_EET_BASE_EO_LEGACY_H_ + +#ifndef _ECORE_CON_EET_BASE_EO_CLASS_TYPE +#define _ECORE_CON_EET_BASE_EO_CLASS_TYPE + +typedef Eo Ecore_Con_Eet_Base; + +#endif + +#ifndef _ECORE_CON_EET_BASE_EO_TYPES +#define _ECORE_CON_EET_BASE_EO_TYPES + +/** Ecore connection reply data structure + * + * @ingroup Ecore_Con + */ +typedef struct _Ecore_Con_Reply Ecore_Con_Reply; + + +#endif + + + + + + + +/** + * @brief Function to register a @ref Eet.Data.Descriptor to the ecore_con_eet + * object. + * + * @param[in] obj The object. + * @param[in] name The name of the eet stream. + * @param[in] edd The Eet.Data.Descriptor that is to be registered. + * + * @ingroup (null)_Group + */ +EAPI void ecore_con_eet(Ecore_Con_Eet_Base *obj, const char *name, Eet_Data_Descriptor *edd); + + + +#endif diff --git a/src/lib/ecore_con/ecore_con_eet_client_obj.eo b/src/lib/ecore_con/ecore_con_eet_client_obj.eo deleted file mode 100644 index 8b5955a49a..0000000000 --- a/src/lib/ecore_con/ecore_con_eet_client_obj.eo +++ /dev/null @@ -1,10 +0,0 @@ -class Ecore.Con.Eet.Client.Obj extends Ecore.Con.Eet.Base { - [[Ecore Connection Eet Client class.]] - - eo_prefix: ecore_con_eet_client_obj; - implements { - Efl.Object.constructor; - Efl.Object.destructor; - } -} - diff --git a/src/lib/ecore_con/ecore_con_eet_client_obj_eo.c b/src/lib/ecore_con/ecore_con_eet_client_obj_eo.c new file mode 100644 index 0000000000..3c9f7cbef4 --- /dev/null +++ b/src/lib/ecore_con/ecore_con_eet_client_obj_eo.c @@ -0,0 +1,39 @@ + +Efl_Object *_ecore_con_eet_client_obj_efl_object_constructor(Eo *obj, Ecore_Con_Eet_Client_Obj_Data *pd); + + +void _ecore_con_eet_client_obj_efl_object_destructor(Eo *obj, Ecore_Con_Eet_Client_Obj_Data *pd); + + +static Eina_Bool +_ecore_con_eet_client_obj_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ECORE_CON_EET_CLIENT_OBJ_EXTRA_OPS +#define ECORE_CON_EET_CLIENT_OBJ_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _ecore_con_eet_client_obj_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _ecore_con_eet_client_obj_efl_object_destructor), + ECORE_CON_EET_CLIENT_OBJ_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _ecore_con_eet_client_obj_class_desc = { + EO_VERSION, + "Ecore.Con.Eet.Client.Obj", + EFL_CLASS_TYPE_REGULAR, + sizeof(Ecore_Con_Eet_Client_Obj_Data), + _ecore_con_eet_client_obj_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(ecore_con_eet_client_obj_class_get, &_ecore_con_eet_client_obj_class_desc, ECORE_CON_EET_BASE_CLASS, NULL); diff --git a/src/lib/ecore_con/ecore_con_eet_client_obj_eo.h b/src/lib/ecore_con/ecore_con_eet_client_obj_eo.h new file mode 100644 index 0000000000..0de995fca3 --- /dev/null +++ b/src/lib/ecore_con/ecore_con_eet_client_obj_eo.h @@ -0,0 +1,24 @@ +#ifndef _ECORE_CON_EET_CLIENT_OBJ_EO_H_ +#define _ECORE_CON_EET_CLIENT_OBJ_EO_H_ + +#ifndef _ECORE_CON_EET_CLIENT_OBJ_EO_CLASS_TYPE +#define _ECORE_CON_EET_CLIENT_OBJ_EO_CLASS_TYPE + +typedef Eo Ecore_Con_Eet_Client_Obj; + +#endif + +#ifndef _ECORE_CON_EET_CLIENT_OBJ_EO_TYPES +#define _ECORE_CON_EET_CLIENT_OBJ_EO_TYPES + + +#endif +/** Ecore Connection Eet Client class. + * + * @ingroup Ecore_Con_Eet_Client_Obj + */ +#define ECORE_CON_EET_CLIENT_OBJ_CLASS ecore_con_eet_client_obj_class_get() + +EWAPI const Efl_Class *ecore_con_eet_client_obj_class_get(void); + +#endif diff --git a/src/lib/ecore_con/ecore_con_eet_client_obj_eo.legacy.h b/src/lib/ecore_con/ecore_con_eet_client_obj_eo.legacy.h new file mode 100644 index 0000000000..81081c0894 --- /dev/null +++ b/src/lib/ecore_con/ecore_con_eet_client_obj_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ECORE_CON_EET_CLIENT_OBJ_EO_LEGACY_H_ +#define _ECORE_CON_EET_CLIENT_OBJ_EO_LEGACY_H_ + +#ifndef _ECORE_CON_EET_CLIENT_OBJ_EO_CLASS_TYPE +#define _ECORE_CON_EET_CLIENT_OBJ_EO_CLASS_TYPE + +typedef Eo Ecore_Con_Eet_Client_Obj; + +#endif + +#ifndef _ECORE_CON_EET_CLIENT_OBJ_EO_TYPES +#define _ECORE_CON_EET_CLIENT_OBJ_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/ecore_con/ecore_con_eet_server_obj.eo b/src/lib/ecore_con/ecore_con_eet_server_obj.eo deleted file mode 100644 index 11c97d4889..0000000000 --- a/src/lib/ecore_con/ecore_con_eet_server_obj.eo +++ /dev/null @@ -1,10 +0,0 @@ -class Ecore.Con.Eet.Server.Obj extends Ecore.Con.Eet.Base { - [[Ecore Connection Eet Server class.]] - - eo_prefix: ecore_con_eet_server_obj; - implements { - Efl.Object.constructor; - Efl.Object.destructor; - } -} - diff --git a/src/lib/ecore_con/ecore_con_eet_server_obj_eo.c b/src/lib/ecore_con/ecore_con_eet_server_obj_eo.c new file mode 100644 index 0000000000..3f7f4eac18 --- /dev/null +++ b/src/lib/ecore_con/ecore_con_eet_server_obj_eo.c @@ -0,0 +1,39 @@ + +Efl_Object *_ecore_con_eet_server_obj_efl_object_constructor(Eo *obj, Ecore_Con_Eet_Server_Obj_Data *pd); + + +void _ecore_con_eet_server_obj_efl_object_destructor(Eo *obj, Ecore_Con_Eet_Server_Obj_Data *pd); + + +static Eina_Bool +_ecore_con_eet_server_obj_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ECORE_CON_EET_SERVER_OBJ_EXTRA_OPS +#define ECORE_CON_EET_SERVER_OBJ_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _ecore_con_eet_server_obj_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _ecore_con_eet_server_obj_efl_object_destructor), + ECORE_CON_EET_SERVER_OBJ_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _ecore_con_eet_server_obj_class_desc = { + EO_VERSION, + "Ecore.Con.Eet.Server.Obj", + EFL_CLASS_TYPE_REGULAR, + sizeof(Ecore_Con_Eet_Server_Obj_Data), + _ecore_con_eet_server_obj_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(ecore_con_eet_server_obj_class_get, &_ecore_con_eet_server_obj_class_desc, ECORE_CON_EET_BASE_CLASS, NULL); diff --git a/src/lib/ecore_con/ecore_con_eet_server_obj_eo.h b/src/lib/ecore_con/ecore_con_eet_server_obj_eo.h new file mode 100644 index 0000000000..3d2a76c38e --- /dev/null +++ b/src/lib/ecore_con/ecore_con_eet_server_obj_eo.h @@ -0,0 +1,24 @@ +#ifndef _ECORE_CON_EET_SERVER_OBJ_EO_H_ +#define _ECORE_CON_EET_SERVER_OBJ_EO_H_ + +#ifndef _ECORE_CON_EET_SERVER_OBJ_EO_CLASS_TYPE +#define _ECORE_CON_EET_SERVER_OBJ_EO_CLASS_TYPE + +typedef Eo Ecore_Con_Eet_Server_Obj; + +#endif + +#ifndef _ECORE_CON_EET_SERVER_OBJ_EO_TYPES +#define _ECORE_CON_EET_SERVER_OBJ_EO_TYPES + + +#endif +/** Ecore Connection Eet Server class. + * + * @ingroup Ecore_Con_Eet_Server_Obj + */ +#define ECORE_CON_EET_SERVER_OBJ_CLASS ecore_con_eet_server_obj_class_get() + +EWAPI const Efl_Class *ecore_con_eet_server_obj_class_get(void); + +#endif diff --git a/src/lib/ecore_con/ecore_con_eet_server_obj_eo.legacy.h b/src/lib/ecore_con/ecore_con_eet_server_obj_eo.legacy.h new file mode 100644 index 0000000000..c3c37b3bde --- /dev/null +++ b/src/lib/ecore_con/ecore_con_eet_server_obj_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ECORE_CON_EET_SERVER_OBJ_EO_LEGACY_H_ +#define _ECORE_CON_EET_SERVER_OBJ_EO_LEGACY_H_ + +#ifndef _ECORE_CON_EET_SERVER_OBJ_EO_CLASS_TYPE +#define _ECORE_CON_EET_SERVER_OBJ_EO_CLASS_TYPE + +typedef Eo Ecore_Con_Eet_Server_Obj; + +#endif + +#ifndef _ECORE_CON_EET_SERVER_OBJ_EO_TYPES +#define _ECORE_CON_EET_SERVER_OBJ_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/ecore_con/ecore_con_legacy.c b/src/lib/ecore_con/ecore_con_legacy.c index 1ac6c2ac15..1956176604 100644 --- a/src/lib/ecore_con/ecore_con_legacy.c +++ b/src/lib/ecore_con/ecore_con_legacy.c @@ -293,7 +293,7 @@ _ecore_con_client_free(Ecore_Con_Client *cl) efl_event_callback_array_del(inner_socket, _ecore_con_client_socket_ssl_cbs(), cl); parent = efl_parent_get(cl->socket); - if (parent && (parent != svr->server)) + if (parent && svr && (parent != svr->server)) efl_del(cl->socket); /* we own it */ else efl_unref(cl->socket); @@ -1420,9 +1420,9 @@ EFL_CALLBACKS_ARRAY_DEFINE(_ecore_con_server_dialer_cbs, { EFL_IO_BUFFERED_STREAM_EVENT_READ_FINISHED, _ecore_con_server_dialer_read_finished }, { EFL_IO_BUFFERED_STREAM_EVENT_FINISHED, _ecore_con_server_dialer_finished }, { EFL_IO_BUFFERED_STREAM_EVENT_ERROR, _ecore_con_server_dialer_error }, - { EFL_NET_DIALER_EVENT_ERROR, _ecore_con_server_dialer_error }, - { EFL_NET_DIALER_EVENT_RESOLVED, _ecore_con_server_dialer_resolved }, - { EFL_NET_DIALER_EVENT_CONNECTED, _ecore_con_server_dialer_connected }); + { EFL_NET_DIALER_EVENT_DIALER_ERROR, _ecore_con_server_dialer_error }, + { EFL_NET_DIALER_EVENT_DIALER_RESOLVED, _ecore_con_server_dialer_resolved }, + { EFL_NET_DIALER_EVENT_DIALER_CONNECTED, _ecore_con_server_dialer_connected }); static void _ecore_con_server_server_client_add(void *data, const Efl_Event *event) @@ -1495,7 +1495,7 @@ _ecore_con_server_server_error(void *data, const Efl_Event *event) EFL_CALLBACKS_ARRAY_DEFINE(_ecore_con_server_server_cbs, { EFL_NET_SERVER_EVENT_CLIENT_ADD, _ecore_con_server_server_client_add }, { EFL_NET_SERVER_EVENT_SERVING, _ecore_con_server_server_serving }, - { EFL_NET_SERVER_EVENT_ERROR, _ecore_con_server_server_error }); + { EFL_NET_SERVER_EVENT_SERVER_ERROR, _ecore_con_server_server_error }); /** * @addtogroup Ecore_Con_Server_Group Ecore Connection Server Functions @@ -2659,7 +2659,7 @@ _ecore_con_lookup_done_cb(void *data, const char *host, const char *port EINA_UN if (!inet_ntop(result->ai_family, mem, ip, sizeof(ip))) { - ERR("could not convert IP to string: %s", strerror(errno)); + ERR("could not convert IP to string: %s", eina_error_msg_get(errno)); goto end; } ctx->cb(result->ai_canonname, ip, result->ai_addr, result->ai_addrlen, (void *)ctx->data); diff --git a/src/lib/ecore_con/ecore_con_local.c b/src/lib/ecore_con/ecore_con_local.c index b3568837b5..5fed0b711e 100644 --- a/src/lib/ecore_con/ecore_con_local.c +++ b/src/lib/ecore_con/ecore_con_local.c @@ -17,7 +17,7 @@ # include #endif -#ifdef HAVE_WS2TCPIP_H +#ifdef _WIN32 # include #endif @@ -127,7 +127,7 @@ _ecore_con_local_mkpath(const char *path, mode_t mode) { if (errno != EEXIST) { - ERR("could not create parent directory '%s' of path '%s': %s", d, path, strerror(errno)); + ERR("could not create parent directory '%s' of path '%s': %s", d, path, eina_error_msg_get(errno)); goto end; } } @@ -138,7 +138,7 @@ _ecore_con_local_mkpath(const char *path, mode_t mode) if (mkdir(d, mode) != 0) { if (errno != EEXIST) - ERR("could not create parent directory '%s' of path '%s': %s", d, path, strerror(errno)); + ERR("could not create parent directory '%s' of path '%s': %s", d, path, eina_error_msg_get(errno)); else { struct stat st; diff --git a/src/lib/ecore_con/ecore_con_socks.c b/src/lib/ecore_con/ecore_con_socks.c index 8138b26525..08f5585381 100644 --- a/src/lib/ecore_con/ecore_con_socks.c +++ b/src/lib/ecore_con/ecore_con_socks.c @@ -34,11 +34,8 @@ # include #endif -#ifdef HAVE_WS2TCPIP_H -# include -#endif - #ifdef _WIN32 +# include # include #endif diff --git a/src/lib/ecore_con/ecore_con_url.c b/src/lib/ecore_con/ecore_con_url.c index 3c9faea28c..27b391c32d 100644 --- a/src/lib/ecore_con/ecore_con_url.c +++ b/src/lib/ecore_con/ecore_con_url.c @@ -425,7 +425,7 @@ _ecore_con_url_dialer_can_read_changed(void *data, const Efl_Event *event EINA_U ssize_t r = write(url_con->write_fd, slice.bytes, slice.len); if (r == -1) { - ERR("Could not write to fd=%d: %s", url_con->write_fd, strerror(errno)); + ERR("Could not write to fd=%d: %s", url_con->write_fd, eina_error_msg_get(errno)); break; } slice.bytes += r; @@ -508,7 +508,7 @@ _ecore_con_url_dialer_headers_done(void *data, const Efl_Event *event EINA_UNUSE EFL_CALLBACKS_ARRAY_DEFINE(ecore_con_url_dialer_cbs, { EFL_IO_READER_EVENT_CAN_READ_CHANGED, _ecore_con_url_dialer_can_read_changed }, { EFL_IO_READER_EVENT_EOS, _ecore_con_url_dialer_eos }, - { EFL_NET_DIALER_EVENT_ERROR, _ecore_con_url_dialer_error }, + { EFL_NET_DIALER_EVENT_DIALER_ERROR, _ecore_con_url_dialer_error }, { EFL_NET_DIALER_HTTP_EVENT_HEADERS_DONE, _ecore_con_url_dialer_headers_done }); static Eina_Bool @@ -734,7 +734,7 @@ _ecore_con_url_request_prepare(Ecore_Con_Url *url_con, const char *method) if (url_con->time.condition != ECORE_CON_URL_TIME_NONE) { - char *ts = efl_net_dialer_http_date_serialize(EFL_NET_DIALER_HTTP_CLASS, url_con->time.stamp); + char *ts = efl_net_dialer_http_date_serialize(url_con->time.stamp); if (ts) { efl_net_dialer_http_request_header_add(url_con->dialer, @@ -1177,7 +1177,7 @@ ecore_con_url_ftp_upload(Ecore_Con_Url *url_con, file = efl_add(EFL_IO_FILE_CLASS, efl_loop_get(url_con->dialer), efl_name_set(efl_added, "upload-file"), - efl_file_set(efl_added, filename, NULL), + efl_file_set(efl_added, filename), efl_io_file_flags_set(efl_added, O_RDONLY), efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE), efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE)); diff --git a/src/lib/ecore_con/ecore_con_url_curl.c b/src/lib/ecore_con/ecore_con_url_curl.c index e0d5f93c6b..6e8d9e73c3 100644 --- a/src/lib/ecore_con/ecore_con_url_curl.c +++ b/src/lib/ecore_con/ecore_con_url_curl.c @@ -8,7 +8,7 @@ #include #include -#ifdef HAVE_WS2TCPIP_H +#ifdef _WIN32 # include #endif 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 53903032f9..3acf2a2f17 100644 --- a/src/lib/ecore_con/efl_net_control_access_point.eo +++ b/src/lib/ecore_con/efl_net_control_access_point.eo @@ -1,7 +1,5 @@ -enum Efl.Net.Control.Access_Point_State { +enum @beta Efl.Net.Control.Access_Point_State { [[Provides the access point state. - - @since 1.19 ]] idle, [[Nothing is happening with this access point]] association, [[The access point is trying to associate itself. This is the first state after a connection attempt.]] @@ -12,10 +10,8 @@ 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 @beta Efl.Net.Control.Access_Point_Error { [[The reason for the connection error. - - @since 1.19 ]] none, [[All OK, no errors]] out_of_range, [[Wireless device is out of range.]] @@ -25,10 +21,8 @@ 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 @beta Efl.Net.Control.Access_Point_Security { [[Bitwise-able securities supported by an access point. - - @since 1.19 ]] unknow = 0, [[Unknown]] none = (1 << 0), [[Open access, no security]] @@ -37,10 +31,8 @@ enum Efl.Net.Control.Access_Point_Security { ieee802_1x = (1 << 3), [[IEEE 802.1X]] } -enum Efl.Net.Control.Access_Point_Ipv4_Method { +enum @beta Efl.Net.Control.Access_Point_Ipv4_Method { [[The method used to configure IPv4 - - @since 1.19 ]] off, [[IPv4 is disabled.]] dhcp, [[IPv4 is configured using DHCP.]] @@ -48,10 +40,8 @@ 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 @beta Efl.Net.Control.Access_Point_Ipv6_Method { [[The method used to configure IPv6 - - @since 1.19 ]] off, [[IPv6 is disabled.]] fixed, [[IPv6 is fixed by operator and cannot be changed.]] @@ -63,10 +53,8 @@ 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 @beta Efl.Net.Control.Access_Point_Proxy_Method { [[The method used to configure Proxies. - - @since 1.19 ]] off, [[Direct connection to the internet, no proxy used.]] auto, [[Proxy is autoconfigured using Proxy-Auto-Configuration (PAC) using given URL.]] @@ -74,7 +62,7 @@ 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 extends Efl.Loop_Consumer { +class @beta Efl.Net.Control.Access_Point extends Efl.Loop_Consumer { [[An access point for network connectivity. The @Efl.Net.Control.Manager is composed of multiple technologies, each @@ -82,8 +70,6 @@ class Efl.Net.Control.Access_Point extends Efl.Loop_Consumer { An application requiring only a network connection can just use a @Efl.Net.Session instead. - - @since 1.19 ]] events { diff --git a/src/lib/ecore_con/efl_net_control_manager.eo b/src/lib/ecore_con/efl_net_control_manager.eo index 5afdeb465c..cfb729b9db 100644 --- a/src/lib/ecore_con/efl_net_control_manager.eo +++ b/src/lib/ecore_con/efl_net_control_manager.eo @@ -2,23 +2,19 @@ import eina_types; import efl_net_control_access_point; import efl_net_control_technology; -enum Efl.Net.Control.State { +enum @beta Efl.Net.Control.State { [[Provides the global network connectivity state. For more details, use @Efl.Net.Control.Manager access points and their property state. - - @since 1.19 ]] offline, [[No access point is connected.]] local, [[At least one access point is connected and the internet connection hasn't been verified.]] online, [[At least one access point is connected and the internet has been verified]] } -enum Efl.Net.Control.Agent_Request_Input_Field { +enum @beta Efl.Net.Control.Agent_Request_Input_Field { [[Bitwise-able fields requested to the agent. - - @since 1.19 ]] name = (1 << 0), [[Used for hidden WiFi access points. If SSID is present, this is an alternative to that.]] ssid = (1 << 1), [[Used for hidden WiFi access points. If name is present, this is an alternative to that.]] @@ -27,19 +23,15 @@ 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 @beta Efl.Net.Control.Agent_Request_Input_Information { [[Name-value information pair provided to the agent. - - @since 1.19 ]] name: string; [[The information name, such as PreviousPassphrase, Host, Name...]] value: string; [[The contents of the information]] } -struct Efl.Net.Control.Agent_Request_Input { +struct @beta Efl.Net.Control.Agent_Request_Input { [[Requests input to the agent. - - @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.]] @@ -47,25 +39,21 @@ struct Efl.Net.Control.Agent_Request_Input { informational: list; [[Such as the previous passphrase, VPN host]] } -struct Efl.Net.Control.Agent_Error { +struct @beta Efl.Net.Control.Agent_Error { [[Reports error to the agent. - - @since 1.19 ]] access_point: Efl.Net.Control.Access_Point; [[The access point that triggered this error.]] message: string; [[The error message.]] } -struct Efl.Net.Control.Agent_Browser_Url { +struct @beta Efl.Net.Control.Agent_Browser_Url { [[Reports to agent that it should open a browser at a given URL. - - @since 1.19 ]] access_point: Efl.Net.Control.Access_Point; [[The access point that triggered this request.]] url: string; [[The URL to point the browser at.]] } -class Efl.Net.Control.Manager extends Efl.Loop_Consumer { +class @beta Efl.Net.Control.Manager extends Efl.Loop_Consumer { [[Controls network connectivity. This class and its child objects are only useful to implement @@ -103,9 +91,6 @@ class Efl.Net.Control.Manager extends Efl.Loop_Consumer { (@Efl.Net.Control.State.online) and iterators for @.access_points and @.technologies will be empty (they will be returned but won't contain any items). - - - @since 1.19 ]] events { access_point,add: Efl.Net.Control.Access_Point; [[The given access point has been added]] diff --git a/src/lib/ecore_con/efl_net_control_technology.eo b/src/lib/ecore_con/efl_net_control_technology.eo index ccc2cf6e8f..dc674339a7 100644 --- a/src/lib/ecore_con/efl_net_control_technology.eo +++ b/src/lib/ecore_con/efl_net_control_technology.eo @@ -1,7 +1,5 @@ -enum Efl.Net.Control.Technology_Type { +enum @beta Efl.Net.Control.Technology_Type { [[Technology types - - @since 1.19 ]] unknown, [[Type: unknown]] system, [[Type: system]] @@ -15,7 +13,7 @@ enum Efl.Net.Control.Technology_Type { p2p, [[Type: Peer-2-Peer]] } -class Efl.Net.Control.Technology extends Efl.Loop_Consumer { +class @beta Efl.Net.Control.Technology extends Efl.Loop_Consumer { [[A technology that allows control of network access points. The @Efl.Net.Control.Manager is composed of multiple technologies, each @@ -24,8 +22,6 @@ class Efl.Net.Control.Technology extends Efl.Loop_Consumer { When powered, the technology will dynamically create and remove access points in @Efl.Net.Control.Manager.access_points. - - @since 1.19 ]] events { changed: void; [[Called when some properties were changed.]] diff --git a/src/lib/ecore_con/efl_net_dialer.eo b/src/lib/ecore_con/efl_net_dialer.eo index 1b7b2e9c16..02770dca46 100644 --- a/src/lib/ecore_con/efl_net_dialer.eo +++ b/src/lib/ecore_con/efl_net_dialer.eo @@ -1,8 +1,8 @@ -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 @beta Efl.Net.Dialer_Error.COULDNT_CONNECT: Eina.Error; [[The dialer could not connect to the remote]] +var @beta Efl.Net.Dialer_Error.COULDNT_RESOLVE_PROXY: Eina.Error; [[The dialer could not resolve the given proxy server]] +var @beta Efl.Net.Dialer_Error.PROXY_AUTHENTICATION_FAILED: Eina.Error; [[The dialer failed to authenticate against the proxy server]] -interface Efl.Net.Dialer extends Efl.Net.Socket { +interface @beta Efl.Net.Dialer extends Efl.Net.Socket { [[Creates a client socket to reach a remote peer. The connection process starts when @.dial is executed. This @@ -17,8 +17,6 @@ interface Efl.Net.Dialer extends Efl.Net.Socket { Once the socket is closed, @Efl.Io.Closer.closed will be called and the "closed" event is dispatched. - - @since 1.19 ]] methods { dial { @@ -112,7 +110,7 @@ interface Efl.Net.Dialer extends Efl.Net.Socket { events { /* FIXME: Might be NULL, but @nullable does not work on event types */ - resolved: string; [[Notifies @.address_dial was resolved to + dialer,resolved: string; [[Notifies @.address_dial was resolved to @Efl.Net.Socket.address_remote. This is emitted before "connected" and may @@ -124,9 +122,9 @@ interface Efl.Net.Dialer extends Efl.Net.Socket { may be emitted multiple times, such as HTTP. ]] - error: Eina.Error; [[Some error happened and the socket + dialer,error: Eina.Error; [[Some error happened and the socket stopped working. ]] - connected: void; [[Notifies the socket is connected to the remote peer.]] + dialer,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 8bfe967c32..b6467b2c23 100644 --- a/src/lib/ecore_con/efl_net_dialer_http.c +++ b/src/lib/ecore_con/efl_net_dialer_http.c @@ -318,7 +318,7 @@ _efl_net_dialer_http_curlm_check(Efl_Net_Dialer_Http_Curlm *cm) efl_ref(dialer); pd = efl_data_scope_get(dialer, MY_CLASS); if (pd->error) - efl_event_callback_call(dialer, EFL_NET_DIALER_EVENT_ERROR, &pd->error); + efl_event_callback_call(dialer, EFL_NET_DIALER_EVENT_DIALER_ERROR, &pd->error); if (pd->recv.used > 0) pd->pending_eos = EINA_TRUE; else { @@ -369,7 +369,7 @@ _efl_net_dialer_http_curlm_timer_schedule(CURLM *multi EINA_UNUSED, long timeout { cm->timer = efl_add(EFL_LOOP_TIMER_CLASS, cm->loop, efl_loop_timer_interval_set(efl_added, seconds), - efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, _efl_net_dialer_http_curlm_timer_do, cm)); + efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, _efl_net_dialer_http_curlm_timer_do, cm)); EINA_SAFETY_ON_NULL_RETURN_VAL(cm->timer, -1); } @@ -1460,7 +1460,7 @@ _efl_net_dialer_http_efl_net_dialer_connected_set(Eo *o, Efl_Net_Dialer_Http_Dat * allow_redirects will trigger more than once */ pd->connected = connected; - if (connected) efl_event_callback_call(o, EFL_NET_DIALER_EVENT_CONNECTED, NULL); + if (connected) efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_CONNECTED, NULL); } EOLIAN static Eina_Bool @@ -1524,7 +1524,7 @@ EOLIAN static void _efl_net_dialer_http_efl_net_socket_address_remote_set(Eo *o, Efl_Net_Dialer_Http_Data *pd, const char *address) { if (eina_stringshare_replace(&pd->address_remote, address)) - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_RESOLVED, NULL); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_RESOLVED, NULL); } EOLIAN static const char * @@ -1626,7 +1626,7 @@ _efl_net_dialer_http_efl_io_reader_can_read_set(Eo *o, Efl_Net_Dialer_Http_Data EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o)); if (pd->can_read == can_read) return; pd->can_read = can_read; - efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, &can_read); } EOLIAN static Eina_Bool @@ -1714,7 +1714,7 @@ _efl_net_dialer_http_efl_io_writer_can_write_set(Eo *o, Efl_Net_Dialer_Http_Data EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o)); if (pd->can_write == can_write) return; pd->can_write = can_write; - efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, &can_write); } static Eina_Value _efl_net_dialer_http_pending_close(Eo *o, void *data, Eina_Value value); @@ -1796,7 +1796,7 @@ _efl_net_dialer_http_efl_io_closer_close_on_exec_set(Eo *o EINA_UNUSED, Efl_Net_ if (!eina_file_close_on_exec(pd->fd, close_on_exec)) { - ERR("fcntl(" SOCKET_FMT ", F_SETFD): %s", pd->fd, strerror(errno)); + ERR("fcntl(" SOCKET_FMT ", F_SETFD): %s", pd->fd, eina_error_msg_get(errno)); pd->close_on_exec = old; return EINA_FALSE; } @@ -2375,14 +2375,14 @@ _efl_net_dialer_http_ssl_certificate_revocation_list_get(const Eo *o EINA_UNUSED } EOLIAN static int64_t -_efl_net_dialer_http_date_parse(Efl_Class *cls EINA_UNUSED, void *cd EINA_UNUSED, const char *str) +_efl_net_dialer_http_date_parse(const char *str) { EINA_SAFETY_ON_NULL_RETURN_VAL(str, 0); return curl_getdate(str, NULL); } EOLIAN static char * -_efl_net_dialer_http_date_serialize(Efl_Class *cls EINA_UNUSED, void *cd EINA_UNUSED, int64_t ts) +_efl_net_dialer_http_date_serialize(int64_t ts) { static const char *const wkday[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; static const char * const month[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; diff --git a/src/lib/ecore_con/efl_net_dialer_http.eo b/src/lib/ecore_con/efl_net_dialer_http.eo index 18c0c35e0b..f5a6fac38d 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 @beta 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 extends Efl.Loop_Consumer implements Efl.Net.Dialer, Efl.Io.Sizer { +class @beta Efl.Net.Dialer_Http extends Efl.Loop_Consumer implements Efl.Net.Dialer, Efl.Io.Sizer { [[HTTP Dialer (Client). The effective URL in use, if @.allow_redirects is $true will be @@ -47,8 +47,6 @@ class Efl.Net.Dialer_Http extends Efl.Loop_Consumer implements Efl.Net.Dialer, E - socks5://proxyserver (default port 1080) - socks4a://proxyserver:port (SOCKSv4 and let socks server to resolve domain) - socks4://proxyserver:port (SOCKSv4) - - @since 1.19 ]] methods { @property method { @@ -74,7 +72,7 @@ class Efl.Net.Dialer_Http extends Efl.Loop_Consumer implements Efl.Net.Dialer, E - 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 + chosen based on the @.method: if "PUT", then it's upload, otherwise it's download. - If @Efl.Net.Dialer_Http_Primary_Mode.upload, applying diff --git a/src/lib/ecore_con/efl_net_dialer_simple.c b/src/lib/ecore_con/efl_net_dialer_simple.c index 71e99e8736..111874e8df 100644 --- a/src/lib/ecore_con/efl_net_dialer_simple.c +++ b/src/lib/ecore_con/efl_net_dialer_simple.c @@ -29,33 +29,6 @@ typedef struct #define MY_CLASS EFL_NET_DIALER_SIMPLE_CLASS -static void -_efl_net_dialer_simple_inner_io_resolved(void *data, const Efl_Event *event) -{ - Eo *o = data; - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_RESOLVED, event->info); -} - -static void -_efl_net_dialer_simple_inner_io_error(void *data, const Efl_Event *event) -{ - Eo *o = data; - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, event->info); -} - -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); -} - -EFL_CALLBACKS_ARRAY_DEFINE(_efl_net_dialer_simple_inner_io_cbs, - { EFL_NET_DIALER_EVENT_RESOLVED, _efl_net_dialer_simple_inner_io_resolved }, - { EFL_NET_DIALER_EVENT_ERROR, _efl_net_dialer_simple_inner_io_error }, - { EFL_NET_DIALER_EVENT_CONNECTED, _efl_net_dialer_simple_inner_io_connected }); - EOLIAN static Efl_Object * _efl_net_dialer_simple_efl_object_finalize(Eo *o, Efl_Net_Dialer_Simple_Data *pd) { @@ -94,7 +67,9 @@ _efl_net_dialer_simple_efl_object_invalidate(Eo *o, Efl_Net_Dialer_Simple_Data * 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); + efl_event_callback_forwarder_del(inner_io, EFL_NET_DIALER_EVENT_DIALER_ERROR, o); + efl_event_callback_forwarder_del(inner_io, EFL_NET_DIALER_EVENT_DIALER_RESOLVED, o); + efl_event_callback_forwarder_del(inner_io, EFL_NET_DIALER_EVENT_DIALER_CONNECTED, o); if (efl_parent_get(inner_io) == o) efl_parent_set(inner_io, NULL); } @@ -122,8 +97,9 @@ _efl_net_dialer_simple_efl_io_buffered_stream_inner_io_set(Eo *o, Efl_Net_Dialer { EINA_SAFETY_ON_FALSE_RETURN(efl_isa(io, EFL_NET_DIALER_INTERFACE)); efl_io_buffered_stream_inner_io_set(efl_super(o, MY_CLASS), io); - efl_event_callback_array_add(io, _efl_net_dialer_simple_inner_io_cbs(), o); - + efl_event_callback_forwarder_add(io, EFL_NET_DIALER_EVENT_DIALER_ERROR, o); + efl_event_callback_forwarder_add(io, EFL_NET_DIALER_EVENT_DIALER_RESOLVED, o); + efl_event_callback_forwarder_add(io, EFL_NET_DIALER_EVENT_DIALER_CONNECTED, o); /* apply pending dialer values */ if (pd->pending.proxy_url) { diff --git a/src/lib/ecore_con/efl_net_dialer_simple.eo b/src/lib/ecore_con/efl_net_dialer_simple.eo index 0a5aa941b2..f1d2dd1acd 100644 --- a/src/lib/ecore_con/efl_net_dialer_simple.eo +++ b/src/lib/ecore_con/efl_net_dialer_simple.eo @@ -1,4 +1,4 @@ -class Efl.Net.Dialer_Simple extends Efl.Net.Socket_Simple implements Efl.Net.Dialer { +class @beta Efl.Net.Dialer_Simple extends Efl.Net.Socket_Simple implements 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 @@ -40,8 +40,6 @@ class Efl.Net.Dialer_Simple extends Efl.Net.Socket_Simple implements Efl.Net.Dia to be set prior to @Efl.Object.finalize, then use @Efl.Io.Buffered_Stream.inner_io directly providing an already created dialer. - - @since 1.19 ]] methods { diff --git a/src/lib/ecore_con/efl_net_dialer_ssl.c b/src/lib/ecore_con/efl_net_dialer_ssl.c index 78b587973a..ffc36a6f58 100644 --- a/src/lib/ecore_con/efl_net_dialer_ssl.c +++ b/src/lib/ecore_con/efl_net_dialer_ssl.c @@ -50,7 +50,7 @@ _efl_net_dialer_ssl_error(void *data EINA_UNUSED, const Efl_Event *event) { Eo *o = event->object; Eina_Error *perr = event->info; - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, perr); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_ERROR, perr); } EFL_CALLBACKS_ARRAY_DEFINE(_efl_net_dialer_ssl_cbs, @@ -84,7 +84,7 @@ _efl_net_dialer_ssl_efl_object_finalize(Eo *o, Efl_Net_Dialer_Ssl_Data *pd) else { if (!pd->ssl_ctx) - pd->ssl_ctx = efl_ref(efl_net_ssl_context_default_dialer_get(EFL_NET_SSL_CONTEXT_CLASS)); + pd->ssl_ctx = efl_ref(efl_net_ssl_context_default_dialer_get()); efl_net_socket_ssl_adopt(o, pd->sock, pd->ssl_ctx); } @@ -134,7 +134,7 @@ _efl_net_dialer_ssl_connect_timeout(Eo *o, void *data EINA_UNUSED, const Eina_Va efl_ref(o); efl_io_reader_eos_set(o, EINA_TRUE); - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, &err); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_ERROR, &err); efl_unref(o); return v; } @@ -205,7 +205,7 @@ _efl_net_dialer_ssl_efl_net_dialer_connected_set(Eo *o, Efl_Net_Dialer_Ssl_Data eina_future_cancel(pd->connect_timeout); if (pd->connected == connected) return; pd->connected = connected; - if (connected) efl_event_callback_call(o, EFL_NET_DIALER_EVENT_CONNECTED, NULL); + if (connected) efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_CONNECTED, NULL); } EOLIAN static Eina_Bool diff --git a/src/lib/ecore_con/efl_net_dialer_ssl.eo b/src/lib/ecore_con/efl_net_dialer_ssl.eo index 832361bbea..6172bd24d9 100644 --- a/src/lib/ecore_con/efl_net_dialer_ssl.eo +++ b/src/lib/ecore_con/efl_net_dialer_ssl.eo @@ -1,4 +1,4 @@ -class Efl.Net.Dialer_Ssl extends Efl.Net.Socket_Ssl implements Efl.Net.Dialer { +class @beta Efl.Net.Dialer_Ssl extends Efl.Net.Socket_Ssl implements Efl.Net.Dialer { [[Connects to a remote SSL server using TCP. This creates an internal @Efl.Net.Dialer_Tcp and once connected @@ -21,8 +21,6 @@ class Efl.Net.Dialer_Ssl extends Efl.Net.Socket_Ssl implements Efl.Net.Dialer { - socks5://proxyserver (default port 1080) - socks4a://proxyserver:port (SOCKSv4 and let socks server to resolve domain) - socks4://proxyserver:port (SOCKSv4) - - @since 1.19 ]] methods { diff --git a/src/lib/ecore_con/efl_net_dialer_tcp.c b/src/lib/ecore_con/efl_net_dialer_tcp.c index 9a7a795faa..ba93fc4c74 100644 --- a/src/lib/ecore_con/efl_net_dialer_tcp.c +++ b/src/lib/ecore_con/efl_net_dialer_tcp.c @@ -99,7 +99,7 @@ _efl_net_dialer_tcp_connect_timeout(Eo *o, void *data EINA_UNUSED, const Eina_Va efl_ref(o); efl_io_reader_eos_set(o, EINA_TRUE); - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, &err); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_ERROR, &err); efl_unref(o); return v; } @@ -128,7 +128,7 @@ _efl_net_dialer_tcp_connected(void *data, const struct sockaddr *addr, socklen_t efl_loop_fd_set(o, sockfd); if (efl_net_socket_address_remote_get(o)) { - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_RESOLVED, NULL); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_RESOLVED, NULL); efl_net_dialer_connected_set(o, EINA_TRUE); } else @@ -148,11 +148,11 @@ _efl_net_dialer_tcp_connected(void *data, const struct sockaddr *addr, socklen_t if (efl_net_ip_port_fmt(buf, sizeof(buf), addr)) { efl_net_socket_address_remote_set(o, buf); - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_RESOLVED, NULL); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_RESOLVED, NULL); } } efl_io_reader_eos_set(o, EINA_TRUE); - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, &err); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_ERROR, &err); } efl_unref(o); @@ -245,7 +245,7 @@ _efl_net_dialer_tcp_efl_net_dialer_connected_set(Eo *o, Efl_Net_Dialer_Tcp_Data if (!connected) _efl_net_dialer_tcp_async_stop(pd); if (pd->connected == connected) return; pd->connected = connected; - if (connected) efl_event_callback_call(o, EFL_NET_DIALER_EVENT_CONNECTED, NULL); + if (connected) efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_CONNECTED, NULL); } EOLIAN static Eina_Bool diff --git a/src/lib/ecore_con/efl_net_dialer_tcp.eo b/src/lib/ecore_con/efl_net_dialer_tcp.eo index 75c7deeefc..4b01aeec9d 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 extends Efl.Net.Socket_Tcp implements Efl.Net.Dialer { +class @beta Efl.Net.Dialer_Tcp extends Efl.Net.Socket_Tcp implements Efl.Net.Dialer { [[Connects to a remote TCP server. If the proxy is NULL (default), then the system proxy will be @@ -18,8 +18,6 @@ class Efl.Net.Dialer_Tcp extends Efl.Net.Socket_Tcp implements Efl.Net.Dialer { - socks5://proxyserver (default port 1080) - socks4a://proxyserver:port (SOCKSv4 and let socks server to resolve domain) - socks4://proxyserver:port (SOCKSv4) - - @since 1.19 ]] implements { diff --git a/src/lib/ecore_con/efl_net_dialer_udp.c b/src/lib/ecore_con/efl_net_dialer_udp.c index 351d077909..e75ed24fed 100644 --- a/src/lib/ecore_con/efl_net_dialer_udp.c +++ b/src/lib/ecore_con/efl_net_dialer_udp.c @@ -95,7 +95,7 @@ _efl_net_dialer_udp_resolver_timeout(Eo *o, void *data EINA_UNUSED, const Eina_V efl_ref(o); efl_io_reader_eos_set(o, EINA_TRUE); - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, &err); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_ERROR, &err); efl_unref(o); return v; } @@ -143,7 +143,7 @@ _efl_net_dialer_udp_resolved_bind(Eo *o, Efl_Net_Dialer_Udp_Data *pd EINA_UNUSED if (family == AF_INET) { const struct sockaddr_in *a = (const struct sockaddr_in *)addr->ai_addr; - uint32_t ipv4 = ntohl(a->sin_addr.s_addr); + uint32_t ipv4 = eina_ntohl(a->sin_addr.s_addr); if (ipv4 == INADDR_BROADCAST) { #ifdef _WIN32 @@ -180,11 +180,11 @@ _efl_net_dialer_udp_resolved_bind(Eo *o, Efl_Net_Dialer_Udp_Data *pd EINA_UNUSED } } - remote_address = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, addr->ai_addr); + remote_address = efl_net_ip_address_create_sockaddr(addr->ai_addr); if (remote_address) { efl_net_socket_udp_init(o, remote_address); - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_RESOLVED, NULL); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_RESOLVED, NULL); efl_del(remote_address); } efl_net_dialer_connected_set(o, EINA_TRUE); @@ -230,12 +230,12 @@ _efl_net_dialer_udp_resolved(void *data, const char *host EINA_UNUSED, const cha if (efl_net_ip_port_fmt(buf, sizeof(buf), result->ai_addr)) { efl_net_socket_address_remote_set(o, buf); - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_RESOLVED, NULL); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_RESOLVED, NULL); } } efl_io_reader_eos_set(o, EINA_TRUE); - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, &err); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_ERROR, &err); } freeaddrinfo(result); @@ -319,7 +319,7 @@ _efl_net_dialer_udp_efl_net_dialer_connected_set(Eo *o, Efl_Net_Dialer_Udp_Data if (pd->resolver.timeout) eina_future_cancel(pd->resolver.timeout); if (pd->connected == connected) return; pd->connected = connected; - if (connected) efl_event_callback_call(o, EFL_NET_DIALER_EVENT_CONNECTED, NULL); + if (connected) efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_CONNECTED, NULL); } EOLIAN static Eina_Bool diff --git a/src/lib/ecore_con/efl_net_dialer_udp.eo b/src/lib/ecore_con/efl_net_dialer_udp.eo index af7aeec1bd..15a957248b 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 extends Efl.Net.Socket_Udp implements Efl.Net.Dialer { +class @beta Efl.Net.Dialer_Udp extends Efl.Net.Socket_Udp implements Efl.Net.Dialer { [[Connects to a remote UDP server. UDP proxies are not supported, not even using SOCKSv5. @@ -19,10 +19,6 @@ class Efl.Net.Dialer_Udp extends Efl.Net.Socket_Udp implements Efl.Net.Dialer { - @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 - - @since 1.19 ]] implements { diff --git a/src/lib/ecore_con/efl_net_dialer_unix.c b/src/lib/ecore_con/efl_net_dialer_unix.c index 95e2b06457..b2d3dfce39 100644 --- a/src/lib/ecore_con/efl_net_dialer_unix.c +++ b/src/lib/ecore_con/efl_net_dialer_unix.c @@ -84,7 +84,7 @@ _efl_net_dialer_unix_connect_timeout(Eo *o, void *data EINA_UNUSED, const Eina_V efl_ref(o); efl_io_reader_eos_set(o, EINA_TRUE); - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, &err); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_ERROR, &err); efl_unref(o); return v; } @@ -105,7 +105,7 @@ _efl_net_dialer_unix_connected(void *data, const struct sockaddr *addr, socklen_ efl_loop_fd_set(o, sockfd); if (efl_net_socket_address_remote_get(o)) { - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_RESOLVED, NULL); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_RESOLVED, NULL); efl_net_dialer_connected_set(o, EINA_TRUE); } else @@ -120,7 +120,7 @@ _efl_net_dialer_unix_connected(void *data, const struct sockaddr *addr, socklen_ if (err) { efl_io_reader_eos_set(o, EINA_TRUE); - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, &err); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_ERROR, &err); } efl_unref(o); @@ -222,7 +222,7 @@ _efl_net_dialer_unix_efl_net_dialer_connected_set(Eo *o, Efl_Net_Dialer_Unix_Dat if (pd->connect.timeout) eina_future_cancel(pd->connect.timeout); if (pd->connected == connected) return; pd->connected = connected; - if (connected) efl_event_callback_call(o, EFL_NET_DIALER_EVENT_CONNECTED, NULL); + if (connected) efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_CONNECTED, NULL); } EOLIAN static Eina_Bool diff --git a/src/lib/ecore_con/efl_net_dialer_unix.eo b/src/lib/ecore_con/efl_net_dialer_unix.eo index f2454e5db2..a9a7693300 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 extends Efl.Net.Socket_Unix implements Efl.Net.Dialer { +class @beta Efl.Net.Dialer_Unix extends Efl.Net.Socket_Unix implements Efl.Net.Dialer { [[Connects to a local AF_UNIX server. The dial address is a file system path (portable) or @@ -6,8 +6,6 @@ class Efl.Net.Dialer_Unix extends Efl.Net.Socket_Unix implements Efl.Net.Dialer Note: Proxies are meaningless for AF_UNIX family, thus are not implemented. - - @since 1.19 ]] implements { diff --git a/src/lib/ecore_con/efl_net_dialer_websocket.c b/src/lib/ecore_con/efl_net_dialer_websocket.c index 30545f23c9..e6672e600c 100644 --- a/src/lib/ecore_con/efl_net_dialer_websocket.c +++ b/src/lib/ecore_con/efl_net_dialer_websocket.c @@ -350,7 +350,7 @@ _efl_net_dialer_websocket_job_send(Eo *o, Efl_Net_Dialer_Websocket_Data *pd) if ((err) && (err != EAGAIN)) { ERR("could not write to HTTP socket #%d '%s'", err, eina_error_msg_get(err)); - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, &err); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_ERROR, &err); } } @@ -730,7 +730,7 @@ _efl_net_dialer_websocket_job_receive(Eo *o, Efl_Net_Dialer_Websocket_Data *pd) eina_error_msg_get(err)); efl_ref(o); efl_io_closer_close(pd->http); - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, &err); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_ERROR, &err); efl_unref(o); } @@ -819,7 +819,7 @@ _efl_net_dialer_websocket_http_error(void *data, const Efl_Event *event) return; efl_ref(o); if (!efl_io_closer_closed_get(o)) efl_io_closer_close(o); - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, perr); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_ERROR, perr); efl_unref(o); } @@ -846,7 +846,7 @@ _efl_net_dialer_websocket_http_headers_done(void *data, const Efl_Event *event E status, EFL_NET_HTTP_STATUS_SWITCHING_PROTOCOLS); efl_ref(o); efl_io_closer_close(pd->http); - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, &err); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_ERROR, &err); efl_unref(o); return; } @@ -887,7 +887,7 @@ _efl_net_dialer_websocket_http_headers_done(void *data, const Efl_Event *event E upgraded, connection_websocket, accepted); efl_ref(o); efl_io_closer_close(pd->http); - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, &err); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_ERROR, &err); efl_unref(o); return; } @@ -934,7 +934,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(_efl_net_dialer_websocket_http_cbs, {EFL_IO_READER_EVENT_CAN_READ_CHANGED, _efl_net_dialer_websocket_http_can_read_changed}, {EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, _efl_net_dialer_websocket_http_can_write_changed}, {EFL_IO_CLOSER_EVENT_CLOSED, _efl_net_dialer_websocket_http_closed}, - {EFL_NET_DIALER_EVENT_ERROR, _efl_net_dialer_websocket_http_error}, + {EFL_NET_DIALER_EVENT_DIALER_ERROR, _efl_net_dialer_websocket_http_error}, {EFL_NET_DIALER_HTTP_EVENT_HEADERS_DONE, _efl_net_dialer_websocket_http_headers_done}); EOLIAN static Efl_Object * @@ -1182,7 +1182,7 @@ _efl_net_dialer_websocket_efl_net_dialer_connected_set(Eo *o, Efl_Net_Dialer_Web if (pd->connected == connected) return; pd->connected = connected; if (connected) - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_CONNECTED, NULL); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_CONNECTED, NULL); } EOLIAN static Eina_Bool @@ -1225,7 +1225,7 @@ EOLIAN static void _efl_net_dialer_websocket_efl_net_socket_address_remote_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd, const char *address) { if (eina_stringshare_replace(&pd->address_remote, address)) - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_RESOLVED, NULL); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_RESOLVED, NULL); } EOLIAN static const char * @@ -1297,7 +1297,13 @@ _efl_net_dialer_websocket_efl_io_reader_can_read_set(Eo *o, Efl_Net_Dialer_Webso if (pd->streaming_mode == EFL_NET_DIALER_WEBSOCKET_STREAMING_MODE_DISABLED) return; if (pd->can_read == can_read) return; pd->can_read = can_read; - efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, &can_read); +} + +EOLIAN static void +_efl_net_dialer_websocket_efl_io_reader_eos_set(Eo *obj EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd EINA_UNUSED, Eina_Bool is_eos EINA_UNUSED) +{ + /* NOP Does not need to be implemented, someone else cannot tell this class to be at the eos. This is done internally and decided within the state of the websocket.*/ } EOLIAN static Eina_Bool @@ -1344,7 +1350,7 @@ _efl_net_dialer_websocket_efl_io_writer_can_write_set(Eo *o, Efl_Net_Dialer_Webs can_write = EINA_FALSE; if (pd->can_write == can_write) return; pd->can_write = can_write; - efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, &can_write); } EOLIAN static Eina_Error diff --git a/src/lib/ecore_con/efl_net_dialer_websocket.eo b/src/lib/ecore_con/efl_net_dialer_websocket.eo index f7a18122c0..262ad755fd 100644 --- a/src/lib/ecore_con/efl_net_dialer_websocket.eo +++ b/src/lib/ecore_con/efl_net_dialer_websocket.eo @@ -1,25 +1,21 @@ import eina_types; import efl_net_http_types; -enum Efl.Net.Dialer_Websocket_Streaming_Mode { +enum @beta 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]] } -enum Efl.Net.Dialer_Websocket_Close_Reason { +enum @beta Efl.Net.Dialer_Websocket_Close_Reason { [[Registered reasons for the CLOSE (opcode=0x8). These are the well known reasons, with some ranges being defined using "_start" and "end" suffixes. See https://tools.ietf.org/html/rfc6455#section-7.4.1 - - @since 1.19 ]] normal = 1000, [[Indicates a normal closure, meaning that the purpose for which the connection was established has been fulfilled.]] going_away = 1001, [[Indicates that an endpoint is "going away", such as a server going down or a browser having navigated away from a page.]] @@ -38,16 +34,14 @@ enum Efl.Net.Dialer_Websocket_Close_Reason { private_end = 4999, [[Applications can use range 4000-4999]] } -struct Efl.Net.Dialer_Websocket_Closed_Reason { +struct @beta Efl.Net.Dialer_Websocket_Closed_Reason { [[Close reason event payload. - - @since 1.19 ]] reason: Efl.Net.Dialer_Websocket_Close_Reason; [[Closing reason]] message: string; [[Textual closing reason message]] } -class Efl.Net.Dialer_Websocket extends Efl.Loop_Consumer implements Efl.Net.Dialer { +class @beta Efl.Net.Dialer_Websocket extends Efl.Loop_Consumer implements Efl.Net.Dialer { [[WebSocket Dialer (Client). The WebSocket Protocol (https://tools.ietf.org/html/rfc6455) is @@ -74,8 +68,6 @@ class Efl.Net.Dialer_Websocket extends Efl.Loop_Consumer implements Efl.Net.Dial - socks5://proxyserver (default port 1080) - socks4a://proxyserver:port (SOCKSv4 and let socks server to resolve domain) - socks4://proxyserver:port (SOCKSv4) - - @since 1.19 ]] methods { @@ -325,7 +317,7 @@ class Efl.Net.Dialer_Websocket extends Efl.Loop_Consumer implements Efl.Net.Dial Efl.Net.Socket.address_remote { get; set; } Efl.Io.Reader.read; Efl.Io.Reader.can_read { get; set; } - Efl.Io.Reader.eos { get; } + Efl.Io.Reader.eos { get; set; } Efl.Io.Writer.write; Efl.Io.Writer.can_write { get; set; } Efl.Io.Closer.close; diff --git a/src/lib/ecore_con/efl_net_dialer_windows.c b/src/lib/ecore_con/efl_net_dialer_windows.c index 8e78446b6f..bf6d525e36 100644 --- a/src/lib/ecore_con/efl_net_dialer_windows.c +++ b/src/lib/ecore_con/efl_net_dialer_windows.c @@ -100,7 +100,7 @@ _efl_net_dialer_windows_efl_net_dialer_dial(Eo *o, Efl_Net_Dialer_Windows_Data * efl_net_socket_address_remote_set(o, sstr); efl_net_socket_address_local_set(o, cstr); - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_RESOLVED, NULL); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_RESOLVED, NULL); efl_net_dialer_connected_set(o, EINA_TRUE); return _efl_net_socket_windows_io_start(o); @@ -125,7 +125,7 @@ _efl_net_dialer_windows_efl_net_dialer_connected_set(Eo *o, Efl_Net_Dialer_Windo { if (pd->connected == connected) return; pd->connected = connected; - if (connected) efl_event_callback_call(o, EFL_NET_DIALER_EVENT_CONNECTED, NULL); + if (connected) efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_CONNECTED, NULL); } EOLIAN static Eina_Bool diff --git a/src/lib/ecore_con/efl_net_dialer_windows.eo b/src/lib/ecore_con/efl_net_dialer_windows.eo index 202b636183..49878f5ece 100644 --- a/src/lib/ecore_con/efl_net_dialer_windows.eo +++ b/src/lib/ecore_con/efl_net_dialer_windows.eo @@ -1,12 +1,10 @@ -class Efl.Net.Dialer_Windows extends Efl.Net.Socket_Windows implements Efl.Net.Dialer { +class @beta Efl.Net.Dialer_Windows extends Efl.Net.Socket_Windows implements Efl.Net.Dialer { [[Connects to a Windows NamedPipe server. The dial address will have "\\\\.\\pipe\\" prepended as required by Windows CreateNamedPipe(). Note: Proxies are meaningless, thus are not implemented. - - @since 1.19 ]] implements { diff --git a/src/lib/ecore_con/efl_net_http_types.eot b/src/lib/ecore_con/efl_net_http_types.eot index f2e5aaa0e7..01a4cff5d3 100644 --- a/src/lib/ecore_con/efl_net_http_types.eot +++ b/src/lib/ecore_con/efl_net_http_types.eot @@ -1,6 +1,6 @@ import eina_types; -enum Efl.Net.Http.Version { +enum @beta Efl.Net.Http.Version { [[HTTP protocol versions]] v1_0 = 100, [[HTTP version 1.0]] @@ -8,7 +8,7 @@ enum Efl.Net.Http.Version { v2_0 = 200, [[HTTP version 2.0]] } -enum Efl.Net.Http.Authentication_Method { +enum @beta Efl.Net.Http.Authentication_Method { [[HTTP authentication methods]] none = 0, [[HTTP authentication method none]] @@ -21,7 +21,7 @@ enum Efl.Net.Http.Authentication_Method { any = Efl.Net.Http.Authentication_Method.any_safe | Efl.Net.Http.Authentication_Method.basic, [[HTTP authentication method any]] } -enum Efl.Net.Http.Status { +enum @beta Efl.Net.Http.Status { [[Common HTTP status codes. A more detailed description on the various HTTPS status codes can be found one Wikipedia: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes]] @@ -109,7 +109,7 @@ enum Efl.Net.Http.Status { network_authentication_required = 511, [[HTTP status code: network authentication required]] } -struct Efl.Net.Http.Header { +struct @beta Efl.Net.Http.Header { [[An HTTP Header. Do not assume strings are Eina_Stringshare and they may be @@ -126,54 +126,54 @@ struct Efl.Net.Http.Header { value: string; [[Header value]] } -var Efl.Net.Http.Error.BAD_CONTENT_ENCODING: Eina.Error; [[HTTP error: bad content encoding]] -var Efl.Net.Http.Error.BAD_DOWNLOAD_RESUME: Eina.Error; [[HTTP error: bad download resume]] -var Efl.Net.Http.Error.BAD_FUNCTION_ARGUMENT: Eina.Error; [[HTTP error: bad function argument]] -var Efl.Net.Http.Error.CHUNK_FAILED: Eina.Error; [[HTTP error: chunk failed]] -var Efl.Net.Http.Error.CONV_FAILED: Eina.Error; [[HTTP error: conv failed]] -var Efl.Net.Http.Error.CONV_REQD: Eina.Error; [[HTTP error: conv reqd]] -var Efl.Net.Http.Error.FAILED_INIT: Eina.Error; [[HTTP error: failed init]] -var Efl.Net.Http.Error.FILE_COULDNT_READ_FILE: Eina.Error; [[HTTP error: could not read file]] -var Efl.Net.Http.Error.FILESIZE_EXCEEDED: Eina.Error; [[HTTP error: filesize exceeded]] -var Efl.Net.Http.Error.FUNCTION_NOT_FOUND: Eina.Error; [[HTTP error: function not found]] -var Efl.Net.Http.Error.GOT_NOTHING: Eina.Error; [[HTTP error: got nothing]] -var Efl.Net.Http.Error.HTTP2: Eina.Error; [[HTTP error: http2]] -var Efl.Net.Http.Error.HTTP2_STREAM: Eina.Error; [[HTTP error: http2 stream]] -var Efl.Net.Http.Error.HTTP_POST_ERROR: Eina.Error; [[HTTP error: http post error]] -var Efl.Net.Http.Error.HTTP_RETURNED_ERROR: Eina.Error; [[HTTP error: http returned error]] -var Efl.Net.Http.Error.INTERFACE_FAILED: Eina.Error; [[HTTP error: interface failed]] -var Efl.Net.Http.Error.LOGIN_DENIED: Eina.Error; [[HTTP error: login denied]] -var Efl.Net.Http.Error.NO_CONNECTION_AVAILABLE: Eina.Error; [[HTTP error: no connection available]] -var Efl.Net.Http.Error.NOT_BUILT_IN: Eina.Error; [[HTTP error: not built in]] -var Efl.Net.Http.Error.OPERATION_TIMEDOUT: Eina.Error; [[HTTP error: operation timeout]] -var Efl.Net.Http.Error.PARTIAL_FILE: Eina.Error; [[HTTP error: partial file]] -var Efl.Net.Http.Error.PEER_FAILED_VERIFICATION: Eina.Error; [[HTTP error: peer failed verification]] -var Efl.Net.Http.Error.RANGE_ERROR: Eina.Error; [[HTTP error: range error]] -var Efl.Net.Http.Error.READ_ERROR: Eina.Error; [[HTTP error: read error]] -var Efl.Net.Http.Error.RECV_ERROR: Eina.Error; [[HTTP error: receive error]] -var Efl.Net.Http.Error.REMOTE_ACCESS_DENIED: Eina.Error; [[HTTP error: remote access denied]] -var Efl.Net.Http.Error.REMOTE_DISK_FULL: Eina.Error; [[HTTP error: remote disk full]] -var Efl.Net.Http.Error.REMOTE_FILE_EXISTS: Eina.Error; [[HTTP error: remote file exists]] -var Efl.Net.Http.Error.REMOTE_FILE_NOT_FOUND: Eina.Error; [[HTTP error: remote file not found]] -var Efl.Net.Http.Error.SEND_ERROR: Eina.Error; [[HTTP error: send error]] -var Efl.Net.Http.Error.SEND_FAIL_REWIND: Eina.Error; [[HTTP error: send fail rewind]] -var Efl.Net.Http.Error.SSL_CACERT: Eina.Error; [[HTTP error: SSL cacert]] -var Efl.Net.Http.Error.SSL_CACERT_BADFILE: Eina.Error; [[HTTP error: SSL cacert bad file]] -var Efl.Net.Http.Error.SSL_CERTPROBLEM: Eina.Error; [[HTTP error: SSL certproblem]] -var Efl.Net.Http.Error.SSL_CIPHER: Eina.Error; [[HTTP error: SSL cipher]] -var Efl.Net.Http.Error.SSL_CONNECT_ERROR: Eina.Error; [[HTTP error: SSL connect error]] -var Efl.Net.Http.Error.SSL_CRL_BADFILE: Eina.Error; [[HTTP error: SSL crl bad file]] -var Efl.Net.Http.Error.SSL_ENGINE_INITFAILED: Eina.Error; [[HTTP error: SSL engine init failed]] -var Efl.Net.Http.Error.SSL_ENGINE_NOTFOUND: Eina.Error; [[HTTP error: SSL engine not found]] -var Efl.Net.Http.Error.SSL_ENGINE_SETFAILED: Eina.Error; [[HTTP error: SSL engine set failed]] -var Efl.Net.Http.Error.SSL_INVALIDCERTSTATUS: Eina.Error; [[HTTP error: SSL invalid cert status]] -var Efl.Net.Http.Error.SSL_ISSUER_ERROR: Eina.Error; [[HTTP error: SSL issuer error]] -var Efl.Net.Http.Error.SSL_PINNEDPUBKEYNOTMATCH: Eina.Error; [[HTTP error: SSL pinned pub key does not match]] -var Efl.Net.Http.Error.SSL_SHUTDOWN_FAILED: Eina.Error; [[HTTP error: SSL shutdown failed]] -var Efl.Net.Http.Error.TOO_MANY_REDIRECTS: Eina.Error; [[HTTP error: too many redirects]] -var Efl.Net.Http.Error.UNKNOWN_OPTION: Eina.Error; [[HTTP error: unknown option]] -var Efl.Net.Http.Error.UNSUPPORTED_PROTOCOL: Eina.Error; [[HTTP error: unsupported protocol]] -var Efl.Net.Http.Error.UPLOAD_FAILED: Eina.Error; [[HTTP error: upload failed]] -var Efl.Net.Http.Error.URL_MALFORMAT: Eina.Error; [[HTTP error: URL mal-formatted]] -var Efl.Net.Http.Error.USE_SSL_FAILED: Eina.Error; [[HTTP error: usage of SSL failed]] -var Efl.Net.Http.Error.WRITE_ERROR: Eina.Error; [[HTTP error: write error]] +var @beta Efl.Net.Http.Error.BAD_CONTENT_ENCODING: Eina.Error; [[HTTP error: bad content encoding]] +var @beta Efl.Net.Http.Error.BAD_DOWNLOAD_RESUME: Eina.Error; [[HTTP error: bad download resume]] +var @beta Efl.Net.Http.Error.BAD_FUNCTION_ARGUMENT: Eina.Error; [[HTTP error: bad function argument]] +var @beta Efl.Net.Http.Error.CHUNK_FAILED: Eina.Error; [[HTTP error: chunk failed]] +var @beta Efl.Net.Http.Error.CONV_FAILED: Eina.Error; [[HTTP error: conv failed]] +var @beta Efl.Net.Http.Error.CONV_REQD: Eina.Error; [[HTTP error: conv reqd]] +var @beta Efl.Net.Http.Error.FAILED_INIT: Eina.Error; [[HTTP error: failed init]] +var @beta Efl.Net.Http.Error.FILE_COULDNT_READ_FILE: Eina.Error; [[HTTP error: could not read file]] +var @beta Efl.Net.Http.Error.FILESIZE_EXCEEDED: Eina.Error; [[HTTP error: filesize exceeded]] +var @beta Efl.Net.Http.Error.FUNCTION_NOT_FOUND: Eina.Error; [[HTTP error: function not found]] +var @beta Efl.Net.Http.Error.GOT_NOTHING: Eina.Error; [[HTTP error: got nothing]] +var @beta Efl.Net.Http.Error.HTTP2: Eina.Error; [[HTTP error: http2]] +var @beta Efl.Net.Http.Error.HTTP2_STREAM: Eina.Error; [[HTTP error: http2 stream]] +var @beta Efl.Net.Http.Error.HTTP_POST_ERROR: Eina.Error; [[HTTP error: http post error]] +var @beta Efl.Net.Http.Error.HTTP_RETURNED_ERROR: Eina.Error; [[HTTP error: http returned error]] +var @beta Efl.Net.Http.Error.INTERFACE_FAILED: Eina.Error; [[HTTP error: interface failed]] +var @beta Efl.Net.Http.Error.LOGIN_DENIED: Eina.Error; [[HTTP error: login denied]] +var @beta Efl.Net.Http.Error.NO_CONNECTION_AVAILABLE: Eina.Error; [[HTTP error: no connection available]] +var @beta Efl.Net.Http.Error.NOT_BUILT_IN: Eina.Error; [[HTTP error: not built in]] +var @beta Efl.Net.Http.Error.OPERATION_TIMEDOUT: Eina.Error; [[HTTP error: operation timeout]] +var @beta Efl.Net.Http.Error.PARTIAL_FILE: Eina.Error; [[HTTP error: partial file]] +var @beta Efl.Net.Http.Error.PEER_FAILED_VERIFICATION: Eina.Error; [[HTTP error: peer failed verification]] +var @beta Efl.Net.Http.Error.RANGE_ERROR: Eina.Error; [[HTTP error: range error]] +var @beta Efl.Net.Http.Error.READ_ERROR: Eina.Error; [[HTTP error: read error]] +var @beta Efl.Net.Http.Error.RECV_ERROR: Eina.Error; [[HTTP error: receive error]] +var @beta Efl.Net.Http.Error.REMOTE_ACCESS_DENIED: Eina.Error; [[HTTP error: remote access denied]] +var @beta Efl.Net.Http.Error.REMOTE_DISK_FULL: Eina.Error; [[HTTP error: remote disk full]] +var @beta Efl.Net.Http.Error.REMOTE_FILE_EXISTS: Eina.Error; [[HTTP error: remote file exists]] +var @beta Efl.Net.Http.Error.REMOTE_FILE_NOT_FOUND: Eina.Error; [[HTTP error: remote file not found]] +var @beta Efl.Net.Http.Error.SEND_ERROR: Eina.Error; [[HTTP error: send error]] +var @beta Efl.Net.Http.Error.SEND_FAIL_REWIND: Eina.Error; [[HTTP error: send fail rewind]] +var @beta Efl.Net.Http.Error.SSL_CACERT: Eina.Error; [[HTTP error: SSL cacert]] +var @beta Efl.Net.Http.Error.SSL_CACERT_BADFILE: Eina.Error; [[HTTP error: SSL cacert bad file]] +var @beta Efl.Net.Http.Error.SSL_CERTPROBLEM: Eina.Error; [[HTTP error: SSL certproblem]] +var @beta Efl.Net.Http.Error.SSL_CIPHER: Eina.Error; [[HTTP error: SSL cipher]] +var @beta Efl.Net.Http.Error.SSL_CONNECT_ERROR: Eina.Error; [[HTTP error: SSL connect error]] +var @beta Efl.Net.Http.Error.SSL_CRL_BADFILE: Eina.Error; [[HTTP error: SSL crl bad file]] +var @beta Efl.Net.Http.Error.SSL_ENGINE_INITFAILED: Eina.Error; [[HTTP error: SSL engine init failed]] +var @beta Efl.Net.Http.Error.SSL_ENGINE_NOTFOUND: Eina.Error; [[HTTP error: SSL engine not found]] +var @beta Efl.Net.Http.Error.SSL_ENGINE_SETFAILED: Eina.Error; [[HTTP error: SSL engine set failed]] +var @beta Efl.Net.Http.Error.SSL_INVALIDCERTSTATUS: Eina.Error; [[HTTP error: SSL invalid cert status]] +var @beta Efl.Net.Http.Error.SSL_ISSUER_ERROR: Eina.Error; [[HTTP error: SSL issuer error]] +var @beta Efl.Net.Http.Error.SSL_PINNEDPUBKEYNOTMATCH: Eina.Error; [[HTTP error: SSL pinned pub key does not match]] +var @beta Efl.Net.Http.Error.SSL_SHUTDOWN_FAILED: Eina.Error; [[HTTP error: SSL shutdown failed]] +var @beta Efl.Net.Http.Error.TOO_MANY_REDIRECTS: Eina.Error; [[HTTP error: too many redirects]] +var @beta Efl.Net.Http.Error.UNKNOWN_OPTION: Eina.Error; [[HTTP error: unknown option]] +var @beta Efl.Net.Http.Error.UNSUPPORTED_PROTOCOL: Eina.Error; [[HTTP error: unsupported protocol]] +var @beta Efl.Net.Http.Error.UPLOAD_FAILED: Eina.Error; [[HTTP error: upload failed]] +var @beta Efl.Net.Http.Error.URL_MALFORMAT: Eina.Error; [[HTTP error: URL mal-formatted]] +var @beta Efl.Net.Http.Error.USE_SSL_FAILED: Eina.Error; [[HTTP error: usage of SSL failed]] +var @beta Efl.Net.Http.Error.WRITE_ERROR: Eina.Error; [[HTTP error: write error]] diff --git a/src/lib/ecore_con/efl_net_ip_address.c b/src/lib/ecore_con/efl_net_ip_address.c index 46fe75bd08..cc29aba680 100644 --- a/src/lib/ecore_con/efl_net_ip_address.c +++ b/src/lib/ecore_con/efl_net_ip_address.c @@ -104,7 +104,7 @@ _efl_net_ip_address_family_get(const Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data EOLIAN static void _efl_net_ip_address_port_set(Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *pd, uint16_t port) { - uint16_t *pport, nport = htons(port); + uint16_t *pport, nport = eina_htons(port); EINA_SAFETY_ON_TRUE_RETURN(pd->addr.sa_family == 0); if (pd->addr.sa_family == AF_INET6) @@ -115,7 +115,7 @@ _efl_net_ip_address_port_set(Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *pd, uin if (*pport == nport) return; if (*pport) { - ERR("port already set to %hu, new %hu", ntohs(*pport), port); + ERR("port already set to %hu, new %hu", eina_ntohs(*pport), port); return; } @@ -133,7 +133,7 @@ _efl_net_ip_address_port_get(const Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *p else pport = &pd->ipv4.sin_port; - return ntohs(*pport); + return eina_ntohs(*pport); } EOLIAN static void @@ -213,7 +213,7 @@ _efl_net_ip_address_sockaddr_get(const Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Dat return &pd->addr; } -#define IPV4_ADDR_GET(pd) ntohl(pd->ipv4.sin_addr.s_addr) +#define IPV4_ADDR_GET(pd) eina_ntohl(pd->ipv4.sin_addr.s_addr) EOLIAN static Eina_Bool _efl_net_ip_address_ipv4_class_a_check(const Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *pd) @@ -300,7 +300,7 @@ _efl_net_ip_address_any_check(const Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data * } EOLIAN static Efl_Net_Ip_Address * -_efl_net_ip_address_create(Eo *cls, void *pd EINA_UNUSED, uint16_t port, const Eina_Slice address) +_efl_net_ip_address_create(uint16_t port, const Eina_Slice address) { int family; @@ -311,26 +311,26 @@ _efl_net_ip_address_create(Eo *cls, void *pd EINA_UNUSED, uint16_t port, const E else family = AF_INET; - return efl_add_ref(cls, efl_main_loop_get(), + return efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, 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)); } EOLIAN static Efl_Net_Ip_Address * -_efl_net_ip_address_create_sockaddr(Eo *cls, void *pd EINA_UNUSED, const void *ptr) +_efl_net_ip_address_create_sockaddr(const void *ptr) { const struct sockaddr *sockaddr = ptr; 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_ref(cls, efl_main_loop_get(), + return efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get(), efl_net_ip_address_sockaddr_set(efl_added, sockaddr)); } EOLIAN static Efl_Net_Ip_Address * -_efl_net_ip_address_parse(Eo *cls, void *pd EINA_UNUSED, const char *numeric_address) +_efl_net_ip_address_parse(const char *numeric_address) { struct sockaddr_storage ss; Eina_Bool r; @@ -368,7 +368,7 @@ _efl_net_ip_address_parse(Eo *cls, void *pd EINA_UNUSED, const char *numeric_add return NULL; } - return efl_add_ref(cls, efl_main_loop_get(), + return efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get(), efl_net_ip_address_sockaddr_set(efl_added, &ss)); } @@ -509,7 +509,7 @@ _efl_net_ip_address_resolve_done(void *data, 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); + o = efl_net_ip_address_create_sockaddr(a->ai_addr); if (!o) continue ; eina_value_array_append(&r, o); @@ -536,7 +536,7 @@ _efl_net_ip_address_resolve_done(void *data, } 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(const char *address, int family, int flags) { Efl_Net_Ip_Address_Resolve_Context *ctx; struct addrinfo hints = { }; diff --git a/src/lib/ecore_con/efl_net_ip_address.eo b/src/lib/ecore_con/efl_net_ip_address.eo index 3d1263134f..8e0370a201 100644 --- a/src/lib/ecore_con/efl_net_ip_address.eo +++ b/src/lib/ecore_con/efl_net_ip_address.eo @@ -1,18 +1,16 @@ import eina_types; -struct Efl.Net.Ip_Address_Resolve_Results { +struct @beta 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. - - @since 1.19 ]] request_address: string; [[The 'address' argument given to Efl.Net.Ip_Address.resolve]] canonical_name: string; [[The canonical name, if it was requested in flags]] results: array; [[The resolved objects. Do not modify this array but you can keep reference to elements using efl_ref() and efl_unref()]] } -class Efl.Net.Ip_Address extends Efl.Object { +class @beta Efl.Net.Ip_Address extends Efl.Object { [[An Internet Protocol (IP) Address. This class is a set of helpers to translate to and from address @@ -36,8 +34,6 @@ class Efl.Net.Ip_Address extends Efl.Object { The result of @.string can be passed to @Efl.Net.Dialer.dial and @Efl.Net.Server.serve - - @since 1.19 ]] methods { diff --git a/src/lib/ecore_con/efl_net_server.eo b/src/lib/ecore_con/efl_net_server.eo index 8e9487f310..72b0bb25d9 100644 --- a/src/lib/ecore_con/efl_net_server.eo +++ b/src/lib/ecore_con/efl_net_server.eo @@ -1,4 +1,4 @@ -interface Efl.Net.Server { +interface @beta Efl.Net.Server { [[The basic server interface. This will start serving and accepting clients once @.serve is @@ -9,8 +9,6 @@ interface Efl.Net.Server { interface. These implement the standard @Efl.Io.Reader, @Efl.Io.Writer and @Efl.Io.Closer interfaces, so can be used with utilities such as @Efl.Io.Copier. - - @since 1.19 ]] events { @@ -26,7 +24,7 @@ interface Efl.Net.Server { excess, see @.clients_limit. ]] - error: Eina.Error; [[An error has occurred and the server needs + server,error: Eina.Error; [[An error has occurred and the server needs to be stopped. ]] serving: void; [[Notifies the server is ready to accept clients. diff --git a/src/lib/ecore_con/efl_net_server_fd.c b/src/lib/ecore_con/efl_net_server_fd.c index 8a493404a9..e4e6461576 100644 --- a/src/lib/ecore_con/efl_net_server_fd.c +++ b/src/lib/ecore_con/efl_net_server_fd.c @@ -54,7 +54,7 @@ efl_net_accept4(SOCKET fd, struct sockaddr *addr, socklen_t *addrlen, Eina_Bool if (!eina_file_close_on_exec(client, EINA_TRUE)) { int errno_bkp = errno; - ERR("fcntl(" SOCKET_FMT ", F_SETFD, FD_CLOEXEC): %s", client, strerror(errno)); + ERR("fcntl(" SOCKET_FMT ", F_SETFD, FD_CLOEXEC): %s", client, eina_error_msg_get(errno)); closesocket(client); errno = errno_bkp; return INVALID_SOCKET; @@ -81,7 +81,7 @@ _efl_net_server_fd_event_error(void *data EINA_UNUSED, const Efl_Event *event) Eina_Error err = EBADF; efl_net_server_serving_set(o, EINA_FALSE); - efl_event_callback_call(o, EFL_NET_SERVER_EVENT_ERROR, &err); + efl_event_callback_call(o, EFL_NET_SERVER_EVENT_SERVER_ERROR, &err); } EOLIAN static Efl_Object * @@ -282,7 +282,7 @@ _efl_net_server_fd_close_on_exec_set(Eo *o, Efl_Net_Server_Fd_Data *pd, Eina_Boo if (!eina_file_close_on_exec(fd, close_on_exec)) { - ERR("fcntl(" SOCKET_FMT ", F_SETFD,): %s", fd, strerror(errno)); + ERR("fcntl(" SOCKET_FMT ", F_SETFD,): %s", fd, eina_error_msg_get(errno)); pd->close_on_exec = old; return EINA_FALSE; } @@ -311,7 +311,7 @@ _efl_net_server_fd_close_on_exec_get(const Eo *o, Efl_Net_Server_Fd_Data *pd) flags = fcntl(fd, F_GETFD); if (flags < 0) { - ERR("fcntl(" SOCKET_FMT ", F_GETFD): %s", fd, strerror(errno)); + ERR("fcntl(" SOCKET_FMT ", F_GETFD): %s", fd, eina_error_msg_get(errno)); return EINA_FALSE; } @@ -474,7 +474,7 @@ _efl_net_server_fd_process_incoming_data(Eo *o, Efl_Net_Server_Fd_Data *pd) { Eina_Error err = efl_net_socket_error_get(); ERR("accept(" SOCKET_FMT "): %s", fd, eina_error_msg_get(err)); - efl_event_callback_call(o, EFL_NET_SERVER_EVENT_ERROR, &err); + efl_event_callback_call(o, EFL_NET_SERVER_EVENT_SERVER_ERROR, &err); return; } diff --git a/src/lib/ecore_con/efl_net_server_fd.eo b/src/lib/ecore_con/efl_net_server_fd.eo index 4758be1634..3807d3ddcc 100644 --- a/src/lib/ecore_con/efl_net_server_fd.eo +++ b/src/lib/ecore_con/efl_net_server_fd.eo @@ -1,7 +1,5 @@ -abstract Efl.Net.Server_Fd extends Efl.Loop_Fd implements Efl.Net.Server { +abstract @beta Efl.Net.Server_Fd extends Efl.Loop_Fd implements Efl.Net.Server { [[A generic server based on file descriptors. - - @since 1.19 ]] methods { diff --git a/src/lib/ecore_con/efl_net_server_ip.eo b/src/lib/ecore_con/efl_net_server_ip.eo index cb46921e9c..b398ff7497 100644 --- a/src/lib/ecore_con/efl_net_server_ip.eo +++ b/src/lib/ecore_con/efl_net_server_ip.eo @@ -1,7 +1,5 @@ -class Efl.Net.Server_Ip extends Efl.Net.Server_Fd { +abstract @beta Efl.Net.Server_Ip extends Efl.Net.Server_Fd { [[An IP server. - - @since 1.20 ]] methods { @property ipv6_only { diff --git a/src/lib/ecore_con/efl_net_server_simple.c b/src/lib/ecore_con/efl_net_server_simple.c index 8c0c4a6732..6ae83dd233 100644 --- a/src/lib/ecore_con/efl_net_server_simple.c +++ b/src/lib/ecore_con/efl_net_server_simple.c @@ -109,20 +109,20 @@ static void _efl_net_server_simple_inner_server_error(void *data, const Efl_Event *event) { Eo *o = data; - efl_event_callback_call(o, EFL_NET_SERVER_EVENT_ERROR, event->info); + efl_event_callback_call(o, EFL_NET_SERVER_EVENT_SERVER_ERROR, event->info); } static void -_efl_net_server_simple_inner_server_serving(void *data, const Efl_Event *event) +_efl_net_server_simple_inner_server_serving(void *data, const Efl_Event *event EINA_UNUSED) { Eo *o = data; - efl_event_callback_call(o, EFL_NET_SERVER_EVENT_SERVING, event->info); + efl_event_callback_call(o, EFL_NET_SERVER_EVENT_SERVING, NULL); } EFL_CALLBACKS_ARRAY_DEFINE(_efl_net_server_simple_inner_server_cbs, { EFL_NET_SERVER_EVENT_CLIENT_ADD, _efl_net_server_simple_inner_server_client_add }, { EFL_NET_SERVER_EVENT_CLIENT_REJECTED, _efl_net_server_simple_inner_server_client_rejected }, - { EFL_NET_SERVER_EVENT_ERROR, _efl_net_server_simple_inner_server_error }, + { EFL_NET_SERVER_EVENT_SERVER_ERROR, _efl_net_server_simple_inner_server_error }, { EFL_NET_SERVER_EVENT_SERVING, _efl_net_server_simple_inner_server_serving }); EOLIAN static Efl_Object * diff --git a/src/lib/ecore_con/efl_net_server_simple.eo b/src/lib/ecore_con/efl_net_server_simple.eo index 3934828ffb..3fc0400a9c 100644 --- a/src/lib/ecore_con/efl_net_server_simple.eo +++ b/src/lib/ecore_con/efl_net_server_simple.eo @@ -1,10 +1,8 @@ -class Efl.Net.Server_Simple extends Efl.Loop_Consumer implements Efl.Net.Server { +class @beta Efl.Net.Server_Simple extends Efl.Loop_Consumer implements 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. - - @since 1.19 ]] methods { @property inner_class { diff --git a/src/lib/ecore_con/efl_net_server_ssl.eo b/src/lib/ecore_con/efl_net_server_ssl.eo index 52b0bcc595..f4bbcf52f3 100644 --- a/src/lib/ecore_con/efl_net_server_ssl.eo +++ b/src/lib/ecore_con/efl_net_server_ssl.eo @@ -1,7 +1,5 @@ -class Efl.Net.Server_Ssl extends Efl.Net.Server_Tcp { +class @beta Efl.Net.Server_Ssl extends Efl.Net.Server_Tcp { [[A SSL server over TCP. - - @since 1.19 ]] methods { diff --git a/src/lib/ecore_con/efl_net_server_tcp.c b/src/lib/ecore_con/efl_net_server_tcp.c index e4e5bcb377..b4bda04192 100644 --- a/src/lib/ecore_con/efl_net_server_tcp.c +++ b/src/lib/ecore_con/efl_net_server_tcp.c @@ -138,7 +138,7 @@ _efl_net_server_tcp_resolved(void *data, const char *host EINA_UNUSED, const cha freeaddrinfo(result); end: - if (err) efl_event_callback_call(o, EFL_NET_SERVER_EVENT_ERROR, &err); + if (err) efl_event_callback_call(o, EFL_NET_SERVER_EVENT_SERVER_ERROR, &err); efl_unref(o); } diff --git a/src/lib/ecore_con/efl_net_server_tcp.eo b/src/lib/ecore_con/efl_net_server_tcp.eo index de6631a32b..0478be67ec 100644 --- a/src/lib/ecore_con/efl_net_server_tcp.eo +++ b/src/lib/ecore_con/efl_net_server_tcp.eo @@ -1,7 +1,5 @@ -class Efl.Net.Server_Tcp extends Efl.Net.Server_Ip { +class @beta Efl.Net.Server_Tcp extends Efl.Net.Server_Ip { [[A TCP server. - - @since 1.19 ]] implements { diff --git a/src/lib/ecore_con/efl_net_server_udp.c b/src/lib/ecore_con/efl_net_server_udp.c index ced3e04662..0f0b2287e9 100644 --- a/src/lib/ecore_con/efl_net_server_udp.c +++ b/src/lib/ecore_con/efl_net_server_udp.c @@ -142,7 +142,7 @@ _efl_net_server_udp_resolved_bind(Eo *o, Efl_Net_Server_Udp_Data *pd, const stru if (mr) { ERR("could not join pending multicast group '%s': %s", mcast_addr, eina_error_msg_get(mr)); - efl_event_callback_call(o, EFL_NET_SERVER_EVENT_ERROR, &mr); + efl_event_callback_call(o, EFL_NET_SERVER_EVENT_SERVER_ERROR, &mr); } } @@ -171,7 +171,7 @@ _efl_net_server_udp_resolved(void *data, const char *host EINA_UNUSED, const cha Eo *o = data; Efl_Net_Server_Udp_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; @@ -191,7 +191,7 @@ _efl_net_server_udp_resolved(void *data, const char *host EINA_UNUSED, const cha freeaddrinfo(result); end: - if (err) efl_event_callback_call(o, EFL_NET_SERVER_EVENT_ERROR, &err); + if (err) efl_event_callback_call(o, EFL_NET_SERVER_EVENT_SERVER_ERROR, &err); efl_unref(o); } @@ -328,7 +328,7 @@ _efl_net_server_udp_efl_net_server_fd_process_incoming_data(Eo *o, Efl_Net_Serve Eina_Error err = efl_net_socket_error_get(); ERR("recvfrom(" SOCKET_FMT ", %p, %zu, 0, %p, %d): %s", fd, buf, buflen, &addr, addrlen, eina_error_msg_get(err)); free(buf); - efl_event_callback_call(o, EFL_NET_SERVER_EVENT_ERROR, &err); + efl_event_callback_call(o, EFL_NET_SERVER_EVENT_SERVER_ERROR, &err); return; } if ((size_t)r < buflen) @@ -341,7 +341,7 @@ _efl_net_server_udp_efl_net_server_fd_process_incoming_data(Eo *o, Efl_Net_Serve free(buf); ERR("Out of memory on efl net udp data incoming"); - efl_event_callback_call(o, EFL_NET_SERVER_EVENT_ERROR, &err); + efl_event_callback_call(o, EFL_NET_SERVER_EVENT_SERVER_ERROR, &err); return; } } @@ -351,6 +351,7 @@ _efl_net_server_udp_efl_net_server_fd_process_incoming_data(Eo *o, Efl_Net_Serve client = eina_hash_find(pd->clients, str); if (client) { + free(buf); _efl_net_server_udp_client_feed(client, slice); return; } @@ -393,8 +394,12 @@ _efl_net_server_udp_efl_net_server_fd_process_incoming_data(Eo *o, Efl_Net_Serve efl_event_callback_add(client, EFL_IO_CLOSER_EVENT_CLOSED, _efl_net_server_udp_client_event_closed, o); if (!efl_net_server_client_announce(o, client)) - return; + { + free(buf); + return; + } + free(buf); _efl_net_server_udp_client_feed(client, slice); } diff --git a/src/lib/ecore_con/efl_net_server_udp.eo b/src/lib/ecore_con/efl_net_server_udp.eo index 3e4138eed4..3532a7bcb7 100644 --- a/src/lib/ecore_con/efl_net_server_udp.eo +++ b/src/lib/ecore_con/efl_net_server_udp.eo @@ -1,7 +1,5 @@ -class Efl.Net.Server_Udp extends Efl.Net.Server_Ip { +class @beta Efl.Net.Server_Udp extends Efl.Net.Server_Ip { [[A UDP server. - - @since 1.19 ]] methods { @@ -99,5 +97,8 @@ class Efl.Net.Server_Udp extends Efl.Net.Server_Ip { Efl.Net.Server.serve; Efl.Net.Server_Fd.process_incoming_data; Efl.Net.Server_Fd.socket_activate; + //These functions are not used, udp emits the there defined events from its internals + @empty Efl.Net.Server_Fd.client_add; + @empty Efl.Net.Server_Fd.client_reject; } } 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 52a9d38008..9a4a7990a4 100644 --- a/src/lib/ecore_con/efl_net_server_udp_client.c +++ b/src/lib/ecore_con/efl_net_server_udp_client.c @@ -234,7 +234,7 @@ _efl_net_server_udp_client_efl_io_reader_can_read_set(Eo *o, Efl_Net_Server_Udp_ EINA_SAFETY_ON_TRUE_RETURN(pd->fd == INVALID_SOCKET); if (pd->can_read == can_read) return; pd->can_read = can_read; - efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, &can_read); } EOLIAN static Eina_Bool @@ -265,7 +265,7 @@ _efl_net_server_udp_client_efl_io_writer_can_write_set(Eo *o, Efl_Net_Server_Udp EINA_SAFETY_ON_TRUE_RETURN(pd->fd == INVALID_SOCKET); if (pd->can_write == can_write) return; pd->can_write = can_write; - efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, &can_write); } EOLIAN static Eina_Bool 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 205ca8ba9f..6ffc5ec5c8 100644 --- a/src/lib/ecore_con/efl_net_server_udp_client.eo +++ b/src/lib/ecore_con/efl_net_server_udp_client.eo @@ -1,4 +1,4 @@ -class Efl.Net.Server_Udp_Client extends Efl.Object implements Efl.Net.Socket { +class @beta Efl.Net.Server_Udp_Client extends Efl.Object implements Efl.Net.Socket { [[A UDP client child of Efl.Net.Server_Udp Unlike connection protocols such as TCP or Local, UDP doesn't @@ -9,8 +9,6 @@ class Efl.Net.Server_Udp_Client extends Efl.Object implements Efl.Net.Socket { Given this limitation, some features such as 'cork' (used to coalesce multiple writes() into a single datagram) are not available since it could interfere with other clients. - - @since 1.19 ]] methods { diff --git a/src/lib/ecore_con/efl_net_server_unix.c b/src/lib/ecore_con/efl_net_server_unix.c index 38280c27c8..ed8735fb0b 100644 --- a/src/lib/ecore_con/efl_net_server_unix.c +++ b/src/lib/ecore_con/efl_net_server_unix.c @@ -165,7 +165,7 @@ _efl_net_server_unix_bind(Eo *o, Efl_Net_Server_Unix_Data *pd) error: if (err) { - efl_event_callback_call(o, EFL_NET_SERVER_EVENT_ERROR, &err); + efl_event_callback_call(o, EFL_NET_SERVER_EVENT_SERVER_ERROR, &err); if (fd != INVALID_SOCKET) closesocket(fd); efl_loop_fd_set(o, SOCKET_TO_LOOP_FD(INVALID_SOCKET)); } diff --git a/src/lib/ecore_con/efl_net_server_unix.eo b/src/lib/ecore_con/efl_net_server_unix.eo index 9e05dd6848..0a7f3f435e 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 extends Efl.Net.Server_Fd { +class @beta Efl.Net.Server_Unix extends Efl.Net.Server_Fd { [[An AF_UNIX server. The @Efl.Net.Server.serve method will call bind(2) directly. @@ -6,8 +6,6 @@ class Efl.Net.Server_Unix extends Efl.Net.Server_Fd { created socket must be subject to some special mode or user, change before executing said method, for example by calling umask(2). - - @since 1.19 ]] methods { diff --git a/src/lib/ecore_con/efl_net_server_windows.c b/src/lib/ecore_con/efl_net_server_windows.c index 68e7fe9906..454e87c547 100644 --- a/src/lib/ecore_con/efl_net_server_windows.c +++ b/src/lib/ecore_con/efl_net_server_windows.c @@ -151,7 +151,7 @@ _efl_net_server_windows_client_listen_failure(void *data, Eo *client EINA_UNUSED } if (err) - efl_event_callback_call(o, EFL_NET_SERVER_EVENT_ERROR, &err); + efl_event_callback_call(o, EFL_NET_SERVER_EVENT_SERVER_ERROR, &err); // TODO: create a new one on failure? diff --git a/src/lib/ecore_con/efl_net_server_windows.eo b/src/lib/ecore_con/efl_net_server_windows.eo index 5bd087a534..fad8a4f318 100644 --- a/src/lib/ecore_con/efl_net_server_windows.eo +++ b/src/lib/ecore_con/efl_net_server_windows.eo @@ -1,12 +1,10 @@ -class Efl.Net.Server_Windows extends Efl.Loop_Consumer implements Efl.Net.Server { +class @beta Efl.Net.Server_Windows extends Efl.Loop_Consumer implements Efl.Net.Server { [[A Windows NamedPipe server. The @Efl.Net.Server.serve method calls CreateNamedPipe() directly, so the path will be accessed and created in that method. If the created socket must be subject to some special mode or user, change before executing said method. - - @since 1.19 ]] methods { diff --git a/src/lib/ecore_con/efl_net_session.eo b/src/lib/ecore_con/efl_net_session.eo index 84db3f8ab7..d9f55e5c0f 100644 --- a/src/lib/ecore_con/efl_net_session.eo +++ b/src/lib/ecore_con/efl_net_session.eo @@ -1,7 +1,5 @@ -enum Efl.Net.Session_State { +enum @beta Efl.Net.Session_State { [[Provides the session connectivity state. - - @since 1.19 ]] offline, [[No access point is connected.]] local, [[At least one access point has connected and the internet connection hasn't been verified.]] @@ -9,10 +7,8 @@ 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 @beta Efl.Net.Session_Technology { [[Bitwise-able technologies to allow for a network session. - - @since 1.9 ]] unknown = 0, [[Type: unknown]] /* system = (1 << 0), [[Type: system]]*/ @@ -27,7 +23,7 @@ enum Efl.Net.Session_Technology { 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 extends Efl.Loop_Consumer { +class @beta Efl.Net.Session extends Efl.Loop_Consumer { [[Used by application to request network connectivity. This API is targeted at applications that need access to the @@ -47,8 +43,6 @@ class Efl.Net.Session extends Efl.Loop_Consumer { Note: the @.connect method is subject to backend policy. For instance, ConnMan uses https://github.com/aldebaran/connman/blob/master/doc/session-policy-format.txt - - @since 1.19 ]] events { changed: void; [[Called when some properties were changed.]] diff --git a/src/lib/ecore_con/efl_net_socket.eo b/src/lib/ecore_con/efl_net_socket.eo index f8741226ad..c16a19dc51 100644 --- a/src/lib/ecore_con/efl_net_socket.eo +++ b/src/lib/ecore_con/efl_net_socket.eo @@ -1,4 +1,4 @@ -interface Efl.Net.Socket extends Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer { +interface @beta Efl.Net.Socket extends Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer { [[The basic socket interface. This is built upon the three core Input/Output interfaces: @@ -7,8 +7,6 @@ interface Efl.Net.Socket extends Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer { - @Efl.Io.Closer: to close the socket for further operations. As such it can be used with utilities like @Efl.Io.Copier. - - @since 1.19 ]] methods { @property address_local { diff --git a/src/lib/ecore_con/efl_net_socket_fd.eo b/src/lib/ecore_con/efl_net_socket_fd.eo index c5b468b759..8c4147fa33 100644 --- a/src/lib/ecore_con/efl_net_socket_fd.eo +++ b/src/lib/ecore_con/efl_net_socket_fd.eo @@ -1,4 +1,4 @@ -class Efl.Net.Socket_Fd extends Efl.Loop_Fd implements Efl.Io.Reader_Fd, Efl.Io.Writer_Fd, Efl.Io.Closer_Fd, Efl.Net.Socket { +class @beta Efl.Net.Socket_Fd extends Efl.Loop_Fd implements 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 @@ -7,8 +7,6 @@ class Efl.Net.Socket_Fd extends Efl.Loop_Fd implements Efl.Io.Reader_Fd, Efl.Io. @Efl.Io.Closer.close_on_exec and @Efl.Io.Closer.close_on_invalidate are respected and default to $true. - - @since 1.19 ]] methods { diff --git a/src/lib/ecore_con/efl_net_socket_simple.eo b/src/lib/ecore_con/efl_net_socket_simple.eo index 07b7c3e8da..493fe30a13 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 extends Efl.Io.Buffered_Stream implements Efl.Net.Socket { +class @beta Efl.Net.Socket_Simple extends Efl.Io.Buffered_Stream implements Efl.Net.Socket { [[A wrapper socket offering an easy to use, buffered I/O. The simple socket encapsulates an actual @Efl.Net.Socket and @@ -33,8 +33,6 @@ class Efl.Net.Socket_Simple extends Efl.Io.Buffered_Stream implements Efl.Net.So @Efl.Io.Buffered_Stream.inner_io.set and can be retrieved with @Efl.Io.Buffered_Stream.inner_io.get, which should be used with care. - - @since 1.19 ]] implements { diff --git a/src/lib/ecore_con/efl_net_socket_ssl.c b/src/lib/ecore_con/efl_net_socket_ssl.c index 3f9e6cebf4..c952acbaeb 100644 --- a/src/lib/ecore_con/efl_net_socket_ssl.c +++ b/src/lib/ecore_con/efl_net_socket_ssl.c @@ -225,7 +225,7 @@ efl_net_socket_ssl_sock_resolved(void *data, const Efl_Event *event EINA_UNUSED) if (pd->torndown) return; - efl_event_callback_call(o, EFL_NET_DIALER_EVENT_RESOLVED, NULL); + efl_event_callback_call(o, EFL_NET_DIALER_EVENT_DIALER_RESOLVED, NULL); } static void @@ -250,8 +250,8 @@ efl_net_socket_ssl_sock_connected(void *data, const Efl_Event *event EINA_UNUSED } EFL_CALLBACKS_ARRAY_DEFINE(efl_net_socket_ssl_sock_dialer_cbs, - {EFL_NET_DIALER_EVENT_RESOLVED, efl_net_socket_ssl_sock_resolved}, - {EFL_NET_DIALER_EVENT_CONNECTED, efl_net_socket_ssl_sock_connected}); + {EFL_NET_DIALER_EVENT_DIALER_RESOLVED, efl_net_socket_ssl_sock_resolved}, + {EFL_NET_DIALER_EVENT_DIALER_CONNECTED, efl_net_socket_ssl_sock_connected}); static void _efl_net_socket_ssl_context_del(void *data, const Efl_Event *event EINA_UNUSED) @@ -536,7 +536,7 @@ _efl_net_socket_ssl_efl_io_reader_can_read_set(Eo *o, Efl_Net_Socket_Ssl_Data *p EINA_SAFETY_ON_NULL_RETURN(pd->sock); if (pd->can_read == can_read) return; pd->can_read = can_read; - efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, &can_read); } EOLIAN static Eina_Bool @@ -599,7 +599,7 @@ _efl_net_socket_ssl_efl_io_writer_can_write_set(Eo *o, Efl_Net_Socket_Ssl_Data * EINA_SAFETY_ON_NULL_RETURN(pd->sock); if (pd->can_write == can_write) return; pd->can_write = can_write; - efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, &can_write); } EOLIAN static Eina_Bool diff --git a/src/lib/ecore_con/efl_net_socket_ssl.eo b/src/lib/ecore_con/efl_net_socket_ssl.eo index dc607636dc..9fb0031473 100644 --- a/src/lib/ecore_con/efl_net_socket_ssl.eo +++ b/src/lib/ecore_con/efl_net_socket_ssl.eo @@ -1,15 +1,13 @@ -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 @beta Efl.Net.Socket_Ssl_Error.HANDSHAKE: Eina.Error; [[Failed SSL handshake]] +var @beta Efl.Net.Socket_Ssl_Error.CERTIFICATE_VERIFY_FAILED: Eina.Error; [[Failed to verify peer's certificate]] -class Efl.Net.Socket_Ssl extends Efl.Loop_Consumer implements Efl.Net.Socket { +class @beta Efl.Net.Socket_Ssl extends Efl.Loop_Consumer implements 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 with "client,add" event. - - @since 1.19 ]] events { diff --git a/src/lib/ecore_con/efl_net_socket_tcp.eo b/src/lib/ecore_con/efl_net_socket_tcp.eo index d3f0d5b3e7..b3232501ca 100644 --- a/src/lib/ecore_con/efl_net_socket_tcp.eo +++ b/src/lib/ecore_con/efl_net_socket_tcp.eo @@ -1,10 +1,8 @@ -class Efl.Net.Socket_Tcp extends Efl.Net.Socket_Fd { +class @beta Efl.Net.Socket_Tcp extends Efl.Net.Socket_Fd { [[A base TCP socket. This is the common class and takes an existing FD, usually created by an dialer or server. - - @since 1.19 ]] methods { diff --git a/src/lib/ecore_con/efl_net_socket_udp.c b/src/lib/ecore_con/efl_net_socket_udp.c index 487fb7a4e9..67e3f6a795 100644 --- a/src/lib/ecore_con/efl_net_socket_udp.c +++ b/src/lib/ecore_con/efl_net_socket_udp.c @@ -119,14 +119,14 @@ _efl_net_socket_udp_bind(Eo *o, Efl_Net_Socket_Udp_Data *pd) if (errno) { err = errno; - ERR("invalid port numer '%s': %s", bport, strerror(errno)); + ERR("invalid port numer '%s': %s", bport, eina_error_msg_get(errno)); goto error_bind; } if (family == AF_INET) - bsa4.sin_port = htons(ul); + bsa4.sin_port = eina_htons(ul); else - bsa6.sin6_port = htons(ul); + bsa6.sin6_port = eina_htons(ul); if (family == AF_INET) r = bind(fd, (struct sockaddr *)&bsa4, sizeof(bsa4)); @@ -539,7 +539,7 @@ _efl_net_socket_udp_efl_io_reader_read(Eo *o, Efl_Net_Socket_Udp_Data *pd, Eina_ if (addr.ss_family == AF_INET) { const struct sockaddr_in *a = (const struct sockaddr_in *)pd->addr_remote; - uint32_t ipv4 = ntohl(a->sin_addr.s_addr); + uint32_t ipv4 = eina_ntohl(a->sin_addr.s_addr); if ((ipv4 != INADDR_BROADCAST) && (ipv4 != INADDR_ANY) && (!IN_MULTICAST(ipv4))) { if ((addrlen != pd->addr_remote_len) || diff --git a/src/lib/ecore_con/efl_net_socket_udp.eo b/src/lib/ecore_con/efl_net_socket_udp.eo index 7e2b53307c..2e5ed25350 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 extends Efl.Net.Socket_Fd { +class @beta Efl.Net.Socket_Udp extends Efl.Net.Socket_Fd { [[A base UDP socket. This is the common class and takes an existing FD, usually @@ -9,8 +9,6 @@ class Efl.Net.Socket_Udp extends 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. - - @since 1.19 ]] methods { diff --git a/src/lib/ecore_con/efl_net_socket_unix.eo b/src/lib/ecore_con/efl_net_socket_unix.eo index 854130e512..04105d4b71 100644 --- a/src/lib/ecore_con/efl_net_socket_unix.eo +++ b/src/lib/ecore_con/efl_net_socket_unix.eo @@ -1,10 +1,8 @@ -class Efl.Net.Socket_Unix extends Efl.Net.Socket_Fd { +class @beta Efl.Net.Socket_Unix extends Efl.Net.Socket_Fd { [[A base UNIX socket. This is the common class and takes an existing FD, usually created by an dialer or server. - - @since 1.19 ]] implements { diff --git a/src/lib/ecore_con/efl_net_socket_windows.c b/src/lib/ecore_con/efl_net_socket_windows.c index c69d0a8b6d..717f0a0256 100644 --- a/src/lib/ecore_con/efl_net_socket_windows.c +++ b/src/lib/ecore_con/efl_net_socket_windows.c @@ -816,7 +816,7 @@ _efl_net_socket_windows_efl_io_reader_can_read_set(Eo *o, Efl_Net_Socket_Windows EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o) && can_read); if (pd->can_read == can_read) return; pd->can_read = can_read; - efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, &can_read); } EOLIAN static Eina_Bool @@ -899,7 +899,7 @@ _efl_net_socket_windows_efl_io_writer_can_write_set(Eo *o, Efl_Net_Socket_Window EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o) && can_write); if (pd->can_write == can_write) return; pd->can_write = can_write; - efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, &can_write); } EOLIAN static Eina_Bool diff --git a/src/lib/ecore_con/efl_net_socket_windows.eo b/src/lib/ecore_con/efl_net_socket_windows.eo index f1e1625aa1..aebc5ca546 100644 --- a/src/lib/ecore_con/efl_net_socket_windows.eo +++ b/src/lib/ecore_con/efl_net_socket_windows.eo @@ -1,11 +1,9 @@ -class Efl.Net.Socket_Windows extends Efl.Loop_Consumer implements Efl.Net.Socket { +class @beta Efl.Net.Socket_Windows extends Efl.Loop_Consumer implements Efl.Net.Socket { [[A base Windows NamedPipe socket. This is the common class and takes an existing file HANDLE, usually created by an dialer (CreatFile()) or server (CreateNamedPipe()). - - @since 1.19 ]] implements { diff --git a/src/lib/ecore_con/efl_net_ssl_context.c b/src/lib/ecore_con/efl_net_ssl_context.c index 271cd8afc2..a625fe81ee 100644 --- a/src/lib/ecore_con/efl_net_ssl_context.c +++ b/src/lib/ecore_con/efl_net_ssl_context.c @@ -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(const Efl_Class *klass, void *pd EINA_UNUSED) +_efl_net_ssl_context_default_dialer_get(void) { if (!_efl_net_ssl_context_default_dialer) { - _efl_net_ssl_context_default_dialer = efl_add(klass, efl_main_loop_get(), + _efl_net_ssl_context_default_dialer = efl_add(EFL_NET_SSL_CONTEXT_CLASS, 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_context.eo b/src/lib/ecore_con/efl_net_ssl_context.eo index c19fe198b8..2557a03552 100644 --- a/src/lib/ecore_con/efl_net_ssl_context.eo +++ b/src/lib/ecore_con/efl_net_ssl_context.eo @@ -1,6 +1,6 @@ import efl_net_ssl_types; -class Efl.Net.Ssl.Context extends Efl.Object { +class @beta Efl.Net.Ssl.Context extends Efl.Object { [[A SSL Context that is used to start a SSL socket wrapper. The context will contain common configurations such as @@ -12,8 +12,6 @@ class Efl.Net.Ssl.Context extends Efl.Object { operational parameters. Note: All setter methods must be called before @Efl.Object.finalize. - - @since 1.19 ]] methods { 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 7a92a821e9..cb1980827f 100644 --- a/src/lib/ecore_con/efl_net_ssl_ctx-gnutls.c +++ b/src/lib/ecore_con/efl_net_ssl_ctx-gnutls.c @@ -125,7 +125,7 @@ _efl_net_ssl_ctx_load_lists(Efl_Net_Ssl_Ctx *ctx, Efl_Net_Ssl_Ctx_Config cfg) r = 0; if (stat(path, &st) != 0) { - ERR("ssl_ctx=%p could not load certificate authorities from '%s': %s", ctx, path, strerror(errno)); + ERR("ssl_ctx=%p could not load certificate authorities from '%s': %s", ctx, path, eina_error_msg_get(errno)); eina_stringshare_del(path); *cfg.certificate_authorities = eina_list_remove_list(*cfg.certificate_authorities, n); continue; 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 6efba8476f..d8e4b6e220 100644 --- a/src/lib/ecore_con/efl_net_ssl_ctx-openssl.c +++ b/src/lib/ecore_con/efl_net_ssl_ctx-openssl.c @@ -196,7 +196,7 @@ _efl_net_ssl_ctx_check_errors(); if (stat(path, &st) != 0) { - ERR("ssl_ctx=%p could not load certificate authorities from '%s': %s", ctx, path, strerror(errno)); + ERR("ssl_ctx=%p could not load certificate authorities from '%s': %s", ctx, path, eina_error_msg_get(errno)); eina_stringshare_del(path); *cfg.certificate_authorities = eina_list_remove_list(*cfg.certificate_authorities, n); continue; diff --git a/src/lib/ecore_con/efl_net_ssl_types.eot b/src/lib/ecore_con/efl_net_ssl_types.eot index 5c41b921c5..8b7d1a1231 100644 --- a/src/lib/ecore_con/efl_net_ssl_types.eot +++ b/src/lib/ecore_con/efl_net_ssl_types.eot @@ -1,4 +1,4 @@ -enum Efl.Net.Ssl.Verify_Mode { +enum @beta Efl.Net.Ssl.Verify_Mode { [[Defines how remote peers should be verified. @since 1.19 @@ -8,7 +8,7 @@ enum Efl.Net.Ssl.Verify_Mode { required, [[Always verify and fail if certificate wasn't provided]] } -enum Efl.Net.Ssl.Cipher { +enum @beta Efl.Net.Ssl.Cipher { [[Defines the SSL/TLS version to use. Prefer 'auto' or one of the TLS variants. diff --git a/src/lib/ecore_con/efl_net_types.eot b/src/lib/ecore_con/efl_net_types.eot index f999b4f451..48512fb105 100644 --- a/src/lib/ecore_con/efl_net_types.eot +++ b/src/lib/ecore_con/efl_net_types.eot @@ -1,3 +1,3 @@ import eina_types; -var Efl.Net.Error.COULDNT_RESOLVE_HOST: Eina.Error; [[Could not resolve the given host name]] +var @beta Efl.Net.Error.COULDNT_RESOLVE_HOST: Eina.Error; [[Could not resolve the given host name]] diff --git a/src/lib/ecore_con/meson.build b/src/lib/ecore_con/meson.build index d1375e246e..eacf16f720 100644 --- a/src/lib/ecore_con/meson.build +++ b/src/lib/ecore_con/meson.build @@ -2,10 +2,7 @@ ecore_con_deps = [] ecore_con_pub_deps = [eina, eo, efl, ecore] if sys_windows == true - ipv6 = cc.compiles(''' - #include - struct ipv6_mreq tmp; - ''') + ipv6 = true else ipv6 = cc.compiles(''' #include @@ -17,36 +14,6 @@ if ipv6 config_h.set('HAVE_IPV6', 1) endif -pub_legacy_eo_files = [ - 'ecore_con_eet_base.eo', - 'ecore_con_eet_server_obj.eo', - 'ecore_con_eet_client_obj.eo' -] - -pub_eo_file_target = [] -foreach eo_file : pub_legacy_eo_files - pub_eo_file_target += custom_target('eolian_gen_' + eo_file, - input : eo_file, - output : [eo_file + '.h'], - depfile : eo_file + '.d', - install : true, - install_dir : dir_package_include, - command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories, - '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'), - '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'), - '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'), - '-gchd', '@INPUT@']) - pub_eo_file_target += custom_target('eolian_gen_legacy_' + eo_file, - input : eo_file, - output : [eo_file + '.legacy.h'], - depfile : eo_file + '.legacy.d', - install : true, - install_dir : dir_package_include, - command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories, - '-o', 'l:' + join_paths(meson.current_build_dir(), eo_file + '.legacy.h'), - '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.legacy.d'), - '-gld', '@INPUT@']) -endforeach pub_eo_files = [ 'efl_net_socket.eo', @@ -133,7 +100,13 @@ ecore_con_header_src = [ 'Efl_Net.h', 'Ecore_Con_Eet.h', 'Ecore_Con_Eet_Legacy.h', - 'Ecore_Con_Eet_Eo.h' + 'Ecore_Con_Eet_Eo.h', + 'ecore_con_eet_base_eo.h', + 'ecore_con_eet_base_eo.legacy.h', + 'ecore_con_eet_client_obj_eo.h', + 'ecore_con_eet_client_obj_eo.legacy.h', + 'ecore_con_eet_server_obj_eo.h', + 'ecore_con_eet_server_obj_eo.legacy.h' ] ecore_con_src = [ @@ -224,9 +197,11 @@ ecore_con = declare_dependency( dependencies: ecore_con_pub_deps, ) -install_data(pub_eo_files + pub_eo_types_files + pub_legacy_eo_files, - install_dir: eolian_ecore_dir -) +if get_option('install-eo-files') + install_data(pub_eo_files + pub_eo_types_files, + install_dir: eolian_ecore_dir + ) +endif install_headers(ecore_con_header_src, install_dir : dir_package_include, diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h index fb1884be2d..ecf4f4a2bd 100644 --- a/src/lib/ecore_drm2/Ecore_Drm2.h +++ b/src/lib/ecore_drm2/Ecore_Drm2.h @@ -310,6 +310,17 @@ EAPI void ecore_drm2_device_pointer_accel_profile_set(Ecore_Drm2_Device *device, */ EAPI Eina_Bool ecore_drm2_device_pointer_rotation_set(Ecore_Drm2_Device *device, int rotation); +/** + * Enable or disable pointer tap-to-click + * + * @param device + * @param enabled + * + * @ingroup Ecore_Drm2_Device_Group + * @since 1.22 + */ +EAPI void ecore_drm2_device_touch_tap_to_click_enabled_set(Ecore_Drm2_Device *device, Eina_Bool enabled); + /** * Set info to be used on keyboards * @@ -781,6 +792,18 @@ EAPI int ecore_drm2_output_supported_rotations_get(Ecore_Drm2_Output *output); */ EAPI Eina_Bool ecore_drm2_output_rotation_set(Ecore_Drm2_Output *output, int rotation); +/** + * Get current output rotation + * + * @param output + * + * @return An integer representing the output current rotation + * + * @ingroup Ecore_Drm2_Output_Group + * @since 1.22 + */ +EAPI int ecore_drm2_output_rotation_get(Ecore_Drm2_Output *output); + /** * Set the user data for the output's page flip handler * @@ -1107,7 +1130,7 @@ EAPI Eina_Bool ecore_drm2_plane_fb_set(Ecore_Drm2_Plane *plane, Ecore_Drm2_Fb *f * @param fb The fb to register the callback on * @param handler The function to handle the callback * @param data The user data to pass to the callback - * @ingroup Ecore_Drm2_Output_Group + * @ingroup Ecore_Drm2_Fb_Group * @since 1.20 */ EAPI void ecore_drm2_fb_status_handler_set(Ecore_Drm2_Fb *fb, Ecore_Drm2_Fb_Status_Handler handler, void *data); @@ -1126,6 +1149,7 @@ EAPI void ecore_drm2_fb_status_handler_set(Ecore_Drm2_Fb *fb, Ecore_Drm2_Fb_Stat * @param sec * @param usec * + * @ingroup Ecore_Drm2_Output_Group * @since 1.20 */ EAPI Eina_Bool ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, int sequence, long *sec, long *usec); @@ -1137,9 +1161,9 @@ EAPI Eina_Bool ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, int se * * @param device * + * @ingroup Ecore_Drm2_Device_Group * @since 1.20 */ - EAPI int ecore_drm2_device_fd_get(Ecore_Drm2_Device *device); /** @@ -1150,6 +1174,7 @@ EAPI int ecore_drm2_device_fd_get(Ecore_Drm2_Device *device); * * @param output * @return Whether there's a flip in progress or not + * @ingroup Ecore_Drm2_Output_Group * @since 1.20 */ EAPI Eina_Bool ecore_drm2_output_pending_get(Ecore_Drm2_Output *output); diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c index 9108db6ff8..b4ca722b22 100644 --- a/src/lib/ecore_drm2/ecore_drm2_device.c +++ b/src/lib/ecore_drm2/ecore_drm2_device.c @@ -782,6 +782,14 @@ ecore_drm2_device_pointer_accel_profile_set(Ecore_Drm2_Device *device, uint32_t elput_input_pointer_accel_profile_set(device->em, NULL, profile); } +EAPI void +ecore_drm2_device_touch_tap_to_click_enabled_set(Ecore_Drm2_Device *device, Eina_Bool enabled) +{ + EINA_SAFETY_ON_NULL_RETURN(device); + + elput_input_touch_tap_to_click_enabled_set(device->em, NULL, enabled); +} + EAPI void ecore_drm2_device_window_set(Ecore_Drm2_Device *device, unsigned int window) { diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c index 33c0e27570..e8f6c16762 100644 --- a/src/lib/ecore_drm2/ecore_drm2_fb.c +++ b/src/lib/ecore_drm2/ecore_drm2_fb.c @@ -263,6 +263,11 @@ ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output) EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); + if (output->flip_timeout) + { + ecore_timer_del(output->flip_timeout); + output->flip_timeout = NULL; + } if (output->current.fb && (output->current.fb != output->pending.fb)) _ecore_drm2_fb_buffer_release(output, &output->current); @@ -408,6 +413,25 @@ _fb_atomic_flip_test(Ecore_Drm2_Output *output) sym_drmModeAtomicAddProperty(req, pstate->obj_id, pstate->ch.id, pstate->ch.value); if (ret < 0) goto err; + +#if 0 + /* XXX: Disable hardware plane rotation for now as this has broken + * recently. The break happens because of an invalid argument, + * ie: the value being sent from pstate->rotation_map ends up being + * incorrect for some reason. I suspect the breakage to be from + * kernel drivers (linux 4.20.0) but have not confirmed that version */ + if ((pstate->rotation.id) && + (pstate->type.value == DRM_PLANE_TYPE_PRIMARY)) + { + DBG("Plane %d Atomic Rotation: %lu", + pstate->obj_id, pstate->rotation.value); + ret = + sym_drmModeAtomicAddProperty(req, pstate->obj_id, + pstate->rotation.id, + pstate->rotation_map[pstate->rotation.value]); + if (ret < 0) goto err; + } +#endif } ret = @@ -428,6 +452,21 @@ err: return EINA_FALSE; } +static int _fb_atomic_flip(Ecore_Drm2_Output *output); +static int _fb_flip(Ecore_Drm2_Output *output); + +static Eina_Bool +_cb_flip_timeout(void *data) +{ + Ecore_Drm2_Output *output = data; + + output->flip_timeout = NULL; + ERR("flip event callback timout 0.05sec - try again"); + if (_ecore_drm2_use_atomic) _fb_atomic_flip(output); + else _fb_flip(output); + return EINA_FALSE; +} + static int _fb_atomic_flip(Ecore_Drm2_Output *output) { @@ -453,6 +492,11 @@ _fb_atomic_flip(Ecore_Drm2_Output *output) ERR("Failed Atomic Commit: %m"); return -1; } + else + { + if (output->flip_timeout) ecore_timer_del(output->flip_timeout); + output->flip_timeout = ecore_timer_add(0.05, _cb_flip_timeout, output); + } return 0; } @@ -466,6 +510,16 @@ _fb_flip(Ecore_Drm2_Output *output) int ret = 0; fb = output->prep.fb; + if (!fb) + { + fb = output->pending.fb; + ERR("Trying to flip NULL fb - fallback to pending fb"); + } + if (!fb) + { + ERR("Pending fb is also NULL, give up flipping"); + return ret; + } if ((!output->current.fb) || (output->current.fb->strides[0] != fb->strides[0])) @@ -526,6 +580,11 @@ _fb_flip(Ecore_Drm2_Output *output) } usleep(100); } + else + { + if (output->flip_timeout) ecore_timer_del(output->flip_timeout); + output->flip_timeout = ecore_timer_add(0.05, _cb_flip_timeout, output); + } } while (repeat); diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c index 8cebea513b..6734cacdff 100644 --- a/src/lib/ecore_drm2/ecore_drm2_outputs.c +++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c @@ -859,14 +859,14 @@ next: { output->connected = EINA_FALSE; output->enabled = EINA_FALSE; - _output_event_send(output); } else { output->connected = EINA_TRUE; output->enabled = EINA_TRUE; - _output_event_send(output); } + + _output_event_send(output); } free(connected); } @@ -891,10 +891,7 @@ _output_destroy(Ecore_Drm2_Device *dev EINA_UNUSED, Ecore_Drm2_Output *output) { if (output->prep.atomic_req) sym_drmModeAtomicFree(output->prep.atomic_req); - } - if (_ecore_drm2_use_atomic) - { EINA_LIST_FREE(output->plane_states, pstate) free(pstate); @@ -919,12 +916,28 @@ _output_destroy(Ecore_Drm2_Device *dev EINA_UNUSED, Ecore_Drm2_Output *output) eina_stringshare_del(output->serial); eina_stringshare_del(output->relative.to); + if (output->flip_timeout) ecore_timer_del(output->flip_timeout); + sym_drmModeFreeProperty(output->dpms); free(output->edid.blob); free(output); } +/* this function is used to indicate if we are in a multi-gpu situation + * and need to calculate vblank sync with high crtc mask */ +static unsigned int +_output_vblank_pipe(Ecore_Drm2_Output *output) +{ + if (output->pipe > 1) + return ((output->pipe << DRM_VBLANK_HIGH_CRTC_SHIFT) & + DRM_VBLANK_HIGH_CRTC_MASK); + else if (output->pipe > 0) + return DRM_VBLANK_SECONDARY; + else + return 0; +} + EAPI Eina_Bool ecore_drm2_outputs_create(Ecore_Drm2_Device *device) { @@ -1333,8 +1346,8 @@ ecore_drm2_output_mode_set(Ecore_Drm2_Output *output, Ecore_Drm2_Output_Mode *mo else buffer = output->ocrtc->buffer_id; - if (sym_drmModeSetCrtc(output->fd, output->crtc_id, buffer, - 0, 0, &output->conn_id, 1, &mode->info) < 0) + if (sym_drmModeSetCrtc(output->fd, output->crtc_id, buffer, 0, 0, + &output->conn_id, 1, &mode->info) < 0) { ERR("Failed to set Mode %dx%d for Output %s: %m", mode->width, mode->height, output->name); @@ -1505,10 +1518,18 @@ ecore_drm2_output_supported_rotations_get(Ecore_Drm2_Output *output) EAPI Eina_Bool ecore_drm2_output_rotation_set(Ecore_Drm2_Output *output, int rotation) { - Eina_Bool ret = EINA_FALSE; + Eina_Bool ret = EINA_TRUE; EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); + output->rotation = rotation; + +#if 0 + /* XXX: Disable hardware plane rotation for now as this has broken + * recently. The break happens because of an invalid argument, + * ie: the value being sent from pstate->rotation_map ends up being + * incorrect for some reason. I suspect the breakage to be from + * kernel drivers (linux 4.20.0) but have not confirmed that version */ if (_ecore_drm2_use_atomic) { Eina_List *l; @@ -1537,8 +1558,7 @@ ecore_drm2_output_rotation_set(Ecore_Drm2_Output *output, int rotation) pstate->rotation.id, rotation); if (res < 0) goto err; - res = sym_drmModeAtomicCommit(output->fd, req, flags, - output); + res = sym_drmModeAtomicCommit(output->fd, req, flags, output); if (res < 0) goto err; else @@ -1551,10 +1571,18 @@ ecore_drm2_output_rotation_set(Ecore_Drm2_Output *output, int rotation) err: sym_drmModeAtomicFree(req); } +#endif return ret; } +EAPI int +ecore_drm2_output_rotation_get(Ecore_Drm2_Output *output) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(output, -1); + return output->rotation; +} + EAPI unsigned int ecore_drm2_output_subpixel_get(const Ecore_Drm2_Output *output) { @@ -1619,6 +1647,7 @@ ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, int sequence, long *s memset(&v, 0, sizeof(v)); v.request.type = DRM_VBLANK_RELATIVE; + v.request.type |= _output_vblank_pipe(output); v.request.sequence = sequence; ret = sym_drmWaitVBlank(output->fd, &v); success = (ret == 0) && (v.reply.tval_sec > 0 || v.reply.tval_usec > 0); @@ -1646,8 +1675,21 @@ ecore_drm2_output_info_get(Ecore_Drm2_Output *output, int *x, int *y, int *w, in EINA_SAFETY_ON_NULL_RETURN(output); EINA_SAFETY_ON_TRUE_RETURN(!output->current_mode); - if (w) *w = output->current_mode->width; - if (h) *h = output->current_mode->height; + switch (output->rotation) + { + case ECORE_DRM2_ROTATION_90: + case ECORE_DRM2_ROTATION_270: + if (w) *w = output->current_mode->height; + if (h) *h = output->current_mode->width; + break; + case ECORE_DRM2_ROTATION_NORMAL: + case ECORE_DRM2_ROTATION_180: + default: + if (w) *w = output->current_mode->width; + if (h) *h = output->current_mode->height; + break; + } + if (refresh) *refresh = output->current_mode->refresh; if (x) *x = output->x; if (y) *y = output->y; diff --git a/src/lib/ecore_drm2/ecore_drm2_plane.c b/src/lib/ecore_drm2/ecore_drm2_plane.c index b9601cc347..6dfa0bcb85 100644 --- a/src/lib/ecore_drm2/ecore_drm2_plane.c +++ b/src/lib/ecore_drm2/ecore_drm2_plane.c @@ -181,6 +181,13 @@ ecore_drm2_plane_fb_set(Ecore_Drm2_Plane *plane, Ecore_Drm2_Fb *fb) fallback_id = plane->state->fid.value; plane->state->fid.value = fb->id; + + /* Update plane state based on fb */ + plane->state->sw.value = fb->w << 16; + plane->state->sh.value = fb->h << 16; + plane->state->cw.value = fb->w; + plane->state->ch.value = fb->h; + if (_fb_atomic_flip_test(plane->output)) { _ecore_drm2_fb_ref(fb); diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h b/src/lib/ecore_drm2/ecore_drm2_private.h index 490f1665e4..25aaac7d71 100644 --- a/src/lib/ecore_drm2/ecore_drm2_private.h +++ b/src/lib/ecore_drm2/ecore_drm2_private.h @@ -208,6 +208,7 @@ struct _Ecore_Drm2_Output int fd; int pipe; int x, y, w, h, pw, ph; + int rotation; long fallback_sec, fallback_usec; @@ -252,6 +253,8 @@ struct _Ecore_Drm2_Output /* unused when doing atomic */ drmModePropertyPtr dpms; + Ecore_Timer *flip_timeout; + Ecore_Drm2_Output_Mode *current_mode; Eina_List *modes; diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index cbd3107fa3..8f8a0241b6 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c @@ -244,7 +244,7 @@ _ecore_evas_idle_enter(void *data EINA_UNUSED) { if (!ee->animator_registered) { - efl_event_callback_add(ee->evas, EFL_EVENT_ANIMATOR_TICK, _ecore_evas_animator, ee); + efl_event_callback_add(ee->evas, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _ecore_evas_animator, ee); ee->animator_registered = EINA_TRUE; } } @@ -307,7 +307,7 @@ _ecore_evas_idle_enter(void *data EINA_UNUSED) if (!change) { - efl_event_callback_del(ee->evas, EFL_EVENT_ANIMATOR_TICK, _ecore_evas_animator, ee); + efl_event_callback_del(ee->evas, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _ecore_evas_animator, ee); ee->animator_registered = EINA_FALSE; } #ifdef ECORE_EVAS_ASYNC_RENDER_DEBUG @@ -3137,7 +3137,7 @@ ecore_evas_animator_tick(Ecore_Evas *ee, Eina_Rectangle *viewport, double loop_t ecore_loop_time_set(loop_time); ee->animator_ran = EINA_TRUE; - efl_event_callback_call(ee->evas, EFL_EVENT_ANIMATOR_TICK, &a); + efl_event_callback_call(ee->evas, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, &a); if (ee->ee_anim.active) _ecore_evas_animators_do(ee); @@ -3330,7 +3330,7 @@ _check_animator_event_catcher_add(void *data, const Efl_Event *event) for (i = 0; array[i].desc != NULL; i++) { - if (array[i].desc == EFL_EVENT_ANIMATOR_TICK) + if (array[i].desc == EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK) { _ticking_start(ee); @@ -3350,7 +3350,7 @@ _check_animator_event_catcher_del(void *data, const Efl_Event *event) for (i = 0; array[i].desc != NULL; i++) { - if (array[i].desc == EFL_EVENT_ANIMATOR_TICK) + if (array[i].desc == EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK) { _ticking_stop(ee); return; @@ -3618,7 +3618,7 @@ _ecore_evas_mouse_move_process_internal(Ecore_Evas *ee, if (!send_event) return; - evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, ee->evas, (void **) &ev); + evt = efl_input_pointer_instance_get( ee->evas, (void **) &ev); if (!evt) return; ev->action = EFL_POINTER_ACTION_MOVE; @@ -4811,7 +4811,7 @@ _direct_mouse_updown(Ecore_Evas *ee, const Ecore_Event_Mouse_Button *info, Efl_P * modifiers (already passed to evas, no need to do anything) */ - evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, e, (void **) &ev); + evt = efl_input_pointer_instance_get( e, (void **) &ev); if (!evt) return EINA_FALSE; ev->action = action; @@ -4875,7 +4875,7 @@ _direct_mouse_move_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Move *info) * modifiers (already passed to evas, no need to do anything) */ - evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, e, (void **) &ev); + evt = efl_input_pointer_instance_get( e, (void **) &ev); if (!evt) return EINA_FALSE; ev->action = EFL_POINTER_ACTION_MOVE; @@ -4915,7 +4915,7 @@ _direct_mouse_wheel_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Wheel *info) * modifiers (already passed to evas, no need to do anything) */ - evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, e, (void **) &ev); + evt = efl_input_pointer_instance_get( e, (void **) &ev); if (!evt) return EINA_FALSE; ev->action = EFL_POINTER_ACTION_WHEEL; @@ -4947,7 +4947,7 @@ _direct_mouse_inout(Ecore_Evas *ee, const Ecore_Event_Mouse_IO *info, Efl_Pointe * modifiers (already passed to evas, no need to do anything) */ - evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, e, (void **) &ev); + evt = efl_input_pointer_instance_get( e, (void **) &ev); if (!evt) return EINA_FALSE; ev->action = action; @@ -4991,7 +4991,7 @@ _direct_axis_update_cb(Ecore_Evas *ee, const Ecore_Event_Axis_Update *info) * window, root_window, event_window */ - evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, e, (void **) &ev); + evt = efl_input_pointer_instance_get( e, (void **) &ev); if (!ev) return EINA_FALSE; ev->action = EFL_POINTER_ACTION_AXIS; @@ -5110,7 +5110,7 @@ _direct_key_updown_cb(Ecore_Evas *ee, const Ecore_Event_Key *info, Eina_Bool dow * modifiers (already passed to evas, no need to do anything) */ - evt = efl_input_instance_get(EFL_INPUT_KEY_CLASS, e, (void **) &ev); + evt = efl_input_key_instance_get( e, (void **) &ev); if (!evt || !ev) return EINA_FALSE; ev->timestamp = info->timestamp; diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c b/src/lib/ecore_evas/ecore_evas_buffer.c index 8fea11a9f3..147e09070b 100644 --- a/src/lib/ecore_evas/ecore_evas_buffer.c +++ b/src/lib/ecore_evas/ecore_evas_buffer.c @@ -77,10 +77,9 @@ _ecore_evas_resize(Ecore_Evas *ee, int w, int h) else { if (bdata->pixels) - bdata->free_func(bdata->data, - bdata->pixels); - bdata->pixels = bdata->alloc_func(bdata->data, - ee->w * ee->h * sizeof(int)); + bdata->free_func(bdata->data, bdata->pixels); + bdata->pixels = + bdata->alloc_func(bdata->data, ee->w * ee->h * sizeof(int)); stride = ee->w * sizeof(int); } @@ -103,7 +102,7 @@ _ecore_evas_resize(Ecore_Evas *ee, int w, int h) } } if (bdata->image) - evas_object_image_data_set(bdata->image, bdata->pixels); + evas_object_image_data_set(bdata->image, bdata->pixels); else bdata->resized = 1; } @@ -176,7 +175,7 @@ _ecore_evas_buffer_prepare(Ecore_Evas *ee) evas_object_image_size_get(bdata->image, &w, &h); if ((w != ee->w) || (h != ee->h)) - _ecore_evas_resize(ee, w, h); + _ecore_evas_resize(ee, w, h); bdata->pixels = evas_object_image_data_get(bdata->image, 1); } else if (bdata->resized) @@ -522,7 +521,7 @@ _ecore_evas_buffer_alpha_set(Ecore_Evas *ee, int alpha) if (((ee->alpha) && (alpha)) || ((!ee->alpha) && (!alpha))) return; ee->alpha = alpha; if (bdata->image) - evas_object_image_alpha_set(bdata->image, ee->alpha); + evas_object_image_alpha_set(bdata->image, ee->alpha); else { Evas_Engine_Info_Buffer *einfo; @@ -665,90 +664,90 @@ _ecore_evas_buffer_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y static Ecore_Evas_Engine_Func _ecore_buffer_engine_func = { _ecore_evas_buffer_free, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - _ecore_evas_move, - NULL, - _ecore_evas_resize, - _ecore_evas_move_resize, - NULL, - NULL, - _ecore_evas_show, - NULL, - NULL, - NULL, - NULL, - _ecore_evas_buffer_title_set, - _ecore_evas_buffer_name_class_set, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - _ecore_evas_buffer_ignore_events_set, - _ecore_evas_buffer_alpha_set, - NULL, //transparent - NULL, // profiles_set - _ecore_evas_buffer_profile_set, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + _ecore_evas_move, + NULL, + _ecore_evas_resize, + _ecore_evas_move_resize, + NULL, + NULL, + _ecore_evas_show, + NULL, + NULL, + NULL, + NULL, + _ecore_evas_buffer_title_set, + _ecore_evas_buffer_name_class_set, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + _ecore_evas_buffer_ignore_events_set, + _ecore_evas_buffer_alpha_set, + NULL, //transparent + NULL, // profiles_set + _ecore_evas_buffer_profile_set, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, - NULL, - _ecore_evas_buffer_screen_geometry_get, - NULL, // screen_dpi_get - _ecore_evas_buffer_msg_parent_send, - _ecore_evas_buffer_msg_send, + NULL, + _ecore_evas_buffer_screen_geometry_get, + NULL, // screen_dpi_get + _ecore_evas_buffer_msg_parent_send, + _ecore_evas_buffer_msg_send, - _ecore_evas_buffer_pointer_xy_get, // pointer_xy_get - _ecore_evas_buffer_pointer_warp, // pointer_warp + _ecore_evas_buffer_pointer_xy_get, // pointer_xy_get + _ecore_evas_buffer_pointer_warp, // pointer_warp - NULL, // wm_rot_preferred_rotation_set - NULL, // wm_rot_available_rotations_set - NULL, // wm_rot_manual_rotation_done_set - NULL, // wm_rot_manual_rotation_done + NULL, // wm_rot_preferred_rotation_set + NULL, // wm_rot_available_rotations_set + NULL, // wm_rot_manual_rotation_done_set + NULL, // wm_rot_manual_rotation_done - NULL, // aux_hints_set + NULL, // aux_hints_set - NULL, // fn_animator_register - NULL, // fn_animator_unregister + NULL, // fn_animator_register + NULL, // fn_animator_unregister - NULL, // fn_evas_changed - NULL, //fn_focus_device_set - NULL, //fn_callback_focus_device_in_set - NULL, //fn_callback_focus_device_out_set - NULL, //fn_callback_device_mouse_in_set - NULL, //fn_callback_device_mouse_out_set - NULL, //fn_pointer_device_xy_get - _ecore_evas_buffer_prepare, - NULL // fn_last_tick_get + NULL, // fn_evas_changed + NULL, //fn_focus_device_set + NULL, //fn_callback_focus_device_in_set + NULL, //fn_callback_focus_device_out_set + NULL, //fn_callback_device_mouse_in_set + NULL, //fn_callback_device_mouse_out_set + NULL, //fn_pointer_device_xy_get + _ecore_evas_buffer_prepare, + NULL // fn_last_tick_get }; static void * @@ -893,10 +892,15 @@ ecore_evas_buffer_new(int w, int h) ecore_event_evas_init(); - ee = ecore_evas_buffer_allocfunc_new - (w, h, _ecore_evas_buffer_pix_alloc, _ecore_evas_buffer_pix_free, NULL); + ee = + ecore_evas_buffer_allocfunc_new(w, h, _ecore_evas_buffer_pix_alloc, + _ecore_evas_buffer_pix_free, NULL); - if (!ee) ecore_event_evas_shutdown(); + if (!ee) + { + ecore_event_evas_shutdown(); + return NULL; + } ecore_evas_done(ee, EINA_TRUE); diff --git a/src/lib/ecore_file/ecore_file_download.c b/src/lib/ecore_file/ecore_file_download.c index 54666693d2..4b65c51ee6 100644 --- a/src/lib/ecore_file/ecore_file_download.c +++ b/src/lib/ecore_file/ecore_file_download.c @@ -66,7 +66,7 @@ _ecore_file_download_copier_done(void *data, const Efl_Event *event EINA_UNUSED) Efl_Net_Http_Status status = efl_net_dialer_http_response_status_get(job->input); const char *file; - efl_file_get(job->output, &file, NULL); + file = efl_file_get(job->output); DBG("Finished downloading %s (status=%d) -> %s", efl_net_dialer_address_dial_get(job->input), @@ -92,7 +92,7 @@ _ecore_file_download_copier_error(void *data, const Efl_Event *event) Eina_Error *perr = event->info; const char *file; - efl_file_get(job->output, &file, NULL); + file = efl_file_get(job->output); WRN("Failed downloading %s (status=%d) -> %s: %s", efl_net_dialer_address_dial_get(job->input), @@ -127,7 +127,7 @@ _ecore_file_download_copier_progress(void *data, const Efl_Event *event EINA_UNU if (!job->progress_cb) return; - efl_file_get(job->output, &file, NULL); + file = efl_file_get(job->output); efl_net_dialer_http_progress_download_get(job->input, &dn, &dt); efl_net_dialer_http_progress_upload_get(job->input, &un, &ut); ret = job->progress_cb((void *)job->data, file, dt, dn, ut, un); @@ -227,7 +227,7 @@ ecore_file_download_full(const char *url, EINA_SAFETY_ON_NULL_GOTO(job->input, error_input); job->output = efl_add(EFL_IO_FILE_CLASS, loop, - efl_file_set(efl_added, dst, NULL), + efl_file_set(efl_added, dst), 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_invalidate_set(efl_added, EINA_TRUE), @@ -309,7 +309,7 @@ ecore_file_download_abort(Ecore_File_Download_Job *job) return; } - efl_file_get(job->output, &file, NULL); + file = efl_file_get(job->output); DBG("Aborting download %s -> %s", efl_net_dialer_address_dial_get(job->input), file); diff --git a/src/lib/ecore_file/meson.build b/src/lib/ecore_file/meson.build index 09ac25ff3e..727c3d372c 100644 --- a/src/lib/ecore_file/meson.build +++ b/src/lib/ecore_file/meson.build @@ -11,7 +11,7 @@ ecore_file_src = [ if sys_windows == true ecore_file_src += [ 'ecore_file_monitor_win32.c'] -elif cc.has_header('sys/inotify.h') +elif sys_linux == true ecore_file_src += [ 'ecore_file_monitor_inotify.c'] else ecore_file_src += [ 'ecore_file_monitor_poll.c'] diff --git a/src/lib/ecore_imf/Ecore_IMF.h b/src/lib/ecore_imf/Ecore_IMF.h index 85c43234a7..d733251fef 100644 --- a/src/lib/ecore_imf/Ecore_IMF.h +++ b/src/lib/ecore_imf/Ecore_IMF.h @@ -47,6 +47,8 @@ extern "C" { * @defgroup Ecore_IMF_Context_Group Ecore Input Method Context Functions * @ingroup Ecore_IMF_Lib_Group * + * @section intro Introduction + * * Functions that operate on Ecore Input Method Context objects. * Ecore Input Method Context Function defines the interface for EFL input methods. @@ -64,8 +66,44 @@ extern "C" { * ecore_imf_init() should be called to initialize and load immodule.@n * ecore_imf_shutdown() is used for shutdowning and unloading immodule. * - * An example of usage of these functions can be found at: + * @section how-to-compose How to process key event for composition or prediction + * + * To input Chinese, Japanese, Korean and other complex languages, the editor widget (as known as entry) should be connected with input method framework.@n + * Each editor widget should have each input context to connect with input service framework.@n + * Key event is processed by input method engine. The result is notified to application through ECORE_IMF_CALLBACK_PREEDIT_CHANGED and ECORE_IMF_CALLBACK_COMMIT event.@n + * @n + * The following example demonstrates how to connect input method framework and handle preedit and commit string from input method framework. * @li @ref ecore_imf_example_c + * + * @section media-content How to receive media contents from input method editor + * + * Users sometimes wants to send images and other rich content with their input method editor (as known as virtual keyboard or soft keyboard).@n + * According to this requirement, the way to receive the media content URI such as images and other rich content as well as text have been provided since 1.20.@n + * @n + * The following code shows how to receive the media content URI. + * + * @code + * #include + * + * static void + * _imf_event_commit_content_cb(void *data, Ecore_IMF_Context *ctx, void *event_info) + * { + * Ecore_IMF_Event_Commit_Content *commit_content = (Ecore_IMF_Event_Commit_Content *)event_info; + * if (!commit_content) return; + * + * // convert URI to filename + * gchar *filepath = g_filename_from_uri(commit_content->content_uri, NULL, NULL); + * printf("filepath : %s, description : %s, mime types : %s\n", filepath, commit_content->description, commit_content->mime_types); + * + * // do something to use filepath + * + * if (filepath) + * g_free(filepath); + * } + * + * ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT_CONTENT, _imf_event_commit_content_cb, data); + * @endcode + * */ /** @@ -674,6 +712,7 @@ struct _Ecore_IMF_Event_Key_Down const char *dev_name; /**< The device name of the key pressed @since 1.14 */ Ecore_IMF_Device_Class dev_class; /**< The device class of the key pressed @since 1.14 */ Ecore_IMF_Device_Subclass dev_subclass; /**< The device subclass of the key pressed @since 1.14 */ + unsigned int keycode; /**< Key scan code numeric value @since 1.22 */ }; /** @@ -692,6 +731,7 @@ struct _Ecore_IMF_Event_Key_Up const char *dev_name; /**< The device name of the key released @since 1.14 */ Ecore_IMF_Device_Class dev_class; /**< The device class of the key released @since 1.14 */ Ecore_IMF_Device_Subclass dev_subclass; /**< The device subclass of the key released @since 1.14 */ + unsigned int keycode; /**< Key scan code numeric value @since 1.22 */ }; /** @@ -1451,8 +1491,10 @@ EAPI void ecore_imf_context_delete_surrounding_event_ad * * The event type @p type to trigger the function may be one of * #ECORE_IMF_CALLBACK_PREEDIT_START, #ECORE_IMF_CALLBACK_PREEDIT_END, - * #ECORE_IMF_CALLBACK_PREEDIT_CHANGED, #ECORE_IMF_CALLBACK_COMMIT and - * #ECORE_IMF_CALLBACK_DELETE_SURROUNDING. + * #ECORE_IMF_CALLBACK_PREEDIT_CHANGED, #ECORE_IMF_CALLBACK_COMMIT, + * #ECORE_IMF_CALLBACK_DELETE_SURROUNDING, #ECORE_IMF_CALLBACK_SELECTION_SET, + * #ECORE_IMF_CALLBACK_PRIVATE_COMMAND_SEND, #ECORE_IMF_CALLBACK_COMMIT_CONTENT, + * #ECORE_IMF_CALLBACK_TRANSACTION_START, and #ECORE_IMF_CALLBACK_TRANSACTION_END. * * @param ctx Ecore_IMF_Context to attach a callback to. * @param type The type of event that will trigger the callback @@ -1463,6 +1505,9 @@ EAPI void ecore_imf_context_delete_surrounding_event_ad * * Example * @code + * #include + * + * // example for handling commit event from input framework * static void * _imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx, void *event_info) * { @@ -1471,6 +1516,28 @@ EAPI void ecore_imf_context_delete_surrounding_event_ad * } * * ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _imf_event_commit_cb, data); + * + * // example for receiving media content URI from input framework + * @code + * #include + * + * static void + * _imf_event_commit_content_cb(void *data, Ecore_IMF_Context *ctx, void *event_info) + * { + * Ecore_IMF_Event_Commit_Content *commit_content = (Ecore_IMF_Event_Commit_Content *)event; + * if (!commit_content) return; + * + * // convert URI to filename + * gchar *filepath = g_filename_from_uri(commit_content->content_uri, NULL, NULL); + * printf("filepath : %s, description : %s, mime types : %s\n", filepath, commit_content->description, commit_content->mime_types); + * + * // do something to use filepath + * + * if (filepath) + * g_free(filepath); + * } + * + * ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT_CONTENT, _imf_event_commit_content_cb, data); * @endcode */ EAPI void ecore_imf_context_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func, const void *data); diff --git a/src/lib/ecore_imf/ecore_imf_module.c b/src/lib/ecore_imf/ecore_imf_module.c index 6232f85614..391778f43b 100644 --- a/src/lib/ecore_imf/ecore_imf_module.c +++ b/src/lib/ecore_imf/ecore_imf_module.c @@ -33,7 +33,7 @@ void ecore_imf_module_init(void) { const char *built_modules[] = { -#ifdef ENABLE_XIM +#ifdef BUILD_ECORE_IMF_XIM "xim", #endif #ifdef BUILD_ECORE_IMF_IBUS @@ -97,7 +97,7 @@ ecore_imf_module_init(void) if ((!env) && (getenv("WAYLAND_DISPLAY")) && (!getenv("DISPLAY"))) env = "wayland"; #endif -#ifdef ENABLE_XIM +#ifdef BUILD_ECORE_IMF_XIM if ((!env) && (!getenv("WAYLAND_DISPLAY")) && (getenv("DISPLAY"))) env = "xim"; #endif diff --git a/src/lib/ecore_imf_evas/ecore_imf_evas.c b/src/lib/ecore_imf_evas/ecore_imf_evas.c index fecd1730e0..1a53e56b9a 100644 --- a/src/lib/ecore_imf_evas/ecore_imf_evas.c +++ b/src/lib/ecore_imf_evas/ecore_imf_evas.c @@ -184,6 +184,7 @@ ecore_imf_evas_event_key_down_wrap(Evas_Event_Key_Down *evas_event, imf_event->string = evas_event->string ? evas_event->string : _ecore_imf_evas_event_empty; imf_event->compose = evas_event->compose ? evas_event->compose : _ecore_imf_evas_event_empty; imf_event->timestamp = evas_event->timestamp; + imf_event->keycode = evas_event->keycode; if (evas_event->dev) { @@ -223,6 +224,7 @@ ecore_imf_evas_event_key_up_wrap(Evas_Event_Key_Up *evas_event, imf_event->string = evas_event->string ? evas_event->string : _ecore_imf_evas_event_empty; imf_event->compose = evas_event->compose ? evas_event->compose : _ecore_imf_evas_event_empty; imf_event->timestamp = evas_event->timestamp; + imf_event->keycode = evas_event->keycode; if (evas_event->dev) { diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c index babf033a17..97b263784b 100644 --- a/src/lib/ecore_ipc/ecore_ipc.c +++ b/src/lib/ecore_ipc/ecore_ipc.c @@ -607,8 +607,8 @@ _ecore_ipc_dialer_connected(void *data, const Efl_Event *event EINA_UNUSED) EFL_CALLBACKS_ARRAY_DEFINE(_ecore_ipc_dialer_cbs, { EFL_IO_READER_EVENT_EOS, _ecore_ipc_dialer_eos }, - { EFL_NET_DIALER_EVENT_ERROR, _ecore_ipc_dialer_error }, - { EFL_NET_DIALER_EVENT_CONNECTED, _ecore_ipc_dialer_connected }); + { EFL_NET_DIALER_EVENT_DIALER_ERROR, _ecore_ipc_dialer_error }, + { EFL_NET_DIALER_EVENT_DIALER_CONNECTED, _ecore_ipc_dialer_connected }); static Eina_Bool ecore_ipc_server_data_process(Ecore_Ipc_Server *svr, void *data, int size, Eina_Bool *stolen); @@ -886,7 +886,7 @@ ecore_ipc_server_clients_get(Ecore_Ipc_Server *svr) unsigned char *dd; \ dd = (unsigned char *)&v; \ v = d; \ - v = htonl(v); \ + v = eina_htonl(v); \ *(dat + s + 0) = dd[0]; \ *(dat + s + 1) = dd[1]; \ *(dat + s + 2) = dd[2]; \ @@ -899,7 +899,7 @@ ecore_ipc_server_clients_get(Ecore_Ipc_Server *svr) unsigned char *dd; \ dd = (unsigned char *)&v; \ v = d; \ - v = htons(v); \ + v = eina_htons(v); \ *(dat + s + 0) = dd[0]; \ *(dat + s + 1) = dd[1]; \ s += 2; \ @@ -945,7 +945,7 @@ ecore_ipc_server_send(Ecore_Ipc_Server *svr, int major, int minor, int ref, int *head |= md << (4 * 4); SVENC(size); *head |= md << (4 * 5); - *head = htonl(*head); + *head = eina_htonl(*head); svr->prev.o = msg; if (svr->dialer.input) @@ -1101,7 +1101,7 @@ ecore_ipc_server_flush(Ecore_Ipc_Server *svr) unsigned char *dd; \ dd = (unsigned char *)&v; \ v = d; \ - v = htonl(v); \ + v = eina_htonl(v); \ *(dat + s + 0) = dd[0]; \ *(dat + s + 1) = dd[1]; \ *(dat + s + 2) = dd[2]; \ @@ -1114,7 +1114,7 @@ ecore_ipc_server_flush(Ecore_Ipc_Server *svr) unsigned char *dd; \ dd = (unsigned char *)&v; \ v = d; \ - v = htons(v); \ + v = eina_htons(v); \ *(dat + s + 0) = dd[0]; \ *(dat + s + 1) = dd[1]; \ s += 2; \ @@ -1168,7 +1168,7 @@ ecore_ipc_client_send(Ecore_Ipc_Client *cl, int major, int minor, int ref, int r *head |= md << (4 * 4); CLENC(size); *head |= md << (4 * 5); - *head = htonl(*head); + *head = eina_htonl(*head); cl->prev.o = msg; if (cl->socket.input) @@ -1503,7 +1503,7 @@ ecore_ipc_ssl_available_get(void) dv[1] = *(cl->buf + offset + s + 1); \ dv[2] = *(cl->buf + offset + s + 2); \ dv[3] = *(cl->buf + offset + s + 3); \ - d = (int)ntohl(v); \ + d = (int)eina_ntohl(v); \ s += 4; \ } \ else if (md >= DLT_ADD16) \ @@ -1513,7 +1513,7 @@ ecore_ipc_ssl_available_get(void) dv = (unsigned char *)&v; \ dv[0] = *(cl->buf + offset + s + 0); \ dv[1] = *(cl->buf + offset + s + 1); \ - d = (int)ntohs(v); \ + d = (int)eina_ntohs(v); \ s += 2; \ } \ else if (md >= DLT_ADD8) \ @@ -1572,7 +1572,7 @@ ecore_ipc_client_data_process(Ecore_Ipc_Client *cl, void *data, int size, Eina_B dd[1] = *(cl->buf + offset + 1); dd[2] = *(cl->buf + offset + 2); dd[3] = *(cl->buf + offset + 3); - head = ntohl(head); + head = eina_ntohl(head); dd = (unsigned char *)&d; s = 4; CLSZ(0); @@ -1695,7 +1695,7 @@ ecore_ipc_client_data_process(Ecore_Ipc_Client *cl, void *data, int size, Eina_B dv[1] = *(svr->buf + offset + s + 1); \ dv[2] = *(svr->buf + offset + s + 2); \ dv[3] = *(svr->buf + offset + s + 3); \ - d = (int)ntohl(v); \ + d = (int)eina_ntohl(v); \ s += 4; \ } \ else if (md >= DLT_ADD16) \ @@ -1705,7 +1705,7 @@ ecore_ipc_client_data_process(Ecore_Ipc_Client *cl, void *data, int size, Eina_B dv = (unsigned char *)&v; \ dv[0] = *(svr->buf + offset + s + 0); \ dv[1] = *(svr->buf + offset + s + 1); \ - d = (int)ntohs(v); \ + d = (int)eina_ntohs(v); \ s += 2; \ } \ else if (md >= DLT_ADD8) \ @@ -1763,7 +1763,7 @@ ecore_ipc_server_data_process(Ecore_Ipc_Server *svr, void *data, int size, Eina_ dd[1] = *(svr->buf + offset + 1); dd[2] = *(svr->buf + offset + 2); dd[3] = *(svr->buf + offset + 3); - head = ntohl(head); + head = eina_ntohl(head); dd = (unsigned char *)&d; s = 4; SVSZ(0); diff --git a/src/lib/ecore_win32/ecore_win32.c b/src/lib/ecore_win32/ecore_win32.c index f217b22475..1ee8b2fbdf 100644 --- a/src/lib/ecore_win32/ecore_win32.c +++ b/src/lib/ecore_win32/ecore_win32.c @@ -25,12 +25,6 @@ * @cond LOCAL */ -/* FIXME: uncomment when mingw-w64 will be updated in win-builds */ - -/* #ifndef WM_CLIPBOARDUPDATE */ -# define WM_CLIPBOARDUPDATE 0x031D -/* #endif */ - /* OLE IID for Drag'n Drop */ #define INITGUID @@ -43,9 +37,6 @@ DEFINE_OLEGUID(IID_IUnknown, 0x00000000L, 0, 0); #define IDI_ICON 101 -typedef BOOL WINAPI (*efl_AddClipboardFormatListener)(_In_ HWND hwnd); -typedef BOOL WINAPI (*efl_RemoveClipboardFormatListener)(_In_ HWND hwnd); - static int _ecore_win32_init_count = 0; LRESULT CALLBACK @@ -205,31 +196,17 @@ _ecore_win32_window_procedure(HWND window, /* Window notifications */ case WM_CREATE: { - efl_AddClipboardFormatListener acfl; - INF("create window message"); - - acfl = (efl_AddClipboardFormatListener)GetProcAddress(GetModuleHandle("user32.dll"), - "AddClipboardFormatListener"); - if (acfl) - { - if (!acfl(window)) - INF("can not create clipboard format listener; no clipboard notification will be sent"); - } + if (!AddClipboardFormatListener(window)) + INF("can not create clipboard format listener; no clipboard notification will be sent"); _ecore_win32_event_handle_create_notify(data); return 0; } case WM_DESTROY: { - efl_RemoveClipboardFormatListener rcfl; - INF("destroy window message"); _ecore_win32_event_handle_destroy_notify(data); - - rcfl = (efl_RemoveClipboardFormatListener)GetProcAddress(GetModuleHandle("user32.dll"), - "RemoveClipboardFormatListener"); - if (rcfl) - rcfl(window); + RemoveClipboardFormatListener(window); return 0; } case WM_SHOWWINDOW: diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index 5d3ccfb2fc..d2fc4048d1 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -1482,7 +1482,7 @@ EAPI Ecore_Wl2_Offer* ecore_wl2_dnd_selection_get(Ecore_Wl2_Input *input); * * @param types a null-terminated array of mimetypes supported by the client * - * @return serial of request on sucess, 0 on failure + * @return serial of request on success, 0 on failure * * @ingroup Ecore_Wl2_Dnd_Group * @since 1.17 @@ -1494,7 +1494,7 @@ EAPI uint32_t ecore_wl2_dnd_selection_set(Ecore_Wl2_Input *input, const char **t * * @param input the input to clear * - * @return serial of request on sucess, 0 on failure + * @return serial of request on success, 0 on failure * * @ingroup Ecore_Wl2_Dnd_Group * @since 1.17 diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c b/src/lib/ecore_wl2/ecore_wl2_display.c index 8272dc27b1..8699dfaace 100644 --- a/src/lib/ecore_wl2/ecore_wl2_display.c +++ b/src/lib/ecore_wl2/ecore_wl2_display.c @@ -10,7 +10,6 @@ static Eina_Hash *_server_displays = NULL; static Eina_Hash *_client_displays = NULL; -static Eina_Bool _cb_connect_idle(void *data); static Eina_Bool _cb_connect_data(void *data, Ecore_Fd_Handler *hdl); static Eina_Bool _ecore_wl2_display_connect(Ecore_Wl2_Display *ewd, Eina_Bool sync); @@ -475,8 +474,6 @@ _recovery_timer_add(Ecore_Wl2_Display *ewd) Ecore_Wl2_Window *window; eina_hash_free_buckets(ewd->globals); - ecore_idle_enterer_del(ewd->idle_enterer); - ewd->idle_enterer = NULL; ecore_main_fd_handler_del(ewd->fd_hdl); ewd->fd_hdl = NULL; @@ -523,11 +520,35 @@ _begin_recovery_maybe(Ecore_Wl2_Display *ewd, int code) _recovery_timer_add(ewd); else if (!_server_displays) { - ERR("Wayland Socket Error: %s", strerror(errno)); + ERR("Wayland Socket Error: %s", eina_error_msg_get(errno)); _ecore_wl2_display_signal_exit(); } } +static void +_cb_connect_pre(void *data, Ecore_Fd_Handler *hdl EINA_UNUSED) +{ + Ecore_Wl2_Display *ewd = data; + int ret = 0, code; + + while ((wl_display_prepare_read(ewd->wl.display) != 0) && (ret >= 0)) + ret = wl_display_dispatch_pending(ewd->wl.display); + + if (ret < 0) goto err; + + ret = wl_display_get_error(ewd->wl.display); + if (ret < 0) goto err; + + return; + +err: + code = errno; + if ((ret < 0) && (code != EAGAIN)) + { + _begin_recovery_maybe(ewd, code); + } +} + static Eina_Bool _cb_connect_data(void *data, Ecore_Fd_Handler *hdl) { @@ -536,17 +557,20 @@ _cb_connect_data(void *data, Ecore_Fd_Handler *hdl) if (ecore_main_fd_handler_active_get(hdl, ECORE_FD_READ)) { - ret = wl_display_dispatch(ewd->wl.display); + ret = wl_display_read_events(ewd->wl.display); code = errno; if ((ret < 0) && (code != EAGAIN)) goto err; } + else + wl_display_cancel_read(ewd->wl.display); + wl_display_dispatch_pending(ewd->wl.display); if (ecore_main_fd_handler_active_get(hdl, ECORE_FD_WRITE)) { ret = wl_display_flush(ewd->wl.display); code = errno; if (ret >= 0) - ecore_main_fd_handler_active_set(hdl, ECORE_FD_READ); + ecore_main_fd_handler_active_set(hdl, ECORE_FD_READ | ECORE_FD_ALWAYS); if ((ret < 0) && (code != EAGAIN)) goto err; } @@ -572,34 +596,6 @@ _cb_globals_hash_del(void *data) free(global); } -static Eina_Bool -_cb_connect_idle(void *data) -{ - Ecore_Wl2_Display *ewd = data; - int ret = 0, code; - - ret = wl_display_get_error(ewd->wl.display); - code = errno; - if (ret < 0) goto err; - - ret = wl_display_dispatch_pending(ewd->wl.display); - code = errno; - if (ret < 0) goto err; - - return ECORE_CALLBACK_RENEW; - -err: - if ((ret < 0) && (code != EAGAIN)) - { - ewd->idle_enterer = NULL; - _begin_recovery_maybe(ewd, code); - - return ECORE_CALLBACK_CANCEL; - } - - return ECORE_CALLBACK_RENEW; -} - static Ecore_Wl2_Global * _ecore_wl2_global_find(Ecore_Wl2_Display *ewd, const char *interface) { @@ -742,10 +738,11 @@ _ecore_wl2_display_connect(Ecore_Wl2_Display *ewd, Eina_Bool sync) ewd->fd_hdl = ecore_main_fd_handler_add(wl_display_get_fd(ewd->wl.display), - ECORE_FD_READ | ECORE_FD_WRITE | ECORE_FD_ERROR, - _cb_connect_data, ewd, NULL, NULL); + ECORE_FD_READ | ECORE_FD_WRITE | ECORE_FD_ERROR | ECORE_FD_ALWAYS, + _cb_connect_data, ewd, NULL, ewd); - ewd->idle_enterer = ecore_idle_enterer_add(_cb_connect_idle, ewd); + ecore_main_fd_handler_prepare_callback_set + (ewd->fd_hdl, _cb_connect_pre, ewd); _ecore_wl2_display_event(ewd, ECORE_WL2_EVENT_CONNECT); return EINA_TRUE; @@ -768,8 +765,6 @@ _ecore_wl2_display_cleanup(Ecore_Wl2_Display *ewd) EINA_INLIST_FOREACH_SAFE(ewd->outputs, tmp, output) _ecore_wl2_output_del(output); - if (ewd->idle_enterer) ecore_idle_enterer_del(ewd->idle_enterer); - if (ewd->fd_hdl) ecore_main_fd_handler_del(ewd->fd_hdl); eina_hash_free(ewd->globals); @@ -1160,7 +1155,7 @@ ecore_wl2_display_flush(Ecore_Wl2_Display *display) if (code == EAGAIN) { ecore_main_fd_handler_active_set(display->fd_hdl, - (ECORE_FD_READ | ECORE_FD_WRITE)); + (ECORE_FD_READ | ECORE_FD_WRITE | ECORE_FD_ALWAYS)); return; } diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c index 721f6a10ee..0d480f50e8 100644 --- a/src/lib/ecore_wl2/ecore_wl2_input.c +++ b/src/lib/ecore_wl2/ecore_wl2_input.c @@ -765,6 +765,7 @@ _pointer_cb_button(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned if (!input) return; input->display->serial = serial; + input->timestamp = timestamp; if (state == WL_POINTER_BUTTON_STATE_PRESSED) { @@ -802,6 +803,8 @@ _pointer_cb_axis(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned in input = data; if (!input) return; + input->timestamp = timestamp; + _ecore_wl2_input_mouse_wheel_send(input, axis, wl_fixed_to_int(value), timestamp); } @@ -1056,6 +1059,7 @@ _keyboard_cb_key(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned if (!window) return; input->display->serial = serial; + input->timestamp = timestamp; /* xkb rules reflect X broken keycodes, so offset by 8 */ code = keycode + 8; @@ -1205,6 +1209,7 @@ _touch_cb_down(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int seri if (!window) return; input->focus.touch = window; + input->timestamp = timestamp; _pointer_cb_enter(data, NULL, serial, surface, x, y); diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h b/src/lib/ecore_wl2/ecore_wl2_private.h index e62ea5f8ea..9b6d4f7e49 100644 --- a/src/lib/ecore_wl2/ecore_wl2_private.h +++ b/src/lib/ecore_wl2/ecore_wl2_private.h @@ -102,7 +102,6 @@ struct _Ecore_Wl2_Display struct xkb_context *xkb_context; - Ecore_Idle_Enterer *idle_enterer; Ecore_Fd_Handler *fd_hdl; Eina_Hash *globals; diff --git a/src/lib/ecore_x/Ecore_X.h b/src/lib/ecore_x/Ecore_X.h index cb55dfa3ee..223bc912ae 100644 --- a/src/lib/ecore_x/Ecore_X.h +++ b/src/lib/ecore_x/Ecore_X.h @@ -2763,7 +2763,7 @@ EAPI Eina_Bool ecore_x_window_keygrab_unset(Ecore_X_ //this API for keyrouter protocol EAPI void ecore_x_e_keyrouter_set(Ecore_X_Window root, Eina_Bool on); /**< @since 1.15 */ //Key router set keyrouter flag using this -EAPI Eina_Bool ecore_x_e_keyrouter_get(Ecore_X_Window root); /**< @since 1.15 */ //Client check the existance of keyrouter using this +EAPI Eina_Bool ecore_x_e_keyrouter_get(Ecore_X_Window root); /**< @since 1.15 */ //Client check the existence of keyrouter using this #ifdef EFL_BETA_API_SUPPORT // XXX: FIXME: re-evaluate this after looking at xdg foreign in wayland diff --git a/src/lib/ecore_x/ecore_x.c b/src/lib/ecore_x/ecore_x.c index bab8a41f6d..f3d8caeb20 100644 --- a/src/lib/ecore_x/ecore_x.c +++ b/src/lib/ecore_x/ecore_x.c @@ -1223,12 +1223,12 @@ _ecore_x_fd_handler(void *data, XEvent ev; XNextEvent(d, &ev); -#ifdef ENABLE_XIM +#ifdef BUILD_ECORE_IMF_XIM /* Filter event for XIM */ if (XFilterEvent(&ev, ev.xkey.window)) continue; -#endif /* ifdef ENABLE_XIM */ +#endif /* ifdef BUILD_ECORE_IMF_XIM */ if ((ev.type >= 0) && (ev.type < _ecore_x_event_handlers_num)) { if (_ecore_x_event_handlers[AnyXEvent]) @@ -1921,7 +1921,7 @@ struct _Keygrab }; Keygrab *_ecore_key_grabs = NULL; -static void +static KeyCode _ecore_x_window_key_grab_internal(Ecore_X_Window win, const char *key, int mod, @@ -1940,13 +1940,13 @@ _ecore_x_window_key_grab_internal(Ecore_X_Window win, { keysym = XStringToKeysym(key); if (keysym == NoSymbol) - return; + return 0; keycode = XKeysymToKeycode(_ecore_x_disp, keysym); } if (keycode == 0) - return; + return 0; m = _ecore_x_event_modifier(mod); if (any_mod) @@ -1966,6 +1966,7 @@ _ecore_x_window_key_grab_internal(Ecore_X_Window win, win, False, GrabModeAsync, GrabModeAsync); if (_ecore_xlib_sync) ecore_x_sync(); } + return keycode; } EAPI void @@ -1975,9 +1976,11 @@ ecore_x_window_key_grab(Ecore_X_Window win, int any_mod) { Keygrab *t; + KeyCode keycode; EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp); - _ecore_x_window_key_grab_internal(win, key, mod, any_mod); + if (!(keycode = _ecore_x_window_key_grab_internal(win, key, mod, any_mod))) + return; _ecore_key_grabs_num++; t = realloc(_ecore_key_grabs, _ecore_key_grabs_num * sizeof(Keygrab)); @@ -2034,7 +2037,7 @@ _ecore_x_key_grab_remove(Ecore_X_Window win, return shuffle; } -static void +static KeyCode _ecore_x_window_key_ungrab_internal(Ecore_X_Window win, const char *key, int mod, @@ -2053,13 +2056,13 @@ _ecore_x_window_key_ungrab_internal(Ecore_X_Window win, { keysym = XStringToKeysym(key); if (keysym == NoSymbol) - return; + return 0; keycode = XKeysymToKeycode(_ecore_x_disp, keysym); } if (keycode == 0) - return; + return 0; m = _ecore_x_event_modifier(mod); if (any_mod) @@ -2075,6 +2078,7 @@ _ecore_x_window_key_ungrab_internal(Ecore_X_Window win, locks[7] = ECORE_X_LOCK_CAPS | ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL; for (i = 0; i < 8; i++) XUngrabKey(_ecore_x_disp, keycode, m | locks[i], win); + return keycode; } EAPI void diff --git a/src/lib/ector/Ector.h b/src/lib/ector/Ector.h index e2268f3ad8..01a71d6e6e 100644 --- a/src/lib/ector/Ector.h +++ b/src/lib/ector/Ector.h @@ -3,8 +3,9 @@ #include #include +#ifdef EFL_BETA_API_SUPPORT #include - +#endif #ifdef EAPI # undef EAPI #endif @@ -99,7 +100,7 @@ typedef Eo Ector_Renderer; /** * @typedef Ector_Colorspace - * The definiton of colorspace. + * The definition of colorspace. */ // FIXME: Enable this when we have merged Emile /* typedef Evas_Colorspace Ector_Colorspace; */ diff --git a/src/lib/ector/cairo/ector_cairo_software_surface.eo b/src/lib/ector/cairo/ector_cairo_software_surface.eo index 03d7e49988..05ad18e37d 100644 --- a/src/lib/ector/cairo/ector_cairo_software_surface.eo +++ b/src/lib/ector/cairo/ector_cairo_software_surface.eo @@ -1,4 +1,4 @@ -class Ector.Cairo.Software.Surface extends Ector.Cairo.Surface implements Ector.Software.Buffer.Base +class @beta Ector.Cairo.Software.Surface extends Ector.Cairo.Surface implements Ector.Software.Buffer.Base { [[Ector surface on a cairo software backend diff --git a/src/lib/ector/cairo/ector_cairo_surface.eo b/src/lib/ector/cairo/ector_cairo_surface.eo index f267a23609..981d2404d2 100644 --- a/src/lib/ector/cairo/ector_cairo_surface.eo +++ b/src/lib/ector/cairo/ector_cairo_surface.eo @@ -1,6 +1,6 @@ struct @extern cairo_t; [[cairo_t type]] -class Ector.Cairo.Surface extends Efl.Object implements Ector.Surface +class @beta Ector.Cairo.Surface extends Efl.Object implements Ector.Surface { [[Ector surface on a cairo backend diff --git a/src/lib/ector/cairo/ector_renderer_cairo.eo b/src/lib/ector/cairo/ector_renderer_cairo.eo index f28efe9e96..3f100b1ef1 100644 --- a/src/lib/ector/cairo/ector_renderer_cairo.eo +++ b/src/lib/ector/cairo/ector_renderer_cairo.eo @@ -1,4 +1,4 @@ -abstract Ector.Renderer.Cairo extends Ector.Renderer +abstract @beta Ector.Renderer.Cairo extends Ector.Renderer { [[Ector cairo renderer abstract class]] methods { 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 28f267f164..9c5c4ff563 100644 --- a/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.eo +++ b/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.eo @@ -1,4 +1,4 @@ -class Ector.Renderer.Cairo.Gradient.Linear extends Ector.Renderer.Cairo implements Ector.Renderer.Gradient, Ector.Renderer.Gradient.Linear, Efl.Gfx.Path +class @beta Ector.Renderer.Cairo.Gradient.Linear extends Ector.Renderer.Cairo implements Ector.Renderer.Gradient, Ector.Renderer.Gradient.Linear, Efl.Gfx.Path { [[Ector cairo renderer gradient linear]] eo_prefix: ector_renderer_cairo_gradient_linear; 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 144019d51b..7c3a60caf8 100644 --- a/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.eo +++ b/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.eo @@ -1,4 +1,4 @@ -class Ector.Renderer.Cairo.Gradient.Radial extends Ector.Renderer.Cairo implements Ector.Renderer.Gradient, Ector.Renderer.Gradient.Radial, Efl.Gfx.Path +class @beta Ector.Renderer.Cairo.Gradient.Radial extends Ector.Renderer.Cairo implements Ector.Renderer.Gradient, Ector.Renderer.Gradient.Radial, Efl.Gfx.Path { [[Ector cairo renderer gradient radial]] eo_prefix: ector_renderer_cairo_gradient_radial; diff --git a/src/lib/ector/cairo/ector_renderer_cairo_shape.eo b/src/lib/ector/cairo/ector_renderer_cairo_shape.eo index 336d4697f7..6f08776591 100644 --- a/src/lib/ector/cairo/ector_renderer_cairo_shape.eo +++ b/src/lib/ector/cairo/ector_renderer_cairo_shape.eo @@ -1,4 +1,4 @@ -class Ector.Renderer.Cairo.Shape extends Ector.Renderer.Cairo implements Ector.Renderer.Shape, Efl.Gfx.Path +class @beta Ector.Renderer.Cairo.Shape extends Ector.Renderer.Cairo implements Ector.Renderer.Shape, Efl.Gfx.Path { [[Ector cairo renderer shape class]] eo_prefix: ector_renderer_cairo_shape; diff --git a/src/lib/ector/cairo/meson.build b/src/lib/ector/cairo/meson.build index 123ea90d1f..094aedb3e6 100644 --- a/src/lib/ector/cairo/meson.build +++ b/src/lib/ector/cairo/meson.build @@ -31,6 +31,9 @@ foreach eo_file : pub_eo_files '-gchd', '@INPUT@']) endforeach -install_data(pub_eo_files, - install_dir: join_paths(eolian_include_dir, package_version_name) -) + +if get_option('install-eo-files') + install_data(pub_eo_files, + install_dir: join_paths(eolian_include_dir, package_version_name) + ) +endif diff --git a/src/lib/ector/ector_buffer.eo b/src/lib/ector/ector_buffer.eo index 9d0aaf4040..c53ecc8962 100644 --- a/src/lib/ector/ector_buffer.eo +++ b/src/lib/ector/ector_buffer.eo @@ -1,6 +1,6 @@ import efl_gfx_types; -enum Ector.Buffer.Flag { +enum @beta Ector.Buffer.Flag { [[Buffer capabilities]] none = 0x00, [[Buffer may not have any backing, indicates an invalid buffer.]] cpu_readable = 0x01, [[Can be read from the CPU after map. Reading may still be very slow.]] @@ -13,7 +13,7 @@ enum Ector.Buffer.Flag { /* non_coherent = 0x80, [[Memory may be mapped but will not be coherent between GPU and CPU. Call flush or invalidate to synchronize it.]] */ } -enum Ector.Buffer.Access_Flag { +enum @beta Ector.Buffer.Access_Flag { [[Buffer access permissions]] none = 0x0, [[No access permission]] read = 0x1, [[Read access permission]] @@ -21,11 +21,9 @@ enum Ector.Buffer.Access_Flag { cow = 0x4, [[Forces copy-on-write if already mapped as read-only. Requires write.]] } -mixin Ector.Buffer +mixin @beta Ector.Buffer { [[2D pixel buffer interface for Ector - - @since 1.17 ]] eo_prefix: ector_buffer; methods { diff --git a/src/lib/ector/ector_renderer.eo b/src/lib/ector/ector_renderer.eo index 46bd9df9c6..53560d17d5 100644 --- a/src/lib/ector/ector_renderer.eo +++ b/src/lib/ector/ector_renderer.eo @@ -1,6 +1,6 @@ import eina_types; -abstract Ector.Renderer extends Efl.Object +abstract @beta Ector.Renderer extends Efl.Object { [[Ector renderer abstract interface]] @@ -100,10 +100,6 @@ abstract Ector.Renderer extends Efl.Object [[Prepare for rendering]] return: bool; [[$true on success, $false otherwise]] } - done @pure_virtual { - [[Done with rendering]] - return: bool; [[$true on success, $false otherwise]] - } } implements { Efl.Object.destructor; diff --git a/src/lib/ector/ector_renderer_gradient.eo b/src/lib/ector/ector_renderer_gradient.eo index 43b9c1d435..70be8823a6 100644 --- a/src/lib/ector/ector_renderer_gradient.eo +++ b/src/lib/ector/ector_renderer_gradient.eo @@ -1,4 +1,4 @@ -mixin Ector.Renderer.Gradient requires Efl.Object extends Efl.Gfx.Gradient +mixin @beta Ector.Renderer.Gradient requires Efl.Object extends Efl.Gfx.Gradient { [[Ector gradient renderer mixin]] eo_prefix: ector_renderer_gradient; diff --git a/src/lib/ector/ector_renderer_gradient_linear.eo b/src/lib/ector/ector_renderer_gradient_linear.eo index 6158e13eb4..db2cde4cbb 100644 --- a/src/lib/ector/ector_renderer_gradient_linear.eo +++ b/src/lib/ector/ector_renderer_gradient_linear.eo @@ -1,4 +1,4 @@ -mixin Ector.Renderer.Gradient.Linear extends Efl.Gfx.Gradient_Linear +mixin @beta Ector.Renderer.Gradient.Linear extends Efl.Gfx.Gradient_Linear { [[Ector gradient linear renderer mixin]] eo_prefix: ector_renderer_gradient_linear; diff --git a/src/lib/ector/ector_renderer_gradient_radial.eo b/src/lib/ector/ector_renderer_gradient_radial.eo index 5cf56c95be..369db43480 100644 --- a/src/lib/ector/ector_renderer_gradient_radial.eo +++ b/src/lib/ector/ector_renderer_gradient_radial.eo @@ -1,4 +1,4 @@ -mixin Ector.Renderer.Gradient.Radial extends Efl.Gfx.Gradient_Radial +mixin @beta Ector.Renderer.Gradient.Radial extends Efl.Gfx.Gradient_Radial { [[Ector gradient radial renderer mixin]] eo_prefix: ector_renderer_gradient_radial; diff --git a/src/lib/ector/ector_renderer_shape.eo b/src/lib/ector/ector_renderer_shape.eo index 683b0072f2..67876ca108 100644 --- a/src/lib/ector/ector_renderer_shape.eo +++ b/src/lib/ector/ector_renderer_shape.eo @@ -1,6 +1,6 @@ import ector_renderer; -mixin Ector.Renderer.Shape requires Efl.Object extends Efl.Gfx.Shape +mixin @beta Ector.Renderer.Shape requires Efl.Object extends Efl.Gfx.Shape { [[Ector shape renderer mixin]] eo_prefix: ector_renderer_shape; diff --git a/src/lib/ector/ector_surface.eo b/src/lib/ector/ector_surface.eo index 9655c06bd5..159033995d 100644 --- a/src/lib/ector/ector_surface.eo +++ b/src/lib/ector/ector_surface.eo @@ -1,4 +1,4 @@ -mixin Ector.Surface extends Ector.Buffer +mixin @beta Ector.Surface extends Ector.Buffer { [[Surface interface for Ector]] diff --git a/src/lib/ector/gl/ector_gl_buffer.eo b/src/lib/ector/gl/ector_gl_buffer.eo index 872ee2b4b5..6b32fffc7a 100644 --- a/src/lib/ector/gl/ector_gl_buffer.eo +++ b/src/lib/ector/gl/ector_gl_buffer.eo @@ -1,4 +1,4 @@ -class Ector.GL.Buffer extends Efl.Object implements Ector.Buffer +class @beta Ector.GL.Buffer extends Efl.Object implements Ector.Buffer { [[Ector GL buffer class]] data: null; diff --git a/src/lib/ector/gl/ector_gl_surface.eo b/src/lib/ector/gl/ector_gl_surface.eo index 37dc43f2ea..19e919c0b8 100644 --- a/src/lib/ector/gl/ector_gl_surface.eo +++ b/src/lib/ector/gl/ector_gl_surface.eo @@ -1,6 +1,6 @@ import ector_types; -class Ector.GL.Surface extends Ector.GL.Buffer implements Ector.Surface +class @beta Ector.GL.Surface extends Ector.GL.Buffer implements Ector.Surface { [[Ector GL surface class]] eo_prefix: ector_gl_surface; diff --git a/src/lib/ector/gl/ector_renderer_gl.eo b/src/lib/ector/gl/ector_renderer_gl.eo index 95b4ef3f5e..62dc486ff3 100644 --- a/src/lib/ector/gl/ector_renderer_gl.eo +++ b/src/lib/ector/gl/ector_renderer_gl.eo @@ -1,6 +1,6 @@ import ector_types; -abstract Ector.Renderer.GL extends Ector.Renderer +abstract @beta Ector.Renderer.GL extends Ector.Renderer { [[Ector GL renderer abstract class]] methods { 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 5971664844..2e7621d905 100644 --- a/src/lib/ector/gl/ector_renderer_gl_gradient_linear.eo +++ b/src/lib/ector/gl/ector_renderer_gl_gradient_linear.eo @@ -1,4 +1,4 @@ -class Ector.Renderer.GL.Gradient.Linear extends Ector.Renderer.GL implements Ector.Renderer.Gradient, Ector.Renderer.Gradient.Linear, Efl.Gfx.Path +class @beta Ector.Renderer.GL.Gradient.Linear extends Ector.Renderer.GL implements Ector.Renderer.Gradient, Ector.Renderer.Gradient.Linear, Efl.Gfx.Path { [[Ector GL renderer gradient linear]] eo_prefix: ector_renderer_gl_gradient_linear; 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 3f4154f819..3f3cbdd72c 100644 --- a/src/lib/ector/gl/ector_renderer_gl_gradient_radial.eo +++ b/src/lib/ector/gl/ector_renderer_gl_gradient_radial.eo @@ -1,4 +1,4 @@ -class Ector.Renderer.GL.Gradient.Radial extends Ector.Renderer.GL implements Ector.Renderer.Gradient, Ector.Renderer.Gradient.Radial, Efl.Gfx.Path +class @beta Ector.Renderer.GL.Gradient.Radial extends Ector.Renderer.GL implements Ector.Renderer.Gradient, Ector.Renderer.Gradient.Radial, Efl.Gfx.Path { [[Ector GL renderer gradient radial]] eo_prefix: ector_renderer_gl_gradient_radial; diff --git a/src/lib/ector/gl/ector_renderer_gl_shape.eo b/src/lib/ector/gl/ector_renderer_gl_shape.eo index 608581b993..ba9043625e 100644 --- a/src/lib/ector/gl/ector_renderer_gl_shape.eo +++ b/src/lib/ector/gl/ector_renderer_gl_shape.eo @@ -1,4 +1,4 @@ -class Ector.Renderer.GL.Shape extends Ector.Renderer.GL implements Ector.Renderer.Shape, Efl.Gfx.Path +class @beta Ector.Renderer.GL.Shape extends Ector.Renderer.GL implements Ector.Renderer.Shape, Efl.Gfx.Path { [[Ector GL renderer shape class]] eo_prefix: ector_renderer_gl_shape; diff --git a/src/lib/ector/gl/meson.build b/src/lib/ector/gl/meson.build index 071e98eaee..ab87d79b4d 100644 --- a/src/lib/ector/gl/meson.build +++ b/src/lib/ector/gl/meson.build @@ -34,6 +34,9 @@ foreach eo_file : pub_eo_files '-gchd', '@INPUT@']) endforeach -install_data(pub_eo_files, - install_dir: join_paths(eolian_include_dir, package_version_name) -) + +if get_option('install-eo-files') + install_data(pub_eo_files, + install_dir: join_paths(eolian_include_dir, package_version_name) + ) +endif diff --git a/src/lib/ector/meson.build b/src/lib/ector/meson.build index 5b86466873..069e98d9e7 100644 --- a/src/lib/ector/meson.build +++ b/src/lib/ector/meson.build @@ -55,9 +55,11 @@ pub_eo_types_files = [ 'ector_types.eot' ] -install_data(ector_pub_eo_files + pub_eo_types_files, - install_dir: join_paths(eolian_include_dir, package_version_name) -) +if get_option('install-eo-files') + install_data(ector_pub_eo_files + pub_eo_types_files, + install_dir: join_paths(eolian_include_dir, package_version_name) + ) +endif foreach eo_file : pub_eo_types_files pub_eo_file_target += custom_target('eolian_gen_' + eo_file, diff --git a/src/lib/ector/software/ector_renderer_software.eo b/src/lib/ector/software/ector_renderer_software.eo index bd94cc6781..00e1040ed1 100644 --- a/src/lib/ector/software/ector_renderer_software.eo +++ b/src/lib/ector/software/ector_renderer_software.eo @@ -1,4 +1,4 @@ -abstract Ector.Renderer.Software extends Ector.Renderer +abstract @beta Ector.Renderer.Software extends Ector.Renderer { [[Ector software renderer class]] data: null; 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 f2705dd2a1..132a4dfdb1 100644 --- a/src/lib/ector/software/ector_renderer_software_gradient_linear.eo +++ b/src/lib/ector/software/ector_renderer_software_gradient_linear.eo @@ -1,4 +1,4 @@ -class Ector.Renderer.Software.Gradient.Linear extends Ector.Renderer.Software implements Ector.Renderer.Gradient, Ector.Renderer.Gradient.Linear +class @beta Ector.Renderer.Software.Gradient.Linear extends Ector.Renderer.Software implements Ector.Renderer.Gradient, Ector.Renderer.Gradient.Linear { [[Ector software renderer gradient linear class]] eo_prefix: ector_renderer_software_gradient_linear; 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 03bde1ead5..31bf1d568c 100644 --- a/src/lib/ector/software/ector_renderer_software_gradient_radial.eo +++ b/src/lib/ector/software/ector_renderer_software_gradient_radial.eo @@ -1,4 +1,4 @@ -class Ector.Renderer.Software.Gradient.Radial extends Ector.Renderer.Software implements Ector.Renderer.Gradient, Ector.Renderer.Gradient.Radial +class @beta Ector.Renderer.Software.Gradient.Radial extends Ector.Renderer.Software implements Ector.Renderer.Gradient, Ector.Renderer.Gradient.Radial { [[Ector software renderer gradient radial]] eo_prefix: ector_renderer_software_gradient_radial; diff --git a/src/lib/ector/software/ector_renderer_software_shape.eo b/src/lib/ector/software/ector_renderer_software_shape.eo index b4889b352f..41f2b7e658 100644 --- a/src/lib/ector/software/ector_renderer_software_shape.eo +++ b/src/lib/ector/software/ector_renderer_software_shape.eo @@ -1,4 +1,4 @@ -class Ector.Renderer.Software.Shape extends Ector.Renderer.Software implements Ector.Renderer.Shape +class @beta Ector.Renderer.Software.Shape extends Ector.Renderer.Software implements Ector.Renderer.Shape { [[Ector software renderer shape class]] eo_prefix: ector_renderer_software_shape; diff --git a/src/lib/ector/software/ector_software_buffer.eo b/src/lib/ector/software/ector_software_buffer.eo index 76c3987343..24df070a62 100644 --- a/src/lib/ector/software/ector_software_buffer.eo +++ b/src/lib/ector/software/ector_software_buffer.eo @@ -1,4 +1,4 @@ -class Ector.Software.Buffer extends Efl.Object implements Ector.Software.Buffer.Base +class @beta Ector.Software.Buffer extends Efl.Object implements Ector.Software.Buffer.Base { [[Ector software buffer class]] data: null; diff --git a/src/lib/ector/software/ector_software_buffer_base.eo b/src/lib/ector/software/ector_software_buffer_base.eo index e139bc7d09..be6539973f 100644 --- a/src/lib/ector/software/ector_software_buffer_base.eo +++ b/src/lib/ector/software/ector_software_buffer_base.eo @@ -1,4 +1,4 @@ -mixin Ector.Software.Buffer.Base extends Ector.Buffer +mixin @beta Ector.Software.Buffer.Base extends Ector.Buffer { [[A buffer in Ector Software is a readable & optionally writable image]] eo_prefix: ector_software_buffer; diff --git a/src/lib/ector/software/ector_software_rasterizer.c b/src/lib/ector/software/ector_software_rasterizer.c index d9b3351248..b2b5779f69 100644 --- a/src/lib/ector/software/ector_software_rasterizer.c +++ b/src/lib/ector/software/ector_software_rasterizer.c @@ -11,8 +11,23 @@ #include "draw.h" +//FIXME: This enum add temporarily to help understanding of additional code +//related to masking in prepare_mask. +//This needs to be formally declared through the eo class. +typedef enum _EFL_CANVAS_VG_NODE_BLEND_TYPE +{ + EFL_CANVAS_VG_NODE_BLEND_TYPE_NONE = 0, + EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA, + EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA_INV, + EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_ADD, + EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_SUBSTRACT, + EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_INTERSECT, + EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_DIFFERENCE +}EFL_CANVAS_VG_NODE_BLEND_TYPE; +// + static void -_blend_color_argb(int count, const SW_FT_Span *spans, void *user_data) +_blend_argb(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *sd = user_data; uint32_t color, *buffer, *target; @@ -34,7 +49,7 @@ _blend_color_argb(int count, const SW_FT_Span *spans, void *user_data) } static void -_blend_color_argb_with_maskA(int count, const SW_FT_Span *spans, void *user_data) +_blend_alpha(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *sd = user_data; const int pix_stride = sd->raster_buffer->stride / 4; @@ -77,7 +92,7 @@ _blend_color_argb_with_maskA(int count, const SW_FT_Span *spans, void *user_data } static void -_blend_color_argb_with_maskInvA(int count, const SW_FT_Span *spans, void *user_data) +_blend_alpha_inv(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *sd = user_data; const int pix_stride = sd->raster_buffer->stride / 4; @@ -120,6 +135,122 @@ _blend_color_argb_with_maskInvA(int count, const SW_FT_Span *spans, void *user_d } } +static void +_blend_mask_add(int count, const SW_FT_Span *spans, void *user_data) +{ + Span_Data *sd = user_data; + Ector_Software_Buffer_Base_Data *mask = sd->mask; + + uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); + RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); + uint32_t *mbuffer = mask->pixels.u32; + + while (count--) + { + uint32_t *ttarget = alloca(sizeof(uint32_t) * spans->len); + memset(ttarget, 0x00, sizeof(uint32_t) * spans->len); + uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x); + comp_func(ttarget, spans->len, color, spans->coverage); + for (int i = 0; i < spans->len; i++) + { + double adst = A_VAL(&mtarget[i]) == 0 ? 0 : (double)(A_VAL(&mtarget[i])) / (double)255; + double asrc = A_VAL(&ttarget[i]) == 0 ? 0 : (double)(A_VAL(&ttarget[i])) / (double)255; + uint32_t aout = (int)(((adst * (1 - asrc)) + asrc) * 255); + mtarget[i] = (aout<<24) + (0x00FFFFFF & mtarget[i]); + } + ++spans; + } +} + +static void +_blend_mask_sub(int count, const SW_FT_Span *spans, void *user_data) +{ + Span_Data *sd = user_data; + Ector_Software_Buffer_Base_Data *mask = sd->mask; + + uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); + RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); + uint32_t *mtarget = mask->pixels.u32; + + int tsize = sd->raster_buffer->generic->w * sd->raster_buffer->generic->h; + uint32_t *tbuffer = alloca(sizeof(uint32_t) * tsize); + memset(tbuffer, 0x00, sizeof(uint32_t) * tsize); + + while (count--) + { + uint32_t *ttarget = tbuffer + ((mask->generic->w * spans->y) + spans->x); + comp_func(ttarget, spans->len, color, spans->coverage); + ++spans; + } + + for(int i = 0; i < tsize; i++) + { + double adst = A_VAL(&mtarget[i]) == 0 ? 0 : (double)(A_VAL(&mtarget[i])) / (double)255; + double asrc = A_VAL(&tbuffer[i]) == 0 ? 0 : (double)(A_VAL(&tbuffer[i])) / (double)255; + uint32_t aout = (int)((adst * (1 - asrc)) * 255); + mtarget[i] = (aout<<24) + (0x00FFFFFF & mtarget[i]); + } +} + + +static void +_blend_mask_ins(int count, const SW_FT_Span *spans, void *user_data) +{ + Span_Data *sd = user_data; + Ector_Software_Buffer_Base_Data *mask = sd->mask; + + uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); + RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); + uint32_t *mtarget = mask->pixels.u32; + + int tsize = sd->raster_buffer->generic->w * sd->raster_buffer->generic->h; + uint32_t *tbuffer = alloca(sizeof(uint32_t) * tsize); + memset(tbuffer, 0x00, sizeof(uint32_t) * tsize); + + while (count--) + { + uint32_t *ttarget = tbuffer + ((mask->generic->w * spans->y) + spans->x); + comp_func(ttarget, spans->len, color, spans->coverage); + ++spans; + } + + for(int i = 0; i < tsize; i++) + { + double adst = A_VAL(&mtarget[i]) == 0 ? 0 : (double)(A_VAL(&mtarget[i])) / (double)255; + double asrc = A_VAL(&tbuffer[i]) == 0 ? 0 : (double)(A_VAL(&tbuffer[i])) / (double)255; + uint32_t aout = (int)((adst * asrc) * 255); + mtarget[i] = (aout<<24) + (0x00FFFFFF & mtarget[i]); + } +} + + +static void +_blend_mask_diff(int count, const SW_FT_Span *spans, void *user_data) +{ + Span_Data *sd = user_data; + Ector_Software_Buffer_Base_Data *mask = sd->mask; + + uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); + RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); + uint32_t *mbuffer = mask->pixels.u32; + + while (count--) + { + uint32_t *ttarget = alloca(sizeof(uint32_t) * spans->len); + memset(ttarget, 0x00, sizeof(uint32_t) * spans->len); + uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x); + comp_func(ttarget, spans->len, color, spans->coverage); + for (int i = 0; i < spans->len; i++) + { + double adst = A_VAL(&mtarget[i]) == 0 ? 0 : (double)(A_VAL(&mtarget[i])) / (double)255; + double asrc = A_VAL(&ttarget[i]) == 0 ? 0 : (double)(A_VAL(&ttarget[i])) / (double)255; + uint32_t aout = (int)((((1 - adst) * asrc) + ((1 - asrc) * adst)) * 255); + mtarget[i] = (aout<<24) + (0x00FFFFFF & mtarget[i]); + } + ++spans; + } +} + #define BLEND_GRADIENT_BUFFER_SIZE 2048 typedef void (*src_fetch) (unsigned int *buffer, Span_Data *data, int y, int x, int length); @@ -362,14 +493,32 @@ _adjust_span_fill_methods(Span_Data *spdata) case Solid: { if (spdata->mask) - { - if (spdata->mask_op == 2) - spdata->unclipped_blend = &_blend_color_argb_with_maskInvA; - else - spdata->unclipped_blend = &_blend_color_argb_with_maskA; - } + { + switch (spdata->mask_op) + { + default: + case EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA: + spdata->unclipped_blend = &_blend_alpha; + break; + case EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA_INV: + spdata->unclipped_blend = &_blend_alpha_inv; + break; + case EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_ADD: + spdata->unclipped_blend = &_blend_mask_add; + break; + case EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_SUBSTRACT: + spdata->unclipped_blend = &_blend_mask_sub; + break; + case EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_INTERSECT: + spdata->unclipped_blend = &_blend_mask_ins; + break; + case EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_DIFFERENCE: + spdata->unclipped_blend = &_blend_mask_diff; + break; + } + } else - spdata->unclipped_blend = &_blend_color_argb; + spdata->unclipped_blend = &_blend_argb; } break; case LinearGradient: @@ -378,6 +527,10 @@ _adjust_span_fill_methods(Span_Data *spdata) break; } + //FIXME: Mask and mask case is not use clipping. + if (spdata->mask_op >= EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_ADD) + spdata->clip.enabled = EINA_FALSE; + // Clipping Function if (spdata->clip.enabled) { diff --git a/src/lib/ector/software/ector_software_surface.eo b/src/lib/ector/software/ector_software_surface.eo index 65d807aec0..c0f851f0e2 100644 --- a/src/lib/ector/software/ector_software_surface.eo +++ b/src/lib/ector/software/ector_software_surface.eo @@ -1,4 +1,4 @@ -class Ector.Software.Surface extends Ector.Software.Buffer implements Ector.Surface +class @beta Ector.Software.Surface extends Ector.Software.Buffer implements Ector.Surface { [[Ector surface software class]] eo_prefix: ector_software_surface; diff --git a/src/lib/ector/software/meson.build b/src/lib/ector/software/meson.build index 1484553374..2dff5be26c 100644 --- a/src/lib/ector/software/meson.build +++ b/src/lib/ector/software/meson.build @@ -45,6 +45,9 @@ if cpu_sse3 == true ector_opt_lib += [ ector_opt ] endif -install_data(pub_eo_files, - install_dir: join_paths(eolian_include_dir, package_version_name) -) + +if get_option('install-eo-files') + install_data(pub_eo_files, + install_dir: join_paths(eolian_include_dir, package_version_name) + ) +endif diff --git a/src/lib/edje/Edje.h b/src/lib/edje/Edje.h index 4d747fc9ea..d8c32dc8c1 100644 --- a/src/lib/edje/Edje.h +++ b/src/lib/edje/Edje.h @@ -253,9 +253,7 @@ extern "C" { #ifndef EFL_NOLEGACY_API_SUPPORT #include "Edje_Legacy.h" #endif -#ifdef EFL_EO_API_SUPPORT #include "Edje_Eo.h" -#endif #ifdef __cplusplus } diff --git a/src/lib/edje/Edje_Eo.h b/src/lib/edje/Edje_Eo.h index 859d4d0183..b42fb866e9 100644 --- a/src/lib/edje/Edje_Eo.h +++ b/src/lib/edje/Edje_Eo.h @@ -4,7 +4,7 @@ #include "efl_layout_signal.eo.h" #include "efl_layout_group.eo.h" #include "efl_canvas_layout.eo.h" -#include "edje_edit.eo.h" +#include "edje_edit_eo.h" #include "efl_canvas_layout_part.eo.h" #include "efl_canvas_layout_part_box.eo.h" diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h index 396e663994..52b3075629 100644 --- a/src/lib/edje/Edje_Legacy.h +++ b/src/lib/edje/Edje_Legacy.h @@ -426,7 +426,7 @@ EAPI int edje_object_freeze(Evas_Object *obj); * * This function thaws the given Edje object. * - * @note If sucessive freezes were done, an equal number of thaws will be + * @note If successive freezes were done, an equal number of thaws will be * required. * * See also @ref edje_object_freeze() @@ -1533,16 +1533,32 @@ EAPI double edje_object_base_scale_get(const Evas_Object *obj); * @{ */ -/** Dragable properties values */ -typedef Efl_Ui_Drag_Dir Edje_Drag_Dir; -/** Not dragable */ -#define EDJE_DRAG_DIR_NONE EFL_UI_DRAG_DIR_NONE -/** Dragable horizontally */ -#define EDJE_DRAG_DIR_X EFL_UI_DRAG_DIR_X -/** Dragable verically */ -#define EDJE_DRAG_DIR_Y EFL_UI_DRAG_DIR_Y -/** Dragable in both directions */ -#define EDJE_DRAG_DIR_XY EFL_UI_DRAG_DIR_XY +/** + * @defgroup Edje_Part_Drag Edje Drag + * + * @brief Functions that deal with dragable parts. + * + * To create a movable part it must be declared as dragable + * in EDC file. To do so, one must define a "dragable" block inside + * the "part" block. + * + * These functions are used to set dragging properties to a + * part or get dragging information about it. + * + * @see @ref tutorial_edje_drag + * + * @ingroup Edje_Object_Part + * + * @{ + */ + +typedef enum _Edje_Drag_Dir +{ + EDJE_DRAG_DIR_NONE = 0, + EDJE_DRAG_DIR_X = 1, + EDJE_DRAG_DIR_Y = 2, + EDJE_DRAG_DIR_XY = 3 +} Edje_Drag_Dir; /** @@ -2187,10 +2203,10 @@ EAPI void *edje_object_text_insert_filter_callback_del_full(Evas_Object *obj, co * text is to be rejected, freeing it and setting the pointer to @c null will * make Edje break out of the filter cycle and reject the inserted text. This * function is different from edje_object_text_insert_filter_callback_add() in - * that the text parameter in the fucn filter is always markup. + * that the text parameter in the func filter is always markup. * * @warning If you use this function with - * edje_object_text_insert_filter_callback_add() togehter, all + * edje_object_text_insert_filter_callback_add() together, all * Edje_Text_Filter_Cb functions and Edje_Markup_Filter_Cb functions will be * executed, and then filtered text will be inserted. * @@ -3150,30 +3166,60 @@ EAPI void edje_object_item_provider_set(Edje_Object *obj, Edje_Item_Provider_Cb */ EAPI const char *edje_object_color_class_description_get(const Edje_Object *obj, const char * color_class); -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 -#define EDJE_PART_TYPE_TEXT EFL_CANVAS_LAYOUT_PART_TYPE_TEXT -#define EDJE_PART_TYPE_IMAGE EFL_CANVAS_LAYOUT_PART_TYPE_IMAGE -#define EDJE_PART_TYPE_SWALLOW EFL_CANVAS_LAYOUT_PART_TYPE_SWALLOW -#define EDJE_PART_TYPE_TEXTBLOCK EFL_CANVAS_LAYOUT_PART_TYPE_TEXTBLOCK -#define EDJE_PART_TYPE_GRADIENT EFL_CANVAS_LAYOUT_PART_TYPE_GRADIENT -#define EDJE_PART_TYPE_GROUP EFL_CANVAS_LAYOUT_PART_TYPE_GROUP -#define EDJE_PART_TYPE_BOX EFL_CANVAS_LAYOUT_PART_TYPE_BOX -#define EDJE_PART_TYPE_TABLE EFL_CANVAS_LAYOUT_PART_TYPE_TABLE -#define EDJE_PART_TYPE_EXTERNAL EFL_CANVAS_LAYOUT_PART_TYPE_EXTERNAL -#define EDJE_PART_TYPE_PROXY EFL_CANVAS_LAYOUT_PART_TYPE_PROXY -#define EDJE_PART_TYPE_SPACER EFL_CANVAS_LAYOUT_PART_TYPE_SPACER -#define EDJE_PART_TYPE_MESH_NODE EFL_CANVAS_LAYOUT_PART_TYPE_MESH_NODE -#define EDJE_PART_TYPE_LIGHT EFL_CANVAS_LAYOUT_PART_TYPE_LIGHT -#define EDJE_PART_TYPE_CAMERA EFL_CANVAS_LAYOUT_PART_TYPE_CAMERA -#define EDJE_PART_TYPE_SNAPSHOT EFL_CANVAS_LAYOUT_PART_TYPE_SNAPSHOT -#define EDJE_PART_TYPE_VECTOR EFL_CANVAS_LAYOUT_PART_TYPE_VECTOR -#define EDJE_PART_TYPE_LAST EFL_CANVAS_LAYOUT_PART_TYPE_LAST +/** + * @defgroup Edje_Object_Part Edje Part + * + * @brief Functions that deal with layout components + * + * Parts are layout components, but as a layout, they are objects too. + * + * There are several types of parts, these types can be divided into two + * main categories, the first being containers. Containers are parts + * that are in effect a group of elements. The second group is that of + * the elements, these part types may not contain others. + * + * This section has some functions specific for some types and others that + * could be applied to any type. + * + * @ingroup Edje_Object_Group + * + * @{ + */ + +/** + * @typedef Edje_Part_Type + * + * All possible "part" types in Edje + */ +typedef enum _Edje_Part_Type +{ + EDJE_PART_TYPE_NONE = 0, /**< None type value */ + EDJE_PART_TYPE_RECTANGLE = 1, /**< Rectangle type value */ + EDJE_PART_TYPE_TEXT = 2, /**< Text type value */ + EDJE_PART_TYPE_IMAGE = 3, /**< Image type value */ + EDJE_PART_TYPE_SWALLOW = 4, /**< Swallow type value */ + EDJE_PART_TYPE_TEXTBLOCK = 5, /**< Text block type value */ + EDJE_PART_TYPE_GRADIENT = 6, /**< Gradient type value */ + EDJE_PART_TYPE_GROUP = 7, /**< Group type value */ + EDJE_PART_TYPE_BOX = 8, /**< Box type value */ + EDJE_PART_TYPE_TABLE = 9, /**< Table type value */ + EDJE_PART_TYPE_EXTERNAL = 10, /**< External type value */ + EDJE_PART_TYPE_PROXY = 11, /**< Proxy type value */ + EDJE_PART_TYPE_SPACER = 12, /**< Spacer type value @since 1.7 */ + EDJE_PART_TYPE_MESH_NODE = 13, + EDJE_PART_TYPE_LIGHT = 14, + EDJE_PART_TYPE_CAMERA = 15, + EDJE_PART_TYPE_SNAPSHOT = 16, /**< Snapshot @since 1.16 */ + EDJE_PART_TYPE_VECTOR = 17, /**< Vector @since 1.18 */ + EDJE_PART_TYPE_LAST = 18 /**< Last type value */ +} Edje_Part_Type; +/** + * @} + */ /** * @} */ -#include "efl_canvas_layout.eo.legacy.h" -#include "edje_edit.eo.legacy.h" -#include "efl_layout_group.eo.legacy.h" +#include "efl_canvas_layout_eo.legacy.h" +#include "edje_edit_eo.legacy.h" +#include "efl_layout_group_eo.legacy.h" diff --git a/src/lib/edje/edje_box_layout.c b/src/lib/edje/edje_box_layout.c index 8eb73bb071..a1c0d6048a 100644 --- a/src/lib/edje/edje_box_layout.c +++ b/src/lib/edje/edje_box_layout.c @@ -1,6 +1,6 @@ #include "edje_private.h" -#include "../evas/canvas/evas_box.eo.h" +#include "../evas/canvas/evas_box_eo.h" #include diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index a050edcdca..3e3bf29850 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -1,9 +1,8 @@ -#define EFL_GFX_FILTER_BETA -#define EFL_GFX_SIZE_HINT_PROTECTED +#define EFL_GFX_HINT_PROTECTED #include "edje_private.h" -#include "../evas/canvas/evas_table.eo.h" +#include "../evas/canvas/evas_table_eo.h" static void _edje_part_make_rtl(Edje_Part_Description_Common *desc); static Edje_Part_Description_Common *_edje_get_description_by_orientation(Edje *ed, Edje_Part_Description_Common *src, Edje_Part_Description_Common **dst, unsigned char type); @@ -1005,7 +1004,7 @@ _edje_recalc_do(Edje *ed) ed->recalc_hints = EINA_FALSE; edje_object_size_min_calc(ed->obj, &min.w, &min.h); - efl_gfx_size_hint_restricted_min_set(ed->obj, min); + efl_gfx_hint_size_restricted_min_set(ed->obj, min); } if (!ed->collection) return; @@ -2398,12 +2397,29 @@ _edje_filter_get(Edje *ed, Edje_Part_Description_Spec_Filter *filter) static void _edje_part_pixel_adjust(Edje *ed, Edje_Real_Part *ep, - Edje_Calc_Params *params) + Edje_Calc_Params *params, + Eina_Bool round) { + int xw, yh, fxw, fyh; + + xw = ABS(params->final.x) + params->final.w; + yh = ABS(params->final.y) + params->final.h; + + if (round) + { + fxw = TO_INT_ROUND(ADD(ABS(params->eval.x), params->eval.w)); + fyh = TO_INT_ROUND(ADD(ABS(params->eval.y), params->eval.h)); + } + else + { + fxw = TO_INT(ADD(ABS(params->eval.x), params->eval.w)); + fyh = TO_INT(ADD(ABS(params->eval.y), params->eval.h)); + } + /* Adjust rounding to not loose one pixels compared to float information only when rendering to avoid infinite adjustement when doing min restricted calc */ - if (ABS(params->final.x) + params->final.w < TO_INT(ADD(ABS(params->eval.x), params->eval.w))) + if (xw < fxw) { if (!ed->calc_only) { @@ -2414,7 +2430,7 @@ _edje_part_pixel_adjust(Edje *ed, ep->invalidate = EINA_TRUE; } } - else if (ABS(params->final.x) + params->final.w > TO_INT(ADD(ABS(params->eval.x), params->eval.w))) + else if (xw > fxw) { if (!ed->calc_only) { @@ -2425,7 +2441,8 @@ _edje_part_pixel_adjust(Edje *ed, ep->invalidate = EINA_TRUE; } } - if (ABS(params->final.y) + params->final.h < TO_INT(ADD(ABS(params->eval.y), params->eval.h))) + + if (yh < fyh) { if (!ed->calc_only) { @@ -2436,7 +2453,7 @@ _edje_part_pixel_adjust(Edje *ed, ep->invalidate = EINA_TRUE; } } - else if (ABS(params->final.y) + params->final.h > TO_INT(ADD(ABS(params->eval.y), params->eval.h))) + else if (yh > fyh) { if (!ed->calc_only) { @@ -2448,6 +2465,8 @@ _edje_part_pixel_adjust(Edje *ed, } } + if (params->final.w < 0 || params->final.h < 0) + ERR("The params final size became negative"); } static void @@ -2907,7 +2926,7 @@ _edje_part_recalc_single(Edje *ed, efl_canvas_group_need_recalculate_set(ep->object, 1); efl_canvas_group_calculate(ep->object); - lmin = efl_gfx_size_hint_restricted_min_get(ep->object); + lmin = efl_gfx_hint_size_restricted_min_get(ep->object); if (((Edje_Part_Description_Table *)chosen_desc)->table.min.h) { if (lmin.w > minw) minw = lmin.w; @@ -2925,7 +2944,7 @@ _edje_part_recalc_single(Edje *ed, efl_canvas_group_need_recalculate_set(ep->object, 1); efl_canvas_group_calculate(ep->object); - lmin = efl_gfx_size_hint_restricted_min_get(ep->object); + lmin = efl_gfx_hint_size_restricted_min_get(ep->object); if (((Edje_Part_Description_Box *)chosen_desc)->box.min.h) { if (lmin.w > minw) minw = lmin.w; @@ -2992,7 +3011,7 @@ _edje_part_recalc_single(Edje *ed, params->final.w = TO_INT(params->eval.w); params->final.h = TO_INT(params->eval.h); - _edje_part_pixel_adjust(ed, ep, params); + _edje_part_pixel_adjust(ed, ep, params, EINA_FALSE); /* fill */ if (ep->part->type == EDJE_PART_TYPE_IMAGE) _edje_part_recalc_single_fill(ep, &((Edje_Part_Description_Image *)desc)->image.fill, params); @@ -3201,17 +3220,17 @@ _edje_svg_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3 EINA_U if (new_svg < 0) { - efl_file_set(ep->object, ed->file->path, src_key); + efl_file_simple_load(ep->object, ed->file->path, src_key); } else { snprintf(dest_key, sizeof(dest_key), "edje/vectors/%i", new_svg); - efl_file_set(ep->object, ed->file->path, src_key); + efl_file_simple_load(ep->object, ed->file->path, src_key); 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); + efl_file_simple_load(ep->object, ed->file->path, dest_key); dest_root = efl_canvas_vg_object_root_node_get(ep->object); efl_ref(dest_root); @@ -3454,7 +3473,7 @@ _edje_physics_body_add(Edje *ed, Edje_Real_Part *rp, EPhysics_World *world) ? (_x1) \ : ADD(_x1, MUL(_p, SUB(_x2, _x1)))); -#define INTP(_x1, _x2, _p) TO_INT(FINTP(_x1, _x2, _p)) +#define INTP(_x1, _x2, _p) TO_INT_ROUND(FINTP(_x1, _x2, _p)) static void _map_colors_free(Edje_Calc_Params *pf) @@ -3541,7 +3560,7 @@ _map_colors_interp(Edje_Calc_Params *p1, Edje_Calc_Params *p2, static void _edje_map_prop_set(Evas_Map *map, const Edje_Calc_Params *pf, Edje_Part_Description_Common *chosen_desc, - Edje_Real_Part *ep, Evas_Object *mo) + Edje_Real_Part *ep, Evas_Object *mo, Evas_Object *populate_obj) { Edje_Map_Color *color, **colors; int colors_cnt, i; @@ -3551,7 +3570,7 @@ _edje_map_prop_set(Evas_Map *map, const Edje_Calc_Params *pf, colors = pf->ext->map->colors; colors_cnt = pf->ext->map->colors_count; - evas_map_util_points_populate_from_object(map, ep->object); + evas_map_util_points_populate_from_object(map, populate_obj ?: ep->object); if (ep->part->type == EDJE_PART_TYPE_IMAGE || ((ep->part->type == EDJE_PART_TYPE_SWALLOW) && @@ -3641,7 +3660,7 @@ _edje_map_prop_set(Evas_Map *map, const Edje_Calc_Params *pf, #define Rel2X 2 #define Rel2Y 3 static Eina_Bool -_circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Eina_List **clist) +_circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Eina_Array *arr) { Edje_Real_Part *rp = NULL; @@ -3655,18 +3674,18 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein if (cep->param1.description->rel1.id_x >= 0) { rp = ed->table_parts[cep->param1.description->rel1.id_x]; - if (_circular_dependency_find(ed, ep, rp, clist)) + if (_circular_dependency_find(ed, ep, rp, arr)) { - *clist = eina_list_prepend(*clist, rp->part->name); + eina_array_push(arr, eina_stringshare_ref(rp->part->name)); return EINA_TRUE; } } if (cep->param1.description->rel2.id_x >= 0) { rp = ed->table_parts[cep->param1.description->rel2.id_x]; - if (_circular_dependency_find(ed, ep, rp, clist)) + if (_circular_dependency_find(ed, ep, rp, arr)) { - *clist = eina_list_prepend(*clist, rp->part->name); + eina_array_push(arr, eina_stringshare_ref(rp->part->name)); return EINA_TRUE; } } @@ -3677,18 +3696,18 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein if (cep->param2->description->rel1.id_x >= 0) { rp = ed->table_parts[cep->param2->description->rel1.id_x]; - if (_circular_dependency_find(ed, ep, rp, clist)) + if (_circular_dependency_find(ed, ep, rp, arr)) { - *clist = eina_list_prepend(*clist, rp->part->name); + eina_array_push(arr, eina_stringshare_ref(rp->part->name)); return EINA_TRUE; } } if (cep->param2->description->rel2.id_x >= 0) { rp = ed->table_parts[cep->param2->description->rel2.id_x]; - if (_circular_dependency_find(ed, ep, rp, clist)) + if (_circular_dependency_find(ed, ep, rp, arr)) { - *clist = eina_list_prepend(*clist, rp->part->name); + eina_array_push(arr, eina_stringshare_ref(rp->part->name)); return EINA_TRUE; } } @@ -3701,18 +3720,18 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein if (cep->param1.description->rel1.id_y >= 0) { rp = ed->table_parts[cep->param1.description->rel1.id_y]; - if (_circular_dependency_find(ed, ep, rp, clist)) + if (_circular_dependency_find(ed, ep, rp, arr)) { - *clist = eina_list_prepend(*clist, rp->part->name); + eina_array_push(arr, eina_stringshare_ref(rp->part->name)); return EINA_TRUE; } } if (cep->param1.description->rel2.id_y >= 0) { rp = ed->table_parts[cep->param1.description->rel2.id_y]; - if (_circular_dependency_find(ed, ep, rp, clist)) + if (_circular_dependency_find(ed, ep, rp, arr)) { - *clist = eina_list_prepend(*clist, rp->part->name); + eina_array_push(arr, eina_stringshare_ref(rp->part->name)); return EINA_TRUE; } } @@ -3722,18 +3741,18 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein if (cep->param2->description->rel1.id_y >= 0) { rp = ed->table_parts[cep->param2->description->rel1.id_y]; - if (_circular_dependency_find(ed, ep, rp, clist)) + if (_circular_dependency_find(ed, ep, rp, arr)) { - *clist = eina_list_prepend(*clist, rp->part->name); + eina_array_push(arr, eina_stringshare_ref(rp->part->name)); return EINA_TRUE; } } if (cep->param2->description->rel2.id_y >= 0) { rp = ed->table_parts[cep->param2->description->rel2.id_y]; - if (_circular_dependency_find(ed, ep, rp, clist)) + if (_circular_dependency_find(ed, ep, rp, arr)) { - *clist = eina_list_prepend(*clist, rp->part->name); + eina_array_push(arr, eina_stringshare_ref(rp->part->name)); return EINA_TRUE; } } @@ -3893,26 +3912,29 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta axes, ep->calculating, faxes, flags); - Eina_List *clist = NULL; - Eina_List *l = NULL; - char *part_name; - char depends_path[PATH_MAX] = ""; + Eina_Array *part_array = eina_array_new(10);; - if (_circular_dependency_find(ed, ep, NULL, &clist)) + if (_circular_dependency_find(ed, ep, NULL, part_array)) { + Eina_Array_Iterator it; + unsigned int i; + char *part_name; + char depends_path[PATH_MAX] = ""; + + efl_event_callback_legacy_call(ed->obj, EFL_LAYOUT_EVENT_CIRCULAR_DEPENDENCY, part_array); strncat(depends_path, ep->part->name, sizeof(depends_path) - strlen(depends_path) - 1); - EINA_LIST_FOREACH(clist, l, part_name) + EINA_ARRAY_ITER_NEXT(part_array, i, part_name, it) { strncat(depends_path, " -> ", sizeof(depends_path) - strlen(depends_path) - 1); strncat(depends_path, part_name, sizeof(depends_path) - strlen(depends_path) - 1); + eina_stringshare_del(part_name); } - efl_event_callback_legacy_call(ed->obj, EFL_LAYOUT_EVENT_CIRCULAR_DEPENDENCY, clist); ERR("Circular dependency in the group '%s' : %s", ed->group, depends_path); - eina_list_free(clist); + eina_array_free(part_array); } #endif return; @@ -4338,7 +4360,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta p3->req.w = INTP(p1->req.w, p2->req.w, pos); p3->req.h = INTP(p1->req.h, p2->req.h, pos); - _edje_part_pixel_adjust(ed, ep, p3); + _edje_part_pixel_adjust(ed, ep, p3, EINA_TRUE); if (ep->part->dragable.x) { @@ -4928,7 +4950,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta proxy = ed->file->image_dir->entries[pd_mesh_node->mesh_node.texture.id].entry; if (proxy) { - efl_file_mmap_set(texture, ed->file->f, proxy); + efl_file_simple_mmap_load(texture, ed->file->f, proxy); evas_canvas3d_texture_filter_set(texture, pd_mesh_node->mesh_node.texture.filter1, pd_mesh_node->mesh_node.texture.filter2); evas_canvas3d_texture_wrap_set(texture, pd_mesh_node->mesh_node.texture.wrap1, pd_mesh_node->mesh_node.texture.wrap2); } @@ -5047,10 +5069,14 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta if (ep->part->type != EDJE_PART_TYPE_SPACER) { Evas_Object *map_obj; + Evas_Object *cursor_objs[EDJE_ENTRY_NUM_CURSOR_OBJS]; + int c = 0, num_cursors = 0; /* Apply map to smart obj holding nested parts */ if (ep->nested_smart) map_obj = ep->nested_smart; else map_obj = mo; + if (ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) + num_cursors = _edje_entry_real_part_cursor_objs_get(ep, cursor_objs); if (chosen_desc->map.on) { @@ -5060,12 +5086,21 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta // create map and populate with part geometry if (!map) map = evas_map_new(4); - _edje_map_prop_set(map, pf, chosen_desc, ep, mo); + _edje_map_prop_set(map, pf, chosen_desc, ep, mo, NULL); if (map_obj) { evas_object_map_set(map_obj, map); evas_object_map_enable_set(map_obj, EINA_TRUE); + if (ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) + { + for (c = 0; c < num_cursors; c++) + { + _edje_map_prop_set(map, pf, chosen_desc, ep, mo, cursor_objs[c]); + evas_object_map_set(cursor_objs[c], map); + evas_object_map_enable_set(cursor_objs[c], EINA_TRUE); + } + } } } else @@ -5079,6 +5114,14 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta #endif evas_object_map_enable_set(mo, EINA_FALSE); evas_object_map_set(mo, NULL); + if (ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) + { + for (c = 0; c < num_cursors; c++) + { + evas_object_map_enable_set(cursor_objs[c], EINA_FALSE); + evas_object_map_set(cursor_objs[c], NULL); + } + } #ifdef HAVE_EPHYSICS } #endif diff --git a/src/lib/edje/edje_convert.h b/src/lib/edje/edje_convert.h index be7bac45eb..e199d1bcad 100644 --- a/src/lib/edje/edje_convert.h +++ b/src/lib/edje/edje_convert.h @@ -193,13 +193,13 @@ Edje_Part_Collection *_edje_collection_convert(Edje_File *file, Old_Edje_Part_Collection *oedc); /** - * Convert old Edje part descripton into new format. + * Convert old Edje part description into new format. * * @param type The edje par description common type * @param ce an edje collection directory entry - * @param the old edje part descripton + * @param the old edje part description * - * @return a new edje part descripton common + * @return a new edje part description common */ Edje_Part_Description_Common *_edje_description_convert(int type, Edje_Part_Collection_Directory_Entry *ce, diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c index 941a614313..ae262e25c7 100644 --- a/src/lib/edje/edje_data.c +++ b/src/lib/edje/edje_data.c @@ -299,6 +299,8 @@ _edje_edd_shutdown(void) FREED(_edje_edd_edje_part_description_external); FREED(_edje_edd_edje_part_description_mesh_node); FREED(_edje_edd_edje_part_description_light); + FREED(_edje_edd_edje_part_description_vector); + FREED(_edje_edd_edje_part_description_vector_pointer); FREED(_edje_edd_edje_part_description_camera); FREED(_edje_edd_edje_part_description_3d_color); FREED(_edje_edd_edje_part_description_3d_offset); @@ -327,6 +329,7 @@ _edje_edd_shutdown(void) FREED(_edje_edd_edje_physics_face); FREED(_edje_edd_edje_map_colors); FREED(_edje_edd_edje_map_colors_pointer); + FREED(_edje_edd_edje_color_tree_node); FREED(_edje_edd_edje_file); FREED(_edje_edd_edje_part_collection); diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index 859fcc2851..1c575174ec 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -9,11 +9,10 @@ #define _EDJE_EDIT_EO_CLASS_TYPE #define EFL_CANVAS_GROUP_PROTECTED -#define EFL_CANVAS_GROUP_BETA #include "edje_private.h" -#include "canvas/evas_canvas.eo.h" +#include "canvas/evas_canvas_eo.h" #define EDJE_EDIT_IS_UNSTABLE_AND_I_KNOW_ABOUT_IT #include "Edje_Edit.h" @@ -239,11 +238,17 @@ _load_scripts(Eo *obj, Edje_Edit *eed) return EINA_TRUE; } -EOLIAN static Eina_Bool -_edje_edit_efl_file_file_set(Eo *obj, Edje_Edit *eed, const char *file, const char *group) +EOLIAN static Eina_Error +_edje_edit_efl_file_load(Eo *obj, Edje_Edit *eed) { + Eina_Error err; + + if (efl_file_loaded_get(obj)) return 0; + _edje_edit_data_clean(eed); + err = efl_file_load(efl_super(obj, MY_CLASS)); + if (err) return err; /* TODO and maybes: * * The whole point of this thing is keep track of stuff such as * strings to free and who knows what, so we need to take care @@ -258,34 +263,10 @@ _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 */ - file = eina_vpath_resolve(file); - - Eina_Bool int_ret; - int_ret = efl_file_set(efl_super(obj, MY_CLASS), file, group); - - if (!int_ret) - return EINA_FALSE; - if (!_load_scripts(obj, eed)) - return EINA_FALSE; + return EFL_GFX_IMAGE_LOAD_ERROR_GENERIC; - return EINA_TRUE; -} - -EOLIAN static Eina_Bool -_edje_edit_efl_file_mmap_set(Eo *obj, Edje_Edit *eed, const Eina_File *mmap, const char *group) -{ - _edje_edit_data_clean(eed); - - Eina_Bool int_ret; - int_ret = efl_file_mmap_set(efl_super(obj, MY_CLASS), mmap, group); - if (!int_ret) - return EINA_FALSE; - - if (!_load_scripts(obj, eed)) - return EINA_FALSE; - - return EINA_TRUE; + return 0; } EAPI Evas_Object * @@ -16770,4 +16751,4 @@ edje_edit_print_internal_status(Evas_Object *obj) #define EDJE_EDIT_EXTRA_OPS \ EFL_CANVAS_GROUP_DEL_OPS(edje_edit) -#include "edje_edit.eo.c" +#include "edje_edit_eo.c" diff --git a/src/lib/edje/edje_edit.eo b/src/lib/edje/edje_edit.eo deleted file mode 100644 index a7bb40a550..0000000000 --- a/src/lib/edje/edje_edit.eo +++ /dev/null @@ -1,16 +0,0 @@ -class Edje.Edit extends Efl.Canvas.Layout -{ - [[Edje editing class to access edje object internals. - - This was intended ONLY for use in an actual edje editor program. Unless - you are writing one of these, do NOT use this API here. - ]] - legacy_prefix: edje_edit; - data: Edje_Edit; - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Efl.File.file { set; } - Efl.File.mmap { set; } - } -} diff --git a/src/lib/edje/edje_edit_eo.c b/src/lib/edje/edje_edit_eo.c new file mode 100644 index 0000000000..12fac92035 --- /dev/null +++ b/src/lib/edje/edje_edit_eo.c @@ -0,0 +1,43 @@ + +Efl_Object *_edje_edit_efl_object_constructor(Eo *obj, Edje_Edit *pd); + + +void _edje_edit_efl_object_destructor(Eo *obj, Edje_Edit *pd); + + +Eina_Error _edje_edit_efl_file_load(Eo *obj, Edje_Edit *pd); + + +static Eina_Bool +_edje_edit_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EDJE_EDIT_EXTRA_OPS +#define EDJE_EDIT_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _edje_edit_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _edje_edit_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_file_load, _edje_edit_efl_file_load), + EDJE_EDIT_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _edje_edit_class_desc = { + EO_VERSION, + "Edje.Edit", + EFL_CLASS_TYPE_REGULAR, + sizeof(Edje_Edit), + _edje_edit_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(edje_edit_class_get, &_edje_edit_class_desc, EFL_CANVAS_LAYOUT_CLASS, NULL); diff --git a/src/lib/edje/edje_edit_eo.h b/src/lib/edje/edje_edit_eo.h new file mode 100644 index 0000000000..f6c561a57d --- /dev/null +++ b/src/lib/edje/edje_edit_eo.h @@ -0,0 +1,28 @@ +#ifndef _EDJE_EDIT_EO_H_ +#define _EDJE_EDIT_EO_H_ + +#ifndef _EDJE_EDIT_EO_CLASS_TYPE +#define _EDJE_EDIT_EO_CLASS_TYPE + +typedef Eo Edje_Edit; + +#endif + +#ifndef _EDJE_EDIT_EO_TYPES +#define _EDJE_EDIT_EO_TYPES + + +#endif +/** + * @brief Edje editing class to access edje object internals. + * + * This was intended ONLY for use in an actual edje editor program. Unless you + * are writing one of these, do NOT use this API here. + * + * @ingroup Edje_Edit + */ +#define EDJE_EDIT_CLASS edje_edit_class_get() + +EWAPI const Efl_Class *edje_edit_class_get(void); + +#endif diff --git a/src/lib/edje/edje_edit_eo.legacy.h b/src/lib/edje/edje_edit_eo.legacy.h new file mode 100644 index 0000000000..c1429d98d2 --- /dev/null +++ b/src/lib/edje/edje_edit_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EDJE_EDIT_EO_LEGACY_H_ +#define _EDJE_EDIT_EO_LEGACY_H_ + +#ifndef _EDJE_EDIT_EO_CLASS_TYPE +#define _EDJE_EDIT_EO_CLASS_TYPE + +typedef Eo Edje_Edit; + +#endif + +#ifndef _EDJE_EDIT_EO_TYPES +#define _EDJE_EDIT_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index da0bc81674..b5397b2c91 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -27,6 +27,7 @@ struct _Entry Evas_Coord ox, oy; Evas_Object *cursor_bg; Evas_Object *cursor_fg, *cursor_fg2; +/* CHANGE EDJE_ENTRY_NUM_CURSOR_OBJS IF YOU ADD MORE OBJECTS HERE */ Evas_Textblock_Cursor *cursor; Evas_Textblock_Cursor *sel_start, *sel_end; Evas_Textblock_Cursor *cursor_user, *cursor_user_extra; @@ -2888,9 +2889,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_SCENE_EVENT_FOCUS_IN, + efl_event_callback_add(ed->base.evas, EFL_CANVAS_SCENE_EVENT_SCENE_FOCUS_IN, _evas_focus_in_cb, ed); - efl_event_callback_add(ed->base.evas, EFL_CANVAS_SCENE_EVENT_FOCUS_OUT, + efl_event_callback_add(ed->base.evas, EFL_CANVAS_SCENE_EVENT_SCENE_FOCUS_OUT, _evas_focus_out_cb, ed); } @@ -2909,12 +2910,29 @@ _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_SCENE_EVENT_FOCUS_IN, + efl_event_callback_del(ed->base.evas, EFL_CANVAS_SCENE_EVENT_SCENE_FOCUS_IN, _evas_focus_in_cb, ed); - efl_event_callback_del(ed->base.evas, EFL_CANVAS_SCENE_EVENT_FOCUS_OUT, + efl_event_callback_del(ed->base.evas, EFL_CANVAS_SCENE_EVENT_SCENE_FOCUS_OUT, _evas_focus_out_cb, ed); } +int +_edje_entry_real_part_cursor_objs_get(Edje_Real_Part *rp, Evas_Object **cursor_objs) +{ + Entry *en; + int ret = 0; + + if ((rp->type != EDJE_RP_TYPE_TEXT) || + (!rp->typedata.text) || (!rp->typedata.text->entry_data)) return -1; + + en = rp->typedata.text->entry_data; + + if (en->cursor_bg) cursor_objs[ret++] = en->cursor_bg; + if (en->cursor_fg) cursor_objs[ret++] = en->cursor_fg; + if (en->cursor_fg2) cursor_objs[ret++] = en->cursor_fg2; + return ret; +} + void _edje_entry_real_part_init(Edje *ed, Edje_Real_Part *rp) { diff --git a/src/lib/edje/edje_legacy.c b/src/lib/edje/edje_legacy.c index 34299e1e18..edcc185a33 100644 --- a/src/lib/edje/edje_legacy.c +++ b/src/lib/edje/edje_legacy.c @@ -5,11 +5,8 @@ EAPI Edje_Load_Error edje_object_load_error_get(const Eo *obj) { - Efl_Gfx_Image_Load_Error p = efl_file_load_error_get(obj); Edje *ed; - 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; return ed->load_error; @@ -77,7 +74,11 @@ edje_object_message_signal_recursive_process(Edje_Object *obj) EAPI void edje_object_signal_callback_add(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data) { - efl_layout_signal_callback_add(obj, emission, source, (Efl_Signal_Cb) func, data); + Edje *ed; + + ed = _edje_fetch(obj); + if (!ed || ed->delete_me) return; + _edje_object_signal_callback_add(ed, emission, source, func, NULL, NULL, data); } EAPI void * @@ -95,7 +96,8 @@ edje_object_signal_callback_del_full(Evas_Object *obj, const char *emission, con emission = eina_stringshare_add(emission); source = eina_stringshare_add(source); - ok = _edje_signal_callback_disable(gp, emission, source, func, data); + // We can cast here as the function won't be used and is just going to be used for comparison + ok = _edje_signal_callback_disable(gp, emission, source, func, NULL, NULL, data); // Legacy only if (!ok && !data) @@ -104,7 +106,8 @@ edje_object_signal_callback_del_full(Evas_Object *obj, const char *emission, con { if (emission == gp->matches->matches[i].signal && source == gp->matches->matches[i].source && - func == gp->matches->matches[i].func && + func == gp->matches->matches[i].legacy && + gp->flags[i].legacy && !gp->flags[i].delete_me) { gp->flags[i].delete_me = EINA_TRUE; @@ -425,7 +428,7 @@ EAPI void edje_object_part_text_cursor_geometry_get(const Edje_Object *obj, const char * part, int *x, int *y, int *w, int *h) { efl_text_cursor_geometry_get(efl_part(obj, part), - efl_text_cursor_get(efl_part(obj, part), EFL_TEXT_CURSOR_GET_MAIN), + efl_text_cursor_get(efl_part(obj, part), EFL_TEXT_CURSOR_GET_TYPE_MAIN), EFL_TEXT_CURSOR_TYPE_BEFORE, x, y, w, h, NULL, NULL, NULL, NULL ); diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c index 6e9248c33b..a323f93a9f 100644 --- a/src/lib/edje/edje_load.c +++ b/src/lib/edje/edje_load.c @@ -159,19 +159,21 @@ static int _sort_defined_boxes(const void *a, const void *b); /************************** API Routines **************************/ -EOLIAN void -_efl_canvas_layout_efl_file_file_get(Eo *obj EINA_UNUSED, Edje *ed, const char **file, const char **group) +EOLIAN const char * +_efl_canvas_layout_efl_file_file_get(Eo *obj EINA_UNUSED, Edje *ed) { - if (file) *file = ed->path; - if (group) *group = ed->group; + return ed->path; } -EOLIAN Efl_Gfx_Image_Load_Error -_efl_canvas_layout_efl_file_load_error_get(const Eo *obj, Edje *ed) +EOLIAN const char * +_efl_canvas_layout_efl_file_group_get(Eo *obj EINA_UNUSED, Edje *ed) { - Efl_Gfx_Image_Load_Error p = efl_file_load_error_get(efl_super(obj, EFL_CANVAS_LAYOUT_CLASS)); + return ed->group; +} - if (p != EFL_GFX_IMAGE_LOAD_ERROR_NONE) return p; +EOLIAN Eina_Error +_efl_canvas_layout_layout_load_error_get(const Eo *obj EINA_UNUSED, Edje *ed) +{ switch (ed->load_error) { case EDJE_LOAD_ERROR_NONE: return EFL_GFX_IMAGE_LOAD_ERROR_NONE; @@ -184,8 +186,9 @@ _efl_canvas_layout_efl_file_load_error_get(const Eo *obj, Edje *ed) 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; + default: break; } + return EFL_GFX_IMAGE_LOAD_ERROR_GENERIC; } EAPI const char * @@ -761,7 +764,7 @@ _edje_devices_add(Edje *ed, Evas *tev) _edje_device_changed_cb, ed); } -int +Eina_Error _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) { Edje *ed; @@ -782,12 +785,12 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch Edje_Nested_Support *st_nested = (idx >= 0) ? eina_array_data_get(nested, idx) : NULL; ed = _edje_fetch(obj); - if (!ed) return 0; + if (!ed) return EFL_GFX_IMAGE_LOAD_ERROR_GENERIC; if (!group) group = ""; if ((ed->file) && (ed->file->f == file) && (ed->group) && (!strcmp(group, ed->group))) { - return 1; + return 0; } tev = evas_object_evas_get(obj); @@ -840,7 +843,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch { ed->load_error = EDJE_LOAD_ERROR_CORRUPT_FILE; _edje_file_del(ed); - return 0; + return EFL_GFX_IMAGE_LOAD_ERROR_CORRUPT_FILE; } eina_array_step_set(&parts, sizeof (Eina_Array), 8); @@ -1009,7 +1012,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch eina_mempool_free(_edje_real_part_mp, rp); evas_event_thaw(tev); evas_event_thaw_eval(tev); - return 0; + return EFL_GFX_IMAGE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; } _edje_ref(ed); @@ -1106,7 +1109,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch if (pd_mesh_node->mesh_node.mesh.primitive == EVAS_CANVAS3D_MESH_PRIMITIVE_NONE) { - efl_file_set(mesh, ed->file->model_dir->entries[pd_mesh_node->mesh_node.mesh.id].entry, NULL); + efl_file_simple_load(mesh, ed->file->model_dir->entries[pd_mesh_node->mesh_node.mesh.id].entry, NULL); } else { @@ -1460,6 +1463,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch do { + Eina_Error load_error; child_obj = edje_object_add(ed->base.evas); edje_object_mirrored_set(child_obj, edje_object_mirrored_get(ed->obj)); @@ -1469,7 +1473,8 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch _edje_real_part_swallow(ed, rp, child_obj, EINA_FALSE); } - if (!_edje_object_file_set_internal(child_obj, file, source, rp->part->name, group_path, nested)) + load_error = _edje_object_file_set_internal(child_obj, file, source, rp->part->name, group_path, nested); + if (load_error) { ERR("impossible to set part '%s' of group '%s' from file '%s' to '%s'", rp->part->name, group_path_entry, eina_file_filename_get(file), source); @@ -1724,11 +1729,11 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch eina_array_flush(&parts); evas_event_thaw(tev); evas_event_thaw_eval(tev); - return 1; + return 0; } evas_event_thaw(tev); evas_event_thaw_eval(tev); - return 0; + return EFL_GFX_IMAGE_LOAD_ERROR_GENERIC; on_error: eina_list_free(textblocks); @@ -1748,7 +1753,7 @@ on_error: } evas_event_thaw(tev); evas_event_thaw_eval(tev); - return 0; + return EFL_GFX_IMAGE_LOAD_ERROR_GENERIC; } void @@ -2100,7 +2105,7 @@ _edje_file_del(Edje *ed) EINA_LIST_FREE(ed->actions, runp) free(runp); } - efl_event_callback_del(ed->obj, EFL_EVENT_ANIMATOR_TICK, _edje_timer_cb, ed); + efl_event_callback_del(ed->obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _edje_timer_cb, ed); ecore_animator_del(ed->animator); ed->animator = NULL; diff --git a/src/lib/edje/edje_main.c b/src/lib/edje/edje_main.c index 1417309250..dc2c35cba5 100644 --- a/src/lib/edje/edje_main.c +++ b/src/lib/edje/edje_main.c @@ -84,7 +84,7 @@ edje_init(void) _edje_scale = FROM_DOUBLE(1.0); _edje_global_obj = efl_add(EDJE_GLOBAL_CLASS, efl_main_loop_get()); EINA_SAFETY_ON_TRUE_GOTO(!_edje_global_obj, shutdown_efreet); - EINA_SAFETY_ON_TRUE_GOTO(!efl_loop_register(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_INTERFACE, _edje_global_obj), shutdown_efreet); + EINA_SAFETY_ON_TRUE_GOTO(!efl_loop_register(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_MIXIN, _edje_global_obj), shutdown_efreet); EINA_SAFETY_ON_TRUE_GOTO(!efl_loop_register(efl_main_loop_get(), EFL_GFX_TEXT_CLASS_INTERFACE, _edje_global_obj), shutdown_efreet); EINA_SAFETY_ON_TRUE_GOTO(!efl_loop_register(efl_main_loop_get(), EFL_GFX_SIZE_CLASS_INTERFACE, _edje_global_obj), shutdown_efreet); @@ -154,7 +154,7 @@ shutdown_all: _edje_edd_shutdown(); if (_edje_global_obj) { - efl_loop_unregister(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_INTERFACE, _edje_global_obj); + efl_loop_unregister(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_MIXIN, _edje_global_obj); efl_loop_unregister(efl_main_loop_get(), EFL_GFX_TEXT_CLASS_INTERFACE, _edje_global_obj); efl_loop_unregister(efl_main_loop_get(), EFL_GFX_SIZE_CLASS_INTERFACE, _edje_global_obj); efl_del(_edje_global_obj); @@ -213,7 +213,7 @@ _edje_shutdown_core(void) _edje_text_class_hash_free(); _edje_size_class_hash_free(); _edje_edd_shutdown(); - efl_loop_unregister(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_INTERFACE, _edje_global_obj); + efl_loop_unregister(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_MIXIN, _edje_global_obj); efl_loop_unregister(efl_main_loop_get(), EFL_GFX_TEXT_CLASS_INTERFACE, _edje_global_obj); efl_loop_unregister(efl_main_loop_get(), EFL_GFX_SIZE_CLASS_INTERFACE, _edje_global_obj); efl_del(_edje_global_obj); diff --git a/src/lib/edje/edje_match.c b/src/lib/edje/edje_match.c index 57e319bdb9..7f4065ae96 100644 --- a/src/lib/edje/edje_match.c +++ b/src/lib/edje/edje_match.c @@ -553,7 +553,10 @@ edje_match_callback_exec_check_finals(const Edje_Signals_Sources_Patterns *ssp, if (ed->callbacks->flags[idx].delete_me) continue; - cb->func((void *)ed->callbacks->custom_data[idx], ed->obj, sig, source); + if (ed->callbacks->flags[idx].legacy) + cb->legacy((void *)ed->callbacks->custom_data[idx], ed->obj, sig, source); + else + cb->eo((void *)ed->callbacks->custom_data[idx], ed->obj, sig, source); if (_edje_block_break(ed)) { r = 0; diff --git a/src/lib/edje/edje_part_box.c b/src/lib/edje/edje_part_box.c index f737159c6e..88a667dd56 100644 --- a/src/lib/edje/edje_part_box.c +++ b/src/lib/edje/edje_part_box.c @@ -3,7 +3,7 @@ #include "efl_canvas_layout_part_box.eo.h" #define MY_CLASS EFL_CANVAS_LAYOUT_PART_BOX_CLASS -#include "../evas/canvas/evas_box.eo.h" +#include "../evas/canvas/evas_box_eo.h" PROXY_IMPLEMENTATION(box, MY_CLASS, EINA_FALSE) #undef PROXY_IMPLEMENTATION @@ -99,12 +99,6 @@ _efl_canvas_layout_part_box_efl_pack_linear_pack_content_get(Eo *obj, void *_pd return _edje_part_box_content_at(pd->ed, pd->part, index); } -EOLIAN static Eina_Bool -_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_Entity * subobj) { diff --git a/src/lib/edje/edje_part_external.c b/src/lib/edje/edje_part_external.c index bbc82791b7..492106c1fa 100644 --- a/src/lib/edje/edje_part_external.c +++ b/src/lib/edje/edje_part_external.c @@ -22,4 +22,18 @@ _efl_canvas_layout_part_external_efl_content_content_get(const Eo *obj, void *_p return _edje_object_part_external_object_get(pd->ed, pd->part); } +EOLIAN static Eina_Bool +_efl_canvas_layout_part_external_efl_content_content_set(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Gfx_Entity *content EINA_UNUSED) +{ + ERR("Setting of content is not permitted on this part"); + return EINA_FALSE; +} + +EOLIAN static Efl_Gfx_Entity* +_efl_canvas_layout_part_external_efl_content_content_unset(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED) +{ + ERR("Unsetting of content is not permitted on this part"); + return NULL; +} + #include "efl_canvas_layout_part_external.eo.c" diff --git a/src/lib/edje/edje_part_invalid.c b/src/lib/edje/edje_part_invalid.c index 469de82fd4..d36491d674 100644 --- a/src/lib/edje/edje_part_invalid.c +++ b/src/lib/edje/edje_part_invalid.c @@ -71,10 +71,9 @@ EDJE_PART_INVALID_VOID(efl_text_cursor_line_jump_by, _efl_canvas_layout_part_inv 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_VOID(efl_text_markup_interactive_cursor_markup_insert, _efl_canvas_layout_part_invalid_efl_text_markup_interactive_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) diff --git a/src/lib/edje/edje_part_swallow.c b/src/lib/edje/edje_part_swallow.c index bf4c2b59cb..e0c0aec568 100644 --- a/src/lib/edje/edje_part_swallow.c +++ b/src/lib/edje/edje_part_swallow.c @@ -27,7 +27,7 @@ _efl_canvas_layout_part_swallow_efl_content_content_unset(Eo *obj, void *_pd EIN PROXY_DATA_GET(obj, pd); Efl_Gfx_Entity *content = _edje_efl_content_content_get(pd->ed, pd->part); if (!content) return NULL; - efl_content_remove(obj, content); + efl_canvas_layout_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 cc2439dd89..e860d74e78 100644 --- a/src/lib/edje/edje_part_table.c +++ b/src/lib/edje/edje_part_table.c @@ -3,7 +3,7 @@ #include "efl_canvas_layout_part_table.eo.h" #define MY_CLASS EFL_CANVAS_LAYOUT_PART_TABLE_CLASS -#include "../evas/canvas/evas_table.eo.h" +#include "../evas/canvas/evas_table_eo.h" PROXY_IMPLEMENTATION(table, MY_CLASS, EINA_FALSE) #undef PROXY_IMPLEMENTATION @@ -29,12 +29,6 @@ _efl_canvas_layout_part_table_efl_container_content_count(Eo *obj, void *_pd EIN return evas_obj_table_count(pd->rp->object); } -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_Entity *content) -{ - return efl_pack_unpack(obj, content); -} - EOLIAN static Eina_Bool _efl_canvas_layout_part_table_efl_pack_pack_clear(Eo *obj, void *_pd EINA_UNUSED) { diff --git a/src/lib/edje/edje_part_text.c b/src/lib/edje/edje_part_text.c index 31678a3697..8f7d936cb6 100644 --- a/src/lib/edje/edje_part_text.c +++ b/src/lib/edje/edje_part_text.c @@ -187,7 +187,7 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_geometry_get(const Eo *obj, } EOLIAN static void -_efl_canvas_layout_part_text_efl_text_markup_cursor_markup_insert(Eo *obj, +_efl_canvas_layout_part_text_efl_text_markup_interactive_cursor_markup_insert(Eo *obj, void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor *cur EINA_UNUSED, const char *text) { @@ -477,6 +477,8 @@ _canvas_layout_user_text_collect(Edje *ed, Edje_User_Defined *eud) Eina_List **props = &eud->u.text_style.props; rp = _edje_real_part_recursive_get(&ed, eud->part); + if (!rp) return; + if (eud->u.text_style.types == EDJE_PART_TEXT_PROP_NONE) return; if (eud->u.text_style.types & EDJE_PART_TEXT_PROP_BACKING_TYPE) diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index 2781ce4c4c..6ae592680f 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -40,7 +40,6 @@ #endif // auto_unref -#define EFL_CANVAS_LAYOUT_BETA #define EFL_CANVAS_OBJECT_PROTECTED #define EFL_LAYOUT_CALC_PROTECTED @@ -156,7 +155,9 @@ EAPI extern int _edje_default_log_dom ; #define FROM_DOUBLE(a) eina_f32p32_double_from(a) #define FROM_INT(a) eina_f32p32_int_from(a) #define TO_INT(a) eina_f32p32_int_to(a) -#define TO_INT_ROUND(a) eina_f32p32_int_to(ADD(a, FROM_DOUBLE(0.5))) +#define TO_INT_ROUND(a) (((a) >= 0.0) \ + ? eina_f32p32_int_to(ADD(a, FROM_DOUBLE(0.5)) \ + : eina_f32p32_int_to(ADD(a, FROM_DOUBLE(-0.5)) #define ZERO 0 #define COS(a) eina_f32p32_cos(a) #define SIN(a) eina_f32p32_sin(a) @@ -179,7 +180,7 @@ EAPI extern int _edje_default_log_dom ; #define FROM_DOUBLE(a) (a) #define FROM_INT(a) (double)(a) #define TO_INT(a) (int)(a) -#define TO_INT_ROUND(a) (int)(a + 0.5) +#define TO_INT_ROUND(a) (((a) >= 0.0) ? (int)(a + 0.5) : (int)(a - 0.5)) #define ZERO 0.0 #define COS(a) cos(a) #define SIN(a) sin(a) @@ -189,6 +190,8 @@ EAPI extern int _edje_default_log_dom ; #endif +#define EDJE_ENTRY_NUM_CURSOR_OBJS 3 + /* Inheritable Edje Smart API. For now private so only Edje Edit makes * use of this, but who knows what will be possible in the future */ #define EDJE_SMART_API_VERSION 1 @@ -1048,12 +1051,16 @@ struct _Edje_Signal_Callback_Match { const char *signal; const char *source; - Edje_Signal_Cb func; + union { + Edje_Signal_Cb legacy; + EflLayoutSignalCb eo; + }; }; struct _Edje_Signal_Callback_Matches { Edje_Signal_Callback_Match *matches; + Eina_Free_Cb *free_cb; Edje_Signals_Sources_Patterns *patterns; @@ -1065,6 +1072,7 @@ struct _Edje_Signal_Callback_Matches struct _Edje_Signal_Callback_Flags { + Eina_Bool legacy:1; Eina_Bool delete_me:1; Eina_Bool just_added:1; Eina_Bool propagate:1; @@ -2148,6 +2156,7 @@ struct _Edje_Var_Hash struct _Edje_Var_Timer { + EINA_INLIST; Edje *edje; int id; Embryo_Function func; @@ -2168,7 +2177,7 @@ struct _Edje_Var_Animator struct _Edje_Var_Pool { int id_count; - Eina_List *timers; + Eina_Inlist *timers; Eina_List *animators; int size; Edje_Var *vars; @@ -2423,7 +2432,9 @@ const Eina_Inarray *edje_match_signal_source_hash_get(const char *signal, const char *source, const Eina_Rbtree *tree); void edje_match_signal_source_free(Edje_Signal_Source_Char *key, void *data); -void _edje_signal_callback_matches_unref(Edje_Signal_Callback_Matches *m); +Eina_Bool _edje_object_signal_callback_add(Edje *ed, const char *emission, const char *source, + Edje_Signal_Cb func_legacy, + Efl_Signal_Cb func_eo, Eina_Free_Cb func_free_cb, void *data); // FIXME remove below 3 eapi decls when edje_convert goes EAPI void _edje_edd_init(void); @@ -2478,7 +2489,7 @@ static inline Edje_Global * _edje_global(void) { #ifndef NDEBUG - return efl_provider_find(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_INTERFACE); + return efl_provider_find(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_MIXIN); #else extern Edje_Global *_edje_global_obj; return _edje_global_obj; @@ -2546,19 +2557,24 @@ void _edje_callbacks_del(Evas_Object *obj, Edje *ed); void _edje_callbacks_focus_del(Evas_Object *obj, Edje *ed); const Edje_Signal_Callback_Group *_edje_signal_callback_alloc(void); +void _edje_signal_callback_matches_unref(Edje_Signal_Callback_Matches *m, Edje_Signal_Callback_Flags *flags, void **custom_data); void _edje_signal_callback_free(const Edje_Signal_Callback_Group *cgp); Eina_Bool _edje_signal_callback_push(Edje_Signal_Callback_Group *cgp, const char *signal, const char *source, - Edje_Signal_Cb func, void *data, + Edje_Signal_Cb func_legacy, + Efl_Signal_Cb func_eo, + Eina_Free_Cb func_free_cb, + void *data, Eina_Bool propagate); Eina_Bool _edje_signal_callback_disable(Edje_Signal_Callback_Group *cgp, const char *signal, const char *source, - Edje_Signal_Cb func, void *data); + Edje_Signal_Cb func_legacy, + EflLayoutSignalCb func, Eina_Free_Cb func_free_cb, void *data); EAPI void _edje_edd_init(void); 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); +Eina_Error _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); @@ -2873,6 +2889,7 @@ void _edje_lua_script_only_message(Edje *ed, Edje_Message *em); void _edje_entry_init(Edje *ed); void _edje_entry_shutdown(Edje *ed); +int _edje_entry_real_part_cursor_objs_get(Edje_Real_Part *rp, Evas_Object **objs); void _edje_entry_real_part_init(Edje *ed, Edje_Real_Part *rp); void _edje_entry_real_part_shutdown(Edje *ed, Edje_Real_Part *rp); void _edje_entry_real_part_configure(Edje *ed, Edje_Real_Part *rp); diff --git a/src/lib/edje/edje_program.c b/src/lib/edje/edje_program.c index 38a798f2ad..5bdb8513bf 100644 --- a/src/lib/edje/edje_program.c +++ b/src/lib/edje/edje_program.c @@ -236,8 +236,10 @@ edje_transition_duration_factor_set(double scale) _edje_transition_duration_scale = FROM_DOUBLE(scale); } -static inline Eina_Bool -_edje_object_signal_callback_add(Edje *ed, const char *emission, const char *source, Efl_Signal_Cb func, void *data) +Eina_Bool +_edje_object_signal_callback_add(Edje *ed, const char *emission, const char *source, + Edje_Signal_Cb func_legacy, + Efl_Signal_Cb func_eo, Eina_Free_Cb func_free_cb, void *data) { Edje_Signal_Callback_Group *gp; const char *sig; @@ -252,7 +254,7 @@ _edje_object_signal_callback_add(Edje *ed, const char *emission, const char *sou src = eina_stringshare_add(source); gp = (Edje_Signal_Callback_Group *) ed->callbacks; - ok = _edje_signal_callback_push(gp, sig, src, func, data, EINA_TRUE); + ok = _edje_signal_callback_push(gp, sig, src, func_legacy, func_eo, func_free_cb, data, EINA_TRUE); eina_stringshare_del(sig); eina_stringshare_del(src); @@ -267,17 +269,17 @@ edje_object_propagate_callback_add(Evas_Object *obj, Efl_Signal_Cb func, void *d ed = _edje_fetch(obj); if (!ed || ed->delete_me) return; - _edje_object_signal_callback_add(ed, "*", "*", func, data); + _edje_object_signal_callback_add(ed, "*", "*", func, NULL, NULL, data); } -EOLIAN Eina_Bool -_efl_canvas_layout_efl_layout_signal_signal_callback_add(Eo *obj EINA_UNUSED, Edje *ed, const char *emission, const char *source, Efl_Signal_Cb func, void *data) +Eina_Bool +_efl_canvas_layout_efl_layout_signal_signal_callback_add(Eo *obj EINA_UNUSED, Edje *ed, const char *emission, const char *source, void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb) { - return _edje_object_signal_callback_add(ed, emission, source, func, data); + return _edje_object_signal_callback_add(ed, emission, source, NULL, func, func_free_cb, func_data); } -EOLIAN Eina_Bool -_efl_canvas_layout_efl_layout_signal_signal_callback_del(Eo *obj EINA_UNUSED, Edje *ed, const char *emission, const char *source, Efl_Signal_Cb func, void *data) +Eina_Bool +_efl_canvas_layout_efl_layout_signal_signal_callback_del(Eo *obj EINA_UNUSED, Edje *ed, const char *emission, const char *source, void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb) { Edje_Signal_Callback_Group *gp; Eina_Bool ok; @@ -291,7 +293,7 @@ _efl_canvas_layout_efl_layout_signal_signal_callback_del(Eo *obj EINA_UNUSED, Ed emission = eina_stringshare_add(emission); source = eina_stringshare_add(source); - ok = _edje_signal_callback_disable(gp, emission, source, func, data); + ok = _edje_signal_callback_disable(gp, emission, source, NULL, func, func_free_cb, func_data); eina_stringshare_del(emission); eina_stringshare_del(source); @@ -395,7 +397,7 @@ _edje_program_run_cleanup(Edje *ed, Edje_Running_Program *runp) ed->actions = eina_list_remove(ed->actions, runp); if (!ed->actions) { - efl_event_callback_del(ed->obj, EFL_EVENT_ANIMATOR_TICK, _edje_timer_cb, ed); + efl_event_callback_del(ed->obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _edje_timer_cb, ed); ecore_animator_del(ed->animator); ed->animator = NULL; } @@ -759,7 +761,7 @@ low_mem_current: if (!ed->actions) { if (ed->canvas_animator) - efl_event_callback_add(ed->obj, EFL_EVENT_ANIMATOR_TICK, _edje_timer_cb, ed); + efl_event_callback_add(ed->obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _edje_timer_cb, ed); else ed->animator = ecore_animator_add(_edje_animator_cb, ed); } @@ -1669,13 +1671,16 @@ _edje_emit_cb(Edje *ed, const char *sig, const char *src, Edje_Message_Signal_Da cb = &m->matches[*i]; - cb->func((void *)ed->callbacks->custom_data[*i], ed->obj, sig, src); + if (ed->callbacks->flags[*i].legacy) + cb->legacy((void *)ed->callbacks->custom_data[*i], ed->obj, sig, src); + else + cb->eo((void *)ed->callbacks->custom_data[*i], ed->obj, sig, src); if (_edje_block_break(ed)) break; } } break_prog: - _edje_signal_callback_matches_unref(m); + _edje_signal_callback_matches_unref(m, ed->callbacks->flags, ed->callbacks->custom_data); _edje_signal_callback_patterns_unref(ssp); } diff --git a/src/lib/edje/edje_signal.c b/src/lib/edje/edje_signal.c index 2f4bab3bd6..e13ec1bcb2 100644 --- a/src/lib/edje/edje_signal.c +++ b/src/lib/edje/edje_signal.c @@ -22,7 +22,13 @@ _edje_signal_match_key_cmp(const void *key1, int key1_length EINA_UNUSED, const { if (a->matches[i].signal != b->matches[i].signal) return a->matches[i].signal - b->matches[i].signal; if (a->matches[i].source != b->matches[i].source) return a->matches[i].source - b->matches[i].source; - if (a->matches[i].func != b->matches[i].func) return (unsigned char *)a->matches[i].func - (unsigned char *)b->matches[i].func; + // Callback be it legacy or eo, have the same pointer size and so can be just compared like that + if (a->matches[i].legacy != b->matches[i].legacy) return (unsigned char *)a->matches[i].legacy - (unsigned char *)b->matches[i].legacy; + if (a->free_cb && b->free_cb && + a->free_cb[i] != b->free_cb[i]) return (unsigned char *)a->free_cb[i] - (unsigned char *)b->free_cb[i]; + if ((!a->free_cb && b->free_cb) || + (a->free_cb && !b->free_cb)) + return a->free_cb - b->free_cb; } return 0; } @@ -39,11 +45,16 @@ _edje_signal_match_key_hash(const void *key, int key_length EINA_UNUSED) #ifdef EFL64 hash ^= eina_hash_int64((const unsigned long long int *)&a->matches[i].signal, sizeof (char *)); hash ^= eina_hash_int64((const unsigned long long int *)&a->matches[i].source, sizeof (char *)); - hash ^= eina_hash_int64((const unsigned long long int *)&a->matches[i].func, sizeof (Edje_Signal_Cb)); + hash ^= eina_hash_int64((const unsigned long long int *)&a->matches[i].legacy, sizeof (Edje_Signal_Cb)); + if (a->free_cb) + hash ^= eina_hash_int64((const unsigned long long int *)&a->free_cb[i], sizeof (Eina_Free_Cb)); #else hash ^= eina_hash_int32((const unsigned int *)&a->matches[i].signal, sizeof (char *)); hash ^= eina_hash_int32((const unsigned int *)&a->matches[i].source, sizeof (char *)); - hash ^= eina_hash_int32((const unsigned int *)&a->matches[i].func, sizeof (Edje_Signal_Cb)); + // Callback be it legacy or eo, have the same pointer size and so using legacy for hash is enough + hash ^= eina_hash_int32((const unsigned int *)&a->matches[i].legacy, sizeof (Edje_Signal_Cb)); + if (a->free_cb) + hash ^= eina_hash_int32((const unsigned int *)&a->free_cb[i], sizeof (Eina_Free_Cb)); #endif } return hash; @@ -64,11 +75,17 @@ _edje_signal_callback_matches_dup(const Edje_Signal_Callback_Matches *src) result->patterns = NULL; EINA_REFCOUNT_REF(result); + if (src->free_cb) + { + result->free_cb = malloc(sizeof (Eina_Free_Cb) * src->matches_count); + if (result->free_cb) memcpy(result->free_cb, src->free_cb, sizeof (Eina_Free_Cb) * src->matches_count); + } + for (i = 0; i < src->matches_count; i++) { result->matches[i].signal = eina_stringshare_ref(src->matches[i].signal); result->matches[i].source = eina_stringshare_ref(src->matches[i].source); - result->matches[i].func = src->matches[i].func; + result->matches[i].legacy = src->matches[i].legacy; } return result; @@ -141,14 +158,23 @@ _edje_signal_callback_unset(Edje_Signal_Callback_Group *gp, int idx) static void _edje_signal_callback_set(Edje_Signal_Callback_Group *gp, int idx, const char *sig, const char *src, - Edje_Signal_Cb func, void *data, Edje_Signal_Callback_Flags flags) + Edje_Signal_Cb func_legacy, + Efl_Signal_Cb func_eo, Eina_Free_Cb func_free_cb, + void *data, Edje_Signal_Callback_Flags flags) { Edje_Signal_Callback_Match *m; m = gp->matches->matches + idx; m->signal = eina_stringshare_ref(sig); m->source = eina_stringshare_ref(src); - m->func = func; + if (func_legacy) m->legacy = func_legacy; + else m->eo = func_eo; + if (func_free_cb) + { + if (!gp->matches->free_cb) + ((Edje_Signal_Callback_Matches *) gp->matches)->free_cb = calloc(sizeof (Eina_Free_Cb), gp->matches->matches_count); + gp->matches->free_cb[idx] = func_free_cb; + } gp->custom_data[idx] = data; @@ -163,6 +189,11 @@ _edje_signal_callback_grow(Edje_Signal_Callback_Group *gp) tmp = (Edje_Signal_Callback_Matches *)gp->matches; tmp->matches_count++; tmp->matches = realloc(tmp->matches, sizeof (Edje_Signal_Callback_Match) * tmp->matches_count); + if (tmp->free_cb) + { + tmp->free_cb = realloc(tmp->free_cb, sizeof (Eina_Free_Cb) * tmp->matches_count); + tmp->free_cb[tmp->matches_count - 1] = NULL; + } gp->custom_data = realloc(gp->custom_data, sizeof (void *) * tmp->matches_count); gp->flags = realloc(gp->flags, sizeof (Edje_Signal_Callback_Flags) * tmp->matches_count); @@ -172,7 +203,9 @@ _edje_signal_callback_grow(Edje_Signal_Callback_Group *gp) Eina_Bool _edje_signal_callback_push(Edje_Signal_Callback_Group *gp, const char *sig, const char *src, - Edje_Signal_Cb func, void *data, Eina_Bool propagate) + Edje_Signal_Cb func_legacy, + Efl_Signal_Cb func_eo, Eina_Free_Cb func_free_cb, + void *data, Eina_Bool propagate) { unsigned int i; Edje_Signal_Callback_Flags flags; @@ -181,23 +214,11 @@ _edje_signal_callback_push(Edje_Signal_Callback_Group *gp, flags.delete_me = EINA_FALSE; flags.just_added = EINA_TRUE; flags.propagate = !!propagate; + flags.legacy = !!func_legacy; + // FIXME: properly handle legacy and non legacy case, including free function tmp = (Edje_Signal_Callback_Matches *)gp->matches; - // let's first try to see if we do find an empty matching stop - for (i = 0; i < tmp->matches_count; i++) - { - if ((sig == tmp->matches[i].signal) && - (src == tmp->matches[i].source) && - (func == tmp->matches[i].func) && - (gp->flags[i].delete_me)) - { - _edje_signal_callback_unset(gp, i); - _edje_signal_callback_set(gp, i, sig, src, func, data, flags); - return EINA_TRUE; - } - } - if (tmp->hashed) { if (EINA_REFCOUNT_GET(tmp) == 1) @@ -224,7 +245,7 @@ _edje_signal_callback_push(Edje_Signal_Callback_Group *gp, if (gp->flags[i].delete_me) { _edje_signal_callback_unset(gp, i); - _edje_signal_callback_set(gp, i, sig, src, func, data, flags); + _edje_signal_callback_set(gp, i, sig, src, func_legacy, func_eo, func_free_cb, data, flags); return EINA_TRUE; } } @@ -232,7 +253,7 @@ _edje_signal_callback_push(Edje_Signal_Callback_Group *gp, _edje_signal_callback_grow(gp); // Set propagate and just_added flags _edje_signal_callback_set(gp, tmp->matches_count - 1, - sig, src, func, data, flags); + sig, src, func_legacy, func_eo, func_free_cb, data, flags); return EINA_TRUE; } @@ -260,12 +281,24 @@ _edje_signal_callback_alloc(void) } void -_edje_signal_callback_matches_unref(Edje_Signal_Callback_Matches *m) +_edje_signal_callback_matches_unref(Edje_Signal_Callback_Matches *m, Edje_Signal_Callback_Flags *flags, void **custom_data) { + unsigned int i; + + if (m->free_cb) + { + for (i = 0; i < m->matches_count; ++i) + { + if (!flags[i].delete_me && + m->free_cb[i]) + { + m->free_cb[i](custom_data[i]); + } + } + } + EINA_REFCOUNT_UNREF(m) { - unsigned int i; - _edje_signal_callback_patterns_unref(m->patterns); if (m->hashed) @@ -292,7 +325,7 @@ _edje_signal_callback_free(const Edje_Signal_Callback_Group *cgp) if (!gp) return; - _edje_signal_callback_matches_unref((Edje_Signal_Callback_Matches *)gp->matches); + _edje_signal_callback_matches_unref((Edje_Signal_Callback_Matches *)gp->matches, gp->flags, gp->custom_data); gp->matches = NULL; free(gp->flags); gp->flags = NULL; @@ -304,7 +337,8 @@ _edje_signal_callback_free(const Edje_Signal_Callback_Group *cgp) Eina_Bool _edje_signal_callback_disable(Edje_Signal_Callback_Group *gp, const char *sig, const char *src, - Edje_Signal_Cb func, void *data) + Edje_Signal_Cb func_legacy, + EflLayoutSignalCb func, Eina_Free_Cb func_free_cb, void *data) { unsigned int i; @@ -314,10 +348,17 @@ _edje_signal_callback_disable(Edje_Signal_Callback_Group *gp, { if (sig == gp->matches->matches[i].signal && src == gp->matches->matches[i].source && - func == gp->matches->matches[i].func && - gp->custom_data[i] == data && - !gp->flags[i].delete_me) + !gp->flags[i].delete_me && + ((func == gp->matches->matches[i].eo && + (!gp->matches->free_cb || func_free_cb == gp->matches->free_cb[i]) && + gp->custom_data[i] == data && + !gp->flags[i].legacy) || + (func_legacy == gp->matches->matches[i].legacy && + gp->custom_data[i] == data && + gp->flags[i].legacy)) + ) { + if (func && func_free_cb) func_free_cb(data); gp->flags[i].delete_me = EINA_TRUE; //return gp->custom_data[i]; return EINA_TRUE; @@ -341,9 +382,7 @@ _edje_signal_callback_move_last(Edje_Signal_Callback_Group *gp, if (!gp->flags[j].delete_me) { _edje_signal_callback_unset(gp, i); - m->matches[i].signal = m->matches[j].signal; - m->matches[i].source = m->matches[j].source; - m->matches[i].func = m->matches[j].func; + memcpy(&m->matches[i], &m->matches[j], sizeof (Edje_Signal_Callback_Match)); gp->flags[i] = gp->flags[j]; gp->custom_data[i] = gp->custom_data[j]; return; @@ -394,7 +433,7 @@ _edje_signal_callback_patterns_ref(const Edje_Signal_Callback_Group *gp) } else { - _edje_signal_callback_matches_unref((Edje_Signal_Callback_Matches *)gp->matches); + _edje_signal_callback_matches_unref((Edje_Signal_Callback_Matches *)gp->matches, gp->flags, gp->custom_data); ((Edje_Signal_Callback_Group *)gp)->matches = m; tmp = (Edje_Signal_Callback_Matches *)gp->matches; EINA_REFCOUNT_REF(tmp); diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c index 5a715b35ed..7b97bd303e 100644 --- a/src/lib/edje/edje_smart.c +++ b/src/lib/edje/edje_smart.c @@ -1,10 +1,9 @@ #define EFL_CANVAS_GROUP_PROTECTED -#define EFL_CANVAS_GROUP_BETA #define EFL_PART_PROTECTED #include "edje_private.h" -#include "canvas/evas_canvas.eo.h" +#include "canvas/evas_canvas_eo.h" #ifdef MY_CLASS # undef MY_CLASS @@ -96,7 +95,7 @@ _efl_canvas_layout_efl_object_dbg_info_get(Eo *eo_obj, Edje *_pd EINA_UNUSED, Ef Edje_Load_Error error; const char *file, *edje_group; - efl_file_get(eo_obj, &file, &edje_group); + efl_file_simple_get(eo_obj, &file, &edje_group); EFL_DBG_INFO_APPEND(group, "File", EINA_VALUE_TYPE_STRING, file); EFL_DBG_INFO_APPEND(group, "Group", EINA_VALUE_TYPE_STRING, edje_group); @@ -403,54 +402,59 @@ _efl_canvas_layout_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Edje *e _edje_recalc_do(ed); } -EOLIAN static Eina_Bool -_efl_canvas_layout_efl_file_mmap_set(Eo *obj, Edje *pd EINA_UNUSED, - const Eina_File *f, const char *key) +EOLIAN static Eina_Error +_efl_canvas_layout_efl_file_load(Eo *obj, Edje *ed) { - Eina_Bool ret; + Eina_Error err; Eina_Array *nested; - ret = EINA_FALSE; + if (efl_file_loaded_get(obj)) return 0; + + err = efl_file_load(efl_super(obj, MY_CLASS)); + if (err) + { + if (err == ENOENT) + ed->load_error = EDJE_LOAD_ERROR_DOES_NOT_EXIST; + else if (err == ENOMEM) + ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; + else if ((err == EPERM) || (err == EACCES)) + ed->load_error = EDJE_LOAD_ERROR_PERMISSION_DENIED; + else + ed->load_error = EDJE_LOAD_ERROR_GENERIC; + return err; + } nested = eina_array_new(8); - if (_edje_object_file_set_internal(obj, f, key, NULL, NULL, nested)) - ret = EINA_TRUE; + err = _edje_object_file_set_internal(obj, efl_file_mmap_get(obj), efl_file_key_get(obj), NULL, NULL, nested); eina_array_free(nested); _edje_object_orientation_inform(obj); - return ret; -} - -EOLIAN static void -_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; - if (key) *key = pd->group; + return err; } EAPI Eina_Bool edje_object_mmap_set(Edje_Object *obj, const Eina_File *file, const char *group) { - return efl_file_mmap_set(obj, file, group); + return efl_file_simple_mmap_load(obj, file, group); } EAPI Eina_Bool edje_object_file_set(Edje_Object *obj, const char *file, const char *group) { - return efl_file_set(obj, file, group); + return efl_file_simple_load(obj, file, group); } EAPI void edje_object_file_get(const Edje_Object *obj, const char **file, const char **group) { - efl_file_get((Edje_Object *)obj, file, group); + if (file) *file = efl_file_get(obj); + if (group) *group = efl_file_key_get(obj); } EOLIAN static void -_efl_canvas_layout_efl_canvas_object_paragraph_direction_set(Eo *obj, Edje *ed, Evas_BiDi_Direction dir) +_efl_canvas_layout_efl_canvas_object_paragraph_direction_set(Eo *obj, Edje *ed, Efl_Text_Bidirectional_Type dir) { efl_canvas_object_paragraph_direction_set(efl_super(obj, MY_CLASS), dir); @@ -583,7 +587,9 @@ _efl_canvas_layout_efl_player_play_speed_get(const Eo *obj EINA_UNUSED, Edje *pd EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_canvas_layout_efl_object_dbg_info_get) #include "efl_canvas_layout.eo.c" +#include "efl_canvas_layout_eo.legacy.c" #include "edje_global.eo.c" #include "efl_layout_calc.eo.c" #include "efl_layout_signal.eo.c" #include "efl_layout_group.eo.c" +#include "efl_layout_group_eo.legacy.c" diff --git a/src/lib/edje/edje_text.c b/src/lib/edje/edje_text.c index 40e783a235..95d7676989 100644 --- a/src/lib/edje/edje_text.c +++ b/src/lib/edje/edje_text.c @@ -1,7 +1,7 @@ #include "edje_private.h" #define _ELLIP_STR "\xE2\x80\xA6" -#include "../evas/canvas/evas_text.eo.h" +#include "../evas/canvas/evas_text_eo.h" /* returns with and height for this part. * @@ -499,7 +499,7 @@ arrange_text: FLOAT_T align_x; if (params->type.text->align.x < FROM_INT(0)) { - if (evas_object_text_direction_get(ep->object) == + if ((Evas_BiDi_Direction)evas_object_text_direction_get(ep->object) == EVAS_BIDI_DIRECTION_RTL) { align_x = FROM_INT(1); diff --git a/src/lib/edje/edje_types.eot b/src/lib/edje/edje_types.eot index bd58febd61..87a5cc3b1d 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 @beta 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 f9fac775ee..29ebf04482 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -1,8 +1,8 @@ #include "edje_private.h" -#include "../evas/canvas/evas_box.eo.h" -#include "../evas/canvas/evas_line.eo.h" -#include "../evas/canvas/evas_text.eo.h" +#include "../evas/canvas/evas_box_eo.h" +#include "../evas/canvas/evas_line_eo.h" +#include "../evas/canvas/evas_text_eo.h" typedef struct _Edje_Box_Layout Edje_Box_Layout; struct _Edje_Box_Layout @@ -1979,7 +1979,6 @@ _edje_object_part_text_raw_generic_set(Edje *ed, Evas_Object *obj, Edje_Real_Par { char *mkup; mkup = efl_text_markup_util_text_to_markup( - EFL_TEXT_MARKUP_UTIL_CLASS, text); rp->typedata.text->text = eina_stringshare_add(mkup); free(mkup); @@ -2039,6 +2038,7 @@ _edje_user_text_style_definition_fetch(Edje *ed, const char *part) if (!eud) { eud = _edje_user_definition_new(EDJE_USER_TEXT_STYLE, part, ed); + if (!eud) return NULL; eud->u.text_style.types = EDJE_PART_TEXT_PROP_NONE; eud->u.text_style.props = NULL; } @@ -2063,6 +2063,7 @@ _edje_user_text_expand_definition_fetch(Edje *ed, const char *part) if (!eud) { eud = _edje_user_definition_new(EDJE_USER_TEXT_EXPAND, part, ed); + if (!eud) return NULL; eud->u.text_expand.expand = EFL_CANVAS_LAYOUT_PART_TEXT_EXPAND_NONE; } @@ -3059,7 +3060,7 @@ _edje_efl_content_content_set(Edje *ed, const char *part, Efl_Gfx_Entity *obj_sw eud->u.swallow.child = obj_swallow; } } - + efl_event_callback_call(ed->obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, obj_swallow); return EINA_TRUE; } @@ -3362,7 +3363,7 @@ _swallow_real_part_get(Evas_Object *obj_swallow) } EOLIAN Eina_Bool -_efl_canvas_layout_efl_container_content_remove(Eo *obj EINA_UNUSED, Edje *ed, Evas_Object *obj_swallow) +_efl_canvas_layout_content_remove(Eo *obj EINA_UNUSED, Edje *ed, Evas_Object *obj_swallow) { Edje_Real_Part *rp; Edje_User_Defined *eud; @@ -3397,6 +3398,82 @@ _efl_canvas_layout_efl_container_content_remove(Eo *obj EINA_UNUSED, Edje *ed, E return EINA_TRUE; } +typedef struct _Content_Part_Iterator Content_Part_Iterator; +struct _Content_Part_Iterator +{ + Eina_Iterator iterator; + Eo *object; + Edje *ed; + unsigned index; +}; + +static Eina_Bool +_content_part_iterator_next(Content_Part_Iterator *it, void **data) +{ + for (; it->index < it->ed->table_parts_size; it->index++) + { + Edje_Real_Part *rp = it->ed->table_parts[it->index]; + if (rp->part && rp->part->type == EDJE_PART_TYPE_SWALLOW) + { + if (data) *data = (void*) rp->typedata.swallow->swallowed_object; + it->index++; + return EINA_TRUE; + } + } + + return EINA_FALSE; +} + +static Eo * +_content_part_iterator_get_container(Content_Part_Iterator *it) +{ + return it->object; +} + +static void +_content_part_iterator_free(Content_Part_Iterator *it) +{ + free(it); +} + +EOLIAN Eina_Iterator* +_efl_canvas_layout_efl_container_content_iterate(Eo *obj, Edje *ed) +{ + Content_Part_Iterator *it; + + it = calloc(1, sizeof(*it)); + if (!it) return NULL; + + EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); + + it->iterator.version = EINA_ITERATOR_VERSION; + it->iterator.next = FUNC_ITERATOR_NEXT(_content_part_iterator_next); + it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_content_part_iterator_get_container); + it->iterator.free = FUNC_ITERATOR_FREE(_content_part_iterator_free); + it->object = obj; + it->ed = ed; + it->index = 0; + + return &it->iterator; +} + +EOLIAN int +_efl_canvas_layout_efl_container_content_count(Eo *obj EINA_UNUSED, Edje *pd) +{ + Edje_Real_Part *rp; + int result = 0; + + for (int i = 0; i < pd->table_parts_size; ++i) + { + rp = pd->table_parts[i]; + if (rp->part && rp->part->type == EDJE_PART_TYPE_SWALLOW) + result ++; + } + + return result; +} + + Efl_Gfx_Entity * _edje_efl_content_content_get(Edje *ed, const char *part) { @@ -6384,7 +6461,7 @@ edje_object_part_swallow(Edje_Object *obj, const char *part, Evas_Object *obj_sw EAPI void edje_object_part_unswallow(Edje_Object *obj, Evas_Object *obj_swallow) { - efl_content_remove(obj, obj_swallow); + efl_canvas_layout_content_remove(obj, obj_swallow); } EAPI Evas_Object * diff --git a/src/lib/edje/edje_var.c b/src/lib/edje/edje_var.c index 3bc3ebf0b2..40f32ff363 100644 --- a/src/lib/edje/edje_var.c +++ b/src/lib/edje/edje_var.c @@ -20,7 +20,8 @@ _edje_var_timer_cb(void *data) embryo_program_vm_push(ed->collection->script); _edje_embryo_globals_init(ed); embryo_parameter_cell_push(ed->collection->script, (Embryo_Cell)et->val); - ed->var_pool->timers = eina_list_remove(ed->var_pool->timers, et); + ed->var_pool->timers = eina_inlist_remove(ed->var_pool->timers, + EINA_INLIST_GET(et)); fn = et->func; free(et); { @@ -211,6 +212,8 @@ _edje_var_init(Edje *ed) void _edje_var_shutdown(Edje *ed) { + Edje_Var_Timer *et; + if (!ed->var_pool) return; if (ed->var_pool->vars) { @@ -237,12 +240,10 @@ _edje_var_shutdown(Edje *ed) } free(ed->var_pool->vars); } - while (ed->var_pool->timers) + EINA_INLIST_FREE(ed->var_pool->timers, et) { - Edje_Var_Timer *et; - - et = eina_list_data_get(ed->var_pool->timers); - ed->var_pool->timers = eina_list_remove(ed->var_pool->timers, et); + ed->var_pool->timers = eina_inlist_remove(ed->var_pool->timers, + EINA_INLIST_GET(et)); ecore_timer_del(et->timer); free(et); } @@ -1008,19 +1009,19 @@ _edje_var_timer_add(Edje *ed, double in, const char *fname, int val) free(et); return 0; } - ed->var_pool->timers = eina_list_prepend(ed->var_pool->timers, et); + ed->var_pool->timers = eina_inlist_prepend(ed->var_pool->timers, + EINA_INLIST_GET(et)); return et->id; } static Edje_Var_Timer * _edje_var_timer_find(Edje *ed, int id) { - Eina_List *l; Edje_Var_Timer *et; if (!ed->var_pool) return NULL; - EINA_LIST_FOREACH(ed->var_pool->timers, l, et) + EINA_INLIST_FOREACH(ed->var_pool->timers, et) if (et->id == id) return et; return NULL; @@ -1034,7 +1035,8 @@ _edje_var_timer_del(Edje *ed, int id) et = _edje_var_timer_find(ed, id); if (!et) return; - ed->var_pool->timers = eina_list_remove(ed->var_pool->timers, et); + ed->var_pool->timers = eina_inlist_remove(ed->var_pool->timers, + EINA_INLIST_GET(et)); ecore_timer_del(et->timer); free(et); } diff --git a/src/lib/edje/efl_canvas_layout.eo b/src/lib/edje/efl_canvas_layout.eo index f607e81408..0653bb41ac 100644 --- a/src/lib/edje/efl_canvas_layout.eo +++ b/src/lib/edje/efl_canvas_layout.eo @@ -1,13 +1,12 @@ // FIXME: This EO doc needs a direct link to the "edcref" doc -class Efl.Canvas.Layout extends Efl.Canvas.Group implements Efl.File, Efl.Container, Efl.Part, +class @beta Efl.Canvas.Layout extends Efl.Canvas.Group implements Efl.File, Efl.Container, Efl.Part, Efl.Observer, Efl.Layout.Calc, Efl.Layout.Signal, Efl.Layout.Group, Efl.Player, Efl.Gfx.Color_Class, Efl.Gfx.Text_Class, Efl.Gfx.Size_Class { [[Edje object class]] - legacy_prefix: edje_object; event_prefix: efl_layout; data: Edje; methods { @@ -35,7 +34,6 @@ class Efl.Canvas.Layout extends Efl.Canvas.Group implements Efl.File, Efl.Contai access_part_iterate @beta { [[Iterates over all accessibility-enabled part names.]] - legacy: null; return: iterator @owned; [[Part name iterator]] } @property seat { @@ -46,8 +44,7 @@ class Efl.Canvas.Layout extends Efl.Canvas.Group implements Efl.File, Efl.Contai Edje naming follows a incrementional convention: first registered name is "seat1", second is "seat2", differently from Evas. - - @since 1.19]] + ]] return: Efl.Input.Device; [[The seat device or $null if not found.]] } @@ -63,15 +60,28 @@ class Efl.Canvas.Layout extends Efl.Canvas.Group implements Efl.File, Efl.Contai Edje naming follows a incrementional convention: first registered name is "seat1", second is "seat2", differently from Evas. - - @since 1.19]] - + ]] return: stringshare; [[The name's character string or $null if not found.]] } keys { device: Efl.Input.Device; [[The seat device]] } } + @property layout_load_error { + get { + [[Gets the (last) file loading error for a given object.]] + } + values { + error: Eina.Error; [[The load error code.]] + } + } + content_remove { + [[Unswallow an object from this Edje.]] + params { + @in content: Efl.Gfx.Entity; [[To be removed content.]] + } + return: bool; [[$false if $content was not a child or can not be removed.]] + } } events { part,invalid @beta: string; [[Emitted when trying to use an invalid part. @@ -113,9 +123,9 @@ class Efl.Canvas.Layout extends Efl.Canvas.Group implements Efl.File, Efl.Contai Efl.Ui.I18n.mirrored { set; get; } Efl.Ui.I18n.language { set; get; } Efl.Gfx.Entity.scale { set; get; } - Efl.File.load_error { get; } - Efl.File.mmap { get; set; } - Efl.Container.content_remove; + Efl.File.load; + Efl.Container.content_iterate; + Efl.Container.content_count; Efl.Part.part_get; [[Returns @Efl.Canvas.Layout_Part]] Efl.Observer.update; Efl.Player.playable { get; } diff --git a/src/lib/edje/efl_canvas_layout_eo.legacy.c b/src/lib/edje/efl_canvas_layout_eo.legacy.c new file mode 100644 index 0000000000..f55e5d5f4b --- /dev/null +++ b/src/lib/edje/efl_canvas_layout_eo.legacy.c @@ -0,0 +1,36 @@ + +EAPI void +edje_object_animation_set(Efl_Canvas_Layout *obj, Eina_Bool on) +{ + efl_canvas_layout_animation_set(obj, on); +} + +EAPI Eina_Bool +edje_object_animation_get(const Efl_Canvas_Layout *obj) +{ + return efl_canvas_layout_animation_get(obj); +} + +EAPI Efl_Input_Device * +edje_object_seat_get(const Efl_Canvas_Layout *obj, Eina_Stringshare *name) +{ + return efl_canvas_layout_seat_get(obj, name); +} + +EAPI Eina_Stringshare * +edje_object_seat_name_get(const Efl_Canvas_Layout *obj, Efl_Input_Device *device) +{ + return efl_canvas_layout_seat_name_get(obj, device); +} + +EAPI Eina_Error +edje_object_layout_load_error_get(const Efl_Canvas_Layout *obj) +{ + return efl_canvas_layout_load_error_get(obj); +} + +EAPI Eina_Bool +edje_object_content_remove(Efl_Canvas_Layout *obj, Efl_Gfx_Entity *content) +{ + return efl_canvas_layout_content_remove(obj, content); +} diff --git a/src/lib/edje/efl_canvas_layout_eo.legacy.h b/src/lib/edje/efl_canvas_layout_eo.legacy.h new file mode 100644 index 0000000000..0155eb96b2 --- /dev/null +++ b/src/lib/edje/efl_canvas_layout_eo.legacy.h @@ -0,0 +1,115 @@ +#ifndef _EFL_CANVAS_LAYOUT_EO_LEGACY_H_ +#define _EFL_CANVAS_LAYOUT_EO_LEGACY_H_ + +#ifndef _EFL_CANVAS_LAYOUT_EO_CLASS_TYPE +#define _EFL_CANVAS_LAYOUT_EO_CLASS_TYPE + +typedef Eo Efl_Canvas_Layout; + +#endif + +#ifndef _EFL_CANVAS_LAYOUT_EO_TYPES +#define _EFL_CANVAS_LAYOUT_EO_TYPES + + +#endif + +/** + * @brief Whether this object is animating or not. + * + * This property indicates whether animations are stopped or not. Animations + * here refer to transitions between states. + * + * If animations are disabled, transitions between states (as defined in EDC) + * are then instantaneous. This is conceptually similar to setting the + * @ref Efl.Player.play_speed to an infinitely high value. + * + * Start or stop animating this object. + * + * @param[in] obj The object. + * @param[in] on The animation state, @c true by default. + * + * @ingroup Edje_Object_Group + */ +EAPI void edje_object_animation_set(Efl_Canvas_Layout *obj, Eina_Bool on); + +/** + * @brief Whether this object is animating or not. + * + * This property indicates whether animations are stopped or not. Animations + * here refer to transitions between states. + * + * If animations are disabled, transitions between states (as defined in EDC) + * are then instantaneous. This is conceptually similar to setting the + * @ref Efl.Player.play_speed to an infinitely high value. + * + * Get the current state of animation, @c true by default. + * + * @param[in] obj The object. + * + * @return The animation state, @c true by default. + * + * @ingroup Edje_Object_Group + */ +EAPI Eina_Bool edje_object_animation_get(const Efl_Canvas_Layout *obj); + +/** + * @brief Returns the seat device given its Edje's name. + * + * Edje references seats by a name that differs from Evas. Edje naming follows + * a incrementional convention: first registered name is "seat1", second is + * "seat2", differently from Evas. + * + * @param[in] obj The object. + * @param[in] name The name's character string. + * + * @return The seat device or @c null if not found. + * + * @since 1.19 + * + * @ingroup Edje_Object_Group + */ +EAPI Efl_Input_Device *edje_object_seat_get(const Efl_Canvas_Layout *obj, Eina_Stringshare *name); + +/** + * @brief Gets the name given to a set by Edje. + * + * Edje references seats by a name that differs from Evas. Edje naming follows + * a incrementional convention: first registered name is "seat1", second is + * "seat2", differently from Evas. + * + * @param[in] obj The object. + * @param[in] device The seat device + * + * @return The name's character string or @c null if not found. + * + * @since 1.19 + * + * @ingroup Edje_Object_Group + */ +EAPI Eina_Stringshare *edje_object_seat_name_get(const Efl_Canvas_Layout *obj, Efl_Input_Device *device); + +/** + * @brief Gets the (last) file loading error for a given object. + * + * @param[in] obj The object. + * + * @return The load error code. + * + * @ingroup Edje_Object_Group + */ +EAPI Eina_Error edje_object_layout_load_error_get(const Efl_Canvas_Layout *obj); + +/** + * @brief Unswallow an object from this Edje. + * + * @param[in] obj The object. + * @param[in] content To be removed content. + * + * @return @c false if @c content was not a child or can not be removed. + * + * @ingroup Edje_Object_Group + */ +EAPI Eina_Bool edje_object_content_remove(Efl_Canvas_Layout *obj, Efl_Gfx_Entity *content); + +#endif diff --git a/src/lib/edje/efl_canvas_layout_part.eo b/src/lib/edje/efl_canvas_layout_part.eo index 927e70ac9a..72bee1c5d8 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 extends Efl.Object implements Efl.Gfx.Entity, Efl.Ui.Drag +class @beta Efl.Canvas.Layout_Part extends Efl.Object implements Efl.Gfx.Entity, Efl.Ui.Drag { [[Common class for part proxy objects for @Efl.Canvas.Layout. @@ -8,8 +8,6 @@ class Efl.Canvas.Layout_Part extends Efl.Object implements Efl.Gfx.Entity, Efl.U 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 ]] methods { @property state { diff --git a/src/lib/edje/efl_canvas_layout_part_box.eo b/src/lib/edje/efl_canvas_layout_part_box.eo index 0173bab7db..38c568c8db 100644 --- a/src/lib/edje/efl_canvas_layout_part_box.eo +++ b/src/lib/edje/efl_canvas_layout_part_box.eo @@ -1,5 +1,5 @@ -class Efl.Canvas.Layout_Part_Box extends Efl.Canvas.Layout_Part implements Efl.Pack_Linear, - Efl.Ui.Direction +class @beta Efl.Canvas.Layout_Part_Box extends Efl.Canvas.Layout_Part implements Efl.Pack_Linear, + Efl.Ui.Direction_Readonly { [[Represents a Box created as part of a layout. @@ -10,7 +10,6 @@ class Efl.Canvas.Layout_Part_Box extends Efl.Canvas.Layout_Part implements Efl.P implements { Efl.Container.content_iterate; Efl.Container.content_count; - Efl.Container.content_remove; Efl.Pack.pack_clear; Efl.Pack.unpack_all; Efl.Pack.unpack; diff --git a/src/lib/edje/efl_canvas_layout_part_external.eo b/src/lib/edje/efl_canvas_layout_part_external.eo index 25e694c589..ea8b00cfa0 100644 --- a/src/lib/edje/efl_canvas_layout_part_external.eo +++ b/src/lib/edje/efl_canvas_layout_part_external.eo @@ -1,4 +1,4 @@ -class Efl.Canvas.Layout_Part_External extends Efl.Canvas.Layout_Part implements Efl.Content +class @beta Efl.Canvas.Layout_Part_External extends Efl.Canvas.Layout_Part implements Efl.Content { [[Class representing an external part in Edje layouts. @@ -20,11 +20,10 @@ class Efl.Canvas.Layout_Part_External extends Efl.Canvas.Layout_Part implements efl_text_set(efl_part(layout, "title"), "hello"); Or in pseudo-script: layout["title"].text = "hello"; - - @since 1.20 ]] data: null; implements { - Efl.Content.content { get; } + Efl.Content.content { get; set; } + Efl.Content.content_unset; } } diff --git a/src/lib/edje/efl_canvas_layout_part_invalid.eo b/src/lib/edje/efl_canvas_layout_part_invalid.eo index ceb3177031..54720569d2 100644 --- a/src/lib/edje/efl_canvas_layout_part_invalid.eo +++ b/src/lib/edje/efl_canvas_layout_part_invalid.eo @@ -1,7 +1,7 @@ -class Efl.Canvas.Layout_Part_Invalid extends Efl.Canvas.Layout_Part implements Efl.Content, - Efl.Pack_Linear, Efl.Ui.Direction, +class @beta Efl.Canvas.Layout_Part_Invalid extends Efl.Canvas.Layout_Part implements Efl.Content, + Efl.Pack_Linear, Efl.Ui.Direction_Readonly, Efl.Pack_Table, Efl.Text, - Efl.Text_Markup + Efl.Text_Markup, Efl.Text_Markup_Interactive { [[Common class for part proxy objects for @Efl.Canvas.Layout. @@ -9,8 +9,6 @@ class Efl.Canvas.Layout_Part_Invalid extends Efl.Canvas.Layout_Part implements E 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 { @@ -31,6 +29,7 @@ class Efl.Canvas.Layout_Part_Invalid extends Efl.Canvas.Layout_Part implements E // Efl.Canvas.Layout_Part_Text Efl.Text.text { set; get; } Efl.Text_Markup.markup { get; set; } + Efl.Text_Markup_Interactive.cursor_markup_insert; Efl.Text_Cursor.text_cursor { get; } Efl.Text_Cursor.cursor_paragraph_first; Efl.Text_Cursor.cursor_paragraph_last; @@ -44,11 +43,9 @@ class Efl.Canvas.Layout_Part_Invalid extends Efl.Canvas.Layout_Part implements E 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; diff --git a/src/lib/edje/efl_canvas_layout_part_swallow.eo b/src/lib/edje/efl_canvas_layout_part_swallow.eo index 6b1c4723ed..96088da982 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 extends Efl.Canvas.Layout_Part implements Efl.Content +class @beta Efl.Canvas.Layout_Part_Swallow extends Efl.Canvas.Layout_Part implements 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 e0184381c4..2b9854cc6c 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 extends Efl.Canvas.Layout_Part implements Efl.Pack_Table +class @beta Efl.Canvas.Layout_Part_Table extends Efl.Canvas.Layout_Part implements Efl.Pack_Table { [[Represents a Table created as part of a layout. @@ -9,7 +9,6 @@ class Efl.Canvas.Layout_Part_Table extends Efl.Canvas.Layout_Part implements Efl implements { Efl.Container.content_iterate; Efl.Container.content_count; - Efl.Container.content_remove; Efl.Pack.pack_clear; Efl.Pack.unpack_all; Efl.Pack.unpack; diff --git a/src/lib/edje/efl_canvas_layout_part_text.eo b/src/lib/edje/efl_canvas_layout_part_text.eo index 0546118c73..a46326391c 100644 --- a/src/lib/edje/efl_canvas_layout_part_text.eo +++ b/src/lib/edje/efl_canvas_layout_part_text.eo @@ -1,4 +1,4 @@ -enum Efl.Canvas.Layout_Part_Text_Expand +enum @beta Efl.Canvas.Layout_Part_Text_Expand { [[Text layout policy to enforce. If none is set, min/max descriptions are taken in considerations solely. @@ -10,8 +10,8 @@ enum Efl.Canvas.Layout_Part_Text_Expand max_y = 1 << 3, } -class Efl.Canvas.Layout_Part_Text extends Efl.Canvas.Layout_Part implements Efl.Text, -Efl.Text_Markup, Efl.Text_Format, Efl.Text_Font, Efl.Text_Style +class @beta Efl.Canvas.Layout_Part_Text extends Efl.Canvas.Layout_Part implements Efl.Text, +Efl.Text_Markup, Efl.Text_Markup_Interactive, Efl.Text_Format, Efl.Text_Font, Efl.Text_Style { [[Represents a TEXT part of a layout @@ -36,6 +36,7 @@ Efl.Text_Markup, Efl.Text_Format, Efl.Text_Font, Efl.Text_Style implements { Efl.Text.text { set; get; } Efl.Text_Markup.markup { get; set; } + Efl.Text_Markup_Interactive.cursor_markup_insert; Efl.Text_Cursor.text_cursor { get; } Efl.Text_Cursor.cursor_paragraph_first; Efl.Text_Cursor.cursor_paragraph_last; @@ -49,7 +50,6 @@ Efl.Text_Markup, Efl.Text_Format, Efl.Text_Font, Efl.Text_Style 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_Format.ellipsis { set; get; } Efl.Text_Format.wrap { set; get; } Efl.Text_Font.font { set; get; } diff --git a/src/lib/edje/efl_layout_calc.eo b/src/lib/edje/efl_layout_calc.eo index 018cd7e197..c022dca900 100644 --- a/src/lib/edje/efl_layout_calc.eo +++ b/src/lib/edje/efl_layout_calc.eo @@ -8,7 +8,7 @@ interface Efl.Layout.Calc This defines all the APIs supported by legacy "Edje" object, known in EO API as Efl.Canvas.Layout. - @since 1.21 + @since 1.22 ]] event_prefix: efl_layout; methods { @@ -90,7 +90,7 @@ interface Efl.Layout.Calc This function thaws (in other words "unfreezes") the given layout object. - Note: If sucessive freezes were done, an equal number of thaws will + Note: If successive freezes were done, an equal number of thaws will be required. See also @.calc_freeze. @@ -109,8 +109,7 @@ interface Efl.Layout.Calc } events { recalc: void; [[The layout was recalculated.]] - /* FIXME: The actual type is list but the C# bindings do not support that yet */ - circular,dependency: void; [[A circular dependency between parts of the + circular,dependency: const(array); [[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 864a3a86c9..78592ab988 100644 --- a/src/lib/edje/efl_layout_group.eo +++ b/src/lib/edje/efl_layout_group.eo @@ -4,7 +4,7 @@ interface Efl.Layout.Group { [[APIs representing static data from a group in an edje file. - @since 1.21 + @since 1.22 ]] methods { @property group_size_min { @@ -89,7 +89,6 @@ interface Efl.Layout.Group Warning: Do not confuse this call with edje_file_data_get(), which queries for a global EDC data field on an EDC declaration file. ]] - legacy: edje_object_data_get; } keys { key: string; [[The data field's key string]] diff --git a/src/lib/edje/efl_layout_group_eo.legacy.c b/src/lib/edje/efl_layout_group_eo.legacy.c new file mode 100644 index 0000000000..c68fa2f540 --- /dev/null +++ b/src/lib/edje/efl_layout_group_eo.legacy.c @@ -0,0 +1,6 @@ + +EAPI const char * +edje_object_data_get(const Efl_Layout_Group *obj, const char *key) +{ + return efl_layout_group_data_get(obj, key); +} diff --git a/src/lib/edje/efl_layout_group_eo.legacy.h b/src/lib/edje/efl_layout_group_eo.legacy.h new file mode 100644 index 0000000000..2dc80c5af8 --- /dev/null +++ b/src/lib/edje/efl_layout_group_eo.legacy.h @@ -0,0 +1,48 @@ +#ifndef _EFL_LAYOUT_GROUP_EO_LEGACY_H_ +#define _EFL_LAYOUT_GROUP_EO_LEGACY_H_ + +#ifndef _EFL_LAYOUT_GROUP_EO_CLASS_TYPE +#define _EFL_LAYOUT_GROUP_EO_CLASS_TYPE + +typedef Eo Efl_Layout_Group; + +#endif + +#ifndef _EFL_LAYOUT_GROUP_EO_TYPES +#define _EFL_LAYOUT_GROUP_EO_TYPES + + +#endif + + + +/** + * @brief Retrives an EDC data field's value from a given Edje object's group. + * + * This function fetches an EDC data field's value, which is declared on the + * objects building EDC file, under its group. EDC data blocks are most + * commonly used to pass arbitrary parameters from an application's theme to + * its code. + * + * EDC data fields always hold strings as values, hence the return type of + * this function. Check the complete "syntax reference" for EDC files. + * + * This is how a data item is defined in EDC: collections { group { name: + * "a_group"; data { item: "key1" "value1"; item: "key2" "value2"; } } } + * + * @warning Do not confuse this call with edje_file_data_get(), which queries + * for a global EDC data field on an EDC declaration file. + * + * @param[in] obj The object. + * @param[in] key The data field's key string + * + * @return The data's value string. + * + * @since 1.21 + * + * @ingroup (null)_Group + */ +EAPI const char *edje_object_data_get(const Efl_Layout_Group *obj, const char *key); + + +#endif diff --git a/src/lib/edje/efl_layout_signal.eo b/src/lib/edje/efl_layout_signal.eo index 708dc3279a..1b49fd1fd0 100644 --- a/src/lib/edje/efl_layout_signal.eo +++ b/src/lib/edje/efl_layout_signal.eo @@ -2,19 +2,29 @@ Edje signaling interface. Note: This API must be manually bound in other languages as this uses function - pointers! This is by design, to keep the API simplhe API simple. + pointers! This is by design, to keep the API simple. If function pointers really become allowed in EO this needs to be altered to match that. */ -type Efl.Signal_Cb: __undefined_type; [[Signal callback.]] +function EflLayoutSignalCb { + [[EflLayoutSignalCb function that is called when a specifc pair of signal/emission is triggered + + @since 1.22 + ]] + params { + @in object: Efl.Layout.Signal; [[The object the callback is being triggered from.]] + @in emission: string; [[The name component of the signal.]] + @in source: string; [[The source of a signal used as context.]] + } +}; interface Efl.Layout.Signal { [[Layouts asynchronous messaging and signaling interface. - @since 1.21 + @since 1.22 ]] methods { // FIXME: There is no message_handler in EO! @@ -83,9 +93,8 @@ interface Efl.Layout.Signal params { @in emission: string; [[The signal's "emission" string]] @in source: string; [[The signal's "source" string]] - @in func: Efl.Signal_Cb; + @in func: EflLayoutSignalCb; [[The callback function to be executed when the signal is emitted.]] - @in data: void_ptr; [[A pointer to data to pass to $func.]] } return: bool; [[$true in case of success, $false in case of error.]] } @@ -102,9 +111,8 @@ interface Efl.Layout.Signal params { @in emission: string; [[The signal's "emission" string]] @in source: string; [[The signal's "source" string]] - @in func: Efl.Signal_Cb; + @in func: EflLayoutSignalCb; [[The callback function to be executed when the signal is emitted.]] - @in data: void_ptr; [[A pointer to data to pass to $func.]] } return: bool; [[$true in case of success, $false in case of error.]] } diff --git a/src/lib/edje/meson.build b/src/lib/edje/meson.build index 393383fbde..23d93ce27e 100644 --- a/src/lib/edje/meson.build +++ b/src/lib/edje/meson.build @@ -1,13 +1,12 @@ edje_deps = [ eina, eo, efl, m, - luajit, eet, evas, ecore_evas, + eet, evas, ecore_evas, ecore_file, ecore_input, ecore_imf, ecore_imf_evas, embryo, efreet, eio, intl ] - -edje_pub_deps = [m, evas, eo, efl, luajit] +edje_pub_deps = [m, evas, eo, efl, lua] if (get_option('physics')) edje_deps += ephysics @@ -22,7 +21,6 @@ if get_option('edje-sound-and-video') endif pub_legacy_eo_files = [ - 'edje_edit.eo', 'efl_layout_calc.eo', 'efl_layout_signal.eo', 'efl_layout_group.eo', @@ -51,16 +49,6 @@ foreach eo_file : pub_legacy_eo_files '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'), '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'), '-gchd', '@INPUT@']) - pub_eo_file_target += custom_target('eolian_gen_legacy_' + eo_file, - input : eo_file, - output : [eo_file + '.legacy.h'], - depfile : eo_file + '.legacy.d', - install : true, - install_dir : dir_package_include, - command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories, - '-o', 'l:' + join_paths(meson.current_build_dir(), eo_file + '.legacy.h'), - '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.legacy.d'), - '-gld', '@INPUT@']) endforeach pub_eo_types_files = [ @@ -92,6 +80,7 @@ foreach eo_file : priv_eo_files depfile : eo_file + '.d', command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories, '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'), + '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'), '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'), '-gchd', '@INPUT@']) endforeach @@ -104,7 +93,11 @@ edje_header_src = [ 'Edje_Common.h', 'Edje_Eo.h', 'Edje_Legacy.h', - 'Edje_Edit.h' + 'Edje_Edit.h', + 'edje_edit_eo.h', + 'edje_edit_eo.legacy.h', + 'efl_layout_group_eo.legacy.h', + 'efl_canvas_layout_eo.legacy.h', ] edje_src = [ @@ -151,7 +144,7 @@ edje_src = [ edje_lib = library('edje', edje_src, pub_eo_file_target, priv_eo_file_target, - dependencies: [edje_deps], + dependencies: edje_pub_deps + edje_deps, include_directories : config_dir + [include_directories('.')], install: true, c_args : [package_c_args], @@ -165,9 +158,12 @@ edje = declare_dependency( dependencies: edje_pub_deps, ) -install_data(pub_eo_files + pub_eo_types_files, - install_dir: join_paths(eolian_include_dir, package_version_name) -) + +if get_option('install-eo-files') + install_data(pub_eo_files + pub_eo_types_files, + install_dir: join_paths(eolian_include_dir, package_version_name) + ) +endif install_headers(edje_header_src, install_dir : dir_package_include, diff --git a/src/lib/eet/Eet.h b/src/lib/eet/Eet.h index 64fcd7c7a3..25babe1578 100644 --- a/src/lib/eet/Eet.h +++ b/src/lib/eet/Eet.h @@ -430,7 +430,7 @@ eet_clearcache(void); * @until printf * * More cheating follows. Just like we knew this was an Eet file, we also know - * what key to read from, and ontop of that we know that the data in it is not + * what key to read from, and on top of that we know that the data in it is not * compressed. * Knowing all this allows us to take some shortcuts. * @until read_direct @@ -1467,7 +1467,7 @@ eet_data_image_header_read_cipher(Eet_File *ef, /** * @ingroup Eet_File_Image_Group - * @brief Gets the colorspace Eet can decode into of a given eet image ressource. + * @brief Gets the colorspace Eet can decode into of a given eet image resource. * * @param ef A valid eet file handle opened for reading. * @param name Name of the entry. eg: "/base/file_i_want". @@ -1604,7 +1604,7 @@ eet_data_image_read_to_surface_cipher(Eet_File *ef, * @param w The expected width in pixels of the pixel surface to decode. * @param h The expected height in pixels of the pixel surface to decode. * @param row_stride The length of a pixels line in the destination surface. - * @param cspace The color space of the pixels bsurface. + * @param cspace The color space of the pixels surface. * @param alpha A pointer to the int to hold the alpha flag. * @param comp A pointer to the int to hold the compression amount. * @param quality A pointer to the int to hold the quality amount. @@ -2080,7 +2080,7 @@ eet_identity_print(Eet_Key *key, * file path to a 'pem' format file (the same used for siging with * eet_identity_open() as a certificate file). * - * @note This function can not be used to provide any security mecanism. You + * @note This function can not be used to provide any security mechanism. You * need to check your x509 certificate against a chain of trust to have a proper * security. This is just a convenience test function. * @warning You need to compile signature support in EET. @@ -3350,7 +3350,7 @@ eet_data_undump(Eet_File *ef, * * The data to be decoded is stored at the memory pointed to by @p data_in, * and is described by the descriptor pointed to by @p edd. The data size is - * passed in as the value to @p size_in, ande must be greater than 0 to + * passed in as the value to @p size_in, and must be greater than 0 to * succeed. * * This function is useful for decoding data structures delivered to the @@ -4193,7 +4193,7 @@ eet_data_undump_cipher(Eet_File *ef, * * The data to be decoded is stored at the memory pointed to by @p data_in, * and is described by the descriptor pointed to by @p edd. The data size is - * passed in as the value to @p size_in, ande must be greater than 0 to + * passed in as the value to @p size_in, and must be greater than 0 to * succeed. * * This function is useful for decoding data structures delivered to the diff --git a/src/lib/eet/Eet_private.h b/src/lib/eet/Eet_private.h index 43b4c141a4..becfabb638 100644 --- a/src/lib/eet/Eet_private.h +++ b/src/lib/eet/Eet_private.h @@ -306,7 +306,7 @@ eet_2_emile_compressor(int comp) switch (comp) { case EET_COMPRESSION_VERYFAST: return EMILE_LZ4HC; - case EET_COMPRESSION_SUPERFAST: return EMILE_LZ4HC; + case EET_COMPRESSION_SUPERFAST: return EMILE_LZ4; default: return EMILE_ZLIB; } } diff --git a/src/lib/eet/eet_cipher.c b/src/lib/eet/eet_cipher.c index ea4880edcb..3bdab4c2f1 100644 --- a/src/lib/eet/eet_cipher.c +++ b/src/lib/eet/eet_cipher.c @@ -8,10 +8,6 @@ #include #include -#ifdef HAVE_NETINET_IN_H -# include -#endif - #ifdef HAVE_SIGNATURE # include # ifdef HAVE_GNUTLS @@ -601,9 +597,9 @@ eet_identity_sign(FILE *fp, # endif /* ifdef HAVE_GNUTLS */ /* Append the signature at the end of the file. */ - head[0] = (int)htonl ((unsigned int)EET_MAGIC_SIGN); - head[1] = (int)htonl ((unsigned int)sign_len); - head[2] = (int)htonl ((unsigned int)cert_len); + head[0] = (int)eina_htonl ((unsigned int)EET_MAGIC_SIGN); + head[1] = (int)eina_htonl ((unsigned int)sign_len); + head[2] = (int)eina_htonl ((unsigned int)cert_len); if (fwrite(head, sizeof(head), 1, fp) != 1) { @@ -675,9 +671,9 @@ eet_identity_check(const void *data_base, memcpy(&sign_len, header+1, sizeof(int)); memcpy(&cert_len, header+2, sizeof(int)); - magic = ntohl(magic); - sign_len = ntohl(sign_len); - cert_len = ntohl(cert_len); + magic = eina_ntohl(magic); + sign_len = eina_ntohl(sign_len); + cert_len = eina_ntohl(cert_len); /* Verify the header */ if (magic != EET_MAGIC_SIGN) diff --git a/src/lib/eet/eet_connection.c b/src/lib/eet/eet_connection.c index 735e112271..c46f614960 100644 --- a/src/lib/eet/eet_connection.c +++ b/src/lib/eet/eet_connection.c @@ -5,14 +5,6 @@ #include #include -#ifdef HAVE_NETINET_IN_H -# include -#endif - -#ifdef _WIN32 -# include -#endif /* ifdef _WIN32 */ - #include #include "Eet.h" @@ -71,9 +63,9 @@ eet_connection_received(Eet_Connection *conn, msg = data; /* Check the magic */ - if (ntohl(msg[0]) != MAGIC_EET_DATA_PACKET) break; + if (eina_ntohl(msg[0]) != MAGIC_EET_DATA_PACKET) break; - packet_size = ntohl(msg[1]); + packet_size = eina_ntohl(msg[1]); /* Message should always be under MAX_MSG_SIZE */ if (packet_size > MAX_MSG_SIZE) break; @@ -143,8 +135,8 @@ _eet_connection_raw_send(Eet_Connection *conn, /* Message should always be under MAX_MSG_SIZE */ if (data_size > MAX_MSG_SIZE) return EINA_FALSE; message = malloc(data_size + (sizeof(int) * 2)); - message[0] = htonl(MAGIC_EET_DATA_PACKET); - message[1] = htonl(data_size); + message[0] = eina_htonl(MAGIC_EET_DATA_PACKET); + message[1] = eina_htonl(data_size); memcpy(message + 2, data, data_size); conn->eet_write_cb(message, data_size + (sizeof(int) * 2), diff --git a/src/lib/eet/eet_data.c b/src/lib/eet/eet_data.c index e00b8ac241..2cda26def6 100644 --- a/src/lib/eet/eet_data.c +++ b/src/lib/eet/eet_data.c @@ -8,14 +8,6 @@ #include #include -#ifdef HAVE_NETINET_IN_H -# include -#endif - -#ifdef _WIN32 -# include -#endif /* ifdef _WIN32 */ - #include #include "Eet.h" @@ -2877,7 +2869,7 @@ _eet_data_dump_encode(int parent_type, { unsigned long int v; - v = htonl(0x12345678); + v = eina_htonl(0x12345678); if (v == 0x12345678) _eet_data_words_bigendian = 1; else @@ -3483,7 +3475,7 @@ _eet_data_descriptor_decode(Eet_Free_Context *context, { unsigned long int v; - v = htonl(0x12345678); + v = eina_htonl(0x12345678); if (v == 0x12345678) _eet_data_words_bigendian = 1; else @@ -5088,7 +5080,7 @@ _eet_data_descriptor_encode(Eet_Dictionary *ed, { unsigned long int v; - v = htonl(0x12345678); + v = eina_htonl(0x12345678); if (v == 0x12345678) _eet_data_words_bigendian = 1; else diff --git a/src/lib/eet/eet_dictionary.c b/src/lib/eet/eet_dictionary.c index 46e8cbf723..7a80463bd6 100644 --- a/src/lib/eet/eet_dictionary.c +++ b/src/lib/eet/eet_dictionary.c @@ -130,17 +130,9 @@ eet_dictionary_string_add(Eet_Dictionary *ed, current->str = str; current->len = len; - if (idx == -1) - { - current->next = ed->hash[hash]; - ed->hash[hash] = ed->count; - } - else - { - current->next = idx; - if (pidx != -1) ed->all[pidx].next = ed->count; - else ed->hash[hash] = ed->count; - } + current->next = ed->hash[hash]; + ed->hash[hash] = ed->count; + cnt = ed->count++; eina_rwlock_release(&ed->rwlock); return cnt; diff --git a/src/lib/eet/eet_image.c b/src/lib/eet/eet_image.c index 33dbcf7af9..3cfb5fca19 100644 --- a/src/lib/eet/eet_image.c +++ b/src/lib/eet/eet_image.c @@ -6,16 +6,6 @@ # include #endif /* ifdef __OpenBSD__ */ -#ifdef HAVE_NETINET_IN_H -# include -#endif - -#ifdef _WIN32 -# include -# define HAVE_BOOLEAN -# define XMD_H /* This prevents libjpeg to redefine INT32 */ -#endif /* ifdef _WIN32 */ - #include #include #include @@ -254,7 +244,7 @@ _eet_image_endian_check(void) { unsigned long int v; - v = htonl(0x12345678); + v = eina_htonl(0x12345678); if (v == 0x12345678) _eet_image_words_bigendian = 1; else @@ -811,8 +801,8 @@ eet_data_image_etc1_compressed_convert(int *size, image_stride = w; image_height = h; - nl_width = htonl(image_stride); - nl_height = htonl(image_height); + nl_width = eina_htonl(image_stride); + nl_height = eina_htonl(image_height); compress = !!compress; // Disable dithering, as it will deteriorate the quality of flat surfaces @@ -1792,8 +1782,8 @@ eet_data_image_header_advance_decode_cipher(const void *data, const char *m = data; // We only use Emile for decoding the actual data, seems simpler this way. - if (w) *w = ntohl(*((unsigned int*) &(m[OFFSET_WIDTH]))); - if (h) *h = ntohl(*((unsigned int*) &(m[OFFSET_HEIGHT]))); + if (w) *w = eina_ntohl(*((unsigned int*) &(m[OFFSET_WIDTH]))); + if (h) *h = eina_ntohl(*((unsigned int*) &(m[OFFSET_HEIGHT]))); if (comp) *comp = m[OFFSET_OPTIONS] & 0x1; switch (m[OFFSET_ALGORITHM] & 0xFF) { diff --git a/src/lib/eet/eet_lib.c b/src/lib/eet/eet_lib.c index e53d1ed89a..0e05b2acaf 100644 --- a/src/lib/eet/eet_lib.c +++ b/src/lib/eet/eet_lib.c @@ -2,10 +2,6 @@ # include #endif /* ifdef HAVE_CONFIG_H */ -#ifdef _WIN32 -# include -#endif /* ifdef _WIN32 */ - #include #include #include @@ -16,14 +12,6 @@ #include #include -#ifdef HAVE_NETINET_IN_H -# include -#endif - -#ifdef _WIN32 -# include -#endif /* ifdef _WIN32 */ - #include #include @@ -384,9 +372,9 @@ eet_flush2(Eet_File *ef) num_dictionary_entries; /* go thru and write the header */ - head[0] = (int)htonl((unsigned int)EET_MAGIC_FILE2); - head[1] = (int)htonl((unsigned int)num_directory_entries); - head[2] = (int)htonl((unsigned int)num_dictionary_entries); + head[0] = (int)eina_htonl((unsigned int)EET_MAGIC_FILE2); + head[1] = (int)eina_htonl((unsigned int)num_directory_entries); + head[2] = (int)eina_htonl((unsigned int)num_dictionary_entries); fseek(fp, 0, SEEK_SET); if (fwrite(head, sizeof (head), 1, fp) != 1) @@ -414,12 +402,12 @@ eet_flush2(Eet_File *ef) efn->offset = data_offset; - ibuf[0] = (int)htonl((unsigned int)data_offset); - ibuf[1] = (int)htonl((unsigned int)efn->size); - ibuf[2] = (int)htonl((unsigned int)efn->data_size); - ibuf[3] = (int)htonl((unsigned int)strings_offset); - ibuf[4] = (int)htonl((unsigned int)efn->name_size); - ibuf[5] = (int)htonl((unsigned int)flag); + ibuf[0] = (int)eina_htonl((unsigned int)data_offset); + ibuf[1] = (int)eina_htonl((unsigned int)efn->size); + ibuf[2] = (int)eina_htonl((unsigned int)efn->data_size); + ibuf[3] = (int)eina_htonl((unsigned int)strings_offset); + ibuf[4] = (int)eina_htonl((unsigned int)efn->name_size); + ibuf[5] = (int)eina_htonl((unsigned int)flag); strings_offset += efn->name_size; data_offset += efn->size; @@ -449,11 +437,11 @@ eet_flush2(Eet_File *ef) if (ef->ed->hash[ef->ed->all_hash[j]] == j) prev = -1; - sbuf[0] = (int)htonl((unsigned int)ef->ed->all_hash[j]); - sbuf[1] = (int)htonl((unsigned int)offset); - sbuf[2] = (int)htonl((unsigned int)ef->ed->all[j].len); - sbuf[3] = (int)htonl((unsigned int)prev); - sbuf[4] = (int)htonl((unsigned int)ef->ed->all[j].next); + sbuf[0] = (int)eina_htonl((unsigned int)ef->ed->all_hash[j]); + sbuf[1] = (int)eina_htonl((unsigned int)offset); + sbuf[2] = (int)eina_htonl((unsigned int)ef->ed->all[j].len); + sbuf[3] = (int)eina_htonl((unsigned int)prev); + sbuf[4] = (int)eina_htonl((unsigned int)ef->ed->all[j].next); offset += ef->ed->all[j].len; @@ -755,14 +743,14 @@ eet_internal_read2(Eet_File *ef) unsigned int i; idx += sizeof(int); - if (eet_test_close((int)ntohl(*data) != EET_MAGIC_FILE2, ef)) + if (eet_test_close((int)eina_ntohl(*data) != EET_MAGIC_FILE2, ef)) return NULL; data++; #define GET_INT(Value, Pointer, Index) \ { \ - Value = ntohl(*Pointer); \ + Value = eina_ntohl(*Pointer); \ Pointer++; \ Index += sizeof(int); \ } @@ -1003,9 +991,9 @@ eet_internal_read2(Eet_File *ef) /* check the signature has the magic number and sig + cert len * + magic is sane */ memcpy(head, buffer, 3 * sizeof(int)); - head[0] = ntohl(head[0]); - head[1] = ntohl(head[1]); - head[2] = ntohl(head[2]); + head[0] = eina_ntohl(head[0]); + head[1] = eina_ntohl(head[1]); + head[2] = eina_ntohl(head[2]); if ((head[0] == EET_MAGIC_SIGN) && (head[1] > 0) && (head[2] > 0)) { /* there appears to be an actual valid identity at the end @@ -1061,14 +1049,14 @@ eet_internal_read1(Eet_File *ef) /* build header table if read mode */ /* geat header */ idx += sizeof(int); - if (eet_test_close((int)ntohl(*((int *)ef->data)) != EET_MAGIC_FILE, ef)) + if (eet_test_close((int)eina_ntohl(*((int *)ef->data)) != EET_MAGIC_FILE, ef)) return NULL; #define EXTRACT_INT(Value, Pointer, Index) \ { \ int tmp; \ memcpy(&tmp, Pointer + Index, sizeof(int)); \ - Value = ntohl(tmp); \ + Value = eina_ntohl(tmp); \ Index += sizeof(int); \ } @@ -1248,7 +1236,7 @@ eet_internal_read(Eet_File *ef) if (eet_test_close(ef->data_size < (int)sizeof(int) * 3, ef)) return NULL; - switch (ntohl(*data)) + switch (eina_ntohl(*data)) { #if EET_OLD_EET_FILE_FORMAT case EET_MAGIC_FILE: diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index af6154b766..da582a4421 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -50,11 +50,13 @@ extern "C" { #define EFL_VERSION_1_19 1 #define EFL_VERSION_1_20 1 #define EFL_VERSION_1_21 1 +#define EFL_VERSION_1_22 1 +#define EFL_VERSION_1_23 1 /* Add here all the required ifdef for any @protected method */ #ifdef EFL_BUILD # define EFL_PACK_LAYOUT_PROTECTED -# define EFL_GFX_SIZE_HINT_PROTECTED +# define EFL_GFX_HINT_PROTECTED #endif /** @@ -69,8 +71,6 @@ typedef struct tm Efl_Time; typedef struct _Efl_Text_Cursor_Cursor Efl_Text_Cursor_Cursor; typedef struct _Efl_Text_Annotate_Annotation Efl_Text_Annotate_Annotation; -#ifdef EFL_BETA_API_SUPPORT - #include "interfaces/efl_types.eot.h" #include @@ -84,9 +84,11 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; #include "interfaces/efl_config.eo.h" #include "interfaces/efl_control.eo.h" #include "interfaces/efl_duplicate.eo.h" +#include "interfaces/efl_file.h" #include "interfaces/efl_file.eo.h" +#include "interfaces/efl_file_save.eo.h" #include "interfaces/efl_gfx_image.eo.h" -#include "interfaces/efl_gfx_image_animation_controller.eo.h" +#include "interfaces/efl_gfx_frame_controller.eo.h" #include "interfaces/efl_gfx_image_load_controller.eo.h" #include "interfaces/efl_part.eo.h" #include "interfaces/efl_playable.eo.h" @@ -96,8 +98,10 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; #include "interfaces/efl_orientation.eo.h" #include "interfaces/efl_ui_i18n.eo.h" #include "interfaces/efl_ui_direction.eo.h" +#include "interfaces/efl_ui_direction_readonly.eo.h" #include "interfaces/efl_ui_drag.eo.h" -#include "interfaces/efl_ui_range.eo.h" +#include "interfaces/efl_ui_range_display.eo.h" +#include "interfaces/efl_ui_range_interactive.eo.h" #include "interfaces/efl_ui_autorepeat.eo.h" #include "interfaces/efl_ui_draggable.eo.h" #include "interfaces/efl_ui_clickable.eo.h" @@ -116,7 +120,6 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; #define EFL_ORIENT_270 EFL_ORIENT_LEFT /* Core interface */ -#include "interfaces/efl_animator.eo.h" #include "interfaces/efl_interpolator.eo.h" /* Graphics */ @@ -133,7 +136,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; #include "interfaces/efl_gfx_gradient_radial.eo.h" #include "interfaces/efl_gfx_filter.eo.h" #include "interfaces/efl_gfx_blur.eo.h" -#include "interfaces/efl_gfx_size_hint.eo.h" +#include "interfaces/efl_gfx_hint.eo.h" #include "interfaces/efl_gfx_color_class.eo.h" #include "interfaces/efl_gfx_text_class.eo.h" #include "interfaces/efl_gfx_size_class.eo.h" @@ -146,8 +149,9 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; #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_property_bind.eo.h" #include "interfaces/efl_ui_factory.eo.h" +#include "interfaces/efl_ui_factory_bind.eo.h" #include "interfaces/efl_ui_format.eo.h" #include "interfaces/efl_cached_item.eo.h" @@ -180,8 +184,13 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; #include "interfaces/efl_text_cursor.eo.h" #include "interfaces/efl_text_annotate.eo.h" #include "interfaces/efl_text_markup.eo.h" +#include "interfaces/efl_text_markup_interactive.eo.h" #include "interfaces/efl_text_markup_util.eo.h" +#ifdef EFL_BETA_API_SUPPORT + +EAPI void efl_observable_tuple_free(Efl_Observable_Tuple *tuple); + /** * @brief Get a proxy object referring to a part of an object. * @@ -220,11 +229,6 @@ EAPI Eina_Future *efl_ui_view_factory_create_with_event(Efl_Ui_Factory *factory, #include "interfaces/efl_gfx_types.eot.h" #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_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_Config.h.cmake b/src/lib/efl/Efl_Config.h.cmake index 4f7a03ac1f..5c7a420dae 100644 --- a/src/lib/efl/Efl_Config.h.cmake +++ b/src/lib/efl/Efl_Config.h.cmake @@ -3,16 +3,12 @@ /* Add -DEFL_API_OVERRIDE ot your CFLAGS to override the default * installed api set and then fter that -DEFL_NOLEGACY_API_SUPPORT - * and/or -DEFL_EO_API_SUPPORT as desired + * as desired */ #ifndef EFL_API_OVERRIDE #cmakedefine EFL_API_LEGACY_DEF #cmakedefine EFL_BETA_API_SUPPORT -/* You can't disable Eo API anymore as EFL use it everywhere internally - and we don't want to expose it publicly just yet, so keep it hidden - and require an explicit request to get it. */ -/* #define EFL_EO_API_SUPPORT */ #endif #define EFL_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ diff --git a/src/lib/efl/Efl_Config.h.in b/src/lib/efl/Efl_Config.h.in index 25420d0c4e..1673cd04e9 100644 --- a/src/lib/efl/Efl_Config.h.in +++ b/src/lib/efl/Efl_Config.h.in @@ -3,14 +3,10 @@ /* Add -DEFL_API_OVERRIDE ot your CFLAGS to override the default * installed api set and then fter that -DEFL_NOLEGACY_API_SUPPORT - * and/or -DEFL_EO_API_SUPPORT as desired + * as desired */ #ifndef EFL_API_OVERRIDE @EFL_API_LEGACY_DEF@ -/* You can't disable Eo API anymore as EFL use it everywhere internally - and we don't want to expose it publicly just yet, so keep it hidden - and require an explicit request to get it. */ -/* @EFL_API_EO_DEF@ */ #endif #define EFL_VERSION_MAJOR @EFL_VERSION_MAJOR@ diff --git a/src/lib/efl/Efl_MVVM_Common.h b/src/lib/efl/Efl_MVVM_Common.h index 954163b4cf..d928fa55c1 100644 --- a/src/lib/efl/Efl_MVVM_Common.h +++ b/src/lib/efl/Efl_MVVM_Common.h @@ -12,6 +12,8 @@ EAPI extern Eina_Error EFL_MODEL_ERROR_INCORRECT_VALUE; EAPI extern Eina_Error EFL_MODEL_ERROR_PERMISSION_DENIED; EAPI extern Eina_Error EFL_MODEL_ERROR_INVALID_OBJECT; /**< @since 1.19 */ +EAPI extern Eina_Error EFL_PROPERTY_ERROR_INVALID_KEY; /**< Returned when the given key during a efl_ui_property_bind does not exist on the object. */ + EAPI extern Eina_Error EFL_FACTORY_ERROR_NOT_SUPPORTED; /**< Returned error when factory got a request that it can't fullfil due to a set of unsupported parameters @since 1.22 */ #include "interfaces/efl_model.eo.h" diff --git a/src/lib/efl/interfaces/efl_animator.eo b/src/lib/efl/interfaces/efl_animator.eo deleted file mode 100644 index ca969d99fe..0000000000 --- a/src/lib/efl/interfaces/efl_animator.eo +++ /dev/null @@ -1,15 +0,0 @@ -import eina_types; - -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.]] -} - -interface Efl.Animator { - [[Efl animator interface]] - eo_prefix: efl_animator; - event_prefix: efl; - events { - animator,tick: Efl.Event_Animator_Tick; [[Animator tick synchronized with screen vsync if possible.]] - } -} diff --git a/src/lib/efl/interfaces/efl_cached_item.eo b/src/lib/efl/interfaces/efl_cached_item.eo index f3f82d6baf..a8da315453 100644 --- a/src/lib/efl/interfaces/efl_cached_item.eo +++ b/src/lib/efl/interfaces/efl_cached_item.eo @@ -1,4 +1,4 @@ -interface Efl.Cached.Item +interface @beta Efl.Cached.Item { [[Efl Cached Item interface]] methods { diff --git a/src/lib/efl/interfaces/efl_canvas_pointer.eo b/src/lib/efl/interfaces/efl_canvas_pointer.eo index 45e34f7849..705b17d5e6 100644 --- a/src/lib/efl/interfaces/efl_canvas_pointer.eo +++ b/src/lib/efl/interfaces/efl_canvas_pointer.eo @@ -2,9 +2,13 @@ import efl_input_device; interface Efl.Canvas.Pointer { - [[Efl Canvas Pointer interface]] + [[Efl Canvas Pointer interface + + @since 1.22 + ]] methods { - @property pointer_inside { + /* FIXME Efl.Input.Device is not stable yet*/ + @property pointer_inside @beta { get { [[Returns whether the mouse pointer is logically inside the canvas. diff --git a/src/lib/efl/interfaces/efl_canvas_scene.eo b/src/lib/efl/interfaces/efl_canvas_scene.eo index ab624be34c..fd1a8180d9 100644 --- a/src/lib/efl/interfaces/efl_canvas_scene.eo +++ b/src/lib/efl/interfaces/efl_canvas_scene.eo @@ -3,18 +3,21 @@ import efl_gfx_types; interface Efl.Canvas.Scene { - [[Common interface for window and some internal classes in EFL.]] + [[Interface containing basic canvas-related methods and events. + + @since 1.22 + ]] methods { @property image_max_size { get { - [[Get the maximum image size evas can possibly handle. + [[Get the maximum image size the canvas 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. + the canvas 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. + size exists. + + The default limit is 65535x65535. ]] return: bool; [[$true on success, $false otherwise]] @@ -23,32 +26,30 @@ interface Efl.Canvas.Scene max: Eina.Size2D; [[The maximum image size (in pixels).]] } } - smart_objects_calculate { - [[Call user-provided $calculate smart functions and unset the + group_objects_calculate { + [[Call user-provided $calculate group functions and unset the flag signalling that the object needs to get recalculated to - all smart objects in the canvas. + all group objects in the canvas. ]] } - @property smart_objects_calculating { + @property group_objects_calculating { get { - [[Get if the canvas is currently calculating smart objects.]] + [[Get if the canvas is currently calculating group objects.]] } values { - calculating: bool; [[$true if currently calculating smart objects.]] + calculating: bool; [[$true if currently calculating group objects.]] } } objects_at_xy_get { - [[Retrieve a list of objects lying over a given position in - a canvas. + [[Retrieve a list of objects at 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 + given position. The user can exclude 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. + Warning: This function will only evaluate top-level objects; child + or "sub" objects will be skipped. ]] return: iterator @owned @warn_unused; [[ The list of objects that are over the given position in $e. @@ -71,14 +72,13 @@ interface Efl.Canvas.Scene 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. + given position. The user can exclude 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. + Warning: This function will only evaluate top-level objects; child + or "sub" objects will be skipped. ]] - return: Efl.Gfx.Entity @warn_unused; [[The Evas object that is over all other objects at the given position.]] + return: Efl.Gfx.Entity @warn_unused; [[The canvas 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; [[ @@ -92,18 +92,16 @@ interface Efl.Canvas.Scene } } objects_in_rectangle_get { - [[Retrieve a list of objects lying over a given - rectangular region in a canvas. + [[Retrieve a list of objects overlapping 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 + with the given rectangular region. The user can exclude 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. + Warning: This function will only evaluate top-level objects; child + or "sub" objects will be skipped. ]] return: iterator @owned @warn_unused; [[Iterator to objects]] params { @@ -119,18 +117,17 @@ interface Efl.Canvas.Scene } } object_top_in_rectangle_get @const { - [[Retrieve the Evas object stacked at the top of a given + [[Retrieve the canvas 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 + with the given rectangular region. The user can exclude 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. + Warning: This function will only evaluate top-level objects; child + or "sub" objects will be skipped. ]] return: Efl.Gfx.Entity @warn_unused; [[ The object that is over all other objects at the given @@ -148,15 +145,19 @@ interface Efl.Canvas.Scene ]] } } - seats { - [[Iterate over the input device seats. + /* FIXME Efl.Input.Device is not stable yet*/ + seats @beta { + [[Iterate over the available input device seats for the canvas. - @since 1.20 + A "seat" is the term used for a group of input devices, typically including + a pointer and a keyboard. A seat object is the parent of the individual input + devices. ]] return: iterator @owned; [[An iterator over the attached seats.]] } - @property device { + /* FIXME Efl.Input.Device is not stable yet*/ + @property device @beta{ [[An input device attached to this canvas, found by name. Note: This function is meant to find seats and not individual @@ -174,8 +175,13 @@ interface Efl.Canvas.Scene seat: Efl.Input.Device; [[The device or seat, $null if not found.]] } } - @property seat { - [[A seat attached to this canvas, found by id. + /* FIXME Efl.Input.Device is not stable yet*/ + @property seat @beta { + [[Get a seat attached to this canvas using the seat's id property. + + Seats are associated with an arbitrary integer id. The id is not a + persistent value and should never be hardcoded, as it may change between + runs of an application depending on the environment. See also @.device to find a seat by name instead of by id. ]] @@ -189,54 +195,50 @@ interface Efl.Canvas.Scene seat: Efl.Input.Device; [[The seat or $null if not found.]] } } - @property pointer_position { + /* FIXME Efl.Input.Device is not stable yet*/ + @property seat_default @beta { + [[Get the default seat attached to this canvas. + + A canvas may have exactly one default seat. + + See also @.device to find a seat by name. + See also @.seat to find a seat by id. + ]] + get { + [[Get the default seat.]] + } + values { + seat: Efl.Input.Device; [[The default seat or $null if one does not exist.]] + } + } + /* FIXME Efl.Input.Device is not stable yet*/ + @property pointer_position @beta { get { [[This function returns the current known pointer coordinates This function returns the current position of the main input pointer (mouse, pen, etc...). ]] + return: bool; [[$true if a pointer exists for the given seat, otherwise $false.]] + } + keys { + seat: Efl.Input.Device; [[The seat, or $null to use the default.]] } - /* FIXME: missing keys { seat } */ values { pos: Eina.Position2D; [[The pointer position in pixels.]] } } - /* FIXME: maybe not necessary if gesture supports this */ - pointer_iterate @const @beta { - [[Returns an iterator over the current known pointer positions. - - This is used to iterate over the current known multi-touch positions, - including the first finger. Each pointer position is represented by - an object of type @Efl.Input.Pointer. - - Each finger in a multi touch environment can then be identified - by the @Efl.Input.Pointer.tool property. The order of the pointers - in this iterator is not defined. - - Note: If the input surface supports hovering input, some pointers - may not be in a "down" state. To retrieve the list of such pointers, - set the $hover value to $true. Remember though that most devices - currently don't support this. - ]] - params { - /* FIXME: missing seat. hover is not useful */ - hover: bool @optional; [[$false by default, $true means to include - fingers that are currently hovering.]] - } - return: iterator; [[Iterator to pointer positions]] - } } events { - focus,in: Efl.Input.Focus; [[Called when canvas got focus]] - focus,out: Efl.Input.Focus; [[Called when canvas lost focus]] + scene,focus,in: Efl.Input.Focus; [[Called when scene got focus]] + scene,focus,out: Efl.Input.Focus; [[Called when scene 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: 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]] + render,post @beta: Efl.Gfx.Event.Render_Post; [[Called when post render happens]] + device,changed @beta : Efl.Input.Device; [[Called when input device changed]] + device,added @beta: Efl.Input.Device; [[Called when input device was added]] + device,removed @beta : 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 f0ca171a7d..11ca0cea07 100644 --- a/src/lib/efl/interfaces/efl_common_internal.h +++ b/src/lib/efl/interfaces/efl_common_internal.h @@ -116,6 +116,7 @@ struct _Efl_Input_Focus_Data Efl_Input_Device *device; //The seat Eo *object_wref; // wref on the focused object - Efl.Canvas.Object or Efl.Canvas. double timestamp; + Efl_Input_Flags event_flags; }; /* Internal helpers */ diff --git a/src/lib/efl/interfaces/efl_config.eo b/src/lib/efl/interfaces/efl_config.eo index f76736ab19..e6605d4282 100644 --- a/src/lib/efl/interfaces/efl_config.eo +++ b/src/lib/efl/interfaces/efl_config.eo @@ -1,9 +1,9 @@ -interface Efl.Config +interface @beta Efl.Config { [[A generic configuration interface, that holds key-value pairs.]] methods { @property config { - [[A generic configuration value, refered to by name.]] + [[A generic configuration value, referred to by name.]] get { keys { name: string; [[Configuration option name.]] diff --git a/src/lib/efl/interfaces/efl_container.eo b/src/lib/efl/interfaces/efl_container.eo index e7157ee0a7..d45d0a1d75 100644 --- a/src/lib/efl/interfaces/efl_container.eo +++ b/src/lib/efl/interfaces/efl_container.eo @@ -4,17 +4,12 @@ interface Efl.Container APIs in this interface deal with containers of multiple sub objects, not with individual parts. + + @since 1.22 ]] eo_prefix: efl_content; event_prefix: efl_container; methods { - content_remove { - [[Unswallow an object from this container.]] - params { - @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 @owned @warn_unused; [[Iterator to object content]] diff --git a/src/lib/efl/interfaces/efl_content.eo b/src/lib/efl/interfaces/efl_content.eo index da2088d834..d23ac388a4 100644 --- a/src/lib/efl/interfaces/efl_content.eo +++ b/src/lib/efl/interfaces/efl_content.eo @@ -1,24 +1,36 @@ interface Efl.Content { - [[Common interface for objects that have a (single) content. + [[Common interface for objects that have a single sub-object as content. This is used for the default content part of widgets, as well as for individual parts through @Efl.Part. + + @since 1.22 ]] methods { @property content { - [[Swallowed sub-object contained in this object.]] + [[Sub-object currently set as this object's single content. + + If it is set multiple times, previous sub-objects are removed first. + Therefore, if an invalid $content is set the object will + become empty (it will have no sub-object). + ]] set { - return: bool; [[$true on success, $false otherwise]] + return: bool; [[$true if $content was successfully swallowed.]] } get {} values { - content: Efl.Gfx.Entity; [[The object to swallow.]] + content: Efl.Gfx.Entity; [[The sub-object.]] } } content_unset { - [[Unswallow the object in the current container and return it.]] + [[Remove the sub-object currently set as content of this object and return it. + This object becomes empty. + ]] return: Efl.Gfx.Entity; [[Unswallowed object]] } } + events { + content,changed: Efl.Gfx.Entity; [[Sent after the content is set or unset using the current content object.]] + } } diff --git a/src/lib/efl/interfaces/efl_control.eo b/src/lib/efl/interfaces/efl_control.eo index 39d327eef5..3382cc4392 100644 --- a/src/lib/efl/interfaces/efl_control.eo +++ b/src/lib/efl/interfaces/efl_control.eo @@ -1,6 +1,6 @@ /* FIXME: Rename */ -interface Efl.Control { +interface @beta Efl.Control { [[Efl control interface]] methods { @property priority { diff --git a/src/lib/efl/interfaces/efl_duplicate.eo b/src/lib/efl/interfaces/efl_duplicate.eo index 1b71d803be..6419f35280 100644 --- a/src/lib/efl/interfaces/efl_duplicate.eo +++ b/src/lib/efl/interfaces/efl_duplicate.eo @@ -1,4 +1,4 @@ -interface Efl.Duplicate +interface @beta Efl.Duplicate { [[An interface for duplication of objects. diff --git a/src/lib/efl/interfaces/efl_file.c b/src/lib/efl/interfaces/efl_file.c index 8edbbfb463..67619039c9 100644 --- a/src/lib/efl/interfaces/efl_file.c +++ b/src/lib/efl/interfaces/efl_file.c @@ -7,56 +7,211 @@ typedef struct _Efl_File_Data Efl_File_Data; struct _Efl_File_Data { - Efl_Gfx_Image_Load_Error error; + Eina_Stringshare *vpath; /* efl_file_set */ + Eina_Stringshare *key; /* efl_file_key_set */ + Eina_File *file; /* efl_file_mmap_set */ + Eina_Bool file_opened : 1; /* if `file` was opened implicitly during load */ + Eina_Bool setting : 1; /* set when this file is internally calling methods to avoid infinite recursion */ + Eina_Bool loaded : 1; /* whether the currently set file properties have been loaded */ }; -static Eina_Bool -_efl_file_file_set(Eo *obj, Efl_File_Data *pd, const char *file, const char *key) +EOLIAN static void +_efl_file_unload(Eo *obj, Efl_File_Data *pd) { - char *tmp = NULL; - Eina_File *f = NULL; - Eina_Bool r = EINA_FALSE; + if (!pd->loaded) return; + if (!pd->file) return; + if (!pd->file_opened) return; + pd->setting = 1; + eina_file_close(pd->file); + efl_file_mmap_set(obj, NULL); + pd->setting = 0; + pd->loaded = pd->file_opened = EINA_FALSE; +} - pd->error = EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST; +EOLIAN static Eina_Error +_efl_file_load(Eo *obj, Efl_File_Data *pd) +{ + Eina_Error ret = 0; + + if (pd->loaded) return 0; + EINA_SAFETY_ON_NULL_RETURN_VAL(pd->vpath, ENOENT); + errno = 0; + if (!pd->file) + { + Eina_File *f; + f = eina_file_open(pd->vpath, EINA_FALSE); + if (!f) return errno ?: ENOENT; + pd->file_opened = EINA_TRUE; + pd->setting = 1; + ret = efl_file_mmap_set(obj, f); + pd->setting = 0; + if (ret) pd->file_opened = EINA_FALSE; + eina_file_close(f); + } + pd->loaded = !ret; + return ret; +} + +EOLIAN static Eina_Error +_efl_file_mmap_set(Eo *obj, Efl_File_Data *pd, const Eina_File *f) +{ + Eina_Error err = 0; + Eina_File *file = NULL; + + if (f == pd->file) return 0; + if (f) + { + file = eina_file_dup(f); + if (!file) return errno; + } + if (pd->file) eina_file_close(pd->file); + pd->file = file; + pd->loaded = EINA_FALSE; + + if (!pd->setting) + { + /* avoid infinite recursion */ + pd->setting = 1; + err = efl_file_set(obj, eina_file_filename_get(pd->file)); + pd->setting = 0; + } + return err; +} + +EOLIAN static const Eina_File * +_efl_file_mmap_get(const Eo *obj EINA_UNUSED, Efl_File_Data *pd) +{ + return pd->file; +} + +EOLIAN static Eina_Error +_efl_file_file_set(Eo *obj, Efl_File_Data *pd, const char *file) +{ + char *tmp; + Eina_Error err = 0; + Eina_Bool same; tmp = (char*)(file); if (tmp) - { - tmp = eina_vpath_resolve(tmp); - } - - if (tmp) - { - f = eina_file_open(tmp, EINA_FALSE); - if (!f) goto on_error; - } - - pd->error = EFL_GFX_IMAGE_LOAD_ERROR_NONE; - - r = efl_file_mmap_set(obj, f, key); - if (f) eina_file_close(f); - - on_error: + tmp = eina_vpath_resolve(tmp); + same = !eina_stringshare_replace(&pd->vpath, tmp ?: file); free(tmp); - return r; + if (same) return err; + pd->loaded = EINA_FALSE; + if (!pd->setting) + { + pd->setting = 1; + err = efl_file_mmap_set(obj, NULL); + pd->setting = 0; + } + return err; } -static void -_efl_file_file_get(const Eo *obj, Efl_File_Data *pd EINA_UNUSED, const char **file, const char **key) +EOLIAN static Eina_Stringshare * +_efl_file_file_get(const Eo *obj EINA_UNUSED, Efl_File_Data *pd) { - 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; + return pd->vpath; } -static Efl_Gfx_Image_Load_Error -_efl_file_load_error_get(const Eo *obj EINA_UNUSED, Efl_File_Data *pd) +EOLIAN static void +_efl_file_key_set(Eo *obj EINA_UNUSED, Efl_File_Data *pd, const char *key) { - return pd->error; + if (eina_stringshare_replace(&pd->key, key)) + pd->loaded = 0; +} + +EOLIAN static Eina_Stringshare * +_efl_file_key_get(const Eo *obj EINA_UNUSED, Efl_File_Data *pd) +{ + return pd->key; +} + +EOLIAN static Eina_Bool +_efl_file_loaded_get(const Eo *obj EINA_UNUSED, Efl_File_Data *pd) +{ + return pd->loaded; +} + +EOLIAN static void +_efl_file_efl_object_destructor(Eo *obj, Efl_File_Data *pd) +{ + eina_stringshare_del(pd->vpath); + eina_stringshare_del(pd->key); + eina_file_close(pd->file); + efl_destructor(efl_super(obj, EFL_FILE_MIXIN)); +} + +EOLIAN static Eo * +_efl_file_efl_object_finalize(Eo *obj, Efl_File_Data *pd) +{ + obj = efl_finalize(efl_super(obj, EFL_FILE_MIXIN)); + if (!obj) return NULL; + if (pd->file || pd->vpath) efl_file_load(obj); + return obj; +} + +//////////////////////////////////////////////////////////////////////////// + +EAPI Eina_Bool +efl_file_simple_load(Eo *obj, const char *file, const char *key) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE); + efl_ref(obj); + EINA_SAFETY_ON_TRUE_GOTO(efl_file_set(obj, file), fail); + efl_file_key_set(obj, key); + if (file) + { + if (efl_file_load(obj)) goto fail; + efl_unref(obj); + return EINA_TRUE; + } + efl_file_unload(obj); + efl_unref(obj); + return EINA_TRUE; +fail: + efl_unref(obj); + return EINA_FALSE; +} + +EAPI Eina_Bool +efl_file_simple_mmap_load(Eo *obj, const Eina_File *file, const char *key) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE); + efl_ref(obj); + EINA_SAFETY_ON_TRUE_GOTO(efl_file_mmap_set(obj, file), fail); + efl_file_key_set(obj, key); + if (file) + { + if (efl_file_load(obj)) goto fail; + efl_unref(obj); + return EINA_TRUE; + } + efl_file_unload(obj); + efl_unref(obj); + return EINA_TRUE; +fail: + efl_unref(obj); + return EINA_FALSE; +} + +EAPI void +efl_file_simple_get(const Eo *obj, const char **file, const char **key) +{ + efl_ref((Eo*)obj); + if (file) *file = efl_file_get(obj); + if (key) *key = efl_file_key_get(obj); + efl_unref((Eo*)obj); +} + +EAPI void +efl_file_simple_mmap_get(const Eo *obj, const Eina_File **file, const char **key) +{ + efl_ref((Eo*)obj); + if (file) *file = efl_file_mmap_get(obj); + if (key) *key = efl_file_key_get(obj); + efl_unref((Eo*)obj); } #include "interfaces/efl_file.eo.c" +#include "interfaces/efl_file_save.eo.c" diff --git a/src/lib/efl/interfaces/efl_file.eo b/src/lib/efl/interfaces/efl_file.eo index 9260c16bf1..7d1ee49114 100644 --- a/src/lib/efl/interfaces/efl_file.eo +++ b/src/lib/efl/interfaces/efl_file.eo @@ -1,115 +1,111 @@ import eina_types; -import efl_gfx_types; -mixin Efl.File { - [[Efl file interface]] +mixin Efl.File requires Efl.Object { + [[Efl file interface + + @since 1.22 + ]] methods { - @property load_error { - get { - [[Gets the (last) file loading error for a given object.]] - } - values { - error: Efl.Gfx.Image_Load_Error(Efl.Gfx.Image_Load_Error.none); [[The load error code.]] - } - } @property mmap { - set @pure_virtual { - [[Set the source mmaped file from where an image object must fetch the real - image data (it must be an Eina_File). + set { + [[Set the mmaped file from where an object will fetch the real + data (it must be an @Eina.File). - If the file supports multiple data stored in it (as Eet files do), - you can specify the key to be used as the index of the image in - this file. + If mmap is set during object construction, the object will automatically + call @.load during the finalize phase of construction. + ]] - @since 1.8]] - - return: bool; [[$true on success, $false otherwise]] + return: Eina.Error; [[0 on success, error code otherwise]] } - get @pure_virtual { - [[Get the source mmaped file from where an image object must fetch the real - image data (it must be an Eina_File). - - If the file supports multiple data stored in it (as Eet files do), - you can get the key to be used as the index of the image in - this file. - - @since 1.10]] + get { + [[Get the mmaped file from where an object will fetch the real + data (it must be an @Eina.File). + ]] } values { - f: ptr(const(Eina.File)); [[The handler to an Eina_File that will be used as image source]] - key: string @optional; [[The group that the image belongs to, in case - it's an EET(including Edje case) file. This can be used - as a key inside evas image cache if this is a normal image - file not eet file.]] + f: ptr(const(Eina.File)); [[The handle to the @Eina.File that will be used]] } } @property file { set { - [[Set the source file from where an image object must fetch the real - image data (it may be an Eet file, besides pure image ones). + [[Set the file path from where an object will fetch the data. - If the file supports multiple data stored in it (as Eet files do), - you can specify the key to be used as the index of the image in - this file.]] + If file is set during object construction, the object will automatically + call @.load during the finalize phase of construction. + ]] - /* FIXME-doc - * Example: - * @code - * img = evas_object_image_add(canvas); - * evas_object_image_file_set(img, "/path/to/img", NULL); - * err = evas_object_image_load_error_get(img); - * if (err != EVAS_LOAD_ERROR_NONE) - * { - * fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n", - * valid_path, evas_load_error_str(err)); - * } - * else - * { - * evas_object_image_fill_set(img, 0, 0, w, h); - * evas_object_resize(img, w, h); - * evas_object_show(img); - * } - * @endcode - */ - - return: bool; [[$true on success, $false otherwise]] + return: Eina.Error; [[0 on success, error code otherwise]] } get { - [[Retrieve the source file from where an image object is to fetch the - real image data (it may be an Eet file, besides pure image ones). + [[Retrieve the file path from where an object is to fetch the data. You must not modify the strings on the returned pointers. - - Note: Use $null pointers on the file components you're not - interested in: they'll be ignored by the function.]] + ]] } values { - file: string; [[The image file path.]] - key: string; [[The image key in $file (if its an Eet one), or - $null, otherwise.]] + file: string; [[The file path.]] } } - save @const @pure_virtual { - [[Save the given image object's contents to an (image) file. + @property key { + set { + [[Set the key which corresponds to the target data within a file. - The extension suffix on $file will determine which saver - module Evas is to use when saving, thus the final file's - format. If the file supports multiple data stored in it (Eet ones), - you can specify the key to be used as the index of the image in it. - - You can specify some flags when saving the image. Currently - acceptable flags are $quality and $compress. Eg.: - "quality=100 compress=9". - ]] - params { - @in file: string @nonull; [[The filename to be used to save the image (extension - obligatory).]] - @in key: string; [[The image key in the file (if an Eet one), or $null, - otherwise.]] - @in flags: string; [[String containing the flags to be used ($null for - none).]] + Some filetypes can contain multiple data streams which are indexed by + a key. Use this property for such cases. + ]] } - return: bool; [[$true on success, $false otherwise]] + get { + [[Get the previously-set key which corresponds to the target data within a file. + + Some filetypes can contain multiple data streams which are indexed by + a key. Use this property for such cases (See for example @Efl.Ui.Image or + @Efl.Ui.Layout). + + You must not modify the strings on the returned pointers. + ]] + } + values { + key: string; [[The group that the data belongs to. See the class documentation + for particular implementations of this interface to see how this + property is used.]] + } + } + @property loaded { + get { + [[Get the load state of the object. + ]] + } + values { + loaded: bool; [[$true if the object is loaded, $false otherwise.]] + } + } + + load { + [[Perform all necessary operations to open and load file data into the object + using the @.file (or @.mmap) and @.key properties. + + In the case where @.file.set has been called on an object, this will internally + open the file and call @.mmap.set on the object using the opened file handle. + + Calling @.load on an object which has already performed file operations based on + the currently set properties will have no effect. + ]] + + return: Eina.Error; [[0 on success, error code otherwise]] + } + + unload { + [[Perform all necessary operations to unload file data from the object. + + In the case where @.mmap.set has been externally called on an object, the file handle + stored in the object will be preserved. + + Calling @.unload on an object which is not currently loaded will have no effect. + ]] } } + implements { + Efl.Object.destructor; + Efl.Object.finalize; + } } diff --git a/src/lib/efl/interfaces/efl_file.h b/src/lib/efl/interfaces/efl_file.h new file mode 100644 index 0000000000..d0457148e4 --- /dev/null +++ b/src/lib/efl/interfaces/efl_file.h @@ -0,0 +1,10 @@ +#ifndef _EFL_FILE_H +# define _EFL_FILE_H + +/* add doc note about needing ref/unref when passing efl_part to these functions */ +EAPI Eina_Bool efl_file_simple_load(Eo *obj, const char *file, const char *key); +EAPI Eina_Bool efl_file_simple_mmap_load(Eo *obj, const Eina_File *file, const char *key); +EAPI void efl_file_simple_get(const Eo *obj, const char **file, const char **key); +EAPI void efl_file_simple_mmap_get(const Eo *obj, const Eina_File **file, const char **key); + +#endif diff --git a/src/lib/efl/interfaces/efl_file_save.eo b/src/lib/efl/interfaces/efl_file_save.eo new file mode 100644 index 0000000000..e9a72ec262 --- /dev/null +++ b/src/lib/efl/interfaces/efl_file_save.eo @@ -0,0 +1,43 @@ +import eina_types; + + +struct Efl.File_Save_Info +{ + [[Info used to determine various attributes when saving a file. + + @since 1.22 + ]] + quality: uint; [[The quality level (0-100) to save the file with; commonly used when saving image files.]] + compression: uint; [[The compression level (0-100) to save the file with.]] + encoding: string; [[The encoding to use when saving the file.]] +} + +interface Efl.File_Save { + [[Efl file saving interface + + @since 1.22 + ]] + methods { + save @const { + [[Save the given image object's contents to an (image) file. + + The extension suffix on $file will determine which saver + module Evas is to use when saving, thus the final file's + format. If the file supports multiple data stored in it (Eet ones), + you can specify the key to be used as the index of the image in it. + + You can specify some flags when saving the image. Currently + acceptable flags are $quality and $compress. Eg.: + "quality=100 compress=9". + ]] + params { + @in file: string @nonull; [[The filename to be used to save the image (extension + obligatory).]] + @in key: string; [[The image key in the file (if an Eet one), or $null, + otherwise.]] + @in info: const(ptr(Efl.File_Save_Info)); [[The flags to be used ($null for defaults).]] + } + return: bool; [[$true on success, $false otherwise]] + } + } +} diff --git a/src/lib/efl/interfaces/efl_gfx_blur.eo b/src/lib/efl/interfaces/efl_gfx_blur.eo index c69e7871fb..a3f2d5dac0 100644 --- a/src/lib/efl/interfaces/efl_gfx_blur.eo +++ b/src/lib/efl/interfaces/efl_gfx_blur.eo @@ -1,4 +1,4 @@ -interface Efl.Gfx.Blur +interface @beta Efl.Gfx.Blur { [[A simple API to apply blur effects. diff --git a/src/lib/efl/interfaces/efl_gfx_buffer.eo b/src/lib/efl/interfaces/efl_gfx_buffer.eo index a4fa28cb98..074dd7843a 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 @beta Efl.Gfx.Buffer_Access_Mode { [[Graphics buffer access mode]] none = 0x0, [[No buffer access]] read = 0x1, [[Read access to buffer]] @@ -12,7 +12,7 @@ enum Efl.Gfx.Buffer_Access_Mode { /* FIXME: YUV and other planar formats are not properly handled in this API! */ -interface Efl.Gfx.Buffer +interface @beta Efl.Gfx.Buffer { [[Common APIs for all objects representing images and 2D pixel buffers.]] diff --git a/src/lib/efl/interfaces/efl_gfx_color.c b/src/lib/efl/interfaces/efl_gfx_color.c index 54c4df868f..92c1f07483 100644 --- a/src/lib/efl/interfaces/efl_gfx_color.c +++ b/src/lib/efl/interfaces/efl_gfx_color.c @@ -117,8 +117,8 @@ _efl_gfx_color_color_code_get(const Eo *obj, void *_pd EINA_UNUSED) return eina_slstr_printf("#%02X%02X%02X%02X", r, g, b, a); } -EOLIAN static void -_efl_gfx_color_color_class_code_set(Eo *obj, void *_pd EINA_UNUSED, const char *color_class, +EOLIAN static Eina_Bool +_efl_gfx_color_class_color_class_code_set(Eo *obj, void *_pd EINA_UNUSED, const char *color_class, Efl_Gfx_Color_Class_Layer layer, const char *colorcode) { int len; @@ -127,17 +127,19 @@ _efl_gfx_color_color_class_code_set(Eo *obj, void *_pd EINA_UNUSED, const char * len = _format_clean_param(colorcode); _format_color_parse(colorcode, len, &r, &g, &b, &a); - efl_gfx_color_class_set(obj, color_class, layer, r, g, b, a); + return efl_gfx_color_class_set(obj, color_class, layer, r, g, b, a); } EOLIAN static const char * -_efl_gfx_color_color_class_code_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, +_efl_gfx_color_class_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; - efl_gfx_color_class_get(obj, color_class, layer, &r, &g, &b, &a); - return eina_slstr_printf("#%02X%02X%02X%02X", r, g, b, a); + if (efl_gfx_color_class_get(obj, color_class, layer, &r, &g, &b, &a)) + return eina_slstr_printf("#%02X%02X%02X%02X", r, g, b, a); + return NULL; } #include "interfaces/efl_gfx_color.eo.c" +#include "interfaces/efl_gfx_color_class.eo.c" diff --git a/src/lib/efl/interfaces/efl_gfx_color.eo b/src/lib/efl/interfaces/efl_gfx_color.eo index 6e1aa2b260..fa0d1d4c37 100644 --- a/src/lib/efl/interfaces/efl_gfx_color.eo +++ b/src/lib/efl/interfaces/efl_gfx_color.eo @@ -2,7 +2,10 @@ import efl_gfx_types; mixin Efl.Gfx.Color { - [[Efl Gfx Color mixin class]] + [[Efl Gfx Color mixin class + + @since 1.22 + ]] data: null; methods { @property color @pure_virtual { @@ -58,24 +61,5 @@ mixin Efl.Gfx.Color colorcode: string; [[the hex color code.]] } } - @property color_class_code { - set { - [[Set the color class color of given Evas Object to the given hex color code(#RRGGBBAA). - e.g. efl_gfx_color_class_code_set(obj, "color_class_name", layer, "#FFCCAACC"); - ]] - } - get { - [[Get hex color class code of given Evas Object. - This returns a short lived hex color class code string. - ]] - } - keys { - color_class: string; [[The name of color class]] - 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 f0d4dcb866..25d822bdc8 100644 --- a/src/lib/efl/interfaces/efl_gfx_color_class.eo +++ b/src/lib/efl/interfaces/efl_gfx_color_class.eo @@ -1,10 +1,11 @@ import efl_gfx_types; -interface Efl.Gfx.Color_Class +mixin @beta Efl.Gfx.Color_Class { - [[Efl Gfx Color Class interface]] + [[Efl Gfx Color Class mixin class]] + data: null; methods { - @property color_class { + @property color_class @pure_virtual { set { [[Set the color of color class. @@ -46,7 +47,47 @@ interface Efl.Gfx.Color_Class a: int; [[The alpha value]] } } - @property color_class_description { + @property color_class_code { + set { + [[Set the hex color string of color class. + + This function sets the color values for a color class. This will + cause all edje parts in the specified object that have the specified + color class to have their colors multiplied by these values. + + The first color is the object, the second is the text outline, and + the third is the text shadow. (Note that the second two only apply + to text parts). + + Setting color emits a signal "color_class,set" with source being + the given color. + + Note: These color values are expected to be premultiplied by the alpha.]] + return: bool; [[$true if setting the color succeeded, $false otherwise]] + } + get { + [[Get the hex color string of color class. + + This function gets the color values for a color class. If no explicit + object color is set, then global values will be used. + + The first color is the object, the second is the text outline, and + the third is the text shadow. (Note that the second two only apply + to text parts). + + Returns NULL if the color class cannot be fetched. + + Note: These color values are expected to be premultiplied by $a.]] + } + keys { + color_class: string; [[The name of color class]] + layer: Efl.Gfx.Color_Class_Layer @optional; [[The layer to set the color]] + } + values { + colorcode: string; [[the hex color code.]] + } + } + @property color_class_description @pure_virtual { get { [[Get the description of a color class. @@ -59,7 +100,7 @@ interface Efl.Gfx.Color_Class description: string; [[The description of the target color class or $null if not found]] } } - color_class_del { + color_class_del @pure_virtual { [[Delete the color class. This function deletes any values for the specified color class. @@ -73,14 +114,13 @@ interface Efl.Gfx.Color_Class @in color_class: string; [[The name of color_class]] } } - color_class_clear { + color_class_clear @pure_virtual { [[Delete all color classes defined in object level. This function deletes any color classes defined in object level. Clearing color classes will revert the color of all edje parts to the values defined in global level or theme file. - - @since 1.17.0]] + ]] } } } diff --git a/src/lib/efl/interfaces/efl_gfx_entity.eo b/src/lib/efl/interfaces/efl_gfx_entity.eo index 30131d6ba3..358228c5ce 100644 --- a/src/lib/efl/interfaces/efl_gfx_entity.eo +++ b/src/lib/efl/interfaces/efl_gfx_entity.eo @@ -1,7 +1,10 @@ import eina_types; interface Efl.Gfx.Entity { - [[Efl graphics interface]] + [[Efl graphics interface + + @since 1.22 + ]] eo_prefix: efl_gfx_entity; methods { @property position { @@ -31,7 +34,7 @@ interface Efl.Gfx.Entity { 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.Hint instead, when manipulating widgets. ]] } @@ -101,9 +104,8 @@ interface Efl.Gfx.Entity { } } events { - 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.]] + visibility,changed: bool; [[Object's visibility state changed, the event value is the new state.]] + position,changed: Eina.Position2D; [[Object was moved, its position during the event is the new one.]] + size,changed: Eina.Size2D; [[Object was resized, its size during the event is the new one.]] } } diff --git a/src/lib/efl/interfaces/efl_gfx_fill.eo b/src/lib/efl/interfaces/efl_gfx_fill.eo index 566f26daad..0cd438012d 100644 --- a/src/lib/efl/interfaces/efl_gfx_fill.eo +++ b/src/lib/efl/interfaces/efl_gfx_fill.eo @@ -1,6 +1,6 @@ import eina_types; -interface Efl.Gfx.Fill { +interface @beta Efl.Gfx.Fill { [[Efl graphics fill interface]] methods { @property fill_auto { diff --git a/src/lib/efl/interfaces/efl_gfx_filter.eo b/src/lib/efl/interfaces/efl_gfx_filter.eo index 499a29c8de..5e8e0e982b 100644 --- a/src/lib/efl/interfaces/efl_gfx_filter.eo +++ b/src/lib/efl/interfaces/efl_gfx_filter.eo @@ -1,4 +1,4 @@ -interface Efl.Gfx.Filter +interface @beta Efl.Gfx.Filter { [[Graphical filters can be applied to any object implementing this interface. @@ -7,8 +7,6 @@ interface Efl.Gfx.Filter be found under "EFL Graphics Filters". This was a beta feature since 1.15. - - @since 1.18 ]] eo_prefix: efl_gfx; methods { diff --git a/src/lib/efl/interfaces/efl_gfx_image_animation_controller.eo b/src/lib/efl/interfaces/efl_gfx_frame_controller.eo similarity index 54% rename from src/lib/efl/interfaces/efl_gfx_image_animation_controller.eo rename to src/lib/efl/interfaces/efl_gfx_frame_controller.eo index ef11fe6d4d..79712182f4 100644 --- a/src/lib/efl/interfaces/efl_gfx_image_animation_controller.eo +++ b/src/lib/efl/interfaces/efl_gfx_frame_controller.eo @@ -1,44 +1,37 @@ /* FIXME: invalid type from evas/emile! */ /* type @extern Evas.Animated_Loop_Hint: int; */ -enum Efl.Gfx.Image_Animation_Controller_Loop_Hint { - [[Image animation loop modes]] +enum @beta Efl.Gfx.Frame_Controller_Loop_Hint { + [[Frame 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.Gfx.Image_Animation_Controller when eo/eolian are fixed */ - -interface Efl.Gfx.Image_Animation_Controller +interface @beta Efl.Gfx.Frame_Controller { - [[Efl animated image interface]] - eo_prefix: efl_gfx_image; + [[Efl frame controller of frame based animated object interface.]] methods { @property animated { get { - [[Check if an image can be animated (has multiple frames). + [[Check if an object can be animated (has multiple frames). - This will be $true for animated Gif files for instance but $false - for still images. - - @since 1.1 + This will be $true for animated object for instance but $false + for a single frame object. ]] } values { - is_animated: bool; [[$true if the image is animated]] + is_animated: bool; [[$true if the object is animated]] } } - @property animated_frame { - [[Index of the current frame of an animated image. + @property frame { + [[Index of the current frame of an animated object. - Ranges from 1 to @.animated_frame_count. Valid only if @.animated. + Ranges from 1 to @.frame_count. Valid only if @.animated. ]] set { - [[Set the frame to current frame of an image object. - - @since 1.1 + [[Set the frame to current frame of an animated object. ]] return: bool; [[Returns $true if the frame index is valid.]] } @@ -47,55 +40,49 @@ interface Efl.Gfx.Image_Animation_Controller frame_index: int; [[The index of current frame.]] } } - @property animated_frame_count { + @property frame_count { get { - [[Get the total number of frames of the image, if animated. + [[Get the total number of frames of the object, if animated. Returns -1 if not animated. - - @since 1.1 ]] - return: int; [[The number of frames in the animated image.]] + return: int; [[The number of frames in the animated object.]] } } - @property animated_loop_type { + @property loop_type { /* FIXME: external type used from evas / emile */ get { - [[Get the kind of looping the image object does. + [[Get the kind of looping the animated object does. - This returns the kind of looping the image object wants to do. + This returns the kind of looping the animated object wants to do. - If it returns @Efl.Gfx.Image_Animation_Controller_Loop_Hint.loop, you should + If it returns @Efl.Gfx.Frame_Controller_Loop_Hint.loop, you should display frames in a sequence like: 1->2->3->1->2->3->1... - If it returns @Efl.Gfx.Image_Animation_Controller_Loop_Hint.pingpong, it is + If it returns @Efl.Gfx.Frame_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.Gfx.Image_Animation_Controller_Loop_Hint.loop. - - @since 1.1 + The default type is @Efl.Gfx.Frame_Controller_Loop_Hint.loop. ]] - return: Efl.Gfx.Image_Animation_Controller_Loop_Hint; [[Loop type of the image object.]] + return: Efl.Gfx.Frame_Controller_Loop_Hint; [[Loop type of the animated object.]] } } - @property animated_loop_count { + @property loop_count { get { [[Get the number times the animation of the object loops. - This returns loop count of image. The loop count is the number + This returns loop count of animated object. The loop count is the number of times the animation will play fully from first to last frame until the animation should stop (at the final frame). If 0 is returned, then looping should happen indefinitely (no limit to the number of times it loops). - - @since 1.1 ]] - return: int; [[The number of loop of an animated image object.]] + return: int; [[The number of loop of an animated object.]] } } - @property animated_frame_duration { + @property frame_duration { get { [[Get the duration of a sequence of frames. @@ -105,12 +92,10 @@ interface Efl.Gfx.Image_Animation_Controller If $start_frame is 1 and $frame_num is 0, this returns the duration of frame 1. If $start_frame is 1 and $frame_num is 1, this returns the total duration of frame 1 + frame 2. - - @since 1.1 ]] } keys { - start_frame: int; [[The first frame, rangers from 1 to @.animated_frame_count.]] + start_frame: int; [[The first frame, rangers from 1 to @.frame_count.]] frame_num: int; [[Number of frames in the sequence, starts from 0.]] } values { diff --git a/src/lib/efl/interfaces/efl_gfx_gradient.eo b/src/lib/efl/interfaces/efl_gfx_gradient.eo index 311e873698..3622034a45 100644 --- a/src/lib/efl/interfaces/efl_gfx_gradient.eo +++ b/src/lib/efl/interfaces/efl_gfx_gradient.eo @@ -1,6 +1,6 @@ import efl_gfx_types; -interface Efl.Gfx.Gradient +interface @beta Efl.Gfx.Gradient { [[Efl graphics gradient interface]] eo_prefix: efl_gfx_gradient; diff --git a/src/lib/efl/interfaces/efl_gfx_gradient_linear.eo b/src/lib/efl/interfaces/efl_gfx_gradient_linear.eo index ec7a9bfdfd..238e5d04a4 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 extends Efl.Gfx.Gradient +interface @beta Efl.Gfx.Gradient_Linear extends 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 1b2d6bdf26..9cc3f3f069 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 extends Efl.Gfx.Gradient +interface @beta Efl.Gfx.Gradient_Radial extends Efl.Gfx.Gradient { [[Efl graphics gradient radial interface]] methods { diff --git a/src/lib/efl/interfaces/efl_gfx_size_hint.eo b/src/lib/efl/interfaces/efl_gfx_hint.eo similarity index 78% rename from src/lib/efl/interfaces/efl_gfx_size_hint.eo rename to src/lib/efl/interfaces/efl_gfx_hint.eo index 711ff6e817..08f521fcf4 100644 --- a/src/lib/efl/interfaces/efl_gfx_size_hint.eo +++ b/src/lib/efl/interfaces/efl_gfx_hint.eo @@ -1,44 +1,17 @@ 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.Hint_Expand: double = 1.0; + [[Use with @Efl.Gfx.Hint.hint_weight.]] -interface Efl.Gfx.Size_Hint +interface Efl.Gfx.Hint { - [[Efl graphics size hint interface]] + [[Efl graphics hint interface + + @since 1.22 + ]] event_prefix: efl_gfx_entity; methods { - @property hint_base { - [[Base size for objects with sizing restrictions. - - This is not a size enforcement in any way, it's just a hint - that should be used whenever appropriate. - - @.hint_base + N x @.hint_step is what is calculated for object - sizing restrictions. - - See also @.hint_step. - ]] - values { - sz: Eina.Size2D; [[Base size (hint) in pixels.]] - } - } - @property hint_step { - [[Step size for objects with sizing restrictions. - - This is not a size enforcement in any way, it's just a hint - that should be used whenever appropriate. - - Set this to for an object to scale up by steps and not continuously. - - @.hint_base + N x @.hint_step is what is calculated for object - sizing restrictions. - ]] - values { - sz: Eina.Size2D; [[Step size (hint) in pixels.]] - } - } @property hint_aspect { [[Defines the aspect ratio to respect when scaling this object. @@ -57,7 +30,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.Hint_Aspect; [[Mode of interpretation.]] sz: Eina.Size2D; [[Base size to use for aspecting.]] /* FIXME: do we want min/max like Edje instead?? @@ -66,7 +39,7 @@ interface Efl.Gfx.Size_Hint */ } } - @property hint_max { + @property hint_size_max { [[Hints on the object's maximum size. This is not a size enforcement in any way, it's just a hint @@ -79,7 +52,7 @@ interface Efl.Gfx.Size_Hint queried by managers. Note: Smart objects (such as elementary) can have their own - size hint policy. So calling this API may or may not affect + hint policy. So calling this API may or may not affect the size of smart objects. ]] values { @@ -87,7 +60,7 @@ interface Efl.Gfx.Size_Hint default for canvas objects).]] } } - @property hint_min { + @property hint_size_min { [[Hints on the object's minimum size. This is not a size enforcement in any way, it's just a hint @@ -106,7 +79,7 @@ interface Efl.Gfx.Size_Hint sz: Eina.Size2D; [[Minimum size (hint) in pixels.]] } } - @property hint_restricted_min { + @property hint_size_restricted_min { [[Internal hints for an object's minimum size. This is not a size enforcement in any way, it's just a hint @@ -118,7 +91,7 @@ interface Efl.Gfx.Size_Hint Note: This property is internal and meant for widget developers to define the absolute minimum size of the object. EFL itself sets this size internally, so any change to it from an application - might be ignored. Use @.hint_min instead. + might be ignored. Use @.hint_size_min instead. ]] set @protected { [[This function is protected as it is meant for widgets to indicate @@ -132,13 +105,13 @@ interface Efl.Gfx.Size_Hint sz: Eina.Size2D; [[Minimum size (hint) in pixels.]] } } - @property hint_combined_min { - [[Read-only minimum size combining both @.hint_restricted_min and - @.hint_min size hints. + @property hint_size_combined_min { + [[Read-only minimum size combining both @.hint_size_restricted_min and + @.hint_size_min hints. - @.hint_restricted_min is intended for mostly internal usage - and widget developers, and @.hint_min is intended to be - set from application side. @.hint_combined_min combines both values + @.hint_size_restricted_min is intended for mostly internal usage + and widget developers, and @.hint_size_min is intended to be + set from application side. @.hint_size_combined_min combines both values by taking their repective maximum (in both width and height), and is used internally to get an object's minimum size. ]] @@ -157,7 +130,7 @@ interface Efl.Gfx.Size_Hint placing the object accordingly. Note: Smart objects (such as elementary) can have their own - size hint policy. So calling this API may or may not affect + hint policy. So calling this API may or may not affect the size of smart objects. ]] /* @@ -176,7 +149,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.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 @@ -225,7 +198,7 @@ interface Efl.Gfx.Size_Hint or "fill" by some users. @.hint_fill specify whether to fill the space inside the boundaries of a container/manager. - Maximum size hints should be enforced with higher + Maximum hints should be enforced with higher priority, if they are set. Also, any @.hint_margin set on objects should add up to the object space on the final scene composition. @@ -247,6 +220,6 @@ interface Efl.Gfx.Size_Hint } } events { - change,size,hints: void; [[Object size hints changed.]] + hints,changed: void; [[Object hints changed.]] } } diff --git a/src/lib/efl/interfaces/efl_gfx_image.eo b/src/lib/efl/interfaces/efl_gfx_image.eo index 4e8a23cdea..1ef54efe8c 100644 --- a/src/lib/efl/interfaces/efl_gfx_image.eo +++ b/src/lib/efl/interfaces/efl_gfx_image.eo @@ -1,7 +1,7 @@ import efl_gfx_types; import eina_types; -enum Efl.Gfx.Image_Content_Hint +enum @beta 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 +9,7 @@ enum Efl.Gfx.Image_Content_Hint static = 2 [[The content won't change over time.]] } -enum Efl.Gfx.Image_Scale_Hint +enum @beta 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 +18,7 @@ enum Efl.Gfx.Image_Scale_Hint static = 2 [[Image will not be re-scaled over time, thus turning scaling cache ON for its data.]] } -enum Efl.Gfx.Image_Scale_Type +enum @beta Efl.Gfx.Image_Scale_Type { [[Enumeration that defines scale types of an image.]] fill, [[Scale the image so that it matches @@ -40,7 +40,7 @@ enum Efl.Gfx.Image_Scale_Type none [[Not scale the image]] } -interface Efl.Gfx.Image +interface @beta Efl.Gfx.Image { [[Common APIs for all 2D images that can be rendered on the canvas.]] @@ -148,8 +148,6 @@ interface Efl.Gfx.Image as stored in the original file. This is a read-only property, and may return 0x0. - - @since 1.20 ]] get {} values { @@ -203,11 +201,19 @@ interface Efl.Gfx.Image see @Efl.Gfx.Image_Scale_Hint]] } } + @property image_load_error { + get { + [[Gets the (last) file loading error for a given object.]] + } + values { + error: Eina.Error; [[The load error code.]] + } + } } events { - 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 + image,preload: void; [[Image data has been preloaded.]] + image,resize: void; [[Image was resized (its pixel data).]] + image,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_gfx_image_load_controller.eo b/src/lib/efl/interfaces/efl_gfx_image_load_controller.eo index 66ae1d4085..84f0cc0527 100644 --- a/src/lib/efl/interfaces/efl_gfx_image_load_controller.eo +++ b/src/lib/efl/interfaces/efl_gfx_image_load_controller.eo @@ -2,7 +2,7 @@ import eina_types; import efl_gfx_types; /* -enum Efl.Gfx.Image_Load_Controller_State +enum @beta Efl.Gfx.Image_Load_Controller_State { none = 0, [[Not loading any image.]] loaded = 1, [[Image data is loaded, nothing is pending.]] @@ -13,7 +13,7 @@ enum Efl.Gfx.Image_Load_Controller_State } */ -interface Efl.Gfx.Image_Load_Controller +interface @beta Efl.Gfx.Image_Load_Controller { [[Common APIs for all loadable 2D images.]] @@ -92,8 +92,6 @@ interface Efl.Gfx.Image_Load_Controller @property load_region_support { [[Indicates whether the @.load_region property is supported for the current file. - - @since 1.2 ]] get {} values { @@ -130,8 +128,6 @@ interface Efl.Gfx.Image_Load_Controller JPEG image. If this flag is $false, then the orientation will be ignored at load time, otherwise the image will be loaded with the proper orientation. - - @since 1.1 ]] set {} get {} @@ -180,6 +176,6 @@ interface Efl.Gfx.Image_Load_Controller } events { load,done: void; [[Called when he image was loaded]] - load,error: Efl.Gfx.Image_Load_Error; [[Called when an error happened during image loading]] + load,error: Eina.Error; [[Called when an error happened during image loading]] } } diff --git a/src/lib/efl/interfaces/efl_gfx_path.eo b/src/lib/efl/interfaces/efl_gfx_path.eo index d60886e499..e370ea5a08 100644 --- a/src/lib/efl/interfaces/efl_gfx_path.eo +++ b/src/lib/efl/interfaces/efl_gfx_path.eo @@ -1,15 +1,13 @@ import eina_types; import efl_gfx_types; -mixin Efl.Gfx.Path +mixin @beta Efl.Gfx.Path { [[EFL graphics path object interface]] methods { @property path { [[Set the list of commands and points to be used to create the content of path. - - @since 1.18 ]] set { } @@ -50,8 +48,6 @@ mixin Efl.Gfx.Path /* FIXME: Return a new object!!! */ copy_from { [[Copy the path data from the object specified. - - @since 1.18 ]] params { @in dup_from: const(Efl.Object); [[Shape object from where data will be copied.]] @@ -59,8 +55,6 @@ mixin Efl.Gfx.Path } bounds_get @const { [[Compute and return the bounding box of the currently set path - - @since 1.18 ]] params { @out r: Eina.Rect; [[Contain the bounding box of the currently set path]] @@ -68,8 +62,6 @@ mixin Efl.Gfx.Path } reset { [[Reset the path data of the path object. - - @since 1.18 ]] } append_move_to { @@ -77,8 +69,6 @@ mixin Efl.Gfx.Path implicitly starting a new subpath and closing the previous one. See also @.append_close. - - @since 1.18 ]] params { @in x: double; [[X co-ordinate of the current point.]] @@ -94,8 +84,6 @@ mixin Efl.Gfx.Path a point. See also @.append_move_to. - - @since 1.18 ]] params { @in x: double; [[X co-ordinate of end point of the line.]] @@ -107,8 +95,6 @@ mixin Efl.Gfx.Path given end point (x,y) using the control points specified by (ctrl_x, ctrl_y). After the path is drawn, the current position is updated to be at the end point of the path. - - @since 1.18 ]] params { @in x: double; [[X co-ordinate of end point of the line.]] @@ -122,8 +108,6 @@ mixin Efl.Gfx.Path that it uses the current control point to draw the bezier. See also @.append_quadratic_to. - - @since 1.18 ]] params { @in x: double; [[X co-ordinate of end point of the line.]] @@ -135,8 +119,6 @@ mixin Efl.Gfx.Path given end point (x,y) using the control points specified by (ctrl_x0, ctrl_y0), and (ctrl_x1, ctrl_y1). After the path is drawn, the current position is updated to be at the end point of the path. - - @since 1.18 ]] params { @in ctrl_x0: double; [[X co-ordinate of 1st control point.]] @@ -152,8 +134,6 @@ mixin Efl.Gfx.Path uses the current control point to draw the bezier. See also @.append_cubic_to. - - @since 1.18 ]] params { @in x: double; [[X co-ordinate of end point of the line.]] @@ -169,8 +149,6 @@ mixin Efl.Gfx.Path Use this api if you know the end point's of the arc otherwise use more convenient function @.append_arc. - - @since 1.18 ]] params { @in x: double; [[X co-ordinate of end point of the arc.]] @@ -189,8 +167,6 @@ mixin Efl.Gfx.Path append_arc { [[Append an arc that enclosed in the given rectangle (x, y, w, h). The angle is defined in counter clock wise , use -ve angle for clockwise arc. - - @since 1.18 ]] params { @in x: double; [[X co-ordinate of the rect.]] @@ -207,14 +183,10 @@ mixin Efl.Gfx.Path new path is (0, 0). If the subpath does not contain any points, this function does nothing. - - @since 1.18 ]] } append_circle { [[Append a circle with given center and radius. - - @since 1.18 ]] params { @in x: double; [[X co-ordinate of the center of the circle.]] @@ -232,8 +204,6 @@ mixin Efl.Gfx.Path If xr and yr are 0, then it will draw a rectangle without rounded corner. - - @since 1.18 ]] params { @in x: double; [[X co-ordinate of the rectangle.]] @@ -284,8 +254,6 @@ mixin Efl.Gfx.Path [[Reserve path commands buffer in advance. If you know the count of path commands coming, you can reserve commands buffer in advance to avoid buffer growing job. - - @since 1.22 ]] params { @in cmd_count: uint; [[Commands count to reserve]] diff --git a/src/lib/efl/interfaces/efl_gfx_shape.eo b/src/lib/efl/interfaces/efl_gfx_shape.eo index 2dfb554e81..321d4057bf 100644 --- a/src/lib/efl/interfaces/efl_gfx_shape.eo +++ b/src/lib/efl/interfaces/efl_gfx_shape.eo @@ -1,14 +1,12 @@ import efl_gfx_types; -mixin Efl.Gfx.Shape extends Efl.Gfx.Path +mixin @beta Efl.Gfx.Shape extends Efl.Gfx.Path { [[EFL graphics shape object interface]] methods { @property stroke_scale { [[The stroke scale to be used for stroking the path. Will be used along with stroke width property. - - @since 1.14 ]] set { } @@ -20,8 +18,6 @@ mixin Efl.Gfx.Shape extends Efl.Gfx.Path } @property stroke_color { [[The color to be used for stroking the path. - - @since 1.14 ]] set { } @@ -36,8 +32,6 @@ mixin Efl.Gfx.Shape extends Efl.Gfx.Path } @property stroke_width { [[The stroke width to be used for stroking the path. - - @since 1.14 ]] set { } @@ -79,8 +73,6 @@ mixin Efl.Gfx.Shape extends Efl.Gfx.Path open subpath. See also @Efl.Gfx.Cap. - - @since 1.14 ]] set { } @@ -96,8 +88,6 @@ mixin Efl.Gfx.Shape extends Efl.Gfx.Path while stroking the path. See also @Efl.Gfx.Join. - - @since 1.14 ]] set { } @@ -110,8 +100,6 @@ mixin Efl.Gfx.Shape extends Efl.Gfx.Path @property fill_rule { [[The fill rule of the given shape object. @Efl.Gfx.Fill_Rule.winding or @Efl.Gfx.Fill_Rule.odd_even. - - @since 1.14 ]] set { } diff --git a/src/lib/efl/interfaces/efl_gfx_size_class.eo b/src/lib/efl/interfaces/efl_gfx_size_class.eo index a3e7fc96b2..b7033e925d 100644 --- a/src/lib/efl/interfaces/efl_gfx_size_class.eo +++ b/src/lib/efl/interfaces/efl_gfx_size_class.eo @@ -1,4 +1,4 @@ -interface Efl.Gfx.Size_Class +interface @beta Efl.Gfx.Size_Class { [[Efl Gfx Size Class interface]] methods { @@ -9,8 +9,7 @@ interface Efl.Gfx.Size_Class This function sets width and height for a size class. This will make all edje parts in the specified object that have the specified size class update their size with given values. - - @since 1.17]] + ]] return: bool; [[$true, on success or $false, on error]] } get { @@ -19,8 +18,7 @@ interface Efl.Gfx.Size_Class This function gets width and height for a size class. These values will only be valid until the size class is changed or the edje object is deleted. - - @since 1.17]] + ]] return: bool; [[$true, on success or $false, on error]] } keys { @@ -40,8 +38,7 @@ interface Efl.Gfx.Size_Class Deleting the size class will revert it to the values defined by @.size_class.set() or the size class defined in the theme file. - - @since 1.17]] + ]] params { @in size_class: string; [[The size class to be deleted.]] } diff --git a/src/lib/efl/interfaces/efl_gfx_stack.eo b/src/lib/efl/interfaces/efl_gfx_stack.eo index c122b48260..ea3ce848ac 100644 --- a/src/lib/efl/interfaces/efl_gfx_stack.eo +++ b/src/lib/efl/interfaces/efl_gfx_stack.eo @@ -3,7 +3,10 @@ const Efl.Gfx.Stack_Layer_Max: short = 32767; [[top-most layer number]] interface Efl.Gfx.Stack { - [[Efl graphics stack interface]] + [[Efl graphics stack interface + + @since 1.22 + ]] event_prefix: efl_gfx_entity; methods { @property layer { @@ -32,7 +35,7 @@ interface Efl.Gfx.Stack } values { l: short; [[The number of the layer to place the object on. - Must be between #EFL_GFX_STACK_LAYER_MIN and #EFL_GFX_STACK_LAYER_MAX.]] + Must be between @Efl.Gfx.Stack_Layer_Min and @Efl.Gfx.Stack_Layer_Max.]] } } @property below { @@ -43,8 +46,8 @@ interface Efl.Gfx.Stack objects on layers below the one $obj is placed at. See also @.layer.get(), @.layer.set() and @.below.get()]] - return: Efl.Gfx.Stack @warn_unused; [[The #Efl_Gfx_Stack directly below $obj, if any, - or $null, if none]] + return: Efl.Gfx.Stack @warn_unused; [[The @Efl.Gfx.Stack object directly below $obj, if any, + or $null, if none.]] } } @property above { @@ -55,8 +58,8 @@ interface Efl.Gfx.Stack objects on layers above the one $obj is placed at. See also @.layer.get(), @.layer.set() and @.below.get()]] - return: Efl.Gfx.Stack @warn_unused; [[The #Efl_Gfx_Stack directly below $obj, if any, - or $null, if none]] + return: Efl.Gfx.Stack @warn_unused; [[The @Efl.Gfx.Stack object directly below $obj, if any, + or $null, if none.]] } } stack_below { @@ -84,13 +87,13 @@ interface Efl.Gfx.Stack @in below: Efl.Gfx.Stack @nonull; [[The object below which to stack]] } } - raise { + raise_to_top { [[Raise $obj to the top of its layer. $obj will, then, be the highest one in the layer it belongs to. Object on other layers won't get touched. - See also @.stack_above(), @.stack_below() and @.lower()]] + See also @.stack_above(), @.stack_below() and @.lower_to_bottom()]] } stack_above { @@ -118,17 +121,17 @@ interface Efl.Gfx.Stack @in above: Efl.Gfx.Stack @nonull; [[The object above which to stack]] } } - lower { + lower_to_bottom { [[Lower $obj to the bottom of its layer. $obj will, then, be the lowest one in the layer it belongs to. Objects on other layers won't get touched. - See also @.stack_above(), @.stack_below() and @.raise() ]] + See also @.stack_above(), @.stack_below() and @.raise_to_top() ]] } } events { - restack: void; [[Object stacking was changed.]] + stacking,changed: void; [[Object stacking was changed.]] } } diff --git a/src/lib/efl/interfaces/efl_gfx_text_class.eo b/src/lib/efl/interfaces/efl_gfx_text_class.eo index bf2c5a1339..0d92f97220 100644 --- a/src/lib/efl/interfaces/efl_gfx_text_class.eo +++ b/src/lib/efl/interfaces/efl_gfx_text_class.eo @@ -1,6 +1,6 @@ import efl_gfx_types; -interface Efl.Gfx.Text_Class +interface @beta Efl.Gfx.Text_Class { [[Efl Gfx Text Class interface]] methods { @@ -34,8 +34,7 @@ interface Efl.Gfx.Text_Class Deleting the text class will revert it to the values defined by @.text_class.set() or the text class defined in the theme file. - - @since 1.17]] + ]] params { @in text_class: string; [[The text class to be deleted.]] } diff --git a/src/lib/efl/interfaces/efl_gfx_types.eot b/src/lib/efl/interfaces/efl_gfx_types.eot index 9af1daf273..61a832a7b8 100644 --- a/src/lib/efl/interfaces/efl_gfx_types.eot +++ b/src/lib/efl/interfaces/efl_gfx_types.eot @@ -1,6 +1,6 @@ import eina_types; -enum Efl.Gfx.Colorspace { +enum @beta Efl.Gfx.Colorspace { [[Graphics colorspace type]] argb8888, [[ARGB 32 bits per pixel, high-byte is Alpha, accessed one 32bit word at a time.]] ycbcr422p601_pl, [[YCbCr 4:2:2 Planar, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows.]] @@ -78,7 +78,7 @@ enum Efl.Gfx.Gradient_Spread last [[Sentinel value to indicate last enum field during iteration]] } -enum Efl.Gfx.Fill_Rule +enum @beta Efl.Gfx.Fill_Rule { [[Type defining how an image content get filled. @since 1.14 @@ -109,7 +109,7 @@ struct Efl.Gfx.Gradient_Stop a: int; [[The component A color of the gradient stop]] } -struct Efl.Gfx.Stroke_Color +struct @beta Efl.Gfx.Stroke_Color { [[Internal structure for @Efl.Gfx.Stroke.]] r: int; [[The component R color of the stroke]] @@ -118,7 +118,7 @@ struct Efl.Gfx.Stroke_Color a: int; [[The component A color of the stroke]] } -struct Efl.Gfx.Stroke +struct @beta Efl.Gfx.Stroke { [[Type defining stroke information. Describes the properties to define the path stroke. @@ -134,13 +134,13 @@ struct Efl.Gfx.Stroke join: Efl.Gfx.Join; [[Stroke join]] } -struct Efl.Gfx.Shape_Public +struct @beta Efl.Gfx.Shape_Public { [[Public shape]] stroke: Efl.Gfx.Stroke; [[Internal representation as stroke]] } -enum Efl.Gfx.Border_Fill_Mode +enum @beta Efl.Gfx.Border_Fill_Mode { [[How an image's center region (the complement to the border region) should be rendered by EFL]] none = 0, [[Image's center region is $not to be rendered]] @@ -169,11 +169,11 @@ struct Efl.Gfx.Event.Render_Post updated in the canvas.]] } -enum Efl.Gfx.Size_Hint_Aspect +enum Efl.Gfx.Hint_Aspect { [[Aspect types/policies for scaling size hints. - See also @Efl.Gfx.Size_Hint.hint_aspect. + See also @Efl.Gfx.Hint.hint_aspect. ]] none = 0, [[No preference on either direction of the container @@ -188,27 +188,23 @@ enum Efl.Gfx.Size_Hint_Aspect aspect.]] } -enum Efl.Gfx.Image_Load_Error -{ - [[Image or Edje load error type]] - none = 0, [[No error on load]] - generic = 1, [[A non-specific error occurred]] - does_not_exist = 2, [[File (or file path) does not exist]] - permission_denied = 3, [[Permission denied to an existing file (or path)]] - resource_allocation_failed = 4, [[Allocation of resources failure prevented load]] - corrupt_file = 5, [[File corrupt (but was detected as a known format)]] - unknown_format = 6, [[File is not a known format]] - cancelled = 7, [[Reading operation has been cancelled during decoding]] - incompatible_file = 8, [[(Edje only) The file pointed to is incompatible, i.e., it doesn't match the library's current version's format.]] - unknown_collection = 9, [[(Edje only) The group/collection set to load from was not found in the file]] - 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 @beta Efl.Gfx.Color_Class_Layer { [[Efl Gfx Color Class layer enum]] normal = 0, [[Default color]] outline, [[Outline color]] shadow [[Shadow color]] } -type Efl.Font.Size: int; [[Efl font size type]] +type @beta Efl.Font.Size: int; [[Efl font size type]] + +var @beta Efl.Gfx.Image.Load_Error.NONE: Eina.Error; [[No error on load]] +var @beta Efl.Gfx.Image.Load_Error.GENERIC: Eina.Error; [[A non-specific error occurred]] +var @beta Efl.Gfx.Image.Load_Error.DOES_NOT_EXIST: Eina.Error; [[File (or file path) does not exist]] +var @beta Efl.Gfx.Image.Load_Error.PERMISSION_DENIED: Eina.Error; [[Permission denied to an existing file (or path)]] +var @beta Efl.Gfx.Image.Load_Error.RESOURCE_ALLOCATION_FAILED: Eina.Error; [[Allocation of resources failure prevented load]] +var @beta Efl.Gfx.Image.Load_Error.CORRUPT_FILE: Eina.Error; [[File corrupt (but was detected as a known format)]] +var @beta Efl.Gfx.Image.Load_Error.UNKNOWN_FORMAT: Eina.Error; [[File is not a known format]] +var @beta Efl.Gfx.Image.Load_Error.CANCELLED: Eina.Error; [[Reading operation has been cancelled during decoding]] +var @beta Efl.Gfx.Image.Load_Error.INCOMPATIBLE_FILE: Eina.Error; [[(Edje only) The file pointed to is incompatible, i.e., it doesn't match the library's current version's format.]] +var @beta Efl.Gfx.Image.Load_Error.UNKNOWN_COLLECTION: Eina.Error; [[(Edje only) The group/collection set to load from was not found in the file]] +var @beta Efl.Gfx.Image.Load_Error.RECURSIVE_REFERENCE: Eina.Error; [[(Edje only) The group/collection set to load from had recursive references on its components]] diff --git a/src/lib/efl/interfaces/efl_gfx_view.eo b/src/lib/efl/interfaces/efl_gfx_view.eo index 233175c6a2..f18d0dc52a 100644 --- a/src/lib/efl/interfaces/efl_gfx_view.eo +++ b/src/lib/efl/interfaces/efl_gfx_view.eo @@ -1,6 +1,6 @@ import eina_types; -interface Efl.Gfx.View +interface @beta Efl.Gfx.View { [[Efl graphics view interface]] eo_prefix: efl_gfx; diff --git a/src/lib/efl/interfaces/efl_input_device.eo b/src/lib/efl/interfaces/efl_input_device.eo index 91a0760bb5..28ec10eb5d 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 @beta Efl.Input.Device_Type { [[General type of input device. @@ -19,11 +19,9 @@ enum Efl.Input.Device_Type @property canvas { values { canvas: Efl.Canvas; } } */ -class Efl.Input.Device extends Efl.Object +class @beta Efl.Input.Device extends Efl.Object { [[Represents a pointing device such as a touch finger, pen or mouse. - - @since 1.18 ]] methods { @property device_type { @@ -56,8 +54,6 @@ class Efl.Input.Device extends Efl.Object } @property seat_id { [[Seat id number - - @since 1.20 ]] values { id: uint; [[The id of the seat]] @@ -68,8 +64,6 @@ class Efl.Input.Device extends Efl.Object This is only meaningful with seat devices, as they are groups of real input devices. - - @since 1.20 ]] return: iterator @owned; [[List of device children]] } @@ -79,8 +73,6 @@ class Efl.Input.Device extends Efl.Object Returns 1 for Mouse, Touch, Pen, Pointer, and Wand type devices. If a seat device is passed returns the number of pointer devices in the seat. - - @since 1.20 ]] return: uint; [[Pointer caps]] } diff --git a/src/lib/efl/interfaces/efl_input_types.eot b/src/lib/efl/interfaces/efl_input_types.eot index a06f6044f7..eb5f8edeb7 100644 --- a/src/lib/efl/interfaces/efl_input_types.eot +++ b/src/lib/efl/interfaces/efl_input_types.eot @@ -1,4 +1,4 @@ -enum Efl.Pointer.Action +enum @beta Efl.Pointer.Action { [[Pointer event type. Represents which kind of event this is. @@ -18,7 +18,7 @@ enum Efl.Pointer.Action axis, [[Axis event (pen, stick, ...).]] } -enum Efl.Pointer.Flags +enum @beta Efl.Pointer.Flags { [[Pointer flags indicating whether a double or triple click is under way. @@ -29,7 +29,7 @@ enum Efl.Pointer.Flags triple_click = (1 << 1), [[This mouse button press was the 3rd press of a triple click]] } -enum Efl.Input.Flags +enum @beta Efl.Input.Flags { [[Special flags set during an input event propagation. @@ -48,7 +48,7 @@ enum Efl.Input.Flags actually perform anything.]] } -enum Efl.Input.Object_Pointer_Mode { +enum @beta Efl.Input.Object_Pointer_Mode { [[How the mouse pointer should be handled by EFL. In the mode $autograb, when a mouse button is pressed down over an @@ -74,7 +74,7 @@ enum Efl.Input.Object_Pointer_Mode { ]] } -enum Efl.Input.Value { +enum @beta Efl.Input.Value { [[Keys for the generic values of all events. @since 1.19 diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c index d1f9b80394..279bf153c4 100644 --- a/src/lib/efl/interfaces/efl_interfaces_main.c +++ b/src/lib/efl/interfaces/efl_interfaces_main.c @@ -2,9 +2,7 @@ # include #endif -#define EFL_CANVAS_SCENE_BETA #define EFL_UI_SCROLLBAR_PROTECTED -#define EFL_UI_SCROLLBAR_BETA #define EFL_PART_PROTECTED #include "eo_internal.h" @@ -15,7 +13,7 @@ #include "interfaces/efl_control.eo.c" #include "interfaces/efl_duplicate.eo.c" #include "interfaces/efl_gfx_image.eo.c" -#include "interfaces/efl_gfx_image_animation_controller.eo.c" +#include "interfaces/efl_gfx_frame_controller.eo.c" #include "interfaces/efl_gfx_image_load_controller.eo.c" #include "interfaces/efl_part.eo.c" #include "interfaces/efl_playable.eo.c" @@ -27,6 +25,7 @@ #include "interfaces/efl_text_cursor.eo.c" #include "interfaces/efl_text_annotate.eo.c" #include "interfaces/efl_text_markup.eo.c" +#include "interfaces/efl_text_markup_interactive.eo.c" #include "interfaces/efl_gfx_entity.eo.c" #include "interfaces/efl_gfx_buffer.eo.c" @@ -34,7 +33,6 @@ #include "interfaces/efl_gfx_fill.eo.c" #include "interfaces/efl_gfx_view.eo.c" -#include "interfaces/efl_gfx_color_class.eo.c" #include "interfaces/efl_gfx_text_class.eo.c" #include "interfaces/efl_gfx_size_class.eo.c" @@ -45,7 +43,7 @@ #include "interfaces/efl_gfx_filter.eo.c" #include "interfaces/efl_gfx_blur.eo.c" -#include "interfaces/efl_gfx_size_hint.eo.c" +#include "interfaces/efl_gfx_hint.eo.c" #include "interfaces/efl_canvas_scene.eo.c" #include "interfaces/efl_canvas_pointer.eo.c" @@ -60,17 +58,18 @@ #include "interfaces/efl_pack_table.eo.c" #include "interfaces/efl_model.eo.c" -#include "interfaces/efl_animator.eo.c" #include "interfaces/efl_interpolator.eo.c" #include "interfaces/efl_orientation.eo.c" #include "interfaces/efl_ui_i18n.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_range_display.eo.c" +#include "interfaces/efl_ui_range_interactive.eo.c" #include "interfaces/efl_ui_autorepeat.eo.c" #include "interfaces/efl_ui_view.eo.c" -#include "interfaces/efl_ui_model_connect.eo.c" +#include "interfaces/efl_ui_property_bind.eo.c" #include "interfaces/efl_ui_factory.eo.c" +#include "interfaces/efl_ui_factory_bind.eo.c" #include "interfaces/efl_ui_draggable.eo.c" #include "interfaces/efl_ui_clickable.eo.c" diff --git a/src/lib/efl/interfaces/efl_interpolator.eo b/src/lib/efl/interfaces/efl_interpolator.eo index 870582ab6f..ba01e742d2 100644 --- a/src/lib/efl/interfaces/efl_interpolator.eo +++ b/src/lib/efl/interfaces/efl_interpolator.eo @@ -1,4 +1,4 @@ -interface Efl.Interpolator +interface @beta Efl.Interpolator { [[Efl interpolator interface]] methods { diff --git a/src/lib/efl/interfaces/efl_io_buffer.c b/src/lib/efl/interfaces/efl_io_buffer.c index c0c505e6b8..2c0e5957ef 100644 --- a/src/lib/efl/interfaces/efl_io_buffer.c +++ b/src/lib/efl/interfaces/efl_io_buffer.c @@ -232,7 +232,7 @@ _efl_io_buffer_efl_io_reader_can_read_set(Eo *o, Efl_Io_Buffer_Data *pd, Eina_Bo EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o)); if (pd->can_read == can_read) return; pd->can_read = can_read; - efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, &can_read); } EOLIAN static Eina_Bool @@ -322,7 +322,7 @@ _efl_io_buffer_efl_io_writer_can_write_set(Eo *o, Efl_Io_Buffer_Data *pd, Eina_B EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o)); if (pd->can_write == can_write) return; pd->can_write = can_write; - efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, &can_write); } EOLIAN static Eina_Error diff --git a/src/lib/efl/interfaces/efl_io_buffer.eo b/src/lib/efl/interfaces/efl_io_buffer.eo index 230c2aa061..7cad411cd9 100644 --- a/src/lib/efl/interfaces/efl_io_buffer.eo +++ b/src/lib/efl/interfaces/efl_io_buffer.eo @@ -1,4 +1,4 @@ -class Efl.Io.Buffer extends Efl.Object implements Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer, Efl.Io.Sizer, Efl.Io.Positioner { +class @beta Efl.Io.Buffer extends Efl.Object implements Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer, Efl.Io.Sizer, Efl.Io.Positioner { [[Generic In-memory buffer of data to be used as I/O. This class offers both input and output, which can be used at @@ -10,8 +10,6 @@ class Efl.Io.Buffer extends Efl.Object implements Efl.Io.Reader, Efl.Io.Writer, A fixed sized buffer can be implemented by setting @.limit followed by @.preallocate - - @since 1.19 ]] methods { diff --git a/src/lib/efl/interfaces/efl_io_closer.eo b/src/lib/efl/interfaces/efl_io_closer.eo index 2ba4323085..91e35eb75d 100644 --- a/src/lib/efl/interfaces/efl_io_closer.eo +++ b/src/lib/efl/interfaces/efl_io_closer.eo @@ -9,7 +9,7 @@ interface Efl.Io.Closer { Calls to @.close() may or may not block, that's not up to this interface to specify. - @since 1.19 + @since 1.22 ]] methods { diff --git a/src/lib/efl/interfaces/efl_io_positioner.eo b/src/lib/efl/interfaces/efl_io_positioner.eo index 4b4033c670..28d6f8e754 100644 --- a/src/lib/efl/interfaces/efl_io_positioner.eo +++ b/src/lib/efl/interfaces/efl_io_positioner.eo @@ -1,16 +1,14 @@ import eina_types; -enum Efl.Io.Positioner_Whence { +enum @beta Efl.Io.Positioner_Whence { [[Seek position modes]] start, [[Seek from start of the stream/file]] current, [[Seek from current position]] end, [[Seek from the end of stream/file]] } -mixin Efl.Io.Positioner { +mixin @beta Efl.Io.Positioner { [[Generic interface for objects that can change or report position. - - @since 1.19 ]] data: null; diff --git a/src/lib/efl/interfaces/efl_io_queue.c b/src/lib/efl/interfaces/efl_io_queue.c index 20f3e951ef..3d570d82b0 100644 --- a/src/lib/efl/interfaces/efl_io_queue.c +++ b/src/lib/efl/interfaces/efl_io_queue.c @@ -346,7 +346,7 @@ _efl_io_queue_efl_io_reader_can_read_set(Eo *o, Efl_Io_Queue_Data *pd, Eina_Bool EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o)); if (pd->can_read == can_read) return; pd->can_read = can_read; - efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, &can_read); } EOLIAN static Eina_Bool @@ -448,7 +448,7 @@ _efl_io_queue_efl_io_writer_can_write_set(Eo *o, Efl_Io_Queue_Data *pd, Eina_Boo EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o)); if (pd->can_write == can_write) return; pd->can_write = can_write; - efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL); + efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, &can_write); } EOLIAN static Eina_Error diff --git a/src/lib/efl/interfaces/efl_io_queue.eo b/src/lib/efl/interfaces/efl_io_queue.eo index c8c6f1e46c..75011d87d2 100644 --- a/src/lib/efl/interfaces/efl_io_queue.eo +++ b/src/lib/efl/interfaces/efl_io_queue.eo @@ -1,4 +1,4 @@ -class Efl.Io.Queue extends Efl.Object implements Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer { +class @beta Efl.Io.Queue extends Efl.Object implements Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer { [[Generic In-memory queue of data to be used as I/O. This class is to be used to receive temporary data using @@ -7,8 +7,6 @@ class Efl.Io.Queue extends Efl.Object implements Efl.Io.Reader, Efl.Io.Writer, E A fixed sized queue can be implemented by setting @.limit followed by @.preallocate - - @since 1.19 ]] methods { diff --git a/src/lib/efl/interfaces/efl_io_reader.eo b/src/lib/efl/interfaces/efl_io_reader.eo index ccb3efe90f..873b11eda6 100644 --- a/src/lib/efl/interfaces/efl_io_reader.eo +++ b/src/lib/efl/interfaces/efl_io_reader.eo @@ -12,7 +12,7 @@ interface Efl.Io.Reader { "can_read,changed" or property @.can_read to known whenever a read would have data to return. - @since 1.19 + @since 1.22 ]] methods { @@ -55,7 +55,7 @@ interface Efl.Io.Reader { } events { - can_read,changed: void; [[Notifies can_read property changed. + can_read,changed: bool; [[Notifies can_read property changed. If @.can_read is $true there is data to @.read without blocking/error. If diff --git a/src/lib/efl/interfaces/efl_io_sizer.eo b/src/lib/efl/interfaces/efl_io_sizer.eo index a91cf665a1..765784e15c 100644 --- a/src/lib/efl/interfaces/efl_io_sizer.eo +++ b/src/lib/efl/interfaces/efl_io_sizer.eo @@ -1,12 +1,10 @@ import eina_types; -mixin Efl.Io.Sizer { +mixin @beta Efl.Io.Sizer { [[Generic interface for objects that can resize or report size of themselves. This interface allows external objects to transparently resize or report its size. - - @since 1.19 ]] data: null; diff --git a/src/lib/efl/interfaces/efl_io_writer.eo b/src/lib/efl/interfaces/efl_io_writer.eo index 7e109cf372..bfff7242b9 100644 --- a/src/lib/efl/interfaces/efl_io_writer.eo +++ b/src/lib/efl/interfaces/efl_io_writer.eo @@ -12,7 +12,7 @@ interface Efl.Io.Writer { "can_write,changed" or property @.can_write to known whenever a write could push more data. - @since 1.19 + @since 1.22 ]] methods { @@ -47,7 +47,7 @@ interface Efl.Io.Writer { } events { - can_write,changed: void; [[Notifies can_write property changed. + can_write,changed: bool; [[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 72de91d809..981158f9be 100644 --- a/src/lib/efl/interfaces/efl_model.eo +++ b/src/lib/efl/interfaces/efl_model.eo @@ -1,10 +1,10 @@ -struct Efl.Model_Property_Event { +struct @beta Efl.Model_Property_Event { [[EFL model property event data structure]] - changed_properties: array; [[List of changed properties]] - invalidated_properties: array; [[Removed properties identified by name]] + changed_properties: array; [[List of changed properties]] + invalidated_properties: array; [[Removed properties identified by name]] } -struct Efl.Model_Children_Event { +struct @beta Efl.Model_Children_Event { [[Every time a child is added the event @[Efl.Model.child,added] is dispatched passing along this structure.]] index: uint; [[index is a hint and is intended to provide a way for applications @@ -13,7 +13,7 @@ struct Efl.Model_Children_Event { the parent, it will be available here.]] } -interface Efl.Model +interface @beta Efl.Model { [[Efl model interface]] eo_prefix: efl_model; @@ -28,8 +28,6 @@ interface Efl.Model listeners of any modifications in the properties. See also @[Efl.Model.properties,changed]. - - @since 1.14 ]] } values { @@ -52,8 +50,6 @@ interface Efl.Model property in model See @.property.get, @[Efl.Model.properties,changed] - - @since 1.14 ]] return: future; [[Return an error in case the property could not be set, the value that was set otherwise.]] } @@ -65,8 +61,6 @@ interface Efl.Model notify listeners of the property/value. See @.properties.get, @[Efl.Model.properties,changed] - - @since 1.14 ]] } keys { @@ -117,7 +111,9 @@ interface Efl.Model See @.children_count.get - @since 1.14 + Note: The returned children will live only as long as the future + itself. Once the future is done, if you want to keep the object + alive, you need to take a reference for yourself. ]] params { @in start: uint; [[Range begin - start from here.]] @@ -138,8 +134,6 @@ interface Efl.Model emitted when count is finished. See also @.children_slice_get. - - @since 1.14 ]] } values { @@ -153,8 +147,6 @@ interface Efl.Model of a internal keeping. When the child is effectively added the event @[Efl.Model.child,added] is then raised and the new child is kept along with other children. - - @since 1.14 ]] return: Efl.Object; [[Child object]] } @@ -165,8 +157,6 @@ interface Efl.Model removed the event @[Efl.Model.child,removed] is then raised to give a chance for listeners to perform any cleanup and/or update references. - - @since 1.14 ]] params { @in child: Efl.Object; [[Child to be removed]] diff --git a/src/lib/efl/interfaces/efl_mvvm_common.c b/src/lib/efl/interfaces/efl_mvvm_common.c index 2c95c76eaa..a2c7fa4f8d 100644 --- a/src/lib/efl/interfaces/efl_mvvm_common.c +++ b/src/lib/efl/interfaces/efl_mvvm_common.c @@ -15,6 +15,7 @@ EAPI Eina_Error EFL_MODEL_ERROR_INCORRECT_VALUE = 0; EAPI Eina_Error EFL_MODEL_ERROR_INVALID_OBJECT = 0; EAPI Eina_Error EFL_FACTORY_ERROR_NOT_SUPPORTED = 0; +EAPI Eina_Error EFL_PROPERTY_ERROR_INVALID_KEY = 0; static const char EFL_MODEL_ERROR_UNKNOWN_STR[] = "Unknown Error"; static const char EFL_MODEL_ERROR_NOT_SUPPORTED_STR[] = "Operation not supported"; @@ -27,6 +28,9 @@ static const char EFL_MODEL_ERROR_INVALID_OBJECT_STR[] = "Object is invalid"; static const char EFL_FACTORY_ERROR_NOT_SUPPORTED_STR[] = "Operation not supported"; +static const char EFL_PROPERTY_ERROR_INVALID_KEY_STR[] = "Incorrect key provided"; + + EAPI int efl_model_init(void) { @@ -44,6 +48,10 @@ efl_model_init(void) #define _ERROR(Name) EFL_FACTORY_ERROR_##Name = eina_error_msg_static_register(EFL_FACTORY_ERROR_##Name##_STR); _ERROR(NOT_SUPPORTED); +#undef _ERROR +#define _ERROR(Name) EFL_PROPERTY_ERROR_##Name = eina_error_msg_static_register(EFL_PROPERTY_ERROR_##Name##_STR); + _ERROR(INVALID_KEY); + return EINA_TRUE; } @@ -54,6 +62,7 @@ _efl_model_properties_changed_internal(const Efl_Model *model, ...) { Efl_Model_Property_Event ev = { 0 }; Eina_Array *properties = eina_array_new(1); + Eina_Stringshare *sp; const char *property; va_list args; @@ -61,7 +70,7 @@ _efl_model_properties_changed_internal(const Efl_Model *model, ...) while ((property = (const char*) va_arg(args, const char*))) { - eina_array_push(properties, property); + eina_array_push(properties, eina_stringshare_add(property)); } va_end(args); @@ -70,6 +79,8 @@ _efl_model_properties_changed_internal(const Efl_Model *model, ...) efl_event_callback_call((Efl_Model *) model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, &ev); + while ((sp = eina_array_pop(properties))) + eina_stringshare_del(sp); eina_array_free(properties); } @@ -79,13 +90,16 @@ efl_model_property_invalidated_notify(Efl_Model *model, const char *property) Eina_Array *invalidated_properties = eina_array_new(1); EINA_SAFETY_ON_NULL_RETURN(invalidated_properties); - Eina_Bool ret = eina_array_push(invalidated_properties, property); + Eina_Stringshare *sp = eina_stringshare_add(property); + + Eina_Bool ret = eina_array_push(invalidated_properties, sp); EINA_SAFETY_ON_FALSE_GOTO(ret, on_error); Efl_Model_Property_Event evt = {.invalidated_properties = invalidated_properties}; efl_event_callback_call(model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, &evt); on_error: + eina_stringshare_del(sp); eina_array_free(invalidated_properties); } diff --git a/src/lib/efl/interfaces/efl_observable.eo b/src/lib/efl/interfaces/efl_observable.eo index 4055217c51..babfe21c59 100644 --- a/src/lib/efl/interfaces/efl_observable.eo +++ b/src/lib/efl/interfaces/efl_observable.eo @@ -1,6 +1,13 @@ import efl_types; -class Efl.Observable extends Efl.Object { +struct @beta @free(efl_observable_tuple_free) Efl.Observable_Tuple +{ + [[This type describes an observable touple]] + key: string; [[Touple key]] + data: iterator @owned; [[Touple data]] +} + +class @beta Efl.Observable extends Efl.Object { [[Efl observable class]] methods { observer_add { @@ -8,8 +15,7 @@ class Efl.Observable extends Efl.Object { Note: Observers that observe this observable are grouped by the $key and an observer can belong to multiple groups at the same time. - - @since 1.19]] + ]] params { @in key: string; [[A key to classify observer groups]] @in obs: Efl.Observer; [[An observer object]] @@ -19,8 +25,7 @@ class Efl.Observable extends Efl.Object { [[Delete an observer from a group of observers. See also @.observer_add(). - - @since 1.19]] + ]] params { @in key: string; [[A key to classify observer groups]] @in obs: Efl.Observer; [[An observer object]] @@ -28,16 +33,14 @@ class Efl.Observable extends Efl.Object { } observer_clean { [[Clear an observer from all groups of observers. - - @since 1.19]] + ]] params { @in obs: Efl.Observer; [[An observer object]] } } observers_iterator_new { [[Return a new iterator associated with a group of observers. - - @since 1.19]] + ]] return: iterator @owned; [[Iterator for observers group]] params { @in key: string; [[A key to classify observer groups]] @@ -45,8 +48,7 @@ class Efl.Observable extends Efl.Object { } observers_update { [[Update all observers in a group by calling their update() method. - - @since 1.19]] + ]] params { @in key: string; [[A key to classify observer groups]] @in data: void_ptr; [[Required data to update observer]] @@ -54,8 +56,7 @@ class Efl.Observable extends Efl.Object { } iterator_tuple_new { [[Return a new iterator associated to this observable. - - @since 1.19]] + ]] return: iterator @owned; [[Iterator for observer]] } } diff --git a/src/lib/efl/interfaces/efl_observer.c b/src/lib/efl/interfaces/efl_observer.c index c7efc30b2c..8656b801b9 100644 --- a/src/lib/efl/interfaces/efl_observer.c +++ b/src/lib/efl/interfaces/efl_observer.c @@ -257,5 +257,12 @@ _efl_observable_iterator_tuple_new(Eo *obj, Efl_Observable_Data *pd) return &it->iterator; } +EAPI void +efl_observable_tuple_free(Efl_Observable_Tuple *tuple) +{ + //key is not owned + eina_iterator_free(tuple->data); +} + #include "interfaces/efl_observable.eo.c" #include "interfaces/efl_observer.eo.c" diff --git a/src/lib/efl/interfaces/efl_observer.eo b/src/lib/efl/interfaces/efl_observer.eo index 38764f843d..f1477807dd 100644 --- a/src/lib/efl/interfaces/efl_observer.eo +++ b/src/lib/efl/interfaces/efl_observer.eo @@ -1,10 +1,9 @@ -interface Efl.Observer { +interface @beta Efl.Observer { [[Efl observer interface]] methods { update { [[Update observer according to the changes of observable object. - - @since 1.19]] + ]] params { /* FIXME: obs should be Efl.Observable, but cyclic dependency error occurs. */ @in obs: Efl.Object; [[An observable object]] diff --git a/src/lib/efl/interfaces/efl_orientation.eo b/src/lib/efl/interfaces/efl_orientation.eo index 4f83c25c97..e874dcfdb7 100644 --- a/src/lib/efl/interfaces/efl_orientation.eo +++ b/src/lib/efl/interfaces/efl_orientation.eo @@ -1,6 +1,6 @@ parse efl_ui_direction; -enum Efl.Orient +enum @beta Efl.Orient { [[An orientation type, to rotate visual objects. @@ -17,7 +17,7 @@ enum Efl.Orient left = 270, [[Orient left, rotate 90 degrees clock-wise.]] } -enum Efl.Flip +enum @beta Efl.Flip { [[A flip type, to flip visual objects. @@ -28,7 +28,7 @@ enum Efl.Flip vertical = 2 [[Flip image vertically]] } -interface Efl.Orientation +interface @beta Efl.Orientation { [[Efl orientation interface]] methods { diff --git a/src/lib/efl/interfaces/efl_pack.eo b/src/lib/efl/interfaces/efl_pack.eo index 0b8f1d670f..624a0004fe 100644 --- a/src/lib/efl/interfaces/efl_pack.eo +++ b/src/lib/efl/interfaces/efl_pack.eo @@ -1,4 +1,4 @@ -interface Efl.Pack extends Efl.Container +interface @beta Efl.Pack extends Efl.Container { [[API common to all UI container objects.]] methods @@ -57,7 +57,4 @@ interface Efl.Pack extends Efl.Container } } } - events { - 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 cdc593b031..19bda9a6b8 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 @beta Efl.Pack_Layout { [[Low-level APIs for object that can lay their children out. @@ -17,10 +17,13 @@ interface Efl.Pack_Layout [[Implementation of this container's layout algorithm. EFL will call this function whenever the contents of this - container need to be re-layed out on the canvas. + container need to be re-laid out on the canvas. - This can be overriden to implement custom layout behaviours. + This can be overriden to implement custom layout behaviors. ]] } } + events { + layout,updated: void; [[Sent after the layout was updated.]] + } } diff --git a/src/lib/efl/interfaces/efl_pack_linear.eo b/src/lib/efl/interfaces/efl_pack_linear.eo index 5829c73d27..b82cee842f 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 extends Efl.Pack +interface @beta Efl.Pack_Linear extends Efl.Pack { [[API for containers ]] eo_prefix: efl_pack; @@ -13,12 +13,12 @@ interface Efl.Pack_Linear extends Efl.Pack container without deleting it. ]] params { - @in subobj: Efl.Gfx.Entity; [[Item to pack.]] + @in subobj: Efl.Gfx.Entity; [[Item to pack at the beginning.]] } - return: bool; [[$false if $subobj could not be packed]] + return: bool; [[$false if $subobj could not be packed.]] } pack_end { - [[Append object at the end of this container. + [[Append item at the end of this container. This is the same as @.pack_at($subobj, -1). @@ -29,7 +29,7 @@ interface Efl.Pack_Linear extends Efl.Pack params { @in subobj: Efl.Gfx.Entity; [[Item to pack at the end.]] } - return: bool; [[$false if $subobj could not be packed]] + return: bool; [[$false if $subobj could not be packed.]] } pack_before { [[Prepend item before other sub object. @@ -60,46 +60,72 @@ interface Efl.Pack_Linear extends Efl.Pack could not be packed.]] } pack_at { - [[Inserts $subobj at the specified $index. + [[Inserts $subobj BEFORE the item at position $index. - Valid range: -$count to +$count. -1 refers to the last element. - Out of range indices will trigger an append. + $index ranges from -$count to $count-1, where positive numbers go + from first item (0) to last item ($count-1), and negative numbers go + from last item (-1) to first item (-$count). Where $count is + the number of items currently in the container. + + If $index is less than -$count, it will trigger @.pack_begin($subobj) + whereas $index greater than $count-1 will trigger @.pack_end($subobj). When this container is deleted, it will request deletion of the given $subobj. Use @Efl.Pack.unpack to remove $subobj from this container without deleting it. ]] params { - @in subobj: Efl.Gfx.Entity; [[Item to pack at given index.]] - @in index: int; [[A position.]] + @in subobj: Efl.Gfx.Entity; [[Item to pack.]] + @in index: int; [[Index of item to insert BEFORE. + Valid range is -$count to ($count-1). + ]] } return: bool; [[$false if $subobj could not be packed.]] } pack_content_get { - [[Content at a given index in this container. + [[Content at a given $index in this container. - Index -1 refers to the last item. The valid range is -(count - 1) to - (count - 1). + $index ranges from -$count to $count-1, where positive numbers go + from first item (0) to last item ($count-1), and negative numbers go + from last item (-1) to first item (-$count). Where $count is + the number of items currently in the container. + + If $index is less than -$count, it will return the first item + whereas $index greater than $count-1 will return the last item. ]] params { - index: int; [[Index number]] + @in index: int; [[Index of the item to retrieve. + Valid range is -$count to ($count-1). + ]] } 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.Entity); [[An object contained in this pack.]] + @in 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.]] + return: int(-1); [[-1 in case $subobj is not a child of this object, + or the index of this item in the range 0 to ($count-1). + ]] } pack_unpack_at { - [[Pop out item at specified $index. + [[Pop out (remove) the item at the specified $index. - Equivalent to unpack(content_at($index)). + $index ranges from -$count to $count-1, where positive numbers go + from first item (0) to last item ($count-1), and negative numbers go + from last item (-1) to first item (-$count). Where $count is + the number of items currently in the container. + + If $index is less than -$count, it will remove the first item + whereas $index greater than $count-1 will remove the last item. + + Equivalent to @Efl.Pack.unpack(@.pack_content_get($index)). ]] params { - index: int; [[Index number]] + @in index: int; [[Index of item to remove. + Valid range is -$count to ($count-1). + ]] } 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 6b0bfd8b6e..9472b52ed4 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_ui_direction; -interface Efl.Pack_Table extends Efl.Pack_Linear +interface @beta Efl.Pack_Table extends Efl.Pack { [[2D containers aligned on a table with rows and columns]] eo_prefix: efl_pack; diff --git a/src/lib/efl/interfaces/efl_part.eo b/src/lib/efl/interfaces/efl_part.eo index 1f37e7e4ab..f282983cd6 100644 --- a/src/lib/efl/interfaces/efl_part.eo +++ b/src/lib/efl/interfaces/efl_part.eo @@ -33,6 +33,8 @@ interface Efl.Part func2(part, args) func3(part, args) unref(part) + + @since 1.22 ]] methods { part_get @protected @const { diff --git a/src/lib/efl/interfaces/efl_playable.eo b/src/lib/efl/interfaces/efl_playable.eo index 56dbc9e51b..69df4235d9 100644 --- a/src/lib/efl/interfaces/efl_playable.eo +++ b/src/lib/efl/interfaces/efl_playable.eo @@ -1,4 +1,4 @@ -interface Efl.Playable +interface @beta Efl.Playable { [[Efl media playable interface]] methods { diff --git a/src/lib/efl/interfaces/efl_player.eo b/src/lib/efl/interfaces/efl_player.eo index 0353b36752..5c3a32c6d7 100644 --- a/src/lib/efl/interfaces/efl_player.eo +++ b/src/lib/efl/interfaces/efl_player.eo @@ -1,4 +1,4 @@ -interface Efl.Player +interface @beta Efl.Player { [[Efl media player interface]] methods { diff --git a/src/lib/efl/interfaces/efl_screen.eo b/src/lib/efl/interfaces/efl_screen.eo index ee58232781..5fd9adef6e 100644 --- a/src/lib/efl/interfaces/efl_screen.eo +++ b/src/lib/efl/interfaces/efl_screen.eo @@ -2,18 +2,47 @@ import eina_types; interface Efl.Screen { - [[Efl screen interface]] - methods { - @property screen_size { - get { - [[Get screen geometry details for the screen that a window is on. + [[Efl screen interface - Note that on some display systems this information is not - available (this could be the case Wayland for instance). + @since 1.22 + ]] + methods { + @property screen_size_in_pixels { + get { + [[Get screen size (in pixels) for the screen. + + Note that on some display systems this information is not available and + a value of 0x0 will be returned. ]] } values { - size: Eina.Size2D; [[The screen size.]] + size: Eina.Size2D; [[The screen size in pixels.]] + } + } +// @property screen_size_in_mm { +// get { +// [[Get screen geometry (in millimeters) for the screen. +// +// Note that on some display systems this information is not available and +// a value of 0x0 will be returned. +// ]] +// } +// values { +// size: Eina.Size2D; [[The screen size in millimeters.]] +// } +// } + @property screen_scale_factor { + get { + [[Get screen scaling factor. + + This is the factor by which window contents will be scaled on the screen. + + Note that on some display systems this information is not available and a + value of 1.0 will be returned. + ]] + } + values { + size: float; [[The screen scaling factor.]] } } @property screen_rotation { @@ -21,23 +50,20 @@ interface Efl.Screen [[Get the rotation of the screen. Most engines only return multiples of 90. - @since 1.19 ]] } values { - rotation: int; [[The degree of the screen.]] + rotation: int; [[Screen rotation in degrees.]] } } @property screen_dpi { get { - [[Get screen dpi for the screen that a window is on. - - @since 1.7 + [[Get the pixel density in DPI (Dots Per Inch) for the screen that a window is on. ]] } values { - xdpi: int; [[Pointer to value to store return horizontal dpi. May be $null.]] - ydpi: int; [[Pointer to value to store return vertical dpi. May be $null.]] + xdpi: int; [[Horizontal DPI.]] + ydpi: int; [[Vertical DPI.]] } } } diff --git a/src/lib/efl/interfaces/efl_text.eo b/src/lib/efl/interfaces/efl_text.eo index 13733b0d4e..35b44bbcdf 100644 --- a/src/lib/efl/interfaces/efl_text.eo +++ b/src/lib/efl/interfaces/efl_text.eo @@ -1,6 +1,9 @@ interface Efl.Text { - [[Efl text interface]] + [[Efl text interface + + @since 1.22 + ]] methods { @property text { set { diff --git a/src/lib/efl/interfaces/efl_text_annotate.eo b/src/lib/efl/interfaces/efl_text_annotate.eo index f22209ec39..f9f52a4bb0 100644 --- a/src/lib/efl/interfaces/efl_text_annotate.eo +++ b/src/lib/efl/interfaces/efl_text_annotate.eo @@ -1,9 +1,7 @@ import efl_text_types; -interface Efl.Text_Annotate { +interface @beta Efl.Text_Annotate { [[Cursor API - - @since 1.20 ]] eo_prefix: efl_text; methods { @@ -15,15 +13,11 @@ interface Efl.Text_Annotate { Assumes that $annotation is a handle for an existing annotation, i.e. one that was added using @.annotation_insert to this object. Otherwise, this will fail and return $false. - - @since 1.18 ]] set { - legacy: null; return: bool; [[$true on success, $false otherwise.]] } get { - legacy: null; } keys { annotation: ptr(Efl.Text_Annotate_Annotation); [[Given annotation]] @@ -34,10 +28,7 @@ interface Efl.Text_Annotate { } 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]] @@ -49,10 +40,7 @@ interface Efl.Text_Annotate { The $format will be applied to the given range, and the $annotation handle will be returned for further handling. - - @since 1.18 ]] - legacy: null; params { @in start: ptr(Efl.Text_Cursor_Cursor); [[Start of range]] @in end: ptr(Efl.Text_Cursor_Cursor); [[End of range]] @@ -65,10 +53,7 @@ interface Efl.Text_Annotate { All formats applied by $annotation will be removed and it will be deleted. - - @since 1.18 ]] - legacy: null; params { @in annotation: ptr(Efl.Text_Annotate_Annotation); [[Annotation to be removed]] @@ -80,10 +65,7 @@ interface Efl.Text_Annotate { 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 annotation: ptr(const(Efl.Text_Annotate_Annotation)); [[Annotation handle to query]] @@ -100,10 +82,7 @@ interface Efl.Text_Annotate { see @.cursor_item_insert see @.item_geometry_get - - @since 1.21 ]] - legacy: null; params { annotation: ptr(Efl.Text_Annotate_Annotation); [[Given annotation]] } @@ -113,10 +92,7 @@ interface Efl.Text_Annotate { [[Queries a given object item for its geometry. Note that the provided annotation should be an object item type. - - @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]] @@ -130,7 +106,6 @@ interface Efl.Text_Annotate { @property cursor_item_annotation { [[The object-item annotation at the cursor's position.]] get { - legacy: null; } values { annotation: ptr(Efl.Text_Annotate_Annotation); [[Annotation]] @@ -146,7 +121,6 @@ interface Efl.Text_Annotate { which in turn place graphics on top of it. It essentially places an OBJECT REPLACEMENT CHARACTER and set a special annotation to it. ]] - legacy: null; params { cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]] @in item: string; [[Item key to be used in higher-up diff --git a/src/lib/efl/interfaces/efl_text_cursor.eo b/src/lib/efl/interfaces/efl_text_cursor.eo index 87bba61bdd..50fc3aecdc 100644 --- a/src/lib/efl/interfaces/efl_text_cursor.eo +++ b/src/lib/efl/interfaces/efl_text_cursor.eo @@ -1,9 +1,8 @@ import eina_types; import efl_text_types; -enum Efl.Text_Cursor_Get_Type { +enum @beta Efl.Text_Cursor_Get_Type { [[All available cursor states]] - legacy: efl_text_cursor_get; default = 0, [[Main cursor state (alias to "main")]] main, [[Main cursor state]] selection_begin, [[Selection begin cursor state]] @@ -14,28 +13,22 @@ enum Efl.Text_Cursor_Get_Type { user_extra [[User extra cursor state]] } -enum Efl.Text_Cursor_Type +enum @beta Efl.Text_Cursor_Type { [[Text cursor types]] - legacy: efl_text_cursor_type; before, [[Cursor type before]] under [[Cursor type under]] } -interface Efl.Text_Cursor { +interface @beta Efl.Text_Cursor { [[Cursor API - - @since 1.20 ]] methods { // Cursor @property text_cursor { [[The object's main cursor. - - @since 1.18 ]] get { - legacy: null; return: ptr(Efl.Text_Cursor_Cursor); [[Text cursor object]] } keys { @@ -44,8 +37,8 @@ interface Efl.Text_Cursor { } @property cursor_position { [[Cursor position]] - set { legacy: null; } - get { legacy: null; } + set { } + get { } values { position: int; [[Cursor position]] } @@ -56,7 +49,6 @@ interface Efl.Text_Cursor { @property cursor_content { [[The content of the cursor (the character under the cursor)]] get { - legacy: null; } values { content: Eina.Unicode; [[The unicode codepoint of the character]] @@ -75,7 +67,6 @@ interface Efl.Text_Cursor { In this case $true is returned and $cx2, $cy2, $cw2, $ch2 are set. ]] get { - legacy: null; return: bool; [[ $true if split cursor, $false otherwise.]] } keys { @@ -95,19 +86,16 @@ interface Efl.Text_Cursor { } cursor_new { [[Create new cursor]] - legacy: null; return: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]] } cursor_free { [[Free existing cursor]] - legacy: null; params { 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]] @@ -116,7 +104,6 @@ interface Efl.Text_Cursor { } cursor_compare { [[Compare two cursors]] - legacy: null; params { @cref cur1: Efl.Text_Cursor_Cursor; [[Cursor 1 object]] @cref cur2: Efl.Text_Cursor_Cursor; [[Cursor 2 object]] @@ -125,7 +112,6 @@ interface Efl.Text_Cursor { } cursor_copy { [[Copy existing cursor]] - legacy: null; params { /* @out */ dst: ptr(Efl.Text_Cursor_Cursor); [[Destination cursor]] @cref src: Efl.Text_Cursor_Cursor; [[Source cursor]] @@ -133,105 +119,90 @@ interface Efl.Text_Cursor { } cursor_char_next { [[Advances to the next character]] - legacy: null; params { /* @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]] } } cursor_cluster_next { [[Advances to the next grapheme cluster]] - legacy: null; params { /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]] } } cursor_cluster_prev { [[Advances to the previous grapheme cluster]] - legacy: null; params { /* @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]] } } cursor_paragraph_char_last { [[Advances to the last character in this paragraph]] - legacy: null; params { /* @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]] } } cursor_word_end { [[Advance to current word end]] - legacy: null; params { /* @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]] } } cursor_line_char_last { [[Advance to current line last character]] - legacy: null; params { /* @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]] } } cursor_paragraph_last { [[Advance to current paragraph last character]] - legacy: null; params { /* @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]] } } cursor_paragraph_prev { [[Advances to the end of the previous text node]] - legacy: null; params { /* @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]] by: int; [[Number of lines]] @@ -239,7 +210,6 @@ interface Efl.Text_Cursor { } cursor_coord_set { [[Set cursor coordinates]] - legacy: null; params { /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]] @in x: int; [[X coord to set by.]] @@ -250,7 +220,6 @@ interface Efl.Text_Cursor { [[Set cursor coordinates according to grapheme clusters. It does not allow to put a cursor to the middle of a grapheme cluster. ]] - legacy: null; params { /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]] @in x: int; [[X coord to set by.]] @@ -261,7 +230,6 @@ interface Efl.Text_Cursor { [[Adds text to the current cursor position and set the cursor to *after* the start of the text just added. ]] - legacy: null; params { /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]] @in text: string; [[Text to append (UTF-8 format).]] @@ -270,7 +238,6 @@ interface Efl.Text_Cursor { } cursor_char_delete { [[Deletes a single character from position pointed by given cursor.]] - legacy: null; params { /* @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 34e5dab22a..32f15c2a55 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 import efl_gfx_types; -enum Efl.Text_Font_Weight { +enum @beta 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 @beta 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 @beta Efl.Text_Font_Slant { [[Type of font slant]] normal, [[Normal font slant]] oblique, [[Oblique font slant]] @@ -40,19 +40,15 @@ 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 @beta Efl.Text_Font_Bitmap_Scalable { [[Scalable of bitmap fonts - - @since 1.21 ]] none = 0, [[Disable scalable feature for bitmap fonts.]] color = (1 << 0), [[Enable scalable feature for color bitmap fonts.]] } -interface Efl.Text_Font { +interface @beta Efl.Text_Font { [[Font settings of the text - - @since 1.20 ]] eo_prefix: efl_text; methods { diff --git a/src/lib/efl/interfaces/efl_text_format.eo b/src/lib/efl/interfaces/efl_text_format.eo index 0ec9c98240..6d0125c55d 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 @beta Efl.Text_Format_Wrap { [[Wrap mode of the text (not in effect if not multiline)]] none, [[No wrapping]] char, [[Wrap mode character]] @@ -7,22 +7,19 @@ enum Efl.Text_Format_Wrap { hyphenation [[Wrap mode hyphenation]] } -enum Efl.Text_Format_Horizontal_Alignment_Auto_Type { +enum @beta Efl.Text_Format_Horizontal_Alignment_Auto_Type { [[Auto-horizontal alignment of the text]] - legacy: efl_text_horizontal_alignment_auto; none, [[No auto-alignment rule]] normal, [[Respects LTR/RTL (bidirectional) settings]] locale, [[Respects locale's langauge settings]] end [[Text is places at opposite side of LTR/RTL (bidirectional) settings]] } -interface Efl.Text_Format { +interface @beta Efl.Text_Format { [[The look and layout of the text The text format can affect the geometry of the text object, as well as how characters are presented. - - @since 1.20 ]] eo_prefix: efl_text; methods { diff --git a/src/lib/efl/interfaces/efl_text_markup.eo b/src/lib/efl/interfaces/efl_text_markup.eo index 97de5672b4..a0ec020cf5 100644 --- a/src/lib/efl/interfaces/efl_text_markup.eo +++ b/src/lib/efl/interfaces/efl_text_markup.eo @@ -1,7 +1,5 @@ -interface Efl.Text_Markup extends Efl.Text_Cursor { +interface @beta Efl.Text_Markup { [[Markup data that populates the text object's style and format - - @since 1.21 ]] methods { @property markup { @@ -10,24 +8,6 @@ interface Efl.Text_Markup extends Efl.Text_Cursor { markup: string; [[The markup-text representation set to this text.]] } } - @property markup_range { - [[Markup of a given range in the text]] - values { - markup: mstring @owned; [[The markup-text representation set to - this text of a given range]] - } - keys { - start: ptr(Efl.Text_Cursor_Cursor); - end: ptr(Efl.Text_Cursor_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]] - @in markup: string; [[The markup text to insert]] - } - } } } diff --git a/src/lib/efl/interfaces/efl_text_markup_interactive.eo b/src/lib/efl/interfaces/efl_text_markup_interactive.eo new file mode 100644 index 0000000000..cbb4906ac2 --- /dev/null +++ b/src/lib/efl/interfaces/efl_text_markup_interactive.eo @@ -0,0 +1,25 @@ +interface @beta Efl.Text_Markup_Interactive extends Efl.Text_Cursor { + [[Markup data that populates the text object's style and format + ]] + methods { + @property markup_range { + [[Markup of a given range in the text]] + values { + markup: mstring @owned; [[The markup-text representation set to + this text of a given range]] + } + keys { + start: ptr(Efl.Text_Cursor_Cursor); [[Start of the markup region]] + end: ptr(Efl.Text_Cursor_Cursor); [[End of markup region]] + } + } + 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]] + @in markup: string; [[The markup text to insert]] + } + } + } +} + diff --git a/src/lib/efl/interfaces/efl_text_markup_util.c b/src/lib/efl/interfaces/efl_text_markup_util.c index bf296c11fb..239915b4ac 100644 --- a/src/lib/efl/interfaces/efl_text_markup_util.c +++ b/src/lib/efl/interfaces/efl_text_markup_util.c @@ -68,8 +68,7 @@ _markup_get_text_utf8_append(Eina_Strbuf *sbuf, const char *text) } EOLIAN static char* -_efl_text_markup_util_text_to_markup(Eo *class EINA_UNUSED, - void *_pd EINA_UNUSED, const char *text) +_efl_text_markup_util_text_to_markup(const char *text) { Eina_Strbuf *sbuf; char *str = NULL; @@ -491,8 +490,7 @@ _text_util_markup_to_text(const char *text) } static EOLIAN char* -_efl_text_markup_util_markup_to_text(Eo *class EINA_UNUSED, - void *_pd EINA_UNUSED, const char *text) +_efl_text_markup_util_markup_to_text(const char *text) { return _text_util_markup_to_text(text); } diff --git a/src/lib/efl/interfaces/efl_text_markup_util.eo b/src/lib/efl/interfaces/efl_text_markup_util.eo index 845694d489..96237fc740 100644 --- a/src/lib/efl/interfaces/efl_text_markup_util.eo +++ b/src/lib/efl/interfaces/efl_text_markup_util.eo @@ -1,7 +1,5 @@ -class Efl.Text_Markup_Util { +class @beta Efl.Text_Markup_Util { [[Utility class for markup, such as conversions - - @since 1.21. ]] data: null; methods { diff --git a/src/lib/efl/interfaces/efl_text_style.eo b/src/lib/efl/interfaces/efl_text_style.eo index 99552ac036..362a56f223 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 @beta 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 @beta 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 @beta 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 @beta 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 @beta Efl.Text_Style_Underline_Type { [[Underline type of the displayed text]] off = 0, [[Text without underline]] @@ -55,12 +55,10 @@ enum Efl.Text_Style_Underline_Type dashed, [[Underlined with a dashed line]] } -interface Efl.Text_Style { +interface @beta Efl.Text_Style { [[Style to apply to the text A style can be coloring, effects, underline, strikethrough etc. - - @since 1.20 ]] eo_prefix: efl_text; methods { diff --git a/src/lib/efl/interfaces/efl_text_types.eot b/src/lib/efl/interfaces/efl_text_types.eot index 61003586b9..1e1d59fd1e 100644 --- a/src/lib/efl/interfaces/efl_text_types.eot +++ b/src/lib/efl/interfaces/efl_text_types.eot @@ -7,7 +7,7 @@ enum Efl.Text_Bidirectional_Type { inherit [[Inherit text type]] } -struct Efl.Ui.Text_Change_Info { +struct @beta Efl.Ui.Text_Change_Info { [[This structure includes all the information about content changes. It's meant to be used to implement undo/redo. diff --git a/src/lib/efl/interfaces/efl_types.eot b/src/lib/efl/interfaces/efl_types.eot index 06a9426ee8..fd5a23f255 100644 --- a/src/lib/efl/interfaces/efl_types.eot +++ b/src/lib/efl/interfaces/efl_types.eot @@ -39,9 +39,3 @@ struct Efl.Version build_id: string; [[Contains $EFL_BUILD_ID.]] } -struct Efl.Observable_Tuple -{ - [[This type describes an observable touple]] - key: string; [[Touple key]] - data: iterator @owned; [[Touple data]] -} diff --git a/src/lib/efl/interfaces/efl_ui_autorepeat.eo b/src/lib/efl/interfaces/efl_ui_autorepeat.eo index 5bcf451e5a..1c374a5172 100644 --- a/src/lib/efl/interfaces/efl_ui_autorepeat.eo +++ b/src/lib/efl/interfaces/efl_ui_autorepeat.eo @@ -1,4 +1,4 @@ -interface Efl.Ui.Autorepeat { +interface @beta Efl.Ui.Autorepeat { [[Efl UI autorepeat interface]] eo_prefix: efl_ui; methods { diff --git a/src/lib/efl/interfaces/efl_ui_clickable.eo b/src/lib/efl/interfaces/efl_ui_clickable.eo index 869d5e3650..34da147875 100644 --- a/src/lib/efl/interfaces/efl_ui_clickable.eo +++ b/src/lib/efl/interfaces/efl_ui_clickable.eo @@ -1,4 +1,4 @@ -interface Efl.Ui.Clickable +interface @beta Efl.Ui.Clickable { [[Efl UI clickable interface]] event_prefix: efl_ui; diff --git a/src/lib/efl/interfaces/efl_ui_direction.eo b/src/lib/efl/interfaces/efl_ui_direction.eo index 7e5aa74c0e..a75872eb85 100644 --- a/src/lib/efl/interfaces/efl_ui_direction.eo +++ b/src/lib/efl/interfaces/efl_ui_direction.eo @@ -3,7 +3,7 @@ parse efl_orientation; -enum Efl.Ui.Dir +enum @beta Efl.Ui.Dir { [[Direction for UI objects and layouts. @@ -25,7 +25,7 @@ enum Efl.Ui.Dir left = Efl.Ui.Dir.rtl, [[Left is an alias for RTL.]] } -interface Efl.Ui.Direction +interface @beta Efl.Ui.Direction { [[EFL UI object direction interface]] methods { diff --git a/src/lib/efl/interfaces/efl_ui_direction_readonly.c b/src/lib/efl/interfaces/efl_ui_direction_readonly.c new file mode 100644 index 0000000000..e972ab2b02 --- /dev/null +++ b/src/lib/efl/interfaces/efl_ui_direction_readonly.c @@ -0,0 +1,17 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +typedef struct { + +} Efl_Ui_Direction_Readonly_Data; + +EOLIAN static void +_efl_ui_direction_readonly_efl_ui_direction_direction_set(Eo *obj EINA_UNUSED, Efl_Ui_Direction_Readonly_Data *pd EINA_UNUSED, Efl_Ui_Dir dir EINA_UNUSED) +{ + EINA_LOG_ERR("This object does not allow setting of a direction"); +} + +#include "interfaces/efl_ui_direction_readonly.eo.c" diff --git a/src/lib/efl/interfaces/efl_ui_direction_readonly.eo b/src/lib/efl/interfaces/efl_ui_direction_readonly.eo new file mode 100644 index 0000000000..aaba2d45c5 --- /dev/null +++ b/src/lib/efl/interfaces/efl_ui_direction_readonly.eo @@ -0,0 +1,6 @@ +mixin @beta Efl.Ui.Direction_Readonly extends Efl.Ui.Direction +{ + implements { + Efl.Ui.Direction.direction { set; [[This will always print and error that this is a readonly object]]} + } +} diff --git a/src/lib/efl/interfaces/efl_ui_drag.eo b/src/lib/efl/interfaces/efl_ui_drag.eo index dedcb348f1..36a5aa0365 100644 --- a/src/lib/efl/interfaces/efl_ui_drag.eo +++ b/src/lib/efl/interfaces/efl_ui_drag.eo @@ -2,11 +2,9 @@ import efl_ui_types; -interface Efl.Ui.Drag +interface @beta Efl.Ui.Drag { [[Common interface for draggable objects and parts. - - @since 1.20 ]] methods { @property drag_value { diff --git a/src/lib/efl/interfaces/efl_ui_draggable.eo b/src/lib/efl/interfaces/efl_ui_draggable.eo index a202a3e434..3cd939667b 100644 --- a/src/lib/efl/interfaces/efl_ui_draggable.eo +++ b/src/lib/efl/interfaces/efl_ui_draggable.eo @@ -1,5 +1,5 @@ /* FIXME: Edje Drag and this Dnd Draggable have confusingly similar names! */ -interface Efl.Ui.Draggable +interface @beta Efl.Ui.Draggable { [[Efl UI draggable interface]] event_prefix: efl_ui; diff --git a/src/lib/efl/interfaces/efl_ui_factory.eo b/src/lib/efl/interfaces/efl_ui_factory.eo index 45be8aab80..e2c2ae3318 100644 --- a/src/lib/efl/interfaces/efl_ui_factory.eo +++ b/src/lib/efl/interfaces/efl_ui_factory.eo @@ -1,10 +1,10 @@ -struct Efl.Ui.Factory_Item_Created_Event { +struct @beta Efl.Ui.Factory_Item_Created_Event { [[EFL Ui Factory event structure provided when an item was just created.]] model: Efl.Model; [[The model already set on the new item.]] item: Efl.Gfx.Entity; [[The item that was just created.]] } -interface Efl.Ui.Factory extends Efl.Ui.Model.Connect +interface @beta Efl.Ui.Factory extends Efl.Ui.Property_Bind, Efl.Ui.Factory_Bind { [[Efl UI factory interface]] methods { @@ -22,13 +22,6 @@ interface Efl.Ui.Factory extends Efl.Ui.Model.Connect 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]] - } - } } events { created: Efl.Ui.Factory_Item_Created_Event; [[Event triggered when an item has been successfully created.]] diff --git a/src/lib/efl/interfaces/efl_ui_factory_bind.eo b/src/lib/efl/interfaces/efl_ui_factory_bind.eo new file mode 100644 index 0000000000..d26832453f --- /dev/null +++ b/src/lib/efl/interfaces/efl_ui_factory_bind.eo @@ -0,0 +1,19 @@ +interface @beta Efl.Ui.Factory_Bind +{ + [[Efl UI Property interface. + view object can have @Efl.Model and need to set cotent with those model stored data. + the interface can help binding the factory to create object with model property data. + see @Efl.Model + see @Efl.Ui.Factory]] + methods { + factory_bind { + [[bind the factory with the given key string. when the data is ready or changed, + factory create the object and bind the data to the key action and process promised work. + Note: the input @Efl.Ui.Factory need to be @Efl.Ui.Property_Bind.property_bind at least once.]] + params { + key: string; [[Key string for bind model property data]] + factory: Efl.Ui.Factory; [[@Efl.Ui.Factory for create and bind model property data]] + } + } + } +} diff --git a/src/lib/efl/interfaces/efl_ui_format.c b/src/lib/efl/interfaces/efl_ui_format.c index e722d22654..f6f1b811e2 100644 --- a/src/lib/efl/interfaces/efl_ui_format.c +++ b/src/lib/efl/interfaces/efl_ui_format.c @@ -38,6 +38,8 @@ _format_string_check(const char *fmt) if (itr[1] == '%') { itr++; + if (ret_type == FORMAT_TYPE_STATIC) + ret_type = FORMAT_TYPE_STRING; continue; } @@ -69,7 +71,8 @@ _format_string_check(const char *fmt) } else { - ret_type = FORMAT_TYPE_INVALID; + ERR("Format string '%s' has unknown format element '%c' in format. It must have one format element of type 's', 'f', 'F', 'd', 'u', 'i', 'o', 'x' or 'X'", fmt, *itr); + found = EINA_FALSE; break; } } @@ -121,7 +124,7 @@ _default_format_cb(void *data, Eina_Strbuf *str, const Eina_Value value) } else if (sd->format_type == FORMAT_TYPE_STATIC) { - eina_strbuf_append_printf(str, "%s", sd->template); + eina_strbuf_append(str, sd->template); } else { diff --git a/src/lib/efl/interfaces/efl_ui_format.eo b/src/lib/efl/interfaces/efl_ui_format.eo index e78478e8bd..8f59d858af 100644 --- a/src/lib/efl/interfaces/efl_ui_format.eo +++ b/src/lib/efl/interfaces/efl_ui_format.eo @@ -1,12 +1,14 @@ -function Efl.Ui.Format_Func_Cb { +import eina_types; + +function @beta Efl.Ui.Format_Func_Cb { [[Function pointer for format function hook]] params { @in str: strbuf; [[the formated string to be appended by user.]] - @in value: const(any_value); [[The Eina.Value passed by $obj.]] + @in value: const(any_value); [[The @Eina.Value passed by $obj.]] } }; -mixin Efl.Ui.Format +mixin @beta Efl.Ui.Format { [[interface class for format_func]] methods { diff --git a/src/lib/efl/interfaces/efl_ui_i18n.eo b/src/lib/efl/interfaces/efl_ui_i18n.eo index 3dffa16c1e..ece81f6314 100644 --- a/src/lib/efl/interfaces/efl_ui_i18n.eo +++ b/src/lib/efl/interfaces/efl_ui_i18n.eo @@ -1,4 +1,4 @@ -interface Efl.Ui.I18n +interface @beta Efl.Ui.I18n { [[A common Internationalization interface for UI objects.]] eo_prefix: efl_ui; diff --git a/src/lib/efl/interfaces/efl_ui_menu.eo b/src/lib/efl/interfaces/efl_ui_menu.eo index be4b6cb82f..e0f47e6585 100644 --- a/src/lib/efl/interfaces/efl_ui_menu.eo +++ b/src/lib/efl/interfaces/efl_ui_menu.eo @@ -1,6 +1,5 @@ -interface Efl.Ui.Menu { +interface @beta Efl.Ui.Menu { [[Efl UI menu interface]] - legacy_prefix: null; methods { @property selected_item { get { diff --git a/src/lib/efl/interfaces/efl_ui_model_connect.eo b/src/lib/efl/interfaces/efl_ui_model_connect.eo deleted file mode 100644 index 4a5e2c1310..0000000000 --- a/src/lib/efl/interfaces/efl_ui_model_connect.eo +++ /dev/null @@ -1,13 +0,0 @@ -interface Efl.Ui.Model.Connect -{ - [[Efl UI model connect interface]] - methods { - connect { - [[Connect property]] - params { - name: string; [[Model name]] - property: string; [[Property name]] - } - } - } -} diff --git a/src/lib/efl/interfaces/efl_ui_multi_selectable.eo b/src/lib/efl/interfaces/efl_ui_multi_selectable.eo index f8a95afeed..a99ff458f4 100644 --- a/src/lib/efl/interfaces/efl_ui_multi_selectable.eo +++ b/src/lib/efl/interfaces/efl_ui_multi_selectable.eo @@ -1,6 +1,5 @@ -enum Efl.Ui.Select_Mode { +enum @beta 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 @@ -9,7 +8,7 @@ enum Efl.Ui.Select_Mode { none [[Last value of select mode. child cannot be selected at all.]] } -interface Efl.Ui.Multi_Selectable +interface @beta Efl.Ui.Multi_Selectable { [[Efl UI Multi selectable interface. The container have to control select property of multiple chidren.]] diff --git a/src/lib/efl/interfaces/efl_ui_property_bind.eo b/src/lib/efl/interfaces/efl_ui_property_bind.eo new file mode 100644 index 0000000000..e60de731a1 --- /dev/null +++ b/src/lib/efl/interfaces/efl_ui_property_bind.eo @@ -0,0 +1,31 @@ +import eina_types; + +struct Efl.Ui.Property_Event { + [[EFL Ui property event data structure triggered when an object property change due + to the interaction on the object.]] + changed_properties: array; [[List of changed properties]] +} + +interface @beta Efl.Ui.Property_Bind +{ + [[Efl UI Property_Bind interface. + view object can have @Efl.Model to manage the data, + the interface can help loading and tracking child data from the model property. + see @Efl.Model + see @Efl.Ui.Factory]] + methods { + property_bind { + [[bind property data with the given key string. when the data is ready or changed, + bind the data to the key action and process promised work.]] + params { + key: string; [[key string for bind model property data]] + property: string; [[Model property name]] + } + return: Eina.Error; [[0 when it succeed, an error code otherwise.]] + } + } + events { + properties,changed: Efl.Ui.Property_Event; [[Event dispatched when a property on the object has changed due to an user interaction on the object that a model could be interested in.]] + property,bound: stringshare; [[Event dispatched when a property on the object is bound to a model. This is useful to not overgenerate event.]] + } +} diff --git a/src/lib/efl/interfaces/efl_ui_range.eo b/src/lib/efl/interfaces/efl_ui_range_display.eo similarity index 72% rename from src/lib/efl/interfaces/efl_ui_range.eo rename to src/lib/efl/interfaces/efl_ui_range_display.eo index a387ef128f..ca9d2c1e1b 100644 --- a/src/lib/efl/interfaces/efl_ui_range.eo +++ b/src/lib/efl/interfaces/efl_ui_range_display.eo @@ -1,6 +1,7 @@ -interface Efl.Ui.Range +interface @beta Efl.Ui.Range_Display { - [[Efl UI progress interface]] + [[Interface that contains properties regarding the displaying of a range.]] + eo_prefix: efl_ui_range; methods { @property range_value { [[Control the range value (in percentage) on a given range widget @@ -26,7 +27,7 @@ interface Efl.Ui.Range If actual value is less than $min, it will be updated to $min. If it is bigger then $max, will be updated to $max. The actual value - can be obtained with @Efl.Ui.Range.range_value.get + can be obtained with @Efl.Ui.Range_Display.range_value.get The minimum and maximum values may be different for each class. @@ -46,21 +47,5 @@ interface Efl.Ui.Range max: double; [[The maximum value.]] } } - @property range_step { - [[Control the step used to increment or decrement values for given widget. - - This value will be incremented or decremented to the displayed value. - - By default step value is equal to 1. - - Warning: The step value should be bigger than 0.]] - set { - } - get { - } - values { - step: double; [[The step value.]] - } - } } } diff --git a/src/lib/efl/interfaces/efl_ui_range_interactive.eo b/src/lib/efl/interfaces/efl_ui_range_interactive.eo new file mode 100644 index 0000000000..a7af8c8c8f --- /dev/null +++ b/src/lib/efl/interfaces/efl_ui_range_interactive.eo @@ -0,0 +1,26 @@ +interface @beta Efl.Ui.Range_Interactive extends Efl.Ui.Range_Display +{ + [[Interface that extends the normal displaying properties with usage properties. + + The properties defined here are used to manipulate the way a user interacts with a displayed range. + ]] + eo_prefix: efl_ui_range; + methods { + @property range_step { + [[Control the step used to increment or decrement values for given widget. + + This value will be incremented or decremented to the displayed value. + + By default step value is equal to 1. + + Warning: The step value should be bigger than 0.]] + set { + } + get { + } + values { + step: double; [[The step value.]] + } + } + } +} diff --git a/src/lib/efl/interfaces/efl_ui_scrollable.eo b/src/lib/efl/interfaces/efl_ui_scrollable.eo index b1284e5cd6..dd255eb0bf 100644 --- a/src/lib/efl/interfaces/efl_ui_scrollable.eo +++ b/src/lib/efl/interfaces/efl_ui_scrollable.eo @@ -1,18 +1,16 @@ -enum Efl.Ui.Scroll_Block +enum @beta Efl.Ui.Scroll_Block { [[Direction in which a scroller should be blocked. Note: These options may be effective only in case of thumbscroll (i.e. when scrolling by dragging). - - @since 1.21 ]] none = 0, [[Don't block any movement.]] vertical = 1, [[Block vertical movement.]] horizontal = 2 [[Block horizontal movement.]] } -interface Efl.Ui.Scrollable +interface @beta Efl.Ui.Scrollable { [[Efl UI scrollable interface]] event_prefix: efl_ui; diff --git a/src/lib/efl/interfaces/efl_ui_scrollable_interactive.eo b/src/lib/efl/interfaces/efl_ui_scrollable_interactive.eo index 7499bc7b91..906c43982e 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 extends Efl.Ui.Scrollable +interface @beta Efl.Ui.Scrollable_Interactive extends Efl.Ui.Scrollable { eo_prefix: efl_ui_scrollable; methods { @@ -109,7 +109,7 @@ interface Efl.Ui.Scrollable_Interactive extends Efl.Ui.Scrollable The scroller will adjust the view to glue itself as follows. x=0.0, for staying where it is relative to the left edge of the content - x=1.0, for staying where it is relative to the rigth edge of the content + x=1.0, for staying where it is relative to the right edge of the content y=0.0, for staying where it is relative to the top edge of the content y=1.0, for staying where it is relative to the bottom edge of the content @@ -137,6 +137,19 @@ interface Efl.Ui.Scrollable_Interactive extends Efl.Ui.Scrollable h: bool; [[Whether to limit the minimum vertical size]] } } + @property step_size { + [[Control the step size + + Use this call to set step size. + This value is used when scroller scroll by arrow key event.]] + set { + } + get { + } + values { + step: Eina.Position2D; [[The step size in pixels]] + } + } scroll { [[Show a specific virtual region within the scroller content object. diff --git a/src/lib/efl/interfaces/efl_ui_scrollbar.eo b/src/lib/efl/interfaces/efl_ui_scrollbar.eo index 46e1bad5fe..50b2b2f34c 100644 --- a/src/lib/efl/interfaces/efl_ui_scrollbar.eo +++ b/src/lib/efl/interfaces/efl_ui_scrollbar.eo @@ -1,18 +1,18 @@ -enum Efl.Ui.Scrollbar_Mode +enum @beta Efl.Ui.Scrollbar_Mode { auto = 0, [[Visible if necessary]] on, [[Always visible]] off, [[Always invisible]] - last [[]] + last [[For internal use only]] } -enum Efl.Ui.Scrollbar_Direction +enum @beta Efl.Ui.Scrollbar_Direction { horizontal = 0, vertical, last } -interface Efl.Ui.Scrollbar +interface @beta Efl.Ui.Scrollbar { methods { @property bar_mode { diff --git a/src/lib/efl/interfaces/efl_ui_selectable.eo b/src/lib/efl/interfaces/efl_ui_selectable.eo index 2d67ac018f..1105fe42d2 100644 --- a/src/lib/efl/interfaces/efl_ui_selectable.eo +++ b/src/lib/efl/interfaces/efl_ui_selectable.eo @@ -1,12 +1,12 @@ -interface Efl.Ui.Selectable +interface @beta Efl.Ui.Selectable { [[Efl UI selectable interface]] event_prefix: efl_ui; events { /* FIXME: Called with multiple types of event_info! */ - selected: void; [[Called when selected]] + item,selected: Efl.Object; [[Called when selected]] /* FIXME: Called with multiple types of event_info! */ - unselected: void; [[Called when no longer selected]] + item,unselected: Efl.Object; [[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]] diff --git a/src/lib/efl/interfaces/efl_ui_types.eot b/src/lib/efl/interfaces/efl_ui_types.eot index 59cf1abf7f..2622e4225f 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 @beta 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_view.eo b/src/lib/efl/interfaces/efl_ui_view.eo index 144b2fa660..33919d5c96 100644 --- a/src/lib/efl/interfaces/efl_ui_view.eo +++ b/src/lib/efl/interfaces/efl_ui_view.eo @@ -1,4 +1,4 @@ -interface Efl.Ui.View +interface @beta Efl.Ui.View { [[Efl UI view interface]] methods { diff --git a/src/lib/efl/interfaces/efl_ui_zoom.eo b/src/lib/efl/interfaces/efl_ui_zoom.eo index 7e5e58b495..b3d949aa5f 100644 --- a/src/lib/efl/interfaces/efl_ui_zoom.eo +++ b/src/lib/efl/interfaces/efl_ui_zoom.eo @@ -1,7 +1,6 @@ -enum Efl.Ui.Zoom_Mode +enum @beta Efl.Ui.Zoom_Mode { [[Types of zoom available.]] - legacy: efl_ui_zoom_mode; manual = 0, [[Zoom controlled normally by efl_ui_zoom_set]] auto_fit, [[Zoom until photo fits in zoomable object]] auto_fill, [[Zoom until photo fills zoomable object]] @@ -9,7 +8,7 @@ enum Efl.Ui.Zoom_Mode last [[Sentinel value to indicate last enum field during iteration]] } -interface Efl.Ui.Zoom +interface @beta Efl.Ui.Zoom { [[Efl UI zoom interface]] event_prefix: efl_ui; @@ -17,23 +16,14 @@ interface Efl.Ui.Zoom methods { @property zoom_animation { - set { - [[Enable zoom animation - - This sets the zoom animation state to on or off for zoomable. The - default is off. This will stop zooming using animation on - zoom level changes and change instantly. This will stop any - existing animations that are running. - ]] - } - get { - [[Disable zoom animation - - This gets the current zoom animation state for the zoomable object. - ]] - } + [[This sets the zoom animation state to on or off for zoomable. The + default is off. When $paused is $true, it will stop zooming using + animation on zoom level changes and change instantly, stopping any + existing animations that are running.]] + set {} + get {} values { - paused: bool; [[The pause state.]] + paused: bool; [[The paused state.]] } } @property zoom_level { diff --git a/src/lib/efl/interfaces/meson.build b/src/lib/efl/interfaces/meson.build index 13f71e4408..ef75b3d7ff 100644 --- a/src/lib/efl/interfaces/meson.build +++ b/src/lib/efl/interfaces/meson.build @@ -5,7 +5,7 @@ pub_legacy_eo_files = [ 'efl_gfx_entity.eo', 'efl_gfx_color.eo', 'efl_gfx_image.eo', - 'efl_gfx_image_animation_controller.eo', + 'efl_gfx_frame_controller.eo', 'efl_input_device.eo', 'efl_ui_draggable.eo', 'efl_ui_clickable.eo', @@ -29,16 +29,6 @@ foreach eo_file : pub_legacy_eo_files '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'), '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'), '-gchd', '@INPUT@']) - pub_eo_file_target += custom_target('eolian_gen_legacy_' + eo_file, - input : eo_file, - output : [eo_file + '.legacy.h'], - depfile : eo_file + '.legacy.d', - install : true, - install_dir : join_paths(dir_package_include, 'interfaces'), - command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories, - '-o', 'l:' + join_paths(meson.current_build_dir(), eo_file + '.legacy.h'), - '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.legacy.d'), - '-gld', '@INPUT@']) endforeach pub_eo_files = [ @@ -49,6 +39,7 @@ pub_eo_files = [ 'efl_control.eo', 'efl_duplicate.eo', 'efl_file.eo', + 'efl_file_save.eo', 'efl_gfx_image_load_controller.eo', 'efl_part.eo', 'efl_player.eo', @@ -59,6 +50,7 @@ pub_eo_files = [ 'efl_text_cursor.eo', 'efl_text_annotate.eo', 'efl_text_markup.eo', + 'efl_text_markup_interactive.eo', 'efl_text_markup_util.eo', 'efl_gfx_stack.eo', 'efl_gfx_view.eo', @@ -70,9 +62,8 @@ pub_eo_files = [ 'efl_gfx_gradient_radial.eo', 'efl_gfx_filter.eo', 'efl_gfx_blur.eo', - 'efl_gfx_size_hint.eo', + 'efl_gfx_hint.eo', 'efl_model.eo', - 'efl_animator.eo', 'efl_interpolator.eo', 'efl_orientation.eo', 'efl_container.eo', @@ -83,11 +74,14 @@ pub_eo_files = [ 'efl_pack_table.eo', 'efl_ui_i18n.eo', 'efl_ui_direction.eo', + 'efl_ui_direction_readonly.eo', 'efl_ui_drag.eo', - 'efl_ui_range.eo', + 'efl_ui_range_display.eo', + 'efl_ui_range_interactive.eo', 'efl_ui_view.eo', - 'efl_ui_model_connect.eo', + 'efl_ui_property_bind.eo', 'efl_ui_factory.eo', + 'efl_ui_factory_bind.eo', 'efl_ui_multi_selectable.eo', 'efl_screen.eo', 'efl_io_closer.eo', @@ -144,9 +138,11 @@ foreach eo_file : pub_eo_types_files '-ghd', '@INPUT@']) endforeach -install_data(pub_eo_files + pub_legacy_eo_files + pub_eo_types_files, - install_dir: join_paths(eolian_include_dir, package_version_name) -) +if get_option('install-eo-files') + install_data(pub_eo_files + pub_legacy_eo_files + pub_eo_types_files, + install_dir: join_paths(eolian_include_dir, package_version_name) + ) +endif efl_interfaces_eo_files = pub_eo_files efl_interfaces_eot_files = pub_eo_types_files @@ -171,6 +167,7 @@ efl_src += files([ 'efl_observer.c', 'efl_file.c', 'efl_ui_format.c', + 'efl_ui_direction_readonly.c', 'efl_text_markup_util.c', ]) @@ -178,4 +175,8 @@ efl_src += files([ # 'efl_common_internal.h' #]) +install_headers('efl_file.h', + install_dir : join_paths(dir_package_include, 'interfaces'), +) + eolian_include_directories += ['-I', meson.current_source_dir()] diff --git a/src/lib/efl_mono/efl_custom_exports_mono.c b/src/lib/efl_mono/efl_custom_exports_mono.c index 246a7bcf71..c4a3b54bc5 100644 --- a/src/lib/efl_mono/efl_custom_exports_mono.c +++ b/src/lib/efl_mono/efl_custom_exports_mono.c @@ -1,5 +1,6 @@ #include "Eo.h" #include "Eina.h" +#include "Ecore.h" #include #include @@ -22,6 +23,92 @@ # endif #endif /* ! _WIN32 */ +typedef void (*Efl_Mono_Free_GCHandle_Cb)(void *gchandle); +typedef void (*Efl_Mono_Remove_Events_Cb)(Eo *obj, void *gchandle); + +static Efl_Mono_Free_GCHandle_Cb _efl_mono_free_gchandle_call = NULL; +static Efl_Mono_Remove_Events_Cb _efl_mono_remove_events_call = NULL; + +EAPI void efl_mono_gchandle_callbacks_set(Efl_Mono_Free_GCHandle_Cb free_gchandle_cb, Efl_Mono_Remove_Events_Cb remove_events_cb) +{ + _efl_mono_free_gchandle_call = free_gchandle_cb; + _efl_mono_remove_events_call = remove_events_cb; +} + +EAPI void efl_mono_native_dispose(Eo *obj, void* gchandle) +{ + if (gchandle) _efl_mono_remove_events_call(obj, gchandle); + efl_unref(obj); + if (gchandle) _efl_mono_free_gchandle_call(gchandle); +} + +typedef struct _Efl_Mono_Native_Dispose_Data +{ + Eo *obj; + void *gchandle; +} Efl_Mono_Native_Dispose_Data; + +static void _efl_mono_native_dispose_cb(void *data) +{ + Efl_Mono_Native_Dispose_Data *dd = data; + efl_mono_native_dispose(dd->obj, dd->gchandle); + free(dd); +} + +EAPI void efl_mono_thread_safe_native_dispose(Eo *obj, void* gchandle) +{ + Efl_Mono_Native_Dispose_Data *dd = malloc(sizeof(Efl_Mono_Native_Dispose_Data)); + dd->obj = obj; + dd->gchandle = gchandle; + ecore_main_loop_thread_safe_call_async(_efl_mono_native_dispose_cb, dd); +} + +static void _efl_mono_unref_cb(void *obj) +{ + efl_unref(obj); +} + +EAPI void efl_mono_thread_safe_efl_unref(Eo* obj) +{ + ecore_main_loop_thread_safe_call_async(_efl_mono_unref_cb, obj); +} + +EAPI void efl_mono_thread_safe_free_cb_exec(Eina_Free_Cb free_cb, void* cb_data) +{ + ecore_main_loop_thread_safe_call_async(free_cb, cb_data); +} + +static void _efl_mono_list_free_cb(void *l) +{ + eina_list_free(l); +} + +EAPI void efl_mono_thread_safe_eina_list_free(Eina_List* list) +{ + ecore_main_loop_thread_safe_call_async(_efl_mono_list_free_cb, list); +} + +typedef struct _Efl_Mono_Promise_Reject_Data +{ + Eina_Promise *promise; + Eina_Error err; +} Efl_Mono_Promise_Reject_Data; + +static void _efl_mono_promise_reject_cb(void *data) +{ + Efl_Mono_Promise_Reject_Data *d = data; + eina_promise_reject(d->promise, d->err); + free(d); +} + +EAPI void efl_mono_thread_safe_promise_reject(Eina_Promise *p, Eina_Error err) +{ + Efl_Mono_Promise_Reject_Data *d = malloc(sizeof(Efl_Mono_Promise_Reject_Data)); + d->promise = p; + d->err = err; + ecore_main_loop_thread_safe_call_async(_efl_mono_promise_reject_cb, d); +} + EAPI void *efl_mono_native_alloc(unsigned int size) { return malloc(size); @@ -81,7 +168,7 @@ EAPI Eina_Free_Cb efl_mono_native_free_addr_get() EAPI Eina_Free_Cb efl_mono_native_efl_unref_addr_get() { - return (Eina_Free_Cb)efl_unref; + return (Eina_Free_Cb)efl_mono_thread_safe_efl_unref; } // Iterator Wrapper // @@ -349,6 +436,63 @@ EINA_SET_WRAPPER(double, double) EINA_SET_WRAPPER(string, const char *) EINA_SET_WRAPPER(ptr, void *) +#define EINA_CONTAINER_SET_WRAPPER(N, T) EAPI Eina_Bool eina_value_container_set_wrapper_##N(Eina_Value *value, int i, T new_value) \ +{ \ + const Eina_Value_Type *tp = eina_value_type_get(value); \ + if (tp == EINA_VALUE_TYPE_ARRAY) \ + return eina_value_array_set(value, i, new_value); \ + else if (tp == EINA_VALUE_TYPE_LIST) \ + return eina_value_list_set(value, i, new_value); \ + else \ + return EINA_FALSE; \ +} + +EINA_CONTAINER_SET_WRAPPER(char, char) +EINA_CONTAINER_SET_WRAPPER(uchar, unsigned char) +EINA_CONTAINER_SET_WRAPPER(short, short) +EINA_CONTAINER_SET_WRAPPER(ushort, unsigned short) +EINA_CONTAINER_SET_WRAPPER(int, int) +EINA_CONTAINER_SET_WRAPPER(uint, unsigned int) +EINA_CONTAINER_SET_WRAPPER(long, long) +EINA_CONTAINER_SET_WRAPPER(ulong, unsigned long) +EINA_CONTAINER_SET_WRAPPER(float, float) +EINA_CONTAINER_SET_WRAPPER(double, double) +EINA_CONTAINER_SET_WRAPPER(string, const char *) +EINA_CONTAINER_SET_WRAPPER(ptr, void *) + +#define EINA_CONTAINER_APPEND_WRAPPER(N, T) EAPI Eina_Bool eina_value_container_append_wrapper_##N(Eina_Value *value, T new_value) \ +{ \ + const Eina_Value_Type *tp = eina_value_type_get(value); \ + if (tp == EINA_VALUE_TYPE_ARRAY) \ + return eina_value_array_append(value, new_value); \ + else if (tp == EINA_VALUE_TYPE_LIST) \ + return eina_value_list_append(value, new_value); \ + else \ + return EINA_FALSE; \ +} + +EINA_CONTAINER_APPEND_WRAPPER(char, char) +EINA_CONTAINER_APPEND_WRAPPER(uchar, unsigned char) +EINA_CONTAINER_APPEND_WRAPPER(short, short) +EINA_CONTAINER_APPEND_WRAPPER(ushort, unsigned short) +EINA_CONTAINER_APPEND_WRAPPER(int, int) +EINA_CONTAINER_APPEND_WRAPPER(uint, unsigned int) +EINA_CONTAINER_APPEND_WRAPPER(long, long) +EINA_CONTAINER_APPEND_WRAPPER(ulong, unsigned long) +EINA_CONTAINER_APPEND_WRAPPER(float, float) +EINA_CONTAINER_APPEND_WRAPPER(double, double) +EINA_CONTAINER_APPEND_WRAPPER(string, const char *) +EINA_CONTAINER_APPEND_WRAPPER(ptr, void *) + +EAPI void eina_value_container_get_wrapper(const Eina_Value *value, int i, void *output) +{ + const Eina_Value_Type *tp = eina_value_type_get(value); + if (tp == EINA_VALUE_TYPE_ARRAY) + eina_value_array_get(value, i, output); + else if (tp == EINA_VALUE_TYPE_LIST) + eina_value_list_get(value, i, output); +} + EAPI Eina_Bool eina_value_setup_wrapper(Eina_Value *value, const Eina_Value_Type *type) { diff --git a/src/lib/efreet/efreet_desktop_command.c b/src/lib/efreet/efreet_desktop_command.c index c98ce0fbdf..8c99102c3d 100644 --- a/src/lib/efreet/efreet_desktop_command.c +++ b/src/lib/efreet/efreet_desktop_command.c @@ -464,6 +464,7 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command) } while ((l = eina_list_next(l))); + IF_FREE(exec); return execs; error: IF_FREE(exec); diff --git a/src/lib/efreet/efreet_mime.c b/src/lib/efreet/efreet_mime.c index 68767dcec0..e4e1ba896f 100644 --- a/src/lib/efreet/efreet_mime.c +++ b/src/lib/efreet/efreet_mime.c @@ -9,18 +9,6 @@ #include #include -#ifdef HAVE_NETINET_IN_H -# include -#endif - -#ifdef HAVE_ARPA_INET_H -# include -#endif - -#ifdef _WIN32 -# include -#endif - #include #include @@ -1018,7 +1006,7 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size) tshort = 0; memcpy(&tshort, ptr, sizeof(short)); - entry->value_len = ntohs(tshort); + entry->value_len = eina_ntohs(tshort); ptr += 2; entry->value = NEW(char, entry->value_len); @@ -1059,20 +1047,20 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size) if (entry->word_size == 2) { ((short*)entry->value)[j] = - ntohs(((short*)entry->value)[j]); + eina_ntohs(((short*)entry->value)[j]); if (entry->mask) ((short*)entry->mask)[j] = - ntohs(((short*)entry->mask)[j]); + eina_ntohs(((short*)entry->mask)[j]); } else if (entry->word_size == 4) { ((int*)entry->value)[j] = - ntohl(((int*)entry->value)[j]); + eina_ntohl(((int*)entry->value)[j]); if (entry->mask) ((int*)entry->mask)[j] = - ntohl(((int*)entry->mask)[j]); + eina_ntohl(((int*)entry->mask)[j]); } } } diff --git a/src/lib/eina/eina_config.h.in b/src/lib/eina/eina_config.h.in index dca465d704..c040cc5341 100644 --- a/src/lib/eina/eina_config.h.in +++ b/src/lib/eina/eina_config.h.in @@ -122,6 +122,15 @@ #endif @EINA_CONFIGURE_HAVE_OSX_SEMAPHORE@ +#ifndef EINA_HAVE_WORDS_BIGENDIAN +# undef EINA_HAVE_WORDS_BIGENDIAN +#endif +@EINA_CONFIGURE_HAVE_WORDS_BIGENDIAN@ + +#if ((defined __APPLE_CC__) && (defined __BIG_ENDIAN__)) || (defined EINA_HAVE_WORDS_BIGENDIAN) +# define EINA_HAVE_BIGENDIAN +#endif + #include #endif /* EINA_CONFIG_H_ */ diff --git a/src/lib/eina/eina_convert.c b/src/lib/eina/eina_convert.c index 152ef5be4a..bd2d3c2479 100644 --- a/src/lib/eina/eina_convert.c +++ b/src/lib/eina/eina_convert.c @@ -14,6 +14,10 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; * if not, see . + * + * The code of eina_convert_strtod_c() is based on code published + * under the public domain license, which can be found here: + * https://gist.github.com/mattn/1890186 */ #ifdef HAVE_CONFIG_H @@ -24,6 +28,8 @@ #include #include #include +#include +#include #ifdef _WIN32 # include @@ -453,14 +459,208 @@ eina_convert_atofp(const char *src, int length, Eina_F32p32 *fp) return EINA_TRUE; } +/* + * https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strtod-strtod-l-wcstod-wcstod-l?view=vs-2017 + * + * src should be one of the following form : + * + * [whitespace] [sign] {digits [radix digits] | radix digits} [{e | E} [sign] digits] + * [whitespace] [sign] {INF | INFINITY} + * [whitespace] [sign] NAN [sequence] + * + * No hexadecimal form supported + * no sequence supported after NAN + */ EAPI double eina_convert_strtod_c(const char *nptr, char **endptr) { -#ifdef _WIN32 - return _strtod_l(nptr, endptr, _eina_c_locale_get()); -#else - return strtod_l(nptr, endptr, _eina_c_locale_get()); -#endif + const char *iter; + const char *a; + double val; + unsigned long long integer_part; + int minus; + + EINA_SAFETY_ON_NULL_RETURN_VAL(nptr, 0.0); + + a = iter = nptr; + + /* ignore leading whitespaces */ + while (isspace(*iter)) + iter++; + + /* signed or not */ + minus = 1; + if (*iter == '-') + { + minus = -1; + iter++; + } + else if (*iter == '+') + iter++; + + if (tolower(*iter) == 'i') + { + if ((tolower(*(iter + 1)) == 'n') && + (tolower(*(iter + 2)) == 'f')) + iter += 3; + else + goto on_error; + if (tolower(*(iter + 3)) == 'i') + { + if ((tolower(*(iter + 4)) == 'n') && + (tolower(*(iter + 5)) == 'i') && + (tolower(*(iter + 6)) == 't') && + (tolower(*(iter + 7)) == 'y')) + iter += 5; + else + goto on_error; + } + if (endptr) + *endptr = (char *)iter; + return (minus == -1) ? -INFINITY : INFINITY; + } + + if (tolower(*iter) == 'n') + { + if ((tolower(*(iter + 1)) == 'a') && + (tolower(*(iter + 2)) == 'n')) + iter += 3; + else + goto on_error; + if (endptr) + *endptr = (char *)iter; + return (minus == -1) ? -NAN : NAN; + } + + integer_part = 0; + + /* (optional) integer part before dot */ + if (isdigit(*iter)) + { + for (; isdigit(*iter); iter++) + integer_part = integer_part * 10ULL + (unsigned long long)(*iter - '0'); + a = iter; + } + else if (*iter != '.') + { + val = 0.0; + goto on_success; + } + + val = (double)integer_part; + + /* (optional) decimal part after dot */ + if (*iter == '.') + { + unsigned long long decimal_part; + unsigned long long pow10; + int count; + + iter++; + + decimal_part = 0; + count = 0; + pow10 = 1; + + if (isdigit(*iter)) + { + for (; isdigit(*iter); iter++, count++) + { + if (count < 19) + { + decimal_part = decimal_part * 10ULL + + (unsigned long long)(*iter - '0'); + pow10 *= 10ULL; + } + } + } + val += (double)decimal_part / (double)pow10; + a = iter; + } + + /* (optional) exponent */ + if ((*iter == 'e') || (*iter == 'E')) + { + double scale = 1.0; + unsigned int expo_part; + int minus_e; + + iter++; + + /* signed or not */ + minus_e = 1; + if (*iter == '-') + { + minus_e = -1; + iter++; + } + else if (*iter == '+') + iter++; + + /* exponential part */ + expo_part = 0; + if (isdigit(*iter)) + { + while (*iter == 0) + iter++; + + for (; isdigit(*iter); iter++) + { + expo_part = expo_part * 10U + (unsigned int)(*iter - '0'); + } + } + else if (!isdigit(*(a - 1))) + { + a = nptr; + goto on_success; + } + else if (*iter == 0) + goto on_success; + + if ((val == 2.2250738585072011) && ((minus_e * (int)expo_part) == -308)) + { + val *= 1.0e-308; + a = iter; + errno = ERANGE; + goto on_success; + } + + if ((val == 2.2250738585072012) && ((minus_e * (int)expo_part) <= -308)) + { + val *= 1.0e-308; + a = iter; + goto on_success; + } + + a = iter; + + while (expo_part >= 8U) + { + scale *= 1E8; + expo_part -= 8U; + } + while (expo_part > 0U) + { + scale *= 10.0; + expo_part--; + } + + val = (minus_e == -1) ? (val / scale) : (val * scale); + } + else if ((iter > nptr) && !isdigit(*(iter - 1))) + { + a = nptr; + goto on_success; + } + + on_success: + if (endptr) + *endptr = (char *)a; + return minus * val; + + on_error: + if (endptr) + *endptr = (char *)nptr; + return 0.0; } /** diff --git a/src/lib/eina/eina_cpu.h b/src/lib/eina/eina_cpu.h index 6426017be6..35172a7a3b 100644 --- a/src/lib/eina/eina_cpu.h +++ b/src/lib/eina/eina_cpu.h @@ -116,13 +116,25 @@ static inline unsigned int eina_swap32(unsigned int x); * @brief Reverses the byte order of a 64-bit (destination) register. * * @param[in] x The binary word to swap - * @return A byte order swapped 64-bit integer. + * @return A byte order swapped 64-bit integer. * * On big endian systems, the number is converted to little endian byte order. * On little endian systems, the number is converted to big endian byte order. */ static inline unsigned long long eina_swap64(unsigned long long x); +static inline unsigned short eina_htons(unsigned short host); + +static inline unsigned int eina_htonl(unsigned int host); + +static inline unsigned long long eina_htonll(unsigned long long host); + +static inline unsigned short eina_ntohs(unsigned short net); + +static inline unsigned int eina_ntohl(unsigned int net); + +static inline unsigned long long eina_ntohll(unsigned long long net); + #ifndef MIN # define MIN(x, y) (((x) > (y)) ? (y) : (x)) #endif diff --git a/src/lib/eina/eina_debug.c b/src/lib/eina/eina_debug.c index 7ec64e7b69..c29e2f3db9 100644 --- a/src/lib/eina/eina_debug.c +++ b/src/lib/eina/eina_debug.c @@ -477,7 +477,7 @@ eina_debug_remote_connect(int port) //Prepare the sockaddr_in structure server.sin_family = AF_INET; if (inet_pton(AF_INET, "127.0.0.1", &server.sin_addr.s_addr) != 1) goto err; - server.sin_port = htons(port); + server.sin_port = eina_htons(port); if (connect(fd, (struct sockaddr *)&server, sizeof(server)) < 0) { diff --git a/src/lib/eina/eina_error.c b/src/lib/eina/eina_error.c index a7faadeb3b..7922933e59 100644 --- a/src/lib/eina/eina_error.c +++ b/src/lib/eina/eina_error.c @@ -25,10 +25,6 @@ #include #include -#ifdef _WIN32 -# include -#endif - #include "eina_config.h" #include "eina_private.h" @@ -111,6 +107,18 @@ _eina_error_msg_alloc(void) return _eina_errors + idx; } +#ifdef _WIN32 +# define HAVE_STRERROR_R +# ifdef STRERROR_R_CHAR_P +# undef STRERROR_R_CHAR_P +# endif +/* Windows has strerror_s(), similar to POSIX strerror_r() */ +static inline int strerror_r(int errnum, char *buf, size_t buflen) +{ + return strerror_s(buf, buflen, errnum); +} +#endif + /** * @endcond */ diff --git a/src/lib/eina/eina_error.h b/src/lib/eina/eina_error.h index 80d243b165..c21cb7bc7e 100644 --- a/src/lib/eina/eina_error.h +++ b/src/lib/eina/eina_error.h @@ -147,7 +147,7 @@ EAPI Eina_Error eina_error_msg_static_register(const char *msg) EINA_ARG_NONNUL * @details This function modifies the message associated with @p error and changes * it to @p msg. If the error is previously registered by @ref eina_error_msg_static_register * then the string is not duplicated, otherwise the previous message - * is unrefed and @p msg is copied. + * is unref'ed and @p msg is copied. * * @param[in] error The Eina_Error to change the message of * @param[in] msg The description of the error \n diff --git a/src/lib/eina/eina_file_win32.c b/src/lib/eina/eina_file_win32.c index 537723e01b..7ed6d030ef 100644 --- a/src/lib/eina/eina_file_win32.c +++ b/src/lib/eina/eina_file_win32.c @@ -736,13 +736,17 @@ eina_file_open(const char *path, Eina_Bool shared) if (handle == INVALID_HANDLE_VALUE) { + errno = GetLastError(); WRN("eina_file_open() failed with file %s: %s", - filename, evil_last_error_get()); + filename, evil_format_message(errno)); goto free_file; } if (!GetFileAttributesEx(filename, GetFileExInfoStandard, &fad)) - goto close_handle; + { + errno = GetLastError(); + goto close_handle; + } length.u.LowPart = fad.nFileSizeLow; length.u.HighPart = fad.nFileSizeHigh; diff --git a/src/lib/eina/eina_inline_cpu.x b/src/lib/eina/eina_inline_cpu.x index 17d5cd01be..d26bdcce7c 100644 --- a/src/lib/eina/eina_inline_cpu.x +++ b/src/lib/eina/eina_inline_cpu.x @@ -88,7 +88,64 @@ eina_swap64(unsigned long long x) #endif } +static inline unsigned short +eina_htons(unsigned short host) +{ +#ifdef EINA_HAVE_BIGENDIAN + return host; +#else + return eina_swap16(host); +#endif +} +static inline unsigned int +eina_htonl(unsigned int host) +{ +#ifdef EINA_HAVE_BIGENDIAN + return host; +#else + return eina_swap32(host); +#endif +} + +static inline unsigned long long +eina_htonll(unsigned long long host) +{ +#ifdef EINA_HAVE_BIGENDIAN + return host; +#else + return eina_swap64(host); +#endif +} + +static inline unsigned short +eina_ntohs(unsigned short net) +{ +#ifdef EINA_HAVE_BIGENDIAN + return net; +#else + return eina_swap16(net); +#endif +} + +static inline unsigned int +eina_ntohl(unsigned int net) +{ +#ifdef EINA_HAVE_BIGENDIAN + return net; +#else + return eina_swap32(net); +#endif +} + +static inline unsigned long long +eina_ntohll(unsigned long long net) +{ +#ifdef EINA_HAVE_BIGENDIAN + return net; +#else + return eina_swap64(net); +#endif +} #endif - diff --git a/src/lib/eina/eina_inline_modinfo.x b/src/lib/eina/eina_inline_modinfo.x index 7c931dab27..582b7caf5a 100644 --- a/src/lib/eina/eina_inline_modinfo.x +++ b/src/lib/eina/eina_inline_modinfo.x @@ -32,7 +32,8 @@ __attribute__((__used__)) __attribute__((unused, aligned(1))) = info; * @defgroup Eina_Module_Group Module * * These macros allow you to define module informations like author/description/version/license. - * eina_modinfo can show these informations to users + * eina_modinfo - shows information about an eina module. + * eina_modinfo pulls out information from the eina modules given on command line. * * $ eina_modinfo module.so * version: 0.1 diff --git a/src/lib/eina/eina_inline_value_util.x b/src/lib/eina/eina_inline_value_util.x index f755b4bf1c..09a7996087 100644 --- a/src/lib/eina/eina_inline_value_util.x +++ b/src/lib/eina/eina_inline_value_util.x @@ -16,6 +16,10 @@ * if not, see . */ +/** + * @addtogroup Eina_Value_Value_group + * @{ + */ #ifndef EINA_INLINE_VALUE_UTIL_X_ #define EINA_INLINE_VALUE_UTIL_X_ @@ -127,855 +131,169 @@ eina_value_type_offset(const Eina_Value_Type *type, unsigned int base) return base + padding; } +/// @brief For internal use only. +/// @hideinitializer +#define EINA_VALUE_NEW(Compress_Type, Uppercase_Compress_Type, Type) \ /** - * @brief Create a new #Eina_Value containing the passed parameter - * @param c The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value * -eina_value_uchar_new(unsigned char c) -{ - Eina_Value *v; - - v = eina_value_new(EINA_VALUE_TYPE_UCHAR); - if (v) eina_value_set(v, c); - return v; + @brief Create a new #Eina_Value containing the passed parameter + @param c The value to use + @return The #Eina_Value + @since 1.21 + */ \ +static inline Eina_Value * \ +eina_value_##Compress_Type##_new(Type c) \ +{ \ + Eina_Value *v; \ + \ + v = eina_value_new(EINA_VALUE_TYPE_##Uppercase_Compress_Type); \ + if (v) eina_value_set(v, c); \ + return v; \ } -/** - * @brief Create a new #Eina_Value containing the passed parameter - * @param s The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value * -eina_value_ushort_new(unsigned short s) -{ - Eina_Value *v; +EINA_VALUE_NEW(uchar, UCHAR, unsigned char); +EINA_VALUE_NEW(ushort, USHORT, unsigned short); +EINA_VALUE_NEW(uint, UINT, unsigned int); +EINA_VALUE_NEW(ulong, ULONG, unsigned long); +EINA_VALUE_NEW(uint64, UINT64, uint64_t); +EINA_VALUE_NEW(char, CHAR, char); +EINA_VALUE_NEW(short, SHORT, short); +EINA_VALUE_NEW(int, INT, int); +EINA_VALUE_NEW(long, LONG, long); +EINA_VALUE_NEW(int64, INT64, int64_t); +EINA_VALUE_NEW(float, FLOAT, float); +EINA_VALUE_NEW(double, DOUBLE, double); +EINA_VALUE_NEW(bool, BOOL, Eina_Bool); +EINA_VALUE_NEW(string, STRING, const char *); +EINA_VALUE_NEW(stringshare, STRINGSHARE, const char *); +EINA_VALUE_NEW(time, TIMESTAMP, time_t); +EINA_VALUE_NEW(error, ERROR, Eina_Error); - v = eina_value_new(EINA_VALUE_TYPE_USHORT); - if (v) eina_value_set(v, s); - return v; +/// @brief For internal use only. +/// @hideinitializer +#define EINA_VALUE_INIT(Compress_Type, Uppercase_Compress_Type, Type) \ +/** + @brief Initialize #Eina_Value containing the passed parameter + @param c The value to use + @return The #Eina_Value + @since 1.21 + */ \ +static inline Eina_Value \ +eina_value_##Compress_Type##_init(Type c) \ +{ \ + Eina_Value v = EINA_VALUE_EMPTY; \ + \ + if (eina_value_setup(&v, EINA_VALUE_TYPE_##Uppercase_Compress_Type)) \ + eina_value_set(&v, c); \ + return v; \ } -/** - * @brief Create a new #Eina_Value containing the passed parameter - * @param i The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value * -eina_value_uint_new(unsigned int i) -{ - Eina_Value *v; +EINA_VALUE_INIT(uchar, UCHAR, unsigned char); +EINA_VALUE_INIT(ushort, USHORT, unsigned short); +EINA_VALUE_INIT(uint, UINT, unsigned int); +EINA_VALUE_INIT(ulong, ULONG, unsigned long); +EINA_VALUE_INIT(uint64, UINT64, uint64_t); +EINA_VALUE_INIT(char, CHAR, char); +EINA_VALUE_INIT(short, SHORT, short); +EINA_VALUE_INIT(int, INT, int); +EINA_VALUE_INIT(long, LONG, long); +EINA_VALUE_INIT(int64, INT64, int64_t); +EINA_VALUE_INIT(float, FLOAT, float); +EINA_VALUE_INIT(double, DOUBLE, double); +EINA_VALUE_INIT(bool, BOOL, Eina_Bool); +EINA_VALUE_INIT(string, STRING, const char *); +EINA_VALUE_INIT(stringshare, STRINGSHARE, const char *); +EINA_VALUE_INIT(time, TIMESTAMP, time_t); +EINA_VALUE_INIT(error, ERROR, Eina_Error); - v = eina_value_new(EINA_VALUE_TYPE_UINT); - if (v) eina_value_set(v, i); - return v; +/// @brief For internal use only. +/// @hideinitializer +#define EINA_VALUE_GET(Compress_Type, Uppercase_Compress_Type, Type) \ +/** + @brief Check value type and get contents. + @param v The value to check type and get contents. + @param c Where to store the value contents. + @return #EINA_TRUE if type matches and fetched contents, + #EINA_FALSE on different type or failures. + @since 1.21 + */ \ +static inline Eina_Bool \ +eina_value_##Compress_Type##_get(const Eina_Value *v, Type *c) \ +{ \ + EINA_SAFETY_ON_NULL_RETURN_VAL(c, EINA_FALSE); \ + *c = 0; \ + if (v && v->type == EINA_VALUE_TYPE_##Uppercase_Compress_Type) \ + return eina_value_get(v, c); \ + return EINA_FALSE; \ } -/** - * @brief Create a new #Eina_Value containing the passed parameter - * @param l The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value * -eina_value_ulong_new(unsigned long l) -{ - Eina_Value *v; +EINA_VALUE_GET(uchar, UCHAR, unsigned char); +EINA_VALUE_GET(ushort, USHORT, unsigned short); +EINA_VALUE_GET(uint, UINT, unsigned int); +EINA_VALUE_GET(ulong, ULONG, unsigned long); +EINA_VALUE_GET(uint64, UINT64, uint64_t); +EINA_VALUE_GET(char, CHAR, char); +EINA_VALUE_GET(short, SHORT, short); +EINA_VALUE_GET(int, INT, int); +EINA_VALUE_GET(long, LONG, long); +EINA_VALUE_GET(int64, INT64, int64_t); +EINA_VALUE_GET(float, FLOAT, float); +EINA_VALUE_GET(double, DOUBLE, double); +EINA_VALUE_GET(bool, BOOL, Eina_Bool); +EINA_VALUE_GET(string, STRING, const char *); +EINA_VALUE_GET(stringshare, STRINGSHARE, const char *); +EINA_VALUE_GET(time, TIMESTAMP, time_t); +EINA_VALUE_GET(error, ERROR, Eina_Error); - v = eina_value_new(EINA_VALUE_TYPE_ULONG); - if (v) eina_value_set(v, l); - return v; +/// @brief For internal use only. +/// @hideinitializer +#define EINA_VALUE_CONVERT(Compress_Type, Uppercase_Compress_Type, Type) \ +/** + @brief Check value type and convert contents. + @param v The value to check type and convert contents. + @param c Where to store the value contents. + @return #EINA_TRUE if type matches and fetched contents, + #EINA_FALSE on different type or failures. + @since 1.22 + */ \ +static inline Eina_Bool \ +eina_value_##Compress_Type##_convert(const Eina_Value *v, Type *c) \ +{ \ + Eina_Value dst = EINA_VALUE_EMPTY; \ + Eina_Bool r = EINA_FALSE; \ + \ + EINA_SAFETY_ON_NULL_RETURN_VAL(c, EINA_FALSE); \ + EINA_SAFETY_ON_NULL_RETURN_VAL(v, EINA_FALSE); \ + \ + /* Try no conversion first */ \ + if (eina_value_##Compress_Type##_get(v, c)) return EINA_TRUE; \ + \ + if (!eina_value_setup(&dst, EINA_VALUE_TYPE_##Uppercase_Compress_Type)) return EINA_FALSE; \ + if (!eina_value_convert(v, &dst)) goto on_error; \ + if (!eina_value_##Compress_Type##_get(&dst, c)) goto on_error; \ + r = EINA_TRUE; \ + \ + on_error: \ + eina_value_flush(&dst); \ + return r; \ } -/** - * @brief Create a new #Eina_Value containing the passed parameter - * @param i The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value * -eina_value_uint64_new(uint64_t i) -{ - Eina_Value *v; - - v = eina_value_new(EINA_VALUE_TYPE_UINT64); - if (v) eina_value_set(v, i); - return v; -} - -/** - * @brief Create a new #Eina_Value containing the passed parameter - * @param c The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value * -eina_value_char_new(char c) -{ - Eina_Value *v; - - v = eina_value_new(EINA_VALUE_TYPE_CHAR); - if (v) eina_value_set(v, c); - return v; -} - -/** - * @brief Create a new #Eina_Value containing the passed parameter - * @param s The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value * -eina_value_short_new(short s) -{ - Eina_Value *v; - - v = eina_value_new(EINA_VALUE_TYPE_SHORT); - if (v) eina_value_set(v, s); - return v; -} - -/** - * @brief Create a new #Eina_Value containing the passed parameter - * @param i The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value * -eina_value_int_new(int i) -{ - Eina_Value *v; - - v = eina_value_new(EINA_VALUE_TYPE_INT); - if (v) eina_value_set(v, i); - return v; -} - -/** - * @brief Create a new #Eina_Value containing the passed parameter - * @param l The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value * -eina_value_long_new(long l) -{ - Eina_Value *v; - - v = eina_value_new(EINA_VALUE_TYPE_LONG); - if (v) eina_value_set(v, l); - return v; -} - -/** - * @brief Create a new #Eina_Value containing the passed parameter - * @param i The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value * -eina_value_int64_new(int64_t i) -{ - Eina_Value *v; - - v = eina_value_new(EINA_VALUE_TYPE_INT64); - if (v) eina_value_set(v, i); - return v; -} - -/** - * @brief Create a new #Eina_Value containing the passed parameter - * @param f The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value * -eina_value_float_new(float f) -{ - Eina_Value *v; - - v = eina_value_new(EINA_VALUE_TYPE_FLOAT); - if (v) eina_value_set(v, f); - return v; -} - -/** - * @brief Create a new #Eina_Value containing the passed parameter - * @param d The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value * -eina_value_double_new(double d) -{ - Eina_Value *v; - - v = eina_value_new(EINA_VALUE_TYPE_DOUBLE); - if (v) eina_value_set(v, d); - return v; -} - -/** - * @brief Create a new #Eina_Value containing the passed parameter - * @param b The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value * -eina_value_bool_new(Eina_Bool b) -{ - Eina_Value *v; - - v = eina_value_new(EINA_VALUE_TYPE_BOOL); - if (v) eina_value_set(v, b); - return v; -} - -/** - * @brief Create a new #Eina_Value containing the passed parameter - * @param str The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value * -eina_value_string_new(const char *str) -{ - Eina_Value *v; - - v = eina_value_new(EINA_VALUE_TYPE_STRING); - if (v) eina_value_set(v, str); - return v; -} - -/** - * @brief Create a new #Eina_Value containing the passed parameter - * @param str The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value * -eina_value_stringshare_new(const char *str) -{ - Eina_Value *v; - - v = eina_value_new(EINA_VALUE_TYPE_STRINGSHARE); - if (v) eina_value_set(v, str); - return v; -} - -/** - * @brief Create a new #Eina_Value containing the passed parameter - * @param t The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value * -eina_value_time_new(time_t t) -{ - Eina_Value *v; - - v = eina_value_new(EINA_VALUE_TYPE_TIMESTAMP); - if (v) eina_value_set(v, t); - return v; -} - -/** - * @brief Create a new #Eina_Value containing the passed parameter - * @param err The error code - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value * -eina_value_error_new(Eina_Error err) -{ - Eina_Value *v; - - v = eina_value_new(EINA_VALUE_TYPE_ERROR); - if (v) eina_value_set(v, err); - return v; -} - -/** - * @brief Initialize #Eina_Value containing the passed parameter - * @param c The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value -eina_value_uchar_init(unsigned char c) -{ - Eina_Value v = EINA_VALUE_EMPTY; - - if (eina_value_setup(&v, EINA_VALUE_TYPE_UCHAR)) - eina_value_set(&v, c); - return v; -} - -/** - * @brief Initialize #Eina_Value containing the passed parameter - * @param s The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value -eina_value_ushort_init(unsigned short s) -{ - Eina_Value v = EINA_VALUE_EMPTY; - - if (eina_value_setup(&v, EINA_VALUE_TYPE_USHORT)) - eina_value_set(&v, s); - return v; -} - -/** - * @brief Initialize #Eina_Value containing the passed parameter - * @param i The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value -eina_value_uint_init(unsigned int i) -{ - Eina_Value v = EINA_VALUE_EMPTY; - - if (eina_value_setup(&v, EINA_VALUE_TYPE_UINT)) - eina_value_set(&v, i); - return v; -} - -/** - * @brief Create a new #EinaInitializeining the passed parameter - * @param l The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value -eina_value_ulong_init(unsigned long l) -{ - Eina_Value v = EINA_VALUE_EMPTY; - - if (eina_value_setup(&v, EINA_VALUE_TYPE_ULONG)) - eina_value_set(&v, l); - return v; -} - -/** - * @brief Initialize #Eina_Value containing the passed parameter - * @param i The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value -eina_value_uint64_init(uint64_t i) -{ - Eina_Value v = EINA_VALUE_EMPTY; - - if (eina_value_setup(&v, EINA_VALUE_TYPE_UINT64)) - eina_value_set(&v, i); - return v; -} - -/** - * @brief Create a new #EinaInitializeining the passed parameter - * @param c The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value -eina_value_char_init(char c) -{ - Eina_Value v = EINA_VALUE_EMPTY; - - if (eina_value_setup(&v, EINA_VALUE_TYPE_CHAR)) - eina_value_set(&v, c); - return v; -} - -/** - * @brief Initialize #Eina_Value containing the passed parameter - * @param s The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value -eina_value_short_init(short s) -{ - Eina_Value v = EINA_VALUE_EMPTY; - - if (eina_value_setup(&v, EINA_VALUE_TYPE_SHORT)) - eina_value_set(&v, s); - return v; -} - -/** - * @brief Create a new #EinaInitializeining the passed parameter - * @param i The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value -eina_value_int_init(int i) -{ - Eina_Value v = EINA_VALUE_EMPTY; - - if (eina_value_setup(&v, EINA_VALUE_TYPE_INT)) - eina_value_set(&v, i); - return v; -} - -/** - * @brief Initialize #Eina_Value containing the passed parameter - * @param l The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value -eina_value_long_init(long l) -{ - Eina_Value v = EINA_VALUE_EMPTY; - - if (eina_value_setup(&v, EINA_VALUE_TYPE_LONG)) - eina_value_set(&v, l); - return v; -} - -/** - * @brief Create a new #EinaInitializeining the passed parameter - * @param i The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value -eina_value_int64_init(int64_t i) -{ - Eina_Value v = EINA_VALUE_EMPTY; - - if (eina_value_setup(&v, EINA_VALUE_TYPE_INT64)) - eina_value_set(&v, i); - return v; -} - -/** - * @brief Initialize #Eina_Value containing the passed parameter - * @param f The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value -eina_value_float_init(float f) -{ - Eina_Value v = EINA_VALUE_EMPTY; - - if (eina_value_setup(&v, EINA_VALUE_TYPE_FLOAT)) - eina_value_set(&v, f); - return v; -} - -/** - * @brief Create a new #EinaInitializeining the passed parameter - * @param d The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value -eina_value_double_init(double d) -{ - Eina_Value v = EINA_VALUE_EMPTY; - - if (eina_value_setup(&v, EINA_VALUE_TYPE_DOUBLE)) - eina_value_set(&v, d); - return v; -} - -/** - * @brief Initialize #Eina_Value containing the passed parameter - * @param b The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value -eina_value_bool_init(Eina_Bool b) -{ - Eina_Value v = EINA_VALUE_EMPTY; - - if (eina_value_setup(&v, EINA_VALUE_TYPE_BOOL)) - eina_value_set(&v, b); - return v; -} - -/** - * @brief Create a new #EinaInitializeining the passed parameter - * @param str The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value -eina_value_string_init(const char *str) -{ - Eina_Value v = EINA_VALUE_EMPTY; - - if (eina_value_setup(&v, EINA_VALUE_TYPE_STRING)) - eina_value_set(&v, str); - return v; -} - -/** - * @brief Initialize #Eina_Value containing the passed parameter - * @param str The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value -eina_value_stringshare_init(const char *str) -{ - Eina_Value v = EINA_VALUE_EMPTY; - - if (eina_value_setup(&v, EINA_VALUE_TYPE_STRINGSHARE)) - eina_value_set(&v, str); - return v; -} - -/** - * @brief Create a new #EinaInitializeining the passed parameter - * @param t The value to use - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value -eina_value_time_init(time_t t) -{ - Eina_Value v = EINA_VALUE_EMPTY; - - if (eina_value_setup(&v, EINA_VALUE_TYPE_TIMESTAMP)) - eina_value_set(&v, t); - return v; -} - -/** - * @brief Initialize #Eina_Value containing the passed parameter - * @param err The error code - * @return The #Eina_Value - * @since 1.21 - */ -static inline Eina_Value -eina_value_error_init(Eina_Error err) -{ - Eina_Value v = EINA_VALUE_EMPTY; - - if (eina_value_setup(&v, EINA_VALUE_TYPE_ERROR)) - eina_value_set(&v, err); - return v; -} - -/** - * @brief Check value type and get contents. - * @param v The value to check type and get contents. - * @param c Where to store the value contents. - * @return #EINA_TRUE if type matches and fetched contents, - * #EINA_FALSE on different type or failures. - * @since 1.21 - */ -static inline Eina_Bool -eina_value_uchar_get(const Eina_Value *v, unsigned char *c) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(c, EINA_FALSE); - *c = 0; - if (v && v->type == EINA_VALUE_TYPE_UCHAR) - return eina_value_get(v, c); - return EINA_FALSE; -} - -/** - * @brief Check value type and get contents. - * @param v The value to check type and get contents. - * @param s Where to store the value contents. - * @return #EINA_TRUE if type matches and fetched contents, - * #EINA_FALSE on different type or failures. - * @since 1.21 - */ -static inline Eina_Bool -eina_value_ushort_get(const Eina_Value *v, unsigned short *s) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(s, EINA_FALSE); - *s = 0; - if (v && v->type == EINA_VALUE_TYPE_USHORT) - return eina_value_get(v, s); - return EINA_FALSE; -} - -/** - * @brief Check value type and get contents. - * @param v The value to check type and get contents. - * @param i Where to store the value contents. - * @return #EINA_TRUE if type matches and fetched contents, - * #EINA_FALSE on different type or failures. - * @since 1.21 - */ -static inline Eina_Bool -eina_value_uint_get(const Eina_Value *v, unsigned int *i) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(i, EINA_FALSE); - *i = 0; - if (v && v->type == EINA_VALUE_TYPE_UINT) - return eina_value_get(v, i); - return EINA_FALSE; -} - -/** - * @brief Check value type and get contents. - * @param v The value to check type and get contents. - * @param l Where to store the value contents. - * @return #EINA_TRUE if type matches and fetched contents, - * #EINA_FALSE on different type or failures. - * @since 1.21 - */ -static inline Eina_Bool -eina_value_ulong_get(const Eina_Value *v, unsigned long *l) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(l, EINA_FALSE); - *l = 0; - if (v && v->type == EINA_VALUE_TYPE_ULONG) - return eina_value_get(v, l); - return EINA_FALSE; -} - -/** - * @brief Check value type and get contents. - * @param v The value to check type and get contents. - * @param i Where to store the value contents. - * @return #EINA_TRUE if type matches and fetched contents, - * #EINA_FALSE on different type or failures. - * @since 1.21 - */ -static inline Eina_Bool -eina_value_uint64_get(const Eina_Value *v, uint64_t *i) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(i, EINA_FALSE); - *i = 0; - if (v && v->type == EINA_VALUE_TYPE_UINT64) - return eina_value_get(v, i); - return EINA_FALSE; -} - -/** - * @brief Check value type and get contents. - * @param v The value to check type and get contents. - * @param c Where to store the value contents. - * @return #EINA_TRUE if type matches and fetched contents, - * #EINA_FALSE on different type or failures. - * @since 1.21 - */ -static inline Eina_Bool -eina_value_char_get(const Eina_Value *v, char *c) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(c, EINA_FALSE); - *c = 0; - if (v && v->type == EINA_VALUE_TYPE_CHAR) - return eina_value_get(v, c); - return EINA_FALSE; -} - -/** - * @brief Check value type and get contents. - * @param v The value to check type and get contents. - * @param s Where to store the value contents. - * @return #EINA_TRUE if type matches and fetched contents, - * #EINA_FALSE on different type or failures. - * @since 1.21 - */ -static inline Eina_Bool -eina_value_short_get(const Eina_Value *v, short *s) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(s, EINA_FALSE); - *s = 0; - if (v && v->type == EINA_VALUE_TYPE_SHORT) - return eina_value_get(v, s); - return EINA_FALSE; -} - -/** - * @brief Check value type and get contents. - * @param v The value to check type and get contents. - * @param i Where to store the value contents. - * @return #EINA_TRUE if type matches and fetched contents, - * #EINA_FALSE on different type or failures. - * @since 1.21 - */ -static inline Eina_Bool -eina_value_int_get(const Eina_Value *v, int *i) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(i, EINA_FALSE); - *i = 0; - if (v && v->type == EINA_VALUE_TYPE_INT) - return eina_value_get(v, i); - return EINA_FALSE; -} - -/** - * @brief Check value type and get contents. - * @param v The value to check type and get contents. - * @param l Where to store the value contents. - * @return #EINA_TRUE if type matches and fetched contents, - * #EINA_FALSE on different type or failures. - * @since 1.21 - */ -static inline Eina_Bool -eina_value_long_get(const Eina_Value *v, long *l) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(l, EINA_FALSE); - *l = 0; - if (v && v->type == EINA_VALUE_TYPE_LONG) - return eina_value_get(v, l); - return EINA_FALSE; -} - -/** - * @brief Check value type and get contents. - * @param v The value to check type and get contents. - * @param i Where to store the value contents. - * @return #EINA_TRUE if type matches and fetched contents, - * #EINA_FALSE on different type or failures. - * @since 1.21 - */ -static inline Eina_Bool -eina_value_int64_get(const Eina_Value *v, int64_t *i) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(i, EINA_FALSE); - *i = 0; - if (v && v->type == EINA_VALUE_TYPE_INT64) - return eina_value_get(v, i); - return EINA_FALSE; -} - -/** - * @brief Check value type and get contents. - * @param v The value to check type and get contents. - * @param f Where to store the value contents. - * @return #EINA_TRUE if type matches and fetched contents, - * #EINA_FALSE on different type or failures. - * @since 1.21 - */ -static inline Eina_Bool -eina_value_float_get(const Eina_Value *v, float *f) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(f, EINA_FALSE); - *f = 0.0f; - if (v && v->type == EINA_VALUE_TYPE_FLOAT) - return eina_value_get(v, f); - return EINA_FALSE; -} - -/** - * @brief Check value type and get contents. - * @param v The value to check type and get contents. - * @param d Where to store the value contents. - * @return #EINA_TRUE if type matches and fetched contents, - * #EINA_FALSE on different type or failures. - * @since 1.21 - */ -static inline Eina_Bool -eina_value_double_get(const Eina_Value *v, double *d) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(d, EINA_FALSE); - *d = 0.0; - if (v && v->type == EINA_VALUE_TYPE_DOUBLE) - return eina_value_get(v, d); - return EINA_FALSE; -} - -/** - * @brief Check value type and get contents. - * @param v The value to check type and get contents. - * @param b Where to store the value contents. - * @return #EINA_TRUE if type matches and fetched contents, - * #EINA_FALSE on different type or failures. - * @since 1.21 - */ -static inline Eina_Bool -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_BOOL) - return eina_value_get(v, b); - return EINA_FALSE; -} - -/** - * @brief Check value type and get contents. - * @param v The value to check type and get contents. - * @param str Where to store the value contents. - * @return #EINA_TRUE if type matches and fetched contents, - * #EINA_FALSE on different type or failures. - * @since 1.21 - */ -static inline Eina_Bool -eina_value_string_get(const Eina_Value *v, const char **str) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(str, EINA_FALSE); - *str = NULL; - if (v && v->type == EINA_VALUE_TYPE_STRING) - return eina_value_get(v, str); - return EINA_FALSE; -} - -/** - * @brief Check value type and get contents. - * @param v The value to check type and get contents. - * @param str Where to store the value contents. - * @return #EINA_TRUE if type matches and fetched contents, - * #EINA_FALSE on different type or failures. - * @since 1.21 - */ -static inline Eina_Bool -eina_value_stringshare_get(const Eina_Value *v, const char **str) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(str, EINA_FALSE); - *str = NULL; - if (v && v->type == EINA_VALUE_TYPE_STRINGSHARE) - return eina_value_get(v, str); - return EINA_FALSE; -} - -/** - * @brief Check value type and get contents. - * @param v The value to check type and get contents. - * @param t Where to store the value contents. - * @return #EINA_TRUE if type matches and fetched contents, - * #EINA_FALSE on different type or failures. - * @since 1.21 - */ -static inline Eina_Bool -eina_value_time_get(const Eina_Value *v, time_t *t) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(t, EINA_FALSE); - *t = 0; - if (v && v->type == EINA_VALUE_TYPE_TIMESTAMP) - return eina_value_get(v, t); - return EINA_FALSE; -} - -/** - * @brief Check value type and get contents. - * @param v The value to check type and get contents. - * @param err Where to store the value contents. - * @return #EINA_TRUE if type matches and fetched contents, - * #EINA_FALSE on different type or failures. - * @since 1.21 - */ -static inline Eina_Bool -eina_value_error_get(const Eina_Value *v, Eina_Error *err) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(err, EINA_FALSE); - *err = 0; - if (v && v->type == EINA_VALUE_TYPE_ERROR) - return eina_value_get(v, err); - return EINA_FALSE; -} +EINA_VALUE_CONVERT(uchar, UCHAR, unsigned char); +EINA_VALUE_CONVERT(ushort, USHORT, unsigned short); +EINA_VALUE_CONVERT(uint, UINT, unsigned int); +EINA_VALUE_CONVERT(ulong, ULONG, unsigned long); +EINA_VALUE_CONVERT(uint64, UINT64, uint64_t); +EINA_VALUE_CONVERT(char, CHAR, char); +EINA_VALUE_CONVERT(short, SHORT, short); +EINA_VALUE_CONVERT(int, INT, int); +EINA_VALUE_CONVERT(long, LONG, long); +EINA_VALUE_CONVERT(int64, INT64, int64_t); +EINA_VALUE_CONVERT(float, FLOAT, float); +EINA_VALUE_CONVERT(double, DOUBLE, double); +EINA_VALUE_CONVERT(bool, BOOL, Eina_Bool); +EINA_VALUE_CONVERT(string, STRING, const char *); +EINA_VALUE_CONVERT(stringshare, STRINGSHARE, const char *); +EINA_VALUE_CONVERT(time, TIMESTAMP, time_t); +EINA_VALUE_CONVERT(error, ERROR, Eina_Error); /** * @brief Create a new #Eina_Value containing the passed parameter @@ -1058,3 +376,7 @@ eina_value_string_copy(const Eina_Value *val, char **str) } #endif + +/** + * @} + */ diff --git a/src/lib/eina/eina_iterator.h b/src/lib/eina/eina_iterator.h index ebfd27c2cc..cb254c7e8e 100644 --- a/src/lib/eina/eina_iterator.h +++ b/src/lib/eina/eina_iterator.h @@ -350,7 +350,7 @@ EAPI Eina_Iterator *eina_carray_length_iterator_new(void** array, unsigned int s EAPI Eina_Iterator* eina_iterator_filter_new(Eina_Iterator *original, Eina_Each_Cb filter, Eina_Free_Cb free_cb, void *data) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; /** - * @brief Creates an Eina_Iterator that iterates through a serie + * @brief Creates an Eina_Iterator that iterates through a series * of Eina_Iterator. * * @param[in] it The first Eina_Iterator to iterate over @@ -367,7 +367,7 @@ EAPI Eina_Iterator *eina_multi_iterator_internal_new(Eina_Iterator *it, ...) EIN /** * @def eina_multi_iterator_new - * @brief Creates an Eina_Iterator that iterates through a serie + * @brief Creates an Eina_Iterator that iterates through a series * of Eina_Iterator. * * @param[in] it The first Eina_Iterator to iterate over diff --git a/src/lib/eina/eina_list.h b/src/lib/eina/eina_list.h index 9216b5dde1..1a2413894f 100644 --- a/src/lib/eina/eina_list.h +++ b/src/lib/eina/eina_list.h @@ -167,7 +167,7 @@ * @until demote * * Removing elements from a list can be done with ease: - * @until sagitarius + * @until sagittarius * * To replace an element in the list it is not necessary to remove it and then * re-add with the new value, it is possible to just change the value of a node: diff --git a/src/lib/eina/eina_log.c b/src/lib/eina/eina_log.c index 52cf8f98ac..b6c5632267 100644 --- a/src/lib/eina/eina_log.c +++ b/src/lib/eina/eina_log.c @@ -1720,7 +1720,10 @@ eina_log_print_cb_set(Eina_Log_Print_Cb cb, void *data) { #ifdef EINA_ENABLE_LOG LOG_LOCK(); - _print_cb = cb; + if (cb) + _print_cb = cb; + else + _print_cb = eina_log_print_cb_stderr; _print_cb_data = data; eina_log_print_prefix_update(); LOG_UNLOCK(); diff --git a/src/lib/eina/eina_main.c b/src/lib/eina/eina_main.c index 535e4e7611..024d1e3eaa 100644 --- a/src/lib/eina/eina_main.c +++ b/src/lib/eina/eina_main.c @@ -85,7 +85,6 @@ static int _eina_main_count = 0; static int _eina_main_thread_count = 0; #endif static int _eina_log_dom = -1; -static locale_t _eina_c_locale; #ifdef ERR #undef ERR @@ -286,12 +285,6 @@ eina_init(void) if (EINA_LIKELY(_eina_main_count > 0)) return ++_eina_main_count; -#ifdef _WIN32 - _eina_c_locale = _create_locale(LC_ALL, "C"); -#else - _eina_c_locale = newlocale(LC_ALL_MASK, "C", NULL); -#endif - srand(time(NULL)); while (eina_seed == 0) eina_seed = rand(); @@ -355,12 +348,6 @@ eina_init(void) return 1; } -locale_t -_eina_c_locale_get(void) -{ - return _eina_c_locale; -} - EAPI int eina_shutdown(void) { @@ -372,12 +359,6 @@ eina_shutdown(void) _eina_main_count--; if (EINA_UNLIKELY(_eina_main_count == 0)) { -#ifdef _WIN32 - _free_locale(_eina_c_locale); -#else - freelocale(_eina_c_locale); -#endif - eina_log_timing(_eina_log_dom, EINA_LOG_STATE_START, EINA_LOG_STATE_SHUTDOWN); diff --git a/src/lib/eina/eina_promise.c b/src/lib/eina/eina_promise.c index 1937c17d90..a5f5c40b5a 100644 --- a/src/lib/eina/eina_promise.c +++ b/src/lib/eina/eina_promise.c @@ -333,6 +333,10 @@ _eina_future_cb_dispatch(Eina_Future *f, const Eina_Value value) { Eina_Future_Cb cb = f->cb; + // Cleaning up prev and past to avoid recursion + if (f->next) f->next->prev = NULL; + if (f->prev) f->prev->next = NULL; + f->cb = EINA_FUTURE_DISPATCHED; if (f->storage) *f->storage = NULL; @@ -364,6 +368,7 @@ _eina_future_dispatch_internal(Eina_Future **f, _eina_promise_value_dbg("No future to deliver value", NULL, value); return value; } + if ((*f)->cb == EINA_FUTURE_DISPATCHED) return value; next_value = _eina_future_cb_dispatch(*f, value); *f = _eina_future_free(*f); return next_value; @@ -396,6 +401,12 @@ _eina_future_dispatch(Eina_Future_Scheduler *scheduler, Eina_Future *f, Eina_Val return; } + // Break early if finding a cb that is already dispatching + if (f->cb == EINA_FUTURE_DISPATCHED) + { + eina_value_flush(&next_value); + return; + } if (next_value.type == &EINA_VALUE_TYPE_PROMISE) { if (EINA_UNLIKELY(eina_log_domain_level_check(_promise_log_dom, EINA_LOG_LEVEL_DBG))) @@ -463,6 +474,8 @@ _eina_future_cancel(Eina_Future *f, int err) while (f) { + // Stop on partially dispatched future + if (f->cb == EINA_FUTURE_DISPATCHED) break; if (f->cb) { Eina_Value r = _eina_future_cb_dispatch(f, value); @@ -635,6 +648,11 @@ _eina_promise_clean_dispatch(Eina_Promise *p, Eina_Value v) // This function is called on a promise created with a scheduler, not a continue one. _eina_future_dispatch(p->scheduler, f, v); } + else + { + // Nobody is going to flush this value if we don't + eina_value_flush(&v); + } eina_mempool_free(_promise_mp, p); } @@ -1200,7 +1218,7 @@ _race_then_cb(void *data, const Eina_Value v, Eina_Promise *p = ctx->base.promise; Eina_Bool found, r; Eina_Value result; - unsigned int i; + unsigned int i = 0; //This is not allowed! assert(v.type != &EINA_VALUE_TYPE_PROMISE); diff --git a/src/lib/eina/eina_promise.h b/src/lib/eina/eina_promise.h index 428da12afa..9de125463e 100644 --- a/src/lib/eina/eina_promise.h +++ b/src/lib/eina/eina_promise.h @@ -52,7 +52,7 @@ typedef struct _Eina_Future_Cb_Log_Desc Eina_Future_Cb_Log_Desc; * * @return An Eina_Value to pass to the next Eina_Future in the chain (if any). * If there is no need to convert the received value, it's @b recommended - * to pass-thru @p value argument. If you need to convert to a different type + * to passthrough @p value argument. If you need to convert to a different type * or generate a new value, use @c eina_value_setup() on @b another Eina_Value * and return it. By returning a promise Eina_Value (eina_promise_as_value()) the * whole chain will wait until the promise is resolved in @@ -205,7 +205,7 @@ typedef void (*Eina_Promise_Cancel_Cb) (void *data, const Eina_Promise *dead_pro * @param[in] value The operation result * @return An Eina_Value to pass to the next Eina_Future in the chain (if any). * If there is no need to convert the received value, it's @b recommended - * to pass-thru @p value argument. If you need to convert to a different type + * to passthrough @p value argument. If you need to convert to a different type * or generate a new value, use @c eina_value_setup() on @b another Eina_Value * and return it. By returning a promise Eina_Value (eina_promise_as_value()) the * whole chain will wait until the promise is resolved in @@ -302,7 +302,7 @@ struct _Eina_Future_Cb_Easy_Desc { * may also return a non-error, in this case the next future in chain will receive a regular * value, which may call its @c success. * - * If this function is not provided, then it will pass thru the error to the next error handler. + * If this function is not provided, then it will passthrough the error to the next error handler. * * It may be called with @c EINVAL if @c success_type is provided and doesn't * match the received type. diff --git a/src/lib/eina/eina_util.h b/src/lib/eina/eina_util.h index 6afd424921..08b15233ab 100644 --- a/src/lib/eina/eina_util.h +++ b/src/lib/eina/eina_util.h @@ -78,7 +78,7 @@ static inline Eina_Bool eina_flt_exact(float a, float b); * * @return @c true if two floats match */ -#define EINA_FLT_EQ(a, b) (!!(fabsf((float)a - (float)b) <= FLT_EPSILON)) +#define EINA_FLT_EQ(a, b) (!!(fabsf((float)(a) - (float)(b)) <= FLT_EPSILON)) /** * @brief Determines if a float is not zero @@ -97,7 +97,7 @@ static inline Eina_Bool eina_flt_exact(float a, float b); * * @return @c true if two double match */ -#define EINA_DBL_EQ(a, b) (!!(fabs((double)a - (double)b) <= DBL_EPSILON)) +#define EINA_DBL_EQ(a, b) (!!(fabs((double)(a) - (double)(b)) <= DBL_EPSILON)) /** * @brief Determines if a double is not zero diff --git a/src/lib/eina/eina_vpath.c b/src/lib/eina/eina_vpath.c index 816d0c7aea..25fa9018c4 100644 --- a/src/lib/eina/eina_vpath.c +++ b/src/lib/eina/eina_vpath.c @@ -188,6 +188,8 @@ eina_vpath_init(void) Eina_Bool eina_vpath_shutdown(void) { + eina_hash_free(vpath_data); + vpath_data = NULL; eina_log_domain_unregister(_eina_vpath_log_dom); _eina_vpath_log_dom = -1; return EINA_TRUE; @@ -212,6 +214,7 @@ _fetch_user_homedir(char **str, const char *name, const char *error) #else ERR("User fetching is disabled on this system\nThe string was: %s", error); return EINA_FALSE; + (void) name; #endif } diff --git a/src/lib/eina/eina_vpath.h b/src/lib/eina/eina_vpath.h index 788ff3602a..77c1e35afe 100644 --- a/src/lib/eina/eina_vpath.h +++ b/src/lib/eina/eina_vpath.h @@ -36,7 +36,7 @@ * (:app.tmp:)/some-temp-file/path/file.txt * * (:usr.desktop:)/file-in-users-desktop-directory.txt - * (:usr.documents:)/letter-to-gradma.doc + * (:usr.documents:)/letter-to-grandma.doc * (:usr.downloads:)/file-downloaded-here.zip * (:usr.music:)/fave-song.mp3 * (:usr.pictures:)/a-photo.,jpg @@ -44,7 +44,7 @@ * (: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.config:)/file-in-user-config-dir * (:usr.cache:)/file-in-user-cache-dir * (:usr.run:)/file-in-xdg-runtime-dir * (:usr.tmp:)/some-temp-file/path/file.txt @@ -86,6 +86,9 @@ typedef const char * Eina_Vpath; /** * Translate a virtual path into a normal path. + * + * The return string is a string allocated by malloc and should be freed with + * free() when no longer needed. * * @param[in] path The path. * @return NULL if failed, or a full normal string file path that is resolved diff --git a/src/lib/eina/eina_vpath_xdg.c b/src/lib/eina/eina_vpath_xdg.c index 5eff5fdb7d..bd36042f5d 100644 --- a/src/lib/eina/eina_vpath_xdg.c +++ b/src/lib/eina/eina_vpath_xdg.c @@ -13,31 +13,65 @@ void eina_xdg_env_init(void) { - char *s; - char home[PATH_MAX]; + char home[PATH_MAX], *s; Eina_Vpath_Interface_User user; eina_vpath_resolve_snprintf(home, sizeof(home), "(:home:)/"); - memset(&user, 0, sizeof(Eina_Vpath_Interface_User)); +#define FATAL_SNPRINTF(_buf, _err, _fmt, ...) \ + do { \ + if ((size_t)snprintf(_buf, sizeof(_buf), _fmt, ## __VA_ARGS__) >= (sizeof(_buf) - 1)) { \ + fprintf(stderr, _err"\n", _buf); \ + abort(); \ + } \ + } while (0) + +#ifdef _WIN32 +# define ENV_SET(_env, _dir, _meta) \ + char _meta[PATH_MAX + 128]; \ + if (_env) { \ + s = getenv(_env); \ + if (!s) s = home; \ + } else s = home; \ + if (_dir) FATAL_SNPRINTF(_meta, "vpath string '%s' truncated - fatal", "%s\\%s", s, (char *)_dir); \ + else FATAL_SNPRINTF(_meta, "vpath string '%s' truncated - fatal", "%s\\", s); \ + (&user)->_meta = _meta; + + ENV_SET(NULL, "Desktop", desktop); + ENV_SET(NULL, "Documents", documents); + ENV_SET(NULL, "Downloads", downloads); + ENV_SET(NULL, "Music", music); + ENV_SET(NULL, "Pictures", pictures); + ENV_SET("CommonProgramFiles", NULL, pub); + ENV_SET("APPDATA", "Microsoft\\Windows\\Templates", templates); + ENV_SET(NULL, "Videos", videos); + ENV_SET("LOCALAPPDATA", NULL, data); + ENV_SET("LOCALAPPDATA", "Temp", tmp); + ENV_SET("APPDATA", NULL, config); + ENV_SET("LOCALAPPDATA", NULL, cache); + if (!(s = getenv("APPDATA"))) + user.run = NULL; + else + user.run = s; +#else /* _WIN32 */ # if defined(HAVE_GETUID) && defined(HAVE_GETEUID) # define ENV_HOME_SET(_env, _dir, _meta) \ char _meta [PATH_MAX + 128]; \ if ((getuid() != geteuid()) || (!(s = getenv(_env)))) { \ - snprintf(_meta, sizeof(_meta), "%s/"_dir, home); \ + FATAL_SNPRINTF(_meta, "vpath string '%s' truncated - fatal", "%s/"_dir, home); \ s = _meta; \ } \ (&user)->_meta = s; -#else +# else # define ENV_HOME_SET(_env, _dir, _meta) \ char _meta [PATH_MAX + 128]; \ if (!(s = getenv(_env))) { \ - snprintf(_meta, sizeof(_meta), "%s/"_dir, home); \ + FATAL_SNPRINTF(_meta, "vpath string '%s' truncated - fatal", "%s/"_dir, home); \ s = _meta; \ } \ (&user)->_meta = s; -#endif +# endif // $XDG_DESKTOP_DIR="$HOME/Desktop" ENV_HOME_SET("XDG_DESKTOP_DIR", "Desktop", desktop); // $XDG_DOCUMENTS_DIR="$HOME/Documents" @@ -49,9 +83,9 @@ eina_xdg_env_init(void) // $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); + ENV_HOME_SET("XDG_PUBLICSHARE_DIR", "Public", pub); // $XDG_TEMPLATES_DIR="$HOME/.Templates" - ENV_HOME_SET("XDG_TEMPLATES_DIR", ".Templates", 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 @@ -71,14 +105,15 @@ eina_xdg_env_init(void) // $HOME/.cache should be used. ENV_HOME_SET("XDG_CACHE_HOME", ".cache", cache); -#if defined(HAVE_GETUID) && defined(HAVE_GETEUID) +# if defined(HAVE_GETUID) && defined(HAVE_GETEUID) if ((getuid() != geteuid()) || (!(s = getenv("XDG_RUNTIME_DIR")))) -#else +# else if (!(s = getenv("XDG_RUNTIME_DIR"))) -#endif +# endif user.run = NULL; else user.run = s; +#endif /* _WIN32 */ eina_vpath_interface_user_set(&user); } diff --git a/src/lib/eina/meson.build b/src/lib/eina/meson.build index 245c9cd8fa..bfb484e877 100644 --- a/src/lib/eina/meson.build +++ b/src/lib/eina/meson.build @@ -349,13 +349,17 @@ if sys_osx == true if cc.has_header_symbol('mach/task.h', 'semaphore_create') eina_config.set('EINA_HAVE_OSX_SEMAPHORE', 1) endif +endif +if host_machine.endian() == 'big' + eina_config.set('EINA_HAVE_WORDS_BIGENDIAN', '1') endif eina_config_file = configure_file( output: 'eina_config.h', configuration: eina_config, - install: true) + install: true, + install_dir: dir_package_include) public_headers += eina_config_file diff --git a/src/lib/eio/Eio.h b/src/lib/eio/Eio.h index cc986938dd..fb0fc64813 100644 --- a/src/lib/eio/Eio.h +++ b/src/lib/eio/Eio.h @@ -76,9 +76,7 @@ typedef Eina_Bool (*Eio_Filter_Direct_Cb)(void *data, Eio_File *handler, const E #ifndef EFL_NOLEGACY_API_SUPPORT #include "Eio_Legacy.h" #endif -#ifdef EFL_EO_API_SUPPORT #include "Eio_Eo.h" -#endif /** * @brief get access time from a Eina_Stat diff --git a/src/lib/eio/Eio_Eo.h b/src/lib/eio/Eio_Eo.h index b79f2ab870..e199d5d0b4 100644 --- a/src/lib/eio/Eio_Eo.h +++ b/src/lib/eio/Eio_Eo.h @@ -7,7 +7,7 @@ extern "C" { #include "efl_io_manager.eo.h" #include "eio_sentry.eo.h" -#include "eio_model.eo.h" +#include "efl_io_model.eo.h" #ifdef __cplusplus } diff --git a/src/lib/eio/Eio_Legacy.h b/src/lib/eio/Eio_Legacy.h index adb78b6389..ac7a814f5f 100644 --- a/src/lib/eio/Eio_Legacy.h +++ b/src/lib/eio/Eio_Legacy.h @@ -594,7 +594,7 @@ EAPI Eio_File *eio_file_xattr(const char *path, const void *data); /** - * @brief Define an extented attribute on a file/directory. + * @brief Define an extended attribute on a file/directory. * @param path The path to set the attribute on. * @param attribute The name of the attribute to define. * @param xattr_int The value to link the attribute with. @@ -616,7 +616,7 @@ EAPI Eio_File *eio_file_xattr_int_set(const char *path, const void *data); /** - * @brief Define an extented attribute on a file/directory. + * @brief Define an extended attribute on a file/directory. * @param path The path to set the attribute on. * @param attribute The name of the attribute to define. * @param xattr_double The value to link the attribute with. @@ -637,7 +637,7 @@ EAPI Eio_File *eio_file_xattr_double_set(const char *path, Eio_Error_Cb error_cb, const void *data); /** - * @brief Define a string extented attribute on a file/directory. + * @brief Define a string extended attribute on a file/directory. * @param path The path to set the attribute on. * @param attribute The name of the attribute to define. * @param xattr_string The string to link the attribute with. @@ -658,7 +658,7 @@ EAPI Eio_File *eio_file_xattr_string_set(const char *path, Eio_Error_Cb error_cb, const void *data); /** - * @brief Define an extented attribute on a file/directory. + * @brief Define an extended attribute on a file/directory. * @param path The path to set the attribute on. * @param attribute The name of the attribute to define. * @param xattr_data The data to link the attribute with. @@ -1220,7 +1220,7 @@ EAPI Eio_Monitor *eio_monitor_add(const char *path); * @warning Do NOT pass non-stringshared strings to this function! * If you don't know what this means, use eio_monitor_add(). * - * This fuction is just like eio_monitor_add(), however the string passed by + * This function is just like eio_monitor_add(), however the string passed by * argument must be created using eina_stringshare_add(). */ EAPI Eio_Monitor *eio_monitor_stringshared_add(const char *path); diff --git a/src/lib/eio/efl_io_manager.c b/src/lib/eio/efl_io_manager.c index 3509bc6a63..3bb05634be 100644 --- a/src/lib/eio/efl_io_manager.c +++ b/src/lib/eio/efl_io_manager.c @@ -49,6 +49,102 @@ struct _Job_Closure Efl_Io_Manager_Direct_Ls_Func direct_func; // Used when dispatching direct ls funcs. }; +/* Future have to be resolved right away in the thread context */ +typedef struct _Eio_Future_Entry Eio_Future_Entry; +struct _Eio_Future_Entry +{ + Eina_Future_Schedule_Entry base; + Eina_Future_Scheduler_Cb cb; + Eina_Future *future; + Eina_Value value; +}; + +static Eina_Trash *eio_entry_trash = NULL; +static unsigned int eio_entry_trash_count = 0; +static Eina_List *entries = NULL; + +static Eina_Future_Schedule_Entry * +eio_future_schedule(Eina_Future_Scheduler *sched, + Eina_Future_Scheduler_Cb cb, + Eina_Future *future, + Eina_Value value) +{ + Eio_Future_Entry *ef = NULL; + + if (!eio_entry_trash) + { + ef = calloc(1, sizeof (Eio_Future_Entry)); + if (!ef) return NULL; + } + else + { + ef = eina_trash_pop(&eio_entry_trash); + eio_entry_trash_count--; + } + ef->base.scheduler = sched; + ef->cb = cb; + ef->future = future; + ef->value = value; + + entries = eina_list_append(entries, ef); + + return &ef->base; +} + +static void +eio_future_free(Eio_Future_Entry *ef) +{ + entries = eina_list_remove(entries, ef); + + if (eio_entry_trash_count > 8) + { + free(ef); + return ; + } + eina_trash_push(&eio_entry_trash, ef); + eio_entry_trash_count++; +} + +static void +eio_future_recall(Eina_Future_Schedule_Entry *se) +{ + Eio_Future_Entry *ef = (Eio_Future_Entry *) se; + + eina_value_flush(&ef->value); + eio_future_free(ef); +} + +static Eina_Future_Scheduler eio_future_scheduler = { + .schedule = eio_future_schedule, + .recall = eio_future_recall, +}; + +static void +eio_dummy_cancel(void *data EINA_UNUSED, const Eina_Promise *p EINA_UNUSED) +{ +} + +static void +eio_process_entry(void) +{ + Eio_Future_Entry *ef; + + while (entries) + { + ef = eina_list_data_get(entries); + ef->cb(ef->future, ef->value); + eio_future_free(ef); + } +} + +static Eina_Promise * +eio_promise_new(const Eo *obj) +{ + if (!efl_alive_get(obj)) return NULL; + + return eina_promise_new(&eio_future_scheduler, eio_dummy_cancel, NULL); +} + /* Helper functions */ static void _future_file_done_cb(void *data, Eio_File *handler) @@ -56,6 +152,7 @@ _future_file_done_cb(void *data, Eio_File *handler) Eina_Promise *p = data; eina_promise_resolve(p, eina_value_uint64_init(handler->length)); + eio_process_entry(); } static void @@ -67,6 +164,7 @@ _future_file_error_cb(void *data, // error == 0 -> promise was cancelled, no need to reject it anymore if (error != 0) eina_promise_reject(p, error); + eio_process_entry(); } /* Basic listing callbacks */ @@ -119,7 +217,7 @@ _efl_io_manager_direct_ls(const Eo *obj, Eina_Future *future; Eio_File *h; - p = efl_loop_promise_new(obj); + p = eio_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); @@ -161,7 +259,7 @@ _efl_io_manager_stat_ls(const Eo *obj, Eina_Future *future; Eio_File *h; - p = efl_loop_promise_new(obj); + p = eio_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); @@ -202,7 +300,7 @@ _efl_io_manager_ls(const Eo *obj, Eina_Future *future; Eio_File *h; - p = efl_loop_promise_new(obj); + p = eio_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); @@ -236,12 +334,14 @@ _file_stat_done_cb(void *data, Eio_File *handle EINA_UNUSED, const Eina_Stat *st goto on_error; eina_promise_resolve(p, r); + eio_process_entry(); return ; on_error: eina_value_flush(&r); eina_promise_reject(p, eina_error_get()); + eio_process_entry(); } static Eina_Future * @@ -253,7 +353,7 @@ _efl_io_manager_stat(const Eo *obj, Eina_Future *future; Eio_File *h; - p = efl_loop_promise_new(obj); + p = eio_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); @@ -281,7 +381,7 @@ _efl_io_manager_xattr_ls(const Eo *obj, Eina_Future *future; Eio_File *h; - p = efl_loop_promise_new(obj); + p = eio_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); @@ -317,6 +417,7 @@ _future_file_done_data_cb(void *data, Eio_File *handler EINA_UNUSED, const char eina_value_setup(&v, EINA_VALUE_TYPE_BLOB); eina_value_set(&v, &blob); eina_promise_resolve(p, v); + eio_process_entry(); } static Eina_Future * @@ -331,7 +432,7 @@ _efl_io_manager_xattr_set(Eo *obj, Eina_Future *future; Eio_File *h; - p = efl_loop_promise_new(obj); + p = eio_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); @@ -360,7 +461,7 @@ _efl_io_manager_xattr_get(const Eo *obj, Eina_Future *future; Eio_File *h; - p = efl_loop_promise_new(obj); + p = eio_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); @@ -385,6 +486,7 @@ _future_file_open_cb(void *data, Eio_File *handler EINA_UNUSED, Eina_File *file) eina_value_setup(&v, EINA_VALUE_TYPE_FILE); eina_value_set(&v, file); eina_promise_resolve(p, v); + eio_process_entry(); } static Eina_Future * @@ -397,7 +499,7 @@ _efl_io_manager_open(const Eo *obj, Eina_Future *future; Eio_File *h; - p = efl_loop_promise_new(obj); + p = eio_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); @@ -422,7 +524,7 @@ _efl_io_manager_close(const Eo *obj, Eina_Future *future; Eio_File *h; - p = efl_loop_promise_new(obj); + p = eio_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); diff --git a/src/lib/eio/efl_io_manager.eo b/src/lib/eio/efl_io_manager.eo index 9ac9e637c9..b81ba4cc29 100644 --- a/src/lib/eio/efl_io_manager.eo +++ b/src/lib/eio/efl_io_manager.eo @@ -1,27 +1,27 @@ import eina_types; -struct Eio.Data +struct @beta Eio.Data { [[A structure to handle arbitrary data to be sent over Promises.]] data: void_ptr; [[Private data pointer]] size: uint; [[Size of private data]] } -function EflIoPath { +function @beta EflIoPath { [[EflIoPath function]] params { @in paths: array; [[Accessor to an array of path.]] } }; -function EflIoDirectInfo { +function @beta EflIoDirectInfo { [[EflIoDirectInfo function]] params { @in entries: array; [[Accessor to an array of info.]] } }; -class Efl.Io.Manager extends Efl.Loop_Consumer +class @beta Efl.Io.Manager extends Efl.Loop_Consumer { [[Class representing an asynchronous file operation.]] @@ -109,7 +109,7 @@ class Efl.Io.Manager extends Efl.Loop_Consumer [[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. + // Here we're just interested whether the promise was fulfilled or not. No value needed. } return: future @owned; [[Close return code]] } diff --git a/src/lib/eio/eio_model.c b/src/lib/eio/efl_io_model.c similarity index 68% rename from src/lib/eio/eio_model.c rename to src/lib/eio/efl_io_model.c index 01550d1e7a..300dac0e21 100644 --- a/src/lib/eio/eio_model.c +++ b/src/lib/eio/efl_io_model.c @@ -15,22 +15,22 @@ #include "Eio.h" #include "eio_private.h" -#include "eio_model_private.h" +#include "efl_io_model_private.h" -#define MY_CLASS EIO_MODEL_CLASS -#define MY_CLASS_NAME "Eio_Model" +#define MY_CLASS EFL_IO_MODEL_CLASS +#define MY_CLASS_NAME "Efl_Io_Model" -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); +static void _efl_io_model_info_free(Efl_Io_Model_Info *info, Eina_Bool model); +static void _efl_io_model_efl_model_monitor_add(Efl_Io_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)); + sizeof (Efl_Io_Model_Info), + EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Efl_Io_Model_Info, path_length), + EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Efl_Io_Model_Info, name_length), + EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Efl_Io_Model_Info, name_start), + EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_UINT, Efl_Io_Model_Info, type), + EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_STRINGSHARE, Efl_Io_Model_Info, path)); /** * Callbacks * Property @@ -38,7 +38,7 @@ EINA_VALUE_STRUCT_DESC_DEFINE(_eina_file_direct_info_desc, static void _eio_move_done_cb(void *data, Eio_File *handler) { - Eio_Model_Data *pd = ecore_thread_local_data_find(handler->thread, ".pd"); + Efl_Io_Model_Data *pd = ecore_thread_local_data_find(handler->thread, ".pd"); Eina_Promise *p = data; // FIXME: generate events @@ -50,13 +50,28 @@ _eio_move_done_cb(void *data, Eio_File *handler) static void _eio_file_error_cb(void *data, Eio_File *handler, int error) { - Eio_Model_Data *pd = ecore_thread_local_data_find(handler->thread, ".pd"); + Efl_Io_Model_Data *pd = ecore_thread_local_data_find(handler->thread, ".pd"); Eina_Promise *p = data; eina_promise_reject(p, error); pd->request.move = NULL; } + +static Eina_Bool +_already_added(Efl_Io_Model_Data *pd, const char *path) +{ + Efl_Io_Model_Info *mi; + Eina_List *node; + + EINA_LIST_FOREACH(pd->files, node, mi) + { + if (!strcmp(mi->path, path)) + return EINA_TRUE; + } + return EINA_FALSE; +} + /** * Callbacks * Ecore Events @@ -65,10 +80,10 @@ static Eina_Bool _efl_model_evt_added_ecore_cb(void *data, int type, void *event) { Eio_Monitor_Event *ev = event; - Eio_Model *obj; - Eio_Model_Data *pd = data; + Efl_Io_Model *obj; + Efl_Io_Model_Data *pd = data; Efl_Model_Children_Event cevt; - Eio_Model_Info *mi; + Efl_Io_Model_Info *mi; Eina_List *l; Eina_Stringshare *spath = NULL; char *path = NULL; @@ -78,6 +93,9 @@ _efl_model_evt_added_ecore_cb(void *data, int type, void *event) if (ev->monitor != pd->monitor) return EINA_TRUE; + if (_already_added(pd, ev->filename)) + return EINA_TRUE; + obj = pd->self; path = ecore_file_dir_get(ev->filename); @@ -92,7 +110,7 @@ _efl_model_evt_added_ecore_cb(void *data, int type, void *event) goto end; } - mi = calloc(1, sizeof (Eio_Model_Info)); + mi = calloc(1, sizeof (Efl_Io_Model_Info)); if (!mi) goto end; mi->path_length = eina_stringshare_strlen(spath); @@ -100,7 +118,8 @@ _efl_model_evt_added_ecore_cb(void *data, int type, void *event) 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; + mi->parent_ref = EINA_FALSE; + mi->child_ref = EINA_TRUE; // Honor filter on new added file too if (pd->filter.cb) @@ -111,11 +130,11 @@ _efl_model_evt_added_ecore_cb(void *data, int type, void *event) info.name_start = mi->name_start; info.name_length = mi->name_length; info.type = EINA_FILE_UNKNOWN; - strcpy(info.path, mi->path); + strncpy(info.path, mi->path, (EINA_PATH_MAX - 1)); if (!pd->filter.cb(pd->filter.data, obj, &info)) { - eina_stringshare_del(mi->path); + eina_stringshare_replace(&mi->path, NULL); free(mi); goto end; } @@ -138,11 +157,11 @@ _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_Model_Info *mi; + Efl_Io_Model_Info *mi; Eina_List *l; Eio_Monitor_Event *ev = event; - Eio_Model *obj; - Eio_Model_Data *pd = data; + Efl_Io_Model *obj; + Efl_Io_Model_Data *pd = data; Eina_Stringshare *spath = NULL; Efl_Model_Children_Event cevt = { 0 }; unsigned int i = 0; @@ -176,10 +195,8 @@ _efl_model_evt_deleted_ecore_cb(void *data, int type, void *event) // Remove the entry from the files list pd->files = eina_list_remove_list(pd->files, l); - // 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); + // This will only trigger the data destruction if no object is referencing them. + _efl_io_model_info_free(mi, EINA_FALSE); end: eina_stringshare_del(spath); @@ -192,9 +209,9 @@ _efl_model_evt_deleted_ecore_cb(void *data, int type, void *event) * Child Del */ static void -_eio_del_cleanup(Eio_Model *obj) +_eio_del_cleanup(Efl_Io_Model *obj) { - Eio_Model_Data *pd = efl_data_scope_get(obj, EIO_MODEL_CLASS); + Efl_Io_Model_Data *pd = efl_data_scope_get(obj, EFL_IO_MODEL_CLASS); pd->request.del = NULL; efl_unref(obj); @@ -203,7 +220,7 @@ _eio_del_cleanup(Eio_Model *obj) static void _eio_done_unlink_cb(void *data, Eio_File *handler EINA_UNUSED) { - Eio_Model *child = data; + Efl_Io_Model *child = data; _eio_del_cleanup(child); } @@ -211,7 +228,7 @@ _eio_done_unlink_cb(void *data, Eio_File *handler EINA_UNUSED) static void _eio_error_unlink_cb(void *data, Eio_File *handler EINA_UNUSED, int error) { - Eio_Model *child = data; + Efl_Io_Model *child = data; ERR("%d: %s.", error, strerror(error)); @@ -219,17 +236,12 @@ _eio_error_unlink_cb(void *data, Eio_File *handler EINA_UNUSED, int error) } static void -_eio_model_info_free(Eio_Model_Info *info, Eina_Bool model) +_efl_io_model_info_free(Efl_Io_Model_Info *info, Eina_Bool model) { if (!info) return ; if (!model) { - if (!info->object) - { - efl_del(info->object); - info->object = NULL; - } info->child_ref = EINA_FALSE; } else @@ -241,12 +253,12 @@ _eio_model_info_free(Eio_Model_Info *info, Eina_Bool model) info->parent_ref) return ; - eina_stringshare_del(info->path); + eina_stringshare_replace(&info->path, NULL); free(info); } static Eina_File_Type -_eio_model_info_type_get(const Eina_File_Direct_Info *info, const Eina_Stat *st) +_efl_io_model_info_type_get(const Eina_File_Direct_Info *info, const Eina_Stat *st) { if (info && info->type != EINA_FILE_UNKNOWN) return info->type; @@ -273,13 +285,13 @@ _eio_model_info_type_get(const Eina_File_Direct_Info *info, const Eina_Stat *st) } static void -_eio_model_info_build(const Eio_Model *model, Eio_Model_Data *pd) +_efl_io_model_info_build(const Efl_Io_Model *model, Efl_Io_Model_Data *pd) { char *path; if (pd->info) goto end; - pd->info = calloc(1, sizeof (Eio_Model_Info)); + pd->info = calloc(1, sizeof (Efl_Io_Model_Info)); if (!pd->info) return ; pd->info->path_length = eina_stringshare_strlen(pd->path); @@ -290,7 +302,7 @@ _eio_model_info_build(const Eio_Model *model, Eio_Model_Data *pd) 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); + pd->info->type = _efl_io_model_info_type_get(NULL, pd->st); efl_model_properties_changed(model, "direct_info"); @@ -301,8 +313,8 @@ _eio_model_info_build(const Eio_Model *model, Eio_Model_Data *pd) static void _eio_build_st_done(void *data, Eio_File *handler EINA_UNUSED, const Eina_Stat *stat) { - Eio_Model *model = data; - Eio_Model_Data *pd = efl_data_scope_get(model, EIO_MODEL_CLASS); + Efl_Io_Model *model = data; + Efl_Io_Model_Data *pd = efl_data_scope_get(model, EFL_IO_MODEL_CLASS); if (!pd) return ; pd->request.stat = NULL; @@ -312,16 +324,16 @@ _eio_build_st_done(void *data, Eio_File *handler EINA_UNUSED, const Eina_Stat *s memcpy(pd->st, stat, sizeof (Eina_Stat)); - if (!pd->info) _eio_model_info_build(model, pd); + if (!pd->info) _efl_io_model_info_build(model, pd); if (pd->info->type == EINA_FILE_UNKNOWN) - pd->info->type = _eio_model_info_type_get(NULL, stat); + pd->info->type = _efl_io_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)) { // Now that we know we are a directory, we should whatch it - _eio_model_efl_model_monitor_add(pd); + _efl_io_model_efl_model_monitor_add(pd); // And start listing its child efl_model_children_count_get(model); @@ -333,21 +345,21 @@ _eio_build_st_done(void *data, Eio_File *handler EINA_UNUSED, const Eina_Stat *s static void _eio_build_st_done_clobber(void *data, Eio_File *handler, const Eina_Stat *stat) { - Eio_Model *model = data; - Eio_Model *parent; + Efl_Io_Model *model = data; + Efl_Io_Model *parent; - efl_ref(model); + efl_ref(model); // For st_done _eio_build_st_done(data, handler, stat); parent = efl_parent_get(model); efl_model_child_del(parent, model); - efl_unref(model); + efl_unref(model); // From the async thread early ref } 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); + Efl_Io_Model *model = data; + Efl_Io_Model_Data *pd = efl_data_scope_get(model, EFL_IO_MODEL_CLASS); pd->request.stat = NULL; pd->error = error; @@ -360,28 +372,28 @@ _eio_build_st_error(void *data, Eio_File *handler EINA_UNUSED, int error) static void _eio_build_st_error_clobber(void *data, Eio_File *handler, int error) { - Eio_Model *model = data; - Eio_Model *parent; + Efl_Io_Model *model = data; - efl_ref(model); + efl_ref(model); // For st_error unref _eio_build_st_error(data, handler, error); - parent = efl_parent_get(model); - efl_model_child_del(parent, model); - efl_unref(model); + efl_unref(model); // From the async thread early ref } static void -_eio_build_st(const Eio_Model *model, Eio_Model_Data *pd) +_eio_build_st(const Efl_Io_Model *model, Efl_Io_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)); + 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) +_eio_build_st_then_clobber(const Efl_Io_Model *model, Efl_Io_Model_Data *pd) { if (pd->st) return ; if (pd->request.stat) return ; @@ -394,16 +406,20 @@ _eio_build_st_then_clobber(const Eio_Model *model, Eio_Model_Data *pd) } static Eina_List *delayed_queue = NULL; +static Eina_Bool delayed_one = EINA_FALSE; 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); + Eina_List *tmp = delayed_queue; efl_event_callback_del(ev->object, EFL_LOOP_EVENT_IDLE, _delayed_flush, NULL); + + delayed_one = EINA_FALSE; + delayed_queue = NULL; + EINA_LIST_FREE(tmp, p) + eina_promise_resolve(p, EINA_VALUE_EMPTY); } static Eina_Value @@ -415,7 +431,7 @@ _cancel_request(Eo *model EINA_UNUSED, void *data, Eina_Error error) } static Eina_Future * -_build_delay(Eio_Model *model) +_build_delay(Efl_Io_Model *model) { Eina_Promise *p; @@ -436,79 +452,59 @@ _build_delay(Eio_Model *model) .data = eina_list_last(delayed_queue)); } -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_build_mime_now(Eo *model, void *data, const Eina_Value v) { - 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; + Efl_Io_Model_Data *pd = data; // 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) + if (!delayed_one && + (delayed_queue || ecore_time_get() - ecore_loop_time_get() > 0.004)) { - Eina_Future *f = eina_future_then(_build_delay(model), - _eio_build_mime_now, model, NULL); + Eina_Future *f = efl_future_then(model, _build_delay(model), + .success = _eio_build_mime_now, + .data = pd); return eina_future_as_value(efl_future_then(model, f)); } 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); + delayed_one = EINA_TRUE; return v; } static void -_eio_build_mime(const Efl_Object *model, Eio_Model_Data *pd) +_eio_build_mime(const Efl_Object *model, Efl_Io_Model_Data *pd) { - Eina_Future *f; - if (pd->mime_type) return ; if (pd->request.mime) return ; - efl_wref_add(efl_loop_get(model), &pd->loop); - - f = efl_loop_job(pd->loop); - f = eina_future_then(f, _eio_build_mime_now, model, NULL); - pd->request.mime = efl_future_then(model, f); + pd->request.mime = efl_future_then(model, efl_loop_job(efl_loop_get(model)), + .success = _eio_build_mime_now, + .data = pd); } static Eina_Value * -_property_filename_cb(const Eo *obj, Eio_Model_Data *pd) +_property_filename_cb(const Eo *obj, Efl_Io_Model_Data *pd) { - _eio_model_info_build(obj, pd); + _efl_io_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) +_property_path_cb(const Eo *obj EINA_UNUSED, Efl_Io_Model_Data *pd) { - return eina_value_string_new(pd->path); + return eina_value_stringshare_new(pd->path); } static Eina_Value * -_property_direct_info_cb(const Eo *obj, Eio_Model_Data *pd) +_property_direct_info_cb(const Eo *obj, Efl_Io_Model_Data *pd) { - _eio_model_info_build(obj, pd); + _efl_io_model_info_build(obj, pd); if (pd->info) { @@ -531,7 +527,7 @@ _property_direct_info_cb(const Eo *obj, Eio_Model_Data *pd) #define TIMECB(Prop) \ static Eina_Value * \ - _property_##Prop##_cb(const Eo *obj, Eio_Model_Data *pd) \ + _property_##Prop##_cb(const Eo *obj, Efl_Io_Model_Data *pd) \ { \ if (pd->st) \ return eina_value_time_new(pd->st->Prop); \ @@ -547,7 +543,7 @@ TIMECB(atime); TIMECB(ctime); static Eina_Value * -_property_is_dir_cb(const Eo *obj, Eio_Model_Data *pd) +_property_is_dir_cb(const Eo *obj, Efl_Io_Model_Data *pd) { if (pd->st) return eina_value_bool_new(eio_file_is_dir(pd->st)); @@ -559,7 +555,7 @@ _property_is_dir_cb(const Eo *obj, Eio_Model_Data *pd) } static Eina_Value * -_property_is_lnk_cb(const Eo *obj, Eio_Model_Data *pd) +_property_is_lnk_cb(const Eo *obj, Efl_Io_Model_Data *pd) { if (pd->st) return eina_value_bool_new(eio_file_is_lnk(pd->st)); @@ -571,7 +567,7 @@ _property_is_lnk_cb(const Eo *obj, Eio_Model_Data *pd) } static Eina_Value * -_property_size_cb(const Eo *obj, Eio_Model_Data *pd) +_property_size_cb(const Eo *obj, Efl_Io_Model_Data *pd) { if (pd->st) return eina_value_ulong_new(pd->st->size); @@ -583,7 +579,7 @@ _property_size_cb(const Eo *obj, Eio_Model_Data *pd) } static Eina_Value * -_property_stat_cb(const Eo *obj, Eio_Model_Data *pd) +_property_stat_cb(const Eo *obj, Efl_Io_Model_Data *pd) { if (pd->st) { @@ -607,10 +603,11 @@ _property_stat_cb(const Eo *obj, Eio_Model_Data *pd) } static Eina_Value * -_property_mime_type_cb(const Eo *obj, Eio_Model_Data *pd) +_property_mime_type_cb(const Eo *obj, Efl_Io_Model_Data *pd) { if (pd->mime_type) return eina_value_string_new(pd->mime_type); + if (pd->error) return eina_value_error_new(pd->error); _eio_build_mime(obj, pd); return eina_value_error_new(EAGAIN); @@ -621,7 +618,7 @@ _property_mime_type_cb(const Eo *obj, Eio_Model_Data *pd) static struct { const char *name; - Eina_Value *(*cb)(const Eo *obj, Eio_Model_Data *pd); + Eina_Value *(*cb)(const Eo *obj, Efl_Io_Model_Data *pd); } properties[] = { PP(filename), PP(path), PP(direct_info), @@ -634,19 +631,18 @@ static struct { * Interfaces impl. */ static Eina_Iterator * -_eio_model_efl_model_properties_get(const Eo *obj EINA_UNUSED, - Eio_Model_Data *pd EINA_UNUSED) +_efl_io_model_efl_model_properties_get(const Eo *obj EINA_UNUSED, + Efl_Io_Model_Data *pd EINA_UNUSED) { return EINA_C_ARRAY_ITERATOR_NEW(properties); } static Eina_Value * -_eio_model_efl_model_property_get(const Eo *obj, Eio_Model_Data *pd, const char *property) +_efl_io_model_efl_model_property_get(const Eo *obj, Efl_Io_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 || @@ -655,13 +651,13 @@ _eio_model_efl_model_property_get(const Eo *obj, Eio_Model_Data *pd, const char ERR("Could not find property '%s'.", property); // Unknow value request - return efl_model_property_get(efl_super(obj, EIO_MODEL_CLASS), property); + return eina_value_error_new(EFL_MODEL_ERROR_NOT_SUPPORTED); } static Eina_Future * -_eio_model_efl_model_property_set(Eo *obj, - Eio_Model_Data *pd, - const char *property, Eina_Value *value) +_efl_io_model_efl_model_property_set(Eo *obj, + Efl_Io_Model_Data *pd, + const char *property, Eina_Value *value) { const char *path; Eina_Future *f; @@ -700,7 +696,7 @@ _eio_model_efl_model_property_set(Eo *obj, } else { - f = efl_loop_future_resolved(obj, eina_value_string_init(pd->path)); + f = efl_loop_future_resolved(obj, eina_value_stringshare_init(pd->path)); } return f; @@ -710,21 +706,23 @@ _eio_model_efl_model_property_set(Eo *obj, } static void -_eio_model_children_list(void *data, Eina_Array *entries) +_efl_io_model_children_list(void *data, Eina_Array *entries) { Eina_File_Direct_Info *info; Efl_Model *obj = data; - Eio_Model_Data *pd; + Efl_Io_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); + pd = efl_data_scope_get(obj, EFL_IO_MODEL_CLASS); if (!pd) return ; EINA_ARRAY_ITER_NEXT(entries, i, info, iterator) { - Eio_Model_Info *mi; + Efl_Io_Model_Info *mi; + + if (_already_added(pd, info->path)) continue; if (pd->filter.cb) { @@ -732,7 +730,7 @@ _eio_model_children_list(void *data, Eina_Array *entries) continue ; } - mi = calloc(1, sizeof (Eio_Model_Info)); + mi = calloc(1, sizeof (Efl_Io_Model_Info)); if (!mi) continue ; mi->path_length = info->path_length; @@ -740,8 +738,9 @@ _eio_model_children_list(void *data, Eina_Array *entries) 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; + mi->type = _efl_io_model_info_type_get(info, NULL); + mi->parent_ref = EINA_FALSE; + mi->child_ref = EINA_TRUE; cevt.index = eina_list_count(pd->files); cevt.child = NULL; @@ -754,30 +753,24 @@ _eio_model_children_list(void *data, Eina_Array *entries) 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) +static void +_efl_io_model_children_list_cleanup(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED) { - Eio_Model_Data *pd = data; + Efl_Io_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 unsigned int -_eio_model_efl_model_children_count_get(const Eo *obj, Eio_Model_Data *pd) +_efl_io_model_efl_model_children_count_get(const Eo *obj, Efl_Io_Model_Data *pd) { // If we have no information on the object, let's build it. - if (efl_invalidated_get(obj)) + if (efl_invalidated_get(obj) || + efl_invalidating_get(obj)) { return 0; } @@ -800,16 +793,21 @@ _eio_model_efl_model_children_count_get(const Eo *obj, Eio_Model_Data *pd) } 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, NULL); - pd->request.listing = efl_future_then(obj, f); + (void*) obj, _efl_io_model_children_list, NULL); + + //start monitoring before listing is done + //we will filter later on if we already published a file or not + _efl_io_model_efl_model_monitor_add(pd); + pd->request.listing = efl_future_then(obj, f, + .free = _efl_io_model_children_list_cleanup, + .data = pd); } return eina_list_count(pd->files); } static void -_eio_model_efl_model_monitor_add(Eio_Model_Data *priv) +_efl_io_model_efl_model_monitor_add(Efl_Io_Model_Data *priv) { if (!priv->monitor) { @@ -828,7 +826,7 @@ _eio_model_efl_model_monitor_add(Eio_Model_Data *priv) } static void -_eio_model_efl_model_monitor_del(Eio_Model_Data *priv) +_efl_io_model_efl_model_monitor_del(Efl_Io_Model_Data *priv) { if (priv->monitor) { @@ -849,8 +847,8 @@ _eio_model_efl_model_monitor_del(Eio_Model_Data *priv) * Children Load */ 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) +_efl_io_model_children_filter_set(Eo *obj EINA_UNUSED, Efl_Io_Model_Data *pd, + void *filter_data, EflIoFilter filter, Eina_Free_Cb filter_free_cb) { pd->filter.data = filter_data; pd->filter.cb = filter; @@ -861,7 +859,7 @@ _eio_model_children_filter_set(Eo *obj EINA_UNUSED, Eio_Model_Data *pd, * Child Add */ static Eo * -_eio_model_efl_model_child_add(Eo *obj EINA_UNUSED, Eio_Model_Data *priv EINA_UNUSED) +_efl_io_model_efl_model_child_add(Eo *obj EINA_UNUSED, Efl_Io_Model_Data *priv EINA_UNUSED) { return NULL; } @@ -870,16 +868,16 @@ _eio_model_efl_model_child_add(Eo *obj EINA_UNUSED, Eio_Model_Data *priv EINA_UN * Child Remove */ static void -_eio_model_efl_model_child_del(Eo *obj EINA_UNUSED, - Eio_Model_Data *priv EINA_UNUSED, - Eo *child) +_efl_io_model_efl_model_child_del(Eo *obj EINA_UNUSED, + Efl_Io_Model_Data *priv EINA_UNUSED, + Eo *child) { - Eio_Model_Data *child_pd; + Efl_Io_Model_Data *child_pd; Eina_File_Type type; child_pd = efl_data_scope_get(child, MY_CLASS); - if (!child_pd->info) goto on_error; - if (child_pd->error) goto on_error; + if (!child_pd->info) return; + if (child_pd->error) return; type = child_pd->info->type; @@ -889,6 +887,9 @@ _eio_model_efl_model_child_del(Eo *obj EINA_UNUSED, return ; } + // Already in progress + if (child_pd->request.del) return; + efl_ref(child); if (type == EINA_FILE_DIR) { @@ -906,19 +907,14 @@ _eio_model_efl_model_child_del(Eo *obj EINA_UNUSED, _eio_error_unlink_cb, child); } - - return ; - - on_error: - efl_del(child); } /** * Children Slice Get */ static Eina_Future * -_eio_model_efl_model_children_slice_get(Eo *obj, Eio_Model_Data *pd, - unsigned int start, unsigned int count) +_efl_io_model_efl_model_children_slice_get(Eo *obj, Efl_Io_Model_Data *pd, + unsigned int start, unsigned int count) { Eina_Future_Scheduler *scheduler = NULL; Eina_Value array = EINA_VALUE_EMPTY; @@ -944,23 +940,27 @@ _eio_model_efl_model_children_slice_get(Eo *obj, Eio_Model_Data *pd, while (count > 0) { - Eio_Model_Info *info = eina_list_data_get(ls); - Eio_Model_Data *child_data = NULL; + Efl_Io_Model_Info *info = eina_list_data_get(ls); + Efl_Io_Model_Data *child_data = NULL; - info->child_ref = EINA_TRUE; + info->parent_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); + info->object = efl_add_ref(EFL_IO_MODEL_CLASS, obj, + efl_loop_model_volatile_make(efl_added), + child_data = efl_data_scope_get(efl_added, EFL_IO_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); + efl_wref_add(info->object, &info->object); + efl_unref(info->object); + count--; ls = eina_list_next(ls); } @@ -973,7 +973,7 @@ _eio_model_efl_model_children_slice_get(Eo *obj, Eio_Model_Data *pd, * Class definitions */ static Efl_Object * -_eio_model_efl_object_finalize(Eo *obj, Eio_Model_Data *pd) +_efl_io_model_efl_object_finalize(Eo *obj, Efl_Io_Model_Data *pd) { if (!pd->path) return NULL; if (!efl_provider_find(obj, EFL_LOOP_CLASS)) @@ -999,7 +999,7 @@ _eio_model_efl_object_finalize(Eo *obj, Eio_Model_Data *pd) } static void -_eio_model_path_set(Eo *obj EINA_UNUSED, Eio_Model_Data *priv, const char *path) +_efl_io_model_path_set(Eo *obj EINA_UNUSED, Efl_Io_Model_Data *priv, const char *path) { char *sanitized = eina_file_path_sanitize(path); priv->path = eina_stringshare_add(sanitized); @@ -1007,34 +1007,47 @@ _eio_model_path_set(Eo *obj EINA_UNUSED, Eio_Model_Data *priv, const char *path) } static const char * -_eio_model_path_get(const Eo *obj EINA_UNUSED, Eio_Model_Data *priv) +_efl_io_model_path_get(const Eo *obj EINA_UNUSED, Efl_Io_Model_Data *priv) { return priv->path; } static void -_eio_model_efl_object_destructor(Eo *obj , Eio_Model_Data *priv) +_efl_io_model_efl_object_destructor(Eo *obj , Efl_Io_Model_Data *priv) { - Eio_Model_Info *info; + Efl_Io_Model_Info *info; - _eio_model_info_free(priv->info, EINA_TRUE); + free(priv->st); + priv->st = NULL; + + _efl_io_model_info_free(priv->info, EINA_TRUE); priv->info = NULL; EINA_LIST_FREE(priv->files, info) - _eio_model_info_free(info, EINA_FALSE); + _efl_io_model_info_free(info, EINA_FALSE); - eina_stringshare_del(priv->path); + eina_stringshare_replace(&priv->path, NULL); efl_destructor(efl_super(obj, MY_CLASS)); } static void -_eio_model_efl_object_invalidate(Eo *obj , Eio_Model_Data *priv) +_efl_io_model_efl_object_invalidate(Eo *obj , Efl_Io_Model_Data *priv) { - _eio_model_efl_model_monitor_del(priv); + // This has to be done first, to make sure that the automatic + // del is not done anymore. Or it would lead to too much + // unref when stopping async thread (During invalidate, we + // are already in the process of doing an implicit del). + efl_invalidate(efl_super(obj, EFL_IO_MODEL_CLASS)); + + _efl_io_model_efl_model_monitor_del(priv); // Unlink the object from the parent - if (priv->info) priv->info->object = NULL; + if (priv->info) + { + efl_wref_del(priv->info->object, &priv->info->object); + priv->info->object = NULL; + } if (priv->request.del) { if (!ecore_thread_wait(priv->request.del->thread, 0.1)) @@ -1059,8 +1072,6 @@ _eio_model_efl_object_invalidate(Eo *obj , Eio_Model_Data *priv) ecore_thread_wait(priv->request.stat->thread, 0.1); } } - - efl_invalidate(efl_super(obj, EIO_MODEL_CLASS)); } -#include "eio_model.eo.c" +#include "efl_io_model.eo.c" diff --git a/src/lib/eio/eio_model.eo b/src/lib/eio/efl_io_model.eo similarity index 88% rename from src/lib/eio/eio_model.eo rename to src/lib/eio/efl_io_model.eo index c8776ff7f2..2e314753f9 100644 --- a/src/lib/eio/eio_model.eo +++ b/src/lib/eio/efl_io_model.eo @@ -1,17 +1,17 @@ import eina_types; -function EflIoFilter { +function @beta EflIoFilter { [[EflIoFilter function]] params { - @in model: Eio.Model; + @in model: Efl.Io.Model; @in entry: ptr(Eina.File_Direct_Info); } return: int; }; -class Eio.Model extends Efl.Model_Loop +class @beta Efl.Io.Model extends Efl.Loop_Model { - [[Eio model class]] + [[Efl Io model class]] methods { children_filter_set { @@ -24,8 +24,6 @@ class Eio.Model extends Efl.Model_Loop EINA_TRUE to keep it. See also @Efl.Model.children_slice_get. - - @since 1.11 ]] params { filter: EflIoFilter; [[Filter callback]] @@ -33,8 +31,6 @@ class Eio.Model extends Efl.Model_Loop } @property path { [[ Define the root path of a model. - - @since 1.11 ]] set { [[ Only possible during construction. ]] } get { } diff --git a/src/lib/eio/eio_model_private.h b/src/lib/eio/efl_io_model_private.h similarity index 71% rename from src/lib/eio/eio_model_private.h rename to src/lib/eio/efl_io_model_private.h index bf1344a4c6..2574ade284 100644 --- a/src/lib/eio/eio_model_private.h +++ b/src/lib/eio/efl_io_model_private.h @@ -1,13 +1,13 @@ -#ifndef _EIO_MODEL_PRIVATE_H -#define _EIO_MODEL_PRIVATE_H +#ifndef _EFL_IO_MODEL_PRIVATE_H +#define _EFL_IO_MODEL_PRIVATE_H #define PROP_LIST_SIZE 8 -typedef struct _Eio_Model_Data Eio_Model_Data; -typedef struct _Eio_Model_Info Eio_Model_Info; +typedef struct _Efl_Io_Model_Data Efl_Io_Model_Data; +typedef struct _Efl_Io_Model_Info Efl_Io_Model_Info; -typedef struct _Eio_Model_Monitor_Data Eio_Model_Monitor_Data; -struct _Eio_Model_Monitor_Data +typedef struct _Efl_Io_Model_Monitor_Data Efl_Io_Model_Monitor_Data; +struct _Efl_Io_Model_Monitor_Data { Ecore_Event_Handler *ecore_child_add_handler[3]; Ecore_Event_Handler *ecore_child_del_handler[3]; @@ -18,7 +18,7 @@ struct _Eio_Model_Monitor_Data // FIXME: Would be more efficient to introduce an Eina_Path that assemble // an array of stringshare instead of using one mega stringshare directly. -struct _Eio_Model_Info +struct _Efl_Io_Model_Info { Eina_Stringshare *path; Eo *object; @@ -33,14 +33,13 @@ struct _Eio_Model_Info Eina_Bool child_ref : 1; }; -struct _Eio_Model_Data +struct _Efl_Io_Model_Data { - Efl_Loop *loop; - Eio_Model *self; + Efl_Io_Model *self; Eina_Stringshare *path; - Eio_Model_Info *info; + Efl_Io_Model_Info *info; Eina_Stat *st; const char *mime_type; @@ -58,12 +57,12 @@ struct _Eio_Model_Data void *data; } filter; - Eio_Model_Monitor_Data mon; + Efl_Io_Model_Monitor_Data mon; 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_List *files; // Efl_Io_Model_Info Eina_Error error; diff --git a/src/lib/eio/eio_dir.c b/src/lib/eio/eio_dir.c index 84c7769103..68412b6f8a 100644 --- a/src/lib/eio/eio_dir.c +++ b/src/lib/eio/eio_dir.c @@ -193,15 +193,15 @@ _eio_dir_init(Ecore_Thread *thread, } static void -_eio_dir_target(Eio_Dir_Copy *order, char *target, const char *dir, int length_source, int length_dest) +_eio_dir_target(Eio_Dir_Copy *order, Eina_Strbuf *target, const char *dir, int length_source, int length_dest) { int length; length = eina_stringshare_strlen(dir); - memcpy(target, order->progress.dest, length_dest); - target[length_dest] = '/'; - memcpy(target + length_dest + 1, dir + length_source, length - length_source + 1); + eina_strbuf_append_length(target, order->progress.dest, length_dest); + eina_strbuf_append(target, "/"); + eina_strbuf_append_length(target, dir + length_source, length - length_source + 1); } static Eina_Bool @@ -211,18 +211,20 @@ _eio_dir_mkdir(Ecore_Thread *thread, Eio_Dir_Copy *order, { const char *dir; Eina_List *l; - char target[PATH_MAX]; + Eina_Strbuf *target = eina_strbuf_new(); /* create all directory */ EINA_LIST_FOREACH(order->dirs, l, dir) { + eina_strbuf_reset(target); /* build target dir path */ _eio_dir_target(order, target, dir, length_source, length_dest); /* create the directory (we will apply the mode later) */ - if (mkdir(target, 0777) != 0) + if (mkdir(eina_strbuf_string_get(target), 0777) != 0) { eio_file_thread_error(&order->progress.common, thread); + eina_strbuf_free(target); return EINA_FALSE; } @@ -232,9 +234,13 @@ _eio_dir_mkdir(Ecore_Thread *thread, Eio_Dir_Copy *order, /* check for cancel request */ if (ecore_thread_check(thread)) - return EINA_FALSE; + { + eina_strbuf_free(target); + return EINA_FALSE; + } } + eina_strbuf_free(target); return EINA_TRUE; } @@ -247,32 +253,54 @@ _eio_dir_link(Ecore_Thread *thread, Eio_Dir_Copy *order, { const char *ln; Eina_List *l; - char oldpath[PATH_MAX]; - char target[PATH_MAX]; - char buffer[PATH_MAX]; - char *newpath; + Eina_Strbuf *oldpath, *buffer; + char *target = NULL, *newpath = NULL; + ssize_t bsz = -1; + struct stat st; + + oldpath = eina_strbuf_new(); + buffer = eina_strbuf_new(); /* Build once the base of the link target */ - memcpy(buffer, order->progress.dest, length_dest); - buffer[length_dest] = '/'; + eina_strbuf_append_length(buffer, order->progress.dest, length_dest); + eina_strbuf_append(buffer, "/"); /* recreate all links */ EINA_LIST_FOREACH(order->links, l, ln) { ssize_t length; + eina_strbuf_reset(oldpath); + /* build oldpath link */ _eio_dir_target(order, oldpath, ln, length_source, length_dest); + if (lstat(ln, &st) == -1) + { + goto on_error; + } + if (st.st_size == 0) + { + bsz = PATH_MAX; + free(target); + target = malloc(bsz); + } + else if(bsz < st.st_size + 1) + { + bsz = st.st_size +1; + free(target); + target = malloc(bsz); + } + /* read link target */ - length = readlink(ln, target, PATH_MAX); + length = readlink(ln, target, bsz); if (length < 0) goto on_error; if (strncmp(target, order->progress.source, length_source) == 0) { /* The link is inside the zone to copy, so rename it */ - memcpy(buffer + length_dest + 1, target + length_source, length - length_source + 1); + eina_strbuf_insert_length(buffer, target + length_source,length - length_source + 1, length_dest + 1); newpath = target; } else @@ -282,7 +310,7 @@ _eio_dir_link(Ecore_Thread *thread, Eio_Dir_Copy *order, } /* create the link */ - if (symlink(newpath, oldpath) != 0) + if (symlink(newpath, eina_strbuf_string_get(oldpath)) != 0) goto on_error; /* inform main thread */ @@ -291,13 +319,21 @@ _eio_dir_link(Ecore_Thread *thread, Eio_Dir_Copy *order, /* check for cancel request */ if (ecore_thread_check(thread)) - return EINA_FALSE; + goto on_thread_error; } + eina_strbuf_free(oldpath); + eina_strbuf_free(buffer); + if(target) free(target); + return EINA_TRUE; on_error: eio_file_thread_error(&order->progress.common, thread); + on_thread_error: + eina_strbuf_free(oldpath); + eina_strbuf_free(buffer); + if(target) free(target); return EINA_FALSE; } #endif @@ -309,11 +345,15 @@ _eio_dir_chmod(Ecore_Thread *thread, Eio_Dir_Copy *order, Eina_Bool rmdir_source) { const char *dir = NULL; - char target[PATH_MAX]; + Eina_Strbuf *target; struct stat buffer; + target = eina_strbuf_new(); + while (order->dirs) { + eina_strbuf_reset(target); + /* destroy in reverse order so that we don't prevent change of lower dir */ dir = eina_list_data_get(eina_list_last(order->dirs)); order->dirs = eina_list_remove_list(order->dirs, eina_list_last(order->dirs)); @@ -327,7 +367,7 @@ _eio_dir_chmod(Ecore_Thread *thread, Eio_Dir_Copy *order, goto on_error; /* set the orginal mode to the newly created dir */ - if (chmod(target, buffer.st_mode) != 0) + if (chmod(eina_strbuf_string_get(target), buffer.st_mode) != 0) goto on_error; /* if required destroy original directory */ @@ -349,12 +389,14 @@ _eio_dir_chmod(Ecore_Thread *thread, Eio_Dir_Copy *order, dir = NULL; } + eina_strbuf_free(target); return EINA_TRUE; on_error: eio_file_thread_error(&order->progress.common, thread); on_cancel: if (dir) eina_stringshare_del(dir); + eina_strbuf_free(target); return EINA_FALSE; } @@ -367,7 +409,7 @@ _eio_dir_copy_heavy(void *data, Ecore_Thread *thread) const char *ln; Eio_File_Progress file_copy; - char target[PATH_MAX]; + Eina_Strbuf *target; int length_source = 0; int length_dest = 0; @@ -378,6 +420,8 @@ _eio_dir_copy_heavy(void *data, Ecore_Thread *thread) if (!_eio_dir_recursiv_ls(thread, copy, copy->progress.source)) return; + target = eina_strbuf_new(); + /* init all structure needed to copy the file */ if (!_eio_dir_init(thread, &step, &count, &length_source, &length_dest, copy, &file_copy)) goto on_error; @@ -392,11 +436,13 @@ _eio_dir_copy_heavy(void *data, Ecore_Thread *thread) /* copy all files */ EINA_LIST_FREE(copy->files, file) { + eina_strbuf_reset(target); + /* build target file path */ _eio_dir_target(copy, target, file, length_source, length_dest); file_copy.source = file; - file_copy.dest = eina_stringshare_add(target); + file_copy.dest = eina_stringshare_add(eina_strbuf_string_get(target)); /* copy the file */ if (!eio_file_copy_do(thread, &file_copy)) @@ -444,6 +490,8 @@ _eio_dir_copy_heavy(void *data, Ecore_Thread *thread) if (!ecore_thread_check(thread)) eio_progress_send(thread, ©->progress, count, count); + eina_strbuf_free(target); + return; } @@ -492,7 +540,7 @@ _eio_dir_move_heavy(void *data, Ecore_Thread *thread) const char *dir = NULL; Eio_File_Progress file_move; - char target[PATH_MAX]; + Eina_Strbuf *target; int length_source; int length_dest; @@ -511,6 +559,8 @@ _eio_dir_move_heavy(void *data, Ecore_Thread *thread) if (!_eio_dir_recursiv_ls(thread, move, move->progress.source)) return; + target = eina_strbuf_new(); + /* init all structure needed to move the file */ if (!_eio_dir_init(thread, &step, &count, &length_source, &length_dest, move, &file_move)) goto on_error; @@ -525,11 +575,13 @@ _eio_dir_move_heavy(void *data, Ecore_Thread *thread) /* move file around */ EINA_LIST_FREE(move->files, file) { + eina_strbuf_reset(target); + /* build target file path */ _eio_dir_target(move, target, file, length_source, length_dest); file_move.source = file; - file_move.dest = eina_stringshare_add(target); + file_move.dest = eina_stringshare_add(eina_strbuf_string_get(target)); /* first try to rename */ if (rename(file_move.source, file_move.dest) < 0) @@ -594,6 +646,8 @@ _eio_dir_move_heavy(void *data, Ecore_Thread *thread) if (!ecore_thread_check(thread)) eio_progress_send(thread, &move->progress, count, count); + eina_strbuf_free(target); + return; } @@ -613,7 +667,7 @@ _eio_dir_rmrf_heavy(void *data, Ecore_Thread *thread) /* init counter */ step = 0; - count = eina_list_count(rmrf->files) + eina_list_count(rmrf->dirs) + 1; + count = ((long long) eina_list_count(rmrf->files)) + ((long long) eina_list_count(rmrf->dirs)) + 1; EINA_LIST_FREE(rmrf->files, file) { diff --git a/src/lib/eio/eio_monitor_poll.c b/src/lib/eio/eio_monitor_poll.c index 2788aee84e..55cdff6fbf 100644 --- a/src/lib/eio/eio_monitor_poll.c +++ b/src/lib/eio/eio_monitor_poll.c @@ -196,7 +196,7 @@ _eio_monitor_fallback_heavy_cb(void *data, Ecore_Thread *thread) } cmp->version = backend->version; - if (ecore_thread_check(thread)) break; + if (thread && ecore_thread_check(thread)) break; } if (it) eina_iterator_free(it); @@ -346,6 +346,9 @@ eio_monitor_fallback_add(Eio_Monitor *monitor) backend->parent = monitor; monitor->backend = backend; monitor->fallback = EINA_TRUE; + + //ensure this is initialized here + _eio_monitor_fallback_heavy_cb(backend, NULL); backend->work = ecore_thread_run(_eio_monitor_fallback_heavy_cb, _eio_monitor_fallback_end_cb, _eio_monitor_fallback_cancel_cb, diff --git a/src/lib/eio/eio_sentry.c b/src/lib/eio/eio_sentry.c index 84b958f694..20ca327282 100644 --- a/src/lib/eio/eio_sentry.c +++ b/src/lib/eio/eio_sentry.c @@ -21,7 +21,6 @@ # include #endif -#define EIO_SENTRY_BETA 1 #include #include "Ecore.h" diff --git a/src/lib/eio/eio_sentry.eo b/src/lib/eio/eio_sentry.eo index bd0d19a82a..993e0c958f 100644 --- a/src/lib/eio/eio_sentry.eo +++ b/src/lib/eio/eio_sentry.eo @@ -1,11 +1,11 @@ -struct Eio.Sentry.Event +struct @beta Eio.Sentry.Event { [[Wraps the data about a monitor event on a file.]] trigger: string; [[The cause of the event.]] source: string; [[The original monitored path.]] } -class Eio.Sentry extends Efl.Object +class @beta Eio.Sentry extends Efl.Object { [[Monitors files and directories for changes.]] diff --git a/src/lib/eio/meson.build b/src/lib/eio/meson.build index 40f0def8f3..f95a1e652c 100644 --- a/src/lib/eio/meson.build +++ b/src/lib/eio/meson.build @@ -1,7 +1,7 @@ pub_eo_file_target = [] pub_eo_files = [ - 'eio_model.eo', + 'efl_io_model.eo', 'efl_io_manager.eo', 'eio_sentry.eo' ] @@ -44,8 +44,8 @@ eio_src = [ 'eio_monitor_poll.c', 'eio_single.c', 'eio_xattr.c', - 'eio_model.c', - 'eio_model_private.h', + 'efl_io_model.c', + 'efl_io_model_private.h', 'eio_private.h', 'eio_sentry_private.h' ] @@ -83,9 +83,12 @@ eio = declare_dependency( dependencies: eio_pub_deps, ) -install_data(pub_eo_files + pub_eo_types_files, - install_dir: join_paths(eolian_include_dir, package_version_name) -) + +if get_option('install-eo-files') + install_data(pub_eo_files + pub_eo_types_files, + install_dir: join_paths(eolian_include_dir, package_version_name) + ) +endif install_headers(eio_header_src, install_dir : dir_package_include, diff --git a/src/lib/eldbus/Eldbus.h b/src/lib/eldbus/Eldbus.h index ac88fd51cf..c69c056c41 100644 --- a/src/lib/eldbus/Eldbus.h +++ b/src/lib/eldbus/Eldbus.h @@ -80,8 +80,9 @@ #include #include #include +#ifdef EFL_BETA_API_SUPPORT #include - +#endif #ifdef EAPI # undef EAPI #endif diff --git a/src/lib/eldbus/Eldbus_Model.h b/src/lib/eldbus/Eldbus_Model.h index 4f4aca2576..0bf925c2d4 100644 --- a/src/lib/eldbus/Eldbus_Model.h +++ b/src/lib/eldbus/Eldbus_Model.h @@ -2,7 +2,6 @@ #define _ELDBUS_MODEL_H #include -#include #include #ifdef __cplusplus @@ -10,7 +9,7 @@ extern "C" { #endif #ifdef EFL_BETA_API_SUPPORT - +#include #include #include #include diff --git a/src/lib/eldbus/eldbus_model.eo b/src/lib/eldbus/eldbus_model.eo index 743808b572..4197311056 100644 --- a/src/lib/eldbus/eldbus_model.eo +++ b/src/lib/eldbus/eldbus_model.eo @@ -1,6 +1,6 @@ import eldbus_types; -class Eldbus.Model extends Efl.Model_Loop { +class @beta Eldbus.Model extends Efl.Loop_Model { methods { connect { [[Define connection parameters. diff --git a/src/lib/eldbus/eldbus_model_arguments.eo b/src/lib/eldbus/eldbus_model_arguments.eo index 2eb37d06ad..627ab680a7 100644 --- a/src/lib/eldbus/eldbus_model_arguments.eo +++ b/src/lib/eldbus/eldbus_model_arguments.eo @@ -1,6 +1,6 @@ import eldbus_types; -class Eldbus.Model.Arguments extends Eldbus.Model { +class @beta Eldbus.Model.Arguments extends Eldbus.Model { [[Eldbus model arguments class]] methods { diff --git a/src/lib/eldbus/eldbus_model_connection.eo b/src/lib/eldbus/eldbus_model_connection.eo index 499dfa430d..bd2544bd09 100644 --- a/src/lib/eldbus/eldbus_model_connection.eo +++ b/src/lib/eldbus/eldbus_model_connection.eo @@ -1,4 +1,4 @@ -class Eldbus.Model.Connection extends Eldbus.Model { +class @beta Eldbus.Model.Connection extends Eldbus.Model { [[Eldbus model connection class]] implements { diff --git a/src/lib/eldbus/eldbus_model_method.eo b/src/lib/eldbus/eldbus_model_method.eo index 66ef3e6cf4..00e8b7ef87 100644 --- a/src/lib/eldbus/eldbus_model_method.eo +++ b/src/lib/eldbus/eldbus_model_method.eo @@ -1,6 +1,6 @@ import eldbus_types; -class Eldbus.Model.Method extends Eldbus.Model.Arguments { +class @beta Eldbus.Model.Method extends Eldbus.Model.Arguments { [[Eldbus model method class]] methods { @property proxy { diff --git a/src/lib/eldbus/eldbus_model_object.eo b/src/lib/eldbus/eldbus_model_object.eo index d5827c5a24..9e9194aa9c 100644 --- a/src/lib/eldbus/eldbus_model_object.eo +++ b/src/lib/eldbus/eldbus_model_object.eo @@ -1,4 +1,4 @@ -class Eldbus.Model.Object extends Eldbus.Model { +class @beta Eldbus.Model.Object extends Eldbus.Model { [[Eldbus model object class]] data: Eldbus_Model_Object_Data; diff --git a/src/lib/eldbus/eldbus_model_proxy.c b/src/lib/eldbus/eldbus_model_proxy.c index 32253e36a7..bf1f8fb931 100644 --- a/src/lib/eldbus/eldbus_model_proxy.c +++ b/src/lib/eldbus/eldbus_model_proxy.c @@ -271,7 +271,7 @@ _eldbus_model_proxy_efl_model_property_set(Eo *obj EINA_UNUSED, const char *property, Eina_Value *value) { - Eldbus_Model_Proxy_Property_Set_Data *data; + Eldbus_Model_Proxy_Property_Set_Data *data = NULL; const char *signature; Eldbus_Pending *pending; unsigned char access; @@ -314,6 +314,7 @@ _eldbus_model_proxy_efl_model_property_set(Eo *obj EINA_UNUSED, .data = data, .free = _eldbus_model_proxy_cancel_cb); on_error: + free(data); return efl_loop_future_rejected(obj, err); } @@ -530,6 +531,7 @@ _eldbus_model_proxy_property_get_all_load(const Eldbus_Message *msg, Eldbus_Mode Eldbus_Message_Iter *values = NULL; Eldbus_Message_Iter *entry; Eina_Array *changed_properties; + Eina_Stringshare *tmp = NULL; const char *error_name, *error_text; if (eldbus_message_error_get(msg, &error_name, &error_text)) @@ -547,7 +549,6 @@ _eldbus_model_proxy_property_get_all_load(const Eldbus_Message *msg, Eldbus_Mode 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; @@ -567,7 +568,6 @@ _eldbus_model_proxy_property_get_all_load(const Eldbus_Message *msg, Eldbus_Mode 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); @@ -575,14 +575,20 @@ _eldbus_model_proxy_property_get_all_load(const Eldbus_Message *msg, Eldbus_Mode eina_value_flush(&arg0); - ret = eina_array_push(changed_properties, property); + ret = eina_array_push(changed_properties, tmp); if (!ret) goto on_error; + + // Reset tmp to NULL to avoid double free. + tmp = NULL; } pd->is_loaded = EINA_TRUE; return changed_properties; on_error: + eina_stringshare_del(tmp); + while ((tmp = eina_array_pop(changed_properties))) + eina_stringshare_del(tmp); eina_array_free(changed_properties); return NULL; } @@ -603,6 +609,7 @@ _eldbus_model_proxy_property_get_all_cb(void *data, { Eldbus_Model_Proxy_Data *pd = (Eldbus_Model_Proxy_Data*)data; Eldbus_Property_Promise* p; + Eina_Stringshare *sp; Eina_Array *properties; Efl_Model_Property_Event evt; @@ -623,6 +630,8 @@ _eldbus_model_proxy_property_get_all_cb(void *data, evt.changed_properties = properties; efl_event_callback_call(pd->obj, EFL_MODEL_EVENT_PROPERTIES_CHANGED, &evt); + while ((sp = eina_array_pop(properties))) + eina_stringshare_del(sp); eina_array_free(properties); } @@ -635,6 +644,7 @@ _eldbus_model_proxy_property_set_load_cb(void *data, 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; + Eina_Stringshare *sp; const char *signature; pd->pendings = eina_list_remove(pd->pendings, pending); @@ -645,16 +655,20 @@ _eldbus_model_proxy_property_set_load_cb(void *data, if (!signature || !properties) { eina_promise_reject(set_data->promise, EFL_MODEL_ERROR_UNKNOWN); - eina_array_free(properties); _eldbus_model_proxy_property_set_data_free(set_data); - return; + goto end; } - 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); + +end: + if (!properties) return; + while ((sp = eina_array_pop(properties))) + eina_stringshare_del(sp); + eina_array_free(properties); } diff --git a/src/lib/eldbus/eldbus_model_proxy.eo b/src/lib/eldbus/eldbus_model_proxy.eo index 3c8fe5bb5d..2f85000844 100644 --- a/src/lib/eldbus/eldbus_model_proxy.eo +++ b/src/lib/eldbus/eldbus_model_proxy.eo @@ -1,6 +1,6 @@ import eldbus_types; -class Eldbus.Model.Proxy extends Eldbus.Model { +class @beta Eldbus.Model.Proxy extends Eldbus.Model { [[Eldbus model proxy class]] methods { diff --git a/src/lib/eldbus/eldbus_model_signal.eo b/src/lib/eldbus/eldbus_model_signal.eo index 6ea877aeb4..1698018ad8 100644 --- a/src/lib/eldbus/eldbus_model_signal.eo +++ b/src/lib/eldbus/eldbus_model_signal.eo @@ -1,4 +1,4 @@ -class Eldbus.Model.Signal extends Eldbus.Model.Arguments { +class @beta Eldbus.Model.Signal extends Eldbus.Model.Arguments { [[Eldbus model signal class]] methods { diff --git a/src/lib/eldbus/meson.build b/src/lib/eldbus/meson.build index 1fd852fcb3..de9902757d 100644 --- a/src/lib/eldbus/meson.build +++ b/src/lib/eldbus/meson.build @@ -109,9 +109,12 @@ eldbus = declare_dependency( dependencies: eldbus_pub_deps, ) -install_data(pub_eo_files + pub_eo_types_files, - install_dir: join_paths(eolian_include_dir, package_version_name) -) + +if get_option('install-eo-files') + install_data(pub_eo_files + pub_eo_types_files, + install_dir: join_paths(eolian_include_dir, package_version_name) + ) +endif install_headers(eldbus_header_src, install_dir : dir_package_include, diff --git a/src/lib/elementary/.gitignore b/src/lib/elementary/.gitignore index 9076648525..0a04d8032d 100644 --- a/src/lib/elementary/.gitignore +++ b/src/lib/elementary/.gitignore @@ -9,4 +9,4 @@ /eldbus_elementary_colorclass.c /eldbus_elementary_colorclass.h /eldbus_utils.h - +/elm_default_config.x diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h index d2e2297091..246ebf8456 100644 --- a/src/lib/elementary/Efl_Ui.h +++ b/src/lib/elementary/Efl_Ui.h @@ -4,14 +4,10 @@ #include #include -#ifndef EFL_EO_API_SUPPORT -# define EFL_EO_API_SUPPORT +/* FIXME: wtf? */ +#ifndef EFL_UI_RADIO_EVENT_CHANGED +# define EFL_UI_RADIO_EVENT_CHANGED EFL_UI_NSTATE_EVENT_CHANGED #endif - -#ifndef EFL_BETA_API_SUPPORT -# define EFL_BETA_API_SUPPORT -#endif - /* Standard headers for standard system calls etc. */ #include #include @@ -57,41 +53,6 @@ #include #include -#ifdef EAPI -# undef EAPI -#endif -#ifdef EWAPI -# undef EWAPI -#endif - -#ifdef _WIN32 -# ifdef EFL_BUILD -# ifdef DLL_EXPORT -# define EAPI __declspec(dllexport) -# else -# define EAPI -# endif -# else -# define EAPI __declspec(dllimport) -# 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 - -#define EWAPI EAPI EAPI_WEAK - #ifdef _WIN32 # define WIN32_LEAN_AND_MEAN # include @@ -137,6 +98,41 @@ #include #endif +#ifdef EAPI +# undef EAPI +#endif +#ifdef EWAPI +# undef EWAPI +#endif + +#ifdef _WIN32 +# ifdef EFL_BUILD +# ifdef DLL_EXPORT +# define EAPI __declspec(dllexport) +# else +# define EAPI +# endif +# else +# define EAPI __declspec(dllimport) +# 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 + +#define EWAPI EAPI EAPI_WEAK + #ifdef __cplusplus extern "C" { #endif @@ -153,6 +149,9 @@ typedef Eo Efl_Ui_Focus_Manager; # include # include +# ifdef EFL_BETA_API_SUPPORT +EAPI void efl_ui_focus_relation_free(Efl_Ui_Focus_Relations *rel); +# endif # include # include # include @@ -173,7 +172,11 @@ typedef Eo Efl_Ui_Focus_Manager; # include # include +# include +# include # include +# include +# include # include # include # include @@ -188,11 +191,15 @@ typedef Eo Efl_Ui_Focus_Manager; # include # include # include +/* FIXME: what the actual fuck. */ +# include # include # include +# include /* FIXME: Efl.Ui.Text must not use elm_general.h */ -# warning Efl.Ui.Text is not available yet without Elementary.h +// no. +//# warning Efl.Ui.Text is not available yet without Elementary.h # if 0 # include # include @@ -208,12 +215,11 @@ typedef Eo Efl_Ui_Focus_Manager; # include # include "efl_ui_caching_factory.eo.h" +# include "efl_ui_widget_factory.eo.h" /* FIXME: Multibuttonentry must not use elm_widget_item */ -# warning Efl.Ui.Multibutton is not available yet without Elementary.h -# if 0 -# include -# endif + +# include # include # include @@ -222,6 +228,13 @@ typedef Eo Efl_Ui_Focus_Manager; # include # include # include +# include + +# include +# include +# include +# include +# include /** * Initialize Elementary diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h index 6050df643a..67688ea155 100644 --- a/src/lib/elementary/Elementary.h +++ b/src/lib/elementary/Elementary.h @@ -70,7 +70,6 @@ #include #include #include -#include #ifdef ELM_ELOCATION #include @@ -88,7 +87,7 @@ #endif #ifdef _WIN32 -# ifdef ELEMENTARY_BUILD +# ifdef EFL_BUILD # ifdef DLL_EXPORT # define EAPI __declspec(dllexport) # else @@ -147,12 +146,17 @@ EAPI extern Elm_Version *elm_version; #include #include -#if defined (EFL_EO_API_SUPPORT) && defined (EFL_BETA_API_SUPPORT) - +#include +/* FIXME: wtf? */ +#ifndef EFL_UI_RADIO_EVENT_CHANGED +# define EFL_UI_RADIO_EVENT_CHANGED EFL_UI_NSTATE_EVENT_CHANGED +#endif +# include //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 # include # include @@ -163,9 +167,10 @@ typedef Eo Efl_Ui_Focus_Manager; # include # include # include + +#ifdef EFL_BETA_API_SUPPORT # include # include -# include #endif #include @@ -279,7 +284,6 @@ typedef Eo Efl_Ui_Focus_Manager; #include #include -#ifdef EFL_EO_API_SUPPORT # include # include # include @@ -341,12 +345,10 @@ typedef Eo Efl_Ui_Focus_Manager; # include # include # include -# include -# include # include -# include # include # include +# include # include # include # include @@ -355,11 +357,7 @@ typedef Eo Efl_Ui_Focus_Manager; # include # include # include -# include -# include -# include -# include -# include +# include # ifndef _EFL_UI_PAGER_EO_CLASS_TYPE # define _EFL_UI_PAGER_EO_CLASS_TYPE @@ -376,7 +374,6 @@ typedef Eo Efl_Ui_Pager; # include # include # include -#endif /* include deprecated calls last of all */ #include @@ -387,7 +384,7 @@ typedef Eo Efl_Ui_Pager; } #endif -#ifndef ELEMENTARY_BUILD +#ifndef EFL_BUILD # undef EAPI # define EAPI #endif diff --git a/src/lib/elementary/Elementary.hh b/src/lib/elementary/Elementary.hh index 36a31ef700..e5e1036e0c 100644 --- a/src/lib/elementary/Elementary.hh +++ b/src/lib/elementary/Elementary.hh @@ -7,9 +7,6 @@ #ifndef EFL_BETA_API_SUPPORT #define EFL_BETA_API_SUPPORT #endif -#ifndef EFL_EO_API_SUPPORT -#define EFL_EO_API_SUPPORT -#endif #ifndef ELM_INTERNAL_API_ARGESFSDFEFC #define ELM_INTERNAL_API_ARGESFSDFEFC #endif diff --git a/src/lib/elementary/config_embed b/src/lib/elementary/config_embed new file mode 100755 index 0000000000..2382e0e33f --- /dev/null +++ b/src/lib/elementary/config_embed @@ -0,0 +1,4 @@ +#!/bin/bash +echo "static const char *embedded_config = \"\"" > $2 +sed -e 's/"/\\"/g; s/$/\"/; s/^/\"/' $1 >> $2 +echo "\"\";" >> $2 diff --git a/src/lib/elementary/efl_access_action.c b/src/lib/elementary/efl_access_action.c index 8e56d79fd2..da5cd1b4e2 100644 --- a/src/lib/elementary/efl_access_action.c +++ b/src/lib/elementary/efl_access_action.c @@ -3,7 +3,6 @@ #endif #define EFL_ACCESS_ACTION_PROTECTED -#define EFL_ACCESS_ACTION_BETA #include #include "elm_widget.h" diff --git a/src/lib/elementary/efl_access_action.eo b/src/lib/elementary/efl_access_action.eo index 073a7a2f1b..94804b5081 100644 --- a/src/lib/elementary/efl_access_action.eo +++ b/src/lib/elementary/efl_access_action.eo @@ -1,6 +1,6 @@ import efl_ui; -mixin Efl.Access.Action +mixin @beta Efl.Access.Action { [[Accessible action mixin]] data: null; diff --git a/src/lib/elementary/efl_access_component.c b/src/lib/elementary/efl_access_component.c index f4a3c653bc..83f7640249 100644 --- a/src/lib/elementary/efl_access_component.c +++ b/src/lib/elementary/efl_access_component.c @@ -3,7 +3,6 @@ #endif #define EFL_ACCESS_COMPONENT_PROTECTED -#define EFL_ACCESS_COMPONENT_BETA #define EFL_ACCESS_OBJECT_PROTECTED #include diff --git a/src/lib/elementary/efl_access_component.eo b/src/lib/elementary/efl_access_component.eo index 3b5f561191..b18921b3fd 100644 --- a/src/lib/elementary/efl_access_component.eo +++ b/src/lib/elementary/efl_access_component.eo @@ -1,6 +1,6 @@ import eina_types; -mixin Efl.Access.Component extends Efl.Gfx.Entity, Efl.Gfx.Stack +mixin @beta Efl.Access.Component extends Efl.Gfx.Entity, Efl.Gfx.Stack { [[AT-SPI component mixin]] data: null; diff --git a/src/lib/elementary/efl_access_editable_text.eo b/src/lib/elementary/efl_access_editable_text.eo index 126d8f7821..e780f0576f 100644 --- a/src/lib/elementary/efl_access_editable_text.eo +++ b/src/lib/elementary/efl_access_editable_text.eo @@ -1,4 +1,4 @@ -interface Efl.Access.Editable.Text +interface @beta Efl.Access.Editable.Text { [[Elementary editable text interface]] methods { diff --git a/src/lib/elementary/efl_access_object.c b/src/lib/elementary/efl_access_object.c index b9626274e2..6bb3b2e882 100644 --- a/src/lib/elementary/efl_access_object.c +++ b/src/lib/elementary/efl_access_object.c @@ -195,7 +195,7 @@ _efl_access_object_attributes_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_D { Efl_Access_Attribute *attr = calloc(1, sizeof(Efl_Access_Attribute)); if (!attr) - return attr_list; + return attr_list; attr->key = eina_stringshare_add(t_attr->key); attr->value = eina_stringshare_add(t_attr->value); @@ -232,6 +232,29 @@ _efl_access_object_attribute_append(Eo *obj EINA_UNUSED, Efl_Access_Object_Data pd->attr_list = eina_list_append(pd->attr_list, attr); } +EOLIAN static void +_efl_access_object_attribute_del(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd, const char *key) +{ + Eina_List *l; + Efl_Access_Attribute *attr = NULL; + + if (!key) return; + if (!pd->attr_list) return; + + /* Check whether existing attribute list has this key and delete */ + EINA_LIST_FOREACH(pd->attr_list, l, attr) + { + if (!strcmp((const char *)attr->key, key)) + { + pd->attr_list = eina_list_remove_list(pd->attr_list, l); + eina_stringshare_del(attr->key); + eina_stringshare_del(attr->value); + free(attr); + return; + } + } +} + EOLIAN static void _efl_access_object_attributes_clear(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd) { if (!pd->attr_list) return; @@ -249,7 +272,14 @@ EOLIAN static void _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; + if (reading_info == pd->reading_info) + return; pd->reading_info = reading_info; + if (!pd->reading_info) + { + efl_access_object_attribute_del(obj, "reading_info_type"); + return; + } buf = eina_strbuf_new(); eina_strbuf_reset(buf); if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_NAME)) @@ -383,19 +413,25 @@ _efl_access_object_relations_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Da return eina_list_iterator_new(pd->relations); } +EAPI void +efl_access_attribute_free(Efl_Access_Attribute *attr) +{ + eina_stringshare_del(attr->key); + eina_stringshare_del(attr->value); + free(attr); +} + EAPI void efl_access_attributes_list_free(Eina_List *list) { Efl_Access_Attribute *attr; EINA_LIST_FREE(list, attr) { - eina_stringshare_del(attr->key); - eina_stringshare_del(attr->value); - free(attr); + efl_access_attribute_free(attr); } } EOLIAN void -_efl_access_object_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 *accessible, const Efl_Event_Description *event, void *event_info) { Eina_List *l; Efl_Access_Event_Handler *hdl; @@ -431,9 +467,10 @@ _efl_access_object_event_emit(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Eo *a } EOLIAN Efl_Access_Event_Handler * -_efl_access_object_event_handler_add(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Efl_Event_Cb cb, void *data) +_efl_access_object_event_handler_add(Efl_Event_Cb cb, void *data) { Efl_Access_Event_Handler *ret = calloc(1, sizeof(Efl_Access_Event_Handler)); + if (!ret) return NULL; ret->cb = cb; ret->data = data; @@ -443,8 +480,8 @@ _efl_access_object_event_handler_add(Eo *class EINA_UNUSED, void *pd EINA_UNUSED return ret; } -EOLIAN void -_efl_access_object_event_handler_del(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Efl_Access_Event_Handler *handler) +EOLIAN void +_efl_access_object_event_handler_del(Efl_Access_Event_Handler *handler) { Eina_List *l, *l2; Efl_Access_Event_Handler *hdl; @@ -589,7 +626,7 @@ _efl_access_object_relationships_clear(Eo *obj EINA_UNUSED, Efl_Access_Object_Da } EOLIAN Eo* -_efl_access_object_access_root_get(const Eo *class EINA_UNUSED, void *pd EINA_UNUSED) +_efl_access_object_access_root_get(void) { if (!root) root = efl_add(ELM_ATSPI_APP_OBJECT_CLASS, efl_main_loop_get()); diff --git a/src/lib/elementary/efl_access_object.eo b/src/lib/elementary/efl_access_object.eo index e20f50dc60..37b021e0ca 100644 --- a/src/lib/elementary/efl_access_object.eo +++ b/src/lib/elementary/efl_access_object.eo @@ -1,4 +1,4 @@ -enum Efl.Access.Type +enum @beta Efl.Access.Type { [[Type of accessibility object]] regular, [[default accessible object]] @@ -6,7 +6,7 @@ enum Efl.Access.Type skipped [[skip object in accessibility hierarchy]] } -enum Efl.Access.Role +enum @beta Efl.Access.Role { [[Describes the role of an object visible to Accessibility Clients.]] invalid, [[Role: invalid]] @@ -115,10 +115,9 @@ enum Efl.Access.Role last_defined, [[Last enum entry sentinel]] } -enum Efl.Access.State_Type +enum @beta Efl.Access.State_Type { [[Describes the possible states for an object visible to accessibility clients.]] - legacy: efl_access_state; invalid, [[State: invalid]] active, [[State: active]] armed, [[State: armed]] @@ -134,7 +133,7 @@ enum Efl.Access.State_Type focused, [[State: focused]] has_tooltip, [[State: has a tooltip]] horizontal, [[State: horizontal]] - iconified, [[State: iconified]] + minimized, [[State: minimized]] modal, [[State: modal]] multi_line, [[State: multi line]] multiselectable, [[State: multiselectable]] @@ -163,10 +162,9 @@ enum Efl.Access.State_Type last_defined, [[Last enum entry sentinel]] } -enum Efl.Access.Relation_Type +enum @beta Efl.Access.Relation_Type { [[Describes the relationship between two objects.]] - legacy: efl_access_relation; null, [[No relation]] label_for, [[Label for relation]] labelled_by, [[Labelled by relation]] @@ -189,7 +187,7 @@ enum Efl.Access.Relation_Type last_defined, [[Last enum entry sentinel]] } -enum Efl.Access.Reading.Info.Type +enum @beta Efl.Access.Reading.Info.Type { [[The accessible Reading information type that can be read.]] name = 1 << 0, [[Name should be read]] @@ -198,18 +196,18 @@ enum Efl.Access.Reading.Info.Type state = 1 << 3, [[State should be read.]] } -type Efl.Access.State_Set: uint64; [[Accessibility object state set.]] +type @beta Efl.Access.State_Set: uint64; [[Accessibility object state set.]] -struct Efl.Access.Event.Handler; [[Accessibility event listener]] +struct @beta Efl.Access.Event.Handler; [[Accessibility event listener]] -struct Efl.Access.Event.State_Changed.Data +struct @beta Efl.Access.Event.State_Changed.Data { [[Accessibility state changed event data]] type: Efl.Access.State_Type; [[Type of the state changed event]] new_value: bool; [[New value]] } -struct Efl.Access.Event.Geometry_Changed.Data +struct @beta Efl.Access.Event.Geometry_Changed.Data { [[Accessibility geometry changed event data]] x: int; [[X coordinate]] @@ -218,28 +216,28 @@ struct Efl.Access.Event.Geometry_Changed.Data height: int; [[Height]] } -struct Efl.Access.Event.Children_Changed.Data +struct @beta Efl.Access.Event.Children_Changed.Data { [[Accessibility children changed event data]] is_added: bool; [[Child is added or not]] child: Efl.Object; [[Child object]] } -struct Efl.Access.Attribute +struct @free(efl_access_attribute_free) Efl.Access.Attribute { [[Accessibility Attribute]] key: string; [[Attribute key]] value: string; [[Attribute value]] } -struct Efl.Access.Relation +struct @beta Efl.Access.Relation { [[Accessibility Relation]] type: Efl.Access.Relation_Type; [[Relation type]] objects: list; [[List with relation objects]] } -mixin Efl.Access.Object requires Efl.Object +mixin @beta Efl.Access.Object requires Efl.Object { [[Accessibility accessible mixin]] eo_prefix: efl_access_object; @@ -309,15 +307,26 @@ mixin Efl.Access.Object requires Efl.Object @in value: string; [[The string value to give extra information]] } } + attribute_del { + [[delete key-value pair identifying object extra attributes when key is given + ]] + params { + @in key: string; [[The string key to identify the key-value pair]] + } + } attributes_clear { [[Removes all attributes in accessible object.]] } @property reading_info_type @protected { get { - [[Gets reading information types of an accessible object.]] + [[Gets reading information types of an accessible object. if no reading information + is set, 0 is returned which means all four reading information types will be read on + object highlight]] } set { - [[Sets reading information of an accessible object.]] + [[Sets reading information of an accessible object. If set as 0, existing + reading info will be deleted and by default all four reading information types + like name, role, state and description will be read on object highlight]] } values { reading_info: Efl.Access.Reading.Info.Type; [[Reading information types]] @@ -376,7 +385,7 @@ mixin Efl.Access.Object requires Efl.Object properties. Translation domain should be set if the application wants to support i18n - for accessibily "name" and "description" properties. + for accessibility "name" and "description" properties. When translation domain is set, values of "name" and "description" properties will be translated with the dgettext function using the @@ -413,8 +422,8 @@ mixin Efl.Access.Object requires Efl.Object provide customized feedback, improving overall user experience. Relationship_append API is asymmetric, which means that - appending, for example, relation EFL_ACCESS_RELATION_FLOWS_TO from object A to B, - do NOT append relation EFL_ACCESS_RELATION_FLOWS_FROM from object B to + appending, for example, relation EFL_ACCESS_RELATION_TYPE_FLOWS_TO from object A to B, + do NOT append relation EFL_ACCESS_RELATION_TYPE_FLOWS_FROM from object B to object A.]] return: bool; [[$true if relationship was successfully appended, $false otherwise]] params { diff --git a/src/lib/elementary/efl_access_object.h b/src/lib/elementary/efl_access_object.h index 72fb57734e..4ad1ede4e5 100644 --- a/src/lib/elementary/efl_access_object.h +++ b/src/lib/elementary/efl_access_object.h @@ -2,13 +2,7 @@ #define EFL_ACCESS_H #ifdef EFL_BETA_API_SUPPORT - -#ifdef EFL_EO_API_SUPPORT #include "efl_access_object.eo.h" -#endif -#ifndef EFL_NOLEGACY_API_SUPPORT -#include "efl_access_object.eo.legacy.h" -#endif /* * Sets a particilar state type for given state set. @@ -30,7 +24,11 @@ */ EAPI void efl_access_attributes_list_free(Eina_List *list); -#ifdef EFL_EO_API_SUPPORT +/** + * Free the Efl_Access_Attribute type + */ +EAPI void +efl_access_attribute_free(Efl_Access_Attribute *attr); /** * Emits Accessible 'StateChanged' signal. @@ -40,7 +38,7 @@ EAPI void efl_access_attributes_list_free(Eina_List *list); Efl_Access_Event_State_Changed_Data evinfo; \ evinfo.type = (tp); \ evinfo.new_value = (nvl); \ - efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_STATE_CHANGED, (void*)&evinfo); \ + efl_access_object_event_emit(obj, EFL_ACCESS_OBJECT_EVENT_STATE_CHANGED, (void*)&evinfo); \ } while(0); } /** @@ -49,38 +47,38 @@ EAPI void efl_access_attributes_list_free(Eina_List *list); #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_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_BOUNDS_CHANGED, (void*)&evinfo); \ + efl_access_object_event_emit(obj, EFL_ACCESS_OBJECT_EVENT_BOUNDS_CHANGED, (void*)&evinfo); \ } while(0); /** * Emits Accessible 'PropertyChanged' signal for 'Name' property. */ #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"); + efl_access_object_event_emit(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_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_PROPERTY_CHANGED, "description"); + efl_access_object_event_emit(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_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_PROPERTY_CHANGED, "parent"); + efl_access_object_event_emit(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_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_PROPERTY_CHANGED, "role"); + efl_access_object_event_emit(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_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_PROPERTY_CHANGED, "value"); + efl_access_object_event_emit(obj, EFL_ACCESS_OBJECT_EVENT_PROPERTY_CHANGED, "value"); /** * Emits Accessible 'ChildrenChanged' signal with added child as argument. @@ -88,7 +86,7 @@ EAPI void efl_access_attributes_list_free(Eina_List *list); #define efl_access_children_changed_added_signal_emit(obj, child) \ do { \ Efl_Access_Event_Children_Changed_Data atspi_data = { EINA_TRUE, child }; \ - efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_CHILDREN_CHANGED, &atspi_data); \ + efl_access_object_event_emit(obj, EFL_ACCESS_OBJECT_EVENT_CHILDREN_CHANGED, &atspi_data); \ } while(0); /** @@ -97,34 +95,32 @@ EAPI void efl_access_attributes_list_free(Eina_List *list); #define efl_access_children_changed_del_signal_emit(obj, child) \ do { \ Efl_Access_Event_Children_Changed_Data atspi_data = { EINA_FALSE, child }; \ - efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_CHILDREN_CHANGED, &atspi_data); \ + efl_access_object_event_emit(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_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_ACTIVE_DESCENDANT_CHANGED, child); + efl_access_object_event_emit(obj, EFL_ACCESS_OBJECT_EVENT_ACTIVE_DESCENDANT_CHANGED, child); /** * Emits Accessible 'VisibleDataChanged' signal. */ #define efl_access_visible_data_changed_signal_emit(obj) \ - efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_VISIBLE_DATA_CHANGED, NULL); + efl_access_object_event_emit(obj, EFL_ACCESS_OBJECT_EVENT_VISIBLE_DATA_CHANGED, NULL); /** * Emits Accessible 'AddAccessible' signal. */ #define efl_access_added(obj) \ - efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_ADDED, NULL); + efl_access_object_event_emit(obj, EFL_ACCESS_OBJECT_EVENT_ADDED, NULL); /** * Emits Accessible 'RemoveAccessible' signal. */ #define efl_access_removed(obj) \ - efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_OBJECT_EVENT_REMOVED, NULL); - -#endif + efl_access_object_event_emit(obj, EFL_ACCESS_OBJECT_EVENT_REMOVED, NULL); #endif #endif diff --git a/src/lib/elementary/efl_access_selection.eo b/src/lib/elementary/efl_access_selection.eo index ca9c4f085b..3b2d703ed2 100644 --- a/src/lib/elementary/efl_access_selection.eo +++ b/src/lib/elementary/efl_access_selection.eo @@ -1,4 +1,4 @@ -interface Efl.Access.Selection +interface @beta Efl.Access.Selection { [[Elementary access selection interface]] methods { @@ -55,6 +55,6 @@ interface Efl.Access.Selection } } events { - selection,changed: void; [[Called when selection has been changed.]] + access,selection,changed: void; [[Called when selection has been changed.]] } } diff --git a/src/lib/elementary/efl_access_text.c b/src/lib/elementary/efl_access_text.c index 5f3f339f60..fa3798523a 100644 --- a/src/lib/elementary/efl_access_text.c +++ b/src/lib/elementary/efl_access_text.c @@ -17,4 +17,11 @@ EAPI elm_atspi_text_text_attribute_free(Efl_Access_Text_Attribute *attr) free(attr); } +EAPI void +elm_atspi_text_text_range_free(Efl_Access_Text_Range *range) +{ + free(range->content); + free(range); +} + #include "efl_access_text.eo.c" diff --git a/src/lib/elementary/efl_access_text.eo b/src/lib/elementary/efl_access_text.eo index 45e373bc6c..0d42c02c7b 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 @beta Efl.Access.Text_Granularity { [[Text accessibility granularity]] char, [[Character granularity]] @@ -10,24 +10,23 @@ enum Efl.Access.Text_Granularity paragraph [[Paragraph granularity]] } -enum Efl.Access.Text_Clip_Type +enum @beta Efl.Access.Text_Clip_Type { [[Text clip type]] - legacy: elm_atspi_text_clip; none, [[No clip type]] min, [[Minimum clip type]] max, [[Maximum clip type]] both [[Both clip types]] } -struct Efl.Access.Text_Attribute +struct @free(elm_atspi_text_text_attribute_free) Efl.Access.Text_Attribute { [[Text attribute]] name: string; [[Text attribute name]] value: string; [[Text attribute value]] } -struct Efl.Access.Text_Range +struct @free(elm_atspi_text_text_range_free) Efl.Access.Text_Range { [[Text range]] start_offset: int; [[Range start offset]] @@ -35,7 +34,7 @@ struct Efl.Access.Text_Range content: ptr(char); [[Range content]] } -struct Efl.Access.Text_Change_Info +struct @beta Efl.Access.Text_Change_Info { [[Text change information]] content: string; [[Change content]] @@ -44,7 +43,7 @@ struct Efl.Access.Text_Change_Info len: size; [[Change length]] } -interface Efl.Access.Text +interface @beta Efl.Access.Text { [[Elementary accessible text interface]] methods { diff --git a/src/lib/elementary/efl_access_text.h b/src/lib/elementary/efl_access_text.h index edbb6e10f9..a1dfec0a0c 100644 --- a/src/lib/elementary/efl_access_text.h +++ b/src/lib/elementary/efl_access_text.h @@ -2,18 +2,17 @@ #define ELM_INTERFACE_ATSPI_TEXT_H #ifdef EFL_BETA_API_SUPPORT - -#ifdef EFL_EO_API_SUPPORT #include "efl_access_text.eo.h" -#endif -#ifndef EFL_NOLEGACY_API_SUPPORT -#include "efl_access_text.eo.legacy.h" -#endif /** * @brief Free Efl_Access_Text_Attribute structure */ EAPI void elm_atspi_text_text_attribute_free(Efl_Access_Text_Attribute *attr); +/** + * @brief Free Efl_Access_Text_Range structure + */ +EAPI void elm_atspi_text_text_range_free(Efl_Access_Text_Range *range); + #endif #endif diff --git a/src/lib/elementary/efl_access_value.eo b/src/lib/elementary/efl_access_value.eo index 43d6d219b8..4ab0a7b35e 100644 --- a/src/lib/elementary/efl_access_value.eo +++ b/src/lib/elementary/efl_access_value.eo @@ -1,4 +1,4 @@ -interface Efl.Access.Value +interface @beta Efl.Access.Value { [[Elementary Access value interface]] methods { diff --git a/src/lib/elementary/efl_access_widget_action.c b/src/lib/elementary/efl_access_widget_action.c index bb0c920f49..47b2f2724a 100644 --- a/src/lib/elementary/efl_access_widget_action.c +++ b/src/lib/elementary/efl_access_widget_action.c @@ -4,7 +4,6 @@ #define EFL_ACCESS_ACTION_PROTECTED #define EFL_ACCESS_WIDGET_ACTION_PROTECTED -#define EFL_ACCESS_ACTION_BETA #include #include "elm_widget.h" diff --git a/src/lib/elementary/efl_access_widget_action.eo b/src/lib/elementary/efl_access_widget_action.eo index da381591af..58f795948f 100644 --- a/src/lib/elementary/efl_access_widget_action.eo +++ b/src/lib/elementary/efl_access_widget_action.eo @@ -1,6 +1,6 @@ import efl_ui; -mixin Efl.Access.Widget.Action extends Efl.Access.Action +mixin @beta Efl.Access.Widget.Action extends Efl.Access.Action { [[Access widget action mixin]] data: null; diff --git a/src/lib/elementary/efl_access_widget_action.h b/src/lib/elementary/efl_access_widget_action.h index 62caf4f5ae..86df79c8cc 100644 --- a/src/lib/elementary/efl_access_widget_action.h +++ b/src/lib/elementary/efl_access_widget_action.h @@ -13,12 +13,7 @@ struct _Efl_Access_Action_Data typedef struct _Efl_Access_Action_Data Efl_Access_Action_Data; -#ifdef EFL_EO_API_SUPPORT #include "efl_access_widget_action.eo.h" -#endif -#ifndef EFL_NOLEGACY_API_SUPPORT -#include "efl_access_widget_action.eo.legacy.h" -#endif #endif #endif diff --git a/src/lib/elementary/efl_access_window.eo b/src/lib/elementary/efl_access_window.eo index 320fb8ace6..12c00a81ef 100644 --- a/src/lib/elementary/efl_access_window.eo +++ b/src/lib/elementary/efl_access_window.eo @@ -1,12 +1,12 @@ -interface Efl.Access.Window +interface @beta Efl.Access.Window { [[Elementary accessible window interface]] events { 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,activated: void; [[Called when window has been activated. (focused)]] window,deactivated: void; [[Called when window has been deactivated (unfocused).]] - window,maximized: void; [[Called when window has been maximmized]] + window,maximized: void; [[Called when window has been maximized]] 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 38938d21ca..739d9f025d 100644 --- a/src/lib/elementary/efl_access_window.h +++ b/src/lib/elementary/efl_access_window.h @@ -2,55 +2,49 @@ #define EFL_ACCESS_WINDOW_H #ifdef EFL_BETA_API_SUPPORT -#ifdef EFL_EO_API_SUPPORT - #include "efl_access_window.eo.h" -#endif -#ifndef EFL_NOLEGACY_API_SUPPORT -#include "efl_access_window.eo.legacy.h" -#endif /** * Emits 'Window:Activated' accessible signal. */ #define efl_access_window_activated_signal_emit(obj) \ - efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_ACTIVATED, NULL); + efl_access_object_event_emit(obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_ACTIVATED, NULL); /** * Emits 'Window:Deactivated' accessible signal. */ #define efl_access_window_deactivated_signal_emit(obj) \ - efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_DEACTIVATED, NULL); + efl_access_object_event_emit(obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_DEACTIVATED, NULL); /** * Emits 'Window:Created' accessible signal. */ #define efl_access_window_created_signal_emit(obj) \ - efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_CREATED, NULL); + efl_access_object_event_emit(obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_CREATED, NULL); /** * Emits 'Window:Destroyed' accessible signal. */ #define efl_access_window_destroyed_signal_emit(obj) \ - efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_DESTROYED, NULL); + efl_access_object_event_emit(obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_DESTROYED, NULL); /** * Emits 'Window:Maximized' accessible signal. */ #define efl_access_window_maximized_signal_emit(obj) \ - efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_MAXIMIZED, NULL); + efl_access_object_event_emit(obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_MAXIMIZED, NULL); /** * Emits 'Window:Minimized' accessible signal. */ #define efl_access_window_minimized_signal_emit(obj) \ - efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_MINIMIZED, NULL); + efl_access_object_event_emit(obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_MINIMIZED, NULL); /** * Emits 'Window:Restored' accessible signal. */ #define efl_access_window_restored_signal_emit(obj) \ - efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, obj, EFL_ACCESS_WINDOW_EVENT_WINDOW_RESTORED, NULL); + efl_access_object_event_emit(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 aba9adedb4..77a04ae928 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 extends Efl.Object implements Efl.Config +class @beta Efl.Config_Global extends Efl.Object implements Efl.Config { [[This class is a singleton representing the global configuration for the running application. @@ -79,8 +79,6 @@ class Efl.Config_Global extends Efl.Object implements Efl.Config At this point it is not expected that anyone would generally use this API except if you are a desktop environment and so the user base of this API will be enlightenment itself. - - @since 1.17 ]] params { profile: string; [[The new profile's name.]] @@ -97,8 +95,6 @@ class Efl.Config_Global extends Efl.Object implements Efl.Config At this point it is not expected that anyone would generally use this API except if you are a desktop environment and so the user base of this API will be enlightenment itself. - - @since 1.17 ]] params { profile: string; [[The name of the profile that is to be deleted.]] diff --git a/src/lib/elementary/efl_datetime_manager.eo b/src/lib/elementary/efl_datetime_manager.eo index 194c6bd546..3368fdcdc5 100644 --- a/src/lib/elementary/efl_datetime_manager.eo +++ b/src/lib/elementary/efl_datetime_manager.eo @@ -1,6 +1,6 @@ import efl_types; -class Efl.Datetime.Manager extends Efl.Object +class @beta Efl.Datetime.Manager extends Efl.Object { [[Efl datetime manager class for Datepicker and Timepicker]] methods { diff --git a/src/lib/elementary/efl_page_indicator.c b/src/lib/elementary/efl_page_indicator.c index 86ea8511e5..6b0be267b2 100644 --- a/src/lib/elementary/efl_page_indicator.c +++ b/src/lib/elementary/efl_page_indicator.c @@ -14,18 +14,40 @@ EOLIAN static void _efl_page_indicator_update(Eo *obj EINA_UNUSED, - Efl_Page_Indicator_Data *pd EINA_UNUSED, + Efl_Page_Indicator_Data *pd, double pos EINA_UNUSED) { - + pd->curr_idx = efl_ui_pager_current_page_get(pd->pager.obj); } EOLIAN static void _efl_page_indicator_pack(Eo *obj EINA_UNUSED, Efl_Page_Indicator_Data *pd, - int index EINA_UNUSED) + int index) { pd->cnt++; + if ((pd->curr_idx == -1) || (pd->curr_idx >= index)) pd->curr_idx++; +} + +EOLIAN static void +_efl_page_indicator_unpack(Eo *obj EINA_UNUSED, + Efl_Page_Indicator_Data *pd, + int index) +{ + pd->cnt--; + + if ((pd->cnt == 0) || + ((index == pd->curr_idx) && (index != 0)) || + (index < pd->curr_idx)) + pd->curr_idx--; +} + +EOLIAN static void +_efl_page_indicator_unpack_all(Eo *obj EINA_UNUSED, + Efl_Page_Indicator_Data *pd) +{ + pd->cnt = 0; + pd->curr_idx = -1; } EOLIAN static void @@ -40,7 +62,15 @@ _efl_page_indicator_bind(Eo *obj EINA_UNUSED, pd->idbox = idbox; if (pager) - pd->cnt = efl_content_count(pd->pager.obj); + { + pd->cnt = efl_content_count(pd->pager.obj); + pd->curr_idx = efl_ui_pager_current_page_get(pd->pager.obj); + } + else + { + pd->cnt = 0; + pd->curr_idx = -1; + } } @@ -48,11 +78,18 @@ 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) +EOAPI EFL_VOID_FUNC_BODYV(efl_page_indicator_unpack, + EFL_FUNC_CALL(index), int index) +EOAPI EFL_VOID_FUNC_BODY(efl_page_indicator_unpack_all) #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) + _efl_page_indicator_pack), \ + EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack, \ + _efl_page_indicator_unpack), \ + EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack_all, \ + _efl_page_indicator_unpack_all) #include "efl_page_indicator.eo.c" diff --git a/src/lib/elementary/efl_page_indicator.eo b/src/lib/elementary/efl_page_indicator.eo index a3602438cb..be03c56433 100644 --- a/src/lib/elementary/efl_page_indicator.eo +++ b/src/lib/elementary/efl_page_indicator.eo @@ -1,4 +1,4 @@ -class Efl.Page.Indicator extends Efl.Object +class @beta Efl.Page.Indicator extends Efl.Object { [[Page indicator diff --git a/src/lib/elementary/efl_page_indicator.h b/src/lib/elementary/efl_page_indicator.h index 42dc88651d..78dfd8c223 100644 --- a/src/lib/elementary/efl_page_indicator.h +++ b/src/lib/elementary/efl_page_indicator.h @@ -14,6 +14,7 @@ struct _Efl_Page_Indicator_Data Efl_Ui_Box *idbox; int cnt; + int curr_idx; }; #define EFL_PAGE_INDICATOR_DATA_GET(o, pd) \ diff --git a/src/lib/elementary/efl_page_indicator_icon.c b/src/lib/elementary/efl_page_indicator_icon.c index 9b9f02c78b..55326cfdd6 100644 --- a/src/lib/elementary/efl_page_indicator_icon.c +++ b/src/lib/elementary/efl_page_indicator_icon.c @@ -19,8 +19,6 @@ _efl_page_indicator_icon_update(Eo *obj, 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) @@ -30,19 +28,23 @@ _efl_page_indicator_icon_update(Eo *obj, if (pd->adj) efl_layout_signal_message_send(pd->adj, 1, *(pd->v)); } - item = eina_list_nth(pd->items, page); + efl_page_indicator_update(efl_super(obj, MY_CLASS), pos); + + pd->curr = eina_list_nth(pd->items, spd->curr_idx); eina_value_set(pd->v, (1.0 - delta)); - efl_layout_signal_message_send(item, 1, *(pd->v)); - pd->curr = item; + efl_layout_signal_message_send(pd->curr, 1, *(pd->v)); 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); + pd->adj = eina_list_nth(pd->items, (spd->curr_idx - 1 + spd->cnt) % spd->cnt); + else if (pos > 0) + pd->adj = eina_list_nth(pd->items, (spd->curr_idx + 1 + spd->cnt) % spd->cnt); + else pd->adj = NULL; - eina_value_set(pd->v, delta); - efl_layout_signal_message_send(item, 1, *(pd->v)); - pd->adj = item; + if (pd->adj) + { + eina_value_set(pd->v, delta); + efl_layout_signal_message_send(pd->adj, 1, *(pd->v)); + } } EOLIAN static void @@ -53,20 +55,14 @@ _efl_page_indicator_icon_pack(Eo *obj, 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); + efl_gfx_hint_align_set(item, 0.5, 0.5); + efl_gfx_hint_weight_set(item, 0, 0); + efl_gfx_hint_fill_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)) + if (index == spd->cnt) { pd->items = eina_list_append(pd->items, item); efl_pack_end(spd->idbox, item); @@ -77,6 +73,56 @@ _efl_page_indicator_icon_pack(Eo *obj, pd->items = eina_list_prepend_relative(pd->items, item, existing); efl_pack_before(spd->idbox, item, existing); } + + efl_page_indicator_pack(efl_super(obj, MY_CLASS), index); + + if (!pd->curr) + { + pd->curr = eina_list_nth(pd->items, spd->curr_idx); + eina_value_set(pd->v, 1.0); + efl_layout_signal_message_send(pd->curr, 1, *(pd->v)); + } +} + +EOLIAN static void +_efl_page_indicator_icon_unpack(Eo *obj, + Efl_Page_Indicator_Icon_Data *pd, + int index) +{ + EFL_PAGE_INDICATOR_DATA_GET(obj, spd); + Eo *item; + + item = eina_list_nth(pd->items, index); + pd->items = eina_list_remove(pd->items, item); + efl_pack_unpack(spd->idbox, item); + efl_del(item); + + if (index == spd->curr_idx) pd->curr = NULL; + + efl_page_indicator_unpack(efl_super(obj, MY_CLASS), index); + + if ((pd->curr == NULL) && (spd->curr_idx != -1)) + { + pd->curr = eina_list_nth(pd->items, spd->curr_idx); + eina_value_set(pd->v, 1.0); + efl_layout_signal_message_send(pd->curr, 1, *(pd->v)); + } +} + +EOLIAN static void +_efl_page_indicator_icon_unpack_all(Eo *obj, + Efl_Page_Indicator_Icon_Data *pd) +{ + Eo *item; + + EINA_LIST_FREE(pd->items, item) + { + efl_del(item); + } + + pd->curr = NULL; + + efl_page_indicator_unpack_all(efl_super(obj, MY_CLASS)); } EOLIAN static void @@ -115,8 +161,9 @@ _efl_page_indicator_icon_efl_page_indicator_bind(Eo *obj, 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_gfx_hint_align_set(item, 0.5, 0.5); + efl_gfx_hint_weight_set(item, 0, 0); + efl_gfx_hint_fill_set(item, 0, 0); efl_pack_end(spd->idbox, item); } @@ -130,23 +177,15 @@ _efl_page_indicator_icon_efl_page_indicator_bind(Eo *obj, } } -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) + _efl_page_indicator_icon_pack), \ + EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack, \ + _efl_page_indicator_icon_unpack), \ + EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack_all, \ + _efl_page_indicator_icon_unpack_all) #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 index c56ae14f01..1af3bdc397 100644 --- a/src/lib/elementary/efl_page_indicator_icon.eo +++ b/src/lib/elementary/efl_page_indicator_icon.eo @@ -1,4 +1,4 @@ -class Efl.Page.Indicator_Icon extends Efl.Page.Indicator +class @beta Efl.Page.Indicator_Icon extends Efl.Page.Indicator { [[Icon type page indicator @@ -7,7 +7,6 @@ class Efl.Page.Indicator_Icon extends Efl.Page.Indicator 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_transition.c b/src/lib/elementary/efl_page_transition.c index 69d4a8e020..f6d73a2c10 100644 --- a/src/lib/elementary/efl_page_transition.c +++ b/src/lib/elementary/efl_page_transition.c @@ -63,6 +63,22 @@ _efl_page_transition_update(Eo *obj EINA_UNUSED, } +EOLIAN static void +_efl_page_transition_pack(Eo *obj EINA_UNUSED, + Efl_Page_Transition_Data *pd EINA_UNUSED, + int index EINA_UNUSED) +{ + +} + +EOLIAN static void +_efl_page_transition_unpack_all(Eo *obj EINA_UNUSED, + Efl_Page_Transition_Data *pd EINA_UNUSED, + int index EINA_UNUSED) +{ + +} + EOLIAN static void _efl_page_transition_curr_page_change(Eo *obj EINA_UNUSED, Efl_Page_Transition_Data *pd EINA_UNUSED, @@ -71,30 +87,39 @@ _efl_page_transition_curr_page_change(Eo *obj EINA_UNUSED, } -EOLIAN static void +EOLIAN static Eina_Bool _efl_page_transition_loop_set(Eo *obj EINA_UNUSED, Efl_Page_Transition_Data *pd, Efl_Ui_Pager_Loop loop) { pd->loop = loop; + + return EINA_TRUE; } EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_update, EFL_FUNC_CALL(move), double move) +EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_pack, + EFL_FUNC_CALL(index), int index) +EOAPI EFL_VOID_FUNC_BODY(efl_page_transition_unpack_all) EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_curr_page_change, - EFL_FUNC_CALL(move), double move) + EFL_FUNC_CALL(diff), int diff) 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, +EOAPI EFL_FUNC_BODYV(efl_page_transition_loop_set, Eina_Bool, 0, 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_pack, \ + _efl_page_transition_pack), \ + EFL_OBJECT_OP_FUNC(efl_page_transition_unpack_all, \ + _efl_page_transition_unpack_all), \ 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, \ diff --git a/src/lib/elementary/efl_page_transition.eo b/src/lib/elementary/efl_page_transition.eo index bf67b7ea7b..5f97951b0e 100644 --- a/src/lib/elementary/efl_page_transition.eo +++ b/src/lib/elementary/efl_page_transition.eo @@ -1,4 +1,4 @@ -class Efl.Page.Transition extends Efl.Object +class @beta Efl.Page.Transition extends Efl.Object { [[Page transition for @Efl.Ui.Pager diff --git a/src/lib/elementary/efl_page_transition_scroll.c b/src/lib/elementary/efl_page_transition_scroll.c index 41b70336c3..3908710cc6 100644 --- a/src/lib/elementary/efl_page_transition_scroll.c +++ b/src/lib/elementary/efl_page_transition_scroll.c @@ -41,6 +41,7 @@ _page_info_allocate(Efl_Page_Transition_Scroll_Data *pd, for (i = 0; i < pd->page_info_num; i++) { pi = calloc(1, sizeof(*pi)); + if (!pi) return; if (i == 0) pd->head = pi; else if (i == (pd->page_info_num - 1)) pd->tail = pi; pi->id = i; @@ -64,72 +65,17 @@ _page_info_allocate(Efl_Page_Transition_Scroll_Data *pd, 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; + Page_Info *curr; + Eo *tmp; + int content_w, tmp_id, curr_page, cnt; - content_w = spd->page_spec.sz.w - + ((spd->page_spec.sz.w + spd->page_spec.padding) * pd->side_page_num * 2); + content_w = (spd->page_spec.sz.w * (pd->side_page_num * 2 + 1)) + + (spd->page_spec.padding * pd->side_page_num * 2); if (content_w < spd->pager.w) { @@ -150,36 +96,76 @@ _page_info_geometry_change(Efl_Page_Transition_Scroll_Data *pd, 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) + curr_page = efl_ui_pager_current_page_get(spd->pager.obj); + cnt = efl_content_count(spd->pager.obj); + + curr = pd->head; + do { - EINA_RECTANGLE_SET(&pi->geometry, + EINA_RECTANGLE_SET(&curr->geometry, spd->pager.x + (spd->pager.w / 2) - + pi->pos * (spd->page_spec.sz.w + spd->page_spec.padding) + + curr->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)))) + efl_gfx_entity_geometry_set(curr->obj, (Eina_Rect) curr->geometry); + + if (!eina_rectangles_intersect(&curr->geometry, &pd->viewport)) { - pi->vis_page = EINA_TRUE; - pi->visible = EINA_TRUE; - efl_canvas_object_clip_set(pi->obj, pd->foreclip); + if (curr->visible) + { + efl_canvas_object_clipper_set(curr->obj, pd->backclip); + + efl_pack_unpack(curr->obj, curr->content); + efl_canvas_object_clipper_set(curr->content, pd->backclip); + + curr->content_num = -1; + curr->content = NULL; + curr->visible = EINA_FALSE; + } } else { - pi->vis_page = EINA_FALSE; - pi->visible = EINA_FALSE; - efl_canvas_object_clip_set(pi->obj, pd->backclip); + tmp_id = curr_page + curr->pos; + if (spd->loop == EFL_UI_PAGER_LOOP_ENABLED) + tmp_id = (tmp_id + cnt) % cnt; + + if ((abs(curr->pos) < cnt) && + (tmp_id >= 0) && + (tmp_id < cnt)) + { + if (curr->content_num != tmp_id) + { + tmp = efl_pack_content_get(spd->pager.obj, tmp_id); + + efl_canvas_object_clipper_set(curr->obj, pd->foreclip); + + efl_pack(curr->obj, tmp); + efl_canvas_object_clipper_set(tmp, pd->foreclip); + + curr->content_num = tmp_id; + curr->content = tmp; + curr->visible = EINA_TRUE; + } + } + else if (curr->content) + { + efl_canvas_object_clipper_set(curr->obj, pd->backclip); + + efl_pack_unpack(curr->obj, curr->content); + efl_canvas_object_clipper_set(curr->content, pd->backclip); + + curr->content_num = -1; + curr->content = NULL; + curr->visible = EINA_FALSE; + } } - efl_gfx_entity_geometry_set(pi->obj, (Eina_Rect) pi->geometry); - } + curr = curr->next; - if (efl_content_count(spd->pager.obj) > 0) _content_show(pd, spd); + } while (curr != pd->head); } static void @@ -232,8 +218,8 @@ _efl_page_transition_scroll_efl_page_transition_bind(Eo *obj, 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); + efl_event_callback_del(spd->pager.group, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _resize_cb, obj); + efl_event_callback_del(spd->pager.group, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _move_cb, obj); _page_info_deallocate(pd); efl_del(pd->foreclip); @@ -247,8 +233,8 @@ _efl_page_transition_scroll_efl_page_transition_bind(Eo *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); + efl_event_callback_add(spd->pager.group, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _resize_cb, obj); + efl_event_callback_add(spd->pager.group, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _move_cb, obj); pd->foreclip = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas_object_evas_get(spd->pager.obj)); @@ -263,7 +249,7 @@ _efl_page_transition_scroll_efl_page_transition_bind(Eo *obj, for (i = 0; i < cnt; i++) { item = efl_pack_content_get(spd->pager.obj, i); - efl_canvas_object_clip_set(item, pd->backclip); + efl_canvas_object_clipper_set(item, pd->backclip); } _page_info_allocate(pd, spd); _page_info_geometry_change(pd, spd); @@ -299,11 +285,10 @@ _efl_page_transition_scroll_update(Eo *obj, { EFL_PAGE_TRANSITION_DATA_GET(obj, spd); + Page_Info *start, *dummy, *curr, *target; + Eo *tmp; double t; int tmp_id, curr_page, cnt; - Eo *tmp; - Eina_List *list; - Page_Info *pi, *tpi; t = pos; if (t < 0) t *= (-1); @@ -315,76 +300,140 @@ _efl_page_transition_scroll_update(Eo *obj, // 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 { - 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; + start = pd->head; + dummy = pd->tail; + } + else // if scrolled left, each page takes prev page's position + { + start = pd->tail; + dummy = pd->head; + } - EINA_RECTANGLE_SET(&pi->temp, - tpi->geometry.x * t + pi->geometry.x * (1 - t), - tpi->geometry.y, - tpi->geometry.w, - tpi->geometry.h); + if (dummy->visible) + { + efl_canvas_object_clipper_set(dummy->obj, pd->backclip); + efl_pack_unpack(dummy->obj, dummy->content); + efl_canvas_object_clipper_set(dummy->content, pd->backclip); - efl_gfx_entity_geometry_set(pi->obj, (Eina_Rect) pi->temp); + dummy->content_num = -1; + dummy->content = NULL; + dummy->visible = EINA_FALSE; + } - if (!pi->vis_page && !tpi->vis_page) continue; + curr = start; + do + { + if (pos < 0) target = curr->next; + else target = curr->prev; - if (!eina_rectangles_intersect(&pi->temp, &pd->viewport)) + EINA_RECTANGLE_SET(&curr->temp, + target->geometry.x * t + curr->geometry.x * (1 - t), + target->geometry.y, + target->geometry.w, + target->geometry.h); + efl_gfx_entity_geometry_set(curr->obj, (Eina_Rect) curr->temp); + + if (!eina_rectangles_intersect(&curr->temp, &pd->viewport)) { - if (pi->content) + if (curr->visible) { - efl_canvas_object_clip_set(pi->obj, pd->backclip); + efl_canvas_object_clipper_set(curr->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; + efl_pack_unpack(curr->obj, curr->content); + efl_canvas_object_clipper_set(curr->content, pd->backclip); + curr->content_num = -1; + curr->content = NULL; + curr->visible = EINA_FALSE; } } else { - tmp_id = (curr_page + pi->pos + cnt) % cnt; - if (pi->content_num != tmp_id) + tmp_id = curr_page + curr->pos; + if (spd->loop == EFL_UI_PAGER_LOOP_ENABLED) + tmp_id = (tmp_id + cnt) % cnt; + + if ((abs(curr->pos) < cnt) && + (tmp_id >= 0) && + (tmp_id < cnt)) { - 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) + if (curr->content != tmp) { - efl_canvas_object_clip_set(pi->obj, pd->foreclip); + if (curr->content) + { + efl_pack_unpack(curr->obj, curr->content); + efl_canvas_object_clipper_set(curr->content, pd->backclip); + } - efl_pack(pi->obj, tmp); - efl_canvas_object_clip_set(tmp, pd->foreclip); + efl_canvas_object_clipper_set(curr->obj, pd->foreclip); - pi->content_num = tmp_id; - pi->content = tmp; - pi->visible = EINA_TRUE; + efl_pack(curr->obj, tmp); + efl_canvas_object_clipper_set(tmp, pd->foreclip); + + curr->content_num = tmp_id; + curr->content = tmp; + curr->visible = EINA_TRUE; } } + else if (curr->content) + { + efl_canvas_object_clipper_set(curr->obj, pd->backclip); + + efl_pack_unpack(curr->obj, curr->content); + efl_canvas_object_clipper_set(curr->content, pd->backclip); + + curr->content_num = -1; + curr->content = NULL; + curr->visible = EINA_FALSE; + } } + + curr = target; + + } while (target != dummy); +} + +EOLIAN static void +_efl_page_transition_scroll_pack(Eo *obj, + Efl_Page_Transition_Scroll_Data *pd, + int index) +{ + EFL_PAGE_TRANSITION_DATA_GET(obj, spd); + Eo *tmp; + + tmp = efl_pack_content_get(spd->pager.obj, index); + efl_canvas_object_clipper_set(tmp, pd->backclip); + + _efl_page_transition_scroll_update(obj, pd, 0.0); +} + +EOLIAN static void +_efl_page_transition_scroll_unpack_all(Eo *obj EINA_UNUSED, + Efl_Page_Transition_Scroll_Data *pd) +{ + Eina_List *list; + Page_Info *pi; + + EINA_LIST_FOREACH(pd->page_infos, list, pi) + { + efl_pack_unpack(pi->obj, pi->content); + + pi->content_num = -1; + pi->content = NULL; + pi->visible = EINA_FALSE; } + return; } EOLIAN static void _efl_page_transition_scroll_curr_page_change(Eo *obj EINA_UNUSED, Efl_Page_Transition_Scroll_Data *pd, - double pos) + int diff) { Eina_List *list; Page_Info *pi, *target = NULL; @@ -393,55 +442,23 @@ _efl_page_transition_scroll_curr_page_change(Eo *obj EINA_UNUSED, // 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)) + if (diff == 1) { pi->id = (pi->id - 1 + pd->page_info_num) % pd->page_info_num; target = pi->prev; } - else if (EINA_DBL_EQ(pos, -1.0)) + else { pi->id = (pi->id + 1) % pd->page_info_num; target = pi->next; } pi->pos = pi->id - (pd->side_page_num + 1); - if (!target) return; - 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) @@ -452,6 +469,17 @@ _efl_page_transition_scroll_curr_page_change(Eo *obj EINA_UNUSED, pi->temp.w, pi->temp.h); } + + if (diff == 1) + { + pd->head = pd->head->next; + pd->tail = pd->tail->next; + } + else + { + pd->head = pd->head->prev; + pd->tail = pd->tail->prev; + } } EOLIAN static int @@ -467,6 +495,7 @@ _add_item(Efl_Page_Transition_Scroll_Data *pd, Efl_Page_Transition_Data *spd) Page_Info *pi; pi = calloc(1, sizeof(*pi)); + if (!pi) return NULL; 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; @@ -483,7 +512,7 @@ _add_item(Efl_Page_Transition_Scroll_Data *pd, Efl_Page_Transition_Data *spd) static void _remove_item(Page_Info *pi, Efl_Page_Transition_Scroll_Data *pd) { - efl_canvas_object_clip_set(pi->content, pd->backclip); + efl_canvas_object_clipper_set(pi->content, pd->backclip); efl_pack_unpack(pi->obj, pi->content); efl_del(pi->obj); pi->prev->next = pi->next; @@ -551,18 +580,66 @@ _efl_page_transition_scroll_side_page_num_set(Eo *obj, _page_info_geometry_change(pd, spd); } -EOLIAN static void +EOLIAN static Eina_Bool _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); + int tmp_id, curr_page, cnt; + Page_Info *curr; + Eo *tmp; - if (spd->loop == loop) return; + if (loop == efl_ui_pager_loop_mode_get(spd->pager.obj)) + return EINA_TRUE; + + if ((loop == EFL_UI_PAGER_LOOP_ENABLED) && + (efl_content_count(spd->pager.obj) < (pd->page_info_num - 1))) + return EINA_FALSE; efl_page_transition_loop_set(efl_super(obj, MY_CLASS), loop); - _content_show(pd, spd); + curr_page = efl_ui_pager_current_page_get(spd->pager.obj); + cnt = efl_content_count(spd->pager.obj); + + curr = pd->head->next; + do + { + tmp_id = curr_page + curr->pos; + if ((tmp_id < 0) || (tmp_id >= cnt)) + { + switch (loop) + { + case EFL_UI_PAGER_LOOP_ENABLED: + tmp_id = (tmp_id + cnt) % cnt; + tmp = efl_pack_content_get(spd->pager.obj, tmp_id); + + efl_pack(curr->obj, tmp); + efl_canvas_object_clipper_set(tmp, pd->foreclip); + + curr->content_num = tmp_id; + curr->content = tmp; + curr->visible = EINA_TRUE; + + break; + + case EFL_UI_PAGER_LOOP_DISABLED: + efl_pack_unpack(curr->obj, curr->content); + efl_canvas_object_clipper_set(curr->content, pd->backclip); + + curr->content_num = -1; + curr->content = NULL; + curr->visible = EINA_FALSE; + + break; + } + } + + curr = curr->next; + + } while (curr != pd->tail); + + return EINA_TRUE; } EOLIAN static Eo * @@ -585,7 +662,6 @@ _efl_page_transition_scroll_efl_object_invalidate(Eo *obj, EINA_LIST_FREE(pd->page_infos, pi) { - efl_del(pi->obj); free(pi); } @@ -596,6 +672,10 @@ _efl_page_transition_scroll_efl_object_invalidate(Eo *obj, #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_pack, \ + _efl_page_transition_scroll_pack), \ + EFL_OBJECT_OP_FUNC(efl_page_transition_unpack_all, \ + _efl_page_transition_scroll_unpack_all), \ 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, \ diff --git a/src/lib/elementary/efl_page_transition_scroll.eo b/src/lib/elementary/efl_page_transition_scroll.eo index 2575a507fe..e9af63b224 100644 --- a/src/lib/elementary/efl_page_transition_scroll.eo +++ b/src/lib/elementary/efl_page_transition_scroll.eo @@ -1,4 +1,4 @@ -class Efl.Page.Transition_Scroll extends Efl.Page.Transition +class @beta Efl.Page.Transition_Scroll extends Efl.Page.Transition { [[Page transition for @Efl.Ui.Pager diff --git a/src/lib/elementary/efl_page_transition_scroll.h b/src/lib/elementary/efl_page_transition_scroll.h index b4203d7706..adec47d3cd 100644 --- a/src/lib/elementary/efl_page_transition_scroll.h +++ b/src/lib/elementary/efl_page_transition_scroll.h @@ -66,7 +66,6 @@ typedef struct _Page_Info struct _Page_Info *prev, *next; Eina_Bool visible; - Eina_Bool vis_page; } Page_Info; diff --git a/src/lib/elementary/efl_text_interactive.eo b/src/lib/elementary/efl_text_interactive.eo index 0cb4d6f766..4d8d96d832 100644 --- a/src/lib/elementary/efl_text_interactive.eo +++ b/src/lib/elementary/efl_text_interactive.eo @@ -1,6 +1,6 @@ import efl_text_types; -interface Efl.Text_Interactive extends Efl.Text, Efl.Text_Font, +interface @beta Efl.Text_Interactive extends Efl.Text, Efl.Text_Font, Efl.Text_Format, Efl.Text_Style { [[This is an interface interactive text inputs should implement]] @@ -48,6 +48,6 @@ interface Efl.Text_Interactive extends Efl.Text, Efl.Text_Font, } } events { - selection,changed: void; [[The selection on the object has changed. Query using @.selection_cursors]] + text,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 ce17980e56..f0b5e6ce44 100644 --- a/src/lib/elementary/efl_ui.eot +++ b/src/lib/elementary/efl_ui.eot @@ -1,15 +1,11 @@ /* Efl.Ui enum and struct types */ +import eina_types; -enum Efl.Ui.Theme_Apply_Result -{ - [[Return error code when setting the style on a widget.]] - fail = 0, [[Failed to apply theme. The widget may become unusable.]] - default = 1, [[Successfully applied the default style. The widget may - look different from the rest of the UI if a custom theme - is in use, but it should be usable.]] - success = 3 [[Successfully applied the requested style from the current - theme.]] -} +var Efl.Ui.Theme.Apply_Error.NONE: Eina.Error; [[Successfully applied the requested style from the current theme.]] +var Efl.Ui.Theme.Apply_Error.DEFAULT: Eina.Error; [[Successfully applied the default style. The widget may + look different from the rest of the UI if a custom theme + is in use, but it should be usable.]] +var Efl.Ui.Theme.Apply_Error.GENERIC: Eina.Error; [[Failed to apply theme. The widget may become unusable.]] enum Efl.Ui.Focus.Direction { @@ -23,26 +19,19 @@ enum Efl.Ui.Focus.Direction last = 6 [[ last direction ]] } -enum Efl.Ui.Interest_Region_Mode -{ - [[Focus region show mode.]] - widget, [[As a widget.]] - item, [[As an item.]] -} - enum Efl.Ui.Focus.Move_Policy { [[Focus Movement Policy. @since 1.10]] click, [[Move focus by mouse click or touch. Elementary focus is set on mouse click and this is checked at mouse up time. (default)]] - in, [[Move focus by mouse in. Elementary focus is set on mouse move when the + move_in, [[Move focus by mouse in. Elementary focus is set on mouse move when the mouse pointer is moved into an object.]] key_only, [[Move focus by key. Elementary focus is set on key input like Left, Right, Up, Down, Tab, or Shift+Tab.]] } -enum Efl.Ui.Slider_Indicator_Visible_Mode +enum @beta Efl.Ui.Slider_Indicator_Visible_Mode { [[Slider's indicator visibility mode. @@ -65,7 +54,7 @@ enum Efl.Ui.Focus.Autoscroll_Mode bring_in [[Bring in the focused region or item automatically which might invole the scrolling.]] } -enum Efl.Ui.Softcursor_Mode +enum @beta Efl.Ui.Softcursor_Mode { [[Software cursor mode. @@ -77,7 +66,7 @@ enum Efl.Ui.Softcursor_Mode } /* 'on_access_activate' is beta API in the Widget class */ -enum Efl.Ui.Activate +enum @beta Efl.Ui.Activate { [[Accessibility ]] default = 0, [[Activate default]] @@ -88,7 +77,7 @@ enum Efl.Ui.Activate back, [[Activate back]] } -enum Efl.Ui.Widget_Orientation_Mode +enum @beta Efl.Ui.Widget_Orientation_Mode { [[Widget orientation mode, or how the theme handles screen orientation. @@ -103,4 +92,4 @@ enum Efl.Ui.Widget_Orientation_Mode } /* Types for A11Y (internal/beta API) */ -type @extern Efl.Access.Action_Data: __undefined_type; [[Internal struct for accesssibility.]] +type @beta @extern Efl.Access.Action_Data: __undefined_type; [[Internal struct for accesssibility.]] diff --git a/src/lib/elementary/efl_ui_alert_popup.c b/src/lib/elementary/efl_ui_alert_popup.c index 3d13c90670..e7eac4a955 100644 --- a/src/lib/elementary/efl_ui_alert_popup.c +++ b/src/lib/elementary/efl_ui_alert_popup.c @@ -97,10 +97,46 @@ _user_button_clicked_cb(void *data, const Efl_Event *ev EINA_UNUSED) efl_event_callback_call(popup_obj, EFL_UI_ALERT_POPUP_EVENT_BUTTON_CLICKED, &event); } +static void +_apply_button_style(Eo *obj, Efl_Ui_Alert_Popup_Data *pd, int button_cnt) +{ + if (pd->button[EFL_UI_ALERT_POPUP_BUTTON_USER]) + { + if (button_cnt > 1) + elm_widget_element_update(obj, + pd->button[EFL_UI_ALERT_POPUP_BUTTON_USER], + "left_button"); + } + + if (pd->button[EFL_UI_ALERT_POPUP_BUTTON_POSITIVE]) + { + if (button_cnt == 2) + { + if (pd->button[EFL_UI_ALERT_POPUP_BUTTON_USER]) + elm_widget_element_update(obj, + pd->button[EFL_UI_ALERT_POPUP_BUTTON_POSITIVE], + "right_button"); + else + elm_widget_element_update(obj, + pd->button[EFL_UI_ALERT_POPUP_BUTTON_POSITIVE], + "left_button"); + } + } + + if (pd->button[EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE]) + { + if (button_cnt > 1) + elm_widget_element_update(obj, + pd->button[EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE], + "right_button"); + } +} + EOLIAN static void _efl_ui_alert_popup_button_set(Eo *obj, Efl_Ui_Alert_Popup_Data *pd, Efl_Ui_Alert_Popup_Button type, const char *text, Eo *icon) { int i; + Eina_Bool is_btn_created = EINA_FALSE; Eo *cur_content; ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); @@ -111,6 +147,7 @@ _efl_ui_alert_popup_button_set(Eo *obj, Efl_Ui_Alert_Popup_Data *pd, Efl_Ui_Aler } if (!pd->button[type]) { + is_btn_created = EINA_TRUE; pd->button[type] = efl_add(EFL_UI_BUTTON_CLASS, obj, elm_widget_element_update(obj, efl_added, PART_NAME_BUTTON)); @@ -132,47 +169,65 @@ _efl_ui_alert_popup_button_set(Eo *obj, Efl_Ui_Alert_Popup_Data *pd, Efl_Ui_Aler break; } } + else + { + const char *pre_text = efl_text_get(pd->button[type]); + if ((pre_text != NULL) && (text != NULL) && + (!strcmp(pre_text, text)) && + (efl_content_get(pd->button[type]) == icon)) + return; + } + efl_text_set(pd->button[type], text); efl_content_set(pd->button[type], icon); - cur_content = efl_content_get(efl_part(obj, "efl.buttons")); - if (cur_content) + if (is_btn_created) { - for (i = 0; i < EFL_UI_ALERT_POPUP_BUTTON_COUNT; i++) - efl_content_unset(efl_part(cur_content, BUTTON_SWALLOW_NAME[i])); - } - else - { - cur_content = efl_add(EFL_UI_LAYOUT_CLASS, obj, - efl_content_set(efl_part(obj, "efl.buttons"), efl_added)); + int btn_count = !!pd->button[EFL_UI_ALERT_POPUP_BUTTON_POSITIVE] + + !!pd->button[EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE] + + !!pd->button[EFL_UI_ALERT_POPUP_BUTTON_USER]; + + cur_content = efl_content_get(efl_part(obj, "efl.buttons")); + if (cur_content) + { + for (i = 0; i < EFL_UI_ALERT_POPUP_BUTTON_COUNT; i++) + efl_content_unset(efl_part(cur_content, BUTTON_SWALLOW_NAME[i])); + } + else + { + cur_content = efl_add(EFL_UI_LAYOUT_CLASS, obj, + efl_content_set(efl_part(obj, "efl.buttons"), efl_added)); + } + + elm_widget_element_update(obj, cur_content, PART_NAME_BUTTON_LAYOUT[btn_count - 1]); + + _apply_button_style(obj, pd, btn_count); + + i = 0; + if (pd->button[EFL_UI_ALERT_POPUP_BUTTON_USER]) + { + efl_content_set(efl_part(cur_content, BUTTON_SWALLOW_NAME[i]), + pd->button[EFL_UI_ALERT_POPUP_BUTTON_USER]); + i++; + } + + if (pd->button[EFL_UI_ALERT_POPUP_BUTTON_POSITIVE]) + { + efl_content_set(efl_part(cur_content, BUTTON_SWALLOW_NAME[i]), + pd->button[EFL_UI_ALERT_POPUP_BUTTON_POSITIVE]); + i++; + } + + if (pd->button[EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE]) + { + efl_content_set(efl_part(cur_content, BUTTON_SWALLOW_NAME[i]), + pd->button[EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE]); + } + + elm_layout_signal_emit(obj, "efl,buttons,show", "efl"); + edje_object_message_signal_process(wd->resize_obj); } - int btn_count = !!pd->button[EFL_UI_ALERT_POPUP_BUTTON_POSITIVE] + - !!pd->button[EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE] + - !!pd->button[EFL_UI_ALERT_POPUP_BUTTON_USER]; - elm_widget_element_update(obj, cur_content, PART_NAME_BUTTON_LAYOUT[btn_count - 1]); - - i = 0; - if (pd->button[EFL_UI_ALERT_POPUP_BUTTON_USER]) - { - efl_content_set(efl_part(cur_content, BUTTON_SWALLOW_NAME[i]), - pd->button[EFL_UI_ALERT_POPUP_BUTTON_USER]); - i++; - } - if (pd->button[EFL_UI_ALERT_POPUP_BUTTON_POSITIVE]) - { - efl_content_set(efl_part(cur_content, BUTTON_SWALLOW_NAME[i]), - pd->button[EFL_UI_ALERT_POPUP_BUTTON_POSITIVE]); - i++; - } - if (pd->button[EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE]) - { - efl_content_set(efl_part(cur_content, BUTTON_SWALLOW_NAME[i]), - pd->button[EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE]); - } - - elm_layout_signal_emit(obj, "efl,buttons,show", "efl"); - edje_object_message_signal_process(wd->resize_obj); elm_layout_sizing_eval(obj); } @@ -187,8 +242,6 @@ _efl_ui_alert_popup_efl_object_constructor(Eo *obj, obj = efl_constructor(efl_super(obj, MY_CLASS)); efl_canvas_object_type_set(obj, MY_CLASS_NAME); - elm_widget_sub_object_parent_add(obj); - return obj; } diff --git a/src/lib/elementary/efl_ui_alert_popup.eo b/src/lib/elementary/efl_ui_alert_popup.eo index fdcb6eb86f..48e6bbae51 100644 --- a/src/lib/elementary/efl_ui_alert_popup.eo +++ b/src/lib/elementary/efl_ui_alert_popup.eo @@ -1,16 +1,16 @@ -enum Efl.Ui.Alert_Popup_Button { +enum @beta Efl.Ui.Alert_Popup_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.Alert_Popup_Button_Clicked_Event { +struct @beta Efl.Ui.Alert_Popup_Button_Clicked_Event { [[Information of clicked event]] button_type: Efl.Ui.Alert_Popup_Button; [[Clicked button type]] } -class Efl.Ui.Alert_Popup extends Efl.Ui.Popup +class @beta Efl.Ui.Alert_Popup extends Efl.Ui.Popup { [[EFL UI Alert Popup class]] methods { diff --git a/src/lib/elementary/efl_ui_alert_popup_part.eo b/src/lib/elementary/efl_ui_alert_popup_part.eo index 41e00d05c7..b5860a99ff 100644 --- a/src/lib/elementary/efl_ui_alert_popup_part.eo +++ b/src/lib/elementary/efl_ui_alert_popup_part.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Alert_Popup_Part extends Efl.Ui.Layout_Part_Text +class @beta Efl.Ui.Alert_Popup_Part extends Efl.Ui.Layout_Part_Text { [[Efl UI Alert Popup internal part class]] data: null; diff --git a/src/lib/elementary/efl_ui_anchor_popup.c b/src/lib/elementary/efl_ui_anchor_popup.c index 9b0e9c680d..ec0573be4c 100644 --- a/src/lib/elementary/efl_ui_anchor_popup.c +++ b/src/lib/elementary/efl_ui_anchor_popup.c @@ -3,7 +3,6 @@ #endif #define EFL_UI_POPUP_PROTECTED -#define EFL_UI_ANCHOR_POPUP_BETA #include @@ -207,7 +206,7 @@ _anchor_del_cb(void *data, const Efl_Event *ev EINA_UNUSED) EFL_UI_POPUP_DATA_GET_OR_RETURN(data, ppd); EFL_UI_ANCHOR_POPUP_DATA_GET(data, pd); - efl_event_callback_del(ppd->win_parent, EFL_GFX_ENTITY_EVENT_RESIZE, _anchor_geom_cb, data); + efl_event_callback_del(ppd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _anchor_geom_cb, data); pd->anchor = NULL; //Add align calc only @@ -224,9 +223,9 @@ _anchor_detach(Eo *obj) if (!pd->anchor) return; - 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(ppd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _anchor_geom_cb, obj); + efl_event_callback_del(pd->anchor, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _anchor_geom_cb, obj); + efl_event_callback_del(pd->anchor, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _anchor_geom_cb, obj); efl_event_callback_del(pd->anchor, EFL_EVENT_DEL, _anchor_del_cb, obj); } @@ -240,9 +239,9 @@ _efl_ui_anchor_popup_anchor_set(Eo *obj, Efl_Ui_Anchor_Popup_Data *pd, Eo *ancho if (anchor) { - 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(ppd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _anchor_geom_cb, obj); + efl_event_callback_add(anchor, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _anchor_geom_cb, obj); + efl_event_callback_add(anchor, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _anchor_geom_cb, obj); efl_event_callback_add(anchor, EFL_EVENT_DEL, _anchor_del_cb, obj); } @@ -331,8 +330,6 @@ _efl_ui_anchor_popup_efl_object_constructor(Eo *obj, obj = efl_constructor(efl_super(obj, MY_CLASS)); efl_canvas_object_type_set(obj, MY_CLASS_NAME); - elm_widget_sub_object_parent_add(obj); - pd->priority[0] = EFL_UI_POPUP_ALIGN_TOP; pd->priority[1] = EFL_UI_POPUP_ALIGN_LEFT; pd->priority[2] = EFL_UI_POPUP_ALIGN_RIGHT; diff --git a/src/lib/elementary/efl_ui_anchor_popup.eo b/src/lib/elementary/efl_ui_anchor_popup.eo index 1f8ab61651..85b81c80e3 100644 --- a/src/lib/elementary/efl_ui_anchor_popup.eo +++ b/src/lib/elementary/efl_ui_anchor_popup.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Anchor_Popup extends Efl.Ui.Popup +class @beta Efl.Ui.Anchor_Popup extends Efl.Ui.Popup { [[EFL UI Anchor Popup class]] methods { diff --git a/src/lib/elementary/efl_ui_average_model.c b/src/lib/elementary/efl_ui_average_model.c new file mode 100644 index 0000000000..20e1da2c57 --- /dev/null +++ b/src/lib/elementary/efl_ui_average_model.c @@ -0,0 +1,191 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include "elm_priv.h" + +// This class rely on the parent class to do all the individual holding of value, +// it only compute the average size of an item and answer for that property alone. + +// FIXME: handle child being removed +typedef struct _Efl_Ui_Average_Model_Data Efl_Ui_Average_Model_Data; +struct _Efl_Ui_Average_Model_Data +{ + Efl_Ui_Average_Model_Data *parent; + + struct { + unsigned long long width; + unsigned long long height; + unsigned long long wseen; + unsigned long long hseen; + } total; + + Eina_Bool wseen : 1; + Eina_Bool hseen : 1; +}; + +typedef struct _Efl_Ui_Average_Model_Update Efl_Ui_Average_Model_Update; +struct _Efl_Ui_Average_Model_Update +{ + unsigned long long *total; + unsigned long long *seen; + unsigned int previous; +}; + +static Eina_Value +_efl_ui_average_model_update(Eo *obj EINA_UNUSED, void *data, const Eina_Value v) +{ + Efl_Ui_Average_Model_Update *request = data; + unsigned int now; + + if (!eina_value_uint_convert(&v, &now)) + goto on_error; + + *(request->total) += now - request->previous; + if (request->seen) *(request->seen) += 1; + + on_error: + return v; +} + +static void +_efl_ui_average_model_clean(Eo *obj, void *data, const Eina_Future *dead_future EINA_UNUSED) +{ + free(data); + + efl_unref(obj); +} + +static Eina_Future * +_efl_ui_average_model_prepare(Eo *obj, + unsigned long long *total, unsigned long long *seen, + const char *property, Eina_Value *value) +{ + Efl_Ui_Average_Model_Update *update; + Eina_Value *previous; + Eina_Future *f; + + update = calloc(1, sizeof (Efl_Ui_Average_Model_Update)); + if (!update) return efl_loop_future_rejected(obj, ENOMEM); + + previous = efl_model_property_get(obj, property); + if (eina_value_type_get(previous) == EINA_VALUE_TYPE_ERROR) + { + Eina_Error err; + + // Check the case when that property hasn't been set before + if (!eina_value_error_convert(previous, &err)) + goto on_error; + if (err != EAGAIN) goto on_error; + } + else if (!eina_value_uint_convert(previous, &update->previous)) + goto on_error; + eina_value_free(previous); + + update->total = total; + update->seen = seen; + + // As we are operating asynchronously and we want to make sure that the object + // survive until the transaction is commited, we will ref the object here + // and unref on clean. This is necessary so that a nested call of property_set + // on a model returned by children_slice_get, the user doesn't have to keep a + // reference around to do the same. It shouldn't create any problem as this + // future would be cancelled automatically when the parent object get destroyed. + efl_ref(obj); + + // We have to make the change after we fetch the old value, otherwise, well, no old value left + f = efl_model_property_set(efl_super(obj, EFL_UI_AVERAGE_MODEL_CLASS), property, value); + + return efl_future_then(obj, f, + .success = _efl_ui_average_model_update, + .free = _efl_ui_average_model_clean, + .data = update); + on_error: + eina_value_free(previous); + free(update); + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE); +} + +static Eina_Future * +_efl_ui_average_model_efl_model_property_set(Eo *obj, Efl_Ui_Average_Model_Data *pd, const char *property, Eina_Value *value) +{ + Eina_Future *f = NULL; + + if (!pd->parent) goto end; + + // In vertical list mode we do not need to compute the average width size + /* if (!strcmp(property, _efl_model_property_selfw)) */ + /* { */ + /* f = _efl_ui_average_model_prepare(obj, &pd->parent->total.width, */ + /* pd->wseen ? NULL : &pd->parent->total.wseen, */ + /* property, value, EINA_TRUE); */ + /* pd->wseen = EINA_TRUE; */ + /* } */ + if (!strcmp(property, _efl_model_property_selfh)) + { + f = _efl_ui_average_model_prepare(obj, &pd->parent->total.height, + pd->hseen ? NULL : &pd->parent->total.hseen, + property, value); + pd->hseen = EINA_TRUE; + } + + end: + if (!f) + f = efl_model_property_set(efl_super(obj, EFL_UI_AVERAGE_MODEL_CLASS), property, value); + + return f; +} + +static inline Eina_Value * +_efl_ui_average_model_compute(const Eo *obj, Eina_Value *r, unsigned long long total, unsigned long long seen) +{ + unsigned int count; + + eina_value_free(r); + + // Protection against divide by zero + if (!seen) return eina_value_uint_new(0); + + count = efl_model_children_count_get(obj); + // We are doing the multiply first in an attempt to not reduce the precision to early on. + return eina_value_uint_new((total * count) / seen); +} + +static Eina_Value * +_efl_ui_average_model_efl_model_property_get(const Eo *obj, Efl_Ui_Average_Model_Data *pd, const char *property) +{ + const Eina_Value_Type *t; + Eina_Value *r; + + r = efl_model_property_get(efl_super(obj, EFL_UI_AVERAGE_MODEL_CLASS), property); + if (!r) return r; + + // We are checking that the parent class was able to provide an answer to the request for property "Total.Width" + // or "Total.Height" which means that we are an object that should compute its size. This avoid computing the + // pointer to the parent object. + t = eina_value_type_get(r); + if (t == EINA_VALUE_TYPE_UINT) + { + if (!strcmp(property, _efl_model_property_totalh)) + r = _efl_ui_average_model_compute(obj, r, pd->total.height, pd->total.hseen); + // We do not need to average the width in vertical list mode as this is done by the parent class + /* if (!strcmp(property, _efl_model_property_totalw)) */ + /* r = _efl_ui_average_model_compute(obj, r, pd->total.width, pd->total.wseen); */ + } + + return r; +} + +static Efl_Object * +_efl_ui_average_model_efl_object_constructor(Eo *obj, Efl_Ui_Average_Model_Data *pd) +{ + Eo *parent = efl_parent_get(obj); + + if (parent && efl_isa(parent, EFL_UI_AVERAGE_MODEL_CLASS)) + pd->parent = efl_data_scope_get(efl_parent_get(obj), EFL_UI_AVERAGE_MODEL_CLASS); + + return efl_constructor(efl_super(obj, EFL_UI_AVERAGE_MODEL_CLASS)); +} + +#include "efl_ui_average_model.eo.c" diff --git a/src/lib/elementary/efl_ui_average_model.eo b/src/lib/elementary/efl_ui_average_model.eo new file mode 100644 index 0000000000..98d97598f8 --- /dev/null +++ b/src/lib/elementary/efl_ui_average_model.eo @@ -0,0 +1,19 @@ +class @beta Efl.Ui.Average_Model extends Efl.Ui.Exact_Model +{ + [[Class to be used to store object item size for List/Grid View. + + This model provide the same feature as @Efl.Ui.Exact_Model except for the + @Efl.Model.property "$total.width" and "$total.height" which reflect an + estimated value of the total size by using the currently know size from its + children as an average size for all its children. As more children fill + "$self.width" and "$self.height", this model will figure out a more precise + answer. Once all children size is known, the result will be exact and the same + as @Efl.Ui.Exact_Model. + + This model only supporting vertical list at this point.]] + + implements { + Efl.Object.constructor; + Efl.Model.property { set; get; } + } +} diff --git a/src/lib/elementary/efl_ui_bg.c b/src/lib/elementary/efl_ui_bg.c index 90bb5061eb..88d5ef7eb1 100644 --- a/src/lib/elementary/efl_ui_bg.c +++ b/src/lib/elementary/efl_ui_bg.c @@ -29,13 +29,12 @@ _efl_ui_bg_efl_object_constructor(Eo *obj, Efl_Ui_Bg_Data *pd) elm_widget_theme_klass_set(obj, "bg"); obj = efl_constructor(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_FALSE); - if (!elm_widget_theme_object_set(obj, wd->resize_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))) + elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); if (elm_widget_is_legacy(obj)) @@ -210,48 +209,76 @@ _efl_ui_bg_efl_gfx_image_load_controller_load_size_get(const Eo *obj EINA_UNUSED EAPI Eina_Bool elm_bg_file_set(Eo *obj, const char *file, const char *group) { - return efl_file_set((Eo *) obj, file, group); + return efl_file_simple_load((Eo *) obj, file, group); } -EOLIAN static Eina_Bool -_efl_ui_bg_efl_file_file_set(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Data *sd, const char *file, const char *key) +EOLIAN static Eina_Error +_efl_ui_bg_efl_file_load(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Data *sd) +{ + return efl_file_load(sd->img); +} + +EOLIAN static Eina_Error +_efl_ui_bg_efl_file_file_set(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Data *sd, const char *file) { eina_stringshare_replace(&sd->file, file); + + return efl_file_set(sd->img, file); +} + +EOLIAN static void +_efl_ui_bg_efl_file_key_set(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Data *sd, const char *key) +{ eina_stringshare_replace(&sd->key, key); - return efl_file_set(sd->img, file, key); + efl_file_key_set(sd->img, key); } + EAPI void elm_bg_file_get(const Eo *obj, const char **file, const char **group) { - efl_file_get((Eo *) obj, file, group); + efl_file_simple_get((Eo *) obj, file, group); } -EOLIAN static void -_efl_ui_bg_efl_file_file_get(const Eo *obj, Efl_Ui_Bg_Data *sd, const char **file, const char **key) +EOLIAN static const char * +_efl_ui_bg_efl_file_file_get(const Eo *obj, Efl_Ui_Bg_Data *sd) { if (elm_widget_is_legacy(obj)) - { - if (file) *file = sd->file; - if (key) *key = sd->key; - return; - } + return sd->file; - efl_file_get(sd->img, file, key); + return efl_file_get(sd->img); } -EOLIAN static Eina_Bool +EOLIAN static const char * +_efl_ui_bg_efl_file_key_get(const Eo *obj, Efl_Ui_Bg_Data *sd) +{ + if (elm_widget_is_legacy(obj)) + return sd->key; + + return efl_file_key_get(sd->img); +} + +EOLIAN static Eina_Error _efl_ui_bg_efl_file_mmap_set(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Data *sd, - const Eina_File *file, const char *key) + const Eina_File *file) { - return efl_file_mmap_set(sd->img, file, key); + return efl_file_mmap_set(sd->img, file); } -EOLIAN static void -_efl_ui_bg_efl_file_mmap_get(const Eo *obj EINA_UNUSED, Efl_Ui_Bg_Data *sd, - const Eina_File **file, const char **key) +EOLIAN static const Eina_File * +_efl_ui_bg_efl_file_mmap_get(const Eo *obj EINA_UNUSED, Efl_Ui_Bg_Data *sd) { - efl_file_mmap_get(sd->img, file, key); + return efl_file_mmap_get(sd->img); +} + + +EOLIAN static Eo * +_efl_ui_bg_efl_object_finalize(Eo *obj, Efl_Ui_Bg_Data *sd) +{ + obj = efl_finalize(efl_super(obj, MY_CLASS)); + if (!obj) return NULL; + if (efl_file_get(sd->img) || efl_file_mmap_get(sd->img)) efl_file_load(sd->img); + return obj; } /* Internal EO APIs and hidden overrides */ @@ -264,7 +291,7 @@ ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX) #include "efl_ui_bg.eo.c" -#include "efl_ui_bg_legacy.eo.h" +#include "efl_ui_bg_legacy_eo.h" #define MY_CLASS_NAME_LEGACY "elm_bg" @@ -292,4 +319,4 @@ elm_bg_add(Evas_Object *parent) return elm_legacy_add(EFL_UI_BG_LEGACY_CLASS, parent); } -#include "efl_ui_bg_legacy.eo.c" +#include "efl_ui_bg_legacy_eo.c" diff --git a/src/lib/elementary/efl_ui_bg.eo b/src/lib/elementary/efl_ui_bg.eo index 26b16437ab..bc0ef7efed 100644 --- a/src/lib/elementary/efl_ui_bg.eo +++ b/src/lib/elementary/efl_ui_bg.eo @@ -1,15 +1,17 @@ -class Efl.Ui.Bg extends Efl.Ui.Layout implements Efl.Gfx.Color, Efl.Gfx.Image, Efl.Gfx.Image_Load_Controller +class @beta Efl.Ui.Bg extends Efl.Ui.Layout_Base implements Efl.File, Efl.Gfx.Color, Efl.Gfx.Image, Efl.Gfx.Image_Load_Controller { [[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. ]] - legacy_prefix: elm_bg; implements { Efl.Object.constructor; Efl.Object.destructor; + Efl.Object.finalize; + Efl.File.load; Efl.File.file { get; set; } + Efl.File.key { get; set; } Efl.File.mmap { get; set; } Efl.Gfx.Color.color { get; set; } Efl.Gfx.Image.scale_type { get; set; } diff --git a/src/lib/elementary/efl_ui_bg_eo.legacy.h b/src/lib/elementary/efl_ui_bg_eo.legacy.h new file mode 100644 index 0000000000..8ad9bcd1f5 --- /dev/null +++ b/src/lib/elementary/efl_ui_bg_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_BG_EO_LEGACY_H_ +#define _EFL_UI_BG_EO_LEGACY_H_ + +#ifndef _EFL_UI_BG_EO_CLASS_TYPE +#define _EFL_UI_BG_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Bg; + +#endif + +#ifndef _EFL_UI_BG_EO_TYPES +#define _EFL_UI_BG_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/efl_ui_bg_legacy.eo b/src/lib/elementary/efl_ui_bg_legacy.eo deleted file mode 100644 index 7ab9aab3b4..0000000000 --- a/src/lib/elementary/efl_ui_bg_legacy.eo +++ /dev/null @@ -1,14 +0,0 @@ -class Efl.Ui.Bg_Legacy extends Efl.Ui.Bg implements 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_legacy_eo.c b/src/lib/elementary/efl_ui_bg_legacy_eo.c new file mode 100644 index 0000000000..9cd23ff42f --- /dev/null +++ b/src/lib/elementary/efl_ui_bg_legacy_eo.c @@ -0,0 +1,35 @@ + +Efl_Object *_efl_ui_bg_legacy_efl_object_constructor(Eo *obj, void *pd); + + +static Eina_Bool +_efl_ui_bg_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_BG_LEGACY_EXTRA_OPS +#define EFL_UI_BG_LEGACY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _efl_ui_bg_legacy_efl_object_constructor), + EFL_UI_BG_LEGACY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_bg_legacy_class_desc = { + EO_VERSION, + "Efl.Ui.Bg_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _efl_ui_bg_legacy_class_initializer, + _efl_ui_bg_legacy_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_bg_legacy_class_get, &_efl_ui_bg_legacy_class_desc, EFL_UI_BG_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/efl_ui_bg_legacy_eo.h b/src/lib/elementary/efl_ui_bg_legacy_eo.h new file mode 100644 index 0000000000..ea3641dc2e --- /dev/null +++ b/src/lib/elementary/efl_ui_bg_legacy_eo.h @@ -0,0 +1,32 @@ +#ifndef _EFL_UI_BG_LEGACY_EO_H_ +#define _EFL_UI_BG_LEGACY_EO_H_ + +#ifndef _EFL_UI_BG_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_BG_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Bg_Legacy; + +#endif + +#ifndef _EFL_UI_BG_LEGACY_EO_TYPES +#define _EFL_UI_BG_LEGACY_EO_TYPES + + +#endif +#ifdef EFL_BETA_API_SUPPORT +/** + * @brief 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. + * + * @ingroup Efl_Ui_Bg_Legacy + */ +#define EFL_UI_BG_LEGACY_CLASS efl_ui_bg_legacy_class_get() + +EWAPI const Efl_Class *efl_ui_bg_legacy_class_get(void); +#endif /* EFL_BETA_API_SUPPORT */ + +#endif diff --git a/src/lib/elementary/efl_ui_bg_legacy_eo.legacy.h b/src/lib/elementary/efl_ui_bg_legacy_eo.legacy.h new file mode 100644 index 0000000000..7498da1144 --- /dev/null +++ b/src/lib/elementary/efl_ui_bg_legacy_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_BG_LEGACY_EO_LEGACY_H_ +#define _EFL_UI_BG_LEGACY_EO_LEGACY_H_ + +#ifndef _EFL_UI_BG_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_BG_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Bg_Legacy; + +#endif + +#ifndef _EFL_UI_BG_LEGACY_EO_TYPES +#define _EFL_UI_BG_LEGACY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/efl_ui_box.c b/src/lib/elementary/efl_ui_box.c index 3abf465a1a..ce3304132d 100644 --- a/src/lib/elementary/efl_ui_box.c +++ b/src/lib/elementary/efl_ui_box.c @@ -7,148 +7,160 @@ * - removed transition stuff (TODO: add back - needs clean API first) */ -static const char SIG_CHILD_ADDED[] = "child,added"; -static const char SIG_CHILD_REMOVED[] = "child,removed"; -static const Evas_Smart_Cb_Description _smart_callbacks[] = { - {SIG_CHILD_ADDED, ""}, - {SIG_CHILD_REMOVED, ""}, - {NULL, NULL} -}; +#define EFL_UI_BOX_DATA_GET(o, sd) \ + Efl_Ui_Box_Data *sd = efl_data_scope_get(o, EFL_UI_BOX_CLASS) + +void _efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Efl_Ui_Box_Data *pd); static void -_child_added_cb_proxy(void *data, const Efl_Event *event) +_on_child_size_changed(void *data, const Efl_Event *event EINA_UNUSED) { - Evas_Object *box = data; - Evas_Object_Box_Option *opt = event->info; - - efl_event_callback_legacy_call(box, EFL_CONTAINER_EVENT_CONTENT_ADDED, opt->obj); + Eo *box = data; + efl_pack_layout_request(box); } static void -_child_removed_cb_proxy(void *data, const Efl_Event *event) +_on_child_del(void *data, const Efl_Event *event) { - Evas_Object *box = data; - Evas_Object *child = event->info; + Eo *box = data; + EFL_UI_BOX_DATA_GET(box, sd); - efl_event_callback_legacy_call(box, EFL_CONTAINER_EVENT_CONTENT_REMOVED, child); + sd->children = eina_list_remove(sd->children, event->object); + + efl_pack_layout_request(box); } static void -_sizing_eval(Evas_Object *obj, Efl_Ui_Box_Data *sd) +_on_child_hints_changed(void *data, const Efl_Event *event EINA_UNUSED) { - Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - Evas_Coord w, h; + Eo *box = data; + efl_pack_layout_request(box); +} - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); +EFL_CALLBACKS_ARRAY_DEFINE(efl_ui_box_callbacks, + { EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _on_child_size_changed }, + { EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _on_child_hints_changed }, + { EFL_EVENT_DEL, _on_child_del } +); - if (!efl_alive_get(obj)) return; - if (sd->delete_me) +static inline Eina_Bool +_efl_ui_box_child_register(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj) +{ + if (!subobj || (efl_canvas_object_render_parent_get(subobj) == obj)) + { + ERR("subobj %p %s is already added to this", subobj, efl_class_name_get(subobj) ); + return EINA_FALSE; + } + + if (!efl_ui_widget_sub_object_add(obj, subobj)) + return EINA_FALSE; + + efl_key_data_set(subobj, "_elm_leaveme", obj); + efl_canvas_group_member_add(obj, subobj); + efl_canvas_object_clipper_set(subobj, pd->clipper); + efl_pack_layout_request(obj); + + efl_event_callback_array_add(subobj, efl_ui_box_callbacks(), obj); + efl_event_callback_call(obj, EFL_CONTAINER_EVENT_CONTENT_ADDED, subobj); + + return EINA_TRUE; +} + +static inline Eina_Bool +_efl_ui_box_child_unregister(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED, Efl_Gfx_Entity *subobj) +{ + if (efl_canvas_object_render_parent_get(subobj) != obj) + { + ERR("subobj %p %s is not part of this widget", subobj, efl_class_name_get(subobj) ); + return EINA_FALSE; + } + if (!subobj || !_elm_widget_sub_object_redirect_to_top(obj, subobj)) + return EINA_FALSE; + + efl_canvas_group_member_remove(obj, subobj); + efl_canvas_object_clipper_set(subobj, NULL); + efl_key_data_set(subobj, "_elm_leaveme", NULL); + efl_pack_layout_request(obj); + + efl_event_callback_array_del(subobj, efl_ui_box_callbacks(), obj); + efl_event_callback_call(obj, EFL_CONTAINER_EVENT_CONTENT_REMOVED, subobj); + + return EINA_TRUE; +} + +static void +_efl_ui_box_size_hints_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev) +{ + efl_pack_layout_request(ev->object); +} + +EOLIAN static void +_efl_ui_box_homogeneous_set(Eo *obj, Efl_Ui_Box_Data *pd, Eina_Bool homogeneous) +{ + homogeneous = !!homogeneous; + + if (pd->homogeneous == homogeneous) return; - evas_object_size_hint_combined_min_get(wd->resize_obj, &minw, &minh); - evas_object_size_hint_max_get(wd->resize_obj, &maxw, &maxh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, maxw, maxh); - - evas_object_geometry_get(obj, NULL, NULL, &w, &h); - if (w < minw) w = minw; - if (h < minh) h = minh; - if ((maxw >= 0) && (w > maxw)) w = maxw; - if ((maxh >= 0) && (h > maxh)) h = maxh; - evas_object_resize(obj, w, h); + pd->homogeneous = homogeneous; + efl_pack_layout_request(obj); } -static void -_on_size_hints_changed(void *data, Evas *e EINA_UNUSED, - Evas_Object *resizeobj, void *event_info EINA_UNUSED) +EOLIAN static Eina_Bool +_efl_ui_box_homogeneous_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd) { - Efl_Ui_Box *obj = data; - Efl_Ui_Box_Data *pd = efl_data_scope_get(obj, EFL_UI_BOX_CLASS); - - if (obj == resizeobj) - efl_pack_layout_request(obj); - else - _sizing_eval(data, pd); + return pd->homogeneous; } -static void -_evas_box_custom_layout(Evas_Object *evas_box EINA_UNUSED, - Evas_Object_Box_Data *bd EINA_UNUSED, void *data) +EOLIAN static void +_efl_ui_box_efl_pack_layout_layout_update(Eo *obj, Efl_Ui_Box_Data *pd) { - Efl_Ui_Box *obj = data; + _efl_ui_box_custom_layout(obj, pd); +} +EOLIAN static void +_efl_ui_box_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSED) +{ efl_pack_layout_update(obj); } EOLIAN static void -_efl_ui_box_efl_pack_layout_layout_update(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED) +_efl_ui_box_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSED, Eina_Size2D sz) { - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - Evas_Object_Box_Data *bd; - - bd = evas_object_smart_data_get(wd->resize_obj); - _efl_ui_box_custom_layout(obj, bd); - efl_event_callback_legacy_call(obj, EFL_PACK_EVENT_LAYOUT_UPDATED, NULL); + efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz); + efl_canvas_group_change(obj); } EOLIAN static void -_efl_ui_box_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Box_Data *pd) +_efl_ui_box_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSED, Eina_Position2D pos) { - if (pd->recalc) return; - - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - evas_object_smart_need_recalculate_set(wd->resize_obj, EINA_TRUE); - pd->recalc = EINA_TRUE; - evas_object_smart_calculate(wd->resize_obj); - pd->recalc = EINA_FALSE; + efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos); + efl_canvas_group_change(obj); } EOLIAN static void -_efl_ui_box_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSED) +_efl_ui_box_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Box_Data *pd) { - Evas *e = evas_object_evas_get(obj); - - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - elm_widget_resize_object_set(obj, evas_object_box_add(e)); - evas_object_box_layout_set(wd->resize_obj, _evas_box_custom_layout, obj, NULL); - - evas_object_event_callback_add(wd->resize_obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_size_hints_changed, obj); - evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_size_hints_changed, obj); + pd->clipper = efl_add(EFL_CANVAS_RECTANGLE_CLASS, obj); + evas_object_static_clip_set(pd->clipper, EINA_TRUE); + efl_gfx_entity_geometry_set(pd->clipper, EINA_RECT(-49999, -49999, 99999, 99999)); + efl_canvas_group_member_add(obj, pd->clipper); + efl_ui_widget_sub_object_add(obj, pd->clipper); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); - efl_event_callback_add(wd->resize_obj, EVAS_BOX_EVENT_CHILD_ADDED, _child_added_cb_proxy, obj); - efl_event_callback_add(wd->resize_obj, EVAS_BOX_EVENT_CHILD_REMOVED, _child_removed_cb_proxy, obj); - - elm_widget_can_focus_set(obj, EINA_FALSE); + efl_ui_widget_focus_allow_set(obj, EINA_FALSE); elm_widget_highlight_ignore_set(obj, EINA_TRUE); + + efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, + _efl_ui_box_size_hints_changed_cb, NULL); } EOLIAN static void -_efl_ui_box_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Box_Data *sd) +_efl_ui_box_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSED) { - Eina_List *l; - Evas_Object *child; - - sd->delete_me = EINA_TRUE; - - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - evas_object_event_callback_del_full - (wd->resize_obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _on_size_hints_changed, obj); - - /* let's make our box object the *last* to be processed, since it - * may (smart) parent other sub objects here */ - EINA_LIST_FOREACH (wd->subobjs, l, child) - { - if (child == wd->resize_obj) - { - wd->subobjs = - eina_list_demote_list(wd->subobjs, l); - break; - } - } + efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, + _efl_ui_box_size_hints_changed_cb, NULL); efl_canvas_group_del(efl_super(obj, MY_CLASS)); } @@ -158,10 +170,10 @@ _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_object_access_type_set(obj, EFL_ACCESS_TYPE_SKIPPED); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_FILLER); + pd->dir = EFL_UI_DIR_VERTICAL; pd->align.h = 0.5; pd->align.v = 0.5; @@ -171,48 +183,34 @@ _efl_ui_box_efl_object_constructor(Eo *obj, Efl_Ui_Box_Data *pd) /* CLEAN API BELOW */ EOLIAN static int -_efl_ui_box_efl_container_content_count(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED) +_efl_ui_box_efl_container_content_count(Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd) { - Evas_Object_Box_Data *bd; - - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, 0); - - bd = evas_object_smart_data_get(wd->resize_obj); - return bd ? eina_list_count(bd->children) : 0; + return eina_list_count(pd->children); } EOLIAN static Eina_Bool _efl_ui_box_efl_pack_pack_clear(Eo *obj, Efl_Ui_Box_Data *pd) { - Eina_Bool ret; + Eo *child; + EINA_LIST_FREE(pd->children, child) + { + efl_event_callback_array_del(child, efl_ui_box_callbacks(), obj); + efl_del(child); + } - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); + efl_pack_layout_request(obj); - ret = evas_object_box_remove_all(wd->resize_obj, EINA_TRUE); - _sizing_eval(obj, pd); - - return ret; + return EINA_TRUE; } EOLIAN static Eina_Bool _efl_ui_box_efl_pack_unpack_all(Eo *obj, Efl_Ui_Box_Data *pd) { - Evas_Object_Box_Data *bd; - Evas_Object_Box_Option *opt; - Eina_List *l; - Eina_Bool ret; + Eo *child; + Eina_Bool ret = EINA_TRUE; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); - - /* set this to block _sizing_eval() calls */ - pd->delete_me = EINA_TRUE; - bd = evas_object_smart_data_get(wd->resize_obj); - EINA_LIST_FOREACH(bd->children, l, opt) - _elm_widget_sub_object_redirect_to_top(obj, opt->obj); - pd->delete_me = EINA_FALSE; - - ret = evas_object_box_remove_all(wd->resize_obj, EINA_FALSE); - _sizing_eval(obj, pd); + EINA_LIST_FREE(pd->children, child) + ret &= _efl_ui_box_child_unregister(obj, pd, child); return ret; } @@ -220,16 +218,12 @@ _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_Entity *subobj) { - Eina_Bool ret = EINA_FALSE; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); + if (!_efl_ui_box_child_unregister(obj, pd, subobj)) + return EINA_FALSE; - if (evas_object_box_remove(wd->resize_obj, subobj)) - { - ret = _elm_widget_sub_object_redirect_to_top(obj, subobj); - _sizing_eval(obj, pd); - } + pd->children = eina_list_remove(pd->children, subobj); - return ret; + return EINA_TRUE; } EOLIAN static Eina_Bool @@ -239,133 +233,91 @@ _efl_ui_box_efl_pack_pack(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED, Efl_Gfx_Enti } EOLIAN static Eina_Bool -_efl_ui_box_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED, Efl_Gfx_Entity *subobj) +_efl_ui_box_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj) { - Eina_Bool ret; - - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); - - ret = elm_widget_sub_object_add(obj, subobj); - ret &= (evas_object_box_append(wd->resize_obj, subobj) != NULL); - - return ret; -} - -EOLIAN static Eina_Bool -_efl_ui_box_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSED, Efl_Gfx_Entity *subobj) -{ - Eina_Bool ret; - - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); - - ret = elm_widget_sub_object_add(obj, subobj); - ret &= (evas_object_box_prepend(wd->resize_obj, subobj) != NULL); - - return ret; -} - -EOLIAN static Eina_Bool -_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); - - if (!elm_widget_sub_object_add(obj, subobj)) + if (!_efl_ui_box_child_register(obj, pd, subobj)) return EINA_FALSE; - if (!evas_object_box_insert_before(wd->resize_obj, subobj, existing)) - { - elm_widget_sub_object_del(obj, subobj); - return EINA_FALSE; - } + pd->children = eina_list_append(pd->children, subobj); return EINA_TRUE; } EOLIAN static Eina_Bool -_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) +_efl_ui_box_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj) { - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); - - if (!elm_widget_sub_object_add(obj, subobj)) + if (!_efl_ui_box_child_register(obj, pd, subobj)) return EINA_FALSE; - if (!evas_object_box_insert_after(wd->resize_obj, subobj, existing)) - { - elm_widget_sub_object_del(obj, subobj); - return EINA_FALSE; - } + pd->children = eina_list_prepend(pd->children, subobj); return EINA_TRUE; } EOLIAN static Eina_Bool -_efl_ui_box_efl_pack_linear_pack_at(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED, - Efl_Gfx_Entity *subobj, int index) +_efl_ui_box_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) { - if (!index) + if (!_efl_ui_box_child_register(obj, pd, subobj)) + return EINA_FALSE; + + pd->children = eina_list_prepend_relative(pd->children, subobj, existing); + + return EINA_TRUE; +} + +EOLIAN static Eina_Bool +_efl_ui_box_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) +{ + if (!_efl_ui_box_child_register(obj, pd, subobj)) + return EINA_FALSE; + + pd->children = eina_list_append_relative(pd->children, subobj, existing); + + return EINA_TRUE; +} + +EOLIAN static Eina_Bool +_efl_ui_box_efl_pack_linear_pack_at(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj, int index) +{ + int count = eina_list_count(pd->children); + + if (index < -count) return efl_pack_begin(obj, subobj); - else if (index == -1) + + if (index >= count) return efl_pack_end(obj, subobj); - else - { - Evas_Object_Box_Data *bd; - int cnt; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); + if (index < 0) + index += count; - bd = evas_object_smart_data_get(wd->resize_obj); - cnt = eina_list_count(bd ? bd->children : NULL); - if (!cnt) - index = 0; - else - { - index %= cnt; - if (index < 0) index += cnt; - } - return (evas_object_box_insert_at(wd->resize_obj, subobj, index) != NULL); - } -} + if (!_efl_ui_box_child_register(obj, pd, subobj)) + return EINA_FALSE; -static inline Efl_Gfx_Entity * -_box_item(Evas_Object_Box_Option *opt) -{ - return opt ? opt->obj : NULL; + pd->children = eina_list_prepend_relative_list(pd->children, subobj, + eina_list_nth_list(pd->children, index)); + + return EINA_TRUE; } 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) +_efl_ui_box_efl_pack_linear_pack_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd, int index) { - Evas_Object_Box_Data *bd; - int cnt; + int count = eina_list_count(pd->children); - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); - bd = evas_object_smart_data_get(wd->resize_obj); - if (!bd || !bd->children) return NULL; + if (index <= -count) + return eina_list_data_get(pd->children); - if (!index) - return _box_item(eina_list_data_get(bd->children)); - else if (index == -1) - return _box_item(eina_list_last_data_get(bd->children)); + if (index >= count) + return eina_list_last_data_get(pd->children); - cnt = eina_list_count(bd->children); - if (!cnt) return NULL; + if (index < 0) + index += count; - if (index >= (cnt - 1)) - return _box_item(eina_list_last_data_get(bd->children)); - else if (index <= (-cnt)) - return _box_item(eina_list_data_get(bd->children)); - - // this should loop only once - while (index < 0) - index += cnt; - - return _box_item(eina_list_nth(bd->children, index)); + return eina_list_nth(pd->children, index); } 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_ui_box_efl_pack_linear_pack_unpack_at(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED, int index) { Efl_Gfx_Entity *content; @@ -379,90 +331,28 @@ _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_Entity *subobj) +_efl_ui_box_efl_pack_linear_pack_index_get(Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd, const Efl_Gfx_Entity *subobj) { - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, -1); - Evas_Object_Box_Data *bd; - Evas_Object_Box_Option *opt; - Eina_List *l; - int k = 0; - - if (evas_object_smart_parent_get(subobj) != wd->resize_obj) - goto end; - - bd = evas_object_smart_data_get(wd->resize_obj); - EINA_LIST_FOREACH(bd->children, l, opt) - { - if (opt->obj == subobj) - return k; - k++; - } - -end: - ERR("object %p (%s) is not a child of %p (%s)", - subobj, efl_class_name_get(subobj), obj, efl_class_name_get(obj)); - return -1; + return eina_list_data_idx(pd->children, (Efl_Gfx_Entity *)subobj); } EOLIAN static void _efl_ui_box_efl_pack_layout_layout_request(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED) { - evas_object_smart_need_recalculate_set(obj, EINA_TRUE); -} - -static Eina_Bool -_box_item_iterator_next(Box_Item_Iterator *it, void **data) -{ - Efl_Gfx_Entity *sub; - - if (!eina_iterator_next(it->real_iterator, (void **) &sub)) - return EINA_FALSE; - - if (data) *data = sub; - return EINA_TRUE; -} - -static Eo * -_box_item_iterator_get_container(Box_Item_Iterator *it) -{ - return it->object; -} - -static void -_box_item_iterator_free(Box_Item_Iterator *it) -{ - eina_iterator_free(it->real_iterator); - eina_list_free(it->list); - free(it); + efl_canvas_group_need_recalculate_set(obj, EINA_TRUE); } EOLIAN static Eina_Iterator * -_efl_ui_box_efl_container_content_iterate(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED) +_efl_ui_box_efl_container_content_iterate(Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd) { - Box_Item_Iterator *it; - - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); - - it = calloc(1, sizeof(*it)); - if (!it) return NULL; - - EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); - - it->list = evas_object_box_children_get(wd->resize_obj); - it->real_iterator = eina_list_iterator_new(it->list); - it->iterator.version = EINA_ITERATOR_VERSION; - it->iterator.next = FUNC_ITERATOR_NEXT(_box_item_iterator_next); - it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_box_item_iterator_get_container); - it->iterator.free = FUNC_ITERATOR_FREE(_box_item_iterator_free); - it->object = obj; - - return &it->iterator; + return eina_list_iterator_new(pd->children); } EOLIAN static void _efl_ui_box_efl_ui_direction_direction_set(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Ui_Dir dir) { + if (pd->dir == dir) return; + switch (dir) { case EFL_UI_DIR_RTL: @@ -494,28 +384,24 @@ _efl_ui_box_efl_ui_direction_direction_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box EOLIAN static void _efl_ui_box_efl_pack_pack_padding_set(Eo *obj, Efl_Ui_Box_Data *pd, double h, double v, Eina_Bool scalable) { - - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - + scalable = !!scalable; if (h < 0) h = 0; if (v < 0) v = 0; + + if (EINA_DBL_EQ(pd->pad.h, h) && EINA_DBL_EQ(pd->pad.v, v) && + (pd->pad.scalable == scalable)) + return; + pd->pad.h = h; pd->pad.v = v; - pd->pad.scalable = !!scalable; - if (pd->pad.scalable) - { - double scale = elm_object_scale_get(obj); - evas_object_box_padding_set(wd->resize_obj, h * scale, v * scale); - } - else - evas_object_box_padding_set(wd->resize_obj, h, v); + pd->pad.scalable = scalable; + + efl_pack_layout_request(obj); } EOLIAN static void -_efl_ui_box_efl_pack_pack_padding_get(const 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 EINA_UNUSED, Efl_Ui_Box_Data *pd, double *h, double *v, Eina_Bool *scalable) { - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - if (scalable) *scalable = pd->pad.scalable; if (h) *h = pd->pad.h; if (v) *v = pd->pad.v; @@ -524,16 +410,17 @@ _efl_ui_box_efl_pack_pack_padding_get(const Eo *obj, Efl_Ui_Box_Data *pd, double EOLIAN static void _efl_ui_box_efl_pack_pack_align_set(Eo *obj, Efl_Ui_Box_Data *pd, double h, double v) { - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - if (h < 0) h = -1; + else if (h > 1) h = 1; if (v < 0) v = -1; - if (h > 1) h = 1; - if (v > 1) v = 1; + else if (v > 1) v = 1; + + if (EINA_DBL_EQ(pd->align.h, h) && EINA_DBL_EQ(pd->align.v, v)) + return; + pd->align.h = h; pd->align.v = v; - evas_object_box_align_set(wd->resize_obj, h, v); efl_pack_layout_request(obj); } diff --git a/src/lib/elementary/efl_ui_box.eo b/src/lib/elementary/efl_ui_box.eo index 76a546b5eb..5e5950cd63 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 extends Efl.Ui.Widget implements Efl.Pack_Linear, Efl.Pack_Layout, +class @beta Efl.Ui.Box extends Efl.Ui.Widget implements Efl.Pack_Linear, Efl.Pack_Layout, Efl.Ui.Direction { [[The box widget. @@ -15,10 +15,23 @@ class Efl.Ui.Box extends Efl.Ui.Widget implements Efl.Pack_Linear, Efl.Pack_Layo THIS CLASS NEEDS GOOD UP TO DATE DOCUMENTATION. LEGACY BOX AND UI BOX BEHAVE SLIGHTLY DIFFERENTLY AND USE VASTLY DIFFERENT APIS. ]] + methods { + @property homogeneous { + [[Control homogeneous mode. + + This will enable the homogeneous mode where children are of the same + weight and of the same min size which is determined by maximum min + size of children.]] + values { + homogeneous: bool; [[$true if the box is homogeneous, $false otherwise]] + } + } + } implements { Efl.Object.constructor; Efl.Canvas.Group.group_calculate; - //Efl.Container.content_remove; // TODO + Efl.Gfx.Entity.position { set; } + Efl.Gfx.Entity.size { set; } Efl.Container.content_iterate; Efl.Container.content_count; Efl.Ui.Direction.direction { get; set; } diff --git a/src/lib/elementary/efl_ui_box_flow.c b/src/lib/elementary/efl_ui_box_flow.c index a93ccc9e49..2600acffd9 100644 --- a/src/lib/elementary/efl_ui_box_flow.c +++ b/src/lib/elementary/efl_ui_box_flow.c @@ -1,4 +1,5 @@ #include "efl_ui_box_private.h" +#include "efl_ui_container_layout.h" #define MY_CLASS EFL_UI_BOX_FLOW_CLASS @@ -6,75 +7,352 @@ typedef struct _Efl_Ui_Box_Flow_Data Efl_Ui_Box_Flow_Data; struct _Efl_Ui_Box_Flow_Data { - Eina_Bool homogenous; - Eina_Bool max_size; }; -EOLIAN static void -_efl_ui_box_flow_box_flow_homogenous_set(Eo *obj EINA_UNUSED, Efl_Ui_Box_Flow_Data *pd, Eina_Bool val) +typedef struct _Item_Calc Item_Calc; +typedef struct _Row_Calc Row_Calc; + +struct _Item_Calc { - pd->homogenous = val; + EINA_INLIST; + + Evas_Object *obj; + Row_Calc *row; + double weight_factor; + Efl_Ui_Container_Item_Hints hints[2]; /* 0 is x-axis, 1 is y-axis */ +}; + +struct _Row_Calc +{ + EINA_INLIST; + + Evas_Object *obj; + int item_count; + int min_sum; + int hgsize; + double weight_sum; + double cross_weight; + double cross_space; + double cur_pos; + double weight_factor; + Efl_Ui_Container_Item_Hints hint; +}; + +static int +_item_weight_sort_cb(const void *l1, const void *l2) +{ + Item_Calc *it1, *it2; + + it1 = EINA_INLIST_CONTAINER_GET(l1, Item_Calc); + it2 = EINA_INLIST_CONTAINER_GET(l2, Item_Calc); + + return it2->weight_factor <= it1->weight_factor ? -1 : 1; } -EOLIAN static Eina_Bool -_efl_ui_box_flow_box_flow_homogenous_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Flow_Data *pd) +static int +_row_weight_sort_cb(const void *l1, const void *l2) { - return pd->homogenous; + Row_Calc *it1, *it2; + + it1 = EINA_INLIST_CONTAINER_GET(l1, Row_Calc); + it2 = EINA_INLIST_CONTAINER_GET(l2, Row_Calc); + + return it2->weight_factor <= it1->weight_factor ? -1 : 1; } EOLIAN static void -_efl_ui_box_flow_box_flow_max_size_set(Eo *obj EINA_UNUSED, Efl_Ui_Box_Flow_Data *pd, Eina_Bool val) +_efl_ui_box_flow_efl_pack_layout_layout_update(Eo *obj, Efl_Ui_Box_Flow_Data *pd EINA_UNUSED) { - pd->max_size = val; -} + Efl_Ui_Box_Data *bd = efl_data_scope_get(obj, EFL_UI_BOX_CLASS); + Eo *child; + Eina_List *li; + Eina_Inlist *inlist = NULL; + Item_Calc *items, *item; + Row_Calc *rows, *row; + Efl_Ui_Container_Item_Hints *hints, *hint; + Eina_Bool axis = !efl_ui_dir_is_horizontal(bd->dir, EINA_FALSE); + Eina_Bool c_axis = !axis; + int want[2] = { 0, 0 }; + int rc = 0, count, i = 0, id, item_last = 0; + double cur_pos, cross_weight_sum = 0, cross_min_sum = 0, min_sum = 0; + Efl_Ui_Container_Layout_Calc box_calc[2]; /* 0 is x-axis, 1 is y-axis */ -EOLIAN static Eina_Bool -_efl_ui_box_flow_box_flow_max_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Flow_Data *pd) -{ - return pd->max_size; -} - -EOLIAN static void -_efl_ui_box_flow_efl_pack_layout_layout_update(Eo *obj, Efl_Ui_Box_Flow_Data *pd) -{ - void (*func)(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data); - Evas_Object_Box_Data *bd; - Eina_Bool homo = EINA_FALSE, maxsize = EINA_FALSE; - - EINA_SAFETY_ON_FALSE_RETURN(efl_isa(obj, EFL_UI_BOX_CLASS)); - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - bd = efl_data_scope_get(wd->resize_obj, EVAS_BOX_CLASS); - - homo = pd->homogenous; - maxsize = pd->max_size; - - // This makes it horizontal by default, as opposed to the standard box. - if (efl_ui_dir_is_horizontal(efl_ui_direction_get(obj), EINA_TRUE)) + count = eina_list_count(bd->children); + if (!count) { - if (homo) - { - if (maxsize) - func = evas_object_box_layout_homogeneous_max_size_horizontal; - else - func = evas_object_box_layout_homogeneous_horizontal; - } - else - func = evas_object_box_layout_flow_horizontal; - } - else - { - if (homo) - { - if (maxsize) - func = evas_object_box_layout_homogeneous_max_size_vertical; - else - func = evas_object_box_layout_homogeneous_vertical; - } - else - func = evas_object_box_layout_flow_vertical; + efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(0, 0)); + return; } - func(wd->resize_obj, bd, NULL); + _efl_ui_container_layout_init(obj, box_calc); + + items = alloca(count * sizeof(*items)); + rows = alloca(count * sizeof(*rows)); + memset(rows, 0, count * sizeof(*rows)); + +#ifdef DEBUG + memset(items, 0, count * sizeof(*items)); +#endif + + // scan all items, get their properties, calculate total weight & min size + EINA_LIST_FOREACH(bd->children, li, child) + { + item = &items[i++]; + item->obj = child; + hints = item->hints; + + _efl_ui_container_layout_item_init(item->obj, hints); + + if ((bd->homogeneous && !axis) || box_calc[0].fill) + hints[0].weight = 1; + else if (hints[0].weight < 0) + hints[0].weight = 0; + + if ((bd->homogeneous && axis) || box_calc[1].fill) + hints[1].weight = 1; + else if (hints[1].weight < 0) + hints[1].weight = 0; + + if (want[axis] < hints[axis].space) + want[axis] = hints[axis].space; + + if (bd->homogeneous) + continue; + + if (i == 1) + { + min_sum = hints[axis].space; + } + else if (box_calc[axis].size < (min_sum + hints[axis].space + box_calc[axis].pad)) + { + min_sum = hints[axis].space; + rc++; + } + else + { + min_sum += (hints[axis].space + box_calc[axis].pad); + } + + row = &rows[rc]; + item->row = row; + + if (row->cross_weight < hints[c_axis].weight) + row->cross_weight = hints[c_axis].weight; + if (row->cross_space < hints[c_axis].space) + row->cross_space = hints[c_axis].space; + row->weight_sum += hints[axis].weight; + row->min_sum += hints[axis].space; + row->item_count++; + } + + // initialize homogeneous properties + if (bd->homogeneous) + { + min_sum = 0; + for (i = 0; i < count; i++) + { + item = &items[i]; + hints = items[i].hints; + + if (i == 0) + { + min_sum = want[axis]; + } + else if (box_calc[axis].size < (min_sum + want[axis] + box_calc[axis].pad)) + { + min_sum = want[axis]; + rc++; + } + else + { + min_sum += (want[axis] + box_calc[axis].pad); + } + + row = &rows[rc]; + item->row = row; + + if (row->cross_weight < hints[c_axis].weight) + row->cross_weight = hints[c_axis].weight; + if (row->cross_space < hints[c_axis].space) + row->cross_space = hints[c_axis].space; + row->item_count++; + } + } + + // calculate item space of each row + for (id = 0, i = 0; id <= rc; id++) + { + int box_size; + + row = &rows[id]; + row->cur_pos = box_calc[axis].pos; + + box_size = box_calc[axis].size - + (box_calc[axis].pad * (row->item_count - 1)); + row->hgsize = box_size / row->item_count; + + cross_min_sum += row->cross_space; + cross_weight_sum += row->cross_weight; + + if (bd->homogeneous) + continue; + + if (row->weight_sum > 0) + { + int calc_size; + double orig_weight = row->weight_sum; + + calc_size = box_size; + inlist = NULL; + + item_last += row->item_count; + for (; i < item_last; i++) + { + double denom; + hint = &items[i].hints[axis]; + + denom = (hint->weight * box_size) - (orig_weight * hint->space); + if (denom > 0) + { + items[i].weight_factor = (hint->weight * box_size) / denom; + inlist = eina_inlist_sorted_insert(inlist, EINA_INLIST_GET(&items[i]), + _item_weight_sort_cb); + + } + else + { + calc_size -= hint->space; + row->weight_sum -= hint->weight; + } + } + + EINA_INLIST_FOREACH(inlist, item) + { + double weight_len; + hint = &item->hints[axis]; + + weight_len = (calc_size * hint->weight) / row->weight_sum; + if (hint->space < weight_len) + { + hint->space = weight_len; + } + else + { + row->weight_sum -= hint->weight; + calc_size -= hint->space; + } + } + } + else if (EINA_DBL_EQ(row->weight_sum, 0)) + { + row->cur_pos += (box_size - row->min_sum) * box_calc[axis].align; + } + } + + // calculate row space + box_calc[c_axis].size -= (box_calc[c_axis].pad * rc); + cur_pos = box_calc[c_axis].pos; + if ((box_calc[c_axis].size > cross_min_sum)) + { + if (cross_weight_sum > 0) + { + int orig_size, calc_size; + double orig_weight = cross_weight_sum; + + calc_size = orig_size = box_calc[c_axis].size; + inlist = NULL; + + for (i = 0; i <= rc; i++) + { + double denom; + row = &rows[i]; + + denom = (row->cross_weight * orig_size) - + (orig_weight * row->cross_space); + if (denom > 0) + { + row->weight_factor = (row->cross_weight * orig_size) / denom; + inlist = eina_inlist_sorted_insert(inlist, EINA_INLIST_GET(row), + _row_weight_sort_cb); + + } + else + { + calc_size -= row->cross_space; + cross_weight_sum -= row->cross_weight; + } + } + + EINA_INLIST_FOREACH(inlist, row) + { + double weight_len; + + weight_len = (calc_size * row->cross_weight) / cross_weight_sum; + if (row->cross_space < weight_len) + { + row->cross_space = weight_len; + } + else + { + cross_weight_sum -= row->cross_weight; + calc_size -= row->cross_space; + } + } + } + else if (EINA_DBL_EQ(cross_weight_sum, 0)) + { + cur_pos += (box_calc[c_axis].size - cross_min_sum) * box_calc[c_axis].align; + } + } + + // calculate item geometry + int item_size[2], item_pos[2], sw, sh; + + row = NULL; + for (i = 0; i < count; i++) + { + item = &items[i]; + hints = items[i].hints; + + if (row && (row != item->row)) + cur_pos += row->cross_space + box_calc[c_axis].pad; + + row = item->row; + + if (bd->homogeneous) + hints[axis].space = row->hgsize; + hints[c_axis].space = row->cross_space; + sw = hints[0].space - (hints[0].margin[0] + hints[0].margin[1]); + sh = hints[1].space - (hints[1].margin[0] + hints[1].margin[1]); + + item_size[0] = ((hints[0].weight > 0) && hints[0].fill) ? sw : 0; + item_size[1] = ((hints[1].weight > 0) && hints[1].fill) ? sh : 0; + + _efl_ui_container_layout_min_max_calc(hints, &item_size[0], &item_size[1], + (hints[0].aspect > 0) && (hints[1].aspect > 0)); + + item_pos[axis] = row->cur_pos + 0.5; + item_pos[c_axis] = cur_pos + 0.5; + + item_pos[0] += (hints[0].margin[0] + + ((sw - item_size[0]) * hints[0].align)); + item_pos[1] += (hints[1].margin[0] + + ((sh - item_size[1]) * hints[1].align)); + + row->cur_pos += hints[axis].space + box_calc[axis].pad; + + efl_gfx_entity_geometry_set(items[i].obj, + EINA_RECT(item_pos[0], item_pos[1], + item_size[0], item_size[1])); + } + + want[axis] += (box_calc[axis].margin[0] + box_calc[axis].margin[1]); + want[c_axis] = (box_calc[c_axis].margin[0] + box_calc[c_axis].margin[1]) + + (box_calc[c_axis].pad * rc) + cross_min_sum; + + efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(want[0], want[1])); + + efl_event_callback_call(obj, EFL_PACK_EVENT_LAYOUT_UPDATED, NULL); } #include "efl_ui_box_flow.eo.c" diff --git a/src/lib/elementary/efl_ui_box_flow.eo b/src/lib/elementary/efl_ui_box_flow.eo index 82e5bdbdfe..91336525dc 100644 --- a/src/lib/elementary/efl_ui_box_flow.eo +++ b/src/lib/elementary/efl_ui_box_flow.eo @@ -1,24 +1,6 @@ -class Efl.Ui.Box_Flow extends Efl.Ui.Box +class @beta Efl.Ui.Box_Flow extends Efl.Ui.Box { [[A custom layout engine for @Efl.Ui.Box.]] - methods { - @property box_flow_homogenous { - [[Box flow homogenous property]] - set {} - get {} - values { - val: bool; [[$true if the box flow layout is homogenous, $false otherwise]] - } - } - @property box_flow_max_size { - [[Box flow maximum size property]] - set {} - get {} - values { - val: bool; [[$true if the box flow layout has the maximal size, $false otherwise]] - } - } - } implements { Efl.Pack_Layout.layout_update; } diff --git a/src/lib/elementary/efl_ui_box_layout.c b/src/lib/elementary/efl_ui_box_layout.c index c42dd740a1..7240cd012c 100644 --- a/src/lib/elementary/efl_ui_box_layout.c +++ b/src/lib/elementary/efl_ui_box_layout.c @@ -1,399 +1,204 @@ -#define EFL_GFX_SIZE_HINT_PROTECTED +#define EFL_GFX_HINT_PROTECTED #include "efl_ui_box_private.h" +#include "efl_ui_container_layout.h" -// FIXME: Aspect support is not implemented // FIXME: handle RTL? just invert the horizontal order? typedef struct _Item_Calc Item_Calc; struct _Item_Calc { + EINA_INLIST; + Evas_Object *obj; - double weight[2]; - double align[2]; - Eina_Bool fill[2]; - Eina_Size2D max, want, aspect; - int pad[4]; - Efl_Gfx_Size_Hint_Aspect aspect_type; - int id; + double weight_factor; + Efl_Ui_Container_Item_Hints hints[2]; /* 0 is x-axis, 1 is y-axis */ }; -void -_efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Evas_Object_Box_Data *bd) +static int +_weight_sort_cb(const void *l1, const void *l2) { - Efl_Ui_Box_Data *pd = efl_data_scope_get(ui_box, EFL_UI_BOX_CLASS); - Evas_Object_Box_Option *opt; - Evas_Object *o; + Item_Calc *it1, *it2; + + it1 = EINA_INLIST_CONTAINER_GET(l1, Item_Calc); + it2 = EINA_INLIST_CONTAINER_GET(l2, Item_Calc); + + return it2->weight_factor <= it1->weight_factor ? -1 : 1; +} + +void +_efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Efl_Ui_Box_Data *pd) +{ + Eo *child; Eina_List *li; - int wantw = 0, wanth = 0; // requested size - int boxx, boxy, boxw, boxh; + Eina_Inlist *inlist = NULL; Item_Calc *items, *item; - Eina_Bool horiz = efl_ui_dir_is_horizontal(pd->dir, EINA_FALSE); - Eina_Bool zeroweight = EINA_FALSE; - int id = 0, count, boxl = 0, boxr = 0, boxt = 0, boxb = 0; - int length, want, pad, extra = 0, rounding = 0; - double cur_pos = 0, weight[2] = { 0, 0 }, scale; - double box_align[2]; - Eina_Bool box_fill[2] = { EINA_FALSE, EINA_FALSE }; + Efl_Ui_Container_Item_Hints *hints, *hint; + Eina_Bool axis = !efl_ui_dir_is_horizontal(pd->dir, EINA_FALSE); + Eina_Bool r_axis = !axis; + int want[2] = { 0, 0 }; + int count, i = 0; + double cur_pos, mmin = 0, weight_sum = 0; + Efl_Ui_Container_Layout_Calc box_calc[2]; /* 0 is x-axis, 1 is y-axis */ - evas_object_geometry_get(ui_box, &boxx, &boxy, &boxw, &boxh); - efl_gfx_size_hint_margin_get(ui_box, &boxl, &boxr, &boxt, &boxb); - scale = evas_object_scale_get(ui_box); - // Box align: used if "item has max size and fill" or "no item has a weight" - // Note: cells always expand on the orthogonal direction - box_align[0] = pd->align.h; - box_align[1] = pd->align.v; - if (box_align[0] < 0) - { - box_fill[0] = EINA_TRUE; - box_align[0] = 0.5; - } - if (box_align[1] < 0) - { - box_fill[1] = EINA_TRUE; - box_align[1] = 0.5; - } - - count = eina_list_count(bd->children); + count = eina_list_count(pd->children); if (!count) { - evas_object_size_hint_min_set(ui_box, 0, 0); + efl_gfx_hint_size_restricted_min_set(ui_box, EINA_SIZE2D(0, 0)); return; } + _efl_ui_container_layout_init(ui_box, box_calc); + items = alloca(count * sizeof(*items)); #ifdef DEBUG memset(items, 0, count * sizeof(*items)); #endif // scan all items, get their properties, calculate total weight & min size - EINA_LIST_FOREACH(bd->children, li, opt) + EINA_LIST_FOREACH(pd->children, li, child) { - item = &items[id]; - o = item->obj = opt->obj; + item = &items[i++]; + item->obj = child; + hints = item->hints; - efl_gfx_size_hint_weight_get(o, &item->weight[0], &item->weight[1]); - efl_gfx_size_hint_align_get(o, &item->align[0], &item->align[1]); - efl_gfx_size_hint_margin_get(o, &item->pad[0], &item->pad[1], &item->pad[2], &item->pad[3]); - efl_gfx_size_hint_fill_get(o, &item->fill[0], &item->fill[1]); - item->max = efl_gfx_size_hint_max_get(o); - item->want = efl_gfx_size_hint_combined_min_get(o); - efl_gfx_size_hint_aspect_get(o, &item->aspect_type, &item->aspect); + _efl_ui_container_layout_item_init(item->obj, hints); - if (item->weight[0] < 0) item->weight[0] = 0; - if (item->weight[1] < 0) item->weight[1] = 0; + if (pd->homogeneous || box_calc[0].fill) + hints[0].weight = 1; + else if (hints[0].weight < 0) + hints[0].weight = 0; - if (EINA_DBL_EQ(item->align[0], -1)) + if (pd->homogeneous || box_calc[1].fill) + hints[1].weight = 1; + else if (hints[1].weight < 0) + hints[1].weight = 0; + + weight_sum += hints[axis].weight; + + if (hints[r_axis].space > want[r_axis]) + want[r_axis] = hints[r_axis].space; + + if (pd->homogeneous) { - item->align[0] = 0.5; - item->fill[0] = EINA_TRUE; - } - else if (item->align[0] < 0) - { - item->align[0] = 0; - } - if (EINA_DBL_EQ(item->align[1], -1)) - { - item->align[1] = 0.5; - item->fill[1] = EINA_TRUE; - } - else if (item->align[1] < 0) - { - item->align[1] = 0; - } - if (item->align[0] > 1) item->align[0] = 1; - if (item->align[1] > 1) item->align[1] = 1; - - if (item->want.w < 0) item->want.w = 0; - if (item->want.h < 0) item->want.h = 0; - - if (item->max.w < 0) item->max.w = INT_MAX; - if (item->max.h < 0) item->max.h = INT_MAX; - - if (item->aspect.w <= 0 || item->aspect.h <= 0) - { - if (item->aspect_type >= EFL_GFX_SIZE_HINT_ASPECT_HORIZONTAL) - ERR("Invalid aspect parameter for obj: %p", item->obj); - item->aspect.w = item->aspect.h = 0; - item->aspect_type = EFL_GFX_SIZE_HINT_ASPECT_NONE; - } - - if (item->aspect_type >= EFL_GFX_SIZE_HINT_ASPECT_HORIZONTAL) - { - double w, h; - - w = item->want.w; - h = w * item->aspect.h / item->aspect.w; - if (h < item->want.h) - { - h = item->want.h; - w = h * item->aspect.w / item->aspect.h; - } - - if (horiz) - { - if (item->fill[1] && (h < boxh)) - { - double w1, h1; - h1 = item->max.h > 0 ? MIN(boxh, item->max.h) : boxh; - h1 = MAX(h, h1); - w1 = h1 * item->aspect.w / item->aspect.h; - w = item->max.w > 0 ? MIN(w1, item->max.w) : w1; - } - } - else - { - if (item->fill[0] && (w < boxw)) - { - double w1, h1; - w1 = item->max.w > 0 ? MIN(boxw, item->max.w) : boxw; - w1 = MAX(w, w1); - h1 = w1 * item->aspect.h / item->aspect.w; - h = item->max.h > 0 ? MIN(h1, item->max.h) : h1; - } - } - item->want.w = w; - item->want.h = h; - } - if (item->max.w < item->want.w) item->max.w = item->want.w; - if (item->max.h < item->want.h) item->max.h = item->want.h; - - item->want.w += item->pad[0] + item->pad[1]; - item->want.h += item->pad[2] + item->pad[3]; - - weight[0] += item->weight[0]; - weight[1] += item->weight[1]; - if (horiz) - { - wantw += item->want.w; - if (item->want.h > wanth) - wanth = item->want.h; + if (hints[axis].space > mmin) + mmin = hints[axis].space; } else { - wanth += item->want.h; - if (item->want.w > wantw) - wantw = item->want.w; + want[axis] += hints[axis].space; } - - item->id = id++; } - // box outer margin - boxw -= boxl + boxr; - boxh -= boxt + boxb; - boxx += boxl; - boxy += boxt; - // total space & available space - if (horiz) - { - length = boxw; - want = wantw; - pad = pd->pad.scalable ? (pd->pad.h * scale) : pd->pad.h; - } - else - { - length = boxh; - want = wanth; - pad = pd->pad.scalable ? (pd->pad.v * scale) : pd->pad.v; - } + if (pd->homogeneous) + want[axis] = mmin * count; + + if (box_calc[r_axis].size < want[r_axis]) + box_calc[r_axis].size = want[r_axis]; // padding can not be squeezed (note: could make it an option) - length -= pad * (count - 1); + box_calc[axis].size -= (box_calc[axis].pad * (count - 1)); + box_calc[r_axis].pad = 0; + cur_pos = box_calc[axis].pos; - // available space. if <0 we overflow - extra = length - want; + // calculate weight size + if (!pd->homogeneous && (box_calc[axis].size > want[axis]) && (weight_sum > 0)) + { + int orig_size, calc_size; + double orig_weight = weight_sum; - if (horiz) - { - evas_object_size_hint_min_set(ui_box, - wantw + boxl + boxr + pad * (count - 1), - wanth + boxt + boxb); - } - else - { - evas_object_size_hint_min_set(ui_box, - wantw + boxl + boxr, - wanth + pad * (count - 1) + boxt + boxb); + calc_size = orig_size = box_calc[axis].size; + + for (i = 0; i < count; i++) + { + double denom; + hint = &items[i].hints[axis]; + + denom = (hint->weight * orig_size) - (orig_weight * hint->space); + if (denom > 0) + { + items[i].weight_factor = (hint->weight * orig_size) / denom; + inlist = eina_inlist_sorted_insert(inlist, EINA_INLIST_GET(&items[i]), + _weight_sort_cb); + + } + else + { + calc_size -= hint->space; + weight_sum -= hint->weight; + } + } + + EINA_INLIST_FOREACH(inlist, item) + { + double weight_len; + hint = &item->hints[axis]; + + weight_len = (calc_size * hint->weight) / weight_sum; + if (hint->space < weight_len) + { + hint->space = weight_len; + } + else + { + weight_sum -= hint->weight; + calc_size -= hint->space; + } + } } - if (extra < 0) extra = 0; - - if (EINA_DBL_EQ(weight[!horiz], 0)) + // calculate item geometry { - if (box_fill[!horiz]) + int item_size[2], item_pos[2], sw, sh; + + if (box_calc[axis].size > want[axis]) { - // box is filled, set all weights to be equal - zeroweight = EINA_TRUE; + if (pd->homogeneous) + mmin = (double)box_calc[axis].size / count; + else if (EINA_DBL_EQ(weight_sum, 0)) + cur_pos += (box_calc[axis].size - want[axis]) * box_calc[axis].align; } - else + + for (i = 0; i < count; i++) { - // move bounding box according to box align - cur_pos = extra * box_align[!horiz]; + hints = items[i].hints; + + if (pd->homogeneous) + hints[axis].space = mmin; + hints[r_axis].space = box_calc[r_axis].size; + sw = hints[0].space - (hints[0].margin[0] + hints[0].margin[1]); + sh = hints[1].space - (hints[1].margin[0] + hints[1].margin[1]); + + item_size[0] = ((hints[0].weight > 0) && hints[0].fill) ? sw : 0; + item_size[1] = ((hints[1].weight > 0) && hints[1].fill) ? sh : 0; + + _efl_ui_container_layout_min_max_calc(hints, &item_size[0], &item_size[1], + (hints[0].aspect > 0) && (hints[1].aspect > 0)); + + item_pos[axis] = cur_pos + 0.5; + item_pos[r_axis] = box_calc[r_axis].pos; + + item_pos[0] += (hints[0].margin[0] + + ((sw - item_size[0]) * hints[0].align)); + item_pos[1] += (hints[1].margin[0] + + ((sh - item_size[1]) * hints[1].align)); + + cur_pos += hints[axis].space + box_calc[axis].pad; + + efl_gfx_entity_geometry_set(items[i].obj, + EINA_RECT(item_pos[0], item_pos[1], + item_size[0], item_size[1])); } - weight[!horiz] = count; } + want[0] += (box_calc[0].margin[0] + box_calc[0].margin[1]) + + (box_calc[0].pad * (count - 1)); + want[1] += (box_calc[1].margin[0] + box_calc[1].margin[1]) + + (box_calc[1].pad * (count - 1)); - for (id = 0; id < count; id++) - { - double cx, cy, cw, ch, x, y, w, h; - item = &items[id]; + efl_gfx_hint_size_restricted_min_set(ui_box, EINA_SIZE2D(want[0], want[1])); - // extra rounding up (compensate cumulative error) - if ((item->id == (count - 1)) && (cur_pos - floor(cur_pos) >= 0.5)) - rounding = 1; - - if (horiz) - { - cx = boxx + cur_pos; - cy = boxy; - cw = item->want.w + rounding + (zeroweight ? 1.0 : item->weight[0]) * extra / weight[0]; - ch = boxh; - cur_pos += cw + pad; - } - else - { - cx = boxx; - cy = boxy + cur_pos; - cw = boxw; - ch = item->want.h + rounding + (zeroweight ? 1.0 : item->weight[1]) * extra / weight[1]; - cur_pos += ch + pad; - } - - if (item->aspect_type >= EFL_GFX_SIZE_HINT_ASPECT_HORIZONTAL) - { - if (horiz) - { - w = item->want.w; - h = item->want.h; - if (weight[0] > 0) - w = item->want.w + extra * item->weight[0] / weight[0]; - h = w * item->aspect.h / item->aspect.w; - - if (item->aspect_type == EFL_GFX_SIZE_HINT_ASPECT_BOTH || - item->aspect_type == EFL_GFX_SIZE_HINT_ASPECT_VERTICAL) - { - if (h > boxh) - { - h = boxh; - w = h * item->aspect.w / item->aspect.h; - } - } - } - else - { - w = item->want.w; - h = item->want.h; - if (weight[1] > 0) - h = item->want.h + extra * item->weight[1] / weight[1]; - w = h * item->aspect.w / item->aspect.h; - - if (item->aspect_type == EFL_GFX_SIZE_HINT_ASPECT_BOTH || - item->aspect_type == EFL_GFX_SIZE_HINT_ASPECT_HORIZONTAL) - { - if (w > boxw) - { - w = boxw; - h = w * item->aspect.h / item->aspect.w; - } - } - } - - if ((item->max.w != INT_MAX) && (item->max.h != INT_MAX)) - { - double mar, ar; - mar = item->max.w / (double)item->max.h; - ar = item->aspect.w / (double)item->aspect.h; - if (ar < mar) - { - if (h > item->max.h) - { - h = item->max.h; - w = h * item->aspect.w / item->aspect.h; - } - } - else - { - if (w > item->max.w) - { - w = item->max.w; - h = w * item->aspect.h / item->aspect.w; - } - } - } - else if (item->max.w != INT_MAX) - { - w = MIN(w, MAX(item->want.w, item->max.w)); - h = w * item->aspect.h / item->aspect.w; - } - else - { - h = MIN(h, MAX(item->want.h, item->max.h)); - w = h * item->aspect.w / item->aspect.h; - } - w = w - item->pad[0] - item->pad[1]; - h = h - item->pad[2] - item->pad[3]; - - if (item->fill[0]) - x = cx + (cw - w) * 0.5 + item->pad[0]; - else - x = cx + (cw - w) * item->align[0] + item->pad[0]; - - if (item->fill[1]) - y = cy + (ch - h) * 0.5 + item->pad[2]; - else - y = cy + (ch - h) * item->align[1] + item->pad[2]; - } - else - { - // horizontally - if (item->max.w < INT_MAX) - { - w = MIN(MAX(item->want.w - item->pad[0] - item->pad[1], item->max.w), cw); - x = cx + ((cw - w) * item->align[0]) + item->pad[0]; - } - else if (item->fill[0]) - { - // fill x - w = cw - item->pad[0] - item->pad[1]; - x = cx + item->pad[0]; - } - else - { - if (horiz && item->weight[0] > 0) - w = cw - item->pad[0] - item->pad[1]; - else - w = item->want.w - item->pad[0] - item->pad[1]; - x = cx + ((cw - w) * item->align[0]) + item->pad[0]; - } - - // vertically - if (item->max.h < INT_MAX) - { - h = MIN(MAX(item->want.h - item->pad[2] - item->pad[3], item->max.h), ch); - y = cy + ((ch - h) * item->align[1]) + item->pad[2]; - } - else if (item->fill[1]) - { - // fill y - h = ch - item->pad[2] - item->pad[3]; - y = cy + item->pad[2]; - } - else - { - if (!horiz && item->weight[1] > 0) - h = ch - item->pad[2] - item->pad[3]; - else - h = item->want.h - item->pad[2] - item->pad[3]; - y = cy + ((ch - h) * item->align[1]) + item->pad[2]; - } - } - - //DBG("[%2d/%2d] cell: %.0f,%.0f %.0fx%.0f item: %.0f,%.0f %.0fx%.0f", - // id, count, cx, cy, cw, ch, x, y, w, h); - evas_object_geometry_set(item->obj, x, y, w, h); - } + efl_event_callback_call(ui_box, EFL_PACK_EVENT_LAYOUT_UPDATED, NULL); } diff --git a/src/lib/elementary/efl_ui_box_private.h b/src/lib/elementary/efl_ui_box_private.h index 2bd12c9fe8..5921eaf783 100644 --- a/src/lib/elementary/efl_ui_box_private.h +++ b/src/lib/elementary/efl_ui_box_private.h @@ -10,21 +10,13 @@ #include #include "elm_priv.h" -// FIXME: stop using Evas.Box -#include <../evas/canvas/evas_box.eo.h> - -// FIXME: stop using evas box -void _efl_ui_box_custom_layout(Efl_Ui_Box *box, Evas_Object_Box_Data *priv); - typedef struct _Efl_Ui_Box_Data Efl_Ui_Box_Data; -typedef struct _Box_Item_Iterator Box_Item_Iterator; struct _Efl_Ui_Box_Data { Efl_Ui_Dir dir; - Eina_Bool homogeneous : 1; - Eina_Bool delete_me : 1; - Eina_Bool recalc : 1; + Eo *clipper; + Eina_List *children; struct { double h, v; @@ -34,14 +26,8 @@ struct _Efl_Ui_Box_Data struct { double h, v; } align; -}; -struct _Box_Item_Iterator -{ - Eina_Iterator iterator; - Eina_List *list; - Eina_Iterator *real_iterator; - Efl_Ui_Box *object; + Eina_Bool homogeneous : 1; }; #endif diff --git a/src/lib/elementary/efl_ui_box_stack.c b/src/lib/elementary/efl_ui_box_stack.c index 38bc96cf55..212368b4c0 100644 --- a/src/lib/elementary/efl_ui_box_stack.c +++ b/src/lib/elementary/efl_ui_box_stack.c @@ -1,35 +1,98 @@ -#define EFL_GFX_SIZE_HINT_PROTECTED +#define EFL_GFX_HINT_PROTECTED #include "efl_ui_box_private.h" +#include "efl_ui_container_layout.h" #define MY_CLASS EFL_UI_BOX_STACK_CLASS +typedef struct _Item_Calc Item_Calc; + +struct _Item_Calc +{ + Evas_Object *obj; + Efl_Ui_Container_Item_Hints hints[2]; /* 0 is x-axis, 1 is y-axis */ +}; + EOLIAN static void _efl_ui_box_stack_efl_pack_layout_layout_update(Eo *obj, void *_pd EINA_UNUSED) { - Evas_Object_Box_Option *opt; - Evas_Object_Box_Data *bd; - Eina_Size2D min = { 0, 0 }, cmin; + Efl_Ui_Box_Data *bd = efl_data_scope_get(obj, EFL_UI_BOX_CLASS); + Eo *child; + Efl_Ui_Container_Layout_Calc box_calc[2]; + Efl_Ui_Container_Item_Hints *hints; + Item_Calc *items, *item; Eina_List *l; + Eina_Size2D want = { 0, 0 }; + Evas_Object *old_child = NULL; + int i = 0, count; - EINA_SAFETY_ON_FALSE_RETURN(efl_isa(obj, EFL_UI_BOX_CLASS)); - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - bd = efl_data_scope_get(wd->resize_obj, EVAS_BOX_CLASS); - - evas_object_box_layout_stack(wd->resize_obj, bd, NULL); - - /* Note: legacy evas_object_box_layout_stack sets the box min size to be - * the MAX() of the children's sizes, rather than their min sizes. By fixing - * that, we can implement elm_win_resize_object_add() with a Efl.Ui.Box. */ - EINA_LIST_FOREACH(bd->children, l, opt) + count = eina_list_count(bd->children); + if (!count) { - Evas_Object *child = opt->obj; - - cmin = efl_gfx_size_hint_combined_min_get(child); - if (cmin.w > min.w) min.w = cmin.w; - if (cmin.h > min.h) min.h = cmin.h; + efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(0, 0)); + return; } - efl_gfx_size_hint_restricted_min_set(obj, min); + + _efl_ui_container_layout_init(obj, box_calc); + + items = alloca(count * sizeof(*items)); +#ifdef DEBUG + memset(items, 0, count * sizeof(*items)); +#endif + + EINA_LIST_FOREACH(bd->children, l, child) + { + item = &items[i++]; + item->obj = child; + hints = item->hints; + + _efl_ui_container_layout_item_init(child, hints); + + if (want.w < hints[0].space) + want.w = hints[0].space; + if (want.h < hints[1].space) + want.h = hints[1].space; + } + + if (box_calc[0].size < want.w) + box_calc[0].size = want.w; + if (box_calc[1].size < want.h) + box_calc[1].size = want.h; + + for (i = 0; i < count; i++) + { + hints = items[i].hints; + Eina_Rect item_geom; + + hints[0].space = box_calc[0].size - + (hints[0].margin[0] + hints[0].margin[1]); + hints[1].space = box_calc[1].size - + (hints[1].margin[0] + hints[1].margin[1]); + + item_geom.w = ((hints[0].weight > 0) && hints[0].fill) ? hints[0].space : 0; + item_geom.h = ((hints[1].weight > 0) && hints[1].fill) ? hints[1].space : 0; + + _efl_ui_container_layout_min_max_calc(hints, &item_geom.w, &item_geom.h, + (hints[0].aspect > 0) && (hints[1].aspect > 0)); + + item_geom.x = box_calc[0].pos + hints[0].margin[0] + + (hints[0].space - item_geom.w) * hints[0].align; + item_geom.y = box_calc[1].pos + hints[1].margin[0] + + (hints[1].space - item_geom.h) * hints[1].align; + + efl_gfx_entity_geometry_set(items[i].obj, item_geom); + + if (old_child) + efl_gfx_stack_above(items[i].obj, old_child); + old_child = items[i].obj; + } + + want.w += (box_calc[0].margin[0] + box_calc[0].margin[1]); + want.h += (box_calc[1].margin[0] + box_calc[1].margin[1]); + + efl_gfx_hint_size_restricted_min_set(obj, want); + + efl_event_callback_call(obj, EFL_PACK_EVENT_LAYOUT_UPDATED, NULL); } #include "efl_ui_box_stack.eo.c" diff --git a/src/lib/elementary/efl_ui_box_stack.eo b/src/lib/elementary/efl_ui_box_stack.eo index 7d2ebfbbee..61035b45f9 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 extends Efl.Ui.Box +class @beta Efl.Ui.Box_Stack extends Efl.Ui.Box { [[A custom layout engine for @Efl.Ui.Box that stacks items. diff --git a/src/lib/elementary/efl_ui_button.c b/src/lib/elementary/efl_ui_button.c index 1be677dca3..a3c1c4dbfc 100644 --- a/src/lib/elementary/efl_ui_button.c +++ b/src/lib/elementary/efl_ui_button.c @@ -218,7 +218,6 @@ _efl_ui_button_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Button_Data *_pd EINA_ if (!elm_widget_theme_klass_get(obj)) elm_widget_theme_klass_set(obj, "button"); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); if (elm_widget_is_legacy(obj)) { @@ -255,10 +254,10 @@ _efl_ui_button_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Button_Data *_pd EINA_ elm_widget_can_focus_set(obj, EINA_TRUE); - if (!elm_widget_theme_object_set(obj, wd->resize_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))) + elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); } @@ -410,7 +409,7 @@ ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX) #include "efl_ui_button.eo.c" -#include "efl_ui_button_legacy.eo.h" +#include "efl_ui_button_legacy_eo.h" #include "efl_ui_button_legacy_part.eo.h" EOLIAN static Eo * @@ -442,13 +441,13 @@ _icon_signal_emit(Evas_Object *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_Result +EOLIAN static Eina_Error _efl_ui_button_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _icon_signal_emit(obj); return int_ret; @@ -507,4 +506,4 @@ elm_button_add(Evas_Object *parent) return elm_legacy_add(EFL_UI_BUTTON_LEGACY_CLASS, parent); } -#include "efl_ui_button_legacy.eo.c" +#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 adb22ba3dc..b126588179 100644 --- a/src/lib/elementary/efl_ui_button.eo +++ b/src/lib/elementary/efl_ui_button.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Button extends Efl.Ui.Layout implements Efl.Ui.Clickable, Efl.Ui.Autorepeat, +class @beta Efl.Ui.Button extends Efl.Ui.Layout_Base implements Efl.Ui.Clickable, Efl.Ui.Autorepeat, Efl.Text, Efl.Content, Efl.Access.Widget.Action { @@ -7,7 +7,6 @@ class Efl.Ui.Button extends Efl.Ui.Layout implements Efl.Ui.Clickable, Efl.Ui.Au Press it and run some function. It can contain a simple label and icon object and it also has an autorepeat feature. ]] - legacy_prefix: elm_button; implements { class.constructor; Efl.Object.constructor; @@ -16,7 +15,7 @@ class Efl.Ui.Button extends Efl.Ui.Layout implements Efl.Ui.Clickable, Efl.Ui.Au Efl.Ui.Autorepeat.autorepeat_enabled { set; get; } Efl.Ui.Autorepeat.autorepeat_supported { get;} Efl.Ui.Widget.on_access_activate; - Efl.Ui.Widget.widget_event; + Efl.Ui.Widget.widget_input_event_handler; Efl.Access.Widget.Action.elm_actions { get; } Efl.Content.content { get; set; } Efl.Content.content_unset; diff --git a/src/lib/elementary/efl_ui_button_eo.legacy.h b/src/lib/elementary/efl_ui_button_eo.legacy.h new file mode 100644 index 0000000000..7bfbbe8a15 --- /dev/null +++ b/src/lib/elementary/efl_ui_button_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_BUTTON_EO_LEGACY_H_ +#define _EFL_UI_BUTTON_EO_LEGACY_H_ + +#ifndef _EFL_UI_BUTTON_EO_CLASS_TYPE +#define _EFL_UI_BUTTON_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Button; + +#endif + +#ifndef _EFL_UI_BUTTON_EO_TYPES +#define _EFL_UI_BUTTON_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/efl_ui_button_legacy.eo b/src/lib/elementary/efl_ui_button_legacy.eo deleted file mode 100644 index acb2c8d7ac..0000000000 --- a/src/lib/elementary/efl_ui_button_legacy.eo +++ /dev/null @@ -1,15 +0,0 @@ -class Efl.Ui.Button_Legacy extends Efl.Ui.Button implements 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_legacy_eo.c b/src/lib/elementary/efl_ui_button_legacy_eo.c new file mode 100644 index 0000000000..0fcd13af64 --- /dev/null +++ b/src/lib/elementary/efl_ui_button_legacy_eo.c @@ -0,0 +1,47 @@ + +Efl_Object *_efl_ui_button_legacy_efl_object_constructor(Eo *obj, void *pd); + + +Eina_Error _efl_ui_button_legacy_efl_ui_widget_theme_apply(Eo *obj, void *pd); + + +Eina_Bool _efl_ui_button_legacy_efl_ui_widget_widget_sub_object_del(Eo *obj, void *pd, Efl_Canvas_Object *sub_obj); + + +Efl_Object *_efl_ui_button_legacy_efl_part_part_get(const Eo *obj, void *pd, const char *name); + + +static Eina_Bool +_efl_ui_button_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_BUTTON_LEGACY_EXTRA_OPS +#define EFL_UI_BUTTON_LEGACY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _efl_ui_button_legacy_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _efl_ui_button_legacy_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _efl_ui_button_legacy_efl_ui_widget_widget_sub_object_del), + EFL_OBJECT_OP_FUNC(efl_part_get, _efl_ui_button_legacy_efl_part_part_get), + EFL_UI_BUTTON_LEGACY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_button_legacy_class_desc = { + EO_VERSION, + "Efl.Ui.Button_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _efl_ui_button_legacy_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_button_legacy_class_get, &_efl_ui_button_legacy_class_desc, EFL_UI_BUTTON_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/efl_ui_button_legacy_eo.h b/src/lib/elementary/efl_ui_button_legacy_eo.h new file mode 100644 index 0000000000..31630d64ef --- /dev/null +++ b/src/lib/elementary/efl_ui_button_legacy_eo.h @@ -0,0 +1,30 @@ +#ifndef _EFL_UI_BUTTON_LEGACY_EO_H_ +#define _EFL_UI_BUTTON_LEGACY_EO_H_ + +#ifndef _EFL_UI_BUTTON_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_BUTTON_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Button_Legacy; + +#endif + +#ifndef _EFL_UI_BUTTON_LEGACY_EO_TYPES +#define _EFL_UI_BUTTON_LEGACY_EO_TYPES + + +#endif +#ifdef EFL_BETA_API_SUPPORT +/** + * @brief 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. + * + * @ingroup Efl_Ui_Button_Legacy + */ +#define EFL_UI_BUTTON_LEGACY_CLASS efl_ui_button_legacy_class_get() + +EWAPI const Efl_Class *efl_ui_button_legacy_class_get(void); +#endif /* EFL_BETA_API_SUPPORT */ + +#endif diff --git a/src/lib/elementary/efl_ui_button_legacy_eo.legacy.h b/src/lib/elementary/efl_ui_button_legacy_eo.legacy.h new file mode 100644 index 0000000000..2fa216cb99 --- /dev/null +++ b/src/lib/elementary/efl_ui_button_legacy_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_BUTTON_LEGACY_EO_LEGACY_H_ +#define _EFL_UI_BUTTON_LEGACY_EO_LEGACY_H_ + +#ifndef _EFL_UI_BUTTON_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_BUTTON_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Button_Legacy; + +#endif + +#ifndef _EFL_UI_BUTTON_LEGACY_EO_TYPES +#define _EFL_UI_BUTTON_LEGACY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/efl_ui_button_legacy_part.eo b/src/lib/elementary/efl_ui_button_legacy_part.eo index baa055146e..0d7c7c9967 100644 --- a/src/lib/elementary/efl_ui_button_legacy_part.eo +++ b/src/lib/elementary/efl_ui_button_legacy_part.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Button_Legacy_Part extends Efl.Ui.Layout_Part_Content +class @beta Efl.Ui.Button_Legacy_Part extends Efl.Ui.Layout_Part_Content { [[Elementary button internal part class]] data: null; diff --git a/src/lib/elementary/efl_ui_caching_factory.c b/src/lib/elementary/efl_ui_caching_factory.c index b25d6ba829..bea7a3360c 100644 --- a/src/lib/elementary/efl_ui_caching_factory.c +++ b/src/lib/elementary/efl_ui_caching_factory.c @@ -6,18 +6,33 @@ #include "elm_priv.h" typedef struct _Efl_Ui_Caching_Factory_Data Efl_Ui_Caching_Factory_Data; +typedef struct _Efl_Ui_Caching_Factory_Request Efl_Ui_Caching_Factory_Request; + struct _Efl_Ui_Caching_Factory_Data { const Efl_Class *klass; + Eina_Stringshare *style; + // Simple list of ready-to-use objects. They are all equal so it does not matter from which // end of the list objects are added and removed. Eina_List *cache; + Eina_Hash *lookup; struct { unsigned int memory; unsigned int items; } limit, current; + + Eina_Bool invalidated : 1; +}; + +struct _Efl_Ui_Caching_Factory_Request +{ + Efl_Ui_Caching_Factory_Data *pd; + + Eo *parent; + Efl_Model *model; }; // Clear the cache until it meet the constraint @@ -33,7 +48,15 @@ _efl_ui_caching_factory_remove(Efl_Ui_Caching_Factory_Data *pd, Eina_List *l, Ef } static void -_efl_ui_caching_factory_flush(Efl_Ui_Caching_Factory_Data *pd) +_efl_ui_caching_factory_item_del(Eo *obj, Efl_Ui_Caching_Factory_Data *pd, + Efl_Gfx_Entity *entity) +{ + if (pd->klass) efl_del(entity); + else efl_ui_factory_release(efl_super(obj, EFL_UI_CACHING_FACTORY_CLASS), entity); +} + +static void +_efl_ui_caching_factory_flush(Eo *obj, Efl_Ui_Caching_Factory_Data *pd) { while (pd->limit.items != 0 && pd->current.items > pd->limit.items) @@ -43,8 +66,8 @@ _efl_ui_caching_factory_flush(Efl_Ui_Caching_Factory_Data *pd) entity = eina_list_data_get(eina_list_last(pd->cache)); _efl_ui_caching_factory_remove(pd, eina_list_last(pd->cache), entity); - - efl_del(entity); + if (pd->lookup) eina_hash_del(pd->lookup, efl_ui_widget_style_get(entity), entity); + _efl_ui_caching_factory_item_del(obj, pd, entity); } while (pd->limit.memory != 0 && @@ -55,69 +78,138 @@ _efl_ui_caching_factory_flush(Efl_Ui_Caching_Factory_Data *pd) entity = eina_list_data_get(eina_list_last(pd->cache)); _efl_ui_caching_factory_remove(pd, eina_list_last(pd->cache), entity); - - efl_del(entity); + if (pd->lookup) eina_hash_del(pd->lookup, efl_ui_widget_style_get(entity), entity); + _efl_ui_caching_factory_item_del(obj, pd, entity); } } +static Eina_Value +_efl_ui_caching_factory_create_then(Eo *obj EINA_UNUSED, void *data, const Eina_Value v) +{ + Efl_Ui_Caching_Factory_Request *r = data; + Efl_Ui_Widget *w; + const char *string = NULL; + + if (!eina_value_string_get(&v, &string)) + return eina_value_error_init(EFL_MODEL_ERROR_NOT_SUPPORTED); + + w = eina_hash_find(r->pd->lookup, string); + if (!w) + { + Eina_Future *f; + + // No object of that style in the cache, need to create a new one + f = efl_ui_factory_create(efl_super(obj, EFL_UI_CACHING_FACTORY_CLASS), + r->model, r->parent); + return eina_future_as_value(f); + } + + eina_hash_del(r->pd->lookup, string, w); + _efl_ui_caching_factory_remove(r->pd, r->pd->cache, w); + + efl_parent_set(w, r->parent); + efl_ui_view_model_set(w, r->model); + + return eina_value_object_init(w); +} + +static void +_efl_ui_caching_factory_create_cleanup(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED) +{ + Efl_Ui_Caching_Factory_Request *r = data; + + efl_unref(r->model); + efl_unref(r->parent); + free(r); +} + static Eina_Future * _efl_ui_caching_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Caching_Factory_Data *pd, Efl_Model *model, Efl_Gfx_Entity *parent) { - Efl_Gfx_Entity *r; + Efl_Gfx_Entity *w = NULL; if (pd->cache) { - r = eina_list_data_get(pd->cache); + if (pd->style && !pd->klass) + { + Efl_Ui_Caching_Factory_Request *r; - _efl_ui_caching_factory_remove(pd, pd->cache, r); + r = calloc(1, sizeof (Efl_Ui_Caching_Factory_Request)); + if (!r) return efl_loop_future_rejected(obj, ENOMEM); - efl_parent_set(r, parent); + r->pd = pd; + r->parent = efl_ref(parent); + r->model = efl_ref(model); + + return efl_future_then(obj, efl_model_property_ready_get(obj, pd->style), + .success = _efl_ui_caching_factory_create_then, + .data = r, + .free = _efl_ui_caching_factory_create_cleanup); + } + + w = eina_list_data_get(pd->cache); + + _efl_ui_caching_factory_remove(pd, pd->cache, w); + + efl_parent_set(w, parent); } - else + + if (!w) { - r = efl_add(pd->klass, parent); + if (pd->klass) w = efl_add(pd->klass, parent); + else return efl_ui_factory_create(efl_super(obj, EFL_UI_CACHING_FACTORY_CLASS), + model, parent); } - efl_ui_view_model_set(r, model); + efl_ui_view_model_set(w, model); - return efl_loop_future_resolved(obj, eina_value_object_init(r)); + return efl_loop_future_resolved(obj, eina_value_object_init(w)); } static void -_efl_ui_caching_factory_item_class_set(Eo *obj, - Efl_Ui_Caching_Factory_Data *pd, - const Efl_Object *klass) +_efl_ui_caching_factory_efl_ui_widget_factory_item_class_set(Eo *obj, + Efl_Ui_Caching_Factory_Data *pd, + const Efl_Object *klass) { - if (!efl_isa(klass, EFL_GFX_ENTITY_INTERFACE) || - !efl_isa(klass, EFL_UI_VIEW_INTERFACE)) + if (efl_isa(klass, EFL_UI_VIEW_INTERFACE) && + !efl_isa(klass, EFL_UI_WIDGET_CLASS)) { - ERR("Provided class '%s' for factory '%s' doesn't implement '%s' and '%s' interfaces.", - efl_class_name_get(klass), - efl_class_name_get(obj), - efl_class_name_get(EFL_GFX_ENTITY_INTERFACE), - efl_class_name_get(EFL_UI_VIEW_INTERFACE)); - return ; + if (!efl_isa(klass, EFL_GFX_ENTITY_INTERFACE) || + !efl_isa(klass, EFL_UI_VIEW_INTERFACE)) + { + ERR("Provided class '%s' for factory '%s' doesn't implement '%s' and '%s' interfaces nor '%s' and '%s' interfaces.", + efl_class_name_get(klass), + efl_class_name_get(obj), + efl_class_name_get(EFL_GFX_ENTITY_INTERFACE), + efl_class_name_get(EFL_UI_VIEW_INTERFACE), + efl_class_name_get(EFL_UI_WIDGET_CLASS), + efl_class_name_get(EFL_UI_VIEW_INTERFACE)); + return ; + } + pd->klass = klass; + return; } - pd->klass = klass; + efl_ui_widget_factory_item_class_set(efl_super(obj, EFL_UI_CACHING_FACTORY_CLASS), klass); } static const Efl_Object * -_efl_ui_caching_factory_item_class_get(const Eo *obj EINA_UNUSED, - Efl_Ui_Caching_Factory_Data *pd) +_efl_ui_caching_factory_efl_ui_widget_factory_item_class_get(const Eo *obj, + Efl_Ui_Caching_Factory_Data *pd) { - return pd->klass; + if (pd->klass) return pd->klass; + return efl_ui_widget_factory_item_class_get(efl_super(obj, EFL_UI_CACHING_FACTORY_CLASS)); } static void -_efl_ui_caching_factory_memory_limit_set(Eo *obj EINA_UNUSED, +_efl_ui_caching_factory_memory_limit_set(Eo *obj, Efl_Ui_Caching_Factory_Data *pd, unsigned int limit) { pd->limit.memory = limit; - _efl_ui_caching_factory_flush(pd); + _efl_ui_caching_factory_flush(obj, pd); } static unsigned int @@ -128,13 +220,13 @@ _efl_ui_caching_factory_memory_limit_get(const Eo *obj EINA_UNUSED, } static void -_efl_ui_caching_factory_items_limit_set(Eo *obj EINA_UNUSED, +_efl_ui_caching_factory_items_limit_set(Eo *obj, Efl_Ui_Caching_Factory_Data *pd, unsigned int limit) { pd->limit.items = limit; - _efl_ui_caching_factory_flush(pd); + _efl_ui_caching_factory_flush(obj, pd); } static unsigned int @@ -149,6 +241,13 @@ _efl_ui_caching_factory_efl_ui_factory_release(Eo *obj, Efl_Ui_Caching_Factory_Data *pd, Efl_Gfx_Entity *ui_view) { + // Are we invalidated ? + if (pd->invalidated) + { + _efl_ui_caching_factory_item_del(obj, pd, ui_view); + return; + } + // Change parent, disconnect the object and make it invisible efl_parent_set(ui_view, obj); efl_gfx_entity_visible_set(ui_view, EINA_FALSE); @@ -161,8 +260,15 @@ _efl_ui_caching_factory_efl_ui_factory_release(Eo *obj, if (efl_isa(ui_view, EFL_CACHED_ITEM_INTERFACE)) pd->current.memory += efl_cached_item_memory_size_get(ui_view); + // Fill lookup + if (!pd->klass && efl_ui_widget_style_get(ui_view)) + { + if (!pd->lookup) pd->lookup = eina_hash_string_djb2_new(NULL); + eina_hash_direct_add(pd->lookup, efl_ui_widget_style_get(ui_view), ui_view); + } + // And check if the cache need some triming - _efl_ui_caching_factory_flush(pd); + _efl_ui_caching_factory_flush(obj, pd); } static void @@ -171,6 +277,9 @@ _efl_ui_caching_factory_efl_object_invalidate(Eo *obj EINA_UNUSED, { // As all the objects in the cache have the factory as parent, there's no need to unparent them pd->cache = eina_list_free(pd->cache); + eina_hash_free(pd->lookup); + pd->lookup = NULL; + pd->invalidated = EINA_TRUE; } static Efl_App * @@ -215,4 +324,14 @@ _efl_ui_caching_factory_efl_object_parent_set(Eo *obj, Efl_Ui_Caching_Factory_Da if (a) efl_event_callback_add(a, EFL_APP_EVENT_PAUSE, _efl_ui_caching_factory_pause, pd); } +static Eina_Error +_efl_ui_caching_factory_efl_ui_property_bind_property_bind(Eo *obj, Efl_Ui_Caching_Factory_Data *pd, + const char *key, const char *property) +{ + if (!strcmp(key, "style")) + eina_stringshare_replace(&pd->style, property); + + return efl_ui_property_bind(efl_super(obj, EFL_UI_CACHING_FACTORY_CLASS), key, property); +} + #include "efl_ui_caching_factory.eo.c" diff --git a/src/lib/elementary/efl_ui_caching_factory.eo b/src/lib/elementary/efl_ui_caching_factory.eo index c7e2f2b743..266ea5803d 100644 --- a/src/lib/elementary/efl_ui_caching_factory.eo +++ b/src/lib/elementary/efl_ui_caching_factory.eo @@ -1,9 +1,11 @@ -class Efl.Ui.Caching_Factory extends Efl.Loop_Consumer implements Efl.Ui.Factory +class @beta Efl.Ui.Caching_Factory extends Efl.Ui.Widget_Factory { [[Efl Ui Factory that provides object caching. - This factory handles caching of one type of object and automatically empties the cache - when the application goes into pause. + This factory handles caching of one type of object that must be an @Efl.Gfx.Entity with an @Efl.Ui.View interface defined. + This factory will rely on its parent class @Efl.Ui.Widget_Factory for creating the subset of class that match @Efl.Ui.Widget + interface. + The factory will automatically empties the cache when the application goes into pause. Creating objects is costly and time consuming, keeping a few on hand for when you next will need them helps a lot. This is what this factory caching infrastructure provides. It will create the object from the class defined on it and @@ -13,14 +15,6 @@ class Efl.Ui.Caching_Factory extends Efl.Loop_Consumer implements Efl.Ui.Factory The cache might decide to flush itself when the application event pause is triggered. ]] methods { - @property item_class { - [[Define the class of the item returned by this factory.]] - get {} - set {} - values { - klass: const(Efl.Class); [[The class identifier to create item from.]] - } - } @property memory_limit { [[Define the maxium size in Bytes that all the object waiting on standby in the cache take. They must provide the @Efl.Cached.Item interface for an accurate accounting.]] get {} @@ -42,6 +36,8 @@ class Efl.Ui.Caching_Factory extends Efl.Loop_Consumer implements Efl.Ui.Factory implements { Efl.Ui.Factory.create; Efl.Ui.Factory.release; + Efl.Ui.Property_Bind.property_bind; + Efl.Ui.Widget_Factory.item_class { get; set; } Efl.Object.invalidate; Efl.Object.parent { set; } } diff --git a/src/lib/elementary/efl_ui_calendar.c b/src/lib/elementary/efl_ui_calendar.c index 3e5d34dd7a..eb3918d7ac 100644 --- a/src/lib/elementary/efl_ui_calendar.c +++ b/src/lib/elementary/efl_ui_calendar.c @@ -510,13 +510,13 @@ _spinner_buttons_add(Evas_Object *obj, Efl_Ui_Calendar_Data *sd) } } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_calendar_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Calendar_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _spinner_buttons_add(obj, sd); @@ -910,8 +910,6 @@ _efl_ui_calendar_constructor_internal(Eo *obj, Efl_Ui_Calendar_Data *priv) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); - elm_widget_sub_object_parent_add(obj); - priv->date_min.tm_year = 2; priv->date_min.tm_mon = 0; priv->date_min.tm_mday = 1; @@ -938,10 +936,10 @@ _efl_ui_calendar_constructor_internal(Eo *obj, Efl_Ui_Calendar_Data *priv) if (!elm_widget_theme_klass_get(obj)) elm_widget_theme_klass_set(obj, "calendar"); - if (!elm_widget_theme_object_set(obj, wd->resize_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))) + elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); evas_object_smart_changed(obj); diff --git a/src/lib/elementary/efl_ui_calendar.eo b/src/lib/elementary/efl_ui_calendar.eo index 78bc2b4a38..888319d382 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 @beta 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 extends Efl.Ui.Layout implements Efl.Ui.Focus.Composition, Efl.Access.Widget.Action, Efl.Ui.Format +class @beta Efl.Ui.Calendar extends Efl.Ui.Layout_Base implements Efl.Ui.Focus.Composition, Efl.Access.Widget.Action, Efl.Ui.Format { [[Calendar widget @@ -109,7 +109,7 @@ class Efl.Ui.Calendar extends Efl.Ui.Layout implements Efl.Ui.Focus.Composition, 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.Widget.widget_input_event_handler; Efl.Access.Widget.Action.elm_actions { get; } Efl.Ui.Format.format_cb { set; } Efl.Ui.Format.format_string { set; get;} diff --git a/src/lib/elementary/efl_ui_calendar.h b/src/lib/elementary/efl_ui_calendar.h index f80dce28d5..c3c8f6ae89 100644 --- a/src/lib/elementary/efl_ui_calendar.h +++ b/src/lib/elementary/efl_ui_calendar.h @@ -48,9 +48,8 @@ * @{ */ -#ifdef EFL_EO_API_SUPPORT #include "efl_ui_calendar.eo.h" -#endif + /** * @} */ diff --git a/src/lib/elementary/efl_ui_calendar_item.eo b/src/lib/elementary/efl_ui_calendar_item.eo index ad235e0332..2dcd80a613 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 extends Efl.Object implements Efl.Ui.Focus.Object +class @beta Efl.Ui.Calendar_Item extends Efl.Object implements 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 1b9a19bcf9..6056e5c572 100644 --- a/src/lib/elementary/efl_ui_check.c +++ b/src/lib/elementary/efl_ui_check.c @@ -100,7 +100,7 @@ _activate(Evas_Object *obj) if (_elm_config->atspi_mode) efl_access_state_changed_signal_emit(obj, - EFL_ACCESS_STATE_CHECKED, + EFL_ACCESS_STATE_TYPE_CHECKED, efl_ui_nstate_value_get(obj)); } @@ -112,7 +112,7 @@ _efl_ui_check_efl_access_object_state_set_get(const Eo *obj, Efl_Ui_Check_Data * 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); + STATE_TYPE_SET(states, EFL_ACCESS_STATE_TYPE_CHECKED); return states; } @@ -135,16 +135,15 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED) return EINA_TRUE; } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_check_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Check_Data *sd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; if (elm_widget_is_legacy(obj)) { @@ -234,7 +233,7 @@ _on_check_off(void *data, if (_elm_config->atspi_mode) efl_access_state_changed_signal_emit(data, - EFL_ACCESS_STATE_CHECKED, + EFL_ACCESS_STATE_TYPE_CHECKED, efl_ui_nstate_value_get(obj)); } @@ -259,7 +258,7 @@ _on_check_on(void *data, if (_elm_config->atspi_mode) efl_access_state_changed_signal_emit(data, - EFL_ACCESS_STATE_CHECKED, + EFL_ACCESS_STATE_TYPE_CHECKED, efl_ui_nstate_value_get(obj)); } @@ -327,20 +326,20 @@ _efl_ui_check_efl_object_constructor(Eo *obj, Efl_Ui_Check_Data *pd EINA_UNUSED) if (elm_widget_is_legacy(obj)) { efl_layout_signal_callback_add - (wd->resize_obj, "elm,action,check,on", "*", _on_check_on, obj); + (wd->resize_obj, "elm,action,check,on", "*", obj, _on_check_on, NULL); efl_layout_signal_callback_add - (wd->resize_obj, "elm,action,check,off", "*", _on_check_off, obj); + (wd->resize_obj, "elm,action,check,off", "*", obj, _on_check_off, NULL); efl_layout_signal_callback_add - (wd->resize_obj, "elm,action,check,toggle", "*", _on_check_toggle, obj); + (wd->resize_obj, "elm,action,check,toggle", "*", obj, _on_check_toggle, NULL); } else { efl_layout_signal_callback_add - (wd->resize_obj, "efl,action,check,on", "*", _on_check_on, obj); + (wd->resize_obj, "efl,action,check,on", "*", obj, _on_check_on, NULL); efl_layout_signal_callback_add - (wd->resize_obj, "efl,action,check,off", "*", _on_check_off, obj); + (wd->resize_obj, "efl,action,check,off", "*", obj, _on_check_off, NULL); efl_layout_signal_callback_add - (wd->resize_obj, "efl,action,check,toggle", "*", _on_check_toggle, obj); + (wd->resize_obj, "efl,action,check,toggle", "*", obj, _on_check_toggle, NULL); } efl_access_object_role_set(obj, EFL_ACCESS_ROLE_CHECK_BOX); @@ -449,8 +448,9 @@ 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_eo.legacy.c" -#include "efl_ui_check_legacy.eo.h" +#include "efl_ui_check_legacy_eo.h" #include "efl_ui_check_legacy_part.eo.h" #define MY_CLASS_NAME_LEGACY "elm_check" @@ -492,13 +492,13 @@ _icon_signal_emit(Evas_Object *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_Result +EOLIAN static Eina_Error _efl_ui_check_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_CHECK_LEGACY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _icon_signal_emit(obj); @@ -558,4 +558,4 @@ elm_check_add(Evas_Object *parent) return elm_legacy_add(EFL_UI_CHECK_LEGACY_CLASS, parent); } -#include "efl_ui_check_legacy.eo.c" +#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 b6ea04f879..5bd3d187e1 100644 --- a/src/lib/elementary/efl_ui_check.eo +++ b/src/lib/elementary/efl_ui_check.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Check extends Efl.Ui.Nstate implements Efl.Access.Widget.Action +class @beta Efl.Ui.Check extends Efl.Ui.Nstate implements Efl.Access.Widget.Action { [[Check widget @@ -7,7 +7,6 @@ class Efl.Ui.Check extends Efl.Ui.Nstate implements Efl.Access.Widget.Action except they do not work as a group, but independently, and only toggle the value of a boolean between false and true. ]] - legacy_prefix: elm_check; methods { @property selected { [[The on/off state of the check object.]] @@ -24,7 +23,7 @@ class Efl.Ui.Check extends Efl.Ui.Nstate implements Efl.Access.Widget.Action Efl.Object.constructor; Efl.Ui.Widget.on_access_activate; Efl.Ui.Widget.theme_apply; - Efl.Ui.Widget.widget_event; + Efl.Ui.Widget.widget_input_event_handler; Efl.Ui.Nstate.value { set; } Efl.Access.Object.state_set { get; } Efl.Access.Widget.Action.elm_actions { get; } diff --git a/src/lib/elementary/efl_ui_check_eo.legacy.c b/src/lib/elementary/efl_ui_check_eo.legacy.c new file mode 100644 index 0000000000..ea58cc9249 --- /dev/null +++ b/src/lib/elementary/efl_ui_check_eo.legacy.c @@ -0,0 +1,12 @@ + +EAPI void +elm_check_selected_set(Efl_Ui_Check *obj, Eina_Bool value) +{ + efl_ui_check_selected_set(obj, value); +} + +EAPI Eina_Bool +elm_check_selected_get(const Efl_Ui_Check *obj) +{ + return efl_ui_check_selected_get(obj); +} diff --git a/src/lib/elementary/efl_ui_check_eo.legacy.h b/src/lib/elementary/efl_ui_check_eo.legacy.h new file mode 100644 index 0000000000..5b3ade3f2f --- /dev/null +++ b/src/lib/elementary/efl_ui_check_eo.legacy.h @@ -0,0 +1,38 @@ +#ifndef _EFL_UI_CHECK_EO_LEGACY_H_ +#define _EFL_UI_CHECK_EO_LEGACY_H_ + +#ifndef _EFL_UI_CHECK_EO_CLASS_TYPE +#define _EFL_UI_CHECK_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Check; + +#endif + +#ifndef _EFL_UI_CHECK_EO_TYPES +#define _EFL_UI_CHECK_EO_TYPES + + +#endif + +/** + * @brief The on/off state of the check object. + * + * @param[in] obj The object. + * @param[in] value @c true if the check object is selected, @c false otherwise + * + * @ingroup Elm_Check_Group + */ +EAPI void elm_check_selected_set(Efl_Ui_Check *obj, Eina_Bool value); + +/** + * @brief The on/off state of the check object. + * + * @param[in] obj The object. + * + * @return @c true if the check object is selected, @c false otherwise + * + * @ingroup Elm_Check_Group + */ +EAPI Eina_Bool elm_check_selected_get(const Efl_Ui_Check *obj); + +#endif diff --git a/src/lib/elementary/efl_ui_check_legacy.eo b/src/lib/elementary/efl_ui_check_legacy.eo deleted file mode 100644 index 9486bf608f..0000000000 --- a/src/lib/elementary/efl_ui_check_legacy.eo +++ /dev/null @@ -1,18 +0,0 @@ -class Efl.Ui.Check_Legacy extends Efl.Ui.Check implements 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_eo.c b/src/lib/elementary/efl_ui_check_legacy_eo.c new file mode 100644 index 0000000000..cd1d466ee9 --- /dev/null +++ b/src/lib/elementary/efl_ui_check_legacy_eo.c @@ -0,0 +1,47 @@ + +Efl_Object *_efl_ui_check_legacy_efl_object_constructor(Eo *obj, void *pd); + + +Eina_Error _efl_ui_check_legacy_efl_ui_widget_theme_apply(Eo *obj, void *pd); + + +Eina_Bool _efl_ui_check_legacy_efl_ui_widget_widget_sub_object_del(Eo *obj, void *pd, Efl_Canvas_Object *sub_obj); + + +Efl_Object *_efl_ui_check_legacy_efl_part_part_get(const Eo *obj, void *pd, const char *name); + + +static Eina_Bool +_efl_ui_check_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_CHECK_LEGACY_EXTRA_OPS +#define EFL_UI_CHECK_LEGACY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _efl_ui_check_legacy_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _efl_ui_check_legacy_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _efl_ui_check_legacy_efl_ui_widget_widget_sub_object_del), + EFL_OBJECT_OP_FUNC(efl_part_get, _efl_ui_check_legacy_efl_part_part_get), + EFL_UI_CHECK_LEGACY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_check_legacy_class_desc = { + EO_VERSION, + "Efl.Ui.Check_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _efl_ui_check_legacy_class_initializer, + _efl_ui_check_legacy_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_check_legacy_class_get, &_efl_ui_check_legacy_class_desc, EFL_UI_CHECK_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/efl_ui_check_legacy_eo.h b/src/lib/elementary/efl_ui_check_legacy_eo.h new file mode 100644 index 0000000000..a8fb7f50e6 --- /dev/null +++ b/src/lib/elementary/efl_ui_check_legacy_eo.h @@ -0,0 +1,32 @@ +#ifndef _EFL_UI_CHECK_LEGACY_EO_H_ +#define _EFL_UI_CHECK_LEGACY_EO_H_ + +#ifndef _EFL_UI_CHECK_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_CHECK_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Check_Legacy; + +#endif + +#ifndef _EFL_UI_CHECK_LEGACY_EO_TYPES +#define _EFL_UI_CHECK_LEGACY_EO_TYPES + + +#endif +#ifdef EFL_BETA_API_SUPPORT +/** + * @brief 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. + * + * @ingroup Efl_Ui_Check_Legacy + */ +#define EFL_UI_CHECK_LEGACY_CLASS efl_ui_check_legacy_class_get() + +EWAPI const Efl_Class *efl_ui_check_legacy_class_get(void); +#endif /* EFL_BETA_API_SUPPORT */ + +#endif diff --git a/src/lib/elementary/efl_ui_check_legacy_eo.legacy.h b/src/lib/elementary/efl_ui_check_legacy_eo.legacy.h new file mode 100644 index 0000000000..efe4b009b3 --- /dev/null +++ b/src/lib/elementary/efl_ui_check_legacy_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_CHECK_LEGACY_EO_LEGACY_H_ +#define _EFL_UI_CHECK_LEGACY_EO_LEGACY_H_ + +#ifndef _EFL_UI_CHECK_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_CHECK_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Check_Legacy; + +#endif + +#ifndef _EFL_UI_CHECK_LEGACY_EO_TYPES +#define _EFL_UI_CHECK_LEGACY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/efl_ui_check_legacy_part.eo b/src/lib/elementary/efl_ui_check_legacy_part.eo index b856f08f12..afd8703716 100644 --- a/src/lib/elementary/efl_ui_check_legacy_part.eo +++ b/src/lib/elementary/efl_ui_check_legacy_part.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Check_Legacy_Part extends Efl.Ui.Layout_Part_Content +class @beta Efl.Ui.Check_Legacy_Part extends Efl.Ui.Layout_Part_Content { [[Elementary check internal part class]] data: null; diff --git a/src/lib/elementary/efl_ui_clock.c b/src/lib/elementary/efl_ui_clock.c index 528e1f4727..e580d3cf06 100644 --- a/src/lib/elementary/efl_ui_clock.c +++ b/src/lib/elementary/efl_ui_clock.c @@ -496,23 +496,6 @@ _efl_ui_clock_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Clock_Data *sd return EINA_TRUE; } -EOLIAN static Eina_Bool -_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; - - if (!efl_ui_widget_on_disabled_update(efl_super(obj, MY_CLASS), disabled)) - return EINA_FALSE; - - for (idx = 0; idx < EFL_UI_CLOCK_TYPE_COUNT; idx++) - { - field = sd->field_list + idx; - elm_object_disabled_set(field->item_obj, disabled); - } - return EINA_TRUE; -} - EOLIAN static void _efl_ui_clock_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Clock_Data *sd) { @@ -531,10 +514,10 @@ _efl_ui_clock_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Clock_Data *sd) evas_object_size_hint_max_set(obj, -1, -1); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_clock_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Clock_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; Clock_Field *field; char buf[BUFFER_SIZE]; @@ -544,7 +527,7 @@ _efl_ui_clock_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Clock_Data *sd) 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_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; dt_mod = _dt_mod_init(); if ((!dt_mod) || (!dt_mod->field_value_display)) return EINA_TRUE; @@ -872,12 +855,11 @@ _efl_ui_clock_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Clock_Data *priv) if (!elm_widget_theme_klass_get(obj)) elm_widget_theme_klass_set(obj, "uiclock"); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); - if (!elm_widget_theme_object_set(obj, wd->resize_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))) + elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); // module - initialise module for clock diff --git a/src/lib/elementary/efl_ui_clock.eo b/src/lib/elementary/efl_ui_clock.eo index 678b210af2..e2c7fdec6e 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 @beta 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 extends Efl.Ui.Layout +class @beta Efl.Ui.Clock extends Efl.Ui.Layout_Base { [[Efl UI clock class]] methods { @@ -224,7 +224,6 @@ class Efl.Ui.Clock extends Efl.Ui.Layout implements { Efl.Object.constructor; Efl.Ui.Widget.theme_apply; - Efl.Ui.Widget.on_disabled_update; Efl.Ui.Focus.Object.on_focus_update; Efl.Ui.L10n.translation_update; } diff --git a/src/lib/elementary/efl_ui_clock.h b/src/lib/elementary/efl_ui_clock.h index b882cd77a5..1115faaf45 100644 --- a/src/lib/elementary/efl_ui_clock.h +++ b/src/lib/elementary/efl_ui_clock.h @@ -196,9 +196,8 @@ * @{ */ -#ifdef EFL_EO_API_SUPPORT #include "efl_ui_clock.eo.h" -#endif + /** * @} */ diff --git a/src/lib/elementary/efl_ui_clock_legacy.eo b/src/lib/elementary/efl_ui_clock_legacy.eo index 463af9676e..acc7cea33c 100644 --- a/src/lib/elementary/efl_ui_clock_legacy.eo +++ b/src/lib/elementary/efl_ui_clock_legacy.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Clock_Legacy extends Efl.Ui.Clock implements Efl.Ui.Legacy +class @beta Efl.Ui.Clock_Legacy extends Efl.Ui.Clock implements Efl.Ui.Legacy { [[Efl UI clock class]] data: null; diff --git a/src/lib/elementary/efl_ui_container_layout.c b/src/lib/elementary/efl_ui_container_layout.c new file mode 100644 index 0000000000..51934e73c7 --- /dev/null +++ b/src/lib/elementary/efl_ui_container_layout.c @@ -0,0 +1,158 @@ +#include "efl_ui_container_layout.h" + +void +_efl_ui_container_layout_min_max_calc(Efl_Ui_Container_Item_Hints *item, int *cw, int *ch, Eina_Bool aspect_check) +{ + int w = *cw, h = *ch; + Eina_Size2D aspect = { item[0].aspect, item[1].aspect }; + + if (aspect_check) + { + w = h * aspect.w / aspect.h; + if (w > *cw) + { + w = *cw; + h = w * aspect.h / aspect.w; + } + } + + if (w > item[0].max) + { + w = item[0].max; + if (aspect_check) h = w * aspect.h / aspect.w; + } + if (h > item[1].max) + { + h = item[1].max; + if (aspect_check) w = h * aspect.w / aspect.h; + } + if (w < item[0].min) + { + w = item[0].min; + if (aspect_check) h = w * aspect.h / aspect.w; + } + if (h < item[1].min) + { + h = item[1].min; + if (aspect_check) w = h * aspect.w / aspect.h; + } + *cw = w; + *ch = h; +} + +void +_efl_ui_container_layout_item_init(Eo* o, Efl_Ui_Container_Item_Hints *item) +{ + Eina_Size2D max; + Eina_Size2D min; + Eina_Size2D aspect; + Efl_Gfx_Hint_Aspect aspect_type; + + efl_gfx_hint_weight_get(o, &item[0].weight, &item[1].weight); + efl_gfx_hint_align_get(o, &item[0].align, &item[1].align); + efl_gfx_hint_margin_get(o, &item[0].margin[0], &item[0].margin[1], + &item[1].margin[0], &item[1].margin[1]); + efl_gfx_hint_fill_get(o, &item[0].fill, &item[1].fill); + max = efl_gfx_hint_size_max_get(o); + min = efl_gfx_hint_size_combined_min_get(o); + efl_gfx_hint_aspect_get(o, &aspect_type, &aspect); + item[0].aspect = aspect.w; + item[1].aspect = aspect.h; + item[0].aspect_type = aspect_type; + item[1].aspect_type = aspect_type; + + if (EINA_DBL_EQ(item[0].align, -1)) + { + item[0].align = 0.5; + item[0].fill = EINA_TRUE; + } + else if (item[0].align < 0) item[0].align = 0; + else if (item[0].align > 1) item[0].align = 1; + if (EINA_DBL_EQ(item[1].align, -1)) + { + item[1].align = 0.5; + item[1].fill = EINA_TRUE; + } + else if (item[1].align < 0) item[1].align = 0; + else if (item[1].align > 1) item[1].align = 1; + + if (min.w < 0) min.w = 0; + if (min.h < 0) min.h = 0; + + if (max.w < 0) max.w = INT_MAX; + if (max.h < 0) max.h = INT_MAX; + + item[0].max = max.w; + item[1].max = max.h; + item[0].min = min.w; + item[1].min = min.h; + + if ((item[0].aspect <= 0) || (item[1].aspect <= 0)) + { + if ((item[0].aspect <= 0) ^ (item[1].aspect <= 0)) + { + ERR("Invalid aspect parameter for obj(%p)", o); + item[0].aspect = item[1].aspect = 0; + item[0].aspect_type = item[1].aspect_type = EFL_GFX_HINT_ASPECT_NONE; + } + } + else + { + _efl_ui_container_layout_min_max_calc(item, &item[0].min, &item[1].min, + EINA_TRUE); + } + + + item[0].space = item[0].min + item[0].margin[0] + item[0].margin[1]; + item[1].space = item[1].min + item[1].margin[0] + item[1].margin[1]; +} + +void +_efl_ui_container_layout_init(Eo* obj, Efl_Ui_Container_Layout_Calc *calc) +{ + Eina_Rect geom; + Eina_Bool pad_scalable; + + geom = efl_gfx_entity_geometry_get(obj); + efl_gfx_hint_margin_get(obj, &calc[0].margin[0], &calc[0].margin[1], + &calc[1].margin[0], &calc[1].margin[1]); + calc[0].scale = calc[1].scale = efl_gfx_entity_scale_get(obj); + + efl_pack_padding_get(obj, &calc[0].pad, &calc[1].pad, &pad_scalable); + calc[0].pad = pad_scalable ? (calc[0].pad * calc[0].scale) : calc[0].pad; + calc[1].pad = pad_scalable ? (calc[1].pad * calc[1].scale) : calc[1].pad; + + // pack align is used if "no item has a weight" + efl_pack_align_get(obj, &calc[0].align, &calc[1].align); + if (calc[0].align < 0) + { + calc[0].fill = EINA_TRUE; + calc[0].align = 0.5; + } + else if (calc[0].align > 1) + { + calc[0].align = 1; + } + else + { + calc[0].fill = EINA_FALSE; + } + + if (calc[1].align < 0) + { + calc[1].fill = EINA_TRUE; + calc[1].align = 0.5; + } + else if (calc[1].align > 1) + { + calc[1].align = 1; + } + else + { + calc[1].fill = EINA_FALSE; + } + calc[0].pos = geom.x + calc[0].margin[0]; + calc[1].pos = geom.y + calc[1].margin[0]; + calc[0].size = geom.w - calc[0].margin[0] - calc[0].margin[1]; + calc[1].size = geom.h - calc[1].margin[0] - calc[1].margin[1]; +} diff --git a/src/lib/elementary/efl_ui_container_layout.h b/src/lib/elementary/efl_ui_container_layout.h new file mode 100644 index 0000000000..097abee13b --- /dev/null +++ b/src/lib/elementary/efl_ui_container_layout.h @@ -0,0 +1,42 @@ +#ifndef _EFL_UI_CONTAINER_HELPER_H_ +#define _EFL_UI_CONTAINER_HELPER_H_ + +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include +#include "elm_priv.h" + +typedef struct _Efl_Ui_Container_Item_Hints Efl_Ui_Container_Item_Hints; +typedef struct _Efl_Ui_Container_Layout_Calc Efl_Ui_Container_Layout_Calc; + +struct _Efl_Ui_Container_Item_Hints +{ + int max; + int min; + int aspect; + int margin[2]; // start, end + Efl_Gfx_Hint_Aspect aspect_type; + double weight; + double align; + double space; + Eina_Bool fill; +}; + +struct _Efl_Ui_Container_Layout_Calc +{ + int pos; + int size; + int margin[2]; + double align; + double scale; + double pad; + Eina_Bool fill : 1; +}; + +void _efl_ui_container_layout_min_max_calc(Efl_Ui_Container_Item_Hints *item, int *cw, int *ch, Eina_Bool aspect_check); +void _efl_ui_container_layout_item_init(Eo* o, Efl_Ui_Container_Item_Hints *item); +void _efl_ui_container_layout_init(Eo* obj, Efl_Ui_Container_Layout_Calc *calc); + +#endif diff --git a/src/lib/elementary/efl_ui_cursor.eo b/src/lib/elementary/efl_ui_cursor.eo deleted file mode 100644 index a172e533f7..0000000000 --- a/src/lib/elementary/efl_ui_cursor.eo +++ /dev/null @@ -1,88 +0,0 @@ -interface Efl.Ui.Cursor -{ - [[An interface to define mouse cursors to use when hovering - over UI widgets. - - The Elementary cursor is an internal smart object used to customize the - mouse cursor displayed over objects (or widgets). In the most common - scenario, the cursor decoration comes from the graphical engine Elementary - is running on. These engines may provide different decorations for cursors, - and Elementary provides functions to choose them for instance - X11 cursors. - - By default, Elementary searches cursors only from the engine. Besides - using cursors provided by the you can also use those - coming from Edje theme files. Both globally and per widget, Elementary - can help you store cursors in engines - only or in Elementary's theme file. To set cursor's hot spot two data - items must be added to the cursor's theme: "hot_x" and "hot_y" are the - offset from the upper-left corner of the cursor (coordinates 0,0). - ]] - legacy_prefix: elm_object; - methods { - @property cursor { - [[The cursor to be shown when mouse is over the object - - This is the cursor that will be displayed when mouse is over the - object. The object can have only one cursor set to it so if - @.cursor.set is called twice for an object, the previous set - will be unset. - - If using X cursors, a definition of all the valid cursor names - is listed on Elementary_Cursors.h. If an invalid name is set - the default cursor will be used. - ]] - set { - [[Sets or unsets the current cursor. - - If $cursor is $null this function will reset the cursor - to the default one. - ]] - return: bool; [[$true if successful.]] - } - get { - [[Returns the current cursor name.]] - } - values { - cursor: string @nullable; [[The cursor name, defined either - by the display system or the theme.]] - } - } - @property cursor_style { - [[A different style for the cursor. - - This only makes sense if theme cursors are used. - The cursor should be set with @.cursor.set first before - setting its style with this property. - ]] - set { - [[Sets a style for the current cursor. Call after @.cursor.set.]] - return: bool; [[$true if successful.]] - } - get { - [[Returns the current cursor style name.]] - } - values { - style: string; [[A specific style to use, eg. default, - transparent, ....]] - } - } - @property cursor_theme_search_enabled { - [[Whether the cursor may be looked in the theme or not. - - If $false, the cursor may only come from the render engine, - i.e. from the display manager. - ]] - set { - [[Enables or disables theme cursors.]] - return: bool; [[$true if successful.]] - } - get { - [[Returns the current state of theme cursors search.]] - } - values { - allow: bool(true); [[Whether to use theme cursors.]] - } - } - } -} diff --git a/src/lib/elementary/efl_ui_datepicker.c b/src/lib/elementary/efl_ui_datepicker.c index 493dbfa674..06a18780e3 100644 --- a/src/lib/elementary/efl_ui_datepicker.c +++ b/src/lib/elementary/efl_ui_datepicker.c @@ -27,6 +27,7 @@ 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]; \ + t.tm_sec = 0; \ efl_datetime_manager_value_set(pd->dt_manager, t); \ } while (0) @@ -244,18 +245,16 @@ _efl_ui_datepicker_efl_object_constructor(Eo *obj, Efl_Ui_Datepicker_Data *pd) 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))) + 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)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) 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; diff --git a/src/lib/elementary/efl_ui_datepicker.eo b/src/lib/elementary/efl_ui_datepicker.eo index 81d9b1634e..93e7632023 100644 --- a/src/lib/elementary/efl_ui_datepicker.eo +++ b/src/lib/elementary/efl_ui_datepicker.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Datepicker extends Efl.Ui.Layout +class @beta Efl.Ui.Datepicker extends Efl.Ui.Layout_Base { [[Datepicker widget diff --git a/src/lib/elementary/efl_ui_dnd.c b/src/lib/elementary/efl_ui_dnd.c index c368beb0d1..df79eb9762 100644 --- a/src/lib/elementary/efl_ui_dnd.c +++ b/src/lib/elementary/efl_ui_dnd.c @@ -7,7 +7,6 @@ #define ELM_INTERFACE_ATSPI_TEXT_EDITABLE_PROTECTED #define ELM_LAYOUT_PROTECTED -#define EFL_UI_SELECTION_MANAGER_BETA #include #include @@ -28,7 +27,7 @@ Eo* _efl_ui_selection_manager_get(Eo *obj) { if (!efl_isa(obj, EFL_UI_WIDGET_CLASS)) return NULL; - Eo *app = efl_app_main_get(EFL_APP_CLASS); + Eo *app = efl_app_main_get(); Eo *sel_man = efl_key_data_get(app, "__selection_manager"); if (!sel_man) { @@ -41,7 +40,7 @@ _efl_ui_selection_manager_get(Eo *obj) void _efl_ui_dnd_shutdown(void) { - Eo *app = efl_app_main_get(EFL_APP_CLASS); + Eo *app = efl_app_main_get(); Eo *sel_man = efl_key_data_get(app, "__selection_manager"); efl_del(sel_man); @@ -820,7 +819,7 @@ elm_drag_item_container_add(Evas_Object *obj, double anim_tm, double tm_to_drag, 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_ui_selection_manager_container_drag_item_add(sel_man, obj, anim_tm, tm_to_drag, + efl_ui_selection_manager_container_drag_item_add(sel_man, obj, tm_to_drag, anim_tm, di, _cont_drag_data_func, NULL, di, _cont_drag_item_func, NULL, di, _cont_drag_icon_create, NULL, diff --git a/src/lib/elementary/efl_ui_dnd.eo b/src/lib/elementary/efl_ui_dnd.eo index a4ea5e9b78..08f668856b 100644 --- a/src/lib/elementary/efl_ui_dnd.eo +++ b/src/lib/elementary/efl_ui_dnd.eo @@ -1,6 +1,6 @@ import efl_ui_dnd_types; -mixin Efl.Ui.Dnd { +mixin @beta Efl.Ui.Dnd { data: null; methods { drag_start { diff --git a/src/lib/elementary/efl_ui_dnd_container.eo b/src/lib/elementary/efl_ui_dnd_container.eo index ee1e727a4a..0cc1f3f945 100644 --- a/src/lib/elementary/efl_ui_dnd_container.eo +++ b/src/lib/elementary/efl_ui_dnd_container.eo @@ -1,14 +1,12 @@ import efl_ui_dnd_types; -mixin Efl.Ui.Dnd_Container { +mixin @beta 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]] diff --git a/src/lib/elementary/efl_ui_dnd_types.eot b/src/lib/elementary/efl_ui_dnd_types.eot index f07de0bc33..83b9795506 100644 --- a/src/lib/elementary/efl_ui_dnd_types.eot +++ b/src/lib/elementary/efl_ui_dnd_types.eot @@ -1,16 +1,16 @@ import efl_ui_selection_types; -function Efl.Dnd.Drag_Icon_Create { +function @beta 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; + @out off: Eina.Position2D; [[Offset from the icon position to the cursor]] } return: Efl.Canvas.Object; [[The drag icon object]] }; -function Efl.Dnd.Drag_Data_Get { +function @beta 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]] @@ -20,7 +20,7 @@ function Efl.Dnd.Drag_Data_Get { } }; -function Efl.Dnd.Item_Get { +function @beta 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]] @@ -30,7 +30,7 @@ function Efl.Dnd.Item_Get { return: Efl.Object; [[Object under x,y coordinates or NULL if not found]] }; -function Efl.Dnd.Drag_Icon_List_Create { +function @beta 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.]] @@ -40,18 +40,18 @@ function Efl.Dnd.Drag_Icon_List_Create { return: list; }; -struct Efl.Dnd.Drag_Accept { +struct @beta Efl.Dnd.Drag_Accept { accepted: bool; } -struct Efl.Dnd.Drag_Pos { +struct @beta Efl.Dnd.Drag_Pos { pos: Eina.Position2D; [[Evas Coordinate]] action: Efl.Ui.Selection_Action; [[The drag action]] format: Efl.Ui.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 { +struct @beta Efl.Dnd.Drag_Item_Container_Drop { item: Efl.Canvas.Object; [[The item object]] data: Efl.Ui.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_exact_model.c b/src/lib/elementary/efl_ui_exact_model.c new file mode 100644 index 0000000000..fac8298745 --- /dev/null +++ b/src/lib/elementary/efl_ui_exact_model.c @@ -0,0 +1,342 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include "elm_priv.h" + +// This class store the size information in a compressed array and unpack it +// when necessary. It does maintain a cache of up to 3 uncompressed slot. +// That cache could get dropped when the application is entering the 'pause' +// state. + +#define EFL_UI_EXACT_MODEL_CONTENT 1024 +#define EFL_UI_EXACT_MODEL_CONTENT_LENGTH (EFL_UI_EXACT_MODEL_CONTENT * sizeof (unsigned int)) + +// For now only vertical logic is implemented. Horizontal list and grid are not supported. + +typedef struct _Efl_Ui_Exact_Model_Data Efl_Ui_Exact_Model_Data; +struct _Efl_Ui_Exact_Model_Data +{ + Efl_Ui_Exact_Model_Data *parent; + + struct { + Eina_List *width; + Eina_List *height; + } compressed; + + struct { + unsigned int width; + unsigned int height; + } total_size; + + struct { + unsigned int *width; + unsigned int *height; + unsigned int start_offset; + unsigned short usage; + Eina_Bool defined : 1; + struct { + Eina_Bool width : 1; + Eina_Bool height : 1; + } decompressed; + } slot[3]; +}; + +static Efl_Object * +_efl_ui_exact_model_efl_object_constructor(Eo *obj, Efl_Ui_Exact_Model_Data *pd) +{ + Eo *parent = efl_parent_get(obj); + + if (parent && efl_isa(parent, EFL_UI_EXACT_MODEL_CLASS)) + pd->parent = efl_data_scope_get(efl_parent_get(obj), EFL_UI_EXACT_MODEL_CLASS); + + return efl_constructor(efl_super(obj, EFL_UI_EXACT_MODEL_CLASS)); +} + +static unsigned int +_efl_ui_exact_model_list_find(unsigned int list_index, Eina_List *start, Eina_List **l) +{ + Eina_Binbuf *tbuf; + + EINA_LIST_FOREACH(start, *l, tbuf) + { + if (list_index == 0) break; + list_index--; + } + + return list_index; +} + +static Eina_List * +_efl_ui_exact_model_slot_compress(unsigned int index, Eina_List *compressed, unsigned int *buffer) +{ + unsigned int list_index = index / EFL_UI_EXACT_MODEL_CONTENT; + static Eina_Binbuf *z = NULL; + Eina_Binbuf *cbuf; + Eina_Binbuf *tbuf; + Eina_List *l = NULL; + unsigned int i; + + _efl_ui_exact_model_list_find(list_index, compressed, &l); + + tbuf = eina_binbuf_manage_new((unsigned char *) buffer, EFL_UI_EXACT_MODEL_CONTENT_LENGTH, EINA_TRUE); + cbuf = emile_compress(tbuf, EMILE_LZ4, EMILE_COMPRESSOR_FAST); + eina_binbuf_free(tbuf); + + if (!tbuf || !cbuf) return compressed; + + // Make sure the list has all the buffer up to the needed one filled with valid data + if (list_index) + { + // Create the compressed zero buffer once. + if (!z) + { + unsigned char *zmem; + + zmem = calloc(EFL_UI_EXACT_MODEL_CONTENT, sizeof (unsigned int)); + if (!zmem) return compressed; + + tbuf = eina_binbuf_manage_new(zmem, EFL_UI_EXACT_MODEL_CONTENT_LENGTH, EINA_TRUE); + if (!tbuf) return compressed; + + z = emile_compress(tbuf, EMILE_LZ4, EMILE_COMPRESSOR_FAST); + + eina_binbuf_free(tbuf); + free(zmem); + } + + // Fill the list all the way to the needed index with buffer full of zero + for (i = 0; i < list_index; i++) + { + compressed = eina_list_append(compressed, z); + } + l = eina_list_last(compressed); + } + + // Replace older buffer by newer buffer + tbuf = eina_list_data_get(l); + compressed = eina_list_prepend_relative(compressed, l, cbuf); + compressed = eina_list_remove_list(compressed, l); + if (tbuf != z) eina_binbuf_free(tbuf); + + return compressed; +} + +static unsigned int * +_efl_ui_exact_model_buffer_expand(unsigned int list_index, unsigned int *buffer, Eina_List *list) +{ + unsigned int found; + Eina_Binbuf *tmp; + Eina_List *l = NULL; + + if (!buffer) buffer = malloc(EFL_UI_EXACT_MODEL_CONTENT_LENGTH); + + found = _efl_ui_exact_model_list_find(list_index, list, &l); + + // Check if the data is in the list + if (!found) + { + // Not found -> everything is assumed to be zero + memset(buffer, 0, EFL_UI_EXACT_MODEL_CONTENT_LENGTH); + return buffer; + } + + // Found -> expand in buffer + tmp = eina_binbuf_manage_new((unsigned char*) buffer, EFL_UI_EXACT_MODEL_CONTENT_LENGTH, EINA_TRUE); + emile_expand(eina_list_data_get(l), tmp, EMILE_LZ4); + eina_binbuf_free(tmp); + + return buffer; +} + +static unsigned char +_efl_ui_exact_model_slot_find(Efl_Ui_Exact_Model_Data *pd, unsigned int index, + Eina_Bool width_get, Eina_Bool height_get) +{ + unsigned char lookup; + unsigned char found = EINA_C_ARRAY_LENGTH(pd->parent->slot); + + for (lookup = 0; lookup < EINA_C_ARRAY_LENGTH(pd->parent->slot); lookup++) + { + // Check if the slot has valid content + if (!pd->parent->slot[lookup].defined) + continue; + if (pd->parent->slot[lookup].start_offset <= index && + index < pd->parent->slot[lookup].start_offset + EFL_UI_EXACT_MODEL_CONTENT) + found = lookup; + // Reduce usage to find unused slot. + if (pd->parent->slot[lookup].usage > 0) + pd->parent->slot[lookup].usage--; + } + + // Do we need to find a new slot? + if (found == EINA_C_ARRAY_LENGTH(pd->parent->slot)) + { + found = 0; + for (lookup = 0; lookup < EINA_C_ARRAY_LENGTH(pd->parent->slot); lookup++) + { + if (!pd->parent->slot[lookup].defined) + { + // Found an empty slot, let's use that. + found = lookup; + break; + } + if (pd->parent->slot[lookup].usage < pd->parent->slot[found].usage) + found = lookup; + } + + // Commit change back to the stored buffer list + if (pd->parent->slot[found].defined && + (pd->parent->slot[found].width || + pd->parent->slot[found].height)) + { + if (pd->parent->slot[found].width && + pd->parent->slot[found].decompressed.width) + pd->parent->compressed.width = _efl_ui_exact_model_slot_compress(index, + pd->parent->compressed.width, + pd->parent->slot[found].width); + if (pd->parent->slot[found].height && + pd->parent->slot[found].decompressed.height) + pd->parent->compressed.height = _efl_ui_exact_model_slot_compress(index, + pd->parent->compressed.height, + pd->parent->slot[found].height); + } + + pd->parent->slot[found].defined = EINA_TRUE; + pd->parent->slot[found].decompressed.width = EINA_FALSE; + pd->parent->slot[found].decompressed.height = EINA_FALSE; + pd->parent->slot[found].start_offset = index / EFL_UI_EXACT_MODEL_CONTENT; + } + + // Increase usage of the returnd slot for now + pd->parent->slot[found].usage++; + + // Unpack the data if requested + if (width_get && !pd->parent->slot[found].decompressed.width) + { + pd->parent->slot[found].width = _efl_ui_exact_model_buffer_expand(pd->parent->slot[found].start_offset, + pd->parent->slot[found].width, + pd->parent->compressed.width); + pd->parent->slot[found].decompressed.width = EINA_TRUE; + } + if (height_get && !pd->parent->slot[found].decompressed.height) + { + pd->parent->slot[found].height = _efl_ui_exact_model_buffer_expand(pd->parent->slot[found].start_offset, + pd->parent->slot[found].height, + pd->parent->compressed.height); + pd->parent->slot[found].decompressed.height = EINA_TRUE; + } + + return found; +} + +static Eina_Future * +_efl_ui_exact_model_efl_model_property_set(Eo *obj, Efl_Ui_Exact_Model_Data *pd, + const char *property, Eina_Value *value) +{ + if (pd->parent) + { + if (!strcmp(property, _efl_model_property_selfw)) + { + unsigned int index; + unsigned char found; + + index = efl_composite_model_index_get(obj); + found = _efl_ui_exact_model_slot_find(pd, index, EINA_TRUE, EINA_FALSE); + if (!eina_value_uint_convert(value, &pd->parent->slot[found].width[index % EFL_UI_EXACT_MODEL_CONTENT])) + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE); + // We succeeded so let's update the max total size width (As we only handle vertical list case at the moment) + if (pd->parent->total_size.width < pd->parent->slot[found].width[index % EFL_UI_EXACT_MODEL_CONTENT]) + pd->parent->total_size.width = pd->parent->slot[found].width[index % EFL_UI_EXACT_MODEL_CONTENT]; + return efl_loop_future_resolved(obj, eina_value_uint_init(pd->parent->slot[found].width[index % EFL_UI_EXACT_MODEL_CONTENT])); + } + if (!strcmp(property, _efl_model_property_selfh)) + { + unsigned int old_value; + unsigned int index; + unsigned char found; + + index = efl_composite_model_index_get(obj); + found = _efl_ui_exact_model_slot_find(pd, index, EINA_FALSE, EINA_TRUE); + old_value = pd->parent->slot[found].height[index % EFL_UI_EXACT_MODEL_CONTENT]; + if (!eina_value_uint_convert(value, &pd->parent->slot[found].height[index % EFL_UI_EXACT_MODEL_CONTENT])) + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE); + // We succeeded so let's update the total size + pd->parent->total_size.height += pd->parent->slot[found].height[index % EFL_UI_EXACT_MODEL_CONTENT] - old_value; + return efl_loop_future_resolved(obj, eina_value_uint_init(pd->parent->slot[found].height[index % EFL_UI_EXACT_MODEL_CONTENT])); + } + // The following property are calculated by the model and so READ_ONLY + if (!strcmp(property, _efl_model_property_totalh)) + { + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_READ_ONLY); + } + if (!strcmp(property, _efl_model_property_totalw)) + { + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_READ_ONLY); + } + } + + if (!strcmp(property, _efl_model_property_itemw)) + { + // The exact model can not guess a general item size if asked + // and should refuse to remember anything like that. + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_READ_ONLY); + } + if (!strcmp(property, _efl_model_property_itemh)) + { + // The exact model can not guess a general item size if asked + // and should refuse to remember anything like that. + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_READ_ONLY); + } + + return efl_model_property_set(efl_super(obj, EFL_UI_EXACT_MODEL_CLASS), property, value); +} + +static Eina_Value * +_efl_ui_exact_model_efl_model_property_get(const Eo *obj, Efl_Ui_Exact_Model_Data *pd, + const char *property) +{ + if (pd->parent) + { + if (!strcmp(property, _efl_model_property_selfw)) + { + unsigned int index; + unsigned char found; + + index = efl_composite_model_index_get(obj); + found = _efl_ui_exact_model_slot_find(pd, index, EINA_TRUE, EINA_FALSE); + return eina_value_uint_new(pd->parent->slot[found].width[index % EFL_UI_EXACT_MODEL_CONTENT]); + } + if (!strcmp(property, _efl_model_property_selfh)) + { + unsigned int index; + unsigned char found; + + index = efl_composite_model_index_get(obj); + found = _efl_ui_exact_model_slot_find(pd, index, EINA_FALSE, EINA_TRUE); + return eina_value_uint_new(pd->parent->slot[found].height[index % EFL_UI_EXACT_MODEL_CONTENT]); + } + } + if (!strcmp(property, _efl_model_property_totalh)) + { + return eina_value_uint_new(pd->total_size.height); + } + if (!strcmp(property, _efl_model_property_totalw)) + { + return eina_value_uint_new(pd->total_size.width); + } + if (!strcmp(property, _efl_model_property_itemw)) + { + // The exact model can not guess a general item size if asked. + return eina_value_error_new(EAGAIN); + } + if (!strcmp(property, _efl_model_property_itemh)) + { + // The exact model can not guess a general item size if asked. + return eina_value_error_new(EAGAIN); + } + return efl_model_property_get(efl_super(obj, EFL_UI_EXACT_MODEL_CLASS), property); +} + +#include "efl_ui_exact_model.eo.c" diff --git a/src/lib/elementary/efl_ui_exact_model.eo b/src/lib/elementary/efl_ui_exact_model.eo new file mode 100644 index 0000000000..691a7504ef --- /dev/null +++ b/src/lib/elementary/efl_ui_exact_model.eo @@ -0,0 +1,17 @@ +class @beta Efl.Ui.Exact_Model extends Efl.Ui.Size_Model +{ + [[Class to be used to store object item size for List/Grid View. + + This model provide "$total.width" and "$total.height" as an accumulated size of all + its children "$self.width" and "$self.height" @Efl.Model.property. This is currently + assuming a vertical list only. + + This model will return an error code EAGAIN for "$item.width" and "$item.height" all + the time and the View that use this Model should continue to get this value even after + computing all the "$self.width" and "$self.height" of this object children.]] + + implements { + Efl.Object.constructor; + Efl.Model.property { set; get; } + } +} diff --git a/src/lib/elementary/efl_ui_flip.c b/src/lib/elementary/efl_ui_flip.c index 7f3238e9bf..71dc20e076 100644 --- a/src/lib/elementary/efl_ui_flip.c +++ b/src/lib/elementary/efl_ui_flip.c @@ -97,12 +97,12 @@ _sizing_eval(Evas_Object *obj) evas_object_size_hint_max_set(obj, maxw, maxh); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_flip_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Flip_Data *sd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _sizing_eval(obj); @@ -1812,7 +1812,6 @@ EOLIAN static void _efl_ui_flip_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Flip_Data *priv) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->clip = evas_object_rectangle_add(evas_object_evas_get(obj)); evas_object_static_clip_set(priv->clip, EINA_TRUE); @@ -1959,7 +1958,7 @@ _internal_elm_flip_go_to(Evas_Object *obj, } EOLIAN static void -_efl_ui_flip_go_to(Eo *obj, Efl_Ui_Flip_Data *sd, Eina_Bool front, Elm_Flip_Mode mode) +_efl_ui_flip_go_to(Eo *obj, Efl_Ui_Flip_Data *sd, Eina_Bool front, Efl_Ui_Flip_Mode mode) { if (sd->next_state == front) return; @@ -1967,7 +1966,7 @@ _efl_ui_flip_go_to(Eo *obj, Efl_Ui_Flip_Data *sd, Eina_Bool front, Elm_Flip_Mode } EOLIAN static void -_efl_ui_flip_go(Eo *obj, Efl_Ui_Flip_Data *sd, Elm_Flip_Mode mode) +_efl_ui_flip_go(Eo *obj, Efl_Ui_Flip_Data *sd, Efl_Ui_Flip_Mode mode) { _internal_elm_flip_go_to(obj, sd, !sd->state, mode); } @@ -2209,15 +2208,6 @@ _efl_ui_flip_efl_container_content_count(Eo *obj EINA_UNUSED, Efl_Ui_Flip_Data * return eina_list_count(pd->content_list); } -EOLIAN static Eina_Bool -_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); - pd->content_list = eina_list_remove(pd->content_list, content); - _content_removed(obj, pd, content); - return EINA_TRUE; -} - EOLIAN static Eina_Bool _efl_ui_flip_efl_pack_unpack(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *subobj) { @@ -2358,8 +2348,9 @@ 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_eo.legacy.c" -#include "efl_ui_flip_legacy.eo.h" +#include "efl_ui_flip_legacy_eo.h" #define MY_CLASS_NAME_LEGACY "elm_flip" @@ -2384,4 +2375,4 @@ elm_flip_add(Evas_Object *parent) return elm_legacy_add(EFL_UI_FLIP_LEGACY_CLASS, parent); } -#include "efl_ui_flip_legacy.eo.c" +#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 f35701f11b..fb5a931067 100644 --- a/src/lib/elementary/efl_ui_flip.eo +++ b/src/lib/elementary/efl_ui_flip.eo @@ -1,9 +1,8 @@ import efl_ui_direction; -enum Efl.Ui.Flip_Mode +enum @beta Efl.Ui.Flip_Mode { [[Efl UI flip mode ]] - legacy: efl_ui_flip; rotate_y_center_axis, [[Rotate Y center axis flip mode]] rotate_x_center_axis, [[Rotate X center axis flip mode]] rotate_xz_center_axis, [[Rotate XZ center axis flip mode]] @@ -19,7 +18,7 @@ enum Efl.Ui.Flip_Mode cross_fade, [[Cross fade flip mode]] } -enum Efl.Ui.Flip_Interaction +enum @beta Efl.Ui.Flip_Interaction { [[Efl UI flip interaction]] none, [[No interaction]] @@ -28,10 +27,9 @@ enum Efl.Ui.Flip_Interaction page [[Page interaction]] } -class Efl.Ui.Flip extends Efl.Ui.Widget implements Efl.Pack_Linear +class @beta Efl.Ui.Flip extends Efl.Ui.Widget implements Efl.Pack_Linear { [[Efl UI flip class]] - legacy_prefix: elm_flip; methods { @property interaction { set { @@ -87,7 +85,6 @@ class Efl.Ui.Flip extends Efl.Ui.Widget implements Efl.Pack_Linear See also @.interaction.set. ]] - legacy: null; params { @in dir: Efl.Ui.Dir; [[The hit area to set.]] @in hitsize: double; [[The amount of that dimension (0.0 to 1.0) to use.]] @@ -96,7 +93,6 @@ class Efl.Ui.Flip extends Efl.Ui.Widget implements Efl.Pack_Linear interaction_direction_hitsize_get { [[Get the amount of the flip that is sensitive to interactive flip.]] return: double; [[The size set for that direction.]] - legacy: null; params { @in dir: Efl.Ui.Dir; [[The direction to check.]] } @@ -113,7 +109,6 @@ class Efl.Ui.Flip extends Efl.Ui.Widget implements Efl.Pack_Linear @.interaction_direction_hitsize_set. By default, a minimum hit area will be created on the opposite edge of the flip. ]] - legacy: null; params { @in dir: Efl.Ui.Dir; [[The direction to change.]] @in enabled: bool; [[If that direction is enabled or not.]] @@ -122,7 +117,6 @@ class Efl.Ui.Flip extends Efl.Ui.Widget implements Efl.Pack_Linear interaction_direction_enabled_get { [[Get the enabled state of that flip direction.]] return: bool; [[If that direction is enabled or not.]] - legacy: null; params { @in dir: Efl.Ui.Dir; [[The direction to check.]] } @@ -146,7 +140,7 @@ class Efl.Ui.Flip extends Efl.Ui.Widget implements Efl.Pack_Linear other content is shown as the other side of the flip), #ELM_FLIP_ROTATE_YZ_CENTER_AXIS (rotate the currently visible content around a diagonal axis in the middle of its height, the - other content is hown as the other side of the flip). + other content is shown as the other side of the flip). #ELM_FLIP_CUBE_LEFT (rotate the currently visible content to the left as if the flip was a cube, the other content is shown as the right face of the cube), #ELM_FLIP_CUBE_RIGHT (rotate the @@ -235,7 +229,6 @@ class Efl.Ui.Flip extends Efl.Ui.Widget implements Efl.Pack_Linear Efl.Ui.Widget.widget_sub_object_del; Efl.Container.content_iterate; Efl.Container.content_count; - Efl.Container.content_remove; Efl.Part.part_get; Efl.Pack.unpack; Efl.Pack.pack; diff --git a/src/lib/elementary/efl_ui_flip_eo.legacy.c b/src/lib/elementary/efl_ui_flip_eo.legacy.c new file mode 100644 index 0000000000..9968236d88 --- /dev/null +++ b/src/lib/elementary/efl_ui_flip_eo.legacy.c @@ -0,0 +1,30 @@ + +EAPI void +elm_flip_interaction_set(Elm_Flip *obj, Elm_Flip_Interaction mode) +{ + efl_ui_flip_interaction_set(obj, mode); +} + +EAPI Elm_Flip_Interaction +elm_flip_interaction_get(const Elm_Flip *obj) +{ + return efl_ui_flip_interaction_get(obj); +} + +EAPI Eina_Bool +elm_flip_front_visible_get(const Elm_Flip *obj) +{ + return efl_ui_flip_front_visible_get(obj); +} + +EAPI void +elm_flip_go(Elm_Flip *obj, Elm_Flip_Mode mode) +{ + efl_ui_flip_go(obj, mode); +} + +EAPI void +elm_flip_go_to(Elm_Flip *obj, Eina_Bool front, Elm_Flip_Mode mode) +{ + efl_ui_flip_go_to(obj, front, mode); +} diff --git a/src/lib/elementary/efl_ui_flip_eo.legacy.h b/src/lib/elementary/efl_ui_flip_eo.legacy.h new file mode 100644 index 0000000000..a8993e349d --- /dev/null +++ b/src/lib/elementary/efl_ui_flip_eo.legacy.h @@ -0,0 +1,140 @@ +#ifndef _EFL_UI_FLIP_EO_LEGACY_H_ +#define _EFL_UI_FLIP_EO_LEGACY_H_ + +/** + * @brief Set the interactive flip mode. + * + * This sets if the flip should be interactive (allow user to click and drag a + * side of the flip to reveal the back page and cause it to flip). By default a + * flip is not interactive. You may also need to set which sides of the flip + * are "active" for flipping and how much space they use (a minimum of a finger + * size) with @ref Efl.Ui.Flip.interaction_direction_enabled_set and + * @ref Efl.Ui.Flip.interaction_direction_hitsize_set. + * + * The four available mode of interaction are #ELM_FLIP_INTERACTION_NONE, + * #ELM_FLIP_INTERACTION_ROTATE, #ELM_FLIP_INTERACTION_CUBE and + * #ELM_FLIP_INTERACTION_PAGE. + * + * @note #ELM_FLIP_INTERACTION_ROTATE won't cause + * #ELM_FLIP_ROTATE_XZ_CENTER_AXIS or #ELM_FLIP_ROTATE_YZ_CENTER_AXIS to + * happen, those can only be achieved with @ref elm_flip_go. + * + * @param[in] obj The object. + * @param[in] mode The interactive flip mode to use. + * + * @ingroup Elm_Flip_Group + */ +EAPI void elm_flip_interaction_set(Eo *obj, Elm_Flip_Interaction mode); + +/** + * @brief Get the interactive flip mode. + * + * @param[in] obj The object. + * + * @return The interactive flip mode to use. + * + * @ingroup Elm_Flip_Group + */ +EAPI Elm_Flip_Interaction elm_flip_interaction_get(const Eo *obj); + +/** + * @brief Get flip front visibility state. + * + * @param[in] obj The object. + * + * @return @c true if front front is showing, @c false if the back is showing. + * + * @ingroup Elm_Flip_Group + */ +EAPI Eina_Bool elm_flip_front_visible_get(const Eo *obj); + + + + + +/** + * @brief Runs the flip animation. + * + * Flips the front and back contents using the @c mode animation. This + * effectively hides the currently visible content and shows the hidden one. + * + * There a number of possible animations to use for flipping, namely + * #ELM_FLIP_ROTATE_X_CENTER_AXIS (rotate the currently visible content around + * a horizontal axis in the middle of its height, the other content is shown as + * the other side of the flip), #ELM_FLIP_ROTATE_Y_CENTER_AXIS (rotate the + * currently visible content around a vertical axis in the middle of its width, + * the other content is shown as the other side of the flip), + * #ELM_FLIP_ROTATE_XZ_CENTER_AXIS (rotate the currently visible content around + * a diagonal axis in the middle of its width, the other content is shown as + * the other side of the flip), #ELM_FLIP_ROTATE_YZ_CENTER_AXIS (rotate the + * currently visible content around a diagonal axis in the middle of its + * height, the other content is shown as the other side of the flip). + * #ELM_FLIP_CUBE_LEFT (rotate the currently visible content to the left as if + * the flip was a cube, the other content is shown as the right face of the + * cube), #ELM_FLIP_CUBE_RIGHT (rotate the currently visible content to the + * right as if the flip was a cube, the other content is shown as the left face + * of the cube), #ELM_FLIP_CUBE_UP (rotate the currently visible content up as + * if the flip was a cube, the other content is shown as the bottom face of the + * cube), #ELM_FLIP_CUBE_DOWN (rotate the currently visible content down as if + * the flip was a cube, the other content is shown as the upper face of the + * cube), #ELM_FLIP_PAGE_LEFT (move the currently visible content to the left + * as if the flip was a book, the other content is shown as the page below + * that), #ELM_FLIP_PAGE_RIGHT (move the currently visible content to the right + * as if the flip was a book, the other content is shown as the page below it), + * #ELM_FLIP_PAGE_UP (move the currently visible content up as if the flip was + * a book, the other content is shown as the page below it), + * #ELM_FLIP_PAGE_DOWN (move the currently visible content down as if the flip + * was a book, the other content is shown as the page below that) and + * #ELM_FLIP_CROSS_FADE (fade out the currently visible content, while fading + * in the invisible content). + * + * @param[in] obj The object. + * @param[in] mode The mode type. + * + * @ingroup Elm_Flip_Group + */ +EAPI void elm_flip_go(Eo *obj, Elm_Flip_Mode mode); + +/** + * @brief Runs the flip animation to front or back. + * + * Flips the front and back contents using the @c mode animation. This + * effectively hides the currently visible content and shows he hidden one. + * + * There a number of possible animations to use for flipping, namely + * #ELM_FLIP_ROTATE_X_CENTER_AXIS (rotate the currently visible content around + * a horizontal axis in the middle of its height, the other content is shown as + * the other side of the flip), #ELM_FLIP_ROTATE_Y_CENTER_AXIS (rotate the + * currently visible content around a vertical axis in the middle of its width, + * the other content is shown as the other side of the flip), + * #ELM_FLIP_ROTATE_XZ_CENTER_AXIS (rotate the currently visible content around + * a diagonal axis in the middle of its width, the other content is shown as + * the other side of the flip), #ELM_FLIP_ROTATE_YZ_CENTER_AXIS (rotate the + * currently visible content around a diagonal axis in the middle of its + * height, the other content is shown as the other side of the flip). + * #ELM_FLIP_CUBE_LEFT (rotate the currently visible content to the left as if + * the flip was a cube, the other content is show as the right face of the + * cube), #ELM_FLIP_CUBE_RIGHT (rotate the currently visible content to the + * right as if the flip was a cube, the other content is show as the left face + * of the cube), #ELM_FLIP_CUBE_UP (rotate the currently visible content up as + * if the flip was a cube, the other content is shown as the bottom face of the + * cube), #ELM_FLIP_CUBE_DOWN (rotate the currently visible content down as if + * the flip was a cube, the other content is shown as the upper face of the + * cube), #ELM_FLIP_PAGE_LEFT (move the currently visible content to the left + * as if the flip was a book, the other content is shown as the page below + * that), #ELM_FLIP_PAGE_RIGHT (move the currently visible content to the right + * as if the flip was a book, the other content is shown as the page below it), + * #ELM_FLIP_PAGE_UP (move the currently visible content up as if the flip was + * a book, the other content is shown as the page below it) and + * #ELM_FLIP_PAGE_DOWN (move the currently visible content down as if the flip + * was a book, the other content is shown as the page below that). + * + * @param[in] obj The object. + * @param[in] front If @c true, makes front visible, otherwise makes back. + * @param[in] mode The mode type. + * + * @ingroup Elm_Flip_Group + */ +EAPI void elm_flip_go_to(Eo *obj, Eina_Bool front, Elm_Flip_Mode mode); + +#endif diff --git a/src/lib/elementary/efl_ui_flip_legacy.eo b/src/lib/elementary/efl_ui_flip_legacy.eo deleted file mode 100644 index c19762fe56..0000000000 --- a/src/lib/elementary/efl_ui_flip_legacy.eo +++ /dev/null @@ -1,9 +0,0 @@ -class Efl.Ui.Flip_Legacy extends Efl.Ui.Flip implements 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 8470bb187d..29652551e0 100644 --- a/src/lib/elementary/efl_ui_flip_legacy.h +++ b/src/lib/elementary/efl_ui_flip_legacy.h @@ -1,30 +1,39 @@ -#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 -#define ELM_FLIP_INTERACTION_ROTATE EFL_UI_FLIP_INTERACTION_ROTATE -#define ELM_FLIP_INTERACTION_CUBE EFL_UI_FLIP_INTERACTION_CUBE -#define ELM_FLIP_INTERACTION_PAGE EFL_UI_FLIP_INTERACTION_PAGE +/** Elm flip mode + * + * @ingroup Elm_Flip + */ +typedef enum +{ + ELM_FLIP_ROTATE_Y_CENTER_AXIS = 0, /**< Rotate Y center axis flip mode */ + ELM_FLIP_ROTATE_X_CENTER_AXIS, /**< Rotate X center axis flip mode */ + ELM_FLIP_ROTATE_XZ_CENTER_AXIS, /**< Rotate XZ center axis flip mode */ + ELM_FLIP_ROTATE_YZ_CENTER_AXIS, /**< Rotate YZ center axis flip mode */ + ELM_FLIP_CUBE_LEFT, /**< Cube left flip mode */ + ELM_FLIP_CUBE_RIGHT, /**< Cube right flip mode */ + ELM_FLIP_CUBE_UP, /**< Cube up flip mode */ + ELM_FLIP_CUBE_DOWN, /**< Cube down flip mode */ + ELM_FLIP_PAGE_LEFT, /**< Page left flip mode */ + ELM_FLIP_PAGE_RIGHT, /**< Page right flip mode */ + ELM_FLIP_PAGE_UP, /**< Page up flip mode */ + ELM_FLIP_PAGE_DOWN, /**< Page down flip mode */ + ELM_FLIP_CROSS_FADE /**< Cross fade flip mode */ +} Elm_Flip_Mode; +/** Efl UI flip interaction + * + * @ingroup Efl_Ui + */ +typedef enum +{ + ELM_FLIP_INTERACTION_NONE = 0, /**< No interaction */ + ELM_FLIP_INTERACTION_ROTATE, /**< Rotate interaction */ + ELM_FLIP_INTERACTION_CUBE, /**< Cube interaction */ + ELM_FLIP_INTERACTION_PAGE /**< Page interaction */ +} Elm_Flip_Interaction; -typedef Efl_Ui_Flip_Mode Elm_Flip_Mode; - -#define ELM_FLIP_ROTATE_Y_CENTER_AXIS EFL_UI_FLIP_ROTATE_Y_CENTER_AXIS -#define ELM_FLIP_ROTATE_X_CENTER_AXIS EFL_UI_FLIP_ROTATE_X_CENTER_AXIS -#define ELM_FLIP_ROTATE_XZ_CENTER_AXIS EFL_UI_FLIP_ROTATE_XZ_CENTER_AXIS -#define ELM_FLIP_ROTATE_YZ_CENTER_AXIS EFL_UI_FLIP_ROTATE_YZ_CENTER_AXIS -#define ELM_FLIP_CUBE_LEFT EFL_UI_FLIP_CUBE_LEFT -#define ELM_FLIP_CUBE_RIGHT EFL_UI_FLIP_CUBE_RIGHT -#define ELM_FLIP_CUBE_UP EFL_UI_FLIP_CUBE_UP -#define ELM_FLIP_CUBE_DOWN EFL_UI_FLIP_CUBE_DOWN -#define ELM_FLIP_PAGE_LEFT EFL_UI_FLIP_PAGE_LEFT -#define ELM_FLIP_PAGE_RIGHT EFL_UI_FLIP_PAGE_RIGHT -#define ELM_FLIP_PAGE_UP EFL_UI_FLIP_PAGE_UP -#define ELM_FLIP_PAGE_DOWN EFL_UI_FLIP_PAGE_DOWN -#define ELM_FLIP_CROSS_FADE EFL_UI_FLIP_CROSS_FADE typedef enum { @@ -58,9 +67,9 @@ typedef enum * * @param[in] hitsize The amount of that dimension (0.0 to 1.0) to use. * - * @ingroup Efl_Ui_Flip + * @ingroup Elm_Flip */ -EAPI void elm_flip_interaction_direction_hitsize_set(Efl_Ui_Flip *obj, Elm_Flip_Direction dir, double hitsize); +EAPI void elm_flip_interaction_direction_hitsize_set(Elm_Flip *obj, Elm_Flip_Direction dir, double hitsize); /** * @brief Get the amount of the flip that is sensitive to interactive flip. @@ -69,9 +78,9 @@ EAPI void elm_flip_interaction_direction_hitsize_set(Efl_Ui_Flip *obj, Elm_Flip_ * * @return The size set for that direction. * - * @ingroup Efl_Ui_Flip + * @ingroup Elm_Flip */ -EAPI double elm_flip_interaction_direction_hitsize_get(Efl_Ui_Flip *obj, Elm_Flip_Direction dir); +EAPI double elm_flip_interaction_direction_hitsize_get(Elm_Flip *obj, Elm_Flip_Direction dir); /** * @brief Set which directions of the flip respond to interactive flip @@ -86,9 +95,9 @@ EAPI double elm_flip_interaction_direction_hitsize_get(Efl_Ui_Flip *obj, Elm_Fli * * @param[in] enabled If that direction is enabled or not. * - * @ingroup Efl_Ui_Flip + * @ingroup Elm_Flip */ -EAPI void elm_flip_interaction_direction_enabled_set(Efl_Ui_Flip *obj, Elm_Flip_Direction dir, Eina_Bool enabled); +EAPI void elm_flip_interaction_direction_enabled_set(Elm_Flip *obj, Elm_Flip_Direction dir, Eina_Bool enabled); /** * @brief Get the enabled state of that flip direction. @@ -97,9 +106,9 @@ EAPI void elm_flip_interaction_direction_enabled_set(Efl_Ui_Flip *obj, Elm_Flip_ * * @return If that direction is enabled or not. * - * @ingroup Efl_Ui_Flip + * @ingroup Elm_Flip */ -EAPI Eina_Bool elm_flip_interaction_direction_enabled_get(Efl_Ui_Flip *obj, Elm_Flip_Direction dir); +EAPI Eina_Bool elm_flip_interaction_direction_enabled_get(Elm_Flip *obj, Elm_Flip_Direction dir); /** * @brief Add a new flip to the parent @@ -124,3 +133,4 @@ EAPI Evas_Object *elm_flip_add(Evas_Object *parent); * @ingroup Elm_Flip */ EAPI void elm_flip_perspective_set(Evas_Object *obj, Evas_Coord foc, Evas_Coord x, Evas_Coord y); +#include "efl_ui_flip_eo.legacy.h" diff --git a/src/lib/elementary/efl_ui_flip_legacy_eo.c b/src/lib/elementary/efl_ui_flip_legacy_eo.c new file mode 100644 index 0000000000..ca21a315c5 --- /dev/null +++ b/src/lib/elementary/efl_ui_flip_legacy_eo.c @@ -0,0 +1,35 @@ + +Efl_Object *_efl_ui_flip_legacy_efl_object_constructor(Eo *obj, void *pd); + + +static Eina_Bool +_efl_ui_flip_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_FLIP_LEGACY_EXTRA_OPS +#define EFL_UI_FLIP_LEGACY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _efl_ui_flip_legacy_efl_object_constructor), + EFL_UI_FLIP_LEGACY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_flip_legacy_class_desc = { + EO_VERSION, + "Efl.Ui.Flip_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _efl_ui_flip_legacy_class_initializer, + _efl_ui_flip_legacy_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_flip_legacy_class_get, &_efl_ui_flip_legacy_class_desc, EFL_UI_FLIP_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/efl_ui_flip_legacy_eo.h b/src/lib/elementary/efl_ui_flip_legacy_eo.h new file mode 100644 index 0000000000..8d578ddac5 --- /dev/null +++ b/src/lib/elementary/efl_ui_flip_legacy_eo.h @@ -0,0 +1,26 @@ +#ifndef _EFL_UI_FLIP_LEGACY_EO_H_ +#define _EFL_UI_FLIP_LEGACY_EO_H_ + +#ifndef _EFL_UI_FLIP_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_FLIP_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Flip_Legacy; + +#endif + +#ifndef _EFL_UI_FLIP_LEGACY_EO_TYPES +#define _EFL_UI_FLIP_LEGACY_EO_TYPES + + +#endif +#ifdef EFL_BETA_API_SUPPORT +/** Efl UI flip class + * + * @ingroup Efl_Ui_Flip_Legacy + */ +#define EFL_UI_FLIP_LEGACY_CLASS efl_ui_flip_legacy_class_get() + +EWAPI const Efl_Class *efl_ui_flip_legacy_class_get(void); +#endif /* EFL_BETA_API_SUPPORT */ + +#endif diff --git a/src/lib/elementary/efl_ui_flip_legacy_eo.legacy.h b/src/lib/elementary/efl_ui_flip_legacy_eo.legacy.h new file mode 100644 index 0000000000..7cd1835121 --- /dev/null +++ b/src/lib/elementary/efl_ui_flip_legacy_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_FLIP_LEGACY_EO_LEGACY_H_ +#define _EFL_UI_FLIP_LEGACY_EO_LEGACY_H_ + +#ifndef _EFL_UI_FLIP_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_FLIP_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Flip_Legacy; + +#endif + +#ifndef _EFL_UI_FLIP_LEGACY_EO_TYPES +#define _EFL_UI_FLIP_LEGACY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/efl_ui_flip_part.eo b/src/lib/elementary/efl_ui_flip_part.eo index 84c3b0f1fb..f0b06442fc 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 extends Efl.Ui.Widget_Part implements Efl.Content +class @beta Efl.Ui.Flip_Part extends Efl.Ui.Widget_Part implements 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 8a4b3dfe4c..de38094c62 100644 --- a/src/lib/elementary/efl_ui_focus_composition.c +++ b/src/lib/elementary/efl_ui_focus_composition.c @@ -14,7 +14,7 @@ typedef struct { Eina_List *order, *targets_ordered; Eina_List *register_target, *registered_targets; - Efl_Ui_Focus_Manager *registered, *custom_manager, *old_manager; + Efl_Ui_Focus_Manager *registered, *old_manager; Eina_Bool dirty; Eina_Bool logical; } Efl_Ui_Focus_Composition_Data; @@ -27,10 +27,7 @@ _state_apply(Eo *obj, Efl_Ui_Focus_Composition_Data *pd) //Legacy code compatibility, only update the custom chain of elements if legacy was NOT messing with it. if (elm_widget_is_legacy(obj) && elm_object_focus_custom_chain_get(obj)) return; - if (pd->custom_manager) - manager = pd->custom_manager; - else - manager = pd->registered; + manager = pd->registered; if (manager) { @@ -92,10 +89,11 @@ _state_apply(Eo *obj, Efl_Ui_Focus_Composition_Data *pd) } } static void -_del(void *data, const Efl_Event *ev) +_invalidate(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); + pd->registered_targets = eina_list_remove(pd->registered_targets, ev->object); } EOLIAN static void @@ -107,7 +105,7 @@ _efl_ui_focus_composition_composition_elements_set(Eo *obj, Efl_Ui_Focus_Composi pd->targets_ordered = eina_list_free(pd->targets_ordered); EINA_LIST_FREE(pd->register_target, elem) { - efl_event_callback_del(elem, EFL_EVENT_DEL, _del, obj); + efl_event_callback_del(elem, EFL_EVENT_INVALIDATE, _invalidate, obj); } pd->order = eina_list_free(pd->order); @@ -125,7 +123,7 @@ _efl_ui_focus_composition_composition_elements_set(Eo *obj, Efl_Ui_Focus_Composi if (efl_isa(elem, EFL_UI_FOCUS_OBJECT_MIXIN)) { pd->register_target = eina_list_append(pd->register_target , o); - efl_event_callback_add(o, EFL_EVENT_DEL, _del, obj); + efl_event_callback_add(o, EFL_EVENT_INVALIDATE, _invalidate, obj); } else { @@ -166,7 +164,12 @@ _efl_ui_focus_composition_efl_ui_widget_focus_state_apply(Eo *obj, Efl_Ui_Focus_ registered = efl_ui_widget_focus_state_apply(efl_super(obj, MY_CLASS), current_state, configured_state, redirect); if (registered) - pd->registered = configured_state->manager; + { + if (efl_isa(obj, EFL_UI_FOCUS_MANAGER_INTERFACE)) + pd->registered = obj; + else + pd->registered = configured_state->manager; + } else pd->registered = NULL; @@ -182,7 +185,7 @@ _efl_ui_focus_composition_dirty(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Da } EOLIAN static void -_efl_ui_focus_composition_efl_ui_focus_object_prepare_logical_none_recursive(Eo *obj, Efl_Ui_Focus_Composition_Data *pd EINA_UNUSED) +_efl_ui_focus_composition_efl_ui_focus_object_setup_order_non_recursive(Eo *obj, Efl_Ui_Focus_Composition_Data *pd EINA_UNUSED) { if (pd->dirty) { @@ -190,19 +193,7 @@ _efl_ui_focus_composition_efl_ui_focus_object_prepare_logical_none_recursive(Eo pd->dirty = EINA_FALSE; } - efl_ui_focus_object_prepare_logical_none_recursive(efl_super(obj, MY_CLASS)); -} - -EOLIAN static void -_efl_ui_focus_composition_custom_manager_set(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Data *pd, Efl_Ui_Focus_Manager *custom_manager) -{ - pd->custom_manager = custom_manager; -} - -EOLIAN static Efl_Ui_Focus_Manager* -_efl_ui_focus_composition_custom_manager_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Data *pd) -{ - return pd->custom_manager; + efl_ui_focus_object_setup_order_non_recursive(efl_super(obj, MY_CLASS)); } EOLIAN static void @@ -241,14 +232,15 @@ _canvas_object_deleted(void *data, const Efl_Event *ev EINA_UNUSED) } static void -_new_geom(void *data, const Efl_Event *event) +_new_geom(void *data, const Efl_Event *event EINA_UNUSED) { - efl_event_callback_call(data, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_GEOMETRY_CHANGED, event->info); + Eina_Rect rect = efl_ui_focus_object_focus_geometry_get(data); + efl_event_callback_call(data, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_GEOMETRY_CHANGED, &rect); } EFL_CALLBACKS_ARRAY_DEFINE(canvas_obj, - {EFL_GFX_ENTITY_EVENT_RESIZE, _new_geom}, - {EFL_GFX_ENTITY_EVENT_MOVE, _new_geom}, + {EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _new_geom}, + {EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _new_geom}, {EFL_EVENT_DEL, _canvas_object_deleted}, ); diff --git a/src/lib/elementary/efl_ui_focus_composition.eo b/src/lib/elementary/efl_ui_focus_composition.eo index 120867e53a..c52bf8cadf 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 requires Efl.Ui.Widget { +mixin @beta Efl.Ui.Focus.Composition requires 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. @@ -29,15 +29,6 @@ mixin Efl.Ui.Focus.Composition requires Efl.Ui.Widget { You can use this function to call composition_elements. ]] } - @property custom_manager @protected { - [[Register all children in this manager - - Set to $null to register them in the same manager as the implementor is - ]] - values { - custom_manager : Efl.Ui.Focus.Manager; [[EFL focus manager]] - } - } @property logical_mode @protected { [[Set to true if all children should be registered as logicals]] values { @@ -48,7 +39,7 @@ mixin Efl.Ui.Focus.Composition requires Efl.Ui.Widget { implements { Efl.Object.invalidate; Efl.Ui.Widget.focus_state_apply; - Efl.Ui.Focus.Object.prepare_logical_none_recursive; + Efl.Ui.Focus.Object.setup_order_non_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 bb4e81c222..118f4a3a2a 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 extends Efl.Object implements Efl.Ui.Focus.Object +class @beta Efl.Ui.Focus.Composition_Adapter extends Efl.Object implements Efl.Ui.Focus.Object { [[EFL UI Focus Composition Adapter class]] methods { diff --git a/src/lib/elementary/efl_ui_focus_layer.c b/src/lib/elementary/efl_ui_focus_layer.c index 1069956881..6c6c8218c1 100644 --- a/src/lib/elementary/efl_ui_focus_layer.c +++ b/src/lib/elementary/efl_ui_focus_layer.c @@ -97,8 +97,8 @@ _efl_ui_focus_layer_efl_object_constructor(Eo *obj, Efl_Ui_Focus_Layer_Data *pd) 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); + efl_event_callback_call(obj, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_MANAGER_CHANGED, omanager); + efl_event_callback_call(obj, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_PARENT_CHANGED, oobj); } EOLIAN static void @@ -112,7 +112,7 @@ _efl_ui_focus_layer_enable_set(Eo *obj, Efl_Ui_Focus_Layer_Data *pd, Eina_Bool v 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); + manager = efl_ui_focus_util_active_manager(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); diff --git a/src/lib/elementary/efl_ui_focus_layer.eo b/src/lib/elementary/efl_ui_focus_layer.eo index 92145ae29c..fd177caf62 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 requires Efl.Ui.Widget extends Efl.Ui.Widget_Focus_Manager { +mixin @beta Efl.Ui.Focus.Layer requires Efl.Ui.Widget extends 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. diff --git a/src/lib/elementary/efl_ui_focus_manager.c b/src/lib/elementary/efl_ui_focus_manager.c index 2cb14a6790..31afb9dc98 100644 --- a/src/lib/elementary/efl_ui_focus_manager.c +++ b/src/lib/elementary/efl_ui_focus_manager.c @@ -5,5 +5,15 @@ #include #include "elm_priv.h" +EAPI void +efl_ui_focus_relation_free(Efl_Ui_Focus_Relations *rel) +{ + eina_list_free(rel->right); + eina_list_free(rel->left); + eina_list_free(rel->top); + eina_list_free(rel->down); + free(rel); +} + #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 35614712b7..7d1a510642 100644 --- a/src/lib/elementary/efl_ui_focus_manager.eo +++ b/src/lib/elementary/efl_ui_focus_manager.eo @@ -1,16 +1,14 @@ import efl_ui; import eina_types; -struct Efl.Ui.Focus.Relations { - [[Structure holding the graph of relations between focussable objects. - - @since 1.20 +struct @beta @free(efl_ui_focus_relation_free) Efl.Ui.Focus.Relations { + [[Structure holding the graph of relations between focusable objects. ]] - right : list; [[List of objects on the right side]] - left : list; [[[List of objects on the left side]] - top : list; [[[List of objects above]] - down : list; [[[List of objects below]] - next : Efl.Ui.Focus.Object; [[[Next object]] + right : list @owned; [[List of objects on the right side]] + left : list @owned; [[List of objects on the left side]] + top : list @owned; [[List of objects above]] + down : list @owned; [[List of objects below]] + next : Efl.Ui.Focus.Object; [[Next object]] prev : Efl.Ui.Focus.Object; [[Previous object]] parent : Efl.Ui.Focus.Object; [[Parent object]] redirect : Efl.Ui.Focus.Manager; [[Redirect manager]] @@ -22,54 +20,60 @@ struct Efl.Ui.Focus.Relations { struct Efl.Ui.Focus.Manager_Logical_End_Detail { [[Structure holding the focus object with extra information on logical end - @since 1.21 + @since 1.22 ]] - is_regular_end : bool; [[$true if logical end, $false otherwise]] - element : Efl.Ui.Focus.Object; [[Focus object element]] + is_regular_end : bool; [[$true if element is registered as regular element in the @Efl.Ui.Focus.Manager obejct, $false otherwise]] + element : Efl.Ui.Focus.Object; [[The last element of the logical chain in the @Efl.Ui.Focus.Manager]] } interface Efl.Ui.Focus.Manager { - [[Calculates the directions of Efl.Ui.Focus.Direction + [[Interface for managing focus objects - Each registered item will get a other registered object into each - direction, you can get those items for the currently focused item if - you call request move. + This interface is built in order to support movement of the focus property in a set of widgets. + The movement of the focus property can happen in a tree manner, or a graph manner. + The movement is also keeping track of the history of focused elements. + The tree interpretation differentiates between logical and non-logical widgets, + a logical widget cannot receive focus whereas a non-logical one can. - @since 1.20 + @since 1.22 ]] methods { move { - [[Move the focus into the given direction. + [[Move the focus in the given direction. This call flushes all changes. - This means all changes between the last flush and now are computed + This means all changes between the last flush and now are computed. ]] params { - direction : Efl.Ui.Focus.Direction; [[The direction to move to]] + direction : Efl.Ui.Focus.Direction; [[The direction to move to.]] } - return : Efl.Ui.Focus.Object; [[The element which is now focused]] + return : Efl.Ui.Focus.Object; [[The element which is now focused.]] } request_move { - [[Return the object next in the $direction from $child.]] + [[Return the object 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.]] + direction : Efl.Ui.Focus.Direction; [[Direction to move focus.]] + child : Efl.Ui.Focus.Object; [[The child to move from. Pass $null to indicate the currently focused child.]] + logical : bool; [[Wether you want to have a logical node as result or a non-logical. + Note, in a @.move call no logical node will get focus.]] } - return : Efl.Ui.Focus.Object; [[Next object to focus]] + return : Efl.Ui.Focus.Object; [[Object that would receive focus if moved in the given direction.]] } @property manager_focus { [[The element which is currently focused by this manager - For the case focus is a logical child, then the item will go to the next none logical element. If there is none, focus will stay where it is right now. + Use this property to retrieve the object currently being focused, or to set the focus + to a new one. + When $focus is a logical child (which cannot receive focus), the next non-logical + object is selected instead. If there is no such object, focus does not change. ]] values { - focus : Efl.Ui.Focus.Object @nonull; [[Focused element]] + focus : Efl.Ui.Focus.Object @nonull; [[Currently focused element.]] } } @property redirect { - [[Add a another manager to serve the move requests. + [[Add another manager to serve the move requests. If this value is set, all move requests are redirected to this manager object. Set it to $null once nothing should be redirected @@ -92,17 +96,17 @@ interface Efl.Ui.Focus.Manager { } } @property viewport_elements { - [[The list of elements which are at the border of the viewport. + [[Get all elements that are at the border of the viewport - This means one of the relations right,left or down,up are not set. - This call flushes all changes. See @Efl.Ui.Focus.Manager.move + Every element returned by this is located inside the viewport rectangle, + but has a right, left, down or up neighbor outside the viewport. ]] get {} keys { - viewport : Eina.Rect; + viewport : Eina.Rect; [[The rectangle defining the viewport.]] } values { - viewport_elements : iterator; + viewport_elements : iterator; [[The list of border objects.]] } } @property root { @@ -114,9 +118,7 @@ interface Efl.Ui.Focus.Manager { return : bool; [[If $true, this is the root node]] } - get { - - } + get {} values { root : Efl.Ui.Focus.Object @nonull; [[Will be registered into @@ -124,21 +126,21 @@ interface Efl.Ui.Focus.Manager { } } request_subchild { - [[Returns a widget that can receive focus + [[Return the widget in the direction next. - The returned widget is in a child of the passed param. - Its garanteed that child will not be prepared once again, - so you can call this function out of a prepare call. + The returned widget is a child of $root. + It's guaranteed that child will not be prepared once again, + so you can call this function inside a @Efl.Ui.Focus.Object.setup_order call. ]] params { - child : Efl.Ui.Focus.Object; [[Parent for returned child]] + root : Efl.Ui.Focus.Object; [[Parent for returned child.]] } - return : Efl.Ui.Focus.Object; [[Child of passed parameter]] + return : Efl.Ui.Focus.Object; [[Child of passed parameter.]] } - fetch { + fetch @beta { [[This will fetch the data from a registered node. - Be aware this function will trigger all dirty nodes to be computed + Be aware this function will trigger a computation of all dirty nodes. ]] params { child : Efl.Ui.Focus.Object; [[The child object to inspect.]] @@ -151,49 +153,58 @@ 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. - This means the most upper element will be unfocused, all other elements will be removed from the remembered before. + This means the uppermost element will be unfocused, and all other elements + will be removed from the remembered list. - To not break the assertion that there should be always a focused element, you should focus a other element immidiatly after calling that. + You should focus another element immediately after calling this, in order + to always have a focused object. ]] } pop_history_stack { - [[Removes the most upper history element, and move focus on. + [[Remove the uppermost history element, and focus the previous one. - If there is a element that was focused before, it will be taken. Otherwise, the best fitting element from the registered elements will be focused. + If there is an element that was focused before, it will be used. + Otherwise, the best fitting element from the registered elements will be focused. ]] } setup_on_first_touch { - [[Called when this manager is set as redirect]] + [[Called when this manager is set as redirect. + + In case that this is called as an result of a move call, $direction and $entry + will be set to the direction of the move call, and the $entry object will be + set to the object that had this manager as redirect property. + ]] params { - direction : Efl.Ui.Focus.Direction; [[The direction in which this should be setup]] - entry : Efl.Ui.Focus.Object; [[The object that caused this manager to be redirect]] + direction : Efl.Ui.Focus.Direction; [[The direction in which this should be setup.]] + entry : Efl.Ui.Focus.Object; [[The object that caused this manager to be redirect.]] } } dirty_logic_freeze { - [[This disables the cache invalidation when a object is moved. + [[This disables the cache invalidation when an object is moved. - Even the object is moved, the focus manager will not recalculate its relations, this can be used when you know that the set of widgets in the focus manager is equally moved. so the relations between the widets in the set do not change. + Even if an object is moved, the focus manager will not recalculate its relations. + This can be used when you know that the set of widgets in the focus manager is + moved the same way, so the relations between the widets in the set do not change + and the complex calculations can be avoided. + Use @.dirty_logic_unfreeze to re-enable relationship calculation. ]] } dirty_logic_unfreeze { - [[This enables the cache invalidation when a object is moved. + [[This enables the cache invalidation when an object is moved. - This is the counter part to @.dirty_logic_freeze + This is the counterpart to @.dirty_logic_freeze. ]] } } events { - redirect,changed : Efl.Ui.Focus.Manager; [[Emitted when the redirect - object has changed, the old manager is passed as event info]] - 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]] - focus,changed : Efl.Ui.Focus.Object; [[Emitted if the manager has focused an - object, the passed focus object is the last focused object]] - dirty_logic_freeze,changed : bool; [[Called when this focus manager is frozen or unfrozen, even_info beeing $true indicates that it is now frozen, $false indicates that it is unfrozen.]] + redirect,changed : Efl.Ui.Focus.Manager; [[Redirect object has changed, the old manager is passed as an event argument.]] + flush,pre: void; [[After this event, the manager object will calculate relations in the graph. Can be used to add / remove children in a lazy fashion.]] + coords,dirty: void; [[Cached relationship calculation results have been invalidated.]] + manager_focus,changed : Efl.Ui.Focus.Object; [[The manager_focus property has changed. The previously focused object is passed as an event argument.]] + dirty_logic_freeze,changed : bool; [[Called when this focus manager is frozen or thawed, even_info being $true indicates that it is now frozen, $false indicates that it is thawed.]] } } diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c index b2b8356cf4..3ccb48e8a6 100644 --- a/src/lib/elementary/efl_ui_focus_manager_calc.c +++ b/src/lib/elementary/efl_ui_focus_manager_calc.c @@ -157,7 +157,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, efl_ui_focus_util_direction_complement(EFL_UI_FOCUS_UTIL_CLASS,direction)); + Border *b = &DIRECTION_ACCESS(partner, efl_ui_focus_util_direction_complement(direction)); b->cleanup_nodes = eina_list_remove(b->cleanup_nodes, node); } @@ -165,7 +165,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,efl_ui_focus_util_direction_complement(EFL_UI_FOCUS_UTIL_CLASS,direction)); + Border *comp_border = &DIRECTION_ACCESS(partner,efl_ui_focus_util_direction_complement(direction)); comp_border->cleanup_nodes = eina_list_append(comp_border->cleanup_nodes, node); } @@ -183,7 +183,7 @@ border_onedirection_cleanup(Node *node, Efl_Ui_Focus_Direction direction) EINA_LIST_FREE(border->cleanup_nodes, partner) { - Border *b = &DIRECTION_ACCESS(partner, efl_ui_focus_util_direction_complement(EFL_UI_FOCUS_UTIL_CLASS,direction)); + Border *b = &DIRECTION_ACCESS(partner, efl_ui_focus_util_direction_complement(direction)); b->one_direction = eina_list_remove(b->one_direction, node); } } @@ -1047,7 +1047,7 @@ _prepare_node(Node *root) Eina_List *n; Node *node; - efl_ui_focus_object_prepare_logical(root->focusable); + efl_ui_focus_object_setup_order(root->focusable); EINA_LIST_FOREACH(root->tree.children, n, node) { @@ -1193,7 +1193,7 @@ _prev_item(Node *node) parent = T(node).parent; //we are accessing the parents children, prepare! - efl_ui_focus_object_prepare_logical(parent->focusable); + efl_ui_focus_object_setup_order(parent->focusable); lnode = eina_list_data_find_list(T(parent).children, node); lnode = eina_list_prev(lnode); @@ -1232,7 +1232,7 @@ _next(Node *node) parent = T(n).parent; //we are accessing the parents children, prepare! - efl_ui_focus_object_prepare_logical(parent->focusable); + efl_ui_focus_object_setup_order(parent->focusable); lnode = eina_list_data_find_list(T(parent).children, n); lnode = eina_list_next(lnode); @@ -1262,7 +1262,7 @@ _prev(Node *node) //we are accessing prev items children, prepare them! if (n && n->focusable) - efl_ui_focus_object_prepare_logical(n->focusable); + efl_ui_focus_object_setup_order(n->focusable); //case 1 there is a item in the parent previous to node, which has children if (n && T(n).children && !n->redirect_manager) @@ -1323,7 +1323,7 @@ _logical_movement(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd EINA_UNUSED, Node tmp = eina_list_clone(T(result).saved_order); efl_ui_focus_manager_calc_update_order(obj, result->focusable, tmp); } - efl_ui_focus_object_prepare_logical(result->focusable); + efl_ui_focus_object_setup_order(result->focusable); } result = deliver(result); @@ -1413,7 +1413,7 @@ _request_subchild(Node *node) do { if (target != node) - efl_ui_focus_object_prepare_logical(target->focusable); + efl_ui_focus_object_setup_order(target->focusable); target = _next(target); //abort if we are exceeding the childrens of node @@ -1466,7 +1466,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_manager_focus_set(Eo *obj, Efl_U F_DBG(" %p is logical, fetching the next subnode that is either a redirect or a regular", obj); //important! if there are no children _next would return the parent of node which will exceed the limit of children of node - efl_ui_focus_object_prepare_logical(node->focusable); + efl_ui_focus_object_setup_order(node->focusable); target = _request_subchild(node); @@ -1489,7 +1489,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_manager_focus_set(Eo *obj, Efl_U { //the correct one is focused if (node->redirect_manager == pd->redirect) - return; + goto end; } //make sure this manager is in the chain of redirects @@ -1553,7 +1553,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_manager_focus_set(Eo *obj, Efl_U 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_FOCUS_CHANGED, last_focusable); + efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, last_focusable); } _current_focused_parent_to_array(obj, pd, chain); @@ -1566,11 +1566,18 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_manager_focus_set(Eo *obj, Efl_U } while (eina_array_count(chain) > 1) - efl_event_callback_call(eina_array_pop(chain), EFL_UI_FOCUS_OBJECT_EVENT_CHILD_FOCUS_CHANGED , (void*)EINA_TRUE); + { + Eina_Bool child_focus_changed = EINA_TRUE; + efl_event_callback_call(eina_array_pop(chain), EFL_UI_FOCUS_OBJECT_EVENT_CHILD_FOCUS_CHANGED , &child_focus_changed); + } while (eina_array_count(old_chain) > 1) - efl_event_callback_call(eina_array_pop(old_chain), EFL_UI_FOCUS_OBJECT_EVENT_CHILD_FOCUS_CHANGED, (void*)EINA_FALSE); + { + Eina_Bool child_focus_changed = EINA_FALSE; + efl_event_callback_call(eina_array_pop(old_chain), EFL_UI_FOCUS_OBJECT_EVENT_CHILD_FOCUS_CHANGED, &child_focus_changed); + } +end: eina_array_free(old_chain); eina_array_free(chain); } @@ -1796,10 +1803,10 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_fetch(Eo *obj, Efl_Ui_Focus_Mana dirty_flush(obj, pd, n); - //make sure to prepare_logical so next and prev are correctly + //make sure to setup_order so next and prev are correctly if (n->tree.parent) - efl_ui_focus_object_prepare_logical(n->tree.parent->focusable); - efl_ui_focus_object_prepare_logical(n->focusable); + efl_ui_focus_object_setup_order(n->tree.parent->focusable); + efl_ui_focus_object_setup_order(n->focusable); #define DIR_CLONE(dir) _convert(DIRECTION_ACCESS(n,dir)); @@ -1868,7 +1875,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_reset_history(Eo *obj EINA_UNUSE pd->focus_stack = eina_list_free(pd->focus_stack); - efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED, last_focusable); + efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, last_focusable); } EOLIAN static void @@ -1909,7 +1916,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_pop_history_stack(Eo *obj EINA_U efl_ui_focus_manager_focus_set(obj, last->focusable); } - efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED, last_focusable); + efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, last_focusable); } EOLIAN static Efl_Ui_Focus_Object* @@ -1949,19 +1956,24 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_dirty_logic_freeze(Eo *obj, Efl_ { pd->freeze ++; if (pd->freeze == 1) - efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_DIRTY_LOGIC_FREEZE_CHANGED, (void*)EINA_TRUE); -} + { + Eina_Bool event_info = EINA_TRUE; + efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_DIRTY_LOGIC_FREEZE_CHANGED, &event_info); + } +} EOLIAN static void _efl_ui_focus_manager_calc_efl_ui_focus_manager_dirty_logic_unfreeze(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd) { pd->freeze --; if (!pd->freeze) - efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_DIRTY_LOGIC_FREEZE_CHANGED, (void*)EINA_FALSE); + { + Eina_Bool event_info = EINA_FALSE; + efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_DIRTY_LOGIC_FREEZE_CHANGED, &event_info); + } } - #define EFL_UI_FOCUS_MANAGER_CALC_EXTRA_OPS \ EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_ui_focus_manager_calc_efl_object_dbg_info_get) diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.eo b/src/lib/elementary/efl_ui_focus_manager_calc.eo index 19212c7c87..7f1974139b 100644 --- a/src/lib/elementary/efl_ui_focus_manager_calc.eo +++ b/src/lib/elementary/efl_ui_focus_manager_calc.eo @@ -1,11 +1,9 @@ -class Efl.Ui.Focus.Manager_Calc extends Efl.Object implements Efl.Ui.Focus.Manager { +class @beta Efl.Ui.Focus.Manager_Calc extends Efl.Object implements Efl.Ui.Focus.Manager { [[Calculates the directions of Efl.Ui.Focus.Direction Each registered item will get an other registered object in each direction. You can get items for the currently focused item if you call request move. - - @since 1.20 ]] methods { register { 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 14f0f3a43a..64b4d83695 100644 --- a/src/lib/elementary/efl_ui_focus_manager_root_focus.eo +++ b/src/lib/elementary/efl_ui_focus_manager_root_focus.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Focus.Manager_Root_Focus extends Efl.Ui.Focus.Manager_Calc { +class @beta Efl.Ui.Focus.Manager_Root_Focus extends Efl.Ui.Focus.Manager_Calc { [[ This class ensures that the root is at least focusable, if nothing else is focusable]] methods { @property canvas_object { diff --git a/src/lib/elementary/efl_ui_focus_manager_sub.c b/src/lib/elementary/efl_ui_focus_manager_sub.c index eb05f971b0..4fb2733610 100644 --- a/src/lib/elementary/efl_ui_focus_manager_sub.c +++ b/src/lib/elementary/efl_ui_focus_manager_sub.c @@ -122,7 +122,8 @@ _redirect_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED) static void _freeze_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED) { - if (ev->info) + Eina_Bool *val = ev->info; + if (*val) { efl_ui_focus_manager_dirty_logic_freeze(data); } @@ -203,8 +204,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_OBJECT_EVENT_LOGICAL_CHANGED, _logical_manager_change}, - {EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, _manager_change} + {EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_PARENT_CHANGED, _logical_manager_change}, + {EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_MANAGER_CHANGED, _manager_change} ); EOLIAN static Efl_Object* diff --git a/src/lib/elementary/efl_ui_focus_manager_sub.eo b/src/lib/elementary/efl_ui_focus_manager_sub.eo index a2414d43eb..9394080396 100644 --- a/src/lib/elementary/efl_ui_focus_manager_sub.eo +++ b/src/lib/elementary/efl_ui_focus_manager_sub.eo @@ -1,4 +1,4 @@ -mixin Efl.Ui.Focus.Manager_Sub requires Efl.Object extends Efl.Ui.Focus.Manager +mixin @beta Efl.Ui.Focus.Manager_Sub requires Efl.Object extends Efl.Ui.Focus.Manager { [[A class that automatically registers its border elements in the parent manager @@ -12,8 +12,6 @@ mixin Efl.Ui.Focus.Manager_Sub requires Efl.Object extends Efl.Ui.Focus.Manager You can filter the border elements by overriding the property @Efl.Ui.Focus.Manager.border_elements. - - @since 1.20 ]] implements { Efl.Object.constructor; diff --git a/src/lib/elementary/efl_ui_focus_manager_window_root.eo b/src/lib/elementary/efl_ui_focus_manager_window_root.eo index 201e3bffc1..f56e6ccf58 100644 --- a/src/lib/elementary/efl_ui_focus_manager_window_root.eo +++ b/src/lib/elementary/efl_ui_focus_manager_window_root.eo @@ -3,5 +3,7 @@ interface Efl.Ui.Focus.Manager_Window_Root { 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. + + @since 1.22 ]] } diff --git a/src/lib/elementary/efl_ui_focus_object.c b/src/lib/elementary/efl_ui_focus_object.c index 37c65a0544..92f857897d 100644 --- a/src/lib/elementary/efl_ui_focus_object.c +++ b/src/lib/elementary/efl_ui_focus_object.c @@ -24,7 +24,7 @@ _efl_ui_focus_object_focus_set(Eo *obj, Efl_Ui_Focus_Object_Data *pd, Eina_Bool parent = efl_ui_focus_object_focus_parent_get(obj); if (parent) efl_ui_focus_object_child_focus_set(parent, focus); - efl_event_callback_call(obj, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED , (void*) (uintptr_t) focus); + efl_event_callback_call(obj, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED , &focus); } EOLIAN static Eina_Bool @@ -34,13 +34,13 @@ _efl_ui_focus_object_focus_get(const Eo *obj EINA_UNUSED, Efl_Ui_Focus_Object_Da } EOLIAN static void -_efl_ui_focus_object_prepare_logical(Eo *obj, Efl_Ui_Focus_Object_Data *pd) +_efl_ui_focus_object_setup_order(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); + efl_ui_focus_object_setup_order_non_recursive(obj); pd->ongoing_prepare_call = EINA_FALSE; } diff --git a/src/lib/elementary/efl_ui_focus_object.eo b/src/lib/elementary/efl_ui_focus_object.eo index 0058be0d11..3210db0e15 100644 --- a/src/lib/elementary/efl_ui_focus_object.eo +++ b/src/lib/elementary/efl_ui_focus_object.eo @@ -4,14 +4,13 @@ mixin Efl.Ui.Focus.Object { [[Functions of focusable objects. - @since 1.20 + @since 1.22 ]] methods { @property focus_geometry { - [[The geometry used to calculate relationships between other objects.]] - get { - - } + [[The geometry (that is, the bounding rectangle) used to calculate the + relationship with other objects.]] + get {} values { rect : Eina.Rect; [[The geometry to use.]] } @@ -24,23 +23,17 @@ mixin Efl.Ui.Focus.Object [[This is called by the manager and should never be called by anyone else. - It can be used by configuring a focus object to adapt to - any changes that are required. - The function emits the focus state events, if focus is different to the previous state. ]] - } values { - focus : bool; [[The focused state of the object]] + focus : bool; [[The focused state of the object.]] } } @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. + [[This is the focus manager where this focus object is registered in. + The element which is the $root of a Efl.Ui.Focus.Manager will not have this focus manager as this object, but rather the second focus manager where it is registered in. ]] get {} values { @@ -55,39 +48,39 @@ mixin Efl.Ui.Focus.Object } } @property child_focus @protected { - [[set if a child of this element has focus or not.]] + [[Indicates if a child of this object has focus set to true.]] values { - child_focus : bool; + child_focus : bool; [[$true if a child has focus.]] } } - 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 undefined behaviour and may cause your system to crash. + setup_order { + [[Tells the object that its children will be queried soon by the focus manager. + Overwrite this to update the order of the children. Deleting items in this call will + result in undefined behaviour and may cause your system to crash. ]] } - prepare_logical_none_recursive @protected { - [[]] + setup_order_non_recursive @protected { + [[This is called when @.setup_order is called, but only on the first call, additional recursive calls to @.setup_order will not call this function again.]] } - on_focus_update @protected @pure_virtual { + on_focus_update @protected { [[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_none_recursive; + @empty .setup_order_non_recursive; @empty .focus_manager; @empty .focus_parent; + @empty .on_focus_update; } events { - focus,changed : bool; [[Emitted if the focus state has changed]] - manager,changed: Efl.Ui.Focus.Manager; [[Emitted when a new manager is + focus,changed : bool; [[Emitted if the focus state has changed.]] + focus_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 + focus_parent,changed: Efl.Ui.Focus.Object; [[Emitted when a new logical parent should be used.]] - child_focus,changed: bool; [[Emitted if child_focus has changed]] - focus_geometry,changed: void; [[Emitted if focus geometry of this object has changed]] + child_focus,changed: bool; [[Emitted if child_focus has changed.]] + focus_geometry,changed: Eina.Rect; [[Emitted if focus geometry of this object has changed.]] } } diff --git a/src/lib/elementary/efl_ui_focus_parent_provider.eo b/src/lib/elementary/efl_ui_focus_parent_provider.eo index 04fa38ae31..7e33027da5 100644 --- a/src/lib/elementary/efl_ui_focus_parent_provider.eo +++ b/src/lib/elementary/efl_ui_focus_parent_provider.eo @@ -1,4 +1,4 @@ -interface Efl.Ui.Focus.Parent_Provider { +interface @beta Efl.Ui.Focus.Parent_Provider { [[EFL UI Focus Parent Provider interface]] methods { find_logical_parent { 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 34ac71aedc..1ad1ab2ae1 100644 --- a/src/lib/elementary/efl_ui_focus_parent_provider_gen.c +++ b/src/lib/elementary/efl_ui_focus_parent_provider_gen.c @@ -4,7 +4,7 @@ #include #include "elm_priv.h" -#include "efl_ui_focus_parent_provider_gen.eo.h" +#include "efl_ui_focus_parent_provider_gen_eo.h" #include "efl_ui_focus_composition_adapter.eo.h" typedef struct { @@ -67,7 +67,7 @@ _efl_ui_focus_parent_provider_gen_efl_ui_focus_parent_provider_find_logical_pare if (parent == pd->container) { item = eina_hash_find(pd->map, &above_gengrid); - efl_ui_focus_object_prepare_logical(pd->container); + efl_ui_focus_object_setup_order(pd->container); if (item) return item; @@ -91,7 +91,7 @@ _efl_ui_focus_parent_provider_gen_item_fetch(Eo *obj EINA_UNUSED, Efl_Ui_Focus_P if (efl_isa(item, ELM_WIDGET_ITEM_CLASS)) { - efl_ui_focus_object_prepare_logical(pd->container); + efl_ui_focus_object_setup_order(pd->container); return item; } else @@ -114,9 +114,9 @@ _efl_ui_focus_parent_provider_gen_item_fetch(Eo *obj EINA_UNUSED, Efl_Ui_Focus_P } item = eina_hash_find(pd->map, &above_gengrid); - efl_ui_focus_object_prepare_logical(pd->container); + efl_ui_focus_object_setup_order(pd->container); return item; } -#include "efl_ui_focus_parent_provider_gen.eo.c" +#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 deleted file mode 100644 index 3bb66972d2..0000000000 --- a/src/lib/elementary/efl_ui_focus_parent_provider_gen.eo +++ /dev/null @@ -1,27 +0,0 @@ -class Efl.Ui.Focus.Parent_Provider_Gen extends Efl.Object implements Efl.Ui.Focus.Parent_Provider { - [[EFL UI Focus Parent Provider Gen class]] - methods { - @property content_item_map { - [[Content item map property]] - values { - map : hash; [[Item map]] - } - } - @property container { - [[Container property]] - values { - 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_gen_eo.c b/src/lib/elementary/efl_ui_focus_parent_provider_gen_eo.c new file mode 100644 index 0000000000..5f5a73d9ff --- /dev/null +++ b/src/lib/elementary/efl_ui_focus_parent_provider_gen_eo.c @@ -0,0 +1,60 @@ + +void _efl_ui_focus_parent_provider_gen_content_item_map_set(Eo *obj, Efl_Ui_Focus_Parent_Provider_Gen_Data *pd, Eina_Hash *map); + +EOAPI EFL_VOID_FUNC_BODYV(efl_ui_focus_parent_provider_gen_content_item_map_set, EFL_FUNC_CALL(map), Eina_Hash *map); + +Eina_Hash *_efl_ui_focus_parent_provider_gen_content_item_map_get(const Eo *obj, Efl_Ui_Focus_Parent_Provider_Gen_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(efl_ui_focus_parent_provider_gen_content_item_map_get, Eina_Hash *, NULL); + +void _efl_ui_focus_parent_provider_gen_container_set(Eo *obj, Efl_Ui_Focus_Parent_Provider_Gen_Data *pd, Efl_Ui_Widget *container); + +EOAPI EFL_VOID_FUNC_BODYV(efl_ui_focus_parent_provider_gen_container_set, EFL_FUNC_CALL(container), Efl_Ui_Widget *container); + +Efl_Ui_Widget *_efl_ui_focus_parent_provider_gen_container_get(const Eo *obj, Efl_Ui_Focus_Parent_Provider_Gen_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(efl_ui_focus_parent_provider_gen_container_get, Efl_Ui_Widget *, NULL); + +Efl_Ui_Widget *_efl_ui_focus_parent_provider_gen_item_fetch(Eo *obj, Efl_Ui_Focus_Parent_Provider_Gen_Data *pd, Efl_Ui_Widget *widget); + +EOAPI EFL_FUNC_BODYV(efl_ui_focus_parent_provider_gen_item_fetch, Efl_Ui_Widget *, NULL, EFL_FUNC_CALL(widget), Efl_Ui_Widget *widget); + +Efl_Ui_Focus_Object *_efl_ui_focus_parent_provider_gen_efl_ui_focus_parent_provider_find_logical_parent(Eo *obj, Efl_Ui_Focus_Parent_Provider_Gen_Data *pd, Efl_Ui_Focus_Object *widget); + + +static Eina_Bool +_efl_ui_focus_parent_provider_gen_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_FOCUS_PARENT_PROVIDER_GEN_EXTRA_OPS +#define EFL_UI_FOCUS_PARENT_PROVIDER_GEN_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_ui_focus_parent_provider_gen_content_item_map_set, _efl_ui_focus_parent_provider_gen_content_item_map_set), + EFL_OBJECT_OP_FUNC(efl_ui_focus_parent_provider_gen_content_item_map_get, _efl_ui_focus_parent_provider_gen_content_item_map_get), + EFL_OBJECT_OP_FUNC(efl_ui_focus_parent_provider_gen_container_set, _efl_ui_focus_parent_provider_gen_container_set), + EFL_OBJECT_OP_FUNC(efl_ui_focus_parent_provider_gen_container_get, _efl_ui_focus_parent_provider_gen_container_get), + EFL_OBJECT_OP_FUNC(efl_ui_focus_parent_provider_gen_item_fetch, _efl_ui_focus_parent_provider_gen_item_fetch), + EFL_OBJECT_OP_FUNC(efl_ui_focus_parent_provider_find_logical_parent, _efl_ui_focus_parent_provider_gen_efl_ui_focus_parent_provider_find_logical_parent), + EFL_UI_FOCUS_PARENT_PROVIDER_GEN_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_focus_parent_provider_gen_class_desc = { + EO_VERSION, + "Efl.Ui.Focus.Parent_Provider_Gen", + EFL_CLASS_TYPE_REGULAR, + sizeof(Efl_Ui_Focus_Parent_Provider_Gen_Data), + _efl_ui_focus_parent_provider_gen_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_focus_parent_provider_gen_class_get, &_efl_ui_focus_parent_provider_gen_class_desc, EFL_OBJECT_CLASS, EFL_UI_FOCUS_PARENT_PROVIDER_INTERFACE, NULL); diff --git a/src/lib/elementary/efl_ui_focus_parent_provider_gen_eo.h b/src/lib/elementary/efl_ui_focus_parent_provider_gen_eo.h new file mode 100644 index 0000000000..1200debba4 --- /dev/null +++ b/src/lib/elementary/efl_ui_focus_parent_provider_gen_eo.h @@ -0,0 +1,78 @@ +#ifndef _EFL_UI_FOCUS_PARENT_PROVIDER_GEN_EO_H_ +#define _EFL_UI_FOCUS_PARENT_PROVIDER_GEN_EO_H_ + +#ifndef _EFL_UI_FOCUS_PARENT_PROVIDER_GEN_EO_CLASS_TYPE +#define _EFL_UI_FOCUS_PARENT_PROVIDER_GEN_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Focus_Parent_Provider_Gen; + +#endif + +#ifndef _EFL_UI_FOCUS_PARENT_PROVIDER_GEN_EO_TYPES +#define _EFL_UI_FOCUS_PARENT_PROVIDER_GEN_EO_TYPES + + +#endif +#ifdef EFL_BETA_API_SUPPORT +/** EFL UI Focus Parent Provider Gen class + * + * @ingroup Efl_Ui_Focus_Parent_Provider_Gen + */ +#define EFL_UI_FOCUS_PARENT_PROVIDER_GEN_CLASS efl_ui_focus_parent_provider_gen_class_get() + +EWAPI const Efl_Class *efl_ui_focus_parent_provider_gen_class_get(void); + +/** + * @brief Content item map property + * + * @param[in] obj The object. + * @param[in] map Item map + * + * @ingroup Efl_Ui_Focus_Parent_Provider_Gen + */ +EOAPI void efl_ui_focus_parent_provider_gen_content_item_map_set(Eo *obj, Eina_Hash *map); + +/** + * @brief Content item map property + * + * @param[in] obj The object. + * + * @return Item map + * + * @ingroup Efl_Ui_Focus_Parent_Provider_Gen + */ +EOAPI Eina_Hash *efl_ui_focus_parent_provider_gen_content_item_map_get(const Eo *obj); + +/** + * @brief Container property + * + * @param[in] obj The object. + * @param[in] container Container widget + * + * @ingroup Efl_Ui_Focus_Parent_Provider_Gen + */ +EOAPI void efl_ui_focus_parent_provider_gen_container_set(Eo *obj, Efl_Ui_Widget *container); + +/** + * @brief Container property + * + * @param[in] obj The object. + * + * @return Container widget + * + * @ingroup Efl_Ui_Focus_Parent_Provider_Gen + */ +EOAPI Efl_Ui_Widget *efl_ui_focus_parent_provider_gen_container_get(const Eo *obj); + +/** + * @brief Fetch the item where the item is a subchild from + * + * @param[in] obj The object. + * @param[in] widget + * + * @ingroup Efl_Ui_Focus_Parent_Provider_Gen + */ +EOAPI Efl_Ui_Widget *efl_ui_focus_parent_provider_gen_item_fetch(Eo *obj, Efl_Ui_Widget *widget); +#endif /* EFL_BETA_API_SUPPORT */ + +#endif 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 d9d38b5301..40cce41449 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 extends Efl.Object implements Efl.Ui.Focus.Parent_Provider { +class @beta Efl.Ui.Focus.Parent_Provider_Standard extends Efl.Object implements 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_util.c b/src/lib/elementary/efl_ui_focus_util.c index f422266101..891489773e 100644 --- a/src/lib/elementary/efl_ui_focus_util.c +++ b/src/lib/elementary/efl_ui_focus_util.c @@ -12,7 +12,7 @@ typedef struct { static void _manager_changed(void *data, const Efl_Event *event EINA_UNUSED) { - efl_ui_focus_util_focus(EFL_UI_FOCUS_UTIL_CLASS, data); + efl_ui_focus_util_focus(data); } static Eina_Bool @@ -25,7 +25,7 @@ _can_take_focus(Efl_Ui_Focus_Manager *m, Efl_Ui_Focus_Object *user) } EOLIAN static void -_efl_ui_focus_util_focus(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Ui_Focus_Object *user) +_efl_ui_focus_util_focus(Efl_Ui_Focus_Object *user) { Efl_Ui_Focus_Object *entry; Efl_Ui_Widget *top, *o; @@ -34,7 +34,7 @@ _efl_ui_focus_util_focus(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Ui_Focus top = elm_widget_top_get(user); o = efl_key_data_get(top, "__delayed_focus_set"); - if (o) efl_event_callback_del(o, EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, _manager_changed, o); + if (o) efl_event_callback_del(o, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_MANAGER_CHANGED, _manager_changed, o); efl_key_data_set(top, "__delayed_focus_set", NULL); registered_manager = m = efl_ui_focus_object_focus_manager_get(user); @@ -54,7 +54,7 @@ _efl_ui_focus_util_focus(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Ui_Focus { efl_key_data_set(top, "__delayed_focus_set", entry); efl_event_callback_add(entry, - EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, + EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_MANAGER_CHANGED, _manager_changed, user); } else if (efl_isa(m, EFL_UI_WIN_CLASS)) @@ -64,7 +64,7 @@ _efl_ui_focus_util_focus(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Ui_Focus } 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) +_efl_ui_focus_util_active_manager(Efl_Ui_Focus_Manager *manager) { while (efl_ui_focus_manager_redirect_get(manager)) manager = efl_ui_focus_manager_redirect_get(manager); @@ -73,7 +73,7 @@ _efl_ui_focus_util_active_manager(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl } 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) +_efl_ui_focus_util_direction_complement(Efl_Ui_Focus_Direction dir) { #define COMP(a,b) \ if (dir == a) return b; \ diff --git a/src/lib/elementary/efl_ui_focus_util.eo b/src/lib/elementary/efl_ui_focus_util.eo index 4724dccc47..c19c05cb18 100644 --- a/src/lib/elementary/efl_ui_focus_util.eo +++ b/src/lib/elementary/efl_ui_focus_util.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Focus.Util extends Efl.Object { +class @beta Efl.Ui.Focus.Util extends Efl.Object { [[EFL UI Focus Util class]] methods { focus @class { diff --git a/src/lib/elementary/efl_ui_frame.c b/src/lib/elementary/efl_ui_frame.c index 686fdc6cc1..664a542a46 100644 --- a/src/lib/elementary/efl_ui_frame.c +++ b/src/lib/elementary/efl_ui_frame.c @@ -113,7 +113,6 @@ _efl_ui_frame_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Frame_Data *_pd EINA_UN if (!elm_widget_theme_klass_get(obj)) elm_widget_theme_klass_set(obj, "frame"); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); if (elm_widget_is_legacy(obj)) { @@ -136,10 +135,10 @@ _efl_ui_frame_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Frame_Data *_pd EINA_UN elm_widget_can_focus_set(obj, EINA_FALSE); - if (!elm_widget_theme_object_set(obj, wd->resize_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))) + elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); elm_layout_sizing_eval(obj); @@ -225,8 +224,9 @@ ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_frame, Efl_Ui_Frame_Data) EFL_CANVAS_GROUP_ADD_OPS(efl_ui_frame) #include "efl_ui_frame.eo.c" +#include "efl_ui_frame_eo.legacy.c" -#include "efl_ui_frame_legacy.eo.h" +#include "efl_ui_frame_legacy_eo.h" #define MY_CLASS_NAME_LEGACY "elm_frame" @@ -251,4 +251,4 @@ elm_frame_add(Evas_Object *parent) return elm_legacy_add(EFL_UI_FRAME_LEGACY_CLASS, parent); } -#include "efl_ui_frame_legacy.eo.c" +#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 af6b59278a..509bd02df0 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 extends Efl.Ui.Layout implements Efl.Ui.Clickable, Efl.Text, Efl.Text_Markup, +class @beta Efl.Ui.Frame extends Efl.Ui.Layout_Base implements Efl.Ui.Clickable, Efl.Text, Efl.Text_Markup, Efl.Content { [[Frame widget @@ -7,7 +7,6 @@ class Efl.Ui.Frame extends Efl.Ui.Layout implements Efl.Ui.Clickable, Efl.Text, by clicking on the frame label. the label and content can be set using text_set and content_set api. ]] - legacy_prefix: elm_frame; methods { @property collapse { set { diff --git a/src/lib/elementary/efl_ui_frame_eo.legacy.c b/src/lib/elementary/efl_ui_frame_eo.legacy.c new file mode 100644 index 0000000000..ad34a0c7ed --- /dev/null +++ b/src/lib/elementary/efl_ui_frame_eo.legacy.c @@ -0,0 +1,30 @@ + +EAPI void +elm_frame_collapse_set(Efl_Ui_Frame *obj, Eina_Bool collapse) +{ + efl_ui_frame_collapse_set(obj, collapse); +} + +EAPI Eina_Bool +elm_frame_collapse_get(const Efl_Ui_Frame *obj) +{ + return efl_ui_frame_collapse_get(obj); +} + +EAPI void +elm_frame_autocollapse_set(Efl_Ui_Frame *obj, Eina_Bool autocollapse) +{ + efl_ui_frame_autocollapse_set(obj, autocollapse); +} + +EAPI Eina_Bool +elm_frame_autocollapse_get(const Efl_Ui_Frame *obj) +{ + return efl_ui_frame_autocollapse_get(obj); +} + +EAPI void +elm_frame_collapse_go(Efl_Ui_Frame *obj, Eina_Bool collapse) +{ + efl_ui_frame_collapse_go(obj, collapse); +} diff --git a/src/lib/elementary/efl_ui_frame_eo.legacy.h b/src/lib/elementary/efl_ui_frame_eo.legacy.h new file mode 100644 index 0000000000..b2ba76e21c --- /dev/null +++ b/src/lib/elementary/efl_ui_frame_eo.legacy.h @@ -0,0 +1,78 @@ +#ifndef _EFL_UI_FRAME_EO_LEGACY_H_ +#define _EFL_UI_FRAME_EO_LEGACY_H_ + +#ifndef _EFL_UI_FRAME_EO_CLASS_TYPE +#define _EFL_UI_FRAME_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Frame; + +#endif + +#ifndef _EFL_UI_FRAME_EO_TYPES +#define _EFL_UI_FRAME_EO_TYPES + + +#endif + +/** + * @brief Manually collapse a frame without animations Use this to toggle the + * collapsed state of a frame, bypassing animations. + * + * @param[in] obj The object. + * @param[in] collapse @c true to collapse, @c false to expand. + * + * @ingroup Elm_Frame_Group + */ +EAPI void elm_frame_collapse_set(Efl_Ui_Frame *obj, Eina_Bool collapse); + +/** + * @brief Determine the collapse state of a frame Use this to determine the + * collapse state of a frame. + * + * @param[in] obj The object. + * + * @return @c true to collapse, @c false to expand. + * + * @ingroup Elm_Frame_Group + */ +EAPI Eina_Bool elm_frame_collapse_get(const Efl_Ui_Frame *obj); + +/** + * @brief Toggle autocollapsing of a frame When @c enable is @c true, clicking + * a frame's label will collapse the frame vertically, shrinking it to the + * height of the label. By default, this is DISABLED. + * + * @param[in] obj The object. + * @param[in] autocollapse Whether to enable autocollapse. + * + * @ingroup Elm_Frame_Group + */ +EAPI void elm_frame_autocollapse_set(Efl_Ui_Frame *obj, Eina_Bool autocollapse); + +/** + * @brief Determine autocollapsing of a frame + * + * When this returns @c true, clicking a frame's label will collapse the frame + * vertically, shrinking it to the height of the label. By default, this is + * DISABLED. + * + * @param[in] obj The object. + * + * @return Whether to enable autocollapse. + * + * @ingroup Elm_Frame_Group + */ +EAPI Eina_Bool elm_frame_autocollapse_get(const Efl_Ui_Frame *obj); + +/** + * @brief Manually collapse a frame with animations Use this to toggle the + * collapsed state of a frame, triggering animations. + * + * @param[in] obj The object. + * @param[in] collapse @c true to collapse, @c false to expand. + * + * @ingroup Elm_Frame_Group + */ +EAPI void elm_frame_collapse_go(Efl_Ui_Frame *obj, Eina_Bool collapse); + +#endif diff --git a/src/lib/elementary/efl_ui_frame_legacy.eo b/src/lib/elementary/efl_ui_frame_legacy.eo deleted file mode 100644 index fb21570094..0000000000 --- a/src/lib/elementary/efl_ui_frame_legacy.eo +++ /dev/null @@ -1,14 +0,0 @@ -class Efl.Ui.Frame_Legacy extends Efl.Ui.Frame implements 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 7e96f12e30..8d225885ae 100644 --- a/src/lib/elementary/efl_ui_frame_legacy.h +++ b/src/lib/elementary/efl_ui_frame_legacy.h @@ -10,4 +10,4 @@ typedef Eo Elm_Frame; */ EAPI Evas_Object *elm_frame_add(Evas_Object *parent); -#include "efl_ui_frame.eo.legacy.h" +#include "efl_ui_frame_eo.legacy.h" diff --git a/src/lib/elementary/efl_ui_frame_legacy_eo.c b/src/lib/elementary/efl_ui_frame_legacy_eo.c new file mode 100644 index 0000000000..22e40576a2 --- /dev/null +++ b/src/lib/elementary/efl_ui_frame_legacy_eo.c @@ -0,0 +1,35 @@ + +Efl_Object *_efl_ui_frame_legacy_efl_object_constructor(Eo *obj, void *pd); + + +static Eina_Bool +_efl_ui_frame_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_FRAME_LEGACY_EXTRA_OPS +#define EFL_UI_FRAME_LEGACY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _efl_ui_frame_legacy_efl_object_constructor), + EFL_UI_FRAME_LEGACY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_frame_legacy_class_desc = { + EO_VERSION, + "Efl.Ui.Frame_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _efl_ui_frame_legacy_class_initializer, + _efl_ui_frame_legacy_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_frame_legacy_class_get, &_efl_ui_frame_legacy_class_desc, EFL_UI_FRAME_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/efl_ui_frame_legacy_eo.h b/src/lib/elementary/efl_ui_frame_legacy_eo.h new file mode 100644 index 0000000000..ea4b164ba8 --- /dev/null +++ b/src/lib/elementary/efl_ui_frame_legacy_eo.h @@ -0,0 +1,31 @@ +#ifndef _EFL_UI_FRAME_LEGACY_EO_H_ +#define _EFL_UI_FRAME_LEGACY_EO_H_ + +#ifndef _EFL_UI_FRAME_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_FRAME_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Frame_Legacy; + +#endif + +#ifndef _EFL_UI_FRAME_LEGACY_EO_TYPES +#define _EFL_UI_FRAME_LEGACY_EO_TYPES + + +#endif +#ifdef EFL_BETA_API_SUPPORT +/** + * @brief 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. + * + * @ingroup Efl_Ui_Frame_Legacy + */ +#define EFL_UI_FRAME_LEGACY_CLASS efl_ui_frame_legacy_class_get() + +EWAPI const Efl_Class *efl_ui_frame_legacy_class_get(void); +#endif /* EFL_BETA_API_SUPPORT */ + +#endif diff --git a/src/lib/elementary/efl_ui_frame_legacy_eo.legacy.h b/src/lib/elementary/efl_ui_frame_legacy_eo.legacy.h new file mode 100644 index 0000000000..4bbd7cccbf --- /dev/null +++ b/src/lib/elementary/efl_ui_frame_legacy_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_FRAME_LEGACY_EO_LEGACY_H_ +#define _EFL_UI_FRAME_LEGACY_EO_LEGACY_H_ + +#ifndef _EFL_UI_FRAME_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_FRAME_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Frame_Legacy; + +#endif + +#ifndef _EFL_UI_FRAME_LEGACY_EO_TYPES +#define _EFL_UI_FRAME_LEGACY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/efl_ui_grid.c b/src/lib/elementary/efl_ui_grid.c index e983708950..8e0974dd12 100644 --- a/src/lib/elementary/efl_ui_grid.c +++ b/src/lib/elementary/efl_ui_grid.c @@ -5,7 +5,6 @@ #define ELM_LAYOUT_PROTECTED #define EFL_UI_SCROLL_MANAGER_PROTECTED #define EFL_UI_SCROLLBAR_PROTECTED -#define EFL_UI_SCROLLBAR_BETA #include #include "elm_priv.h" @@ -65,7 +64,7 @@ _relayout(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, Eina_Position2D pan) { EFL_UI_GRID_ITEM_DATA_GET(item, id); - if (pd->need_update || id->update_me || id->update_begin) + if (pd->need_update || (id && (id->update_me || id->update_begin))) { // Index begin with zero value : id->index = count; @@ -118,8 +117,8 @@ _relayout(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, Eina_Position2D pan) } } - min = efl_gfx_size_hint_min_get(item); - max = efl_gfx_size_hint_max_get(item); + min = efl_gfx_hint_size_min_get(item); + max = efl_gfx_hint_size_max_get(item); if (pd->item.size.w < min.w) pd->item.size.w = min.w; if (pd->item.size.h < min.h) pd->item.size.h = min.h; @@ -140,7 +139,7 @@ _relayout(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, Eina_Position2D pan) // efl_gfx_entity_position_set(item, ipos); efl_gfx_entity_size_set(item, id->geo.size); - //efl_gfx_size_hint_restricted_min_set(item, id->geo.size); + //efl_gfx_hint_size_restricted_min_set(item, id->geo.size); prev = id; count++; @@ -151,7 +150,7 @@ _relayout(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, Eina_Position2D pan) else pd->geo.h = cur.y + pd->item.size.h + pd->item.pad.h - pd->geo.y; - //efl_gfx_size_hint_restricted_min_set(pd->content, pd->geo.size); + //efl_gfx_hint_size_restricted_min_set(pd->content, pd->geo.size); efl_gfx_entity_size_set(pd->content, pd->geo.size); pd->need_update = EINA_FALSE; @@ -168,12 +167,13 @@ _reposition(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, Eina_Position2D pan) EINA_LIST_FOREACH(pd->items, l, item) { EFL_UI_GRID_ITEM_DATA_GET(item, id); + if (!id) continue; ipos.x = id->geo.x - pan.x; ipos.y = id->geo.y - pan.y; efl_gfx_entity_position_set(item, ipos); efl_gfx_entity_size_set(item, id->geo.size); - //efl_gfx_size_hint_min_set(item, id->geo.size); + //efl_gfx_hint_size_min_set(item, id->geo.size); } } @@ -198,14 +198,14 @@ _item_scroll_internal(Eo *obj, if (pd->dir == EFL_UI_DIR_HORIZONTAL) { ipos.y = view.y; - ipos.h = ipos.h; + //ipos.h = ipos.h; // 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)) //Internal Prefix { ipos.x = ipos.x + vpos.x - view.x; - ipos.w = ipos.w; + //ipos.w = ipos.w; } else if ((align > 0.0 || EINA_DBL_EQ(align, 0.0)) && (align < 1.0 || EINA_DBL_EQ(align, 1.0))) @@ -219,14 +219,14 @@ _item_scroll_internal(Eo *obj, else //VERTICAL { ipos.x = view.x; - ipos.w = ipos.w; + //ipos.w = ipos.w; // 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)) //Internal Prefix { ipos.y = ipos.y + vpos.y - view.y; - ipos.h = ipos.h; + //ipos.h = ipos.h; } else if ((align > 0.0 || EINA_DBL_EQ(align, 0.0)) && (align < 1.0 || EINA_DBL_EQ(align, 1.0))) @@ -435,40 +435,40 @@ _scroll_edje_object_attach(Eo *obj) EFL_UI_GRID_DATA_GET_OR_RETURN(obj, pd); efl_layout_signal_callback_add(obj, "reload", "efl", - _efl_ui_grid_reload_cb, obj); + obj, _efl_ui_grid_reload_cb, NULL); efl_layout_signal_callback_add(obj, "drag", "efl.dragable.vbar", - _efl_ui_grid_vbar_drag_cb, obj); + obj, _efl_ui_grid_vbar_drag_cb, NULL); efl_layout_signal_callback_add(obj, "drag,set", "efl.dragable.vbar", - _efl_ui_grid_edje_drag_cb, obj); + obj, _efl_ui_grid_edje_drag_cb, NULL); efl_layout_signal_callback_add(obj, "drag,start", "efl.dragable.vbar", - _efl_ui_grid_edje_drag_start_cb, obj); + obj, _efl_ui_grid_edje_drag_start_cb, NULL); efl_layout_signal_callback_add(obj, "drag,stop", "efl.dragable.vbar", - _efl_ui_grid_edje_drag_stop_cb, obj); + obj, _efl_ui_grid_edje_drag_stop_cb, NULL); efl_layout_signal_callback_add(obj, "drag,step", "efl.dragable.vbar", - _efl_ui_grid_edje_drag_cb, obj); + obj, _efl_ui_grid_edje_drag_cb, NULL); efl_layout_signal_callback_add(obj, "drag,page", "efl.dragable.vbar", - _efl_ui_grid_edje_drag_cb, obj); + obj, _efl_ui_grid_edje_drag_cb, NULL); efl_layout_signal_callback_add(obj, "efl,vbar,press", "efl", - _efl_ui_grid_vbar_press_cb, obj); + obj, _efl_ui_grid_vbar_press_cb, NULL); efl_layout_signal_callback_add(obj, "efl,vbar,unpress", "efl", - _efl_ui_grid_vbar_unpress_cb, obj); + obj, _efl_ui_grid_vbar_unpress_cb, NULL); efl_layout_signal_callback_add(obj, "drag", "efl.dragable.hbar", - _efl_ui_grid_hbar_drag_cb, obj); + obj, _efl_ui_grid_hbar_drag_cb, NULL); efl_layout_signal_callback_add(obj, "drag,set", "efl.dragable.hbar", - _efl_ui_grid_edje_drag_cb, obj); + obj, _efl_ui_grid_edje_drag_cb, NULL); efl_layout_signal_callback_add(obj, "drag,start", "efl.dragable.hbar", - _efl_ui_grid_edje_drag_start_cb, obj); + obj, _efl_ui_grid_edje_drag_start_cb, NULL); efl_layout_signal_callback_add(obj, "drag,stop", "efl.dragable.hbar", - _efl_ui_grid_edje_drag_stop_cb, obj); + obj, _efl_ui_grid_edje_drag_stop_cb, NULL); efl_layout_signal_callback_add(obj, "drag,step", "efl.dragable.hbar", - _efl_ui_grid_edje_drag_cb, obj); + obj, _efl_ui_grid_edje_drag_cb, NULL); efl_layout_signal_callback_add(obj, "drag,page", "efl.dragable.hbar", - _efl_ui_grid_edje_drag_cb, obj); + obj, _efl_ui_grid_edje_drag_cb, NULL); efl_layout_signal_callback_add(obj, "efl,hbar,press", "efl", - _efl_ui_grid_hbar_press_cb, obj); + obj, _efl_ui_grid_hbar_press_cb, NULL); efl_layout_signal_callback_add(obj, "efl,hbar,unpress", "efl", - _efl_ui_grid_hbar_unpress_cb, obj); + obj, _efl_ui_grid_hbar_unpress_cb, NULL); } static void @@ -477,40 +477,40 @@ _scroll_edje_object_detach(Eo *obj) EFL_UI_GRID_DATA_GET_OR_RETURN(obj, pd); efl_layout_signal_callback_del(obj, "reload", "efl", - _efl_ui_grid_reload_cb, obj); + obj, _efl_ui_grid_reload_cb, NULL); efl_layout_signal_callback_del(obj, "drag", "efl.dragable.vbar", - _efl_ui_grid_vbar_drag_cb, obj); + obj, _efl_ui_grid_vbar_drag_cb, NULL); efl_layout_signal_callback_del(obj, "drag,set", "efl.dragable.vbar", - _efl_ui_grid_edje_drag_cb, obj); + obj, _efl_ui_grid_edje_drag_cb, NULL); efl_layout_signal_callback_del(obj, "drag,start", "efl.dragable.vbar", - _efl_ui_grid_edje_drag_start_cb, obj); + obj, _efl_ui_grid_edje_drag_start_cb, NULL); efl_layout_signal_callback_del(obj, "drag,stop", "efl.dragable.vbar", - _efl_ui_grid_edje_drag_stop_cb, obj); + obj, _efl_ui_grid_edje_drag_stop_cb, NULL); efl_layout_signal_callback_del(obj, "drag,step", "efl.dragable.vbar", - _efl_ui_grid_edje_drag_cb, obj); + obj, _efl_ui_grid_edje_drag_cb, NULL); efl_layout_signal_callback_del(obj, "drag,page", "efl.dragable.vbar", - _efl_ui_grid_edje_drag_cb, obj); + obj, _efl_ui_grid_edje_drag_cb, NULL); efl_layout_signal_callback_del(obj, "efl,vbar,press", "efl", - _efl_ui_grid_vbar_press_cb, obj); + obj, _efl_ui_grid_vbar_press_cb, NULL); efl_layout_signal_callback_del(obj, "efl,vbar,unpress", "efl", - _efl_ui_grid_vbar_unpress_cb, obj); + obj, _efl_ui_grid_vbar_unpress_cb, NULL); efl_layout_signal_callback_del(obj, "drag", "efl.dragable.hbar", - _efl_ui_grid_hbar_drag_cb, obj); + obj, _efl_ui_grid_hbar_drag_cb, NULL); efl_layout_signal_callback_del(obj, "drag,set", "efl.dragable.hbar", - _efl_ui_grid_edje_drag_cb, obj); + obj, _efl_ui_grid_edje_drag_cb, NULL); efl_layout_signal_callback_del(obj, "drag,start", "efl.dragable.hbar", - _efl_ui_grid_edje_drag_start_cb, obj); + obj, _efl_ui_grid_edje_drag_start_cb, NULL); efl_layout_signal_callback_del(obj, "drag,stop", "efl.dragable.hbar", - _efl_ui_grid_edje_drag_stop_cb, obj); + obj, _efl_ui_grid_edje_drag_stop_cb, NULL); efl_layout_signal_callback_del(obj, "drag,step", "efl.dragable.hbar", - _efl_ui_grid_edje_drag_cb, obj); + obj, _efl_ui_grid_edje_drag_cb, NULL); efl_layout_signal_callback_del(obj, "drag,page", "efl.dragable.hbar", - _efl_ui_grid_edje_drag_cb, obj); + obj, _efl_ui_grid_edje_drag_cb, NULL); efl_layout_signal_callback_del(obj, "efl,hbar,press", "efl", - _efl_ui_grid_hbar_press_cb, obj); + obj, _efl_ui_grid_hbar_press_cb, NULL); efl_layout_signal_callback_del(obj, "efl,hbar,unpress", "efl", - _efl_ui_grid_hbar_unpress_cb, obj); + obj, _efl_ui_grid_hbar_unpress_cb, NULL); } static void @@ -577,7 +577,7 @@ _efl_ui_grid_efl_object_finalize(Eo *obj, efl_ui_scroll_manager_pan_set(pd->smanager, pd->pan); edje_object_part_swallow(wd->resize_obj, "efl.content", pd->pan); - pd->select_mode = EFL_UI_SELECT_SINGLE; + pd->select_mode = EFL_UI_SELECT_MODE_SINGLE; if ((pd->item.size.w == 0) && (pd->item.size.h == 0)) { @@ -601,13 +601,13 @@ _efl_ui_grid_efl_object_finalize(Eo *obj, _efl_ui_grid_bar_show_cb, obj); efl_event_callback_add(obj, EFL_UI_SCROLLBAR_EVENT_BAR_HIDE, _efl_ui_grid_bar_hide_cb, obj); - efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_RESIZE, + efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _efl_ui_grid_resized_cb, obj); - efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS, + efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _efl_ui_grid_size_hint_changed_cb, obj); - efl_event_callback_add(pd->pan, EFL_GFX_ENTITY_EVENT_RESIZE, + efl_event_callback_add(pd->pan, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _efl_ui_grid_pan_resized_cb, obj); - efl_event_callback_add(pd->content, EFL_GFX_ENTITY_EVENT_MOVE, + efl_event_callback_add(pd->content, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _efl_ui_grid_content_moved_cb, obj); elm_layout_sizing_eval(obj); @@ -629,13 +629,13 @@ _efl_ui_grid_efl_object_invalidate(Eo *obj, Efl_Ui_Grid_Data *pd) _efl_ui_grid_bar_show_cb, obj); efl_event_callback_del(obj, EFL_UI_SCROLLBAR_EVENT_BAR_HIDE, _efl_ui_grid_bar_hide_cb, obj); - efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_RESIZE, + efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _efl_ui_grid_resized_cb, obj); - efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS, + efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _efl_ui_grid_size_hint_changed_cb, obj); - efl_event_callback_del(pd->pan, EFL_GFX_ENTITY_EVENT_RESIZE, + efl_event_callback_del(pd->pan, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _efl_ui_grid_pan_resized_cb, obj); - efl_event_callback_del(pd->content, EFL_GFX_ENTITY_EVENT_MOVE, + efl_event_callback_del(pd->content, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _efl_ui_grid_content_moved_cb, obj); _grid_clear_internal(obj, pd); @@ -709,8 +709,9 @@ _efl_ui_grid_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Grid_Data *pd) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - min = efl_gfx_size_hint_combined_min_get(obj); - max = efl_gfx_size_hint_max_get(obj); + min = efl_gfx_hint_size_combined_min_get(obj); + max = efl_gfx_hint_size_max_get(obj); + efl_gfx_hint_weight_get(obj, &xw, &yw); if (pd->smanager) view = efl_ui_scrollable_viewport_geometry_get(pd->smanager); @@ -740,11 +741,11 @@ _efl_ui_grid_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Grid_Data *pd) if (pd->match_content_w) size.w = vmw + min.w; if (pd->match_content_h) size.h = vmh + min.h; - max = efl_gfx_size_hint_max_get(obj); + max = efl_gfx_hint_size_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; pd->geo = view; - efl_gfx_size_hint_min_set(obj, size); + efl_gfx_hint_size_min_set(obj, size); _need_update(pd); return; @@ -844,12 +845,12 @@ _efl_ui_grid_efl_ui_direction_direction_get(const Eo *obj EINA_UNUSED, Efl_Ui_Gr } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_grid_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Grid_Data *pd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; efl_ui_mirrored_set(pd->smanager, efl_ui_mirrored_get(obj)); @@ -891,7 +892,7 @@ _grid_item_selected(void *data, const Efl_Event *event) EFL_UI_GRID_DATA_GET_OR_RETURN(obj, pd); /* Single Select */ - if (pd->select_mode != EFL_UI_SELECT_MULTI) + if (pd->select_mode != EFL_UI_SELECT_MODE_MULTI) { EINA_LIST_FREE(pd->selected, selected) { @@ -902,7 +903,7 @@ _grid_item_selected(void *data, const Efl_Event *event) pd->selected = eina_list_append(pd->selected, item); pd->last_selected = item; - efl_event_callback_call(obj, EFL_UI_EVENT_SELECTED, item); + efl_event_callback_call(obj, EFL_UI_EVENT_ITEM_SELECTED, item); } static void @@ -915,7 +916,7 @@ _grid_item_unselected(void *data, const Efl_Event *event) 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); + efl_event_callback_call(obj, EFL_UI_EVENT_ITEM_UNSELECTED, item); } static void @@ -923,7 +924,7 @@ _grid_item_deleted(void *data, const Efl_Event *event) { Eo *obj = data; Efl_Ui_Grid_Item *it = event->object; - EFL_UI_GRID_DATA_GET(obj, pd); + EFL_UI_GRID_DATA_GET_OR_RETURN(obj, pd); _grid_item_unpack_internal(obj, pd, it); } @@ -933,8 +934,8 @@ _grid_item_process(Eo *obj, Efl_Ui_Grid_Data *pd, EINA_UNUSED Efl_Ui_Grid_Item * EFL_UI_GRID_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); //FIXME: This is tricky workaround for set select mode and parent value. - EFL_UI_GRID_ITEM_DATA_GET(it, gd); - EFL_UI_ITEM_DATA_GET(it, id); + EFL_UI_GRID_ITEM_DATA_GET_OR_RETURN(it, gd, EINA_FALSE); + EFL_UI_ITEM_DATA_GET_OR_RETURN(it, id, EINA_FALSE); id->select_mode = &(pd->select_mode); id->parent = obj; gd->parent = obj; @@ -944,8 +945,8 @@ _grid_item_process(Eo *obj, Efl_Ui_Grid_Data *pd, EINA_UNUSED Efl_Ui_Grid_Item * efl_event_callback_add(it, EFL_UI_EVENT_PRESSED, _grid_item_pressed, obj); efl_event_callback_add(it, EFL_UI_EVENT_UNPRESSED, _grid_item_unpressed, obj); efl_event_callback_add(it, EFL_UI_EVENT_LONGPRESSED, _grid_item_longpressed, obj); - efl_event_callback_add(it, EFL_UI_EVENT_SELECTED, _grid_item_selected, obj); - efl_event_callback_add(it, EFL_UI_EVENT_UNSELECTED, _grid_item_unselected, obj); + efl_event_callback_add(it, EFL_UI_EVENT_ITEM_SELECTED, _grid_item_selected, obj); + efl_event_callback_add(it, EFL_UI_EVENT_ITEM_UNSELECTED, _grid_item_unselected, obj); efl_event_callback_add(it, EFL_EVENT_DEL, _grid_item_deleted, obj); return EINA_TRUE; @@ -955,11 +956,11 @@ static void _grid_item_unpack_internal(Eo *obj, Efl_Ui_Grid_Data *pd, Efl_Ui_Grid_Item *it) { EFL_UI_GRID_ITEM_CHECK_OR_RETURN(it); - EFL_UI_GRID_ITEM_DATA_GET(it, ld); - EFL_UI_ITEM_DATA_GET(it, id); + EFL_UI_GRID_ITEM_DATA_GET_OR_RETURN(it, gd); + EFL_UI_ITEM_DATA_GET_OR_RETURN(it, id); id->select_mode = NULL; id->parent = NULL; - ld->parent = NULL; + gd->parent = NULL; pd->items = eina_list_remove(pd->items, it); if (efl_ui_item_selected_get(it)) @@ -970,8 +971,8 @@ _grid_item_unpack_internal(Eo *obj, Efl_Ui_Grid_Data *pd, Efl_Ui_Grid_Item *it) efl_event_callback_del(it, EFL_UI_EVENT_PRESSED, _grid_item_pressed, obj); efl_event_callback_del(it, EFL_UI_EVENT_UNPRESSED, _grid_item_unpressed, obj); efl_event_callback_del(it, EFL_UI_EVENT_LONGPRESSED, _grid_item_longpressed, obj); - efl_event_callback_del(it, EFL_UI_EVENT_SELECTED, _grid_item_selected, obj); - efl_event_callback_del(it, EFL_UI_EVENT_UNSELECTED, _grid_item_unselected, obj); + efl_event_callback_del(it, EFL_UI_EVENT_ITEM_SELECTED, _grid_item_selected, obj); + efl_event_callback_del(it, EFL_UI_EVENT_ITEM_UNSELECTED, _grid_item_unselected, obj); efl_event_callback_del(it, EFL_EVENT_DEL, _grid_item_deleted, obj); } @@ -1039,7 +1040,7 @@ EOLIAN static Eina_Bool _efl_ui_grid_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Grid_Data *pd, Efl_Gfx_Entity *subobj) { if (!_grid_item_process(obj, pd, subobj)) return EINA_FALSE; - EFL_UI_GRID_ITEM_DATA_GET(subobj, pid); + EFL_UI_GRID_ITEM_DATA_GET_OR_RETURN(subobj, pid, EINA_FALSE); pd->items = eina_list_append(pd->items, subobj); pid->update_me = EINA_TRUE; @@ -1052,7 +1053,7 @@ EOLIAN static Eina_Bool _efl_ui_grid_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Grid_Data *pd, Efl_Gfx_Entity *subobj) { if (!_grid_item_process(obj, pd, subobj)) return EINA_FALSE; - EFL_UI_GRID_ITEM_DATA_GET(subobj, pid); + EFL_UI_GRID_ITEM_DATA_GET_OR_RETURN(subobj, pid, EINA_FALSE); pd->items = eina_list_prepend(pd->items, subobj); // Defered item's placing in group calculation pid->update_me = EINA_TRUE; @@ -1068,7 +1069,7 @@ _efl_ui_grid_efl_pack_linear_pack_before(Eo *obj, { if (!_grid_item_process(obj, pd, subobj)) return EINA_FALSE; EFL_UI_GRID_ITEM_CHECK_OR_RETURN(existing, EINA_FALSE); - EFL_UI_GRID_ITEM_DATA_GET(subobj, pid); + EFL_UI_GRID_ITEM_DATA_GET_OR_RETURN(subobj, pid, EINA_FALSE); pd->items = eina_list_prepend_relative(pd->items, subobj, existing); // Defered item's placing in group calculation @@ -1085,7 +1086,7 @@ _efl_ui_grid_efl_pack_linear_pack_after(Eo *obj, { if (!_grid_item_process(obj, pd, subobj)) return EINA_FALSE; EFL_UI_GRID_ITEM_CHECK_OR_RETURN(existing, EINA_FALSE); - EFL_UI_GRID_ITEM_DATA_GET(subobj, pid); + EFL_UI_GRID_ITEM_DATA_GET_OR_RETURN(subobj, pid, EINA_FALSE); pd->items = eina_list_append_relative(pd->items, subobj, existing); // Defered item's placing in group calculation @@ -1102,7 +1103,7 @@ _efl_ui_grid_efl_pack_linear_pack_at(Eo *obj, { if (!_grid_item_process(obj, pd, subobj)) return EINA_FALSE; Efl_Ui_Grid_Item *existing = eina_list_nth(pd->items, index); - EFL_UI_GRID_ITEM_DATA_GET(subobj, pid); + EFL_UI_GRID_ITEM_DATA_GET_OR_RETURN(subobj, pid, EINA_FALSE); pd->items = eina_list_prepend_relative(pd->items, subobj, existing); // Defered item's placing in group calculation @@ -1222,9 +1223,9 @@ _efl_ui_grid_efl_ui_multi_selectable_select_mode_set(Eo *obj EINA_UNUSED, { Efl_Ui_Grid_Item *selected; - if ((pd->select_mode == EFL_UI_SELECT_MULTI && - mode != EFL_UI_SELECT_MULTI) || - mode == EFL_UI_SELECT_NONE) + if ((pd->select_mode == EFL_UI_SELECT_MODE_MULTI && + mode != EFL_UI_SELECT_MODE_MULTI) || + mode == EFL_UI_SELECT_MODE_NONE) { Eina_List *clone = eina_list_clone(pd->selected); EINA_LIST_FREE(clone, selected) diff --git a/src/lib/elementary/efl_ui_grid.eo b/src/lib/elementary/efl_ui_grid.eo index 3c846cce57..6c70f36c39 100644 --- a/src/lib/elementary/efl_ui_grid.eo +++ b/src/lib/elementary/efl_ui_grid.eo @@ -1,6 +1,6 @@ import efl_ui_grid_item; -class Efl.Ui.Grid extends Efl.Ui.Layout implements +class @beta Efl.Ui.Grid extends Efl.Ui.Layout_Base implements Efl.Ui.Scrollable_Interactive, Efl.Ui.Scrollbar, Efl.Pack_Linear, Efl.Pack_Layout, @@ -93,4 +93,8 @@ class Efl.Ui.Grid extends Efl.Ui.Layout implements //Efl.Ui.Multi_Selectable Efl.Ui.Multi_Selectable.select_mode {get; set;} } + composite { + Efl.Ui.Scrollable_Interactive; + Efl.Ui.Scrollbar; + } } diff --git a/src/lib/elementary/efl_ui_grid_default_item.c b/src/lib/elementary/efl_ui_grid_default_item.c index ffc5e674a0..d0884296b4 100644 --- a/src/lib/elementary/efl_ui_grid_default_item.c +++ b/src/lib/elementary/efl_ui_grid_default_item.c @@ -23,9 +23,9 @@ _efl_ui_grid_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_Result theme_apply = efl_ui_layout_theme_set(obj, "grid_item", NULL, NULL); + Eina_Error theme_apply = efl_ui_layout_theme_set(obj, "grid_item", NULL, NULL); - if (theme_apply == EFL_UI_THEME_APPLY_RESULT_FAIL) + if (theme_apply == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Default Item(%p) failed to set theme [efl/grid_item]!", eo); return eo; } diff --git a/src/lib/elementary/efl_ui_grid_default_item.eo b/src/lib/elementary/efl_ui_grid_default_item.eo index c0f5862484..4cbe74e4b9 100644 --- a/src/lib/elementary/efl_ui_grid_default_item.eo +++ b/src/lib/elementary/efl_ui_grid_default_item.eo @@ -1,5 +1,5 @@ -class Efl.Ui.Grid_Default_Item extends Efl.Ui.Grid_Item implements +class @beta Efl.Ui.Grid_Default_Item extends Efl.Ui.Grid_Item implements Efl.Text, Efl.Text_Markup, Efl.Ui.L10n, @@ -7,8 +7,8 @@ class Efl.Ui.Grid_Default_Item extends Efl.Ui.Grid_Item implements { [[Grid 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.]] + Text and contents can be set using @Efl.Text, + @Efl.Content or @Efl.Part.]] data: null; parts { icon: Efl.Ui.Grid_Default_Item_Part_Icon; [[]] diff --git a/src/lib/elementary/efl_ui_grid_default_item_part_end.eo b/src/lib/elementary/efl_ui_grid_default_item_part_end.eo index 66ebd2a1a7..dc3b6dfbbb 100644 --- a/src/lib/elementary/efl_ui_grid_default_item_part_end.eo +++ b/src/lib/elementary/efl_ui_grid_default_item_part_end.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Grid_Default_Item_Part_End extends Efl.Ui.Layout_Part implements Efl.Content +class @beta Efl.Ui.Grid_Default_Item_Part_End extends Efl.Ui.Layout_Part implements Efl.Content { [[Grid Default Item internal content of end part class]] data: null; diff --git a/src/lib/elementary/efl_ui_grid_default_item_part_icon.eo b/src/lib/elementary/efl_ui_grid_default_item_part_icon.eo index 4dede025b6..47e290bace 100644 --- a/src/lib/elementary/efl_ui_grid_default_item_part_icon.eo +++ b/src/lib/elementary/efl_ui_grid_default_item_part_icon.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Grid_Default_Item_Part_Icon extends Efl.Ui.Layout_Part implements Efl.Content +class @beta Efl.Ui.Grid_Default_Item_Part_Icon extends Efl.Ui.Layout_Part implements Efl.Content { [[Grid Default Item internal content of icon part class]] data: null; diff --git a/src/lib/elementary/efl_ui_grid_item.eo b/src/lib/elementary/efl_ui_grid_item.eo index f430cab123..99a4abca01 100644 --- a/src/lib/elementary/efl_ui_grid_item.eo +++ b/src/lib/elementary/efl_ui_grid_item.eo @@ -1,5 +1,5 @@ -abstract Efl.Ui.Grid_Item extends Efl.Ui.Item +abstract @beta Efl.Ui.Grid_Item extends Efl.Ui.Item { implements { //Efl.Object diff --git a/src/lib/elementary/efl_ui_homogeneous_model.c b/src/lib/elementary/efl_ui_homogeneous_model.c new file mode 100644 index 0000000000..2aaf90431b --- /dev/null +++ b/src/lib/elementary/efl_ui_homogeneous_model.c @@ -0,0 +1,142 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include "elm_priv.h" + +// For now only vertical logic is implemented. Horizontal list and grid are not supported. + +typedef struct _Efl_Ui_Homogeneous_Model_Data Efl_Ui_Homogeneous_Model_Data; +struct _Efl_Ui_Homogeneous_Model_Data +{ + Efl_Ui_Homogeneous_Model_Data *parent; + + struct { + unsigned int width; + unsigned int height; + + struct { + Eina_Bool width; + Eina_Bool height; + } defined; + } item; +}; + +static Eina_Future * +_efl_ui_homogeneous_model_property_set(Eo *obj, Eina_Value *value, + Eina_Bool *defined, unsigned int *r) +{ + Eina_Future *f; + + if (*defined) + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_READ_ONLY); + if (!eina_value_uint_convert(value, r)) + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE); + *defined = EINA_TRUE; + f = efl_loop_future_resolved(obj, *value); + eina_value_free(value); + return f; +} + +static Eina_Future * +_efl_ui_homogeneous_model_efl_model_property_set(Eo *obj, + Efl_Ui_Homogeneous_Model_Data *pd, + const char *property, Eina_Value *value) +{ + if (pd->parent) + { + if (!strcmp(property, _efl_model_property_selfw)) + return _efl_ui_homogeneous_model_property_set(obj, value, + &pd->parent->item.defined.width, + &pd->parent->item.width); + if (!strcmp(property, _efl_model_property_selfh)) + return _efl_ui_homogeneous_model_property_set(obj, value, + &pd->parent->item.defined.height, + &pd->parent->item.height); + if (!strcmp(property, _efl_model_property_totalw) || + !strcmp(property, _efl_model_property_totalh)) + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_READ_ONLY); + } + if (!strcmp(property, _efl_model_property_itemw)) + { + return _efl_ui_homogeneous_model_property_set(obj, value, + &pd->item.defined.width, + &pd->item.width); + } + if (!strcmp(property, _efl_model_property_itemh)) + { + return _efl_ui_homogeneous_model_property_set(obj, value, + &pd->item.defined.height, + &pd->item.height); + } + + return efl_model_property_set(efl_super(obj, EFL_UI_HOMOGENEOUS_MODEL_CLASS), + property, value); +} + +static Eina_Value * +_efl_ui_homogeneous_model_efl_model_property_get(const Eo *obj, + Efl_Ui_Homogeneous_Model_Data *pd, + const char *property) +{ + if (pd->parent) + { + if (!strcmp(property, _efl_model_property_selfw)) + { + if (pd->parent->item.defined.width) + return eina_value_uint_new(pd->parent->item.width); + goto not_ready; + } + if (!strcmp(property, _efl_model_property_selfh)) + { + if (pd->parent->item.defined.height) + return eina_value_uint_new(pd->parent->item.height); + goto not_ready; + } + } + if (!strcmp(property, _efl_model_property_itemw)) + { + if (pd->item.defined.width) + return eina_value_uint_new(pd->item.width); + goto not_ready; + } + if (!strcmp(property, _efl_model_property_itemh)) + { + if (pd->item.defined.height) + return eina_value_uint_new(pd->item.height); + goto not_ready; + } + if (!strcmp(property, _efl_model_property_totalh)) + { + if (pd->item.defined.height) + return eina_value_uint_new(pd->item.height * + efl_model_children_count_get(obj)); + goto not_ready; + } + if (!strcmp(property, _efl_model_property_totalw)) + { + if (pd->item.defined.width) + // We only handle vertical list at this point, so total width is the width of one item. + return eina_value_uint_new(pd->item.width); + goto not_ready; + } + + return efl_model_property_get(efl_super(obj, EFL_UI_HOMOGENEOUS_MODEL_CLASS), property); + + not_ready: + return eina_value_error_new(EAGAIN); +} + +static Efl_Object * +_efl_ui_homogeneous_model_efl_object_constructor(Eo *obj, Efl_Ui_Homogeneous_Model_Data *pd) +{ + Eo *parent = efl_parent_get(obj); + + if (parent && efl_isa(parent, EFL_UI_HOMOGENEOUS_MODEL_CLASS)) + pd->parent = efl_data_scope_get(efl_parent_get(obj), EFL_UI_HOMOGENEOUS_MODEL_CLASS); + + return efl_constructor(efl_super(obj, EFL_UI_HOMOGENEOUS_MODEL_CLASS)); +} + +#include "efl_ui_homogeneous_model.eo.c" diff --git a/src/lib/elementary/efl_ui_homogeneous_model.eo b/src/lib/elementary/efl_ui_homogeneous_model.eo new file mode 100644 index 0000000000..996c1ac364 --- /dev/null +++ b/src/lib/elementary/efl_ui_homogeneous_model.eo @@ -0,0 +1,20 @@ +class @beta Efl.Ui.Homogeneous_Model extends Efl.Ui.Size_Model +{ + [[Class to be used to store object item size for List/Grid View. + + This model provides the properties "$item.width" and "$item.height" which have the + same value for all siblings of this object. The first sibling that defines "$self.width" + and "$self.height" set them for all other siblings and also set "$item.width" and + "$item.height" for the parent (See @Efl.Ui.Size_Model). + + Subsequent attempts to set "$self.width" or "$self.height" will fail with a + Read Only error code. + + The properties "$total.width" and "$total.height" are computed from the number of node, + the "$self.width" and "$self.height" assuming that the View is a vertical list.]] + + implements { + Efl.Object.constructor; + Efl.Model.property { set; get; } + } +} diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c index e17a21f665..166db8dc27 100644 --- a/src/lib/elementary/efl_ui_image.c +++ b/src/lib/elementary/efl_ui_image.c @@ -46,11 +46,12 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { }; static Eina_Bool _key_action_activate(Evas_Object *obj, const char *params); -static Eina_Bool _efl_ui_image_smart_internal_file_set(Eo *obj, Efl_Ui_Image_Data *sd, const char *file, const Eina_File *f, const char *key); +static Eina_Error _efl_ui_image_smart_internal_file_set(Eo *obj, Efl_Ui_Image_Data *sd); static void _efl_ui_image_remote_copier_cancel(Eo *obj, Efl_Ui_Image_Data *sd); void _efl_ui_image_sizing_eval(Evas_Object *obj); static void _efl_ui_image_model_properties_changed_cb(void *data, const Efl_Event *event); static void _on_size_hints_changed(void *data, const Efl_Event *e); +static Eina_Bool _efl_ui_image_download(Eo *obj, Efl_Ui_Image_Data *sd, const char *url); static const Elm_Action key_actions[] = { {"activate", _key_action_activate}, @@ -80,8 +81,8 @@ static void _recover_status(Eo *obj, Efl_Ui_Image_Data *sd) { int r, g, b, a; - Evas_Object *pclip = efl_canvas_object_clip_get(obj); - if (pclip) efl_canvas_object_clip_set(sd->img, pclip); + Evas_Object *pclip = efl_canvas_object_clipper_get(obj); + if (pclip) efl_canvas_object_clipper_set(sd->img, pclip); efl_gfx_color_get(obj, &r, &g, &b, &a); efl_gfx_color_set(sd->img, r, g, b, a); @@ -396,7 +397,7 @@ static void _efl_ui_image_async_open_done(void *data, Ecore_Thread *thread) { Async_Open_Data *todo = data; - Eina_Stringshare *file, *key; + const char *key; Eina_Bool ok; Eina_File *f; void *map; @@ -414,19 +415,21 @@ _efl_ui_image_async_open_done(void *data, Ecore_Thread *thread) map = todo->map; f = todo->f_open; ok = f && map; - if (todo->file) file = todo->file; - else file = f ? eina_file_filename_get(f) : NULL; if (ok) { - if (sd->edje) + efl_file_key_set(sd->self, key); + ok = !efl_file_mmap_set(sd->self, f); + if (ok) { - _prev_img_del(sd); - ok = edje_object_mmap_set(sd->img, f, key); + if (sd->edje) + { + _prev_img_del(sd); + ok = edje_object_mmap_set(sd->img, f, key); + } + else + ok = !_efl_ui_image_smart_internal_file_set(sd->self, sd); } - else - ok = _efl_ui_image_smart_internal_file_set - (sd->self, sd, file, f, key); } if (ok) evas_object_smart_callback_call(sd->self, SIG_LOAD_OPEN, NULL); else evas_object_smart_callback_call(sd->self, SIG_LOAD_ERROR, NULL); @@ -437,18 +440,20 @@ _efl_ui_image_async_open_done(void *data, Ecore_Thread *thread) _async_open_data_free(todo); } -static Eina_Bool -_efl_ui_image_async_file_set(Eo *obj, Efl_Ui_Image_Data *sd, const char *file, - const Eina_File *f, const char *key) +static Eina_Error +_efl_ui_image_async_file_set(Eo *obj, Efl_Ui_Image_Data *sd) { Async_Open_Data *todo; + const char *file = efl_file_get(obj); + const char *key = efl_file_key_get(obj); + const Eina_File *f = efl_file_mmap_get(obj); if (sd->async.th && ((file == sd->async.file) || (file && sd->async.file && !strcmp(file, sd->async.file))) && ((key == sd->async.key) || (key && sd->async.key && !strcmp(key, sd->async.key)))) - return EINA_TRUE; + return 0; todo = calloc(1, sizeof(Async_Open_Data)); if (!todo) return EINA_FALSE; @@ -467,22 +472,28 @@ _efl_ui_image_async_file_set(Eo *obj, Efl_Ui_Image_Data *sd, const char *file, sd->async.th = ecore_thread_run(_efl_ui_image_async_open_do, _efl_ui_image_async_open_done, _efl_ui_image_async_open_cancel, todo); - if (sd->async.th) return EINA_TRUE; + if (sd->async.th) return 0; _async_open_data_free(todo); _async_clear(sd); DBG("Could not spawn an async thread!"); - return EINA_FALSE; + return EFL_GFX_IMAGE_LOAD_ERROR_GENERIC; } -static Eina_Bool -_efl_ui_image_edje_file_set(Evas_Object *obj, - const char *file, - const Eina_File *f, - const char *group) +static Eina_Error +_efl_ui_image_edje_file_set(Evas_Object *obj) { + Eina_Error err; + const Eina_File *f; + const char *key; + EFL_UI_IMAGE_DATA_GET(obj, sd); + err = efl_file_load(efl_super(obj, MY_CLASS)); + if (err) return err; + + f = efl_file_mmap_get(obj); + key = efl_file_key_get(obj); _prev_img_del(sd); if (!sd->edje) @@ -500,39 +511,30 @@ _efl_ui_image_edje_file_set(Evas_Object *obj, if (!sd->async_enable) { - if (f) + efl_file_key_set(sd->img, key); + err = efl_file_mmap_set(sd->img, f); + if (!err) err = efl_file_load(sd->img); + if (err) { - if (!edje_object_mmap_set(sd->img, f, group)) - { - ERR("failed to set edje file '%s', group '%s': %s", file, group, - edje_load_error_str(edje_object_load_error_get(sd->img))); - return EINA_FALSE; - } - } - else - { - if (!edje_object_file_set(sd->img, file, group)) - { - ERR("failed to set edje file '%s', group '%s': %s", file, group, - edje_load_error_str(edje_object_load_error_get(sd->img))); - return EINA_FALSE; - } + ERR("failed to set edje file '%s', group '%s': %s", eina_file_filename_get(f), key, + edje_load_error_str(edje_object_load_error_get(sd->img))); + return err; } } else - return _efl_ui_image_async_file_set(obj, sd, file, f, group); + return _efl_ui_image_async_file_set(obj, sd); /* FIXME: do i want to update icon on file change ? */ _efl_ui_image_sizing_eval(obj); - return EINA_TRUE; + return 0; } EOLIAN static void _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); + if (sd->img && (!sd->edje)) evas_object_image_smooth_scale_set(sd->img, smooth); } EOLIAN static Eina_Bool @@ -547,7 +549,7 @@ _efl_ui_image_drag_n_drop_cb(void *elm_obj, Elm_Selection_Data *drop) { Eina_Bool ret = EINA_FALSE; - ret = efl_file_set(obj, drop->data, NULL); + ret = efl_file_simple_load(obj, drop->data, NULL); if (ret) { DBG("dnd: %s, %s, %s", elm_widget_type_get(elm_obj), @@ -564,7 +566,6 @@ EOLIAN static void _efl_ui_image_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Image_Data *priv) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj)); evas_object_smart_member_add(priv->hit_rect, obj); @@ -593,10 +594,11 @@ _efl_ui_image_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Image_Data *priv) EOLIAN static void _efl_ui_image_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Image_Data *sd) { + Efl_Model *model; + if (elm_widget_is_legacy(obj)) - efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS, + efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _on_size_hints_changed, sd); - ecore_job_del(sd->sizing_job); ecore_timer_del(sd->anim_timer); evas_object_del(sd->img); _prev_img_del(sd); @@ -605,12 +607,11 @@ _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->property.model) + model = efl_ui_view_model_get(obj); + if (model) { - efl_event_callback_del(sd->property.model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, + efl_event_callback_del(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)); @@ -704,27 +705,27 @@ _efl_ui_image_efl_gfx_color_color_set(Eo *obj, Efl_Ui_Image_Data *sd, int r, int } EOLIAN static void -_efl_ui_image_efl_canvas_object_clip_set(Eo *obj, Efl_Ui_Image_Data *sd, Evas_Object *clip) +_efl_ui_image_efl_canvas_object_clipper_set(Eo *obj, Efl_Ui_Image_Data *sd, Evas_Object *clip) { if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 0, clip)) return; - efl_canvas_object_clip_set(efl_super(obj, MY_CLASS), clip); + efl_canvas_object_clipper_set(efl_super(obj, MY_CLASS), clip); if (sd->img) evas_object_clip_set(sd->img, clip); if (sd->prev_img) evas_object_clip_set(sd->prev_img, clip); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_image_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Image_Data *sd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; if (sd->stdicon) _elm_theme_object_icon_set(obj, sd->stdicon, elm_widget_style_get(obj)); int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _efl_ui_image_sizing_eval(obj); @@ -738,18 +739,15 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED) return EINA_TRUE; } -static void -_sizing_eval_cb(void *data) +void +_efl_ui_image_sizing_eval(Evas_Object *obj) { - Evas_Object *obj = data; + EFL_UI_IMAGE_DATA_GET_OR_RETURN(obj, sd); + Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; Eina_Size2D sz; double ts; - EFL_UI_IMAGE_DATA_GET_OR_RETURN(obj, sd); - - sd->sizing_job = NULL; - // TODO: remove this function after using the widget's scale value instead of image's scale value, if (sd->no_scale) sd->scale = 1.0; @@ -809,15 +807,6 @@ _sizing_eval_cb(void *data) } } -void -_efl_ui_image_sizing_eval(Evas_Object *obj) -{ - EFL_UI_IMAGE_DATA_GET_OR_RETURN(obj, sd); - - if (sd->sizing_job) ecore_job_del(sd->sizing_job); - sd->sizing_job = ecore_job_add(_sizing_eval_cb, obj); -} - static void _efl_ui_image_load_size_set_internal(Evas_Object *obj, Efl_Ui_Image_Data *sd) { @@ -864,12 +853,33 @@ _efl_ui_image_efl_object_constructor(Eo *obj, Efl_Ui_Image_Data *pd) return obj; } -EOLIAN Eina_Bool -_efl_ui_image_efl_file_mmap_set(Eo *obj, Efl_Ui_Image_Data *sd, - const Eina_File *file, const char *key) -{ - Eina_Bool ret = EINA_FALSE; +static const Eina_Slice remote_uri[] = { + EINA_SLICE_STR_LITERAL("http://"), + EINA_SLICE_STR_LITERAL("https://"), + EINA_SLICE_STR_LITERAL("ftp://"), + { } +}; +static inline Eina_Bool +_efl_ui_image_is_remote(const char *file) +{ + Eina_Slice s = EINA_SLICE_STR(file); + const Eina_Slice *itr; + + for (itr = remote_uri; itr->mem; itr++) + if (eina_slice_startswith(s, *itr)) + return EINA_TRUE; + + return EINA_FALSE; +} + +EOLIAN Eina_Error +_efl_ui_image_efl_file_load(Eo *obj, Efl_Ui_Image_Data *sd) +{ + Eina_Error ret; + const char *file = efl_file_get(obj); + + if (efl_file_loaded_get(obj)) return 0; _async_cancel(sd); /* stop preloading as it may hit to-be-freed memory */ @@ -879,42 +889,100 @@ _efl_ui_image_efl_file_mmap_set(Eo *obj, Efl_Ui_Image_Data *sd, if (sd->remote.copier) _efl_ui_image_remote_copier_cancel(obj, sd); if (sd->remote.binbuf) ELM_SAFE_FREE(sd->remote.binbuf, eina_binbuf_free); + if (sd->anim) + { + ELM_SAFE_FREE(sd->anim_timer, ecore_timer_del); + sd->play = EINA_FALSE; + sd->anim = EINA_FALSE; + } + + if (file && _efl_ui_image_is_remote(file)) + { + evas_object_hide(sd->img); + if (_efl_ui_image_download(obj, sd, file)) + { + evas_object_smart_callback_call(obj, SIG_DOWNLOAD_START, NULL); + return 0; + } + } + if (!sd->async_enable) - ret = _efl_ui_image_smart_internal_file_set(obj, sd, eina_file_filename_get(file), file, key); + ret = _efl_ui_image_smart_internal_file_set(obj, sd); else - ret = _efl_ui_image_async_file_set(obj, sd, eina_file_filename_get(file), file, key); + ret = _efl_ui_image_async_file_set(obj, sd); return ret; } -static Eina_Bool -_efl_ui_image_smart_internal_file_set(Eo *obj, Efl_Ui_Image_Data *sd, - const char *file, const Eina_File *f, const char *key) +EOLIAN void +_efl_ui_image_efl_file_unload(Eo *obj, Efl_Ui_Image_Data *sd) { - Evas_Load_Error err; + _async_cancel(sd); + + /* stop preloading as it may hit to-be-freed memory */ + if (sd->img && sd->preload_status == EFL_UI_IMAGE_PRELOADING) + evas_object_image_preload(sd->img, EINA_TRUE); + + if (sd->remote.copier) _efl_ui_image_remote_copier_cancel(obj, sd); + if (sd->remote.binbuf) ELM_SAFE_FREE(sd->remote.binbuf, eina_binbuf_free); + + if (sd->anim) + { + ELM_SAFE_FREE(sd->anim_timer, ecore_timer_del); + sd->play = EINA_FALSE; + sd->anim = EINA_FALSE; + } + + if (sd->prev_img) + _prev_img_del(sd); + _efl_ui_image_file_set_do(obj); + efl_file_unload(sd->img); + efl_file_unload(efl_super(obj, MY_CLASS)); + if (sd->preload_status == EFL_UI_IMAGE_PRELOAD_DISABLED) + _prev_img_del(sd); + else + { + evas_object_hide(sd->img); + sd->preload_status = EFL_UI_IMAGE_PRELOADING; + evas_object_image_preload(sd->img, EINA_FALSE); + } + + _efl_ui_image_sizing_eval(obj); +} + +static Eina_Error +_efl_ui_image_smart_internal_file_set(Eo *obj, Efl_Ui_Image_Data *sd) +{ + Eina_Error err; + const Eina_File *f; + const char *key; + const char *file = efl_file_get(obj); if (eina_str_has_extension(file, ".edj")) - return _efl_ui_image_edje_file_set(obj, file, f, key); + return _efl_ui_image_edje_file_set(obj); + + err = efl_file_load(efl_super(obj, MY_CLASS)); + if (err) return err; + + f = efl_file_mmap_get(obj); + key = efl_file_key_get(obj); _efl_ui_image_file_set_do(obj); - if (f) - evas_object_image_mmap_set(sd->img, f, key); - else - evas_object_image_file_set(sd->img, file, key); + evas_object_image_mmap_set(sd->img, f, key); err = evas_object_image_load_error_get(sd->img); - if (err != EVAS_LOAD_ERROR_NONE) + if (err) { if (file || f) { if (key) ERR("Failed to load image '%s' '%s': %s. (%p)", - file ? file : eina_file_filename_get(f), key, + eina_file_filename_get(f), key, evas_load_error_str(err), obj); else ERR("Failed to load image '%s': %s. (%p)", - file ? file : eina_file_filename_get(f), + eina_file_filename_get(f), evas_load_error_str(err), obj); } else @@ -922,7 +990,7 @@ _efl_ui_image_smart_internal_file_set(Eo *obj, Efl_Ui_Image_Data *sd, ERR("NULL image file passed! (%p)", obj); } _prev_img_del(sd); - return EINA_FALSE; + return err; } if (sd->preload_status == EFL_UI_IMAGE_PRELOAD_DISABLED) @@ -936,7 +1004,7 @@ _efl_ui_image_smart_internal_file_set(Eo *obj, Efl_Ui_Image_Data *sd, _efl_ui_image_sizing_eval(obj); - return EINA_TRUE; + return 0; } static void @@ -973,7 +1041,7 @@ _efl_ui_image_remote_copier_done(void *data, const Efl_Event *event EINA_UNUSED) Eina_File *f; Eo *dialer; const char *url; - Eina_Bool ret = EINA_FALSE; + Eina_Error ret; /* we're called from _efl_ui_image_remote_copier_cancel() */ if (!sd->remote.copier) return; @@ -991,11 +1059,11 @@ _efl_ui_image_remote_copier_done(void *data, const Efl_Event *event EINA_UNUSED) eina_binbuf_string_get(sd->remote.binbuf), eina_binbuf_length_get(sd->remote.binbuf), EINA_FALSE); - - ret = _efl_ui_image_smart_internal_file_set(obj, sd, url, f, sd->remote.key); + efl_file_mmap_set(obj, f); + ret = _efl_ui_image_smart_internal_file_set(obj, sd); eina_file_close(f); - if (!ret) + if (ret) { Efl_Ui_Image_Error err = { 0, EINA_TRUE }; @@ -1051,11 +1119,12 @@ EFL_CALLBACKS_ARRAY_DEFINE(_efl_ui_image_remote_copier_cbs, { EFL_IO_COPIER_EVENT_PROGRESS, _efl_ui_image_remote_copier_progress }); static Eina_Bool -_efl_ui_image_download(Eo *obj, Efl_Ui_Image_Data *sd, const char *url, const char *key) +_efl_ui_image_download(Eo *obj, Efl_Ui_Image_Data *sd, const char *url) { Eo *dialer; Efl_Ui_Image_Error img_err = { ENOSYS, EINA_FALSE }; Eina_Error err; + const char *key = efl_file_key_get(obj); dialer = efl_add(EFL_NET_DIALER_HTTP_CLASS, obj, efl_net_dialer_http_allow_redirects_set(efl_added, EINA_TRUE)); @@ -1090,72 +1159,23 @@ _efl_ui_image_download(Eo *obj, Efl_Ui_Image_Data *sd, const char *url, const ch return EINA_FALSE; } -static const Eina_Slice remote_uri[] = { - EINA_SLICE_STR_LITERAL("http://"), - EINA_SLICE_STR_LITERAL("https://"), - EINA_SLICE_STR_LITERAL("ftp://"), - { } -}; - -static inline Eina_Bool -_efl_ui_image_is_remote(const char *file) +EOLIAN static const char* +_efl_ui_image_efl_layout_group_group_data_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, const char *key) { - Eina_Slice s = EINA_SLICE_STR(file); - const Eina_Slice *itr; - - for (itr = remote_uri; itr->mem; itr++) - if (eina_slice_startswith(s, *itr)) - return EINA_TRUE; - - return EINA_FALSE; + if (sd->edje) + return edje_object_data_get(sd->img, key); + return NULL; } EOLIAN static Eina_Bool -_efl_ui_image_efl_file_file_set(Eo *obj, Efl_Ui_Image_Data *sd, const char *file, const char *key) +_efl_ui_image_efl_layout_group_part_exist_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, const char *part) { - Eina_Bool ret = EINA_FALSE; - - _async_cancel(sd); - - /* stop preloading as it may hit to-be-freed memory */ - if (sd->img && sd->preload_status == EFL_UI_IMAGE_PRELOADING) - evas_object_image_preload(sd->img, EINA_TRUE); - - if (sd->remote.copier) _efl_ui_image_remote_copier_cancel(obj, sd); - if (sd->remote.binbuf) ELM_SAFE_FREE(sd->remote.binbuf, eina_binbuf_free); - - if (sd->anim) - { - ELM_SAFE_FREE(sd->anim_timer, ecore_timer_del); - sd->play = EINA_FALSE; - sd->anim = EINA_FALSE; - } - - if (!file) - { - 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)) - { - evas_object_hide(sd->img); - if (_efl_ui_image_download(obj, sd, file, key)) - { - evas_object_smart_callback_call(obj, SIG_DOWNLOAD_START, NULL); - return EINA_TRUE; - } - } - - if (!sd->async_enable) - ret = _efl_ui_image_smart_internal_file_set(obj, sd, file, NULL, key); - else - ret = _efl_ui_image_async_file_set(obj, sd, file, NULL, key); - - return ret; + if (sd->edje) + return edje_object_part_exists(sd->img, part); + return EINA_FALSE; } + EOLIAN static void _efl_ui_image_efl_layout_signal_signal_emit(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, const char *emission, const char *source) { @@ -1196,20 +1216,49 @@ _efl_ui_image_efl_layout_calc_calc_size_min(Eo *obj EINA_UNUSED, Efl_Ui_Image_Da else { // Ignore restricted here? Combine with min? Hmm... - return efl_gfx_size_hint_combined_min_get(sd->img); + return efl_gfx_hint_size_combined_min_get(sd->img); } } -EOLIAN static void -_efl_ui_image_efl_file_file_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, const char **file, const char **key) +EOLIAN Eina_Rect +_efl_ui_image_efl_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd) { - if (sd->async.th) + if (sd->edje) + return efl_layout_calc_parts_extends(sd->img); + return efl_gfx_entity_geometry_get(sd->img); +} + +EOLIAN static int +_efl_ui_image_efl_layout_calc_calc_freeze(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd) +{ + if (sd->edje) return edje_object_freeze(sd->img); + return 0; +} + +EOLIAN static int +_efl_ui_image_efl_layout_calc_calc_thaw(Eo *obj, Efl_Ui_Image_Data *sd) +{ + if (sd->edje) { - if (file) *file = sd->async.file; - if (key) *key = sd->async.key; - return; + int ret = edje_object_thaw(sd->img); + elm_layout_sizing_eval(obj); + return ret; } - efl_file_get(sd->img, file, key); + return 0; +} + +EOLIAN void +_efl_ui_image_efl_layout_calc_calc_auto_update_hints_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, Eina_Bool update) +{ + if (sd->edje) + efl_layout_calc_auto_update_hints_set(sd->img, update); +} + +EOLIAN Eina_Bool +_efl_ui_image_efl_layout_calc_calc_auto_update_hints_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd) +{ + if (sd->edje) return efl_layout_calc_auto_update_hints_get(sd->img); + return EINA_TRUE; } #if 0 @@ -1661,7 +1710,7 @@ _icon_freedesktop_set(Evas_Object *obj, const char *name, int size) if (sd->freedesktop.use) { sd->freedesktop.requested_size = size; - efl_file_set(obj, path, NULL); + efl_file_simple_load(obj, path, NULL); return EINA_TRUE; } return EINA_FALSE; @@ -1729,7 +1778,7 @@ _internal_efl_ui_image_icon_set(Evas_Object *obj, const char *name, Eina_Bool *f { if (fdo) *fdo = EINA_FALSE; - return efl_file_set(obj, name, NULL); + return efl_file_simple_load(obj, name, NULL); } /* if that fails, see if icon name is in the format size/name. if so, @@ -1787,12 +1836,14 @@ _update_viewmodel(Eo *obj, Efl_Ui_Image_Data *pd) Eina_File *f = NULL; char *file = NULL; char *key = NULL; + Efl_Model *model; - if (!pd->property.model) return ; + model = efl_ui_view_model_get(obj); + if (!model) return ; - vfile = efl_model_property_get(pd->property.model, pd->property.file); + vfile = efl_model_property_get(model, pd->property.file); if (!vfile) return; - vkey = efl_model_property_get(pd->property.model, pd->property.key); + vkey = efl_model_property_get(model, pd->property.key); if (eina_value_type_get(vfile) == EINA_VALUE_TYPE_ERROR) goto err; @@ -1811,13 +1862,13 @@ _update_viewmodel(Eo *obj, Efl_Ui_Image_Data *pd) { eina_value_get(vfile, &f); - efl_file_mmap_set(obj, f, key); + efl_file_simple_mmap_load(obj, f, key); } else { file = eina_value_to_string(vfile); - efl_file_set(obj, file, key); + efl_file_simple_load(obj, file, key); } } @@ -1864,50 +1915,59 @@ _efl_ui_image_model_properties_changed_cb(void *data, const Efl_Event *event) EOLIAN static void _efl_ui_image_efl_ui_view_model_set(Eo *obj, Efl_Ui_Image_Data *pd, Efl_Model *model) { - if (pd->property.model) + Efl_Model *setted; + + setted = efl_ui_view_model_get(obj); + if (setted) { - efl_event_callback_del(pd->property.model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, + efl_event_callback_del(setted, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _efl_ui_image_model_properties_changed_cb, obj); } - efl_replace(&pd->property.model, model); + efl_ui_view_model_set(efl_super(obj, EFL_UI_IMAGE_CLASS), model); - if (model) + setted = efl_ui_view_model_get(obj); + if (setted) { - efl_event_callback_add(model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, + efl_event_callback_add(setted, 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(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd) +EOLIAN static Eina_Error +_efl_ui_image_efl_ui_property_bind_property_bind(Eo *obj, Efl_Ui_Image_Data *pd, const char *key, const char *property) { - return pd->property.model; -} + Eina_Stringshare *sk; -EOLIAN static void -_efl_ui_image_efl_ui_model_connect_connect(Eo *obj, Efl_Ui_Image_Data *pd, const char *name, const char *property) -{ - if (strcmp(name, "filename") == 0) + if (strcmp(key, "filename") == 0) { pd->property.icon = EINA_FALSE; eina_stringshare_replace(&pd->property.file, property); } - else if (strcmp(name, "icon") == 0) + else if (strcmp(key, "icon") == 0) { 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) + else if (strcmp(key, "key") == 0) { eina_stringshare_replace(&pd->property.key, property); } - else return; + else + { + return efl_ui_property_bind(efl_super(obj, EFL_UI_IMAGE_CLASS), key, property); + } _update_viewmodel(obj, pd); + + sk = eina_stringshare_add(key); + efl_event_callback_call(obj, EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND, (void*) sk); + eina_stringshare_del(sk); + + return 0; } EAPI void @@ -1946,7 +2006,7 @@ elm_image_file_set(Evas_Object *obj, const char *file, const char *group) Eina_Bool ret = EINA_FALSE; EFL_UI_IMAGE_CHECK(obj) EINA_FALSE; - ret = efl_file_set(obj, file, group); + ret = efl_file_simple_load(obj, file, group); _efl_ui_image_sizing_eval(obj); return ret; } @@ -1954,14 +2014,14 @@ elm_image_file_set(Evas_Object *obj, const char *file, const char *group) EAPI void elm_image_file_get(const Eo *obj, const char **file, const char **group) { - efl_file_get((Eo *) obj, file, group); + efl_file_simple_get((Eo *) obj, file, group); } EAPI Eina_Bool elm_image_mmap_set(Evas_Object *obj, const Eina_File *file, const char *group) { EFL_UI_IMAGE_CHECK(obj) EINA_FALSE; - return efl_file_mmap_set(obj, file, group); + return efl_file_simple_mmap_load(obj, file, group); } EAPI Eina_Bool @@ -2223,7 +2283,7 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_image, Efl_Ui_Image_Data) #include "efl_ui_image.eo.c" -#include "efl_ui_image_legacy.eo.h" +#include "efl_ui_image_legacy_eo.h" #define MY_CLASS_NAME_LEGACY "elm_image" @@ -2248,9 +2308,9 @@ elm_image_add(Evas_Object *parent) 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); + efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _on_size_hints_changed, priv); return obj; } -#include "efl_ui_image_legacy.eo.c" +#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 d512ad881f..5202850d36 100644 --- a/src/lib/elementary/efl_ui_image.eo +++ b/src/lib/elementary/efl_ui_image.eo @@ -1,37 +1,38 @@ -struct Efl.Ui.Image_Progress +struct @beta Efl.Ui.Image_Progress { [[ Structure associated with smart callback 'download,progress'. - @since 1.8 ]] now: double; [[Current percentage]] total: double; [[Total percentage]] } -struct Efl.Ui.Image_Error +struct @beta Efl.Ui.Image_Error { [[ Structure associated with smart callback 'download,progress'. - @since 1.8 ]] status: int; [[Error status of the download]] open_error: bool; [[$true if the error happened when opening the file, $false otherwise]] } -class Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Ui.Clickable, Efl.Ui.Draggable, +class @beta Efl.Ui.Image extends Efl.Ui.Widget implements 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.Calc, Efl.Layout.Group, Efl.Layout.Signal { - [[ Efl UI image class]] + [[Efl UI image class + + When loading images from a file, the @Efl.File.key property can be used to access different + streams. For example, when accessing Evas image caches. + ]] event_prefix: efl_ui_image; methods { @property scalable { [[Enable or disable scaling up or down the internal image. - - @since 1.18]] + ]] values { scale_up: bool; [[If $true, the internal image might be scaled up if necessary according to the scale type. @@ -45,8 +46,7 @@ class Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Ui.Clickable, Efl.Ui.Dra } @property align { [[Controls how the internal image is positioned inside an image object. - - @since 1.18]] + ]] values { align_x: double; [[Alignment in the horizontal axis (0 <= align_x <= 1).]] align_y: double; [[Alignment in the vertical axis (0 <= align_y <= 1).]] @@ -66,8 +66,8 @@ class Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Ui.Clickable, Efl.Ui.Dra the absolute path of an image file, this image will be used. Lookup order used by @.icon.set can be set using "icon_theme" in config. - Note: The image set by this function can be changed by - @Efl.File.file.set. + Note: The image set by this function is changed when + @Efl.File.load is called. Note: This function does not accept relative icon path. @@ -89,8 +89,8 @@ class Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Ui.Clickable, Efl.Ui.Dra } implements { Efl.Object.constructor; - Efl.File.file { get; set; } - Efl.File.mmap { set; } + Efl.File.load; + Efl.File.unload; Efl.Gfx.Color.color { set; } Efl.Gfx.Entity.visible { set; } Efl.Gfx.Entity.position { set; } @@ -107,15 +107,21 @@ class Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Ui.Clickable, Efl.Ui.Dra Efl.Layout.Signal.signal_emit; 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.Calc.calc_freeze; + Efl.Layout.Calc.calc_thaw; + Efl.Layout.Calc.calc_auto_update_hints { get; set; } Efl.Layout.Calc.calc_size_min; + Efl.Layout.Calc.calc_parts_extends; Efl.Layout.Calc.calc_force; - Efl.Canvas.Object.clip { set; } + Efl.Canvas.Object.clipper { set; } Efl.Canvas.Group.group_member_add; Efl.Ui.Draggable.drag_target { get; set; } - Efl.Ui.Model.Connect.connect; - Efl.Ui.View.model { get; set; } + Efl.Ui.Property_Bind.property_bind; + Efl.Ui.View.model { set; } Efl.Ui.Widget.theme_apply; - Efl.Ui.Widget.widget_event; + Efl.Ui.Widget.widget_input_event_handler; Efl.Access.Component.extents { get; } Efl.Access.Widget.Action.elm_actions { get; } } diff --git a/src/lib/elementary/efl_ui_image_factory.c b/src/lib/elementary/efl_ui_image_factory.c index ce4d892dfa..9bf9f39a9c 100644 --- a/src/lib/elementary/efl_ui_image_factory.c +++ b/src/lib/elementary/efl_ui_image_factory.c @@ -17,7 +17,7 @@ EOLIAN static Eo * _efl_ui_image_factory_efl_object_constructor(Eo *obj, Efl_Ui_Image_Factory_Data *pd) { obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_ui_caching_factory_item_class_set(obj, EFL_UI_IMAGE_CLASS); + efl_ui_widget_factory_item_class_set(obj, EFL_UI_IMAGE_CLASS); pd->property = NULL; @@ -34,14 +34,14 @@ _efl_ui_image_factory_efl_object_destructor(Eo *obj EINA_UNUSED, Efl_Ui_Image_Fa } static Eina_Value -_efl_ui_image_factory_connect(Eo *obj EINA_UNUSED, void *data, const Eina_Value value) +_efl_ui_image_factory_bind(Eo *obj EINA_UNUSED, void *data, const Eina_Value value) { Efl_Gfx_Entity *entity = NULL; Efl_Ui_Image_Factory_Data *pd = data; eina_value_pget(&value, &entity); - efl_ui_model_connect(entity, "filename", pd->property); + efl_ui_property_bind(entity, "filename", pd->property); return value; } @@ -58,14 +58,15 @@ _efl_ui_image_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Image_Factory_Data * return efl_future_then(obj, f, .success_type = EINA_VALUE_TYPE_OBJECT, - .success = _efl_ui_image_factory_connect, + .success = _efl_ui_image_factory_bind, .data = pd); } -EOLIAN static void -_efl_ui_image_factory_efl_ui_model_connect_connect(Eo *obj EINA_UNUSED, Efl_Ui_Image_Factory_Data *pd, const char *name EINA_UNUSED, const char *property) +EOLIAN static Eina_Error +_efl_ui_image_factory_efl_ui_property_bind_property_bind(Eo *obj EINA_UNUSED, Efl_Ui_Image_Factory_Data *pd, const char *key EINA_UNUSED, const char *property) { - eina_stringshare_replace(&pd->property, property); + eina_stringshare_replace(&pd->property, property); + return 0; } #include "efl_ui_image_factory.eo.c" diff --git a/src/lib/elementary/efl_ui_image_factory.eo b/src/lib/elementary/efl_ui_image_factory.eo index 2b5c97e4b4..5ebcc1cd32 100644 --- a/src/lib/elementary/efl_ui_image_factory.eo +++ b/src/lib/elementary/efl_ui_image_factory.eo @@ -1,10 +1,10 @@ -class Efl.Ui.Image_Factory extends Efl.Ui.Caching_Factory +class @beta Efl.Ui.Image_Factory extends Efl.Ui.Caching_Factory { [[Efl UI image factory class]] implements { Efl.Object.constructor; Efl.Object.destructor; Efl.Ui.Factory.create; - Efl.Ui.Model.Connect.connect; + Efl.Ui.Property_Bind.property_bind; } } diff --git a/src/lib/elementary/efl_ui_image_legacy.eo b/src/lib/elementary/efl_ui_image_legacy.eo deleted file mode 100644 index 15a3005746..0000000000 --- a/src/lib/elementary/efl_ui_image_legacy.eo +++ /dev/null @@ -1,9 +0,0 @@ -class Efl.Ui.Image_Legacy extends Efl.Ui.Image implements Efl.Ui.Legacy -{ - [[ Efl UI image class]] - data: null; - implements { - class.constructor; - Efl.Object.constructor; - } -} diff --git a/src/lib/elementary/efl_ui_image_legacy_eo.c b/src/lib/elementary/efl_ui_image_legacy_eo.c new file mode 100644 index 0000000000..7a8f61adce --- /dev/null +++ b/src/lib/elementary/efl_ui_image_legacy_eo.c @@ -0,0 +1,35 @@ + +Efl_Object *_efl_ui_image_legacy_efl_object_constructor(Eo *obj, void *pd); + + +static Eina_Bool +_efl_ui_image_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_IMAGE_LEGACY_EXTRA_OPS +#define EFL_UI_IMAGE_LEGACY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _efl_ui_image_legacy_efl_object_constructor), + EFL_UI_IMAGE_LEGACY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_image_legacy_class_desc = { + EO_VERSION, + "Efl.Ui.Image_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _efl_ui_image_legacy_class_initializer, + _efl_ui_image_legacy_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_image_legacy_class_get, &_efl_ui_image_legacy_class_desc, EFL_UI_IMAGE_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/efl_ui_image_legacy_eo.h b/src/lib/elementary/efl_ui_image_legacy_eo.h new file mode 100644 index 0000000000..204a09db05 --- /dev/null +++ b/src/lib/elementary/efl_ui_image_legacy_eo.h @@ -0,0 +1,26 @@ +#ifndef _EFL_UI_IMAGE_LEGACY_EO_H_ +#define _EFL_UI_IMAGE_LEGACY_EO_H_ + +#ifndef _EFL_UI_IMAGE_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_IMAGE_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Image_Legacy; + +#endif + +#ifndef _EFL_UI_IMAGE_LEGACY_EO_TYPES +#define _EFL_UI_IMAGE_LEGACY_EO_TYPES + + +#endif +#ifdef EFL_BETA_API_SUPPORT +/** Efl UI image class + * + * @ingroup Efl_Ui_Image_Legacy + */ +#define EFL_UI_IMAGE_LEGACY_CLASS efl_ui_image_legacy_class_get() + +EWAPI const Efl_Class *efl_ui_image_legacy_class_get(void); +#endif /* EFL_BETA_API_SUPPORT */ + +#endif diff --git a/src/lib/elementary/efl_ui_image_legacy_eo.legacy.h b/src/lib/elementary/efl_ui_image_legacy_eo.legacy.h new file mode 100644 index 0000000000..3da696e85f --- /dev/null +++ b/src/lib/elementary/efl_ui_image_legacy_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_IMAGE_LEGACY_EO_LEGACY_H_ +#define _EFL_UI_IMAGE_LEGACY_EO_LEGACY_H_ + +#ifndef _EFL_UI_IMAGE_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_IMAGE_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Image_Legacy; + +#endif + +#ifndef _EFL_UI_IMAGE_LEGACY_EO_TYPES +#define _EFL_UI_IMAGE_LEGACY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c index 2a46ddb29b..0fe2bd864a 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.c +++ b/src/lib/elementary/efl_ui_image_zoomable.c @@ -6,7 +6,6 @@ #define EFL_ACCESS_WIDGET_ACTION_PROTECTED #define EFL_UI_SCROLL_MANAGER_PROTECTED #define EFL_UI_SCROLLBAR_PROTECTED -#define EFL_UI_SCROLLBAR_BETA #include @@ -144,7 +143,7 @@ _calc_job_cb(void *data) sd->minw = minw; sd->minh = minh; - efl_event_callback_call(sd->pan_obj, EFL_UI_PAN_EVENT_CONTENT_CHANGED, NULL); + efl_event_callback_call(sd->pan_obj, EFL_UI_PAN_EVENT_PAN_CONTENT_CHANGED, NULL); _sizing_eval(obj); } sd->calc_job = NULL; @@ -399,7 +398,7 @@ _efl_ui_image_zoomable_pan_efl_ui_pan_pan_position_set(Eo *obj, Efl_Ui_Image_Zoo psd->wsd->pan_y = pos.y; evas_object_smart_changed(obj); - efl_event_callback_call(obj, EFL_UI_PAN_EVENT_POSITION_CHANGED, NULL); + efl_event_callback_call(obj, EFL_UI_PAN_EVENT_PAN_POSITION_CHANGED, NULL); } EOLIAN static Eina_Position2D @@ -826,7 +825,7 @@ _zoom_anim_cb(void *data, const Efl_Event *event EINA_UNUSED) { sd->no_smooth--; if (!sd->no_smooth) _smooth_update(data); - efl_event_callback_del(obj, EFL_EVENT_ANIMATOR_TICK, _zoom_anim_cb, obj); + efl_event_callback_del(obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _zoom_anim_cb, obj); efl_event_callback_legacy_call(obj, EFL_UI_EVENT_ZOOM_STOP, NULL); } } @@ -921,17 +920,17 @@ _efl_ui_image_zoomable_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Image return EINA_TRUE; } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_image_zoomable_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; Eina_Bool fdo = EINA_FALSE; if (sd->stdicon) _internal_efl_ui_image_zoomable_icon_set(obj, sd->stdicon, &fdo, EINA_TRUE); int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; efl_ui_mirrored_set(sd->smanager, efl_ui_mirrored_get(obj)); @@ -1059,7 +1058,7 @@ _bounce_eval(void *data, const Efl_Event *event EINA_UNUSED) efl_ui_scrollable_scroll_freeze_set(sd->smanager, EINA_FALSE); - efl_event_callback_del(obj, EFL_EVENT_ANIMATOR_TICK, _bounce_eval, obj); + efl_event_callback_del(obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _bounce_eval, obj); } static void @@ -1067,7 +1066,7 @@ _efl_ui_image_zoomable_bounce_reset(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd EINA { Eina_Bool r; - r = efl_event_callback_del(obj, EFL_EVENT_ANIMATOR_TICK, _bounce_eval, obj); + r = efl_event_callback_del(obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _bounce_eval, obj); if (r) _zoom_do(obj, 1.0); } @@ -1076,7 +1075,7 @@ _efl_ui_image_zoomable_zoom_reset(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd) { Eina_Bool r; - r = efl_event_callback_del(obj, EFL_EVENT_ANIMATOR_TICK, _zoom_anim_cb, obj); + r = efl_event_callback_del(obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _zoom_anim_cb, obj); if (r) { sd->no_smooth--; @@ -1276,7 +1275,7 @@ _g_layer_zoom_end_cb(void *data, sd->g_layer_zoom.bounce.t_end = t + _elm_config->page_scroll_friction; - efl_event_callback_add(obj, EFL_EVENT_ANIMATOR_TICK, _bounce_eval, obj); + efl_event_callback_add(obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _bounce_eval, obj); } else { @@ -1610,108 +1609,108 @@ _efl_ui_image_zoomable_edje_object_attach(Eo *obj) if (elm_widget_is_legacy(obj)) { efl_layout_signal_callback_add - (obj, "reload", "elm", _efl_ui_image_zoomable_reload_cb, obj); + (obj, "reload", "elm", obj, _efl_ui_image_zoomable_reload_cb, NULL); efl_layout_signal_callback_add (obj, "drag", "elm.dragable.vbar", - _efl_ui_image_zoomable_vbar_drag_cb, obj); + obj, _efl_ui_image_zoomable_vbar_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,set", "elm.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,start", "elm.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_start_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_start_cb, NULL); efl_layout_signal_callback_add (obj, "drag,stop", "elm.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_stop_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_stop_cb, NULL); efl_layout_signal_callback_add (obj, "drag,step", "elm.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,page", "elm.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "elm,vbar,press", "elm", - _efl_ui_image_zoomable_vbar_press_cb, obj); + obj, _efl_ui_image_zoomable_vbar_press_cb, NULL); efl_layout_signal_callback_add (obj, "elm,vbar,unpress", "elm", - _efl_ui_image_zoomable_vbar_unpress_cb, obj); + obj, _efl_ui_image_zoomable_vbar_unpress_cb, NULL); efl_layout_signal_callback_add (obj, "drag", "elm.dragable.hbar", - _efl_ui_image_zoomable_hbar_drag_cb, obj); + obj, _efl_ui_image_zoomable_hbar_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,set", "elm.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,start", "elm.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_start_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_start_cb, NULL); efl_layout_signal_callback_add (obj, "drag,stop", "elm.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_stop_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_stop_cb, NULL); efl_layout_signal_callback_add (obj, "drag,step", "elm.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,page", "elm.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "elm,hbar,press", "elm", - _efl_ui_image_zoomable_hbar_press_cb, obj); + obj, _efl_ui_image_zoomable_hbar_press_cb, NULL); efl_layout_signal_callback_add (obj, "elm,hbar,unpress", "elm", - _efl_ui_image_zoomable_hbar_unpress_cb, obj); + obj, _efl_ui_image_zoomable_hbar_unpress_cb, NULL); } else { efl_layout_signal_callback_add - (obj, "reload", "efl", _efl_ui_image_zoomable_reload_cb, obj); + (obj, "reload", "efl", obj, _efl_ui_image_zoomable_reload_cb, NULL); efl_layout_signal_callback_add - (obj, "drag", "efl.dragable.vbar", _efl_ui_image_zoomable_vbar_drag_cb, - obj); + (obj, "drag", "efl.dragable.vbar", + obj, _efl_ui_image_zoomable_vbar_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,set", "efl.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,start", "efl.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_start_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_start_cb, NULL); efl_layout_signal_callback_add (obj, "drag,stop", "efl.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_stop_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_stop_cb, NULL); efl_layout_signal_callback_add (obj, "drag,step", "efl.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,page", "efl.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "efl,vbar,press", "efl", - _efl_ui_image_zoomable_vbar_press_cb, obj); + obj, _efl_ui_image_zoomable_vbar_press_cb, NULL); efl_layout_signal_callback_add (obj, "efl,vbar,unpress", "efl", - _efl_ui_image_zoomable_vbar_unpress_cb, obj); + obj, _efl_ui_image_zoomable_vbar_unpress_cb, NULL); efl_layout_signal_callback_add - (obj, "drag", "efl.dragable.hbar", _efl_ui_image_zoomable_hbar_drag_cb, - obj); + (obj, "drag", "efl.dragable.hbar", + obj, _efl_ui_image_zoomable_hbar_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,set", "efl.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,start", "efl.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_start_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_start_cb, NULL); efl_layout_signal_callback_add (obj, "drag,stop", "efl.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_stop_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_stop_cb, NULL); efl_layout_signal_callback_add (obj, "drag,step", "efl.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,page", "efl.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "efl,hbar,press", "efl", - _efl_ui_image_zoomable_hbar_press_cb, obj); + obj, _efl_ui_image_zoomable_hbar_press_cb, NULL); efl_layout_signal_callback_add (obj, "efl,hbar,unpress", "efl", - _efl_ui_image_zoomable_hbar_unpress_cb, obj); + obj, _efl_ui_image_zoomable_hbar_unpress_cb, NULL); } } @@ -1721,108 +1720,108 @@ _efl_ui_image_zoomable_edje_object_detach(Evas_Object *obj) if (elm_widget_is_legacy(obj)) { efl_layout_signal_callback_del - (obj, "reload", "elm", _efl_ui_image_zoomable_reload_cb, obj); + (obj, "reload", "elm", obj, _efl_ui_image_zoomable_reload_cb, NULL); efl_layout_signal_callback_del (obj, "drag", "elm.dragable.vbar", - _efl_ui_image_zoomable_vbar_drag_cb, obj); + obj, _efl_ui_image_zoomable_vbar_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,set", "elm.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,start", "elm.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_start_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_start_cb, NULL); efl_layout_signal_callback_del (obj, "drag,stop", "elm.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_stop_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_stop_cb, NULL); efl_layout_signal_callback_del (obj, "drag,step", "elm.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,page", "elm.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "elm,vbar,press", "elm", - _efl_ui_image_zoomable_vbar_press_cb, obj); + obj, _efl_ui_image_zoomable_vbar_press_cb, NULL); efl_layout_signal_callback_del (obj, "elm,vbar,unpress", "elm", - _efl_ui_image_zoomable_vbar_unpress_cb, obj); + obj, _efl_ui_image_zoomable_vbar_unpress_cb, NULL); efl_layout_signal_callback_del (obj, "drag", "elm.dragable.hbar", - _efl_ui_image_zoomable_hbar_drag_cb, obj); + obj, _efl_ui_image_zoomable_hbar_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,set", "elm.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,start", "elm.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_start_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_start_cb, NULL); efl_layout_signal_callback_del (obj, "drag,stop", "elm.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_stop_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_stop_cb, NULL); efl_layout_signal_callback_del (obj, "drag,step", "elm.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,page", "elm.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "elm,hbar,press", "elm", - _efl_ui_image_zoomable_hbar_press_cb, obj); + obj, _efl_ui_image_zoomable_hbar_press_cb, NULL); efl_layout_signal_callback_del (obj, "elm,hbar,unpress", "elm", - _efl_ui_image_zoomable_hbar_unpress_cb, obj); + obj, _efl_ui_image_zoomable_hbar_unpress_cb, NULL); } else { efl_layout_signal_callback_del - (obj, "reload", "efl", _efl_ui_image_zoomable_reload_cb, obj); + (obj, "reload", "efl", obj, _efl_ui_image_zoomable_reload_cb, NULL); efl_layout_signal_callback_del (obj, "drag", "efl.dragable.vbar", - _efl_ui_image_zoomable_vbar_drag_cb, obj); + obj, _efl_ui_image_zoomable_vbar_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,set", "efl.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,start", "efl.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_start_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_start_cb, NULL); efl_layout_signal_callback_del (obj, "drag,stop", "efl.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_stop_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_stop_cb, NULL); efl_layout_signal_callback_del (obj, "drag,step", "efl.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,page", "efl.dragable.vbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "efl,vbar,press", "efl", - _efl_ui_image_zoomable_vbar_press_cb, obj); + obj, _efl_ui_image_zoomable_vbar_press_cb, NULL); efl_layout_signal_callback_del (obj, "efl,vbar,unpress", "efl", - _efl_ui_image_zoomable_vbar_unpress_cb, obj); + obj, _efl_ui_image_zoomable_vbar_unpress_cb, NULL); efl_layout_signal_callback_del (obj, "drag", "efl.dragable.hbar", - _efl_ui_image_zoomable_hbar_drag_cb, obj); + obj, _efl_ui_image_zoomable_hbar_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,set", "efl.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,start", "efl.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_start_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_start_cb, NULL); efl_layout_signal_callback_del (obj, "drag,stop", "efl.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_stop_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_stop_cb, NULL); efl_layout_signal_callback_del (obj, "drag,step", "efl.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,page", "efl.dragable.hbar", - _efl_ui_image_zoomable_edje_drag_cb, obj); + obj, _efl_ui_image_zoomable_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "efl,hbar,press", "efl", - _efl_ui_image_zoomable_hbar_press_cb, obj); + obj, _efl_ui_image_zoomable_hbar_press_cb, NULL); efl_layout_signal_callback_del (obj, "efl,hbar,unpress", "efl", - _efl_ui_image_zoomable_hbar_unpress_cb, obj); + obj, _efl_ui_image_zoomable_hbar_unpress_cb, NULL); } } @@ -1834,8 +1833,6 @@ _efl_ui_image_zoomable_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Image_Zoomable Evas_Object *edje; Evas_Coord minw, minh; - elm_widget_sub_object_parent_add(obj); - edje = edje_object_add(evas_object_evas_get(obj)); elm_widget_resize_object_set(obj, edje); @@ -1928,8 +1925,8 @@ _efl_ui_image_zoomable_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Image_Zoomable ecore_job_del(sd->calc_job); ecore_timer_del(sd->scr_timer); ecore_timer_del(sd->long_timer); - efl_event_callback_del(obj, EFL_EVENT_ANIMATOR_TICK, _zoom_anim_cb, obj); - efl_event_callback_del(obj, EFL_EVENT_ANIMATOR_TICK, _bounce_eval, obj); + efl_event_callback_del(obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _zoom_anim_cb, obj); + efl_event_callback_del(obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _bounce_eval, obj); efl_event_callback_del(obj, EFL_UI_EVENT_SCROLL, _scroll_cb, obj); _efl_ui_image_zoomable_edje_object_detach(obj); @@ -1999,35 +1996,39 @@ _efl_ui_image_zoomable_efl_layout_group_group_size_max_get(const Eo *obj EINA_UN } EOLIAN static Eina_Bool -_efl_ui_image_zoomable_efl_layout_signal_signal_callback_add(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd EINA_UNUSED, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data) +_efl_ui_image_zoomable_efl_layout_signal_signal_callback_add(Eo *obj, Efl_Ui_Image_Zoomable_Data *pd EINA_UNUSED, + const char *emission, const char *source, + void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb) { 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); + ok = efl_layout_signal_callback_add(wd->resize_obj, emission, source, func_data, func, func_free_cb); return ok; } EOLIAN static Eina_Bool -_efl_ui_image_zoomable_efl_layout_signal_signal_callback_del(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd EINA_UNUSED, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data) +_efl_ui_image_zoomable_efl_layout_signal_signal_callback_del(Eo *obj, Efl_Ui_Image_Zoomable_Data *pd EINA_UNUSED, + const char *emission, const char *source, + void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb) { 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); + ok = efl_layout_signal_callback_del(wd->resize_obj, emission, source, func_data, func, func_free_cb); return ok; } -static Eina_Bool +static Eina_Error _img_proxy_set(Evas_Object *obj, Efl_Ui_Image_Zoomable_Data *sd, - const char *file, const Eina_File *f, const char *group, Eina_Bool resize) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); double tz; int w, h; + Eina_Error err = 0; sd->zoom = 1.0; evas_object_image_smooth_scale_set(sd->img, (sd->no_smooth == 0)); @@ -2039,23 +2040,13 @@ _img_proxy_set(Evas_Object *obj, Efl_Ui_Image_Zoomable_Data *sd, sd->edje = edje_object_add(evas_object_evas_get(obj)); if (!resize) { - if (f) + efl_file_key_set(sd->edje, efl_file_key_get(obj)); + err = efl_file_mmap_set(sd->edje, efl_file_mmap_get(obj)); + if (err) { - if (!edje_object_mmap_set(sd->edje, f, group)) - { - ERR("failed to set edje file '%s', group '%s': %s", sd->file, group, - edje_load_error_str(edje_object_load_error_get(sd->edje))); - return EINA_FALSE; - } - } - else if (file) - { - if (!edje_object_file_set(sd->edje, file, group)) - { - ERR("failed to set edje file '%s', group '%s': %s", file, group, - edje_load_error_str(edje_object_load_error_get(sd->edje))); - return EINA_FALSE; - } + ERR("failed to set edje file '%s', group '%s': %s", efl_file_get(obj), efl_file_key_get(obj), + edje_load_error_str(edje_object_load_error_get(sd->edje))); + return err; } } @@ -2097,41 +2088,39 @@ _img_proxy_set(Evas_Object *obj, Efl_Ui_Image_Zoomable_Data *sd, sd->flip = EFL_FLIP_NONE; sd->orientation_changed = EINA_FALSE; - return EINA_TRUE; + return 0; } -static Eina_Bool -_image_zoomable_edje_file_set(Evas_Object *obj, - const char *file, - const char *group) +static Eina_Error +_image_zoomable_edje_file_set(Evas_Object *obj) { EFL_UI_IMAGE_ZOOMABLE_DATA_GET(obj, sd); - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_GFX_IMAGE_LOAD_ERROR_GENERIC); - if (file) eina_stringshare_replace(&sd->file, file); - return _img_proxy_set(obj, sd, file, NULL, group, EINA_FALSE); + return _img_proxy_set(obj, sd, EINA_FALSE); } -static void -_internal_file_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, const char *file, Eina_File *f, const char *key, Evas_Load_Error *ret) +static Eina_Error +_internal_file_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, Evas_Load_Error *ret) { - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - Evas_Load_Error err; + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_GFX_IMAGE_LOAD_ERROR_GENERIC); int w, h; double tz; + Eina_Error err = 0; + const char *file; + + file = efl_file_get(obj); if (eina_str_has_extension(file, ".edj")) { - _image_zoomable_edje_file_set(obj, file, key); - return; + return _image_zoomable_edje_file_set(obj); } // It is actually to late, we have lost the reference to the previous // file descriptor already, so we can't know if the file changed. To // be safe we do for now just force a full reload on file_set and hope // on evas to catch it, if there is no change. - eina_stringshare_replace(&sd->file, file); - sd->f = eina_file_dup(f); + sd->f = eina_file_dup(efl_file_mmap_get(obj)); evas_object_image_smooth_scale_set(sd->img, (sd->no_smooth == 0)); evas_object_image_file_set(sd->img, NULL, NULL); @@ -2142,7 +2131,7 @@ _internal_file_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, const char *file, Ei { ERR("Things are going bad for '%s' (%p) : %i", file, sd->img, err); if (ret) *ret = err; - return; + return err; } evas_object_image_size_get(sd->img, &w, &h); @@ -2158,7 +2147,7 @@ _internal_file_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, const char *file, Ei { ERR("Things are going bad for '%s' (%p)", file, sd->img); if (ret) *ret = err; - return; + return err; } evas_object_image_preload(sd->img, 0); @@ -2186,6 +2175,7 @@ _internal_file_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, const char *file, Ei sd->orientation_changed = EINA_FALSE; if (ret) *ret = evas_object_image_load_error_get(sd->img); + return efl_gfx_image_load_error_get(sd->img); } static void @@ -2236,11 +2226,11 @@ _efl_ui_image_zoomable_remote_copier_done(void *data, const Efl_Event *event EIN eina_binbuf_string_get(sd->remote.binbuf), eina_binbuf_length_get(sd->remote.binbuf), EINA_FALSE); - - _internal_file_set(obj, sd, url, f, NULL, &ret); + efl_file_mmap_set(obj, f); eina_file_close(f); + ret = _internal_file_set(obj, sd, &ret); - if (ret != EVAS_LOAD_ERROR_NONE) + if (ret) { Elm_Photocam_Error err = { 0, EINA_TRUE }; @@ -2339,8 +2329,9 @@ static const Eina_Slice remote_uri[] = { static inline Eina_Bool _efl_ui_image_zoomable_is_remote(const char *file) { - Eina_Slice s = EINA_SLICE_STR(file); const Eina_Slice *itr; + if (!file) return EINA_FALSE; + Eina_Slice s = EINA_SLICE_STR(file);; for (itr = remote_uri; itr->mem; itr++) if (eina_slice_startswith(s, *itr)) @@ -2349,11 +2340,10 @@ _efl_ui_image_zoomable_is_remote(const char *file) return EINA_FALSE; } -static Evas_Load_Error -_efl_ui_image_zoomable_file_set_internal(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, const char *file, const char *key) +static Eina_Error +_efl_ui_image_zoomable_file_set_internal(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, Evas_Load_Error *ret) { - Evas_Load_Error ret = EVAS_LOAD_ERROR_NONE; - + const char *file = efl_file_get(obj); ELM_SAFE_FREE(sd->edje, evas_object_del); eina_stringshare_replace(&sd->stdicon, NULL); @@ -2379,21 +2369,24 @@ _efl_ui_image_zoomable_file_set_internal(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd { efl_event_callback_legacy_call (obj, EFL_UI_IMAGE_ZOOMABLE_EVENT_DOWNLOAD_START, NULL); - return ret; + *ret = EVAS_LOAD_ERROR_NONE; + return 0; } } - _internal_file_set(obj, sd, file, NULL, key, &ret); - - return ret; + return _internal_file_set(obj, sd, ret); } -EOLIAN static Eina_Bool -_efl_ui_image_zoomable_efl_file_file_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, const char *file, const char *key) +EOLIAN static Eina_Error +_efl_ui_image_zoomable_efl_file_load(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd) { - Evas_Load_Error ret = _efl_ui_image_zoomable_file_set_internal(obj, sd, file, key); + Evas_Load_Error ret; + Eina_Error err; - if (ret == EVAS_LOAD_ERROR_NONE) return EINA_TRUE; + if (efl_file_loaded_get(obj)) return 0; + err = _efl_ui_image_zoomable_file_set_internal(obj, sd, &ret); + + if ((!ret) && (!err)) return 0; eina_error_set( ret == EVAS_LOAD_ERROR_DOES_NOT_EXIST ? PHOTO_FILE_LOAD_ERROR_DOES_NOT_EXIST : @@ -2403,14 +2396,20 @@ _efl_ui_image_zoomable_efl_file_file_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd ret == EVAS_LOAD_ERROR_UNKNOWN_FORMAT ? PHOTO_FILE_LOAD_ERROR_UNKNOWN_FORMAT : PHOTO_FILE_LOAD_ERROR_GENERIC ); - return EINA_FALSE; + return err; } -EOLIAN static void -_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) +EOLIAN static Eina_Error +_efl_ui_image_zoomable_efl_file_file_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd, const char *file) { - if (file) *file = sd->file; - if (key) *key = NULL; + eina_stringshare_replace(&sd->file, file); + return 0; +} + +EOLIAN static const char * +_efl_ui_image_zoomable_efl_file_file_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd) +{ + return sd->file; } EOLIAN static void @@ -2604,8 +2603,8 @@ done: } else { - an = efl_event_callback_del(obj, EFL_EVENT_ANIMATOR_TICK, _zoom_anim_cb, obj); - efl_event_callback_add(obj, EFL_EVENT_ANIMATOR_TICK, _zoom_anim_cb, obj); + an = efl_event_callback_del(obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _zoom_anim_cb, obj); + efl_event_callback_add(obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _zoom_anim_cb, obj); if (!an) { sd->no_smooth++; @@ -2648,10 +2647,10 @@ _efl_ui_image_zoomable_efl_ui_zoom_zoom_level_get(const Eo *obj EINA_UNUSED, Efl } EOLIAN static void -_efl_ui_image_zoomable_efl_ui_zoom_zoom_mode_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, Elm_Photocam_Zoom_Mode mode) +_efl_ui_image_zoomable_efl_ui_zoom_zoom_mode_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, Efl_Ui_Zoom_Mode mode) { double tz; - if (sd->mode == mode) return; + if (sd->mode == (Elm_Photocam_Zoom_Mode)mode) return; sd->mode = mode; tz = sd->zoom; @@ -2659,7 +2658,7 @@ _efl_ui_image_zoomable_efl_ui_zoom_zoom_mode_set(Eo *obj, Efl_Ui_Image_Zoomable_ elm_photocam_zoom_set(obj, tz); } -EOLIAN static Elm_Photocam_Zoom_Mode +EOLIAN static Efl_Ui_Zoom_Mode _efl_ui_image_zoomable_efl_ui_zoom_zoom_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd) { return sd->mode; @@ -2813,7 +2812,7 @@ _min_obj_size_get(Evas_Object *o, int *w, int *h) } } -static Eina_Bool +static Eina_Error _image_zoomable_object_icon_set(Evas_Object *o, const char *group, char *style, Eina_Bool resize) { Elm_Theme *th = elm_widget_theme_get(o); @@ -2829,10 +2828,10 @@ _image_zoomable_object_icon_set(Evas_Object *o, const char *group, char *style, if (f) { if (sd->f) eina_file_close(sd->f); - eina_stringshare_replace(&sd->file, eina_file_filename_get(f)); - sd->f = eina_file_dup(f); + efl_file_key_set(o, buf); + efl_file_mmap_set(o, f); - return _img_proxy_set(o, sd, NULL, f, buf, resize); + return _img_proxy_set(o, sd, resize); } ELM_SAFE_FREE(sd->edje, evas_object_del); @@ -2840,7 +2839,7 @@ _image_zoomable_object_icon_set(Evas_Object *o, const char *group, char *style, WRN("Failed to set icon '%s'. Icon theme '%s' not found", group, buf); ELM_SAFE_FREE(sd->f, eina_file_close); - return EINA_FALSE; + return EFL_GFX_IMAGE_LOAD_ERROR_UNKNOWN_COLLECTION; } static Eina_Bool @@ -2848,7 +2847,7 @@ _icon_standard_set(Evas_Object *obj, const char *name, Eina_Bool resize) { EFL_UI_IMAGE_ZOOMABLE_DATA_GET(obj, sd); - if (_image_zoomable_object_icon_set(obj, name, "default", resize)) + if (!_image_zoomable_object_icon_set(obj, name, "default", resize)) { /* TODO: elm_unneed_efreet() */ sd->freedesktop.use = EINA_FALSE; @@ -2899,7 +2898,7 @@ _icon_freedesktop_set(Evas_Object *obj, const char *name, int size) if (sd->freedesktop.use) { sd->freedesktop.requested_size = size; - efl_file_set(obj, path, NULL); + efl_file_simple_load(obj, path, NULL); return EINA_TRUE; } return EINA_FALSE; @@ -2967,7 +2966,7 @@ _internal_efl_ui_image_zoomable_icon_set(Evas_Object *obj, const char *name, Ein { if (fdo) *fdo = EINA_FALSE; - return efl_file_set(obj, name, NULL); + return efl_file_simple_load(obj, name, NULL); } /* if that fails, see if icon name is in the format size/name. if so, @@ -3177,8 +3176,9 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_image_zoomable, Efl_Ui_Image_Zoomab EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_image_zoomable) #include "efl_ui_image_zoomable.eo.c" +#include "efl_ui_image_zoomable_eo.legacy.c" -#include "efl_ui_image_zoomable_legacy.eo.h" +#include "efl_ui_image_zoomable_legacy_eo.h" #define MY_CLASS_NAME_LEGACY "elm_photocam" static void @@ -3357,9 +3357,9 @@ elm_photocam_zoom_mode_get(const Evas_Object *obj) EAPI Evas_Load_Error elm_photocam_file_set(Evas_Object *obj, const char *file) { - ELM_PHOTOCAM_CHECK(obj) EVAS_LOAD_ERROR_NONE; - EINA_SAFETY_ON_NULL_RETURN_VAL(file, EVAS_LOAD_ERROR_NONE); - if (efl_file_set(obj, file, NULL)) return EVAS_LOAD_ERROR_NONE; + ELM_PHOTOCAM_CHECK(obj) EVAS_LOAD_ERROR_GENERIC; + EINA_SAFETY_ON_NULL_RETURN_VAL(file, EVAS_LOAD_ERROR_GENERIC); + if (efl_file_simple_load(obj, file, NULL)) return EVAS_LOAD_ERROR_NONE; Eina_Error err = eina_error_get(); return err == PHOTO_FILE_LOAD_ERROR_DOES_NOT_EXIST ? @@ -3378,9 +3378,7 @@ elm_photocam_file_set(Evas_Object *obj, const char *file) EAPI const char* elm_photocam_file_get(const Evas_Object *obj) { - const char *ret = NULL; - efl_file_get(obj, &ret, NULL); - return ret; + return efl_file_get(obj); } EAPI void @@ -3433,4 +3431,4 @@ elm_photocam_image_region_get(const Efl_Ui_Image_Zoomable *obj, int *x, int *y, if (h) *h = r.h; } -#include "efl_ui_image_zoomable_legacy.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 8aa795685e..fccf57f21c 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.eo +++ b/src/lib/elementary/efl_ui_image_zoomable.eo @@ -2,12 +2,11 @@ struct @extern Elm.Photocam.Error; struct @extern Elm.Photocam.Progress; -class Efl.Ui.Image_Zoomable extends Efl.Ui.Image implements Efl.Ui.Zoom, +class @beta Efl.Ui.Image_Zoomable extends Efl.Ui.Image implements Efl.Ui.Zoom, Efl.Ui.Scrollable_Interactive, Efl.Ui.Scrollbar { [[Elementary Image Zoomable class]] - legacy_prefix: elm_photocam; methods { @property gesture_enabled { set { @@ -33,15 +32,12 @@ class Efl.Ui.Image_Zoomable extends Efl.Ui.Image implements Efl.Ui.Zoom, See also @.image_region.set. ]] - legacy: null; } set { [[Set the viewed region of the image This shows the region of the image without using animation. - @since 1.20 ]] - legacy: null; } values { region: Eina.Rect; [[The region in the original image pixels.]] @@ -64,9 +60,10 @@ class Efl.Ui.Image_Zoomable extends Efl.Ui.Image implements Efl.Ui.Zoom, Efl.Canvas.Group.group_member_add; Efl.Ui.Widget.theme_apply; Efl.Ui.Focus.Object.on_focus_update; - Efl.Ui.Widget.widget_event; + Efl.Ui.Widget.widget_input_event_handler; Efl.Ui.Scrollable_Interactive.scroll; Efl.Access.Widget.Action.elm_actions { get; } + Efl.File.load; Efl.File.file { get; set; } Efl.Orientation.orientation { get; set; } Efl.Orientation.flip { get; set; } @@ -87,4 +84,8 @@ class Efl.Ui.Image_Zoomable extends Efl.Ui.Image implements Efl.Ui.Zoom, download,done: void; [[Called when photocam download finished]] download,error: Elm.Photocam.Error; [[Called when photocam download failed]] } + composite { + Efl.Ui.Scrollable_Interactive; + Efl.Ui.Scrollbar; + } } diff --git a/src/lib/elementary/efl_ui_image_zoomable_eo.legacy.c b/src/lib/elementary/efl_ui_image_zoomable_eo.legacy.c new file mode 100644 index 0000000000..61dd7502df --- /dev/null +++ b/src/lib/elementary/efl_ui_image_zoomable_eo.legacy.c @@ -0,0 +1,12 @@ + +EAPI void +elm_photocam_gesture_enabled_set(Efl_Ui_Image_Zoomable *obj, Eina_Bool gesture) +{ + efl_ui_image_zoomable_gesture_enabled_set(obj, gesture); +} + +EAPI Eina_Bool +elm_photocam_gesture_enabled_get(const Efl_Ui_Image_Zoomable *obj) +{ + return efl_ui_image_zoomable_gesture_enabled_get(obj); +} diff --git a/src/lib/elementary/efl_ui_image_zoomable_eo.legacy.h b/src/lib/elementary/efl_ui_image_zoomable_eo.legacy.h new file mode 100644 index 0000000000..7fa5aabb32 --- /dev/null +++ b/src/lib/elementary/efl_ui_image_zoomable_eo.legacy.h @@ -0,0 +1,45 @@ +#ifndef _EFL_UI_IMAGE_ZOOMABLE_EO_LEGACY_H_ +#define _EFL_UI_IMAGE_ZOOMABLE_EO_LEGACY_H_ + +#ifndef _EFL_UI_IMAGE_ZOOMABLE_EO_CLASS_TYPE +#define _EFL_UI_IMAGE_ZOOMABLE_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Image_Zoomable; + +#endif + +#ifndef _EFL_UI_IMAGE_ZOOMABLE_EO_TYPES +#define _EFL_UI_IMAGE_ZOOMABLE_EO_TYPES + + +#endif + +/** + * @brief Set the gesture state for photocam. + * + * This sets the gesture state to on or off for photocam. The default is off. + * This will start multi touch zooming. + * + * @param[in] obj The object. + * @param[in] gesture The gesture state. + * + * @ingroup Elm_Photocam_Group + */ +EAPI void elm_photocam_gesture_enabled_set(Efl_Ui_Image_Zoomable *obj, Eina_Bool gesture); + +/** + * @brief Get the gesture state for photocam. + * + * This gets the current gesture state for the photocam object. + * + * @param[in] obj The object. + * + * @return The gesture state. + * + * @ingroup Elm_Photocam_Group + */ +EAPI Eina_Bool elm_photocam_gesture_enabled_get(const Efl_Ui_Image_Zoomable *obj); + + + +#endif diff --git a/src/lib/elementary/efl_ui_image_zoomable_legacy.eo b/src/lib/elementary/efl_ui_image_zoomable_legacy.eo deleted file mode 100644 index 233d9ad95e..0000000000 --- a/src/lib/elementary/efl_ui_image_zoomable_legacy.eo +++ /dev/null @@ -1,9 +0,0 @@ -class Efl.Ui.Image_Zoomable_Legacy extends Efl.Ui.Image_Zoomable implements 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_legacy_eo.c b/src/lib/elementary/efl_ui_image_zoomable_legacy_eo.c new file mode 100644 index 0000000000..22ac25bc3c --- /dev/null +++ b/src/lib/elementary/efl_ui_image_zoomable_legacy_eo.c @@ -0,0 +1,35 @@ + +Efl_Object *_efl_ui_image_zoomable_legacy_efl_object_constructor(Eo *obj, void *pd); + + +static Eina_Bool +_efl_ui_image_zoomable_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_IMAGE_ZOOMABLE_LEGACY_EXTRA_OPS +#define EFL_UI_IMAGE_ZOOMABLE_LEGACY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _efl_ui_image_zoomable_legacy_efl_object_constructor), + EFL_UI_IMAGE_ZOOMABLE_LEGACY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_image_zoomable_legacy_class_desc = { + EO_VERSION, + "Efl.Ui.Image_Zoomable_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _efl_ui_image_zoomable_legacy_class_initializer, + _efl_ui_image_zoomable_legacy_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_image_zoomable_legacy_class_get, &_efl_ui_image_zoomable_legacy_class_desc, EFL_UI_IMAGE_ZOOMABLE_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/efl_ui_image_zoomable_legacy_eo.h b/src/lib/elementary/efl_ui_image_zoomable_legacy_eo.h new file mode 100644 index 0000000000..e18960f320 --- /dev/null +++ b/src/lib/elementary/efl_ui_image_zoomable_legacy_eo.h @@ -0,0 +1,26 @@ +#ifndef _EFL_UI_IMAGE_ZOOMABLE_LEGACY_EO_H_ +#define _EFL_UI_IMAGE_ZOOMABLE_LEGACY_EO_H_ + +#ifndef _EFL_UI_IMAGE_ZOOMABLE_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_IMAGE_ZOOMABLE_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Image_Zoomable_Legacy; + +#endif + +#ifndef _EFL_UI_IMAGE_ZOOMABLE_LEGACY_EO_TYPES +#define _EFL_UI_IMAGE_ZOOMABLE_LEGACY_EO_TYPES + + +#endif +#ifdef EFL_BETA_API_SUPPORT +/** Elementary Image Zoomable class + * + * @ingroup Efl_Ui_Image_Zoomable_Legacy + */ +#define EFL_UI_IMAGE_ZOOMABLE_LEGACY_CLASS efl_ui_image_zoomable_legacy_class_get() + +EWAPI const Efl_Class *efl_ui_image_zoomable_legacy_class_get(void); +#endif /* EFL_BETA_API_SUPPORT */ + +#endif diff --git a/src/lib/elementary/efl_ui_image_zoomable_legacy_eo.legacy.h b/src/lib/elementary/efl_ui_image_zoomable_legacy_eo.legacy.h new file mode 100644 index 0000000000..0ed427d5a5 --- /dev/null +++ b/src/lib/elementary/efl_ui_image_zoomable_legacy_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_IMAGE_ZOOMABLE_LEGACY_EO_LEGACY_H_ +#define _EFL_UI_IMAGE_ZOOMABLE_LEGACY_EO_LEGACY_H_ + +#ifndef _EFL_UI_IMAGE_ZOOMABLE_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_IMAGE_ZOOMABLE_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Image_Zoomable_Legacy; + +#endif + +#ifndef _EFL_UI_IMAGE_ZOOMABLE_LEGACY_EO_TYPES +#define _EFL_UI_IMAGE_ZOOMABLE_LEGACY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/efl_ui_image_zoomable_pan.eo b/src/lib/elementary/efl_ui_image_zoomable_pan.eo index 4cb307e04e..b1b5c0d4b3 100644 --- a/src/lib/elementary/efl_ui_image_zoomable_pan.eo +++ b/src/lib/elementary/efl_ui_image_zoomable_pan.eo @@ -1,7 +1,6 @@ -class Efl.Ui.Image_Zoomable_Pan extends Efl.Ui.Pan +class @beta Efl.Ui.Image_Zoomable_Pan extends Efl.Ui.Pan { [[Elementary photocom pan class]] - legacy_prefix: elm_photocam_pan; implements { class.constructor; Efl.Object.destructor; diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c b/src/lib/elementary/efl_ui_internal_text_interactive.c index 7975cb58df..9d7fdedf6f 100644 --- a/src/lib/elementary/efl_ui_internal_text_interactive.c +++ b/src/lib/elementary/efl_ui_internal_text_interactive.c @@ -75,7 +75,7 @@ static Eina_Bool _entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, char **text, int *cursor_pos) { Efl_Canvas_Text *obj = data; - Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); + Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); const char *str; if (text) @@ -177,7 +177,7 @@ static void _entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info EINA_UNUSED) { Efl_Canvas_Text *obj = data; - Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); + Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS); int cursor_pos; int preedit_start_pos, preedit_end_pos; @@ -330,7 +330,7 @@ static void _entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info) { Efl_Canvas_Text *obj = data; - Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); + Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS); Ecore_IMF_Event_Delete_Surrounding *ev = event_info; Evas_Textblock_Cursor *del_start, *del_end; @@ -374,7 +374,7 @@ static void _entry_imf_event_selection_set_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info) { Efl_Canvas_Text *obj = data; - Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); + Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS); Ecore_IMF_Event_Selection *ev = event_info; @@ -465,7 +465,7 @@ _focus_in_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void if (!en->imf_context) return; - cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); + cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); ecore_imf_context_focus_in(en->imf_context); _entry_imf_cursor_info_set(obj, cur, en); #endif @@ -558,7 +558,7 @@ _sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Inter free(en->selection); en->selection = NULL; } - efl_event_callback_call(o, EFL_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, NULL); + efl_event_callback_call(o, EFL_TEXT_INTERACTIVE_EVENT_TEXT_SELECTION_CHANGED, NULL); } static void @@ -574,7 +574,7 @@ _sel_clear(Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en { en->have_selection = EINA_FALSE; efl_text_cursor_copy(o, en->sel_start, en->sel_end); - efl_event_callback_call(o, EFL_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, NULL); + efl_event_callback_call(o, EFL_TEXT_INTERACTIVE_EVENT_TEXT_SELECTION_CHANGED, NULL); } } @@ -607,6 +607,7 @@ _range_del_emit(Evas_Object *obj, Efl_Text_Cursor_Cursor *cur1, Efl_Text_Cursor_ evas_textblock_cursor_range_delete(cur1, cur2); efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info); + efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED, NULL); if (tmp) free(tmp); } @@ -637,6 +638,7 @@ _delete_emit(Eo *obj, Evas_Textblock_Cursor *c, Efl_Ui_Internal_Text_Interactive evas_textblock_cursor_char_delete(c); efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info); + efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED, NULL); if (tmp) free(tmp); } @@ -725,7 +727,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void /* FIXME: Maybe allow selctions to happen even when not editable. */ if (!en->editable) return; - cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); + cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); old_cur_pos = evas_textblock_cursor_pos_get(cur); if (old_cur_pos < 0) return; @@ -1061,6 +1063,8 @@ end: if (changed_user) { efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info); + /* FIXME: this is kinda gross */ + efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED, NULL); } (void) 0; } @@ -1108,7 +1112,7 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN Evas_Coord cx, cy; Evas_Event_Mouse_Down *ev = event_info; Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS); - Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); + Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); Evas_Textblock_Cursor *tc = NULL; Eina_Bool dosel = EINA_FALSE; Eina_Bool shift; @@ -1219,7 +1223,7 @@ _mouse_up_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void { Evas_Coord cx, cy; Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS); - Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); + Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); Evas_Event_Mouse_Up *ev = event_info; if ((!ev) || (ev->button != 1)) return; @@ -1260,7 +1264,7 @@ _mouse_move_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, vo { Evas_Coord cx, cy; Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS); - Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); + Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); Evas_Event_Mouse_Move *ev = event_info; Evas_Coord x, y, w, h; Evas_Textblock_Cursor *tc; diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.eo b/src/lib/elementary/efl_ui_internal_text_interactive.eo index f3505140ae..a7bf52293c 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 extends Efl.Canvas.Text implements Efl.Text_Interactive +class @beta Efl.Ui.Internal.Text.Interactive extends Efl.Canvas.Text implements Efl.Text_Interactive { [[An internal object in charge of the interactive aspect of the text widget. diff --git a/src/lib/elementary/efl_ui_internal_text_scroller.c b/src/lib/elementary/efl_ui_internal_text_scroller.c index 9ff9934b79..0773b976b5 100644 --- a/src/lib/elementary/efl_ui_internal_text_scroller.c +++ b/src/lib/elementary/efl_ui_internal_text_scroller.c @@ -5,7 +5,6 @@ #define ELM_LAYOUT_PROTECTED #define EFL_UI_SCROLL_MANAGER_PROTECTED #define EFL_UI_SCROLLBAR_PROTECTED -#define EFL_UI_SCROLLBAR_BETA #ifdef HAVE_CONFIG_H # include "elementary_config.h" @@ -119,8 +118,8 @@ _efl_ui_internal_text_scroller_elm_layout_sizing_eval(Eo *obj, // FIXME: should be restricted_min? efl_gfx_entity_size_set(sd->text_table, fsz); - efl_gfx_size_hint_min_set(obj, size); - efl_gfx_size_hint_max_set(obj, EINA_SIZE2D(-1, size.h)); + efl_gfx_hint_size_min_set(obj, size); + efl_gfx_hint_size_max_set(obj, EINA_SIZE2D(-1, size.h)); } } diff --git a/src/lib/elementary/efl_ui_internal_text_scroller.eo b/src/lib/elementary/efl_ui_internal_text_scroller.eo index bc9b33e86e..4e20e9bea7 100644 --- a/src/lib/elementary/efl_ui_internal_text_scroller.eo +++ b/src/lib/elementary/efl_ui_internal_text_scroller.eo @@ -1,11 +1,11 @@ -enum Efl.Ui.Text_Scroller_Mode +enum @beta Efl.Ui.Text_Scroller_Mode { default = 0, singleline = 0, multiline = 1, } -class Efl.Ui.Internal_Text_Scroller extends Efl.Ui.Scroller +class @beta Efl.Ui.Internal_Text_Scroller extends Efl.Ui.Scroller { [[Internal-usage text scroller class. diff --git a/src/lib/elementary/efl_ui_item.c b/src/lib/elementary/efl_ui_item.c index aad857bb24..65f488e2e7 100644 --- a/src/lib/elementary/efl_ui_item.c +++ b/src/lib/elementary/efl_ui_item.c @@ -19,15 +19,15 @@ static void _item_select(Eo *obj, Efl_Ui_Item_Data *pd) { if (pd->selected && - (*(pd->select_mode) != EFL_UI_SELECT_SINGLE_ALWAYS)) + (*(pd->select_mode) != EFL_UI_SELECT_MODE_SINGLE_ALWAYS)) return; - if (*(pd->select_mode) == EFL_UI_SELECT_NONE) return; + if (*(pd->select_mode) == EFL_UI_SELECT_MODE_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); + efl_event_callback_call(obj, EFL_UI_EVENT_ITEM_SELECTED, NULL); } static void @@ -38,7 +38,7 @@ _item_unselect(Eo *obj, Efl_Ui_Item_Data *pd) 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); + efl_event_callback_call(obj, EFL_UI_EVENT_ITEM_UNSELECTED, NULL); } /* Mouse Controls */ @@ -101,9 +101,9 @@ _item_mouse_up(void *data, 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)) + if ((*(pd->select_mode) != EFL_UI_SELECT_MODE_SINGLE_ALWAYS) && (pd->selected)) _item_unselect(item, pd); - else if (*(pd->select_mode) != EFL_UI_SELECT_NONE) + else if (*(pd->select_mode) != EFL_UI_SELECT_MODE_NONE) _item_select(item, pd); } diff --git a/src/lib/elementary/efl_ui_item.eo b/src/lib/elementary/efl_ui_item.eo index e3ba8afa33..50e1e1c739 100644 --- a/src/lib/elementary/efl_ui_item.eo +++ b/src/lib/elementary/efl_ui_item.eo @@ -1,4 +1,4 @@ -abstract Efl.Ui.Item extends Efl.Ui.Layout implements Efl.Ui.Selectable, Efl.Ui.Clickable +abstract @beta Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Selectable, Efl.Ui.Clickable { [[Item abstract class for pack widget. All item have to be inherited from this class.]] methods { diff --git a/src/lib/elementary/efl_ui_l10n.eo b/src/lib/elementary/efl_ui_l10n.eo index 5275759262..8eec6e12d4 100644 --- a/src/lib/elementary/efl_ui_l10n.eo +++ b/src/lib/elementary/efl_ui_l10n.eo @@ -1,4 +1,4 @@ -interface Efl.Ui.L10n +interface @beta Efl.Ui.L10n { [[Interface for all translatable text APIs. diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index b3aaa083e9..63f9491467 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -6,15 +6,16 @@ #define ELM_LAYOUT_PROTECTED #define EFL_UI_WIDGET_PART_BG_PROTECTED #define EFL_PART_PROTECTED +#define EFL_LAYOUT_CALC_PROTECTED #include #include "elm_priv.h" #include "elm_widget_layout.h" #include "elm_part_helper.h" -#include "elm_entry.eo.h" +#include "elm_entry_eo.h" -#define MY_CLASS EFL_UI_LAYOUT_CLASS +#define MY_CLASS EFL_UI_LAYOUT_BASE_CLASS #define MY_CLASS_PFX efl_ui_layout #define MY_CLASS_NAME "Efl.Ui.Layout" @@ -75,7 +76,7 @@ struct _Efl_Ui_Layout_Factory_Tracking { Efl_Ui_Factory *factory; Eina_Future *in_flight; - Eina_Stringshare *name; + Eina_Stringshare *key; }; @@ -132,7 +133,7 @@ struct _Efl_Ui_Layout_Sub_Object_Cursor #define MY_CLASS_NAME_LEGACY "elm_layout" static void -_efl_ui_layout_class_constructor(Efl_Class *klass) +_efl_ui_layout_base_class_constructor(Efl_Class *klass) { evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); } @@ -394,12 +395,32 @@ _efl_ui_layout_highlight_in_theme(Evas_Object *obj) elm_widget_access_highlight_in_theme_set(obj, EINA_FALSE); } +static void +_flush_mirrored_state(Eo *obj) +{ + char prefix[4], state[10], signal[100]; + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); + + if (!wd->resize_obj) return; + + if (efl_ui_widget_disabled_get(obj)) + snprintf(state, sizeof(state), "disabled"); + else + snprintf(state, sizeof(state), "enabled"); + + if (!elm_widget_is_legacy(obj)) + snprintf(prefix, sizeof(prefix), "efl"); + else + snprintf(prefix, sizeof(prefix), "elm"); + + snprintf(signal, sizeof(signal), "%s,state,%s", prefix, state); + efl_layout_signal_emit(obj, signal, prefix); +} + static Eina_Bool _visuals_refresh(Evas_Object *obj, Efl_Ui_Layout_Data *sd) { - Eina_Bool ret = EINA_FALSE; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); _parts_signals_emit(sd); @@ -413,49 +434,26 @@ _visuals_refresh(Evas_Object *obj, efl_gfx_entity_scale_get(obj) * elm_config_scale_get()); _efl_ui_layout_highlight_in_theme(obj); - - ret = efl_ui_widget_on_disabled_update(obj, elm_widget_disabled_get(obj)); + _flush_mirrored_state(obj); elm_layout_sizing_eval(obj); - return ret; -} - -EOLIAN static Eina_Bool -_efl_ui_layout_efl_ui_widget_on_disabled_update(Eo *obj, Efl_Ui_Layout_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 (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 - { - 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_Result +EOLIAN static void +_efl_ui_layout_base_efl_ui_widget_disabled_set(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, Eina_Bool disabled) +{ + efl_ui_widget_disabled_set(efl_super(obj, MY_CLASS), disabled); + _flush_mirrored_state(obj); +} + +static Eina_Error _efl_ui_layout_theme_internal(Eo *obj, Efl_Ui_Layout_Data *sd) { - Efl_Ui_Theme_Apply_Result ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); /* function already prints error messages, if any */ if (!sd->file_set) @@ -467,29 +465,36 @@ _efl_ui_layout_theme_internal(Eo *obj, Efl_Ui_Layout_Data *sd) elm_widget_theme_style_get(obj)); } - if (ret) + if (ret != EFL_UI_THEME_APPLY_ERROR_GENERIC) efl_event_callback_legacy_call(obj, EFL_UI_LAYOUT_EVENT_THEME_CHANGED, NULL); if (!_visuals_refresh(obj, sd)) - ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; return ret; } -EOLIAN static Efl_Ui_Theme_Apply_Result -_efl_ui_layout_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd) +EOLIAN static Eina_Error +_efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd) { - Efl_Ui_Theme_Apply_Result theme_apply_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error theme_apply_ret, theme_apply_internal_ret; theme_apply_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!theme_apply_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (theme_apply_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return EFL_UI_THEME_APPLY_ERROR_GENERIC; - theme_apply_ret &= _efl_ui_layout_theme_internal(obj, sd); - return theme_apply_ret; + theme_apply_internal_ret = _efl_ui_layout_theme_internal(obj, sd); + if (theme_apply_internal_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) + return EFL_UI_THEME_APPLY_ERROR_GENERIC; + + if ((theme_apply_ret == EFL_UI_THEME_APPLY_ERROR_DEFAULT) || + (theme_apply_internal_ret == EFL_UI_THEME_APPLY_ERROR_DEFAULT)) + return EFL_UI_THEME_APPLY_ERROR_DEFAULT; + + return EFL_UI_THEME_APPLY_ERROR_NONE; } EOLIAN static Eina_Bool -_efl_ui_layout_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED) +_efl_ui_layout_base_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); @@ -521,7 +526,7 @@ _efl_ui_layout_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Layout_Data * } EOLIAN static Eina_Bool -_efl_ui_layout_efl_ui_widget_widget_sub_object_add(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, Evas_Object *sobj) +_efl_ui_layout_base_efl_ui_widget_widget_sub_object_add(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, Evas_Object *sobj) { Eina_Bool int_ret = EINA_FALSE; @@ -538,7 +543,7 @@ _efl_ui_layout_efl_ui_widget_widget_sub_object_add(Eo *obj, Efl_Ui_Layout_Data * } EOLIAN static Eina_Bool -_efl_ui_layout_efl_ui_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Layout_Data *sd, Evas_Object *sobj) +_efl_ui_layout_base_efl_ui_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Layout_Data *sd, Evas_Object *sobj) { Eina_List *l; Efl_Ui_Layout_Sub_Object_Data *sub_d; @@ -731,12 +736,10 @@ _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_base_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED) { Evas_Object *edje; - elm_widget_sub_object_parent_add(obj); - /* has to be there *before* parent's smart_add() */ edje = edje_object_add(evas_object_evas_get(obj)); elm_widget_resize_object_set(obj, edje); @@ -756,13 +759,14 @@ _efl_ui_layout_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_ } EOLIAN static void -_efl_ui_layout_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Layout_Data *sd) +_efl_ui_layout_base_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Layout_Data *sd) { Efl_Ui_Layout_Sub_Object_Data *sub_d; Efl_Ui_Layout_Sub_Object_Cursor *pc; Edje_Signal_Data *esd; Evas_Object *child; Eina_List *l; + Efl_Model *model; ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); @@ -787,12 +791,11 @@ _efl_ui_layout_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Layout_Data *sd) free(esd); } - if(sd->connect.model) + model = efl_ui_view_model_get(obj); + if(model) { - efl_event_callback_del(sd->connect.model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, + efl_event_callback_del(model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _efl_model_properties_changed_cb, sd); - efl_unref(sd->connect.model); - sd->connect.model = NULL; } eina_hash_free(sd->connect.properties); @@ -822,7 +825,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_base_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Layout_Data *sd) { if (sd->needs_size_calc) { @@ -850,78 +853,90 @@ _parts_cursors_find(Efl_Ui_Layout_Data *sd, /* The public functions down here are meant to operate on whichever * 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) +EOLIAN static Eina_Error +_efl_ui_layout_efl_file_load(Eo *obj, void *_pd EINA_UNUSED) { - Eina_Bool int_ret = EINA_FALSE; + Eina_Error err; + Efl_Ui_Layout_Data *sd = efl_data_scope_get(obj, MY_CLASS); ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); - int_ret = - edje_object_file_set(wd->resize_obj, file, group); + if (efl_file_loaded_get(obj)) return 0; + err = efl_file_load(wd->resize_obj); - if (int_ret) + if (!err) { sd->file_set = EINA_TRUE; _visuals_refresh(obj, sd); } else ERR("failed to set edje file '%s', group '%s': %s", - file, group, + efl_file_get(wd->resize_obj), efl_file_key_get(wd->resize_obj), edje_load_error_str (edje_object_load_error_get(wd->resize_obj))); - return int_ret; + return err; +} + +EOLIAN static Eina_Error +_efl_ui_layout_efl_file_file_set(Eo *obj, void *_pd EINA_UNUSED, const char *file) +{ + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_GFX_IMAGE_LOAD_ERROR_GENERIC); + return efl_file_set(wd->resize_obj, file); +} + +EOLIAN static const char * +_efl_ui_layout_efl_file_file_get(const Eo *obj, void *_pd EINA_UNUSED) +{ + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); + return efl_file_get(wd->resize_obj); } EOLIAN static void -_efl_ui_layout_efl_file_file_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const char **file, const char **group) +_efl_ui_layout_efl_file_key_set(Eo *obj, void *_pd EINA_UNUSED, const char *key) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - edje_object_file_get(wd->resize_obj, file, group); + return efl_file_key_set(wd->resize_obj, key); } - -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) +EOLIAN static const char * +_efl_ui_layout_efl_file_key_get(const Eo *obj, void *_pd EINA_UNUSED) { - Eina_Bool int_ret = EINA_FALSE; + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); + return efl_file_key_get(wd->resize_obj); +} +EOLIAN static Eina_Error +_efl_ui_layout_efl_file_mmap_set(Eo *obj, void *_pd EINA_UNUSED, const Eina_File *file) +{ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); + return efl_file_mmap_set(wd->resize_obj, file); +} - int_ret = - edje_object_mmap_set(wd->resize_obj, file, group); - - if (int_ret) - { - sd->file_set = EINA_TRUE; - _visuals_refresh(obj, sd); - } - else - ERR("failed to set edje mmap file %p, group '%s': %s", - file, group, - edje_load_error_str - (edje_object_load_error_get(wd->resize_obj))); - - return int_ret; +EOLIAN static const Eina_File * +_efl_ui_layout_efl_file_mmap_get(const Eo *obj, void *_pd EINA_UNUSED) +{ + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); + return efl_file_mmap_get(wd->resize_obj); } EOLIAN static void -_efl_ui_layout_efl_file_mmap_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const Eina_File **file, const char **group) +_efl_ui_layout_base_theme_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const char **klass, const char **group, const char **style) { - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - efl_file_mmap_get(wd->resize_obj, file, group); + if (klass) *klass = elm_widget_theme_klass_get(obj); + if (group) *group = elm_widget_theme_element_get(obj); + if (style) *style = elm_widget_theme_style_get(obj); } -EOLIAN static Efl_Ui_Theme_Apply_Result -_efl_ui_layout_theme_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *klass, const char *group, const char *style) +EOLIAN static Eina_Error +_efl_ui_layout_base_theme_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *klass, const char *group, const char *style) { Eina_Bool changed = EINA_FALSE; 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_RESULT_FAIL; + return EFL_UI_THEME_APPLY_ERROR_GENERIC; } if (sd->file_set) sd->file_set = EINA_FALSE; @@ -932,11 +947,11 @@ _efl_ui_layout_theme_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *klass, con if (changed) return efl_ui_widget_theme_apply(obj); - return EFL_UI_THEME_APPLY_RESULT_SUCCESS; + return EFL_UI_THEME_APPLY_ERROR_NONE; } 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_base_efl_layout_signal_signal_emit(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, const char *emission, const char *source) { // Don't do anything else than call forward here EINA_SAFETY_ON_TRUE_RETURN(efl_invalidated_get(obj)); @@ -944,20 +959,20 @@ _efl_ui_layout_efl_layout_signal_signal_emit(Eo *obj, Efl_Ui_Layout_Data *_pd EI efl_layout_signal_emit(wd->resize_obj, emission, source); } -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) +static Eina_Bool +_efl_ui_layout_base_efl_layout_signal_signal_callback_add(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED, const char *emission, const char *source, void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb) { // Don't do anything else than call forward here ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); - return efl_layout_signal_callback_add(wd->resize_obj, emission, source, func, data); + return efl_layout_signal_callback_add(wd->resize_obj, emission, source, func_data, func, func_free_cb); } -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) +static Eina_Bool +_efl_ui_layout_base_efl_layout_signal_signal_callback_del(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED, const char *emission, const char *source, void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb) { // Don't do anything else than call forward here ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); - return efl_layout_signal_callback_del(wd->resize_obj, emission, source, func, data); + return efl_layout_signal_callback_del(wd->resize_obj, emission, source, func_data, func, func_free_cb); } // TODO: @@ -1146,23 +1161,6 @@ _efl_ui_layout_content_unset(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part) return NULL; } -EOLIAN static Eina_Bool -_efl_ui_layout_efl_container_content_remove(Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, - Efl_Gfx_Entity *content) -{ - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); - - if (!_elm_widget_sub_object_redirect_to_top(obj, content)) - { - ERR("could not remove sub object %p from %p", content, obj); - return EINA_FALSE; - } - edje_object_part_unswallow(wd->resize_obj, content); - _eo_unparent_helper(content, obj); - - return EINA_TRUE; -} - /* legacy only - eo is iterator */ EAPI Eina_List * elm_layout_content_swallow_list_get(const Evas_Object *obj) @@ -1228,13 +1226,13 @@ _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_base_efl_container_content_iterate(Eo *eo_obj EINA_UNUSED, Efl_Ui_Layout_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_base_efl_container_content_count(Eo *eo_obj EINA_UNUSED, Efl_Ui_Layout_Data *sd) { return eina_list_count(sd->subs); } @@ -1246,6 +1244,7 @@ _efl_ui_layout_text_generic_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *par Efl_Ui_Layout_Sub_Object_Data *sub_d = NULL; Eina_List *l; + Efl_Model *model; EINA_LIST_FOREACH(sd->subs, l, sub_d) { @@ -1302,7 +1301,8 @@ _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->connect.model && !sd->connect.updating) + model = efl_ui_view_model_get(obj); + if (model && !sd->connect.updating) { char *property = eina_hash_find(sd->connect.properties, sub_d->part); @@ -1313,7 +1313,7 @@ _efl_ui_layout_text_generic_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *par eina_value_setup(&v, EINA_VALUE_TYPE_STRING); eina_value_set(&v, text); - efl_model_property_set(sd->connect.model, property, &v); + efl_model_property_set(model, property, &v); } } @@ -1674,7 +1674,7 @@ elm_layout_edje_get(const Eo *obj) } EOLIAN static const char * -_efl_ui_layout_efl_layout_group_group_data_get(const Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, const char *key) +_efl_ui_layout_base_efl_layout_group_group_data_get(const Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, const char *key) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); @@ -1682,7 +1682,7 @@ _efl_ui_layout_efl_layout_group_group_data_get(const Eo *obj, Efl_Ui_Layout_Data } EOLIAN static Eina_Size2D -_efl_ui_layout_efl_layout_group_group_size_min_get(const Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED) +_efl_ui_layout_base_efl_layout_group_group_size_min_get(const Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_SIZE2D(0, 0)); @@ -1690,7 +1690,7 @@ _efl_ui_layout_efl_layout_group_group_size_min_get(const Eo *obj, Efl_Ui_Layout_ } EOLIAN static Eina_Size2D -_efl_ui_layout_efl_layout_group_group_size_max_get(const Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED) +_efl_ui_layout_base_efl_layout_group_group_size_max_get(const Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_SIZE2D(0, 0)); @@ -1698,7 +1698,7 @@ _efl_ui_layout_efl_layout_group_group_size_max_get(const Eo *obj, Efl_Ui_Layout_ } EOLIAN static Eina_Bool -_efl_ui_layout_efl_layout_group_part_exist_get(const Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, const char *part) +_efl_ui_layout_base_efl_layout_group_part_exist_get(const Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, const char *part) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); @@ -1733,7 +1733,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_base_efl_layout_calc_calc_freeze(Eo *obj, Efl_Ui_Layout_Data *sd) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, 0); @@ -1745,7 +1745,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_base_efl_layout_calc_calc_thaw(Eo *obj, Efl_Ui_Layout_Data *sd) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, 0); @@ -1758,6 +1758,41 @@ _efl_ui_layout_efl_layout_calc_calc_thaw(Eo *obj, Efl_Ui_Layout_Data *sd) return 0; } +EOLIAN void +_efl_ui_layout_base_efl_layout_calc_calc_auto_update_hints_set(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *sd EINA_UNUSED, Eina_Bool update) +{ + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); + efl_layout_calc_auto_update_hints_set(wd->resize_obj, update); +} + +EOLIAN Eina_Bool +_efl_ui_layout_base_efl_layout_calc_calc_auto_update_hints_get(const Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *sd EINA_UNUSED) +{ + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); + return efl_layout_calc_auto_update_hints_get(wd->resize_obj); +} + +EOLIAN Eina_Size2D +_efl_ui_layout_base_efl_layout_calc_calc_size_min(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *sd EINA_UNUSED, Eina_Size2D restricted) +{ + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, restricted); + return efl_layout_calc_size_min(wd->resize_obj, restricted); +} + +EOLIAN Eina_Rect +_efl_ui_layout_base_efl_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *sd EINA_UNUSED) +{ + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, (Eina_Rect){.rect = {0, 0, 0, 0}}); + return efl_layout_calc_parts_extends(wd->resize_obj); +} + +EOLIAN void +_efl_ui_layout_base_efl_layout_calc_calc_force(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *sd EINA_UNUSED) +{ + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); + efl_layout_calc_force(wd->resize_obj); +} + static Eina_Bool _efl_ui_layout_part_cursor_set(Efl_Ui_Layout_Data *sd, const char *part_name, const char *cursor) { @@ -1923,7 +1958,7 @@ elm_layout_edje_object_can_access_get(const Eo *obj) } 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_base_efl_object_dbg_info_get(Eo *eo_obj, Efl_Ui_Layout_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); @@ -1935,7 +1970,7 @@ _efl_ui_layout_efl_object_dbg_info_get(Eo *eo_obj, Efl_Ui_Layout_Data *_pd EINA_ Evas_Object *edje_obj = wd->resize_obj; Edje_Load_Error error; - efl_file_get(edje_obj, &file, &edje_group); + efl_file_simple_get(edje_obj, &file, &edje_group); EFL_DBG_INFO_APPEND(group, "File", EINA_VALUE_TYPE_STRING, file); EFL_DBG_INFO_APPEND(group, "Group", EINA_VALUE_TYPE_STRING, edje_group); @@ -1953,8 +1988,10 @@ _efl_ui_layout_view_model_property_update(Efl_Ui_Layout_Data *pd, const char *pa { Eina_Value *v = NULL; char *value = NULL; + Efl_Model *model; - v = efl_model_property_get(pd->connect.model, fetch); + model = efl_ui_view_model_get(pd->obj); + v = efl_model_property_get(model, fetch); if (!v) return; if (eina_value_type_get(v) != EINA_VALUE_TYPE_ERROR) @@ -1974,10 +2011,12 @@ _efl_ui_layout_view_model_signal_update(Efl_Ui_Layout_Data *pd, const char *sign Eina_Value *v = NULL; Eina_Strbuf *buf; char *value = NULL; + Efl_Model *model; Eina_Bool eval = EINA_FALSE; Eina_Bool is_bool = EINA_FALSE; - v = efl_model_property_get(pd->connect.model, fetch); + model = efl_ui_view_model_get(pd->obj); + v = efl_model_property_get(model, fetch); if (!v) return; if (eina_value_type_get(v) == EINA_VALUE_TYPE_ERROR) @@ -1985,7 +2024,7 @@ _efl_ui_layout_view_model_signal_update(Efl_Ui_Layout_Data *pd, const char *sign Eina_Error error; eina_value_get(v, &error); - ERR("Failed to fetch signal value. Error: %s", eina_error_msg_get(error)); + if (error != EAGAIN) ERR("Failed to fetch signal value %s for property %s got error: %s", signal, fetch, eina_error_msg_get(error)); return; } @@ -2049,7 +2088,7 @@ struct _Efl_Ui_Layout_Factory_Request Efl_Ui_Layout_Factory_Tracking *tracking; Efl_Ui_Layout_Data *pd; Efl_Ui_Factory *factory; - const char *name; + const char *key; }; static Eina_Value @@ -2062,11 +2101,11 @@ _content_created(Eo *obj, void *data, const Eina_Value value) eina_value_get(&value, &content); // Recycle old content - old_content = elm_layout_content_get(obj, request->name); + old_content = efl_content_get(efl_part(obj, request->key)); if (old_content) efl_ui_factory_release(request->factory, old_content); // Set new content - elm_layout_content_set(obj, request->name, content); + efl_content_set(efl_part(obj, request->key), content); return value; } @@ -2077,27 +2116,29 @@ _clean_request(Eo *obj EINA_UNUSED, void *data, const Eina_Future *dead_future E Efl_Ui_Layout_Factory_Request *request = data; request->tracking->in_flight = NULL; - eina_stringshare_del(request->name); + eina_stringshare_del(request->key); efl_unref(request->factory); free(request); } static void -_efl_ui_layout_view_model_content_update(Efl_Ui_Layout_Data *pd, Efl_Ui_Layout_Factory_Tracking *tracking, const char *name) +_efl_ui_layout_view_model_content_update(Efl_Ui_Layout_Data *pd, Efl_Ui_Layout_Factory_Tracking *tracking, const char *key) { Efl_Ui_Layout_Factory_Request *request = calloc(1, sizeof (Efl_Ui_Layout_Factory_Request)); Eina_Future *f; + Efl_Model *model; if (!request) return ; if (tracking->in_flight) eina_future_cancel(tracking->in_flight); - request->name = eina_stringshare_ref(name); + request->key = eina_stringshare_ref(key); request->pd = pd; request->factory = efl_ref(tracking->factory); request->tracking = tracking; - f = efl_ui_view_factory_create_with_event(tracking->factory, pd->connect.model, pd->obj); + model = efl_ui_view_model_get(pd->obj); + f = efl_ui_view_factory_create_with_event(tracking->factory, model, pd->obj); f = efl_future_then(pd->obj, f, .success = _content_created, .success_type = EINA_VALUE_TYPE_OBJECT, @@ -2111,7 +2152,7 @@ _efl_ui_layout_view_model_update(Efl_Ui_Layout_Data *pd) Eina_Hash_Tuple *tuple; Eina_Iterator *it; - if (!pd->connect.model) return ; + if (!efl_ui_view_model_get(pd->obj)) return ; it = eina_hash_iterator_tuple_new(pd->connect.properties); EINA_ITERATOR_FOREACH(it, tuple) @@ -2146,21 +2187,18 @@ _efl_model_properties_changed_cb(void *data, const Efl_Event *event) EINA_ARRAY_ITER_NEXT(evt->changed_properties, i, prop, it) { - Eina_Stringshare *sprop = eina_stringshare_add(prop); const char *part; const char *signal; Efl_Ui_Layout_Factory_Tracking *factory; - part = eina_hash_find(pd->connect.properties, sprop); - if (part) _efl_ui_layout_view_model_property_update(pd, part, sprop); + part = eina_hash_find(pd->connect.properties, prop); + if (part) _efl_ui_layout_view_model_property_update(pd, part, prop); - signal = eina_hash_find(pd->connect.signals, sprop); - if (signal) _efl_ui_layout_view_model_signal_update(pd, signal, sprop); + signal = eina_hash_find(pd->connect.signals, prop); + if (signal) _efl_ui_layout_view_model_signal_update(pd, signal, prop); - factory = eina_hash_find(pd->connect.factories, sprop); - if (factory) _efl_ui_layout_view_model_content_update(pd, factory, sprop); - - eina_stringshare_del(sprop); + factory = eina_hash_find(pd->connect.factories, prop); + if (factory) _efl_ui_layout_view_model_content_update(pd, factory, prop); } } @@ -2169,7 +2207,7 @@ _efl_ui_layout_factory_free(Efl_Ui_Layout_Factory_Tracking *tracking) { if (tracking->in_flight) eina_future_cancel(tracking->in_flight); efl_unref(tracking->factory); - eina_stringshare_del(tracking->name); + eina_stringshare_del(tracking->key); free(tracking); } @@ -2184,30 +2222,31 @@ _efl_ui_layout_connect_hash(Efl_Ui_Layout_Data *pd) } EOLIAN static void -_efl_ui_layout_efl_ui_view_model_set(Eo *obj, Efl_Ui_Layout_Data *pd, Efl_Model *model) +_efl_ui_layout_base_efl_ui_view_model_set(Eo *obj, Efl_Ui_Layout_Data *pd, Efl_Model *model) { - Eina_Stringshare *name; + Eina_Stringshare *key; Eina_Hash_Tuple *tuple; Eina_Iterator *it; + Efl_Model *setted; - if (pd->connect.model && pd->connect.model != model) - efl_event_callback_del(pd->connect.model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, - _efl_model_properties_changed_cb, pd); + setted = efl_ui_view_model_get(obj); + if (setted) + efl_event_callback_del(setted, EFL_MODEL_EVENT_PROPERTIES_CHANGED, + _efl_model_properties_changed_cb, pd); - if (!efl_replace(&pd->connect.model, model)) - return; + efl_ui_view_model_set(efl_super(obj, EFL_UI_LAYOUT_BASE_CLASS), model); if (model) - efl_event_callback_add(pd->connect.model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, - _efl_model_properties_changed_cb, pd); + efl_event_callback_add(model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, + _efl_model_properties_changed_cb, pd); _efl_ui_layout_connect_hash(pd); // Reset to empty state it = eina_hash_iterator_key_new(pd->connect.properties); - EINA_ITERATOR_FOREACH(it, name) + EINA_ITERATOR_FOREACH(it, key) { - efl_text_set(efl_part(obj, name), NULL); + efl_text_set(efl_part(obj, key), NULL); } eina_iterator_free(it); @@ -2217,18 +2256,18 @@ _efl_ui_layout_efl_ui_view_model_set(Eo *obj, Efl_Ui_Layout_Data *pd, Efl_Model Efl_Ui_Layout_Factory_Tracking *factory; Efl_Gfx_Entity *content; - name = tuple->key; + key = tuple->key; factory = tuple->data; // Cancel in flight creation request if (factory->in_flight) eina_future_cancel(factory->in_flight); // Cleanup content - content = elm_layout_content_get(obj, name); - elm_layout_content_set(obj, name, NULL); + content = efl_content_get(efl_part(obj, key)); + efl_content_unset(efl_part(obj, key)); // And recycle it - efl_ui_factory_release(factory->factory, content); + if (content) efl_ui_factory_release(factory->factory, content); } eina_iterator_free(it); @@ -2236,37 +2275,39 @@ _efl_ui_layout_efl_ui_view_model_set(Eo *obj, Efl_Ui_Layout_Data *pd, Efl_Model _efl_ui_layout_view_model_update(pd); } -EOLIAN static Efl_Model * -_efl_ui_layout_efl_ui_view_model_get(const Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *pd) +EOLIAN static Eina_Error +_efl_ui_layout_base_efl_ui_property_bind_property_bind(Eo *obj, Efl_Ui_Layout_Data *pd, const char *key, const char *property) { - 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) -{ - EINA_SAFETY_ON_NULL_RETURN(name); + EINA_SAFETY_ON_NULL_RETURN_VAL(key, EFL_PROPERTY_ERROR_INVALID_KEY); Eina_Stringshare *sprop; + Eina_Stringshare *sk; Eina_Hash *hash = NULL; char *data = NULL; + Efl_Model *model; + Eina_Error r; - if (!_elm_layout_part_aliasing_eval(obj, &name, EINA_TRUE)) - return; + // First try binding with property on the Widget + r = efl_ui_property_bind(efl_super(obj, EFL_UI_LAYOUT_BASE_CLASS), key, property); + if (!r) return r; + + // Before trying to bind on the part of this object. + if (!_elm_layout_part_aliasing_eval(obj, &key, EINA_TRUE)) + return EFL_PROPERTY_ERROR_INVALID_KEY; _efl_ui_layout_connect_hash(pd); sprop = eina_stringshare_add(property); - // FIXME: prevent double connect of name to multiple property ? - if (strncmp(SIGNAL_PREFIX, name, sizeof(SIGNAL_PREFIX) - 1) == 0) + // FIXME: prevent double connect of key to multiple property ? + if (strncmp(SIGNAL_PREFIX, key, sizeof(SIGNAL_PREFIX) - 1) == 0) { hash = pd->connect.signals; - data = strdup(name + sizeof(SIGNAL_PREFIX) - 1); + data = strdup(key + sizeof(SIGNAL_PREFIX) - 1); } else { hash = pd->connect.properties; - data = strdup(name); + data = strdup(key); } if (!sprop) @@ -2279,7 +2320,8 @@ _efl_ui_layout_efl_ui_model_connect_connect(Eo *obj EINA_UNUSED, Efl_Ui_Layout_D } // Update display right away if possible - if (pd->connect.model) + model = efl_ui_view_model_get(obj); + if (model) { if (hash == pd->connect.signals) _efl_ui_layout_view_model_signal_update(pd, data, sprop); @@ -2287,35 +2329,41 @@ _efl_ui_layout_efl_ui_model_connect_connect(Eo *obj EINA_UNUSED, Efl_Ui_Layout_D _efl_ui_layout_view_model_property_update(pd, data, sprop); } + sk = eina_stringshare_add(key); + efl_event_callback_call(obj, EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND, (void*) sk); + eina_stringshare_del(sk); + if (!sprop) free(data); + + return 0; } EOLIAN static void -_efl_ui_layout_efl_ui_factory_model_connect(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *pd, - const char *name, Efl_Ui_Factory *factory) +_efl_ui_layout_base_efl_ui_factory_bind_factory_bind(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *pd, + const char *key, Efl_Ui_Factory *factory) { - EINA_SAFETY_ON_NULL_RETURN(name); + EINA_SAFETY_ON_NULL_RETURN(key); Efl_Ui_Layout_Factory_Tracking *tracking; - Eina_Stringshare *ss_name; + Eina_Stringshare *ss_key; - if (!_elm_layout_part_aliasing_eval(obj, &name, EINA_TRUE)) + if (!_elm_layout_part_aliasing_eval(obj, &key, EINA_TRUE)) return; if (!pd->connect.factories) pd->connect.factories = eina_hash_stringshared_new(EINA_FREE_CB(_efl_ui_layout_factory_free)); - ss_name = eina_stringshare_add(name); + ss_key = eina_stringshare_add(key); // First undo the old one if there is one - tracking = eina_hash_find(pd->connect.factories, ss_name); + tracking = eina_hash_find(pd->connect.factories, ss_key); if (tracking) { Efl_Gfx_Entity *old; // Unset and recycle - old = elm_layout_content_get(obj, ss_name); - elm_layout_content_set(obj, ss_name, NULL); + old = efl_content_get(efl_part(obj, ss_key)); + efl_content_unset(efl_part(obj, ss_key)); if (old) efl_ui_factory_release(tracking->factory, old); // Stop in flight request @@ -2329,19 +2377,19 @@ _efl_ui_layout_efl_ui_factory_model_connect(Eo *obj EINA_UNUSED, Efl_Ui_Layout_D tracking = calloc(1, sizeof (Efl_Ui_Layout_Factory_Tracking)); if (!tracking) return ; - tracking->name = ss_name; + tracking->key = ss_key; - eina_hash_add(pd->connect.factories, ss_name, tracking); + eina_hash_add(pd->connect.factories, ss_key, tracking); } // And update content with the new factory tracking->factory = efl_ref(factory); - _efl_ui_layout_view_model_content_update(pd, tracking, ss_name); + _efl_ui_layout_view_model_content_update(pd, tracking, ss_key); } EOLIAN static Eo * -_efl_ui_layout_efl_object_constructor(Eo *obj, Efl_Ui_Layout_Data *sd) +_efl_ui_layout_base_efl_object_constructor(Eo *obj, Efl_Ui_Layout_Data *sd) { sd->obj = obj; obj = efl_constructor(efl_super(obj, MY_CLASS)); @@ -2352,25 +2400,32 @@ _efl_ui_layout_efl_object_constructor(Eo *obj, Efl_Ui_Layout_Data *sd) } EOLIAN static Efl_Object* -_efl_ui_layout_efl_object_finalize(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED) +_efl_ui_layout_base_efl_object_finalize(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED) { - Eo *eo; - + Eo *eo, *win; + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); eo = efl_finalize(efl_super(obj, MY_CLASS)); efl_ui_widget_theme_apply(eo); + win = elm_widget_top_get(obj); + if (efl_isa(win, EFL_UI_WIN_CLASS)) + efl_ui_layout_theme_rotation_apply(obj, efl_ui_win_rotation_get(win)); + + if (efl_file_get(wd->resize_obj) || efl_file_mmap_get(wd->resize_obj)) + efl_file_load(wd->resize_obj); + return eo; } 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_base_efl_layout_signal_message_send(Eo *obj, Efl_Ui_Layout_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_base_efl_layout_signal_signal_process(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED, Eina_Bool recurse) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); efl_layout_signal_process(wd->resize_obj, recurse); @@ -2379,7 +2434,7 @@ _efl_ui_layout_efl_layout_signal_signal_process(Eo *obj, Efl_Ui_Layout_Data *pd /* Efl.Part implementation */ EOLIAN static Eo * -_efl_ui_layout_efl_part_part_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const char *part) +_efl_ui_layout_base_efl_part_part_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const char *part) { Efl_Canvas_Layout_Part_Type type = EFL_CANVAS_LAYOUT_PART_TYPE_NONE; @@ -2401,7 +2456,7 @@ _efl_ui_layout_efl_part_part_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUS type > EFL_CANVAS_LAYOUT_PART_TYPE_NONE) { const char *file = NULL, *key = NULL; - efl_file_get(wd->resize_obj, &file, &key); + efl_file_simple_get(wd->resize_obj, &file, &key); WRN("Layout has a background but it's not a swallow: '%s'", elm_widget_theme_element_get(obj)); } @@ -2444,7 +2499,7 @@ _efl_ui_layout_efl_part_part_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUS } static const char * -_efl_ui_layout_default_content_part_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED) +_efl_ui_layout_base_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)) @@ -2453,7 +2508,7 @@ _efl_ui_layout_default_content_part_get(const Eo *obj, Efl_Ui_Layout_Data *sd EI } static const char * -_efl_ui_layout_default_text_part_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED) +_efl_ui_layout_base_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)) @@ -2461,56 +2516,6 @@ _efl_ui_layout_default_text_part_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_ 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(const 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(const 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(const 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); -} - #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)) \ @@ -2527,11 +2532,11 @@ _efl_ui_layout_part_efl_ui_cursor_cursor_theme_search_enabled_get(const Eo *obj, 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, Efl_Ui_Layout_Data) +CONTENT_FULL(efl_ui_layout_part_content, efl_ui_layout, EFL_UI_LAYOUT_BASE, Efl_Ui_Layout_Data) /* Efl.Ui.Layout_Part_Text */ -TEXT_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) -MARKUP_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) +TEXT_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT_BASE, Efl_Ui_Layout_Data) +MARKUP_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT_BASE, Efl_Ui_Layout_Data) EOLIAN static const char * _efl_ui_layout_part_text_efl_ui_l10n_l10n_text_get(const Eo *obj, void *_pd EINA_UNUSED, const char **domain) @@ -2548,9 +2553,9 @@ _efl_ui_layout_part_text_efl_ui_l10n_l10n_text_set(Eo *obj, void *_pd EINA_UNUSE } /* Efl.Ui.Layout_Part_Legacy */ -CONTENT_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) -TEXT_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) -MARKUP_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) +CONTENT_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT_BASE, Efl_Ui_Layout_Data) +TEXT_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT_BASE, Efl_Ui_Layout_Data) +MARKUP_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT_BASE, Efl_Ui_Layout_Data) EOLIAN static const char * _efl_ui_layout_part_legacy_efl_ui_l10n_l10n_text_get(const Eo *obj, void *_pd EINA_UNUSED, const char **domain) @@ -2590,6 +2595,35 @@ _efl_ui_layout_part_bg_efl_object_finalize(Eo *obj, void *_pd EINA_UNUSED) return obj; } +EOLIAN static void +_efl_ui_layout_base_automatic_theme_rotation_set(Eo *obj, Efl_Ui_Layout_Data *pd, Eina_Bool automatic) +{ + if (pd->automatic_orientation_apply == automatic) return; + pd->automatic_orientation_apply = automatic; + + efl_ui_layout_theme_rotation_apply(obj, efl_ui_win_rotation_get(elm_widget_top_get(obj))); +} + +EOLIAN static Eina_Bool +_efl_ui_layout_base_automatic_theme_rotation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *pd) +{ + return pd->automatic_orientation_apply; +} + +EOLIAN static void +_efl_ui_layout_base_theme_rotation_apply(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED, Efl_Orient orientation) +{ + char prefix[4], buf[128]; + + if (elm_widget_is_legacy(obj)) + snprintf(prefix, sizeof(prefix), "elm"); + else + snprintf(prefix, sizeof(prefix), "efl"); + snprintf(buf, sizeof(buf), "%s,state,orient,%d", prefix, (int)orientation); + efl_layout_signal_emit(obj, buf, prefix); +} + + /* Efl.Ui.Layout_Part_Xxx includes */ #include "efl_ui_layout_part.eo.c" #include "efl_ui_layout_part_content.eo.c" @@ -2609,18 +2643,19 @@ EFL_FUNC_BODY_CONST(elm_layout_content_aliases_get, const Elm_Layout_Part_Alias_ 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), \ +#define EFL_UI_LAYOUT_BASE_EXTRA_OPS \ + EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_layout_base), \ + ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_layout_base), \ + ELM_PART_TEXT_DEFAULT_OPS(efl_ui_layout_base), \ 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) + EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_ui_layout_base_efl_object_dbg_info_get) +#include "efl_ui_layout_base.eo.c" #include "efl_ui_layout.eo.c" -#include "efl_ui_layout_legacy.eo.h" +#include "efl_ui_layout_legacy_eo.h" EOLIAN static Eo * @@ -2641,25 +2676,25 @@ elm_layout_add(Evas_Object *parent) EAPI Eina_Bool elm_layout_file_set(Eo *obj, const char *file, const char *group) { - return efl_file_set((Eo *) obj, file, group); + return efl_file_simple_load((Eo *) obj, file, group); } EAPI void elm_layout_file_get(Eo *obj, const char **file, const char **group) { - efl_file_get((Eo *) obj, file, group); + efl_file_simple_get((Eo *) obj, file, group); } EAPI Eina_Bool elm_layout_mmap_set(Eo *obj, const Eina_File *file, const char *group) { - return efl_file_mmap_set((Eo *) obj, file, group); + return efl_file_simple_mmap_load((Eo *) obj, file, group); } EAPI void elm_layout_mmap_get(Eo *obj, const Eina_File **file, const char **group) { - efl_file_mmap_get((Eo *) obj, file, group); + efl_file_simple_mmap_get((Eo *) obj, file, group); } EAPI Eina_Bool @@ -2729,6 +2764,10 @@ elm_layout_table_clear(Eo *obj, const char *part, Eina_Bool clear) EAPI Eina_Bool elm_layout_text_set(Eo *obj, const char *part, const char *text) { + Eo *part_obj; + + if (efl_invalidating_get(obj) || efl_invalidated_get(obj)) return EINA_FALSE; + if (!part) { part = efl_ui_widget_default_text_part_get(obj); @@ -2737,7 +2776,19 @@ elm_layout_text_set(Eo *obj, const char *part, const char *text) else if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE)) return EINA_FALSE; - efl_text_set(efl_part(obj, part), text); + part_obj = efl_ref(efl_part(obj, part)); + + if (!efl_isa(part_obj, EFL_TEXT_INTERFACE) || + !efl_isa(part_obj, EFL_UI_LAYOUT_PART_CLASS)) + { + efl_unref(part_obj); + return EINA_FALSE; + } + + efl_text_set(part_obj, text); + + efl_unref(part_obj); + return EINA_TRUE; } @@ -2758,43 +2809,57 @@ elm_layout_text_get(const Eo *obj, const char *part) EAPI Eina_Bool elm_layout_part_cursor_engine_only_set(Eo *obj, const char *part, Eina_Bool engine_only) { - return efl_ui_cursor_theme_search_enabled_set(efl_part(obj, part), !engine_only); + Efl_Ui_Layout_Data *sd = efl_data_scope_get(obj, MY_CLASS); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EINA_FALSE); + return _efl_ui_layout_part_cursor_engine_only_set(sd, part, engine_only); } EAPI Eina_Bool elm_layout_part_cursor_engine_only_get(const Eo *obj, const char *part) { - return !efl_ui_cursor_theme_search_enabled_get(efl_part(obj, part)); + Efl_Ui_Layout_Data *sd = efl_data_scope_get(obj, MY_CLASS); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EINA_FALSE); + return _efl_ui_layout_part_cursor_engine_only_get(sd, part); } EAPI Eina_Bool elm_layout_part_cursor_set(Eo *obj, const char *part, const char *cursor) { - return efl_ui_cursor_set(efl_part(obj, part), cursor); + Efl_Ui_Layout_Data *sd = efl_data_scope_get(obj, MY_CLASS); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EINA_FALSE); + return _efl_ui_layout_part_cursor_set(sd, part, cursor); } EAPI const char * elm_layout_part_cursor_get(const Eo *obj, const char *part) { - return efl_ui_cursor_get(efl_part(obj, part)); + Efl_Ui_Layout_Data *sd = efl_data_scope_get(obj, MY_CLASS); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd, NULL); + return _efl_ui_layout_part_cursor_get(sd, part); } EAPI Eina_Bool elm_layout_part_cursor_style_set(Eo *obj, const char *part, const char *style) { - return efl_ui_cursor_style_set(efl_part(obj, part), style); + Efl_Ui_Layout_Data *sd = efl_data_scope_get(obj, MY_CLASS); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EINA_FALSE); + return _efl_ui_layout_part_cursor_style_set(sd, part, style); } EAPI const char * elm_layout_part_cursor_style_get(const Eo *obj, const char *part) { - return efl_ui_cursor_style_get(efl_part(obj, part)); + Efl_Ui_Layout_Data *sd = efl_data_scope_get(obj, MY_CLASS); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd, NULL); + return _efl_ui_layout_part_cursor_style_get(sd, part); } EAPI Eina_Bool elm_layout_part_cursor_unset(Eo *obj, const char *part) { - return efl_ui_cursor_set(efl_part(obj, part), NULL); + Efl_Ui_Layout_Data *sd = efl_data_scope_get(obj, MY_CLASS); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EINA_FALSE); + return _efl_ui_layout_part_cursor_set(sd, part, NULL); } EAPI int @@ -2826,7 +2891,7 @@ _elm_layout_signal_callback_add_legacy(Eo *obj, Eo *edje, Eina_List **p_edje_sig esd->data = data; *p_edje_signals = eina_list_append(*p_edje_signals, esd); - efl_layout_signal_callback_add(edje, emission, source, + edje_object_signal_callback_add(edje, emission, source, _edje_signal_callback, esd); } @@ -2869,8 +2934,8 @@ _elm_layout_signal_callback_del_legacy(Eo *obj EINA_UNUSED, Eo *edje, Eina_List { *p_edje_signals = eina_list_remove_list(*p_edje_signals, l); - efl_layout_signal_callback_del(edje, emission, source, - _edje_signal_callback, esd); + edje_object_signal_callback_del_full(edje, emission, source, + _edje_signal_callback, esd); eina_stringshare_del(esd->emission); eina_stringshare_del(esd->source); @@ -2917,10 +2982,10 @@ elm_layout_data_get(const Evas_Object *obj, const char *key) EAPI Eina_Bool elm_layout_theme_set(Evas_Object *obj, const char *klass, const char *group, const char *style) { - Efl_Ui_Theme_Apply_Result theme_apply_ret; + Eina_Error theme_apply_ret; theme_apply_ret = efl_ui_layout_theme_set(obj, klass, group, style); - return (theme_apply_ret != EFL_UI_THEME_APPLY_RESULT_FAIL); + return (theme_apply_ret != EFL_UI_THEME_APPLY_ERROR_GENERIC); } -#include "efl_ui_layout_legacy.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.eo index 4bae6917e0..bdc81db9c2 100644 --- a/src/lib/elementary/efl_ui_layout.eo +++ b/src/lib/elementary/efl_ui_layout.eo @@ -1,81 +1,20 @@ import efl_ui; -class Efl.Ui.Layout extends Efl.Ui.Widget implements Efl.Container, Efl.File, - Efl.Ui.View, Efl.Ui.Model.Connect, Efl.Ui.Factory, - Efl.Layout.Calc, Efl.Layout.Signal, - Efl.Layout.Group +class Efl.Ui.Layout extends Efl.Ui.Layout_Base implements Efl.File { - [[Elementary layout class]] - methods { - @property theme { - [[The theme of this widget, defines which edje group will be used. + [[Elementary layout class - Based on the type of widget ($klass), a given $group and a - $style (usually "default"), the edje group name will be formed - for this object. + When loading layouts from a file, use the @Efl.File.key property to specify + the group that the data belongs to, in case it's an EET file + (including Edje files). - 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. - ]] - 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 @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 - non-functioning. - ]] - return: Efl.Ui.Theme_Apply_Result(0); - [[Whether the style was successfully applied or not, see - the values of @Efl.Ui.Theme_Apply_Result for more information.]] - } - /* - TODO: - get { - [[Get information about the current theme in use.]] - } - */ - values { - klass: string; [[The class of the group, eg. "button".]] - group: string("base"); [[The group, eg. "base".]] - style: string("default"); [[The style to use, eg "default".]] - } - } - } + @since 1.22 + ]] + data: null; implements { - class.constructor; - Efl.Object.constructor; - Efl.Object.finalize; Efl.File.file { get; set; } + Efl.File.key { get; set; } Efl.File.mmap { get; set; } - Efl.Canvas.Group.group_calculate; - Efl.Layout.Calc.calc_freeze; - Efl.Layout.Calc.calc_thaw; - Efl.Layout.Signal.signal_callback_add; - Efl.Layout.Signal.signal_callback_del; - Efl.Layout.Signal.signal_emit; - Efl.Layout.Signal.message_send; - Efl.Layout.Signal.signal_process; - Efl.Layout.Group.group_data { get; } - Efl.Layout.Group.group_size_min { get; } - Efl.Layout.Group.group_size_max { get; } - 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_get; - Efl.Ui.View.model { get; set; } - Efl.Ui.Model.Connect.connect; - Efl.Ui.Factory.model_connect; - } - events { - theme,changed: void; [[Called when theme changed]] + Efl.File.load; } } diff --git a/src/lib/elementary/efl_ui_layout_base.eo b/src/lib/elementary/efl_ui_layout_base.eo new file mode 100644 index 0000000000..a3401c865e --- /dev/null +++ b/src/lib/elementary/efl_ui_layout_base.eo @@ -0,0 +1,95 @@ +import efl_ui; +import efl_orientation; + +abstract Efl.Ui.Layout_Base extends Efl.Ui.Widget implements Efl.Container, + Efl.Ui.Factory_Bind, + Efl.Layout.Calc, Efl.Layout.Signal, + Efl.Layout.Group +{ + [[Elementary layout abstract + + @since 1.22 + ]] + eo_prefix: efl_ui_layout; + data: Efl_Ui_Layout_Data; + methods { + @property theme { + [[The theme of this widget, defines which edje group will be used. + + Based on the type of widget ($klass), a given $group and a + $style (usually "default"), the edje group name will be formed + for this object. + + 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. + + Note that $style will be the new style of this object, as retrieved by + @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 non-functioning. + ]] + set { + return: Eina.Error; + [[Whether the theme was successfully applied or not, see + the Efl.Ui.Theme.Apply_Error subset of @Eina.Error for more information.]] + } + get { + } + values { + klass: string; [[The class of the group, eg. "button".]] + group: string("base"); [[The group, eg. "base".]] + style: string("default"); [[The style to use, eg "default".]] + } + } + @property automatic_theme_rotation @beta { + [[This flag tells if this object will automatically mirror the rotation changes of the window to this object. + ]] + values { + automatic : bool; [[$true to mirror orientation changes to the theme $false otherwise]] + } + } + theme_rotation_apply @beta { + [[Apply a new rotation value to this object.]] + params { + orientation : Efl.Orient; [[The new rotation value.]] + } + } + } + implements { + class.constructor; + Efl.Object.constructor; + Efl.Object.finalize; + Efl.Canvas.Group.group_calculate; + Efl.Layout.Calc.calc_freeze; + Efl.Layout.Calc.calc_thaw; + Efl.Layout.Calc.calc_auto_update_hints { get; set; } + Efl.Layout.Calc.calc_size_min; + Efl.Layout.Calc.calc_parts_extends; + Efl.Layout.Calc.calc_force; + Efl.Layout.Signal.signal_callback_add; + Efl.Layout.Signal.signal_callback_del; + Efl.Layout.Signal.signal_emit; + Efl.Layout.Signal.message_send; + Efl.Layout.Signal.signal_process; + Efl.Layout.Group.group_data { get; } + Efl.Layout.Group.group_size_min { get; } + Efl.Layout.Group.group_size_max { get; } + Efl.Layout.Group.part_exist { get; } + Efl.Ui.Widget.widget_sub_object_add; + Efl.Ui.Widget.theme_apply; + Efl.Ui.Widget.disabled {set;} + Efl.Ui.Widget.widget_sub_object_del; + Efl.Ui.Focus.Object.on_focus_update; + Efl.Container.content_count; + Efl.Container.content_iterate; + Efl.Part.part_get; + Efl.Ui.Property_Bind.property_bind; + Efl.Ui.Factory_Bind.factory_bind; + Efl.Ui.View.model { set; } + } + events { + theme,changed: void; [[Called when theme changed]] + } +} diff --git a/src/lib/elementary/efl_ui_layout_factory.c b/src/lib/elementary/efl_ui_layout_factory.c index 150fd67aa0..709a31fc85 100644 --- a/src/lib/elementary/efl_ui_layout_factory.c +++ b/src/lib/elementary/efl_ui_layout_factory.c @@ -10,33 +10,35 @@ typedef struct _Efl_Ui_Layout_Factory_Data { - Eina_Hash *connects; - Eina_Hash *factory_connects; + struct { + Eina_Hash *properties; + Eina_Hash *factories; + } bind; Eina_Stringshare *klass; Eina_Stringshare *group; Eina_Stringshare *style; } Efl_Ui_Layout_Factory_Data; Eina_Bool -_model_connect(const Eina_Hash *hash EINA_UNUSED, const void *key, void *data, void *fdata) +_property_bind(const Eina_Hash *hash EINA_UNUSED, const void *key, void *data, void *fdata) { Eo *layout = fdata; - Eina_Stringshare *name = key; + Eina_Stringshare *ss_key = key; Eina_Stringshare *property = data; - efl_ui_model_connect(layout, name, property); + efl_ui_property_bind(layout, ss_key, property); return EINA_TRUE; } Eina_Bool -_factory_model_connect(const Eina_Hash *hash EINA_UNUSED, const void *key, void *data, void *fdata) +_factory_bind(const Eina_Hash *hash EINA_UNUSED, const void *key, void *data, void *fdata) { Eo *layout = fdata; - Eina_Stringshare *name = key; + Eina_Stringshare *ss_key = key; Efl_Ui_Factory *factory = data; - efl_ui_factory_model_connect(layout, name, factory); + efl_ui_factory_bind(layout, ss_key, factory); return EINA_TRUE; } @@ -45,10 +47,10 @@ _efl_ui_layout_factory_efl_object_constructor(Eo *obj, Efl_Ui_Layout_Factory_Dat { obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_ui_caching_factory_item_class_set(obj, EFL_UI_LAYOUT_CLASS); + efl_ui_widget_factory_item_class_set(obj, EFL_UI_LAYOUT_CLASS); - pd->connects = eina_hash_stringshared_new(EINA_FREE_CB(eina_stringshare_del)); - pd->factory_connects = eina_hash_stringshared_new(EINA_FREE_CB(efl_unref)); + pd->bind.properties = eina_hash_stringshared_new(EINA_FREE_CB(eina_stringshare_del)); + pd->bind.factories = eina_hash_stringshared_new(EINA_FREE_CB(efl_unref)); return obj; } @@ -60,14 +62,14 @@ _efl_ui_layout_factory_efl_object_destructor(Eo *obj, Efl_Ui_Layout_Factory_Data eina_stringshare_del(pd->group); eina_stringshare_del(pd->style); - eina_hash_free(pd->connects); - eina_hash_free(pd->factory_connects); + eina_hash_free(pd->bind.properties); + eina_hash_free( pd->bind.factories); efl_destructor(efl_super(obj, MY_CLASS)); } static Eina_Value -_efl_ui_layout_factory_connect(Eo *obj EINA_UNUSED, void *data, const Eina_Value value) +_efl_ui_layout_factory_bind(Eo *obj EINA_UNUSED, void *data, const Eina_Value value) { Efl_Ui_Layout_Factory_Data *pd = data; Efl_Gfx_Entity *layout; @@ -76,8 +78,8 @@ _efl_ui_layout_factory_connect(Eo *obj EINA_UNUSED, void *data, const Eina_Value efl_ui_layout_theme_set(layout, pd->klass, pd->group, pd->style); - eina_hash_foreach(pd->connects, _model_connect, layout); - eina_hash_foreach(pd->factory_connects, _factory_model_connect, layout); + eina_hash_foreach(pd->bind.properties, _property_bind, layout); + eina_hash_foreach(pd->bind.factories, _factory_bind, layout); evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -95,54 +97,53 @@ _efl_ui_layout_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Layout_Factory_Data return efl_future_then(obj, f, .success_type = EINA_VALUE_TYPE_OBJECT, - .success = _efl_ui_layout_factory_connect, + .success = _efl_ui_layout_factory_bind, .data = pd); } EOLIAN static void -_efl_ui_layout_factory_efl_ui_factory_model_connect(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Factory_Data *pd - , const char *name, Efl_Ui_Factory *factory) +_efl_ui_layout_factory_efl_ui_factory_bind_factory_bind(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Factory_Data *pd, + const char *key, Efl_Ui_Factory *factory) { - Eina_Stringshare *ss_name; + Eina_Stringshare *ss_key; Efl_Ui_Factory *f_old; - ss_name = eina_stringshare_add(name); + ss_key = eina_stringshare_add(key); if (factory == NULL) { - eina_hash_del(pd->factory_connects, ss_name, NULL); + eina_hash_del(pd->bind.factories, ss_key, NULL); return; } - f_old = eina_hash_set(pd->factory_connects, ss_name, efl_ref(factory)); + f_old = eina_hash_set(pd->bind.factories, ss_key, efl_ref(factory)); if (f_old) { efl_unref(f_old); - eina_stringshare_del(ss_name); + eina_stringshare_del(ss_key); } } -EOLIAN static void -_efl_ui_layout_factory_efl_ui_model_connect_connect(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Factory_Data *pd - , const char *name, const char *property) +EOLIAN static Eina_Error +_efl_ui_layout_factory_efl_ui_property_bind_property_bind(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Factory_Data *pd, + const char *key, const char *property) { - Eina_Stringshare *ss_name, *ss_prop, *ss_old; - ss_name = eina_stringshare_add(name); + Eina_Stringshare *ss_key, *ss_prop, *ss_old; + ss_key = eina_stringshare_add(key); if (property == NULL) { - eina_hash_del(pd->connects, ss_name, NULL); - eina_stringshare_del(ss_name); - return; + eina_hash_del(pd->bind.properties, ss_key, NULL); + goto end; } ss_prop = eina_stringshare_add(property); - ss_old = eina_hash_set(pd->connects, ss_name, ss_prop); - if (ss_old) - { - eina_stringshare_del(ss_old); - eina_stringshare_del(ss_name); - } + ss_old = eina_hash_set(pd->bind.properties, ss_key, ss_prop); + if (ss_old) eina_stringshare_del(ss_old); + end: + efl_event_callback_call(obj, EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND, (void*) ss_key); + eina_stringshare_del(ss_key); + return 0; } EOLIAN static void diff --git a/src/lib/elementary/efl_ui_layout_factory.eo b/src/lib/elementary/efl_ui_layout_factory.eo index ea71e89a32..b31486db02 100644 --- a/src/lib/elementary/efl_ui_layout_factory.eo +++ b/src/lib/elementary/efl_ui_layout_factory.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Layout_Factory extends Efl.Ui.Caching_Factory +class @beta Efl.Ui.Layout_Factory extends Efl.Ui.Caching_Factory { [[Efl Ui Layout Factory class]] methods { @@ -16,7 +16,7 @@ class Efl.Ui.Layout_Factory extends Efl.Ui.Caching_Factory Efl.Object.constructor; Efl.Object.destructor; Efl.Ui.Factory.create; - Efl.Ui.Factory.model_connect; - Efl.Ui.Model.Connect.connect; + Efl.Ui.Property_Bind.property_bind; + Efl.Ui.Factory_Bind.factory_bind; } } diff --git a/src/lib/elementary/efl_ui_layout_legacy.eo b/src/lib/elementary/efl_ui_layout_legacy.eo deleted file mode 100644 index ca16e604c8..0000000000 --- a/src/lib/elementary/efl_ui_layout_legacy.eo +++ /dev/null @@ -1,8 +0,0 @@ -class Efl.Ui.Layout_Legacy extends Efl.Ui.Layout implements Efl.Ui.Legacy -{ - [[Elementary layout class]] - data: null; - implements { - Efl.Object.constructor; - } -} diff --git a/src/lib/elementary/efl_ui_layout_legacy_eo.c b/src/lib/elementary/efl_ui_layout_legacy_eo.c new file mode 100644 index 0000000000..6bec4f9f78 --- /dev/null +++ b/src/lib/elementary/efl_ui_layout_legacy_eo.c @@ -0,0 +1,35 @@ + +Efl_Object *_efl_ui_layout_legacy_efl_object_constructor(Eo *obj, void *pd); + + +static Eina_Bool +_efl_ui_layout_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_LAYOUT_LEGACY_EXTRA_OPS +#define EFL_UI_LAYOUT_LEGACY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _efl_ui_layout_legacy_efl_object_constructor), + EFL_UI_LAYOUT_LEGACY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_layout_legacy_class_desc = { + EO_VERSION, + "Efl.Ui.Layout_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _efl_ui_layout_legacy_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_layout_legacy_class_get, &_efl_ui_layout_legacy_class_desc, EFL_UI_LAYOUT_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/efl_ui_layout_legacy_eo.h b/src/lib/elementary/efl_ui_layout_legacy_eo.h new file mode 100644 index 0000000000..3ad5c08573 --- /dev/null +++ b/src/lib/elementary/efl_ui_layout_legacy_eo.h @@ -0,0 +1,26 @@ +#ifndef _EFL_UI_LAYOUT_LEGACY_EO_H_ +#define _EFL_UI_LAYOUT_LEGACY_EO_H_ + +#ifndef _EFL_UI_LAYOUT_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_LAYOUT_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Layout_Legacy; + +#endif + +#ifndef _EFL_UI_LAYOUT_LEGACY_EO_TYPES +#define _EFL_UI_LAYOUT_LEGACY_EO_TYPES + + +#endif +#ifdef EFL_BETA_API_SUPPORT +/** Elementary layout class + * + * @ingroup Efl_Ui_Layout_Legacy + */ +#define EFL_UI_LAYOUT_LEGACY_CLASS efl_ui_layout_legacy_class_get() + +EWAPI const Efl_Class *efl_ui_layout_legacy_class_get(void); +#endif /* EFL_BETA_API_SUPPORT */ + +#endif diff --git a/src/lib/elementary/efl_ui_layout_legacy_eo.legacy.h b/src/lib/elementary/efl_ui_layout_legacy_eo.legacy.h new file mode 100644 index 0000000000..06a8f751e0 --- /dev/null +++ b/src/lib/elementary/efl_ui_layout_legacy_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_LAYOUT_LEGACY_EO_LEGACY_H_ +#define _EFL_UI_LAYOUT_LEGACY_EO_LEGACY_H_ + +#ifndef _EFL_UI_LAYOUT_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_LAYOUT_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Layout_Legacy; + +#endif + +#ifndef _EFL_UI_LAYOUT_LEGACY_EO_TYPES +#define _EFL_UI_LAYOUT_LEGACY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/efl_ui_layout_pack.c b/src/lib/elementary/efl_ui_layout_pack.c index e01ba6616f..c59264cede 100644 --- a/src/lib/elementary/efl_ui_layout_pack.c +++ b/src/lib/elementary/efl_ui_layout_pack.c @@ -13,8 +13,8 @@ #include "elm_widget_layout.h" #include "elm_part_helper.h" -#include "../evas/canvas/evas_box.eo.h" -#include "../evas/canvas/evas_table.eo.h" +#include "../evas/canvas/evas_box_eo.h" +#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); @@ -67,7 +67,7 @@ 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_BASE_CLASS, obj); eina_stringshare_replace(&pd->part, part); pd->temp = 1; } @@ -111,13 +111,6 @@ _efl_ui_layout_part_box_efl_pack_unpack(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Box_D 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_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_Entity *subobj) { @@ -225,7 +218,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_BASE_CLASS, obj); eina_stringshare_replace(&pd->part, part); pd->temp = 1; } @@ -281,13 +274,6 @@ _efl_ui_layout_part_table_efl_pack_unpack(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Tab 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_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_Entity *subobj, int col, int row, int colspan, int rowspan) { diff --git a/src/lib/elementary/efl_ui_layout_part.eo b/src/lib/elementary/efl_ui_layout_part.eo index 9dad61e75f..0ce9829c59 100644 --- a/src/lib/elementary/efl_ui_layout_part.eo +++ b/src/lib/elementary/efl_ui_layout_part.eo @@ -1,10 +1,5 @@ -class Efl.Ui.Layout_Part extends Efl.Ui.Widget_Part implements Efl.Ui.Cursor +class @beta Efl.Ui.Layout_Part extends Efl.Ui.Widget_Part { [[Elementary layout internal part class]] data: null; - implements { - Efl.Ui.Cursor.cursor { get; set; } - Efl.Ui.Cursor.cursor_style { get; set; } - Efl.Ui.Cursor.cursor_theme_search_enabled { get; set; } - } } diff --git a/src/lib/elementary/efl_ui_layout_part_bg.eo b/src/lib/elementary/efl_ui_layout_part_bg.eo index dff060f9bd..f1404d2c10 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 extends Efl.Ui.Widget_Part_Bg +class @beta Efl.Ui.Layout_Part_Bg extends 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 59ecc649ea..f83bff735d 100644 --- a/src/lib/elementary/efl_ui_layout_part_box.eo +++ b/src/lib/elementary/efl_ui_layout_part_box.eo @@ -1,5 +1,5 @@ -class Efl.Ui.Layout_Part_Box extends Efl.Object implements Efl.Pack_Linear, - Efl.Ui.Direction +class @beta Efl.Ui.Layout_Part_Box extends Efl.Object implements Efl.Pack_Linear, + Efl.Ui.Direction_Readonly { [[Represents a Box created as part of a layout. @@ -22,7 +22,6 @@ class Efl.Ui.Layout_Part_Box extends Efl.Object implements Efl.Pack_Linear, Efl.Object.destructor; Efl.Container.content_iterate; Efl.Container.content_count; - Efl.Container.content_remove; Efl.Ui.Direction.direction { get; } Efl.Pack.pack_clear; Efl.Pack.unpack_all; diff --git a/src/lib/elementary/efl_ui_layout_part_content.eo b/src/lib/elementary/efl_ui_layout_part_content.eo index c09d075d40..923033dd4e 100644 --- a/src/lib/elementary/efl_ui_layout_part_content.eo +++ b/src/lib/elementary/efl_ui_layout_part_content.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Layout_Part_Content extends Efl.Ui.Layout_Part implements Efl.Content +class @beta Efl.Ui.Layout_Part_Content extends Efl.Ui.Layout_Part implements Efl.Content { [[Elementary layout internal part class]] data: null; diff --git a/src/lib/elementary/efl_ui_layout_part_legacy.eo b/src/lib/elementary/efl_ui_layout_part_legacy.eo index af6279eea2..3137a43b6d 100644 --- a/src/lib/elementary/efl_ui_layout_part_legacy.eo +++ b/src/lib/elementary/efl_ui_layout_part_legacy.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Layout_Part_Legacy extends Efl.Ui.Layout_Part implements Efl.Content, Efl.Text, +class @beta Efl.Ui.Layout_Part_Legacy extends Efl.Ui.Layout_Part implements Efl.Content, Efl.Text, Efl.Text_Markup, Efl.Ui.L10n { [[Elementary layout internal part class]] diff --git a/src/lib/elementary/efl_ui_layout_part_table.eo b/src/lib/elementary/efl_ui_layout_part_table.eo index db6ce0836d..2ffe6fae99 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 extends Efl.Object implements Efl.Pack_Table +class @beta Efl.Ui.Layout_Part_Table extends Efl.Object implements Efl.Pack_Table { [[Represents a Table created as part of a layout. @@ -21,7 +21,6 @@ class Efl.Ui.Layout_Part_Table extends Efl.Object implements Efl.Pack_Table Efl.Object.destructor; Efl.Container.content_iterate; Efl.Container.content_count; - Efl.Container.content_remove; Efl.Pack.pack_clear; Efl.Pack.unpack_all; Efl.Pack.unpack; diff --git a/src/lib/elementary/efl_ui_layout_part_text.eo b/src/lib/elementary/efl_ui_layout_part_text.eo index 0a092a251f..a7442a7f45 100644 --- a/src/lib/elementary/efl_ui_layout_part_text.eo +++ b/src/lib/elementary/efl_ui_layout_part_text.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Layout_Part_Text extends Efl.Ui.Layout_Part implements Efl.Text, Efl.Text_Markup, +class @beta Efl.Ui.Layout_Part_Text extends Efl.Ui.Layout_Part implements Efl.Text, Efl.Text_Markup, Efl.Ui.L10n { [[Elementary layout internal part class]] diff --git a/src/lib/elementary/efl_ui_legacy.eo b/src/lib/elementary/efl_ui_legacy.eo index f4cba24d9c..4537d302ed 100644 --- a/src/lib/elementary/efl_ui_legacy.eo +++ b/src/lib/elementary/efl_ui_legacy.eo @@ -1,4 +1,4 @@ -interface Efl.Ui.Legacy extends Efl.Interface +interface @beta Efl.Ui.Legacy { [[The bg (background) widget is used for setting (solid) background decorations diff --git a/src/lib/elementary/efl_ui_list.c b/src/lib/elementary/efl_ui_list.c index 045346ceee..978aae3271 100644 --- a/src/lib/elementary/efl_ui_list.c +++ b/src/lib/elementary/efl_ui_list.c @@ -5,7 +5,6 @@ #define ELM_LAYOUT_PROTECTED #define EFL_UI_SCROLL_MANAGER_PROTECTED #define EFL_UI_SCROLLBAR_PROTECTED -#define EFL_UI_SCROLLBAR_BETA #include #include "elm_priv.h" @@ -255,57 +254,57 @@ _scroll_edje_object_attach(Eo *obj) efl_layout_signal_callback_add (obj, "reload", "efl", - _efl_ui_list_reload_cb, obj); + obj, _efl_ui_list_reload_cb, NULL); efl_layout_signal_callback_add (obj, "drag", "efl.dragable.vbar", - _efl_ui_list_vbar_drag_cb, obj); + obj, _efl_ui_list_vbar_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,set", "efl.dragable.vbar", - _efl_ui_list_edje_drag_cb, obj); + obj, _efl_ui_list_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,start", "efl.dragable.vbar", - _efl_ui_list_edje_drag_start_cb, obj); + obj, _efl_ui_list_edje_drag_start_cb, NULL); efl_layout_signal_callback_add (obj, "drag,stop", "efl.dragable.vbar", - _efl_ui_list_edje_drag_stop_cb, obj); + obj, _efl_ui_list_edje_drag_stop_cb, NULL); efl_layout_signal_callback_add (obj, "drag,step", "efl.dragable.vbar", - _efl_ui_list_edje_drag_cb, obj); + obj, _efl_ui_list_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,page", "efl.dragable.vbar", - _efl_ui_list_edje_drag_cb, obj); + obj, _efl_ui_list_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "efl,vbar,press", "efl", - _efl_ui_list_vbar_press_cb, obj); + obj, _efl_ui_list_vbar_press_cb, NULL); efl_layout_signal_callback_add (obj, "efl,vbar,unpress", "efl", - _efl_ui_list_vbar_unpress_cb, obj); + obj, _efl_ui_list_vbar_unpress_cb, NULL); /* 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); + obj, _efl_ui_list_hbar_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,set", "efl.dragable.hbar", - _efl_ui_list_edje_drag_cb, obj); + obj, _efl_ui_list_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,start", "efl.dragable.hbar", - _efl_ui_list_edje_drag_start_cb, obj); + obj, _efl_ui_list_edje_drag_start_cb, NULL); efl_layout_signal_callback_add (obj, "drag,stop", "efl.dragable.hbar", - _efl_ui_list_edje_drag_stop_cb, obj); + obj, _efl_ui_list_edje_drag_stop_cb, NULL); efl_layout_signal_callback_add (obj, "drag,step", "efl.dragable.hbar", - _efl_ui_list_edje_drag_cb, obj); + obj, _efl_ui_list_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,page", "efl.dragable.hbar", - _efl_ui_list_edje_drag_cb, obj); + obj, _efl_ui_list_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "efl,hbar,press", "efl", - _efl_ui_list_hbar_press_cb, obj); + obj, _efl_ui_list_hbar_press_cb, NULL); efl_layout_signal_callback_add (obj, "efl,hbar,unpress", "efl", - _efl_ui_list_hbar_unpress_cb, obj); + obj, _efl_ui_list_hbar_unpress_cb, NULL); */ } @@ -316,57 +315,57 @@ _scroll_edje_object_detach(Eo *obj) efl_layout_signal_callback_del (obj, "reload", "efl", - _efl_ui_list_reload_cb, obj); + obj, _efl_ui_list_reload_cb, NULL); efl_layout_signal_callback_del (obj, "drag", "efl.dragable.vbar", - _efl_ui_list_vbar_drag_cb, obj); + obj, _efl_ui_list_vbar_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,set", "efl.dragable.vbar", - _efl_ui_list_edje_drag_cb, obj); + obj, _efl_ui_list_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,start", "efl.dragable.vbar", - _efl_ui_list_edje_drag_start_cb, obj); + obj, _efl_ui_list_edje_drag_start_cb, NULL); efl_layout_signal_callback_del (obj, "drag,stop", "efl.dragable.vbar", - _efl_ui_list_edje_drag_stop_cb, obj); + obj, _efl_ui_list_edje_drag_stop_cb, NULL); efl_layout_signal_callback_del (obj, "drag,step", "efl.dragable.vbar", - _efl_ui_list_edje_drag_cb, obj); + obj, _efl_ui_list_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,page", "efl.dragable.vbar", - _efl_ui_list_edje_drag_cb, obj); + obj, _efl_ui_list_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "efl,vbar,press", "efl", - _efl_ui_list_vbar_press_cb, obj); + obj, _efl_ui_list_vbar_press_cb, NULL); efl_layout_signal_callback_del (obj, "efl,vbar,unpress", "efl", - _efl_ui_list_vbar_unpress_cb, obj); + obj, _efl_ui_list_vbar_unpress_cb, NULL); /* 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); + obj, _efl_ui_list_hbar_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,set", "efl.dragable.hbar", - _efl_ui_list_edje_drag_cb, obj); + obj, _efl_ui_list_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,start", "efl.dragable.hbar", - _efl_ui_list_edje_drag_start_cb, obj); + obj, _efl_ui_list_edje_drag_start_cb, NULL); efl_layout_signal_callback_del (obj, "drag,stop", "efl.dragable.hbar", - _efl_ui_list_edje_drag_stop_cb, obj); + obj, _efl_ui_list_edje_drag_stop_cb, NULL); efl_layout_signal_callback_del (obj, "drag,step", "efl.dragable.hbar", - _efl_ui_list_edje_drag_cb, obj); + obj, _efl_ui_list_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,page", "efl.dragable.hbar", - _efl_ui_list_edje_drag_cb, obj); + obj, _efl_ui_list_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "efl,hbar,press", "efl", - _efl_ui_list_hbar_press_cb, obj); + obj, _efl_ui_list_hbar_press_cb, NULL); efl_layout_signal_callback_del (obj, "efl,hbar,unpress", "efl", - _efl_ui_list_hbar_unpress_cb, obj); + obj, _efl_ui_list_hbar_unpress_cb, NULL); */ } @@ -414,6 +413,8 @@ _efl_ui_list_size_hint_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED) EOLIAN static Eo * _efl_ui_list_efl_object_constructor(Eo *obj, Efl_Ui_List_Data *pd EINA_UNUSED) { + if (!elm_widget_theme_klass_get(obj)) + elm_widget_theme_klass_set(obj, "list"); obj = efl_constructor(efl_super(obj, MY_CLASS)); return obj; @@ -427,10 +428,6 @@ _efl_ui_list_efl_object_finalize(Eo *obj, ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); - Efl_Ui_Theme_Apply_Result theme_apply_ret = efl_ui_layout_theme_set(obj, "list", "base", efl_ui_widget_style_get(obj)); - if (theme_apply_ret == EFL_UI_THEME_APPLY_RESULT_FAIL) - CRI("list(%p) failed to set theme [efl/list:%s]!", obj, efl_ui_widget_style_get(obj) ?: "NULL"); - pd->smanager = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj); efl_ui_mirrored_set(pd->smanager, efl_ui_mirrored_get(obj)); efl_composite_attach(obj, pd->smanager); @@ -445,7 +442,7 @@ _efl_ui_list_efl_object_finalize(Eo *obj, 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; + pd->select_mode = EFL_UI_SELECT_MODE_SINGLE; _scroll_edje_object_attach(obj); @@ -457,11 +454,11 @@ _efl_ui_list_efl_object_finalize(Eo *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_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_RESIZE, + efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _efl_ui_list_resized_cb, obj); - efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS, + efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _efl_ui_list_size_hint_changed_cb, obj); - efl_event_callback_add(pd->pan, EFL_GFX_ENTITY_EVENT_RESIZE, + efl_event_callback_add(pd->pan, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _efl_ui_list_pan_resized_cb, obj); elm_layout_sizing_eval(obj); @@ -470,7 +467,7 @@ _efl_ui_list_efl_object_finalize(Eo *obj, } EOLIAN static void -_efl_ui_list_efl_object_destructor(Eo *obj, Efl_Ui_List_Data *pd) +_efl_ui_list_efl_object_invalidate(Eo *obj, Efl_Ui_List_Data *pd) { _scroll_edje_object_detach(obj); @@ -482,21 +479,23 @@ _efl_ui_list_efl_object_destructor(Eo *obj, Efl_Ui_List_Data *pd) _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_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _efl_ui_list_resized_cb, obj); - efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS, + efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _efl_ui_list_size_hint_changed_cb, obj); - efl_event_callback_del(pd->pan, EFL_GFX_ENTITY_EVENT_RESIZE, + efl_event_callback_del(pd->pan, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _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)); + efl_invalidate(efl_super(obj, MY_CLASS)); } EOLIAN static void @@ -518,9 +517,9 @@ _efl_ui_list_elm_layout_sizing_eval(Eo *obj, Efl_Ui_List_Data *pd) if (pd->box) { - 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); + min = efl_gfx_hint_size_combined_min_get(pd->box); + max = efl_gfx_hint_size_max_get(pd->box); + efl_gfx_hint_weight_get(pd->box, &xw, &yw); } if (pd->smanager) @@ -553,11 +552,11 @@ _efl_ui_list_elm_layout_sizing_eval(Eo *obj, Efl_Ui_List_Data *pd) if (pd->match_content_w) size.w = vmw + min.w; if (pd->match_content_h) size.h = vmh + min.h; - max = efl_gfx_size_hint_max_get(obj); + max = efl_gfx_hint_size_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; - efl_gfx_size_hint_min_set(obj, size); + efl_gfx_hint_size_min_set(obj, size); } //FIXME: is this box related API could be improved more? @@ -600,12 +599,12 @@ _efl_ui_list_efl_container_content_iterate(Eo *obj EINA_UNUSED, Efl_Ui_List_Data } */ -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_list_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_List_Data *pd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; efl_ui_mirrored_set(pd->smanager, efl_ui_mirrored_get(obj)); @@ -647,7 +646,7 @@ _list_item_selected(void *data, const Efl_Event *event) EFL_UI_LIST_DATA_GET_OR_RETURN(obj, pd); /* Single Select */ - if (pd->select_mode != EFL_UI_SELECT_MULTI) + if (pd->select_mode != EFL_UI_SELECT_MODE_MULTI) { EINA_LIST_FREE(pd->selected, selected) { @@ -658,7 +657,7 @@ _list_item_selected(void *data, const Efl_Event *event) pd->selected = eina_list_append(pd->selected, item); pd->last_selected = item; - efl_event_callback_call(obj, EFL_UI_EVENT_SELECTED, item); + efl_event_callback_call(obj, EFL_UI_EVENT_ITEM_SELECTED, item); } static void @@ -671,7 +670,7 @@ _list_item_unselected(void *data, const Efl_Event *event) 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); + efl_event_callback_call(obj, EFL_UI_EVENT_ITEM_UNSELECTED, item); } static Eina_Bool @@ -690,8 +689,8 @@ _list_item_process(Eo *obj, Efl_Ui_List_Data *pd, EINA_UNUSED Efl_Ui_List_Item * 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); + efl_event_callback_add(it, EFL_UI_EVENT_ITEM_SELECTED, _list_item_selected, obj); + efl_event_callback_add(it, EFL_UI_EVENT_ITEM_UNSELECTED, _list_item_unselected, obj); return EINA_TRUE; } @@ -709,8 +708,8 @@ _list_item_clear(Eo *obj, Efl_Ui_List_Data *pd EINA_UNUSED, EINA_UNUSED Efl_Ui_L 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); + efl_event_callback_del(it, EFL_UI_EVENT_ITEM_SELECTED, _list_item_selected, obj); + efl_event_callback_del(it, EFL_UI_EVENT_ITEM_UNSELECTED, _list_item_unselected, obj); } /* Pack APIs */ @@ -936,9 +935,9 @@ _efl_ui_list_efl_ui_multi_selectable_select_mode_set(Eo *obj EINA_UNUSED, { Efl_Ui_List_Item *selected; - if ((pd->select_mode == EFL_UI_SELECT_MULTI && - mode != EFL_UI_SELECT_MULTI) || - mode == EFL_UI_SELECT_NONE) + if ((pd->select_mode == EFL_UI_SELECT_MODE_MULTI && + mode != EFL_UI_SELECT_MODE_MULTI) || + mode == EFL_UI_SELECT_MODE_NONE) { Eina_List *clone = eina_list_clone(pd->selected); EINA_LIST_FREE(clone, selected) diff --git a/src/lib/elementary/efl_ui_list.eo b/src/lib/elementary/efl_ui_list.eo index 5ccb5bda4e..8a77e37261 100644 --- a/src/lib/elementary/efl_ui_list.eo +++ b/src/lib/elementary/efl_ui_list.eo @@ -1,6 +1,6 @@ import efl_ui_list_item; -class Efl.Ui.List extends Efl.Ui.Layout implements +class @beta Efl.Ui.List extends Efl.Ui.Layout_Base implements Efl.Ui.Scrollable_Interactive, Efl.Ui.Scrollbar, Efl.Pack_Linear, Efl.Pack_Layout, @@ -42,7 +42,7 @@ class Efl.Ui.List extends Efl.Ui.Layout implements //Efl.Object Efl.Object.constructor; Efl.Object.finalize; - Efl.Object.destructor; + Efl.Object.invalidate; //Efl.Canvas Efl.Canvas.Group.group_calculate; @@ -83,4 +83,8 @@ class Efl.Ui.List extends Efl.Ui.Layout implements //Efl.Ui.Multi_Selectable Efl.Ui.Multi_Selectable.select_mode {get; set;} } + composite { + Efl.Ui.Scrollable_Interactive; + Efl.Ui.Scrollbar; + } } diff --git a/src/lib/elementary/efl_ui_list_default_item.c b/src/lib/elementary/efl_ui_list_default_item.c index 98138b1d8b..3fcf9e7521 100644 --- a/src/lib/elementary/efl_ui_list_default_item.c +++ b/src/lib/elementary/efl_ui_list_default_item.c @@ -23,9 +23,9 @@ _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_Result theme_apply_ret = efl_ui_layout_theme_set(obj, "list_item", NULL, NULL); + Eina_Error theme_apply_ret = efl_ui_layout_theme_set(obj, "list_item", NULL, NULL); - if (theme_apply_ret == EFL_UI_THEME_APPLY_RESULT_FAIL) + if (theme_apply_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Default Item(%p) failed to set theme [efl/list_item]!", eo); return eo; } diff --git a/src/lib/elementary/efl_ui_list_default_item.eo b/src/lib/elementary/efl_ui_list_default_item.eo index d4aca6941e..5ea4d2e44a 100644 --- a/src/lib/elementary/efl_ui_list_default_item.eo +++ b/src/lib/elementary/efl_ui_list_default_item.eo @@ -1,5 +1,5 @@ -class Efl.Ui.List_Default_Item extends Efl.Ui.List_Item implements +class @beta Efl.Ui.List_Default_Item extends Efl.Ui.List_Item implements Efl.Text, Efl.Text_Markup, Efl.Content 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 index c7b51fbf01..9ff2d1160e 100644 --- a/src/lib/elementary/efl_ui_list_default_item_part_end.eo +++ b/src/lib/elementary/efl_ui_list_default_item_part_end.eo @@ -1,4 +1,4 @@ -class Efl.Ui.List_Default_Item_Part_End extends Efl.Ui.Layout_Part implements Efl.Content +class @beta Efl.Ui.List_Default_Item_Part_End extends Efl.Ui.Layout_Part implements Efl.Content { [[List Default Item internal content of end part class]] data: null; 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 index ff0ec0e432..232b0d95b1 100644 --- a/src/lib/elementary/efl_ui_list_default_item_part_icon.eo +++ b/src/lib/elementary/efl_ui_list_default_item_part_icon.eo @@ -1,4 +1,4 @@ -class Efl.Ui.List_Default_Item_Part_Icon extends Efl.Ui.Layout_Part implements Efl.Content +class @beta Efl.Ui.List_Default_Item_Part_Icon extends Efl.Ui.Layout_Part implements Efl.Content { [[List Default Item internal content of icon part class]] data: null; diff --git a/src/lib/elementary/efl_ui_list_empty_item.c b/src/lib/elementary/efl_ui_list_empty_item.c index 33259505ac..bc4aab1b95 100644 --- a/src/lib/elementary/efl_ui_list_empty_item.c +++ b/src/lib/elementary/efl_ui_list_empty_item.c @@ -21,9 +21,9 @@ _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_Result theme_apply_ret = efl_ui_layout_theme_set(obj, "list_item", NULL, "empty"); + Eina_Error theme_apply_ret = efl_ui_layout_theme_set(obj, "list_item", NULL, "empty"); - if (theme_apply_ret == EFL_UI_THEME_APPLY_RESULT_FAIL) + if (theme_apply_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Empty Item(%p) failed to set theme [efl/list_item:empty]!", eo); return eo; } diff --git a/src/lib/elementary/efl_ui_list_empty_item.eo b/src/lib/elementary/efl_ui_list_empty_item.eo index 9b3456dee5..070b60531f 100644 --- a/src/lib/elementary/efl_ui_list_empty_item.eo +++ b/src/lib/elementary/efl_ui_list_empty_item.eo @@ -1,5 +1,5 @@ -class Efl.Ui.List_Empty_Item extends Efl.Ui.List_Item implements Efl.Content +class @beta Efl.Ui.List_Empty_Item extends Efl.Ui.List_Item implements Efl.Content { [[List Empty Item class. This item have only one swallow space, thus user can decorate item by filling the swallow with diff --git a/src/lib/elementary/efl_ui_list_item.eo b/src/lib/elementary/efl_ui_list_item.eo index e1bcf9235d..2997926cfd 100644 --- a/src/lib/elementary/efl_ui_list_item.eo +++ b/src/lib/elementary/efl_ui_list_item.eo @@ -1,5 +1,5 @@ -abstract Efl.Ui.List_Item extends Efl.Ui.Item +abstract @beta Efl.Ui.List_Item extends Efl.Ui.Item { implements { //Efl.Object diff --git a/src/lib/elementary/efl_ui_list_view.c b/src/lib/elementary/efl_ui_list_view.c index ee26515822..219d2aa151 100644 --- a/src/lib/elementary/efl_ui_list_view.c +++ b/src/lib/elementary/efl_ui_list_view.c @@ -5,7 +5,6 @@ #define EFL_ACCESS_SELECTION_PROTECTED #define EFL_UI_SCROLL_MANAGER_PROTECTED #define EFL_UI_SCROLLBAR_PROTECTED -#define EFL_UI_SCROLLBAR_BETA #define EFL_UI_FOCUS_COMPOSITION_PROTECTED #define EFL_UI_WIDGET_FOCUS_MANAGER_PROTECTED @@ -59,7 +58,7 @@ _efl_ui_list_view_pan_efl_ui_pan_pan_position_set(Eo *obj EINA_UNUSED, Efl_Ui_Li psd->gmt.x = pos.x; psd->gmt.y = pos.y; - efl_event_callback_call(obj, EFL_UI_PAN_EVENT_POSITION_CHANGED, NULL); + efl_event_callback_call(obj, EFL_UI_PAN_EVENT_PAN_POSITION_CHANGED, NULL); evas_object_smart_changed(psd->wobj); } @@ -438,24 +437,24 @@ _efl_ui_list_view_bar_hide_cb(void *data, const Efl_Event *event) edje_object_signal_emit(wd->resize_obj, "efl,action,hide,vbar", "efl"); } -EOLIAN static Eina_Bool -_efl_ui_list_view_efl_layout_signal_signal_callback_add(Eo *obj EINA_UNUSED, Efl_Ui_List_View_Data *sd EINA_UNUSED, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data) +static Eina_Bool +_efl_ui_list_view_efl_layout_signal_signal_callback_add(Eo *obj, Efl_Ui_List_View_Data *pd EINA_UNUSED, const char *emission, const char *source, void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb) { 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); + ok = efl_layout_signal_callback_add(wd->resize_obj, emission, source, func_data, func, func_free_cb); return ok; } -EOLIAN static Eina_Bool -_efl_ui_list_view_efl_layout_signal_signal_callback_del(Eo *obj EINA_UNUSED, Efl_Ui_List_View_Data *sd EINA_UNUSED, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data) +static Eina_Bool +_efl_ui_list_view_efl_layout_signal_signal_callback_del(Eo *obj, Efl_Ui_List_View_Data *pd EINA_UNUSED, const char *emission, const char *source, void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb) { 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); + ok = efl_layout_signal_callback_del(wd->resize_obj, emission, source, func_data, func, func_free_cb); return ok; } @@ -464,116 +463,118 @@ static void _efl_ui_list_view_edje_object_attach(Eo *obj) { efl_layout_signal_callback_add - (obj, "reload", "efl", _efl_ui_list_view_reload_cb, obj); + (obj, "reload", "efl", + obj, _efl_ui_list_view_reload_cb, NULL); //Vertical bar efl_layout_signal_callback_add (obj, "drag", "efl.dragable.vbar", - _efl_ui_list_view_vbar_drag_cb, obj); + obj, _efl_ui_list_view_vbar_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,set", "efl.dragable.vbar", - _efl_ui_list_view_edje_drag_cb, obj); + obj, _efl_ui_list_view_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,start", "efl.dragable.vbar", - _efl_ui_list_view_edje_drag_start_cb, obj); + obj, _efl_ui_list_view_edje_drag_start_cb, NULL); efl_layout_signal_callback_add (obj, "drag,stop", "efl.dragable.vbar", - _efl_ui_list_view_edje_drag_stop_cb, obj); + obj, _efl_ui_list_view_edje_drag_stop_cb, NULL); efl_layout_signal_callback_add (obj, "drag,step", "efl.dragable.vbar", - _efl_ui_list_view_edje_drag_cb, obj); + obj, _efl_ui_list_view_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,page", "efl.dragable.vbar", - _efl_ui_list_view_edje_drag_cb, obj); + obj, _efl_ui_list_view_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "efl,vbar,press", "efl", - _efl_ui_list_view_vbar_press_cb, obj); + obj, _efl_ui_list_view_vbar_press_cb, NULL); efl_layout_signal_callback_add (obj, "efl,vbar,unpress", "efl", - _efl_ui_list_view_vbar_unpress_cb, obj); + obj, _efl_ui_list_view_vbar_unpress_cb, NULL); - //Horizontal bar + //Horizontal bar efl_layout_signal_callback_add (obj, "drag", "efl.dragable.hbar", - _efl_ui_list_view_hbar_drag_cb, obj); + obj, _efl_ui_list_view_hbar_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,set", "efl.dragable.hbar", - _efl_ui_list_view_edje_drag_cb, obj); + obj, _efl_ui_list_view_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,start", "efl.dragable.hbar", - _efl_ui_list_view_edje_drag_start_cb, obj); + obj, _efl_ui_list_view_edje_drag_start_cb, NULL); efl_layout_signal_callback_add (obj, "drag,stop", "efl.dragable.hbar", - _efl_ui_list_view_edje_drag_stop_cb, obj); + obj, _efl_ui_list_view_edje_drag_stop_cb, NULL); efl_layout_signal_callback_add (obj, "drag,step", "efl.dragable.hbar", - _efl_ui_list_view_edje_drag_cb, obj); + obj, _efl_ui_list_view_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,page", "efl.dragable.hbar", - _efl_ui_list_view_edje_drag_cb, obj); + obj, _efl_ui_list_view_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "efl,hbar,press", "efl", - _efl_ui_list_view_hbar_press_cb, obj); + obj, _efl_ui_list_view_hbar_press_cb, NULL); efl_layout_signal_callback_add (obj, "efl,hbar,unpress", "efl", - _efl_ui_list_view_hbar_unpress_cb, obj); + obj, _efl_ui_list_view_hbar_unpress_cb, NULL); } static void _efl_ui_list_view_edje_object_detach(Evas_Object *obj) { efl_layout_signal_callback_del - (obj, "reload", "efl", _efl_ui_list_view_reload_cb, obj); - //Vertical bar + (obj, "reload", "efl", + obj, _efl_ui_list_view_reload_cb, NULL); + //Vertical bar efl_layout_signal_callback_del - (obj, "drag", "efl.dragable.vbar", _efl_ui_list_view_vbar_drag_cb, - obj); + (obj, "drag", "efl.dragable.vbar", + obj, _efl_ui_list_view_vbar_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,set", "efl.dragable.vbar", - _efl_ui_list_view_edje_drag_cb, obj); + obj, _efl_ui_list_view_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,start", "efl.dragable.vbar", - _efl_ui_list_view_edje_drag_start_cb, obj); + obj, _efl_ui_list_view_edje_drag_start_cb, NULL); efl_layout_signal_callback_del (obj, "drag,stop", "efl.dragable.vbar", - _efl_ui_list_view_edje_drag_stop_cb, obj); + obj, _efl_ui_list_view_edje_drag_stop_cb, NULL); efl_layout_signal_callback_del (obj, "drag,step", "efl.dragable.vbar", - _efl_ui_list_view_edje_drag_cb, obj); + obj, _efl_ui_list_view_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,page", "efl.dragable.vbar", - _efl_ui_list_view_edje_drag_cb, obj); + obj, _efl_ui_list_view_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "efl,vbar,press", "efl", - _efl_ui_list_view_vbar_press_cb, obj); + obj, _efl_ui_list_view_vbar_press_cb, NULL); efl_layout_signal_callback_del (obj, "efl,vbar,unpress", "efl", - _efl_ui_list_view_vbar_unpress_cb, obj); + obj, _efl_ui_list_view_vbar_unpress_cb, NULL); //Horizontal bar efl_layout_signal_callback_del - (obj, "drag", "efl.dragable.hbar", - _efl_ui_list_view_hbar_drag_cb, obj); + (obj, "drag", "efl.dragable.hbar", + obj, _efl_ui_list_view_hbar_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,set", "efl.dragable.hbar", - _efl_ui_list_view_edje_drag_cb, obj); + obj, _efl_ui_list_view_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,start", "efl.dragable.hbar", - _efl_ui_list_view_edje_drag_start_cb, obj); + obj, _efl_ui_list_view_edje_drag_start_cb, NULL); efl_layout_signal_callback_del (obj, "drag,stop", "efl.dragable.hbar", - _efl_ui_list_view_edje_drag_stop_cb, obj); + obj, _efl_ui_list_view_edje_drag_stop_cb, NULL); efl_layout_signal_callback_del (obj, "drag,step", "efl.dragable.hbar", - _efl_ui_list_view_edje_drag_cb, obj); + obj, _efl_ui_list_view_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,page", "efl.dragable.hbar", - _efl_ui_list_view_edje_drag_cb, obj); + obj, _efl_ui_list_view_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "efl,hbar,press", "efl", - _efl_ui_list_view_hbar_press_cb, obj); + obj, _efl_ui_list_view_hbar_press_cb, NULL); efl_layout_signal_callback_del (obj, "efl,hbar,unpress", "efl", - _efl_ui_list_view_hbar_unpress_cb, obj); + obj, _efl_ui_list_view_hbar_unpress_cb, NULL); } EOLIAN static void @@ -587,7 +588,6 @@ _efl_ui_list_view_efl_canvas_group_group_add(Eo *obj, Efl_Ui_List_View_Data *pd) 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); @@ -608,13 +608,13 @@ _efl_ui_list_view_efl_canvas_group_group_add(Eo *obj, Efl_Ui_List_View_Data *pd) 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); + efl_gfx_stack_raise_to_top((Eo *)o); 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_gfx_hint_size_restricted_min_set(obj, min); efl_event_callback_add(obj, EFL_UI_SCROLLBAR_EVENT_BAR_SIZE_CHANGED, _efl_ui_list_view_bar_size_changed_cb, obj); @@ -675,11 +675,10 @@ _efl_ui_list_view_efl_object_constructor(Eo *obj, Efl_Ui_List_View_Data *pd) evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_LIST); - pd->seg_array = efl_new(EFL_UI_LIST_VIEW_SEG_ARRAY_CLASS, efl_ui_list_view_seg_array_setup(efl_added, 32)); + pd->seg_array = efl_ui_list_view_seg_array_setup(32); - efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED, _list_element_focused, NULL); + efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _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)); @@ -694,7 +693,7 @@ _efl_ui_list_view_efl_object_constructor(Eo *obj, Efl_Ui_List_View_Data *pd) EOLIAN static void _efl_ui_list_view_efl_object_destructor(Eo *obj, Efl_Ui_List_View_Data *pd) { - efl_event_callback_del(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED, + efl_event_callback_del(obj, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _list_element_focused, NULL); _efl_ui_list_view_edje_object_detach(obj); @@ -703,8 +702,7 @@ _efl_ui_list_view_efl_object_destructor(Eo *obj, Efl_Ui_List_View_Data *pd) efl_replace(&pd->relayout, NULL); efl_replace(&pd->factory, NULL); - efl_ui_list_view_seg_array_flush(pd->seg_array); - efl_unref(pd->seg_array); + efl_ui_list_view_seg_array_free(pd->seg_array); eina_stringshare_del(pd->style); efl_destructor(efl_super(obj, MY_CLASS)); @@ -831,19 +829,6 @@ _efl_ui_list_view_item_select_set(Efl_Ui_List_View_Layout_Item *item, Eina_Bool eina_stringshare_del(sprop); } -static void -_efl_ui_list_view_relayout_set(Eo *obj EINA_UNUSED, Efl_Ui_List_View_Data *pd EINA_UNUSED, Efl_Ui_List_View_Relayout *object) -{ - if (efl_replace(&pd->relayout, object) && pd->model && pd->relayout) - efl_ui_list_view_relayout_model_set(pd->relayout, pd->model); -} - -static Efl_Ui_List_View_Relayout * -_efl_ui_list_view_relayout_get(const Eo *obj EINA_UNUSED, Efl_Ui_List_View_Data *pd EINA_UNUSED) -{ - return pd->relayout; -} - static Eina_Value _children_slice_then(void * data, const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED) { @@ -879,7 +864,7 @@ _efl_ui_list_view_efl_ui_list_view_model_min_size_set(Eo *obj, Efl_Ui_List_View_ 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); + efl_event_callback_call(pd->pan_obj, EFL_UI_PAN_EVENT_PAN_CONTENT_CHANGED, NULL); } EOLIAN static void diff --git a/src/lib/elementary/efl_ui_list_view.eo b/src/lib/elementary/efl_ui_list_view.eo index 83e403f198..f963fd3331 100644 --- a/src/lib/elementary/efl_ui_list_view.eo +++ b/src/lib/elementary/efl_ui_list_view.eo @@ -1,21 +1,16 @@ import elm_general; -struct Efl.Ui.List_View_Item_Event +struct @beta Efl.Ui.List_View_Item_Event { layout: Efl.Ui.Layout; child: Efl.Model; index: int; } -class Efl.Ui.List_View extends Efl.Ui.Layout implements Efl.Ui.Scrollable_Interactive, Efl.Ui.Scrollbar, +class @beta Efl.Ui.List_View extends Efl.Ui.Layout_Base implements 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.List_View_Model, Efl.Ui.Widget_Focus_Manager { methods { - @property relayout { - values { - object: Efl.Ui.List_View_Relayout; - } - } @property homogeneous { get { [[Get whether the homogeneous mode is enabled.]] @@ -56,8 +51,6 @@ class Efl.Ui.List_View extends Efl.Ui.Layout implements Efl.Ui.Scrollable_Intera item,unfocused : Efl.Ui.List_View_Item_Event; item,highlighted : Efl.Ui.List_View_Item_Event; item,unhighlighted : Efl.Ui.List_View_Item_Event; - item,selected : Efl.Ui.List_View_Item_Event; - item,unselected : Efl.Ui.List_View_Item_Event; } implements { @@ -78,17 +71,13 @@ class Efl.Ui.List_View extends Efl.Ui.Layout implements Efl.Ui.Scrollable_Intera // Widget Efl.Ui.Widget_Focus_Manager.focus_manager_create; - Efl.Ui.Widget.widget_event; + Efl.Ui.Widget.widget_input_event_handler; Efl.Ui.Widget.focus_state_apply; Efl.Ui.Focus.Composition.prepare; Efl.Ui.View.model { get; set; } -// 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; } @@ -99,4 +88,8 @@ class Efl.Ui.List_View extends Efl.Ui.Layout implements Efl.Ui.Scrollable_Intera Efl.Access.Selection.all_children_select; Efl.Access.Selection.access_selection_clear; } + composite { + Efl.Ui.Scrollable_Interactive; + Efl.Ui.Scrollbar; + } } diff --git a/src/lib/elementary/efl_ui_list_view_model.eo b/src/lib/elementary/efl_ui_list_view_model.eo index 0a511e2de5..cf4780ed5f 100644 --- a/src/lib/elementary/efl_ui_list_view_model.eo +++ b/src/lib/elementary/efl_ui_list_view_model.eo @@ -1,6 +1,6 @@ import efl_ui_list_view_types; -interface Efl.Ui.List_View_Model extends Efl.Interface +interface @beta Efl.Ui.List_View_Model { methods { @property load_range { @@ -21,13 +21,6 @@ interface Efl.Ui.List_View_Model extends Efl.Interface item: ptr(Efl.Ui.List_View_Layout_Item); } } - // @property visible_range { - // set {} - // values { - // first: int; - // count: int; - // } - // } @property model_size { get {} values { diff --git a/src/lib/elementary/efl_ui_list_view_pan.eo b/src/lib/elementary/efl_ui_list_view_pan.eo index e05cd09b96..1bd72a8300 100644 --- a/src/lib/elementary/efl_ui_list_view_pan.eo +++ b/src/lib/elementary/efl_ui_list_view_pan.eo @@ -1,4 +1,4 @@ -class Efl.Ui.List_View_Pan extends Efl.Ui.Pan +class @beta Efl.Ui.List_View_Pan extends Efl.Ui.Pan { [[Elementary Efl_Ui_List_View pan class]] implements { diff --git a/src/lib/elementary/efl_ui_list_view_precise_layouter.c b/src/lib/elementary/efl_ui_list_view_precise_layouter.c index c6cd605f77..d20d706d3f 100644 --- a/src/lib/elementary/efl_ui_list_view_precise_layouter.c +++ b/src/lib/elementary/efl_ui_list_view_precise_layouter.c @@ -7,6 +7,7 @@ #include #include "elm_priv.h" +#include "efl_ui_list_view_relayout.eo.h" #include "efl_ui_list_view_seg_array.h" #define MY_CLASS EFL_UI_LIST_VIEW_PRECISE_LAYOUTER_CLASS @@ -59,12 +60,12 @@ _item_size_calc(Efl_Ui_List_View_Precise_Layouter_Data *pd, Efl_Ui_List_View_Lay Eina_Bool fill[2]; Eina_Size2D max; - efl_gfx_size_hint_margin_get(item->layout, &pad[0], &pad[1], &pad[2], &pad[3]); + efl_gfx_hint_margin_get(item->layout, &pad[0], &pad[1], &pad[2], &pad[3]); evas_object_geometry_get(pd->modeler, &boxx, &boxy, &boxw, &boxh); - efl_gfx_size_hint_margin_get(pd->modeler, &boxl, &boxr, &boxt, &boxb); - efl_gfx_size_hint_align_get(item->layout, &align[0], &align[1]); - efl_gfx_size_hint_fill_get(item->layout, &fill[0], &fill[1]); - max = efl_gfx_size_hint_max_get(item->layout); + efl_gfx_hint_margin_get(pd->modeler, &boxl, &boxr, &boxt, &boxb); + efl_gfx_hint_align_get(item->layout, &align[0], &align[1]); + efl_gfx_hint_fill_get(item->layout, &fill[0], &fill[1]); + max = efl_gfx_hint_size_max_get(item->layout); // box outer margin boxw -= boxl + boxr; @@ -144,9 +145,9 @@ _item_min_calc(Efl_Ui_List_View_Precise_Layouter_Data *pd, Efl_Ui_List_View_Layo Efl_Ui_List_View_Layout_Item *layout_item; int i, pad[4]; - Eina_Size2D min = efl_gfx_size_hint_combined_min_get(item->layout); + Eina_Size2D min = efl_gfx_hint_size_combined_min_get(item->layout); - efl_gfx_size_hint_margin_get(item->layout, &pad[0], &pad[1], &pad[2], &pad[3]); + efl_gfx_hint_margin_get(item->layout, &pad[0], &pad[1], &pad[2], &pad[3]); min.w += pad[0] + pad[1]; min.h += pad[2] + pad[3]; @@ -353,7 +354,7 @@ _initilize(Eo *obj EINA_UNUSED, Efl_Ui_List_View_Precise_Layouter_Data *pd, Efl_ pd->recalc = EINA_TRUE; pd->initialized = EINA_TRUE; - efl_replace(&pd->seg_array, seg_array); + pd->seg_array = seg_array; efl_ui_list_view_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); @@ -400,7 +401,7 @@ _finalize(Eo *obj EINA_UNUSED, Efl_Ui_List_View_Precise_Layouter_Data *pd) efl_ui_list_view_model_min_size_set(pd->modeler, pd->min); } - efl_replace(&pd->seg_array, NULL); + pd->seg_array = NULL; efl_replace(&pd->modeler, NULL); pd->initialized = EINA_FALSE; @@ -566,6 +567,7 @@ _efl_ui_list_view_precise_layouter_efl_ui_list_view_relayout_content_created(Eo } cb_data = calloc(1, sizeof(Efl_Ui_List_View_Precise_Layouter_Callback_Data)); + if (!cb_data) return; cb_data->pd = pd; cb_data->item = item; evas_object_event_callback_add(item->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_item_size_hint_change, cb_data); @@ -632,7 +634,7 @@ _efl_ui_list_view_relayout_layout_do(Efl_Ui_List_View_Precise_Layouter_Data *pd) _calc_range(pd); evas_object_geometry_get(pd->modeler, &boxx, &boxy, &boxw, &boxh); - efl_gfx_size_hint_margin_get(pd->modeler, &boxl, &boxr, &boxt, &boxb); + efl_gfx_hint_margin_get(pd->modeler, &boxl, &boxr, &boxt, &boxb); // box outer margin boxw -= boxl + boxr; @@ -679,7 +681,7 @@ _efl_ui_list_view_relayout_layout_do(Efl_Ui_List_View_Precise_Layouter_Data *pd) if (pd->resize) _item_size_calc(pd, layout_item); - efl_gfx_size_hint_weight_get(layout_item->layout, &weight_x, &weight_y); + efl_gfx_hint_weight_get(layout_item->layout, &weight_x, &weight_y); } else { diff --git a/src/lib/elementary/efl_ui_list_view_precise_layouter.eo b/src/lib/elementary/efl_ui_list_view_precise_layouter.eo index 52f4964c6c..0a83c0a08b 100644 --- a/src/lib/elementary/efl_ui_list_view_precise_layouter.eo +++ b/src/lib/elementary/efl_ui_list_view_precise_layouter.eo @@ -1,4 +1,4 @@ -class Efl.Ui.List_View_Precise_Layouter extends Efl.Object implements Efl.Ui.List_View_Relayout +class @beta Efl.Ui.List_View_Precise_Layouter extends Efl.Object implements Efl.Ui.List_View_Relayout { implements { Efl.Object.constructor; diff --git a/src/lib/elementary/efl_ui_list_view_private.h b/src/lib/elementary/efl_ui_list_view_private.h index af3e2b5c98..6b1c632d60 100644 --- a/src/lib/elementary/efl_ui_list_view_private.h +++ b/src/lib/elementary/efl_ui_list_view_private.h @@ -6,6 +6,7 @@ #endif #include +#include "efl_ui_list_view_relayout.eo.h" #include "elm_priv.h" typedef struct _Efl_Ui_List_View_Data Efl_Ui_List_View_Data; diff --git a/src/lib/elementary/efl_ui_list_view_relayout.eo b/src/lib/elementary/efl_ui_list_view_relayout.eo index 52cd23d577..07b5dc65bb 100644 --- a/src/lib/elementary/efl_ui_list_view_relayout.eo +++ b/src/lib/elementary/efl_ui_list_view_relayout.eo @@ -1,11 +1,11 @@ -interface Efl.Ui.List_View_Relayout extends Efl.Interface +interface @beta Efl.Ui.List_View_Relayout { methods { layout_do { params { modeler: Efl.Ui.List_View_Model; first: int; - children: Efl.Ui.List_View_Seg_Array; + children: ptr(Efl_Ui_List_View_Seg_Array); } } content_created { diff --git a/src/lib/elementary/efl_ui_list_view_seg_array.c b/src/lib/elementary/efl_ui_list_view_seg_array.c index 8c6c0ed154..89dba53011 100644 --- a/src/lib/elementary/efl_ui_list_view_seg_array.c +++ b/src/lib/elementary/efl_ui_list_view_seg_array.c @@ -5,13 +5,11 @@ #include #include -#define MY_CLASS EFL_UI_LIST_VIEW_SEG_ARRAY_CLASS -#define MY_CLASS_NAME "Efl.Ui.List_View_Seg_Array" - #include "efl_ui_list_view_private.h" #include "efl_ui_list_view_seg_array.h" -static int _search_lookup_cb(Eina_Rbtree const* rbtree, const void* key, int length EINA_UNUSED, void* data EINA_UNUSED) +static int +_search_lookup_cb(Eina_Rbtree const* rbtree, const void* key, int length EINA_UNUSED, void* data EINA_UNUSED) { Efl_Ui_List_View_Seg_Array_Node const* node = (void const*)rbtree; int index = *(int*)key; @@ -29,7 +27,8 @@ static int _search_lookup_cb(Eina_Rbtree const* rbtree, const void* key, int len } } -static int _insert_lookup_cb(Eina_Rbtree const* rbtree, const void* key, int length EINA_UNUSED, void* data EINA_UNUSED) +static int +_insert_lookup_cb(Eina_Rbtree const* rbtree, const void* key, int length EINA_UNUSED, void* data EINA_UNUSED) { Efl_Ui_List_View_Seg_Array_Node const* node = (void const*)rbtree; int index = *(int*)key; @@ -47,7 +46,8 @@ static int _insert_lookup_cb(Eina_Rbtree const* rbtree, const void* key, int len } } -static Eina_Rbtree_Direction _rbtree_compare(Efl_Ui_List_View_Seg_Array_Node const* left, +static Eina_Rbtree_Direction +_rbtree_compare(Efl_Ui_List_View_Seg_Array_Node const* left, Efl_Ui_List_View_Seg_Array_Node const* right, void* data EINA_UNUSED) { if(left->first < right->first) @@ -73,10 +73,11 @@ _free_node(Efl_Ui_List_View_Seg_Array_Node* node, void* data EINA_UNUSED) } static Efl_Ui_List_View_Seg_Array_Node* -_alloc_node(Efl_Ui_List_View_Seg_Array_Data* pd, int first) +_alloc_node(Efl_Ui_List_View_Seg_Array* pd, int first) { Efl_Ui_List_View_Seg_Array_Node* node; node = calloc(1, sizeof(Efl_Ui_List_View_Seg_Array_Node) + pd->step_size*sizeof(Efl_Ui_List_View_Layout_Item*)); + if (!node) return NULL; node->first = first; node->max = pd->step_size; pd->root = (void*)eina_rbtree_inline_insert(EINA_RBTREE_GET(pd->root), EINA_RBTREE_GET(node), @@ -85,25 +86,17 @@ _alloc_node(Efl_Ui_List_View_Seg_Array_Data* pd, int first) return node; } -EOLIAN static void -_efl_ui_list_view_seg_array_flush(Eo* obj EINA_UNUSED, Efl_Ui_List_View_Seg_Array_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_List_View_Layout_Item* _create_item_partial(Efl_Model* model) +static Efl_Ui_List_View_Layout_Item* +_create_item_partial(Efl_Model* model) { Efl_Ui_List_View_Layout_Item* item = calloc(1, sizeof(Efl_Ui_List_View_Layout_Item)); + if (!item) return NULL; item->children = efl_ref(model); return item; } -static Efl_Ui_List_View_Layout_Item* _create_item(Efl_Model* model, Efl_Ui_List_View_Seg_Array_Node* node, unsigned int index) +static Efl_Ui_List_View_Layout_Item* +_create_item(Efl_Model* model, Efl_Ui_List_View_Seg_Array_Node* node, unsigned int index) { Efl_Ui_List_View_Layout_Item* item = _create_item_partial(model); item->index_offset = index - node->first; @@ -111,43 +104,9 @@ static Efl_Ui_List_View_Layout_Item* _create_item(Efl_Model* model, Efl_Ui_List_ return item; } -EOLIAN static Efl_Ui_List_View_Layout_Item* -_efl_ui_list_view_seg_array_remove(Eo* obj EINA_UNUSED, Efl_Ui_List_View_Seg_Array_Data *pd, int index) -{ - Efl_Ui_List_View_Seg_Array_Node *node; - Efl_Ui_List_View_Layout_Item *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_list_view_seg_array_insert_at_node(Efl_Ui_List_View_Seg_Array_Data* pd, int index, Efl_Ui_List_View_Layout_Item* item, Efl_Ui_List_View_Seg_Array_Node* node) +_efl_ui_list_view_seg_array_insert_at_node(Efl_Ui_List_View_Seg_Array* pd, int index, + Efl_Ui_List_View_Layout_Item* item, Efl_Ui_List_View_Seg_Array_Node* node) { Eina_Iterator* iterator; int pos; @@ -193,83 +152,28 @@ _efl_ui_list_view_seg_array_insert_at_node(Efl_Ui_List_View_Seg_Array_Data* pd, eina_iterator_free(iterator); } - -EOLIAN static void -_efl_ui_list_view_seg_array_insert(Eo *obj EINA_UNUSED, Efl_Ui_List_View_Seg_Array_Data* pd, int index, Efl_Model* model) -{ - Efl_Ui_List_View_Seg_Array_Node* node, *next; - Efl_Ui_List_View_Layout_Item* 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_list_view_seg_array_insert_at_node(pd, index, item, next); - else - _efl_ui_list_view_seg_array_insert_at_node(pd, index, item, node); - } - else - _efl_ui_list_view_seg_array_insert_at_node(pd, index, item, NULL); -} - static void -efl_ui_list_view_seg_array_insert_object(Efl_Ui_List_View_Seg_Array_Data *seg_array, unsigned int index, Efl_Model *children) +_efl_ui_list_view_seg_array_insert_object(Efl_Ui_List_View_Seg_Array *pd, unsigned int index, Efl_Model *children) { Efl_Ui_List_View_Seg_Array_Node *node; - node = (void*)eina_rbtree_inline_lookup(EINA_RBTREE_GET(seg_array->root), + node = (void*)eina_rbtree_inline_lookup(EINA_RBTREE_GET(pd->root), &index, sizeof(index), &_insert_lookup_cb, NULL); if (!node) { - node = _alloc_node(seg_array, index); + node = _alloc_node(pd, index); } assert(node->length < node->max); node->pointers[node->length] = _create_item(children, node, index); node->length++; - seg_array->count++; -} - -EOLIAN static void -_efl_ui_list_view_seg_array_insert_value(Eo *obj EINA_UNUSED, Efl_Ui_List_View_Seg_Array_Data *seg_array, 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_list_view_seg_array_insert_object(seg_array, 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_list_view_seg_array_insert_object(seg_array, idx, children); - } - } - else - { - printf("Unknow type !\n"); - } -} - -EOLIAN static int -_efl_ui_list_view_seg_array_count(Eo *obj EINA_UNUSED, Efl_Ui_List_View_Seg_Array_Data* pd) -{ - return pd->count; + pd->count++; } typedef struct _Efl_Ui_List_View_Segarray_Eina_Accessor { Eina_Accessor vtable; - Efl_Ui_List_View_Seg_Array_Data* seg_array; + Efl_Ui_List_View_Seg_Array* seg_array; } Efl_Ui_List_View_Segarray_Eina_Accessor; static Eina_Bool @@ -289,30 +193,6 @@ _efl_ui_list_view_seg_array_accessor_get_at(Efl_Ui_List_View_Segarray_Eina_Acces return EINA_FALSE; } -EOLIAN static void -_efl_ui_list_view_seg_array_setup(Eo *obj EINA_UNUSED, Efl_Ui_List_View_Seg_Array_Data *pd, int size) -{ - pd->step_size = size; -} - -EOLIAN static Eo * -_efl_ui_list_view_seg_array_efl_object_constructor(Eo *obj, Efl_Ui_List_View_Seg_Array_Data *pd EINA_UNUSED) -{ - obj = efl_constructor(efl_super(obj, MY_CLASS)); - - return obj; -} - -EOLIAN static void -_efl_ui_list_view_seg_array_efl_object_destructor(Eo *obj, Efl_Ui_List_View_Seg_Array_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_list_view_seg_array_accessor_get_container(Efl_Ui_List_View_Segarray_Eina_Accessor* acc EINA_UNUSED) { @@ -344,7 +224,7 @@ _efl_ui_list_view_seg_array_accessor_clone(Efl_Ui_List_View_Segarray_Eina_Access } static void -_efl_ui_list_view_seg_array_accessor_setup(Efl_Ui_List_View_Segarray_Eina_Accessor* acc, Efl_Ui_List_View_Seg_Array_Data* seg_array) +_efl_ui_list_view_seg_array_accessor_setup(Efl_Ui_List_View_Segarray_Eina_Accessor* acc, Efl_Ui_List_View_Seg_Array* seg_array) { EINA_MAGIC_SET(&acc->vtable, EINA_MAGIC_ACCESSOR); acc->vtable.version = EINA_ACCESSOR_VERSION; @@ -357,18 +237,10 @@ _efl_ui_list_view_seg_array_accessor_setup(Efl_Ui_List_View_Segarray_Eina_Access acc->seg_array = seg_array; } -EOLIAN static Eina_Accessor* -_efl_ui_list_view_seg_array_accessor_get(const Eo *obj EINA_UNUSED, Efl_Ui_List_View_Seg_Array_Data* pd) -{ - Efl_Ui_List_View_Segarray_Eina_Accessor* acc = calloc(1, sizeof(Efl_Ui_List_View_Segarray_Eina_Accessor)); - _efl_ui_list_view_seg_array_accessor_setup(acc, pd); - return &acc->vtable; -} - typedef struct _Efl_Ui_List_View_Segarray_Node_Accessor { Eina_Accessor vtable; - Efl_Ui_List_View_Seg_Array_Data* seg_array; + Efl_Ui_List_View_Seg_Array* seg_array; Eina_Iterator* pre_iterator; Efl_Ui_List_View_Seg_Array_Node* current_node; int current_index; @@ -442,7 +314,7 @@ _efl_ui_list_view_seg_array_node_accessor_clone(Efl_Ui_List_View_Segarray_Node_A } static void -_efl_ui_list_view_seg_array_node_accessor_setup(Efl_Ui_List_View_Segarray_Node_Accessor* acc, Efl_Ui_List_View_Seg_Array_Data* seg_array) +_efl_ui_list_view_seg_array_node_accessor_setup(Efl_Ui_List_View_Segarray_Node_Accessor* acc, Efl_Ui_List_View_Seg_Array* seg_array) { EINA_MAGIC_SET(&acc->vtable, EINA_MAGIC_ACCESSOR); acc->vtable.version = EINA_ACCESSOR_VERSION; @@ -458,18 +330,148 @@ _efl_ui_list_view_seg_array_node_accessor_setup(Efl_Ui_List_View_Segarray_Node_A acc->current_node = NULL; } -EOLIAN static Eina_Accessor* -_efl_ui_list_view_seg_array_node_accessor_get(const Eo *obj EINA_UNUSED, Efl_Ui_List_View_Seg_Array_Data* pd) +/* External Functions */ + +Efl_Ui_List_View_Seg_Array * +efl_ui_list_view_seg_array_setup(int size) +{ + Efl_Ui_List_View_Seg_Array *pd = calloc(1, sizeof(Efl_Ui_List_View_Seg_Array)); + if (!pd) return NULL; + pd->step_size = size; + + return pd; +} + +void +efl_ui_list_view_seg_array_free(Efl_Ui_List_View_Seg_Array *pd) +{ + if (pd->root) + eina_rbtree_delete(EINA_RBTREE_GET(pd->root), EINA_RBTREE_FREE_CB(_free_node), NULL); + + pd->root = NULL; + free(pd); +} + +void +efl_ui_list_view_seg_array_flush(Efl_Ui_List_View_Seg_Array *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; +} + +int +efl_ui_list_view_seg_array_count(Efl_Ui_List_View_Seg_Array* pd) +{ + return pd->count; +} + +void +efl_ui_list_view_seg_array_insert(Efl_Ui_List_View_Seg_Array* pd, int index, Efl_Model* model) +{ + Efl_Ui_List_View_Seg_Array_Node* node, *next; + Efl_Ui_List_View_Layout_Item* 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_list_view_seg_array_insert_at_node(pd, index, item, next); + else + _efl_ui_list_view_seg_array_insert_at_node(pd, index, item, node); + } + else + _efl_ui_list_view_seg_array_insert_at_node(pd, index, item, NULL); +} + +void +efl_ui_list_view_seg_array_insert_value(Efl_Ui_List_View_Seg_Array *pd, 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_list_view_seg_array_insert_object(pd, 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_list_view_seg_array_insert_object(pd, idx, children); + } + } + else + { + printf("Unknow type !\n"); + } +} + + +Efl_Ui_List_View_Layout_Item* +efl_ui_list_view_seg_array_remove(Efl_Ui_List_View_Seg_Array *pd, int index) +{ + Efl_Ui_List_View_Seg_Array_Node *node; + Efl_Ui_List_View_Layout_Item *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; +} + +Eina_Accessor* +efl_ui_list_view_seg_array_accessor_get(Efl_Ui_List_View_Seg_Array* pd) +{ + Efl_Ui_List_View_Segarray_Eina_Accessor* acc = calloc(1, sizeof(Efl_Ui_List_View_Segarray_Eina_Accessor)); + _efl_ui_list_view_seg_array_accessor_setup(acc, pd); + return &acc->vtable; +} + +Eina_Accessor* +efl_ui_list_view_seg_array_node_accessor_get(Efl_Ui_List_View_Seg_Array* pd) { Efl_Ui_List_View_Segarray_Node_Accessor* acc = calloc(1, sizeof(Efl_Ui_List_View_Segarray_Node_Accessor)); _efl_ui_list_view_seg_array_node_accessor_setup(acc, pd); return &acc->vtable; } -int efl_ui_list_view_item_index_get(Efl_Ui_List_View_Layout_Item* item) +int +efl_ui_list_view_item_index_get(Efl_Ui_List_View_Layout_Item* item) { Efl_Ui_List_View_Seg_Array_Node* node = item->tree_node; return item->index_offset + node->first; } - -#include "efl_ui_list_view_seg_array.eo.c" diff --git a/src/lib/elementary/efl_ui_list_view_seg_array.eo b/src/lib/elementary/efl_ui_list_view_seg_array.eo deleted file mode 100644 index 228b417347..0000000000 --- a/src/lib/elementary/efl_ui_list_view_seg_array.eo +++ /dev/null @@ -1,61 +0,0 @@ -import efl_ui_list_view_types; - -class Efl.Ui.List_View_Seg_Array extends Efl.Object -{ - methods { - @property accessor { - get { - [[ Get a Seg_Array List items accessor ]] - } - values { - acc: accessor; - } - } - @property node_accessor { - get { - [[ Get a Seg_Array node accessor ]] - } - values { - acc: accessor; - } - } - insert_value { - [[ Insert a accessor in segarray tree ]] - params { - @in first: int; - @in v: any_value; - } - } - count { - [[ Get the number of items in Seg_Array tree ]] - return: int; - } - setup { - [[ Configure a step of Seg_Array tree, this is the max node size ]] - params { - @in initial_step_size: int; - } - } - flush { - [[ flush the Seg_Array tree ]] - } - insert { - [[ Insert a new model in Seg_Array tree at index position ]] - params { - @in index: int; - @in model: Efl.Model; - } - } - remove { - [[ Remove the item at index position in Seg_Array tree ]] - params { - @in index: int; - } - return: ptr(Efl.Ui.List_View_Layout_Item) @owned; - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - } -} diff --git a/src/lib/elementary/efl_ui_list_view_seg_array.h b/src/lib/elementary/efl_ui_list_view_seg_array.h index 485398d469..adbfc28441 100644 --- a/src/lib/elementary/efl_ui_list_view_seg_array.h +++ b/src/lib/elementary/efl_ui_list_view_seg_array.h @@ -14,13 +14,29 @@ typedef struct _Efl_Ui_List_View_SegArray_Node Efl_Ui_List_View_Layout_Item* pointers[0]; } Efl_Ui_List_View_Seg_Array_Node; -typedef struct _Efl_Ui_List_View_Seg_Array_Data +typedef struct _Efl_Ui_List_View_Seg_Array { Efl_Ui_List_View_Seg_Array_Node *root; int step_size; int node_count; int count; -} Efl_Ui_List_View_Seg_Array_Data; +} Efl_Ui_List_View_Seg_Array; + + +Efl_Ui_List_View_Seg_Array * efl_ui_list_view_seg_array_setup(int size); +void efl_ui_list_view_seg_array_free(Efl_Ui_List_View_Seg_Array *seg_array); +void efl_ui_list_view_seg_array_flush(Efl_Ui_List_View_Seg_Array *seg_array); +int efl_ui_list_view_seg_array_count(Efl_Ui_List_View_Seg_Array* seg_array); +int efl_ui_list_view_item_index_get(Efl_Ui_List_View_Layout_Item* item); + + +void efl_ui_list_view_seg_array_insert(Efl_Ui_List_View_Seg_Array* seg_array, int index, Efl_Model* model); +void efl_ui_list_view_seg_array_insert_value(Efl_Ui_List_View_Seg_Array *seg_array, int first, Eina_Value value); +Efl_Ui_List_View_Layout_Item* efl_ui_list_view_seg_array_remove(Efl_Ui_List_View_Seg_Array *seg_array, int index); + +Eina_Accessor* efl_ui_list_view_seg_array_accessor_get(Efl_Ui_List_View_Seg_Array* seg_array); +Eina_Accessor* efl_ui_list_view_seg_array_node_accessor_get(Efl_Ui_List_View_Seg_Array* seg_array); + #endif diff --git a/src/lib/elementary/efl_ui_list_view_types.eot b/src/lib/elementary/efl_ui_list_view_types.eot index 780dc202a6..b53190752d 100644 --- a/src/lib/elementary/efl_ui_list_view_types.eot +++ b/src/lib/elementary/efl_ui_list_view_types.eot @@ -1,4 +1,4 @@ -struct Efl.Ui.List_View_Layout_Item { +struct @beta @free(free) Efl.Ui.List_View_Layout_Item { layout: Efl.Ui.Layout; layout_request: future; children: Efl.Model; @@ -9,4 +9,4 @@ struct Efl.Ui.List_View_Layout_Item { pos: Eina.Position2D; } -struct @extern Efl.Ui.List_View_Seg_Array_Node; [[ ]] +struct @beta Efl_Ui_List_View_Seg_Array; diff --git a/src/lib/elementary/efl_ui_navigation_bar.c b/src/lib/elementary/efl_ui_navigation_bar.c index 035d922494..d693a52838 100644 --- a/src/lib/elementary/efl_ui_navigation_bar.c +++ b/src/lib/elementary/efl_ui_navigation_bar.c @@ -39,13 +39,11 @@ _efl_ui_navigation_bar_efl_object_constructor(Eo *obj, Efl_Ui_Navigation_Bar_Dat 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))) + 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)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); Eo *back_button = efl_add(EFL_UI_BUTTON_CLASS, obj, diff --git a/src/lib/elementary/efl_ui_navigation_bar.eo b/src/lib/elementary/efl_ui_navigation_bar.eo index 15f4d922a8..318b307ca2 100644 --- a/src/lib/elementary/efl_ui_navigation_bar.eo +++ b/src/lib/elementary/efl_ui_navigation_bar.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Navigation_Bar extends Efl.Ui.Layout implements Efl.Content, Efl.Text +class @beta Efl.Ui.Navigation_Bar extends Efl.Ui.Layout_Base implements Efl.Content, Efl.Text { [[Navigation_Bar widget. diff --git a/src/lib/elementary/efl_ui_navigation_bar_part.eo b/src/lib/elementary/efl_ui_navigation_bar_part.eo index c94b5a5f02..40b0bcf74b 100644 --- a/src/lib/elementary/efl_ui_navigation_bar_part.eo +++ b/src/lib/elementary/efl_ui_navigation_bar_part.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Navigation_Bar_Part extends Efl.Ui.Layout_Part_Content +class @beta Efl.Ui.Navigation_Bar_Part extends Efl.Ui.Layout_Part_Content { [[Efl UI Navigation_Bar internal part class]] data: null; 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 index 43e3dd1613..2ed99a181f 100644 --- a/src/lib/elementary/efl_ui_navigation_bar_part_back_button.eo +++ b/src/lib/elementary/efl_ui_navigation_bar_part_back_button.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Navigation_Bar_Part_Back_Button extends Efl.Ui.Layout_Part implements Efl.Ui.Clickable, Efl.Gfx.Entity, Efl.Text, Efl.Content +class @beta Efl.Ui.Navigation_Bar_Part_Back_Button extends Efl.Ui.Layout_Part implements Efl.Ui.Clickable, Efl.Gfx.Entity, Efl.Text, Efl.Content { [[Efl Ui Navigation_Bar internal part back button class]] data: null; diff --git a/src/lib/elementary/efl_ui_navigation_layout.c b/src/lib/elementary/efl_ui_navigation_layout.c index 843dcbbe34..2f535e1a76 100644 --- a/src/lib/elementary/efl_ui_navigation_layout.c +++ b/src/lib/elementary/efl_ui_navigation_layout.c @@ -15,7 +15,7 @@ EOLIAN static void _efl_ui_navigation_layout_bar_set(Eo *obj, Efl_Ui_Navigation_Layout_Data *pd, Efl_Ui_Layout *bar) { - EINA_SAFETY_ON_FALSE_RETURN(efl_isa(bar, EFL_UI_LAYOUT_CLASS)); + EINA_SAFETY_ON_FALSE_RETURN(efl_isa(bar, EFL_UI_LAYOUT_BASE_CLASS)); efl_content_set(efl_part(obj, "efl.bar"), bar); pd->bar = bar; @@ -37,13 +37,11 @@ _efl_ui_navigation_layout_efl_object_constructor(Eo *obj, Efl_Ui_Navigation_Layo 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))) + 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)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); return obj; diff --git a/src/lib/elementary/efl_ui_navigation_layout.eo b/src/lib/elementary/efl_ui_navigation_layout.eo index 51fe71f8ae..1ddac7367b 100644 --- a/src/lib/elementary/efl_ui_navigation_layout.eo +++ b/src/lib/elementary/efl_ui_navigation_layout.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Navigation_Layout extends Efl.Ui.Layout implements Efl.Content +class @beta Efl.Ui.Navigation_Layout extends Efl.Ui.Layout_Base implements Efl.Content { [[Navigation_Layout widget. @@ -16,7 +16,7 @@ class Efl.Ui.Navigation_Layout extends Efl.Ui.Layout implements Efl.Content get { } values { - value: Efl.Ui.Layout; + value: Efl.Ui.Layout_Base; [[The bar object located at the top area of the Navigation Layout. ]] } diff --git a/src/lib/elementary/efl_ui_nstate.c b/src/lib/elementary/efl_ui_nstate.c index 1ee831e10a..b44ea3b5d4 100644 --- a/src/lib/elementary/efl_ui_nstate.c +++ b/src/lib/elementary/efl_ui_nstate.c @@ -37,7 +37,6 @@ _efl_ui_nstate_efl_object_constructor(Eo *obj, Efl_Ui_Nstate_Data *pd) elm_widget_theme_klass_set(obj, "nstate"); obj = efl_constructor(efl_super(obj, MY_CLASS)); efl_canvas_object_type_set(obj, MY_CLASS_NAME); - elm_widget_sub_object_parent_add(obj); pd->state = 0; // Default: 2 states @@ -45,7 +44,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, "efl,action,state,changed", "*", _on_state_changed, obj); + (wd->resize_obj, "efl,action,state,changed", "*", obj, _on_state_changed, NULL); //TODO: Add ATSPI call here @@ -116,13 +115,13 @@ _efl_ui_nstate_value_set(Eo *obj, Efl_Ui_Nstate_Data *pd, int state) _state_active(obj, pd); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_nstate_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Nstate_Data *pd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _state_signal_emit(obj, pd); diff --git a/src/lib/elementary/efl_ui_nstate.eo b/src/lib/elementary/efl_ui_nstate.eo index 31b29acd56..dd72d8e992 100644 --- a/src/lib/elementary/efl_ui_nstate.eo +++ b/src/lib/elementary/efl_ui_nstate.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Nstate extends Efl.Ui.Button +class @beta Efl.Ui.Nstate extends Efl.Ui.Button { [[Efl UI nstate class]] methods { @@ -31,7 +31,7 @@ class Efl.Ui.Nstate extends Efl.Ui.Button class.constructor; Efl.Object.constructor; Efl.Ui.Widget.theme_apply; - Efl.Ui.Widget.widget_event; + Efl.Ui.Widget.widget_input_event_handler; } events { changed: void; [[Called when the value changed.]] diff --git a/src/lib/elementary/efl_ui_nstate.h b/src/lib/elementary/efl_ui_nstate.h index 5e69c19dce..1d16c1f1c4 100644 --- a/src/lib/elementary/efl_ui_nstate.h +++ b/src/lib/elementary/efl_ui_nstate.h @@ -21,6 +21,4 @@ * @{ */ -#ifdef EFL_EO_API_SUPPORT #include "efl_ui_nstate.eo.h" -#endif diff --git a/src/lib/elementary/efl_ui_pager.c b/src/lib/elementary/efl_ui_pager.c index 921d7676f9..efa77f8314 100644 --- a/src/lib/elementary/efl_ui_pager.c +++ b/src/lib/elementary/efl_ui_pager.c @@ -17,7 +17,9 @@ _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->transition) + efl_page_transition_update(pd->transition, pd->curr.pos); + if (pd->indicator) efl_page_indicator_update(pd->indicator, pd->curr.pos); } @@ -93,9 +95,9 @@ _page_set_animation(void *data, const Efl_Event *event) if (pd->curr.page != temp_page) { if (pd->change.delta < 0) - efl_page_transition_curr_page_change(pd->transition, -1.0); + efl_page_transition_curr_page_change(pd->transition, -1); else - efl_page_transition_curr_page_change(pd->transition, 1.0); + efl_page_transition_curr_page_change(pd->transition, 1); temp_pos = 0.0; } @@ -107,7 +109,7 @@ _page_set_animation(void *data, const Efl_Event *event) _efl_ui_pager_update(pd); if (EINA_DBL_EQ(p, 1.0)) - efl_event_callback_del(event->object, EFL_EVENT_ANIMATOR_TICK, + efl_event_callback_del(event->object, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _page_set_animation, pd); } @@ -137,13 +139,13 @@ _mouse_up_animation(void *data, const Efl_Event *event) if (EINA_DBL_EQ(pd->curr.pos, 1.0)) { - efl_page_transition_curr_page_change(pd->transition, 1.0); + efl_page_transition_curr_page_change(pd->transition, 1); 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); + efl_page_transition_curr_page_change(pd->transition, -1); pd->curr.page = (pd->curr.page - 1 + pd->cnt) % pd->cnt; pd->curr.pos = 0.0; } @@ -151,7 +153,7 @@ _mouse_up_animation(void *data, const Efl_Event *event) _efl_ui_pager_update(pd); if (EINA_DBL_EQ(p, 1.0)) - efl_event_callback_del(event->object, EFL_EVENT_ANIMATOR_TICK, + efl_event_callback_del(event->object, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _mouse_up_animation, pd); } @@ -167,8 +169,10 @@ _mouse_down_cb(void *data, 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); + if (pd->cnt == 0) return; + + efl_event_callback_del(obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _mouse_up_animation, pd); + efl_event_callback_del(obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _page_set_animation, pd); pd->move_started = EINA_FALSE; @@ -239,7 +243,7 @@ _mouse_up_cb(void *data, pd->mouse_up_time = ecore_loop_time_get(); - efl_event_callback_add(obj, EFL_EVENT_ANIMATOR_TICK, _mouse_up_animation, pd); + efl_event_callback_add(obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _mouse_up_animation, pd); } //FIXME sub_object_parent_add? destruction @@ -326,18 +330,16 @@ _efl_ui_pager_efl_object_constructor(Eo *obj, 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))) + 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)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) 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.page = -1; pd->curr.pos = 0.0; pd->transition = NULL; @@ -354,8 +356,8 @@ _efl_ui_pager_efl_object_constructor(Eo *obj, 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); + efl_event_callback_add(pd->page_root, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _resize_cb, pd); + efl_event_callback_add(pd->page_root, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _move_cb, pd); pd->page_box = efl_add(EFL_UI_BOX_CLASS, obj); efl_canvas_group_member_add(pd->page_root, pd->page_box); @@ -364,7 +366,7 @@ _efl_ui_pager_efl_object_constructor(Eo *obj, 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); + efl_canvas_object_clipper_set(pd->page_box, pd->foreclip); pd->backclip = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas_object_evas_get(obj)); @@ -375,6 +377,19 @@ _efl_ui_pager_efl_object_constructor(Eo *obj, return obj; } +EOLIAN static void +_efl_ui_pager_efl_object_invalidate(Eo *obj, + Efl_Ui_Pager_Data *pd) +{ + efl_invalidate(efl_super(obj, MY_CLASS)); + + /* Since the parent of foreclip and backclip is evas, foreclip and backclip + * are not deleted automatically when pager is deleted. + * Therefore, foreclip and backclip are deleted manually here. */ + efl_del(pd->foreclip); + efl_del(pd->backclip); +} + EOLIAN static int _efl_ui_pager_efl_container_content_count(Eo *obj EINA_UNUSED, Efl_Ui_Pager_Data *pd) @@ -383,122 +398,107 @@ _efl_ui_pager_efl_container_content_count(Eo *obj EINA_UNUSED, } EOLIAN static Eina_Bool -_efl_ui_pager_efl_pack_linear_pack_begin(Eo *obj, +_efl_ui_pager_efl_pack_linear_pack_begin(Eo *obj EINA_UNUSED, Efl_Ui_Pager_Data *pd, Efl_Gfx_Entity *subobj) { - efl_parent_set(subobj, obj); - elm_widget_sub_object_add(obj, subobj); + if (!EINA_DBL_EQ(pd->curr.pos, 0.0)) return EINA_FALSE; pd->content_list = eina_list_prepend(pd->content_list, subobj); - pd->cnt += 1; - pd->curr.page += 1; + pd->cnt++; + pd->curr.page++; if (pd->transition) - efl_page_transition_update(pd->transition, pd->curr.pos); + efl_page_transition_pack(pd->transition, 0); else { if (pd->cnt == 1) efl_pack(pd->page_box, subobj); - else efl_canvas_object_clip_set(subobj, pd->backclip); + else efl_canvas_object_clipper_set(subobj, pd->backclip); } if (pd->indicator) - { - efl_page_indicator_pack(pd->indicator, 0); - efl_page_indicator_update(pd->indicator, pd->curr.pos); - } + efl_page_indicator_pack(pd->indicator, 0); return EINA_TRUE; } EOLIAN static Eina_Bool -_efl_ui_pager_efl_pack_linear_pack_end(Eo *obj, +_efl_ui_pager_efl_pack_linear_pack_end(Eo *obj EINA_UNUSED, Efl_Ui_Pager_Data *pd, Efl_Gfx_Entity *subobj) { - efl_parent_set(subobj, obj); - elm_widget_sub_object_add(obj, subobj); + if (!EINA_DBL_EQ(pd->curr.pos, 0.0)) return EINA_FALSE; pd->content_list = eina_list_append(pd->content_list, subobj); - pd->cnt += 1; + pd->cnt++; + if (pd->curr.page == -1) pd->curr.page = 0; if (pd->transition) - efl_page_transition_update(pd->transition, pd->curr.pos); + efl_page_transition_pack(pd->transition, (pd->cnt - 1)); else { if (pd->cnt == 1) efl_pack(pd->page_box, subobj); - else efl_canvas_object_clip_set(subobj, pd->backclip); + else efl_canvas_object_clipper_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); - } + efl_page_indicator_pack(pd->indicator, (pd->cnt - 1)); return EINA_TRUE; } EOLIAN static Eina_Bool -_efl_ui_pager_efl_pack_linear_pack_before(Eo *obj, +_efl_ui_pager_efl_pack_linear_pack_before(Eo *obj EINA_UNUSED, Efl_Ui_Pager_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) { - int index; + if (!EINA_DBL_EQ(pd->curr.pos, 0.0)) return EINA_FALSE; - efl_parent_set(subobj, obj); - elm_widget_sub_object_add(obj, subobj); + int index = eina_list_data_idx(pd->content_list, (void *)existing); + if (index == -1) return EINA_FALSE; - 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; + pd->cnt++; + if (pd->curr.page >= index) pd->curr.page++; if (pd->transition) - efl_page_transition_update(pd->transition, pd->curr.pos); - else efl_canvas_object_clip_set(subobj, pd->backclip); + efl_page_transition_pack(pd->transition, index); + else efl_canvas_object_clipper_set(subobj, pd->backclip); if (pd->indicator) - { - efl_page_indicator_pack(pd->indicator, index); - efl_page_indicator_update(pd->indicator, pd->curr.pos); - } + efl_page_indicator_pack(pd->indicator, index); return EINA_TRUE; } EOLIAN static Eina_Bool -_efl_ui_pager_efl_pack_linear_pack_after(Eo *obj, +_efl_ui_pager_efl_pack_linear_pack_after(Eo *obj EINA_UNUSED, Efl_Ui_Pager_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) { - int index; + if (!EINA_DBL_EQ(pd->curr.pos, 0.0)) return EINA_FALSE; - efl_parent_set(subobj, obj); - elm_widget_sub_object_add(obj, subobj); + int index = eina_list_data_idx(pd->content_list, (void *)existing); + if (index == -1) return EINA_FALSE; - 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; + pd->cnt++; + if (pd->curr.page > index) pd->curr.page++; if (pd->transition) - efl_page_transition_update(pd->transition, pd->curr.pos); - else efl_canvas_object_clip_set(subobj, pd->backclip); + efl_page_transition_pack(pd->transition, (index + 1)); + else efl_canvas_object_clipper_set(subobj, pd->backclip); if (pd->indicator) - { - efl_page_indicator_pack(pd->indicator, (index + 1)); - efl_page_indicator_update(pd->indicator, pd->curr.pos); - } + efl_page_indicator_pack(pd->indicator, (index + 1)); return EINA_TRUE; } @@ -509,25 +509,33 @@ _efl_ui_pager_efl_pack_linear_pack_at(Eo *obj, Efl_Gfx_Entity *subobj, int index) { - Efl_Gfx_Entity *existing = NULL; + if (!EINA_DBL_EQ(pd->curr.pos, 0.0)) return EINA_FALSE; - 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) + if ((index > pd->cnt) || (index < 0)) { - efl_page_indicator_pack(pd->indicator, index); - efl_page_indicator_update(pd->indicator, pd->curr.pos); + return EINA_FALSE; + } + else if (index == pd->cnt) + { + _efl_ui_pager_efl_pack_linear_pack_end(obj, pd, subobj); + } + else + { + 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); + + pd->cnt++; + if (pd->curr.page >= index) pd->curr.page++; + + if (pd->transition) + efl_page_transition_pack(pd->transition, index); + else efl_canvas_object_clipper_set(subobj, pd->backclip); + + if (pd->indicator) + efl_page_indicator_pack(pd->indicator, index); } return EINA_TRUE; @@ -556,10 +564,10 @@ _efl_ui_pager_current_page_set(Eo *obj, { 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); + efl_event_callback_del(obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _mouse_up_animation, pd); + efl_event_callback_del(obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _page_set_animation, pd); - if (index >= pd->cnt) + if ((index < 0) || (index > (pd->cnt - 1))) { ERR("page set fail"); return; @@ -571,7 +579,7 @@ _efl_ui_pager_current_page_set(Eo *obj, 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); + efl_canvas_object_clipper_set(curr, pd->backclip); pd->curr.page = index; curr = eina_list_nth(pd->content_list, pd->curr.page); @@ -589,7 +597,7 @@ _efl_ui_pager_current_page_set(Eo *obj, 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); + efl_event_callback_add(obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _page_set_animation, pd); } EOLIAN static int @@ -604,6 +612,8 @@ _efl_ui_pager_transition_set(Eo *obj, Efl_Ui_Pager_Data *pd, Efl_Page_Transition *transition) { + if (!EINA_DBL_EQ(pd->curr.pos, 0.0)) return; + if (pd->transition == transition) return; if (pd->transition) @@ -614,7 +624,7 @@ _efl_ui_pager_transition_set(Eo *obj, 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); + efl_canvas_object_clipper_set(pd->page_box, pd->backclip); } pd->transition = transition; @@ -631,11 +641,11 @@ _efl_ui_pager_transition_set(Eo *obj, _event_handler_del(obj, pd); - efl_canvas_object_clip_set(pd->page_box, pd->foreclip); + efl_canvas_object_clipper_set(pd->page_box, pd->foreclip); EINA_LIST_FOREACH(pd->content_list, list, curr) { - efl_canvas_object_clip_set(curr, pd->backclip); + efl_canvas_object_clipper_set(curr, pd->backclip); } curr = eina_list_nth(pd->content_list, pd->curr.page); @@ -715,7 +725,12 @@ _efl_ui_pager_page_size_set(Eo *obj EINA_UNUSED, 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); + { + 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))); + } } EOLIAN static int @@ -732,7 +747,8 @@ _efl_ui_pager_padding_set(Eo *obj EINA_UNUSED, { pd->page_spec.padding = padding; - efl_page_transition_padding_size_set(pd->transition, padding); + if (pd->transition) + efl_page_transition_padding_size_set(pd->transition, padding); } EOLIAN static void @@ -755,14 +771,21 @@ _efl_ui_pager_scroll_block_set(Eo *obj EINA_UNUSED, pd->next_block = next; } -EOLIAN static void +EOLIAN static Eina_Bool _efl_ui_pager_loop_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Pager_Data *pd, Efl_Ui_Pager_Loop loop) { - pd->loop = loop; + if (pd->loop == loop) return EINA_TRUE; - efl_page_transition_loop_set(pd->transition, loop); + if (!pd->transition) return EINA_FALSE; + + if (efl_page_transition_loop_set(pd->transition, loop)) + { + pd->loop = loop; + return EINA_TRUE; + } + else return EINA_FALSE; } EOLIAN static Efl_Ui_Pager_Loop @@ -772,38 +795,127 @@ _efl_ui_pager_loop_mode_get(const Eo *obj EINA_UNUSED, return pd->loop; } +static void +_unpack_all(Efl_Ui_Pager_Data *pd, + Eina_Bool clear) +{ + Eo *subobj; + + pd->cnt = 0; + pd->curr.page = -1; + pd->curr.pos = 0.0; + + if (pd->transition) + { + efl_page_transition_unpack_all(pd->transition); + } + else + { + subobj = eina_list_nth(pd->content_list, pd->curr.page); + efl_pack_unpack(pd->page_box, subobj); + } + + if (clear) + { + EINA_LIST_FREE(pd->content_list, subobj) + evas_object_del(subobj); + } + else + { + EINA_LIST_FREE(pd->content_list, subobj) + efl_canvas_object_clipper_set(subobj, NULL); + } + + if (pd->indicator) + { + efl_page_indicator_unpack_all(pd->indicator); + } +} + EOLIAN static Eina_Bool _efl_ui_pager_efl_pack_pack_clear(Eo *obj EINA_UNUSED, - Efl_Ui_Pager_Data *pd EINA_UNUSED) + Efl_Ui_Pager_Data *pd) { - ERR("Soon to be implemented"); - return EINA_FALSE; + _unpack_all(pd, EINA_TRUE); + + return EINA_TRUE; } EOLIAN static Eina_Bool _efl_ui_pager_efl_pack_unpack_all(Eo *obj EINA_UNUSED, - Efl_Ui_Pager_Data *pd EINA_UNUSED) + Efl_Ui_Pager_Data *pd) { - ERR("Soon to be implemented"); - return EINA_FALSE; + _unpack_all(pd, EINA_FALSE); + + return EINA_TRUE; +} + +static void +_unpack(Eo *obj, + Efl_Ui_Pager_Data *pd, + Efl_Gfx_Entity *subobj, + int index) +{ + pd->content_list = eina_list_remove(pd->content_list, subobj); + pd->cnt--; + + if (((index == pd->curr.page) && ((index != 0) || (pd->cnt == 0))) || + (index < pd->curr.page)) + pd->curr.page--; + + if (pd->transition) + { + // if the number of pages is not enough after unpacking a page, + // loop mode needs to be disabled + if (pd->loop == EFL_UI_PAGER_LOOP_ENABLED) + { + _efl_ui_pager_loop_mode_set(obj, pd, EFL_UI_PAGER_LOOP_DISABLED); + _efl_ui_pager_loop_mode_set(obj, pd, EFL_UI_PAGER_LOOP_ENABLED); + } + efl_page_transition_update(pd->transition, pd->curr.pos); + } + else + { + efl_pack_unpack(pd->page_box, subobj); + if (pd->curr.page != -1) + efl_pack(pd->page_box, eina_list_nth(pd->content_list, pd->curr.page)); + } + + if (pd->indicator) + efl_page_indicator_unpack(pd->indicator, index); } 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) +_efl_ui_pager_efl_pack_unpack(Eo *obj, + Efl_Ui_Pager_Data *pd, + Efl_Gfx_Entity *subobj) { - ERR("Soon to be implemented"); - return EINA_FALSE; + if (!EINA_DBL_EQ(pd->curr.pos, 0.0)) return EINA_FALSE; + + if (!subobj) return EINA_FALSE; + + int index = eina_list_data_idx(pd->content_list, subobj); + if (index == -1) return EINA_FALSE; + + _unpack(obj, pd, subobj, index); + + return EINA_TRUE; } 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) +_efl_ui_pager_efl_pack_linear_pack_unpack_at(Eo *obj, + Efl_Ui_Pager_Data *pd, + int index) { - ERR("Soon to be implemented"); - return NULL; + if (!EINA_DBL_EQ(pd->curr.pos, 0.0)) return NULL; + + if ((index >= pd->cnt) || (index < 0)) return NULL; + + Efl_Gfx_Entity *subobj = eina_list_nth(pd->content_list, index); + + _unpack(obj, pd, subobj, index); + + return subobj; } diff --git a/src/lib/elementary/efl_ui_pager.eo b/src/lib/elementary/efl_ui_pager.eo index 4962f782d6..646be5accd 100644 --- a/src/lib/elementary/efl_ui_pager.eo +++ b/src/lib/elementary/efl_ui_pager.eo @@ -1,11 +1,11 @@ -enum Efl.Ui.Pager_Loop +enum @beta Efl.Ui.Pager_Loop { [[Efl ui pager loop mode]] disabled, enabled } -class Efl.Ui.Pager extends Efl.Ui.Layout implements Efl.Pack_Linear +class @beta Efl.Ui.Pager extends Efl.Ui.Layout_Base implements Efl.Pack_Linear { [[Pager widget @@ -68,6 +68,11 @@ class Efl.Ui.Pager extends Efl.Ui.Layout implements Efl.Pack_Linear [[Pager is not scrolled after it's scrolled to the end by default. This property gives the option to make a loop through pages. ]] + set { + return: bool; [[$true on success, $false otherwise]] + } + get { + } values { loop: Efl.Ui.Pager_Loop; } @@ -85,6 +90,7 @@ class Efl.Ui.Pager extends Efl.Ui.Layout implements Efl.Pack_Linear } implements { Efl.Object.constructor; + Efl.Object.invalidate; Efl.Container.content_count; Efl.Pack.pack_clear; //TODO Efl.Pack.unpack_all; //TODO diff --git a/src/lib/elementary/efl_ui_pan.c b/src/lib/elementary/efl_ui_pan.c index 062e94cfad..f56cae3c88 100644 --- a/src/lib/elementary/efl_ui_pan.c +++ b/src/lib/elementary/efl_ui_pan.c @@ -47,7 +47,7 @@ _efl_ui_pan_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Pan_Data *psd, Eina_Size2D s psd->h = sz.h; evas_object_smart_changed(obj); - efl_event_callback_call(obj, EFL_UI_PAN_EVENT_VIEWPORT_CHANGED, NULL); + efl_event_callback_call(obj, EFL_UI_PAN_EVENT_PAN_VIEWPORT_CHANGED, NULL); } EOLIAN static void @@ -68,7 +68,7 @@ _efl_ui_pan_pan_position_set(Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *psd, Eina_Pos psd->py = pos.y; evas_object_smart_changed(obj); - efl_event_callback_call(obj, EFL_UI_PAN_EVENT_POSITION_CHANGED, NULL); + efl_event_callback_call(obj, EFL_UI_PAN_EVENT_PAN_POSITION_CHANGED, NULL); } EOLIAN static Eina_Position2D @@ -126,7 +126,7 @@ _efl_ui_pan_content_del_cb(void *data, psd->content = NULL; psd->content_w = psd->content_h = psd->px = psd->py = 0; - efl_event_callback_call(pobj, EFL_UI_PAN_EVENT_CONTENT_CHANGED, NULL); + efl_event_callback_call(pobj, EFL_UI_PAN_EVENT_PAN_CONTENT_CHANGED, NULL); } static void @@ -145,7 +145,7 @@ _efl_ui_pan_content_resize_cb(void *data, psd->content_h = sz.h; evas_object_smart_changed(pobj); } - efl_event_callback_call(pobj, EFL_UI_PAN_EVENT_CONTENT_CHANGED, NULL); + efl_event_callback_call(pobj, EFL_UI_PAN_EVENT_PAN_CONTENT_CHANGED, NULL); } EOLIAN static Eina_Bool @@ -156,14 +156,7 @@ _efl_ui_pan_efl_content_content_set(Evas_Object *obj, Efl_Ui_Pan_Data *psd, Evas if (content == psd->content) return EINA_TRUE; if (psd->content) { - efl_canvas_group_member_del(obj, psd->content); - evas_object_event_callback_del_full - (psd->content, EVAS_CALLBACK_DEL, _efl_ui_pan_content_del_cb, obj); - evas_object_event_callback_del_full - (psd->content, EVAS_CALLBACK_RESIZE, _efl_ui_pan_content_resize_cb, - obj); - psd->content = NULL; - psd->content_w = psd->content_h = psd->px = psd->py = 0; + efl_content_unset(obj); } if (!content) goto end; @@ -185,10 +178,36 @@ _efl_ui_pan_efl_content_content_set(Evas_Object *obj, Efl_Ui_Pan_Data *psd, Evas evas_object_smart_changed(obj); end: - efl_event_callback_call(obj, EFL_UI_PAN_EVENT_CONTENT_CHANGED, NULL); + efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, content); + efl_event_callback_call(obj, EFL_UI_PAN_EVENT_PAN_CONTENT_CHANGED, NULL); return EINA_TRUE; } +EOLIAN static Efl_Gfx_Entity* +_efl_ui_pan_efl_content_content_get(const Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *pd) +{ + return pd->content; +} + +EOLIAN static Efl_Gfx_Entity* +_efl_ui_pan_efl_content_content_unset(Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *pd) +{ + Efl_Gfx_Stack *old_content = pd->content; + + efl_canvas_group_member_remove(obj, pd->content); + evas_object_event_callback_del_full + (pd->content, EVAS_CALLBACK_DEL, _efl_ui_pan_content_del_cb, obj); + evas_object_event_callback_del_full + (pd->content, EVAS_CALLBACK_RESIZE, _efl_ui_pan_content_resize_cb, + obj); + pd->content = NULL; + pd->content_w = pd->content_h = pd->px = pd->py = 0; + efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, NULL); + efl_event_callback_call(obj, EFL_UI_PAN_EVENT_PAN_CONTENT_CHANGED, NULL); + + return old_content; +} + EOLIAN static void _efl_ui_pan_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *psd) { diff --git a/src/lib/elementary/efl_ui_pan.eo b/src/lib/elementary/efl_ui_pan.eo index bd47b60e2e..9923a39463 100644 --- a/src/lib/elementary/efl_ui_pan.eo +++ b/src/lib/elementary/efl_ui_pan.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Pan extends Efl.Canvas.Group implements Efl.Content +class @beta Efl.Ui.Pan extends Efl.Canvas.Group implements Efl.Content { [[Elementary pan class]] methods { @@ -43,12 +43,13 @@ class Efl.Ui.Pan extends Efl.Canvas.Group implements Efl.Content Efl.Gfx.Entity.visible { set; } Efl.Gfx.Entity.position { set; } Efl.Gfx.Entity.size { set; } - Efl.Content.content { set; } + Efl.Content.content { set; get; } + Efl.Content.content_unset; Efl.Canvas.Group.group_calculate; } events { - content,changed: void; [[Called when pan content changed]] - viewport,changed: void; [[Called when pan viewport changed]] - position,changed: void; [[Called when pan position changed]] + pan,content,changed: void; [[Called when pan content changed]] + pan,viewport,changed: void; [[Called when pan viewport changed]] + pan,position,changed: void; [[Called when pan position changed]] } } diff --git a/src/lib/elementary/efl_ui_panel.c b/src/lib/elementary/efl_ui_panel.c index 8351c8972e..84aa6f08d9 100644 --- a/src/lib/elementary/efl_ui_panel.c +++ b/src/lib/elementary/efl_ui_panel.c @@ -198,18 +198,18 @@ _scrollable_layout_theme_set(Eo *obj, Efl_Ui_Panel_Data *sd) _access_obj_process(obj, EINA_TRUE); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_panel_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Panel_Data *sd) { const char *str; Evas_Coord minw = 0, minh = 0; - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _mirrored_set(obj, efl_ui_mirrored_get(obj)); @@ -705,10 +705,10 @@ _key_action_toggle(Evas_Object *obj, const char *params EINA_UNUSED) ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(panel, Efl_Ui_Panel_Data) EOLIAN static Eina_Bool -_efl_ui_panel_efl_ui_widget_widget_event(Eo *obj, Efl_Ui_Panel_Data *pd, const Efl_Event *eo_event, Evas_Object *src) +_efl_ui_panel_efl_ui_widget_widget_input_event_handler(Eo *obj, Efl_Ui_Panel_Data *pd, const Efl_Event *eo_event, Evas_Object *src) { if (src != obj) return EINA_FALSE; - return _panel_efl_ui_widget_widget_event(obj, pd, eo_event, src); + return _panel_efl_ui_widget_widget_input_event_handler(obj, pd, eo_event, src); } static Eina_Bool @@ -727,7 +727,7 @@ _efl_ui_panel_efl_content_content_set(Eo *obj, Efl_Ui_Panel_Data *sd, Efl_Gfx_En else elm_widget_sub_object_add(obj, sd->content); } - + efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, content); if (efl_finalized_get(obj)) elm_layout_sizing_eval(obj); @@ -752,7 +752,7 @@ _efl_ui_panel_efl_content_content_unset(Eo *obj EINA_UNUSED, Efl_Ui_Panel_Data * if (sd->scrollable) _elm_widget_sub_object_redirect_to_top(sd->scr_ly, sd->content); sd->content = NULL; - + efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, NULL); return ret; } @@ -838,7 +838,6 @@ _efl_ui_panel_efl_object_constructor(Eo *obj, Efl_Ui_Panel_Data *_pd) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); obj = efl_constructor(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_TRUE); _pd->panel_edje = wd->resize_obj; @@ -1156,16 +1155,30 @@ _scroll_cb(Evas_Object *obj, void *data EINA_UNUSED) (obj, EFL_UI_EVENT_SCROLL, (void *) &event); } -EOLIAN static Eina_Bool -_efl_ui_panel_efl_ui_widget_on_disabled_update(Eo *obj, Efl_Ui_Panel_Data *sd, Eina_Bool disabled) +EOLIAN static void +_efl_ui_panel_efl_ui_widget_disabled_set(Eo *obj, Efl_Ui_Panel_Data *sd, Eina_Bool disabled) { - if (!efl_ui_widget_on_disabled_update(efl_super(obj, MY_CLASS), disabled)) - return EINA_FALSE; + efl_ui_widget_disabled_set(efl_super(obj, MY_CLASS), disabled); if (sd->scrollable) { if (disabled && sd->callback_added) { + switch (sd->orient) + { + case ELM_PANEL_ORIENT_BOTTOM: + case ELM_PANEL_ORIENT_TOP: + elm_interface_scrollable_movement_block_set + (obj, EFL_UI_SCROLL_BLOCK_VERTICAL); + break; + + case ELM_PANEL_ORIENT_RIGHT: + case ELM_PANEL_ORIENT_LEFT: + elm_interface_scrollable_movement_block_set + (obj, EFL_UI_SCROLL_BLOCK_HORIZONTAL); + break; + } + evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down); evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_MOVE, @@ -1179,6 +1192,21 @@ _efl_ui_panel_efl_ui_widget_on_disabled_update(Eo *obj, Efl_Ui_Panel_Data *sd, E } else if (!disabled && !sd->callback_added) { + switch (sd->orient) + { + case ELM_PANEL_ORIENT_BOTTOM: + case ELM_PANEL_ORIENT_TOP: + elm_interface_scrollable_movement_block_set + (obj, EFL_UI_SCROLL_BLOCK_HORIZONTAL); + break; + + case ELM_PANEL_ORIENT_RIGHT: + case ELM_PANEL_ORIENT_LEFT: + elm_interface_scrollable_movement_block_set + (obj, EFL_UI_SCROLL_BLOCK_VERTICAL); + break; + } + evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, sd); evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_MOVE, @@ -1191,8 +1219,6 @@ _efl_ui_panel_efl_ui_widget_on_disabled_update(Eo *obj, Efl_Ui_Panel_Data *sd, E sd->callback_added = EINA_TRUE; } } - - return EINA_TRUE; } EOLIAN static double diff --git a/src/lib/elementary/efl_ui_panel.eo b/src/lib/elementary/efl_ui_panel.eo index 6d0bc5ccb5..fffe726ccb 100644 --- a/src/lib/elementary/efl_ui_panel.eo +++ b/src/lib/elementary/efl_ui_panel.eo @@ -1,4 +1,4 @@ -enum Efl.Ui.Panel_Orient +enum @beta Efl.Ui.Panel_Orient { [[Panel orientation mode]] @@ -8,14 +8,14 @@ enum Efl.Ui.Panel_Orient right [[Panel (dis)appears from the right]] } -struct Efl.Ui.Panel_Scroll_Info +struct @beta Efl.Ui.Panel_Scroll_Info { [[Panel scroll information]] rel_x: double; [[content scrolled position (0.0 ~ 1.0) in the panel]] rel_y: double; [[content scrolled position (0.0 ~ 1.0) in the panel]] } -class Efl.Ui.Panel extends Efl.Ui.Layout implements Efl.Ui.Focus.Layer, Elm.Interface_Scrollable, Efl.Content, +class @beta Efl.Ui.Panel extends Efl.Ui.Layout_Base implements Efl.Ui.Focus.Layer, Elm.Interface_Scrollable, Efl.Content, Efl.Access.Widget.Action { [[Elementary panel class]] @@ -80,9 +80,9 @@ class Efl.Ui.Panel extends Efl.Ui.Layout implements Efl.Ui.Focus.Layer, Elm.Inte Efl.Gfx.Entity.size { set; } Efl.Canvas.Group.group_member_add; Efl.Ui.Widget.theme_apply; - Efl.Ui.Widget.on_disabled_update; + Efl.Ui.Widget.disabled {set;} Efl.Ui.Widget.on_access_update; - Efl.Ui.Widget.widget_event; + Efl.Ui.Widget.widget_input_event_handler; Efl.Ui.Widget.interest_region { get; } Efl.Access.Widget.Action.elm_actions { get; } Efl.Ui.I18n.mirrored { set; } diff --git a/src/lib/elementary/efl_ui_panes.c b/src/lib/elementary/efl_ui_panes.c index 97dcd759b1..d42b3ebb3b 100644 --- a/src/lib/elementary/efl_ui_panes.c +++ b/src/lib/elementary/efl_ui_panes.c @@ -4,7 +4,7 @@ #define EFL_ACCESS_OBJECT_PROTECTED #define ELM_LAYOUT_PROTECTED -#define EFL_GFX_SIZE_HINT_PROTECTED +#define EFL_GFX_HINT_PROTECTED #define EFL_PART_PROTECTED #include @@ -110,14 +110,14 @@ _efl_ui_panes_theme_group_get(Evas_Object *obj, Efl_Ui_Panes_Data *sd) return eina_strbuf_release(new_group); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_panes_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Panes_Data *sd) { double size; Evas_Coord minw = 0, minh = 0; char *group; - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; group = _efl_ui_panes_theme_group_get(obj, sd); if (group) @@ -131,7 +131,7 @@ _efl_ui_panes_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Panes_Data *sd) evas_object_size_hint_min_set(sd->event, minw, minh); int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; size = elm_panes_content_left_size_get(obj); @@ -223,17 +223,17 @@ _efl_ui_panes_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Panes_Data *sd) if (first_content) { if (!sd->first_hint_min_allow) - sd->first_min = efl_gfx_size_hint_combined_min_get(first_content); + sd->first_min = efl_gfx_hint_size_combined_min_get(first_content); else - sd->first_min = efl_gfx_size_hint_min_get(first_content); + sd->first_min = efl_gfx_hint_size_min_get(first_content); } if (second_content) { if (!sd->second_hint_min_allow) - sd->second_min = efl_gfx_size_hint_combined_min_get(second_content); + sd->second_min = efl_gfx_hint_size_combined_min_get(second_content); else - sd->second_min = efl_gfx_size_hint_min_get(second_content); + sd->second_min = efl_gfx_hint_size_min_get(second_content); } if (sd->dir == EFL_UI_DIR_HORIZONTAL) @@ -247,7 +247,7 @@ _efl_ui_panes_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Panes_Data *sd) min.h = MAX(sd->first_min.h, sd->second_min.h); } - efl_gfx_size_hint_restricted_min_set(obj, min); + efl_gfx_hint_size_restricted_min_set(obj, min); _set_min_size_new(obj); } @@ -408,13 +408,12 @@ _efl_ui_panes_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Panes_Data *_pd EINA_UN if (!elm_widget_theme_klass_get(obj)) elm_widget_theme_klass_set(obj, "panes"); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); group = _efl_ui_panes_theme_group_get(obj, sd); - if (!elm_widget_theme_object_set(obj, wd->resize_obj, + 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_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); free(group); @@ -716,8 +715,9 @@ ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(efl_ui_panes) ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_panes) #include "efl_ui_panes.eo.c" +#include "efl_ui_panes_eo.legacy.c" -#include "efl_ui_panes_legacy.eo.h" +#include "efl_ui_panes_legacy_eo.h" #define MY_CLASS_NAME_LEGACY "elm_panes" static void @@ -904,4 +904,4 @@ elm_panes_content_right_unset(Evas_Object *obj) return elm_layout_content_unset(obj, "right"); } -#include "efl_ui_panes_legacy.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 eb4d0c3669..ca24cd7357 100644 --- a/src/lib/elementary/efl_ui_panes.eo +++ b/src/lib/elementary/efl_ui_panes.eo @@ -1,8 +1,7 @@ -class Efl.Ui.Panes extends Efl.Ui.Layout implements Efl.Ui.Direction, +class @beta Efl.Ui.Panes extends Efl.Ui.Layout_Base implements Efl.Ui.Direction, Efl.Ui.Clickable { [[Elementary panes class]] - legacy_prefix: elm_panes; event_prefix: elm_panes; methods { @property split_ratio { @@ -20,10 +19,8 @@ class Efl.Ui.Panes extends Efl.Ui.Layout implements Efl.Ui.Direction, Note: This ratio will change when user drags the panes bar.]] set { - legacy: null; } get { - legacy: null; } values { ratio: double; [[Value between 0.0 and 1.0 representing split ratio between panes first and second parts.]] diff --git a/src/lib/elementary/efl_ui_panes_eo.legacy.c b/src/lib/elementary/efl_ui_panes_eo.legacy.c new file mode 100644 index 0000000000..fde258805d --- /dev/null +++ b/src/lib/elementary/efl_ui_panes_eo.legacy.c @@ -0,0 +1,12 @@ + +EAPI void +elm_panes_fixed_set(Efl_Ui_Panes *obj, Eina_Bool fixed) +{ + efl_ui_panes_fixed_set(obj, fixed); +} + +EAPI Eina_Bool +elm_panes_fixed_get(const Efl_Ui_Panes *obj) +{ + return efl_ui_panes_fixed_get(obj); +} diff --git a/src/lib/elementary/efl_ui_panes_eo.legacy.h b/src/lib/elementary/efl_ui_panes_eo.legacy.h new file mode 100644 index 0000000000..b0b3a942b8 --- /dev/null +++ b/src/lib/elementary/efl_ui_panes_eo.legacy.h @@ -0,0 +1,49 @@ +#ifndef _EFL_UI_PANES_EO_LEGACY_H_ +#define _EFL_UI_PANES_EO_LEGACY_H_ + +#ifndef _EFL_UI_PANES_EO_CLASS_TYPE +#define _EFL_UI_PANES_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Panes; + +#endif + +#ifndef _EFL_UI_PANES_EO_TYPES +#define _EFL_UI_PANES_EO_TYPES + + +#endif + + + +/** + * @brief Set whether the left and right panes can be resized by user + * interaction. + * + * By default panes' contents are resizable by user interaction. + * + * @param[in] obj The object. + * @param[in] fixed Use @c true to fix the left and right panes sizes and make + * them not to be resized by user interaction. Use @c false to make them + * resizable. + * + * @ingroup Elm_Panes_Group + */ +EAPI void elm_panes_fixed_set(Efl_Ui_Panes *obj, Eina_Bool fixed); + +/** + * @brief Set whether the left and right panes can be resized by user + * interaction. + * + * By default panes' contents are resizable by user interaction. + * + * @param[in] obj The object. + * + * @return Use @c true to fix the left and right panes sizes and make them not + * to be resized by user interaction. Use @c false to make them resizable. + * + * @ingroup Elm_Panes_Group + */ +EAPI Eina_Bool elm_panes_fixed_get(const Efl_Ui_Panes *obj); + +#endif diff --git a/src/lib/elementary/efl_ui_panes_legacy.eo b/src/lib/elementary/efl_ui_panes_legacy.eo deleted file mode 100644 index 28f9ca5af9..0000000000 --- a/src/lib/elementary/efl_ui_panes_legacy.eo +++ /dev/null @@ -1,9 +0,0 @@ -class Efl.Ui.Panes_Legacy extends Efl.Ui.Panes implements Efl.Ui.Legacy -{ - [[Elementary panes class]] - data: null; - implements { - class.constructor; - Efl.Object.constructor; - } -} diff --git a/src/lib/elementary/efl_ui_panes_legacy_eo.c b/src/lib/elementary/efl_ui_panes_legacy_eo.c new file mode 100644 index 0000000000..ba95585085 --- /dev/null +++ b/src/lib/elementary/efl_ui_panes_legacy_eo.c @@ -0,0 +1,35 @@ + +Efl_Object *_efl_ui_panes_legacy_efl_object_constructor(Eo *obj, void *pd); + + +static Eina_Bool +_efl_ui_panes_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_PANES_LEGACY_EXTRA_OPS +#define EFL_UI_PANES_LEGACY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _efl_ui_panes_legacy_efl_object_constructor), + EFL_UI_PANES_LEGACY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_panes_legacy_class_desc = { + EO_VERSION, + "Efl.Ui.Panes_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _efl_ui_panes_legacy_class_initializer, + _efl_ui_panes_legacy_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_panes_legacy_class_get, &_efl_ui_panes_legacy_class_desc, EFL_UI_PANES_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/efl_ui_panes_legacy_eo.h b/src/lib/elementary/efl_ui_panes_legacy_eo.h new file mode 100644 index 0000000000..692578c8ca --- /dev/null +++ b/src/lib/elementary/efl_ui_panes_legacy_eo.h @@ -0,0 +1,26 @@ +#ifndef _EFL_UI_PANES_LEGACY_EO_H_ +#define _EFL_UI_PANES_LEGACY_EO_H_ + +#ifndef _EFL_UI_PANES_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_PANES_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Panes_Legacy; + +#endif + +#ifndef _EFL_UI_PANES_LEGACY_EO_TYPES +#define _EFL_UI_PANES_LEGACY_EO_TYPES + + +#endif +#ifdef EFL_BETA_API_SUPPORT +/** Elementary panes class + * + * @ingroup Efl_Ui_Panes_Legacy + */ +#define EFL_UI_PANES_LEGACY_CLASS efl_ui_panes_legacy_class_get() + +EWAPI const Efl_Class *efl_ui_panes_legacy_class_get(void); +#endif /* EFL_BETA_API_SUPPORT */ + +#endif diff --git a/src/lib/elementary/efl_ui_panes_legacy_eo.legacy.h b/src/lib/elementary/efl_ui_panes_legacy_eo.legacy.h new file mode 100644 index 0000000000..ba2c1331a3 --- /dev/null +++ b/src/lib/elementary/efl_ui_panes_legacy_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_PANES_LEGACY_EO_LEGACY_H_ +#define _EFL_UI_PANES_LEGACY_EO_LEGACY_H_ + +#ifndef _EFL_UI_PANES_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_PANES_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Panes_Legacy; + +#endif + +#ifndef _EFL_UI_PANES_LEGACY_EO_TYPES +#define _EFL_UI_PANES_LEGACY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/efl_ui_panes_part.eo b/src/lib/elementary/efl_ui_panes_part.eo index 4a96713c83..2c12ac72f4 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 extends Efl.Ui.Layout_Part_Content +class @beta Efl.Ui.Panes_Part extends Efl.Ui.Layout_Part_Content { [[Elementary Panes internal part class]] data: null; @@ -6,7 +6,7 @@ class Efl.Ui.Panes_Part extends 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.Hint.hint_size_min.set is respected forcefully. ]] values { allow: bool; [[If $true minimum size is forced]] @@ -15,7 +15,7 @@ class Efl.Ui.Panes_Part extends 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.Hint.hint_size_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_popup.c b/src/lib/elementary/efl_ui_popup.c index 6afdd55667..47ef65b4a9 100644 --- a/src/lib/elementary/efl_ui_popup.c +++ b/src/lib/elementary/efl_ui_popup.c @@ -110,8 +110,8 @@ _efl_ui_popup_efl_ui_widget_widget_parent_set(Eo *obj, Efl_Ui_Popup_Data *pd EIN 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_ENTITY_EVENT_RESIZE, _parent_geom_cb, obj); - efl_event_callback_add(pd->win_parent, EFL_GFX_ENTITY_EVENT_MOVE, _parent_geom_cb, obj); + efl_event_callback_add(pd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _parent_geom_cb, obj); + efl_event_callback_add(pd->win_parent, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _parent_geom_cb, obj); } EOLIAN static void @@ -215,13 +215,11 @@ _efl_ui_popup_efl_object_constructor(Eo *obj, Efl_Ui_Popup_Data *pd) 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, + 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))) + elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); pd->backwall = edje_object_add(evas_object_evas_get(obj)); @@ -242,9 +240,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_ENTITY_EVENT_RESIZE, _parent_geom_cb, + efl_event_callback_del(pd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _parent_geom_cb, obj); - efl_event_callback_del(pd->win_parent, EFL_GFX_ENTITY_EVENT_MOVE, _parent_geom_cb, + efl_event_callback_del(pd->win_parent, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _parent_geom_cb, obj); efl_destructor(efl_super(obj, MY_CLASS)); @@ -259,7 +257,7 @@ _sizing_eval(Eo *obj) elm_coords_finger_size_adjust(1, &minw, 1, &minh); edje_object_size_min_restricted_calc (wd->resize_obj, &minw, &minh, minw, minh); - efl_gfx_size_hint_min_set(obj, EINA_SIZE2D(minw, minh)); + efl_gfx_hint_size_min_set(obj, EINA_SIZE2D(minw, minh)); Eina_Size2D size = efl_gfx_entity_size_get(obj); @@ -351,12 +349,19 @@ _efl_ui_popup_part_backwall_repeat_events_get(const Eo *obj, void *_pd EINA_UNUS return efl_canvas_object_repeat_events_get(sd->backwall); } -EOLIAN static Eina_Bool -_efl_ui_popup_part_backwall_efl_file_file_set(Eo *obj, void *_pd EINA_UNUSED, const char *file, const char *group) +EOLIAN static Eina_Error +_efl_ui_popup_part_backwall_efl_file_load(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); + Eina_Error err; + + if (efl_file_loaded_get(obj)) return 0; + + err = efl_file_load(efl_super(obj, MY_CLASS)); + if (err) return err; + Eo *prev_obj = edje_object_part_swallow_get(sd->backwall, "efl.content"); if (prev_obj) { @@ -366,16 +371,23 @@ _efl_ui_popup_part_backwall_efl_file_file_set(Eo *obj, void *_pd EINA_UNUSED, co } Eo *image = elm_image_add(pd->obj); - Eina_Bool ret = elm_image_file_set(image, file, group); + Eina_Bool ret; + const Eina_File *f; + + f = efl_file_mmap_get(obj); + if (f) + ret = elm_image_mmap_set(image, f, efl_file_key_get(obj)); + else + ret = elm_image_file_set(image, efl_file_get(obj), efl_file_key_get(obj)); if (!ret) { efl_del(image); - return EINA_FALSE; + return EFL_GFX_IMAGE_LOAD_ERROR_GENERIC; } edje_object_part_swallow(sd->backwall, "efl.content", image); edje_object_signal_emit(sd->backwall, "efl,state,content,set", "efl"); - return EINA_TRUE; + return 0; } #include "efl_ui_popup_part_backwall.eo.c" diff --git a/src/lib/elementary/efl_ui_popup.eo b/src/lib/elementary/efl_ui_popup.eo index 26d85973c5..4fc5548e6b 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 @beta 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 extends Efl.Ui.Layout implements Efl.Content +class @beta Efl.Ui.Popup extends Efl.Ui.Layout_Base implements Efl.Content, Efl.Ui.Focus.Layer { [[EFL UI popup class]] methods { diff --git a/src/lib/elementary/efl_ui_popup_part_backwall.eo b/src/lib/elementary/efl_ui_popup_part_backwall.eo index 124d27c909..4a6a914a45 100644 --- a/src/lib/elementary/efl_ui_popup_part_backwall.eo +++ b/src/lib/elementary/efl_ui_popup_part_backwall.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Popup_Part_Backwall extends Efl.Ui.Layout_Part implements Efl.File +class @beta Efl.Ui.Popup_Part_Backwall extends Efl.Ui.Layout_Part implements Efl.File { [[Efl UI Popup internal part backwall class]] data: null; @@ -25,6 +25,6 @@ class Efl.Ui.Popup_Part_Backwall extends Efl.Ui.Layout_Part implements Efl.File } } implements { - Efl.File.file { set; } + Efl.File.load; } } diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c index 19d6c2532b..c65d9bdcff 100644 --- a/src/lib/elementary/efl_ui_progressbar.c +++ b/src/lib/elementary/efl_ui_progressbar.c @@ -48,6 +48,7 @@ _progress_status_new(const char *part_name, double val) { Efl_Ui_Progress_Status *ps; ps = calloc(1, sizeof(Efl_Ui_Progress_Status)); + if (!ps) return NULL; ps->part_name = eina_stringshare_add(part_name); ps->val = val; return ps; @@ -231,11 +232,11 @@ _efl_ui_progressbar_theme_group_get(Evas_Object *obj, Efl_Ui_Progressbar_Data *s return eina_strbuf_release(new_group); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_progressbar_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Progressbar_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); char *group; group = _efl_ui_progressbar_theme_group_get(obj, sd); @@ -246,7 +247,7 @@ _efl_ui_progressbar_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Progressbar_Data * } int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; if (elm_widget_is_legacy(obj)) { @@ -358,18 +359,16 @@ _efl_ui_progressbar_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Progressbar_Data if (!elm_widget_theme_klass_get(obj)) elm_widget_theme_klass_set(obj, "progressbar"); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); 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, - elm_widget_theme_klass_get(obj), - group, - elm_widget_theme_style_get(obj))) - CRI("Failed to set layout!"); + if (elm_widget_theme_object_set(obj, wd->resize_obj, + elm_widget_theme_klass_get(obj), + group, + elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) free(group); @@ -602,7 +601,7 @@ _progressbar_part_value_get(Efl_Ui_Progressbar_Data *sd, const char* part) } EOLIAN static void -_efl_ui_progressbar_efl_ui_range_range_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, double val) +_efl_ui_progressbar_efl_ui_range_display_range_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, double val) { if (EINA_DBL_EQ(sd->val, val)) return; @@ -613,7 +612,7 @@ _efl_ui_progressbar_efl_ui_range_range_value_set(Eo *obj, Efl_Ui_Progressbar_Dat } EOLIAN static double -_efl_ui_progressbar_efl_ui_range_range_value_get(const Eo *obj, Efl_Ui_Progressbar_Data *sd EINA_UNUSED) +_efl_ui_progressbar_efl_ui_range_display_range_value_get(const Eo *obj, Efl_Ui_Progressbar_Data *sd EINA_UNUSED) { if (elm_widget_is_legacy(obj)) return efl_ui_range_value_get(efl_part(obj, "elm.cur.progressbar")); @@ -678,7 +677,7 @@ _efl_ui_progressbar_pulse_get(const Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data } EOLIAN static void -_efl_ui_progressbar_efl_ui_range_range_min_max_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, double min, double max) +_efl_ui_progressbar_efl_ui_range_display_range_min_max_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, double min, double max) { if (elm_widget_is_legacy(obj)) _progress_part_min_max_set(obj, sd, "elm.cur.progressbar", min, max); @@ -687,7 +686,7 @@ _efl_ui_progressbar_efl_ui_range_range_min_max_set(Eo *obj, Efl_Ui_Progressbar_D } 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) +_efl_ui_progressbar_efl_ui_range_display_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; @@ -702,14 +701,14 @@ _efl_ui_progressbar_efl_part_part_get(const Eo *obj, Efl_Ui_Progressbar_Data *sd ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); // Progress bars are dragable types - if (edje_object_part_drag_dir_get(wd->resize_obj, part) != EFL_UI_DRAG_DIR_NONE) + if (edje_object_part_drag_dir_get(wd->resize_obj, part) != (Edje_Drag_Dir)EFL_UI_DRAG_DIR_NONE) return ELM_PART_IMPLEMENT(EFL_UI_PROGRESSBAR_PART_CLASS, obj, part); return efl_part_get(efl_super(obj, MY_CLASS), part); } EOLIAN static void -_efl_ui_progressbar_part_efl_ui_range_range_value_set(Eo *obj, void *_pd EINA_UNUSED, double val) +_efl_ui_progressbar_part_efl_ui_range_display_range_value_set(Eo *obj, void *_pd EINA_UNUSED, double val) { 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); @@ -718,7 +717,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(const Eo *obj, void *_pd EINA_UNUSED) +_efl_ui_progressbar_part_efl_ui_range_display_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); @@ -733,7 +732,7 @@ _efl_ui_progressbar_efl_access_value_value_and_text_get(const Eo *obj EINA_UNUSE } EOLIAN static void -_efl_ui_progressbar_part_efl_ui_range_range_min_max_set(Eo *obj, void *_pd EINA_UNUSED, double min, double max) +_efl_ui_progressbar_part_efl_ui_range_display_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); @@ -742,7 +741,7 @@ _efl_ui_progressbar_part_efl_ui_range_range_min_max_set(Eo *obj, void *_pd EINA_ } 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_progressbar_part_efl_ui_range_display_range_min_max_get(const Eo *obj, void *_pd EINA_UNUSED, double *min, double *max) { Efl_Ui_Progress_Status *ps; Eina_List *l; @@ -779,7 +778,7 @@ ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(efl_ui_progressbar) #include "efl_ui_progressbar.eo.c" -#include "efl_ui_progressbar_legacy.eo.h" +#include "efl_ui_progressbar_legacy_eo.h" #include "efl_ui_progressbar_legacy_part.eo.h" #define MY_CLASS_NAME_LEGACY "elm_progressbar" @@ -819,13 +818,13 @@ _icon_signal_emit(Evas_Object *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_Result +EOLIAN static Eina_Error _efl_ui_progressbar_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _icon_signal_emit(obj); return int_ret; @@ -998,6 +997,7 @@ elm_progressbar_unit_format_function_set(Evas_Object *obj, progressbar_func_type { EFL_UI_PROGRESSBAR_DATA_GET_OR_RETURN(obj, sd); Pb_Format_Wrapper_Data *pfwd = malloc(sizeof(Pb_Format_Wrapper_Data)); + if (!pfwd) return; pfwd->format_cb = func; pfwd->format_free_cb = free_func; @@ -1048,4 +1048,4 @@ elm_progressbar_value_get(const Evas_Object *obj) return efl_ui_range_value_get(obj); } -#include "efl_ui_progressbar_legacy.eo.c" +#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 2222763c1e..af84fc986c 100644 --- a/src/lib/elementary/efl_ui_progressbar.eo +++ b/src/lib/elementary/efl_ui_progressbar.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Progressbar extends Efl.Ui.Layout implements Efl.Ui.Range, Efl.Ui.Format, +class @beta Efl.Ui.Progressbar extends Efl.Ui.Layout_Base implements Efl.Ui.Range_Display, Efl.Ui.Format, Efl.Ui.Direction, Efl.Access.Value, Efl.Text, Efl.Content, Efl.Text_Markup { @@ -16,8 +16,6 @@ class Efl.Ui.Progressbar extends Efl.Ui.Layout implements Efl.Ui.Range, Efl.Ui.F 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 efl_ui_progressbar_pulse_set(). - - @since 1.20 ]] set { @@ -33,14 +31,10 @@ class Efl.Ui.Progressbar extends Efl.Ui.Layout implements Efl.Ui.Range, Efl.Ui.F [[Start/stop a given progress bar "pulsing" animation, if its under that mode Note: This call won't do anything if $obj is not under "pulsing mode". - - @since 1.20 ]] } get { [[ Get the pulsing state on a given progressbar widget. - - @since 1.20 ]] } values { @@ -51,8 +45,8 @@ class Efl.Ui.Progressbar extends Efl.Ui.Layout implements Efl.Ui.Range, Efl.Ui.F implements { Efl.Object.constructor; Efl.Ui.Widget.theme_apply; - Efl.Ui.Range.range_value { get; set; } - Efl.Ui.Range.range_min_max {get; set; } + Efl.Ui.Range_Display.range_value { get; set; } + Efl.Ui.Range_Display.range_min_max {get; set; } Efl.Ui.Direction.direction { get; set; } Efl.Ui.Format.format_cb { set; } Efl.Part.part_get; diff --git a/src/lib/elementary/efl_ui_progressbar_legacy.eo b/src/lib/elementary/efl_ui_progressbar_legacy.eo deleted file mode 100644 index a8361cf09d..0000000000 --- a/src/lib/elementary/efl_ui_progressbar_legacy.eo +++ /dev/null @@ -1,12 +0,0 @@ -class Efl.Ui.Progressbar_Legacy extends Efl.Ui.Progressbar implements 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_eo.c b/src/lib/elementary/efl_ui_progressbar_legacy_eo.c new file mode 100644 index 0000000000..8b32d45cd1 --- /dev/null +++ b/src/lib/elementary/efl_ui_progressbar_legacy_eo.c @@ -0,0 +1,47 @@ + +Efl_Object *_efl_ui_progressbar_legacy_efl_object_constructor(Eo *obj, void *pd); + + +Eina_Error _efl_ui_progressbar_legacy_efl_ui_widget_theme_apply(Eo *obj, void *pd); + + +Eina_Bool _efl_ui_progressbar_legacy_efl_ui_widget_widget_sub_object_del(Eo *obj, void *pd, Efl_Canvas_Object *sub_obj); + + +Efl_Object *_efl_ui_progressbar_legacy_efl_part_part_get(const Eo *obj, void *pd, const char *name); + + +static Eina_Bool +_efl_ui_progressbar_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_PROGRESSBAR_LEGACY_EXTRA_OPS +#define EFL_UI_PROGRESSBAR_LEGACY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _efl_ui_progressbar_legacy_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _efl_ui_progressbar_legacy_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _efl_ui_progressbar_legacy_efl_ui_widget_widget_sub_object_del), + EFL_OBJECT_OP_FUNC(efl_part_get, _efl_ui_progressbar_legacy_efl_part_part_get), + EFL_UI_PROGRESSBAR_LEGACY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_progressbar_legacy_class_desc = { + EO_VERSION, + "Efl.Ui.Progressbar_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _efl_ui_progressbar_legacy_class_initializer, + _efl_ui_progressbar_legacy_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_progressbar_legacy_class_get, &_efl_ui_progressbar_legacy_class_desc, EFL_UI_PROGRESSBAR_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/efl_ui_progressbar_legacy_eo.h b/src/lib/elementary/efl_ui_progressbar_legacy_eo.h new file mode 100644 index 0000000000..00807e3fc4 --- /dev/null +++ b/src/lib/elementary/efl_ui_progressbar_legacy_eo.h @@ -0,0 +1,26 @@ +#ifndef _EFL_UI_PROGRESSBAR_LEGACY_EO_H_ +#define _EFL_UI_PROGRESSBAR_LEGACY_EO_H_ + +#ifndef _EFL_UI_PROGRESSBAR_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_PROGRESSBAR_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Progressbar_Legacy; + +#endif + +#ifndef _EFL_UI_PROGRESSBAR_LEGACY_EO_TYPES +#define _EFL_UI_PROGRESSBAR_LEGACY_EO_TYPES + + +#endif +#ifdef EFL_BETA_API_SUPPORT +/** Elementary progressbar class + * + * @ingroup Efl_Ui_Progressbar_Legacy + */ +#define EFL_UI_PROGRESSBAR_LEGACY_CLASS efl_ui_progressbar_legacy_class_get() + +EWAPI const Efl_Class *efl_ui_progressbar_legacy_class_get(void); +#endif /* EFL_BETA_API_SUPPORT */ + +#endif diff --git a/src/lib/elementary/efl_ui_progressbar_legacy_eo.legacy.h b/src/lib/elementary/efl_ui_progressbar_legacy_eo.legacy.h new file mode 100644 index 0000000000..2e7912da08 --- /dev/null +++ b/src/lib/elementary/efl_ui_progressbar_legacy_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_PROGRESSBAR_LEGACY_EO_LEGACY_H_ +#define _EFL_UI_PROGRESSBAR_LEGACY_EO_LEGACY_H_ + +#ifndef _EFL_UI_PROGRESSBAR_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_PROGRESSBAR_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Progressbar_Legacy; + +#endif + +#ifndef _EFL_UI_PROGRESSBAR_LEGACY_EO_TYPES +#define _EFL_UI_PROGRESSBAR_LEGACY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/efl_ui_progressbar_legacy_part.eo b/src/lib/elementary/efl_ui_progressbar_legacy_part.eo index fd989e518d..da75f9602d 100644 --- a/src/lib/elementary/efl_ui_progressbar_legacy_part.eo +++ b/src/lib/elementary/efl_ui_progressbar_legacy_part.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Progressbar_Legacy_Part extends Efl.Ui.Layout_Part_Content +class @beta Efl.Ui.Progressbar_Legacy_Part extends Efl.Ui.Layout_Part_Content { [[Elementary progressbar internal part class]] data: null; diff --git a/src/lib/elementary/efl_ui_progressbar_part.eo b/src/lib/elementary/efl_ui_progressbar_part.eo index 13924fccd5..b80177dd16 100644 --- a/src/lib/elementary/efl_ui_progressbar_part.eo +++ b/src/lib/elementary/efl_ui_progressbar_part.eo @@ -1,9 +1,9 @@ -class Efl.Ui.Progressbar_Part extends Efl.Ui.Layout_Part implements Efl.Ui.Range +class @beta Efl.Ui.Progressbar_Part extends Efl.Ui.Layout_Part implements Efl.Ui.Range_Display { [[Elementary progressbar internal part class]] data: null; implements { - Efl.Ui.Range.range_value { set; get; } - Efl.Ui.Range.range_min_max {get; set; } + Efl.Ui.Range_Display.range_value { set; get; } + Efl.Ui.Range_Display.range_min_max {get; set; } } } diff --git a/src/lib/elementary/efl_ui_radio.c b/src/lib/elementary/efl_ui_radio.c index 009ca7183b..565a80e13c 100644 --- a/src/lib/elementary/efl_ui_radio.c +++ b/src/lib/elementary/efl_ui_radio.c @@ -88,7 +88,7 @@ _state_set(Evas_Object *obj, Eina_Bool state, Eina_Bool activate) { if (sd->state) { - efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_CHECKED, EINA_TRUE); + efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_TYPE_CHECKED, EINA_TRUE); } } } @@ -147,13 +147,13 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED) return EINA_TRUE; } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _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_RESULT_FAIL); - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_CHECK_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; if (elm_widget_is_legacy(obj)) { @@ -359,7 +359,7 @@ _efl_ui_radio_efl_access_object_state_set_get(const Eo *obj, Efl_Ui_Radio_Data * 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); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_CHECKED); return ret; } @@ -373,8 +373,9 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX) ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX) #include "efl_ui_radio.eo.c" +#include "efl_ui_radio_eo.legacy.c" -#include "efl_ui_radio_legacy.eo.h" +#include "efl_ui_radio_legacy_eo.h" #include "efl_ui_radio_legacy_part.eo.h" #define MY_CLASS_NAME_LEGACY "elm_radio" @@ -414,12 +415,12 @@ _icon_signal_emit(Evas_Object *obj) elm_layout_sizing_eval(obj); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_radio_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_RADIO_LEGACY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; /* FIXME: replicated from elm_layout just because radio's icon * spot is elm.swallow.content, not elm.swallow.icon. Fix that @@ -494,4 +495,4 @@ elm_radio_value_get(const Evas_Object *obj) return efl_ui_nstate_value_get(obj); } -#include "efl_ui_radio_legacy.eo.c" +#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 c85d163be1..5fd6136543 100644 --- a/src/lib/elementary/efl_ui_radio.eo +++ b/src/lib/elementary/efl_ui_radio.eo @@ -1,7 +1,6 @@ -class Efl.Ui.Radio extends Efl.Ui.Check implements Efl.Access.Widget.Action, Efl.Content +class @beta Efl.Ui.Radio extends Efl.Ui.Check implements Efl.Access.Widget.Action, Efl.Content { [[Elementary radio class]] - legacy_prefix: elm_radio; methods { @property state_value { set { @@ -63,7 +62,7 @@ class Efl.Ui.Radio extends Efl.Ui.Check implements Efl.Access.Widget.Action, Efl Efl.Object.destructor; Efl.Ui.Widget.theme_apply; Efl.Ui.Widget.on_access_activate; - Efl.Ui.Widget.widget_event; + Efl.Ui.Widget.widget_input_event_handler; Efl.Access.Object.state_set { get; } Efl.Access.Widget.Action.elm_actions { get; } Efl.Ui.Nstate.value { set; get; } diff --git a/src/lib/elementary/efl_ui_radio_eo.legacy.c b/src/lib/elementary/efl_ui_radio_eo.legacy.c new file mode 100644 index 0000000000..69b23653ed --- /dev/null +++ b/src/lib/elementary/efl_ui_radio_eo.legacy.c @@ -0,0 +1,30 @@ + +EAPI void +elm_radio_state_value_set(Efl_Ui_Radio *obj, int value) +{ + efl_ui_radio_state_value_set(obj, value); +} + +EAPI int +elm_radio_state_value_get(const Efl_Ui_Radio *obj) +{ + return efl_ui_radio_state_value_get(obj); +} + +EAPI void +elm_radio_value_pointer_set(Efl_Ui_Radio *obj, int *valuep) +{ + efl_ui_radio_value_pointer_set(obj, valuep); +} + +EAPI Efl_Canvas_Object * +elm_radio_selected_object_get(const Efl_Ui_Radio *obj) +{ + return efl_ui_radio_selected_object_get(obj); +} + +EAPI void +elm_radio_group_add(Efl_Ui_Radio *obj, Efl_Ui_Radio *group) +{ + efl_ui_radio_group_add(obj, group); +} diff --git a/src/lib/elementary/efl_ui_radio_eo.legacy.h b/src/lib/elementary/efl_ui_radio_eo.legacy.h new file mode 100644 index 0000000000..43e068fa69 --- /dev/null +++ b/src/lib/elementary/efl_ui_radio_eo.legacy.h @@ -0,0 +1,85 @@ +#ifndef _EFL_UI_RADIO_EO_LEGACY_H_ +#define _EFL_UI_RADIO_EO_LEGACY_H_ + +#ifndef _EFL_UI_RADIO_EO_CLASS_TYPE +#define _EFL_UI_RADIO_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Radio; + +#endif + +#ifndef _EFL_UI_RADIO_EO_TYPES +#define _EFL_UI_RADIO_EO_TYPES + + +#endif + +/** + * @brief Set the integer value that this radio object represents. + * + * This sets the value of the radio. + * + * @param[in] obj The object. + * @param[in] value The value to use if this radio object is selected. + * + * @ingroup Elm_Radio_Group + */ +EAPI void elm_radio_state_value_set(Efl_Ui_Radio *obj, int value); + +/** + * @brief Get the integer value that this radio object represents. + * + * This gets the value of the radio. + * + * @param[in] obj The object. + * + * @return The value to use if this radio object is selected. + * + * @ingroup Elm_Radio_Group + */ +EAPI int elm_radio_state_value_get(const Efl_Ui_Radio *obj); + +/** + * @brief Set a convenience pointer to an integer, which changes when radio + * group value changes. + * + * This sets a pointer to an integer that in addition to the radio object state + * will also be modified directly. To stop setting the object pointed to, + * simply use NULL as the valuep argument. If valuep is not NULL then when + * called, the radio object state will also be modified to reflect the value of + * the integer valuep points to, just like calling elm_radio_value_set(). + * + * @param[in] obj The object. + * @param[in] valuep Pointer to the integer to modify + * + * @ingroup Elm_Radio_Group + */ +EAPI void elm_radio_value_pointer_set(Efl_Ui_Radio *obj, int *valuep); + +/** + * @brief Get the selected radio object. + * + * @param[in] obj The object. + * + * @return The selected radio object + * + * @ingroup Elm_Radio_Group + */ +EAPI Efl_Canvas_Object *elm_radio_selected_object_get(const Efl_Ui_Radio *obj); + +/** + * @brief Add this radio to a group of other radio objects + * + * Radio objects work in groups. Each member should have a different integer + * value assigned. In order to have them work as a group, they need to know + * about each other. This adds the given radio object to the group of which the + * group object indicated is a member. + * + * @param[in] obj The object. + * @param[in] group Any radio object whose group the obj is to join. + * + * @ingroup Elm_Radio_Group + */ +EAPI void elm_radio_group_add(Efl_Ui_Radio *obj, Efl_Ui_Radio *group); + +#endif diff --git a/src/lib/elementary/efl_ui_radio_legacy.eo b/src/lib/elementary/efl_ui_radio_legacy.eo deleted file mode 100644 index 8089c48763..0000000000 --- a/src/lib/elementary/efl_ui_radio_legacy.eo +++ /dev/null @@ -1,12 +0,0 @@ -class Efl.Ui.Radio_Legacy extends Efl.Ui.Radio implements 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_eo.c b/src/lib/elementary/efl_ui_radio_legacy_eo.c new file mode 100644 index 0000000000..b0a26730e8 --- /dev/null +++ b/src/lib/elementary/efl_ui_radio_legacy_eo.c @@ -0,0 +1,47 @@ + +Efl_Object *_efl_ui_radio_legacy_efl_object_constructor(Eo *obj, void *pd); + + +Eina_Error _efl_ui_radio_legacy_efl_ui_widget_theme_apply(Eo *obj, void *pd); + + +Eina_Bool _efl_ui_radio_legacy_efl_ui_widget_widget_sub_object_del(Eo *obj, void *pd, Efl_Canvas_Object *sub_obj); + + +Efl_Object *_efl_ui_radio_legacy_efl_part_part_get(const Eo *obj, void *pd, const char *name); + + +static Eina_Bool +_efl_ui_radio_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_RADIO_LEGACY_EXTRA_OPS +#define EFL_UI_RADIO_LEGACY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _efl_ui_radio_legacy_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _efl_ui_radio_legacy_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _efl_ui_radio_legacy_efl_ui_widget_widget_sub_object_del), + EFL_OBJECT_OP_FUNC(efl_part_get, _efl_ui_radio_legacy_efl_part_part_get), + EFL_UI_RADIO_LEGACY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_radio_legacy_class_desc = { + EO_VERSION, + "Efl.Ui.Radio_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _efl_ui_radio_legacy_class_initializer, + _efl_ui_radio_legacy_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_radio_legacy_class_get, &_efl_ui_radio_legacy_class_desc, EFL_UI_RADIO_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/efl_ui_radio_legacy_eo.h b/src/lib/elementary/efl_ui_radio_legacy_eo.h new file mode 100644 index 0000000000..6e0cb00f12 --- /dev/null +++ b/src/lib/elementary/efl_ui_radio_legacy_eo.h @@ -0,0 +1,26 @@ +#ifndef _EFL_UI_RADIO_LEGACY_EO_H_ +#define _EFL_UI_RADIO_LEGACY_EO_H_ + +#ifndef _EFL_UI_RADIO_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_RADIO_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Radio_Legacy; + +#endif + +#ifndef _EFL_UI_RADIO_LEGACY_EO_TYPES +#define _EFL_UI_RADIO_LEGACY_EO_TYPES + + +#endif +#ifdef EFL_BETA_API_SUPPORT +/** Elementary radio class + * + * @ingroup Efl_Ui_Radio_Legacy + */ +#define EFL_UI_RADIO_LEGACY_CLASS efl_ui_radio_legacy_class_get() + +EWAPI const Efl_Class *efl_ui_radio_legacy_class_get(void); +#endif /* EFL_BETA_API_SUPPORT */ + +#endif diff --git a/src/lib/elementary/efl_ui_radio_legacy_eo.legacy.h b/src/lib/elementary/efl_ui_radio_legacy_eo.legacy.h new file mode 100644 index 0000000000..bb813c74da --- /dev/null +++ b/src/lib/elementary/efl_ui_radio_legacy_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_RADIO_LEGACY_EO_LEGACY_H_ +#define _EFL_UI_RADIO_LEGACY_EO_LEGACY_H_ + +#ifndef _EFL_UI_RADIO_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_RADIO_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Radio_Legacy; + +#endif + +#ifndef _EFL_UI_RADIO_LEGACY_EO_TYPES +#define _EFL_UI_RADIO_LEGACY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/efl_ui_radio_legacy_part.eo b/src/lib/elementary/efl_ui_radio_legacy_part.eo index e7edcdeb2e..12a99be7c8 100644 --- a/src/lib/elementary/efl_ui_radio_legacy_part.eo +++ b/src/lib/elementary/efl_ui_radio_legacy_part.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Radio_Legacy_Part extends Efl.Ui.Layout_Part_Content +class @beta Efl.Ui.Radio_Legacy_Part extends Efl.Ui.Layout_Part_Content { [[Elementary radio internal part class]] data: null; diff --git a/src/lib/elementary/efl_ui_relative_layout.c b/src/lib/elementary/efl_ui_relative_layout.c new file mode 100644 index 0000000000..fa47d7591c --- /dev/null +++ b/src/lib/elementary/efl_ui_relative_layout.c @@ -0,0 +1,551 @@ +#include "efl_ui_relative_layout_private.h" + +#define MY_CLASS EFL_UI_RELATIVE_LAYOUT_CLASS +#define MY_CLASS_NAME "Efl.Ui.Relative_Layout" + +#define LEFT 0 +#define RIGHT 1 +#define TOP 2 +#define BOTTOM 3 + +#define START (axis ? TOP : LEFT) +#define END (axis ? BOTTOM : RIGHT) + +static void _child_calc(Efl_Ui_Relative_Layout_Child *child, Eina_Bool axis); + +static int +_chain_sort_cb(const void *l1, const void *l2) +{ + Efl_Ui_Relative_Layout_Calc *calc1, *calc2; + + calc1 = EINA_INLIST_CONTAINER_GET(l1, Efl_Ui_Relative_Layout_Calc); + calc2 = EINA_INLIST_CONTAINER_GET(l2, Efl_Ui_Relative_Layout_Calc); + + return calc2->comp_factor <= calc1->comp_factor ? -1 : 1; +} + +static Efl_Ui_Relative_Layout_Child * +_efl_ui_relative_layout_register(Efl_Ui_Relative_Layout_Data *pd, Eo *child) +{ + Efl_Ui_Relative_Layout_Child *rc; + + rc = calloc(1, sizeof(Efl_Ui_Relative_Layout_Child)); + if (!rc) return NULL; + + rc->obj = child; + rc->layout = pd->obj; + rc->rel[LEFT].to = rc->layout; + rc->rel[LEFT].relative = 0.0; + rc->rel[RIGHT].to = rc->layout; + rc->rel[RIGHT].relative = 1.0; + rc->rel[TOP].to = rc->layout; + rc->rel[TOP].relative = 0.0; + rc->rel[BOTTOM].to = rc->layout; + rc->rel[BOTTOM].relative = 1.0; + + if (pd->obj == child) + { + rc->calc.state[0] = RELATIVE_CALC_DONE; + rc->calc.state[1] = RELATIVE_CALC_DONE; + rc->calc.chain_state[0] = RELATIVE_CALC_DONE; + rc->calc.chain_state[1] = RELATIVE_CALC_DONE; + } + else + { + efl_ui_widget_sub_object_add(pd->obj, child); + efl_canvas_group_member_add(pd->obj, child); + efl_canvas_group_change(pd->obj); + } + + eina_hash_add(pd->children, &child, rc); + + return rc; +} + +static Efl_Ui_Relative_Layout_Child * +_relative_child_get(Efl_Ui_Relative_Layout_Data *pd, Eo *child) +{ + Efl_Ui_Relative_Layout_Child *rc; + + rc = eina_hash_find(pd->children, &child); + if (!rc) + rc = _efl_ui_relative_layout_register(pd, child); + + return rc; +} + +static Efl_Ui_Relative_Layout_Child * +_relative_child_find(const Eina_Hash *children, Eo *target) +{ + Efl_Ui_Relative_Layout_Child *child; + + child = eina_hash_find(children, &target); + if (!child) + ERR("target(%p(%s)) is not registered", target, efl_class_name_get(target)); + + return child; +} + +static void +_child_aspect_calc(Efl_Ui_Relative_Layout_Child *child, Eina_Bool axis) +{ + Efl_Ui_Relative_Layout_Calc *calc = &child->calc; + int temph; + + if ((calc->aspect[0] <= 0) || (calc->aspect[1] <= 0)) + { + ERR("Invalid aspect parameter for obj(%p), aspect(%d, %d) ", + child->obj, calc->aspect[0], calc->aspect[1]); + return; + } + + switch (calc->aspect_type) + { + case EFL_GFX_HINT_ASPECT_HORIZONTAL: + if (axis) _child_calc(child, !axis); + calc->want[1].length = calc->want[0].length * calc->aspect[1] / calc->aspect[0]; + break; + case EFL_GFX_HINT_ASPECT_VERTICAL: + if (!axis) _child_calc(child, !axis); + calc->want[0].length = calc->want[1].length * calc->aspect[0] / calc->aspect[1]; + break; + case EFL_GFX_HINT_ASPECT_BOTH: + if (calc->state[!axis] != RELATIVE_CALC_ON) + _child_calc(child, !axis); + temph = calc->want[axis].length * calc->aspect[!axis] / calc->aspect[axis]; + if (temph > calc->want[!axis].length) + { + temph = calc->want[!axis].length; + calc->want[axis].length = temph * calc->aspect[axis] / calc->aspect[!axis]; + } + else + calc->want[!axis].length = temph; + break; + default: + if (calc->state[!axis] != RELATIVE_CALC_ON) + _child_calc(child, !axis); + temph = calc->want[axis].length * calc->aspect[!axis] / calc->aspect[axis]; + if (temph < calc->want[!axis].length) + { + temph = calc->want[!axis].length; + calc->want[axis].length = temph * calc->aspect[axis] / calc->aspect[!axis]; + } + else + calc->want[!axis].length = temph; + } + + //calculate max size + if (calc->want[0].length > calc->max[0]) + { + calc->want[0].length = calc->max[0]; + calc->want[1].length = calc->want[0].length * calc->aspect[1] / calc->aspect[0]; + } + if (calc->want[1].length > calc->max[1]) + { + calc->want[1].length = calc->max[1]; + calc->want[0].length = calc->want[1].length * calc->aspect[0] / calc->aspect[1]; + } + //calculate min size + if (calc->want[0].length < calc->min[0]) + { + calc->want[0].length = calc->min[0]; + calc->want[1].length = calc->want[0].length * calc->aspect[1] / calc->aspect[0]; + } + if (calc->want[1].length < calc->min[1]) + { + calc->want[1].length = calc->min[1]; + calc->want[0].length = calc->want[1].length * calc->aspect[0] / calc->aspect[1]; + } + + //calculate align + calc->want[!axis].position = + calc->space[!axis].position + + (calc->space[!axis].length - calc->want[!axis].length) * calc->align[!axis]; +} + +static Eina_Bool +_child_chain_calc(Efl_Ui_Relative_Layout_Child *child, Eina_Bool axis) +{ + Efl_Ui_Relative_Layout_Child *head, *tail, *o; + Efl_Gfx_Hint_Aspect aspect_type; + int space, min_sum = 0; + double weight_sum = 0, cur_pos; + Eina_Inlist *chain = NULL; + + if (child->calc.chain_state[axis] == RELATIVE_CALC_DONE) + return EINA_TRUE; + + if ((child != child->calc.to[START]->calc.to[END]) && + (child != child->calc.to[END]->calc.to[START])) + return EINA_FALSE; + + // find head + head = child; + while (head == head->calc.to[START]->calc.to[END]) + head = head->calc.to[START]; + + //calculate weight_sum + aspect_type = !axis ? EFL_GFX_HINT_ASPECT_VERTICAL : EFL_GFX_HINT_ASPECT_HORIZONTAL; + o = head; + do + { + if ((o->calc.aspect[0] > 0) && (o->calc.aspect[1] > 0) && + (o->calc.aspect_type == aspect_type)) + { + _child_calc(o, !axis); + if (o->calc.want[axis].length > o->calc.min[axis]) + o->calc.min[axis] = o->calc.want[axis].length; + } + else if ((o->calc.aspect[0] <= 0) ^ (o->calc.aspect[1] <= 0)) + { + ERR("Invalid aspect parameter for obj(%p), aspect(%d, %d) ", + o->obj, o->calc.aspect[0], o->calc.aspect[1]); + } + + o->calc.space[axis].length = o->calc.min[axis] + + o->calc.margin[START] + o->calc.margin[END]; + min_sum += o->calc.space[axis].length; + weight_sum += o->calc.weight[axis]; + + tail = o; + o = o->calc.to[END]; + } + while (o->calc.to[START] == tail); + + _child_calc(head->calc.to[START], axis); + _child_calc(tail->calc.to[END], axis); + + cur_pos = head->calc.to[START]->calc.want[axis].position + + (head->calc.to[START]->calc.want[axis].length * head->rel[START].relative); + space = tail->calc.to[END]->calc.want[axis].position + + (tail->calc.to[END]->calc.want[axis].length * tail->rel[END].relative) - cur_pos; + + if ((space <= min_sum) || EINA_DBL_EQ(weight_sum, 0.0)) + cur_pos += (space - min_sum) * head->calc.align[axis]; + else + { + Efl_Ui_Relative_Layout_Calc *calc; + double weight_len, orig_space = space, orig_weight = weight_sum; + + // Calculate compare factor + for (o = head; o != tail->calc.to[END]; o = o->calc.to[END]) + { + double denom; + + calc = &o->calc; + denom = (calc->weight[axis] * orig_space) - (orig_weight * calc->min[axis]); + if (denom > 0) + { + calc->comp_factor = (calc->weight[axis] * orig_space) / denom; + chain = eina_inlist_sorted_insert(chain, EINA_INLIST_GET(calc), + _chain_sort_cb); + } + else + { + space -= calc->space[axis].length; + weight_sum -= calc->weight[axis]; + } + } + + EINA_INLIST_FOREACH(chain, calc) + { + weight_len = (space * calc->weight[axis]) / weight_sum; + + if (calc->space[axis].length < weight_len) + calc->space[axis].length = weight_len; + else + { + weight_sum -= calc->weight[axis]; + space -= calc->space[axis].length; + } + } + } + + for (o = head; o != tail->calc.to[END]; o = o->calc.to[END]) + { + o->calc.space[axis].position = cur_pos + o->calc.margin[START] + 0.5; + cur_pos += o->calc.space[axis].length; + o->calc.space[axis].length -= o->calc.margin[START] + o->calc.margin[END]; + o->calc.chain_state[axis] = RELATIVE_CALC_DONE; + } + + return EINA_TRUE; +} + +static void +_child_calc(Efl_Ui_Relative_Layout_Child *child, Eina_Bool axis) +{ + Efl_Ui_Relative_Layout_Calc *calc = &child->calc; + + if (calc->state[axis] == RELATIVE_CALC_DONE) + return; + + if (calc->state[axis] == RELATIVE_CALC_ON) + { + ERR("%c-axis circular dependency when calculating part \"%s\"(%p).", + axis ? 'Y' : 'X', efl_class_name_get(child->obj), child->obj); + return; + } + + calc->state[axis] = RELATIVE_CALC_ON; + + if (!_child_chain_calc(child, axis)) + { + _child_calc(calc->to[START], axis); + _child_calc(calc->to[END], axis); + + calc->space[axis].position = calc->to[START]->calc.want[axis].position + + (calc->to[START]->calc.want[axis].length * child->rel[START].relative) + + calc->margin[START]; + calc->space[axis].length = calc->to[END]->calc.want[axis].position + + (calc->to[END]->calc.want[axis].length * child->rel[END].relative) + - calc->margin[END] - calc->space[axis].position; + } + + if (calc->fill[axis] && (calc->weight[axis] > 0)) + calc->want[axis].length = calc->space[axis].length; + + if (!calc->aspect[0] && !calc->aspect[1]) + { + if (calc->want[axis].length > calc->max[axis]) + calc->want[axis].length = calc->max[axis]; + + if (calc->want[axis].length < calc->min[axis]) + calc->want[axis].length = calc->min[axis]; + } + else + { + _child_aspect_calc(child, axis); + } + + //calculate align + calc->want[axis].position = + calc->space[axis].position + + (calc->space[axis].length - calc->want[axis].length) * calc->align[axis]; + + child->calc.state[axis] = RELATIVE_CALC_DONE; +} + +static void +_hash_free_cb(void *data) +{ + Efl_Ui_Relative_Layout_Child *child = data; + + free(child); +} + +static Eina_Bool +_hash_free_foreach_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, + void *data, void *fdata EINA_UNUSED) +{ + Efl_Ui_Relative_Layout_Child *child = data; + + _elm_widget_sub_object_redirect_to_top(child->layout, child->obj); + _hash_free_cb(child); + + return EINA_TRUE; +} + +static Eina_Bool +_hash_child_calc_foreach_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, + void *data, void *fdata EINA_UNUSED) +{ + Efl_Ui_Relative_Layout_Child *child = data; + Eina_Rect want; + + if (child->obj == child->layout) + return EINA_TRUE; + + _child_calc(child, 0); + _child_calc(child, 1); + + want.x = child->calc.want[0].position; + want.w = child->calc.want[0].length; + want.y = child->calc.want[1].position; + want.h = child->calc.want[1].length; + + efl_gfx_entity_geometry_set(child->obj, want); + return EINA_TRUE; +} + + +static Eina_Bool +_hash_child_init_foreach_cb(const Eina_Hash *hash, const void *key EINA_UNUSED, + void *data, void *fdata EINA_UNUSED) +{ + Eina_Size2D max, min, aspect; + Efl_Ui_Relative_Layout_Child *child = data; + Efl_Ui_Relative_Layout_Calc *calc = &(child->calc); + + calc->to[LEFT] = _relative_child_find(hash, child->rel[LEFT].to); + if (!calc->to[LEFT]) calc->to[LEFT] = eina_hash_find(hash, &child->layout); + calc->to[RIGHT] = _relative_child_find(hash, child->rel[RIGHT].to); + if (!calc->to[RIGHT]) calc->to[RIGHT] = eina_hash_find(hash, &child->layout); + calc->to[TOP] = _relative_child_find(hash, child->rel[TOP].to); + if (!calc->to[TOP]) calc->to[TOP] = eina_hash_find(hash, &child->layout); + calc->to[BOTTOM] = _relative_child_find(hash, child->rel[BOTTOM].to); + if (!calc->to[BOTTOM]) calc->to[BOTTOM] = eina_hash_find(hash, &child->layout); + + if (child->obj == child->layout) + { + Eina_Rect want = efl_gfx_entity_geometry_get(child->obj); + calc->want[0].position = want.x; + calc->want[0].length = want.w; + calc->want[1].position = want.y; + calc->want[1].length = want.h; + calc->state[0] = RELATIVE_CALC_DONE; + calc->state[1] = RELATIVE_CALC_DONE; + calc->chain_state[0] = RELATIVE_CALC_DONE; + calc->chain_state[1] = RELATIVE_CALC_DONE; + return EINA_TRUE; + } + + calc->state[0] = RELATIVE_CALC_NONE; + calc->state[1] = RELATIVE_CALC_NONE; + calc->chain_state[0] = RELATIVE_CALC_NONE; + calc->chain_state[1] = RELATIVE_CALC_NONE; + + efl_gfx_hint_weight_get(child->obj, &calc->weight[0], &calc->weight[1]); + efl_gfx_hint_align_get(child->obj, &calc->align[0], &calc->align[1]); + efl_gfx_hint_fill_get(child->obj, &calc->fill[0], &calc->fill[1]); + efl_gfx_hint_aspect_get(child->obj, &calc->aspect_type, &aspect); + calc->aspect[0] = aspect.w; + calc->aspect[1] = aspect.h; + efl_gfx_hint_margin_get(child->obj, &calc->margin[LEFT], &calc->margin[RIGHT], + &calc->margin[TOP], &calc->margin[BOTTOM]); + max = efl_gfx_hint_size_max_get(child->obj); + min = efl_gfx_hint_size_combined_min_get(child->obj); + calc->max[0] = max.w; + calc->max[1] = max.h; + calc->min[0] = min.w; + calc->min[1] = min.h; + + calc->want[0].position = 0; + calc->want[0].length = 0; + calc->want[1].position = 0; + calc->want[1].length = 0; + calc->space[0].position = 0; + calc->space[0].length = 0; + calc->space[1].position = 0; + calc->space[1].length = 0; + + if (calc->weight[0] < 0) calc->weight[0] = 0; + if (calc->weight[1] < 0) calc->weight[1] = 0; + + if (calc->align[0] < 0) calc->align[0] = 0; + if (calc->align[1] < 0) calc->align[1] = 0; + if (calc->align[0] > 1) calc->align[0] = 1; + if (calc->align[1] > 1) calc->align[1] = 1; + + if (calc->max[0] < 0) calc->max[0] = INT_MAX; + if (calc->max[1] < 0) calc->max[1] = INT_MAX; + if (calc->aspect[0] < 0) calc->aspect[0] = 0; + if (calc->aspect[1] < 0) calc->aspect[1] = 0; + + return EINA_TRUE; +} + +static void +_on_size_hints_changed(void *data EINA_UNUSED, Evas *e EINA_UNUSED, + Evas_Object *obj, void *event_info EINA_UNUSED) +{ + efl_pack_layout_request(obj); +} + +EOLIAN static void +_efl_ui_relative_layout_efl_pack_layout_layout_update(Eo *obj, Efl_Ui_Relative_Layout_Data *pd) +{ + eina_hash_foreach(pd->children, _hash_child_init_foreach_cb, NULL); + eina_hash_foreach(pd->children, _hash_child_calc_foreach_cb, NULL); + + efl_event_callback_call(obj, EFL_PACK_EVENT_LAYOUT_UPDATED, NULL); +} + +EOLIAN static void +_efl_ui_relative_layout_efl_pack_layout_layout_request(Eo *obj, Efl_Ui_Relative_Layout_Data *pd EINA_UNUSED) +{ + efl_canvas_group_need_recalculate_set(obj, EINA_TRUE); +} + +EOLIAN static void +_efl_ui_relative_layout_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Relative_Layout_Data *pd EINA_UNUSED) +{ + efl_pack_layout_update(obj); +} + +EOLIAN static void +_efl_ui_relative_layout_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Relative_Layout_Data *pd EINA_UNUSED, Eina_Size2D sz) +{ + efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz); + efl_canvas_group_change(obj); +} + +EOLIAN static void +_efl_ui_relative_layout_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Relative_Layout_Data *pd EINA_UNUSED, Eina_Position2D pos) +{ + efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos); + efl_canvas_group_change(obj); +} + +EOLIAN static void +_efl_ui_relative_layout_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Relative_Layout_Data *pd EINA_UNUSED) +{ + evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_size_hints_changed, NULL); + efl_canvas_group_add(efl_super(obj, MY_CLASS)); + + elm_widget_highlight_ignore_set(obj, EINA_TRUE); +} + +EOLIAN static Eo * +_efl_ui_relative_layout_efl_object_constructor(Eo *obj, Efl_Ui_Relative_Layout_Data *pd) +{ + obj = efl_constructor(efl_super(obj, MY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME); + efl_access_object_access_type_set(obj, EFL_ACCESS_TYPE_SKIPPED); + efl_access_object_role_set(obj, EFL_ACCESS_ROLE_FILLER); + + pd->obj = obj; + pd->children = eina_hash_pointer_new(_hash_free_cb); + _efl_ui_relative_layout_register(pd, obj); + + return obj; +} + +EOLIAN static void +_efl_ui_relative_layout_efl_object_destructor(Eo *obj, Efl_Ui_Relative_Layout_Data *pd) +{ + eina_hash_free(pd->children); + efl_destructor(efl_super(obj, MY_CLASS)); +} + +EOLIAN static void +_efl_ui_relative_layout_unregister(Eo *obj, Efl_Ui_Relative_Layout_Data *pd, Efl_Object *child) +{ + _elm_widget_sub_object_redirect_to_top(obj, child); + if (!eina_hash_del_by_key(pd->children, &child)) + ERR("child(%p(%s)) is not registered", child, efl_class_name_get(child)); +} + +EOLIAN static void +_efl_ui_relative_layout_unregister_all(Eo *obj EINA_UNUSED, Efl_Ui_Relative_Layout_Data *pd) +{ + eina_hash_foreach(pd->children, _hash_free_foreach_cb, NULL); +} + +EOLIAN static Eina_Iterator * +_efl_ui_relative_layout_children_iterate(Eo *obj EINA_UNUSED, Efl_Ui_Relative_Layout_Data *pd) +{ + return eina_hash_iterator_data_new(pd->children); +} + +EFL_UI_RELATIVE_LAYOUT_RELATION_SET_GET(left, LEFT); +EFL_UI_RELATIVE_LAYOUT_RELATION_SET_GET(right, RIGHT); +EFL_UI_RELATIVE_LAYOUT_RELATION_SET_GET(top, TOP); +EFL_UI_RELATIVE_LAYOUT_RELATION_SET_GET(bottom, BOTTOM); + +/* Internal EO APIs and hidden overrides */ + +#define EFL_UI_RELATIVE_LAYOUT_EXTRA_OPS \ + EFL_CANVAS_GROUP_ADD_OPS(efl_ui_relative_layout) + +#include "efl_ui_relative_layout.eo.c" diff --git a/src/lib/elementary/efl_ui_relative_layout.eo b/src/lib/elementary/efl_ui_relative_layout.eo new file mode 100644 index 0000000000..dff9c60801 --- /dev/null +++ b/src/lib/elementary/efl_ui_relative_layout.eo @@ -0,0 +1,79 @@ +class @beta Efl.Ui.Relative_Layout extends Efl.Ui.Widget implements Efl.Pack_Layout +{ + [[The relative layout class. + + A relative layout calculates the size and position of all the children + based on their relationship to each other.]] + methods { + @property relation_left { + [[Specifies the left side edge of the child relative to the target. + By default, target is parent and relative is 0.0.]] + keys { + child: Efl.Object; [[The child to specify relation.]] + } + values { + target: Efl.Object; [[The relative target.]] + relative: double; [[The ratio between left and right of the target, + ranging from 0.0 to 1.0.]] + } + } + @property relation_right { + [[Specifies the right side edge of the child relative to the target. + By default, target is parent and relative is 1.0.]] + keys { + child: Efl.Object; [[The child to specify relation.]] + } + values { + target: Efl.Object; [[The relative target.]] + relative: double; [[The ratio between left and right of the target, + ranging from 0.0 to 1.0.]] + } + } + @property relation_top { + [[Specifies the top side edge of the child relative to the target. + By default, target is parent and relative is 0.0.]] + keys { + child: Efl.Object; [[The child to specify relation.]] + } + values { + target: Efl.Object; [[The relative target.]] + relative: double; [[The ratio between top and bottom of the target, + ranging from 0.0 to 1.0.]] + } + } + @property relation_bottom { + [[Specifies the bottom side edge of the child relative to the target. + By default, target is parent and relative is 1.0.]] + keys { + child: Efl.Object; [[The child to specify relation.]] + } + values { + target: Efl.Object; [[The relative target.]] + relative: double; [[The ratio between top and bottom of the target, + ranging from 0.0 to 1.0.]] + } + } + unregister { + [[Remove all relations of the child.]] + params { + @in child: Efl.Object; [[The child to unregister]] + } + } + unregister_all { + [[Remove all relations from the registered children. ]] + } + children_iterate { + [[Begin iterating over this object's children.]] + return: iterator @owned @warn_unused; [[Iterator to object children.]] + } + } + implements { + Efl.Object.constructor; + Efl.Object.destructor; + Efl.Canvas.Group.group_calculate; + Efl.Gfx.Entity.position { set; } + Efl.Gfx.Entity.size { set; } + Efl.Pack_Layout.layout_update; + Efl.Pack_Layout.layout_request; + } +} diff --git a/src/lib/elementary/efl_ui_relative_layout_private.h b/src/lib/elementary/efl_ui_relative_layout_private.h new file mode 100644 index 0000000000..b7410efc49 --- /dev/null +++ b/src/lib/elementary/efl_ui_relative_layout_private.h @@ -0,0 +1,90 @@ +#ifndef EFL_UI_RELATIVE_LAYOUT_PRIVATE_H +#define EFL_UI_RELATIVE_LAYOUT_PRIVATE_H + +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#define EFL_PACK_LAYOUT_PROTECTED + +#include +#include "elm_priv.h" + +typedef enum _Efl_Ui_Relative_Layout_Calc_State +{ + RELATIVE_CALC_NONE, + RELATIVE_CALC_DONE, + RELATIVE_CALC_ON +} Efl_Ui_Relative_Layout_Calc_State; + +typedef struct _Efl_Ui_Relative_Layout_Data Efl_Ui_Relative_Layout_Data; +typedef struct _Efl_Ui_Relative_Layout_Child Efl_Ui_Relative_Layout_Child; +typedef struct _Efl_Ui_Relative_Layout_Calc Efl_Ui_Relative_Layout_Calc; +typedef struct _Efl_Ui_Relative_Layout_Relation Efl_Ui_Relative_Layout_Relation; + +struct _Efl_Ui_Relative_Layout_Calc +{ + EINA_INLIST; + + int max[2]; + int min[2]; + int aspect[2]; + int margin[4]; + Efl_Gfx_Hint_Aspect aspect_type; + Eina_Bool fill[2]; + double weight[2]; + double align[2]; + double comp_factor; + + struct { + int position; + double length; + } space[2], want[2]; + + Efl_Ui_Relative_Layout_Calc_State state[2]; + Efl_Ui_Relative_Layout_Calc_State chain_state[2]; + Efl_Ui_Relative_Layout_Child *to[4]; +}; + +struct _Efl_Ui_Relative_Layout_Data +{ + Eo *obj; + Eina_Hash *children; +}; + +struct _Efl_Ui_Relative_Layout_Relation +{ + Efl_Object *to; + double relative; +}; + +struct _Efl_Ui_Relative_Layout_Child +{ + Eo *obj; + Eo *layout; + Efl_Ui_Relative_Layout_Relation rel[4]; + Efl_Ui_Relative_Layout_Calc calc; +}; + +#define EFL_UI_RELATIVE_LAYOUT_RELATION_SET_GET(direction, DIRECTION) \ + EOLIAN static void \ + _efl_ui_relative_layout_relation_ ## direction ## _set(Eo *obj EINA_UNUSED, Efl_Ui_Relative_Layout_Data *pd, Eo *child, Eo *target, double relative) \ + { \ + Efl_Ui_Relative_Layout_Child *rc; \ + rc = _relative_child_get(pd, child); \ + if (target) rc->rel[DIRECTION].to = target; \ + if (relative < 0) relative = 0; \ + else if (relative > 1) relative = 1; \ + rc->rel[DIRECTION].relative = relative; \ + } \ + \ + EOLIAN static void \ + _efl_ui_relative_layout_relation_ ## direction ## _get(const Eo *obj EINA_UNUSED, Efl_Ui_Relative_Layout_Data *pd, Eo *child, Eo **target, double *relative) \ + { \ + Efl_Ui_Relative_Layout_Child *rc; \ + rc = _relative_child_get(pd, child); \ + if (target) *target = rc->rel[DIRECTION].to; \ + if (relative) *relative = rc->rel[DIRECTION].relative; \ + } + +#endif diff --git a/src/lib/elementary/efl_ui_scroll_alert_popup.c b/src/lib/elementary/efl_ui_scroll_alert_popup.c index 3e7c8d9b5e..54e28c5643 100644 --- a/src/lib/elementary/efl_ui_scroll_alert_popup.c +++ b/src/lib/elementary/efl_ui_scroll_alert_popup.c @@ -2,7 +2,6 @@ # include "elementary_config.h" #endif -#define EFL_UI_SCROLL_ALERT_POPUP_BETA #define EFL_PART_PROTECTED #include @@ -100,7 +99,7 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Scroll_Alert_Popup_Data *pd, efl_gfx_entity_size_set(obj, new_size); } - efl_gfx_size_hint_min_set(obj, new_min); + efl_gfx_hint_size_min_set(obj, new_min); } static void @@ -160,8 +159,8 @@ _efl_ui_scroll_alert_popup_content_set(Eo *obj, Efl_Ui_Scroll_Alert_Popup_Data * pd->content = content; //Content should have expand propeties since the scroller is not layout layer - efl_gfx_size_hint_weight_set(pd->content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_gfx_size_hint_fill_set(pd->content, EINA_TRUE, EINA_TRUE); + efl_gfx_hint_weight_set(pd->content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + efl_gfx_hint_fill_set(pd->content, EINA_TRUE, EINA_TRUE); efl_content_set(pd->scroller, pd->content); } @@ -267,8 +266,6 @@ _efl_ui_scroll_alert_popup_efl_object_constructor(Eo *obj, obj = efl_constructor(efl_super(obj, MY_CLASS)); efl_canvas_object_type_set(obj, MY_CLASS_NAME); - elm_widget_sub_object_parent_add(obj); - pd->scroller = elm_scroller_add(obj); elm_object_style_set(pd->scroller, "popup/no_inset_shadow"); elm_scroller_policy_set(pd->scroller, ELM_SCROLLER_POLICY_AUTO, diff --git a/src/lib/elementary/efl_ui_scroll_alert_popup.eo b/src/lib/elementary/efl_ui_scroll_alert_popup.eo index fe4cf365d5..fb9aeb2558 100644 --- a/src/lib/elementary/efl_ui_scroll_alert_popup.eo +++ b/src/lib/elementary/efl_ui_scroll_alert_popup.eo @@ -1,6 +1,6 @@ import eina_types; -class Efl.Ui.Scroll_Alert_Popup extends Efl.Ui.Alert_Popup +class @beta Efl.Ui.Scroll_Alert_Popup extends Efl.Ui.Alert_Popup { [[EFL UI Scroll Alert Popup class]] methods { diff --git a/src/lib/elementary/efl_ui_scroll_alert_popup_part.eo b/src/lib/elementary/efl_ui_scroll_alert_popup_part.eo index f100d02286..b9a818a00f 100644 --- a/src/lib/elementary/efl_ui_scroll_alert_popup_part.eo +++ b/src/lib/elementary/efl_ui_scroll_alert_popup_part.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Scroll_Alert_Popup_Part extends Efl.Ui.Layout_Part implements Efl.Content, Efl.Text +class @beta Efl.Ui.Scroll_Alert_Popup_Part extends Efl.Ui.Layout_Part implements Efl.Content, Efl.Text { [[Efl UI Scroll Alert Popup internal part class]] data: null; diff --git a/src/lib/elementary/efl_ui_scroll_manager.c b/src/lib/elementary/efl_ui_scroll_manager.c index ee10d895ab..a6bf0cda22 100644 --- a/src/lib/elementary/efl_ui_scroll_manager.c +++ b/src/lib/elementary/efl_ui_scroll_manager.c @@ -4,7 +4,6 @@ #define EFL_UI_SCROLL_MANAGER_PROTECTED #define EFL_UI_SCROLLBAR_PROTECTED -#define EFL_UI_SCROLLBAR_BETA #include #include "elm_priv.h" @@ -14,12 +13,12 @@ #define MY_CLASS_NAME "Efl.Ui.Scroll.Manager" #define ELM_ANIMATOR_CONNECT(Obj, Bool, Callback, Data) \ - efl_event_callback_del(Obj, EFL_EVENT_ANIMATOR_TICK, Callback, Data); \ - efl_event_callback_add(Obj, EFL_EVENT_ANIMATOR_TICK, Callback, Data); \ + efl_event_callback_del(Obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, Callback, Data); \ + efl_event_callback_add(Obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, Callback, Data); \ Bool = 1; #define ELM_ANIMATOR_DISCONNECT(Obj, Bool, Callback, Data) \ - efl_event_callback_del(Obj, EFL_EVENT_ANIMATOR_TICK, Callback, Data); \ + efl_event_callback_del(Obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, Callback, Data); \ Bool = 0; @@ -275,6 +274,19 @@ _efl_ui_scroll_manager_efl_ui_scrollable_interactive_match_content_set(Eo *obj E sd->match_content_h = !!h; } +EOLIAN static void +_efl_ui_scroll_manager_efl_ui_scrollable_interactive_step_size_set(Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd, Eina_Position2D step) +{ + sd->step.x = step.x * elm_config_scale_get(); + sd->step.y = step.y * elm_config_scale_get(); +} + +EOLIAN static Eina_Position2D +_efl_ui_scroll_manager_efl_ui_scrollable_interactive_step_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd) +{ + return EINA_POSITION2D(sd->step.x, sd->step.y); +} + static Evas_Coord _efl_ui_scroll_manager_x_mirrored_get(const Evas_Object *obj, Evas_Coord x) @@ -1011,7 +1023,7 @@ _efl_ui_scroll_manager_mouse_up_event_momentum_eval(Efl_Ui_Scroll_Manager_Data * { double t, at; Evas_Coord dx, dy, ax, ay, vel; - char sdx, sdy; + signed char sdx, sdy; t = ev->timestamp / 1000.0; @@ -1282,7 +1294,7 @@ _scroll_manager_momentum_animator_add(Efl_Ui_Scroll_Manager_Data *sd, double vx, #define INVERSE_MASS 1 #define ACCEL (FRICTION * INVERSE_MASS) double dur = 0.0; - char sdx = 0, sdy = 0; + signed char sdx = 0, sdy = 0; Evas_Coord dstx = 0, dsty = 0; /* @@ -2235,11 +2247,11 @@ _efl_ui_scroll_manager_pan_set(Eo *obj, Efl_Ui_Scroll_Manager_Data *sd, Eo *pan) if (sd->pan_obj) { efl_event_callback_del - (sd->pan_obj, EFL_UI_PAN_EVENT_CONTENT_CHANGED, _efl_ui_scroll_manager_pan_content_changed_cb, sd); + (sd->pan_obj, EFL_UI_PAN_EVENT_PAN_CONTENT_CHANGED, _efl_ui_scroll_manager_pan_content_changed_cb, sd); efl_event_callback_del - (sd->pan_obj, EFL_UI_PAN_EVENT_VIEWPORT_CHANGED, _efl_ui_scroll_manager_pan_viewport_changed_cb, sd); + (sd->pan_obj, EFL_UI_PAN_EVENT_PAN_VIEWPORT_CHANGED, _efl_ui_scroll_manager_pan_viewport_changed_cb, sd); efl_event_callback_del - (sd->pan_obj, EFL_UI_PAN_EVENT_POSITION_CHANGED, _efl_ui_scroll_manager_pan_position_changed_cb, sd); + (sd->pan_obj, EFL_UI_PAN_EVENT_PAN_POSITION_CHANGED, _efl_ui_scroll_manager_pan_position_changed_cb, sd); } if (!pan) @@ -2248,11 +2260,11 @@ _efl_ui_scroll_manager_pan_set(Eo *obj, Efl_Ui_Scroll_Manager_Data *sd, Eo *pan) sd->pan_obj = pan; efl_event_callback_add - (sd->pan_obj, EFL_UI_PAN_EVENT_CONTENT_CHANGED, _efl_ui_scroll_manager_pan_content_changed_cb, sd); + (sd->pan_obj, EFL_UI_PAN_EVENT_PAN_CONTENT_CHANGED, _efl_ui_scroll_manager_pan_content_changed_cb, sd); efl_event_callback_add - (sd->pan_obj, EFL_UI_PAN_EVENT_VIEWPORT_CHANGED, _efl_ui_scroll_manager_pan_viewport_changed_cb, sd); + (sd->pan_obj, EFL_UI_PAN_EVENT_PAN_VIEWPORT_CHANGED, _efl_ui_scroll_manager_pan_viewport_changed_cb, sd); efl_event_callback_add - (sd->pan_obj, EFL_UI_PAN_EVENT_POSITION_CHANGED, _efl_ui_scroll_manager_pan_position_changed_cb, sd); + (sd->pan_obj, EFL_UI_PAN_EVENT_PAN_POSITION_CHANGED, _efl_ui_scroll_manager_pan_position_changed_cb, sd); evas_object_event_callback_add(sd->pan_obj, EVAS_CALLBACK_RESIZE, _efl_ui_scroll_manager_pan_resized_cb, obj); evas_object_event_callback_add(sd->pan_obj, EVAS_CALLBACK_MOVE, @@ -2406,6 +2418,7 @@ _efl_ui_scroll_manager_efl_object_constructor(Eo *obj, Efl_Ui_Scroll_Manager_Dat sd->scrolling = EINA_FALSE; sd->event_rect = evas_object_rectangle_add(evas_object_evas_get(sd->parent)); + efl_key_data_set(sd->event_rect, "_elm_leaveme", obj); efl_canvas_group_member_add(sd->parent, sd->event_rect); efl_ui_widget_sub_object_add(sd->parent, sd->event_rect); @@ -2433,17 +2446,19 @@ _efl_ui_scroll_manager_efl_object_destructor(Eo *obj, Efl_Ui_Scroll_Manager_Data ELM_ANIMATOR_DISCONNECT(sd->event_rect, sd->scrollto.x.animator, _efl_ui_scroll_manager_scroll_to_x_animator, sd); ELM_ANIMATOR_DISCONNECT(sd->event_rect, sd->scrollto.y.animator, _efl_ui_scroll_manager_scroll_to_y_animator, sd); - evas_object_event_callback_del_full(sd->pan_obj, EVAS_CALLBACK_RESIZE, - _efl_ui_scroll_manager_pan_resized_cb, obj); - evas_object_event_callback_del_full(sd->pan_obj, EVAS_CALLBACK_MOVE, - _efl_ui_scroll_manager_pan_moved_cb, obj); - efl_event_callback_del - (sd->pan_obj, EFL_UI_PAN_EVENT_CONTENT_CHANGED, _efl_ui_scroll_manager_pan_content_changed_cb, sd); - efl_event_callback_del - (sd->pan_obj, EFL_UI_PAN_EVENT_VIEWPORT_CHANGED, _efl_ui_scroll_manager_pan_viewport_changed_cb, sd); - efl_event_callback_del - (sd->pan_obj, EFL_UI_PAN_EVENT_POSITION_CHANGED, _efl_ui_scroll_manager_pan_position_changed_cb, sd); - + if (!efl_invalidating_get(sd->pan_obj)) + { + evas_object_event_callback_del_full(sd->pan_obj, EVAS_CALLBACK_RESIZE, + _efl_ui_scroll_manager_pan_resized_cb, obj); + evas_object_event_callback_del_full(sd->pan_obj, EVAS_CALLBACK_MOVE, + _efl_ui_scroll_manager_pan_moved_cb, obj); + efl_event_callback_del + (sd->pan_obj, EFL_UI_PAN_EVENT_PAN_CONTENT_CHANGED, _efl_ui_scroll_manager_pan_content_changed_cb, sd); + efl_event_callback_del + (sd->pan_obj, EFL_UI_PAN_EVENT_PAN_VIEWPORT_CHANGED, _efl_ui_scroll_manager_pan_viewport_changed_cb, sd); + efl_event_callback_del + (sd->pan_obj, EFL_UI_PAN_EVENT_PAN_POSITION_CHANGED, _efl_ui_scroll_manager_pan_position_changed_cb, sd); + } efl_destructor(efl_super(obj, MY_CLASS)); } diff --git a/src/lib/elementary/efl_ui_scroll_manager.eo b/src/lib/elementary/efl_ui_scroll_manager.eo index c390e166ff..93cd7e99bc 100644 --- a/src/lib/elementary/efl_ui_scroll_manager.eo +++ b/src/lib/elementary/efl_ui_scroll_manager.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Scroll.Manager extends Efl.Object implements +class @beta Efl.Ui.Scroll.Manager extends Efl.Object implements Efl.Ui.I18n, Efl.Ui.Scrollable_Interactive, Efl.Ui.Scrollbar @@ -35,6 +35,7 @@ class Efl.Ui.Scroll.Manager extends Efl.Object implements 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.step_size { set; get; } Efl.Ui.Scrollbar.bar_mode { get; set; } Efl.Ui.Scrollbar.bar_size { get; } Efl.Ui.Scrollbar.bar_position { get; set; } diff --git a/src/lib/elementary/efl_ui_scroller.c b/src/lib/elementary/efl_ui_scroller.c index 0c750ef301..0fef382346 100644 --- a/src/lib/elementary/efl_ui_scroller.c +++ b/src/lib/elementary/efl_ui_scroller.c @@ -5,7 +5,7 @@ #define ELM_LAYOUT_PROTECTED #define EFL_UI_SCROLL_MANAGER_PROTECTED #define EFL_UI_SCROLLBAR_PROTECTED -#define EFL_UI_SCROLLBAR_BETA +#define EFL_UI_WIDGET_FOCUS_MANAGER_PROTECTED #include #include "elm_priv.h" @@ -28,6 +28,126 @@ o, evas_object_type_get(o)); \ return __VA_ARGS__; \ } + +static Eina_Bool _key_action_move(Evas_Object *obj, const char *params); + +static const Elm_Action key_actions[] = { + {"move", _key_action_move}, + {NULL, NULL} +}; + +static Eina_Bool +_key_action_move(Eo *obj, const char *params) +{ + EFL_UI_SCROLLER_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE); + + const char *dir = params; + Efl_Ui_Focus_Direction focus_dir = 0; + Efl_Ui_Focus_Object *focused, *next_target; + Eina_Rect focused_geom, viewport; + Eina_Position2D pos; + Eina_Size2D max; + Eina_Bool scroller_adjustment = EINA_FALSE; + + pos = efl_ui_scrollable_content_pos_get(obj); + viewport = efl_ui_scrollable_viewport_geometry_get(obj); + max = efl_gfx_entity_size_get(sd->content); + if (!strcmp(dir, "prior")) + focus_dir = EFL_UI_FOCUS_DIRECTION_PREVIOUS; + else if (!strcmp(dir, "next")) + focus_dir = EFL_UI_FOCUS_DIRECTION_NEXT; + else if (!strcmp(dir, "left")) + focus_dir = EFL_UI_FOCUS_DIRECTION_LEFT; + else if (!strcmp(dir, "right")) + focus_dir = EFL_UI_FOCUS_DIRECTION_RIGHT; + else if (!strcmp(dir, "up")) + focus_dir = EFL_UI_FOCUS_DIRECTION_UP; + else if (!strcmp(dir, "down")) + focus_dir = EFL_UI_FOCUS_DIRECTION_DOWN; + else return EINA_FALSE; + + focused = efl_ui_focus_manager_focus_get(obj); + next_target = efl_ui_focus_manager_request_move(obj, focus_dir, focused, EINA_FALSE); + + //logical movement is handled by focus directly + if (focused && + (focus_dir == EFL_UI_FOCUS_DIRECTION_NEXT || + focus_dir == EFL_UI_FOCUS_DIRECTION_PREVIOUS)) + return EINA_FALSE; + //check if a object that is focused is lapping out of the viewport + // if this is the case, and the object is lapping out of the viewport in + // the direction we want to move, then move the scroller + if (focused) + { + Eina_Rectangle_Outside relative; + + focused_geom = efl_gfx_entity_geometry_get(focused); + + relative = eina_rectangle_outside_position(&viewport.rect, &focused_geom.rect); + + //now precisly check if the direction is also lapping out + if ((focus_dir == EFL_UI_FOCUS_DIRECTION_UP && (relative & EINA_RECTANGLE_OUTSIDE_TOP)) || + (focus_dir == EFL_UI_FOCUS_DIRECTION_LEFT && (relative & EINA_RECTANGLE_OUTSIDE_LEFT)) || + (focus_dir == EFL_UI_FOCUS_DIRECTION_DOWN && (relative & EINA_RECTANGLE_OUTSIDE_BOTTOM)) || + (focus_dir == EFL_UI_FOCUS_DIRECTION_RIGHT && (relative & EINA_RECTANGLE_OUTSIDE_RIGHT))) + { + scroller_adjustment = EINA_TRUE; + } + } + //check if there is a next target in the direction where we want to move + //if not, and the scroller is not at its max in that relation, + //then move the scroller instead of the focus + if (!next_target) + { + if ((focus_dir == EFL_UI_FOCUS_DIRECTION_UP && (pos.y != 0)) || + (focus_dir == EFL_UI_FOCUS_DIRECTION_LEFT && (pos.x != 0)) || + (focus_dir == EFL_UI_FOCUS_DIRECTION_DOWN && (pos.y != max.h)) || + (focus_dir == EFL_UI_FOCUS_DIRECTION_RIGHT && (pos.x != max.w))) + { + scroller_adjustment = EINA_TRUE; + } + } + if (!scroller_adjustment) + return EINA_FALSE; + + Eina_Position2D step = efl_ui_scrollable_step_size_get(obj); + + if (!strcmp(dir, "left")) + { + if (pos.x <= 0) return EINA_FALSE; + pos.x -= step.x; + } + else if (!strcmp(dir, "right")) + { + if (pos.x >= (max.w - viewport.w)) return EINA_FALSE; + pos.x += step.x; + } + else if (!strcmp(dir, "up")) + { + if (pos.y <= 0) return EINA_FALSE; + pos.y -= step.y; + } + else if (!strcmp(dir, "down")) + { + if (pos.y >= (max.h - viewport.h)) return EINA_FALSE; + pos.y += step.y; + } + else if (!strcmp(dir, "first")) + { + pos.y = 0; + } + else if (!strcmp(dir, "last")) + { + pos.y = max.h - viewport.h; + } + else return EINA_FALSE; + + efl_ui_scrollable_scroll(obj, EINA_RECT(pos.x, pos.y, viewport.w, viewport.h), EINA_FALSE); + + return EINA_TRUE; +} + + static void _efl_ui_scroller_content_del_cb(void *data, const Efl_Event *event EINA_UNUSED) @@ -64,6 +184,26 @@ _efl_ui_scroller_efl_content_content_set(Eo *obj, return EINA_TRUE; } +EOLIAN static Efl_Gfx_Entity* +_efl_ui_scroller_efl_content_content_get(const Eo *obj EINA_UNUSED, Efl_Ui_Scroller_Data *pd) +{ + return pd->content; +} + +EOLIAN static Efl_Gfx_Entity* +_efl_ui_scroller_efl_content_content_unset(Eo *obj EINA_UNUSED, Efl_Ui_Scroller_Data *pd) +{ + Efl_Gfx_Entity *old_content = pd->content; + + pd->content = NULL; + if (pd->smanager) + { + efl_ui_scrollbar_bar_visibility_update(pd->smanager); + } + + return old_content; +} + static void _efl_ui_scroller_bar_read_and_update(Eo *obj) { @@ -259,55 +399,56 @@ _scroll_edje_object_attach(Eo *obj) EFL_UI_SCROLLER_DATA_GET_OR_RETURN(obj, sd); efl_layout_signal_callback_add - (obj, "reload", "efl", _efl_ui_scroller_reload_cb, obj); + (obj, "reload", "efl", + obj, _efl_ui_scroller_reload_cb, NULL); efl_layout_signal_callback_add - (obj, "drag", "efl.dragable.vbar", _efl_ui_scroller_vbar_drag_cb, - obj); + (obj, "drag", "efl.dragable.vbar", + obj, _efl_ui_scroller_vbar_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,set", "efl.dragable.vbar", - _efl_ui_scroller_edje_drag_cb, obj); + obj, _efl_ui_scroller_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,start", "efl.dragable.vbar", - _efl_ui_scroller_edje_drag_start_cb, obj); + obj, _efl_ui_scroller_edje_drag_start_cb, NULL); efl_layout_signal_callback_add (obj, "drag,stop", "efl.dragable.vbar", - _efl_ui_scroller_edje_drag_stop_cb, obj); + obj, _efl_ui_scroller_edje_drag_stop_cb, NULL); efl_layout_signal_callback_add (obj, "drag,step", "efl.dragable.vbar", - _efl_ui_scroller_edje_drag_cb, obj); + obj, _efl_ui_scroller_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,page", "efl.dragable.vbar", - _efl_ui_scroller_edje_drag_cb, obj); + obj, _efl_ui_scroller_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "efl,vbar,press", "efl", - _efl_ui_scroller_vbar_press_cb, obj); + obj, _efl_ui_scroller_vbar_press_cb, NULL); efl_layout_signal_callback_add (obj, "efl,vbar,unpress", "efl", - _efl_ui_scroller_vbar_unpress_cb, obj); + obj, _efl_ui_scroller_vbar_unpress_cb, NULL); efl_layout_signal_callback_add - (obj, "drag", "efl.dragable.hbar", _efl_ui_scroller_hbar_drag_cb, - obj); + (obj, "drag", "efl.dragable.hbar", + obj, _efl_ui_scroller_hbar_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,set", "efl.dragable.hbar", - _efl_ui_scroller_edje_drag_cb, obj); + obj, _efl_ui_scroller_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,start", "efl.dragable.hbar", - _efl_ui_scroller_edje_drag_start_cb, obj); + obj, _efl_ui_scroller_edje_drag_start_cb, NULL); efl_layout_signal_callback_add (obj, "drag,stop", "efl.dragable.hbar", - _efl_ui_scroller_edje_drag_stop_cb, obj); + obj, _efl_ui_scroller_edje_drag_stop_cb, NULL); efl_layout_signal_callback_add (obj, "drag,step", "efl.dragable.hbar", - _efl_ui_scroller_edje_drag_cb, obj); + obj, _efl_ui_scroller_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "drag,page", "efl.dragable.hbar", - _efl_ui_scroller_edje_drag_cb, obj); + obj, _efl_ui_scroller_edje_drag_cb, NULL); efl_layout_signal_callback_add (obj, "efl,hbar,press", "efl", - _efl_ui_scroller_hbar_press_cb, obj); + obj, _efl_ui_scroller_hbar_press_cb, NULL); efl_layout_signal_callback_add (obj, "efl,hbar,unpress", "efl", - _efl_ui_scroller_hbar_unpress_cb, obj); + obj, _efl_ui_scroller_hbar_unpress_cb, NULL); } static void @@ -316,55 +457,56 @@ _scroll_edje_object_detach(Evas_Object *obj) EFL_UI_SCROLLER_DATA_GET_OR_RETURN(obj, sd); efl_layout_signal_callback_del - (obj, "reload", "efl", _efl_ui_scroller_reload_cb, obj); + (obj, "reload", "efl", + obj, _efl_ui_scroller_reload_cb, NULL); efl_layout_signal_callback_del - (obj, "drag", "efl.dragable.vbar", _efl_ui_scroller_vbar_drag_cb, - obj); + (obj, "drag", "efl.dragable.vbar", + obj, _efl_ui_scroller_vbar_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,set", "efl.dragable.vbar", - _efl_ui_scroller_edje_drag_cb, obj); + obj, _efl_ui_scroller_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,start", "efl.dragable.vbar", - _efl_ui_scroller_edje_drag_start_cb, obj); + obj, _efl_ui_scroller_edje_drag_start_cb, NULL); efl_layout_signal_callback_del (obj, "drag,stop", "efl.dragable.vbar", - _efl_ui_scroller_edje_drag_stop_cb, obj); + obj, _efl_ui_scroller_edje_drag_stop_cb, NULL); efl_layout_signal_callback_del (obj, "drag,step", "efl.dragable.vbar", - _efl_ui_scroller_edje_drag_cb, obj); + obj, _efl_ui_scroller_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,page", "efl.dragable.vbar", - _efl_ui_scroller_edje_drag_cb, obj); + obj, _efl_ui_scroller_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "efl,vbar,press", "efl", - _efl_ui_scroller_vbar_press_cb, obj); + obj, _efl_ui_scroller_vbar_press_cb, NULL); efl_layout_signal_callback_del (obj, "efl,vbar,unpress", "efl", - _efl_ui_scroller_vbar_unpress_cb, obj); + obj, _efl_ui_scroller_vbar_unpress_cb, NULL); efl_layout_signal_callback_del - (obj, "drag", "efl.dragable.hbar", _efl_ui_scroller_hbar_drag_cb, - obj); + (obj, "drag", "efl.dragable.hbar", + obj, _efl_ui_scroller_hbar_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,set", "efl.dragable.hbar", - _efl_ui_scroller_edje_drag_cb, obj); + obj, _efl_ui_scroller_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,start", "efl.dragable.hbar", - _efl_ui_scroller_edje_drag_start_cb, obj); + obj, _efl_ui_scroller_edje_drag_start_cb, NULL); efl_layout_signal_callback_del (obj, "drag,stop", "efl.dragable.hbar", - _efl_ui_scroller_edje_drag_stop_cb, obj); + obj, _efl_ui_scroller_edje_drag_stop_cb, NULL); efl_layout_signal_callback_del (obj, "drag,step", "efl.dragable.hbar", - _efl_ui_scroller_edje_drag_cb, obj); + obj, _efl_ui_scroller_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "drag,page", "efl.dragable.hbar", - _efl_ui_scroller_edje_drag_cb, obj); + obj, _efl_ui_scroller_edje_drag_cb, NULL); efl_layout_signal_callback_del (obj, "efl,hbar,press", "efl", - _efl_ui_scroller_hbar_press_cb, obj); + obj, _efl_ui_scroller_hbar_press_cb, NULL); efl_layout_signal_callback_del (obj, "efl,hbar,unpress", "efl", - _efl_ui_scroller_hbar_unpress_cb, obj); + obj, _efl_ui_scroller_hbar_unpress_cb, NULL); } static void @@ -385,10 +527,31 @@ _efl_ui_scroller_size_hint_changed_cb(void *data, const Efl_Event *ev EINA_UNUSE elm_layout_sizing_eval(data); } +static void +_focused_element(void *data, const Efl_Event *event) +{ + Eina_Rect geom; + Efl_Ui_Focus_Object *obj = data; + Efl_Ui_Focus_Object *focus = efl_ui_focus_manager_focus_get(event->object); + Eina_Position2D pos, pan; + + if (!focus) return; + + geom = efl_ui_focus_object_focus_geometry_get(focus); + pos = efl_gfx_entity_position_get(obj); + pan = efl_ui_scrollable_content_pos_get(obj); + geom.x += pan.x - pos.x; + geom.y += pan.y - pos.y; + + efl_ui_scrollable_scroll(obj, geom, EINA_TRUE); +} + EOLIAN static Eo * _efl_ui_scroller_efl_object_constructor(Eo *obj, Efl_Ui_Scroller_Data *sd EINA_UNUSED) { + if (!elm_widget_theme_klass_get(obj)) + elm_widget_theme_klass_set(obj, "scroller"); obj = efl_constructor(efl_super(obj, MY_CLASS)); return obj; @@ -402,8 +565,6 @@ _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)); - sd->smanager = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj); efl_ui_mirrored_set(sd->smanager, efl_ui_mirrored_get(obj)); efl_composite_attach(obj, sd->smanager); @@ -413,6 +574,8 @@ _efl_ui_scroller_efl_object_finalize(Eo *obj, efl_ui_scroll_manager_pan_set(sd->smanager, sd->pan_obj); edje_object_part_swallow(wd->resize_obj, "efl.content", sd->pan_obj); + elm_widget_can_focus_set(obj, EINA_TRUE); + _scroll_edje_object_attach(obj); efl_event_callback_add(obj, EFL_UI_SCROLLBAR_EVENT_BAR_SIZE_CHANGED, @@ -423,13 +586,14 @@ _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_ENTITY_EVENT_RESIZE, + efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _efl_ui_scroller_resized_cb, obj); - efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS, + efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _efl_ui_scroller_size_hint_changed_cb, obj); - efl_event_callback_add(sd->pan_obj, EFL_GFX_ENTITY_EVENT_RESIZE, + efl_event_callback_add(sd->pan_obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _efl_ui_scroller_pan_resized_cb, obj); + efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _focused_element, obj); return obj; } @@ -447,11 +611,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_ENTITY_EVENT_RESIZE, + efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _efl_ui_scroller_resized_cb, obj); - efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS, + efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _efl_ui_scroller_size_hint_changed_cb, obj); - efl_event_callback_del(sd->pan_obj, EFL_GFX_ENTITY_EVENT_RESIZE, + efl_event_callback_del(sd->pan_obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _efl_ui_scroller_pan_resized_cb, obj); efl_del(sd->pan_obj); sd->pan_obj = NULL; @@ -472,9 +636,9 @@ _efl_ui_scroller_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Scroller_Data *sd) if (sd->content) { - min = efl_gfx_size_hint_combined_min_get(sd->content); - max = efl_gfx_size_hint_max_get(sd->content); - efl_gfx_size_hint_weight_get(sd->content, &xw, &yw); + min = efl_gfx_hint_size_combined_min_get(sd->content); + max = efl_gfx_hint_size_max_get(sd->content); + efl_gfx_hint_weight_get(sd->content, &xw, &yw); } if (sd->smanager) @@ -507,19 +671,19 @@ _efl_ui_scroller_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Scroller_Data *sd) if (sd->match_content_w) size.w = vmw + min.w; if (sd->match_content_h) size.h = vmh + min.h; - max = efl_gfx_size_hint_max_get(obj); + max = efl_gfx_hint_size_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; - efl_gfx_size_hint_min_set(obj, size); + efl_gfx_hint_size_min_set(obj, size); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_scroller_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Scroller_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; efl_ui_mirrored_set(sd->smanager, efl_ui_mirrored_get(obj)); @@ -542,6 +706,28 @@ _efl_ui_scroller_efl_ui_scrollable_interactive_match_content_set(Eo *obj EINA_UN elm_layout_sizing_eval(obj); } +EOLIAN static Eina_Bool +_efl_ui_scroller_efl_ui_widget_focus_state_apply(Eo *obj, Efl_Ui_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; + return efl_ui_widget_focus_state_apply(efl_super(obj, MY_CLASS), current_state, configured_state, obj); +} + +EOLIAN static Efl_Ui_Focus_Manager* +_efl_ui_scroller_efl_ui_widget_focus_manager_focus_manager_create(Eo *obj, Efl_Ui_Scroller_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root) +{ + Efl_Ui_Focus_Manager *manager; + manager = efl_add(EFL_UI_FOCUS_MANAGER_ROOT_FOCUS_CLASS, obj, + efl_ui_focus_manager_root_set(efl_added, root)); + + return manager; +} + +/* Standard widget overrides */ + +ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_scroller, Efl_Ui_Scroller_Data) + /* Internal EO APIs and hidden overrides */ #define EFL_UI_SCROLLER_EXTRA_OPS \ diff --git a/src/lib/elementary/efl_ui_scroller.eo b/src/lib/elementary/efl_ui_scroller.eo index d7ad5d1a36..8f90d23462 100644 --- a/src/lib/elementary/efl_ui_scroller.eo +++ b/src/lib/elementary/efl_ui_scroller.eo @@ -1,6 +1,8 @@ -class Efl.Ui.Scroller extends Efl.Ui.Layout implements +class @beta Efl.Ui.Scroller extends Efl.Ui.Layout_Base implements Efl.Ui.Scrollable_Interactive, Efl.Ui.Scrollbar, + Efl.Ui.Focus.Manager_Sub, + Efl.Ui.Widget_Focus_Manager, Efl.Content { [[Efl ui scroller class]] @@ -8,8 +10,16 @@ class Efl.Ui.Scroller extends Efl.Ui.Layout implements Efl.Object.constructor; Efl.Object.finalize; Efl.Object.destructor; - Efl.Content.content { set; } + Efl.Content.content { get; set; } + Efl.Content.content_unset; Efl.Ui.Widget.theme_apply; + Efl.Ui.Widget.focus_state_apply; + Efl.Ui.Widget.widget_input_event_handler; + Efl.Ui.Widget_Focus_Manager.focus_manager_create; Efl.Ui.Scrollable_Interactive.match_content { set; } } + composite { + Efl.Ui.Scrollable_Interactive; + Efl.Ui.Scrollbar; + } } diff --git a/src/lib/elementary/efl_ui_selection.c b/src/lib/elementary/efl_ui_selection.c index 2fd60c4a38..675eb0cf99 100644 --- a/src/lib/elementary/efl_ui_selection.c +++ b/src/lib/elementary/efl_ui_selection.c @@ -2,7 +2,6 @@ # include "elementary_config.h" #endif -#define EFL_UI_SELECTION_MANAGER_BETA #include #include "elm_priv.h" diff --git a/src/lib/elementary/efl_ui_selection.eo b/src/lib/elementary/efl_ui_selection.eo index 89714ceb8b..20e42261d0 100644 --- a/src/lib/elementary/efl_ui_selection.eo +++ b/src/lib/elementary/efl_ui_selection.eo @@ -1,6 +1,6 @@ import efl_ui_selection_types; -mixin Efl.Ui.Selection { +mixin @beta Efl.Ui.Selection { [[Efl Ui Selection class]] data: null; methods { @@ -9,7 +9,7 @@ mixin Efl.Ui.Selection { params { @in type: Efl.Ui.Selection_Type; [[Selection Type]] @in format: Efl.Ui.Selection_Format; [[Selection Format]] - @in data: Eina.Slice; + @in data: Eina.Slice; [[Selection data]] @in seat: uint;[[Specified seat for multiple seats case.]] } return: future; [[Future for tracking when the selection is lost]] @@ -40,6 +40,6 @@ mixin Efl.Ui.Selection { } } events { - selection,changed: Efl.Ui.Selection_Changed; [[Called when display server's selection has changed]] + wm_selection,changed: Efl.Ui.Selection_Changed; [[Called when display server's selection has changed]] } } diff --git a/src/lib/elementary/efl_ui_selection_manager.c b/src/lib/elementary/efl_ui_selection_manager.c index d8064a4953..cbef9226af 100644 --- a/src/lib/elementary/efl_ui_selection_manager.c +++ b/src/lib/elementary/efl_ui_selection_manager.c @@ -880,7 +880,7 @@ _x11_fixes_selection_notify(void *data, int t EINA_UNUSED, void *event) _e->exists = e.exist; ecore_event_add(ELM_CNP_EVENT_SELECTION_CHANGED, _e, NULL, NULL); - efl_event_callback_call(sel->owner, EFL_UI_SELECTION_EVENT_SELECTION_CHANGED, &e); + efl_event_callback_call(sel->owner, EFL_UI_SELECTION_EVENT_WM_SELECTION_CHANGED, &e); return ECORE_CALLBACK_RENEW; } @@ -1142,15 +1142,20 @@ 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 (data_ret) + { + char *s; + + s = malloc(sel->data.len + 1); + if (!s) return EINA_FALSE; + memcpy(s, sel->data.mem, sel->data.len); + s[sel->data.len] = 0; + *data_ret = s; + } + if (size_ret) *size_ret = sel->data.len; return EINA_TRUE; } @@ -1205,7 +1210,7 @@ _x11_text_converter(char *target, void *data, int size EINA_UNUSED, void **data_ } else if (sel->format & EFL_UI_SELECTION_FORMAT_IMAGE) { - efl_file_get(sel->request_obj, (const char **)data_ret, NULL); + efl_file_simple_get(sel->request_obj, (const char **)data_ret, NULL); if (!*data_ret) *data_ret = strdup("No file"); else *data_ret = strdup(*data_ret); @@ -1340,7 +1345,7 @@ _x11_drag_mouse_up(void *data, int etype EINA_UNUSED, void *event) { 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, + efl_event_callback_del(win, EFL_UI_WIN_EVENT_WIN_ROTATION_CHANGED, _x11_win_rotation_changed_cb, seat_sel->drag_win); } } @@ -1496,7 +1501,7 @@ _x11_efl_sel_manager_drag_start(Eo *obj EINA_UNUSED, Efl_Ui_Selection_Manager_Da 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, + efl_event_callback_add(win, EFL_UI_WIN_EVENT_WIN_ROTATION_CHANGED, _x11_win_rotation_changed_cb, seat_sel->drag_win); } } @@ -2487,7 +2492,7 @@ _wl_text_converter(char *target, Sel_Manager_Selection *sel, void *data, int siz else if (format & EFL_UI_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); + efl_file_simple_get(sel->request_obj, (const char **)data_ret, NULL); if (!*data_ret) *data_ret = strdup("No file"); else *data_ret = strdup(*data_ret); @@ -2650,7 +2655,7 @@ _wl_selection_changed(void *data, int type EINA_UNUSED, void *event) _e->exists = e.exist; ecore_event_add(ELM_CNP_EVENT_SELECTION_CHANGED, _e, _wl_selection_changed_free, ev->display); - efl_event_callback_call(sel->request_obj, EFL_UI_SELECTION_EVENT_SELECTION_CHANGED, &e); + efl_event_callback_call(sel->request_obj, EFL_UI_SELECTION_EVENT_WM_SELECTION_CHANGED, &e); return ECORE_CALLBACK_RENEW; } @@ -4927,7 +4932,7 @@ _efl_ui_selection_manager_drag_cancel(Eo *obj EINA_UNUSED, Efl_Ui_Selection_Mana { 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, + efl_event_callback_del(win, EFL_UI_WIN_EVENT_WIN_ROTATION_CHANGED, _x11_win_rotation_changed_cb, seat_sel->drag_win); } } @@ -5179,7 +5184,11 @@ _efl_ui_selection_manager_efl_object_constructor(Eo *obj, Efl_Ui_Selection_Manag } if (init_x) { - ecore_x_init(NULL); + if (!ecore_x_init(NULL)) + { + ERR("Could not initialize Ecore_X"); + return NULL; + } } #endif #ifdef HAVE_ELEMENTARY_WL2 diff --git a/src/lib/elementary/efl_ui_selection_manager.eo b/src/lib/elementary/efl_ui_selection_manager.eo index 50b5d5b22c..e7df9cce77 100644 --- a/src/lib/elementary/efl_ui_selection_manager.eo +++ b/src/lib/elementary/efl_ui_selection_manager.eo @@ -1,6 +1,6 @@ import efl_ui_dnd_types; -class Efl.Ui.Selection_Manager extends Efl.Object { +class @beta Efl.Ui.Selection_Manager extends Efl.Object { methods { selection_set @beta { [[Set selection]] diff --git a/src/lib/elementary/efl_ui_selection_types.eot b/src/lib/elementary/efl_ui_selection_types.eot index cab30d8b69..98bbfbdc5a 100644 --- a/src/lib/elementary/efl_ui_selection_types.eot +++ b/src/lib/elementary/efl_ui_selection_types.eot @@ -1,4 +1,4 @@ -enum Efl.Ui.Selection_Type +enum @beta Efl.Ui.Selection_Type { [[Selection type]] primary, [[Primary text selection (highlighted or selected text)]] @@ -7,7 +7,7 @@ enum Efl.Ui.Selection_Type clipboard [[Clipboard selection (ctrl+C)]] } -enum Efl.Ui.Selection_Format +enum @beta Efl.Ui.Selection_Format { [[Selection format]] targets = -1, [[For matching every possible atom]] @@ -19,7 +19,7 @@ enum Efl.Ui.Selection_Format html = 0x10 [[Raw HTML-like data (eg. webkit)]] } -enum Efl.Ui.Selection_Action +enum @beta Efl.Ui.Selection_Action { [[Defines the kind of action associated with the drop data]] unknown, [[Action type is unknown]] @@ -32,7 +32,7 @@ enum Efl.Ui.Selection_Action description [[Describe the data]] } -struct Efl.Ui.Selection_Data +struct @beta Efl.Ui.Selection_Data { [[Structure holding the info about selected data]] pos: Eina.Position2D; [[Coordinates of the drop (DND operations only)]] @@ -42,7 +42,7 @@ struct Efl.Ui.Selection_Data item: Efl.Object; [[Item under the drag position. It is only available for container]] } -function Efl.Ui.Selection_Data_Ready { +function @beta Efl.Ui.Selection_Data_Ready { [[Function pointer for getting selection]] params { @in obj: Efl.Object; [[Object which requested for the selection]] @@ -50,7 +50,7 @@ function Efl.Ui.Selection_Data_Ready { } }; -struct Efl.Ui.Selection_Changed +struct @beta Efl.Ui.Selection_Changed { type: Efl.Ui.Selection_Type; [[Selection type]] seat: int; [[The seat on which the selection changed, or NULL for "default"]] diff --git a/src/lib/elementary/efl_ui_size_model.c b/src/lib/elementary/efl_ui_size_model.c new file mode 100644 index 0000000000..9b6154d6dd --- /dev/null +++ b/src/lib/elementary/efl_ui_size_model.c @@ -0,0 +1,48 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include "elm_priv.h" + +const char *_efl_model_property_itemw = "item.width"; +const char *_efl_model_property_itemh = "item.height"; +const char *_efl_model_property_selfw = "self.width"; +const char *_efl_model_property_selfh = "self.height"; +const char *_efl_model_property_totalw = "total.width"; +const char *_efl_model_property_totalh = "total.height"; + +static Eina_Iterator * +_efl_ui_size_model_properties_child(void) +{ + const char *properties[] = { + _efl_model_property_itemw, _efl_model_property_itemh, _efl_model_property_selfh, _efl_model_property_selfw + }; + return EINA_C_ARRAY_ITERATOR_NEW(properties); +} + +static Eina_Iterator * +_efl_ui_size_model_properties_root(void) +{ + const char *properties[] = { + _efl_model_property_itemw, _efl_model_property_itemh + }; + return EINA_C_ARRAY_ITERATOR_NEW(properties); +} + +static Eina_Iterator * +_efl_ui_size_model_efl_model_properties_get(const Eo *obj, void *pd EINA_UNUSED) +{ + Eina_Iterator *super; + Eina_Iterator *prop; + + super = efl_model_properties_get(efl_super(obj, EFL_UI_SIZE_MODEL_CLASS)); + if (efl_isa(efl_parent_get(obj), EFL_UI_SIZE_MODEL_CLASS)) + prop = _efl_ui_size_model_properties_child(); + else + prop = _efl_ui_size_model_properties_root(); + + return eina_multi_iterator_new(super, prop); +} + +#include "efl_ui_size_model.eo.c" diff --git a/src/lib/elementary/efl_ui_size_model.eo b/src/lib/elementary/efl_ui_size_model.eo new file mode 100644 index 0000000000..333347d478 --- /dev/null +++ b/src/lib/elementary/efl_ui_size_model.eo @@ -0,0 +1,19 @@ +class @beta Efl.Ui.Size_Model extends Efl.Composite_Model +{ + [[Class to be used to store object item size for List/Grid View. + + This model provide the following properties that can be retrived by + @Efl.Model.properties.get : + - "$self.width" and "$self.height" define the size of this object from the point of + view of the @Efl.Ui.View that use it. It only apply on children and not on the + top root object. + - "$item.width" and "$item.height" define all the children size and is available + only on @Efl.Ui.Size_Model that do have children. + - "$total.width" and "$total.height" define the accumulated size used by all the children. + Only vertical list accumulation logic is implemented at this point.]] + + data: null; + implements { + Efl.Model.properties { get; } + } +} diff --git a/src/lib/elementary/efl_ui_slider.c b/src/lib/elementary/efl_ui_slider.c index e4bb806174..6a5798d44b 100644 --- a/src/lib/elementary/efl_ui_slider.c +++ b/src/lib/elementary/efl_ui_slider.c @@ -302,17 +302,17 @@ _key_action_drag(Evas_Object *obj, const char *params) return EINA_TRUE; } -// _slider_efl_ui_widget_widget_event +// _slider_efl_ui_widget_widget_input_event_handler ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(slider, Efl_Ui_Slider_Data) EOLIAN static Eina_Bool -_efl_ui_slider_efl_ui_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_input_event_handler(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_efl_ui_widget_widget_event(obj, sd, eo_event, src)) + if (!_slider_efl_ui_widget_widget_input_event_handler(obj, sd, eo_event, src)) return EINA_FALSE; } else if (eo_event->desc == EFL_EVENT_KEY_UP) @@ -423,11 +423,11 @@ _efl_ui_slider_theme_group_get(Evas_Object *obj, Efl_Ui_Slider_Data *sd) return eina_strbuf_release(new_group); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_slider_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Slider_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); char *group; group = _efl_ui_slider_theme_group_get(obj, sd); @@ -438,7 +438,7 @@ _efl_ui_slider_efl_ui_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_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; if (elm_widget_is_legacy(obj)) { @@ -472,8 +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); - efl_gfx_size_hint_restricted_min_set(obj, EINA_SIZE2D(minw, minh)); - efl_gfx_size_hint_max_set(obj, EINA_SIZE2D(-1, -1)); + efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh)); + efl_gfx_hint_size_max_set(obj, EINA_SIZE2D(-1, -1)); } static void @@ -595,6 +595,24 @@ _spacer_up_cb(void *data, } } +static void +_mouse_in_cb(void *data EINA_UNUSED, + Evas *e EINA_UNUSED, + Evas_Object *obj, + void *event_info EINA_UNUSED) +{ + efl_ui_widget_scroll_hold_push(obj); +} + +static void +_mouse_out_cb(void *data EINA_UNUSED, + Evas *e EINA_UNUSED, + Evas_Object *obj, + void *event_info EINA_UNUSED) +{ + efl_ui_widget_scroll_hold_pop(obj); +} + static char * _access_info_cb(void *data EINA_UNUSED, Evas_Object *obj) { @@ -637,13 +655,12 @@ _efl_ui_slider_efl_object_constructor(Eo *obj, Efl_Ui_Slider_Data *priv) if (!elm_widget_theme_klass_get(obj)) elm_widget_theme_klass_set(obj, "slider"); - elm_widget_sub_object_parent_add(obj); 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))) + if (elm_widget_theme_object_set(obj, wd->resize_obj, + elm_widget_theme_klass_get(obj), + group, + elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); free(group); @@ -652,11 +669,11 @@ _efl_ui_slider_efl_object_constructor(Eo *obj, Efl_Ui_Slider_Data *priv) 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); + efl_layout_signal_callback_add(obj, "drag", "*", obj, _drag, NULL); + efl_layout_signal_callback_add(obj, "drag,start", "*", obj, _drag_start, NULL); + efl_layout_signal_callback_add(obj, "drag,stop", "*", obj, _drag_stop, NULL); + efl_layout_signal_callback_add(obj, "drag,step", "*", obj, _drag_step, NULL); + efl_layout_signal_callback_add(obj, "drag,page", "*", obj, _drag_stop, NULL); priv->spacer = efl_add(EFL_CANVAS_RECTANGLE_CLASS, obj, efl_gfx_color_set(efl_added, 0, 0, 0, 0), @@ -673,6 +690,11 @@ _efl_ui_slider_efl_object_constructor(Eo *obj, Efl_Ui_Slider_Data *priv) (priv->spacer, EVAS_CALLBACK_MOUSE_MOVE, _spacer_move_cb, obj); evas_object_event_callback_add (priv->spacer, EVAS_CALLBACK_MOUSE_UP, _spacer_up_cb, obj); + evas_object_event_callback_add + (obj, EVAS_CALLBACK_MOUSE_IN, _mouse_in_cb, obj); + evas_object_event_callback_add + (obj, EVAS_CALLBACK_MOUSE_OUT, _mouse_out_cb, obj); + efl_ui_widget_focus_allow_set(obj, EINA_TRUE); @@ -713,7 +735,7 @@ _efl_ui_slider_efl_ui_direction_direction_get(const Eo *obj EINA_UNUSED, Efl_Ui_ } EOLIAN static void -_efl_ui_slider_efl_ui_range_range_min_max_set(Eo *obj, Efl_Ui_Slider_Data *sd, double min, double max) +_efl_ui_slider_efl_ui_range_display_range_min_max_set(Eo *obj, Efl_Ui_Slider_Data *sd, double min, double max) { if ((sd->val_min == min) && (sd->val_max == max)) return; sd->val_min = min; @@ -725,14 +747,14 @@ _efl_ui_slider_efl_ui_range_range_min_max_set(Eo *obj, Efl_Ui_Slider_Data *sd, d } EOLIAN static void -_efl_ui_slider_efl_ui_range_range_min_max_get(const Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double *min, double *max) +_efl_ui_slider_efl_ui_range_display_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; } EOLIAN static void -_efl_ui_slider_efl_ui_range_range_value_set(Eo *obj, Efl_Ui_Slider_Data *sd, double val) +_efl_ui_slider_efl_ui_range_display_range_value_set(Eo *obj, Efl_Ui_Slider_Data *sd, double val) { if (sd->val == val) return; sd->val = val; @@ -744,19 +766,19 @@ _efl_ui_slider_efl_ui_range_range_value_set(Eo *obj, Efl_Ui_Slider_Data *sd, dou } EOLIAN static double -_efl_ui_slider_efl_ui_range_range_value_get(const Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd) +_efl_ui_slider_efl_ui_range_display_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) +_efl_ui_slider_efl_ui_range_interactive_range_step_get(const Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd) { return sd->step; } EOLIAN static void -_efl_ui_slider_efl_ui_range_range_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double step) +_efl_ui_slider_efl_ui_range_interactive_range_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double step) { if (sd->step == step) return; diff --git a/src/lib/elementary/efl_ui_slider.eo b/src/lib/elementary/efl_ui_slider.eo index 43bb166f62..9e8952afe3 100644 --- a/src/lib/elementary/efl_ui_slider.eo +++ b/src/lib/elementary/efl_ui_slider.eo @@ -1,20 +1,18 @@ -class Efl.Ui.Slider extends Efl.Ui.Layout implements Efl.Ui.Range, Efl.Ui.Direction, +class @beta Efl.Ui.Slider extends Efl.Ui.Layout_Base implements Efl.Ui.Range_Interactive, Efl.Ui.Direction, Efl.Access.Value, - Efl.Access.Widget.Action, - Efl.Content + Efl.Access.Widget.Action { [[Elementary slider class]] - legacy_prefix: null; implements { Efl.Object.constructor; 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.Widget.widget_input_event_handler; + Efl.Ui.Range_Display.range_value { get; set; } + Efl.Ui.Range_Display.range_min_max {get; set; } + Efl.Ui.Range_Interactive.range_step { get; set; } Efl.Ui.Direction.direction { get; set; } Efl.Access.Value.value_and_text { get; set; } Efl.Access.Value.range { get; } diff --git a/src/lib/elementary/efl_ui_slider_interval.eo b/src/lib/elementary/efl_ui_slider_interval.eo index 0a833893a5..fcfc1b73bd 100644 --- a/src/lib/elementary/efl_ui_slider_interval.eo +++ b/src/lib/elementary/efl_ui_slider_interval.eo @@ -1,23 +1,16 @@ -class Efl.Ui.Slider_Interval extends Efl.Ui.Slider +class @beta Efl.Ui.Slider_Interval extends Efl.Ui.Slider { [[An interval slider. This is a slider with two indicators. - - @since 1.21 ]] - legacy_prefix: null; methods { @property interval_value { [[Sets up position of two indicators at start and end position. - - @since 1.21 ]] get { - legacy: null; } set { - legacy: null; } values { from: double;[[interval minimum value]] diff --git a/src/lib/elementary/efl_ui_spin.c b/src/lib/elementary/efl_ui_spin.c index 151fa8810e..f446bab9f3 100644 --- a/src/lib/elementary/efl_ui_spin.c +++ b/src/lib/elementary/efl_ui_spin.c @@ -168,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_efl_ui_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_input_event_handler(Eo *obj, Efl_Ui_Spin_Data *sd, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED) { Eo *ev = eo_event->info; @@ -239,16 +239,14 @@ _efl_ui_spin_efl_object_constructor(Eo *obj, Efl_Ui_Spin_Data *sd) elm_widget_theme_klass_set(obj, "spin"); obj = efl_constructor(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); - 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), - elm_widget_theme_element_get(obj), - elm_widget_theme_style_get(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)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); _label_write(obj); @@ -310,7 +308,7 @@ _efl_ui_spin_efl_ui_format_format_cb_set(Eo *obj, Efl_Ui_Spin_Data *sd, void *fu } EOLIAN static void -_efl_ui_spin_efl_ui_range_range_min_max_set(Eo *obj, Efl_Ui_Spin_Data *sd, double min, double max) +_efl_ui_spin_efl_ui_range_display_range_min_max_set(Eo *obj, Efl_Ui_Spin_Data *sd, double min, double max) { if (max < min) { @@ -331,14 +329,14 @@ _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(const Eo *obj EINA_UNUSED, Efl_Ui_Spin_Data *sd, double *min, double *max) +_efl_ui_spin_efl_ui_range_display_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; } EOLIAN static void -_efl_ui_spin_efl_ui_range_range_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Spin_Data *sd, double step) +_efl_ui_spin_efl_ui_range_interactive_range_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Spin_Data *sd, double step) { if (step <= 0) { @@ -350,13 +348,13 @@ _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(const Eo *obj EINA_UNUSED, Efl_Ui_Spin_Data *sd) +_efl_ui_spin_efl_ui_range_interactive_range_step_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spin_Data *sd) { return sd->step; } EOLIAN static void -_efl_ui_spin_efl_ui_range_range_value_set(Eo *obj, Efl_Ui_Spin_Data *sd, double val) +_efl_ui_spin_efl_ui_range_display_range_value_set(Eo *obj, Efl_Ui_Spin_Data *sd, double val) { if (val < sd->val_min) val = sd->val_min; @@ -378,7 +376,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(const Eo *obj EINA_UNUSED, Efl_Ui_Spin_Data *sd) +_efl_ui_spin_efl_ui_range_display_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 8ec81df6f8..e523ecbd3b 100644 --- a/src/lib/elementary/efl_ui_spin.eo +++ b/src/lib/elementary/efl_ui_spin.eo @@ -1,19 +1,17 @@ -struct Efl.Ui.Spin_Special_Value +struct @beta Efl.Ui.Spin_Special_Value { [[Special value]] value: double; [[Target value]] label: string; [[String to replace]] } -class Efl.Ui.Spin extends Efl.Ui.Layout implements Efl.Ui.Range, Efl.Ui.Format, +class @beta Efl.Ui.Spin extends Efl.Ui.Layout_Base implements Efl.Ui.Range_Interactive, Efl.Ui.Format, Efl.Access.Value, Efl.Access.Widget.Action { [[A Spin. This is a widget which allows the user to increase or decrease numeric values using user interactions. It's a basic type of widget for choosing and displaying values. - - @since 1.21 ]] methods { @property special_value { @@ -36,10 +34,10 @@ class Efl.Ui.Spin extends Efl.Ui.Layout implements Efl.Ui.Range, Efl.Ui.Format, implements { Efl.Object.constructor; Efl.Object.destructor; - 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.Widget.widget_input_event_handler; + Efl.Ui.Range_Display.range_min_max { get; set; } + Efl.Ui.Range_Interactive.range_step { get; set; } + Efl.Ui.Range_Display.range_value { get; set; } Efl.Ui.Format.format_cb { set; } } events { diff --git a/src/lib/elementary/efl_ui_spin_button.c b/src/lib/elementary/efl_ui_spin_button.c index fbe36462e3..4941b41bde 100644 --- a/src/lib/elementary/efl_ui_spin_button.c +++ b/src/lib/elementary/efl_ui_spin_button.c @@ -12,7 +12,7 @@ #include "elm_priv.h" #include "efl_ui_spin_button_private.h" #include "efl_ui_spin_private.h" -#include "elm_entry.eo.h" +#include "elm_entry_eo.h" #define MY_CLASS EFL_UI_SPIN_BUTTON_CLASS @@ -557,7 +557,7 @@ _key_action_toggle(Evas_Object *obj, const char *params EINA_UNUSED) } EOLIAN static Eina_Bool -_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) +_efl_ui_spin_button_efl_ui_widget_widget_input_event_handler(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; @@ -788,10 +788,10 @@ _efl_ui_spin_button_theme_group_get(Evas_Object *obj, Efl_Ui_Spin_Button_Data *s } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_spin_button_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; char *group; group = _efl_ui_spin_button_theme_group_get(obj, sd); @@ -802,7 +802,7 @@ _efl_ui_spin_button_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Spin_Button_Data * } int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; if (sd->ent) elm_widget_element_update(obj, sd->ent, PART_NAME_ENTRY); @@ -821,7 +821,7 @@ _efl_ui_spin_button_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Spin_Button_Data * _label_write(obj); elm_layout_sizing_eval(obj); - return EFL_UI_THEME_APPLY_RESULT_SUCCESS; + return EFL_UI_THEME_APPLY_ERROR_NONE; } EOLIAN static Eo * @@ -830,18 +830,18 @@ _efl_ui_spin_button_efl_object_constructor(Eo *obj, Efl_Ui_Spin_Button_Data *sd) char *group; obj = efl_constructor(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); elm_widget_theme_klass_set(obj, "spin_button"); ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); group = _efl_ui_spin_button_theme_group_get(obj, sd); - if (!elm_widget_theme_object_set(obj, wd->resize_obj, - elm_widget_theme_klass_get(obj), - group, - elm_widget_theme_style_get(obj))) + if (elm_widget_theme_object_set(obj, wd->resize_obj, + elm_widget_theme_klass_get(obj), + group, + elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); + free(group); sd->first_interval = 0.85; @@ -901,7 +901,7 @@ _efl_ui_spin_button_efl_ui_direction_direction_get(const Eo *obj EINA_UNUSED, Ef } EOLIAN static void -_efl_ui_spin_button_efl_ui_range_range_value_set(Eo *obj, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED, double val) +_efl_ui_spin_button_efl_ui_range_display_range_value_set(Eo *obj, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED, double val) { efl_ui_range_value_set(efl_super(obj, MY_CLASS), val); diff --git a/src/lib/elementary/efl_ui_spin_button.eo b/src/lib/elementary/efl_ui_spin_button.eo index cd55741ec8..fd6d360011 100644 --- a/src/lib/elementary/efl_ui_spin_button.eo +++ b/src/lib/elementary/efl_ui_spin_button.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Spin_Button extends Efl.Ui.Spin implements Efl.Ui.Focus.Composition, Efl.Ui.Direction, +class @beta Efl.Ui.Spin_Button extends Efl.Ui.Spin implements Efl.Ui.Focus.Composition, Efl.Ui.Direction, Efl.Access.Widget.Action { [[A Button Spin. @@ -6,8 +6,6 @@ class Efl.Ui.Spin_Button extends Efl.Ui.Spin implements Efl.Ui.Focus.Composition This is a widget which allows the user to increase or decrease numeric values using the arrow buttons or to edit values directly by clicking over them and inputting new ones. - - @since 1.21 ]] methods { @property circulate { @@ -65,9 +63,9 @@ class Efl.Ui.Spin_Button extends Efl.Ui.Spin implements Efl.Ui.Focus.Composition implements { Efl.Object.constructor; Efl.Ui.Widget.theme_apply; - Efl.Ui.Widget.widget_event; + Efl.Ui.Widget.widget_input_event_handler; Efl.Ui.Focus.Object.on_focus_update; - Efl.Ui.Range.range_value { set; } + Efl.Ui.Range_Display.range_value { set; } Efl.Ui.Direction.direction { get; set; } Efl.Access.Object.i18n_name { get; } Efl.Access.Value.value_and_text { get; set; } diff --git a/src/lib/elementary/efl_ui_stack.c b/src/lib/elementary/efl_ui_stack.c index 921c4ac336..e7edcdaf57 100644 --- a/src/lib/elementary/efl_ui_stack.c +++ b/src/lib/elementary/efl_ui_stack.c @@ -13,6 +13,53 @@ static Efl_Canvas_Animation *show_anim = NULL; static Efl_Canvas_Animation *hide_anim = NULL; +static void +_announce_hiding(Efl_Ui_Stack *obj, Evas_Object *content) +{ + //Deactivated Event + Efl_Ui_Stack_Event_Deactivated deactivated_info; + deactivated_info.content = 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 = content; + efl_event_callback_call(obj, + EFL_UI_STACK_EVENT_UNLOADED, + &unloaded_info); +} + +static void +_show_content_without_anim(Efl_Ui_Stack *obj, Evas_Object *content) +{ + //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); + + 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); + + //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); +} + +static void +_hide_content_without_anim(Efl_Ui_Stack *obj EINA_UNUSED, Evas_Object *content) +{ + efl_gfx_entity_visible_set(content, EINA_FALSE); +} + static void _content_del_cb(void *data, const Efl_Event *event EINA_UNUSED) { @@ -21,23 +68,11 @@ _content_del_cb(void *data, const Efl_Event *event EINA_UNUSED) //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); + _announce_hiding(NULL, cd->content); } static Content_Data * -_content_data_new(Eo *obj, Eo *content) +_content_data_new(Eo *obj EINA_UNUSED, Eo *content) { Content_Data *cd = calloc(1, sizeof(Content_Data)); if (!cd) @@ -46,7 +81,6 @@ _content_data_new(Eo *obj, Eo *content) return NULL; } - cd->stack = obj; cd->content = content; efl_event_callback_add(cd->content, EFL_EVENT_DEL, _content_del_cb, cd); @@ -68,58 +102,93 @@ _content_data_del(Content_Data *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_freeze(efl_animation_player_target_get(event->object)); +} - efl_event_callback_del(event->object, EFL_CANVAS_OBJECT_EVENT_ANIM_STARTED, - _anim_started_cb, NULL); +static Evas_Object* +_end_anim(Transit_Data *td) +{ + Efl_Canvas_Object *content = td->cd->content; + + efl_event_thaw(content); + td->cd->on_pushing = EINA_FALSE; + td->cd->on_popping = EINA_FALSE; + free(td); + + return content; } static void -_anim_ended_cb(void *data, const Efl_Event *event) +_hide_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED) { - Transit_Data *td = data; - Efl_Canvas_Object_Animation_Event *anim_event = event->info; + Efl_Ui_Stack_Data *pd = efl_data_scope_safe_get(data, EFL_UI_STACK_CLASS); + Efl_Canvas_Object *content; - //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); + EINA_SAFETY_ON_NULL_RETURN(pd); - efl_canvas_object_freeze_events_set(event->object, - td->freeze_events); + content = _end_anim(pd->hide_td); + pd->hide_td = NULL; + efl_gfx_entity_visible_set(content, EINA_FALSE); + _announce_hiding(data, content); +} - td->cd->on_pushing = EINA_FALSE; - td->cd->on_popping = EINA_FALSE; +static void +_show_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED) +{ + Efl_Ui_Stack_Data *pd = efl_data_scope_safe_get(data, EFL_UI_STACK_CLASS); + Efl_Canvas_Object *content; - 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); + EINA_SAFETY_ON_NULL_RETURN(pd); - //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); - } + content = _end_anim(pd->show_td); + pd->show_td = NULL; + //Activated Event + Efl_Ui_Stack_Event_Activated activated_info; + activated_info.content = content; + efl_event_callback_call(data, + EFL_UI_STACK_EVENT_ACTIVATED, + &activated_info); +} - efl_event_callback_del(event->object, EFL_CANVAS_OBJECT_EVENT_ANIM_ENDED, - _anim_ended_cb, data); - free(data); +static void +_show_content_with_anim(Efl_Ui_Stack *obj, Efl_Ui_Stack_Data *pd, Content_Data *cd) +{ + //immidiatly stop hiding animation + efl_player_stop(pd->show); + if (pd->show_td) + EINA_SAFETY_ERROR("td is set but it should not"); + + //attach new content target + efl_animation_player_target_set(pd->show, cd->content); + + Transit_Data *td = calloc(1, sizeof(Transit_Data)); + td->cd = cd; + pd->show_td = 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, cd->content); + efl_player_start(pd->show); +} + +static void +_hide_content_with_anim(Efl_Ui_Stack *obj EINA_UNUSED, Efl_Ui_Stack_Data *pd, Content_Data *cd) +{ + //immidiatly stop hiding animation + efl_player_stop(pd->hide); + if (pd->hide_td) + EINA_SAFETY_ERROR("td is set but it should not"); + + //attach new content target + efl_animation_player_target_set(pd->hide, cd->content); + + Transit_Data *td = calloc(1, sizeof(Transit_Data)); + td->cd = cd; + pd->hide_td = td; + + efl_player_start(pd->hide); } EOLIAN static void @@ -167,121 +236,38 @@ _efl_ui_stack_push(Eo *obj, Efl_Ui_Stack_Data *pd, Eo *content) { 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); + _hide_content_without_anim(obj, top_content); + _announce_hiding(obj, top_content); } 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); + _hide_content_with_anim(obj, pd, top_cd); } } /* 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); - } + cd->on_pushing = EINA_TRUE; + _hide_content_without_anim(obj, content); /* 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); - } + _show_content_with_anim(obj, pd, cd); } static void -_pop_content_hide_cb(void *data, const Efl_Event *event EINA_UNUSED) +_pop_content_hide_cb(void *data, const Efl_Event *event) { Content_Data *cd = data; + Eina_Bool *visible = event->info; + /* object is being shown */ + if (*visible) return; cd->popped_hidden = EINA_TRUE; @@ -306,72 +292,22 @@ _efl_ui_stack_pop(Eo *obj, Efl_Ui_Stack_Data *pd) { 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); + _hide_content_without_anim(obj, top_content); + _announce_hiding(obj, top_content); } 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, + efl_event_callback_add(top_content, EFL_GFX_ENTITY_EVENT_VISIBILITY_CHANGED, _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); + _hide_content_with_anim(obj, pd, top_cd); } } @@ -381,13 +317,6 @@ _efl_ui_stack_pop(Eo *obj, Efl_Ui_Stack_Data *pd) Content_Data); 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 @@ -398,36 +327,7 @@ _efl_ui_stack_pop(Eo *obj, Efl_Ui_Stack_Data *pd) /* 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); - } + _show_content_with_anim(obj, pd, prev_cd); } return NULL; @@ -486,72 +386,14 @@ _efl_ui_stack_insert_after(Eo *obj, Efl_Ui_Stack_Data *pd, 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); - + _hide_content_without_anim(obj, base_cd->content); + _announce_hiding(obj, base_cd->content); /* 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); + _show_content_without_anim(obj, content); } } @@ -607,72 +449,15 @@ _efl_ui_stack_insert_at(Eo *obj, Efl_Ui_Stack_Data *pd, 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); - + _hide_content_without_anim(obj, base_cd->content); + _announce_hiding(obj, base_cd->content); /* 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); + _show_content_without_anim(obj, content); } } @@ -710,17 +495,7 @@ _efl_ui_stack_remove(Eo *obj, Efl_Ui_Stack_Data *pd, Eo *content) 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); + _announce_hiding(obj, cd->content); _content_data_del(cd); if (remove_top) @@ -729,42 +504,10 @@ _efl_ui_stack_remove(Eo *obj, Efl_Ui_Stack_Data *pd, Eo *content) { Content_Data *new_top_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last, Content_Data); - //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); + _show_content_without_anim(obj, new_top_cd->content); } } } @@ -802,17 +545,7 @@ _efl_ui_stack_remove_at(Eo *obj, Efl_Ui_Stack_Data *pd, 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); + _announce_hiding(NULL, cd->content); _content_data_del(cd); //FIXME: Apply transition here. @@ -822,42 +555,9 @@ _efl_ui_stack_remove_at(Eo *obj, Efl_Ui_Stack_Data *pd, { Content_Data *new_top_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last, Content_Data); - //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); + _show_content_without_anim(obj, new_top_cd->content); } } } @@ -936,24 +636,45 @@ _efl_ui_stack_top(Eo *obj EINA_UNUSED, Efl_Ui_Stack_Data *pd) return cd->content; } +EFL_CALLBACKS_ARRAY_DEFINE(_anim_show_event_cb, + {EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb}, + {EFL_ANIMATION_PLAYER_EVENT_ENDED, _show_anim_ended_cb}, +) + +EFL_CALLBACKS_ARRAY_DEFINE(_anim_hide_event_cb, + {EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb}, + {EFL_ANIMATION_PLAYER_EVENT_ENDED, _hide_anim_ended_cb}, +) + EOLIAN static Eo * _efl_ui_stack_efl_object_constructor(Eo *obj, Efl_Ui_Stack_Data *pd EINA_UNUSED) { + Efl_Canvas_Animation *sh, *hi; 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); + sh = 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); + pd->show = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, obj); + efl_animation_player_animation_set(pd->show, sh); + efl_player_play_set(pd->show, EINA_FALSE); + efl_event_callback_array_add(pd->show, _anim_show_event_cb(), obj); + //Default Hide Animation - hide_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, obj); + hi = 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); + pd->hide = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, obj); + efl_animation_player_animation_set(pd->hide, hi); + efl_player_play_set(pd->hide, EINA_FALSE); + efl_event_callback_array_add(pd->hide, _anim_hide_event_cb(), obj); + return obj; } diff --git a/src/lib/elementary/efl_ui_stack.eo b/src/lib/elementary/efl_ui_stack.eo index 57c8d70424..8fbc2cf2ed 100644 --- a/src/lib/elementary/efl_ui_stack.eo +++ b/src/lib/elementary/efl_ui_stack.eo @@ -1,24 +1,24 @@ -struct Efl.Ui.Stack_Event_Loaded { +struct @beta Efl.Ui.Stack_Event_Loaded { [[Information of loaded event.]] content: Efl.Canvas.Object; [[Loaded content.]] } -struct Efl.Ui.Stack_Event_Unloaded { +struct @beta Efl.Ui.Stack_Event_Unloaded { [[Information of unloaded event.]] content: Efl.Canvas.Object; [[Unloaded content.]] } -struct Efl.Ui.Stack_Event_Activated { +struct @beta Efl.Ui.Stack_Event_Activated { [[Information of activated event.]] content: Efl.Canvas.Object; [[Activated content.]] } -struct Efl.Ui.Stack_Event_Deactivated { +struct @beta Efl.Ui.Stack_Event_Deactivated { [[Information of deactivated event.]] content: Efl.Canvas.Object; [[Deactivated content.]] } -class Efl.Ui.Stack extends Efl.Ui.Layout +class @beta Efl.Ui.Stack extends Efl.Ui.Layout_Base { [[Stack widget. diff --git a/src/lib/elementary/efl_ui_stack_private.h b/src/lib/elementary/efl_ui_stack_private.h index dc67451d58..f3d3b7a7c4 100644 --- a/src/lib/elementary/efl_ui_stack_private.h +++ b/src/lib/elementary/efl_ui_stack_private.h @@ -1,18 +1,12 @@ #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; @@ -23,8 +17,15 @@ typedef struct _Transit_Data Transit_Data; struct _Transit_Data { Content_Data *cd; - Eina_Bool orig_anim; - Eina_Bool freeze_events; +}; + +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 */ + Efl_Canvas_Animation_Player *hide, *show; + Transit_Data *show_td, *hide_td; + }; #endif diff --git a/src/lib/elementary/efl_ui_model_state.eo b/src/lib/elementary/efl_ui_state_model.eo similarity index 83% rename from src/lib/elementary/efl_ui_model_state.eo rename to src/lib/elementary/efl_ui_state_model.eo index eb49aba370..7ac2730086 100644 --- a/src/lib/elementary/efl_ui_model_state.eo +++ b/src/lib/elementary/efl_ui_state_model.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Model_State extends Efl.Model_Composite_Boolean +class @beta Efl.Ui.State_Model extends Efl.Boolean_Model { [[Efl model handling visibility, enable and selected state]] implements { diff --git a/src/lib/elementary/efl_ui_tab_bar.c b/src/lib/elementary/efl_ui_tab_bar.c index 7d9f5c29dc..0129121d7a 100644 --- a/src/lib/elementary/efl_ui_tab_bar.c +++ b/src/lib/elementary/efl_ui_tab_bar.c @@ -2,7 +2,6 @@ # include "elementary_config.h" #endif -#define EFL_UI_TAB_BAR_BETA #include #include "elm_priv.h" @@ -87,7 +86,7 @@ _tab_icon_set_cb(void *data, Tab_Info *ti = data; _tab_icon_update(ti); - efl_layout_signal_callback_del(obj, emission, source, _tab_icon_set_cb, ti); + efl_layout_signal_callback_del(obj, emission, source, ti, _tab_icon_set_cb, NULL); efl_layout_signal_emit(ti->tab, "efl,state,icon,reset", "efl"); } @@ -129,7 +128,7 @@ _tab_icon_obj_set(Eo *obj, (efl_part(ti->tab, "efl.icon_new"), ti->icon); efl_layout_signal_emit(ti->tab, "efl,state,icon_new,set", "efl"); efl_layout_signal_callback_add - (ti->tab, "efl,state,icon_set,done", "efl", _tab_icon_set_cb, ti); + (ti->tab, "efl,state,icon_set,done", "efl", ti, _tab_icon_set_cb, NULL); } else _tab_icon_update(ti); @@ -188,9 +187,9 @@ _tab_select(Efl_Ui_Tab_Bar_Data *sd, Tab_Info *ti) 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; + + efl_event_callback_call(tp, EFL_UI_EVENT_ITEM_SELECTED, NULL); } } @@ -214,14 +213,19 @@ _tab_add(Eo *obj, const char *label, const char *icon) { Eo *tab, *icon_obj; Tab_Info *ti; - Efl_Ui_Theme_Apply_Result theme_apply; + Eina_Error theme_apply; ti = calloc(1, sizeof(*ti)); ti->tab = NULL; ti->label = eina_stringshare_add(label); - tab = efl_add(EFL_UI_LAYOUT_CLASS, obj); + tab = efl_add(EFL_UI_LAYOUT_CLASS, obj, + efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL)); + /* FIXME: This is for tab sizing issue. + * Recently, the size_hint_fill API has been added, + * but currently tab_bar is not available because it uses evas_object_box. + * This should be removed after the box in tab_bar has been replaced by efl.ui.box */ icon_obj = elm_icon_add(tab); @@ -239,11 +243,11 @@ _tab_add(Eo *obj, const char *label, const char *icon) theme_apply = elm_widget_element_update(obj, tab, PART_NAME_TAB); - if (theme_apply == EFL_UI_THEME_APPLY_RESULT_FAIL) + if (theme_apply == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); efl_layout_signal_callback_add - (tab, "efl,action,click", "efl", _action_click_cb, ti); + (tab, "efl,action,click", "efl", ti,_action_click_cb, NULL); if (ti->icon) efl_content_set(efl_part(tab, "efl.icon"), ti->icon); @@ -366,14 +370,12 @@ _efl_ui_tab_bar_efl_object_constructor(Eo *obj, Efl_Ui_Tab_Bar_Data *sd) 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))) + 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)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) 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); diff --git a/src/lib/elementary/efl_ui_tab_bar.eo b/src/lib/elementary/efl_ui_tab_bar.eo index 2fbdd4dcd4..e83401b12a 100644 --- a/src/lib/elementary/efl_ui_tab_bar.eo +++ b/src/lib/elementary/efl_ui_tab_bar.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Tab_Bar extends Efl.Ui.Layout implements Efl.Ui.Clickable +class @beta Efl.Ui.Tab_Bar extends Efl.Ui.Layout_Base implements Efl.Ui.Clickable { [[Tab Bar class]] methods { @@ -38,6 +38,6 @@ class Efl.Ui.Tab_Bar extends Efl.Ui.Layout implements Efl.Ui.Clickable implements { Efl.Object.constructor; Efl.Object.destructor; - Efl.Ui.Widget.widget_event; + Efl.Ui.Widget.widget_input_event_handler; } } diff --git a/src/lib/elementary/efl_ui_tab_page.c b/src/lib/elementary/efl_ui_tab_page.c index 361ccd6371..a0bd26ef70 100644 --- a/src/lib/elementary/efl_ui_tab_page.c +++ b/src/lib/elementary/efl_ui_tab_page.c @@ -26,6 +26,13 @@ _efl_ui_tab_page_efl_content_content_set(Eo *obj, Efl_Ui_Tab_Page_Data *sd, Eo * return EINA_TRUE; } +EOLIAN static Efl_Gfx_Entity* +_efl_ui_tab_page_efl_content_content_unset(Eo *obj, Efl_Ui_Tab_Page_Data *pd EINA_UNUSED) +{ + return efl_content_unset(efl_part(obj, "efl.content")); +} + + EOLIAN static Eo * _efl_ui_tab_page_efl_content_content_get(const Eo *obj EINA_UNUSED, Efl_Ui_Tab_Page_Data *sd) { @@ -42,14 +49,12 @@ _efl_ui_tab_page_efl_object_constructor(Eo *obj, Efl_Ui_Tab_Page_Data *sd) 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))) + 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)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); - elm_widget_sub_object_parent_add(obj); - efl_ui_widget_focus_allow_set(obj, EINA_TRUE); sd->content = NULL; diff --git a/src/lib/elementary/efl_ui_tab_page.eo b/src/lib/elementary/efl_ui_tab_page.eo index e5468dd027..818277cfad 100644 --- a/src/lib/elementary/efl_ui_tab_page.eo +++ b/src/lib/elementary/efl_ui_tab_page.eo @@ -1,14 +1,14 @@ -enum Efl.Ui.Tab_Page_Tab_Changed { +enum @beta Efl.Ui.Tab_Page_Tab_Changed { label = 0, [[Label changed]] icon [[Icon changed]] } -struct Efl.Ui.Tab_Page_Tab_Changed_Event { +struct @beta Efl.Ui.Tab_Page_Tab_Changed_Event { [[Information of changed event]] changed_info: Efl.Ui.Tab_Page_Tab_Changed; } -class Efl.Ui.Tab_Page extends Efl.Ui.Layout implements Efl.Content +class @beta Efl.Ui.Tab_Page extends Efl.Ui.Layout_Base implements Efl.Content { [[Tab Page class]] methods { @@ -20,6 +20,7 @@ class Efl.Ui.Tab_Page extends Efl.Ui.Layout implements Efl.Content Efl.Object.constructor; Efl.Object.destructor; Efl.Content.content { get; set; } + Efl.Content.content_unset; Efl.Part.part_get; } events { diff --git a/src/lib/elementary/efl_ui_tab_page_part_tab.eo b/src/lib/elementary/efl_ui_tab_page_part_tab.eo index 03626fcb04..735437fe76 100644 --- a/src/lib/elementary/efl_ui_tab_page_part_tab.eo +++ b/src/lib/elementary/efl_ui_tab_page_part_tab.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Tab_Page_Part_Tab extends Efl.Ui.Layout_Part implements Efl.Text +class @beta Efl.Ui.Tab_Page_Part_Tab extends Efl.Ui.Layout_Part implements Efl.Text { [[Tab_Page internal part class]] data: null; diff --git a/src/lib/elementary/efl_ui_tab_pager.c b/src/lib/elementary/efl_ui_tab_pager.c index 5fbae19c3c..2b43aa8939 100644 --- a/src/lib/elementary/efl_ui_tab_pager.c +++ b/src/lib/elementary/efl_ui_tab_pager.c @@ -2,7 +2,6 @@ # include "elementary_config.h" #endif -#define EFL_UI_TAB_BAR_BETA #include #include "elm_priv.h" @@ -27,7 +26,7 @@ _select(Eo *obj, int index) static void _tab_select_cb(void *data, const Efl_Event *event) { - int index = (intptr_t)event->info; + int index = efl_ui_tab_bar_current_tab_get(event->object); _select(data, index); } @@ -61,7 +60,7 @@ _efl_ui_tab_pager_tab_bar_set(Eo *obj, Efl_Ui_Tab_Pager_Data *sd, Efl_Canvas_Obj { if (sd->tab_bar != NULL) { - efl_event_callback_del(sd->tab_bar, EFL_UI_EVENT_SELECTED, _tab_select_cb, obj); + efl_event_callback_del(sd->tab_bar, EFL_UI_EVENT_ITEM_SELECTED, _tab_select_cb, obj); efl_content_unset(efl_part(obj, "efl.tab_root")); efl_del(sd->tab_bar); } @@ -69,7 +68,7 @@ _efl_ui_tab_pager_tab_bar_set(Eo *obj, Efl_Ui_Tab_Pager_Data *sd, Efl_Canvas_Obj 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); + efl_event_callback_add(sd->tab_bar, EFL_UI_EVENT_ITEM_SELECTED, _tab_select_cb, obj); } EOLIAN static Efl_Canvas_Object * @@ -88,7 +87,7 @@ 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_event_callback_del(sd->tab_bar, EFL_UI_EVENT_ITEM_SELECTED, _tab_select_cb, obj); efl_destructor(efl_super(obj, MY_CLASS)); } @@ -100,7 +99,6 @@ _efl_ui_tab_pager_efl_object_constructor(Eo *obj, Efl_Ui_Tab_Pager_Data *sd) 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); diff --git a/src/lib/elementary/efl_ui_tab_pager.eo b/src/lib/elementary/efl_ui_tab_pager.eo index fa79b58975..c7e0b5504a 100644 --- a/src/lib/elementary/efl_ui_tab_pager.eo +++ b/src/lib/elementary/efl_ui_tab_pager.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Tab_Pager extends Efl.Ui.Pager +class @beta Efl.Ui.Tab_Pager extends Efl.Ui.Pager { [[Tab Pager class]] methods { @@ -14,7 +14,7 @@ class Efl.Ui.Tab_Pager extends Efl.Ui.Pager Efl.Container.content_count; Efl.Pack.pack_clear; // TODO Efl.Pack.unpack_all; // TODO - Efl.Pack.unpack; // TODO + Efl.Pack.unpack; Efl.Pack_Linear.pack_begin; Efl.Pack_Linear.pack_end; Efl.Pack_Linear.pack_before; diff --git a/src/lib/elementary/efl_ui_table.c b/src/lib/elementary/efl_ui_table.c index d3415d75e4..7a11f2fb71 100644 --- a/src/lib/elementary/efl_ui_table.c +++ b/src/lib/elementary/efl_ui_table.c @@ -1,6 +1,6 @@ #include "efl_ui_table_private.h" -#include "../evas/canvas/evas_table.eo.h" +#include "../evas/canvas/evas_table_eo.h" #define MY_CLASS EFL_UI_TABLE_CLASS #define MY_CLASS_NAME "Efl.Ui.Table" @@ -28,12 +28,12 @@ _mirrored_set(Evas_Object *obj, Eina_Bool rtl) evas_object_table_mirrored_set(wd->resize_obj, rtl); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_table_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _mirrored_set(obj, efl_ui_mirrored_get(obj)); @@ -74,7 +74,16 @@ _table_size_hints_changed(void *data, Evas *e EINA_UNUSED, { Efl_Ui_Table_Data *pd = efl_data_scope_get(data, MY_CLASS); - _sizing_eval(data, pd); + if (table == data) + efl_pack_layout_request(data); + else + _sizing_eval(data, pd); +} + +static void +_efl_ui_table_size_hints_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev) +{ + efl_pack_layout_request(ev->object); } /* Custom table class: overrides smart_calculate. */ @@ -83,11 +92,11 @@ static void _custom_table_calc(Eo *obj, Custom_Table_Data *pd); static Eina_Bool _custom_table_initializer(Efl_Class *klass) { - EFL_OPS_DEFINE(class_ops, + EFL_OPS_DEFINE(ops, EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _custom_table_calc) ); - return efl_class_functions_set(klass, NULL, &class_ops); + return efl_class_functions_set(klass, &ops, NULL); }; static const Efl_Class_Description custom_table_class_desc = { @@ -113,13 +122,29 @@ _custom_table_calc(Eo *obj, Custom_Table_Data *pd) } /* End of custom table class */ +EOLIAN static void +_efl_ui_table_homogeneous_set(Eo *obj, Efl_Ui_Table_Data *pd, Eina_Bool homogeneoush, Eina_Bool homogeneousv) +{ + if ((pd->homogeneoush == !!homogeneoush) && + (pd->homogeneousv == !!homogeneousv)) + return; + + pd->homogeneoush = !!homogeneoush; + pd->homogeneousv = !!homogeneousv; + efl_pack_layout_request(obj); +} + +EOLIAN static void +_efl_ui_table_homogeneous_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, Eina_Bool *homogeneoush, Eina_Bool *homogeneousv) +{ + if (homogeneoush) *homogeneoush = pd->homogeneoush; + if (homogeneousv) *homogeneousv = pd->homogeneousv; +} + EOLIAN static void _efl_ui_table_efl_pack_layout_layout_update(Eo *obj, Efl_Ui_Table_Data *pd) { - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - _sizing_eval(obj, pd); - efl_canvas_group_calculate(efl_super(wd->resize_obj, CUSTOM_TABLE_CLASS)); + _efl_ui_table_custom_layout(obj, pd); } EOLIAN void @@ -136,8 +161,6 @@ _efl_ui_table_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Table_Data *pd) Custom_Table_Data *custom; Evas_Object *table; - elm_widget_sub_object_parent_add(obj); - table = efl_add(CUSTOM_TABLE_CLASS, obj); custom = efl_data_scope_get(table, CUSTOM_TABLE_CLASS); custom->gd = pd; @@ -148,6 +171,8 @@ _efl_ui_table_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Table_Data *pd) evas_object_event_callback_add (table, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _table_size_hints_changed, obj); + efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, + _efl_ui_table_size_hints_changed_cb, NULL); efl_canvas_group_add(efl_super(obj, MY_CLASS)); @@ -168,6 +193,8 @@ _efl_ui_table_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNU evas_object_event_callback_del_full (wd->resize_obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _table_size_hints_changed, obj); + efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, + _efl_ui_table_size_hints_changed_cb, NULL); /* let's make our table object the *last* to be processed, since it * may (smart) parent other sub objects here */ @@ -197,6 +224,8 @@ _efl_ui_table_efl_object_constructor(Eo *obj, Efl_Ui_Table_Data *pd) pd->last_row = -1; pd->req_cols = 0; pd->req_rows = 0; + pd->align.h = 0.5; + pd->align.v = 0.5; return obj; } @@ -232,6 +261,28 @@ _efl_ui_table_efl_pack_pack_padding_get(const Eo *obj, Efl_Ui_Table_Data *pd EIN if (v) *v = pd->pad.v; } +EOLIAN static void +_efl_ui_table_efl_pack_pack_align_set(Eo *obj, Efl_Ui_Table_Data *pd, double h, double v) +{ + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); + + if (h < 0) h = -1; + if (v < 0) v = -1; + if (h > 1) h = 1; + if (v > 1) v = 1; + pd->align.h = h; + pd->align.v = v; + + efl_pack_layout_request(obj); +} + +EOLIAN static void +_efl_ui_table_efl_pack_pack_align_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, double *h, double *v) +{ + if (h) *h = pd->align.h; + if (v) *v = pd->align.v; +} + static void _subobj_del_cb(void *data, const Efl_Event *event) { @@ -253,6 +304,18 @@ _pack_at(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj, ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); + gi = efl_key_data_get(subobj, TABLE_ITEM_KEY); + + if (gi && efl_ui_widget_parent_get(subobj) == obj) + { + ERR("subobj %p %s is already added to this", subobj, efl_class_name_get(subobj) ); + return EINA_FALSE; + } + else if (gi && efl_ui_widget_parent_get(subobj) != obj) + { + gi = NULL; + } + if (col < 0) col = 0; if (row < 0) row = 0; @@ -274,23 +337,12 @@ _pack_at(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj, col, row, colspan, rowspan, pd->req_cols, pd->req_rows); } - if (obj == elm_widget_parent_widget_get(subobj)) - { - gi = efl_key_data_get(subobj, TABLE_ITEM_KEY); - if (gi) - { - gi->col = col; - gi->row = row; - gi->col_span = colspan; - gi->row_span = rowspan; - gi->linear = EINA_FALSE; - } - else ERR("object is a child but internal data was not found!"); - } - if (!gi) { + if (!elm_widget_sub_object_add(obj, subobj)) + return EINA_FALSE; gi = calloc(1, sizeof(*gi)); + if (!gi) return EINA_FALSE; gi->col = col; gi->row = row; gi->col_span = colspan; @@ -302,7 +354,6 @@ _pack_at(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj, eina_inlist_append(EINA_INLIST_GET(pd->items), EINA_INLIST_GET(gi)); efl_key_data_set(subobj, TABLE_ITEM_KEY, gi); - elm_widget_sub_object_add(obj, subobj); efl_event_callback_legacy_call(obj, EFL_CONTAINER_EVENT_CONTENT_ADDED, subobj); efl_event_callback_array_add(subobj, subobj_callbacks(), obj); } @@ -415,6 +466,7 @@ end: eina_inlist_remove(EINA_INLIST_GET(pd->items), EINA_INLIST_GET(gi)); pd->count--; efl_key_data_set(subobj, TABLE_ITEM_KEY, NULL); + efl_event_callback_array_del(subobj, subobj_callbacks(), obj); free(gi); } @@ -435,20 +487,28 @@ _efl_ui_table_efl_pack_unpack(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *su } EOLIAN static Eina_Bool -_efl_ui_table_efl_pack_pack_clear(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED) +_efl_ui_table_efl_pack_pack_clear(Eo *obj, Efl_Ui_Table_Data *pd) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); + while (pd->items) + _item_remove(obj, pd, pd->items->object); + evas_object_table_clear(wd->resize_obj, EINA_TRUE); + return EINA_TRUE; } EOLIAN static Eina_Bool -_efl_ui_table_efl_pack_unpack_all(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED) +_efl_ui_table_efl_pack_unpack_all(Eo *obj, Efl_Ui_Table_Data *pd) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); + while (pd->items) + _item_remove(obj, pd, pd->items->object); + evas_object_table_clear(wd->resize_obj, EINA_FALSE); + return EINA_TRUE; } @@ -658,21 +718,14 @@ _efl_ui_table_efl_pack_table_table_rows_get(const Eo *obj EINA_UNUSED, Efl_Ui_Ta { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, 0); int rows; - evas_object_table_col_row_size_get(wd->resize_obj, &rows, NULL); + evas_object_table_col_row_size_get(wd->resize_obj, NULL, &rows); return rows; } return pd->req_rows; } EOLIAN static Eina_Bool -_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_Entity *subobj) +_efl_ui_table_efl_pack_pack(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 35774f30b5..7bcf3195a1 100644 --- a/src/lib/elementary/efl_ui_table.eo +++ b/src/lib/elementary/efl_ui_table.eo @@ -1,12 +1,26 @@ -class Efl.Ui.Table extends Efl.Ui.Widget implements Efl.Pack_Table, Efl.Pack_Layout, +class @beta Efl.Ui.Table extends Efl.Ui.Widget implements Efl.Pack_Table, Efl.Pack_Layout, Efl.Ui.Direction { [[Efl UI table class]] + methods { + @property homogeneous { + [[Control homogeneous mode. + + This will enable the homogeneous mode where cells are of the same + weight and of the same min size which is determined by maximum min + size of cells.]] + values { + homogeneoush : bool; [[$true if the box is homogeneous horizontally, + $false otherwise]] + homogeneousv : bool; [[$true if the box is homogeneous vertically, + $false otherwise]] + } + } + } implements { Efl.Object.constructor; Efl.Canvas.Group.group_calculate; Efl.Ui.Widget.theme_apply; - //Efl.Container.content_remove; // TODO Efl.Container.content_iterate; Efl.Container.content_count; Efl.Ui.Direction.direction { get; set; } @@ -15,6 +29,7 @@ class Efl.Ui.Table extends Efl.Ui.Widget implements Efl.Pack_Table, Efl.Pack_Lay Efl.Pack.unpack; Efl.Pack.pack; Efl.Pack.pack_padding { get; set; } + Efl.Pack.pack_align { get; set; } Efl.Pack_Table.pack_table; Efl.Pack_Table.table_content_get; Efl.Pack_Table.table_contents_get; @@ -23,7 +38,6 @@ class Efl.Ui.Table extends Efl.Ui.Widget implements Efl.Pack_Table, Efl.Pack_Lay 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_layout.c b/src/lib/elementary/efl_ui_table_layout.c new file mode 100644 index 0000000000..3d29551de5 --- /dev/null +++ b/src/lib/elementary/efl_ui_table_layout.c @@ -0,0 +1,384 @@ +#include "efl_ui_table_private.h" +#include "efl_ui_container_layout.h" + +typedef struct _Item_Calc Item_Calc; +typedef struct _Cell_Calc Cell_Calc; +typedef struct _Table_Calc Table_Calc; + +struct _Item_Calc +{ + Evas_Object *obj; + int cell_span[2]; + int cell_index[2]; + Efl_Ui_Container_Item_Hints hints[2]; /* 0 is x-axis, 1 is y-axis */ +}; + +struct _Cell_Calc +{ + EINA_INLIST; + + int index; + int next; + double acc; + double space; + double weight; + double weight_factor; + Eina_Bool occupied : 1; +}; + +struct _Table_Calc +{ + /* 0 is x-axis, 1 is y-axis */ + + int rows; + int cols; + int want[2]; + int hgsize[2]; + double weight_sum[2]; + Cell_Calc *cell_calc[2]; + Efl_Ui_Container_Layout_Calc layout_calc[2]; +}; + +static int +_weight_sort_cb(const void *l1, const void *l2) +{ + Cell_Calc *cc1, *cc2; + + cc1 = EINA_INLIST_CONTAINER_GET(l1, Cell_Calc); + cc2 = EINA_INLIST_CONTAINER_GET(l2, Cell_Calc); + + return cc2->weight_factor <= cc1->weight_factor ? -1 : 1; +} + +static void +_cell_weight_calc(Table_Calc *table_calc, Eina_Bool axis) +{ + int i, count, layout_size, calc_size; + double denom, weight_sum, calc_weight; + Eina_Inlist *inlist = NULL; + Cell_Calc *cell_calc, *cc; + + layout_size = calc_size = table_calc->layout_calc[axis].size; + weight_sum = calc_weight = table_calc->weight_sum[axis]; + cell_calc = table_calc->cell_calc[axis]; + count = axis ? table_calc->rows : table_calc->cols; + + for (i = 0; i < count; i = cell_calc[i].next) + { + denom = (cell_calc[i].weight * layout_size) - + (weight_sum * cell_calc[i].space); + if (denom > 0) + { + cell_calc[i].weight_factor = (cell_calc[i].weight * layout_size) / denom; + inlist = eina_inlist_sorted_insert(inlist, + EINA_INLIST_GET(&cell_calc[i]), + _weight_sort_cb); + } + else + { + calc_size -= cell_calc[i].space; + calc_weight -= cell_calc[i].weight; + } + } + + EINA_INLIST_FOREACH(inlist, cc) + { + double weight_len; + + weight_len = (calc_size * cc->weight) / calc_weight; + if (cc->space < weight_len) + { + cc->space = weight_len; + } + else + { + calc_size -= cc->space; + calc_weight -= cc->weight; + } + } +} + +static void +_efl_ui_table_homogeneous_cell_init(Table_Calc *table_calc, Eina_Bool axis) +{ + int i, index = 0, mmin = 0, count; + Cell_Calc *prev_cell = NULL, *cell_calc; + + cell_calc = table_calc->cell_calc[axis]; + count = axis ? table_calc->rows : table_calc->cols; + + for (i = 0; i < count; i++) + { + if (!cell_calc[i].occupied) continue; + + cell_calc[i].index = index++; + if (cell_calc[i].space > mmin) + mmin = cell_calc[i].space; + + if (prev_cell) + prev_cell->next = i; + + prev_cell = &cell_calc[i]; + } + if (prev_cell) + prev_cell->next = count; + + table_calc->layout_calc[axis].size -= (table_calc->layout_calc[axis].pad + * (index - 1)); + + table_calc->want[axis] = mmin * index; + table_calc->weight_sum[axis] = index; + + if (table_calc->want[axis] > table_calc->layout_calc[axis].size) + table_calc->hgsize[axis] = table_calc->want[axis] / index; + else + table_calc->hgsize[axis] = table_calc->layout_calc[axis].size / index; + + table_calc->hgsize[axis] += table_calc->layout_calc[axis].pad; +} + +static void +_efl_ui_table_regular_cell_init(Table_Calc *table_calc, Eina_Bool axis) +{ + int i, index = 0, acc, want = 0, count; + double weight_sum = 0; + Cell_Calc *prev_cell = NULL, *cell_calc; + Efl_Ui_Container_Layout_Calc *layout_calc; + + layout_calc = &(table_calc->layout_calc[axis]); + cell_calc = table_calc->cell_calc[axis]; + count = axis ? table_calc->rows : table_calc->cols; + + for (i = 0; i < count; i++) + { + if (!cell_calc[i].occupied) continue; + else if (i && cell_calc[0].next == 0) cell_calc[0].next = i; + + cell_calc[i].index = index++; + want += cell_calc[i].space; + weight_sum += cell_calc[i].weight; + + if (prev_cell) + prev_cell->next = i; + + prev_cell = &cell_calc[i]; + } + if (prev_cell) + prev_cell->next = count; + + table_calc->want[axis] = want; + table_calc->weight_sum[axis] = weight_sum; + table_calc->layout_calc[axis].size -= (table_calc->layout_calc[axis].pad + * (index - 1)); + + if ((layout_calc->size > want) && (weight_sum > 0)) + _cell_weight_calc(table_calc, axis); + if (EINA_DBL_EQ(weight_sum, 0.0)) + layout_calc->pos += (layout_calc->size - want) * layout_calc->align; + + for (i = 0, acc = 0; i < count; acc += cell_calc[i].space, i = cell_calc[i].next) + cell_calc[i].acc = acc; +} + +static inline int +_efl_ui_table_homogeneous_item_pos_get(Table_Calc *table_calc, Item_Calc *item, Eina_Bool axis) +{ + return 0.5 + table_calc->layout_calc[axis].pos + (table_calc->hgsize[axis] + * table_calc->cell_calc[axis][item->cell_index[axis]].index); +} + +static inline int +_efl_ui_table_homogeneous_item_size_get(Table_Calc *table_calc, Item_Calc *item, Eina_Bool axis) +{ + return (table_calc->hgsize[axis] * item->cell_span[axis]) + - table_calc->layout_calc[axis].pad; +} + +static inline int +_efl_ui_table_regular_item_pos_get(Table_Calc *table_calc, Item_Calc *item, Eina_Bool axis) +{ + return 0.5 + table_calc->layout_calc[axis].pos + + table_calc->cell_calc[axis][item->cell_index[axis]].acc + + (table_calc->cell_calc[axis][item->cell_index[axis]].index * + table_calc->layout_calc[axis].pad); +} + +static inline int +_efl_ui_table_regular_item_size_get(Table_Calc *table_calc, Item_Calc *item, Eina_Bool axis) +{ + int start, end; + + start = item->cell_index[axis]; + end = start + item->cell_span[axis] - 1; + + return table_calc->cell_calc[axis][end].acc + - table_calc->cell_calc[axis][start].acc + + table_calc->cell_calc[axis][end].space + + ((item->cell_span[axis] - 1) * table_calc->layout_calc[axis].pad) + - item->hints[axis].margin[0] - item->hints[axis].margin[1]; +} + +void +_efl_ui_table_custom_layout(Efl_Ui_Table *ui_table, Efl_Ui_Table_Data *pd) +{ + Table_Item *ti; + Item_Calc *items, *item; + Efl_Ui_Container_Item_Hints *hints; + int id = 0, i = 0, rows, cols; + int (*_efl_ui_table_item_pos_get[2])(Table_Calc *, Item_Calc *, Eina_Bool); + int (*_efl_ui_table_item_size_get[2])(Table_Calc *, Item_Calc *, Eina_Bool); + + Table_Calc table_calc; + + if (!pd->count) + { + efl_gfx_hint_size_restricted_min_set(ui_table, EINA_SIZE2D(0, 0)); + return; + } + + _efl_ui_container_layout_init(ui_table, table_calc.layout_calc); + + table_calc.want[0] = table_calc.want[1] = 0; + table_calc.weight_sum[0] = table_calc.weight_sum[1] = 0; + + efl_pack_table_size_get(ui_table, &cols, &rows); + + table_calc.cell_calc[0] = alloca(cols * sizeof(Cell_Calc)); + table_calc.cell_calc[1] = alloca(rows * sizeof(Cell_Calc)); + + memset(table_calc.cell_calc[0], 0, cols * sizeof(Cell_Calc)); + memset(table_calc.cell_calc[1], 0, rows * sizeof(Cell_Calc)); + + items = alloca(pd->count * sizeof(*items)); +#ifdef DEBUG + memset(items, 0, pd->count * sizeof(*items)); +#endif + + table_calc.cols = cols; + table_calc.rows = rows; + // scan all items, get their properties, calculate total weight & min size + EINA_INLIST_FOREACH(pd->items, ti) + { + if (((ti->col + ti->col_span) > cols) || + ((ti->row + ti->row_span) > rows)) + { + efl_gfx_entity_visible_set(ti->object, EINA_FALSE); + continue; + } + + item = &items[id++]; + item->obj = ti->object; + hints = item->hints; + + _efl_ui_container_layout_item_init(item->obj, hints); + + if (table_calc.layout_calc[0].fill || pd->homogeneoush) + hints[0].weight = 1; + else if (hints[0].weight < 0) + hints[0].weight = 0; + + if (table_calc.layout_calc[1].fill || pd->homogeneousv) + hints[1].weight = 1; + else if (hints[1].weight < 0) + hints[1].weight = 0; + + item->cell_index[0] = ti->col; + item->cell_index[1] = ti->row; + item->cell_span[0] = ti->col_span; + item->cell_span[1] = ti->row_span; + + int end; + double ispace, iweight; + + end = ti->col + ti->col_span; + ispace = hints[0].space / ti->col_span; + iweight = hints[0].weight / ti->col_span; + for (i = ti->col; i < end; i++) + { + table_calc.cell_calc[0][i].occupied = EINA_TRUE; + + if (table_calc.cell_calc[0][i].space < ispace) + table_calc.cell_calc[0][i].space = ispace; + if (table_calc.cell_calc[0][i].weight < iweight) + table_calc.cell_calc[0][i].weight = iweight; + } + + end = ti->row + ti->row_span; + ispace = hints[1].space / ti->row_span; + iweight = hints[1].weight / ti->row_span; + for (i = ti->row; i < end; i++) + { + table_calc.cell_calc[1][i].occupied = EINA_TRUE; + + if (table_calc.cell_calc[1][i].space < ispace) + table_calc.cell_calc[1][i].space = ispace; + if (table_calc.cell_calc[1][i].weight < iweight) + table_calc.cell_calc[1][i].weight = iweight; + } + } + + if (pd->homogeneoush) + { + _efl_ui_table_homogeneous_cell_init(&table_calc, 0); + _efl_ui_table_item_pos_get[0] = _efl_ui_table_homogeneous_item_pos_get; + _efl_ui_table_item_size_get[0] = _efl_ui_table_homogeneous_item_size_get; + } + else + { + _efl_ui_table_regular_cell_init(&table_calc, 0); + _efl_ui_table_item_pos_get[0] = _efl_ui_table_regular_item_pos_get; + _efl_ui_table_item_size_get[0] = _efl_ui_table_regular_item_size_get; + } + + if (pd->homogeneousv) + { + _efl_ui_table_homogeneous_cell_init(&table_calc, 1); + _efl_ui_table_item_pos_get[1] = _efl_ui_table_homogeneous_item_pos_get; + _efl_ui_table_item_size_get[1] = _efl_ui_table_homogeneous_item_size_get; + } + else + { + _efl_ui_table_regular_cell_init(&table_calc, 1); + _efl_ui_table_item_pos_get[1] = _efl_ui_table_regular_item_pos_get; + _efl_ui_table_item_size_get[1] = _efl_ui_table_regular_item_size_get; + } + + for (i = 0; i < pd->count; i++) + { + Eina_Rect space, item_geom; + item = &items[i]; + hints = items[i].hints; + + space.x = _efl_ui_table_item_pos_get[0](&table_calc, item, 0); + space.y = _efl_ui_table_item_pos_get[1](&table_calc, item, 1); + space.w = _efl_ui_table_item_size_get[0](&table_calc, item, 0); + space.h = _efl_ui_table_item_size_get[1](&table_calc, item, 1); + + item_geom.w = hints[0].fill ? space.w : hints[0].min; + item_geom.h = hints[1].fill ? space.h : hints[1].min; + + _efl_ui_container_layout_min_max_calc(hints, &item_geom.w, &item_geom.h, + (hints[0].aspect > 0) && (hints[1].aspect > 0)); + + item_geom.x = space.x + ((space.w - item_geom.w) * hints[0].align) + + hints[0].margin[0]; + item_geom.y = space.y + ((space.h - item_geom.h) * hints[1].align) + + hints[1].margin[0]; + + efl_gfx_entity_geometry_set(item->obj, item_geom); + } + + table_calc.want[0] += table_calc.layout_calc[0].margin[0] + + table_calc.layout_calc[0].margin[1] + + (table_calc.layout_calc[0].pad * + table_calc.cell_calc[0][cols - 1].index); + + table_calc.want[1] += table_calc.layout_calc[1].margin[0] + + table_calc.layout_calc[1].margin[1] + + (table_calc.layout_calc[1].pad * + table_calc.cell_calc[1][rows - 1].index); + + efl_gfx_hint_size_restricted_min_set(ui_table, + EINA_SIZE2D(table_calc.want[0], + table_calc.want[1])); +} diff --git a/src/lib/elementary/efl_ui_table_private.h b/src/lib/elementary/efl_ui_table_private.h index e7c3821ee9..4aea410376 100644 --- a/src/lib/elementary/efl_ui_table_private.h +++ b/src/lib/elementary/efl_ui_table_private.h @@ -14,6 +14,8 @@ typedef struct _Efl_Ui_Table_Data Efl_Ui_Table_Data; typedef struct _Table_Item_Iterator Table_Item_Iterator; typedef struct _Table_Item Table_Item; +void _efl_ui_table_custom_layout(Efl_Ui_Table *ui_table, Efl_Ui_Table_Data *pd); + #define TABLE_ITEM_KEY "__table_item" struct _Table_Item @@ -39,7 +41,12 @@ struct _Efl_Ui_Table_Data double h, v; Eina_Bool scalable: 1; } pad; + struct { + double h, v; + } align; Eina_Bool linear_recalc : 1; + Eina_Bool homogeneoush : 1; + Eina_Bool homogeneousv : 1; }; struct _Table_Item_Iterator diff --git a/src/lib/elementary/efl_ui_table_static.eo b/src/lib/elementary/efl_ui_table_static.eo index 12d39f32d2..c459dcb03a 100644 --- a/src/lib/elementary/efl_ui_table_static.eo +++ b/src/lib/elementary/efl_ui_table_static.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Table_Static extends Efl.Ui.Table +class @beta Efl.Ui.Table_Static extends Efl.Ui.Table { [[Efl UI table static class]] data: null; diff --git a/src/lib/elementary/efl_ui_tags.c b/src/lib/elementary/efl_ui_tags.c index 3cdaa70898..12b56c15c5 100644 --- a/src/lib/elementary/efl_ui_tags.c +++ b/src/lib/elementary/efl_ui_tags.c @@ -5,7 +5,7 @@ #include #include "elm_priv.h" #include "efl_ui_tags_private.h" -#include "elm_entry.eo.h" +#include "elm_entry_eo.h" #define MY_CLASS EFL_UI_TAGS_CLASS @@ -65,7 +65,7 @@ _shrink_mode_set(Eo *obj, { elm_box_pack_end(sd->box, sd->label); Eina_Size2D label_min = - efl_gfx_size_hint_combined_min_get(sd->label); + efl_gfx_hint_size_combined_min_get(sd->label); w -= label_min.w; w -= box_inner_item_width_padding; } @@ -82,7 +82,7 @@ _shrink_mode_set(Eo *obj, evas_object_show(layout); Eina_Size2D item_min = - efl_gfx_size_hint_combined_min_get(layout); + efl_gfx_hint_size_combined_min_get(layout); w -= item_min.w; w -= box_inner_item_width_padding; @@ -132,7 +132,7 @@ _shrink_mode_set(Eo *obj, 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)); + efl_gfx_hint_size_min_set(sd->end, EINA_SIZE2D(w_label_count, h)); elm_box_pack_end(sd->box, sd->end); evas_object_show(sd->end); @@ -144,7 +144,7 @@ _shrink_mode_set(Eo *obj, { sd->view_state = TAGS_VIEW_SHRINK; efl_event_callback_call - (obj, EFL_UI_TAGS_EVENT_EXPAND_STATE_CHANGED, (void *)1); + (obj, EFL_UI_TAGS_EVENT_EXPAND_STATE_CHANGED, &shrink); } eina_value_flush(&val); @@ -175,7 +175,7 @@ _shrink_mode_set(Eo *obj, { sd->view_state = TAGS_VIEW_NONE; efl_event_callback_call - (obj, EFL_UI_TAGS_EVENT_EXPAND_STATE_CHANGED, (void *)(uintptr_t)sd->shrink); + (obj, EFL_UI_TAGS_EVENT_EXPAND_STATE_CHANGED, &shrink); } } @@ -403,7 +403,7 @@ _item_new(Efl_Ui_Tags_Data *sd, layout = efl_add(EFL_UI_LAYOUT_CLASS, obj); - if (!elm_widget_element_update(obj, layout, PART_NAME_BUTTON)) + if (elm_widget_element_update(obj, layout, PART_NAME_BUTTON) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); efl_text_set(efl_part(layout, "efl.btn.text"), str); @@ -426,19 +426,19 @@ _item_new(Efl_Ui_Tags_Data *sd, (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); + efl_gfx_hint_align_set(layout, 0.5, 0.5); + efl_gfx_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); + min = efl_gfx_hint_size_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_hint_size_min_set(layout, EINA_SIZE2D(r.w, min.h)); efl_gfx_entity_size_set(layout, EINA_SIZE2D(r.w, min.h)); } @@ -471,7 +471,7 @@ _item_new(Efl_Ui_Tags_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_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) +_efl_ui_tags_efl_ui_widget_widget_input_event_handler(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; @@ -488,8 +488,8 @@ _efl_ui_tags_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Tags_Data *sd EINA_UNUSED) 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)); + efl_gfx_hint_size_min_set(obj, EINA_SIZE2D(minw, minh)); + efl_gfx_hint_size_max_set(obj, EINA_SIZE2D(maxw, maxh)); } static void @@ -538,12 +538,12 @@ _box_resize_cb(void *data, elm_layout_sizing_eval(layout); evas_object_smart_calculate(layout); - min = efl_gfx_size_hint_combined_min_get(layout); + min = efl_gfx_hint_size_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_hint_size_min_set(layout, EINA_SIZE2D(min.w, min.h)); efl_gfx_entity_size_set(layout, EINA_SIZE2D(min.w, min.h)); } } @@ -770,14 +770,14 @@ _box_min_size_calculate(Evas_Object *box, Evas_Object_Box_Option *opt; evas_object_geometry_get(box, NULL, NULL, &w, NULL); - box_min = efl_gfx_size_hint_combined_min_get(box); + box_min = efl_gfx_hint_size_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); + min = efl_gfx_hint_size_combined_min_get(opt->obj); linew += min.w; if (lineh < min.h) lineh = min.h; @@ -793,7 +793,7 @@ _box_min_size_calculate(Evas_Object *box, } 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)); + efl_gfx_hint_size_min_set(box, EINA_SIZE2D(box_min.w, box_min.h)); *line_height = lineh; return EINA_TRUE; @@ -818,8 +818,8 @@ _box_layout_cb(Evas_Object *o, 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); + min = efl_gfx_hint_size_combined_min_get(o); + efl_gfx_hint_align_get(o, &ax, &ay); rtl = efl_ui_mirrored_get(data); if (rtl) ax = 1.0 - ax; @@ -848,8 +848,8 @@ _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); - efl_gfx_size_hint_fill_get(obj, &fx, &fy); - obj_min = efl_gfx_size_hint_combined_min_get(obj); + efl_gfx_hint_fill_get(obj, &fx, &fy); + obj_min = efl_gfx_hint_size_combined_min_get(obj); if (EINA_DBL_EQ(ax, -1)) { fx = 1; ax = 0.5; } else if (ax < 0) { ax = 0.0; } @@ -940,10 +940,10 @@ _view_init(Evas_Object *obj, Efl_Ui_Tags_Data *sd) 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)); + efl_gfx_hint_size_min_set(sd->entry, EINA_SIZE2D(MIN_W_ENTRY, 0)); evas_object_size_hint_weight_set (sd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_gfx_size_hint_fill_set(sd->entry, EINA_TRUE, EINA_TRUE); + efl_gfx_hint_fill_set(sd->entry, EINA_TRUE, EINA_TRUE); elm_box_pack_end(sd->box, sd->entry); @@ -958,7 +958,7 @@ _view_init(Evas_Object *obj, Efl_Ui_Tags_Data *sd) 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)); + efl_gfx_hint_size_min_set(sd->end, EINA_SIZE2D(button_min_width, button_min_height)); elm_widget_sub_object_add(obj, sd->end); } } @@ -996,8 +996,8 @@ _legacy_focused(void *data, const Efl_Event *ev) 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_FOCUS_CHANGED, _legacy_focused, ev->object); - efl_event_callback_add(efl_ui_focus_object_focus_manager_get(ev->object), EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED, _legacy_focused, ev->object); + efl_event_callback_del(ev->info, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _legacy_focused, ev->object); + efl_event_callback_add(efl_ui_focus_object_focus_manager_get(ev->object), EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _legacy_focused, ev->object); } EOLIAN static Eo * @@ -1009,12 +1009,11 @@ _efl_ui_tags_efl_object_constructor(Eo *obj, Efl_Ui_Tags_Data *sd) 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, + 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))) + elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); elm_widget_can_focus_set(obj, EINA_FALSE); @@ -1029,7 +1028,7 @@ _efl_ui_tags_efl_object_constructor(Eo *obj, Efl_Ui_Tags_Data *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); + efl_event_callback_add(obj, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_MANAGER_CHANGED, _legacy_manager_changed_cb, NULL); return obj; } diff --git a/src/lib/elementary/efl_ui_tags.eo b/src/lib/elementary/efl_ui_tags.eo index 05a9e120ec..86e83ab7e2 100644 --- a/src/lib/elementary/efl_ui_tags.eo +++ b/src/lib/elementary/efl_ui_tags.eo @@ -1,46 +1,51 @@ -class Efl.Ui.Tags extends Efl.Ui.Layout implements Efl.Text, Efl.Ui.Format +class @beta Efl.Ui.Tags extends Efl.Ui.Layout_Base implements Efl.Text, Efl.Ui.Format { - [[Elementary Tags class]] + [[A widget displaying a list of tags. The user can remove tags by clicking + on each tag "close" button and add new tags by typing text in the text + entry at the end of the list.]] methods { @property editable { - [[Control if the tags is to be editable or not.]] + [[Control if the tag list is to be editable by the user or not.]] set { } get { } values { - editable: bool; [[If $true, user can add/delete item in tags, if not, the tags is non-editable.]] + editable: bool; [[If $true, the user can add/delete tags to the tag list, + if not, the tag list is non-editable.]] } } @property expanded { - [[Control the tags to expanded state. + [[Control whether the tag list is expanded or not. - In expanded state, the complete entry will be displayed. - Otherwise, only single line of the entry will be displayed.]] + In the expanded state, all tags will be displayed. + Otherwise, only a single line of tags will be displayed with a marker to + indicate that there is more content.]] 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.]] + expanded: bool; [[The expanded state. Set this to $true to allow multiple + lines of tags. Set to $false for a single line.]] } } @property items { - [[Get a list of items in the tags]] + [[List of tags in the tag list. Tags can be added and removed by the user + using the UI, and by the program by modifying this property.]] set { } get { } values { - items: const(array); [[The array of items, or NULL if none]] + items: const(array); [[The array of items, or NULL if none.]] } } } implements { Efl.Object.constructor; Efl.Object.destructor; - Efl.Ui.Widget.widget_event; + Efl.Ui.Widget.widget_input_event_handler; Efl.Text.text { get; set; } Efl.Ui.Format.format_cb { set; } } @@ -56,4 +61,7 @@ class Efl.Ui.Tags extends Efl.Ui.Layout implements Efl.Text, Efl.Ui.Format /* FIXME: Not future-proof */ expand,state,changed: int; [[Called when expanded state changed]] } + composite { + Efl.Text; + } } diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 000ba0e3bb..ebb2dd539e 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -15,7 +15,7 @@ #include "elm_entry_common.h" #include "elm_widget_entry.h" #include "efl_ui_text.eo.h" -#include "elm_hoversel.eo.h" +#include "elm_hoversel_eo.h" #include "efl_ui_text_part.eo.h" #include "elm_part_helper.h" @@ -91,7 +91,7 @@ struct _Efl_Ui_Text_Data const char *hover_style; /**< style of a hover object */ } anchor_hover; - Elm_Sel_Format cnp_mode; + Efl_Ui_Selection_Format cnp_mode; Elm_Sel_Format drop_format; struct { @@ -251,14 +251,13 @@ static void _selection_defer(Eo *obj, Efl_Ui_Text_Data *sd); static Eina_Position2D _decoration_calc_offset(Efl_Ui_Text_Data *sd); static char * -_file_load(const char *file) +_file_load(Eo *obj) { Eina_File *f; char *text = NULL; void *tmp = NULL; - f = eina_file_open(file, EINA_FALSE); - if (!f) return NULL; + f = eina_file_dup(efl_file_mmap_get(obj)); tmp = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); if (!tmp) goto on_error; @@ -282,29 +281,35 @@ _file_load(const char *file) } static char * -_plain_load(const char *file) +_plain_load(Eo *obj) { - return _file_load(file); + return _file_load(obj); } -static Eina_Bool +static Eina_Error _load_do(Evas_Object *obj) { char *text; + Eina_Error err = 0; EFL_UI_TEXT_DATA_GET(obj, sd); if (!sd->file) { elm_object_text_set(obj, ""); - return EINA_TRUE; + return 0; } switch (sd->format) { /* Only available format */ case ELM_TEXT_FORMAT_PLAIN_UTF8: - text = _plain_load(sd->file); + text = _plain_load(obj); + if (!text) + { + err = errno; + if (!err) err = ENOENT; + } break; default: @@ -316,13 +321,10 @@ _load_do(Evas_Object *obj) { efl_text_set(obj, text); free(text); - return EINA_TRUE; - } - else - { - efl_text_set(obj, ""); - return EINA_FALSE; + return 0; } + efl_text_set(obj, ""); + return err; } static void @@ -599,23 +601,30 @@ _selection_data_cb(void *data EINA_UNUSED, Eo *obj, Efl_Ui_Selection_Data *sel_data) { Efl_Text_Cursor_Cursor *cur, *start, *end; + Efl_Ui_Text_Change_Info info = { NULL, 0, 0, 0, 0 }; char *buf = eina_slice_strdup(sel_data->content); + size_t len = sel_data->content.len; 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); } - cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); + cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); + info.insert = EINA_TRUE; + info.position = efl_text_cursor_position_get(obj, cur); + info.length = len; + info.content = buf; if (sel_data->format == EFL_UI_SELECTION_FORMAT_MARKUP) { - efl_text_markup_cursor_markup_insert(obj, cur, buf); + efl_text_markup_interactive_cursor_markup_insert(obj, cur, buf); } else // TEXT { efl_text_cursor_text_insert(obj, cur, buf); } + efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info); free(buf); } @@ -684,15 +693,17 @@ _get_drop_format(Evas_Object *obj) EFL_UI_TEXT_DATA_GET(obj, sd); if ((sd->editable) && (!sd->single_line) && (!sd->password) && (!sd->disabled)) - return EFL_UI_SELECTION_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE; + return EFL_UI_SELECTION_FORMAT_MARKUP | EFL_UI_SELECTION_FORMAT_IMAGE; return EFL_UI_SELECTION_FORMAT_MARKUP; } /* we can't reuse layout's here, because it's on entry_edje only */ -EOLIAN static Eina_Bool -_efl_ui_text_efl_ui_widget_on_disabled_update(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Bool disabled) +EOLIAN static void +_efl_ui_text_efl_ui_widget_disabled_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Bool disabled) { - const char *emission ; + const char *emission; + + efl_ui_widget_disabled_set(efl_super(obj, MY_CLASS), disabled); elm_drop_target_del(obj, sd->drop_format, _dnd_enter_cb, NULL, @@ -700,16 +711,16 @@ _efl_ui_text_efl_ui_widget_on_disabled_update(Eo *obj, Efl_Ui_Text_Data *sd, Ein _dnd_pos_cb, NULL, _dnd_drop_cb, NULL); - emission = disabled ? "efl,state,disabled" : "efl,state,enabled"; + emission = efl_ui_widget_disabled_get(obj) ? "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, "efl"); - //elm_interface_scrollable_freeze_set(obj, disabled); + elm_interface_scrollable_freeze_set(obj, efl_ui_widget_disabled_get(obj)); } - sd->disabled = disabled; + sd->disabled = efl_ui_widget_disabled_get(obj); - if (!disabled) + if (!efl_ui_widget_disabled_get(obj)) { sd->drop_format = _get_drop_format(obj); elm_drop_target_add(obj, sd->drop_format, @@ -718,23 +729,21 @@ _efl_ui_text_efl_ui_widget_on_disabled_update(Eo *obj, Efl_Ui_Text_Data *sd, Ein _dnd_pos_cb, NULL, _dnd_drop_cb, NULL); } - - return EINA_TRUE; } /* we can't issue the layout's theming code here, cause it assumes an * unique edje object, always */ -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_text_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd) { - Efl_Ui_Theme_Apply_Result theme_apply; + Eina_Error theme_apply; ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); // 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, EFL_UI_WIDGET_CLASS)); - if (!theme_apply) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (theme_apply == EFL_UI_THEME_APPLY_ERROR_GENERIC) return EFL_UI_THEME_APPLY_ERROR_GENERIC; efl_event_freeze(obj); @@ -825,7 +834,7 @@ _cursor_geometry_recalc(Evas_Object *obj) x = y = w = h = 0; Efl_Text_Cursor_Cursor *main_cur = - efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); + efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); efl_text_cursor_geometry_get(obj, main_cur, EFL_TEXT_CURSOR_TYPE_BEFORE, @@ -882,7 +891,7 @@ _efl_ui_text_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Text_Data *sd) } elm_layout_sizing_eval(sd->scroller); - min = efl_gfx_size_hint_min_get(sd->scroller); + min = efl_gfx_hint_size_min_get(sd->scroller); if (sd->single_line) { efl_ui_internal_text_scroller_mode_set(sd->scroller, @@ -890,7 +899,7 @@ _efl_ui_text_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Text_Data *sd) edje_object_size_min_calc(wd->resize_obj, &edmin.w, &edmin.h); min.w = edmin.w; min.h = edmin.h; - efl_gfx_size_hint_restricted_min_set(obj, min); + efl_gfx_hint_size_restricted_min_set(obj, min); } sd->cursor_update = EINA_TRUE; @@ -902,7 +911,7 @@ _efl_ui_text_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Text_Data *sd) efl_canvas_text_size_formatted_get(sd->text_obj, &min.w, &min.h); min.w += edmin.w; min.h += edmin.h; - efl_gfx_size_hint_restricted_min_set(obj, min); + efl_gfx_hint_size_restricted_min_set(obj, min); } } @@ -944,7 +953,7 @@ _efl_ui_text_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Text_Data *sd) 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); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_FOCUSED, EINA_TRUE); + efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_TYPE_FOCUSED, EINA_TRUE); _return_key_enabled_check(obj); _validate(obj); } @@ -960,7 +969,7 @@ _efl_ui_text_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Text_Data *sd) if (top && top_is_win && sd->input_panel_enable) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_FOCUSED, EINA_FALSE); + efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_TYPE_FOCUSED, EINA_FALSE); if (_elm_config->selection_clear_enable) { @@ -986,7 +995,7 @@ _efl_ui_text_efl_ui_widget_interest_region_get(const Eo *obj EINA_UNUSED, Efl_Ui Eina_Rect r = {}; efl_text_cursor_geometry_get(obj, - efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN), + efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN), EFL_TEXT_CURSOR_TYPE_BEFORE, &r.x, &r.y, &r.w, &r.h, NULL, NULL, NULL, NULL); @@ -1111,7 +1120,7 @@ _hoversel_item_paste_cb(void *data, } static void -_selection_clear(void *data, Elm_Sel_Type selection) +_selection_clear(void *data, Efl_Ui_Selection_Type selection) { EFL_UI_TEXT_DATA_GET(data, sd); @@ -1155,20 +1164,16 @@ _selection_store(Efl_Ui_Selection_Type seltype, Selection_Loss_Data *ldata; Eina_Future *f; - ldata = calloc(1, sizeof(Selection_Loss_Data)); - if (!ldata) return; - EFL_UI_TEXT_DATA_GET(obj, sd); efl_text_interactive_selection_cursors_get(obj, &start, &end); - sel = efl_text_markup_range_get(obj, start, end); + sel = efl_text_markup_interactive_markup_range_get(obj, start, end); if ((!sel) || (!sel[0])) return; /* avoid deleting our own selection */ slice.len = strlen(sel); slice.mem = sel; - switch (seltype) { case EFL_UI_SELECTION_TYPE_CLIPBOARD: @@ -1193,12 +1198,16 @@ _selection_store(Efl_Ui_Selection_Type seltype, break; } + ldata = calloc(1, sizeof(Selection_Loss_Data)); + if (!ldata) goto end; + ldata->obj = obj; eina_future_then_easy(f, _selection_lost_cb, NULL, NULL, EINA_VALUE_TYPE_UINT, ldata); //if (seltype == EFL_UI_SELECTION_TYPE_CLIPBOARD) // eina_stringshare_replace(&sd->cut_sel, sel); +end: free(sel); } @@ -1661,26 +1670,26 @@ _efl_ui_text_efl_layout_signal_signal_emit(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data } } -EOLIAN static Eina_Bool -_efl_ui_text_efl_layout_signal_signal_callback_add(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data) +static Eina_Bool +_efl_ui_text_efl_layout_signal_signal_callback_add(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *pd, const char *emission, const char *source, void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb) { Eina_Bool ok; - ok = efl_layout_signal_callback_add(sd->entry_edje, emission, source, func_cb, data); - if (sd->scr_edje) - ok = efl_layout_signal_callback_add(sd->scr_edje, emission, source, func_cb, data); + ok = efl_layout_signal_callback_add(pd->entry_edje, emission, source, func_data, func, func_free_cb); + if (pd->scr_edje) + ok = efl_layout_signal_callback_add(pd->scr_edje, emission, source, func_data, func, func_free_cb); return ok; } -EOLIAN static Eina_Bool -_efl_ui_text_efl_layout_signal_signal_callback_del(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data) +static Eina_Bool +_efl_ui_text_efl_layout_signal_signal_callback_del(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *pd, const char *emission, const char *source, void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb) { Eina_Bool ok; - ok = efl_layout_signal_callback_del(sd->entry_edje, emission, source, func_cb, data); - if (sd->scr_edje) - ok = efl_layout_signal_callback_del(sd->scr_edje, emission, source, func_cb, data); + ok = efl_layout_signal_callback_del(pd->entry_edje, emission, source, func_data, func, func_free_cb); + if (pd->scr_edje) + ok = efl_layout_signal_callback_del(pd->scr_edje, emission, source, func_data, func, func_free_cb); return ok; } @@ -1696,7 +1705,7 @@ _selection_handlers_offset_calc(Evas_Object *obj, Evas_Object *handler) pos = efl_gfx_entity_position_get(sd->text_obj); efl_text_cursor_geometry_get(obj, - efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN), + efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN), EFL_TEXT_CURSOR_TYPE_BEFORE, &cx, &cy, &cw, &ch, NULL, NULL, NULL, NULL); @@ -1734,7 +1743,7 @@ _start_handler_mouse_down_cb(void *data, /* Get the cursors */ 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); + main_cur = efl_text_cursor_get(text_obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); start_pos = efl_text_cursor_position_get(text_obj, sel_start); end_pos = efl_text_cursor_position_get(text_obj, sel_end); @@ -1793,7 +1802,7 @@ _start_handler_mouse_move_cb(void *data, /* Set the main cursor. */ efl_text_cursor_position_set(sd->text_obj, - efl_text_cursor_get(sd->text_obj, EFL_TEXT_CURSOR_GET_MAIN), pos); + efl_text_cursor_get(sd->text_obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN), pos); ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del); sd->long_pressed = EINA_FALSE; @@ -1816,7 +1825,7 @@ _end_handler_mouse_down_cb(void *data, Eo *text_obj = sd->text_obj; 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); + main_cur = efl_text_cursor_get(text_obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); start_pos = efl_text_cursor_position_get(text_obj, sel_start); end_pos = efl_text_cursor_position_get(text_obj, sel_end); @@ -1874,7 +1883,7 @@ _end_handler_mouse_move_cb(void *data, efl_text_cursor_coord_set(sd->text_obj, sd->sel_handler_cursor, cx, cy); pos = efl_text_cursor_position_get(sd->text_obj, sd->sel_handler_cursor); /* Set the main cursor. */ - efl_text_cursor_position_set(sd->text_obj, efl_text_cursor_get(data, EFL_TEXT_CURSOR_GET_MAIN), pos); + efl_text_cursor_position_set(sd->text_obj, efl_text_cursor_get(data, EFL_TEXT_CURSOR_GET_TYPE_MAIN), pos); ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del); sd->long_pressed = EINA_FALSE; } @@ -2062,7 +2071,7 @@ _format_color_parse(const char *str, int slen, /** * @internal * Updates the text properties of the object from the theme. - * + * * This update functions skips any property that was already set, * to allow users to override the theme during the construction of the widget. */ @@ -2117,9 +2126,10 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd) elm_widget_theme_klass_set(obj, "text"); obj = efl_constructor(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); - text_obj = efl_add(EFL_UI_INTERNAL_TEXT_INTERACTIVE_CLASS, obj); + efl_event_callback_forwarder_add(text_obj, EFL_UI_TEXT_EVENT_CHANGED_USER, obj); + efl_event_callback_forwarder_add(text_obj, EFL_UI_TEXT_EVENT_CHANGED, obj); + efl_event_callback_forwarder_add(text_obj, EFL_TEXT_INTERACTIVE_EVENT_TEXT_SELECTION_CHANGED, obj); sd->text_obj = text_obj; sd->text_guide_obj = efl_add(EFL_CANVAS_TEXT_CLASS, obj); sd->text_table = efl_add(EFL_UI_TABLE_CLASS, obj); @@ -2132,7 +2142,7 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd) sd->auto_save = EINA_TRUE; sd->editable = EINA_TRUE; sd->sel_allow = EINA_TRUE; - sd->drop_format = EFL_UI_SELECTION_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE; + sd->drop_format = EFL_UI_SELECTION_FORMAT_MARKUP | EFL_UI_SELECTION_FORMAT_IMAGE; sd->last.scroll = EINA_SIZE2D(0, 0); sd->sel_handler_disabled = EINA_TRUE; @@ -2153,11 +2163,11 @@ _efl_ui_text_efl_object_finalize(Eo *obj, _dnd_pos_cb, NULL, _dnd_drop_cb, NULL); - if (!elm_widget_theme_object_set(obj, wd->resize_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 tp set layout!"); + elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) + CRI("Failed to set layout!"); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_ENTRY); efl_event_callback_add(obj, EFL_EVENT_CALLBACK_ADD, _cb_added, NULL); @@ -2187,11 +2197,11 @@ _efl_ui_text_efl_object_finalize(Eo *obj, _efl_ui_text_changed_user_cb, obj); efl_event_callback_add(sd->text_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, _efl_ui_text_changed_cb, obj); - efl_event_callback_add(sd->text_obj, EFL_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, + efl_event_callback_add(sd->text_obj, EFL_TEXT_INTERACTIVE_EVENT_TEXT_SELECTION_CHANGED, _efl_ui_text_selection_changed_cb, obj); efl_event_callback_add(sd->text_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, _efl_ui_text_cursor_changed_cb, obj); - efl_event_callback_add(sd->text_obj, EFL_GFX_ENTITY_EVENT_MOVE, + efl_event_callback_add(sd->text_obj, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _text_position_changed_cb, obj); evas_object_event_callback_add(sd->entry_edje, EVAS_CALLBACK_MOVE, _efl_ui_text_move_cb, obj); @@ -2205,7 +2215,7 @@ _efl_ui_text_efl_object_finalize(Eo *obj, evas_object_event_callback_add (sd->entry_edje, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move_cb, obj); - efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_RESIZE, + efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _text_size_changed_cb, obj); elm_widget_can_focus_set(obj, EINA_TRUE); @@ -2372,7 +2382,7 @@ _efl_ui_text_selection_handler_disabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Te static void _efl_ui_text_entry_insert(Eo *obj, Efl_Ui_Text_Data *sd, const char *entry) { - Efl_Text_Cursor_Cursor *cur_obj = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); + Efl_Text_Cursor_Cursor *cur_obj = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); efl_text_cursor_text_insert(obj, cur_obj, entry); sd->text_changed = EINA_TRUE; elm_layout_sizing_eval(obj); @@ -2518,21 +2528,24 @@ _efl_ui_text_context_menu_disabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Da return !sd->context_menu; } -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) +EOLIAN static Eina_Error +_efl_ui_text_efl_file_file_set(Eo *obj, Efl_Ui_Text_Data *sd, const char *file) { - ELM_SAFE_FREE(sd->delay_write, ecore_timer_del); - if (sd->auto_save) _save_do(obj); eina_stringshare_replace(&sd->file, file); - Eina_Bool int_ret = _load_do(obj); - return int_ret; + return efl_file_set(efl_super(obj, MY_CLASS), file); } -EOLIAN static void -_efl_ui_text_efl_file_file_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, const char **file, const char **group) +EOLIAN static Eina_Error +_efl_ui_text_efl_file_load(Eo *obj, Efl_Ui_Text_Data *sd) { - if (file) *file = sd->file; - if (group) *group = NULL; + Eina_Error err; + + if (efl_file_loaded_get(obj)) return 0; + err = efl_file_load(efl_super(obj, MY_CLASS)); + if (err) return err; + ELM_SAFE_FREE(sd->delay_write, ecore_timer_del); + if (sd->auto_save) _save_do(obj); + return _load_do(obj); } EOLIAN static void @@ -2555,7 +2568,7 @@ _efl_ui_text_cnp_mode_set(Eo *obj, Efl_Ui_Text_Data *sd, Efl_Ui_Selection_Format if (sd->cnp_mode == EFL_UI_SELECTION_FORMAT_TEXT) dnd_format = EFL_UI_SELECTION_FORMAT_TEXT; else if (cnp_mode == EFL_UI_SELECTION_FORMAT_IMAGE) - dnd_format |= ELM_SEL_FORMAT_IMAGE; + dnd_format |= EFL_UI_SELECTION_FORMAT_IMAGE; elm_drop_target_del(obj, sd->drop_format, _dnd_enter_cb, NULL, @@ -2592,7 +2605,7 @@ _efl_ui_text_scrollable_set(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, Eina_Bool edje_object_part_swallow(sd->entry_edje, "efl.text", sd->scroller); evas_object_clip_set(sd->cursor, efl_ui_internal_text_scroller_viewport_clip_get(sd->scroller)); - efl_event_callback_add(sd->scroller, EFL_GFX_ENTITY_EVENT_RESIZE, + efl_event_callback_add(sd->scroller, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _scroller_size_changed_cb, obj); } else @@ -2972,13 +2985,13 @@ fail: EOLIAN static int _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)); + return efl_text_cursor_position_get(obj, efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN)); } EOLIAN static Eina_Bool _efl_ui_text_efl_access_text_caret_offset_set(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, int offset) { - efl_text_cursor_position_set(obj, efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN), offset); + efl_text_cursor_position_set(obj, efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN), offset); return EINA_TRUE; } @@ -3285,7 +3298,7 @@ _efl_ui_text_efl_access_editable_text_text_content_set(Eo *obj, Efl_Ui_Text_Data EOLIAN static Eina_Bool _efl_ui_text_efl_access_editable_text_insert(Eo *obj, Efl_Ui_Text_Data *pd, const char *string, int position) { - Efl_Text_Cursor_Cursor *cur_obj = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); + Efl_Text_Cursor_Cursor *cur_obj = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); efl_text_cursor_position_set(obj, cur_obj, position); _efl_ui_text_entry_insert(obj, pd, string); @@ -3335,7 +3348,7 @@ _efl_ui_text_efl_access_editable_text_delete(Eo *obj, Efl_Ui_Text_Data *pd, int EOLIAN static Eina_Bool _efl_ui_text_efl_access_editable_text_paste(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, int position) { - Efl_Text_Cursor_Cursor *cur_obj = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); + Efl_Text_Cursor_Cursor *cur_obj = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); efl_text_cursor_position_set(obj, cur_obj, position); efl_ui_text_selection_paste(obj); return EINA_TRUE; @@ -3356,7 +3369,7 @@ _efl_ui_text_efl_access_object_state_set_get(const Eo *obj, Efl_Ui_Text_Data *_p ret = efl_access_object_state_set_get(efl_super(obj, EFL_UI_TEXT_CLASS)); if (efl_text_interactive_editable_get(obj)) - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_EDITABLE); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_EDITABLE); return ret; } @@ -3456,7 +3469,7 @@ _update_text_cursors(Eo *obj) xx = yy = ww = hh = -1; off =_decoration_calc_offset(sd); bidi_cursor = efl_text_cursor_geometry_get(obj, - efl_text_cursor_get(text_obj, EFL_TEXT_CURSOR_GET_MAIN), + efl_text_cursor_get(text_obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN), EFL_TEXT_CURSOR_TYPE_BEFORE, &xx, &yy, &ww, &hh, &xx2, &yy2, NULL, NULL); if (ww < 1) ww = 1; @@ -3627,7 +3640,7 @@ _anchor_format_parse(const char *item) static Anchor * _anchor_get(Eo *obj, Efl_Ui_Text_Data *sd, Efl_Text_Annotate_Annotation *an) { - Anchor *anc; + Anchor *anc; Eina_List *i; const char *str; @@ -3724,7 +3737,7 @@ _anchors_update(Eo *obj, Efl_Ui_Text_Data *sd) { efl_canvas_group_member_add(smart, ob); efl_gfx_stack_above(ob, obj); - efl_canvas_object_clip_set(ob, clip); + efl_canvas_object_clipper_set(ob, clip); efl_canvas_object_pass_events_set(ob, EINA_TRUE); rect->obj = ob; } @@ -3892,13 +3905,14 @@ _decoration_defer_all(Eo *obj) } static void -_efl_ui_text_changed_cb(void *data, const Efl_Event *event EINA_UNUSED) +_efl_ui_text_changed_cb(void *data, const Efl_Event *event) { if (efl_invalidated_get(event->object)) return; EFL_UI_TEXT_DATA_GET(data, sd); sd->text_changed = EINA_TRUE; sd->cursor_update = EINA_TRUE; _update_guide_text(data, sd); + efl_event_callback_call(event->object, EFL_UI_TEXT_EVENT_CHANGED, NULL); elm_layout_sizing_eval(data); _decoration_defer(data); } diff --git a/src/lib/elementary/efl_ui_text.eo b/src/lib/elementary/efl_ui_text.eo index 4441f56f07..c2b0bb1ce6 100644 --- a/src/lib/elementary/efl_ui_text.eo +++ b/src/lib/elementary/efl_ui_text.eo @@ -1,7 +1,7 @@ /* FIXME - Text object must stop using elm_general! */ import elm_general; -class Efl.Ui.Text extends Efl.Ui.Layout implements Efl.Ui.Clickable, +class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Ui.Clickable, Efl.Access.Text, Efl.Access.Editable.Text, Efl.File, Efl.Ui.Selectable, Efl.Text_Interactive { @@ -29,14 +29,10 @@ class Efl.Ui.Text extends Efl.Ui.Layout implements Efl.Ui.Clickable, set { [[Set the attribute to show the input panel in case of only a user's explicit Mouse Up event. It doesn't request to show the input panel even though it has focus. - - @since 1.9 ]] } get { [[Get the attribute to show the input panel in case of only an user's explicit Mouse Up event. - - @since 1.9 ]] } values { @@ -101,7 +97,6 @@ class Efl.Ui.Text extends Efl.Ui.Layout implements Efl.Ui.Clickable, } get { [[This returns whether the entry's selection handlers are disabled.]] - legacy: null; } values { disabled: bool; [[If $true, the selection handlers are disabled.]] @@ -110,14 +105,10 @@ class Efl.Ui.Text extends Efl.Ui.Layout implements Efl.Ui.Clickable, @property input_panel_layout_variation { set { [[Set the input panel layout variation of the entry - - @since 1.8 ]] } get { [[Get the input panel layout variation of the entry - - @since 1.8 ]] } values { @@ -334,7 +325,7 @@ class Efl.Ui.Text extends Efl.Ui.Layout implements Efl.Ui.Clickable, 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.disabled {set;} //Efl.Ui.Widget.widget_sub_object_del; //Elm.Interface_Scrollable.policy { set; } //Elm.Interface_Scrollable.bounce_allow { set; } @@ -362,7 +353,8 @@ class Efl.Ui.Text extends Efl.Ui.Layout implements Efl.Ui.Clickable, Efl.Access.Editable.Text.cut; Efl.Access.Editable.Text.delete; Efl.Access.Editable.Text.paste; - Efl.File.file { get; set; } + Efl.File.file { set; } + Efl.File.load; Efl.Text_Interactive.editable { set; } Efl.Part.part_get; } @@ -385,4 +377,7 @@ class Efl.Ui.Text extends Efl.Ui.Layout implements Efl.Ui.Clickable, anchor,up: Elm.Entry_Anchor_Info; [[called on anchor up]] cursor,changed,manual: void; [[Called on manual cursor change]] } + composite { + Efl.Text_Interactive; + } } diff --git a/src/lib/elementary/efl_ui_text_alert_popup.c b/src/lib/elementary/efl_ui_text_alert_popup.c index 1f8c4601f5..355b8c21f3 100644 --- a/src/lib/elementary/efl_ui_text_alert_popup.c +++ b/src/lib/elementary/efl_ui_text_alert_popup.c @@ -103,7 +103,7 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd, Eina_Size2D obj efl_gfx_entity_size_set(obj, new_size); } - efl_gfx_size_hint_min_set(obj, new_min); + efl_gfx_hint_size_min_set(obj, new_min); } EOLIAN static void @@ -127,7 +127,7 @@ _sizing_eval(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd) //Calculate popup's min size including scroller's min size { elm_label_line_wrap_set(pd->message, ELM_WRAP_NONE); - text_min = efl_gfx_size_hint_combined_min_get(pd->message); + text_min = efl_gfx_hint_size_combined_min_get(pd->message); elm_label_line_wrap_set(pd->message, ELM_WRAP_MIXED); elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_TRUE); @@ -198,7 +198,7 @@ _efl_ui_text_alert_popup_text_set(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd, con // TODO: Change internal component to Efl.Ui.Widget pd->message = elm_label_add(obj); //elm_widget_element_update(obj, pd->message, PART_NAME_TEXT); - efl_gfx_size_hint_weight_set(pd->message, EVAS_HINT_EXPAND, + efl_gfx_hint_weight_set(pd->message, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); efl_content_set(pd->scroller, pd->message); } @@ -270,12 +270,10 @@ _efl_ui_text_alert_popup_efl_object_constructor(Eo *obj, ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); if (!elm_widget_theme_klass_get(obj)) - elm_widget_theme_klass_set(obj, "scroll_alert_popup"); + elm_widget_theme_klass_set(obj, "text_alert_popup"); obj = efl_constructor(efl_super(obj, MY_CLASS)); efl_canvas_object_type_set(obj, MY_CLASS_NAME); - elm_widget_sub_object_parent_add(obj); - pd->scroller = elm_scroller_add(obj); elm_object_style_set(pd->scroller, "popup/no_inset_shadow"); elm_scroller_policy_set(pd->scroller, ELM_SCROLLER_POLICY_OFF, diff --git a/src/lib/elementary/efl_ui_text_alert_popup.eo b/src/lib/elementary/efl_ui_text_alert_popup.eo index fc52f8cf05..0f684866c7 100644 --- a/src/lib/elementary/efl_ui_text_alert_popup.eo +++ b/src/lib/elementary/efl_ui_text_alert_popup.eo @@ -1,6 +1,6 @@ import eina_types; -class Efl.Ui.Text_Alert_Popup extends Efl.Ui.Alert_Popup implements Efl.Text +class @beta Efl.Ui.Text_Alert_Popup extends Efl.Ui.Alert_Popup implements Efl.Text { [[EFL UI Text Alert Popup class]] methods { diff --git a/src/lib/elementary/efl_ui_text_alert_popup_part.eo b/src/lib/elementary/efl_ui_text_alert_popup_part.eo index c572dad4e9..e8d34a0872 100644 --- a/src/lib/elementary/efl_ui_text_alert_popup_part.eo +++ b/src/lib/elementary/efl_ui_text_alert_popup_part.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Text_Alert_Popup_Part extends Efl.Ui.Layout_Part implements Efl.Content, Efl.Text +class @beta Efl.Ui.Text_Alert_Popup_Part extends Efl.Ui.Layout_Part implements Efl.Content, Efl.Text { [[Efl UI Text Alert Popup internal part class]] data: null; diff --git a/src/lib/elementary/efl_ui_text_async.eo b/src/lib/elementary/efl_ui_text_async.eo index 9afc2acf4a..186394812e 100644 --- a/src/lib/elementary/efl_ui_text_async.eo +++ b/src/lib/elementary/efl_ui_text_async.eo @@ -1,8 +1,6 @@ -class Efl.Ui.Text_Async extends Efl.Ui.Text +class @beta Efl.Ui.Text_Async extends Efl.Ui.Text { [[Efl UI text async class - - @since 1.21 ]] data: null; implements { diff --git a/src/lib/elementary/efl_ui_text_editable.eo b/src/lib/elementary/efl_ui_text_editable.eo index d025f017f0..32a987e493 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 extends Efl.Ui.Text +class @beta Efl.Ui.Text_Editable extends 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 index 97b93b5028..f66c99dd2f 100644 --- a/src/lib/elementary/efl_ui_text_factory_emoticons.c +++ b/src/lib/elementary/efl_ui_text_factory_emoticons.c @@ -24,7 +24,7 @@ EOLIAN static Efl_Canvas_Object Eo *o; o = efl_add(EFL_CANVAS_LAYOUT_CLASS, object); - if (!elm_widget_element_update(object, o, key)) + if (elm_widget_element_update(object, o, key) == EFL_UI_THEME_APPLY_ERROR_GENERIC) { elm_widget_element_update(object, o, "wtf"); } diff --git a/src/lib/elementary/efl_ui_text_factory_emoticons.eo b/src/lib/elementary/efl_ui_text_factory_emoticons.eo index 05d4618c68..903f449d6b 100644 --- a/src/lib/elementary/efl_ui_text_factory_emoticons.eo +++ b/src/lib/elementary/efl_ui_text_factory_emoticons.eo @@ -1,8 +1,6 @@ -class Efl.Ui.Text_Factory.Emoticons extends Efl.Object implements Efl.Canvas.Text_Factory +class @beta Efl.Ui.Text_Factory.Emoticons extends Efl.Object implements 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.eo b/src/lib/elementary/efl_ui_text_factory_fallback.eo index 8158c5001a..f41352bee8 100644 --- a/src/lib/elementary/efl_ui_text_factory_fallback.eo +++ b/src/lib/elementary/efl_ui_text_factory_fallback.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Text_Factory.Fallback extends Efl.Object implements Efl.Canvas.Text_Factory +class @beta Efl.Ui.Text_Factory.Fallback extends Efl.Object implements Efl.Canvas.Text_Factory { [[Internal factory for fallback cases. @@ -6,7 +6,6 @@ class Efl.Ui.Text_Factory.Fallback extends Efl.Object implements Efl.Canvas.Text - 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; diff --git a/src/lib/elementary/efl_ui_text_factory_images.c b/src/lib/elementary/efl_ui_text_factory_images.c index 54c5c43aa9..38529e43a9 100644 --- a/src/lib/elementary/efl_ui_text_factory_images.c +++ b/src/lib/elementary/efl_ui_text_factory_images.c @@ -61,20 +61,20 @@ _efl_ui_text_factory_images_efl_canvas_text_factory_create(Eo *obj EINA_UNUSED, e = eina_hash_find(pd->hash, key); if (e) { - efl_file_mmap_set(o, e->file, e->key); + efl_file_key_set(o, e->key); + if (efl_file_mmap_set(o, e->file)) goto error; } 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; + if (efl_file_set(o, key)) goto error; } + if (efl_file_load(o)) goto error; return o; + +error: + efl_del(o); + return NULL; } EOLIAN static Eina_Bool diff --git a/src/lib/elementary/efl_ui_text_factory_images.eo b/src/lib/elementary/efl_ui_text_factory_images.eo index dbbe2a2bb7..eecc69cb91 100644 --- a/src/lib/elementary/efl_ui_text_factory_images.eo +++ b/src/lib/elementary/efl_ui_text_factory_images.eo @@ -1,12 +1,10 @@ -class Efl.Ui.Text_Factory.Images extends Efl.Object implements Efl.Canvas.Text_Factory +class @beta Efl.Ui.Text_Factory.Images extends Efl.Object implements 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 { diff --git a/src/lib/elementary/efl_ui_text_part.eo b/src/lib/elementary/efl_ui_text_part.eo index b1bf6d5bcc..f5d8c0e97e 100644 --- a/src/lib/elementary/efl_ui_text_part.eo +++ b/src/lib/elementary/efl_ui_text_part.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Text_Part extends Efl.Ui.Layout_Part_Text +class @beta Efl.Ui.Text_Part extends Efl.Ui.Layout_Part_Text { [[Efl UI Text internal part class]] data: null; diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c index 095c7a3891..679a68a38a 100644 --- a/src/lib/elementary/efl_ui_textpath.c +++ b/src/lib/elementary/efl_ui_textpath.c @@ -178,7 +178,8 @@ _segment_draw(Efl_Ui_Textpath_Data *pd, int slice_no, double dt, double dist, /* Set mp1, mp2 position according to difference between * previous points and next points. - * It improves smoothness of curve's slope changing. */ + * It improves smoothness of curve's slope changing. + * But, it can cause huge differeces from actual positions. */ mp0_x = *last_x1; mp0_y = *last_y1; mp1_x = *last_x1 + (int) round(vec1.x - vec0.x); @@ -188,6 +189,12 @@ _segment_draw(Efl_Ui_Textpath_Data *pd, int slice_no, double dt, double dist, mp3_x = *last_x2; mp3_y = *last_y2; + /* It reduces differences between actual position and modified position. */ + mp1_x += (int)round(((double)vec1.x - mp1_x) / 2); + mp1_y += (int)round(((double)vec1.y - mp1_y) / 2); + mp2_x += (int)round(((double)vec2.x - mp2_x) / 2); + mp2_y += (int)round(((double)vec2.y - mp2_y) / 2); + 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); @@ -383,6 +390,7 @@ _text_draw(void *data) remained_w -= seg->length; } evas_object_map_enable_set(pd->text_obj, EINA_TRUE); + evas_object_anti_alias_set(pd->text_obj, EINA_TRUE); evas_object_map_set(pd->text_obj, map); evas_map_free(map); @@ -497,7 +505,7 @@ _path_data_get(Eo *obj, Efl_Ui_Textpath_Data *pd, Eina_Bool set_min) } if (set_min) { - efl_gfx_size_hint_min_set(obj, rect.size); + efl_gfx_hint_size_min_set(obj, rect.size); } } } @@ -576,13 +584,12 @@ _efl_ui_textpath_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Textpath_Data *priv) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->text_obj = edje_object_add(evas_object_evas_get(obj)); elm_widget_theme_object_set(obj, priv->text_obj, "textpath", "base", 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_hint_weight_set(priv->text_obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + efl_gfx_hint_align_set(priv->text_obj, EVAS_HINT_FILL, EVAS_HINT_FILL); efl_gfx_entity_visible_set(priv->text_obj, EINA_TRUE); evas_object_smart_member_add(priv->text_obj, obj); @@ -646,13 +653,13 @@ _efl_ui_textpath_efl_text_text_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Da return edje_object_part_text_get(pd->text_obj, "efl.text"); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_textpath_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Textpath_Data *pd) { - Efl_Ui_Theme_Apply_Result ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return EFL_UI_THEME_APPLY_ERROR_GENERIC; elm_widget_theme_object_set(obj, pd->text_obj, "textpath", "base", elm_widget_style_get(obj)); @@ -750,8 +757,9 @@ ELM_PART_OVERRIDE_TEXT_GET(efl_ui_textpath, EFL_UI_TEXTPATH, Efl_Ui_Textpath_Dat EFL_CANVAS_GROUP_ADD_OPS(efl_ui_textpath) #include "efl_ui_textpath.eo.c" +#include "efl_ui_textpath_eo.legacy.c" -#include "efl_ui_textpath_legacy.eo.h" +#include "efl_ui_textpath_legacy_eo.h" #define MY_CLASS_NAME_LEGACY "elm_textpath" /* Legacy APIs */ @@ -777,5 +785,5 @@ elm_textpath_add(Evas_Object *parent) return elm_legacy_add(EFL_UI_TEXTPATH_LEGACY_CLASS, parent); } -#include "efl_ui_textpath_legacy.eo.c" +#include "efl_ui_textpath_legacy_eo.c" diff --git a/src/lib/elementary/efl_ui_textpath.eo b/src/lib/elementary/efl_ui_textpath.eo index 3c9dff4ab7..b403d149f5 100644 --- a/src/lib/elementary/efl_ui_textpath.eo +++ b/src/lib/elementary/efl_ui_textpath.eo @@ -1,13 +1,12 @@ -enum Efl.Ui.Textpath_Direction { +enum @beta Efl.Ui.Textpath_Direction { [[Textpath direction]] cw, [[Clockwise]] ccw [[Counter-clockwise]] } -class Efl.Ui.Textpath extends Efl.Ui.Layout implements Efl.Text, Efl.Gfx.Path +class @beta Efl.Ui.Textpath extends Efl.Ui.Layout_Base implements Efl.Text, Efl.Gfx.Path { [[Efl Ui Textpath class]] - legacy_prefix: elm_textpath; methods { circle_set { [[Set a circle with given center, radius, and start angle.]] diff --git a/src/lib/elementary/efl_ui_textpath_eo.legacy.c b/src/lib/elementary/efl_ui_textpath_eo.legacy.c new file mode 100644 index 0000000000..e810a856dd --- /dev/null +++ b/src/lib/elementary/efl_ui_textpath_eo.legacy.c @@ -0,0 +1,30 @@ + +EAPI void +elm_textpath_circle_set(Efl_Ui_Textpath *obj, double x, double y, double radius, double start_angle, Efl_Ui_Textpath_Direction direction) +{ + efl_ui_textpath_circle_set(obj, x, y, radius, start_angle, direction); +} + +EAPI void +elm_textpath_slice_number_set(Efl_Ui_Textpath *obj, int slice_no) +{ + efl_ui_textpath_slice_number_set(obj, slice_no); +} + +EAPI int +elm_textpath_slice_number_get(const Efl_Ui_Textpath *obj) +{ + return efl_ui_textpath_slice_number_get(obj); +} + +EAPI void +elm_textpath_ellipsis_set(Efl_Ui_Textpath *obj, Eina_Bool ellipsis) +{ + efl_ui_textpath_ellipsis_set(obj, ellipsis); +} + +EAPI Eina_Bool +elm_textpath_ellipsis_get(const Efl_Ui_Textpath *obj) +{ + return efl_ui_textpath_ellipsis_get(obj); +} diff --git a/src/lib/elementary/efl_ui_textpath_eo.legacy.h b/src/lib/elementary/efl_ui_textpath_eo.legacy.h new file mode 100644 index 0000000000..47660c5f59 --- /dev/null +++ b/src/lib/elementary/efl_ui_textpath_eo.legacy.h @@ -0,0 +1,85 @@ +#ifndef _EFL_UI_TEXTPATH_EO_LEGACY_H_ +#define _EFL_UI_TEXTPATH_EO_LEGACY_H_ + +#ifndef _EFL_UI_TEXTPATH_EO_CLASS_TYPE +#define _EFL_UI_TEXTPATH_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Textpath; + +#endif + +#ifndef _EFL_UI_TEXTPATH_EO_TYPES +#define _EFL_UI_TEXTPATH_EO_TYPES + +/** Textpath direction + * + * @ingroup Efl_Ui + */ +typedef enum +{ + EFL_UI_TEXTPATH_DIRECTION_CW = 0, /**< Clockwise */ + EFL_UI_TEXTPATH_DIRECTION_CCW /**< Counter-clockwise */ +} Efl_Ui_Textpath_Direction; + + +#endif + +/** + * @brief Set a circle with given center, radius, and start angle. + * + * @param[in] obj The object. + * @param[in] x X coordinate of center + * @param[in] y Y coordinate of center + * @param[in] radius Radius of the circle + * @param[in] start_angle Start angle of the circle + * @param[in] direction Textpath direction + * + * @ingroup Elm_Textpath_Group + */ +EAPI void elm_textpath_circle_set(Efl_Ui_Textpath *obj, double x, double y, double radius, double start_angle, Efl_Ui_Textpath_Direction direction); + +/** + * @brief The number of slices. The larger the number of slice_num is, The + * better the text follows the path. + * + * @param[in] obj The object. + * @param[in] slice_no Number of slices + * + * @ingroup Elm_Textpath_Group + */ +EAPI void elm_textpath_slice_number_set(Efl_Ui_Textpath *obj, int slice_no); + +/** + * @brief The number of slices. The larger the number of slice_num is, The + * better the text follows the path. + * + * @param[in] obj The object. + * + * @return Number of slices + * + * @ingroup Elm_Textpath_Group + */ +EAPI int elm_textpath_slice_number_get(const Efl_Ui_Textpath *obj); + +/** + * @brief Control the ellipsis behavior of the textpath. + * + * @param[in] obj The object. + * @param[in] ellipsis To ellipsis text or not + * + * @ingroup Elm_Textpath_Group + */ +EAPI void elm_textpath_ellipsis_set(Efl_Ui_Textpath *obj, Eina_Bool ellipsis); + +/** + * @brief Control the ellipsis behavior of the textpath. + * + * @param[in] obj The object. + * + * @return To ellipsis text or not + * + * @ingroup Elm_Textpath_Group + */ +EAPI Eina_Bool elm_textpath_ellipsis_get(const Efl_Ui_Textpath *obj); + +#endif diff --git a/src/lib/elementary/efl_ui_textpath_legacy.eo b/src/lib/elementary/efl_ui_textpath_legacy.eo deleted file mode 100644 index 7ac3572ea2..0000000000 --- a/src/lib/elementary/efl_ui_textpath_legacy.eo +++ /dev/null @@ -1,9 +0,0 @@ -class Efl.Ui.Textpath_Legacy extends Efl.Ui.Textpath implements Efl.Ui.Legacy -{ - [[Textpath widget]] - data: null; - implements { - class.constructor; - Efl.Object.constructor; - } -} diff --git a/src/lib/elementary/efl_ui_textpath_legacy_eo.c b/src/lib/elementary/efl_ui_textpath_legacy_eo.c new file mode 100644 index 0000000000..401a626321 --- /dev/null +++ b/src/lib/elementary/efl_ui_textpath_legacy_eo.c @@ -0,0 +1,35 @@ + +Efl_Object *_efl_ui_textpath_legacy_efl_object_constructor(Eo *obj, void *pd); + + +static Eina_Bool +_efl_ui_textpath_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_TEXTPATH_LEGACY_EXTRA_OPS +#define EFL_UI_TEXTPATH_LEGACY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _efl_ui_textpath_legacy_efl_object_constructor), + EFL_UI_TEXTPATH_LEGACY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_textpath_legacy_class_desc = { + EO_VERSION, + "Efl.Ui.Textpath_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _efl_ui_textpath_legacy_class_initializer, + _efl_ui_textpath_legacy_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_textpath_legacy_class_get, &_efl_ui_textpath_legacy_class_desc, EFL_UI_TEXTPATH_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/efl_ui_textpath_legacy_eo.h b/src/lib/elementary/efl_ui_textpath_legacy_eo.h new file mode 100644 index 0000000000..9a721634b1 --- /dev/null +++ b/src/lib/elementary/efl_ui_textpath_legacy_eo.h @@ -0,0 +1,26 @@ +#ifndef _EFL_UI_TEXTPATH_LEGACY_EO_H_ +#define _EFL_UI_TEXTPATH_LEGACY_EO_H_ + +#ifndef _EFL_UI_TEXTPATH_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_TEXTPATH_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Textpath_Legacy; + +#endif + +#ifndef _EFL_UI_TEXTPATH_LEGACY_EO_TYPES +#define _EFL_UI_TEXTPATH_LEGACY_EO_TYPES + + +#endif +#ifdef EFL_BETA_API_SUPPORT +/** Textpath widget + * + * @ingroup Efl_Ui_Textpath_Legacy + */ +#define EFL_UI_TEXTPATH_LEGACY_CLASS efl_ui_textpath_legacy_class_get() + +EWAPI const Efl_Class *efl_ui_textpath_legacy_class_get(void); +#endif /* EFL_BETA_API_SUPPORT */ + +#endif diff --git a/src/lib/elementary/efl_ui_textpath_legacy_eo.legacy.h b/src/lib/elementary/efl_ui_textpath_legacy_eo.legacy.h new file mode 100644 index 0000000000..090ad494df --- /dev/null +++ b/src/lib/elementary/efl_ui_textpath_legacy_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_TEXTPATH_LEGACY_EO_LEGACY_H_ +#define _EFL_UI_TEXTPATH_LEGACY_EO_LEGACY_H_ + +#ifndef _EFL_UI_TEXTPATH_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_TEXTPATH_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Textpath_Legacy; + +#endif + +#ifndef _EFL_UI_TEXTPATH_LEGACY_EO_TYPES +#define _EFL_UI_TEXTPATH_LEGACY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/efl_ui_textpath_part.eo b/src/lib/elementary/efl_ui_textpath_part.eo index 8a51a53ffe..8a25b9207b 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 extends Efl.Ui.Layout_Part_Text +class @beta Efl.Ui.Textpath_Part extends Efl.Ui.Layout_Part_Text { [[Efl UI Textpath internal part class]] data: null; diff --git a/src/lib/elementary/efl_ui_theme.eo b/src/lib/elementary/efl_ui_theme.eo index 8f18db4021..73805a90a5 100644 --- a/src/lib/elementary/efl_ui_theme.eo +++ b/src/lib/elementary/efl_ui_theme.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Theme extends Efl.Object +class @beta Efl.Ui.Theme extends Efl.Object { [[Efl Ui Theme class]] eo_prefix: efl_ui_theme; diff --git a/src/lib/elementary/efl_ui_timepicker.c b/src/lib/elementary/efl_ui_timepicker.c index dac4170bc2..732f8aefdc 100644 --- a/src/lib/elementary/efl_ui_timepicker.c +++ b/src/lib/elementary/efl_ui_timepicker.c @@ -218,16 +218,14 @@ _efl_ui_timepicker_efl_object_constructor(Eo *obj, Efl_Ui_Timepicker_Data *pd EI 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))) + 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)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) 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; diff --git a/src/lib/elementary/efl_ui_timepicker.eo b/src/lib/elementary/efl_ui_timepicker.eo index d91a76137f..7e2d48cced 100644 --- a/src/lib/elementary/efl_ui_timepicker.eo +++ b/src/lib/elementary/efl_ui_timepicker.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Timepicker extends Efl.Ui.Layout +class @beta Efl.Ui.Timepicker extends Efl.Ui.Layout_Base { [[Timepicker widget diff --git a/src/lib/elementary/efl_ui_video.c b/src/lib/elementary/efl_ui_video.c index 3d7bf74e5a..75b6b155dc 100644 --- a/src/lib/elementary/efl_ui_video.c +++ b/src/lib/elementary/efl_ui_video.c @@ -242,17 +242,16 @@ _efl_ui_video_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Video_Data *priv) if (!elm_widget_theme_klass_get(obj)) elm_widget_theme_klass_set(obj, "video"); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_TRUE); priv->emotion = emotion_object_add(evas_object_evas_get(obj)); if (!emotion_object_init(priv->emotion, NULL)) CRI("Failed to init emotion object"); - if (!elm_widget_theme_object_set(obj, wd->resize_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))) + elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); if (elm_widget_is_legacy(obj)) @@ -288,14 +287,19 @@ _efl_ui_video_efl_object_constructor(Eo *obj, Efl_Ui_Video_Data *_pd EINA_UNUSED return obj; } -EOLIAN static Eina_Bool -_efl_ui_video_efl_file_file_set(Eo *obj, Efl_Ui_Video_Data *sd, const char *filename, const char *key EINA_UNUSED) +EOLIAN static Eina_Error +_efl_ui_video_efl_file_load(Eo *obj, Efl_Ui_Video_Data *sd) { + const char *file = efl_file_get(obj); + EINA_SAFETY_ON_NULL_RETURN_VAL(file, EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST); + + if (eina_streq(file, emotion_object_file_get(sd->emotion)) && efl_file_loaded_get(sd->emotion)) return 0; + if (sd->remember) emotion_object_last_position_save(sd->emotion); sd->stop = EINA_FALSE; - if (!emotion_object_file_set(sd->emotion, filename)) return EINA_FALSE; + if (!emotion_object_file_set(sd->emotion, file)) return EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST; - if (filename && ((!strncmp(filename, "file://", 7)) || (!strstr(filename, "://")))) + if (file && ((!strncmp(file, "file://", 7)) || (!strstr(file, "://")))) emotion_object_last_position_load(sd->emotion); if(elm_widget_is_legacy(obj)) @@ -303,14 +307,7 @@ _efl_ui_video_efl_file_file_set(Eo *obj, Efl_Ui_Video_Data *sd, const char *file else elm_layout_signal_emit(obj, "efl,video,load", "efl"); - return EINA_TRUE; -} - -EOLIAN static void -_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); + return 0; } EOLIAN static Evas_Object* @@ -423,8 +420,9 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_video, Efl_Ui_Video_Data) EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_video) #include "efl_ui_video.eo.c" +#include "efl_ui_video_eo.legacy.c" -#include "efl_ui_video_legacy.eo.h" +#include "efl_ui_video_legacy_eo.h" #define MY_CLASS_NAME_LEGACY "elm_video" @@ -454,13 +452,13 @@ elm_video_add(Evas_Object *parent) EAPI Eina_Bool elm_video_file_set(Eo *obj, const char *filename) { - return efl_file_set((Eo *) obj, filename, NULL); + return efl_file_simple_load((Eo *) obj, filename, NULL); } EAPI void elm_video_file_get(Eo *obj, const char **filename) { - efl_file_get((Eo *) obj, filename, NULL); + efl_file_simple_get((Eo *) obj, filename, NULL); } EAPI void @@ -535,4 +533,4 @@ elm_video_pause(Evas_Object *obj) efl_player_play_set(obj, EINA_FALSE); } -#include "efl_ui_video_legacy.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 a7c8378933..ab9c3ce48d 100644 --- a/src/lib/elementary/efl_ui_video.eo +++ b/src/lib/elementary/efl_ui_video.eo @@ -1,7 +1,6 @@ -class Efl.Ui.Video extends Efl.Ui.Layout implements Efl.Player, Efl.Access.Widget.Action +class @beta Efl.Ui.Video extends Efl.Ui.Layout_Base implements Efl.File, Efl.Player, Efl.Access.Widget.Action { [[Efl UI video class]] - legacy_prefix: elm_video; methods { @property remember_position { set { @@ -42,11 +41,14 @@ class Efl.Ui.Video extends Efl.Ui.Layout implements Efl.Player, Efl.Access.Widge } implements { Efl.Object.constructor; - Efl.File.file { get; set; } - Efl.Ui.Widget.widget_event; + Efl.File.load; + Efl.Ui.Widget.widget_input_event_handler; Efl.Access.Widget.Action.elm_actions { get; } Efl.Player.start; Efl.Player.stop; Efl.Player.play { get; set; } } + composite { + Efl.Player; + } } diff --git a/src/lib/elementary/efl_ui_video.h b/src/lib/elementary/efl_ui_video.h index d015d1c0d7..c4cfc55815 100644 --- a/src/lib/elementary/efl_ui_video.h +++ b/src/lib/elementary/efl_ui_video.h @@ -54,9 +54,7 @@ * ELM_PLAYER_CLASS */ -#ifdef EFL_EO_API_SUPPORT #include "efl_ui_video_eo.h" -#endif #ifndef EFL_NOLEGACY_API_SUPPORT #include "efl_ui_video_legacy.h" #endif diff --git a/src/lib/elementary/efl_ui_video_eo.legacy.c b/src/lib/elementary/efl_ui_video_eo.legacy.c new file mode 100644 index 0000000000..09e0e980ae --- /dev/null +++ b/src/lib/elementary/efl_ui_video_eo.legacy.c @@ -0,0 +1,24 @@ + +EAPI void +elm_video_remember_position_set(Efl_Ui_Video *obj, Eina_Bool remember) +{ + efl_ui_video_remember_position_set(obj, remember); +} + +EAPI Eina_Bool +elm_video_remember_position_get(const Efl_Ui_Video *obj) +{ + return efl_ui_video_remember_position_get(obj); +} + +EAPI Efl_Canvas_Object * +elm_video_emotion_get(const Efl_Ui_Video *obj) +{ + return efl_ui_video_emotion_get(obj); +} + +EAPI const char * +elm_video_title_get(const Efl_Ui_Video *obj) +{ + return efl_ui_video_title_get(obj); +} diff --git a/src/lib/elementary/efl_ui_video_eo.legacy.h b/src/lib/elementary/efl_ui_video_eo.legacy.h new file mode 100644 index 0000000000..463eda87ff --- /dev/null +++ b/src/lib/elementary/efl_ui_video_eo.legacy.h @@ -0,0 +1,70 @@ +#ifndef _EFL_UI_VIDEO_EO_LEGACY_H_ +#define _EFL_UI_VIDEO_EO_LEGACY_H_ + +#ifndef _EFL_UI_VIDEO_EO_CLASS_TYPE +#define _EFL_UI_VIDEO_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Video; + +#endif + +#ifndef _EFL_UI_VIDEO_EO_TYPES +#define _EFL_UI_VIDEO_EO_TYPES + + +#endif + +/** + * @brief Set whether the object can remember the last played position. + * + * @note This API only serves as indication. System support is required. + * + * @param[in] obj The object. + * @param[in] remember @c true when the object can remember the last position, + * @c false otherwise + * + * @ingroup Elm_Video_Group + */ +EAPI void elm_video_remember_position_set(Efl_Ui_Video *obj, Eina_Bool remember); + +/** + * @brief Set whether the object can remember the last played position. + * + * @note This API only serves as indication. System support is required. + * + * @param[in] obj The object. + * + * @return @c true when the object can remember the last position, @c false + * otherwise + * + * @ingroup Elm_Video_Group + */ +EAPI Eina_Bool elm_video_remember_position_get(const Efl_Ui_Video *obj); + +/** + * @brief Get the underlying Emotion object. + * + * @param[in] obj The object. + * + * @return The underlying Emotion object. + * + * @ingroup Elm_Video_Group + */ +EAPI Efl_Canvas_Object *elm_video_emotion_get(const Efl_Ui_Video *obj); + +/** + * @brief Get the title (for instance DVD title) from this emotion object. + * + * This function is only useful when playing a DVD. + * + * @note Don't change or free the string returned by this function. + * + * @param[in] obj The object. + * + * @return A string containing the title. + * + * @ingroup Elm_Video_Group + */ +EAPI const char *elm_video_title_get(const Efl_Ui_Video *obj); + +#endif diff --git a/src/lib/elementary/efl_ui_video_legacy.eo b/src/lib/elementary/efl_ui_video_legacy.eo deleted file mode 100644 index 4d5efc8def..0000000000 --- a/src/lib/elementary/efl_ui_video_legacy.eo +++ /dev/null @@ -1,9 +0,0 @@ -class Efl.Ui.Video_Legacy extends Efl.Ui.Video implements 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 70ac16a718..1d4d3c3621 100644 --- a/src/lib/elementary/efl_ui_video_legacy.h +++ b/src/lib/elementary/efl_ui_video_legacy.h @@ -169,4 +169,4 @@ EAPI void elm_video_stop(Evas_Object *obj); */ EAPI void elm_video_pause(Evas_Object *obj); -#include "efl_ui_video.eo.legacy.h" +#include "efl_ui_video_eo.legacy.h" diff --git a/src/lib/elementary/efl_ui_video_legacy_eo.c b/src/lib/elementary/efl_ui_video_legacy_eo.c new file mode 100644 index 0000000000..1c49e44ca4 --- /dev/null +++ b/src/lib/elementary/efl_ui_video_legacy_eo.c @@ -0,0 +1,35 @@ + +Efl_Object *_efl_ui_video_legacy_efl_object_constructor(Eo *obj, void *pd); + + +static Eina_Bool +_efl_ui_video_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_VIDEO_LEGACY_EXTRA_OPS +#define EFL_UI_VIDEO_LEGACY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _efl_ui_video_legacy_efl_object_constructor), + EFL_UI_VIDEO_LEGACY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_video_legacy_class_desc = { + EO_VERSION, + "Efl.Ui.Video_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _efl_ui_video_legacy_class_initializer, + _efl_ui_video_legacy_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_video_legacy_class_get, &_efl_ui_video_legacy_class_desc, EFL_UI_VIDEO_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/efl_ui_video_legacy_eo.h b/src/lib/elementary/efl_ui_video_legacy_eo.h new file mode 100644 index 0000000000..f6d5382e38 --- /dev/null +++ b/src/lib/elementary/efl_ui_video_legacy_eo.h @@ -0,0 +1,26 @@ +#ifndef _EFL_UI_VIDEO_LEGACY_EO_H_ +#define _EFL_UI_VIDEO_LEGACY_EO_H_ + +#ifndef _EFL_UI_VIDEO_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_VIDEO_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Video_Legacy; + +#endif + +#ifndef _EFL_UI_VIDEO_LEGACY_EO_TYPES +#define _EFL_UI_VIDEO_LEGACY_EO_TYPES + + +#endif +#ifdef EFL_BETA_API_SUPPORT +/** Efl UI video class + * + * @ingroup Efl_Ui_Video_Legacy + */ +#define EFL_UI_VIDEO_LEGACY_CLASS efl_ui_video_legacy_class_get() + +EWAPI const Efl_Class *efl_ui_video_legacy_class_get(void); +#endif /* EFL_BETA_API_SUPPORT */ + +#endif diff --git a/src/lib/elementary/efl_ui_video_legacy_eo.legacy.h b/src/lib/elementary/efl_ui_video_legacy_eo.legacy.h new file mode 100644 index 0000000000..01c7cea0dc --- /dev/null +++ b/src/lib/elementary/efl_ui_video_legacy_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_VIDEO_LEGACY_EO_LEGACY_H_ +#define _EFL_UI_VIDEO_LEGACY_EO_LEGACY_H_ + +#ifndef _EFL_UI_VIDEO_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_VIDEO_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Video_Legacy; + +#endif + +#ifndef _EFL_UI_VIDEO_LEGACY_EO_TYPES +#define _EFL_UI_VIDEO_LEGACY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index 415882af0d..872e32a744 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -6,7 +6,6 @@ #define EFL_ACCESS_COMPONENT_PROTECTED #define ELM_WIDGET_PROTECTED #define ELM_WIDGET_ITEM_PROTECTED -#define EFL_CANVAS_OBJECT_BETA #define EFL_INPUT_EVENT_PROTECTED #define EFL_UI_L10N_PROTECTED #define EFL_UI_FOCUS_OBJECT_PROTECTED @@ -18,6 +17,7 @@ #include "elm_priv.h" #include "elm_widget_container.h" #include "elm_interface_scrollable.h" +#include "elm_pan_eo.h" #include "elm_part_helper.h" #include "elm_widget_combobox.h" @@ -30,9 +30,6 @@ #define MY_CLASS_NAME "Efl_Ui_Widget" #define MY_CLASS_NAME_LEGACY "elm_widget" -#define ELM_WIDGET_DATA_GET(o, wd) \ - Elm_Widget_Smart_Data *wd = efl_data_scope_get(o, MY_CLASS) - #define API_ENTRY \ Elm_Widget_Smart_Data *sd = NULL; \ if (!_elm_widget_is(obj) || \ @@ -162,7 +159,7 @@ static inline Eina_Bool _is_focusable(Evas_Object *obj) { API_ENTRY return EINA_FALSE; - return sd->can_focus || (sd->child_can_focus); + return sd->can_focus || (sd->logical.child_count > 0); } static inline Eina_Bool @@ -184,8 +181,6 @@ _elm_scrollable_is(const Evas_Object *obj) efl_isa(obj, EFL_UI_SCROLLABLE_INTERACTIVE_INTERFACE); } -static void -elm_widget_disabled_internal(Eo *obj, Eina_Bool disabled); static void _on_sub_obj_del(void *data, const Efl_Event *event); static void _propagate_event(void *data, const Efl_Event *eo_event); @@ -237,7 +232,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_BASE_CLASS)) str = edje_object_data_get(elm_layout_edje_get(it->view), "focus_highlight"); else str = edje_object_data_get(it->view, "focus_highlight"); @@ -253,88 +248,21 @@ _elm_widget_item_highlight_in_theme(Evas_Object *obj, Elm_Object_Item *eo_it) void _elm_widget_focus_highlight_start(const Evas_Object *obj) { - Evas_Object *top = elm_widget_top_get(obj); + Evas_Object *top = efl_provider_find(obj, EFL_UI_WIN_CLASS); - if (top && efl_isa(top, EFL_UI_WIN_CLASS)) - _elm_win_focus_highlight_start(top); + EINA_SAFETY_ON_FALSE_RETURN(efl_isa(top, EFL_UI_WIN_CLASS)); + + _elm_win_focus_highlight_start(top); } Evas_Object * _efl_ui_widget_focus_highlight_object_get(const Evas_Object *obj) { - Evas_Object *top = elm_widget_top_get(obj); + Evas_Object *top = efl_provider_find(obj, EFL_UI_WIN_CLASS); - if (top && efl_isa(top, EFL_UI_WIN_CLASS)) - return _elm_win_focus_highlight_object_get(top); - return NULL; -} + EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(top, EFL_UI_WIN_CLASS), NULL); -EOLIAN static Eina_Bool -_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); - - if (win && efl_isa(win, EFL_UI_WIN_CLASS)) - return elm_win_focus_highlight_enabled_get(win); - - return EINA_FALSE; -} - -EOLIAN static void -_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); - - if (win && efl_isa(win, EFL_UI_WIN_CLASS)) - elm_win_focus_highlight_enabled_set(win, enable); -} - -EOLIAN static Eina_Bool -_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); - - if (win && efl_isa(win, EFL_UI_WIN_CLASS)) - return elm_win_focus_highlight_animate_get(win); - - return EINA_FALSE; -} - -EOLIAN static void -_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); - - if (win && efl_isa(win, EFL_UI_WIN_CLASS)) - elm_win_focus_highlight_animate_set(win, enable); -} - -EOLIAN static Eina_Bool -_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); - - if (win && efl_isa(win, EFL_UI_WIN_CLASS)) - return efl_ui_widget_focus_highlight_style_set(win, style); - - return EINA_FALSE; -} - -EOLIAN static const char * -_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); - - if (win && efl_isa(win, EFL_UI_WIN_CLASS)) - return elm_win_focus_highlight_style_get(win); - - return NULL; + return _elm_win_focus_highlight_object_get(top); } static Eina_Bool @@ -403,13 +331,13 @@ _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_OBJECT_EVENT_MANAGER_CHANGED, _manager_changed_cb, obj); + efl_event_callback_del(pd->manager.provider, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_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_OBJECT_EVENT_MANAGER_CHANGED, _manager_changed_cb, obj); + efl_event_callback_add(pd->manager.provider, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_MANAGER_CHANGED, _manager_changed_cb, obj); } return old; @@ -553,12 +481,7 @@ _logical_parent_eval(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd, Eina_Bool s { if (efl_isa(pd->logical.parent, EFL_UI_WIDGET_CLASS)) { - ELM_WIDGET_DATA_GET(pd->logical.parent, logical_wd); - if (!logical_wd) - { - ERR("Widget parent has the wrong type!"); - return NULL; - } + ELM_WIDGET_DATA_GET_OR_RETURN(pd->logical.parent, logical_wd, NULL); logical_wd->logical.child_count --; } old = pd->logical.parent; @@ -569,12 +492,7 @@ _logical_parent_eval(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd, Eina_Bool s { if (efl_isa(parent, EFL_UI_WIDGET_CLASS)) { - ELM_WIDGET_DATA_GET(parent, parent_wd); - if (!parent_wd) - { - ERR("Widget parent has the wrong type!"); - return NULL; - } + ELM_WIDGET_DATA_GET_OR_RETURN(parent, parent_wd, NULL); parent_wd->logical.child_count ++; } pd->logical.parent = parent; @@ -620,13 +538,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_OBJECT_EVENT_LOGICAL_CHANGED, old_registered_parent); + EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_PARENT_CHANGED, old_registered_parent); } if (old_registered_manager != pd->focus.manager) { efl_event_callback_call(obj, - EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, old_registered_manager); + EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_MANAGER_CHANGED, old_registered_manager); } } @@ -955,11 +873,11 @@ _efl_ui_widget_efl_gfx_entity_visible_set(Eo *obj, Elm_Widget_Smart_Data *pd, Ei { efl_access_added(obj); if (_elm_widget_onscreen_is(obj)) - efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_SHOWING, EINA_TRUE); + efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_TYPE_SHOWING, EINA_TRUE); } else { - efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_SHOWING, EINA_FALSE); + efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_TYPE_SHOWING, EINA_FALSE); } } @@ -1022,7 +940,7 @@ _efl_ui_widget_efl_canvas_object_is_frame_object_set(Eo *obj, Elm_Widget_Smart_D } EOLIAN static void -_efl_ui_widget_efl_canvas_object_clip_set(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Evas_Object *clip) +_efl_ui_widget_efl_canvas_object_clipper_set(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Evas_Object *clip) { Eina_Iterator *it; Evas_Object *o; @@ -1030,7 +948,7 @@ _efl_ui_widget_efl_canvas_object_clip_set(Eo *obj, Elm_Widget_Smart_Data *_pd EI if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 0, clip)) return; - efl_canvas_object_clip_set(efl_super(obj, MY_CLASS), clip); + efl_canvas_object_clipper_set(efl_super(obj, MY_CLASS), clip); it = evas_object_smart_iterator_new(obj); EINA_ITERATOR_FOREACH(it, o) @@ -1071,11 +989,11 @@ _efl_ui_widget_efl_canvas_group_group_member_add(Eo *obj, Elm_Widget_Smart_Data } EOLIAN static void -_efl_ui_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_remove(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); - efl_canvas_group_member_del(efl_super(obj, MY_CLASS), child); + efl_canvas_group_member_remove(efl_super(obj, MY_CLASS), child); } // internal funcs @@ -1221,10 +1139,6 @@ elm_widget_focus_region_show(Eo *obj) } } -EOLIAN static void -_efl_ui_widget_widget_parent_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Evas_Object *parent EINA_UNUSED) -{ -} EAPI Eina_Bool elm_widget_api_check(int ver) @@ -1263,31 +1177,43 @@ _efl_ui_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd { } -EAPI Efl_Ui_Theme_Apply_Result +static void +_elm_widget_theme_helper(Eina_Error err, Eina_Bool *err_default, Eina_Bool *err_generic) +{ + if (err == EFL_UI_THEME_APPLY_ERROR_DEFAULT) + *err_default = EINA_TRUE; + else if (err == EFL_UI_THEME_APPLY_ERROR_GENERIC) + *err_generic = EINA_TRUE; +} + +EAPI Eina_Error elm_widget_theme(Evas_Object *obj) { const Eina_List *l; Evas_Object *child; Elm_Tooltip *tt; Elm_Cursor *cur; - Efl_Ui_Theme_Apply_Result ret = EFL_UI_THEME_APPLY_RESULT_SUCCESS; + Eina_Bool err_default = EINA_FALSE; + Eina_Bool err_generic = EINA_FALSE; - API_ENTRY return EFL_UI_THEME_APPLY_RESULT_FAIL; + API_ENTRY return EFL_UI_THEME_APPLY_ERROR_GENERIC; EINA_LIST_FOREACH(sd->subobjs, l, child) if (_elm_widget_is(child)) - ret &= elm_widget_theme(child); + _elm_widget_theme_helper(elm_widget_theme(child), &err_default, &err_generic); - if (sd->hover_obj) ret &= elm_widget_theme(sd->hover_obj); + if (sd->hover_obj) + _elm_widget_theme_helper(elm_widget_theme(sd->hover_obj), &err_default, &err_generic); EINA_LIST_FOREACH(sd->tooltips, l, tt) elm_tooltip_theme(tt); EINA_LIST_FOREACH(sd->cursors, l, cur) elm_cursor_theme(cur); - ret &= efl_ui_widget_theme_apply(obj); - - return ret; + _elm_widget_theme_helper(efl_ui_widget_theme_apply(obj), &err_default, &err_generic); + if (err_generic) return EFL_UI_THEME_APPLY_ERROR_GENERIC; + if (err_default) return EFL_UI_THEME_APPLY_ERROR_DEFAULT; + return EFL_UI_THEME_APPLY_ERROR_NONE; } EAPI void @@ -1335,14 +1261,12 @@ elm_widget_theme_specific(Evas_Object *obj, efl_ui_widget_theme_apply(obj); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _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)) - elm_widget_disabled_internal(obj, elm_widget_disabled_get(obj)); - return EFL_UI_THEME_APPLY_RESULT_SUCCESS; + return EFL_UI_THEME_APPLY_ERROR_NONE; } /** @@ -1415,20 +1339,6 @@ _efl_ui_widget_efl_ui_i18n_mirrored_automatic_set(Eo *obj, Elm_Widget_Smart_Data } } -EOLIAN static void -_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; - - if (sd->on_show_region_data && sd->on_show_region_data_free) - sd->on_show_region_data_free(sd->on_show_region_data); - - sd->on_show_region = func; - sd->on_show_region_data = data; - sd->on_show_region_data_free = func_free_cb; -} - /* * @internal * @@ -1452,137 +1362,154 @@ elm_widget_sub_object_parent_add(Evas_Object *sobj) return elm_widget_sub_object_add(parent, sobj); } -/* - * @internal - * - * Add sobj to obj's sub object. - * - * What does elementary sub object mean? This is unique in elementary, it - * handles overall elementary policies between parent and sub objects. - * focus, access, deletion, theme, scale, mirror, scrollable child get, - * translate, name find, display mode set, orientation set, tree dump - * AUTOMATICALLY. - * - * @see elm_widget_sub_object_parent_add() - */ -EOLIAN static Eina_Bool -_efl_ui_widget_widget_sub_object_add(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Object *sobj) +static int +_disabled_counter_get(Eo *widget) { - Eina_Bool mirrored, pmirrored = efl_ui_mirrored_get(obj); + ELM_WIDGET_DATA_GET_OR_RETURN(widget, pd, -1); - EINA_SAFETY_ON_TRUE_RETURN_VAL(obj == sobj, EINA_FALSE); + return pd->disabled; +} - if (sobj == sd->parent_obj) +static void +_mirror_disabled_state(Eo *obj, Elm_Widget_Smart_Data *pd, int disabled_delta) +{ + int prev_disabled = pd->disabled; + + pd->disabled = (pd->parent_obj ? _disabled_counter_get(pd->parent_obj) : 0) + disabled_delta; + + //The current disabled state is the same as the parent + //when the parent is assigned or changed, no further action is required. + if (((prev_disabled > 0 && pd->disabled > 0)) || + ((prev_disabled <= 0 && pd->disabled <= 0))) + return; + + //we should not call disabled_set when things are invalidated + //otherwise we will unleashe an amount of errors in efl_ui_layout + if (efl_invalidated_get(obj)) return; + + if (pd->disabled > 0) { - /* in this case, sobj must be an elm widget, or something - * very wrong is happening */ - if (!_elm_widget_is(sobj)) return EINA_FALSE; - - if (!elm_widget_sub_object_del(sobj, obj)) return EINA_FALSE; - WRN("You passed a parent object of obj = %p as the sub object = %p!", - obj, sobj); - } - - if (_elm_widget_is(sobj)) - { - ELM_WIDGET_DATA_GET(sobj, sdc); - - if (sdc->parent_obj == obj) goto end; - if (sdc->parent_obj) - { - if (!elm_widget_sub_object_del(sdc->parent_obj, sobj)) - return EINA_FALSE; - } - sdc->parent_obj = obj; - - _full_eval(sobj, sdc); - - if (!sdc->on_create) - efl_ui_widget_on_orientation_update(sobj, sd->orient_mode); - else - sdc->orient_mode = sd->orient_mode; - - if (!sdc->on_create) - { - if (!sdc->disabled && (elm_widget_disabled_get(obj))) - { - efl_ui_widget_on_disabled_update(sobj, EINA_TRUE); - } - } - - _elm_widget_top_win_focused_set(sobj, sd->top_win_focused); - - /* update child focusable-ness on self and parents, now that a - * focusable child got in */ - if (!sd->child_can_focus && (_is_focusable(sobj))) - { - Elm_Widget_Smart_Data *sdp = sd; - - sdp->child_can_focus = EINA_TRUE; - while (sdp->parent_obj) - { - sdp = efl_data_scope_get(sdp->parent_obj, MY_CLASS); - - if (sdp->child_can_focus) break; - - sdp->child_can_focus = EINA_TRUE; - } - } + pd->disabled --; + efl_ui_widget_disabled_set(obj, EINA_TRUE); } else { - void *data = evas_object_data_get(sobj, "elm-parent"); - - if (data) - { - if (data == obj) goto end; - if (!elm_widget_sub_object_del(data, sobj)) return EINA_FALSE; - } + pd->disabled ++; + efl_ui_widget_disabled_set(obj, EINA_FALSE); } +} + +EOLIAN static void +_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Widget_Smart_Data *pd, Efl_Ui_Widget *parent) +{ + Efl_Ui_Widget *old_parent; + //check if we are in the subobject list of parents + if (parent) + { + ELM_WIDGET_DATA_GET_OR_RETURN(parent, ppd); + EINA_SAFETY_ON_FALSE_RETURN(eina_list_data_find(ppd->subobjs, obj)); + } + + /* NOTE: In the following two lines, 'obj' is correct. Do not change it. + * Due to elementary's scale policy, scale and prev_scale can be different in + * some cases. This happens when obj's previous parent and new parent have + * different scale value. + * For example, if obj's previous parent's scale is 5 and new parent's scale + * is 2 while obj's scale is 0. Then 'prev_pscale' is 5 and 'scale' is 2. So + * we need to reset obj's scale to 5. + * Note that each widget's scale is 1.0 by default. + */ + double scale, prev_scale = efl_gfx_entity_scale_get(obj); + Elm_Theme *th, *prev_th = elm_widget_theme_get(obj); + int disabled_delta = pd->disabled - (pd->parent_obj ? _disabled_counter_get(pd->parent_obj) : 0); + + old_parent = pd->parent_obj; + pd->parent_obj = parent; + + // now lets sync up all states + if (pd->parent_obj) + { + Eina_Bool mirrored, pmirrored = efl_ui_mirrored_get(pd->parent_obj); + scale = efl_gfx_entity_scale_get(obj); + th = elm_widget_theme_get(obj); + mirrored = efl_ui_mirrored_get(obj); + + if (!pd->on_create) + { + if ((scale != prev_scale) || (th != prev_th) || + (pmirrored != mirrored)) + elm_widget_theme(obj); + } + if (_is_focused(obj)) _parents_focus(parent); + elm_widget_display_mode_set(obj, evas_object_size_hint_display_mode_get(parent)); + _elm_widget_top_win_focused_set(obj, _elm_widget_top_win_focused_get(parent)); + } + _mirror_disabled_state(obj, pd, disabled_delta); + _full_eval(obj, pd); + + if (old_parent && _elm_config->atspi_mode) + { + Efl_Access_Object *aparent; + aparent = efl_provider_find(efl_parent_get(obj), EFL_ACCESS_OBJECT_MIXIN); + if (aparent) + efl_access_children_changed_del_signal_emit(aparent, obj); + } + + if (pd->parent_obj && _elm_config->atspi_mode && efl_finalized_get(parent)) + { + Efl_Access_Object *aparent; + aparent = efl_provider_find(efl_parent_get(obj), EFL_ACCESS_OBJECT_MIXIN); + if (aparent) + efl_access_children_changed_added_signal_emit(aparent, obj); + } +} + +static void +_widget_add_sub(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Object *sobj) +{ sd->subobjs = eina_list_append(sd->subobjs, sobj); evas_object_data_set(sobj, "elm-parent", obj); - _callbacks_add(sobj, obj); - if (_elm_widget_is(sobj)) +} + +static void +_widget_del_sub(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Object *sobj) +{ + sd->subobjs = eina_list_remove(sd->subobjs, sobj); + evas_object_data_del(sobj, "elm-parent"); + _callbacks_del(sobj, obj); +} + +EOLIAN static Eina_Bool +_efl_ui_widget_widget_sub_object_add(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Object *sobj) +{ + Efl_Ui_Widget *parent; + + if (!sobj) return EINA_FALSE; + EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(sobj, EFL_GFX_ENTITY_INTERFACE), EINA_FALSE); + EINA_SAFETY_ON_TRUE_RETURN_VAL(obj == sobj, EINA_FALSE); + + //first make sure that we unregister the sobj from the parent + if (elm_widget_is(sobj)) + parent = efl_ui_widget_parent_get(sobj); + else + parent = evas_object_data_get(sobj, "elm-parent"); + if (parent == obj) return EINA_TRUE; + if (parent) { - ELM_WIDGET_DATA_GET(sobj, sdc); - - /* NOTE: In the following two lines, 'sobj' is correct. Do not change it. - * Due to elementary's scale policy, scale and pscale can be different in - * some cases. This happens when sobj's previous parent and new parent have - * different scale value. - * For example, if sobj's previous parent's scale is 5 and new parent's scale - * is 2 while sobj's scale is 0. Then 'pscale' is 5 and 'scale' is 2. So we - * need to reset sobj's scale to 5. - * Note that each widget's scale is 0 by default. - */ - double scale, pscale = efl_gfx_entity_scale_get(sobj); - Elm_Theme *th, *pth = elm_widget_theme_get(sobj); - - scale = efl_gfx_entity_scale_get(sobj); - th = elm_widget_theme_get(sobj); - mirrored = efl_ui_mirrored_get(sobj); - - if (!sdc->on_create) - { - if ((scale != pscale) || (th != pth) || (pmirrored != mirrored)) - elm_widget_theme(sobj); - } - - if (_is_focused(sobj)) _parents_focus(obj); - - elm_widget_display_mode_set(sobj, - evas_object_size_hint_display_mode_get(obj)); - if (_elm_config->atspi_mode && !sd->on_create) - { - 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); - } + if (!efl_ui_widget_sub_object_del(parent, sobj)) + return EINA_FALSE; } -end: + //sobj does not have a parent here + //first add it to our own children list + _widget_add_sub(obj, sd, sobj); + + //and if it is a widget, please set the correct parent on the widget itself + //the parent set method will take care of the property syncing etc. + if (elm_widget_is(sobj)) + efl_ui_widget_parent_set(sobj, obj); + return EINA_TRUE; } @@ -1622,54 +1549,13 @@ _efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Ob elm_widget_tree_unfocusable_set(sobj, EINA_TRUE); elm_widget_tree_unfocusable_set(sobj, EINA_FALSE); } - if ((sd->child_can_focus) && (_is_focusable(sobj))) - { - Evas_Object *parent = obj; - /* update child focusable-ness on self and parents, now that a - * focusable child is gone */ - while (parent) - { - const Eina_List *l; - Evas_Object *subobj; - - ELM_WIDGET_DATA_GET(parent, sdp); - - sdp->child_can_focus = EINA_FALSE; - EINA_LIST_FOREACH(sdp->subobjs, l, subobj) - { - if ((subobj != sobj) && (_is_focusable(subobj))) - { - sdp->child_can_focus = EINA_TRUE; - break; - } - } - - /* break again, child_can_focus went back to - * original value */ - if (sdp->child_can_focus) break; - parent = sdp->parent_obj; - } - } - if (_elm_config->atspi_mode && !sd->on_destroy) - { - 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); - } - - ELM_WIDGET_DATA_GET(sobj, sdc); - sdc->parent_obj = NULL; - - _full_eval(sobj, sdc); + efl_ui_widget_parent_set(sobj, NULL); } if (sd->resize_obj == sobj) sd->resize_obj = NULL; - sd->subobjs = eina_list_remove(sd->subobjs, sobj); - - _callbacks_del(sobj, obj); + _widget_del_sub(obj, sd, sobj); return EINA_TRUE; } @@ -1754,45 +1640,10 @@ _efl_ui_widget_focus_allow_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bool can sd->can_focus = can_focus; if (sd->can_focus) { - /* update child_can_focus of parents */ - Evas_Object *o = obj; - - for (;;) - { - o = elm_widget_parent_get(o); - if (!o) break; - ELM_WIDGET_DATA_GET(o, sdp); - if (!sdp || sdp->child_can_focus) break; - sdp->child_can_focus = EINA_TRUE; - } - efl_event_callback_array_add(obj, focus_callbacks(), NULL); } else { - // update child_can_focus of parents */ - Evas_Object *parent = elm_widget_parent_get(obj); - while (parent) - { - const Eina_List *l; - Evas_Object *subobj; - - ELM_WIDGET_DATA_GET(parent, sdp); - - sdp->child_can_focus = EINA_FALSE; - EINA_LIST_FOREACH(sdp->subobjs, l, subobj) - { - if (_is_focusable(subobj)) - { - sdp->child_can_focus = EINA_TRUE; - break; - } - } - /* break again, child_can_focus went back to - * original value */ - if (sdp->child_can_focus) break; - parent = sdp->parent_obj; - } efl_event_callback_array_del(obj, focus_callbacks(), NULL); } if (efl_finalized_get(obj)) @@ -1811,7 +1662,7 @@ elm_widget_child_can_focus_get(const Eo *obj) Elm_Widget_Smart_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS); if (!sd) return EINA_FALSE; - return sd->child_can_focus; + return sd->logical.child_count > 0; } /** @@ -1986,25 +1837,37 @@ elm_widget_highlight_get(const Eo *obj) return sd->highlighted; } -EOLIAN static Evas_Object* -_efl_ui_widget_widget_top_get(const Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED) +EAPI Eina_Bool +elm_widget_is(const Evas_Object *obj) +{ + return _elm_widget_is(obj); +} + +EAPI void +elm_widget_access_info_set(Efl_Ui_Widget *obj, const char *txt) +{ + efl_ui_widget_access_info_set(obj, txt); +} + +EAPI const char * +elm_widget_access_info_get(const Efl_Ui_Widget *obj) +{ + return efl_ui_widget_access_info_get(obj); +} + +EAPI Eo * +elm_widget_top_get(const Eo *obj) { Efl_Ui_Widget *parent = elm_widget_parent_get(obj); if (parent) { if (!efl_isa(parent, EFL_UI_WIDGET_CLASS)) return NULL; - return efl_ui_widget_top_get(parent); + return elm_widget_top_get(parent); } /* XXX const */ return (Evas_Object *)obj; } -EAPI Eina_Bool -elm_widget_is(const Evas_Object *obj) -{ - return _elm_widget_is(obj); -} - EAPI Evas_Object * elm_widget_parent_widget_get(const Evas_Object *obj) { @@ -2092,7 +1955,7 @@ _propagate_event(void *data EINA_UNUSED, const Efl_Event *eo_event) continue; } - if (efl_ui_widget_event(parent, eo_event, obj)) + if (efl_ui_widget_input_event_handler(parent, eo_event, obj)) return; EINA_LIST_FOREACH_SAFE(sd->event_cb, l, l_prev, ecd) @@ -2480,114 +2343,40 @@ _elm_widget_top_win_focused_get(const Evas_Object *obj) return sd->top_win_focused; } -static void -_elm_widget_disabled_eval(const Evas_Object *obj, Eina_Bool disabled) -{ - const Eina_List *l; - Evas_Object *child; - ELM_WIDGET_DATA_GET(obj, sd); - - EINA_LIST_FOREACH(sd->subobjs, l, child) - { - if (elm_widget_is(child)) - { - efl_ui_widget_on_disabled_update(child, disabled); - _elm_widget_disabled_eval(child, disabled); - } - } -} - -static void -elm_widget_disabled_internal(Eo *obj, Eina_Bool disabled) -{ - if (!disabled && elm_widget_disabled_get(elm_widget_parent_get(obj))) - return; - - efl_ui_widget_on_disabled_update(obj, disabled); - _elm_widget_disabled_eval(obj, disabled); -} - EOLIAN static void -_efl_ui_widget_disabled_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bool disabled) +_efl_ui_widget_disabled_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd, Eina_Bool disabled) { - if (sd->disabled == disabled) return; - sd->disabled = !!disabled; + Efl_Ui_Widget *subs; + Eina_List *n; + int distance, parent_counter = (pd->parent_obj ? _disabled_counter_get(pd->parent_obj) : 0); - elm_widget_disabled_internal(obj, disabled); + if (disabled) + pd->disabled ++; + else + pd->disabled --; + + distance = pd->disabled - parent_counter; + + if ((distance < 0) || (distance > 1)) + { + distance = MAX(MIN(disabled, 1), 0); + pd->disabled = parent_counter + distance; + } + + EINA_LIST_FOREACH(pd->subobjs, n, subs) + { + if (efl_isa(subs, EFL_UI_WIDGET_CLASS)) + efl_ui_widget_disabled_set(subs, efl_ui_widget_disabled_get(obj)); + } if (efl_finalized_get(obj)) - _elm_widget_full_eval_children(obj, sd); + _elm_widget_full_eval_children(obj, pd); } EOLIAN static Eina_Bool -_efl_ui_widget_disabled_get(const Eo *obj, Elm_Widget_Smart_Data *sd) +_efl_ui_widget_disabled_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd) { - Eo *parent; - - if (sd->disabled) return EINA_TRUE; - if ((parent = elm_widget_parent_get(obj)) != NULL) - return elm_widget_disabled_get(parent); - return EINA_FALSE; -} - -EOLIAN static void -_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; - - evas_smart_objects_calculate(evas_object_evas_get(obj)); - - if (!forceshow && eina_rectangle_equal(&sr.rect, &sd->show_region.rect)) return; - - sd->show_region = sr; - if (sd->on_show_region) - { - sd->on_show_region(sd->on_show_region_data, obj, sr); - - if (_elm_scrollable_is(obj)) - { - if (elm_widget_is_legacy(obj)) - { - elm_interface_scrollable_content_pos_get(obj, &nx, &ny); - sr.x -= nx; - sr.y -= ny; - } - else - { - Eina_Position2D pos; - pos = efl_ui_scrollable_content_pos_get(obj); - sr.x -= pos.x; - sr.y -= pos.y; - } - } - } - - do - { - parent_obj = sd->parent_obj; - child_obj = sd->obj; - if ((!parent_obj) || (!_elm_widget_is(parent_obj))) break; - sd = efl_data_scope_get(parent_obj, MY_CLASS); - if (!sd) break; - - evas_object_geometry_get(parent_obj, &px, &py, NULL, NULL); - evas_object_geometry_get(child_obj, &cx, &cy, NULL, NULL); - - sr.x += (cx - px); - sr.y += (cy - py); - sd->show_region = sr; - - if (sd->on_show_region) - sd->on_show_region(sd->on_show_region_data, parent_obj, sr); - } - while (parent_obj); -} - -EOLIAN static Eina_Rect -_efl_ui_widget_show_region_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd) -{ - return (Eina_Rect) sd->show_region; + return pd->disabled > 0; } /** @@ -2822,7 +2611,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_BASE_CLASS)) elm_layout_text_set(obj, part, label); } @@ -2832,7 +2621,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_BASE_CLASS)) return elm_layout_text_get(obj, part); return NULL; @@ -3017,6 +2806,32 @@ _efl_ui_widget_access_info_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data return sd->access_info; } + +EAPI void +elm_widget_scroll_hold_push(Efl_Ui_Widget *obj) +{ + efl_ui_widget_scroll_hold_push(obj); +} + +EAPI void +elm_widget_scroll_hold_pop(Efl_Ui_Widget *obj) +{ + efl_ui_widget_scroll_hold_pop(obj); +} + +EAPI void +elm_widget_scroll_freeze_push(Efl_Ui_Widget *obj) +{ + efl_ui_widget_scroll_freeze_push(obj); +} + +EAPI void +elm_widget_scroll_freeze_pop(Efl_Ui_Widget *obj) +{ + efl_ui_widget_scroll_freeze_pop(obj); +} + + EAPI Elm_Theme * elm_widget_theme_get(const Evas_Object *obj) { @@ -3032,19 +2847,19 @@ elm_widget_theme_get(const Evas_Object *obj) return sd->theme; } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _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)) { ERR("Efl.Ui.Widget.style can only be set before finalize!"); - return EFL_UI_THEME_APPLY_RESULT_FAIL; + return EFL_UI_THEME_APPLY_ERROR_GENERIC; } if (eina_stringshare_replace(&sd->style, style)) return elm_widget_theme(obj); - return EFL_UI_THEME_APPLY_RESULT_SUCCESS; + return EFL_UI_THEME_APPLY_ERROR_NONE; } EOLIAN static const char* @@ -3143,39 +2958,17 @@ elm_widget_scroll_child_locked_y_get(const Eo *obj) return sd->child_drag_y_locked; } -EAPI Efl_Ui_Theme_Apply_Result +EAPI Eina_Error elm_widget_theme_object_set(Evas_Object *obj, Evas_Object *edj, const char *wname, const char *welement, const char *wstyle) { Elm_Widget_Smart_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS); - if (!sd) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (!sd) return EFL_UI_THEME_APPLY_ERROR_GENERIC; if (eina_streq(welement, "base")) welement = NULL; if (eina_streq(wstyle, "default")) wstyle = NULL; - Efl_Ui_Theme_Apply_Result ret = _elm_theme_object_set(obj, edj, wname, welement, wstyle); - if (!ret) - { - return EFL_UI_THEME_APPLY_RESULT_FAIL; - } - - if (sd->orient_mode != -1) - { - char buf[128]; - - 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; + return _elm_theme_object_set(obj, edj, wname, welement, wstyle); } static void @@ -3422,7 +3215,7 @@ elm_widget_focus_mouse_up_handle(Eo *obj) if (pd->focus.manager && !pd->focus.logical) { - efl_ui_focus_util_focus(EFL_UI_FOCUS_UTIL_CLASS, obj); + efl_ui_focus_util_focus(obj); } } @@ -3487,7 +3280,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_BASE_CLASS)) { edje_obj = elm_layout_edje_get(obj); if (!(target_hl_part = elm_layout_data_get(obj, "focus_part"))) @@ -3540,24 +3333,6 @@ _efl_ui_widget_focus_highlight_geometry_get(const Eo *obj, Elm_Widget_Smart_Data return r; } -EOLIAN static Elm_Object_Item* -_efl_ui_widget_focused_item_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED) -{ - return NULL; -} - -EOLIAN static void -_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 -_efl_ui_widget_interest_region_mode_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd) -{ - return _pd->focus_region_show_mode; -} - EAPI void elm_widget_activate(Evas_Object *obj, Efl_Ui_Activate act) { @@ -3616,60 +3391,6 @@ elm_widget_display_mode_set(Evas_Object *obj, Evas_Display_Mode dispmode) } } -EOLIAN static void -_efl_ui_widget_orientation_mode_set(Eo *obj, Elm_Widget_Smart_Data *sd, Efl_Ui_Widget_Orientation_Mode mode) -{ - int rotation = -1; - - 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) rotation = 0; - else rotation = sd_parent->orient_mode; - } - efl_ui_widget_on_orientation_update(obj, rotation); -} - -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 EFL_UI_WIDGET_ORIENTATION_MODE_DISABLED; - else return EFL_UI_WIDGET_ORIENTATION_MODE_DEFAULT; -} - -EOLIAN static void -_efl_ui_widget_on_orientation_update(Eo *obj, Elm_Widget_Smart_Data *sd, int orient_mode) -{ - Evas_Object *child; - Eina_List *l; - - sd->orient_mode = orient_mode; - - EINA_LIST_FOREACH (sd->subobjs, l, child) - { - if (elm_widget_is(child)) - efl_ui_widget_on_orientation_update(child, orient_mode); - } - - if (orient_mode != -1) - { - char buf[128]; - - 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"); - } - } -} - /** * @internal * @@ -3679,7 +3400,7 @@ _efl_ui_widget_on_orientation_update(Eo *obj, Elm_Widget_Smart_Data *sd, int ori * @return focus move policy of the object. * **/ -EOLIAN static Elm_Focus_Move_Policy +EOLIAN static Efl_Ui_Focus_Move_Policy _efl_ui_widget_focus_move_policy_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd) { return sd->focus_move_policy; @@ -3695,9 +3416,9 @@ _efl_ui_widget_focus_move_policy_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart */ EOLIAN static void -_efl_ui_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, Efl_Ui_Focus_Move_Policy policy) { - if (sd->focus_move_policy == policy) return; + if (sd->focus_move_policy == (Elm_Focus_Move_Policy)policy) return; sd->focus_move_policy = policy; } @@ -3853,10 +3574,10 @@ elm_widget_theme_style_get(const Evas_Object *obj) * @param name An element name of sub object. * @return Whether the style was successfully applied or not. */ -EAPI Efl_Ui_Theme_Apply_Result +EAPI Eina_Error elm_widget_element_update(Evas_Object *obj, Evas_Object *component, const char *name) { - Efl_Ui_Theme_Apply_Result ret = EFL_UI_THEME_APPLY_RESULT_SUCCESS; + Eina_Error ret = EFL_UI_THEME_APPLY_ERROR_NONE; Eina_Bool changed = EINA_FALSE; const char *obj_group; Eina_Stringshare *group; @@ -3913,10 +3634,9 @@ static void _track_obj_view_del(void *data, const Efl_Event *event); EFL_CALLBACKS_ARRAY_DEFINE(tracker_callbacks, - { 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_GFX_ENTITY_EVENT_SIZE_CHANGED, _track_obj_view_update }, + { EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _track_obj_view_update }, + { EFL_GFX_ENTITY_EVENT_VISIBILITY_CHANGED, _track_obj_view_update }, { EFL_EVENT_DEL, _track_obj_view_del }); static void @@ -4281,18 +4001,18 @@ _elm_widget_item_efl_access_object_state_set_get(const Eo *eo_item, { Efl_Access_State_Set states = 0; - STATE_TYPE_SET(states, EFL_ACCESS_STATE_FOCUSABLE); + STATE_TYPE_SET(states, EFL_ACCESS_STATE_TYPE_FOCUSABLE); if (elm_object_item_focus_get(eo_item)) - STATE_TYPE_SET(states, EFL_ACCESS_STATE_FOCUSED); + STATE_TYPE_SET(states, EFL_ACCESS_STATE_TYPE_FOCUSED); if (!elm_object_item_disabled_get(eo_item)) { - STATE_TYPE_SET(states, EFL_ACCESS_STATE_ENABLED); - STATE_TYPE_SET(states, EFL_ACCESS_STATE_SENSITIVE); - STATE_TYPE_SET(states, EFL_ACCESS_STATE_VISIBLE); + STATE_TYPE_SET(states, EFL_ACCESS_STATE_TYPE_ENABLED); + STATE_TYPE_SET(states, EFL_ACCESS_STATE_TYPE_SENSITIVE); + STATE_TYPE_SET(states, EFL_ACCESS_STATE_TYPE_VISIBLE); } if (_elm_widget_item_onscreen_is(eo_item)) - STATE_TYPE_SET(states, EFL_ACCESS_STATE_SHOWING); + STATE_TYPE_SET(states, EFL_ACCESS_STATE_TYPE_SHOWING); return states; } @@ -5330,16 +5050,26 @@ elm_widget_tree_dot_dump(const Evas_Object *top, EOLIAN static Eo * _efl_ui_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED) { - Eo *parent = NULL; - sd->on_create = EINA_TRUE; + sd->window = efl_provider_find(efl_parent_get(obj), EFL_UI_WIN_CLASS); _efl_ui_focus_event_redirector(obj, obj); 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); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); - parent = efl_parent_get(obj); - efl_ui_widget_parent_set(obj, parent); + if (!efl_isa(obj, EFL_UI_WIN_CLASS)) + { + Eo *parent = efl_parent_get(obj); + 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)); + } + + efl_ui_widget_sub_object_add(parent, obj); + } + sd->on_create = EINA_FALSE; efl_access_object_role_set(obj, EFL_ACCESS_ROLE_UNKNOWN); @@ -5365,7 +5095,7 @@ _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_OBJECT_EVENT_MANAGER_CHANGED, _manager_changed_cb, obj); + efl_event_callback_del(sd->manager.provider, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_MANAGER_CHANGED, _manager_changed_cb, obj); sd->manager.provider = NULL; } efl_access_object_attributes_clear(obj); @@ -5407,19 +5137,13 @@ _efl_ui_widget_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Widget_Smart_Dat evas_object_focus_set(obj, focused); if (_elm_config->atspi_mode && !elm_widget_child_can_focus_get(obj)) - efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_FOCUSED, focused); + efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_TYPE_FOCUSED, focused); return EINA_TRUE; } EOLIAN static Eina_Bool -_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 -_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) +_efl_ui_widget_widget_input_event_handler(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; } @@ -5500,21 +5224,21 @@ _efl_ui_widget_efl_access_object_state_set_get(const Eo *obj, Elm_Widget_Smart_D if (evas_object_visible_get(obj)) { - STATE_TYPE_SET(states, EFL_ACCESS_STATE_VISIBLE); + STATE_TYPE_SET(states, EFL_ACCESS_STATE_TYPE_VISIBLE); if (_elm_widget_onscreen_is(obj)) - STATE_TYPE_SET(states, EFL_ACCESS_STATE_SHOWING); + STATE_TYPE_SET(states, EFL_ACCESS_STATE_TYPE_SHOWING); } if (!elm_widget_child_can_focus_get(obj)) { if (elm_object_focus_allow_get(obj)) - STATE_TYPE_SET(states, EFL_ACCESS_STATE_FOCUSABLE); + STATE_TYPE_SET(states, EFL_ACCESS_STATE_TYPE_FOCUSABLE); if (elm_object_focus_get(obj)) - STATE_TYPE_SET(states, EFL_ACCESS_STATE_FOCUSED); + STATE_TYPE_SET(states, EFL_ACCESS_STATE_TYPE_FOCUSED); } if (!elm_object_disabled_get(obj)) { - STATE_TYPE_SET(states, EFL_ACCESS_STATE_ENABLED); - STATE_TYPE_SET(states, EFL_ACCESS_STATE_SENSITIVE); + STATE_TYPE_SET(states, EFL_ACCESS_STATE_TYPE_ENABLED); + STATE_TYPE_SET(states, EFL_ACCESS_STATE_TYPE_SENSITIVE); } return states; @@ -5624,6 +5348,13 @@ _efl_ui_widget_efl_object_provider_find(const Eo *obj, Elm_Widget_Smart_Data *pd if ((klass == EFL_CONFIG_INTERFACE) || (klass == EFL_CONFIG_GLOBAL_CLASS)) return _efl_config_obj; + if (klass == EFL_UI_WIN_CLASS) + { + if (pd->window) + return pd->window; + //let the parent_obj lookup handle this + } + if (klass == EFL_ACCESS_OBJECT_MIXIN) { Efl_Access_Type type = efl_access_object_access_type_get(obj); @@ -5672,6 +5403,84 @@ _efl_ui_widget_efl_ui_focus_object_focus_set(Eo *obj, Elm_Widget_Smart_Data *pd, /* Legacy APIs */ +EAPI void +elm_widget_on_show_region_hook_set(Eo *obj, void *data, Efl_Ui_Scrollable_On_Show_Region func, Eina_Free_Cb func_free_cb) +{ + ELM_WIDGET_DATA_GET(obj, sd); + + if ((sd->on_show_region_data == data) && (sd->on_show_region == func)) + return; + + if (sd->on_show_region_data && sd->on_show_region_data_free) + sd->on_show_region_data_free(sd->on_show_region_data); + + sd->on_show_region = func; + sd->on_show_region_data = data; + sd->on_show_region_data_free = func_free_cb; +} + +EAPI void +elm_widget_show_region_set(Eo *obj, Eina_Rect sr, Eina_Bool forceshow) +{ + Evas_Object *parent_obj, *child_obj; + Evas_Coord px, py, cx, cy, nx = 0, ny = 0; + + ELM_WIDGET_DATA_GET_OR_RETURN(obj, sd); + + evas_smart_objects_calculate(evas_object_evas_get(obj)); + + if (!forceshow && eina_rectangle_equal(&sr.rect, &sd->show_region.rect)) return; + + sd->show_region = sr; + if (sd->on_show_region) + { + sd->on_show_region(sd->on_show_region_data, obj, sr); + + if (_elm_scrollable_is(obj)) + { + if (elm_widget_is_legacy(obj)) + { + elm_interface_scrollable_content_pos_get(obj, &nx, &ny); + sr.x -= nx; + sr.y -= ny; + } + else + { + Eina_Position2D pos; + pos = efl_ui_scrollable_content_pos_get(obj); + sr.x -= pos.x; + sr.y -= pos.y; + } + } + } + + do + { + parent_obj = sd->parent_obj; + child_obj = sd->obj; + if ((!parent_obj) || (!_elm_widget_is(parent_obj))) break; + sd = efl_data_scope_get(parent_obj, MY_CLASS); + if (!sd) break; + + evas_object_geometry_get(parent_obj, &px, &py, NULL, NULL); + evas_object_geometry_get(child_obj, &cx, &cy, NULL, NULL); + + sr.x += (cx - px); + sr.y += (cy - py); + sd->show_region = sr; + + if (sd->on_show_region) + sd->on_show_region(sd->on_show_region_data, parent_obj, sr); + } + while (parent_obj); +} + +EAPI Eina_Rect +elm_widget_show_region_get(const Eo *obj) +{ + ELM_WIDGET_DATA_GET_OR_RETURN(obj, sd, EINA_RECT_EMPTY()); + return (Eina_Rect) sd->show_region; +} /* elm_object_content_xxx APIs are supposed to work on all objects for which * elm_object_widget_check() returns true. The below checks avoid printing out * undesired ERR messages. */ @@ -5679,7 +5488,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_BASE_CLASS)) { elm_layout_content_set(obj, part, content); return; @@ -5697,7 +5506,7 @@ 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_BASE_CLASS)) return elm_layout_content_get(obj, part); if (!efl_isa(obj, EFL_PART_INTERFACE)) return NULL; if (!part) @@ -5712,7 +5521,7 @@ 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_BASE_CLASS)) return elm_layout_content_unset(obj, part); if (!efl_isa(obj, EFL_PART_INTERFACE)) return NULL; if (!part) @@ -5728,7 +5537,7 @@ elm_widget_signal_emit(Eo *obj, const char *emission, const char *source) { ELM_WIDGET_CHECK(obj); - if (efl_isa(obj, EFL_UI_LAYOUT_CLASS)) + if (efl_isa(obj, EFL_UI_LAYOUT_BASE_CLASS)) elm_layout_signal_emit(obj, emission, source); else if (evas_object_smart_type_check(obj, "elm_icon")) { @@ -5808,11 +5617,10 @@ _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_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 }) +{ EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _widget_shadow_event_cb }, +{ EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _widget_shadow_event_cb }, +{ EFL_GFX_ENTITY_EVENT_STACKING_CHANGED, _widget_shadow_event_cb }, +{ EFL_GFX_ENTITY_EVENT_VISIBILITY_CHANGED, _widget_shadow_event_cb }); static Widget_Shadow * _widget_shadow_part_get(const Eo *part_obj) @@ -5825,6 +5633,7 @@ _widget_shadow_part_get(const Eo *part_obj) if (!shadow) { shadow = calloc(1, sizeof(*shadow)); + if (!shadow) return NULL; shadow->widget = pd->obj; efl_key_data_set(widget, "__elm_shadow", shadow); efl_event_callback_array_add(widget, widget_shadow_cb(), shadow); @@ -5878,7 +5687,7 @@ _widget_shadow_update(Widget_Shadow *ws) return; } - efl_canvas_object_clip_set(ws->surface, efl_canvas_object_clip_get(ws->widget)); + efl_canvas_object_clipper_set(ws->surface, efl_canvas_object_clipper_get(ws->widget)); efl_canvas_group_member_add(efl_canvas_object_render_parent_get(ws->widget), ws->surface); efl_gfx_entity_geometry_set(ws->surface, srect); efl_gfx_stack_below(ws->surface, ws->widget); @@ -6087,20 +5896,60 @@ efl_ui_widget_part_bg_get(const Eo *part_obj) return _efl_ui_widget_bg_get(pd->obj); } -EOLIAN static Eina_Bool -_efl_ui_widget_part_bg_efl_file_file_set(Eo *obj, void *pd EINA_UNUSED, const char *file, const char *key) +EOLIAN static Eina_Error +_efl_ui_widget_part_bg_efl_file_load(Eo *obj, void *pd EINA_UNUSED) { Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj); - return efl_file_set(bg_obj, file, key); + return efl_file_load(bg_obj); +} + +EOLIAN static const char * +_efl_ui_widget_part_bg_efl_file_file_get(const Eo *obj, void *pd EINA_UNUSED) +{ + Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj); + + return efl_file_get(bg_obj); +} + +EOLIAN static Eina_Error +_efl_ui_widget_part_bg_efl_file_file_set(Eo *obj, void *pd EINA_UNUSED, const char *file) +{ + Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj); + + return efl_file_set(bg_obj, file); +} + +EOLIAN static const char * +_efl_ui_widget_part_bg_efl_file_key_get(const Eo *obj, void *pd EINA_UNUSED) +{ + Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj); + + return efl_file_key_get(bg_obj); } EOLIAN static void -_efl_ui_widget_part_bg_efl_file_file_get(const Eo *obj, void *pd EINA_UNUSED, const char **file, const char **key) +_efl_ui_widget_part_bg_efl_file_key_set(Eo *obj, void *pd EINA_UNUSED, const char *key) { Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj); - efl_file_get(bg_obj, file, key); + efl_file_key_set(bg_obj, key); +} + +EOLIAN static const Eina_File * +_efl_ui_widget_part_bg_efl_file_mmap_get(const Eo *obj, void *pd EINA_UNUSED) +{ + Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj); + + return efl_file_mmap_get(bg_obj); +} + +EOLIAN static Eina_Error +_efl_ui_widget_part_bg_efl_file_mmap_set(Eo *obj, void *pd EINA_UNUSED, const Eina_File *file) +{ + Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj); + + return efl_file_mmap_set(bg_obj, file); } EOLIAN static void @@ -6135,6 +5984,189 @@ _efl_ui_widget_part_bg_efl_gfx_image_scale_type_get(const Eo *obj, void *pd EINA return efl_gfx_image_scale_type_get(bg_obj); } +typedef struct _Efl_Ui_Property_Bound Efl_Ui_Property_Bound; +struct _Efl_Ui_Property_Bound +{ + Eina_Stringshare *key; // Local object property + Eina_Stringshare *property; // Model property + Eina_Future *f; +}; + +static void +_efl_ui_property_bind_free(void *data) +{ + Efl_Ui_Property_Bound *prop = data; + + eina_stringshare_del(prop->key); + eina_stringshare_del(prop->property); + free(prop); +} + +static void +_efl_ui_property_bind_clean(Eo *obj EINA_UNUSED, + void *data, + const Eina_Future *f EINA_UNUSED) +{ + Efl_Ui_Property_Bound *prop = data; + + prop->f = NULL; +} + +static void +_efl_ui_property_bind_get(Efl_Ui_Widget_Data *pd, Efl_Ui_Property_Bound *prop) +{ + Eina_Value *value = efl_model_property_get(pd->properties.model, prop->property); + Eina_Future *f; + Eina_Error err; + + err = efl_property_reflection_set(pd->obj, prop->key, eina_value_reference_copy(value)); + eina_value_free(value); + + if (!err) return ; + + // Report back the error to the model + if (prop->f) eina_future_cancel(prop->f); + f = efl_model_property_set(pd->properties.model, prop->property, + eina_value_error_new(err)); + prop->f = efl_future_then(pd->obj, f, .free = _efl_ui_property_bind_clean, .data = prop); +} + +static void +_efl_ui_property_bind_set(Efl_Ui_Widget_Data *pd, Efl_Ui_Property_Bound *prop) +{ + Eina_Value value = efl_property_reflection_get(pd->obj, prop->key); + Eina_Future *f; + + if (prop->f) eina_future_cancel(prop->f); + f = efl_model_property_set(pd->properties.model, prop->property, eina_value_dup(&value)); + prop->f = efl_future_then(pd->obj, f, .free = _efl_ui_property_bind_clean, .data = prop); + eina_value_flush(&value); +} + +static void +_efl_ui_model_property_bind_changed(void *data, const Efl_Event *event) +{ + Efl_Model_Property_Event *evt = event->info; + Efl_Ui_Widget_Data *pd = data; + Eina_Array_Iterator it; + const char *prop; + unsigned int i; + + EINA_ARRAY_ITER_NEXT(evt->changed_properties, i, prop, it) + { + Efl_Ui_Property_Bound *lookup; + + lookup = eina_hash_find(pd->properties.model_lookup, prop); + if (lookup) _efl_ui_property_bind_get(pd, lookup); + } +} + +static void +_efl_ui_view_property_bind_changed(void *data, const Efl_Event *event) +{ + Efl_Ui_Property_Event *evt = event->info; + Efl_Ui_Widget_Data *pd = data; + Eina_Array_Iterator it; + Eina_Stringshare *prop; + unsigned int i; + + EINA_ARRAY_ITER_NEXT(evt->changed_properties, i, prop, it) + { + Efl_Ui_Property_Bound *lookup; + + lookup = eina_hash_find(pd->properties.view_lookup, prop); + if (lookup) _efl_ui_property_bind_set(pd, lookup); + } +} + +static Eina_Error +_efl_ui_widget_efl_ui_property_bind_property_bind(Eo *obj, Efl_Ui_Widget_Data *pd, + const char *key, const char *property) +{ + Efl_Ui_Property_Bound *prop; + + // Check if the property is available from the reflection table of the object. + if (!efl_property_reflection_exist(obj, key)) return EFL_PROPERTY_ERROR_INVALID_KEY; + + if (!pd->properties.model_lookup) + { + pd->properties.model_lookup = eina_hash_stringshared_new(_efl_ui_property_bind_free); + pd->properties.view_lookup = eina_hash_stringshared_new(NULL); + if (pd->properties.model) + { + efl_event_callback_add(pd->properties.model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, + _efl_ui_model_property_bind_changed, pd); + efl_event_callback_add(obj, EFL_UI_PROPERTY_BIND_EVENT_PROPERTIES_CHANGED, + _efl_ui_view_property_bind_changed, pd); + } + } + + prop = calloc(1, sizeof (Efl_Ui_Property_Bound)); + if (!prop) return ENOMEM; + prop->key = eina_stringshare_add(key); + prop->property = eina_stringshare_add(property); + + eina_hash_direct_add(pd->properties.model_lookup, prop->property, prop); + eina_hash_direct_add(pd->properties.view_lookup, prop->key, prop); + + _efl_ui_property_bind_get(pd, prop); + + efl_event_callback_call(obj, EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND, (void*) prop->key); + + return 0; +} + +static void +_efl_ui_widget_efl_ui_view_model_set(Eo *obj, + Efl_Ui_Widget_Data *pd, + Efl_Model *model) +{ + if (pd->properties.model) + { + // Remove any existing handler that might exist for any reason + efl_event_callback_del(pd->properties.model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, + _efl_ui_model_property_bind_changed, pd); + efl_event_callback_del(obj, EFL_UI_PROPERTY_BIND_EVENT_PROPERTIES_CHANGED, + _efl_ui_view_property_bind_changed, pd); + } + + efl_replace(&pd->properties.model, model); + + if (pd->properties.model && pd->properties.model_lookup) + { + // Set the properties handler just in case + efl_event_callback_add(pd->properties.model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, + _efl_ui_model_property_bind_changed, pd); + efl_event_callback_add(obj, EFL_UI_PROPERTY_BIND_EVENT_PROPERTIES_CHANGED, + _efl_ui_view_property_bind_changed, pd); + } +} + +static Efl_Model * +_efl_ui_widget_efl_ui_view_model_get(const Eo *obj EINA_UNUSED, Efl_Ui_Widget_Data *pd) +{ + return pd->properties.model; +} + +static void +_efl_ui_widget_efl_object_invalidate(Eo *obj, Efl_Ui_Widget_Data *pd) +{ + efl_invalidate(efl_super(obj, EFL_UI_WIDGET_CLASS)); + + if (pd->properties.model) + { + efl_event_callback_del(pd->properties.model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, + _efl_ui_model_property_bind_changed, pd); + efl_event_callback_del(obj, EFL_UI_PROPERTY_BIND_EVENT_PROPERTIES_CHANGED, + _efl_ui_view_property_bind_changed, pd); + efl_replace(&pd->properties.model, NULL); + } + if (pd->properties.view_lookup) eina_hash_free(pd->properties.view_lookup); + pd->properties.view_lookup = NULL; + if (pd->properties.model_lookup) eina_hash_free(pd->properties.model_lookup); + pd->properties.model_lookup = NULL; +} + #include "efl_ui_widget_part_bg.eo.c" /* Efl.Part Bg end */ @@ -6152,10 +6184,13 @@ ELM_PART_TEXT_DEFAULT_GET(efl_ui_widget, NULL) 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_canvas_object_is_frame_object_set, _efl_ui_widget_efl_canvas_object_is_frame_object_set), \ 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_item_eo.c" +#include "elm_widget_item_container_eo.c" #include "efl_ui_widget.eo.c" +#include "efl_ui_widget_eo.legacy.c" /* Others */ #include "efl_ui_l10n.eo.c" diff --git a/src/lib/elementary/efl_ui_widget.eo b/src/lib/elementary/efl_ui_widget.eo index 5ffb67d0ac..e765ddea8c 100644 --- a/src/lib/elementary/efl_ui_widget.eo +++ b/src/lib/elementary/efl_ui_widget.eo @@ -1,4 +1,4 @@ -function Efl.Ui.Scrollable_On_Show_Region { +function @beta Efl.Ui.Scrollable_On_Show_Region { [[Function pointer for on show region hook]] params { @in obj: Efl.Canvas.Object; [[Canvas object]] @@ -7,7 +7,9 @@ function Efl.Ui.Scrollable_On_Show_Region { }; struct Efl.Ui.Widget_Focus_State { - [[All relevant fields needed for the current state of focus registeration]] + [[All relevant fields needed for the current state of focus registration + @since 1.22 + ]] manager : Efl.Ui.Focus.Manager; [[The manager where the widget is registered in]] parent : Efl.Ui.Focus.Object; [[The parent the widget is using as logical parent]] logical : bool; [[$true if this is registered as logical currently]] @@ -15,15 +17,82 @@ struct Efl.Ui.Widget_Focus_State { abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, Efl.Access.Component, Efl.Part, Efl.Ui.Focus.Object, - Efl.Ui.Cursor, Efl.Ui.L10n, - Efl.Ui.Selection, Efl.Ui.Dnd + Efl.Ui.L10n, + Efl.Ui.Selection, Efl.Ui.Dnd, + Efl.Ui.Property_Bind, Efl.Ui.View { - [[Efl UI widget abstract class]] - legacy_prefix: elm_widget; + [[Efl UI widget abstract class + + @since 1.22 + ]] //eo_prefix: efl_ui_widget; event_prefix: efl_ui_widget; data: Efl_Ui_Widget_Data; methods { + @property cursor @beta { + [[The cursor to be shown when mouse is over the object + + This is the cursor that will be displayed when mouse is over the + object. The object can have only one cursor set to it so if + @.cursor.set is called twice for an object, the previous set + will be unset. + + If using X cursors, a definition of all the valid cursor names + is listed on Elementary_Cursors.h. If an invalid name is set + the default cursor will be used. + ]] + set { + [[Sets or unsets the current cursor. + + If $cursor is $null this function will reset the cursor + to the default one. + ]] + return: bool; [[$true if successful.]] + } + get { + [[Returns the current cursor name.]] + } + values { + cursor: string @nullable; [[The cursor name, defined either + by the display system or the theme.]] + } + } + @property cursor_style @beta { + [[A different style for the cursor. + + This only makes sense if theme cursors are used. + The cursor should be set with @.cursor.set first before + setting its style with this property. + ]] + set { + [[Sets a style for the current cursor. Call after @.cursor.set.]] + return: bool; [[$true if successful.]] + } + get { + [[Returns the current cursor style name.]] + } + values { + style: string; [[A specific style to use, eg. default, + transparent, ....]] + } + } + @property cursor_theme_search_enabled @beta { + [[Whether the cursor may be looked in the theme or not. + + If $false, the cursor may only come from the render engine, + i.e. from the display manager. + ]] + set { + [[Enables or disables theme cursors.]] + return: bool; [[$true if successful.]] + } + get { + [[Returns the current state of theme cursors search.]] + } + values { + allow: bool(true); [[Whether to use theme cursors.]] + } + } @property resize_object @protected { [[This is the internal canvas object managed by a widget. @@ -42,6 +111,8 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, @property disabled { [[Whether the widget is enabled (accepts and reacts to user inputs). + The property works counted, this means, whenever n-caller set the value to $true, n-caller have to set it to $false in order to get it out of the disabled state again. + Each widget may handle the disabled state differently, but overall disabled widgets shall not respond to any input events. This is $false by default, meaning the widget is enabled. @@ -78,9 +149,9 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, ]] set @protected { [[Can only be called during construction, before finalize.]] - return: Efl.Ui.Theme_Apply_Result(0); + return: Eina.Error; [[Whether the style was successfully applied or not, see - the values of @Efl.Ui.Theme_Apply_Result for more information.]] + the Efl.Ui.Theme.Apply_Error subset of @Eina.Error for more information.]] } get { [[Returns the current style of a widget.]] @@ -91,7 +162,7 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, for the available style names, or to the themes in use.]] } } - widget_event @protected { + widget_input_event_handler @protected { [[Virtual function handling input events on the widget. This method should return $true if the event has been processed. @@ -109,7 +180,6 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, [[Source object where the event originated. Often same as this.]] } return: bool; [[$true on success, $false otherwise]] - legacy: null; } // FIXME: focus_allow? can_focus? focusable? @property focus_allow { @@ -127,10 +197,8 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, not focusable, but a button is). ]] set { - legacy: elm_widget_can_focus_set; } get { - legacy: elm_widget_can_focus_get; } values { can_focus: bool; [[Whether the object is focusable.]] @@ -142,45 +210,18 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, @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. - - See also @.widget_top. ]] - set {} + set { + } get { - legacy: elm_widget_parent_get; /* internal in legacy */ } values { parent: Efl.Ui.Widget @nullable; [[Widget parent object]] } } - @property widget_top { - [[Root widget in the widget hierarchy. - - This returns the top widget, in terms of widget hierarchy. This is - usually a window (@Efl.Ui.Win). This function walks the list of - @.widget_parent. - - If this widget has no parent (in terms of widget hierarchy) this - will return $null. - - Note: This may not be a display manager window in case of nested - canvases. If a "real" window is required, then you might want to - verify that the returned object is a @Efl.Ui.Win_Inlined, and then - get @Efl.Ui.Win_Inlined.inlined_parent to find an object in the - master window. - - See also @.widget_parent. - ]] - get { - legacy: elm_widget_top_get; /* internal in legacy */ - } - values { - top: Efl.Ui.Widget; [[Top widget, usually a window.]] - } - } /* Accessibility */ - @property access_info { + @property access_info @beta { [[Accessibility information. This is a replacement string to be read by the accessibility @@ -203,7 +244,6 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, @in act: Efl.Ui.Activate; [[Type of activation.]] } return: bool; [[$true on success, $false otherwise]] - legacy: null; /* FIXME: legacy API does extra work */ } on_access_update @protected @beta { [[Hook function called when accessibility is changed on the widget. @@ -214,12 +254,19 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, params { @in enable: bool; [[$true if accessibility is enabled.]] } - legacy: null; /* FIXME: legacy API does extra work */ } /* Internal hooks. */ widget_sub_object_add @protected { - [[Virtual function handling sub objects being added. + [[Virtual function customizing sub objects being added. + + When a widget is added as a sub-object of another widget (like list + elements inside a list container, for example) some of its properties + are automatically adapted to the parent's current values (like focus, + access, theme, scale, mirror, scrollable child get, translate, + display mode set, tree dump). + Override this method if you want to customize differently sub-objects + being added to this object. Sub objects can be any canvas object, not necessarily widgets. @@ -230,74 +277,25 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, [[Sub object to be added. Not necessarily a widget itself.]] } return: bool; [[Indicates if the operation succeeded.]] - legacy: elm_widget_sub_object_add; } widget_sub_object_del @protected { - [[Virtual function handling sub objects being removed. + [[Virtual function customizing sub objects being removed. + + When a widget is removed as a sub-object from another widget + (@Efl.Pack.unpack, @Efl.Content.content_unset, for example) some of + its properties are automatically adjusted.(like focus, access, tree dump) + Override this method if you want to customize differently sub-objects + being removed to this object. Sub objects can be any canvas object, not necessarily widgets. - See also @.widget_parent. + See also @.widget_parent and @.widget_sub_object_add. ]] params { @in sub_obj: Efl.Canvas.Object; [[Sub object to be removed. Should be a child of this widget.]] } 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 is $disabled. - - 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 @.orientation_mode. - ]] - params { - rotation: int; [[Orientation in degrees: 0, 90, 180, 270 or -1 if - @.orientation_mode is $disabled.]] - } - } - on_disabled_update @protected { - [[Virtual function called when the widget becomes disabled. - - This may be triggered even if this widget is not disabled, as the - parent widget could be disabled and propagate its state. - ]] - params { - disabled: bool; [[The new value of @.disabled.]] - } - return: bool; [[Indicates if the operation succeeded.]] } theme_apply @protected { [[Virtual function called when the widget needs to re-apply its theme. @@ -310,59 +308,22 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, Note: even widgets not based on layouts may override this method to handle widget updates (scale, mirrored mode, etc...). ]] - return: Efl.Ui.Theme_Apply_Result; [[Indicates success, and if the current + return: Eina.Error; [[Indicates success, and if the current theme or default theme was used.]] } - /* Scroll API. */ - @property on_show_region_hook @protected { - [[Hook function called when the @.show_region is changed. - - See also @.show_region. - ]] - set {} - values { - func: Efl.Ui.Scrollable_On_Show_Region @nullable; [[Region hook function]] - } - } - @property show_region @protected { - [[Region inside the widget to show. - - See also @.on_show_region_hook. - ]] - set { - [[Request parent scrollers to pan around so that this region - of the widget becomes visible. - - If $force is $true this will trigger scroller changes and - the @.on_show_region_hook to be called even if the region is - unchanged. - ]] - values { - region: Eina.Rect; [[The region to show.]] - force: bool; [[Set to $true to force show even if unchanged.]] - } - } - get { - [[Returns the current region to show.]] - values { - region: Eina.Rect; [[The region to show.]] - } - } - } - /* FIXME: Scroll API. Not sure how those APIs should be exposed with * the new scrollable API. */ - scroll_hold_push { + scroll_hold_push @beta { [[Push scroll hold]] } - scroll_hold_pop { + scroll_hold_pop @beta { [[Pop scroller hold]] } - scroll_freeze_push { + scroll_freeze_push @beta { [[Push scroller freeze]] } - scroll_freeze_pop { + scroll_freeze_pop @beta { [[Pop scroller freeze]] } @@ -382,11 +343,8 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, i.e. X,Y start from 0,0 to indicate the top-left corner of the widget. W,H must be greater or equal to 1 for this region to be taken into account, otherwise it is ignored. - - See also @.interest_region_mode ]] get { - legacy: elm_widget_focus_region_get; } values { region: Eina.Rect; @@ -394,24 +352,6 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, will be ignored, and no action will be taken.]] } } - @property interest_region_mode { - [[Defines how @.show_region should be calculated. - - It is up to the implementation of @.show_region.get to take this - value into account (or ignore it). - ]] - get { - legacy: elm_widget_focus_region_show_mode_get; - } - set { - legacy: elm_widget_focus_region_show_mode_set; - } - values { - mode: Efl.Ui.Interest_Region_Mode; - [[Whether to show a specific item or the widget as a whole.]] - } - } - /* Focus highlight (visual focus rectangle) properties */ @property focus_highlight_geometry @protected { [[The rectangle region to be highlighted on focus. @@ -426,82 +366,6 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, region: Eina.Rect; [[The rectangle area.]] } } - @property focus_highlight_enabled { - [[Whether focus highlight is enabled or not. - - As of EFL 1.21 focus highlight properties apply to a single window, - not a single widget. As a consequence, calls to this function may - be forwarded to the parent window. Future versions of EFL may - implement widget-specific focus highlight properties. - - See also @.widget_top. - See also @.focus_highlight_style. - See also @.focus_highlight_animate. - ]] - set { - [[Set the enabled status for the focus highlight in a window. - - This function will enable or disable the focus highlight, - regardless of the global setting for it. - ]] - } - get { - [[Get the enabled value of the focus highlight for this window.]] - } - values { - enabled: bool; [[The enabled value for the highlight.]] - } - } - @property focus_highlight_style { - [[Control the widget focus highlight style. - - If $style is $null, the default will be used. - - As of EFL 1.21 focus highlight properties apply to a single window, - not a single widget. As a consequence, calls to this function may - be forwarded to the parent window. Future versions of EFL may - implement widget-specific focus highlight properties. - - See also @.widget_top. - See also @.focus_highlight_enabled. - See also @.focus_highlight_animate. - ]] - set { - /* FIXME: This is async... success here means nothing. */ - return: bool; [[$true on success, $false otherwise.]] - } - get { - } - values { - style: string @nullable; [[The name of the focus highlight style.]] - } - } - @property focus_highlight_animate { - [[Whether focus highlight should animate or not. - - As of EFL 1.21 focus highlight properties apply to a single window, - not a single widget. As a consequence, calls to this function may - be forwarded to the parent window. Future versions of EFL may - implement widget-specific focus highlight properties. - - See also @.widget_top. - See also @.focus_highlight_style. - See also @.focus_highlight_enabled. - ]] - set { - [[Set the animate status for the focus highlight for this window. - - This function will enable or disable the animation of focus - highlight. - ]] - } - get { - [[Get the animate value of the focus highlight for this window.]] - } - values { - animate: bool; [[The enabled value for the highlight animation.]] - } - } @property focus_move_policy @beta { [[The widget's focus move policy.]] values { @@ -510,56 +374,40 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, } @property focus_move_policy_automatic @beta { [[Control the widget's focus_move_policy mode setting. - - @since 1.18]] + ]] values { automatic: bool; [[$true to follow system focus move policy change, $false otherwise]] } } - - /* FIXME: No more items in EO API */ - @property focused_item @beta { - get { - [[Get the focused widget item.]] - return: Elm.Widget.Item; [[Focused item]] - } - } - - /* Focus Manager API */ focus_state_apply @protected { - [[Register focus with the given configuration. + [[Apply a new focus state on the widget. - The implementation can feel free to change the logical flag as it - wants, but other than that it should strictly keep the configuration. + This method is called internally by @Efl.Ui.Widget. Override it to change how a widget interacts with its focus manager. + If a widget desires to change the applied configuration, it has to modify $configured_state in addition to any internal changes. - The implementation in elm.widget updates the current state into what - is passed as configured state, respecting manager changes, - registeration and unregistration based on if it should be registered - or unregistered. - - A manager field that is $null means that the widget should not or was - not registered. + The default implementation (when this method is not overridden) applies $configured_state using the $manager contained inside. ]] params { @in current_state : Efl.Ui.Widget_Focus_State; - [[The focus manager to register with.]] + [[The current focus configuration of the widget.]] @inout configured_state : Efl.Ui.Widget_Focus_State; - [[The evaluated Focus state that should be used.]] + [[The new configuration being set on the widget.]] @in redirect : Efl.Ui.Widget; - [[A redirect that will be set by the elm.widget implementation.]] + [[A redirect object if there is any]] } - return: bool; [[Returns whether the widget is registered or not.]] + return: bool; [[Returns $true if the widget is registered in the focus manager, $false if not.]] } } - parts { - shadow: Efl.Ui.Widget_Part_Shadow; - background: Efl.Ui.Widget_Part_Bg; - } +// parts { +// shadow: Efl.Ui.Widget_Part_Shadow; +// background: Efl.Ui.Widget_Part_Bg; +// } implements { class.constructor; Efl.Object.constructor; Efl.Object.finalize; + Efl.Object.invalidate; Efl.Object.destructor; Efl.Object.provider_find; Efl.Object.debug_name_override; @@ -568,11 +416,10 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, Efl.Gfx.Entity.position { set; } Efl.Gfx.Entity.size { set; } Efl.Gfx.Entity.scale { set; get; } - Efl.Canvas.Object.clip { set; } + Efl.Canvas.Object.clipper { 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_remove; Efl.Canvas.Group.group_member_add; Efl.Access.Object.i18n_name { get; } Efl.Access.Object.state_set { get; } @@ -585,16 +432,17 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, Efl.Ui.Focus.Object.focus { set; } Efl.Ui.I18n.mirrored { get; set; } Efl.Ui.I18n.mirrored_automatic { get; set; } - 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.L10n.translation_update; [[This implements the calls to $gettext() and $text_set().]] Efl.Part.part_get; [[Returns @Efl.Ui.Widget_Part.]] + Efl.Ui.View.model { get; set; } + Efl.Ui.Property_Bind.property_bind; + } + constructors { + .style @optional; } events { - moved: Efl.Object; [[Called when widget moved]] - language,changed: void; [[Called when widget language changed]] - access,changed: void; [[Called when accessibility changed]] + language,changed @beta: void; [[Called when widget language changed]] + access,changed @beta: void; [[Called when accessibility changed]] } } diff --git a/src/lib/elementary/efl_ui_widget_common.c b/src/lib/elementary/efl_ui_widget_common.c new file mode 100644 index 0000000000..c83fd07c92 --- /dev/null +++ b/src/lib/elementary/efl_ui_widget_common.c @@ -0,0 +1,174 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#define EFL_ACCESS_OBJECT_PROTECTED +#define EFL_ACCESS_COMPONENT_PROTECTED +#define ELM_WIDGET_PROTECTED +#define ELM_WIDGET_ITEM_PROTECTED +#define EFL_INPUT_EVENT_PROTECTED +#define EFL_UI_L10N_PROTECTED +#define EFL_UI_FOCUS_OBJECT_PROTECTED +#define EFL_UI_WIDGET_PART_BG_PROTECTED +#define EFL_PART_PROTECTED + +#include + +#include "elm_priv.h" +#include "elm_widget_container.h" +#include "elm_interface_scrollable.h" +#include "elm_pan_eo.h" +#include "elm_part_helper.h" +#include "elm_widget_combobox.h" + +typedef struct { + Eina_Iterator iterator; + Efl_Ui_Widget *origin; //where we started + Efl_Ui_Widget *current; // the current widget where the iterator is +} Widget_Iterator; + +static Widget_Iterator* +iter_init(Efl_Ui_Widget *origin) +{ + Widget_Iterator *it; + + it = calloc(1, sizeof(Widget_Iterator)); + + EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); + + it->origin = origin; + it->iterator.version = EINA_ITERATOR_VERSION; + it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(NULL); + it->iterator.free = FUNC_ITERATOR_FREE(free); + + return it; +} + +static Efl_Ui_Widget* +_fetch_parent_widget(Efl_Gfx_Entity* o) +{ + Efl_Ui_Widget *parent; + + if (efl_isa(o, EFL_UI_WIDGET_CLASS)) + parent = efl_ui_widget_parent_get(o); + else + parent = evas_object_data_get(o, "elm-parent"); + + return parent; +} + +static Efl_Ui_Widget* +_next_widget(Efl_Gfx_Entity* o) +{ + Efl_Ui_Widget *parent; + Eina_List *rel; + + parent = _fetch_parent_widget(o); + ELM_WIDGET_DATA_GET_OR_RETURN(parent, pd, NULL); + rel = eina_list_data_find_list(pd->subobjs, o); + + return eina_list_data_get(eina_list_next(rel)); +} + +static Eina_Bool +_widget_next(Widget_Iterator *it, void **data) +{ + Efl_Ui_Widget *runner; + Efl_Ui_Widget_Data *pd = NULL; + + //Init case + if (!it->current) + { + it->current = it->origin; + goto deliver; + } + + if (efl_isa(it->current, EFL_UI_WIDGET_CLASS)) + { + pd = efl_data_scope_safe_get(it->current, EFL_UI_WIDGET_CLASS); + EINA_SAFETY_ON_NULL_RETURN_VAL(pd, EINA_FALSE); + } + + //If there is a child, go there + if (pd && pd->subobjs) + { + it->current = eina_list_data_get(pd->subobjs); + goto deliver; + } + + //If there is no child, then iterate up the parents until we find a widget with a next widget + runner = it->current; + do + { + Efl_Ui_Widget *tmp = _next_widget(runner); + + if (tmp) + { + it->current = tmp; + goto deliver; + } + + runner = _fetch_parent_widget(runner); + } + while(runner && runner != it->origin); + + //Reaching this point here means that there is no widget left, as there is no more parent we can explore + it->current = NULL; + +deliver: + *data = (void*)it->current; + return !!it->current; +} + +EAPI Eina_Iterator* +efl_ui_widget_tree_iterator(Efl_Ui_Widget *obj) +{ + ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd, NULL); + Widget_Iterator *it = iter_init(obj); + it->iterator.next = FUNC_ITERATOR_NEXT(_widget_next); + + return &it->iterator; +} + +static Eina_Bool +_only_widget(const void *container EINA_UNUSED, void *data, void *fdata EINA_UNUSED) +{ + return efl_isa(data, EFL_UI_WIDGET_CLASS); +} + +EAPI Eina_Iterator* +efl_ui_widget_tree_widget_iterator(Efl_Ui_Widget *obj) +{ + ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd, NULL); + Eina_Iterator *tree_iterator = efl_ui_widget_tree_iterator(obj); + + return eina_iterator_filter_new(tree_iterator, _only_widget, NULL, NULL); +} + +static Eina_Bool +_parent_next(Widget_Iterator *it, void **data) +{ + if (!it->current) + { + *data = it->origin; + it->current = *data; + } + else + { + Efl_Ui_Widget *parent = efl_ui_widget_parent_get(it->current); + + *data = parent; + it->current = parent; + } + + return !!*data; +} + +EAPI Eina_Iterator* +efl_ui_widget_parent_iterator(Efl_Ui_Widget *obj) +{ + ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd, NULL); + Widget_Iterator *it = iter_init(obj); + it->iterator.next = FUNC_ITERATOR_NEXT(_parent_next); + return &it->iterator; +} diff --git a/src/lib/elementary/efl_ui_widget_common.h b/src/lib/elementary/efl_ui_widget_common.h new file mode 100644 index 0000000000..3d232b85c0 --- /dev/null +++ b/src/lib/elementary/efl_ui_widget_common.h @@ -0,0 +1,35 @@ +#ifndef EFL_UI_WIDGET_COMMON_H +#define EFL_UI_WIDGET_COMMON_H + +/** + * @brief Get an iterator over all subelements located at obj. + * + * This iterator contains also the canvas objects which are part of the widgets, + * be aware that the construction of this tree is internal and might change heavily + * between versions. + * + * @param obj The widget which is the root of the subtree. + * + * @return A iterator that contains subelement widgets and canvas objects of the root widget. Every contained object is a Efl.Gfx.Entity. + */ +EAPI Eina_Iterator* efl_ui_widget_tree_iterator(Efl_Ui_Widget *obj); + +/** + * @brief Get an iterator over all subelements located at obj. + * + * @param obj The widget which is the root of the subtree. + * + * @return A iterator that contains subelement widgets of the root widget. Every contained object is a Efl.Ui.Widget. + */ +EAPI Eina_Iterator* efl_ui_widget_tree_widget_iterator(Efl_Ui_Widget *obj); + +/** + * @brief Get an iterator that contains all parents of the passed object. + * + * @param obj The object to fetch the parents from. + * + * @return A iterator that contains all parents of the object. Every contained object is a Efl.Ui.Widget. + */ +EAPI Eina_Iterator* efl_ui_widget_parent_iterator(Efl_Ui_Widget *obj); + +#endif diff --git a/src/lib/elementary/efl_ui_widget_eo.legacy.c b/src/lib/elementary/efl_ui_widget_eo.legacy.c new file mode 100644 index 0000000000..0d1665bea0 --- /dev/null +++ b/src/lib/elementary/efl_ui_widget_eo.legacy.c @@ -0,0 +1,90 @@ + +EAPI void +elm_widget_resize_object_set(Efl_Ui_Widget *obj, Efl_Canvas_Object *sobj) +{ + efl_ui_widget_resize_object_set(obj, sobj); +} + +EAPI void +elm_widget_disabled_set(Efl_Ui_Widget *obj, Eina_Bool disabled) +{ + efl_ui_widget_disabled_set(obj, disabled); +} + +EAPI Eina_Bool +elm_widget_disabled_get(const Efl_Ui_Widget *obj) +{ + return efl_ui_widget_disabled_get(obj); +} + +EAPI Eina_Error +elm_widget_style_set(Efl_Ui_Widget *obj, const char *style) +{ + return efl_ui_widget_style_set(obj, style); +} + +EAPI const char * +elm_widget_style_get(const Efl_Ui_Widget *obj) +{ + return efl_ui_widget_style_get(obj); +} + +EAPI void +elm_widget_can_focus_set(Efl_Ui_Widget *obj, Eina_Bool can_focus) +{ + efl_ui_widget_focus_allow_set(obj, can_focus); +} + +EAPI Eina_Bool +elm_widget_can_focus_get(const Efl_Ui_Widget *obj) +{ + return efl_ui_widget_focus_allow_get(obj); +} + +EAPI void +elm_widget_parent_set(Efl_Ui_Widget *obj, Efl_Ui_Widget *parent) +{ + efl_ui_widget_parent_set(obj, parent); +} + +EAPI Efl_Ui_Widget * +elm_widget_parent_get(const Efl_Ui_Widget *obj) +{ + return efl_ui_widget_parent_get(obj); +} + +EAPI Eina_Bool +elm_widget_sub_object_add(Efl_Ui_Widget *obj, Efl_Canvas_Object *sub_obj) +{ + return efl_ui_widget_sub_object_add(obj, sub_obj); +} + +EAPI Eina_Bool +elm_widget_sub_object_del(Efl_Ui_Widget *obj, Efl_Canvas_Object *sub_obj) +{ + return efl_ui_widget_sub_object_del(obj, sub_obj); +} + +EAPI Eina_Error +elm_widget_theme_apply(Efl_Ui_Widget *obj) +{ + return efl_ui_widget_theme_apply(obj); +} + +EAPI Eina_Rect +elm_widget_focus_region_get(const Efl_Ui_Widget *obj) +{ + return efl_ui_widget_interest_region_get(obj); +} + +EAPI Eina_Rect +elm_widget_focus_highlight_geometry_get(const Efl_Ui_Widget *obj) +{ + return efl_ui_widget_focus_highlight_geometry_get(obj); +} + +EAPI Eina_Bool +elm_widget_focus_state_apply(Efl_Ui_Widget *obj, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect) +{ + return efl_ui_widget_focus_state_apply(obj, current_state, configured_state, redirect); +} diff --git a/src/lib/elementary/efl_ui_widget_eo.legacy.h b/src/lib/elementary/efl_ui_widget_eo.legacy.h new file mode 100644 index 0000000000..70ae62e88b --- /dev/null +++ b/src/lib/elementary/efl_ui_widget_eo.legacy.h @@ -0,0 +1,334 @@ +#ifndef _EFL_UI_WIDGET_EO_LEGACY_H_ +#define _EFL_UI_WIDGET_EO_LEGACY_H_ + +#ifndef _EFL_UI_WIDGET_EO_CLASS_TYPE +#define _EFL_UI_WIDGET_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Widget; + +#endif + +#ifndef _EFL_UI_WIDGET_EO_TYPES +#define _EFL_UI_WIDGET_EO_TYPES + +/** Function pointer for on show region hook + * + * @ingroup Efl_Ui + */ +typedef void (*Efl_Ui_Scrollable_On_Show_Region)(void *data, Efl_Canvas_Object *obj, Eina_Rect region); + +/** All relevant fields needed for the current state of focus registeration + * + * @ingroup Efl_Ui + */ +typedef struct _Efl_Ui_Widget_Focus_State +{ + Efl_Ui_Focus_Manager *manager; /**< The manager where the widget is registered + * in */ + Efl_Ui_Focus_Object *parent; /**< The parent the widget is using as logical + * parent */ + Eina_Bool logical; /**< @c true if this is registered as logical currently */ +} Efl_Ui_Widget_Focus_State; + + +#endif + +/** + * @brief This is the internal canvas object managed by a widget. + * + * This property is protected as it is meant for widget implementations only, + * to set and access the internal canvas object. Do use this function unless + * you're implementing a widget. + * + * Sets the new resize object for this widget. + * + * @param[in] obj The object. + * @param[in] sobj A canvas object (often a @ref Efl_Canvas_Layout object). + * + * @ingroup Elm_Widget_Group + */ +EAPI void elm_widget_resize_object_set(Efl_Ui_Widget *obj, Efl_Canvas_Object *sobj); + +/** + * @brief Whether the widget is enabled (accepts and reacts to user inputs). + * + * The property works counted, this means, whenever n-caller set the value to + * @c true, n-caller have to set it to @c false in order to get it out of the + * disabled state again. + * + * Each widget may handle the disabled state differently, but overall disabled + * widgets shall not respond to any input events. This is @c false by default, + * meaning the widget is enabled. + * + * Enables or disables this widget. + * + * Disabling a widget will disable all its children recursively, but only this + * widget will be marked as disabled internally. + * + * @param[in] obj The object. + * @param[in] disabled @c true if the widget is disabled. + * + * @ingroup Elm_Widget_Group + */ +EAPI void elm_widget_disabled_set(Efl_Ui_Widget *obj, Eina_Bool disabled); + +/** + * @brief Whether the widget is enabled (accepts and reacts to user inputs). + * + * The property works counted, this means, whenever n-caller set the value to + * @c true, n-caller have to set it to @c false in order to get it out of the + * disabled state again. + * + * Each widget may handle the disabled state differently, but overall disabled + * widgets shall not respond to any input events. This is @c false by default, + * meaning the widget is enabled. + * + * Returns whether the widget is disabled. + * + * This will return @c true if any widget in the parent hierarchy is disabled. + * Re-enabling that parent may in turn change the disabled state of this + * widget. + * + * @param[in] obj The object. + * + * @return @c true if the widget is disabled. + * + * @ingroup Elm_Widget_Group + */ +EAPI Eina_Bool elm_widget_disabled_get(const Efl_Ui_Widget *obj); + +/** + * @brief The widget style to use. + * + * Styles define different look and feel for widgets, and may provide different + * parts for layout-based widgets. Styles vary from widget to widget and may be + * defined by other themes by means of extensions and overlays. + * + * The style can only be set before @ref Efl.Object.finalize, which means at + * construction time of the object (inside @c efl_add in C). + * + * Can only be called during construction, before finalize. + * + * @param[in] obj The object. + * @param[in] style Name of the style to use. Refer to each widget's + * documentation for the available style names, or to the themes in use. + * + * @return Whether the style was successfully applied or not, see the values of + * Efl.Ui.Theme.Apply_Error for more information. + * + * @ingroup Elm_Widget_Group + */ +EAPI Eina_Error elm_widget_style_set(Efl_Ui_Widget *obj, const char *style); + +/** + * @brief The widget style to use. + * + * Styles define different look and feel for widgets, and may provide different + * parts for layout-based widgets. Styles vary from widget to widget and may be + * defined by other themes by means of extensions and overlays. + * + * The style can only be set before @ref Efl.Object.finalize, which means at + * construction time of the object (inside @c efl_add in C). + * + * Returns the current style of a widget. + * + * @param[in] obj The object. + * + * @return Name of the style to use. Refer to each widget's documentation for + * the available style names, or to the themes in use. + * + * @ingroup Elm_Widget_Group + */ +EAPI const char *elm_widget_style_get(const Efl_Ui_Widget *obj); + + +/** + * @brief The ability for a widget to be focused. + * + * Unfocusable objects do nothing when programmatically focused. The nearest + * focusable parent object the one really getting focus. Also, when they + * receive mouse input, they will get the event, but not take away the focus + * from where it was previously. + * + * @note Objects which are meant to be interacted with by input events are + * created able to be focused, by default. All the others are not. + * + * This property's default value depends on the widget (eg. a box is not + * focusable, but a button is). + * + * @param[in] obj The object. + * @param[in] can_focus Whether the object is focusable. + * + * @ingroup Elm_Widget_Group + */ +EAPI void elm_widget_can_focus_set(Efl_Ui_Widget *obj, Eina_Bool can_focus); + +/** + * @brief The ability for a widget to be focused. + * + * Unfocusable objects do nothing when programmatically focused. The nearest + * focusable parent object the one really getting focus. Also, when they + * receive mouse input, they will get the event, but not take away the focus + * from where it was previously. + * + * @note Objects which are meant to be interacted with by input events are + * created able to be focused, by default. All the others are not. + * + * This property's default value depends on the widget (eg. a box is not + * focusable, but a button is). + * + * @param[in] obj The object. + * + * @return Whether the object is focusable. + * + * @ingroup Elm_Widget_Group + */ +EAPI Eina_Bool elm_widget_can_focus_get(const Efl_Ui_Widget *obj); + +/** + * @brief The internal parent of this widget. + * + * @ref Efl_Ui_Widget objects have a parent hierarchy that may differ slightly + * from their @ref Efl_Object or @ref Efl_Canvas_Object hierarchy. This is + * meant for internal handling. + * + * @param[in] obj The object. + * @param[in] parent Widget parent object + * + * @ingroup Elm_Widget_Group + */ +EAPI void elm_widget_parent_set(Efl_Ui_Widget *obj, Efl_Ui_Widget *parent); + +/** + * @brief The internal parent of this widget. + * + * @ref Efl_Ui_Widget objects have a parent hierarchy that may differ slightly + * from their @ref Efl_Object or @ref Efl_Canvas_Object hierarchy. This is + * meant for internal handling. + * + * @param[in] obj The object. + * + * @return Widget parent object + * + * @ingroup Elm_Widget_Group + */ +EAPI Efl_Ui_Widget *elm_widget_parent_get(const Efl_Ui_Widget *obj); + +/** + * @brief Virtual function handling sub objects being added. + * + * Sub objects can be any canvas object, not necessarily widgets. + * + * See also @ref elm_widget_parent_get. + * + * @param[in] obj The object. + * @param[in] sub_obj Sub object to be added. Not necessarily a widget itself. + * + * @return Indicates if the operation succeeded. + * + * @ingroup Elm_Widget_Group + */ +EAPI Eina_Bool elm_widget_sub_object_add(Efl_Ui_Widget *obj, Efl_Canvas_Object *sub_obj); + +/** + * @brief Virtual function handling sub objects being removed. + * + * Sub objects can be any canvas object, not necessarily widgets. + * + * See also @ref elm_widget_parent_get. + * + * @param[in] obj The object. + * @param[in] sub_obj Sub object to be removed. Should be a child of this + * widget. + * + * @return Indicates if the operation succeeded. + * + * @ingroup Elm_Widget_Group + */ +EAPI Eina_Bool elm_widget_sub_object_del(Efl_Ui_Widget *obj, Efl_Canvas_Object *sub_obj); + +/** + * @brief Virtual function called when the widget needs to re-apply its theme. + * + * This may be called when the object is first created, or whenever the widget + * is modified in any way that may require a reload of the theme. This may + * include but is not limited to scale, theme, or mirrored mode changes. + * + * @note even widgets not based on layouts may override this method to handle + * widget updates (scale, mirrored mode, etc...). + * + * @param[in] obj The object. + * + * @return Indicates success, and if the current theme or default theme was + * used. + * + * @ingroup Elm_Widget_Group + */ +EAPI Eina_Error elm_widget_theme_apply(Efl_Ui_Widget *obj); + +/** + * @brief Region of interest inside this widget, that should be given priority + * to be visible inside a scroller. + * + * When this widget or one of its subwidgets is given focus, this region should + * be shown, which means any parent scroller should attempt to display the + * given area of this widget. For instance, an entry given focus should scroll + * to show the text cursor if that cursor moves. In this example, this region + * defines the relative geometry of the cursor within the widget. + * + * @note The region is relative to the top-left corner of the widget, i.e. X,Y + * start from 0,0 to indicate the top-left corner of the widget. W,H must be + * greater or equal to 1 for this region to be taken into account, otherwise it + * is ignored. + * + * @param[in] obj The object. + * + * @return The relative region to show. If width or height is <= 0 it will be + * ignored, and no action will be taken. + * + * @ingroup Elm_Widget_Group + */ +EAPI Eina_Rect elm_widget_focus_region_get(const Efl_Ui_Widget *obj); + +/** + * @brief The rectangle region to be highlighted on focus. + * + * This is a rectangle region where the focus highlight should be displayed. + * + * This is a read-only property. + * + * @param[in] obj The object. + * + * @return The rectangle area. + * + * @ingroup Elm_Widget_Group + */ +EAPI Eina_Rect elm_widget_focus_highlight_geometry_get(const Efl_Ui_Widget *obj); + +/** + * @brief Register focus with the given configuration. + * + * The implementation can feel free to change the logical flag as it wants, but + * other than that it should strictly keep the configuration. + * + * The implementation in elm.widget updates the current state into what is + * passed as configured state, respecting manager changes, registeration and + * unregistration based on if it should be registered or unregistered. + * + * A manager field that is @c null means that the widget should not or was not + * registered. + * + * @param[in] obj The object. + * @param[in] current_state The focus manager to register with. + * @param[in,out] configured_state The evaluated Focus state that should be + * used. + * @param[in] redirect A redirect that will be set by the elm.widget + * implementation. + * + * @return Returns whether the widget is registered or not. + * + * @ingroup Elm_Widget_Group + */ +EAPI Eina_Bool elm_widget_focus_state_apply(Efl_Ui_Widget *obj, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect); + +#endif diff --git a/src/lib/elementary/efl_ui_widget_factory.c b/src/lib/elementary/efl_ui_widget_factory.c new file mode 100644 index 0000000000..a04bdcbb23 --- /dev/null +++ b/src/lib/elementary/efl_ui_widget_factory.c @@ -0,0 +1,134 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#define EFL_UI_WIDGET_PROTECTED + +#include +#include "elm_priv.h" + +typedef struct _Efl_Ui_Widget_Factory_Data Efl_Ui_Widget_Factory_Data; +typedef struct _Efl_Ui_Widget_Factory_Request Efl_Ui_Widget_Factory_Request; + +struct _Efl_Ui_Widget_Factory_Data +{ + const Efl_Class *klass; + + Eina_Stringshare *style; +}; + +struct _Efl_Ui_Widget_Factory_Request +{ + Efl_Ui_Widget_Factory_Data *pd; + Eo *parent; + Efl_Model *model; +}; + +static void +_efl_ui_widget_factory_item_class_set(Eo *obj, Efl_Ui_Widget_Factory_Data *pd, + const Efl_Class *klass) +{ + if (!efl_isa(klass, EFL_UI_VIEW_INTERFACE) || + !efl_isa(klass, EFL_UI_WIDGET_CLASS)) + { + ERR("Provided class '%s' for factory '%s' doesn't implement '%s' and '%s' interfaces.", + efl_class_name_get(klass), + efl_class_name_get(obj), + efl_class_name_get(EFL_UI_WIDGET_CLASS), + efl_class_name_get(EFL_UI_VIEW_INTERFACE)); + return ; + } + pd->klass = klass; +} + +static const Efl_Class * +_efl_ui_widget_factory_item_class_get(const Eo *obj EINA_UNUSED, + Efl_Ui_Widget_Factory_Data *pd) +{ + return pd->klass; +} + +static Eina_Value +_efl_ui_widget_factory_create_then(Eo *obj EINA_UNUSED, void *data, const Eina_Value v) +{ + Efl_Ui_Widget_Factory_Request *r = data; + Efl_Ui_Widget *w; + const char *string = NULL; + + if (!eina_value_string_get(&v, &string)) + return eina_value_error_init(EFL_MODEL_ERROR_NOT_SUPPORTED); + + w = efl_add(r->pd->klass, r->parent, + efl_ui_widget_style_set(efl_added, string), + efl_ui_view_model_set(efl_added, r->model)); + + return eina_value_object_init(w); +} + +static void +_efl_ui_widget_factory_create_cleanup(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED) +{ + Efl_Ui_Widget_Factory_Request *r = data; + + efl_unref(r->model); + efl_unref(r->parent); + free(r); +} + +static Eina_Future * +_efl_ui_widget_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Widget_Factory_Data *pd, + Efl_Model *model, Efl_Gfx_Entity *parent) +{ + Efl_Ui_Widget_Factory_Request *r; + + if (!pd->klass) + return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE); + + if (!pd->style) + { + Efl_Ui_Widget *w; + + w = efl_add(pd->klass, parent, + efl_ui_view_model_set(efl_added, model)); + return efl_loop_future_resolved(obj, eina_value_object_init(w)); + } + + r = calloc(1, sizeof (Efl_Ui_Widget_Factory_Request)); + if (!r) return efl_loop_future_rejected(obj, ENOMEM); + + r->pd = pd; + r->parent = efl_ref(parent); + r->model = efl_ref(model); + + return efl_future_then(obj, efl_model_property_ready_get(obj, pd->style), + .success = _efl_ui_widget_factory_create_then, + .data = r, + .free = _efl_ui_widget_factory_create_cleanup); +} + +static void +_efl_ui_widget_factory_efl_ui_factory_release(Eo *obj EINA_UNUSED, + Efl_Ui_Widget_Factory_Data *pd EINA_UNUSED, + Efl_Gfx_Entity *ui_view) +{ + // We do not cache or track this item, just get rid of them asap + efl_del(ui_view); +} + +Eina_Stringshare *_property_style_ss = NULL; + +static Eina_Error +_efl_ui_widget_factory_efl_ui_property_bind_property_bind(Eo *obj, Efl_Ui_Widget_Factory_Data *pd, + const char *target, const char *property) +{ + if (_property_style_ss == target || !strcmp(target, _property_style_ss)) + { + eina_stringshare_replace(&pd->style, property); + efl_event_callback_call(obj, EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND, (void*) _property_style_ss); + return 0; + } + + return efl_ui_property_bind(efl_super(obj, EFL_UI_WIDGET_FACTORY_CLASS), target, property); +} + +#include "efl_ui_widget_factory.eo.c" diff --git a/src/lib/elementary/efl_ui_widget_factory.eo b/src/lib/elementary/efl_ui_widget_factory.eo new file mode 100644 index 0000000000..fe1db277c4 --- /dev/null +++ b/src/lib/elementary/efl_ui_widget_factory.eo @@ -0,0 +1,28 @@ +class @beta Efl.Ui.Widget_Factory extends Efl.Loop_Consumer implements Efl.Ui.Factory +{ + [[Efl Ui Factory that provides @Efl.Ui.Widget. + + This factory is designed to build @Efl.Ui.Widget and optionally set their + @Efl.Ui.Widget.style if it was connected with @Efl.Ui.Property_Bind.property_bind "$style". + + ]] + methods { + @property item_class { + [[Define the class of the item returned by this factory.]] + get {} + set {} + values { + klass: const(Efl.Class); [[The class identifier to create item from.]] + } + } + } + + implements { + Efl.Ui.Factory.create; + Efl.Ui.Factory.release; + Efl.Ui.Property_Bind.property_bind; + } + constructors { + .item_class @optional; + } +} diff --git a/src/lib/elementary/efl_ui_widget_focus_manager.eo b/src/lib/elementary/efl_ui_widget_focus_manager.eo index 2c4fe32244..af5a09212f 100644 --- a/src/lib/elementary/efl_ui_widget_focus_manager.eo +++ b/src/lib/elementary/efl_ui_widget_focus_manager.eo @@ -1,5 +1,8 @@ mixin Efl.Ui.Widget_Focus_Manager requires Efl.Ui.Widget extends Efl.Ui.Focus.Manager { + [[ + @since 1.22 + ]] methods { focus_manager_create @protected @pure_virtual { [[If the widget needs a focus manager, this function will be called. @@ -19,4 +22,7 @@ mixin Efl.Ui.Widget_Focus_Manager requires Efl.Ui.Widget extends Efl.Ui.Focus.Ma Efl.Object.destructor; Efl.Ui.Widget.focus_state_apply; } + composite { + Efl.Ui.Focus.Manager; + } } diff --git a/src/lib/elementary/efl_ui_widget_image.h b/src/lib/elementary/efl_ui_widget_image.h index 8fae00f950..7a959d4cc6 100644 --- a/src/lib/elementary/efl_ui_widget_image.h +++ b/src/lib/elementary/efl_ui_widget_image.h @@ -80,7 +80,6 @@ struct _Efl_Ui_Image_Data const char *stdicon; struct { - Efl_Model *model; Eina_Stringshare *file; Eina_Stringshare *key; @@ -92,8 +91,6 @@ struct _Efl_Ui_Image_Data Eina_Bool use : 1; } freedesktop; - Ecore_Job *sizing_job; - Eina_Bool aspect_fixed : 1; Eina_Bool fill_inside : 1; Eina_Bool no_scale : 1; diff --git a/src/lib/elementary/efl_ui_widget_part.eo b/src/lib/elementary/efl_ui_widget_part.eo index b984e499ff..a2a51baf9f 100644 --- a/src/lib/elementary/efl_ui_widget_part.eo +++ b/src/lib/elementary/efl_ui_widget_part.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Widget_Part extends Efl.Object +class @beta Efl.Ui.Widget_Part extends Efl.Object { [[This is the base class for all "Part" handles in Efl.Ui widgets. diff --git a/src/lib/elementary/efl_ui_widget_part_bg.eo b/src/lib/elementary/efl_ui_widget_part_bg.eo index 59fd3014ef..94f87b8ec8 100644 --- a/src/lib/elementary/efl_ui_widget_part_bg.eo +++ b/src/lib/elementary/efl_ui_widget_part_bg.eo @@ -1,10 +1,12 @@ -class Efl.Ui.Widget_Part_Bg extends Efl.Ui.Widget_Part implements Efl.File, Efl.Gfx.Color, Efl.Gfx.Image +class @beta Efl.Ui.Widget_Part_Bg extends Efl.Ui.Widget_Part implements Efl.File, Efl.Gfx.Color, Efl.Gfx.Image { [[Elementary widget internal part background class]] data: null; implements { Efl.File.file { get; set; } - //Efl.File.mmap { get; set; } + Efl.File.key { get; set; } + Efl.File.mmap { get; set; } + Efl.File.load; Efl.Gfx.Color.color { set; get; } 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 0dc4c7d127..77002c0b41 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 extends Efl.Ui.Widget_Part implements Efl.Gfx.Color, +class @beta Efl.Ui.Widget_Part_Shadow extends Efl.Ui.Widget_Part implements 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 f78aaad1af..b37c1de997 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -6,14 +6,11 @@ #define EFL_ACCESS_COMPONENT_PROTECTED #define EFL_ACCESS_WIDGET_ACTION_PROTECTED #define EFL_INPUT_EVENT_PROTECTED -#define EFL_GFX_SIZE_HINT_PROTECTED -#define EFL_CANVAS_OBJECT_BETA +#define EFL_GFX_HINT_PROTECTED #define EFL_CANVAS_OBJECT_PROTECTED #define EFL_UI_L10N_PROTECTED #define EFL_UI_WIN_INLINED_PROTECTED #define EFL_UI_FOCUS_OBJECT_PROTECTED -#define EFL_UI_WIN_BETA -#define EFL_CANVAS_SCENE_BETA #define EFL_UI_WIDGET_FOCUS_MANAGER_PROTECTED #define EFL_PART_PROTECTED #define IPA_YLNO_ESU_LANRETNI_MLE @@ -27,17 +24,18 @@ # include "ecore_evas_wayland_private.h" #endif -#include "../evas/canvas/evas_box.eo.h" +#include "../evas/canvas/evas_box_eo.h" #define EFL_INTERNAL_UNSTABLE #include "interfaces/efl_common_internal.h" #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" +#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" +#include "efl_ui_widget_common.h" #define MY_CLASS EFL_UI_WIN_CLASS #define MY_CLASS_NAME "Efl.Ui.Win" @@ -55,7 +53,7 @@ static int _paused_windows = 0; #define TRAP(sd, name, ...) \ do \ { \ - if (sd->type != ELM_WIN_FAKE) \ + if (sd->type != EFL_UI_WIN_TYPE_FAKE) \ if ((!trap) || (!trap->name) || \ ((trap->name) && \ (trap->name(sd->trap_data, sd->obj, ## __VA_ARGS__)))) \ @@ -272,6 +270,8 @@ struct _Efl_Ui_Win_Data Eina_Bool ctor : 1; /**< legacy constructor: elm_win~add */ } legacy; + Eina_Value exit_on_close; + Eina_Bool first_draw : 1; Eina_Bool deferred_resize_job : 1; Eina_Bool urgent : 1; @@ -281,7 +281,7 @@ struct _Efl_Ui_Win_Data Eina_Bool autohide : 1; Eina_Bool constrain : 1; Eina_Bool resizing : 1; - Eina_Bool iconified : 1; + Eina_Bool minimized : 1; Eina_Bool withdrawn : 1; Eina_Bool sticky : 1; Eina_Bool fullscreen : 1; @@ -311,7 +311,7 @@ static const char SIG_FOCUS_OUT[] = "focus,out"; // deprecated. use "unfocused" static const char SIG_FOCUS_IN[] = "focus,in"; // deprecated. use "focused" instead. static const char SIG_MOVED[] = "moved"; static const char SIG_WITHDRAWN[] = "withdrawn"; -static const char SIG_ICONIFIED[] = "iconified"; +static const char SIG_MINIMIZED[] = "minimized"; static const char SIG_NORMAL[] = "normal"; static const char SIG_STICK[] = "stick"; static const char SIG_UNSTICK[] = "unstick"; @@ -331,7 +331,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { {SIG_FOCUS_IN, ""}, {SIG_MOVED, ""}, {SIG_WITHDRAWN, ""}, - {SIG_ICONIFIED, ""}, + {SIG_MINIMIZED, ""}, {SIG_NORMAL, ""}, {SIG_STICK, ""}, {SIG_UNSTICK, ""}, @@ -360,6 +360,7 @@ static const Elm_Action key_actions[] = { Eina_List *_elm_win_list = NULL; int _elm_win_deferred_free = 0; +static Eina_Value exit_on_all_windows_closed; static Eina_Bool _elm_win_throttle_ok = EINA_FALSE; static int _elm_win_count = 0; @@ -376,13 +377,73 @@ _elm_win_on_resize_obj_changed_size_hints(void *data, void *event_info); static void _elm_win_img_callbacks_del(Evas_Object *obj, Evas_Object *imgobj); -static Efl_Ui_Theme_Apply_Result _elm_win_theme_internal(Eo *obj, Efl_Ui_Win_Data *sd); +static Eina_Error _elm_win_theme_internal(Eo *obj, Efl_Ui_Win_Data *sd); static void _elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style); 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_frame_obj_update(Efl_Ui_Win_Data *sd, Eina_Bool force); +static inline Efl_Ui_Win_Type +_elm_win_type_to_efl_ui_win_type(Elm_Win_Type type) +{ + switch (type) + { +#define CONVERT_TYPE(TYPE) case ELM_WIN_##TYPE: return EFL_UI_WIN_TYPE_##TYPE + CONVERT_TYPE(BASIC); + CONVERT_TYPE(DIALOG_BASIC); + CONVERT_TYPE(DESKTOP); + CONVERT_TYPE(DOCK); + CONVERT_TYPE(TOOLBAR); + CONVERT_TYPE(MENU); + CONVERT_TYPE(UTILITY); + CONVERT_TYPE(SPLASH); + CONVERT_TYPE(DROPDOWN_MENU); + CONVERT_TYPE(POPUP_MENU); + CONVERT_TYPE(TOOLTIP); + CONVERT_TYPE(NOTIFICATION); + CONVERT_TYPE(COMBO); + CONVERT_TYPE(DND); + CONVERT_TYPE(INLINED_IMAGE); + CONVERT_TYPE(SOCKET_IMAGE); + CONVERT_TYPE(FAKE); + CONVERT_TYPE(NAVIFRAME_BASIC); + default: break; + } + return EFL_UI_WIN_TYPE_UNKNOWN; +#undef CONVERT_TYPE +} + +static inline Elm_Win_Type +_efl_ui_win_type_to_elm_win_type(Efl_Ui_Win_Type type) +{ + switch (type) + { +#define CONVERT_TYPE(TYPE) case EFL_UI_WIN_TYPE_##TYPE: return ELM_WIN_##TYPE + CONVERT_TYPE(BASIC); + CONVERT_TYPE(DIALOG_BASIC); + CONVERT_TYPE(DESKTOP); + CONVERT_TYPE(DOCK); + CONVERT_TYPE(TOOLBAR); + CONVERT_TYPE(MENU); + CONVERT_TYPE(UTILITY); + CONVERT_TYPE(SPLASH); + CONVERT_TYPE(DROPDOWN_MENU); + CONVERT_TYPE(POPUP_MENU); + CONVERT_TYPE(TOOLTIP); + CONVERT_TYPE(NOTIFICATION); + CONVERT_TYPE(COMBO); + CONVERT_TYPE(DND); + CONVERT_TYPE(INLINED_IMAGE); + CONVERT_TYPE(SOCKET_IMAGE); + CONVERT_TYPE(FAKE); + CONVERT_TYPE(NAVIFRAME_BASIC); + default: break; + } + return ELM_WIN_UNKNOWN; +#undef CONVERT_TYPE +} + #ifdef HAVE_ELEMENTARY_X static void _elm_win_xwin_update(Efl_Ui_Win_Data *sd); #endif @@ -422,7 +483,7 @@ _win_noblank_eval(void) if (sd->x.xwin) { - if ((sd->noblank) && (!sd->iconified) && (!sd->withdrawn) && + if ((sd->noblank) && (!sd->minimized) && (!sd->withdrawn) && evas_object_visible_get(obj)) noblanks++; @@ -486,12 +547,12 @@ _elm_win_apply_alpha(Eo *obj EINA_UNUSED, 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 + * minimized or not. You can request minimized state + * but there's no explicit feedback for minimization * or return to normal state. * * So, blocking drawing based on client side thinking - * it's iconified, and having the compositor think + * it's minimized, and having the compositor think * the client should be drawing will lead to * predictably disappointing results. * @@ -522,7 +583,7 @@ _elm_win_state_eval(void *data EINA_UNUSED) Eina_List *l; Evas_Object *obj; int _elm_win_count_shown = 0; - int _elm_win_count_iconified = 0; + int _elm_win_count_minimized = 0; int _elm_win_count_withdrawn = 0; Eina_Bool throttle = EINA_FALSE; @@ -587,7 +648,7 @@ _elm_win_state_eval(void *data EINA_UNUSED) EINA_LIST_FOREACH(_elm_win_list, l, obj) { if (elm_win_withdrawn_get(obj)) _elm_win_count_withdrawn++; - else if (elm_win_iconified_get(obj)) _elm_win_count_iconified++; + else if (elm_win_iconified_get(obj)) _elm_win_count_minimized++; else if (evas_object_visible_get(obj)) _elm_win_count_shown++; } if (_elm_win_count_shown <= 0) @@ -901,8 +962,8 @@ _elm_win_size_hints_update(Efl_Ui_Win *win, Efl_Ui_Win_Data *sd) { Eina_Size2D min, max; - min = efl_gfx_size_hint_combined_min_get(win); - max = efl_gfx_size_hint_max_get(win); + min = efl_gfx_hint_size_combined_min_get(win); + max = efl_gfx_hint_size_max_get(win); if (max.w < 1) max.w = -1; if (max.h < 1) max.h = -1; @@ -927,14 +988,16 @@ _elm_win_move(Ecore_Evas *ee) Efl_Ui_Win_Data *sd = _elm_win_associate_get(ee); int x, y; Eo *obj; + Eina_Position2D pos; if (!sd) return; obj = sd->obj; 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_ENTITY_EVENT_MOVE, NULL); + pos.x = sd->screen.x = x; + pos.y = sd->screen.y = y; + efl_event_callback_call(sd->obj, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, &pos); + evas_object_smart_callback_call(sd->obj, "move", NULL); ELM_WIN_DATA_ALIVE_CHECK(obj, sd); evas_nochange_push(evas_object_evas_get(sd->obj)); sd->response++; @@ -998,7 +1061,7 @@ _elm_win_pre_render(Ecore_Evas *ee) { int mw, mh; - if (sd->type != ELM_WIN_FAKE) + if (sd->type != EFL_UI_WIN_TYPE_FAKE) { edje_object_thaw(sd->frame_obj); evas_object_show(sd->frame_obj); @@ -1185,8 +1248,6 @@ _elm_win_focus_highlight_reconfigure_job(void *data) Eina_Bool visible_changed; Eina_Bool common_visible; const char *sig = NULL; - const char *focus_style_target = NULL; - const char *focus_style_previous = NULL; _elm_win_focus_highlight_reconfigure_job_stop(sd); @@ -1252,18 +1313,11 @@ _elm_win_focus_highlight_reconfigure_job(void *data) goto the_end; } - if (previous) - focus_style_previous = elm_widget_focus_highlight_style_get(previous); - focus_style_target = elm_widget_focus_highlight_style_get(target); - - if (sd->focus_highlight.theme_changed || - (focus_style_target != focus_style_previous)) + if (sd->focus_highlight.theme_changed) { const char *str; - if (focus_style_target) - str = focus_style_target; - else if (sd->focus_highlight.style) + if (sd->focus_highlight.style) str = sd->focus_highlight.style; else str = "default"; @@ -1322,7 +1376,7 @@ _elm_win_focus_in(Ecore_Evas *ee) _elm_widget_top_win_focused_set(obj, EINA_TRUE); ELM_WIN_DATA_ALIVE_CHECK(obj, sd); - if (sd->type != ELM_WIN_FAKE) + if (sd->type != EFL_UI_WIN_TYPE_FAKE) { Efl_Ui_Focus_Manager *man = sd->obj; while(efl_ui_focus_manager_redirect_get(man)) @@ -1345,7 +1399,7 @@ _elm_win_focus_in(Ecore_Evas *ee) if (_elm_config->atspi_mode) { efl_access_window_activated_signal_emit(obj); - efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_ACTIVE, EINA_TRUE); + efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_TYPE_ACTIVE, EINA_TRUE); } /* do nothing */ @@ -1392,10 +1446,10 @@ _elm_win_focus_out(Ecore_Evas *ee) if (_elm_config->atspi_mode) { efl_access_window_deactivated_signal_emit(obj); - efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_ACTIVE, EINA_FALSE); + efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_TYPE_ACTIVE, EINA_FALSE); } - if (sd->type != ELM_WIN_FAKE) + if (sd->type != EFL_UI_WIN_TYPE_FAKE) { Efl_Ui_Focus_Manager *man = sd->obj; while(efl_ui_focus_manager_redirect_get(man)) @@ -1485,7 +1539,6 @@ _elm_win_profile_update(Efl_Ui_Win_Data *sd) _config_profile_lock = EINA_TRUE; _elm_config_profile_set(sd->profile.name); - _config_profile_lock = EINA_FALSE; /* update sub ee */ Ecore_Evas *ee2; @@ -1559,6 +1612,95 @@ _elm_win_frame_obj_update(Efl_Ui_Win_Data *sd, Eina_Bool force) TRAP(sd, resize, w, h); } +static int +_win_rotation_degree_check(int rotation) +{ + if ((rotation > 360) || (rotation < 0)) + { + WRN("Rotation degree should be 0 ~ 360 (passed degree: %d)", rotation); + rotation %= 360; + if (rotation < 0) rotation += 360; + } + return rotation; +} + +/* + * This API resizes the internal window(ex: X window) and evas_output. + * But this does not resize the elm window object and its contents. + */ +static void +_win_rotate(Evas_Object *obj, Efl_Ui_Win_Data *sd, int rotation, Eina_Bool resize) +{ + rotation = _win_rotation_degree_check(rotation); + if (sd->rot == rotation) return; + sd->rot = rotation; + if (resize) TRAP(sd, rotation_with_resize_set, rotation); + else TRAP(sd, rotation_set, rotation); + efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(-1, -1)); + efl_gfx_hint_size_max_set(obj, EINA_SIZE2D(-1, -1)); + _elm_win_resize_objects_eval(obj, EINA_FALSE); +#ifdef HAVE_ELEMENTARY_X + _elm_win_xwin_update(sd); +#endif + _elm_win_frame_obj_update(sd, 0); + efl_event_callback_call + (obj, EFL_UI_WIN_EVENT_WIN_ROTATION_CHANGED, &rotation); + evas_object_smart_callback_call(obj, "rotation,changed", NULL); + if (_elm_config->atspi_mode) + { + Evas_Coord x = 0, y = 0, width = 0, height = 0; + elm_win_screen_size_get(obj, &x, &y, &width, &height); + if ((sd->rot == 0) || (sd->rot == 180)) + { + efl_access_bounds_changed_signal_emit(obj, x, y, width, height); + } + else + { + efl_access_bounds_changed_signal_emit(obj, x, y, height, width); + } + } +} + +EOLIAN static void +_efl_ui_win_win_rotation_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd, int rotation) +{ + Efl_Ui_Widget *widget; + Eina_Iterator *it; + int rot = rotation %360; + + if (pd->rot == rot) return; + + _win_rotate(obj, pd, rot, EINA_FALSE); + + it = efl_ui_widget_tree_widget_iterator(obj); + EINA_ITERATOR_FOREACH(it, widget) + { + if (!efl_isa(widget, EFL_UI_LAYOUT_BASE_CLASS)) continue; + + if (efl_ui_layout_automatic_theme_rotation_get(widget)) + efl_ui_layout_theme_rotation_apply(widget, rot); + } +} + +EOLIAN static int +_efl_ui_win_win_rotation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd) +{ + return pd->rot; +} + +EAPI void +elm_win_rotation_set(Evas_Object *obj, int rotation) +{ + efl_ui_win_rotation_set(obj, rotation); +} + +EAPI int +elm_win_rotation_get(const Evas_Object *obj) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(obj, -1); + return efl_ui_win_rotation_get(obj); +} + static void _elm_win_state_change(Ecore_Evas *ee) { @@ -1566,7 +1708,7 @@ _elm_win_state_change(Ecore_Evas *ee) Evas_Object *obj; Eina_Bool ch_withdrawn = EINA_FALSE; Eina_Bool ch_sticky = EINA_FALSE; - Eina_Bool ch_iconified = EINA_FALSE; + Eina_Bool ch_minimized = EINA_FALSE; Eina_Bool ch_fullscreen = EINA_FALSE; Eina_Bool ch_maximized = EINA_FALSE; Eina_Bool ch_profile = EINA_FALSE; @@ -1587,10 +1729,10 @@ _elm_win_state_change(Ecore_Evas *ee) sd->sticky = ecore_evas_sticky_get(sd->ee); ch_sticky = EINA_TRUE; } - if (sd->iconified != ecore_evas_iconified_get(sd->ee)) + if (sd->minimized != ecore_evas_iconified_get(sd->ee)) { - sd->iconified = ecore_evas_iconified_get(sd->ee); - ch_iconified = EINA_TRUE; + sd->minimized = ecore_evas_iconified_get(sd->ee); + ch_minimized = EINA_TRUE; } if (sd->fullscreen != ecore_evas_fullscreen_get(sd->ee)) { @@ -1614,21 +1756,21 @@ _elm_win_state_change(Ecore_Evas *ee) { if (sd->rot != ecore_evas_rotation_get(sd->ee)) { - sd->rot = ecore_evas_rotation_get(sd->ee); ch_wm_rotation = EINA_TRUE; } } _elm_win_state_eval_queue(); - if ((ch_withdrawn) || (ch_iconified)) + if ((ch_withdrawn) || (ch_minimized)) { ELM_WIN_DATA_ALIVE_CHECK(obj, sd); if (sd->withdrawn) efl_event_callback_legacy_call(obj, EFL_UI_WIN_EVENT_WITHDRAWN, NULL); - else if (sd->iconified) + else if (sd->minimized) { - efl_event_callback_legacy_call(obj, EFL_UI_WIN_EVENT_ICONIFIED, NULL); + efl_event_callback_call(obj, EFL_UI_WIN_EVENT_MINIMIZED, NULL); + evas_object_smart_callback_call(obj, "iconified", NULL); if (_elm_config->atspi_mode) efl_access_window_minimized_signal_emit(obj); } @@ -1655,35 +1797,39 @@ _elm_win_state_change(Ecore_Evas *ee) #endif if (ch_fullscreen) { + Eina_Bool fullscreen; ELM_WIN_DATA_ALIVE_CHECK(obj, sd); _elm_win_frame_style_update(sd, 0, 1); + fullscreen = sd->fullscreen; if (sd->fullscreen) { - efl_event_callback_legacy_call - (obj, EFL_UI_WIN_EVENT_FULLSCREEN, NULL); + evas_object_smart_callback_call(obj, "fullscreen", NULL); } else { - efl_event_callback_legacy_call - (obj, EFL_UI_WIN_EVENT_UNFULLSCREEN, NULL); + evas_object_smart_callback_call(obj, "unfullscreen", NULL); } + efl_event_callback_call(obj, EFL_UI_WIN_EVENT_FULLSCREEN_CHANGED, &fullscreen); } if (ch_maximized) { + Eina_Bool maximized; ELM_WIN_DATA_ALIVE_CHECK(obj, sd); _elm_win_frame_style_update(sd, 0, 1); + maximized = sd->maximized; if (sd->maximized) { - efl_event_callback_legacy_call(obj, EFL_UI_WIN_EVENT_MAXIMIZED, NULL); + evas_object_smart_callback_call(obj, "maximized", NULL); if (_elm_config->atspi_mode) efl_access_window_maximized_signal_emit(obj); } else { - efl_event_callback_legacy_call(obj, EFL_UI_WIN_EVENT_UNMAXIMIZED, NULL); + evas_object_smart_callback_call(obj, "unmaximized", NULL); if (_elm_config->atspi_mode) efl_access_window_restored_signal_emit(obj); } + efl_event_callback_call(obj, EFL_UI_WIN_EVENT_MAXIMIZED_CHANGED, &maximized); } if (ch_profile) { @@ -1692,31 +1838,10 @@ _elm_win_state_change(Ecore_Evas *ee) } if (ch_wm_rotation) { - efl_gfx_size_hint_restricted_min_set(obj, EINA_SIZE2D(-1, -1)); - efl_gfx_size_hint_max_set(obj, EINA_SIZE2D(-1, -1)); -#ifdef HAVE_ELEMENTARY_X - ELM_WIN_DATA_ALIVE_CHECK(obj, sd); - _elm_win_xwin_update(sd); -#endif - ELM_WIN_DATA_ALIVE_CHECK(obj, sd); - efl_ui_widget_on_orientation_update(obj, sd->rot); - efl_event_callback_legacy_call - (obj, EFL_UI_WIN_EVENT_ROTATION_CHANGED, NULL); + efl_ui_win_rotation_set(obj, ecore_evas_rotation_get(sd->ee)); + efl_event_callback_legacy_call (obj, EFL_UI_WIN_EVENT_WM_ROTATION_CHANGED, NULL); - if (_elm_config->atspi_mode) - { - Evas_Coord x = 0, y = 0, width = 0, height = 0; - elm_win_screen_size_get(obj, &x, &y, &width, &height); - if ((sd->rot == 0) || (sd->rot == 180)) - { - efl_access_bounds_changed_signal_emit(obj, x, y, width, height); - } - else - { - efl_access_bounds_changed_signal_emit(obj, x, y, height, width); - } - } } } @@ -1883,7 +2008,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_SCENE_EVENT_RENDER_POST, ev); + efl_event_callback_call(win, EFL_CANVAS_SCENE_EVENT_RENDER_POST, ev); } static void @@ -1894,7 +2019,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_SCENE_EVENT_RENDER_PRE, NULL); + efl_event_callback_call(win, EFL_CANVAS_SCENE_EVENT_RENDER_PRE, NULL); } static void @@ -1905,7 +2030,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_SCENE_EVENT_FOCUS_IN, NULL); + efl_event_callback_call(win, EFL_CANVAS_SCENE_EVENT_SCENE_FOCUS_IN, NULL); } static void @@ -1915,7 +2040,7 @@ _elm_win_evas_focus_out(void *data, { Eo *win = data; - efl_event_callback_legacy_call(win, EFL_CANVAS_SCENE_EVENT_FOCUS_OUT, NULL); + efl_event_callback_call(win, EFL_CANVAS_SCENE_EVENT_SCENE_FOCUS_OUT, NULL); } static void @@ -1927,7 +2052,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_SCENE_EVENT_OBJECT_FOCUS_IN, object); + efl_event_callback_call(win, EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_IN, object); } static void @@ -1938,7 +2063,7 @@ _elm_win_evas_object_focus_out(void *data, Eo *object = event_info; Eo *win = data; - efl_event_callback_legacy_call(win, EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_OUT, object); + efl_event_callback_call(win, EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_OUT, object); } static void @@ -1949,7 +2074,7 @@ _elm_win_evas_device_changed(void *data, Eo *device = event_info; Eo *win = data; - efl_event_callback_legacy_call(win, EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED, device); + efl_event_callback_call(win, EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED, device); } static void @@ -2050,13 +2175,13 @@ _win_event_add_cb(void *data, const Efl_Event *ev) evas_event_callback_add(sd->evas, EVAS_CALLBACK_RENDER_PRE, _elm_win_evas_render_pre, win); } - else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_FOCUS_IN) + else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_SCENE_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_SCENE_EVENT_FOCUS_OUT) + else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_SCENE_FOCUS_OUT) { if (!(sd->event_forward.focus_out++)) evas_event_callback_add(sd->evas, EVAS_CALLBACK_FOCUS_OUT, @@ -2181,13 +2306,13 @@ _win_event_del_cb(void *data, const Efl_Event *ev) evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_RENDER_PRE, _elm_win_evas_render_pre, win); } - else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_FOCUS_IN) + else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_SCENE_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_SCENE_EVENT_FOCUS_OUT) + else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_SCENE_FOCUS_OUT) { if (!(--sd->event_forward.focus_out)) evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_FOCUS_OUT, @@ -2370,7 +2495,7 @@ _efl_ui_win_show(Eo *obj, Efl_Ui_Win_Data *sd) { Eo *root; efl_access_window_created_signal_emit(obj); - root = efl_access_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN); + root = efl_access_object_access_root_get(); if (root) efl_access_children_changed_added_signal_emit(root, obj); } @@ -2439,7 +2564,7 @@ _efl_ui_win_hide(Eo *obj, Efl_Ui_Win_Data *sd) if (_elm_config->atspi_mode) { Eo *root; - root = efl_access_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN); + root = efl_access_object_access_root_get(); efl_access_window_destroyed_signal_emit(obj); if (root) efl_access_children_changed_del_signal_emit(root, obj); @@ -2459,12 +2584,10 @@ _efl_ui_win_efl_gfx_entity_visible_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool v else _efl_ui_win_hide(obj, sd); } -EOLIAN static Eina_Position2D -_efl_ui_win_efl_canvas_scene_pointer_position_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) +EOLIAN static Eina_Bool +_efl_ui_win_efl_canvas_scene_pointer_position_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eo *dev, Eina_Position2D *pos) { - Eina_Position2D pos; - evas_pointer_canvas_xy_get(sd->evas, &pos.x, &pos.y); - return pos; + return efl_canvas_scene_pointer_position_get(sd->evas, dev, pos); } EOLIAN static Eina_Bool @@ -2504,7 +2627,7 @@ _input_pointer_iterator_free(Input_Pointer_Iterator *it) } EOLIAN static Eina_Iterator * -_efl_ui_win_efl_canvas_scene_pointer_iterate(const Eo *obj, Efl_Ui_Win_Data *sd, +_efl_ui_win_pointer_iterate(const Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool hover EINA_UNUSED) { Input_Pointer_Iterator *it; @@ -2532,7 +2655,7 @@ _efl_ui_win_efl_canvas_scene_pointer_iterate(const Eo *obj, Efl_Ui_Win_Data *sd, Efl_Input_Pointer *ptr; double x, y; - ptr = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, (Eo *) obj, (void **) &ptrdata); + ptr = efl_input_pointer_instance_get( (Eo *) obj, (void **) &ptrdata); if (!ptrdata) break; ptrdata->tool = evas_touch_point_list_nth_id_get(sd->evas, i); @@ -2578,7 +2701,7 @@ _efl_ui_win_efl_canvas_scene_image_max_size_get(const Eo *obj EINA_UNUSED, Efl_U } EOLIAN static void -_efl_ui_win_efl_canvas_scene_smart_objects_calculate(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) +_efl_ui_win_efl_canvas_scene_group_objects_calculate(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) { evas_smart_objects_calculate(sd->evas); } @@ -2617,6 +2740,12 @@ _efl_ui_win_efl_canvas_scene_device_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Da return efl_canvas_scene_device_get(sd->evas, name); } +EOLIAN static Efl_Input_Device * +_efl_ui_win_efl_canvas_scene_seat_default_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) +{ + return efl_canvas_scene_seat_default_get(sd->evas); +} + EOLIAN static Efl_Input_Device * _efl_ui_win_efl_canvas_scene_seat_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, int id) { @@ -2881,7 +3010,7 @@ _efl_ui_win_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Win_Data *sd) /* NB: child deletion handled by parent's smart del */ - if ((sd->type != ELM_WIN_FAKE) && (trap) && (trap->del)) + if ((sd->type != EFL_UI_WIN_TYPE_FAKE) && (trap) && (trap->del)) trap->del(sd->trap_data, obj); if (sd->parent) @@ -2933,7 +3062,7 @@ _efl_ui_win_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Win_Data *sd) } else { - if (sd->ee && (sd->type != ELM_WIN_FAKE)) + if (sd->ee && (sd->type != EFL_UI_WIN_TYPE_FAKE)) { ecore_evas_manual_render_set(sd->ee, EINA_TRUE); edje_object_freeze(sd->frame_obj); @@ -2985,13 +3114,19 @@ _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_list) + if (eina_value_type_get(&sd->exit_on_close)) + efl_loop_quit(efl_loop_get(obj), sd->exit_on_close); + else if (!_elm_win_list) { if (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED) _elm_win_flush_cache_and_exit(obj); } if (!_elm_win_list) - efl_event_callback_call(efl_app_main_get(EFL_APP_CLASS), EFL_APP_EVENT_STANDBY, NULL); + { + efl_event_callback_call(efl_app_main_get(), EFL_APP_EVENT_STANDBY, NULL); + if (eina_value_type_get(&exit_on_all_windows_closed)) + efl_loop_quit(efl_loop_get(obj), exit_on_all_windows_closed); + } } EOLIAN static void @@ -3006,7 +3141,8 @@ _efl_ui_win_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Posit { sd->screen.x = pos.x; sd->screen.y = pos.y; - efl_event_callback_legacy_call(obj, EFL_GFX_ENTITY_EVENT_MOVE, NULL); + efl_event_callback_call(obj, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, &pos); + evas_object_smart_callback_call(obj, "move", NULL); } goto super_skip; } @@ -3028,7 +3164,8 @@ _efl_ui_win_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Posit { sd->screen.x = pos.x; sd->screen.y = pos.y; - efl_event_callback_legacy_call(obj, EFL_GFX_ENTITY_EVENT_MOVE, NULL); + efl_event_callback_call(obj, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, &pos); + evas_object_smart_callback_call(obj, "move", NULL); } if (sd->frame_obj) { @@ -3217,7 +3354,7 @@ _elm_win_wl_cursor_set(Evas_Object *obj, const char *cursor) if (cursor) { - if (!elm_widget_theme_object_set(sd->obj, sd->pointer.obj, + if (elm_widget_theme_object_set(sd->obj, sd->pointer.obj, "cursor", cursor, "default")) { elm_widget_theme_object_set(sd->obj, sd->pointer.obj, @@ -3341,7 +3478,7 @@ _elm_win_xwin_update(Efl_Ui_Win_Data *sd) { const char *s; - if (sd->type == ELM_WIN_FAKE) return; + if (sd->type == EFL_UI_WIN_TYPE_FAKE) return; _internal_elm_win_xwindow_get(sd); if (!sd->x.xwin) return; /* nothing more to do */ @@ -3569,7 +3706,7 @@ _elm_win_resize_objects_eval(Evas_Object *obj, Eina_Bool force_resize) if ((!minw) && (!minh) && (!sd->deferred_resize_job)) return; // If content has a weight, make resizable - efl_gfx_size_hint_weight_get(sd->legacy.edje, &wx, &wy); + efl_gfx_hint_weight_get(sd->legacy.edje, &wx, &wy); // Content max hint is ignored maxw = sd->max_w; @@ -3607,8 +3744,8 @@ _elm_win_resize_objects_eval(Evas_Object *obj, Eina_Bool force_resize) } sd->tmp_updating_hints = 1; - efl_gfx_size_hint_restricted_min_set(obj, EINA_SIZE2D(minw, minh)); - efl_gfx_size_hint_max_set(obj, EINA_SIZE2D(maxw, maxh)); + efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh)); + efl_gfx_hint_size_max_set(obj, EINA_SIZE2D(maxw, maxh)); sd->tmp_updating_hints = 0; _elm_win_size_hints_update(obj, sd); @@ -3963,40 +4100,40 @@ typedef struct _resize_info { } resize_info; 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) }, - { "elm.event.resize.r", ELM_CURSOR_RIGHT_SIDE, EFL_UI_WIN_MOVE_RESIZE_RIGHT, 8 XDIR(SIZE_R) }, - { "elm.event.resize.tl", ELM_CURSOR_TOP_LEFT_CORNER, EFL_UI_WIN_MOVE_RESIZE_TOP | EFL_UI_WIN_MOVE_RESIZE_LEFT, 5 XDIR(SIZE_TL) }, - { "elm.event.resize.bl", ELM_CURSOR_BOTTOM_LEFT_CORNER, EFL_UI_WIN_MOVE_RESIZE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_LEFT, 6 XDIR(SIZE_BL) }, - { "elm.event.resize.br", ELM_CURSOR_BOTTOM_RIGHT_CORNER, EFL_UI_WIN_MOVE_RESIZE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_RIGHT, 10 XDIR(SIZE_BR) }, - { "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) }, + { "elm.event.resize.t", ELM_CURSOR_TOP_SIDE, EFL_UI_WIN_MOVE_RESIZE_MODE_TOP, 1 XDIR(SIZE_T) }, + { "elm.event.resize.b", ELM_CURSOR_BOTTOM_SIDE, EFL_UI_WIN_MOVE_RESIZE_MODE_BOTTOM, 2 XDIR(SIZE_B) }, + { "elm.event.resize.l", ELM_CURSOR_LEFT_SIDE, EFL_UI_WIN_MOVE_RESIZE_MODE_LEFT, 4 XDIR(SIZE_L) }, + { "elm.event.resize.r", ELM_CURSOR_RIGHT_SIDE, EFL_UI_WIN_MOVE_RESIZE_MODE_RIGHT, 8 XDIR(SIZE_R) }, + { "elm.event.resize.tl", ELM_CURSOR_TOP_LEFT_CORNER, EFL_UI_WIN_MOVE_RESIZE_MODE_TOP | EFL_UI_WIN_MOVE_RESIZE_MODE_LEFT, 5 XDIR(SIZE_TL) }, + { "elm.event.resize.bl", ELM_CURSOR_BOTTOM_LEFT_CORNER, EFL_UI_WIN_MOVE_RESIZE_MODE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_MODE_LEFT, 6 XDIR(SIZE_BL) }, + { "elm.event.resize.br", ELM_CURSOR_BOTTOM_RIGHT_CORNER, EFL_UI_WIN_MOVE_RESIZE_MODE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_MODE_RIGHT, 10 XDIR(SIZE_BR) }, + { "elm.event.resize.tr", ELM_CURSOR_TOP_RIGHT_CORNER, EFL_UI_WIN_MOVE_RESIZE_MODE_TOP | EFL_UI_WIN_MOVE_RESIZE_MODE_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) }, + { "efl.event.resize.t", ELM_CURSOR_TOP_SIDE, EFL_UI_WIN_MOVE_RESIZE_MODE_TOP, 1 XDIR(SIZE_T) }, + { "efl.event.resize.b", ELM_CURSOR_BOTTOM_SIDE, EFL_UI_WIN_MOVE_RESIZE_MODE_BOTTOM, 2 XDIR(SIZE_B) }, + { "efl.event.resize.l", ELM_CURSOR_LEFT_SIDE, EFL_UI_WIN_MOVE_RESIZE_MODE_LEFT, 4 XDIR(SIZE_L) }, + { "efl.event.resize.r", ELM_CURSOR_RIGHT_SIDE, EFL_UI_WIN_MOVE_RESIZE_MODE_RIGHT, 8 XDIR(SIZE_R) }, + { "efl.event.resize.tl", ELM_CURSOR_TOP_LEFT_CORNER, EFL_UI_WIN_MOVE_RESIZE_MODE_TOP | EFL_UI_WIN_MOVE_RESIZE_MODE_LEFT, 5 XDIR(SIZE_TL) }, + { "efl.event.resize.bl", ELM_CURSOR_BOTTOM_LEFT_CORNER, EFL_UI_WIN_MOVE_RESIZE_MODE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_MODE_LEFT, 6 XDIR(SIZE_BL) }, + { "efl.event.resize.br", ELM_CURSOR_BOTTOM_RIGHT_CORNER, EFL_UI_WIN_MOVE_RESIZE_MODE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_MODE_RIGHT, 10 XDIR(SIZE_BR) }, + { "efl.event.resize.tr", ELM_CURSOR_TOP_RIGHT_CORNER, EFL_UI_WIN_MOVE_RESIZE_MODE_TOP | EFL_UI_WIN_MOVE_RESIZE_MODE_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) { const Efl_Ui_Win_Move_Resize_Mode edges[4] = { - EFL_UI_WIN_MOVE_RESIZE_TOP, EFL_UI_WIN_MOVE_RESIZE_LEFT, - EFL_UI_WIN_MOVE_RESIZE_BOTTOM, EFL_UI_WIN_MOVE_RESIZE_RIGHT + EFL_UI_WIN_MOVE_RESIZE_MODE_TOP, EFL_UI_WIN_MOVE_RESIZE_MODE_LEFT, + EFL_UI_WIN_MOVE_RESIZE_MODE_BOTTOM, EFL_UI_WIN_MOVE_RESIZE_MODE_RIGHT }; const Efl_Ui_Win_Move_Resize_Mode corners[4] = { - EFL_UI_WIN_MOVE_RESIZE_TOP | EFL_UI_WIN_MOVE_RESIZE_LEFT, - EFL_UI_WIN_MOVE_RESIZE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_LEFT, - EFL_UI_WIN_MOVE_RESIZE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_RIGHT, - EFL_UI_WIN_MOVE_RESIZE_TOP | EFL_UI_WIN_MOVE_RESIZE_RIGHT, + EFL_UI_WIN_MOVE_RESIZE_MODE_TOP | EFL_UI_WIN_MOVE_RESIZE_MODE_LEFT, + EFL_UI_WIN_MOVE_RESIZE_MODE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_MODE_LEFT, + EFL_UI_WIN_MOVE_RESIZE_MODE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_MODE_RIGHT, + EFL_UI_WIN_MOVE_RESIZE_MODE_TOP | EFL_UI_WIN_MOVE_RESIZE_MODE_RIGHT, }; const int i = rotation / 90; @@ -4010,7 +4147,7 @@ _move_resize_mode_rotate(int rotation, Efl_Ui_Win_Move_Resize_Mode mode) if (mode == corners[k]) return corners[(k + i) % 4]; - return EFL_UI_WIN_MOVE_RESIZE_MOVE; + return EFL_UI_WIN_MOVE_RESIZE_MODE_MOVE; } static const resize_info * @@ -4055,7 +4192,7 @@ _move_resize_mode_get(Evas_Object *obj, const char *source) return _resize_infos[k].mode; } - return EFL_UI_WIN_MOVE_RESIZE_MOVE; + return EFL_UI_WIN_MOVE_RESIZE_MODE_MOVE; } static void @@ -4196,7 +4333,7 @@ _win_move_resize_start(Efl_Ui_Win_Data *sd, Efl_Ui_Win_Move_Resize_Mode mode) return EINA_FALSE; } - if (mode == EFL_UI_WIN_MOVE_RESIZE_MOVE) + if (mode == EFL_UI_WIN_MOVE_RESIZE_MODE_MOVE) return _win_move_start(sd); ri = _resize_info_get(sd->obj, sd->rot, mode); @@ -4242,7 +4379,7 @@ _elm_win_frame_cb_move_start(void *data, { ELM_WIN_DATA_GET_OR_RETURN(data, sd); - _win_move_resize_start(sd, EFL_UI_WIN_MOVE_RESIZE_MOVE); + _win_move_resize_start(sd, EFL_UI_WIN_MOVE_RESIZE_MODE_MOVE); } static void @@ -4253,7 +4390,7 @@ _elm_win_frame_cb_resize_start(void *data, Evas_Object *obj EINA_UNUSED, Efl_Ui_Win_Move_Resize_Mode mode; mode = _move_resize_mode_get(sd->obj, source); - if (mode == EFL_UI_WIN_MOVE_RESIZE_MOVE) return; + if (mode == EFL_UI_WIN_MOVE_RESIZE_MODE_MOVE) return; _win_move_resize_start(sd, mode); } @@ -4267,7 +4404,7 @@ _elm_win_frame_cb_minimize(void *data, ELM_WIN_DATA_GET(data, sd); if (!sd) return; -// sd->iconified = EINA_TRUE; +// sd->minimized = EINA_TRUE; TRAP(sd, iconified_set, EINA_TRUE); } @@ -4433,8 +4570,8 @@ _elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style) v = version ? atoi(version) : 0; if (EINA_LIKELY(v >= FRAME_OBJ_THEME_MIN_VERSION)) { - if (!elm_widget_theme_object_set - (sd->obj, sd->frame_obj, "border", element, style)) + if (elm_widget_theme_object_set + (sd->obj, sd->frame_obj, "border", element, style) == EFL_UI_THEME_APPLY_ERROR_GENERIC) { ERR("Failed to set main border theme for the window."); ELM_SAFE_FREE(sd->frame_obj, evas_object_del); @@ -4629,7 +4766,7 @@ _elm_win_frame_style_update(Efl_Ui_Win_Data *sd, Eina_Bool force_emit, Eina_Bool if (!sd->frame_obj) { if (!efl_finalized_get(sd->obj)) return; - if (EINA_LIKELY(sd->type == ELM_WIN_FAKE)) + if (EINA_LIKELY(sd->type == EFL_UI_WIN_TYPE_FAKE)) return; if (!_elm_config->win_no_border) CRI("Window has no frame object!"); @@ -4825,28 +4962,38 @@ _elm_win_cb_show(void *data EINA_UNUSED, _elm_win_state_eval_queue(); } -static inline const char * -_efl_ui_win_accel(Efl_Ui_Win_Data *sd) +static inline Eina_Bool +_efl_ui_win_accel(Efl_Ui_Win_Data *sd, Eina_Stringshare **accel, int *gl_depth, int *gl_stencil, int *gl_msaa) { const char *str = sd->accel_pref; const char *env; + const char *cfg = NULL; + Eina_Bool is_accel = EINA_FALSE; - /* current elm config */ - if (!str) + /* current elm config OR global override */ + if ((!str) || ((_elm_config->accel_override) && (_elm_config->accel))) { - if (_elm_config->accel) str = _elm_config->accel; - if (_elm_accel_preference) str = _elm_accel_preference; + if (_elm_config->accel) cfg = _elm_config->accel; + if (_elm_config->accel_override && _elm_accel_preference) cfg = _elm_accel_preference; } - /* global overrides */ - if ((_elm_config->accel_override) && (_elm_config->accel)) - str = _elm_config->accel; - /* env var wins */ env = getenv("ELM_ACCEL"); - if (env) str = env; - return str; + if (env) + is_accel = _elm_config_accel_preference_parse(env, accel, gl_depth, gl_stencil, gl_msaa); + else if (cfg) + { + is_accel = !!cfg; + *accel = eina_stringshare_ref(cfg); + *gl_depth = _elm_config->gl_depth; + *gl_stencil = _elm_config->gl_stencil; + *gl_msaa = _elm_config->gl_msaa; + } + else + is_accel = _elm_config_accel_preference_parse(str, accel, gl_depth, gl_stencil, gl_msaa); + + return is_accel; } static inline void @@ -4859,7 +5006,7 @@ _elm_win_need_frame_adjust(Efl_Ui_Win_Data *sd, const char *engine) sd->csd.wayland = (eina_streq(engine, ELM_WAYLAND_SHM) || eina_streq(engine, ELM_WAYLAND_EGL)); - if (sd->type == ELM_WIN_FAKE) + if (sd->type == EFL_UI_WIN_TYPE_FAKE) sd->csd.need = EINA_FALSE; else if (eina_streq(s, "on")) sd->csd.need = EINA_TRUE; @@ -4875,7 +5022,7 @@ _indicator_resized(void *data, const Efl_Event *event) ELM_WIN_DATA_GET_OR_RETURN(data, sd); 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)); + efl_gfx_hint_size_restricted_min_set(indicator, EINA_SIZE2D(size->w, size->h)); _elm_win_frame_obj_update(sd, 0); } @@ -4886,11 +5033,6 @@ _create_indicator(Evas_Object *obj) const char *indicator_serv_name; indicator_serv_name = "elm_indicator_portrait"; - if (!indicator_serv_name) - { - ERR("Conformant cannot get portrait indicator service name"); - return NULL; - } indicator = elm_plug_add(obj); if (!indicator) @@ -4963,6 +5105,24 @@ _win_finalize_job_cb(void *data, const Eina_Value value) return value; } +static void +_gesture_manager_config_load(Eo *obj) +{ + Eina_Value val; + Efl_Canvas_Gesture_Manager *gm = efl_provider_find(obj, EFL_CANVAS_GESTURE_MANAGER_CLASS); + + eina_value_setup(&val, EINA_VALUE_TYPE_DOUBLE); + eina_value_set(&val, _elm_config->glayer_long_tap_start_timeout); + efl_gesture_manager_config_set(gm, "glayer_long_tap_start_timeout", &val); + + eina_value_set(&val, _elm_config->glayer_double_tap_timeout); + efl_gesture_manager_config_set(gm, "glayer_double_tap_timeout", &val); + + eina_value_setup(&val, EINA_VALUE_TYPE_INT); + eina_value_set(&val, _elm_config->glayer_tap_finger_size); + efl_gesture_manager_config_set(gm, "glayer_tap_finger_size", &val); +} + static Eo * _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_Ui_Win_Type type) { @@ -4995,12 +5155,11 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U /* just to store some data while trying out to create a canvas */ memset(&tmp_sd, 0, sizeof(Efl_Ui_Win_Data)); - is_gl_accel = _elm_config_accel_preference_parse - (_efl_ui_win_accel(sd), &accel, &gl_depth, &gl_stencil, &gl_msaa); + is_gl_accel = _efl_ui_win_accel(sd, &accel, &gl_depth, &gl_stencil, &gl_msaa); switch ((int) type) { - case ELM_WIN_FAKE: + case EFL_UI_WIN_TYPE_FAKE: tmp_sd.ee = sd->ee; break; case ELM_WIN_INLINED_IMAGE: @@ -5350,12 +5509,12 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U SD_CPY(shot.info); #undef SD_CPY - if ((type != ELM_WIN_FAKE) && (trap) && (trap->add)) + if ((type != EFL_UI_WIN_TYPE_FAKE) && (trap) && (trap->add)) sd->trap_data = trap->add(obj); /* complementary actions, which depend on final smart data * pointer */ - if (type == ELM_WIN_INLINED_IMAGE) + if (type == EFL_UI_WIN_TYPE_INLINED_IMAGE) _win_inlined_image_set(sd); #ifdef HAVE_ELEMENTARY_X else if ((engine) && @@ -5373,7 +5532,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U sd->kbdmode = ELM_WIN_KEYBOARD_UNKNOWN; sd->legacy.indmode = ELM_WIN_INDICATOR_UNKNOWN; - sd->indimode = EFL_UI_WIN_INDICATOR_OFF; + sd->indimode = EFL_UI_WIN_INDICATOR_MODE_OFF; #ifdef HAVE_ELEMENTARY_X _internal_elm_win_xwindow_get(sd); @@ -5413,7 +5572,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U } ecore_wl2_window_type_set(sd->wl.win, wtype); } - else if (sd->type == ELM_WIN_FAKE) + else if (sd->type == EFL_UI_WIN_TYPE_FAKE) { const char *env = getenv("WAYLAND_DISPLAY"); if (env) @@ -5459,13 +5618,13 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U evas_object_color_set(obj, 0, 0, 0, 0); evas_object_pass_events_set(obj, EINA_TRUE); - if (type == ELM_WIN_INLINED_IMAGE) + if (type == EFL_UI_WIN_TYPE_INLINED_IMAGE) efl_ui_win_inlined_parent_set(obj, parent); /* use own version of ecore_evas_object_associate() that does TRAP() */ ecore_evas_data_set(sd->ee, "elm_win", obj); - if (type != ELM_WIN_FAKE) + if (type != EFL_UI_WIN_TYPE_FAKE) { evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _elm_win_obj_callback_changed_size_hints, NULL); @@ -5490,7 +5649,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U ecore_evas_callback_resize_set(sd->ee, _elm_win_resize); ecore_evas_callback_move_set(sd->ee, _elm_win_move); ecore_evas_callback_pre_render_set(sd->ee, _elm_win_pre_render); - if (type != ELM_WIN_FAKE) + if (type != EFL_UI_WIN_TYPE_FAKE) { ecore_evas_callback_mouse_in_set(sd->ee, _elm_win_mouse_in); ecore_evas_callback_mouse_out_set(sd->ee, _elm_win_mouse_out); @@ -5519,7 +5678,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U _elm_win_xwin_update(sd); #endif - if (type != ELM_WIN_FAKE) + if (type != EFL_UI_WIN_TYPE_FAKE) { //Prohibiting auto-rendering, until elm_win is shown. if (_elm_win_auto_norender_withdrawn(obj)) @@ -5546,7 +5705,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U ERR("failed to grab F12 key to elm widgets (dot) tree generation"); #endif - if (type != ELM_WIN_FAKE) + if (type != EFL_UI_WIN_TYPE_FAKE) { if ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_ON) || ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_AUTO) && @@ -5584,7 +5743,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U _elm_win_apply_alpha(obj, sd); #ifdef HAVE_ELEMENTARY_WL2 - if ((type != ELM_WIN_FAKE) && (type != ELM_WIN_INLINED_IMAGE)) + if ((type != EFL_UI_WIN_TYPE_FAKE) && (type != EFL_UI_WIN_TYPE_INLINED_IMAGE)) { if ((engine) && ((!strcmp(engine, ELM_WAYLAND_SHM) || @@ -5612,7 +5771,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U #endif /* do not append to list; all windows render as black rects */ - if (type != ELM_WIN_FAKE) + if (type != EFL_UI_WIN_TYPE_FAKE) { const char *element = "base"; const char *style; @@ -5630,15 +5789,15 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U if (!style) style = "default"; switch (type) { - case EFL_UI_WIN_DIALOG_BASIC: element = "dialog"; break; - case EFL_UI_WIN_NAVIFRAME_BASIC: element = "naviframe"; break; + case EFL_UI_WIN_TYPE_DIALOG_BASIC: element = "dialog"; break; + case EFL_UI_WIN_TYPE_NAVIFRAME_BASIC: element = "naviframe"; break; default: break; } if (!_elm_config->win_no_border) _elm_win_frame_add(sd, element, style); - if (sd->indimode != EFL_UI_WIN_INDICATOR_OFF) + if (sd->indimode != EFL_UI_WIN_INDICATOR_MODE_OFF) _indicator_add(sd); if (_elm_config->focus_highlight_enable) @@ -5659,7 +5818,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U efl_event_callback_array_add(obj, _elm_win_tracking(), sd); evas_object_show(sd->legacy.edje); - if (type == ELM_WIN_FAKE) + if (type == EFL_UI_WIN_TYPE_FAKE) { _elm_win_resize_job(obj); _elm_win_move(sd->ee); @@ -5675,15 +5834,18 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U { switch (type) { - case EFL_UI_WIN_UNKNOWN: - case EFL_UI_WIN_BASIC: - case EFL_UI_WIN_DIALOG_BASIC: + case EFL_UI_WIN_TYPE_UNKNOWN: + case EFL_UI_WIN_TYPE_BASIC: + case EFL_UI_WIN_TYPE_DIALOG_BASIC: _elm_win_standard_init(obj); break; default: break; } } + // Load the config values into gesutre manager. + _gesture_manager_config_load(obj); + return obj; } @@ -5696,6 +5858,13 @@ _efl_ui_win_efl_object_finalize(Eo *obj, Efl_Ui_Win_Data *sd) if (!obj) return NULL; obj = efl_finalize(efl_super(obj, MY_CLASS)); if (obj && resume) efl_event_callback_call(efl_loop_get(obj), EFL_APP_EVENT_RESUME, NULL); + if (obj && (!elm_widget_is_legacy(obj))) + { + /* FIXME: if parts other than background are supported then this should change */ + if (efl_file_get(efl_super(efl_part(obj, "background"), EFL_UI_WIN_PART_CLASS)) || + efl_file_mmap_get(efl_super(efl_part(obj, "background"), EFL_UI_WIN_PART_CLASS))) + efl_file_load(efl_part(obj, "background")); + } return obj; } @@ -5722,7 +5891,7 @@ EOLIAN static void _efl_ui_win_efl_object_destructor(Eo *obj, Efl_Ui_Win_Data *pd EINA_UNUSED) { #ifdef HAVE_ELEMENTARY_WL2 - if (pd->type == ELM_WIN_FAKE) + if (pd->type == EFL_UI_WIN_TYPE_FAKE) { if (pd->wl.win) ecore_wl2_window_free(pd->wl.win); @@ -5827,21 +5996,6 @@ _efl_ui_win_accel_preference_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd) return pd->accel_pref; } -EOLIAN static void -_efl_ui_win_noblank_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd, Eina_Bool noblank) -{ - noblank = !!noblank; - if (pd->noblank == noblank) return; - pd->noblank = noblank; - _win_noblank_eval(); -} - -EOLIAN static Eina_Bool -_efl_ui_win_noblank_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd) -{ - return pd->noblank; -} - EOLIAN static void _efl_ui_win_win_role_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *role) { @@ -5899,6 +6053,23 @@ _efl_ui_win_icon_object_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) return sd->icon; } +EOLIAN static const Eina_Value * +_efl_ui_win_exit_on_close_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) +{ + return &sd->exit_on_close; +} + +EOLIAN static void +_efl_ui_win_exit_on_close_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const Eina_Value *exit_code) +{ + const Eina_Value_Type *type = eina_value_type_get(exit_code); + + if (type) + eina_value_copy(exit_code, &sd->exit_on_close); + else + eina_value_flush(&sd->exit_on_close); +} + /* Only for C API */ EAPI void elm_win_autodel_set(Eo *obj, Eina_Bool autodel) @@ -5934,7 +6105,7 @@ _efl_ui_win_activate(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) } EOLIAN static void -_efl_ui_win_efl_gfx_stack_raise(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd) +_efl_ui_win_efl_gfx_stack_raise_to_top(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd) { TRAP(pd, raise); } @@ -5942,11 +6113,11 @@ _efl_ui_win_efl_gfx_stack_raise(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd) EAPI void elm_win_raise(Eo *obj) { - efl_gfx_stack_raise(obj); + efl_gfx_stack_raise_to_top(obj); } EOLIAN static void -_efl_ui_win_efl_gfx_stack_lower(Eo *obj, Efl_Ui_Win_Data *pd EINA_UNUSED) +_efl_ui_win_efl_gfx_stack_lower_to_bottom(Eo *obj, Efl_Ui_Win_Data *pd EINA_UNUSED) { // Do nothing: in X we could request to stack lower but that has been abused // and transformed into a kind of "iconify". As a consequence, lower is @@ -6111,7 +6282,7 @@ _efl_ui_win_fullscreen_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool f // these engines... can ONLY be fullscreen return; } - else if (sd->type == ELM_WIN_FAKE) + else if (sd->type == EFL_UI_WIN_TYPE_FAKE) sd->fullscreen = !!fullscreen; else { @@ -6168,7 +6339,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_ENTITY_EVENT_RESIZE, _main_menu_resize_cb, NULL); + efl_event_callback_del(ev->object, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _main_menu_resize_cb, NULL); } static void @@ -6198,7 +6369,7 @@ _dbus_menu_set(Eina_Bool dbus_connect, void *data) else { DBG("Setting menu to local mode"); - efl_event_callback_add(sd->obj, EFL_GFX_ENTITY_EVENT_RESIZE, _main_menu_resize_cb, NULL); + efl_event_callback_add(sd->obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _main_menu_resize_cb, NULL); if (elm_widget_is_legacy(sd->obj)) edje_object_part_swallow(swallow, "elm.swallow.menu", sd->main_menu); @@ -6224,6 +6395,23 @@ _dbus_menu_set(Eina_Bool dbus_connect, void *data) //sd->deferred_resize_job = EINA_TRUE; } +EOLIAN static const Eina_Value * +_efl_ui_win_exit_on_all_windows_closed_get(void) +{ + return &exit_on_all_windows_closed; +} + +EOLIAN static void +_efl_ui_win_exit_on_all_windows_closed_set(const Eina_Value *exit_code) +{ + const Eina_Value_Type *type = eina_value_type_get(exit_code); + + if (type) + eina_value_copy(exit_code, &exit_on_all_windows_closed); + else + eina_value_flush(&exit_on_all_windows_closed); +} + EOLIAN static void _efl_ui_win_maximized_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool maximized) { @@ -6242,19 +6430,19 @@ _efl_ui_win_maximized_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) } EOLIAN static void -_efl_ui_win_iconified_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool iconified) +_efl_ui_win_minimized_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool minimized) { -// sd->iconified = iconified; - TRAP(sd, iconified_set, iconified); +// sd->minimized = minimized; + TRAP(sd, iconified_set, minimized); #ifdef HAVE_ELEMENTARY_X _elm_win_xwin_update(sd); #endif } EOLIAN static Eina_Bool -_efl_ui_win_iconified_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) +_efl_ui_win_minimized_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) { - return sd->iconified; + return sd->minimized; } EOLIAN static void @@ -6356,8 +6544,8 @@ _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(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; + if (sd->urgent) return EFL_UI_WIN_URGENT_MODE_URGENT; + return EFL_UI_WIN_URGENT_MODE_NONE; } EOLIAN static void @@ -6382,8 +6570,8 @@ _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(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; + if (sd->modal) return EFL_UI_WIN_MODAL_MODE_MODAL; + return EFL_UI_WIN_MODAL_MODE_NONE; } static void @@ -6403,12 +6591,12 @@ _win_aspect_get(Efl_Ui_Win_Data *sd) } EOLIAN static void -_efl_ui_win_efl_gfx_size_hint_hint_aspect_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd, - Efl_Gfx_Size_Hint_Aspect mode, Eina_Size2D sz) +_efl_ui_win_efl_gfx_hint_hint_aspect_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd, + Efl_Gfx_Hint_Aspect mode, Eina_Size2D sz) { if (sz.h) _win_aspect_set(pd, (double) sz.w / (double) sz.h); else _win_aspect_set(pd, 0.0); - efl_gfx_size_hint_aspect_set(efl_super(obj, MY_CLASS), mode, sz); + efl_gfx_hint_aspect_set(efl_super(obj, MY_CLASS), mode, sz); #ifdef HAVE_ELEMENTARY_WL2 if (pd->wl.win) ecore_wl2_window_aspect_set(pd->wl.win, sz.w, sz.h, mode); @@ -6416,10 +6604,10 @@ _efl_ui_win_efl_gfx_size_hint_hint_aspect_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Da } EOLIAN static void -_efl_ui_win_efl_gfx_size_hint_hint_weight_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd EINA_UNUSED, +_efl_ui_win_efl_gfx_hint_hint_weight_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd EINA_UNUSED, double w, double h) { - efl_gfx_size_hint_weight_set(efl_super(obj, MY_CLASS), w, h); + efl_gfx_hint_weight_set(efl_super(obj, MY_CLASS), w, h); #ifdef HAVE_ELEMENTARY_WL2 if (pd->wl.win) ecore_wl2_window_weight_set(pd->wl.win, w, h); @@ -6427,7 +6615,7 @@ _efl_ui_win_efl_gfx_size_hint_hint_weight_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Da } EOLIAN static void -_efl_ui_win_efl_gfx_size_hint_hint_base_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Size2D sz) +_efl_ui_win_hint_base_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Size2D sz) { sd->size_base_w = sz.w; sd->size_base_h = sz.h; @@ -6438,13 +6626,13 @@ _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(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) +_efl_ui_win_hint_base_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) { return EINA_SIZE2D(sd->size_base_w, sd->size_base_h); } EOLIAN static void -_efl_ui_win_efl_gfx_size_hint_hint_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Size2D sz) +_efl_ui_win_hint_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Size2D sz) { sd->size_step_w = sz.w; sd->size_step_h = sz.h; @@ -6455,11 +6643,11 @@ _efl_ui_win_efl_gfx_size_hint_hint_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data } EOLIAN static void -_efl_ui_win_efl_gfx_size_hint_hint_max_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Size2D sz) +_efl_ui_win_efl_gfx_hint_hint_size_max_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Size2D sz) { if (sd->tmp_updating_hints) { - efl_gfx_size_hint_max_set(efl_super(obj, MY_CLASS), sz); + efl_gfx_hint_size_max_set(efl_super(obj, MY_CLASS), sz); } else { @@ -6472,7 +6660,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(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) +_efl_ui_win_hint_step_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) { return EINA_SIZE2D(sd->size_step_w, sd->size_step_h); } @@ -6516,55 +6704,6 @@ elm_win_render(Evas_Object *obj) ecore_evas_manual_render(sd->ee); } -static int -_win_rotation_degree_check(int rotation) -{ - if ((rotation > 360) || (rotation < 0)) - { - WRN("Rotation degree should be 0 ~ 360 (passed degree: %d)", rotation); - rotation %= 360; - if (rotation < 0) rotation += 360; - } - return rotation; -} - -/* - * This API resizes the internal window(ex: X window) and evas_output. - * But this does not resize the elm window object and its contents. - */ -static void -_win_rotate(Evas_Object *obj, Efl_Ui_Win_Data *sd, int rotation, Eina_Bool resize) -{ - rotation = _win_rotation_degree_check(rotation); - if (sd->rot == rotation) return; - sd->rot = rotation; - if (resize) TRAP(sd, rotation_with_resize_set, rotation); - else TRAP(sd, rotation_set, rotation); - efl_gfx_size_hint_restricted_min_set(obj, EINA_SIZE2D(-1, -1)); - efl_gfx_size_hint_max_set(obj, EINA_SIZE2D(-1, -1)); - _elm_win_resize_objects_eval(obj, EINA_FALSE); -#ifdef HAVE_ELEMENTARY_X - _elm_win_xwin_update(sd); -#endif - _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); - if (_elm_config->atspi_mode) - { - Evas_Coord x = 0, y = 0, width = 0, height = 0; - elm_win_screen_size_get(obj, &x, &y, &width, &height); - if ((sd->rot == 0) || (sd->rot == 180)) - { - efl_access_bounds_changed_signal_emit(obj, x, y, width, height); - } - else - { - efl_access_bounds_changed_signal_emit(obj, x, y, height, width); - } - } -} - EOLIAN static void _efl_ui_win_wm_available_rotations_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool allow_0, Eina_Bool allow_90, @@ -6692,7 +6831,7 @@ _efl_ui_win_sticky_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) } EOLIAN static void -_efl_ui_win_keyboard_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Elm_Win_Keyboard_Mode mode) +_efl_ui_win_keyboard_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Efl_Ui_Win_Keyboard_Mode mode) { if (mode == sd->kbdmode) return; #ifdef HAVE_ELEMENTARY_X @@ -6706,7 +6845,7 @@ _efl_ui_win_keyboard_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Elm_Win_ #endif } -EOLIAN static Elm_Win_Keyboard_Mode +EOLIAN static Efl_Ui_Win_Keyboard_Mode _efl_ui_win_keyboard_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) { return sd->kbdmode; @@ -6719,7 +6858,7 @@ _efl_ui_win_indicator_mode_set(Eo *obj, Efl_Ui_Win_Data *sd, Efl_Ui_Win_Indicato if (sd->indimode == mode) return; sd->indimode = mode; - if (sd->indimode == EFL_UI_WIN_INDICATOR_OFF) + if (sd->indimode == EFL_UI_WIN_INDICATOR_MODE_OFF) { _indicator_del(sd); return; @@ -6729,20 +6868,20 @@ _efl_ui_win_indicator_mode_set(Eo *obj, Efl_Ui_Win_Data *sd, Efl_Ui_Win_Indicato if (elm_widget_is_legacy(obj)) { - if (sd->indimode == EFL_UI_WIN_INDICATOR_BG_OPAQUE) + if (sd->indimode == EFL_UI_WIN_INDICATOR_MODE_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) + else if (sd->indimode == EFL_UI_WIN_INDICATOR_MODE_BG_TRANSPARENT) edje_object_signal_emit(sd->frame_obj, "elm,action,indicator,bg_transparent", "elm"); - else if (sd->indimode == EFL_UI_WIN_INDICATOR_HIDDEN) + else if (sd->indimode == EFL_UI_WIN_INDICATOR_MODE_HIDDEN) edje_object_signal_emit(sd->frame_obj, "elm,action,indicator,hidden", "elm"); } else { - if (sd->indimode == EFL_UI_WIN_INDICATOR_BG_OPAQUE) + if (sd->indimode == EFL_UI_WIN_INDICATOR_MODE_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) + else if (sd->indimode == EFL_UI_WIN_INDICATOR_MODE_BG_TRANSPARENT) edje_object_signal_emit(sd->frame_obj, "efl,action,indicator,bg_transparent", "efl"); - else if (sd->indimode == EFL_UI_WIN_INDICATOR_HIDDEN) + else if (sd->indimode == EFL_UI_WIN_INDICATOR_MODE_HIDDEN) edje_object_signal_emit(sd->frame_obj, "efl,action,indicator,hidden", "efl"); } @@ -6778,7 +6917,7 @@ _efl_ui_win_screen_constrain_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) } EOLIAN static Eina_Size2D -_efl_ui_win_efl_screen_screen_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) +_efl_ui_win_efl_screen_screen_size_in_pixels_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); @@ -6807,66 +6946,9 @@ _efl_ui_win_prop_focus_skip_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_B TRAP(sd, focus_skip_set, skip); } -EOLIAN static Eina_Bool -_efl_ui_win_keygrab_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *key, - Efl_Input_Modifier modifiers EINA_UNUSED, - Efl_Input_Modifier not_modifiers EINA_UNUSED, - int priority EINA_UNUSED, Efl_Ui_Win_Keygrab_Mode grab_mode) -{ - Eina_Bool ret = EINA_FALSE; -#ifdef HAVE_ELEMENTARY_X - _internal_elm_win_xwindow_get(sd); - if (sd->x.xwin) - { - Ecore_X_Win_Keygrab_Mode x_grab_mode; - switch (grab_mode) - { - case ELM_WIN_KEYGRAB_SHARED: - x_grab_mode = ECORE_X_WIN_KEYGRAB_SHARED; - break; - case ELM_WIN_KEYGRAB_TOPMOST: - x_grab_mode = ECORE_X_WIN_KEYGRAB_TOPMOST; - break; - case ELM_WIN_KEYGRAB_EXCLUSIVE: - x_grab_mode = ECORE_X_WIN_KEYGRAB_EXCLUSIVE; - break; - case ELM_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE: - x_grab_mode = ECORE_X_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE; - break; - default: - return ret; - } - ret = ecore_x_window_keygrab_set(sd->x.xwin, key, 0, 0, 0, x_grab_mode); - } -#else - (void)sd; - (void)key; - (void)grab_mode; -#endif - return ret; -} - -EOLIAN static Eina_Bool -_efl_ui_win_keygrab_unset(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *key, - Efl_Input_Modifier modifiers EINA_UNUSED, - Efl_Input_Modifier not_modifiers EINA_UNUSED) -{ - Eina_Bool ret = EINA_FALSE; -#ifdef HAVE_ELEMENTARY_X - _internal_elm_win_xwindow_get(sd); - if (sd->x.xwin) - ret = ecore_x_window_keygrab_unset(sd->x.xwin, key, 0, 0); -#else - (void)sd; - (void)key; -#endif - return ret; -} - EOLIAN static void -_efl_ui_win_efl_ui_widget_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool enabled) +_efl_ui_win_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; if (sd->focus_highlight.enabled == enabled) return; @@ -6880,31 +6962,27 @@ _efl_ui_win_efl_ui_widget_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, Efl_U } EOLIAN static Eina_Bool -_efl_ui_win_efl_ui_widget_focus_highlight_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) +_efl_ui_win_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; } -static Efl_Ui_Theme_Apply_Result +static Eina_Error _elm_win_theme_internal(Eo *obj, Efl_Ui_Win_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; - Eina_Bool ret = EINA_FALSE, prev_alpha; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; + Eina_Bool prev_alpha; const char *s; int_ret = elm_widget_theme_object_set(obj, sd->legacy.edje, "win", "base", elm_widget_style_get(obj)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; edje_object_mirrored_set(sd->legacy.edje, efl_ui_mirrored_get(obj)); edje_object_scale_set(sd->legacy.edje, 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)); - - if (!ret) int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; prev_alpha = sd->theme_alpha; s = edje_object_data_get(sd->legacy.edje, "alpha"); @@ -6915,26 +6993,25 @@ _elm_win_theme_internal(Eo *obj, Efl_Ui_Win_Data *sd) return int_ret; } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _efl_ui_win_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Win_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; sd->focus_highlight.theme_changed = EINA_TRUE; int_ret = _elm_win_theme_internal(obj, sd) & int_ret; - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _elm_win_focus_highlight_reconfigure_job_start(sd); return int_ret; } EOLIAN static Eina_Bool -_efl_ui_win_efl_ui_widget_focus_highlight_style_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *style) +_efl_ui_win_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)) return EINA_TRUE; @@ -6944,16 +7021,14 @@ _efl_ui_win_efl_ui_widget_focus_highlight_style_set(Eo *obj EINA_UNUSED, Efl_Ui_ } EOLIAN static const char* -_efl_ui_win_efl_ui_widget_focus_highlight_style_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) +_efl_ui_win_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_efl_ui_widget_focus_highlight_animate_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool animate) +_efl_ui_win_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; if (sd->focus_highlight.animate == animate) return; @@ -6964,9 +7039,8 @@ _efl_ui_win_efl_ui_widget_focus_highlight_animate_set(Eo *obj EINA_UNUSED, Efl_U } EOLIAN static Eina_Bool -_efl_ui_win_efl_ui_widget_focus_highlight_animate_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) +_efl_ui_win_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; } @@ -7217,7 +7291,7 @@ _on_atspi_bus_connected(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUS target = efl_ui_focus_manager_focus_get(m); } if (target) - efl_access_state_changed_signal_emit(target, EFL_ACCESS_STATE_FOCUSED, EINA_TRUE); + efl_access_state_changed_signal_emit(target, EFL_ACCESS_STATE_TYPE_FOCUSED, EINA_TRUE); } else efl_access_window_deactivated_signal_emit(win); @@ -7264,7 +7338,7 @@ _efl_ui_win_efl_access_object_state_set_get(const Eo *obj, Efl_Ui_Win_Data *sd E 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); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_ACTIVE); return ret; } @@ -7327,7 +7401,7 @@ _efl_ui_win_efl_object_provider_find(const Eo *obj, 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_ACCESS_OBJECT_MIXIN) return efl_access_object_access_root_get(); if (klass == EFL_UI_FOCUS_PARENT_PROVIDER_INTERFACE) return pd->provider; @@ -7387,8 +7461,8 @@ _elm_win_bg_set(Efl_Ui_Win_Data *sd, Eo *bg) } } efl_gfx_entity_visible_set(bg, 1); - efl_gfx_size_hint_fill_set(bg, EINA_TRUE, EINA_TRUE); - efl_gfx_size_hint_weight_set(bg, 1, 1); + efl_gfx_hint_fill_set(bg, EINA_TRUE, EINA_TRUE); + efl_gfx_hint_weight_set(bg, 1, 1); efl_wref_add(bg, &sd->bg); return EINA_TRUE; } @@ -7558,10 +7632,15 @@ _efl_ui_win_part_color_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char return EINA_FALSE; } -static Eina_Bool -_efl_ui_win_part_file_set(Eo *obj, Efl_Ui_Win_Data *sd, const char *part, const char *file, const char *key) +static Eina_Error +_efl_ui_win_part_file_load(Eo *obj, Efl_Ui_Win_Data *sd, Eo *part_obj, const char *part) { + const char *file, *key; + sd->legacy.forbidden = EINA_TRUE; + if (efl_file_loaded_get(part_obj)) return 0; + file = efl_file_get(part_obj); + key = efl_file_key_get(part_obj); if (eina_streq(part, "background")) { Eina_Bool ok = EINA_TRUE; @@ -7571,7 +7650,7 @@ _efl_ui_win_part_file_set(Eo *obj, Efl_Ui_Win_Data *sd, const char *part, const { bg = efl_add(EFL_UI_IMAGE_CLASS, obj); efl_gfx_image_scale_type_set(bg, EFL_GFX_IMAGE_SCALE_TYPE_FIT_OUTSIDE); - ok = efl_file_set(bg, file, key); + ok = efl_file_simple_load(bg, file, key); if (!ok) ELM_SAFE_DEL(bg); _elm_win_bg_set(sd, bg); } @@ -7587,22 +7666,41 @@ _efl_ui_win_part_file_set(Eo *obj, Efl_Ui_Win_Data *sd, const char *part, const return EINA_FALSE; } -static Eina_Bool -_efl_ui_win_part_file_get(Eo *obj, Efl_Ui_Win_Data *sd, const char *part, const char **file, const char **key) +static const char * +_efl_ui_win_part_file_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const Eo *part_obj, const char *part EINA_UNUSED) { sd->legacy.forbidden = EINA_TRUE; - if (file) *file = NULL; - if (key) *key = NULL; + return efl_file_get(efl_super(part_obj, EFL_UI_WIN_PART_CLASS)); +#if 0 if (eina_streq(part, "background")) { const Eo *bg = _efl_ui_win_content_get(obj, sd, "background"); - efl_file_get(bg, file, key); - return EINA_TRUE; + return efl_file_get(bg); } WIN_PART_ERR(part); - return EINA_FALSE; + return NULL; +#endif +} + +static const char * +_efl_ui_win_part_file_key_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const Eo *part_obj, const char *part EINA_UNUSED) +{ + sd->legacy.forbidden = EINA_TRUE; + return efl_file_key_get(efl_super(part_obj, EFL_UI_WIN_PART_CLASS)); +/* NOTE; if more than one part is ever supported here then this section is needed */ +#if 0 + + if (eina_streq(part, "background")) + { + const Eo *bg = _efl_ui_win_content_get(obj, sd, "background"); + return efl_file_get(bg); + } + + WIN_PART_ERR(part); + return NULL; +#endif } /* Efl.Part begin */ @@ -7627,22 +7725,31 @@ _efl_ui_win_part_efl_gfx_color_color_get(const Eo *obj, void *_pd EINA_UNUSED, i _efl_ui_win_part_color_get(pd->obj, sd, pd->part, r, g, b, a); } -static Eina_Bool -_efl_ui_win_part_efl_file_file_set(Eo *obj, void *_pd EINA_UNUSED, const char *file, const char *key) +EOLIAN static const char * +_efl_ui_win_part_efl_file_file_get(const Eo *obj, void *_pd EINA_UNUSED) { 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); - return _efl_ui_win_part_file_set(pd->obj, sd, pd->part, file, key); + return _efl_ui_win_part_file_get(pd->obj, sd, obj, pd->part); } -static void -_efl_ui_win_part_efl_file_file_get(const Eo *obj, void *_pd EINA_UNUSED, const char **file, const char **key) +EOLIAN static const char * +_efl_ui_win_part_efl_file_key_get(const Eo *obj, void *_pd EINA_UNUSED) { 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); - _efl_ui_win_part_file_get(pd->obj, sd, pd->part, file, key); + return _efl_ui_win_part_file_key_get(pd->obj, sd, obj, pd->part); } +EOLIAN static Eina_Error +_efl_ui_win_part_efl_file_load(Eo *obj, void *_pd EINA_UNUSED) +{ + 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); + return _efl_ui_win_part_file_load(pd->obj, sd, obj, pd->part); +} + + ELM_PART_OVERRIDE(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data) ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data) ELM_PART_OVERRIDE_CONTENT_GET(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data) @@ -8126,15 +8233,6 @@ elm_win_wm_rotation_manual_rotation_done(Evas_Object *obj) ecore_evas_wm_rotation_manual_rotation_done(sd->ee); } -EAPI void -elm_win_rotation_set(Evas_Object *obj, int rotation) -{ - Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS); - if (!sd) return; - - _win_rotate(obj, sd, rotation, EINA_FALSE); -} - /* * This API does not resize the internal window (ex: X window). * But this resizes evas_output, elm window, and its contents. @@ -8148,15 +8246,6 @@ elm_win_rotation_with_resize_set(Evas_Object *obj, int rotation) _win_rotate(obj, sd, rotation, EINA_TRUE); } -EAPI int -elm_win_rotation_get(const Evas_Object *obj) -{ - Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS); - if (!sd) return -1; - - return sd->rot; -} - EAPI int elm_win_wm_rotation_preferred_rotation_get(const Evas_Object *obj) { @@ -8320,7 +8409,7 @@ elm_win_modal_set(Evas_Object *obj, Eina_Bool modal) { Efl_Ui_Win_Modal_Mode modality; - modality = modal ? EFL_UI_WIN_MODAL_MODAL : EFL_UI_WIN_MODAL_NONE; + modality = modal ? EFL_UI_WIN_MODAL_MODE_MODAL : EFL_UI_WIN_MODAL_MODE_NONE; efl_ui_win_modal_set(obj, modality); } @@ -8330,7 +8419,7 @@ elm_win_modal_get(const Evas_Object *obj) Efl_Ui_Win_Modal_Mode modality; modality = efl_ui_win_modal_get(obj); - return (modality != EFL_UI_WIN_MODAL_NONE); + return (modality != EFL_UI_WIN_MODAL_MODE_NONE); } EAPI void @@ -8372,14 +8461,14 @@ elm_win_title_get(const Evas_Object *obj) EAPI void elm_win_size_base_set(Evas_Object *obj, int w, int h) { - efl_gfx_size_hint_base_set(obj, EINA_SIZE2D(w, h)); + efl_ui_win_hint_base_set(obj, EINA_SIZE2D(w, h)); } EAPI void elm_win_size_base_get(const Evas_Object *obj, int *w, int *h) { Eina_Size2D sz; - sz = efl_gfx_size_hint_base_get(obj); + sz = efl_ui_win_hint_base_get(obj); if (w) *w = sz.w; if (h) *h = sz.h; } @@ -8387,14 +8476,14 @@ elm_win_size_base_get(const Evas_Object *obj, int *w, int *h) EAPI void elm_win_size_step_set(Evas_Object *obj, int w, int h) { - efl_gfx_size_hint_step_set(obj, EINA_SIZE2D(w, h)); + efl_ui_win_hint_step_set(obj, EINA_SIZE2D(w, h)); } EAPI void elm_win_size_step_get(const Evas_Object *obj, int *w, int *h) { Eina_Size2D sz; - sz = efl_gfx_size_hint_step_get(obj); + sz = efl_ui_win_hint_step_get(obj); if (w) *w = sz.w; if (h) *h = sz.h; } @@ -8606,7 +8695,7 @@ elm_win_aspect_set(Eo *obj, double aspect) if (aspect > DBL_EPSILON) sz = EINA_SIZE2D(1000 * aspect, 1000); - efl_gfx_size_hint_aspect_set(obj, EFL_GFX_SIZE_HINT_ASPECT_NONE, sz); + efl_gfx_hint_aspect_set(obj, EFL_GFX_HINT_ASPECT_NONE, sz); } EAPI double @@ -8659,7 +8748,7 @@ _window_layout_stack(Evas_Object *o, Evas_Object_Box_Data *p, void *data) EINA_LIST_FOREACH(p->children, l, opt) { child = opt->obj; - efl_gfx_size_hint_weight_get(child, &wx, &wy); + efl_gfx_hint_weight_get(child, &wx, &wy); if (EINA_DBL_EQ(wx, 0.0)) weight_x = 0; if (EINA_DBL_EQ(wy, 0.0)) weight_y = 0; @@ -8669,7 +8758,7 @@ _window_layout_stack(Evas_Object *o, Evas_Object_Box_Data *p, void *data) } if (minw < menuw) minw = menuw; - efl_gfx_size_hint_restricted_min_set(o, EINA_SIZE2D(minw, minh)); + efl_gfx_hint_size_restricted_min_set(o, EINA_SIZE2D(minw, minh)); evas_object_geometry_get(o, &x, &y, &w, &h); if (w < minw) w = minw; if (h < minh) h = minh; @@ -8681,7 +8770,7 @@ _window_layout_stack(Evas_Object *o, Evas_Object_Box_Data *p, void *data) evas_object_geometry_set(child, x, y, w, h); } - efl_gfx_size_hint_weight_set(sd->legacy.edje, weight_x, weight_y); + efl_gfx_hint_weight_set(sd->legacy.edje, weight_x, weight_y); //evas_object_smart_changed(sd->legacy.edje); } @@ -8700,7 +8789,7 @@ _elm_win_legacy_init(Efl_Ui_Win_Data *sd) edje_object_part_swallow(sd->legacy.edje, "efl.contents", sd->legacy.box); evas_object_geometry_set(sd->legacy.edje, 0, 0, 1, 1); - if (sd->type != ELM_WIN_FAKE) + if (sd->type != EFL_UI_WIN_TYPE_FAKE) { edje_object_update_hints_set(sd->legacy.edje, EINA_TRUE); evas_object_event_callback_add(sd->legacy.edje, EVAS_CALLBACK_CHANGED_SIZE_HINTS, @@ -8760,13 +8849,42 @@ EAPI Eina_Bool elm_win_keygrab_set(Elm_Win *obj, const char *key, Evas_Modifier_Mask modifiers EINA_UNUSED, Evas_Modifier_Mask not_modifiers EINA_UNUSED, - int priority, Elm_Win_Keygrab_Mode grab_mode) + int priority EINA_UNUSED, Elm_Win_Keygrab_Mode grab_mode) { // Note: Not converting modifiers as they are not used in the implementation - return efl_ui_win_keygrab_set(obj, key, - EFL_INPUT_MODIFIER_NONE, - EFL_INPUT_MODIFIER_NONE, - priority, grab_mode); + Eina_Bool ret = EINA_FALSE; +#ifdef HAVE_ELEMENTARY_X + Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EINA_FALSE); + _internal_elm_win_xwindow_get(sd); + if (sd->x.xwin) + { + Ecore_X_Win_Keygrab_Mode x_grab_mode; + switch (grab_mode) + { + case ELM_WIN_KEYGRAB_SHARED: + x_grab_mode = ECORE_X_WIN_KEYGRAB_SHARED; + break; + case ELM_WIN_KEYGRAB_TOPMOST: + x_grab_mode = ECORE_X_WIN_KEYGRAB_TOPMOST; + break; + case ELM_WIN_KEYGRAB_EXCLUSIVE: + x_grab_mode = ECORE_X_WIN_KEYGRAB_EXCLUSIVE; + break; + case ELM_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE: + x_grab_mode = ECORE_X_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE; + break; + default: + return ret; + } + ret = ecore_x_window_keygrab_set(sd->x.xwin, key, 0, 0, 0, x_grab_mode); + } +#else + (void)obj; + (void)key; + (void)grab_mode; +#endif + return ret; } EAPI Eina_Bool @@ -8775,9 +8893,18 @@ elm_win_keygrab_unset(Elm_Win *obj, const char *key, Evas_Modifier_Mask not_modifiers EINA_UNUSED) { // Note: Not converting modifiers as they are not used in the implementation - return efl_ui_win_keygrab_unset(obj, key, - EFL_INPUT_MODIFIER_NONE, - EFL_INPUT_MODIFIER_NONE); + Eina_Bool ret = EINA_FALSE; +#ifdef HAVE_ELEMENTARY_X + Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EINA_FALSE); + _internal_elm_win_xwindow_get(sd); + if (sd->x.xwin) + ret = ecore_x_window_keygrab_unset(sd->x.xwin, key, 0, 0); +#else + (void)obj; + (void)key; +#endif + return ret; } EAPI Eina_Bool @@ -8793,42 +8920,6 @@ elm_win_focus_get(const Efl_Ui_Win *obj) return efl_ui_focus_object_focus_get(obj); } -EAPI void -elm_win_focus_highlight_style_set(Elm_Win *obj, const char *style) -{ - elm_widget_focus_highlight_style_set(obj, style); -} - -EAPI const char * -elm_win_focus_highlight_style_get(const Elm_Win *obj) -{ - return elm_widget_focus_highlight_style_get(obj); -} - -EAPI Eina_Bool -elm_win_focus_highlight_enabled_get(const Efl_Ui_Win *obj) -{ - return elm_widget_focus_highlight_enabled_get(obj); -} - -EAPI void -elm_win_focus_highlight_enabled_set(Efl_Ui_Win *obj, Eina_Bool enabled) -{ - efl_ui_widget_focus_highlight_enabled_set(obj, enabled); -} - -EAPI void -elm_win_focus_highlight_animate_set(Elm_Win *obj, Eina_Bool animate) -{ - efl_ui_widget_focus_highlight_animate_set(obj, animate); -} - -EAPI Eina_Bool -elm_win_focus_highlight_animate_get(const Elm_Win *obj) -{ - return efl_ui_widget_focus_highlight_animate_get(obj); -} - EAPI Eina_Bool elm_win_available_profiles_get(const Elm_Win *obj, char ***profiles, unsigned int *count) { @@ -8888,7 +8979,7 @@ EAPI void elm_win_type_set(Evas_Object *obj, Elm_Win_Type type) { ERR("Calling deprecrated function '%s'", __FUNCTION__); - efl_ui_win_type_set(obj, type); + efl_ui_win_type_set(obj, _elm_win_type_to_efl_ui_win_type(type)); } EAPI void @@ -8942,8 +9033,45 @@ _efl_ui_win_legacy_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED) return obj; } + +Efl_Object *_efl_ui_win_legacy_efl_object_finalize(Eo *obj, void *pd); + + +static Eina_Bool +_efl_ui_win_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_WIN_LEGACY_EXTRA_OPS +#define EFL_UI_WIN_LEGACY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_finalize, _efl_ui_win_legacy_efl_object_finalize), + EFL_UI_WIN_LEGACY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_win_legacy_class_desc = { + EO_VERSION, + "Efl.Ui.Win_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _efl_ui_win_legacy_class_initializer, + _efl_ui_win_legacy_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_win_legacy_class_get, &_efl_ui_win_legacy_class_desc, EFL_UI_WIN_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); + + EAPI Evas_Object * -elm_win_add(Evas_Object *parent, const char *name, Efl_Ui_Win_Type type) +elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type) { const Efl_Class *klass = EFL_UI_WIN_LEGACY_CLASS; @@ -8966,7 +9094,7 @@ 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)); + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_FAKE)); } EAPI Evas_Object * @@ -8977,7 +9105,7 @@ elm_win_util_standard_add(const char *name, const char *title) 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)); + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC)); if (!win) return NULL; _elm_win_standard_init(win); @@ -8992,11 +9120,251 @@ elm_win_util_dialog_add(Evas_Object *parent, const char *name, const char *title 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)); + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_DIALOG_BASIC)); if (!win) return NULL; _elm_win_standard_init(win); return win; } -#include "efl_ui_win_legacy.eo.c" + +EAPI void +elm_win_keyboard_mode_set(Evas_Object *obj, Elm_Win_Keyboard_Mode mode) +{ + efl_ui_win_keyboard_mode_set(obj, mode); +} + +EAPI Elm_Win_Keyboard_Mode +elm_win_keyboard_mode_get(const Evas_Object *obj) +{ + return efl_ui_win_keyboard_mode_get(obj); +} + +EAPI void +elm_win_screen_constrain_set(Evas_Object *obj, Eina_Bool constrain) +{ + efl_ui_win_screen_constrain_set(obj, constrain); +} + +EAPI Eina_Bool +elm_win_screen_constrain_get(const Evas_Object *obj) +{ + return efl_ui_win_screen_constrain_get(obj); +} + +EAPI void +elm_win_prop_focus_skip_set(Evas_Object *obj, Eina_Bool skip) +{ + efl_ui_win_prop_focus_skip_set(obj, skip); +} + +EAPI void +elm_win_autohide_set(Evas_Object *obj, Eina_Bool autohide) +{ + efl_ui_win_autohide_set(obj, autohide); +} + +EAPI Eina_Bool +elm_win_autohide_get(const Evas_Object *obj) +{ + return efl_ui_win_autohide_get(obj); +} + +EAPI void +elm_win_exit_on_close_set(Evas_Object *obj, const Eina_Value *exit_code) +{ + efl_ui_win_exit_on_close_set(obj, exit_code); +} + +EAPI const Eina_Value * +elm_win_exit_on_close_get(const Evas_Object *obj) +{ + return efl_ui_win_exit_on_close_get(obj); +} + +EAPI void +elm_win_icon_object_set(Evas_Object *obj, Evas_Object *icon) +{ + efl_ui_win_icon_object_set(obj, icon); +} + +EAPI const Evas_Object * +elm_win_icon_object_get(const Evas_Object *obj) +{ + return efl_ui_win_icon_object_get(obj); +} + +EAPI void +elm_win_iconified_set(Evas_Object *obj, Eina_Bool iconified) +{ + efl_ui_win_minimized_set(obj, iconified); +} + +EAPI Eina_Bool +elm_win_iconified_get(const Evas_Object *obj) +{ + return efl_ui_win_minimized_get(obj); +} + +EAPI void +elm_win_maximized_set(Evas_Object *obj, Eina_Bool maximized) +{ + efl_ui_win_maximized_set(obj, maximized); +} + +EAPI Eina_Bool +elm_win_maximized_get(const Evas_Object *obj) +{ + return efl_ui_win_maximized_get(obj); +} + +EAPI void +elm_win_fullscreen_set(Evas_Object *obj, Eina_Bool fullscreen) +{ + efl_ui_win_fullscreen_set(obj, fullscreen); +} + +EAPI Eina_Bool +elm_win_fullscreen_get(const Evas_Object *obj) +{ + return efl_ui_win_fullscreen_get(obj); +} + +EAPI void +elm_win_sticky_set(Evas_Object *obj, Eina_Bool sticky) +{ + efl_ui_win_sticky_set(obj, sticky); +} + +EAPI Eina_Bool +elm_win_sticky_get(const Evas_Object *obj) +{ + return efl_ui_win_sticky_get(obj); +} + +EAPI void +elm_win_noblank_set(Evas_Object *obj, Eina_Bool noblank) +{ + Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS); + EINA_SAFETY_ON_NULL_RETURN(sd); + noblank = !!noblank; + if (sd->noblank == noblank) return; + sd->noblank = noblank; + _win_noblank_eval(); +} + +EAPI Eina_Bool +elm_win_noblank_get(const Evas_Object *obj) +{ + Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EINA_FALSE); + return sd->noblank; +} + +EAPI void +elm_win_borderless_set(Evas_Object *obj, Eina_Bool borderless) +{ + efl_ui_win_borderless_set(obj, borderless); +} + +EAPI Eina_Bool +elm_win_borderless_get(const Evas_Object *obj) +{ + return efl_ui_win_borderless_get(obj); +} + +EAPI void +elm_win_role_set(Evas_Object *obj, const char *role) +{ + efl_ui_win_role_set(obj, role); +} + +EAPI const char * +elm_win_role_get(const Evas_Object *obj) +{ + return efl_ui_win_role_get(obj); +} + +EAPI const char * +elm_win_name_get(const Evas_Object *obj) +{ + return efl_ui_win_name_get(obj); +} + +EAPI Elm_Win_Type +elm_win_type_get(const Evas_Object *obj) +{ + return _efl_ui_win_type_to_elm_win_type(efl_ui_win_type_get(obj)); +} + +EAPI const char * +elm_win_accel_preference_get(const Evas_Object *obj) +{ + return efl_ui_win_accel_preference_get(obj); +} + +EAPI void +elm_win_alpha_set(Evas_Object *obj, Eina_Bool alpha) +{ + efl_ui_win_alpha_set(obj, alpha); +} + +EAPI Eina_Bool +elm_win_alpha_get(const Evas_Object *obj) +{ + return efl_ui_win_alpha_get(obj); +} + +EAPI void +elm_win_activate(Evas_Object *obj) +{ + efl_ui_win_activate(obj); +} + +EAPI void +elm_win_center(Evas_Object *obj, Eina_Bool h, Eina_Bool v) +{ + efl_ui_win_center(obj, h, v); +} + +EAPI Eina_Bool +elm_win_move_resize_start(Evas_Object *obj, Elm_Win_Move_Resize_Mode mode) +{ + return efl_ui_win_move_resize_start(obj, mode); +} + +EAPI void +elm_win_focus_highlight_animate_set(Efl_Ui_Win *obj, Eina_Bool animate) +{ + efl_ui_win_focus_highlight_animate_set(obj, animate); +} + +EAPI Eina_Bool +elm_win_focus_highlight_animate_get(const Efl_Ui_Win *obj) +{ + return efl_ui_win_focus_highlight_animate_get(obj); +} + +EAPI void +elm_win_focus_highlight_enabled_set(Efl_Ui_Win *obj, Eina_Bool enabled) +{ + efl_ui_win_focus_highlight_enabled_set(obj, enabled); +} + +EAPI Eina_Bool +elm_win_focus_highlight_enabled_get(const Efl_Ui_Win *obj) +{ + return efl_ui_win_focus_highlight_enabled_get(obj); +} + +EAPI Eina_Bool +elm_win_focus_highlight_style_set(Efl_Ui_Win *obj, const char *style) +{ + return efl_ui_win_focus_highlight_style_set(obj, style); +} + +EAPI const char * +elm_win_focus_highlight_style_get(const Efl_Ui_Win *obj) +{ + return efl_ui_win_focus_highlight_style_get(obj); +} diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo index 2dbd882fab..33a4be6510 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 @beta Efl.Ui.Win_Type { [[Defines the types of window that can be created @@ -8,7 +8,6 @@ enum Efl.Ui.Win_Type Currently, only the X11 backed engines use them. ]] - legacy: efl_ui_win; unknown = -1, [[Default, unknown, type]] basic, [[A normal window. Indicates a normal, top-level window. Almost every @@ -36,21 +35,23 @@ 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, + inlined_image, + socket_image, + fake, /* 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. - @since 1.19 ]] } -enum Efl.Ui.Win_Keyboard_Mode +enum @beta Efl.Ui.Win_Keyboard_Mode { [[The different layouts that can be requested for the virtual keyboard. When the application window is being managed by Illume it may request any of the following layouts for the virtual keyboard. ]] - legacy: efl_ui_win_keyboard; unknown, [[Unknown keyboard state]] off, [[Request to deactivate the keyboard]] @@ -72,9 +73,10 @@ enum Efl.Ui.Win_Keyboard_Mode enum Efl.Ui.Win_Indicator_Mode { - [[Defines the type indicator that can be shown]] - legacy: efl_ui_win_indicator; + [[Defines the type indicator that can be shown + @since 1.22 + ]] off, [[Request to deactivate the indicator]] bg_opaque, [[The indicator icon is opaque, as is the indicator background. The content of window is located at the end of the indicator. @@ -86,38 +88,17 @@ 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 -{ - [[Define the keygrab modes of window. A window may send commands to the - Keyrouter according this mode, and perform different actions.]] - - legacy: efl_ui_win_keygrab; - unknown = 0, [[Unknown keygrab mode]] - shared = (1 << 8), [[Get the grabbed-key together with the other client - windows]] - topmost = (1 << 9), [[Get the grabbed-key only when window is top of the - stack]] - exclusive = (1 << 10), [[Get the grabbed-key exclusively regardless of - window's position]] - override_exclusive = (1 << 11) [[Get the grabbed-key exclusively - regardless of window's position. This is - overrided by grabs from the other client - window]] -} - -enum Efl.Ui.Win_Modal_Mode +enum @beta Efl.Ui.Win_Modal_Mode { [[Defines the mode of a modal window]] - legacy: efl_ui_win_modal; none, [[The window is not modal window.]] modal [[The window is modal window.]] } -enum Efl.Ui.Win_Urgent_Mode +enum @beta Efl.Ui.Win_Urgent_Mode { [[Defines the mode of a urgent window.]] - legacy: efl_ui_win_urgent; none, [[The window is not a urgent window.]] urgent [[The window is a urgent window.]] @@ -143,9 +124,8 @@ enum Efl.Ui.Win_Move_Resize_Mode 8. bottom | left, 9. bottom | right. - @since 1.19 + @since 1.22 ]] - legacy: efl_ui_win_move_resize; move = 1, [[Start moving window]] top = (1 << 1), [[Start resizing window to the top]] @@ -160,8 +140,10 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W Efl.Text, Efl.Config, Efl.Ui.Widget_Focus_Manager, Efl.Ui.Focus.Manager_Window_Root { - [[Efl UI window class]] - legacy_prefix: elm_win; + [[Efl UI window class + + @since 1.22 + ]] methods { @property indicator_mode { [[In some environments you may have an indicator that @@ -172,20 +154,16 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W such circumstances. The default settings depends on the environment. For example, on phones, the default is to enable the indicator. The indicator is disabled on devices like televisions however. - - @since 1.18 ]] set { - legacy: null; } get { - 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 type, one of @Efl.Ui.Win_Indicator_Mode.]] } } - @property keyboard_mode { + @property keyboard_mode @beta { set { [[Sets the keyboard mode of the window.]] } @@ -193,10 +171,10 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W [[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 { + @property wm_available_rotations @beta { [[Defines which rotations this window supports. The window manager will refer to these hints and rotate the window @@ -209,27 +187,23 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W allow_270: bool; [[Rotated 270 degrees CCW (i.e. 90 CW).]] } set { - legacy: null; } get { - legacy: null; return: bool; [[Returns $false if available rotations were not specified.]] } } - @property wm_available_profiles { + @property wm_available_profiles @beta { [[Available profiles on a window.]] set { - legacy: null; } get { - legacy: null; } values { profiles: const(array); [[A list of profiles.]] } } - @property screen_constrain { + @property screen_constrain @beta { set { [[Constrain the maximum width and height of a window to the width and height of the screen. @@ -250,7 +224,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W constrain: bool; [[$true to restrict the window's maximum size.]] } } - @property prop_focus_skip { + @property prop_focus_skip @beta { set { [[Set the window to be skipped by keyboard focus. @@ -274,7 +248,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W skip: bool; [[The skip flag state ($true if it is to be skipped).]] } } - @property autohide { + @property autohide @beta { [[Window's autohide state. When closing the window in any way outside of the program control, @@ -299,6 +273,22 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W itself when closed.]] } } + @property exit_on_close { + [[Enable quitting the main loop when this window is closed. + + When set, the window's loop object will exit using the passed exit code if the + window is closed. + + The @Eina.Value passed should be $EMPTY to unset this state or an int value to be + used as the exit code. + + Note this is different from @.exit_on_all_windows_closed which exits when ALL + windows are closed. + ]] + values { + exit_code: const(any_value_ptr); [[The exit code to use when exiting]] + } + } @property icon_object { set { [[Set a window object's icon. @@ -329,15 +319,15 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W } } } - @property iconified { + @property minimized { set { - [[Set the iconified state of a window.]] + [[Set the minimized state of a window.]] } get { - [[Get the iconified state of a window.]] + [[Get the minimized state of a window.]] } values { - iconified: bool; [[If $true, the window is iconified.]] + state: bool; [[If $true, the window is minimized.]] } } @property maximized { @@ -362,7 +352,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W fullscreen: bool; [[If $true, the window is fullscreen.]] } } - @property sticky { + @property sticky @beta { set { [[Set the sticky state of the window. @@ -378,59 +368,30 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W sticky: bool; [[If $true, the window's sticky state is enabled.]] } } - @property urgent { + @property urgent @beta { set { [[Set the urgent state of a window.]] - legacy: null; } get { [[Get the urgent state of a window.]] - legacy: null; } values { urgent: Efl.Ui.Win_Urgent_Mode; - [[The mode of a urgent window, one of #Efl_Ui_Win_Urgent_Mode.]] + [[The mode of a urgent window, one of @Efl.Ui.Win_Urgent_Mode.]] } } - @property modal { + @property modal @beta { set { [[Set the modal state of a window.]] - legacy: null; } get { [[Get the modal state of a 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 { - set { - [[Set the noblank property of a window. - - The "noblank" property is a way to request the display on - which the window is shown does not blank, go to screensaver or - otherwise hide or obscure the window. It is intended for - uses such as media playback on a television where a user - may not want to be interrupted by an idle screen. The - noblank property may have no effect if the window is - iconified/minimized or hidden. - - @since 1.11 - ]] - } - get { - [[Get the noblank property of a window. - - @since 1.11 - ]] - } - values { - noblank: bool; [[If $true, the window is set to noblank.]] - } - } - @property borderless { + @property borderless @beta { set { [[Set the borderless state of a window. @@ -445,7 +406,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W borderless: bool; [[If $true, the window is borderless.]] } } - @property win_role { + @property win_role @beta { /* FIXME: Do we actually need this? There is only support in X. */ [[The role of the window. @@ -454,7 +415,6 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W ]] set { [[Set the role of the window.]] - legacy: elm_win_role_set; } get { [[Get the role of the window. @@ -463,7 +423,6 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W freed or modified. It will also be invalid if a new role is set or if the window is destroyed. ]] - legacy: elm_win_role_get; } values { role: string; [[The role to set.]] @@ -481,17 +440,14 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W ]] set { [[Name can only be set before finalize.]] - legacy: null; } get { - [[ @since 1.18 ]] - legacy: elm_win_name_get; } values { name: string @nullable; [[Window name]] } } - @property win_type { + @property win_type @beta { [[The type of the window. It is a hint of how the Window Manager should handle it. @@ -503,17 +459,15 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W ]] set { [[Type can on be set before finalize.]] - legacy: null; } get { [[If the object is not window object, returns $unknown.]] - legacy: elm_win_type_get; } values { type: Efl.Ui.Win_Type(Efl.Ui.Win_Type.unknown); [[Window type]] } } - @property accel_preference { + @property accel_preference @beta { [[The hardware acceleration preference for this window. This is a constructor function and can only be called before @@ -555,14 +509,11 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W Note that this option may be overriden by environment variables or the configuration option "accel_preference_override". - - @since 1.18 ]] values { accel: string; [[Acceleration]] } set { - legacy: null; } get { [[This will return the value of "accel_preference" when the window @@ -657,6 +608,20 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W This will try and delete all the windows in the stack that are above the window.]] } + @property exit_on_all_windows_closed @class { + [[Enable quitting the main loop when all windows are closed. + + When set, the main loop will quit with the passed exit code once all windows have been closed. + + The @Eina.Value passed should be $EMPTY to unset this state or an int value to be + used as the exit code. + + Note this is different from @.exit_on_close which exits when a given window is closed. + ]] + values { + exit_code: const(any_value_ptr); [[The exit code to use when exiting.]] + } + } activate { [[Activate a window object. @@ -669,7 +634,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W window will be the active one afterwards. ]] } - center { + center @beta { [[Center a window on the screen. This function centers window $obj horizontally and/or vertically @@ -684,40 +649,6 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W @in v: bool; [[If $true, center vertically. If $false, do not change vertical location.]] } } - keygrab_set { - [[Set keygrab value of the window - - This function grabs the $key of window using $grab_mode. - ]] - - return: bool; [[$true on success, $false otherwise]] - params { - @in key: string; [[This string is the keyname to grab.]] - @in modifiers: Efl.Input.Modifier; [[A combination of modifier keys - that must be present to trigger the event. Not supported yet.]] - @in not_modifiers: Efl.Input.Modifier; [[A combination 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 - be grabbed, wrt. focus and stacking.]] - } - legacy: null; - } - keygrab_unset { - [[Unset keygrab value of the window - - This function unset keygrab value. Ungrab $key of window. - ]] - return: bool; [[$true on success, $false otherwise]] - params { - @in key: string; [[This string is the keyname to grab.]] - @in modifiers: Efl.Input.Modifier; [[A combination of modifier keys - that must be present to trigger the event. Not supported yet.]] - @in not_modifiers: Efl.Input.Modifier; [[A combination of modifier keys - that must not be present to trigger the event. Not supported yet.]] - } - legacy: null; - } move_resize_start { [[Start moving or resizing the window. @@ -756,8 +687,6 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W Note: the result of this API can only guarantee that the request has been forwarded to the server, but there is no guarantee that the request can be processed by the display server. - - @since 1.19 ]] return: bool; [[$true if the request was successfully sent to the display server, $false in case of error.]] @@ -766,6 +695,131 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W resize mode.]] } } + @property hint_base { + [[Base size for objects with sizing restrictions. + + This is not a size enforcement in any way, it's just a hint + that should be used whenever appropriate. + + @.hint_base + N x @.hint_step is what is calculated for object + sizing restrictions. + + See also @.hint_step. + ]] + values { + sz: Eina.Size2D; [[Base size (hint) in pixels.]] + } + } + @property hint_step { + [[Step size for objects with sizing restrictions. + + This is not a size enforcement in any way, it's just a hint + that should be used whenever appropriate. + + Set this to for an object to scale up by steps and not continuously. + + @.hint_base + N x @.hint_step is what is calculated for object + sizing restrictions. + ]] + values { + sz: Eina.Size2D; [[Step size (hint) in pixels.]] + } + } + /* FIXME: maybe not necessary if gesture supports this */ + pointer_iterate @const @beta { + [[Returns an iterator over the current known pointer positions. + + This is used to iterate over the current known multi-touch positions, + including the first finger. Each pointer position is represented by + an object of type @Efl.Input.Pointer. + + Each finger in a multi touch environment can then be identified + by the @Efl.Input.Pointer.tool property. The order of the pointers + in this iterator is not defined. + + Note: If the input surface supports hovering input, some pointers + may not be in a "down" state. To retrieve the list of such pointers, + set the $hover value to $true. Remember though that most devices + currently don't support this. + ]] + params { + /* FIXME: missing seat. hover is not useful */ + hover: bool @optional; [[$false by default, $true means to include + fingers that are currently hovering.]] + } + return: iterator; [[Iterator to pointer positions]] + } + @property win_rotation @beta { + [[The rotation of this window + + The value will automatically change when the WM of this window changes its rotation. This rotation is automatically applied to all @Efl.Ui.Layout objects. + ]] + set { + } + get { + } + values { + rotation : int; [[The rotation of the window]] + } + } + @property focus_highlight_enabled { + [[Whether focus highlight is enabled or not. + + See also @.focus_highlight_style. + See also @.focus_highlight_animate. + ]] + set { + [[Set the enabled status for the focus highlight in a window. + + This function will enable or disable the focus highlight, + regardless of the global setting for it. + ]] + } + get { + [[Get the enabled value of the focus highlight for this window.]] + } + values { + enabled: bool; [[The enabled value for the highlight.]] + } + } + @property focus_highlight_style { + [[Control the widget focus highlight style. + + If $style is $null, the default will be used. + + See also @.focus_highlight_enabled. + See also @.focus_highlight_animate. + ]] + set { + /* FIXME: This is async... success here means nothing. */ + return: bool; [[$true on success, $false otherwise.]] + } + get { + } + values { + style: string @nullable; [[The name of the focus highlight style.]] + } + } + @property focus_highlight_animate { + [[Whether focus highlight should animate or not. + + See also @.focus_highlight_style. + See also @.focus_highlight_enabled. + ]] + set { + [[Set the animate status for the focus highlight for this window. + + This function will enable or disable the animation of focus + highlight. + ]] + } + get { + [[Get the animate value of the focus highlight for this window.]] + } + values { + animate: bool; [[The enabled value for the highlight animation.]] + } + } } implements { class.constructor; @@ -777,16 +831,13 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W 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.]] + Efl.Gfx.Stack.raise_to_top; [[Places the window at the top of the stack, so + that it's not covered by any other window.]] + Efl.Gfx.Stack.lower_to_bottom; [[This action is ignored by the Window.]] Efl.Ui.Widget.theme_apply; Efl.Ui.Focus.Object.focus { 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.widget_input_event_handler; Efl.Ui.Widget_Focus_Manager.focus_manager_create; Efl.Access.Object.state_set { get; } Efl.Access.Object.i18n_name { get; } @@ -796,18 +847,16 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W Efl.Input.State.lock_enabled { get; } 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.Screen.screen_size_in_pixels { get; } + Efl.Gfx.Hint.hint_aspect { set; } + Efl.Gfx.Hint.hint_weight { set; } + Efl.Gfx.Hint.hint_size_max { set; } Efl.Text.text { get; set; } + Efl.Canvas.Scene.seat_default { get; } Efl.Canvas.Scene.pointer_position { get; } Efl.Canvas.Pointer.pointer_inside { get; } - Efl.Canvas.Scene.pointer_iterate; Efl.Canvas.Scene.image_max_size { get; } - Efl.Canvas.Scene.smart_objects_calculate; + Efl.Canvas.Scene.group_objects_calculate; Efl.Canvas.Scene.objects_at_xy_get; Efl.Canvas.Scene.object_top_at_xy_get; Efl.Canvas.Scene.objects_in_rectangle_get; @@ -819,28 +868,29 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W Efl.Part.part_get; } constructors { - .win_name; - .win_type; - .accel_preference; + .win_name @optional; + .win_type @optional; + .accel_preference @optional; } events { 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]] + withdrawn @beta: void; [[Called when window is withdrawn]] + minimized: void; [[Called when window is minimized]] 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]] + stick @beta: void; [[Called when window is set as sticky]] + unstick @beta: void; [[Called when window is no longer set as sticky]] + fullscreen,changed: bool; [[Called when window is set to or from fullscreen]] + maximized,changed: bool; [[Called when window is set to or from maximized]] + indicator,prop,changed @beta: void; [[Called when indicator is property changed]] + win_rotation,changed: int; [[Called when window rotation is changed, sends current rotation in degrees]] + profile,changed @beta: void; [[Called when profile is changed]] + wm,rotation,changed @beta: 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]] + elm,action,block_menu @beta: 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]] } + composite { + Efl.Config; + } } diff --git a/src/lib/elementary/efl_ui_win_inlined.c b/src/lib/elementary/efl_ui_win_inlined.c index 54407b7705..f654b43b4d 100644 --- a/src/lib/elementary/efl_ui_win_inlined.c +++ b/src/lib/elementary/efl_ui_win_inlined.c @@ -8,7 +8,7 @@ #include #include "elm_priv.h" -#include "efl_ui_win_inlined_legacy.eo.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" @@ -36,7 +36,7 @@ _efl_ui_win_inlined_inlined_parent_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Inl EOLIAN static Efl_Object * _efl_ui_win_inlined_efl_object_finalize(Eo *obj, Efl_Ui_Win_Inlined_Data *pd EINA_UNUSED) { - efl_ui_win_type_set(obj, ELM_WIN_INLINED_IMAGE); + efl_ui_win_type_set(obj, EFL_UI_WIN_TYPE_INLINED_IMAGE); obj = efl_finalize(efl_super(obj, MY_CLASS)); return obj; @@ -58,4 +58,4 @@ _efl_ui_win_inlined_legacy_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED) return obj; } -#include "efl_ui_win_inlined_legacy.eo.c" +#include "efl_ui_win_inlined_legacy_eo.c" diff --git a/src/lib/elementary/efl_ui_win_inlined.eo b/src/lib/elementary/efl_ui_win_inlined.eo index 2ef4806cc3..27aebb80bc 100644 --- a/src/lib/elementary/efl_ui_win_inlined.eo +++ b/src/lib/elementary/efl_ui_win_inlined.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Win_Inlined extends Efl.Ui.Win +class @beta Efl.Ui.Win_Inlined extends Efl.Ui.Win { [[An inlined window. diff --git a/src/lib/elementary/efl_ui_win_inlined_legacy.eo b/src/lib/elementary/efl_ui_win_inlined_legacy.eo deleted file mode 100644 index 91ca73878f..0000000000 --- a/src/lib/elementary/efl_ui_win_inlined_legacy.eo +++ /dev/null @@ -1,9 +0,0 @@ -class Efl.Ui.Win_Inlined_Legacy extends Efl.Ui.Win_Inlined implements Efl.Ui.Legacy -{ - [[Elementary window inlined class]] - data: null; - implements { - class.constructor; - Efl.Object.finalize; - } -} diff --git a/src/lib/elementary/efl_ui_win_inlined_legacy_eo.c b/src/lib/elementary/efl_ui_win_inlined_legacy_eo.c new file mode 100644 index 0000000000..640f020431 --- /dev/null +++ b/src/lib/elementary/efl_ui_win_inlined_legacy_eo.c @@ -0,0 +1,35 @@ + +Efl_Object *_efl_ui_win_inlined_legacy_efl_object_finalize(Eo *obj, void *pd); + + +static Eina_Bool +_efl_ui_win_inlined_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_WIN_INLINED_LEGACY_EXTRA_OPS +#define EFL_UI_WIN_INLINED_LEGACY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_finalize, _efl_ui_win_inlined_legacy_efl_object_finalize), + EFL_UI_WIN_INLINED_LEGACY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_win_inlined_legacy_class_desc = { + EO_VERSION, + "Efl.Ui.Win_Inlined_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _efl_ui_win_inlined_legacy_class_initializer, + _efl_ui_win_inlined_legacy_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_win_inlined_legacy_class_get, &_efl_ui_win_inlined_legacy_class_desc, EFL_UI_WIN_INLINED_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/efl_ui_win_inlined_legacy_eo.h b/src/lib/elementary/efl_ui_win_inlined_legacy_eo.h new file mode 100644 index 0000000000..acacc7be02 --- /dev/null +++ b/src/lib/elementary/efl_ui_win_inlined_legacy_eo.h @@ -0,0 +1,26 @@ +#ifndef _EFL_UI_WIN_INLINED_LEGACY_EO_H_ +#define _EFL_UI_WIN_INLINED_LEGACY_EO_H_ + +#ifndef _EFL_UI_WIN_INLINED_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_WIN_INLINED_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Win_Inlined_Legacy; + +#endif + +#ifndef _EFL_UI_WIN_INLINED_LEGACY_EO_TYPES +#define _EFL_UI_WIN_INLINED_LEGACY_EO_TYPES + + +#endif +#ifdef EFL_BETA_API_SUPPORT +/** Elementary window inlined class + * + * @ingroup Efl_Ui_Win_Inlined_Legacy + */ +#define EFL_UI_WIN_INLINED_LEGACY_CLASS efl_ui_win_inlined_legacy_class_get() + +EWAPI const Efl_Class *efl_ui_win_inlined_legacy_class_get(void); +#endif /* EFL_BETA_API_SUPPORT */ + +#endif diff --git a/src/lib/elementary/efl_ui_win_inlined_legacy_eo.legacy.h b/src/lib/elementary/efl_ui_win_inlined_legacy_eo.legacy.h new file mode 100644 index 0000000000..8d26a3bf18 --- /dev/null +++ b/src/lib/elementary/efl_ui_win_inlined_legacy_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_WIN_INLINED_LEGACY_EO_LEGACY_H_ +#define _EFL_UI_WIN_INLINED_LEGACY_EO_LEGACY_H_ + +#ifndef _EFL_UI_WIN_INLINED_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_WIN_INLINED_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Win_Inlined_Legacy; + +#endif + +#ifndef _EFL_UI_WIN_INLINED_LEGACY_EO_TYPES +#define _EFL_UI_WIN_INLINED_LEGACY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/efl_ui_win_legacy.eo b/src/lib/elementary/efl_ui_win_legacy.eo deleted file mode 100644 index 7a0e562f97..0000000000 --- a/src/lib/elementary/efl_ui_win_legacy.eo +++ /dev/null @@ -1,9 +0,0 @@ -class Efl.Ui.Win_Legacy extends Efl.Ui.Win implements Efl.Ui.Legacy -{ - [[Efl UI window class]] - data: null; - implements { - class.constructor; - Efl.Object.finalize; - } -} diff --git a/src/lib/elementary/efl_ui_win_legacy_eo.c b/src/lib/elementary/efl_ui_win_legacy_eo.c new file mode 100644 index 0000000000..8be8c6892b --- /dev/null +++ b/src/lib/elementary/efl_ui_win_legacy_eo.c @@ -0,0 +1,35 @@ + +Efl_Object *_efl_ui_win_legacy_efl_object_finalize(Eo *obj, void *pd); + + +static Eina_Bool +_efl_ui_win_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_WIN_LEGACY_EXTRA_OPS +#define EFL_UI_WIN_LEGACY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_finalize, _efl_ui_win_legacy_efl_object_finalize), + EFL_UI_WIN_LEGACY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_win_legacy_class_desc = { + EO_VERSION, + "Efl.Ui.Win_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _efl_ui_win_legacy_class_initializer, + _efl_ui_win_legacy_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_win_legacy_class_get, &_efl_ui_win_legacy_class_desc, EFL_UI_WIN_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/efl_ui_win_legacy_eo.h b/src/lib/elementary/efl_ui_win_legacy_eo.h new file mode 100644 index 0000000000..70563cd14f --- /dev/null +++ b/src/lib/elementary/efl_ui_win_legacy_eo.h @@ -0,0 +1,26 @@ +#ifndef _EFL_UI_WIN_LEGACY_EO_H_ +#define _EFL_UI_WIN_LEGACY_EO_H_ + +#ifndef _EFL_UI_WIN_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_WIN_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Win_Legacy; + +#endif + +#ifndef _EFL_UI_WIN_LEGACY_EO_TYPES +#define _EFL_UI_WIN_LEGACY_EO_TYPES + + +#endif +#ifdef EFL_BETA_API_SUPPORT +/** Efl UI window class + * + * @ingroup Efl_Ui_Win_Legacy + */ +#define EFL_UI_WIN_LEGACY_CLASS efl_ui_win_legacy_class_get() + +EWAPI const Efl_Class *efl_ui_win_legacy_class_get(void); +#endif /* EFL_BETA_API_SUPPORT */ + +#endif diff --git a/src/lib/elementary/efl_ui_win_legacy_eo.legacy.h b/src/lib/elementary/efl_ui_win_legacy_eo.legacy.h new file mode 100644 index 0000000000..a5d82e6e89 --- /dev/null +++ b/src/lib/elementary/efl_ui_win_legacy_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_WIN_LEGACY_EO_LEGACY_H_ +#define _EFL_UI_WIN_LEGACY_EO_LEGACY_H_ + +#ifndef _EFL_UI_WIN_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_WIN_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Win_Legacy; + +#endif + +#ifndef _EFL_UI_WIN_LEGACY_EO_TYPES +#define _EFL_UI_WIN_LEGACY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/efl_ui_win_part.eo b/src/lib/elementary/efl_ui_win_part.eo index 1b93fc2905..ea9d09f518 100644 --- a/src/lib/elementary/efl_ui_win_part.eo +++ b/src/lib/elementary/efl_ui_win_part.eo @@ -1,5 +1,4 @@ -class Efl.Ui.Win_Part extends Efl.Ui.Widget_Part implements Efl.Content, Efl.Gfx.Entity, Efl.Gfx.Color, - Efl.File +class @beta Efl.Ui.Win_Part extends Efl.Ui.Widget_Part implements Efl.Content, Efl.Gfx.Color, Efl.File { [[Efl UI window interal part class]] data: null; @@ -7,6 +6,8 @@ class Efl.Ui.Win_Part extends Efl.Ui.Widget_Part implements Efl.Content, Efl.Gfx Efl.Content.content { get; set; } Efl.Content.content_unset; Efl.Gfx.Color.color { get; set; } - Efl.File.file { get; set; } + Efl.File.load; + Efl.File.file { get; } + Efl.File.key { get; } } } diff --git a/src/lib/elementary/efl_ui_win_socket.c b/src/lib/elementary/efl_ui_win_socket.c index 14ddfdc83f..6e27d917c4 100644 --- a/src/lib/elementary/efl_ui_win_socket.c +++ b/src/lib/elementary/efl_ui_win_socket.c @@ -8,7 +8,7 @@ #include #include "elm_priv.h" -#include "efl_ui_win_socket_legacy.eo.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" @@ -21,7 +21,7 @@ typedef struct EOLIAN static Efl_Object * _efl_ui_win_socket_efl_object_finalize(Eo *obj, Efl_Ui_Win_Socket_Data *pd EINA_UNUSED) { - efl_ui_win_type_set(obj, ELM_WIN_SOCKET_IMAGE); + efl_ui_win_type_set(obj, EFL_UI_WIN_TYPE_SOCKET_IMAGE); obj = efl_finalize(efl_super(obj, MY_CLASS)); return obj; @@ -52,4 +52,4 @@ _efl_ui_win_socket_legacy_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED) return obj; } -#include "efl_ui_win_socket_legacy.eo.c" +#include "efl_ui_win_socket_legacy_eo.c" diff --git a/src/lib/elementary/efl_ui_win_socket.eo b/src/lib/elementary/efl_ui_win_socket.eo index 9f2aa02cb9..2b226a140d 100644 --- a/src/lib/elementary/efl_ui_win_socket.eo +++ b/src/lib/elementary/efl_ui_win_socket.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Win_Socket extends Efl.Ui.Win +class @beta Efl.Ui.Win_Socket extends Efl.Ui.Win { [[An off-screen window to be displayed in a remote process. diff --git a/src/lib/elementary/efl_ui_win_socket_legacy.eo b/src/lib/elementary/efl_ui_win_socket_legacy.eo deleted file mode 100644 index 0dff710193..0000000000 --- a/src/lib/elementary/efl_ui_win_socket_legacy.eo +++ /dev/null @@ -1,9 +0,0 @@ -class Efl.Ui.Win_Socket_Legacy extends Efl.Ui.Win_Socket implements Efl.Ui.Legacy -{ - [[Elementary window socket class]] - data: null; - implements { - class.constructor; - Efl.Object.finalize; - } -} diff --git a/src/lib/elementary/efl_ui_win_socket_legacy_eo.c b/src/lib/elementary/efl_ui_win_socket_legacy_eo.c new file mode 100644 index 0000000000..4f2fcbd803 --- /dev/null +++ b/src/lib/elementary/efl_ui_win_socket_legacy_eo.c @@ -0,0 +1,35 @@ + +Efl_Object *_efl_ui_win_socket_legacy_efl_object_finalize(Eo *obj, void *pd); + + +static Eina_Bool +_efl_ui_win_socket_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EFL_UI_WIN_SOCKET_LEGACY_EXTRA_OPS +#define EFL_UI_WIN_SOCKET_LEGACY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_finalize, _efl_ui_win_socket_legacy_efl_object_finalize), + EFL_UI_WIN_SOCKET_LEGACY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _efl_ui_win_socket_legacy_class_desc = { + EO_VERSION, + "Efl.Ui.Win_Socket_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _efl_ui_win_socket_legacy_class_initializer, + _efl_ui_win_socket_legacy_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(efl_ui_win_socket_legacy_class_get, &_efl_ui_win_socket_legacy_class_desc, EFL_UI_WIN_SOCKET_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/efl_ui_win_socket_legacy_eo.h b/src/lib/elementary/efl_ui_win_socket_legacy_eo.h new file mode 100644 index 0000000000..b89a58aad1 --- /dev/null +++ b/src/lib/elementary/efl_ui_win_socket_legacy_eo.h @@ -0,0 +1,26 @@ +#ifndef _EFL_UI_WIN_SOCKET_LEGACY_EO_H_ +#define _EFL_UI_WIN_SOCKET_LEGACY_EO_H_ + +#ifndef _EFL_UI_WIN_SOCKET_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_WIN_SOCKET_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Win_Socket_Legacy; + +#endif + +#ifndef _EFL_UI_WIN_SOCKET_LEGACY_EO_TYPES +#define _EFL_UI_WIN_SOCKET_LEGACY_EO_TYPES + + +#endif +#ifdef EFL_BETA_API_SUPPORT +/** Elementary window socket class + * + * @ingroup Efl_Ui_Win_Socket_Legacy + */ +#define EFL_UI_WIN_SOCKET_LEGACY_CLASS efl_ui_win_socket_legacy_class_get() + +EWAPI const Efl_Class *efl_ui_win_socket_legacy_class_get(void); +#endif /* EFL_BETA_API_SUPPORT */ + +#endif diff --git a/src/lib/elementary/efl_ui_win_socket_legacy_eo.legacy.h b/src/lib/elementary/efl_ui_win_socket_legacy_eo.legacy.h new file mode 100644 index 0000000000..fce153c49b --- /dev/null +++ b/src/lib/elementary/efl_ui_win_socket_legacy_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EFL_UI_WIN_SOCKET_LEGACY_EO_LEGACY_H_ +#define _EFL_UI_WIN_SOCKET_LEGACY_EO_LEGACY_H_ + +#ifndef _EFL_UI_WIN_SOCKET_LEGACY_EO_CLASS_TYPE +#define _EFL_UI_WIN_SOCKET_LEGACY_EO_CLASS_TYPE + +typedef Eo Efl_Ui_Win_Socket_Legacy; + +#endif + +#ifndef _EFL_UI_WIN_SOCKET_LEGACY_EO_TYPES +#define _EFL_UI_WIN_SOCKET_LEGACY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elc_combobox.c b/src/lib/elementary/elc_combobox.c index cd98f3c8b4..71e581f18b 100644 --- a/src/lib/elementary/elc_combobox.c +++ b/src/lib/elementary/elc_combobox.c @@ -10,9 +10,9 @@ #include #include "elm_priv.h" #include "elm_widget_combobox.h" -#include "elm_entry.eo.h" -#include "elm_genlist.eo.h" -#include "elm_hover.eo.h" +#include "elm_entry_eo.h" +#include "elm_genlist_eo.h" +#include "elm_hover_eo.h" EOAPI void elm_obj_combobox_hover_begin(Eo *obj); EOAPI void elm_obj_combobox_hover_end(Eo *obj); @@ -79,15 +79,15 @@ _elm_combobox_efl_ui_l10n_translation_update(Eo *obj EINA_UNUSED, Elm_Combobox_D efl_ui_l10n_translation_update(sd->hover); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_combobox_efl_ui_widget_theme_apply(Eo *obj, Elm_Combobox_Data *sd) { const char *style; - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; Eina_Bool mirrored; char buf[128]; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); style = eina_stringshare_add(elm_widget_style_get(obj)); @@ -97,7 +97,7 @@ _elm_combobox_efl_ui_widget_theme_apply(Eo *obj, Elm_Combobox_Data *sd) eina_stringshare_replace(&(wd->style), buf); int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; eina_stringshare_replace(&(wd->style), style); @@ -279,7 +279,7 @@ _gl_filter_finished_cb(void *data, const Efl_Event *event) else _table_resize(data); elm_genlist_item_selected_set(sd->item, EINA_TRUE); } - else + else { sd->expanded = EINA_FALSE; elm_layout_signal_emit(sd->hover, "elm,action,hide,no_animate", "elm"); @@ -331,7 +331,6 @@ EOLIAN static void _elm_combobox_efl_canvas_group_group_add(Eo *obj, Elm_Combobox_Data *sd EINA_UNUSED) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); efl_ui_mirrored_automatic_set(obj, EINA_FALSE); @@ -609,7 +608,7 @@ _elm_combobox_class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_combobox_efl_gfx_entity_size_set), EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_combobox_efl_ui_widget_theme_apply), EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_combobox_efl_ui_l10n_translation_update), - EFL_OBJECT_OP_FUNC(efl_ui_widget_event, _elm_combobox_efl_ui_widget_widget_event), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_combobox_efl_ui_widget_widget_input_event_handler), EFL_OBJECT_OP_FUNC(efl_ui_autorepeat_supported_get, _elm_combobox_efl_ui_autorepeat_autorepeat_supported_get), EFL_OBJECT_OP_FUNC(elm_obj_genlist_filter_set, _elm_combobox_elm_genlist_filter_set), EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_combobox_efl_access_widget_action_elm_actions_get), diff --git a/src/lib/elementary/elc_ctxpopup.c b/src/lib/elementary/elc_ctxpopup.c index fd8a4337e5..08817bac70 100644 --- a/src/lib/elementary/elc_ctxpopup.c +++ b/src/lib/elementary/elc_ctxpopup.c @@ -5,7 +5,6 @@ #define EFL_ACCESS_OBJECT_PROTECTED #define EFL_ACCESS_WIDGET_ACTION_PROTECTED #define EFL_UI_WIDGET_PROTECTED -//#define EFL_UI_WIDGET_BETA #define ELM_WIDGET_ITEM_PROTECTED #define EFL_UI_L10N_PROTECTED #define EFL_PART_PROTECTED @@ -14,8 +13,8 @@ #include "elm_priv.h" #include "elm_widget_ctxpopup.h" -#include "elm_ctxpopup_item.eo.h" -#include "elm_ctxpopup.eo.h" +#include "elm_ctxpopup_item_eo.h" +#include "elm_ctxpopup_eo.h" #include "elm_ctxpopup_part.eo.h" #include "elm_part_helper.h" @@ -667,13 +666,13 @@ _on_content_resized(void *data, } //FIXME: lost the content size when theme hook is called. -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_ctxpopup_efl_ui_widget_theme_apply(Eo *obj, Elm_Ctxpopup_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; elm_widget_theme_object_set (obj, sd->bg, "ctxpopup", "bg", elm_widget_style_get(obj)); @@ -1028,27 +1027,12 @@ _elm_ctxpopup_item_efl_object_destructor(Eo *eo_ctxpopup_it, efl_destructor(efl_super(eo_ctxpopup_it, ELM_CTXPOPUP_ITEM_CLASS)); } -EOLIAN static Eina_Bool -_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; - - if (sd->list) - elm_object_disabled_set(sd->list, disabled); - else if (sd->content) - elm_object_disabled_set(sd->content, disabled); - - return EINA_TRUE; -} - EOLIAN static void _elm_ctxpopup_efl_canvas_group_group_add(Eo *obj, Elm_Ctxpopup_Data *priv) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set (obj, "ctxpopup", "base", elm_widget_style_get(obj))) @@ -1059,7 +1043,7 @@ _elm_ctxpopup_efl_canvas_group_group_add(Eo *obj, Elm_Ctxpopup_Data *priv) //Background priv->bg = edje_object_add(evas_object_evas_get(obj)); - if (!elm_widget_theme_object_set(obj, priv->bg, "ctxpopup", "bg", "default")) + if (elm_widget_theme_object_set(obj, priv->bg, "ctxpopup", "bg", "default")) CRI("ctxpopup(%p) failed to set theme [efl/ctxpopup/bg/default]!", obj); edje_object_signal_callback_add @@ -1116,13 +1100,6 @@ _elm_ctxpopup_efl_canvas_group_group_del(Eo *obj, Elm_Ctxpopup_Data *sd) efl_canvas_group_del(efl_super(obj, MY_CLASS)); } -EOLIAN static void -_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); -} - EAPI Evas_Object * elm_ctxpopup_add(Evas_Object *parent) { @@ -1144,7 +1121,8 @@ _elm_ctxpopup_efl_object_constructor(Eo *obj, Elm_Ctxpopup_Data *_pd EINA_UNUSED efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_POPUP_MENU); - + //default parent is to be hover parent + elm_ctxpopup_hover_parent_set(obj, efl_parent_get(obj)); return obj; } @@ -1400,7 +1378,7 @@ _elm_ctxpopup_selected_item_get(const Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd } EOLIAN static Elm_Object_Item* -_elm_ctxpopup_efl_ui_widget_focused_item_get(const Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd) +_elm_ctxpopup_elm_widget_item_container_focused_item_get(const Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd) { if (!sd->list) return NULL; @@ -1530,7 +1508,7 @@ _elm_ctxpopup_efl_access_object_state_set_get(const Eo *obj, Elm_Ctxpopup_Data * Efl_Access_State_Set ret; ret = efl_access_object_state_set_get(efl_super(obj, MY_CLASS)); - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_MODAL); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_MODAL); return ret; } @@ -1575,5 +1553,5 @@ ELM_PART_OVERRIDE_CONTENT_UNSET(elm_ctxpopup, ELM_CTXPOPUP, Elm_Ctxpopup_Data) ELM_LAYOUT_SIZING_EVAL_OPS(elm_ctxpopup), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_ctxpopup) -#include "elm_ctxpopup_item.eo.c" -#include "elm_ctxpopup.eo.c" +#include "elm_ctxpopup_item_eo.c" +#include "elm_ctxpopup_eo.c" diff --git a/src/lib/elementary/elc_ctxpopup_legacy.h b/src/lib/elementary/elc_ctxpopup_legacy.h index cf3ad28371..d3181ed2cf 100644 --- a/src/lib/elementary/elc_ctxpopup_legacy.h +++ b/src/lib/elementary/elc_ctxpopup_legacy.h @@ -8,5 +8,5 @@ */ EAPI Evas_Object *elm_ctxpopup_add(Evas_Object *parent); -#include "elm_ctxpopup_item.eo.legacy.h" -#include "elm_ctxpopup.eo.legacy.h" +#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 96f081f8ca..6f52cf6e87 100644 --- a/src/lib/elementary/elc_fileselector.c +++ b/src/lib/elementary/elc_fileselector.c @@ -11,21 +11,21 @@ #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 "elm_priv.h" +#include "eo_internal.h" #include #include "Eio_Eo.h" -#include "elm_priv.h" -#include "elm_fileselector_button.eo.h" -#include "elm_fileselector_entry.eo.h" +#include "elm_fileselector_button_eo.h" +#include "elm_fileselector_entry_eo.h" #include "elm_interface_fileselector.h" #include "elm_widget_fileselector.h" -#include "elm_entry.eo.h" -#include "elm_fileselector.eo.h" -#include "elm_genlist.eo.h" -#include "elm_gengrid.eo.h" +#include "elm_entry_eo.h" +#include "elm_fileselector_eo.h" +#include "elm_genlist_eo.h" +#include "elm_gengrid_eo.h" #include "elm_fileselector_part.eo.h" #include "elm_part_helper.h" @@ -47,9 +47,6 @@ typedef struct _Legacy_Event_Path_Then_Data static Elm_Genlist_Item_Class *list_itc[ELM_FILE_LAST]; 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"; - EAPI Eina_Error ELM_FILESELECTOR_ERROR_UNKNOWN = 0; EAPI Eina_Error ELM_FILESELECTOR_ERROR_INVALID_MODEL = 0; @@ -99,6 +96,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(monitoring_callbacks, { EFL_MODEL_EVENT_CHILD_ADDED, _resource_created }, { EFL_MODEL_EVENT_CHILD_REMOVED, _resource_deleted }); +static void _properties_changed(void *data, const Efl_Event *ev); static void _focus_chain_update(Eo *obj, Elm_Fileselector_Data *pd) @@ -124,16 +122,16 @@ _focus_chain_update(Eo *obj, Elm_Fileselector_Data *pd) } void -_event_to_legacy_call(Eo *obj, const Efl_Event_Description *evt_desc, void *event_info) +_event_to_legacy_call(Eo *obj, const char *legacy_evt, void *event_info) { - const Efl_Event_Description *legacy_desc = efl_object_legacy_only_event_description_get(evt_desc->name); + const Efl_Event_Description *legacy_desc = efl_object_legacy_only_event_description_get(legacy_evt); efl_event_callback_call(obj, legacy_desc, event_info); } void -_model_event_call(Eo *obj, const Efl_Event_Description *evt_desc, Efl_Model *model, const char *path) +_model_event_call(Eo *obj, const Efl_Event_Description *evt_desc, const char *legacy_evt, Efl_Model *model, const char *path) { - _event_to_legacy_call(obj, evt_desc, (void *)path); + _event_to_legacy_call(obj, legacy_evt, (void *)path); efl_event_callback_call(obj, evt_desc, model); } @@ -200,10 +198,14 @@ _elm_fileselector_replace_model(Elm_Fileselector *fs, Elm_Fileselector_Data *sd, static void _elm_fileselector_smart_del_do(Elm_Fileselector *fs, Elm_Fileselector_Data *sd) { + Eo *child; + EINA_LIST_FREE(sd->children, child) + { + efl_event_callback_del(child, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_changed, sd); + efl_unref(child); + } _elm_fileselector_replace_model(fs, sd, NULL, NULL); - if (sd->prev_model) - efl_unref(sd->prev_model); - free(ecore_idler_del(sd->populate_idler)); + efl_replace(&sd->prev_model, NULL); ecore_idler_del(sd->path_entry_idler); efl_canvas_group_del(efl_super(sd->obj, MY_CLASS)); @@ -221,22 +223,16 @@ _mirrored_set(Evas_Object *obj, Eina_Bool rtl) efl_ui_mirrored_set(sd->home_button, rtl); } -static Eina_Future * -_model_str_property_set(Efl_Model *model, const char *property_name, const char *property_value) -{ - return efl_model_property_set(model, property_name, eina_value_string_new(property_value)); -} - -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_fileselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Fileselector_Data *sd) { const char *style; const char *data; char buf[1024]; - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; style = elm_widget_style_get(obj); _mirrored_set(obj, efl_ui_mirrored_get(obj)); @@ -665,8 +661,7 @@ _signal_first(Listing_Request *lreq) sd->multi_selection = eina_list_free(sd->multi_selection); } - _model_event_call - (lreq->obj, ELM_FILESELECTOR_EVENT_DIRECTORY_OPEN, lreq->model, lreq->path); + _model_event_call(lreq->obj, ELM_FILESELECTOR_EVENT_DIRECTORY_OPEN, ELM_FILESELECTOR_EVENT_DIRECTORY_OPEN->name, lreq->model, lreq->path); if (!lreq->parent_it) { @@ -811,13 +806,6 @@ _fetch_int64_value(Efl_Model *child, const char *name, int64_t *i) 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) { @@ -835,6 +823,10 @@ _process_model(Elm_Fileselector_Data *sd, Efl_Model *child) double mtime = 0; Eina_Bool dir = EINA_FALSE; + // In case we are shutting down, there might be an error being gnerated + if (!parent) return ; + + // We should be good now if (!_fetch_string_value(parent, "path", &parent_path) || !_fetch_string_value(child, "path", &path) || !_fetch_string_value(child, "filename", &filename) || @@ -843,8 +835,20 @@ _process_model(Elm_Fileselector_Data *sd, Efl_Model *child) !_fetch_int64_value(child, "size", &size) || !_fetch_bool_value(child, "is_dir", &dir)) { + Eina_Value *check_error = efl_model_property_get(child, "mtime"); + Eina_Error err = EAGAIN; + + if (eina_value_type_get(check_error) == EINA_VALUE_TYPE_ERROR) + { + // If the error is different from EAGAIN, we should definitively drop this one. + eina_value_error_get(check_error, &err); + } // SETUP listener to retry fetching all data when ready - efl_event_callback_array_add(efl_ref(child), child_model_callbacks(), sd); + if (err == EAGAIN) + { + efl_event_callback_add(efl_ref(child), EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_changed, sd); + sd->children = eina_list_append(sd->children, child); + } goto cleanup; } @@ -899,9 +903,9 @@ _process_model(Elm_Fileselector_Data *sd, Efl_Model *child) efl_key_data_set(child, ".item.data", item); // Is this item selected - if (sd->target) + if (sd->target && sd->target_ready) { - const char *target_path = eio_model_path_get(sd->target); + const char *target_path = efl_io_model_path_get(sd->target); if (!strcmp(it_data->path, target_path)) { @@ -919,19 +923,14 @@ _process_model(Elm_Fileselector_Data *sd, Efl_Model *child) free(parent_path); } -static void -_invalidate(void *data EINA_UNUSED, const Efl_Event *ev) -{ - efl_unref(ev->object); -} - static void _properties_changed(void *data, const Efl_Event *ev) { Elm_Fileselector_Data *sd = data; Efl_Model *child = ev->object; - efl_event_callback_array_del(child, child_model_callbacks(), sd); + sd->children = eina_list_remove(sd->children, child); + efl_event_callback_del(child, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_changed, sd); _process_model(sd, child); efl_unref(child); } @@ -1073,48 +1072,6 @@ _on_list_contract_req(void *data EINA_UNUSED, const Efl_Event *event) elm_genlist_item_expanded_set(it, EINA_FALSE); } -static Eina_Bool -_populate_do(void *data) -{ - struct sel_data *sdata = data; - ELM_FILESELECTOR_DATA_GET(sdata->fs, sd); - - _populate(sdata->fs, sdata->model, NULL, sdata->selected); - efl_replace(&sdata->model, NULL); - efl_replace(&sdata->selected, NULL); - - sd->populate_idler = NULL; - - free(sdata); - return ECORE_CALLBACK_CANCEL; -} - -static void -_schedule_populate(Evas_Object *fs, - Elm_Fileselector_Data *sd, - Efl_Model *model, - Efl_Model *selected) -{ - struct sel_data *sdata; - - sdata = calloc(1, sizeof(*sdata)); - if (!sdata) return; - - sdata->fs = fs; - 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); - efl_replace(&old_sdata->model, NULL); - efl_replace(&old_sdata->selected, NULL); - free(old_sdata); - } - sd->populate_idler = ecore_idler_add(_populate_do, sdata); -} - static void _on_item_activated(void *data, const Efl_Event *event) { @@ -1129,15 +1086,14 @@ _on_item_activated(void *data, const Efl_Event *event) if (!it_data->is_dir) { - _model_event_call - (data, ELM_FILESELECTOR_EVENT_ACTIVATED, it_data->model, it_data->path); + _model_event_call(data, ELM_FILESELECTOR_EVENT_ACTIVATED, ELM_FILESELECTOR_EVENT_ACTIVATED->name, it_data->model, it_data->path); return; } if (!sd->double_tap_navigation) return; efl_parent_set(it_data->model, data); - _schedule_populate(data, sd, it_data->model, NULL); + _populate(data, it_data->model, NULL, NULL); } static void @@ -1169,10 +1125,10 @@ _clear_selections(Elm_Fileselector_Data *sd, Elm_Object_Item *last_selected) } static void -_on_item_selected(void *data, const Efl_Event *event) +_on_item_selected(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) { //This event_info could be a list or gengrid item - Elm_Object_Item *it = event->info; + Elm_Object_Item *it = event_info; Elm_Fileselector_Item_Data *it_data = NULL; ELM_FILESELECTOR_DATA_GET(data, sd); @@ -1214,8 +1170,7 @@ _on_item_selected(void *data, const Efl_Event *event) else elm_object_text_set(sd->name_entry, it_data->filename); - _model_event_call - (data, EFL_UI_EVENT_SELECTED, it_data->model, it_data->path); + _model_event_call(data, EFL_UI_EVENT_ITEM_SELECTED, "selected", it_data->model, it_data->path); } else if (sd->multi && it_data->is_dir && sd->double_tap_navigation) { @@ -1256,18 +1211,16 @@ _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); + _populate(data, it_data->model, NULL, NULL); } static void -_on_item_unselected(void *data, const Efl_Event *event) +_on_item_unselected(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) { Eina_List *li, *l; const Elm_Fileselector_Item_Data *it_data; Eina_Strbuf *buf; - Elm_Object_Item *it = event->info; + Elm_Object_Item *it = event_info; Elm_Object_Item *it2 = NULL; Eina_Bool first = EINA_TRUE; @@ -1314,9 +1267,9 @@ _on_dir_up(void *data, const Efl_Event *event EINA_UNUSED) parent = efl_parent_get(sd->model); if (!parent) return; - if (!efl_isa(parent, EIO_MODEL_CLASS)) + if (!efl_isa(parent, EFL_IO_MODEL_CLASS)) { - const char *path = eio_model_path_get(sd->model); + const char *path = efl_io_model_path_get(sd->model); char dir[PATH_MAX] = ""; char *r; @@ -1359,7 +1312,7 @@ _current_filter_changed(void *data, } static void -_ok(void *data, const Efl_Event *event) +_ok(void *data, const Efl_Event *event EINA_UNUSED) { const char *name; const char *selection = NULL; @@ -1368,7 +1321,7 @@ _ok(void *data, const Efl_Event *event) if (!sd->model || !sd->path) { - _model_event_call(fs, ELM_FILESELECTOR_EVENT_DONE, NULL, NULL); + _model_event_call(fs, ELM_FILESELECTOR_EVENT_DONE, ELM_FILESELECTOR_EVENT_DONE->name, NULL, NULL); return; } @@ -1382,12 +1335,11 @@ _ok(void *data, const Efl_Event *event) else selection = eina_stringshare_printf("%s/%s", sd->path, name); - 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); + selected_model = efl_add_ref(efl_class_get(sd->model), fs, + efl_event_callback_array_add(efl_added, noref_death(), NULL), + efl_io_model_path_set(efl_added, selection)); - _model_event_call - (fs, ELM_FILESELECTOR_EVENT_DONE, selected_model, selection); + _model_event_call(fs, ELM_FILESELECTOR_EVENT_DONE, ELM_FILESELECTOR_EVENT_DONE->name, selected_model, selection); efl_unref(selected_model); eina_stringshare_del(selection); @@ -1397,13 +1349,11 @@ _ok(void *data, const Efl_Event *event) Elm_Fileselector_Item_Data *it_data = _selected_item_data_get(sd); if (it_data) { - _model_event_call - (fs, ELM_FILESELECTOR_EVENT_DONE, it_data->model, it_data->path); + _model_event_call(fs, ELM_FILESELECTOR_EVENT_DONE, ELM_FILESELECTOR_EVENT_DONE->name, it_data->model, it_data->path); } else { - _model_event_call - (fs, ELM_FILESELECTOR_EVENT_DONE, sd->model, sd->path); + _model_event_call(fs, ELM_FILESELECTOR_EVENT_DONE, ELM_FILESELECTOR_EVENT_DONE->name, sd->model, sd->path); } } } @@ -1413,93 +1363,55 @@ _canc(void *data, const Efl_Event *event EINA_UNUSED) { Evas_Object *fs = data; - _model_event_call(fs, ELM_FILESELECTOR_EVENT_DONE, NULL, NULL); -} - -static void -_text_activated_free_fs_data(Elm_Fileselector *fs) -{ - Eina_Stringshare *str = efl_key_data_get(fs, _text_activated_path_key); - eina_stringshare_del(str); - efl_key_data_set(fs, _text_activated_path_key, NULL); - efl_key_ref_set(fs, _text_activated_model_key, NULL); - efl_unref(fs); -} - -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_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; - - if (eina_value_type_get(&v) == EINA_VALUE_TYPE_ERROR) - { - _model_event_call(fs, ELM_FILESELECTOR_EVENT_SELECTED_INVALID, model, str); - goto selected; - } - - fetch = efl_model_property_get(sd->model, "is_dir"); - eina_value_bool_get(fetch, &dir); - - if (dir) - { - efl_replace(&sd->prev_model, sd->model); - - parent = model; - model = NULL; - } - else - { - parent = efl_parent_get(model); - - if (!parent || efl_isa(parent, EFL_MODEL_INTERFACE)) - goto end; - } - - _populate(fs, parent, NULL, model); - - 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; + _model_event_call(fs, ELM_FILESELECTOR_EVENT_DONE, ELM_FILESELECTOR_EVENT_DONE->name, NULL, NULL); } 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_Model *model = NULL, *parent; + Eina_Bool dir = EINA_FALSE; ELM_FILESELECTOR_DATA_GET(fs, sd); if (!sd->model) return; path = elm_widget_part_text_get(event->object, 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; + if (!ecore_file_exists(path)) + { + _model_event_call(fs, ELM_FILESELECTOR_EVENT_SELECTED_INVALID, + ELM_FILESELECTOR_EVENT_SELECTED_INVALID->name, NULL, path); - future = _model_str_property_set(model, "path", path); + elm_widget_part_text_set(event->object, NULL, efl_io_model_path_get(sd->model)); + goto end; + } - 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); - eina_future_then(future, _on_text_activated_set_path_then, fs, NULL); + if (!ecore_file_is_dir(path)) + { + model = efl_add_ref(efl_class_get(sd->model), fs, + efl_io_model_path_set(efl_added, path), + efl_event_callback_array_add(efl_added, noref_death(), NULL)); + path = eina_slstr_steal_new(ecore_file_dir_get(path)); + } + else + { + dir = EINA_TRUE; + } + + parent = efl_add_ref(efl_class_get(sd->model), fs, + efl_io_model_path_set(efl_added, path), + efl_event_callback_array_add(efl_added, noref_death(), NULL)); + if (!parent) goto end; + + _populate(fs, parent, NULL, model); + + if (sd->only_folder && dir) + _model_event_call(fs, EFL_UI_EVENT_ITEM_SELECTED, "selected", parent, path); + + end: elm_object_focus_set(event->object, EINA_FALSE); } @@ -1541,14 +1453,12 @@ _anchor_clicked(void *data, const Efl_Event *event) ELM_FILESELECTOR_DATA_GET(fs, sd); - if (!sd->model) - return; + if (!sd->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; - _model_str_property_set(model, "path", info->name); + model = efl_add_ref(efl_class_get(sd->model), fs, + efl_event_callback_array_add(efl_added, noref_death(), NULL), + efl_io_model_path_set(efl_added, info->name)); + if (!model) return; _populate(fs, model, NULL, NULL); efl_unref(model); @@ -1606,10 +1516,8 @@ _files_list_add(Evas_Object *obj) evas_object_data_set(li, "parent", obj); efl_ui_mirrored_automatic_set(li, EINA_FALSE); - efl_event_callback_add - (li, EFL_UI_EVENT_SELECTED, _on_item_selected, obj); - efl_event_callback_add - (li, EFL_UI_EVENT_UNSELECTED, _on_item_unselected, obj); + evas_object_smart_callback_add(li, "selected", _on_item_selected, obj); + evas_object_smart_callback_add(li, "unselected", _on_item_unselected, obj); efl_event_callback_add (li, ELM_GENLIST_EVENT_ACTIVATED, _on_item_activated, obj); efl_event_callback_add @@ -1643,10 +1551,8 @@ _files_grid_add(Evas_Object *obj) elm_gengrid_align_set(grid, 0.0, 0.0); - efl_event_callback_add - (grid, EFL_UI_EVENT_SELECTED, _on_item_selected, obj); - efl_event_callback_add - (grid, EFL_UI_EVENT_UNSELECTED, _on_item_unselected, obj); + evas_object_smart_callback_add(grid, "selected", _on_item_selected, obj); + evas_object_smart_callback_add(grid, "unselected", _on_item_unselected, obj); efl_event_callback_add (grid, ELM_GENGRID_EVENT_ACTIVATED, _on_item_activated, obj); efl_event_callback_add @@ -1771,7 +1677,6 @@ _elm_fileselector_efl_canvas_group_group_add(Eo *obj, Elm_Fileselector_Data *pri char buf[1024]; efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_FALSE); priv->expand = !!_elm_config->fileselector_expand_enable; @@ -1953,13 +1858,15 @@ static Eina_Bool _from_efl_event_call(Elm_Fileselector *fs, const Efl_Event_Description *evt_desc, Efl_Model *model) { Eina_Value *fetch; + const char *evt; char *path; // Call legacy smart callback with path fetch = efl_model_property_get(model, "path"); path = eina_value_to_string(fetch); - _event_to_legacy_call(fs, evt_desc, path); + evt = evt_desc == EFL_UI_EVENT_ITEM_SELECTED ? "selected" : evt_desc->name; + _event_to_legacy_call(fs, evt, path); // Call Eo event with model return efl_event_callback_call(fs, evt_desc, model); @@ -1970,13 +1877,13 @@ _from_legacy_event_call(Elm_Fileselector *fs, Elm_Fileselector_Data *sd, const E { const Efl_Class *model_cls = NULL; if (!sd->model) - model_cls = EIO_MODEL_CLASS; + model_cls = EFL_IO_MODEL_CLASS; else model_cls = efl_class_get(sd->model); 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); + efl_event_callback_array_add(efl_added, noref_death(), NULL), + efl_io_model_path_set(efl_added, path)); // Call Eo event with model efl_event_callback_call(fs, evt_desc, model); @@ -1995,7 +1902,7 @@ _elm_fileselector_efl_object_event_callback_legacy_call(Eo *obj, Elm_Fileselecto { const Efl_Event_Description *evt_desc = NULL; if (strcmp(desc->name, "selected") == 0) - evt_desc = EFL_UI_EVENT_SELECTED; + evt_desc = EFL_UI_EVENT_ITEM_SELECTED; else if (strcmp(desc->name, "activated") == 0) evt_desc = ELM_FILESELECTOR_EVENT_ACTIVATED; else if (strcmp(desc->name, "directory,open") == 0) @@ -2010,7 +1917,7 @@ _elm_fileselector_efl_object_event_callback_legacy_call(Eo *obj, Elm_Fileselecto return _from_legacy_event_call(obj, sd, desc, evt_desc, event_info); } - if (desc == EFL_UI_EVENT_SELECTED || + if (desc == EFL_UI_EVENT_ITEM_SELECTED || desc == ELM_FILESELECTOR_EVENT_ACTIVATED || desc == ELM_FILESELECTOR_EVENT_DIRECTORY_OPEN || desc == ELM_FILESELECTOR_EVENT_DONE || @@ -2070,7 +1977,7 @@ _elm_fileselector_elm_interface_fileselector_folder_only_set(Eo *obj, Elm_Filese sd->only_folder = !!only; if (sd->model) { - _schedule_populate(obj, sd, sd->model, NULL); + _populate(obj, sd->model, NULL, NULL); } } @@ -2148,7 +2055,7 @@ _elm_fileselector_elm_interface_fileselector_expandable_set(Eo *obj, Elm_Filesel if (sd->model) { - _schedule_populate(obj, sd, sd->model, NULL); + _populate(obj, sd->model, NULL, NULL); } } @@ -2184,21 +2091,21 @@ elm_fileselector_path_set(Evas_Object *obj, void _elm_fileselector_path_set_internal(Evas_Object *obj, const char *_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)); + Efl_Io_Model *model = efl_add_ref(EFL_IO_MODEL_CLASS, obj, + efl_io_model_path_set(efl_added, _path), + efl_loop_model_volatile_make(efl_added)); if (!model) { ERR("Efl.Model allocation error"); return; } efl_ui_view_model_set(obj, model); - efl_unref(model); } EOLIAN static void -_elm_fileselector_efl_ui_view_model_set(Eo *obj, Elm_Fileselector_Data *sd, Efl_Model *model) +_elm_fileselector_efl_ui_view_model_set(Eo *obj, Elm_Fileselector_Data *sd EINA_UNUSED, Efl_Model *model) { - _schedule_populate(obj, sd, model, NULL); + _populate(obj, model, NULL, NULL); } EAPI const char * @@ -2271,7 +2178,7 @@ _elm_fileselector_elm_interface_fileselector_mode_set(Eo *obj, Elm_Fileselector_ efl_ui_widget_theme_apply(obj); if (sd->model) { - _schedule_populate(obj, sd, sd->model, NULL); + _populate(obj, sd->model, NULL, NULL); } } @@ -2387,7 +2294,7 @@ _elm_fileselector_selected_get_internal(const Evas_Object *obj) if (!sd->path) return NULL; if (sd->target) { - return eio_model_path_get(sd->target); + return efl_io_model_path_get(sd->target); } Elm_Fileselector_Item_Data *it_data = _selected_item_data_get(sd); @@ -2459,14 +2366,14 @@ _properties_ready(void *data, const Efl_Event *ev) efl_event_callback_del(ev->object, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_ready, obj); eina_value_bool_get(value, &is_dir); - + pd->target_ready = EINA_TRUE; if (!is_dir) { Efl_Model *parent; - const char *path = eio_model_path_get(ev->object); + const char *path = efl_io_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), + parent = efl_add_ref(EFL_IO_MODEL_CLASS, obj, efl_io_model_path_set(efl_added, dir), efl_event_callback_array_add(efl_added, noref_death(), NULL)); if (!parent) { @@ -2477,14 +2384,14 @@ _properties_ready(void *data, const Efl_Event *ev) } efl_model_children_count_get(parent); - _schedule_populate(obj, pd, parent, ev->object); + _populate(obj, parent, NULL, ev->object); efl_unref(parent); free(dir); } else { efl_model_children_count_get(ev->object); - _schedule_populate(obj, pd, ev->object, NULL); + _populate(obj, ev->object, NULL, NULL); } return ; } @@ -2503,7 +2410,8 @@ _elm_fileselector_selected_set_internal(Evas_Object *obj, const char *path) if (stat(path, &st)) return EINA_FALSE; - pd->target = efl_add_ref(EIO_MODEL_CLASS, obj, eio_model_path_set(efl_added, path), + pd->target_ready = EINA_FALSE; + pd->target = efl_add_ref(EFL_IO_MODEL_CLASS, obj, efl_io_model_path_set(efl_added, path), efl_event_callback_array_add(efl_added, noref_death(), NULL)); if (!pd->target) { @@ -2540,7 +2448,7 @@ _elm_fileselector_elm_interface_fileselector_selected_model_set(Eo *obj, Elm_Fil Eina_Value *value = NULL; Eina_Bool dir = EINA_FALSE; - if (!efl_isa(model, EIO_MODEL_CLASS)) return EINA_FALSE; + if (!efl_isa(model, EFL_IO_MODEL_CLASS)) return EINA_FALSE; efl_event_callback_del(pd->target, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_ready, obj); efl_replace(&pd->target, model); @@ -2556,7 +2464,7 @@ _elm_fileselector_elm_interface_fileselector_selected_model_set(Eo *obj, Elm_Fil 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)); + ERR("Unexpected error '%s' when setting path '%s'.", eina_value_to_string(value), efl_io_model_path_get(pd->target)); goto clean_up; } @@ -2576,10 +2484,10 @@ _elm_fileselector_elm_interface_fileselector_selected_model_set(Eo *obj, Elm_Fil if (!dir) { Efl_Model *parent; - const char *path = eio_model_path_get(pd->target); + const char *path = efl_io_model_path_get(pd->target); char *d = ecore_file_dir_get(path); - parent = efl_add_ref(EIO_MODEL_CLASS, obj, eio_model_path_set(efl_added, d), + parent = efl_add_ref(EFL_IO_MODEL_CLASS, obj, efl_io_model_path_set(efl_added, d), efl_event_callback_array_add(efl_added, noref_death(), NULL)); if (!parent) { @@ -2589,14 +2497,14 @@ _elm_fileselector_elm_interface_fileselector_selected_model_set(Eo *obj, Elm_Fil } efl_model_children_count_get(parent); - _schedule_populate(obj, pd, parent, pd->target); + _populate(obj, parent, NULL, pd->target); efl_unref(parent); free(d); } else { efl_model_children_count_get(pd->target); - _schedule_populate(obj, pd, pd->target, NULL); + _populate(obj, pd->target, NULL, NULL); } return EINA_TRUE; @@ -2745,7 +2653,7 @@ _elm_fileselector_elm_interface_fileselector_mime_types_filter_append(Eo *obj, E if (sd->model) { - _schedule_populate(obj, sd, sd->model, NULL); + _populate(obj, sd->model, NULL, NULL); } return EINA_TRUE; @@ -2797,7 +2705,7 @@ _elm_fileselector_elm_interface_fileselector_custom_filter_append(Eo *obj, Elm_F if (sd->model) { - _schedule_populate(obj, sd, sd->model, NULL); + _populate(obj, sd->model, NULL, NULL); } return EINA_TRUE; @@ -2834,7 +2742,7 @@ _elm_fileselector_elm_interface_fileselector_filters_clear(Eo *obj, Elm_Filesele if (sd->model) { - _schedule_populate(obj, sd, sd->model, NULL); + _populate(obj, sd->model, NULL, NULL); } } @@ -2856,7 +2764,7 @@ _elm_fileselector_elm_interface_fileselector_hidden_visible_set(Eo *obj EINA_UNU if (sd->model) { - _schedule_populate(obj, sd, sd->model, NULL); + _populate(obj, sd->model, NULL, NULL); } } @@ -2898,7 +2806,7 @@ _elm_fileselector_elm_interface_fileselector_thumbnail_size_set(Eo *obj EINA_UNU if (sd->model) { - _schedule_populate(obj, sd, sd->model, NULL); + _populate(obj, sd->model, NULL, NULL); } } @@ -2964,7 +2872,7 @@ _elm_fileselector_elm_interface_fileselector_sort_method_set(Eo *obj EINA_UNUSED if (sd->model) { - _schedule_populate(obj, sd, sd->model, NULL); + _populate(obj, sd->model, NULL, NULL); } } @@ -3080,4 +2988,4 @@ ELM_PART_OVERRIDE_TEXT_SET(elm_fileselector, ELM_FILESELECTOR, Elm_Fileselector_ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_fileselector), \ EFL_OBJECT_OP_FUNC(efl_event_callback_legacy_call, _elm_fileselector_efl_object_event_callback_legacy_call) -#include "elm_fileselector.eo.c" +#include "elm_fileselector_eo.c" diff --git a/src/lib/elementary/elc_fileselector_button.c b/src/lib/elementary/elc_fileselector_button.c index 86632611bc..1a644534f1 100644 --- a/src/lib/elementary/elc_fileselector_button.c +++ b/src/lib/elementary/elc_fileselector_button.c @@ -3,16 +3,15 @@ #endif #define EFL_ACCESS_OBJECT_PROTECTED -#define ELM_INTERFACE_FILESELECTOR_BETA #include #include "Eio_Eo.h" #include "elm_priv.h" -#include "elm_fileselector_button.eo.h" -#include "elm_fileselector_entry.eo.h" +#include "elm_fileselector_button_eo.h" +#include "elm_fileselector_entry_eo.h" #include "elm_interface_fileselector.h" #include "elm_widget_fileselector_button.h" -#include "elm_fileselector.eo.h" +#include "elm_fileselector_eo.h" #define MY_CLASS ELM_FILESELECTOR_BUTTON_CLASS @@ -39,15 +38,15 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { }; #undef ELM_PRIV_FILESELECTOR_BUTTON_SIGNALS -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_fileselector_button_efl_ui_widget_theme_apply(Eo *obj, Elm_Fileselector_Button_Data *sd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; char buf[4096]; const char *style; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); style = eina_stringshare_add(elm_widget_style_get(obj)); @@ -57,7 +56,7 @@ _elm_fileselector_button_efl_ui_widget_theme_apply(Eo *obj, Elm_Fileselector_But eina_stringshare_replace(&(wd->style), buf); int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; eina_stringshare_replace(&(wd->style), style); @@ -88,7 +87,7 @@ _selection_done(void *data, const Efl_Event *event EINA_UNUSED) 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); + (sd->obj, ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN->name, file); eina_value_free(path); free(file); @@ -96,9 +95,9 @@ _selection_done(void *data, const Efl_Event *event EINA_UNUSED) else { _model_event_call - (sd->obj, ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN, NULL, NULL); + (sd->obj, ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN, ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN->name, NULL, NULL); } - + eina_stringshare_replace(&sd->fsd.current_name, elm_interface_fileselector_current_name_get(sd->fs)); del = sd->fsw; sd->fs = NULL; sd->fsw = NULL; @@ -217,15 +216,14 @@ _elm_fileselector_button_efl_canvas_group_group_add(Eo *obj, Elm_Fileselector_Bu const char *path; efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->window_title = eina_stringshare_add(DEFAULT_WINDOW_TITLE); path = eina_environment_home_get(); if (path) priv->fsd.path = eina_stringshare_add(path); else priv->fsd.path = eina_stringshare_add("/"); - priv->fsd.model = efl_add_ref(EIO_MODEL_CLASS, obj, - eio_model_path_set(efl_added, priv->fsd.path), + priv->fsd.model = efl_add_ref(EFL_IO_MODEL_CLASS, obj, + efl_io_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; @@ -326,7 +324,7 @@ _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, obj, eio_model_path_set(efl_added, path)); + Efl_Model *model = efl_add(EFL_IO_MODEL_CLASS, obj, efl_io_model_path_set(efl_added, path)); if (!model) { ERR("Efl.Model allocation error"); @@ -367,7 +365,7 @@ _elm_fileselector_button_efl_ui_view_model_set(Eo *obj EINA_UNUSED, Elm_Filesele eina_stringshare_replace(&sd->fsd.path, file); _event_to_legacy_call - (sd->obj, ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN, file); + (sd->obj, ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN->name, file); free(file); @@ -629,6 +627,54 @@ _elm_fileselector_button_elm_interface_fileselector_hidden_visible_set(Eo *obj E if (sd->fs) elm_fileselector_hidden_visible_set(sd->fs, visible); } +EOLIAN static void +_elm_fileselector_button_elm_interface_fileselector_current_name_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd, const char *name) +{ + eina_stringshare_replace(&sd->fsd.current_name, name); + if (sd->fs) elm_fileselector_current_name_set(sd->fs, sd->fsd.current_name); +} + +EOLIAN static const char* +_elm_fileselector_button_elm_interface_fileselector_current_name_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd) +{ + if (sd->fs) + return elm_fileselector_current_name_get(sd->fs); + + return sd->fsd.current_name; +} + +#define FS_USAGE_API(ret)\ + if (!pd->fs) \ + { \ + ERR("This function is only supported when there is a fileselector"); \ + return ret; \ + } \ + +EOLIAN static Eina_Bool +_elm_fileselector_button_elm_interface_fileselector_custom_filter_append(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *pd, Elm_Fileselector_Filter_Func func, void *data, const char *filter_name) +{ + FS_USAGE_API(EINA_FALSE) + + return elm_interface_fileselector_custom_filter_append(pd->fs, func, data, filter_name); +} + +EOLIAN static Eina_Bool +_elm_fileselector_button_elm_interface_fileselector_mime_types_filter_append(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *pd, const char *mime_types, const char *filter_name) +{ + FS_USAGE_API(EINA_FALSE) + + return elm_interface_fileselector_mime_types_filter_append(pd->fs, mime_types, filter_name); +} + +EOLIAN static void +_elm_fileselector_button_elm_interface_fileselector_filters_clear(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *pd) +{ + FS_USAGE_API() + + elm_interface_fileselector_filters_clear(pd->fs); +} + + EOLIAN static Eina_Bool _elm_fileselector_button_elm_interface_fileselector_hidden_visible_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd) { @@ -656,4 +702,4 @@ elm_fileselector_button_inwin_mode_get(const Eo *obj) #define ELM_FILESELECTOR_BUTTON_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_fileselector_button) -#include "elm_fileselector_button.eo.c" +#include "elm_fileselector_button_eo.c" diff --git a/src/lib/elementary/elc_fileselector_button_legacy.h b/src/lib/elementary/elc_fileselector_button_legacy.h index 0b74a9117f..f34e1a1d7c 100644 --- a/src/lib/elementary/elc_fileselector_button_legacy.h +++ b/src/lib/elementary/elc_fileselector_button_legacy.h @@ -10,7 +10,7 @@ */ EAPI Evas_Object *elm_fileselector_button_add(Evas_Object *parent); -#include "elm_fileselector_button.eo.legacy.h" +#include "elm_fileselector_button_eo.legacy.h" /** * @brief Set whether a given file selector button widget's internal file diff --git a/src/lib/elementary/elc_fileselector_common.h b/src/lib/elementary/elc_fileselector_common.h index c20e2a37c5..df4f831268 100644 --- a/src/lib/elementary/elc_fileselector_common.h +++ b/src/lib/elementary/elc_fileselector_common.h @@ -1,7 +1,6 @@ typedef Eina_Bool (*Elm_Fileselector_Filter_Func)(const char *path, /**< File path */ Eina_Bool dir, /**< A flag to show if path is a directory or not. True if the path is a directory. */ void *data /**< A user data that was given by elm_fileselector_custom_filter_append. */); -#ifdef EFL_EO_API_SUPPORT + EAPI extern Eina_Error ELM_FILESELECTOR_ERROR_UNKNOWN; EAPI extern Eina_Error ELM_FILESELECTOR_ERROR_INVALID_MODEL; -#endif diff --git a/src/lib/elementary/elc_fileselector_entry.c b/src/lib/elementary/elc_fileselector_entry.c index a6e7a70954..df9ac79d2c 100644 --- a/src/lib/elementary/elc_fileselector_entry.c +++ b/src/lib/elementary/elc_fileselector_entry.c @@ -4,18 +4,17 @@ #endif #define EFL_ACCESS_OBJECT_PROTECTED -#define ELM_INTERFACE_FILESELECTOR_BETA #define EFL_PART_PROTECTED #include #include "Eio_Eo.h" #include "elm_priv.h" -#include "elm_fileselector_button.eo.h" -#include "elm_fileselector_entry.eo.h" +#include "elm_fileselector_button_eo.h" +#include "elm_fileselector_entry_eo.h" #include "elm_interface_fileselector.h" #include "elm_widget_fileselector_entry.h" -#include "elm_entry.eo.h" -#include "elm_fileselector.eo.h" +#include "elm_entry_eo.h" +#include "elm_fileselector_eo.h" #include "elm_fileselector_entry_part.eo.h" #include "elm_part_helper.h" @@ -78,13 +77,13 @@ _FILE_CHOSEN_fwd(void *data, const Efl_Event *event) ELM_FILESELECTOR_ENTRY_DATA_GET(fs, sd); efl_ui_view_model_set(sd->entry, model); - efl_ui_model_connect(sd->entry, "default", "path"); + efl_ui_property_bind(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); + (fs, ELM_FILESELECTOR_ENTRY_EVENT_FILE_CHOSEN, ELM_FILESELECTOR_ENTRY_EVENT_FILE_CHOSEN->name, model, file); eina_value_free(path); free(file); @@ -128,17 +127,17 @@ _elm_fileselector_entry_elm_layout_sizing_eval(Eo *obj, Elm_Fileselector_Entry_D evas_object_size_hint_max_set(obj, -1, -1); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_fileselector_entry_efl_ui_widget_theme_apply(Eo *obj, Elm_Fileselector_Entry_Data *sd) { const char *style; char buf[1024]; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; style = elm_widget_style_get(obj); @@ -159,18 +158,6 @@ _elm_fileselector_entry_efl_ui_widget_theme_apply(Eo *obj, Elm_Fileselector_Entr return int_ret; } -EOLIAN static Eina_Bool -_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; - - elm_widget_disabled_set(sd->button, disabled); - elm_widget_disabled_set(sd->entry, disabled); - - return EINA_TRUE; -} - static Eina_Bool _elm_fileselector_entry_text_set(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part, const char *label) { @@ -235,12 +222,12 @@ EOLIAN static void _elm_fileselector_entry_efl_canvas_group_group_add(Eo *obj, Elm_Fileselector_Entry_Data *priv) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->button = elm_fileselector_button_add(obj); efl_ui_mirrored_automatic_set(priv->button, EINA_FALSE); efl_ui_mirrored_set(priv->button, efl_ui_mirrored_get(obj)); elm_widget_style_set(priv->button, "fileselector_entry/default"); + efl_composite_attach(obj, priv->button); elm_fileselector_expandable_set (priv->button, _elm_config->fileselector_expand_enable); @@ -421,7 +408,7 @@ _elm_fileselector_entry_efl_ui_view_model_set(Eo *obj EINA_UNUSED, Elm_Fileselec { efl_ui_view_model_set(sd->button, model); efl_ui_view_model_set(sd->entry, model); - efl_ui_model_connect(sd->entry, "default", "path"); + efl_ui_property_bind(sd->entry, "default", "path"); } EINA_DEPRECATED EAPI const char * @@ -586,4 +573,4 @@ ELM_PART_CONTENT_DEFAULT_GET(elm_fileselector_entry, "button icon") ELM_LAYOUT_SIZING_EVAL_OPS(elm_fileselector_entry), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_fileselector_entry) -#include "elm_fileselector_entry.eo.c" +#include "elm_fileselector_entry_eo.c" diff --git a/src/lib/elementary/elc_fileselector_entry_legacy.h b/src/lib/elementary/elc_fileselector_entry_legacy.h index f06d403a37..af983d738b 100644 --- a/src/lib/elementary/elc_fileselector_entry_legacy.h +++ b/src/lib/elementary/elc_fileselector_entry_legacy.h @@ -11,7 +11,7 @@ */ EAPI Evas_Object *elm_fileselector_entry_add(Evas_Object *parent); -#include "elm_fileselector_entry.eo.legacy.h" +#include "elm_fileselector_entry_eo.legacy.h" /** * @brief Set whether a given file selector entry widget's internal file diff --git a/src/lib/elementary/elc_fileselector_legacy.h b/src/lib/elementary/elc_fileselector_legacy.h index 8fc10654e4..252767ecea 100644 --- a/src/lib/elementary/elc_fileselector_legacy.h +++ b/src/lib/elementary/elc_fileselector_legacy.h @@ -1,4 +1,4 @@ -#include "elm_interface_fileselector.eo.legacy.h" +#include "elm_interface_fileselector_eo.legacy.h" /** * Add a new file selector widget to the given parent Elementary * (container) object @@ -411,4 +411,4 @@ EAPI Elm_Fileselector_Sort elm_fileselector_sort_method_get(const Evas_Object *o */ EAPI void elm_fileselector_sort_method_set(Evas_Object *obj, Elm_Fileselector_Sort sort); -#include "elm_fileselector.eo.legacy.h" +#include "elm_fileselector_eo.legacy.h" diff --git a/src/lib/elementary/elc_hoversel.c b/src/lib/elementary/elc_hoversel.c index f70cc1017b..a7b5685f21 100644 --- a/src/lib/elementary/elc_hoversel.c +++ b/src/lib/elementary/elc_hoversel.c @@ -10,10 +10,10 @@ #include #include "elm_priv.h" -#include "elm_hoversel.eo.h" -#include "elm_hoversel_item.eo.h" +#include "elm_hoversel_eo.h" +#include "elm_hoversel_item_eo.h" #include "elm_widget_hoversel.h" -#include "efl_ui_button_legacy.eo.h" +#include "efl_ui_button_legacy_eo.h" #define MY_CLASS ELM_HOVERSEL_CLASS @@ -42,7 +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 Eina_Bool _hoversel_efl_ui_widget_widget_input_event_handler(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}, @@ -63,14 +63,14 @@ _elm_hoversel_efl_ui_l10n_translation_update(Eo *obj EINA_UNUSED, Elm_Hoversel_D efl_ui_l10n_translation_update(efl_super(obj, MY_CLASS)); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_hoversel_efl_ui_widget_theme_apply(Eo *obj, Elm_Hoversel_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; Eina_List *l; Elm_Object_Item *eo_item; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); char buf[4096]; const char *style; @@ -86,7 +86,7 @@ _elm_hoversel_efl_ui_widget_theme_apply(Eo *obj, Elm_Hoversel_Data *sd) elm_widget_theme_style_set(obj, buf); int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; elm_widget_theme_style_set(obj, style); @@ -176,7 +176,7 @@ _on_item_clicked(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED) ELM_HOVERSEL_DATA_GET(obj2, sd); if (item->func) item->func((void *)WIDGET_ITEM_DATA_GET(eo_it), obj2, eo_it); - efl_event_callback_legacy_call(obj2, EFL_UI_EVENT_SELECTED, eo_it); + efl_event_callback_legacy_call(obj2, EFL_UI_EVENT_ITEM_SELECTED, eo_it); evas_object_event_callback_add(sd->hover, EVAS_CALLBACK_DEL, _auto_update, item); @@ -245,6 +245,7 @@ _sizing_eval(void *data) Eina_Rectangle base, adjusted, parent; ELM_HOVERSEL_DATA_GET(obj, sd); + EINA_SAFETY_ON_NULL_RETURN(sd); if (sd->resize_job) sd->resize_job = NULL; @@ -446,7 +447,7 @@ _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); + _hoversel_efl_ui_widget_widget_input_event_handler(data, sd, ev, ev->object); } static void @@ -637,7 +638,6 @@ EOLIAN static void _elm_hoversel_efl_canvas_group_group_add(Eo *obj, Elm_Hoversel_Data *pd) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); efl_event_callback_add(obj, EFL_UI_EVENT_CLICKED, _on_clicked, obj); @@ -681,12 +681,6 @@ _elm_hoversel_efl_gfx_entity_visible_set(Eo *obj, Elm_Hoversel_Data *sd, Eina_Bo efl_gfx_entity_visible_set(sd->hover, vis); } -EOLIAN static void -_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(const Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd EINA_UNUSED) { @@ -708,6 +702,7 @@ _elm_hoversel_efl_object_constructor(Eo *obj, Elm_Hoversel_Data *_pd EINA_UNUSED evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_PUSH_BUTTON); legacy_object_focus_handle(obj); + elm_hoversel_hover_parent_set(obj, efl_parent_get(obj)); return obj; } @@ -721,7 +716,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_ENTITY_EVENT_RESIZE, _on_parent_resize }); + { EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _on_parent_resize }); EOLIAN static void _elm_hoversel_hover_parent_set(Eo *obj, Elm_Hoversel_Data *sd, Evas_Object *parent) @@ -1015,12 +1010,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_efl_ui_widget_widget_event(Eo *obj, Elm_Hoversel_Data *sd, const Efl_Event *eo_event, Evas_Object *src) +_elm_hoversel_efl_ui_widget_widget_input_event_handler(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)) + if (efl_ui_widget_input_event_handler(efl_super(obj, MY_CLASS), eo_event, src)) return EINA_TRUE; // note: this was FALSE but likely wrong - return _hoversel_efl_ui_widget_widget_event(obj, sd, eo_event, src); + return _hoversel_efl_ui_widget_widget_input_event_handler(obj, sd, eo_event, src); } static void @@ -1067,5 +1062,5 @@ _elm_hoversel_auto_update_get(const Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd) #define ELM_HOVERSEL_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_hoversel) -#include "elm_hoversel_item.eo.c" -#include "elm_hoversel.eo.c" +#include "elm_hoversel_item_eo.c" +#include "elm_hoversel_eo.c" diff --git a/src/lib/elementary/elc_hoversel_legacy.h b/src/lib/elementary/elc_hoversel_legacy.h index 89e6f9be3f..79a286f328 100644 --- a/src/lib/elementary/elc_hoversel_legacy.h +++ b/src/lib/elementary/elc_hoversel_legacy.h @@ -8,5 +8,5 @@ */ EAPI Evas_Object *elm_hoversel_add(Evas_Object *parent); -#include "elm_hoversel_item.eo.legacy.h" -#include "elm_hoversel.eo.legacy.h" +#include "elm_hoversel_item_eo.legacy.h" +#include "elm_hoversel_eo.legacy.h" diff --git a/src/lib/elementary/elc_multibuttonentry.c b/src/lib/elementary/elc_multibuttonentry.c index 01e2cebc3b..452d7e0849 100644 --- a/src/lib/elementary/elc_multibuttonentry.c +++ b/src/lib/elementary/elc_multibuttonentry.c @@ -13,7 +13,7 @@ #include "elm_priv.h" #include "elm_widget_multibuttonentry.h" #include "elm_multibuttonentry_part.eo.h" -#include "elm_entry.eo.h" +#include "elm_entry_eo.h" #include "elm_part_helper.h" #define MY_CLASS ELM_MULTIBUTTONENTRY_CLASS @@ -91,7 +91,7 @@ _format_count(int count, void *data EINA_UNUSED) return strdup(buf); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_multibuttonentry_efl_ui_widget_theme_apply(Eo *obj, Elm_Multibuttonentry_Data *sd) { const char *str; @@ -100,9 +100,9 @@ _elm_multibuttonentry_efl_ui_widget_theme_apply(Eo *obj, Elm_Multibuttonentry_Da Elm_Object_Item *eo_item; double pad_scale; - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; str = elm_layout_data_get(obj, "horizontal_pad"); if (str) hpad = atoi(str); @@ -212,7 +212,7 @@ _shrink_mode_set(Evas_Object *obj, if (sd->label && sd->label_packed) { elm_box_pack_end(sd->box, sd->label); - w -= efl_gfx_size_hint_combined_min_get(sd->label).w; + w -= efl_gfx_hint_size_combined_min_get(sd->label).w; w -= box_inner_item_width_padding; } @@ -229,7 +229,7 @@ _shrink_mode_set(Evas_Object *obj, evas_object_show(VIEW(item)); item->visible = EINA_TRUE; - w -= efl_gfx_size_hint_combined_min_get(VIEW(item)).w; + w -= efl_gfx_hint_size_combined_min_get(VIEW(item)).w; w -= box_inner_item_width_padding; count--; @@ -495,7 +495,7 @@ _on_item_clicked(void *data, if (_elm_config->atspi_mode) efl_access_state_changed_signal_emit(eo_it, - EFL_ACCESS_STATE_CHECKED, + EFL_ACCESS_STATE_TYPE_CHECKED, EINA_TRUE); if (sd->selected_it) @@ -938,7 +938,7 @@ _item_new(Elm_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 -_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) +_elm_multibuttonentry_efl_ui_widget_widget_input_event_handler(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; @@ -1562,12 +1562,11 @@ _elm_multibuttonentry_efl_canvas_group_group_add(Eo *obj, Elm_Multibuttonentry_D if (!elm_widget_theme_klass_get(obj)) elm_widget_theme_klass_set(obj, "multibuttonentry"); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); - if (!elm_widget_theme_object_set(obj, wd->resize_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))) + elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); elm_widget_can_focus_set(obj, EINA_FALSE); @@ -1974,10 +1973,10 @@ _elm_multibuttonentry_item_efl_access_object_state_set_get(const Eo *eo_it, Elm_ sel = elm_obj_multibuttonentry_item_selected_get(eo_it); - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_EDITABLE); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_EDITABLE); if (sel) - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_CHECKED); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_CHECKED); return ret; } @@ -2033,5 +2032,5 @@ ELM_PART_OVERRIDE_TEXT_GET(elm_multibuttonentry, ELM_MULTIBUTTONENTRY, Elm_Multi ELM_LAYOUT_SIZING_EVAL_OPS(elm_multibuttonentry), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_multibuttonentry) -#include "elm_multibuttonentry_item.eo.c" -#include "elm_multibuttonentry.eo.c" +#include "elm_multibuttonentry_item_eo.c" +#include "elm_multibuttonentry_eo.c" diff --git a/src/lib/elementary/elc_multibuttonentry.h b/src/lib/elementary/elc_multibuttonentry.h index 75fe7a1b99..e17c1c946f 100644 --- a/src/lib/elementary/elc_multibuttonentry.h +++ b/src/lib/elementary/elc_multibuttonentry.h @@ -58,9 +58,6 @@ */ #include "elc_multibuttonentry_common.h" -#ifdef EFL_EO_API_SUPPORT -#include "elc_multibuttonentry_eo.h" -#endif #ifndef EFL_NOLEGACY_API_SUPPORT #include "elc_multibuttonentry_legacy.h" #endif diff --git a/src/lib/elementary/elc_multibuttonentry_eo.h b/src/lib/elementary/elc_multibuttonentry_eo.h index 4d958bd55b..8852acfbf9 100644 --- a/src/lib/elementary/elc_multibuttonentry_eo.h +++ b/src/lib/elementary/elc_multibuttonentry_eo.h @@ -1,2 +1,2 @@ -#include "elm_multibuttonentry_item.eo.h" -#include "elm_multibuttonentry.eo.h" +#include "elm_multibuttonentry_item_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 57ab154de9..05edfcc491 100644 --- a/src/lib/elementary/elc_multibuttonentry_legacy.h +++ b/src/lib/elementary/elc_multibuttonentry_legacy.h @@ -1,5 +1,5 @@ -#include "elm_multibuttonentry_item.eo.legacy.h" -#include "elm_multibuttonentry.eo.legacy.h" +#include "elm_multibuttonentry_item_eo.legacy.h" +#include "elm_multibuttonentry_eo.legacy.h" /** * @brief Add a new multibuttonentry to the parent diff --git a/src/lib/elementary/elc_naviframe.c b/src/lib/elementary/elc_naviframe.c index 7e757a44c2..fa22902d90 100644 --- a/src/lib/elementary/elc_naviframe.c +++ b/src/lib/elementary/elc_naviframe.c @@ -11,8 +11,8 @@ #include #include "elm_priv.h" -#include "elm_naviframe.eo.h" -#include "elm_naviframe_item.eo.h" +#include "elm_naviframe_eo.h" +#include "elm_naviframe_item_eo.h" #include "elm_widget_naviframe.h" #include "elm_widget_container.h" @@ -366,7 +366,7 @@ _item_title_enabled_update(Elm_Naviframe_Item_Data *nit, Eina_Bool transition) edje_object_message_signal_process(elm_layout_edje_get(VIEW(nit))); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_naviframe_efl_ui_widget_theme_apply(Eo *obj, Elm_Naviframe_Data *sd) { Elm_Naviframe_Item_Data *it; @@ -384,7 +384,7 @@ _elm_naviframe_efl_ui_widget_theme_apply(Eo *obj, Elm_Naviframe_Data *sd) } elm_layout_sizing_eval(obj); - return EFL_UI_THEME_APPLY_RESULT_SUCCESS; + return EFL_UI_THEME_APPLY_ERROR_NONE; } static char * @@ -1392,7 +1392,6 @@ _elm_naviframe_efl_canvas_group_group_add(Eo *obj, Elm_Naviframe_Data *priv) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->dummy_edje = wd->resize_obj; evas_object_smart_member_add(priv->dummy_edje, obj); @@ -1439,7 +1438,7 @@ _deferred(void *data, const Efl_Event *event EINA_UNUSED) free(nfo); } - efl_event_callback_del(nfd->obj, EFL_EVENT_ANIMATOR_TICK, _deferred, nfd); + efl_event_callback_del(nfd->obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _deferred, nfd); } EOLIAN static void @@ -1534,7 +1533,7 @@ static void _schedule_deferred(Elm_Naviframe_Op *nfo, Elm_Naviframe_Data *sd) { if (!sd->ops) - efl_event_callback_add(sd->obj, EFL_EVENT_ANIMATOR_TICK, _deferred, sd); + efl_event_callback_add(sd->obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _deferred, sd); sd->ops = eina_list_append(sd->ops, nfo); } @@ -2052,5 +2051,5 @@ ELM_PART_OVERRIDE_TEXT_GET(elm_naviframe, ELM_NAVIFRAME, Elm_Naviframe_Data) ELM_LAYOUT_SIZING_EVAL_OPS(elm_naviframe), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_naviframe) -#include "elm_naviframe_item.eo.c" -#include "elm_naviframe.eo.c" +#include "elm_naviframe_item_eo.c" +#include "elm_naviframe_eo.c" diff --git a/src/lib/elementary/elc_naviframe_common.h b/src/lib/elementary/elc_naviframe_common.h index 525f995c8c..453587e048 100644 --- a/src/lib/elementary/elc_naviframe_common.h +++ b/src/lib/elementary/elc_naviframe_common.h @@ -23,7 +23,35 @@ EAPI Evas_Object *elm_naviframe_add(Evas_Object *parent); EAPI void elm_naviframe_item_title_enabled_set(Elm_Object_Item *it, Eina_Bool enabled, Eina_Bool transition); -Elm_Object_Item *elm_naviframe_item_push(Evas_Object *obj, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style); +/** + * @brief Push a new item to the top of the naviframe stack (and show it). + * + * The item pushed becomes one page of the naviframe, this item will be deleted + * when it is popped. + * + * When push transition animation is in progress, pop operation is blocked + * until push is complete. + * + * The following styles are available for this item: "default" + * + * @param[in] obj The object. + * @param[in] title_label The label in the title area. The name of the title + * label part is "elm.text.title" + * @param[in] prev_btn The button to go to the previous item. If it is NULL, + * then naviframe will create a back button automatically. The name of the + * prev_btn part is "elm.swallow.prev_btn" + * @param[in] next_btn The button to go to the next item. Or It could be just + * an extra function button. The name of the next_btn part is + * "elm.swallow.next_btn" + * @param[in] content The main content object. The name of content part is + * "elm.swallow.content" + * @param[in] item_style The current item style name. @c NULL would be default. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Naviframe_Group + */ +EAPI Elm_Object_Item *elm_naviframe_item_push(Evas_Object *obj, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style); /** * @brief Simple version of item_push. diff --git a/src/lib/elementary/elc_naviframe_legacy.h b/src/lib/elementary/elc_naviframe_legacy.h index 7bcba3a6a3..38f06ca186 100644 --- a/src/lib/elementary/elc_naviframe_legacy.h +++ b/src/lib/elementary/elc_naviframe_legacy.h @@ -19,5 +19,5 @@ EAPI void elm_naviframe_item_style_set(Elm_Object_Item *obj, const char *style); */ 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" +#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 96a703ea1c..275599c30f 100644 --- a/src/lib/elementary/elc_player.c +++ b/src/lib/elementary/elc_player.c @@ -185,12 +185,12 @@ _update_theme_slider(Evas_Object *obj, Evas_Object *sl, const char *name, const elm_object_disabled_set(sl, elm_widget_disabled_get(obj)); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_player_efl_ui_widget_theme_apply(Eo *obj, Elm_Player_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _update_theme_button(obj, sd->forward, "forward"); _update_theme_button(obj, sd->info, "info"); @@ -592,7 +592,6 @@ _elm_player_efl_canvas_group_group_add(Eo *obj, Elm_Player_Data *priv) char buf[256]; efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set(obj, "player", "base", elm_widget_style_get(obj))) CRI("Failed to set layout!"); @@ -711,4 +710,4 @@ ELM_PART_CONTENT_DEFAULT_GET(elm_player, "video") ELM_LAYOUT_SIZING_EVAL_OPS(elm_player), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_player) -#include "elm_player.eo.c" +#include "elm_player_eo.c" diff --git a/src/lib/elementary/elc_popup.c b/src/lib/elementary/elc_popup.c index 8c4684e0b3..7cdf1edf0e 100644 --- a/src/lib/elementary/elc_popup.c +++ b/src/lib/elementary/elc_popup.c @@ -365,7 +365,7 @@ _populate_theme_scroll(Elm_Popup_Data *sd) sd->theme_scroll = EINA_FALSE; } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_popup_efl_ui_widget_theme_apply(Eo *obj, Elm_Popup_Data *sd) { Elm_Popup_Item_Data *it; @@ -439,7 +439,7 @@ _elm_popup_efl_ui_widget_theme_apply(Eo *obj, Elm_Popup_Data *sd) /* access */ if (_elm_config->access_mode) _access_obj_process(obj, EINA_TRUE); - return EFL_UI_THEME_APPLY_RESULT_SUCCESS; + return EFL_UI_THEME_APPLY_ERROR_NONE; } static void @@ -503,14 +503,6 @@ _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; } @@ -1425,7 +1417,6 @@ _elm_popup_efl_canvas_group_group_add(Eo *obj, Elm_Popup_Data *priv) char style[1024]; efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); snprintf(style, sizeof(style), "popup/%s", elm_widget_style_get(obj)); @@ -1504,10 +1495,11 @@ _parent_geom_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_i evas_object_resize(popup, w, h); } -EOLIAN static void -_elm_popup_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Popup_Data *sd, Evas_Object *parent) +static void +_parent_setup(Eo *obj, Elm_Popup_Data *sd, Evas_Object *parent) { Evas_Coord x, y, w, h; + evas_object_geometry_get(parent, &x, &y, &w, &h); if (efl_isa(parent, EFL_UI_WIN_CLASS)) @@ -1549,6 +1541,7 @@ _elm_popup_efl_object_constructor(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED) evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_DIALOG); legacy_object_focus_handle(obj); + _parent_setup(obj, _pd, efl_parent_get(obj)); return obj; } @@ -1824,7 +1817,7 @@ _elm_popup_efl_access_object_state_set_get(const Eo *obj, Elm_Popup_Data *sd EIN Efl_Access_State_Set ret; ret = efl_access_object_state_set_get(efl_super(obj, MY_CLASS)); - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_MODAL); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_MODAL); return ret; } @@ -1875,5 +1868,5 @@ ELM_PART_OVERRIDE_TEXT_GET(elm_popup, ELM_POPUP, Elm_Popup_Data) ELM_LAYOUT_SIZING_EVAL_OPS(elm_popup), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_popup) -#include "elm_popup.eo.c" -#include "elm_popup_item.eo.c" +#include "elm_popup_eo.c" +#include "elm_popup_item_eo.c" diff --git a/src/lib/elementary/elc_popup_legacy.h b/src/lib/elementary/elc_popup_legacy.h index 027edbdb6b..3312928593 100644 --- a/src/lib/elementary/elc_popup_legacy.h +++ b/src/lib/elementary/elc_popup_legacy.h @@ -8,4 +8,4 @@ */ EAPI Evas_Object *elm_popup_add(Evas_Object *parent) EINA_ARG_NONNULL(1); -#include "elm_popup.eo.legacy.h" \ No newline at end of file +#include "elm_popup_eo.legacy.h" \ No newline at end of file diff --git a/src/lib/elementary/elementary_config.h b/src/lib/elementary/elementary_config.h index c726711d94..6074510b0d 100644 --- a/src/lib/elementary/elementary_config.h +++ b/src/lib/elementary/elementary_config.h @@ -9,19 +9,9 @@ #define ELM_CONFIG_ICON_THEME_ELEMENTARY "_Elementary_Icon_Theme" -#if defined(ELEMENTARY_BUILD) || defined(ELM_INTERNAL_API_ARGESFSDFEFC) +#if defined(EFL_BUILD) || defined(ELM_INTERNAL_API_ARGESFSDFEFC) #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_OBJECT_BETA -#define EFL_ACCESS_COMPONENT_BETA -#define EFL_ACCESS_EDITABLE_TEXT_BETA -#define EFL_ACCESS_IMAGE_BETA -#define EFL_ACCESS_SELECTION_BETA -#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 f5dcb242dd..9b33f4de40 100644 --- a/src/lib/elementary/elm_access.c +++ b/src/lib/elementary/elm_access.c @@ -48,7 +48,6 @@ EOLIAN static void _elm_access_efl_canvas_group_group_add(Eo *obj, void *_pd EINA_UNUSED) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); } static Eina_Bool @@ -701,7 +700,7 @@ _elm_access_highlight_cycle(Evas_Object *obj, Elm_Focus_Direction dir) } else { - efl_ui_focus_util_focus(EFL_UI_FOCUS_UTIL_CLASS, obj); + efl_ui_focus_util_focus(obj); efl_ui_focus_manager_move(elm_widget_top_get(obj), dir); } } @@ -1531,8 +1530,8 @@ _elm_access_efl_access_object_state_set_get(const Eo *obj, void *pd EINA_UNUSED) Elm_Access_Info *info = _elm_access_info_get(obj); if (info && !evas_object_visible_get(info->part_object)) { - STATE_TYPE_UNSET(ret, EFL_ACCESS_STATE_VISIBLE); - STATE_TYPE_UNSET(ret, EFL_ACCESS_STATE_SHOWING); + STATE_TYPE_UNSET(ret, EFL_ACCESS_STATE_TYPE_VISIBLE); + STATE_TYPE_UNSET(ret, EFL_ACCESS_STATE_TYPE_SHOWING); } return ret; @@ -1543,4 +1542,4 @@ _elm_access_efl_access_object_state_set_get(const Eo *obj, void *pd EINA_UNUSED) #define ELM_ACCESS_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_OPS(elm_access) -#include "elm_access.eo.c" +#include "elm_access_eo.c" diff --git a/src/lib/elementary/elm_access.eo b/src/lib/elementary/elm_access.eo deleted file mode 100644 index 3f81dcffd4..0000000000 --- a/src/lib/elementary/elm_access.eo +++ /dev/null @@ -1,15 +0,0 @@ -class Elm.Access extends Efl.Ui.Widget implements Efl.Access.Widget.Action -{ - [[Elm abstract accessibility class]] - legacy_prefix: elm_access; - eo_prefix: elm_obj_access; - data: null; - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.on_access_activate; - Efl.Ui.Focus.Object.on_focus_update; - Efl.Access.Widget.Action.elm_actions { get; } - Efl.Access.Object.state_set { get; } - } -} diff --git a/src/lib/elementary/elm_access_eo.c b/src/lib/elementary/elm_access_eo.c new file mode 100644 index 0000000000..e2a48bd508 --- /dev/null +++ b/src/lib/elementary/elm_access_eo.c @@ -0,0 +1,51 @@ + +Efl_Object *_elm_access_efl_object_constructor(Eo *obj, void *pd); + + +Eina_Bool _elm_access_efl_ui_widget_on_access_activate(Eo *obj, void *pd, Efl_Ui_Activate act); + + +Eina_Bool _elm_access_efl_ui_focus_object_on_focus_update(Eo *obj, void *pd); + + +const Efl_Access_Action_Data *_elm_access_efl_access_widget_action_elm_actions_get(const Eo *obj, void *pd); + + +Efl_Access_State_Set _elm_access_efl_access_object_state_set_get(const Eo *obj, void *pd); + + +static Eina_Bool +_elm_access_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_ACCESS_EXTRA_OPS +#define ELM_ACCESS_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_access_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_activate, _elm_access_efl_ui_widget_on_access_activate), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_on_focus_update, _elm_access_efl_ui_focus_object_on_focus_update), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_access_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_access_efl_access_object_state_set_get), + ELM_ACCESS_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_access_class_desc = { + EO_VERSION, + "Elm.Access", + EFL_CLASS_TYPE_REGULAR, + 0, + _elm_access_class_initializer, + _elm_access_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_access_class_get, &_elm_access_class_desc, EFL_UI_WIDGET_CLASS, EFL_ACCESS_WIDGET_ACTION_MIXIN, NULL); diff --git a/src/lib/elementary/elm_access_eo.h b/src/lib/elementary/elm_access_eo.h new file mode 100644 index 0000000000..75921b80f5 --- /dev/null +++ b/src/lib/elementary/elm_access_eo.h @@ -0,0 +1,24 @@ +#ifndef _ELM_ACCESS_EO_H_ +#define _ELM_ACCESS_EO_H_ + +#ifndef _ELM_ACCESS_EO_CLASS_TYPE +#define _ELM_ACCESS_EO_CLASS_TYPE + +typedef Eo Elm_Access; + +#endif + +#ifndef _ELM_ACCESS_EO_TYPES +#define _ELM_ACCESS_EO_TYPES + + +#endif +/** Elm abstract accessibility class + * + * @ingroup Elm_Access + */ +#define ELM_ACCESS_CLASS elm_access_class_get() + +EWAPI const Efl_Class *elm_access_class_get(void); + +#endif diff --git a/src/lib/elementary/elm_access_eo.legacy.h b/src/lib/elementary/elm_access_eo.legacy.h new file mode 100644 index 0000000000..631905e794 --- /dev/null +++ b/src/lib/elementary/elm_access_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_ACCESS_EO_LEGACY_H_ +#define _ELM_ACCESS_EO_LEGACY_H_ + +#ifndef _ELM_ACCESS_EO_CLASS_TYPE +#define _ELM_ACCESS_EO_CLASS_TYPE + +typedef Eo Elm_Access; + +#endif + +#ifndef _ELM_ACCESS_EO_TYPES +#define _ELM_ACCESS_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_actionslider.c b/src/lib/elementary/elm_actionslider.c index b9f295f76c..d4e3ca129b 100644 --- a/src/lib/elementary/elm_actionslider.c +++ b/src/lib/elementary/elm_actionslider.c @@ -12,7 +12,7 @@ #include "elm_widget_actionslider.h" #include "elm_widget_layout.h" -#include "elm_actionslider.eo.h" +#include "elm_actionslider_eo.h" #include "elm_actionslider_part.eo.h" #include "elm_part_helper.h" @@ -113,18 +113,18 @@ _mirroredness_change_eval(Evas_Object *obj) (wd->resize_obj, "elm.drag_button_base", 1.0 - pos, 0.5); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_actionslider_efl_ui_widget_theme_apply(Eo *obj, Elm_Actionslider_Data *sd EINA_UNUSED) { Eina_Bool mirrored; - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); mirrored = elm_object_mirrored_get(obj); int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; if (elm_object_mirrored_get(obj) != mirrored) _mirroredness_change_eval(obj); @@ -239,16 +239,13 @@ _button_animator(void *data) if ((!EINA_DBL_EQ(sd->final_position, 0)) && (sd->enabled_position & ELM_ACTIONSLIDER_LEFT)) - efl_event_callback_legacy_call - (obj, EFL_UI_EVENT_SELECTED, (char *)left); + evas_object_smart_callback_call(obj, "selected",(char *)left); else if ((EINA_DBL_EQ(sd->final_position, 0.5)) && (sd->enabled_position & ELM_ACTIONSLIDER_CENTER)) - efl_event_callback_legacy_call - (obj, EFL_UI_EVENT_SELECTED, (char *)center); + evas_object_smart_callback_call(obj, "selected", (char *)center); else if ((EINA_DBL_EQ(sd->final_position, 1)) && (sd->enabled_position & ELM_ACTIONSLIDER_RIGHT)) - efl_event_callback_legacy_call - (obj, EFL_UI_EVENT_SELECTED, (char *)right); + evas_object_smart_callback_call(obj, "selected", (char *)right); sd->button_animator = NULL; @@ -285,8 +282,7 @@ _drag_button_up_cb(void *data, (efl_ui_mirrored_get(obj) && EINA_DBL_EQ(position, 1.0)))) { sd->final_position = 0; - efl_event_callback_legacy_call - (obj, EFL_UI_EVENT_SELECTED, (char *)left); + evas_object_smart_callback_call(obj, "selected", (char *)left); return; } @@ -295,8 +291,7 @@ _drag_button_up_cb(void *data, (sd->enabled_position & ELM_ACTIONSLIDER_CENTER)) { sd->final_position = 0.5; - efl_event_callback_legacy_call - (obj, EFL_UI_EVENT_SELECTED, (char *)center); + evas_object_smart_callback_call(obj, "selected", (char *)center); ecore_animator_del(sd->button_animator); sd->button_animator = ecore_evas_animator_add(obj, _button_animator, obj); @@ -309,8 +304,7 @@ _drag_button_up_cb(void *data, (efl_ui_mirrored_get(obj) && EINA_DBL_EQ(position, 0)))) { sd->final_position = 1; - efl_event_callback_legacy_call - (obj, EFL_UI_EVENT_SELECTED, (char *)right); + evas_object_smart_callback_call(obj, "selected", (char *)right); return; } @@ -489,7 +483,6 @@ _elm_actionslider_efl_canvas_group_group_add(Eo *obj, Elm_Actionslider_Data *pri ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->enabled_position = ELM_ACTIONSLIDER_ALL; @@ -664,4 +657,4 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX) ELM_LAYOUT_SIZING_EVAL_OPS(elm_actionslider), \ EFL_CANVAS_GROUP_ADD_OPS(elm_actionslider) -#include "elm_actionslider.eo.c" +#include "elm_actionslider_eo.c" diff --git a/src/lib/elementary/elm_actionslider.eo b/src/lib/elementary/elm_actionslider.eo deleted file mode 100644 index 260e699420..0000000000 --- a/src/lib/elementary/elm_actionslider.eo +++ /dev/null @@ -1,80 +0,0 @@ -enum Elm.Actionslider.Pos -{ - [[A position for indicators, magnets, and enabled items.]] - legacy: elm_actionslider; - - none = 0, [[No position is set.]] - left = 1 << 0, [[Left position.]] - center = 1 << 1, [[Center position.]] - right = 1 << 2, [[Right position.]] - all = (1 << 3) - 1 [[All positions for left/center/right.]] -} - -class Elm.Actionslider extends Efl.Ui.Layout implements Efl.Ui.Selectable, Efl.Ui.Legacy -{ - [[An actionslider is a switcher for 2 or 3 labels - - with customizable magnet properties. The user drags and releases - the indicator, to choose a label. When the indicator is released, - it will move to its nearest "enabled and magnetized" position. - ]] - - legacy_prefix: elm_actionslider; - eo_prefix: elm_obj_actionslider; - event_prefix: elm_actionslider; - methods { - @property indicator_pos { - [[Actionslider position indicator]] - set { - } - get { - } - values { - pos: Elm.Actionslider.Pos; [[The position of the indicator.]] - } - } - @property magnet_pos { - [[Actionslider magnet position.]] - set { - [[To make multiple positions magnets OR them together (e.g. - ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT) - ]] - } - get { - } - values { - pos: Elm.Actionslider.Pos; [[Bit mask indicating the magnet positions.]] - } - } - @property enabled_pos { - [[Actionslider enabled position.]] - set { - [[To set multiple positions as enabled OR them together(e.g. - ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT). - - Note: All the positions are enabled by default. - ]] - } - get { - } - values { - pos: Elm.Actionslider.Pos; [[Bit mask indicating the enabled positions.]] - } - } - @property selected_label { - get { - [[Get actionslider selected label.]] - return: string; [[Selected label]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.theme_apply; - Efl.Part.part_get; - } - events { - pos_changed: string; [[The position of the actionslider has changed]] - } -} diff --git a/src/lib/elementary/elm_actionslider_eo.c b/src/lib/elementary/elm_actionslider_eo.c new file mode 100644 index 0000000000..5e47bd42f6 --- /dev/null +++ b/src/lib/elementary/elm_actionslider_eo.c @@ -0,0 +1,82 @@ +EWAPI const Efl_Event_Description _ELM_ACTIONSLIDER_EVENT_POS_CHANGED = + EFL_EVENT_DESCRIPTION("pos_changed"); + +void _elm_actionslider_indicator_pos_set(Eo *obj, Elm_Actionslider_Data *pd, Elm_Actionslider_Pos pos); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_actionslider_indicator_pos_set, EFL_FUNC_CALL(pos), Elm_Actionslider_Pos pos); + +Elm_Actionslider_Pos _elm_actionslider_indicator_pos_get(const Eo *obj, Elm_Actionslider_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_actionslider_indicator_pos_get, Elm_Actionslider_Pos, 0); + +void _elm_actionslider_magnet_pos_set(Eo *obj, Elm_Actionslider_Data *pd, Elm_Actionslider_Pos pos); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_actionslider_magnet_pos_set, EFL_FUNC_CALL(pos), Elm_Actionslider_Pos pos); + +Elm_Actionslider_Pos _elm_actionslider_magnet_pos_get(const Eo *obj, Elm_Actionslider_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_actionslider_magnet_pos_get, Elm_Actionslider_Pos, 0); + +void _elm_actionslider_enabled_pos_set(Eo *obj, Elm_Actionslider_Data *pd, Elm_Actionslider_Pos pos); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_actionslider_enabled_pos_set, EFL_FUNC_CALL(pos), Elm_Actionslider_Pos pos); + +Elm_Actionslider_Pos _elm_actionslider_enabled_pos_get(const Eo *obj, Elm_Actionslider_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_actionslider_enabled_pos_get, Elm_Actionslider_Pos, 0); + +const char *_elm_actionslider_selected_label_get(const Eo *obj, Elm_Actionslider_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_actionslider_selected_label_get, const char *, NULL); + +Efl_Object *_elm_actionslider_efl_object_constructor(Eo *obj, Elm_Actionslider_Data *pd); + + +Eina_Error _elm_actionslider_efl_ui_widget_theme_apply(Eo *obj, Elm_Actionslider_Data *pd); + + +Efl_Object *_elm_actionslider_efl_part_part_get(const Eo *obj, Elm_Actionslider_Data *pd, const char *name); + + +static Eina_Bool +_elm_actionslider_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_ACTIONSLIDER_EXTRA_OPS +#define ELM_ACTIONSLIDER_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_actionslider_indicator_pos_set, _elm_actionslider_indicator_pos_set), + EFL_OBJECT_OP_FUNC(elm_obj_actionslider_indicator_pos_get, _elm_actionslider_indicator_pos_get), + EFL_OBJECT_OP_FUNC(elm_obj_actionslider_magnet_pos_set, _elm_actionslider_magnet_pos_set), + EFL_OBJECT_OP_FUNC(elm_obj_actionslider_magnet_pos_get, _elm_actionslider_magnet_pos_get), + EFL_OBJECT_OP_FUNC(elm_obj_actionslider_enabled_pos_set, _elm_actionslider_enabled_pos_set), + EFL_OBJECT_OP_FUNC(elm_obj_actionslider_enabled_pos_get, _elm_actionslider_enabled_pos_get), + EFL_OBJECT_OP_FUNC(elm_obj_actionslider_selected_label_get, _elm_actionslider_selected_label_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_actionslider_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_actionslider_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_actionslider_efl_part_part_get), + ELM_ACTIONSLIDER_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_actionslider_class_desc = { + EO_VERSION, + "Elm.Actionslider", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Actionslider_Data), + _elm_actionslider_class_initializer, + _elm_actionslider_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_actionslider_class_get, &_elm_actionslider_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_actionslider_eo.legacy.c" diff --git a/src/lib/elementary/elm_actionslider_eo.h b/src/lib/elementary/elm_actionslider_eo.h new file mode 100644 index 0000000000..9a6b55d484 --- /dev/null +++ b/src/lib/elementary/elm_actionslider_eo.h @@ -0,0 +1,134 @@ +#ifndef _ELM_ACTIONSLIDER_EO_H_ +#define _ELM_ACTIONSLIDER_EO_H_ + +#ifndef _ELM_ACTIONSLIDER_EO_CLASS_TYPE +#define _ELM_ACTIONSLIDER_EO_CLASS_TYPE + +typedef Eo Elm_Actionslider; + +#endif + +#ifndef _ELM_ACTIONSLIDER_EO_TYPES +#define _ELM_ACTIONSLIDER_EO_TYPES + +/** A position for indicators, magnets, and enabled items. + * + * @ingroup Elm_Actionslider + */ +typedef enum +{ + ELM_ACTIONSLIDER_NONE = 0, /**< No position is set. */ + ELM_ACTIONSLIDER_LEFT = 1 /* 1 >> 0 */, /**< Left position. */ + ELM_ACTIONSLIDER_CENTER = 2 /* 1 >> 1 */, /**< Center position. */ + ELM_ACTIONSLIDER_RIGHT = 4 /* 1 >> 2 */, /**< Right position. */ + ELM_ACTIONSLIDER_ALL = 7 /* (1 >> 3) * 1 */ /**< All positions for + * left/center/right. */ +} Elm_Actionslider_Pos; + + +#endif +/** + * @brief An actionslider is a switcher for 2 or 3 labels + * + * with customizable magnet properties. The user drags and releases the + * indicator, to choose a label. When the indicator is released, it will move + * to its nearest "enabled and magnetized" position. + * + * @ingroup Elm_Actionslider + */ +#define ELM_ACTIONSLIDER_CLASS elm_actionslider_class_get() + +EWAPI const Efl_Class *elm_actionslider_class_get(void); + +/** + * @brief Actionslider position indicator + * + * @param[in] obj The object. + * @param[in] pos The position of the indicator. + * + * @ingroup Elm_Actionslider + */ +EOAPI void elm_obj_actionslider_indicator_pos_set(Eo *obj, Elm_Actionslider_Pos pos); + +/** + * @brief Actionslider position indicator + * + * @param[in] obj The object. + * + * @return The position of the indicator. + * + * @ingroup Elm_Actionslider + */ +EOAPI Elm_Actionslider_Pos elm_obj_actionslider_indicator_pos_get(const Eo *obj); + +/** + * @brief Actionslider magnet position. + * + * To make multiple positions magnets OR them together (e.g. + * ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT) + * + * @param[in] obj The object. + * @param[in] pos Bit mask indicating the magnet positions. + * + * @ingroup Elm_Actionslider + */ +EOAPI void elm_obj_actionslider_magnet_pos_set(Eo *obj, Elm_Actionslider_Pos pos); + +/** + * @brief Actionslider magnet position. + * + * @param[in] obj The object. + * + * @return Bit mask indicating the magnet positions. + * + * @ingroup Elm_Actionslider + */ +EOAPI Elm_Actionslider_Pos elm_obj_actionslider_magnet_pos_get(const Eo *obj); + +/** + * @brief Actionslider enabled position. + * + * To set multiple positions as enabled OR them together(e.g. + * ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT). + * + * @note All the positions are enabled by default. + * + * @param[in] obj The object. + * @param[in] pos Bit mask indicating the enabled positions. + * + * @ingroup Elm_Actionslider + */ +EOAPI void elm_obj_actionslider_enabled_pos_set(Eo *obj, Elm_Actionslider_Pos pos); + +/** + * @brief Actionslider enabled position. + * + * @param[in] obj The object. + * + * @return Bit mask indicating the enabled positions. + * + * @ingroup Elm_Actionslider + */ +EOAPI Elm_Actionslider_Pos elm_obj_actionslider_enabled_pos_get(const Eo *obj); + +/** + * @brief Get actionslider selected label. + * + * @param[in] obj The object. + * + * @return Selected label + * + * @ingroup Elm_Actionslider + */ +EOAPI const char *elm_obj_actionslider_selected_label_get(const Eo *obj); + +EWAPI extern const Efl_Event_Description _ELM_ACTIONSLIDER_EVENT_POS_CHANGED; + +/** The position of the actionslider has changed + * @return const char * + * + * @ingroup Elm_Actionslider + */ +#define ELM_ACTIONSLIDER_EVENT_POS_CHANGED (&(_ELM_ACTIONSLIDER_EVENT_POS_CHANGED)) + +#endif diff --git a/src/lib/elementary/elm_actionslider_eo.legacy.c b/src/lib/elementary/elm_actionslider_eo.legacy.c new file mode 100644 index 0000000000..b1c02500d9 --- /dev/null +++ b/src/lib/elementary/elm_actionslider_eo.legacy.c @@ -0,0 +1,42 @@ + +EAPI void +elm_actionslider_indicator_pos_set(Elm_Actionslider *obj, Elm_Actionslider_Pos pos) +{ + elm_obj_actionslider_indicator_pos_set(obj, pos); +} + +EAPI Elm_Actionslider_Pos +elm_actionslider_indicator_pos_get(const Elm_Actionslider *obj) +{ + return elm_obj_actionslider_indicator_pos_get(obj); +} + +EAPI void +elm_actionslider_magnet_pos_set(Elm_Actionslider *obj, Elm_Actionslider_Pos pos) +{ + elm_obj_actionslider_magnet_pos_set(obj, pos); +} + +EAPI Elm_Actionslider_Pos +elm_actionslider_magnet_pos_get(const Elm_Actionslider *obj) +{ + return elm_obj_actionslider_magnet_pos_get(obj); +} + +EAPI void +elm_actionslider_enabled_pos_set(Elm_Actionslider *obj, Elm_Actionslider_Pos pos) +{ + elm_obj_actionslider_enabled_pos_set(obj, pos); +} + +EAPI Elm_Actionslider_Pos +elm_actionslider_enabled_pos_get(const Elm_Actionslider *obj) +{ + return elm_obj_actionslider_enabled_pos_get(obj); +} + +EAPI const char * +elm_actionslider_selected_label_get(const Elm_Actionslider *obj) +{ + return elm_obj_actionslider_selected_label_get(obj); +} diff --git a/src/lib/elementary/elm_actionslider_eo.legacy.h b/src/lib/elementary/elm_actionslider_eo.legacy.h new file mode 100644 index 0000000000..6a8b63bd0c --- /dev/null +++ b/src/lib/elementary/elm_actionslider_eo.legacy.h @@ -0,0 +1,113 @@ +#ifndef _ELM_ACTIONSLIDER_EO_LEGACY_H_ +#define _ELM_ACTIONSLIDER_EO_LEGACY_H_ + +#ifndef _ELM_ACTIONSLIDER_EO_CLASS_TYPE +#define _ELM_ACTIONSLIDER_EO_CLASS_TYPE + +typedef Eo Elm_Actionslider; + +#endif + +#ifndef _ELM_ACTIONSLIDER_EO_TYPES +#define _ELM_ACTIONSLIDER_EO_TYPES + +/** A position for indicators, magnets, and enabled items. + * + * @ingroup Elm_Actionslider + */ +typedef enum +{ + ELM_ACTIONSLIDER_NONE = 0, /**< No position is set. */ + ELM_ACTIONSLIDER_LEFT = 1 /* 1 >> 0 */, /**< Left position. */ + ELM_ACTIONSLIDER_CENTER = 2 /* 1 >> 1 */, /**< Center position. */ + ELM_ACTIONSLIDER_RIGHT = 4 /* 1 >> 2 */, /**< Right position. */ + ELM_ACTIONSLIDER_ALL = 7 /* (1 >> 3) * 1 */ /**< All positions for + * left/center/right. */ +} Elm_Actionslider_Pos; + + +#endif + +/** + * @brief Actionslider position indicator + * + * @param[in] obj The object. + * @param[in] pos The position of the indicator. + * + * @ingroup Elm_Actionslider_Group + */ +EAPI void elm_actionslider_indicator_pos_set(Elm_Actionslider *obj, Elm_Actionslider_Pos pos); + +/** + * @brief Actionslider position indicator + * + * @param[in] obj The object. + * + * @return The position of the indicator. + * + * @ingroup Elm_Actionslider_Group + */ +EAPI Elm_Actionslider_Pos elm_actionslider_indicator_pos_get(const Elm_Actionslider *obj); + +/** + * @brief Actionslider magnet position. + * + * To make multiple positions magnets OR them together (e.g. + * ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT) + * + * @param[in] obj The object. + * @param[in] pos Bit mask indicating the magnet positions. + * + * @ingroup Elm_Actionslider_Group + */ +EAPI void elm_actionslider_magnet_pos_set(Elm_Actionslider *obj, Elm_Actionslider_Pos pos); + +/** + * @brief Actionslider magnet position. + * + * @param[in] obj The object. + * + * @return Bit mask indicating the magnet positions. + * + * @ingroup Elm_Actionslider_Group + */ +EAPI Elm_Actionslider_Pos elm_actionslider_magnet_pos_get(const Elm_Actionslider *obj); + +/** + * @brief Actionslider enabled position. + * + * To set multiple positions as enabled OR them together(e.g. + * ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT). + * + * @note All the positions are enabled by default. + * + * @param[in] obj The object. + * @param[in] pos Bit mask indicating the enabled positions. + * + * @ingroup Elm_Actionslider_Group + */ +EAPI void elm_actionslider_enabled_pos_set(Elm_Actionslider *obj, Elm_Actionslider_Pos pos); + +/** + * @brief Actionslider enabled position. + * + * @param[in] obj The object. + * + * @return Bit mask indicating the enabled positions. + * + * @ingroup Elm_Actionslider_Group + */ +EAPI Elm_Actionslider_Pos elm_actionslider_enabled_pos_get(const Elm_Actionslider *obj); + +/** + * @brief Get actionslider selected label. + * + * @param[in] obj The object. + * + * @return Selected label + * + * @ingroup Elm_Actionslider_Group + */ +EAPI const char *elm_actionslider_selected_label_get(const Elm_Actionslider *obj); + +#endif diff --git a/src/lib/elementary/elm_actionslider_legacy.h b/src/lib/elementary/elm_actionslider_legacy.h index 60512fd004..57aa0e2770 100644 --- a/src/lib/elementary/elm_actionslider_legacy.h +++ b/src/lib/elementary/elm_actionslider_legacy.h @@ -8,4 +8,4 @@ */ EAPI Evas_Object *elm_actionslider_add(Evas_Object *parent); -#include "elm_actionslider.eo.legacy.h" +#include "elm_actionslider_eo.legacy.h" diff --git a/src/lib/elementary/elm_actionslider_part.eo b/src/lib/elementary/elm_actionslider_part.eo index 5b93976cd1..f9f3d4a42a 100644 --- a/src/lib/elementary/elm_actionslider_part.eo +++ b/src/lib/elementary/elm_actionslider_part.eo @@ -1,4 +1,4 @@ -class Elm_Actionslider.Part extends Efl.Ui.Layout_Part_Legacy +class @beta Elm_Actionslider.Part extends Efl.Ui.Layout_Part_Legacy { [[Elementary Actionslider internal part class]] data: null; diff --git a/src/lib/elementary/elm_atspi_app_object.c b/src/lib/elementary/elm_atspi_app_object.c index 77cfe7f93c..e1ef62ac91 100644 --- a/src/lib/elementary/elm_atspi_app_object.c +++ b/src/lib/elementary/elm_atspi_app_object.c @@ -70,4 +70,4 @@ _elm_atspi_app_object_efl_access_object_role_get(const Eo *obj EINA_UNUSED, Elm_ return EFL_ACCESS_ROLE_APPLICATION; } -#include "elm_atspi_app_object.eo.c" +#include "elm_atspi_app_object_eo.c" diff --git a/src/lib/elementary/elm_atspi_app_object.eo b/src/lib/elementary/elm_atspi_app_object.eo deleted file mode 100644 index e386f390e0..0000000000 --- a/src/lib/elementary/elm_atspi_app_object.eo +++ /dev/null @@ -1,13 +0,0 @@ -class Elm.Atspi.App.Object extends Efl.Object implements 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.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_app_object.h b/src/lib/elementary/elm_atspi_app_object.h index 53042f86fc..e67e5524ff 100644 --- a/src/lib/elementary/elm_atspi_app_object.h +++ b/src/lib/elementary/elm_atspi_app_object.h @@ -1,6 +1,3 @@ -#ifdef EFL_EO_API_SUPPORT -#include "elm_atspi_app_object.eo.h" -#endif #ifndef EFL_NOLEGACY_API_SUPPORT -#include "elm_atspi_app_object.eo.legacy.h" +#include "elm_atspi_app_object_eo.legacy.h" #endif diff --git a/src/lib/elementary/elm_atspi_app_object_eo.c b/src/lib/elementary/elm_atspi_app_object_eo.c new file mode 100644 index 0000000000..2158c09038 --- /dev/null +++ b/src/lib/elementary/elm_atspi_app_object_eo.c @@ -0,0 +1,55 @@ + +void _elm_atspi_app_object_efl_object_destructor(Eo *obj, Elm_Atspi_App_Object_Data *pd); + + +const char *_elm_atspi_app_object_efl_access_object_i18n_name_get(const Eo *obj, Elm_Atspi_App_Object_Data *pd); + + +void _elm_atspi_app_object_efl_access_object_description_set(Eo *obj, Elm_Atspi_App_Object_Data *pd, const char *description); + + +const char *_elm_atspi_app_object_efl_access_object_description_get(const Eo *obj, Elm_Atspi_App_Object_Data *pd); + + +Efl_Access_Role _elm_atspi_app_object_efl_access_object_role_get(const Eo *obj, Elm_Atspi_App_Object_Data *pd); + + +Eina_List *_elm_atspi_app_object_efl_access_object_access_children_get(const Eo *obj, Elm_Atspi_App_Object_Data *pd); + + +static Eina_Bool +_elm_atspi_app_object_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_ATSPI_APP_OBJECT_EXTRA_OPS +#define ELM_ATSPI_APP_OBJECT_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_atspi_app_object_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_access_object_i18n_name_get, _elm_atspi_app_object_efl_access_object_i18n_name_get), + EFL_OBJECT_OP_FUNC(efl_access_object_description_set, _elm_atspi_app_object_efl_access_object_description_set), + EFL_OBJECT_OP_FUNC(efl_access_object_description_get, _elm_atspi_app_object_efl_access_object_description_get), + EFL_OBJECT_OP_FUNC(efl_access_object_role_get, _elm_atspi_app_object_efl_access_object_role_get), + EFL_OBJECT_OP_FUNC(efl_access_object_access_children_get, _elm_atspi_app_object_efl_access_object_access_children_get), + ELM_ATSPI_APP_OBJECT_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_atspi_app_object_class_desc = { + EO_VERSION, + "Elm.Atspi.App.Object", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Atspi_App_Object_Data), + _elm_atspi_app_object_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_atspi_app_object_class_get, &_elm_atspi_app_object_class_desc, EFL_OBJECT_CLASS, EFL_ACCESS_OBJECT_MIXIN, NULL); diff --git a/src/lib/elementary/elm_atspi_app_object_eo.h b/src/lib/elementary/elm_atspi_app_object_eo.h new file mode 100644 index 0000000000..0dff0ba000 --- /dev/null +++ b/src/lib/elementary/elm_atspi_app_object_eo.h @@ -0,0 +1,24 @@ +#ifndef _ELM_ATSPI_APP_OBJECT_EO_H_ +#define _ELM_ATSPI_APP_OBJECT_EO_H_ + +#ifndef _ELM_ATSPI_APP_OBJECT_EO_CLASS_TYPE +#define _ELM_ATSPI_APP_OBJECT_EO_CLASS_TYPE + +typedef Eo Elm_Atspi_App_Object; + +#endif + +#ifndef _ELM_ATSPI_APP_OBJECT_EO_TYPES +#define _ELM_ATSPI_APP_OBJECT_EO_TYPES + + +#endif +/** AT-SPI application object class + * + * @ingroup Elm_Atspi_App_Object + */ +#define ELM_ATSPI_APP_OBJECT_CLASS elm_atspi_app_object_class_get() + +EWAPI const Efl_Class *elm_atspi_app_object_class_get(void); + +#endif diff --git a/src/lib/elementary/elm_atspi_app_object_eo.legacy.h b/src/lib/elementary/elm_atspi_app_object_eo.legacy.h new file mode 100644 index 0000000000..993c31100f --- /dev/null +++ b/src/lib/elementary/elm_atspi_app_object_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_ATSPI_APP_OBJECT_EO_LEGACY_H_ +#define _ELM_ATSPI_APP_OBJECT_EO_LEGACY_H_ + +#ifndef _ELM_ATSPI_APP_OBJECT_EO_CLASS_TYPE +#define _ELM_ATSPI_APP_OBJECT_EO_CLASS_TYPE + +typedef Eo Elm_Atspi_App_Object; + +#endif + +#ifndef _ELM_ATSPI_APP_OBJECT_EO_TYPES +#define _ELM_ATSPI_APP_OBJECT_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_atspi_bridge.c b/src/lib/elementary/elm_atspi_bridge.c index cca6176dee..c689557d6c 100644 --- a/src/lib/elementary/elm_atspi_bridge.c +++ b/src/lib/elementary/elm_atspi_bridge.c @@ -10,7 +10,6 @@ #define EFL_ACCESS_TEXT_PROTECTED #define EFL_ACCESS_EDITABLE_TEXT_PROTECTED -#define EFL_ACCESS_ACTION_BETA #include "atspi/atspi-constants.h" @@ -68,7 +67,6 @@ typedef struct _Elm_Atspi_Bridge_Data { Eldbus_Connection *session_bus; Eldbus_Connection *a11y_bus; - Eina_List *reemited_events; Eina_Hash *cache; Eldbus_Service_Interface *cache_interface; Eldbus_Signal_Handler *register_hdl; @@ -166,7 +164,7 @@ static const Elm_Atspi_Bridge_Event_Handler event_handlers[] = { { EFL_ACCESS_WINDOW_EVENT_WINDOW_MAXIMIZED, _window_signal_send}, { EFL_ACCESS_WINDOW_EVENT_WINDOW_MINIMIZED, _window_signal_send}, { EFL_ACCESS_WINDOW_EVENT_WINDOW_RESTORED, _window_signal_send}, - { EFL_ACCESS_SELECTION_EVENT_SELECTION_CHANGED, _selection_signal_send}, + { EFL_ACCESS_SELECTION_EVENT_ACCESS_SELECTION_CHANGED, _selection_signal_send}, { EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, _text_caret_moved_send }, { EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_INSERTED, _text_text_inserted_send }, { EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_REMOVED, _text_text_removed_send }, @@ -399,71 +397,71 @@ struct atspi_state_desc }; static const struct atspi_state_desc elm_states_to_atspi_state[] = { - { EFL_ACCESS_STATE_INVALID, ATSPI_STATE_INVALID, "invalid" }, - { EFL_ACCESS_STATE_ACTIVE, ATSPI_STATE_ACTIVE, "active" }, - { EFL_ACCESS_STATE_ARMED, ATSPI_STATE_ARMED, "armed" }, - { EFL_ACCESS_STATE_BUSY, ATSPI_STATE_BUSY, "busy" }, - { EFL_ACCESS_STATE_CHECKED, ATSPI_STATE_CHECKED, "checked" }, - { EFL_ACCESS_STATE_COLLAPSED, ATSPI_STATE_COLLAPSED, "collapsed" }, - { EFL_ACCESS_STATE_DEFUNCT, ATSPI_STATE_DEFUNCT, "defunct" }, - { EFL_ACCESS_STATE_EDITABLE, ATSPI_STATE_EDITABLE, "editable" }, - { EFL_ACCESS_STATE_ENABLED, ATSPI_STATE_ENABLED, "enabled" }, - { EFL_ACCESS_STATE_EXPANDABLE, ATSPI_STATE_EXPANDABLE, "expandable" }, - { EFL_ACCESS_STATE_EXPANDED, ATSPI_STATE_EXPANDED, "expanded" }, - { EFL_ACCESS_STATE_FOCUSABLE, ATSPI_STATE_FOCUSABLE, "focusable" }, - { EFL_ACCESS_STATE_FOCUSED, ATSPI_STATE_FOCUSED, "focused" }, - { EFL_ACCESS_STATE_HAS_TOOLTIP, ATSPI_STATE_HAS_TOOLTIP, "has-tooltip" }, - { EFL_ACCESS_STATE_HORIZONTAL, ATSPI_STATE_HORIZONTAL, "horizontal" }, - { EFL_ACCESS_STATE_ICONIFIED, ATSPI_STATE_ICONIFIED, "iconified" }, - { EFL_ACCESS_STATE_MODAL, ATSPI_STATE_MODAL, "modal" }, - { EFL_ACCESS_STATE_MULTI_LINE, ATSPI_STATE_MULTI_LINE, "multi-line" }, - { EFL_ACCESS_STATE_MULTISELECTABLE, ATSPI_STATE_MULTISELECTABLE, "multiselectable" }, - { EFL_ACCESS_STATE_OPAQUE, ATSPI_STATE_OPAQUE, "opaque" }, - { EFL_ACCESS_STATE_PRESSED, ATSPI_STATE_PRESSED, "pressed" }, - { EFL_ACCESS_STATE_RESIZABLE, ATSPI_STATE_RESIZABLE, "resizable" }, - { EFL_ACCESS_STATE_SELECTABLE, ATSPI_STATE_SELECTABLE, "selectable" }, - { EFL_ACCESS_STATE_SELECTED, ATSPI_STATE_SELECTED, "selected" }, - { EFL_ACCESS_STATE_SENSITIVE, ATSPI_STATE_SENSITIVE, "sensitive" }, - { EFL_ACCESS_STATE_SHOWING, ATSPI_STATE_SHOWING, "showing" }, - { EFL_ACCESS_STATE_SINGLE_LINE, ATSPI_STATE_SINGLE_LINE, "single-line" }, - { EFL_ACCESS_STATE_STALE, ATSPI_STATE_STALE, "stale" }, - { EFL_ACCESS_STATE_TRANSIENT, ATSPI_STATE_TRANSIENT, "transient" }, - { EFL_ACCESS_STATE_VERTICAL, ATSPI_STATE_VERTICAL, "vertical" }, - { EFL_ACCESS_STATE_VISIBLE, ATSPI_STATE_VISIBLE, "visible" }, - { EFL_ACCESS_STATE_MANAGES_DESCENDANTS, ATSPI_STATE_MANAGES_DESCENDANTS, "manages-descendants" }, - { EFL_ACCESS_STATE_INDETERMINATE, ATSPI_STATE_INDETERMINATE, "indeterminate" }, - { EFL_ACCESS_STATE_REQUIRED, ATSPI_STATE_REQUIRED, "required" }, - { EFL_ACCESS_STATE_TRUNCATED, ATSPI_STATE_TRUNCATED, "truncated" }, - { EFL_ACCESS_STATE_ANIMATED, ATSPI_STATE_ANIMATED, "animated" }, - { EFL_ACCESS_STATE_INVALID_ENTRY, ATSPI_STATE_INVALID_ENTRY, "invalid-entry" }, - { EFL_ACCESS_STATE_SUPPORTS_AUTOCOMPLETION, ATSPI_STATE_SUPPORTS_AUTOCOMPLETION, "supports-autocompletion" }, - { EFL_ACCESS_STATE_SELECTABLE_TEXT, ATSPI_STATE_SELECTABLE_TEXT, "selectable-text" }, - { EFL_ACCESS_STATE_IS_DEFAULT, ATSPI_STATE_IS_DEFAULT, "is-default" }, - { EFL_ACCESS_STATE_VISITED, ATSPI_STATE_VISITED, "visited" }, - { EFL_ACCESS_STATE_LAST_DEFINED, ATSPI_STATE_LAST_DEFINED, "last-defined" }, + { EFL_ACCESS_STATE_TYPE_INVALID, ATSPI_STATE_INVALID, "invalid" }, + { EFL_ACCESS_STATE_TYPE_ACTIVE, ATSPI_STATE_ACTIVE, "active" }, + { EFL_ACCESS_STATE_TYPE_ARMED, ATSPI_STATE_ARMED, "armed" }, + { EFL_ACCESS_STATE_TYPE_BUSY, ATSPI_STATE_BUSY, "busy" }, + { EFL_ACCESS_STATE_TYPE_CHECKED, ATSPI_STATE_CHECKED, "checked" }, + { EFL_ACCESS_STATE_TYPE_COLLAPSED, ATSPI_STATE_COLLAPSED, "collapsed" }, + { EFL_ACCESS_STATE_TYPE_DEFUNCT, ATSPI_STATE_DEFUNCT, "defunct" }, + { EFL_ACCESS_STATE_TYPE_EDITABLE, ATSPI_STATE_EDITABLE, "editable" }, + { EFL_ACCESS_STATE_TYPE_ENABLED, ATSPI_STATE_ENABLED, "enabled" }, + { EFL_ACCESS_STATE_TYPE_EXPANDABLE, ATSPI_STATE_EXPANDABLE, "expandable" }, + { EFL_ACCESS_STATE_TYPE_EXPANDED, ATSPI_STATE_EXPANDED, "expanded" }, + { EFL_ACCESS_STATE_TYPE_FOCUSABLE, ATSPI_STATE_FOCUSABLE, "focusable" }, + { EFL_ACCESS_STATE_TYPE_FOCUSED, ATSPI_STATE_FOCUSED, "focused" }, + { EFL_ACCESS_STATE_TYPE_HAS_TOOLTIP, ATSPI_STATE_HAS_TOOLTIP, "has-tooltip" }, + { EFL_ACCESS_STATE_TYPE_HORIZONTAL, ATSPI_STATE_HORIZONTAL, "horizontal" }, + { EFL_ACCESS_STATE_TYPE_MINIMIZED, ATSPI_STATE_ICONIFIED, "minimized" }, + { EFL_ACCESS_STATE_TYPE_MODAL, ATSPI_STATE_MODAL, "modal" }, + { EFL_ACCESS_STATE_TYPE_MULTI_LINE, ATSPI_STATE_MULTI_LINE, "multi-line" }, + { EFL_ACCESS_STATE_TYPE_MULTISELECTABLE, ATSPI_STATE_MULTISELECTABLE, "multiselectable" }, + { EFL_ACCESS_STATE_TYPE_OPAQUE, ATSPI_STATE_OPAQUE, "opaque" }, + { EFL_ACCESS_STATE_TYPE_PRESSED, ATSPI_STATE_PRESSED, "pressed" }, + { EFL_ACCESS_STATE_TYPE_RESIZABLE, ATSPI_STATE_RESIZABLE, "resizable" }, + { EFL_ACCESS_STATE_TYPE_SELECTABLE, ATSPI_STATE_SELECTABLE, "selectable" }, + { EFL_ACCESS_STATE_TYPE_SELECTED, ATSPI_STATE_SELECTED, "selected" }, + { EFL_ACCESS_STATE_TYPE_SENSITIVE, ATSPI_STATE_SENSITIVE, "sensitive" }, + { EFL_ACCESS_STATE_TYPE_SHOWING, ATSPI_STATE_SHOWING, "showing" }, + { EFL_ACCESS_STATE_TYPE_SINGLE_LINE, ATSPI_STATE_SINGLE_LINE, "single-line" }, + { EFL_ACCESS_STATE_TYPE_STALE, ATSPI_STATE_STALE, "stale" }, + { EFL_ACCESS_STATE_TYPE_TRANSIENT, ATSPI_STATE_TRANSIENT, "transient" }, + { EFL_ACCESS_STATE_TYPE_VERTICAL, ATSPI_STATE_VERTICAL, "vertical" }, + { EFL_ACCESS_STATE_TYPE_VISIBLE, ATSPI_STATE_VISIBLE, "visible" }, + { EFL_ACCESS_STATE_TYPE_MANAGES_DESCENDANTS, ATSPI_STATE_MANAGES_DESCENDANTS, "manages-descendants" }, + { EFL_ACCESS_STATE_TYPE_INDETERMINATE, ATSPI_STATE_INDETERMINATE, "indeterminate" }, + { EFL_ACCESS_STATE_TYPE_REQUIRED, ATSPI_STATE_REQUIRED, "required" }, + { EFL_ACCESS_STATE_TYPE_TRUNCATED, ATSPI_STATE_TRUNCATED, "truncated" }, + { EFL_ACCESS_STATE_TYPE_ANIMATED, ATSPI_STATE_ANIMATED, "animated" }, + { EFL_ACCESS_STATE_TYPE_INVALID_ENTRY, ATSPI_STATE_INVALID_ENTRY, "invalid-entry" }, + { EFL_ACCESS_STATE_TYPE_SUPPORTS_AUTOCOMPLETION, ATSPI_STATE_SUPPORTS_AUTOCOMPLETION, "supports-autocompletion" }, + { EFL_ACCESS_STATE_TYPE_SELECTABLE_TEXT, ATSPI_STATE_SELECTABLE_TEXT, "selectable-text" }, + { EFL_ACCESS_STATE_TYPE_IS_DEFAULT, ATSPI_STATE_IS_DEFAULT, "is-default" }, + { EFL_ACCESS_STATE_TYPE_VISITED, ATSPI_STATE_VISITED, "visited" }, + { EFL_ACCESS_STATE_TYPE_LAST_DEFINED, ATSPI_STATE_LAST_DEFINED, "last-defined" }, }; static const int elm_relation_to_atspi_relation_mapping[] = { - [EFL_ACCESS_RELATION_NULL] = ATSPI_RELATION_NULL, - [EFL_ACCESS_RELATION_LABEL_FOR] = ATSPI_RELATION_LABEL_FOR, - [EFL_ACCESS_RELATION_LABELLED_BY] = ATSPI_RELATION_LABELLED_BY, - [EFL_ACCESS_RELATION_CONTROLLER_FOR] = ATSPI_RELATION_CONTROLLER_FOR, - [EFL_ACCESS_RELATION_CONTROLLED_BY] = ATSPI_RELATION_CONTROLLED_BY, - [EFL_ACCESS_RELATION_MEMBER_OF] = ATSPI_RELATION_MEMBER_OF, - [EFL_ACCESS_RELATION_TOOLTIP_FOR] = ATSPI_RELATION_TOOLTIP_FOR, - [EFL_ACCESS_RELATION_NODE_CHILD_OF] = ATSPI_RELATION_NODE_CHILD_OF, - [EFL_ACCESS_RELATION_NODE_PARENT_OF] = ATSPI_RELATION_NODE_PARENT_OF, - [EFL_ACCESS_RELATION_EXTENDED] = ATSPI_RELATION_EXTENDED, - [EFL_ACCESS_RELATION_FLOWS_TO] = ATSPI_RELATION_FLOWS_TO, - [EFL_ACCESS_RELATION_FLOWS_FROM] = ATSPI_RELATION_FLOWS_FROM, - [EFL_ACCESS_RELATION_SUBWINDOW_OF] = ATSPI_RELATION_SUBWINDOW_OF, - [EFL_ACCESS_RELATION_EMBEDS] = ATSPI_RELATION_EMBEDS, - [EFL_ACCESS_RELATION_EMBEDDED_BY] = ATSPI_RELATION_EMBEDDED_BY, - [EFL_ACCESS_RELATION_POPUP_FOR] = ATSPI_RELATION_POPUP_FOR, - [EFL_ACCESS_RELATION_PARENT_WINDOW_OF] = ATSPI_RELATION_PARENT_WINDOW_OF, - [EFL_ACCESS_RELATION_DESCRIPTION_FOR] = ATSPI_RELATION_DESCRIPTION_FOR, - [EFL_ACCESS_RELATION_DESCRIBED_BY] = ATSPI_RELATION_DESCRIBED_BY, - [EFL_ACCESS_RELATION_LAST_DEFINED] = ATSPI_RELATION_LAST_DEFINED, + [EFL_ACCESS_RELATION_TYPE_NULL] = ATSPI_RELATION_NULL, + [EFL_ACCESS_RELATION_TYPE_LABEL_FOR] = ATSPI_RELATION_LABEL_FOR, + [EFL_ACCESS_RELATION_TYPE_LABELLED_BY] = ATSPI_RELATION_LABELLED_BY, + [EFL_ACCESS_RELATION_TYPE_CONTROLLER_FOR] = ATSPI_RELATION_CONTROLLER_FOR, + [EFL_ACCESS_RELATION_TYPE_CONTROLLED_BY] = ATSPI_RELATION_CONTROLLED_BY, + [EFL_ACCESS_RELATION_TYPE_MEMBER_OF] = ATSPI_RELATION_MEMBER_OF, + [EFL_ACCESS_RELATION_TYPE_TOOLTIP_FOR] = ATSPI_RELATION_TOOLTIP_FOR, + [EFL_ACCESS_RELATION_TYPE_NODE_CHILD_OF] = ATSPI_RELATION_NODE_CHILD_OF, + [EFL_ACCESS_RELATION_TYPE_NODE_PARENT_OF] = ATSPI_RELATION_NODE_PARENT_OF, + [EFL_ACCESS_RELATION_TYPE_EXTENDED] = ATSPI_RELATION_EXTENDED, + [EFL_ACCESS_RELATION_TYPE_FLOWS_TO] = ATSPI_RELATION_FLOWS_TO, + [EFL_ACCESS_RELATION_TYPE_FLOWS_FROM] = ATSPI_RELATION_FLOWS_FROM, + [EFL_ACCESS_RELATION_TYPE_SUBWINDOW_OF] = ATSPI_RELATION_SUBWINDOW_OF, + [EFL_ACCESS_RELATION_TYPE_EMBEDS] = ATSPI_RELATION_EMBEDS, + [EFL_ACCESS_RELATION_TYPE_EMBEDDED_BY] = ATSPI_RELATION_EMBEDDED_BY, + [EFL_ACCESS_RELATION_TYPE_POPUP_FOR] = ATSPI_RELATION_POPUP_FOR, + [EFL_ACCESS_RELATION_TYPE_PARENT_WINDOW_OF] = ATSPI_RELATION_PARENT_WINDOW_OF, + [EFL_ACCESS_RELATION_TYPE_DESCRIPTION_FOR] = ATSPI_RELATION_DESCRIPTION_FOR, + [EFL_ACCESS_RELATION_TYPE_DESCRIBED_BY] = ATSPI_RELATION_DESCRIBED_BY, + [EFL_ACCESS_RELATION_TYPE_LAST_DEFINED] = ATSPI_RELATION_LAST_DEFINED, }; static inline Eldbus_Message *_dbus_invalid_ref_error_new(const Eldbus_Message *msg) @@ -473,7 +471,7 @@ static inline Eldbus_Message *_dbus_invalid_ref_error_new(const Eldbus_Message * static AtspiRelationType _elm_relation_to_atspi_relation(Efl_Access_Relation_Type type) { - if ((type < EFL_ACCESS_RELATION_LAST_DEFINED) && (type > EFL_ACCESS_RELATION_NULL)) + if ((type < EFL_ACCESS_RELATION_TYPE_LAST_DEFINED) && (type > EFL_ACCESS_RELATION_TYPE_NULL)) return elm_relation_to_atspi_relation_mapping[type]; return ATSPI_RELATION_NULL; } @@ -588,7 +586,7 @@ _accessible_get_application(const Eldbus_Service_Interface *iface, const Eldbus_ EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL); Eldbus_Message_Iter *iter = eldbus_message_iter_get(ret); - root = efl_access_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN); + root = efl_access_object_access_root_get(); _bridge_iter_object_reference_append(bridge, iter, root); return ret; @@ -1755,8 +1753,7 @@ _text_bounded_ranges_get(const Eldbus_Service_Interface *iface, const Eldbus_Mes { eldbus_message_iter_basic_append(iter_struct, 'i', range->start_offset); eldbus_message_iter_basic_append(iter_struct, 'i', range->end_offset); - range->content = range->content ? range->content : strdup(""); - eldbus_message_iter_basic_append(iter_struct, 's', range->content); + eldbus_message_iter_basic_append(iter_struct, 's', range->content ? range->content : ""); /* AT-SPI specification requires variant type in return, however * ATK or other implementations as well as AT Clients don't use it . * To cover spec a dummy value will be returned */ @@ -1768,8 +1765,7 @@ _text_bounded_ranges_get(const Eldbus_Service_Interface *iface, const Eldbus_Mes } eldbus_message_iter_container_close(iter_array, iter_struct); } - if (range->content) free(range->content); - free(range); + elm_atspi_text_text_range_free(range); } eldbus_message_iter_container_close(iter, iter_array); @@ -2028,7 +2024,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_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN); + root = efl_access_object_access_root_get(); return root; } @@ -2055,7 +2051,7 @@ _path_from_object(const Eo *eo) if (!eo) return ATSPI_DBUS_PATH_NULL; - root = efl_access_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN); + root = efl_access_object_access_root_get(); if (eo == root) snprintf(path, sizeof(path), "%s%s", ELM_ACCESS_OBJECT_PATH_PREFIX, ELM_ACCESS_OBJECT_PATH_ROOT); @@ -3203,7 +3199,7 @@ _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_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN); + root = efl_access_object_access_root_get(); role = efl_access_object_role_get(data); @@ -3300,7 +3296,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_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN); + root = efl_access_object_access_root_get(); to_process = eina_list_append(NULL, root); while (to_process) @@ -3705,7 +3701,7 @@ _elm_atspi_bridge_app_register(Eo *bridge) "Embed"); Eldbus_Message_Iter *iter = eldbus_message_iter_get(message); - root = efl_access_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN); + root = efl_access_object_access_root_get(); _bridge_iter_object_reference_append(bridge, iter, root); eldbus_connection_send(pd->a11y_bus, message, _on_elm_atspi_bridge_app_register, NULL, -1); @@ -3718,7 +3714,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_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN); + root = efl_access_object_access_root_get(); Eldbus_Message *message = eldbus_message_method_call_new(ATSPI_DBUS_NAME_REGISTRY, ATSPI_DBUS_PATH_ROOT, @@ -3899,7 +3895,7 @@ _state_changed_signal_send(void *data, const Efl_Event *event) return; } - if ((state_data->type > EFL_ACCESS_STATE_LAST_DEFINED) || + if ((state_data->type > EFL_ACCESS_STATE_TYPE_LAST_DEFINED) || (int)state_data->type < 0) { efl_event_callback_stop(event->object); @@ -4118,7 +4114,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_object_access_root_get(EFL_ACCESS_OBJECT_MIXIN); + root = efl_access_object_access_root_get(); msg = eldbus_message_signal_new(path, infc, signal->name); if (!msg) return; @@ -4368,7 +4364,7 @@ _a11y_connection_shutdown(Eo *bridge) if (pd->event_hash) eina_hash_free(pd->event_hash); pd->event_hash = NULL; - efl_access_object_event_handler_del(EFL_ACCESS_OBJECT_MIXIN, pd->event_hdlr); + efl_access_object_event_handler_del(pd->event_hdlr); pd->event_hdlr = NULL; efl_event_callback_legacy_call(bridge, ELM_ATSPI_BRIDGE_EVENT_DISCONNECTED, NULL); @@ -4460,7 +4456,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_object_event_handler_add(EFL_ACCESS_OBJECT_MIXIN, _bridge_accessible_event_dispatch, obj); + pd->event_hdlr = efl_access_object_event_handler_add(_bridge_accessible_event_dispatch, obj); } static void @@ -4655,73 +4651,66 @@ _iter_marshall_key_event(Eldbus_Message_Iter *iter, Key_Event_Info *data) eldbus_message_iter_container_close(iter, struct_iter); } -static void -_on_event_del(void *user_data, void *func_data EINA_UNUSED) -{ - Key_Event_Info *info = user_data; - _key_event_info_free(info); -} - -static void -_on_listener_answer(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) -{ - Key_Event_Info *info = data; - const char *errname, *errmsg; - Eina_Bool ret = EINA_TRUE; - - ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(info->bridge, pd); - - if (eldbus_message_error_get(msg, &errname, &errmsg)) - { - ERR("%s %s", errname, errmsg); - goto reemit; - } - if (!eldbus_message_arguments_get(msg, "b", &ret)) - { - ERR("Return message does not contain return value"); - goto reemit; - } - if (ret) - { - _key_event_info_free(info); - return; - } -reemit: - ecore_event_add(info->type, &info->event, _on_event_del, info); - pd->reemited_events = eina_list_append(pd->reemited_events, &info->event); -} - static Eina_Bool _elm_atspi_bridge_key_filter(void *data, void *loop EINA_UNUSED, int type, void *event) { - Eldbus_Message *msg; - Eldbus_Message_Iter *iter; Ecore_Event_Key *key_event = event; Key_Event_Info *ke; + Eldbus_Object *dobj; + Eldbus_Proxy *proxy; + Eldbus_Message *req; + Eldbus_Message_Iter *iter; + Eldbus_Message *reply; + Eina_Bool ret = EINA_TRUE; + const char *errname = NULL, *errmsg = NULL; Eo *bridge = data; ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN_VAL(bridge, pd, EINA_TRUE); if ((type != ECORE_EVENT_KEY_DOWN) && (type != ECORE_EVENT_KEY_UP)) return EINA_TRUE; - // check if reemited - if (eina_list_data_find(pd->reemited_events, event)) + if (!(dobj = eldbus_object_get(pd->a11y_bus, ATSPI_DBUS_NAME_REGISTRY, ATSPI_DBUS_PATH_DEC))) { - pd->reemited_events = eina_list_remove(pd->reemited_events, event); + ERR("Failed to create eldbus object for: " ATSPI_DBUS_PATH_DEC); + return EINA_TRUE; + } + + if (!(proxy = eldbus_proxy_get(dobj, ATSPI_DBUS_INTERFACE_DEC))) + { + ERR("Failed to create proxy object for: " ATSPI_DBUS_INTERFACE_DEC); + return EINA_TRUE; + } + + if (!(req = eldbus_proxy_method_call_new(proxy, "NotifyListenersSync"))) + { + ERR("Failed to create method call on: " ATSPI_DBUS_INTERFACE_DEC "." "NotifyListenersSync"); return EINA_TRUE; } ke = _key_event_info_new(type, key_event, bridge); if (!ke) return EINA_TRUE; - msg = eldbus_message_method_call_new(ATSPI_DBUS_NAME_REGISTRY, ATSPI_DBUS_PATH_DEC, - ATSPI_DBUS_INTERFACE_DEC, "NotifyListenersSync"); - iter = eldbus_message_iter_get(msg); + iter = eldbus_message_iter_get(req); _iter_marshall_key_event(iter, ke); + _key_event_info_free(ke); // timeout should be kept reasonably low to avoid delays - if (!eldbus_connection_send(pd->a11y_bus, msg, _on_listener_answer, ke, 100)) - return EINA_TRUE; + if (!(reply = eldbus_proxy_send_and_block(proxy, req, 100))) + { + ERR("Unable to call method " ATSPI_DBUS_INTERFACE_DEC "." "NotifyListenersSync"); + return EINA_TRUE; + } + + if (eldbus_message_error_get(reply, &errname, &errmsg)) + ERR("Error in call method " ATSPI_DBUS_INTERFACE_DEC "." "NotifyListenersSync" ": %s %s", errname, errmsg); + else + if (!eldbus_message_arguments_get(reply, "b", &ret)) + ERR("Invalid answer signature"); + + eldbus_message_unref(reply); + + if (ret) + return EINA_FALSE; return EINA_FALSE; } @@ -4812,4 +4801,4 @@ _elm_atspi_bridge_efl_object_destructor(Eo *obj, Elm_Atspi_Bridge_Data *pd) efl_destructor(efl_super(obj, ELM_ATSPI_BRIDGE_CLASS)); } -#include "elm_atspi_bridge.eo.c" +#include "elm_atspi_bridge_eo.c" diff --git a/src/lib/elementary/elm_atspi_bridge.eo b/src/lib/elementary/elm_atspi_bridge.eo deleted file mode 100644 index 4034ef65d1..0000000000 --- a/src/lib/elementary/elm_atspi_bridge.eo +++ /dev/null @@ -1,25 +0,0 @@ -class Elm.Atspi.Bridge extends Efl.Object -{ - [[AT-SPI bridge class]] - legacy_prefix: elm_atspi_bridge; - eo_prefix: elm_obj_atspi_bridge; - event_prefix: elm_atspi_bridge; - methods { - @property connected { - get { - [[Indicate if connection with AT-SPI2 bus has been established.]] - values { - ret: bool; [[$true if connection has been established, $false otherwise]] - } - } - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - } - events { - connected: void; [[Connected with AT-SPI2 bus]] - disconnected: void; [[Disconnected from AT-SPI2 bus]] - } -} diff --git a/src/lib/elementary/elm_atspi_bridge.h b/src/lib/elementary/elm_atspi_bridge.h index 8827096b6d..c889027b58 100644 --- a/src/lib/elementary/elm_atspi_bridge.h +++ b/src/lib/elementary/elm_atspi_bridge.h @@ -1,8 +1,4 @@ -#ifdef EFL_BETA_API_SUPPORT -#ifdef EFL_EO_API_SUPPORT -#include "elm_atspi_bridge.eo.h" -#endif #ifndef EFL_NOLEGACY_API_SUPPORT -#include "elm_atspi_bridge.eo.legacy.h" -#endif +#include "elm_atspi_bridge_eo.legacy.h" #endif + diff --git a/src/lib/elementary/elm_atspi_bridge_eo.c b/src/lib/elementary/elm_atspi_bridge_eo.c new file mode 100644 index 0000000000..aa883454cd --- /dev/null +++ b/src/lib/elementary/elm_atspi_bridge_eo.c @@ -0,0 +1,66 @@ +EWAPI const Efl_Event_Description _ELM_ATSPI_BRIDGE_EVENT_CONNECTED = + EFL_EVENT_DESCRIPTION("connected"); +EWAPI const Efl_Event_Description _ELM_ATSPI_BRIDGE_EVENT_DISCONNECTED = + EFL_EVENT_DESCRIPTION("disconnected"); + +Eina_Bool _elm_atspi_bridge_connected_get(const Eo *obj, Elm_Atspi_Bridge_Data *pd); + + +static Eina_Value +__eolian_elm_atspi_bridge_connected_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_atspi_bridge_connected_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_atspi_bridge_connected_get, Eina_Bool, 0); + +Efl_Object *_elm_atspi_bridge_efl_object_constructor(Eo *obj, Elm_Atspi_Bridge_Data *pd); + + +void _elm_atspi_bridge_efl_object_destructor(Eo *obj, Elm_Atspi_Bridge_Data *pd); + + +static Eina_Bool +_elm_atspi_bridge_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_ATSPI_BRIDGE_EXTRA_OPS +#define ELM_ATSPI_BRIDGE_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_atspi_bridge_connected_get, _elm_atspi_bridge_connected_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_atspi_bridge_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_atspi_bridge_efl_object_destructor), + ELM_ATSPI_BRIDGE_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"connected", NULL, __eolian_elm_atspi_bridge_connected_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_atspi_bridge_class_desc = { + EO_VERSION, + "Elm.Atspi.Bridge", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Atspi_Bridge_Data), + _elm_atspi_bridge_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_atspi_bridge_class_get, &_elm_atspi_bridge_class_desc, EFL_OBJECT_CLASS, NULL); + +#include "elm_atspi_bridge_eo.legacy.c" diff --git a/src/lib/elementary/elm_atspi_bridge_eo.h b/src/lib/elementary/elm_atspi_bridge_eo.h new file mode 100644 index 0000000000..180544d25c --- /dev/null +++ b/src/lib/elementary/elm_atspi_bridge_eo.h @@ -0,0 +1,51 @@ +#ifndef _ELM_ATSPI_BRIDGE_EO_H_ +#define _ELM_ATSPI_BRIDGE_EO_H_ + +#ifndef _ELM_ATSPI_BRIDGE_EO_CLASS_TYPE +#define _ELM_ATSPI_BRIDGE_EO_CLASS_TYPE + +typedef Eo Elm_Atspi_Bridge; + +#endif + +#ifndef _ELM_ATSPI_BRIDGE_EO_TYPES +#define _ELM_ATSPI_BRIDGE_EO_TYPES + + +#endif +/** AT-SPI bridge class + * + * @ingroup Elm_Atspi_Bridge + */ +#define ELM_ATSPI_BRIDGE_CLASS elm_atspi_bridge_class_get() + +EWAPI const Efl_Class *elm_atspi_bridge_class_get(void); + +/** + * @brief Indicate if connection with AT-SPI2 bus has been established. + * + * @param[in] obj The object. + * + * @return @c true if connection has been established, @c false otherwise + * + * @ingroup Elm_Atspi_Bridge + */ +EOAPI Eina_Bool elm_obj_atspi_bridge_connected_get(const Eo *obj); + +EWAPI extern const Efl_Event_Description _ELM_ATSPI_BRIDGE_EVENT_CONNECTED; + +/** Connected with AT-SPI2 bus + * + * @ingroup Elm_Atspi_Bridge + */ +#define ELM_ATSPI_BRIDGE_EVENT_CONNECTED (&(_ELM_ATSPI_BRIDGE_EVENT_CONNECTED)) + +EWAPI extern const Efl_Event_Description _ELM_ATSPI_BRIDGE_EVENT_DISCONNECTED; + +/** Disconnected from AT-SPI2 bus + * + * @ingroup Elm_Atspi_Bridge + */ +#define ELM_ATSPI_BRIDGE_EVENT_DISCONNECTED (&(_ELM_ATSPI_BRIDGE_EVENT_DISCONNECTED)) + +#endif diff --git a/src/lib/elementary/elm_atspi_bridge_eo.legacy.c b/src/lib/elementary/elm_atspi_bridge_eo.legacy.c new file mode 100644 index 0000000000..8f6ffebcc8 --- /dev/null +++ b/src/lib/elementary/elm_atspi_bridge_eo.legacy.c @@ -0,0 +1,6 @@ + +EAPI Eina_Bool +elm_atspi_bridge_connected_get(const Elm_Atspi_Bridge *obj) +{ + return elm_obj_atspi_bridge_connected_get(obj); +} diff --git a/src/lib/elementary/elm_atspi_bridge_eo.legacy.h b/src/lib/elementary/elm_atspi_bridge_eo.legacy.h new file mode 100644 index 0000000000..ed90721eb6 --- /dev/null +++ b/src/lib/elementary/elm_atspi_bridge_eo.legacy.h @@ -0,0 +1,28 @@ +#ifndef _ELM_ATSPI_BRIDGE_EO_LEGACY_H_ +#define _ELM_ATSPI_BRIDGE_EO_LEGACY_H_ + +#ifndef _ELM_ATSPI_BRIDGE_EO_CLASS_TYPE +#define _ELM_ATSPI_BRIDGE_EO_CLASS_TYPE + +typedef Eo Elm_Atspi_Bridge; + +#endif + +#ifndef _ELM_ATSPI_BRIDGE_EO_TYPES +#define _ELM_ATSPI_BRIDGE_EO_TYPES + + +#endif + +/** + * @brief Indicate if connection with AT-SPI2 bus has been established. + * + * @param[in] obj The object. + * + * @return @c true if connection has been established, @c false otherwise + * + * @ingroup Elm_Atspi_Bridge_Group + */ +EAPI Eina_Bool elm_atspi_bridge_connected_get(const Elm_Atspi_Bridge *obj); + +#endif diff --git a/src/lib/elementary/elm_bg_eo.h b/src/lib/elementary/elm_bg_eo.h deleted file mode 100644 index 3978bc1876..0000000000 --- a/src/lib/elementary/elm_bg_eo.h +++ /dev/null @@ -1 +0,0 @@ -#include "elm_bg.eo.h" \ No newline at end of file diff --git a/src/lib/elementary/elm_bg_legacy.h b/src/lib/elementary/elm_bg_legacy.h index ee50dd9d6b..54f6b6aaf1 100644 --- a/src/lib/elementary/elm_bg_legacy.h +++ b/src/lib/elementary/elm_bg_legacy.h @@ -165,4 +165,4 @@ EAPI Elm_Bg_Option elm_bg_option_get(const Evas_Object *obj); */ EAPI void elm_bg_load_size_set(Evas_Object *obj, int w, int h); -#include "efl_ui_bg.eo.legacy.h" +#include "efl_ui_bg_eo.legacy.h" diff --git a/src/lib/elementary/elm_box.c b/src/lib/elementary/elm_box.c index 71af0b5612..68e5996c78 100644 --- a/src/lib/elementary/elm_box.c +++ b/src/lib/elementary/elm_box.c @@ -6,7 +6,7 @@ #define EFL_UI_FOCUS_COMPOSITION_PROTECTED #include -#include +#include #include "elm_priv.h" #include "els_box.h" #include "elm_widget_box.h" @@ -57,15 +57,15 @@ _child_removed_cb_proxy(void *data, const Efl_Event *event) efl_event_callback_legacy_call(box, ELM_BOX_EVENT_CHILD_REMOVED, child); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_box_efl_ui_widget_theme_apply(Eo *obj, Elm_Box_Data *sd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); evas_object_smart_calculate(wd->resize_obj); return int_ret; @@ -323,7 +323,6 @@ _elm_box_efl_canvas_group_group_add(Eo *obj, Elm_Box_Data *_pd EINA_UNUSED) _on_size_hints_changed, obj); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); efl_event_callback_add (wd->resize_obj, ELM_BOX_EVENT_CHILD_ADDED, _child_added_cb_proxy, obj); @@ -666,4 +665,4 @@ _elm_box_class_constructor(Efl_Class *klass) #define ELM_BOX_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_box) -#include "elm_box.eo.c" +#include "elm_box_eo.c" diff --git a/src/lib/elementary/elm_box.eo b/src/lib/elementary/elm_box.eo deleted file mode 100644 index 5bda1dc249..0000000000 --- a/src/lib/elementary/elm_box.eo +++ /dev/null @@ -1,258 +0,0 @@ -class Elm.Box extends Efl.Ui.Widget implements Efl.Ui.Focus.Composition, Efl.Ui.Legacy -{ - [[Elementary box class]] - legacy_prefix: elm_box; - eo_prefix: elm_obj_box; - event_prefix: elm_box; - methods { - @property homogeneous { - set { - [[Set the box to arrange its children homogeneously - - If enabled, homogeneous layout makes all items the same size, according - to the size of the largest of its children. - - Note: This flag is ignored if a custom layout function is set. - - ]] - } - get { - [[Get whether the box is using homogeneous mode or not ($true if - it's homogeneous, $false otherwise)]] - } - values { - homogeneous: bool; [[The homogeneous flag]] - } - } - @property align { - set { - [[Set the alignment of the whole bounding box of contents. - - Sets how the bounding box containing all the elements of the box, after - their sizes and position has been calculated, will be aligned within - the space given for the whole box widget. - - ]] - } - get { - [[Get the alignment of the whole bounding box of contents. - - See also @.align.set. - - ]] - } - values { - horizontal: double; [[The horizontal alignment of elements]] - vertical: double; [[The vertical alignment of elements]] - } - } - @property horizontal { - set { - [[Set the horizontal orientation - - By default, box object arranges their contents vertically from top to - bottom. - By calling this function with $horizontal as $true, the box will - become horizontal, arranging contents from left to right. - - Note: This flag is ignored if a custom layout function is set. - - ]] - } - get { - [[Get the horizontal orientation ($true if the box is set to - horizontal mode, $false otherwise)]] - } - values { - horizontal: bool; [[The horizontal flag]] - } - } - @property padding { - set { - [[Set the space (padding) between the box's elements. - - Extra space in pixels that will be added between a box child and its - neighbors after its containing cell has been calculated. This padding - is set for all elements in the box, besides any possible padding that - individual elements may have through their size hints. - - ]] - } - get { - [[Get the space (padding) between the box's elements. - - See also @.padding.set. - - ]] - } - values { - horizontal: int; [[The horizontal space between elements]] - vertical: int; [[The vertical space between elements]] - } - } - @property children { - get { - [[Get a list of the objects packed into the box - - Returns a new $list with a pointer to $Evas_Object in its nodes. - The order of the list corresponds to the packing order the box uses. - - You must free this list with eina_list_free() once you are done with it. - - ]] - return: list @owned @warn_unused; [[List of children]] - } - } - pack_end { - [[Add an object at the end of the pack list - - Pack $subobj into the box $obj, placing it last in the list of - children objects. The actual position the object will get on screen - depends on the layout used. If no custom layout is set, it will be at - the bottom or right, depending if the box is vertical or horizontal, - respectively. - - See also @.pack_start, - @.pack_before, - @.pack_after, - @.unpack, - @.unpack_all, - @.clear. - ]] - - params { - @in subobj: Efl.Canvas.Object; [[The object to add to the box]] - } - } - unpack_all { - [[Remove all items from the box, without deleting them - - Clear the box from all children, but don't delete the respective objects. - If no other references of the box children exist, the objects will never - be deleted, and thus the application will leak the memory. Make sure - when using this function that you hold a reference to all the objects - in the box $obj. - - See also @.clear, - @.unpack. - ]] - } - unpack { - [[Unpack a box item - - Remove the object given by $subobj from the box $obj without - deleting it. - - See also @.unpack_all, - @.clear. - - ]] - - params { - @in subobj: Efl.Canvas.Object; [[The object to unpack]] - } - } - pack_after { - [[Adds an object to the box after the indicated object - - This will add the $subobj to the box indicated after the object - indicated with $after. If $after is not already in the box, results - are undefined. After means either to the right of the indicated object or - below it depending on orientation. - - See also @.pack_start, - @.pack_end, - @.pack_before, - @.unpack, - @.unpack_all, - @.clear. - - ]] - - params { - @in subobj: Efl.Canvas.Object; [[The object to add to the box]] - @in after: Efl.Canvas.Object; [[The object after which to add it]] - } - } - pack_start { - [[Add an object to the beginning of the pack list - - Pack $subobj into the box $obj, placing it first in the list of - children objects. The actual position the object will get on screen - depends on the layout used. If no custom layout is set, it will be at - the top or left, depending if the box is vertical or horizontal, - respectively. - - See also @.pack_end, - @.pack_before, - @.pack_after, - @.unpack, - @.unpack_all, - @.clear. - - ]] - - params { - @in subobj: Efl.Canvas.Object; [[The object to add to the box]] - } - } - recalculate { - [[Force the box to recalculate its children packing. - - If any children was added or removed, box will not calculate the - values immediately rather leaving it to the next main loop - iteration. While this is great as it would save lots of - recalculation, whenever you need to get the position of a just - added item you must force recalculate before doing so. - - ]] - - } - pack_before { - [[Adds an object to the box before the indicated object - - This will add the $subobj to the box indicated before the object - indicated with $before. If $before is not already in the box, results - are undefined. Before means either to the left of the indicated object or - above it depending on orientation. - - See also @.pack_start, - @.pack_end, - @.pack_after, - @.unpack, - @.unpack_all, - @.clear. - - ]] - - params { - @in subobj: Efl.Canvas.Object; [[The object to add to the box]] - @in before: Efl.Canvas.Object; [[The object before which to add it]] - } - } - clear { - [[Clear the box of all children - - Remove all the elements contained by the box, deleting the respective - objects. - - See also @.unpack, - @.unpack_all. - - ]] - - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Canvas.Group.group_calculate; - Efl.Ui.Widget.theme_apply; - Efl.Ui.Widget.widget_sub_object_del; - Efl.Ui.Focus.Composition.prepare; - } - events { - 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_box_eo.c b/src/lib/elementary/elm_box_eo.c new file mode 100644 index 0000000000..397d7f49a7 --- /dev/null +++ b/src/lib/elementary/elm_box_eo.c @@ -0,0 +1,199 @@ +EWAPI const Efl_Event_Description _ELM_BOX_EVENT_CHILD_ADDED = + EFL_EVENT_DESCRIPTION("child,added"); +EWAPI const Efl_Event_Description _ELM_BOX_EVENT_CHILD_REMOVED = + EFL_EVENT_DESCRIPTION("child,removed"); + +void _elm_box_homogeneous_set(Eo *obj, Elm_Box_Data *pd, Eina_Bool homogeneous); + + +static Eina_Error +__eolian_elm_box_homogeneous_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_box_homogeneous_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_box_homogeneous_set, EFL_FUNC_CALL(homogeneous), Eina_Bool homogeneous); + +Eina_Bool _elm_box_homogeneous_get(const Eo *obj, Elm_Box_Data *pd); + + +static Eina_Value +__eolian_elm_box_homogeneous_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_box_homogeneous_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_box_homogeneous_get, Eina_Bool, 0); + +void _elm_box_align_set(Eo *obj, Elm_Box_Data *pd, double horizontal, double vertical); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_box_align_set, EFL_FUNC_CALL(horizontal, vertical), double horizontal, double vertical); + +void _elm_box_align_get(const Eo *obj, Elm_Box_Data *pd, double *horizontal, double *vertical); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_box_align_get, EFL_FUNC_CALL(horizontal, vertical), double *horizontal, double *vertical); + +void _elm_box_horizontal_set(Eo *obj, Elm_Box_Data *pd, Eina_Bool horizontal); + + +static Eina_Error +__eolian_elm_box_horizontal_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_box_horizontal_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_box_horizontal_set, EFL_FUNC_CALL(horizontal), Eina_Bool horizontal); + +Eina_Bool _elm_box_horizontal_get(const Eo *obj, Elm_Box_Data *pd); + + +static Eina_Value +__eolian_elm_box_horizontal_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_box_horizontal_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_box_horizontal_get, Eina_Bool, 0); + +void _elm_box_padding_set(Eo *obj, Elm_Box_Data *pd, int horizontal, int vertical); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_box_padding_set, EFL_FUNC_CALL(horizontal, vertical), int horizontal, int vertical); + +void _elm_box_padding_get(const Eo *obj, Elm_Box_Data *pd, int *horizontal, int *vertical); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_box_padding_get, EFL_FUNC_CALL(horizontal, vertical), int *horizontal, int *vertical); + +Eina_List *_elm_box_children_get(const Eo *obj, Elm_Box_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_box_children_get, Eina_List *, NULL); + +void _elm_box_pack_end(Eo *obj, Elm_Box_Data *pd, Efl_Canvas_Object *subobj); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_box_pack_end, EFL_FUNC_CALL(subobj), Efl_Canvas_Object *subobj); + +void _elm_box_unpack_all(Eo *obj, Elm_Box_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_box_unpack_all); + +void _elm_box_unpack(Eo *obj, Elm_Box_Data *pd, Efl_Canvas_Object *subobj); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_box_unpack, EFL_FUNC_CALL(subobj), Efl_Canvas_Object *subobj); + +void _elm_box_pack_after(Eo *obj, Elm_Box_Data *pd, Efl_Canvas_Object *subobj, Efl_Canvas_Object *after); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_box_pack_after, EFL_FUNC_CALL(subobj, after), Efl_Canvas_Object *subobj, Efl_Canvas_Object *after); + +void _elm_box_pack_start(Eo *obj, Elm_Box_Data *pd, Efl_Canvas_Object *subobj); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_box_pack_start, EFL_FUNC_CALL(subobj), Efl_Canvas_Object *subobj); + +void _elm_box_recalculate(Eo *obj, Elm_Box_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_box_recalculate); + +void _elm_box_pack_before(Eo *obj, Elm_Box_Data *pd, Efl_Canvas_Object *subobj, Efl_Canvas_Object *before); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_box_pack_before, EFL_FUNC_CALL(subobj, before), Efl_Canvas_Object *subobj, Efl_Canvas_Object *before); + +void _elm_box_clear(Eo *obj, Elm_Box_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_box_clear); + +Efl_Object *_elm_box_efl_object_constructor(Eo *obj, Elm_Box_Data *pd); + + +void _elm_box_efl_canvas_group_group_calculate(Eo *obj, Elm_Box_Data *pd); + + +Eina_Error _elm_box_efl_ui_widget_theme_apply(Eo *obj, Elm_Box_Data *pd); + + +Eina_Bool _elm_box_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Box_Data *pd, Efl_Canvas_Object *sub_obj); + + +void _elm_box_efl_ui_focus_composition_prepare(Eo *obj, Elm_Box_Data *pd); + + +static Eina_Bool +_elm_box_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_BOX_EXTRA_OPS +#define ELM_BOX_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_box_homogeneous_set, _elm_box_homogeneous_set), + EFL_OBJECT_OP_FUNC(elm_obj_box_homogeneous_get, _elm_box_homogeneous_get), + EFL_OBJECT_OP_FUNC(elm_obj_box_align_set, _elm_box_align_set), + EFL_OBJECT_OP_FUNC(elm_obj_box_align_get, _elm_box_align_get), + EFL_OBJECT_OP_FUNC(elm_obj_box_horizontal_set, _elm_box_horizontal_set), + EFL_OBJECT_OP_FUNC(elm_obj_box_horizontal_get, _elm_box_horizontal_get), + EFL_OBJECT_OP_FUNC(elm_obj_box_padding_set, _elm_box_padding_set), + EFL_OBJECT_OP_FUNC(elm_obj_box_padding_get, _elm_box_padding_get), + EFL_OBJECT_OP_FUNC(elm_obj_box_children_get, _elm_box_children_get), + EFL_OBJECT_OP_FUNC(elm_obj_box_pack_end, _elm_box_pack_end), + EFL_OBJECT_OP_FUNC(elm_obj_box_unpack_all, _elm_box_unpack_all), + EFL_OBJECT_OP_FUNC(elm_obj_box_unpack, _elm_box_unpack), + EFL_OBJECT_OP_FUNC(elm_obj_box_pack_after, _elm_box_pack_after), + EFL_OBJECT_OP_FUNC(elm_obj_box_pack_start, _elm_box_pack_start), + EFL_OBJECT_OP_FUNC(elm_obj_box_recalculate, _elm_box_recalculate), + EFL_OBJECT_OP_FUNC(elm_obj_box_pack_before, _elm_box_pack_before), + EFL_OBJECT_OP_FUNC(elm_obj_box_clear, _elm_box_clear), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_box_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _elm_box_efl_canvas_group_group_calculate), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_box_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _elm_box_efl_ui_widget_widget_sub_object_del), + EFL_OBJECT_OP_FUNC(efl_ui_focus_composition_prepare, _elm_box_efl_ui_focus_composition_prepare), + ELM_BOX_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"homogeneous", __eolian_elm_box_homogeneous_set_reflect, __eolian_elm_box_homogeneous_get_reflect}, + {"horizontal", __eolian_elm_box_horizontal_set_reflect, __eolian_elm_box_horizontal_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_box_class_desc = { + EO_VERSION, + "Elm.Box", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Box_Data), + _elm_box_class_initializer, + _elm_box_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_box_class_get, &_elm_box_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_box_eo.legacy.c" diff --git a/src/lib/elementary/elm_box_eo.h b/src/lib/elementary/elm_box_eo.h new file mode 100644 index 0000000000..fb82524082 --- /dev/null +++ b/src/lib/elementary/elm_box_eo.h @@ -0,0 +1,305 @@ +#ifndef _ELM_BOX_EO_H_ +#define _ELM_BOX_EO_H_ + +#ifndef _ELM_BOX_EO_CLASS_TYPE +#define _ELM_BOX_EO_CLASS_TYPE + +typedef Eo Elm_Box; + +#endif + +#ifndef _ELM_BOX_EO_TYPES +#define _ELM_BOX_EO_TYPES + + +#endif +/** Elementary box class + * + * @ingroup Elm_Box + */ +#define ELM_BOX_CLASS elm_box_class_get() + +EWAPI const Efl_Class *elm_box_class_get(void); + +/** + * @brief Set the box to arrange its children homogeneously + * + * If enabled, homogeneous layout makes all items the same size, according to + * the size of the largest of its children. + * + * @note This flag is ignored if a custom layout function is set. + * + * @param[in] obj The object. + * @param[in] homogeneous The homogeneous flag + * + * @ingroup Elm_Box + */ +EOAPI void elm_obj_box_homogeneous_set(Eo *obj, Eina_Bool homogeneous); + +/** + * @brief Get whether the box is using homogeneous mode or not ($true if it's + * homogeneous, @c false otherwise) + * + * @param[in] obj The object. + * + * @return The homogeneous flag + * + * @ingroup Elm_Box + */ +EOAPI Eina_Bool elm_obj_box_homogeneous_get(const Eo *obj); + +/** + * @brief Set the alignment of the whole bounding box of contents. + * + * Sets how the bounding box containing all the elements of the box, after + * their sizes and position has been calculated, will be aligned within the + * space given for the whole box widget. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal alignment of elements + * @param[in] vertical The vertical alignment of elements + * + * @ingroup Elm_Box + */ +EOAPI void elm_obj_box_align_set(Eo *obj, double horizontal, double vertical); + +/** + * @brief Get the alignment of the whole bounding box of contents. + * + * See also @ref elm_obj_box_align_set. + * + * @param[in] obj The object. + * @param[out] horizontal The horizontal alignment of elements + * @param[out] vertical The vertical alignment of elements + * + * @ingroup Elm_Box + */ +EOAPI void elm_obj_box_align_get(const Eo *obj, double *horizontal, double *vertical); + +/** + * @brief Set the horizontal orientation + * + * By default, box object arranges their contents vertically from top to + * bottom. By calling this function with @c horizontal as @c true, the box will + * become horizontal, arranging contents from left to right. + * + * @note This flag is ignored if a custom layout function is set. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal flag + * + * @ingroup Elm_Box + */ +EOAPI void elm_obj_box_horizontal_set(Eo *obj, Eina_Bool horizontal); + +/** + * @brief Get the horizontal orientation ($true if the box is set to horizontal + * mode, @c false otherwise) + * + * @param[in] obj The object. + * + * @return The horizontal flag + * + * @ingroup Elm_Box + */ +EOAPI Eina_Bool elm_obj_box_horizontal_get(const Eo *obj); + +/** + * @brief Set the space (padding) between the box's elements. + * + * Extra space in pixels that will be added between a box child and its + * neighbors after its containing cell has been calculated. This padding is set + * for all elements in the box, besides any possible padding that individual + * elements may have through their size hints. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal space between elements + * @param[in] vertical The vertical space between elements + * + * @ingroup Elm_Box + */ +EOAPI void elm_obj_box_padding_set(Eo *obj, int horizontal, int vertical); + +/** + * @brief Get the space (padding) between the box's elements. + * + * See also @ref elm_obj_box_padding_set. + * + * @param[in] obj The object. + * @param[out] horizontal The horizontal space between elements + * @param[out] vertical The vertical space between elements + * + * @ingroup Elm_Box + */ +EOAPI void elm_obj_box_padding_get(const Eo *obj, int *horizontal, int *vertical); + +/** + * @brief Get a list of the objects packed into the box + * + * Returns a new @c list with a pointer to @c Evas_Object in its nodes. The + * order of the list corresponds to the packing order the box uses. + * + * You must free this list with eina_list_free() once you are done with it. + * + * @param[in] obj The object. + * + * @return List of children + * + * @ingroup Elm_Box + */ +EOAPI Eina_List *elm_obj_box_children_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Add an object at the end of the pack list + * + * Pack @c subobj into the box @c obj, placing it last in the list of children + * objects. The actual position the object will get on screen depends on the + * layout used. If no custom layout is set, it will be at the bottom or right, + * depending if the box is vertical or horizontal, respectively. + * + * See also @ref elm_obj_box_pack_start, @ref elm_obj_box_pack_before, + * @ref elm_obj_box_pack_after, @ref elm_obj_box_unpack, + * @ref elm_obj_box_unpack_all, @ref elm_obj_box_clear. + * + * @param[in] obj The object. + * @param[in] subobj The object to add to the box + * + * @ingroup Elm_Box + */ +EOAPI void elm_obj_box_pack_end(Eo *obj, Efl_Canvas_Object *subobj); + +/** + * @brief Remove all items from the box, without deleting them + * + * Clear the box from all children, but don't delete the respective objects. If + * no other references of the box children exist, the objects will never be + * deleted, and thus the application will leak the memory. Make sure when using + * this function that you hold a reference to all the objects in the box + * @c obj. + * + * See also @ref elm_obj_box_clear, @ref elm_obj_box_unpack. + * @param[in] obj The object. + * + * @ingroup Elm_Box + */ +EOAPI void elm_obj_box_unpack_all(Eo *obj); + +/** + * @brief Unpack a box item + * + * Remove the object given by @c subobj from the box @c obj without deleting + * it. + * + * See also @ref elm_obj_box_unpack_all, @ref elm_obj_box_clear. + * + * @param[in] obj The object. + * @param[in] subobj The object to unpack + * + * @ingroup Elm_Box + */ +EOAPI void elm_obj_box_unpack(Eo *obj, Efl_Canvas_Object *subobj); + +/** + * @brief Adds an object to the box after the indicated object + * + * This will add the @c subobj to the box indicated after the object indicated + * with @c after. If @c after is not already in the box, results are undefined. + * After means either to the right of the indicated object or below it + * depending on orientation. + * + * See also @ref elm_obj_box_pack_start, @ref elm_obj_box_pack_end, + * @ref elm_obj_box_pack_before, @ref elm_obj_box_unpack, + * @ref elm_obj_box_unpack_all, @ref elm_obj_box_clear. + * + * @param[in] obj The object. + * @param[in] subobj The object to add to the box + * @param[in] after The object after which to add it + * + * @ingroup Elm_Box + */ +EOAPI void elm_obj_box_pack_after(Eo *obj, Efl_Canvas_Object *subobj, Efl_Canvas_Object *after); + +/** + * @brief Add an object to the beginning of the pack list + * + * Pack @c subobj into the box @c obj, placing it first in the list of children + * objects. The actual position the object will get on screen depends on the + * layout used. If no custom layout is set, it will be at the top or left, + * depending if the box is vertical or horizontal, respectively. + * + * See also @ref elm_obj_box_pack_end, @ref elm_obj_box_pack_before, + * @ref elm_obj_box_pack_after, @ref elm_obj_box_unpack, + * @ref elm_obj_box_unpack_all, @ref elm_obj_box_clear. + * + * @param[in] obj The object. + * @param[in] subobj The object to add to the box + * + * @ingroup Elm_Box + */ +EOAPI void elm_obj_box_pack_start(Eo *obj, Efl_Canvas_Object *subobj); + +/** + * @brief Force the box to recalculate its children packing. + * + * If any children was added or removed, box will not calculate the values + * immediately rather leaving it to the next main loop iteration. While this is + * great as it would save lots of recalculation, whenever you need to get the + * position of a just added item you must force recalculate before doing so. + * @param[in] obj The object. + * + * @ingroup Elm_Box + */ +EOAPI void elm_obj_box_recalculate(Eo *obj); + +/** + * @brief Adds an object to the box before the indicated object + * + * This will add the @c subobj to the box indicated before the object indicated + * with @c before. If @c before is not already in the box, results are + * undefined. Before means either to the left of the indicated object or above + * it depending on orientation. + * + * See also @ref elm_obj_box_pack_start, @ref elm_obj_box_pack_end, + * @ref elm_obj_box_pack_after, @ref elm_obj_box_unpack, + * @ref elm_obj_box_unpack_all, @ref elm_obj_box_clear. + * + * @param[in] obj The object. + * @param[in] subobj The object to add to the box + * @param[in] before The object before which to add it + * + * @ingroup Elm_Box + */ +EOAPI void elm_obj_box_pack_before(Eo *obj, Efl_Canvas_Object *subobj, Efl_Canvas_Object *before); + +/** + * @brief Clear the box of all children + * + * Remove all the elements contained by the box, deleting the respective + * objects. + * + * See also @ref elm_obj_box_unpack, @ref elm_obj_box_unpack_all. + * @param[in] obj The object. + * + * @ingroup Elm_Box + */ +EOAPI void elm_obj_box_clear(Eo *obj); + +EWAPI extern const Efl_Event_Description _ELM_BOX_EVENT_CHILD_ADDED; + +/** Called when child was added + * @return Efl_Object * + * + * @ingroup Elm_Box + */ +#define ELM_BOX_EVENT_CHILD_ADDED (&(_ELM_BOX_EVENT_CHILD_ADDED)) + +EWAPI extern const Efl_Event_Description _ELM_BOX_EVENT_CHILD_REMOVED; + +/** Called when child was removed + * @return Efl_Object * + * + * @ingroup Elm_Box + */ +#define ELM_BOX_EVENT_CHILD_REMOVED (&(_ELM_BOX_EVENT_CHILD_REMOVED)) + +#endif diff --git a/src/lib/elementary/elm_box_eo.legacy.c b/src/lib/elementary/elm_box_eo.legacy.c new file mode 100644 index 0000000000..c1e5b7e702 --- /dev/null +++ b/src/lib/elementary/elm_box_eo.legacy.c @@ -0,0 +1,102 @@ + +EAPI void +elm_box_homogeneous_set(Elm_Box *obj, Eina_Bool homogeneous) +{ + elm_obj_box_homogeneous_set(obj, homogeneous); +} + +EAPI Eina_Bool +elm_box_homogeneous_get(const Elm_Box *obj) +{ + return elm_obj_box_homogeneous_get(obj); +} + +EAPI void +elm_box_align_set(Elm_Box *obj, double horizontal, double vertical) +{ + elm_obj_box_align_set(obj, horizontal, vertical); +} + +EAPI void +elm_box_align_get(const Elm_Box *obj, double *horizontal, double *vertical) +{ + elm_obj_box_align_get(obj, horizontal, vertical); +} + +EAPI void +elm_box_horizontal_set(Elm_Box *obj, Eina_Bool horizontal) +{ + elm_obj_box_horizontal_set(obj, horizontal); +} + +EAPI Eina_Bool +elm_box_horizontal_get(const Elm_Box *obj) +{ + return elm_obj_box_horizontal_get(obj); +} + +EAPI void +elm_box_padding_set(Elm_Box *obj, int horizontal, int vertical) +{ + elm_obj_box_padding_set(obj, horizontal, vertical); +} + +EAPI void +elm_box_padding_get(const Elm_Box *obj, int *horizontal, int *vertical) +{ + elm_obj_box_padding_get(obj, horizontal, vertical); +} + +EAPI Eina_List * +elm_box_children_get(const Elm_Box *obj) +{ + return elm_obj_box_children_get(obj); +} + +EAPI void +elm_box_pack_end(Elm_Box *obj, Efl_Canvas_Object *subobj) +{ + elm_obj_box_pack_end(obj, subobj); +} + +EAPI void +elm_box_unpack_all(Elm_Box *obj) +{ + elm_obj_box_unpack_all(obj); +} + +EAPI void +elm_box_unpack(Elm_Box *obj, Efl_Canvas_Object *subobj) +{ + elm_obj_box_unpack(obj, subobj); +} + +EAPI void +elm_box_pack_after(Elm_Box *obj, Efl_Canvas_Object *subobj, Efl_Canvas_Object *after) +{ + elm_obj_box_pack_after(obj, subobj, after); +} + +EAPI void +elm_box_pack_start(Elm_Box *obj, Efl_Canvas_Object *subobj) +{ + elm_obj_box_pack_start(obj, subobj); +} + +EAPI void +elm_box_recalculate(Elm_Box *obj) +{ + elm_obj_box_recalculate(obj); +} + +EAPI void +elm_box_pack_before(Elm_Box *obj, Efl_Canvas_Object *subobj, Efl_Canvas_Object *before) +{ + elm_obj_box_pack_before(obj, subobj, before); +} + +EAPI void +elm_box_clear(Elm_Box *obj) +{ + elm_obj_box_clear(obj); +} diff --git a/src/lib/elementary/elm_box_eo.legacy.h b/src/lib/elementary/elm_box_eo.legacy.h new file mode 100644 index 0000000000..9171fbaafe --- /dev/null +++ b/src/lib/elementary/elm_box_eo.legacy.h @@ -0,0 +1,280 @@ +#ifndef _ELM_BOX_EO_LEGACY_H_ +#define _ELM_BOX_EO_LEGACY_H_ + +#ifndef _ELM_BOX_EO_CLASS_TYPE +#define _ELM_BOX_EO_CLASS_TYPE + +typedef Eo Elm_Box; + +#endif + +#ifndef _ELM_BOX_EO_TYPES +#define _ELM_BOX_EO_TYPES + + +#endif + +/** + * @brief Set the box to arrange its children homogeneously + * + * If enabled, homogeneous layout makes all items the same size, according to + * the size of the largest of its children. + * + * @note This flag is ignored if a custom layout function is set. + * + * @param[in] obj The object. + * @param[in] homogeneous The homogeneous flag + * + * @ingroup Elm_Box_Group + */ +EAPI void elm_box_homogeneous_set(Elm_Box *obj, Eina_Bool homogeneous); + +/** + * @brief Get whether the box is using homogeneous mode or not ($true if it's + * homogeneous, @c false otherwise) + * + * @param[in] obj The object. + * + * @return The homogeneous flag + * + * @ingroup Elm_Box_Group + */ +EAPI Eina_Bool elm_box_homogeneous_get(const Elm_Box *obj); + +/** + * @brief Set the alignment of the whole bounding box of contents. + * + * Sets how the bounding box containing all the elements of the box, after + * their sizes and position has been calculated, will be aligned within the + * space given for the whole box widget. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal alignment of elements + * @param[in] vertical The vertical alignment of elements + * + * @ingroup Elm_Box_Group + */ +EAPI void elm_box_align_set(Elm_Box *obj, double horizontal, double vertical); + +/** + * @brief Get the alignment of the whole bounding box of contents. + * + * See also @ref elm_box_align_set. + * + * @param[in] obj The object. + * @param[out] horizontal The horizontal alignment of elements + * @param[out] vertical The vertical alignment of elements + * + * @ingroup Elm_Box_Group + */ +EAPI void elm_box_align_get(const Elm_Box *obj, double *horizontal, double *vertical); + +/** + * @brief Set the horizontal orientation + * + * By default, box object arranges their contents vertically from top to + * bottom. By calling this function with @c horizontal as @c true, the box will + * become horizontal, arranging contents from left to right. + * + * @note This flag is ignored if a custom layout function is set. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal flag + * + * @ingroup Elm_Box_Group + */ +EAPI void elm_box_horizontal_set(Elm_Box *obj, Eina_Bool horizontal); + +/** + * @brief Get the horizontal orientation ($true if the box is set to horizontal + * mode, @c false otherwise) + * + * @param[in] obj The object. + * + * @return The horizontal flag + * + * @ingroup Elm_Box_Group + */ +EAPI Eina_Bool elm_box_horizontal_get(const Elm_Box *obj); + +/** + * @brief Set the space (padding) between the box's elements. + * + * Extra space in pixels that will be added between a box child and its + * neighbors after its containing cell has been calculated. This padding is set + * for all elements in the box, besides any possible padding that individual + * elements may have through their size hints. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal space between elements + * @param[in] vertical The vertical space between elements + * + * @ingroup Elm_Box_Group + */ +EAPI void elm_box_padding_set(Elm_Box *obj, int horizontal, int vertical); + +/** + * @brief Get the space (padding) between the box's elements. + * + * See also @ref elm_box_padding_set. + * + * @param[in] obj The object. + * @param[out] horizontal The horizontal space between elements + * @param[out] vertical The vertical space between elements + * + * @ingroup Elm_Box_Group + */ +EAPI void elm_box_padding_get(const Elm_Box *obj, int *horizontal, int *vertical); + +/** + * @brief Get a list of the objects packed into the box + * + * Returns a new @c list with a pointer to @c Evas_Object in its nodes. The + * order of the list corresponds to the packing order the box uses. + * + * You must free this list with eina_list_free() once you are done with it. + * + * @param[in] obj The object. + * + * @return List of children + * + * @ingroup Elm_Box_Group + */ +EAPI Eina_List *elm_box_children_get(const Elm_Box *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Add an object at the end of the pack list + * + * Pack @c subobj into the box @c obj, placing it last in the list of children + * objects. The actual position the object will get on screen depends on the + * layout used. If no custom layout is set, it will be at the bottom or right, + * depending if the box is vertical or horizontal, respectively. + * + * See also @ref elm_box_pack_start, @ref elm_box_pack_before, + * @ref elm_box_pack_after, @ref elm_box_unpack, @ref elm_box_unpack_all, + * @ref elm_box_clear. + * + * @param[in] obj The object. + * @param[in] subobj The object to add to the box + * + * @ingroup Elm_Box_Group + */ +EAPI void elm_box_pack_end(Elm_Box *obj, Efl_Canvas_Object *subobj); + +/** + * @brief Remove all items from the box, without deleting them + * + * Clear the box from all children, but don't delete the respective objects. If + * no other references of the box children exist, the objects will never be + * deleted, and thus the application will leak the memory. Make sure when using + * this function that you hold a reference to all the objects in the box + * @c obj. + * + * See also @ref elm_box_clear, @ref elm_box_unpack. + * @param[in] obj The object. + * + * @ingroup Elm_Box_Group + */ +EAPI void elm_box_unpack_all(Elm_Box *obj); + +/** + * @brief Unpack a box item + * + * Remove the object given by @c subobj from the box @c obj without deleting + * it. + * + * See also @ref elm_box_unpack_all, @ref elm_box_clear. + * + * @param[in] obj The object. + * @param[in] subobj The object to unpack + * + * @ingroup Elm_Box_Group + */ +EAPI void elm_box_unpack(Elm_Box *obj, Efl_Canvas_Object *subobj); + +/** + * @brief Adds an object to the box after the indicated object + * + * This will add the @c subobj to the box indicated after the object indicated + * with @c after. If @c after is not already in the box, results are undefined. + * After means either to the right of the indicated object or below it + * depending on orientation. + * + * See also @ref elm_box_pack_start, @ref elm_box_pack_end, + * @ref elm_box_pack_before, @ref elm_box_unpack, @ref elm_box_unpack_all, + * @ref elm_box_clear. + * + * @param[in] obj The object. + * @param[in] subobj The object to add to the box + * @param[in] after The object after which to add it + * + * @ingroup Elm_Box_Group + */ +EAPI void elm_box_pack_after(Elm_Box *obj, Efl_Canvas_Object *subobj, Efl_Canvas_Object *after); + +/** + * @brief Add an object to the beginning of the pack list + * + * Pack @c subobj into the box @c obj, placing it first in the list of children + * objects. The actual position the object will get on screen depends on the + * layout used. If no custom layout is set, it will be at the top or left, + * depending if the box is vertical or horizontal, respectively. + * + * See also @ref elm_box_pack_end, @ref elm_box_pack_before, + * @ref elm_box_pack_after, @ref elm_box_unpack, @ref elm_box_unpack_all, + * @ref elm_box_clear. + * + * @param[in] obj The object. + * @param[in] subobj The object to add to the box + * + * @ingroup Elm_Box_Group + */ +EAPI void elm_box_pack_start(Elm_Box *obj, Efl_Canvas_Object *subobj); + +/** + * @brief Force the box to recalculate its children packing. + * + * If any children was added or removed, box will not calculate the values + * immediately rather leaving it to the next main loop iteration. While this is + * great as it would save lots of recalculation, whenever you need to get the + * position of a just added item you must force recalculate before doing so. + * @param[in] obj The object. + * + * @ingroup Elm_Box_Group + */ +EAPI void elm_box_recalculate(Elm_Box *obj); + +/** + * @brief Adds an object to the box before the indicated object + * + * This will add the @c subobj to the box indicated before the object indicated + * with @c before. If @c before is not already in the box, results are + * undefined. Before means either to the left of the indicated object or above + * it depending on orientation. + * + * See also @ref elm_box_pack_start, @ref elm_box_pack_end, + * @ref elm_box_pack_after, @ref elm_box_unpack, @ref elm_box_unpack_all, + * @ref elm_box_clear. + * + * @param[in] obj The object. + * @param[in] subobj The object to add to the box + * @param[in] before The object before which to add it + * + * @ingroup Elm_Box_Group + */ +EAPI void elm_box_pack_before(Elm_Box *obj, Efl_Canvas_Object *subobj, Efl_Canvas_Object *before); + +/** + * @brief Clear the box of all children + * + * Remove all the elements contained by the box, deleting the respective + * objects. + * + * See also @ref elm_box_unpack, @ref elm_box_unpack_all. + * @param[in] obj The object. + * + * @ingroup Elm_Box_Group + */ +EAPI void elm_box_clear(Elm_Box *obj); + +#endif diff --git a/src/lib/elementary/elm_box_legacy.h b/src/lib/elementary/elm_box_legacy.h index e7b928f7de..1afb296efd 100644 --- a/src/lib/elementary/elm_box_legacy.h +++ b/src/lib/elementary/elm_box_legacy.h @@ -10,7 +10,7 @@ */ EAPI Evas_Object *elm_box_add(Evas_Object *parent); -#include "elm_box.eo.legacy.h" +#include "elm_box_eo.legacy.h" /** * @brief Set the layout defining function to be used by the box diff --git a/src/lib/elementary/elm_bubble.c b/src/lib/elementary/elm_bubble.c index a882a2e567..559ba53d55 100644 --- a/src/lib/elementary/elm_bubble.c +++ b/src/lib/elementary/elm_bubble.c @@ -8,7 +8,7 @@ #include #include "elm_priv.h" -#include "elm_bubble.eo.h" +#include "elm_bubble_eo.h" #include "elm_widget_bubble.h" #include "elm_widget_layout.h" @@ -147,7 +147,6 @@ _elm_bubble_efl_canvas_group_group_add(Eo *obj, Elm_Bubble_Data *priv) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->pos = ELM_BUBBLE_POS_TOP_LEFT; //default @@ -246,4 +245,4 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX) ELM_LAYOUT_SIZING_EVAL_OPS(elm_bubble), \ EFL_CANVAS_GROUP_ADD_OPS(elm_bubble) -#include "elm_bubble.eo.c" +#include "elm_bubble_eo.c" diff --git a/src/lib/elementary/elm_bubble.eo b/src/lib/elementary/elm_bubble.eo deleted file mode 100644 index 4d249d210e..0000000000 --- a/src/lib/elementary/elm_bubble.eo +++ /dev/null @@ -1,44 +0,0 @@ -enum Elm.Bubble.Pos -{ - [[Defines the corner values for a bubble. - - The corner will be used to determine where the arrow of the - bubble points to. - ]] - invalid = -1, [[Invalid corner.]] - top_left, [[The arrow of the bubble points to the top left corner.]] - top_right, [[The arrow of the bubble points to the top right corner.]] - bottom_left, [[The arrow of the bubble points to the bottom left corner.]] - bottom_right [[The arrow of the bubble points to the bottom right corner.]] -} - -class Elm.Bubble extends Efl.Ui.Layout implements Efl.Ui.Clickable, Efl.Ui.Legacy -{ - [[Speech bubble widget used in messaging applications]] - - legacy_prefix: elm_bubble; - eo_prefix: elm_obj_bubble; - methods { - @property pos { - [[The corner of the bubble - - This function sets the corner of the bubble. The corner will be used to - determine where the arrow in the frame points to and where label, icon and - info are shown. See @Elm.Bubble.Pos - ]] - set { - } - get { - } - values { - pos: Elm.Bubble.Pos; [[The given corner for the bubble.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.on_access_update; - Efl.Part.part_get; - } -} diff --git a/src/lib/elementary/elm_bubble_eo.c b/src/lib/elementary/elm_bubble_eo.c new file mode 100644 index 0000000000..8b6ef3e104 --- /dev/null +++ b/src/lib/elementary/elm_bubble_eo.c @@ -0,0 +1,55 @@ + +void _elm_bubble_pos_set(Eo *obj, Elm_Bubble_Data *pd, Elm_Bubble_Pos pos); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_bubble_pos_set, EFL_FUNC_CALL(pos), Elm_Bubble_Pos pos); + +Elm_Bubble_Pos _elm_bubble_pos_get(const Eo *obj, Elm_Bubble_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_bubble_pos_get, Elm_Bubble_Pos, 0); + +Efl_Object *_elm_bubble_efl_object_constructor(Eo *obj, Elm_Bubble_Data *pd); + + +void _elm_bubble_efl_ui_widget_on_access_update(Eo *obj, Elm_Bubble_Data *pd, Eina_Bool enable); + + +Efl_Object *_elm_bubble_efl_part_part_get(const Eo *obj, Elm_Bubble_Data *pd, const char *name); + + +static Eina_Bool +_elm_bubble_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_BUBBLE_EXTRA_OPS +#define ELM_BUBBLE_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_bubble_pos_set, _elm_bubble_pos_set), + EFL_OBJECT_OP_FUNC(elm_obj_bubble_pos_get, _elm_bubble_pos_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_bubble_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_bubble_efl_ui_widget_on_access_update), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_bubble_efl_part_part_get), + ELM_BUBBLE_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_bubble_class_desc = { + EO_VERSION, + "Elm.Bubble", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Bubble_Data), + _elm_bubble_class_initializer, + _elm_bubble_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_bubble_class_get, &_elm_bubble_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_bubble_eo.legacy.c" diff --git a/src/lib/elementary/elm_bubble_eo.h b/src/lib/elementary/elm_bubble_eo.h new file mode 100644 index 0000000000..e94541d2c3 --- /dev/null +++ b/src/lib/elementary/elm_bubble_eo.h @@ -0,0 +1,74 @@ +#ifndef _ELM_BUBBLE_EO_H_ +#define _ELM_BUBBLE_EO_H_ + +#ifndef _ELM_BUBBLE_EO_CLASS_TYPE +#define _ELM_BUBBLE_EO_CLASS_TYPE + +typedef Eo Elm_Bubble; + +#endif + +#ifndef _ELM_BUBBLE_EO_TYPES +#define _ELM_BUBBLE_EO_TYPES + +/** + * @brief Defines the corner values for a bubble. + * + * The corner will be used to determine where the arrow of the bubble points + * to. + * + * @ingroup Elm_Bubble + */ +typedef enum +{ + ELM_BUBBLE_POS_INVALID = -1 /* +1 */, /**< Invalid corner. */ + ELM_BUBBLE_POS_TOP_LEFT, /**< The arrow of the bubble points to the top left + * corner. */ + ELM_BUBBLE_POS_TOP_RIGHT, /**< The arrow of the bubble points to the top right + * corner. */ + ELM_BUBBLE_POS_BOTTOM_LEFT, /**< The arrow of the bubble points to the bottom + * left corner. */ + ELM_BUBBLE_POS_BOTTOM_RIGHT /**< The arrow of the bubble points to the bottom + * right corner. */ +} Elm_Bubble_Pos; + + +#endif +/** Speech bubble widget used in messaging applications + * + * @ingroup Elm_Bubble + */ +#define ELM_BUBBLE_CLASS elm_bubble_class_get() + +EWAPI const Efl_Class *elm_bubble_class_get(void); + +/** + * @brief The corner of the bubble + * + * This function sets the corner of the bubble. The corner will be used to + * determine where the arrow in the frame points to and where label, icon and + * info are shown. See @ref Elm_Bubble_Pos + * + * @param[in] obj The object. + * @param[in] pos The given corner for the bubble. + * + * @ingroup Elm_Bubble + */ +EOAPI void elm_obj_bubble_pos_set(Eo *obj, Elm_Bubble_Pos pos); + +/** + * @brief The corner of the bubble + * + * This function sets the corner of the bubble. The corner will be used to + * determine where the arrow in the frame points to and where label, icon and + * info are shown. See @ref Elm_Bubble_Pos + * + * @param[in] obj The object. + * + * @return The given corner for the bubble. + * + * @ingroup Elm_Bubble + */ +EOAPI Elm_Bubble_Pos elm_obj_bubble_pos_get(const Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_bubble_eo.legacy.c b/src/lib/elementary/elm_bubble_eo.legacy.c new file mode 100644 index 0000000000..812b6b21d3 --- /dev/null +++ b/src/lib/elementary/elm_bubble_eo.legacy.c @@ -0,0 +1,12 @@ + +EAPI void +elm_bubble_pos_set(Elm_Bubble *obj, Elm_Bubble_Pos pos) +{ + elm_obj_bubble_pos_set(obj, pos); +} + +EAPI Elm_Bubble_Pos +elm_bubble_pos_get(const Elm_Bubble *obj) +{ + return elm_obj_bubble_pos_get(obj); +} diff --git a/src/lib/elementary/elm_bubble_eo.legacy.h b/src/lib/elementary/elm_bubble_eo.legacy.h new file mode 100644 index 0000000000..3b06655c24 --- /dev/null +++ b/src/lib/elementary/elm_bubble_eo.legacy.h @@ -0,0 +1,67 @@ +#ifndef _ELM_BUBBLE_EO_LEGACY_H_ +#define _ELM_BUBBLE_EO_LEGACY_H_ + +#ifndef _ELM_BUBBLE_EO_CLASS_TYPE +#define _ELM_BUBBLE_EO_CLASS_TYPE + +typedef Eo Elm_Bubble; + +#endif + +#ifndef _ELM_BUBBLE_EO_TYPES +#define _ELM_BUBBLE_EO_TYPES + +/** + * @brief Defines the corner values for a bubble. + * + * The corner will be used to determine where the arrow of the bubble points + * to. + * + * @ingroup Elm_Bubble + */ +typedef enum +{ + ELM_BUBBLE_POS_INVALID = -1 /* +1 */, /**< Invalid corner. */ + ELM_BUBBLE_POS_TOP_LEFT, /**< The arrow of the bubble points to the top left + * corner. */ + ELM_BUBBLE_POS_TOP_RIGHT, /**< The arrow of the bubble points to the top right + * corner. */ + ELM_BUBBLE_POS_BOTTOM_LEFT, /**< The arrow of the bubble points to the bottom + * left corner. */ + ELM_BUBBLE_POS_BOTTOM_RIGHT /**< The arrow of the bubble points to the bottom + * right corner. */ +} Elm_Bubble_Pos; + + +#endif + +/** + * @brief The corner of the bubble + * + * This function sets the corner of the bubble. The corner will be used to + * determine where the arrow in the frame points to and where label, icon and + * info are shown. See @ref Elm_Bubble_Pos + * + * @param[in] obj The object. + * @param[in] pos The given corner for the bubble. + * + * @ingroup Elm_Bubble_Group + */ +EAPI void elm_bubble_pos_set(Elm_Bubble *obj, Elm_Bubble_Pos pos); + +/** + * @brief The corner of the bubble + * + * This function sets the corner of the bubble. The corner will be used to + * determine where the arrow in the frame points to and where label, icon and + * info are shown. See @ref Elm_Bubble_Pos + * + * @param[in] obj The object. + * + * @return The given corner for the bubble. + * + * @ingroup Elm_Bubble_Group + */ +EAPI Elm_Bubble_Pos elm_bubble_pos_get(const Elm_Bubble *obj); + +#endif diff --git a/src/lib/elementary/elm_bubble_legacy.h b/src/lib/elementary/elm_bubble_legacy.h index fe19303f68..c301e0d6ea 100644 --- a/src/lib/elementary/elm_bubble_legacy.h +++ b/src/lib/elementary/elm_bubble_legacy.h @@ -10,4 +10,4 @@ */ EAPI Evas_Object *elm_bubble_add(Evas_Object *parent); -#include "elm_bubble.eo.legacy.h" \ No newline at end of file +#include "elm_bubble_eo.legacy.h" \ No newline at end of file diff --git a/src/lib/elementary/elm_bubble_part.eo b/src/lib/elementary/elm_bubble_part.eo index 701892e3f4..4237bfc83c 100644 --- a/src/lib/elementary/elm_bubble_part.eo +++ b/src/lib/elementary/elm_bubble_part.eo @@ -1,4 +1,4 @@ -class Elm_Bubble.Part extends Efl.Ui.Layout_Part_Legacy +class @beta Elm_Bubble.Part extends Efl.Ui.Layout_Part_Legacy { [[Elementary Bubble internal part class]] data: null; diff --git a/src/lib/elementary/elm_button.h b/src/lib/elementary/elm_button.h index 49053e54f1..47385657af 100644 --- a/src/lib/elementary/elm_button.h +++ b/src/lib/elementary/elm_button.h @@ -67,9 +67,6 @@ * @{ */ -#ifdef EFL_EO_API_SUPPORT -#include "efl_ui_button_eo.h" -#endif #ifndef EFL_NOLEGACY_API_SUPPORT #include "elm_button_legacy.h" #endif diff --git a/src/lib/elementary/elm_button_legacy.h b/src/lib/elementary/elm_button_legacy.h index be2beab1b1..08db783be0 100644 --- a/src/lib/elementary/elm_button_legacy.h +++ b/src/lib/elementary/elm_button_legacy.h @@ -110,4 +110,4 @@ EAPI void elm_button_autorepeat_set(Evas_Object *obj, Ein */ EAPI Eina_Bool elm_button_autorepeat_get(const Evas_Object *obj); -#include "efl_ui_button.eo.legacy.h" +#include "efl_ui_button_eo.legacy.h" diff --git a/src/lib/elementary/elm_calendar.c b/src/lib/elementary/elm_calendar.c index e150e54cd6..b249fd44fe 100644 --- a/src/lib/elementary/elm_calendar.c +++ b/src/lib/elementary/elm_calendar.c @@ -10,8 +10,8 @@ #include #include "elm_priv.h" #include "elm_widget_calendar.h" -#include "elm_calendar.eo.h" -#include "elm_calendar_item.eo.h" +#include "elm_calendar_eo.h" +#include "elm_calendar_item_eo.h" #define MY_CLASS ELM_CALENDAR_CLASS @@ -842,13 +842,13 @@ _spinner_buttons_add(Evas_Object *obj, Elm_Calendar_Data *sd) } } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_calendar_efl_ui_widget_theme_apply(Eo *obj, Elm_Calendar_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _spinner_buttons_add(obj, sd); @@ -1337,7 +1337,6 @@ _elm_calendar_efl_canvas_group_group_add(Eo *obj, Elm_Calendar_Data *priv) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->first_interval = 0.85; priv->date_min.tm_year = 2; @@ -1929,7 +1928,7 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_calendar, Elm_Calendar_Data) ELM_LAYOUT_SIZING_EVAL_OPS(elm_calendar), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_calendar) -#include "elm_calendar.eo.c" +#include "elm_calendar_eo.c" typedef struct { int v; @@ -1988,4 +1987,4 @@ _elm_calendar_item_efl_ui_focus_object_focus_parent_get(const Eo *obj, Elm_Calen } -#include "elm_calendar_item.eo.c" +#include "elm_calendar_item_eo.c" diff --git a/src/lib/elementary/elm_calendar.eo b/src/lib/elementary/elm_calendar.eo deleted file mode 100644 index 4eb1d3fdb5..0000000000 --- a/src/lib/elementary/elm_calendar.eo +++ /dev/null @@ -1,426 +0,0 @@ -import efl_types; - -type Elm_Calendar_Format_Cb: __undefined_type; [[Elementary calendar format callback type]] - -enum Elm.Calendar.Mark.Repeat.Type -{ - [[Event periodicity, used to define if a mark should be repeated beyond event's day. - - It's set when a mark is added. So, for a mark added to 13th May with periodicity - set to WEEKLY, there will be marks every week after this date. Marks will be - displayed at 13th, 20th, 27th, 3rd June ... - - Values don't work as bitmask, only one can be chosen. See also @Elm.Calendar.mark_add. - ]] - legacy: elm_calendar; - unique, [[Default value. Marks will be displayed only on event day.]] - daily, [[Marks will be displayed every day after event day (inclusive).]] - weekly, [[Marks will be displayed every week after event day (inclusive) - i.e. each seven days.]] - monthly, [[Marks will be displayed every month day that coincides to event day. E.g.: if an event is set to 30th Jan, no marks will be displayed on Feb, but will be displayed on 30th Mar.]] - annually, [[Marks will be displayed every year that coincides to event day (and month). E.g. an event added to 30th Jan 2012 will be repeated on 30th Jan 2013.]] - last_day_of_month, [[Marks will be displayed every last day of month after event day (inclusive). - @since 1.7]] - reverse_daily [[Marks will be displayed every day before event day. @since 1.19]] -} - -enum Elm.Calendar.Weekday -{ - [[A weekday - - See also @Elm.Calendar.first_day_of_week.set. - ]] - legacy: elm_day; - sunday, [[Sunday weekday]] - monday, [[Monday weekday]] - tuesday, [[Tuesday weekday]] - wednesday, [[Wednesday weekday]] - thursday, [[Thursday weekday]] - friday, [[Friday weekday]] - saturday, [[Saturday weekday]] - last [[Sentinel value to indicate last enum field during iteration]] -} - -enum Elm.Calendar.Select.Mode -{ - [[The mode, who determine how user could select a day - - See also @Elm.Calendar.select_mode.set() - ]] - default = 0, [[Default value. A day is always selected.]] - always, [[A day is always selected.]] - none, [[None of the days can be selected.]] - ondemand [[User may have selected a day or not.]] -} - -enum Elm.Calendar.Selectable -{ - [[A bitmask used to define which fields of a $tm struct will be taken into - account, when elm_calendar_selected_time_set() is invoked. - - See also @Elm.Calendar.selectable.set, @Elm.Calendar.selected_time_set. - - @since 1.8 - ]] - none = 0, [[Take no field into account]] - year = (1 << 0), [[Take year field into account]] - month = (1 << 1), [[Take month field into account]] - day = (1 << 2) [[Take day field into account]] -} - -struct Elm.Calendar.Mark; [[Item handle for a calendar mark. - Created with @Elm.Calendar.mark_add and deleted - with @Elm.Calendar.mark_del. - ]] - -class Elm.Calendar extends Efl.Ui.Layout implements Efl.Ui.Focus.Composition, Efl.Access.Widget.Action, - Efl.Ui.Legacy -{ - [[Calendar widget - - It helps applications to flexibly display a calendar with day of the week, - date, year and month. Applications are able to set specific dates to be - reported back, when selected, in the smart callbacks of the calendar widget. - ]] - legacy_prefix: elm_calendar; - eo_prefix: elm_obj_calendar; - event_prefix: elm_calendar; - methods { - @property first_day_of_week { - [[The first day of week to use on calendar widgets'.]] - set { - } - get { - } - values { - day: Elm.Calendar.Weekday; [[Weekday enum value, see @Elm.Calendar.Weekday]] - } - } - @property selectable { - [[Define which fields of a tm struct will be taken into account, when - Elm.Calendar.selected_time.set is invoked. - - By Default the bitmask is set to use all fields of a tm struct (year, - month and day of the month). - - See also @.selected_time_set. - - @since 1.8 - ]] - set { - } - get { - } - values { - selectable: Elm.Calendar.Selectable; [[A bitmask of Elm_Calendar_Selectable]] - } - } - @property interval { - [[The interval on time updates for an user mouse button hold on calendar widgets' - month/year selection. - - This interval value is decreased while the user holds the - mouse pointer either selecting next or previous month/year. - - This helps the user to get to a given month distant from the - current one easier/faster, as it will start to change quicker and - quicker on mouse button holds. - - The calculation for the next change interval value, starting from - the one set with this call, is the previous interval divided by - 1.05, so it decreases a little bit. - - The default starting interval value for automatic changes is - 0.85 seconds. - ]] - set { - } - get { - } - values { - interval: double; [[The (first) interval value in seconds]] - } - } - @property weekdays_names { - [[Weekdays names to be displayed by the calendar. - - By default, weekdays abbreviations get from system are displayed: - E.g. for an en_US locale: "Sun, Mon, Tue, Wed, Thu, Fri, Sat" - - The first string should be related to Sunday, the second to Monday... - - See also @.weekdays_names.get. - - \@ref calendar_example_02. - \@ref calendar_example_05. - ]] - /* FIXME-doc - * - * The usage should be like this: - * @code - * const char *weekdays[] = - * { - * "Sunday", "Monday", "Tuesday", "Wednesday", - * "Thursday", "Friday", "Saturday" - * }; - * elm_calendar_weekdays_names_set(calendar, weekdays); - * @endcode - */ - set { - } - get { - } - values { - weekdays: legacy(ptr(string)); [[Array of seven strings to be used as weekday names. - Warning: It must have 7 elements, or it will access invalid memory. - Warning: The strings must be $null terminated ('@\0').]] - } - } - @property select_mode { - [[Select day mode to use. - - The day selection mode used. - ]] - set { - } - get { - } - values { - mode: Elm.Calendar.Select.Mode; [[The select mode to use.]] - } - } - @property format_function { - set { - [[Set a function to format the string that will be used to display - month and year; - - By default it uses strftime with "%B %Y" format string. - It should allocate the memory that will be used by the string, - that will be freed by the widget after usage. - A pointer to the string and a pointer to the time struct will be provided. - - \@ref calendar_example_02. - ]] - /* FIXME-doc - * Example: - * @code - * static char - * _format_month_year(struct tm *selected_time) - * { - * char buf[32]; - * if (!strftime(buf, sizeof(buf), "%B %Y", selected_time)) return NULL; - * return strdup(buf); - * } - * - * elm_calendar_format_function_set(calendar, _format_month_year); - * @endcode - */ - } - values { - format_function: Elm_Calendar_Format_Cb; [[Function to set the month-year string given - the selected date.]] - } - } - @property marks { - get { - [[Get a list of all the calendar marks. - - See also @.mark_add, - @.mark_del(), - @.marks_clear. - - ]] - return: const(list); [[List with all calendar marks]] - } - } - @property date_min { - [[Minimum date on calendar. - - See also @.date_max.set, @.date_max.get - - @since 1.19 - ]] - set { - [[Set minimum date on calendar. - - Set the minimum date, changing the displayed month or year if needed. - Displayed day also to be disabled if it is smaller than minimum date. - ]] - } - get { - [[Get minimum date. - - Default value is 1 JAN,1902. - ]] - } - values { - @cref min: Efl.Time; [[A tm struct to point to minimum date.]] - } - } - @property date_max { - [[Maximum date on calendar. - - See also @.date_min.set, @.date_min.get - - @since 1.19 - ]] - set { - [[Set maximum date on calendar. - - Set the maximum date, changing the displayed month or year if needed. - Displayed day also to be disabled if it is bigger than maximum date. - ]] - } - get { - [[Get maximum date. - - Default maximum year is -1. - Default maximum day and month are 31 and DEC. - - If the maximum year is a negative value, it will be limited depending - on the platform architecture (year 2037 for 32 bits); - ]] - } - values { - @cref max: Efl.Time; [[A tm struct to point to maximum date.]] - } - } - selected_time_set { - [[Set selected date to be highlighted on calendar. - - Set the selected date, changing the displayed month if needed. - Selected date changes when the user goes to next/previous month or - select a day pressing over it on calendar. - - See also @.selected_time_get. - - \@ref calendar_example_04 - ]] - params { - @in selected_time: ptr(Efl.Time); [[A tm struct to represent the selected date.]] - } - } - selected_time_get @const { - [[Get selected date. - - Get date selected by the user or set by function - @.selected_time_set(). - Selected date changes when the user goes to next/previous month or - select a day pressing over it on calendar. - - See also @.selected_time_get. - - \@ref calendar_example_05. - ]] - return: bool; [[$true if the method succeeded, $false otherwise]] - params { - @inout selected_time: Efl.Time; [[A tm struct to point to selected date.]] - } - } - mark_add { - [[Add a new mark to the calendar - - Add a mark that will be drawn in the calendar respecting the insertion - time and periodicity. It will emit the type as signal to the widget theme. - Default theme supports "holiday" and "checked", but it can be extended. - - It won't immediately update the calendar, drawing the marks. - For this, @.marks_draw(). However, when user selects - next or previous month calendar forces marks drawn. - - Marks created with this method can be deleted with @.mark_del(). - - See also @.marks_draw, @.mark_del(). - - \@ref calendar_example_06 - ]] - /* FIXME-doc - * Example - * @code - * struct tm selected_time; - * time_t current_time; - * - * current_time = time(NULL) + 5 * (24 * 60 * 60); - * localtime_r(¤t_time, &selected_time); - * elm_calendar_mark_add(cal, "holiday", selected_time, - * ELM_CALENDAR_ANNUALLY); - - * current_time = time(NULL) + 1 * (24 * 60 * 60); - * localtime_r(¤t_time, &selected_time); - * elm_calendar_mark_add(cal, "checked", selected_time, ELM_CALENDAR_UNIQUE); - - * elm_calendar_marks_draw(cal); - * @endcode - */ - return: ptr(Elm.Calendar.Mark); [[The newly added calendar mark]] - params { - @in mark_type: string; [[A string used to define the type of mark. It will be - emitted to the theme, that should display a related modification on these - days representation.]] - @in mark_time: ptr(Efl.Time); [[A time struct to represent the date of inclusion of the - mark. For marks that repeats it will just be displayed after the inclusion - date in the calendar.]] - @in repeat: Elm.Calendar.Mark.Repeat.Type; [[Repeat the event following this periodicity. Can be a unique - mark (that don't repeat), daily, weekly, monthly or annually.]] - } - } - mark_del { - [[Delete mark from the calendar. - - If deleting all calendar marks is required, @.marks_clear() - should be used instead of getting marks list and deleting each one. - - See also @.mark_add(), @.marks_clear(). - ]] - legacy: null; - params { - @in mark: ptr(Elm.Calendar.Mark); [[ The mark to be deleted. ]] - } - } - marks_clear { - [[Remove all calendar's marks - - See also @.mark_add, @.mark_del(). - ]] - } - marks_draw { - [[Draw calendar marks. - - Should be used after adding, removing or clearing marks. - It will go through the entire marks list updating the calendar. - If lots of marks will be added, add all the marks and then call - this function. - - When the month is changed, i.e. user selects next or previous month, - marks will be drawn. - - See also @.mark_add, @.mark_del(), @.marks_clear. - - \@ref calendar_example_06 - ]] - } - displayed_time_get @const { - [[Get the current time displayed in the widget - - @since 1.8 - ]] - return: bool; [[$true if the method succeeded, $false otherwise]] - params { - @inout displayed_time: Efl.Time; [[A tm struct to point to displayed date.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Canvas.Group.group_calculate; - 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: 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_calendar_eo.c b/src/lib/elementary/elm_calendar_eo.c new file mode 100644 index 0000000000..2bb920f78f --- /dev/null +++ b/src/lib/elementary/elm_calendar_eo.c @@ -0,0 +1,212 @@ +EWAPI const Efl_Event_Description _ELM_CALENDAR_EVENT_CHANGED = + EFL_EVENT_DESCRIPTION("changed"); +EWAPI const Efl_Event_Description _ELM_CALENDAR_EVENT_DISPLAY_CHANGED = + EFL_EVENT_DESCRIPTION("display,changed"); + +void _elm_calendar_first_day_of_week_set(Eo *obj, Elm_Calendar_Data *pd, Elm_Calendar_Weekday day); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_calendar_first_day_of_week_set, EFL_FUNC_CALL(day), Elm_Calendar_Weekday day); + +Elm_Calendar_Weekday _elm_calendar_first_day_of_week_get(const Eo *obj, Elm_Calendar_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_calendar_first_day_of_week_get, Elm_Calendar_Weekday, 0); + +void _elm_calendar_selectable_set(Eo *obj, Elm_Calendar_Data *pd, Elm_Calendar_Selectable selectable); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_calendar_selectable_set, EFL_FUNC_CALL(selectable), Elm_Calendar_Selectable selectable); + +Elm_Calendar_Selectable _elm_calendar_selectable_get(const Eo *obj, Elm_Calendar_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_calendar_selectable_get, Elm_Calendar_Selectable, 0); + +void _elm_calendar_interval_set(Eo *obj, Elm_Calendar_Data *pd, double interval); + + +static Eina_Error +__eolian_elm_calendar_interval_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_calendar_interval_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_calendar_interval_set, EFL_FUNC_CALL(interval), double interval); + +double _elm_calendar_interval_get(const Eo *obj, Elm_Calendar_Data *pd); + + +static Eina_Value +__eolian_elm_calendar_interval_get_reflect(const Eo *obj) +{ + double val = elm_obj_calendar_interval_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_calendar_interval_get, double, 0); + +void _elm_calendar_weekdays_names_set(Eo *obj, Elm_Calendar_Data *pd, const char **weekdays); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_calendar_weekdays_names_set, EFL_FUNC_CALL(weekdays), const char **weekdays); + +const char **_elm_calendar_weekdays_names_get(const Eo *obj, Elm_Calendar_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_calendar_weekdays_names_get, const char **, NULL); + +void _elm_calendar_select_mode_set(Eo *obj, Elm_Calendar_Data *pd, Elm_Calendar_Select_Mode mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_calendar_select_mode_set, EFL_FUNC_CALL(mode), Elm_Calendar_Select_Mode mode); + +Elm_Calendar_Select_Mode _elm_calendar_select_mode_get(const Eo *obj, Elm_Calendar_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_calendar_select_mode_get, Elm_Calendar_Select_Mode, 0); + +void _elm_calendar_format_function_set(Eo *obj, Elm_Calendar_Data *pd, Elm_Calendar_Format_Cb format_function); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_calendar_format_function_set, EFL_FUNC_CALL(format_function), Elm_Calendar_Format_Cb format_function); + +const Eina_List *_elm_calendar_marks_get(const Eo *obj, Elm_Calendar_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_calendar_marks_get, const Eina_List *, NULL); + +void _elm_calendar_date_min_set(Eo *obj, Elm_Calendar_Data *pd, const Efl_Time *min); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_calendar_date_min_set, EFL_FUNC_CALL(min), const Efl_Time *min); + +const Efl_Time *_elm_calendar_date_min_get(const Eo *obj, Elm_Calendar_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_calendar_date_min_get, const Efl_Time *, NULL); + +void _elm_calendar_date_max_set(Eo *obj, Elm_Calendar_Data *pd, const Efl_Time *max); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_calendar_date_max_set, EFL_FUNC_CALL(max), const Efl_Time *max); + +const Efl_Time *_elm_calendar_date_max_get(const Eo *obj, Elm_Calendar_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_calendar_date_max_get, const Efl_Time *, NULL); + +void _elm_calendar_selected_time_set(Eo *obj, Elm_Calendar_Data *pd, Efl_Time *selected_time); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_calendar_selected_time_set, EFL_FUNC_CALL(selected_time), Efl_Time *selected_time); + +Eina_Bool _elm_calendar_selected_time_get(const Eo *obj, Elm_Calendar_Data *pd, Efl_Time *selected_time); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_calendar_selected_time_get, Eina_Bool, 0, EFL_FUNC_CALL(selected_time), Efl_Time *selected_time); + +Elm_Calendar_Mark *_elm_calendar_mark_add(Eo *obj, Elm_Calendar_Data *pd, const char *mark_type, Efl_Time *mark_time, Elm_Calendar_Mark_Repeat_Type repeat); + +EOAPI EFL_FUNC_BODYV(elm_obj_calendar_mark_add, Elm_Calendar_Mark *, NULL, EFL_FUNC_CALL(mark_type, mark_time, repeat), const char *mark_type, Efl_Time *mark_time, Elm_Calendar_Mark_Repeat_Type repeat); + +void _elm_calendar_mark_del(Eo *obj, Elm_Calendar_Data *pd, Elm_Calendar_Mark *mark); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_calendar_mark_del, EFL_FUNC_CALL(mark), Elm_Calendar_Mark *mark); + +void _elm_calendar_marks_clear(Eo *obj, Elm_Calendar_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_calendar_marks_clear); + +void _elm_calendar_marks_draw(Eo *obj, Elm_Calendar_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_calendar_marks_draw); + +Eina_Bool _elm_calendar_displayed_time_get(const Eo *obj, Elm_Calendar_Data *pd, Efl_Time *displayed_time); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_calendar_displayed_time_get, Eina_Bool, 0, EFL_FUNC_CALL(displayed_time), Efl_Time *displayed_time); + +Efl_Object *_elm_calendar_efl_object_constructor(Eo *obj, Elm_Calendar_Data *pd); + + +void _elm_calendar_efl_canvas_group_group_calculate(Eo *obj, Elm_Calendar_Data *pd); + + +Eina_Error _elm_calendar_efl_ui_widget_theme_apply(Eo *obj, Elm_Calendar_Data *pd); + + +void _elm_calendar_efl_ui_widget_on_access_update(Eo *obj, Elm_Calendar_Data *pd, Eina_Bool enable); + + +Eina_Bool _elm_calendar_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Calendar_Data *pd); + + +Eina_Bool _elm_calendar_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Calendar_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +const Efl_Access_Action_Data *_elm_calendar_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Calendar_Data *pd); + + +static Eina_Bool +_elm_calendar_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_CALENDAR_EXTRA_OPS +#define ELM_CALENDAR_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_calendar_first_day_of_week_set, _elm_calendar_first_day_of_week_set), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_first_day_of_week_get, _elm_calendar_first_day_of_week_get), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_selectable_set, _elm_calendar_selectable_set), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_selectable_get, _elm_calendar_selectable_get), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_interval_set, _elm_calendar_interval_set), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_interval_get, _elm_calendar_interval_get), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_weekdays_names_set, _elm_calendar_weekdays_names_set), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_weekdays_names_get, _elm_calendar_weekdays_names_get), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_select_mode_set, _elm_calendar_select_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_select_mode_get, _elm_calendar_select_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_format_function_set, _elm_calendar_format_function_set), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_marks_get, _elm_calendar_marks_get), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_date_min_set, _elm_calendar_date_min_set), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_date_min_get, _elm_calendar_date_min_get), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_date_max_set, _elm_calendar_date_max_set), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_date_max_get, _elm_calendar_date_max_get), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_selected_time_set, _elm_calendar_selected_time_set), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_selected_time_get, _elm_calendar_selected_time_get), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_mark_add, _elm_calendar_mark_add), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_mark_del, _elm_calendar_mark_del), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_marks_clear, _elm_calendar_marks_clear), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_marks_draw, _elm_calendar_marks_draw), + EFL_OBJECT_OP_FUNC(elm_obj_calendar_displayed_time_get, _elm_calendar_displayed_time_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_calendar_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _elm_calendar_efl_canvas_group_group_calculate), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_calendar_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_calendar_efl_ui_widget_on_access_update), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_on_focus_update, _elm_calendar_efl_ui_focus_object_on_focus_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_calendar_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_calendar_efl_access_widget_action_elm_actions_get), + ELM_CALENDAR_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"interval", __eolian_elm_calendar_interval_set_reflect, __eolian_elm_calendar_interval_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_calendar_class_desc = { + EO_VERSION, + "Elm.Calendar", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Calendar_Data), + _elm_calendar_class_initializer, + _elm_calendar_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_calendar_class_get, &_elm_calendar_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_calendar_eo.legacy.c" diff --git a/src/lib/elementary/elm_calendar_eo.h b/src/lib/elementary/elm_calendar_eo.h new file mode 100644 index 0000000000..09a97eb868 --- /dev/null +++ b/src/lib/elementary/elm_calendar_eo.h @@ -0,0 +1,574 @@ +#ifndef _ELM_CALENDAR_EO_H_ +#define _ELM_CALENDAR_EO_H_ + +#ifndef _ELM_CALENDAR_EO_CLASS_TYPE +#define _ELM_CALENDAR_EO_CLASS_TYPE + +typedef Eo Elm_Calendar; + +#endif + +#ifndef _ELM_CALENDAR_EO_TYPES +#define _ELM_CALENDAR_EO_TYPES + +/** + * @brief Event periodicity, used to define if a mark should be repeated beyond + * event's day. + * + * It's set when a mark is added. So, for a mark added to 13th May with + * periodicity set to WEEKLY, there will be marks every week after this date. + * Marks will be displayed at 13th, 20th, 27th, 3rd June ... + * + * Values don't work as bitmask, only one can be chosen. See also + * @ref elm_obj_calendar_mark_add. + * + * @ingroup Elm_Calendar_Mark_Repeat + */ +typedef enum +{ + ELM_CALENDAR_UNIQUE = 0, /**< Default value. Marks will be displayed only on + * event day. */ + ELM_CALENDAR_DAILY, /**< Marks will be displayed every day after event day + * (inclusive). */ + ELM_CALENDAR_WEEKLY, /**< Marks will be displayed every week after event day + * (inclusive) - i.e. each seven days. */ + ELM_CALENDAR_MONTHLY, /**< Marks will be displayed every month day that + * coincides to event day. E.g.: if an event is set to + * 30th Jan, no marks will be displayed on Feb, but + * will be displayed on 30th Mar. */ + ELM_CALENDAR_ANNUALLY, /**< Marks will be displayed every year that coincides + * to event day (and month). E.g. an event added to + * 30th Jan 2012 will be repeated on 30th Jan 2013. */ + ELM_CALENDAR_LAST_DAY_OF_MONTH, /**< Marks will be displayed every last day of + * month after event day (inclusive). + * + * @since 1.7 */ + ELM_CALENDAR_REVERSE_DAILY /**< Marks will be displayed every day before event + * day. + * + * @since 1.19 */ +} Elm_Calendar_Mark_Repeat_Type; + +/** + * @brief A weekday + * + * See also @ref elm_obj_calendar_first_day_of_week_set. + * + * @ingroup Elm_Calendar + */ +typedef enum +{ + ELM_DAY_SUNDAY = 0, /**< Sunday weekday */ + ELM_DAY_MONDAY, /**< Monday weekday */ + ELM_DAY_TUESDAY, /**< Tuesday weekday */ + ELM_DAY_WEDNESDAY, /**< Wednesday weekday */ + ELM_DAY_THURSDAY, /**< Thursday weekday */ + ELM_DAY_FRIDAY, /**< Friday weekday */ + ELM_DAY_SATURDAY, /**< Saturday weekday */ + ELM_DAY_LAST /**< Sentinel value to indicate last enum field during iteration + */ +} Elm_Calendar_Weekday; + +/** + * @brief The mode, who determine how user could select a day + * + * See also @ref elm_obj_calendar_select_mode_set() + * + * @ingroup Elm_Calendar_Select + */ +typedef enum +{ + ELM_CALENDAR_SELECT_MODE_DEFAULT = 0, /**< Default value. A day is always + * selected. */ + ELM_CALENDAR_SELECT_MODE_ALWAYS, /**< A day is always selected. */ + ELM_CALENDAR_SELECT_MODE_NONE, /**< None of the days can be selected. */ + ELM_CALENDAR_SELECT_MODE_ONDEMAND /**< User may have selected a day or not. */ +} Elm_Calendar_Select_Mode; + +/** + * @brief A bitmask used to define which fields of a @c tm struct will be taken + * into account, when elm_calendar_selected_time_set() is invoked. + * + * See also @ref elm_obj_calendar_selectable_set, + * @ref elm_obj_calendar_selected_time_set. + * + * @since 1.8 + * + * @ingroup Elm_Calendar + */ +typedef enum +{ + ELM_CALENDAR_SELECTABLE_NONE = 0, /**< Take no field into account */ + ELM_CALENDAR_SELECTABLE_YEAR = 1 /* 1 >> 0 */, /**< Take year field into + * account */ + ELM_CALENDAR_SELECTABLE_MONTH = 2 /* 1 >> 1 */, /**< Take month field into + * account */ + ELM_CALENDAR_SELECTABLE_DAY = 4 /* 1 >> 2 */ /**< Take day field into account + */ +} Elm_Calendar_Selectable; + +/** Item handle for a calendar mark. Created with + * @ref elm_obj_calendar_mark_add and deleted with + * @ref elm_obj_calendar_mark_del. + * + * @ingroup Elm_Calendar + */ +typedef struct _Elm_Calendar_Mark Elm_Calendar_Mark; + + +#endif +/** + * @brief Calendar widget + * + * It helps applications to flexibly display a calendar with day of the week, + * date, year and month. Applications are able to set specific dates to be + * reported back, when selected, in the smart callbacks of the calendar widget. + * + * @ingroup Elm_Calendar + */ +#define ELM_CALENDAR_CLASS elm_calendar_class_get() + +EWAPI const Efl_Class *elm_calendar_class_get(void); + +/** + * @brief The first day of week to use on calendar widgets'. + * + * @param[in] obj The object. + * @param[in] day Weekday enum value, see @ref Elm_Calendar_Weekday + * + * @ingroup Elm_Calendar + */ +EOAPI void elm_obj_calendar_first_day_of_week_set(Eo *obj, Elm_Calendar_Weekday day); + +/** + * @brief The first day of week to use on calendar widgets'. + * + * @param[in] obj The object. + * + * @return Weekday enum value, see @ref Elm_Calendar_Weekday + * + * @ingroup Elm_Calendar + */ +EOAPI Elm_Calendar_Weekday elm_obj_calendar_first_day_of_week_get(const Eo *obj); + +/** + * @brief Define which fields of a tm struct will be taken into account, when + * Elm.Calendar.selected_time.set is invoked. + * + * By Default the bitmask is set to use all fields of a tm struct (year, month + * and day of the month). + * + * See also @ref elm_obj_calendar_selected_time_set. + * + * @param[in] obj The object. + * @param[in] selectable A bitmask of Elm_Calendar_Selectable + * + * @since 1.8 + * + * @ingroup Elm_Calendar + */ +EOAPI void elm_obj_calendar_selectable_set(Eo *obj, Elm_Calendar_Selectable selectable); + +/** + * @brief Define which fields of a tm struct will be taken into account, when + * Elm.Calendar.selected_time.set is invoked. + * + * By Default the bitmask is set to use all fields of a tm struct (year, month + * and day of the month). + * + * See also @ref elm_obj_calendar_selected_time_set. + * + * @param[in] obj The object. + * + * @return A bitmask of Elm_Calendar_Selectable + * + * @since 1.8 + * + * @ingroup Elm_Calendar + */ +EOAPI Elm_Calendar_Selectable elm_obj_calendar_selectable_get(const Eo *obj); + +/** + * @brief The interval on time updates for an user mouse button hold on + * calendar widgets' month/year selection. + * + * This interval value is decreased while the user holds the mouse pointer + * either selecting next or previous month/year. + * + * This helps the user to get to a given month distant from the current one + * easier/faster, as it will start to change quicker and quicker on mouse + * button holds. + * + * The calculation for the next change interval value, starting from the one + * set with this call, is the previous interval divided by 1.05, so it + * decreases a little bit. + * + * The default starting interval value for automatic changes is 0.85 seconds. + * + * @param[in] obj The object. + * @param[in] interval The (first) interval value in seconds + * + * @ingroup Elm_Calendar + */ +EOAPI void elm_obj_calendar_interval_set(Eo *obj, double interval); + +/** + * @brief The interval on time updates for an user mouse button hold on + * calendar widgets' month/year selection. + * + * This interval value is decreased while the user holds the mouse pointer + * either selecting next or previous month/year. + * + * This helps the user to get to a given month distant from the current one + * easier/faster, as it will start to change quicker and quicker on mouse + * button holds. + * + * The calculation for the next change interval value, starting from the one + * set with this call, is the previous interval divided by 1.05, so it + * decreases a little bit. + * + * The default starting interval value for automatic changes is 0.85 seconds. + * + * @param[in] obj The object. + * + * @return The (first) interval value in seconds + * + * @ingroup Elm_Calendar + */ +EOAPI double elm_obj_calendar_interval_get(const Eo *obj); + +/** + * @brief Weekdays names to be displayed by the calendar. + * + * By default, weekdays abbreviations get from system are displayed: E.g. for + * an en_US locale: "Sun, Mon, Tue, Wed, Thu, Fri, Sat" + * + * The first string should be related to Sunday, the second to Monday... + * + * See also @ref elm_obj_calendar_weekdays_names_get. + * + * @ref calendar_example_02. @ref calendar_example_05. + * + * @param[in] obj The object. + * @param[in] weekdays Array of seven strings to be used as weekday names. + * Warning: It must have 7 elements, or it will access invalid memory. Warning: + * The strings must be @c null terminated ('@\0'). + * + * @ingroup Elm_Calendar + */ +EOAPI void elm_obj_calendar_weekdays_names_set(Eo *obj, const char **weekdays); + +/** + * @brief Weekdays names to be displayed by the calendar. + * + * By default, weekdays abbreviations get from system are displayed: E.g. for + * an en_US locale: "Sun, Mon, Tue, Wed, Thu, Fri, Sat" + * + * The first string should be related to Sunday, the second to Monday... + * + * See also @ref elm_obj_calendar_weekdays_names_get. + * + * @ref calendar_example_02. @ref calendar_example_05. + * + * @param[in] obj The object. + * + * @return Array of seven strings to be used as weekday names. Warning: It must + * have 7 elements, or it will access invalid memory. Warning: The strings must + * be @c null terminated ('@\0'). + * + * @ingroup Elm_Calendar + */ +EOAPI const char **elm_obj_calendar_weekdays_names_get(const Eo *obj); + +/** + * @brief Select day mode to use. + * + * The day selection mode used. + * + * @param[in] obj The object. + * @param[in] mode The select mode to use. + * + * @ingroup Elm_Calendar + */ +EOAPI void elm_obj_calendar_select_mode_set(Eo *obj, Elm_Calendar_Select_Mode mode); + +/** + * @brief Select day mode to use. + * + * The day selection mode used. + * + * @param[in] obj The object. + * + * @return The select mode to use. + * + * @ingroup Elm_Calendar + */ +EOAPI Elm_Calendar_Select_Mode elm_obj_calendar_select_mode_get(const Eo *obj); + +/** + * @brief Set a function to format the string that will be used to display + * month and year; + * + * By default it uses strftime with "%B %Y" format string. It should allocate + * the memory that will be used by the string, that will be freed by the widget + * after usage. A pointer to the string and a pointer to the time struct will + * be provided. + * + * @ref calendar_example_02. + * + * @param[in] obj The object. + * @param[in] format_function Function to set the month-year string given the + * selected date. + * + * @ingroup Elm_Calendar + */ +EOAPI void elm_obj_calendar_format_function_set(Eo *obj, Elm_Calendar_Format_Cb format_function); + +/** + * @brief Get a list of all the calendar marks. + * + * See also @ref elm_obj_calendar_mark_add, @ref elm_obj_calendar_mark_del(), + * @ref elm_obj_calendar_marks_clear. + * + * @param[in] obj The object. + * + * @return List with all calendar marks + * + * @ingroup Elm_Calendar + */ +EOAPI const Eina_List *elm_obj_calendar_marks_get(const Eo *obj); + +/** + * @brief Minimum date on calendar. + * + * See also @ref elm_obj_calendar_date_max_set, + * @ref elm_obj_calendar_date_max_get + * + * Set minimum date on calendar. + * + * Set the minimum date, changing the displayed month or year if needed. + * Displayed day also to be disabled if it is smaller than minimum date. + * + * @param[in] obj The object. + * @param[in] min A tm struct to point to minimum date. + * + * @since 1.19 + * + * @ingroup Elm_Calendar + */ +EOAPI void elm_obj_calendar_date_min_set(Eo *obj, const Efl_Time *min); + +/** + * @brief Minimum date on calendar. + * + * See also @ref elm_obj_calendar_date_max_set, + * @ref elm_obj_calendar_date_max_get + * + * Get minimum date. + * + * Default value is 1 JAN,1902. + * + * @param[in] obj The object. + * + * @return A tm struct to point to minimum date. + * + * @since 1.19 + * + * @ingroup Elm_Calendar + */ +EOAPI const Efl_Time *elm_obj_calendar_date_min_get(const Eo *obj); + +/** + * @brief Maximum date on calendar. + * + * See also @ref elm_obj_calendar_date_min_set, + * @ref elm_obj_calendar_date_min_get + * + * Set maximum date on calendar. + * + * Set the maximum date, changing the displayed month or year if needed. + * Displayed day also to be disabled if it is bigger than maximum date. + * + * @param[in] obj The object. + * @param[in] max A tm struct to point to maximum date. + * + * @since 1.19 + * + * @ingroup Elm_Calendar + */ +EOAPI void elm_obj_calendar_date_max_set(Eo *obj, const Efl_Time *max); + +/** + * @brief Maximum date on calendar. + * + * See also @ref elm_obj_calendar_date_min_set, + * @ref elm_obj_calendar_date_min_get + * + * Get maximum date. + * + * Default maximum year is -1. Default maximum day and month are 31 and DEC. + * + * If the maximum year is a negative value, it will be limited depending on the + * platform architecture (year 2037 for 32 bits); + * + * @param[in] obj The object. + * + * @return A tm struct to point to maximum date. + * + * @since 1.19 + * + * @ingroup Elm_Calendar + */ +EOAPI const Efl_Time *elm_obj_calendar_date_max_get(const Eo *obj); + +/** + * @brief Set selected date to be highlighted on calendar. + * + * Set the selected date, changing the displayed month if needed. Selected date + * changes when the user goes to next/previous month or select a day pressing + * over it on calendar. + * + * See also @ref elm_obj_calendar_selected_time_get. + * + * @ref calendar_example_04 + * + * @param[in] obj The object. + * @param[in] selected_time A tm struct to represent the selected date. + * + * @ingroup Elm_Calendar + */ +EOAPI void elm_obj_calendar_selected_time_set(Eo *obj, Efl_Time *selected_time); + +/** + * @brief Get selected date. + * + * Get date selected by the user or set by function + * @ref elm_obj_calendar_selected_time_set(). Selected date changes when the + * user goes to next/previous month or select a day pressing over it on + * calendar. + * + * See also @ref elm_obj_calendar_selected_time_get. + * + * @ref calendar_example_05. + * + * @param[in] obj The object. + * @param[in,out] selected_time A tm struct to point to selected date. + * + * @return @c true if the method succeeded, @c false otherwise + * + * @ingroup Elm_Calendar + */ +EOAPI Eina_Bool elm_obj_calendar_selected_time_get(const Eo *obj, Efl_Time *selected_time); + +/** + * @brief Add a new mark to the calendar + * + * Add a mark that will be drawn in the calendar respecting the insertion time + * and periodicity. It will emit the type as signal to the widget theme. + * Default theme supports "holiday" and "checked", but it can be extended. + * + * It won't immediately update the calendar, drawing the marks. For this, + * @ref elm_obj_calendar_marks_draw(). However, when user selects next or + * previous month calendar forces marks drawn. + * + * Marks created with this method can be deleted with + * @ref elm_obj_calendar_mark_del(). + * + * See also @ref elm_obj_calendar_marks_draw, @ref elm_obj_calendar_mark_del(). + * + * @ref calendar_example_06 + * + * @param[in] obj The object. + * @param[in] mark_type A string used to define the type of mark. It will be + * emitted to the theme, that should display a related modification on these + * days representation. + * @param[in] mark_time A time struct to represent the date of inclusion of the + * mark. For marks that repeats it will just be displayed after the inclusion + * date in the calendar. + * @param[in] repeat Repeat the event following this periodicity. Can be a + * unique mark (that don't repeat), daily, weekly, monthly or annually. + * + * @return The newly added calendar mark + * + * @ingroup Elm_Calendar + */ +EOAPI Elm_Calendar_Mark *elm_obj_calendar_mark_add(Eo *obj, const char *mark_type, Efl_Time *mark_time, Elm_Calendar_Mark_Repeat_Type repeat); + +/** + * @brief Delete mark from the calendar. + * + * If deleting all calendar marks is required, + * @ref elm_obj_calendar_marks_clear() should be used instead of getting marks + * list and deleting each one. + * + * See also @ref elm_obj_calendar_mark_add(), + * @ref elm_obj_calendar_marks_clear(). + * + * @param[in] obj The object. + * @param[in] mark The mark to be deleted. + * + * @ingroup Elm_Calendar + */ +EOAPI void elm_obj_calendar_mark_del(Eo *obj, Elm_Calendar_Mark *mark); + +/** + * @brief Remove all calendar's marks + * + * See also @ref elm_obj_calendar_mark_add, @ref elm_obj_calendar_mark_del(). + * @param[in] obj The object. + * + * @ingroup Elm_Calendar + */ +EOAPI void elm_obj_calendar_marks_clear(Eo *obj); + +/** + * @brief Draw calendar marks. + * + * Should be used after adding, removing or clearing marks. It will go through + * the entire marks list updating the calendar. If lots of marks will be added, + * add all the marks and then call this function. + * + * When the month is changed, i.e. user selects next or previous month, marks + * will be drawn. + * + * See also @ref elm_obj_calendar_mark_add, @ref elm_obj_calendar_mark_del(), + * @ref elm_obj_calendar_marks_clear. + * + * @ref calendar_example_06 + * @param[in] obj The object. + * + * @ingroup Elm_Calendar + */ +EOAPI void elm_obj_calendar_marks_draw(Eo *obj); + +/** + * @brief Get the current time displayed in the widget + * + * @param[in] obj The object. + * @param[in,out] displayed_time A tm struct to point to displayed date. + * + * @return @c true if the method succeeded, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Calendar + */ +EOAPI Eina_Bool elm_obj_calendar_displayed_time_get(const Eo *obj, Efl_Time *displayed_time); + +EWAPI extern const Efl_Event_Description _ELM_CALENDAR_EVENT_CHANGED; + +/** Emitted when the date in the calendar is changed + * + * @ingroup Elm_Calendar + */ +#define ELM_CALENDAR_EVENT_CHANGED (&(_ELM_CALENDAR_EVENT_CHANGED)) + +EWAPI extern const Efl_Event_Description _ELM_CALENDAR_EVENT_DISPLAY_CHANGED; + +/** Emitted when the current month displayed in the calendar is changed + * + * @ingroup Elm_Calendar + */ +#define ELM_CALENDAR_EVENT_DISPLAY_CHANGED (&(_ELM_CALENDAR_EVENT_DISPLAY_CHANGED)) + +#endif diff --git a/src/lib/elementary/elm_calendar_eo.legacy.c b/src/lib/elementary/elm_calendar_eo.legacy.c new file mode 100644 index 0000000000..1ddf8af1cb --- /dev/null +++ b/src/lib/elementary/elm_calendar_eo.legacy.c @@ -0,0 +1,132 @@ + +EAPI void +elm_calendar_first_day_of_week_set(Elm_Calendar *obj, Elm_Calendar_Weekday day) +{ + elm_obj_calendar_first_day_of_week_set(obj, day); +} + +EAPI Elm_Calendar_Weekday +elm_calendar_first_day_of_week_get(const Elm_Calendar *obj) +{ + return elm_obj_calendar_first_day_of_week_get(obj); +} + +EAPI void +elm_calendar_selectable_set(Elm_Calendar *obj, Elm_Calendar_Selectable selectable) +{ + elm_obj_calendar_selectable_set(obj, selectable); +} + +EAPI Elm_Calendar_Selectable +elm_calendar_selectable_get(const Elm_Calendar *obj) +{ + return elm_obj_calendar_selectable_get(obj); +} + +EAPI void +elm_calendar_interval_set(Elm_Calendar *obj, double interval) +{ + elm_obj_calendar_interval_set(obj, interval); +} + +EAPI double +elm_calendar_interval_get(const Elm_Calendar *obj) +{ + return elm_obj_calendar_interval_get(obj); +} + +EAPI void +elm_calendar_weekdays_names_set(Elm_Calendar *obj, const char **weekdays) +{ + elm_obj_calendar_weekdays_names_set(obj, weekdays); +} + +EAPI const char ** +elm_calendar_weekdays_names_get(const Elm_Calendar *obj) +{ + return elm_obj_calendar_weekdays_names_get(obj); +} + +EAPI void +elm_calendar_select_mode_set(Elm_Calendar *obj, Elm_Calendar_Select_Mode mode) +{ + elm_obj_calendar_select_mode_set(obj, mode); +} + +EAPI Elm_Calendar_Select_Mode +elm_calendar_select_mode_get(const Elm_Calendar *obj) +{ + return elm_obj_calendar_select_mode_get(obj); +} + +EAPI void +elm_calendar_format_function_set(Elm_Calendar *obj, Elm_Calendar_Format_Cb format_function) +{ + elm_obj_calendar_format_function_set(obj, format_function); +} + +EAPI const Eina_List * +elm_calendar_marks_get(const Elm_Calendar *obj) +{ + return elm_obj_calendar_marks_get(obj); +} + +EAPI void +elm_calendar_date_min_set(Elm_Calendar *obj, const Efl_Time *min) +{ + elm_obj_calendar_date_min_set(obj, min); +} + +EAPI const Efl_Time * +elm_calendar_date_min_get(const Elm_Calendar *obj) +{ + return elm_obj_calendar_date_min_get(obj); +} + +EAPI void +elm_calendar_date_max_set(Elm_Calendar *obj, const Efl_Time *max) +{ + elm_obj_calendar_date_max_set(obj, max); +} + +EAPI const Efl_Time * +elm_calendar_date_max_get(const Elm_Calendar *obj) +{ + return elm_obj_calendar_date_max_get(obj); +} + +EAPI void +elm_calendar_selected_time_set(Elm_Calendar *obj, Efl_Time *selected_time) +{ + elm_obj_calendar_selected_time_set(obj, selected_time); +} + +EAPI Eina_Bool +elm_calendar_selected_time_get(const Elm_Calendar *obj, Efl_Time *selected_time) +{ + return elm_obj_calendar_selected_time_get(obj, selected_time); +} + +EAPI Elm_Calendar_Mark * +elm_calendar_mark_add(Elm_Calendar *obj, const char *mark_type, Efl_Time *mark_time, Elm_Calendar_Mark_Repeat_Type repeat) +{ + return elm_obj_calendar_mark_add(obj, mark_type, mark_time, repeat); +} + +EAPI void +elm_calendar_marks_clear(Elm_Calendar *obj) +{ + elm_obj_calendar_marks_clear(obj); +} + +EAPI void +elm_calendar_marks_draw(Elm_Calendar *obj) +{ + elm_obj_calendar_marks_draw(obj); +} + +EAPI Eina_Bool +elm_calendar_displayed_time_get(const Elm_Calendar *obj, Efl_Time *displayed_time) +{ + return elm_obj_calendar_displayed_time_get(obj, displayed_time); +} diff --git a/src/lib/elementary/elm_calendar_eo.legacy.h b/src/lib/elementary/elm_calendar_eo.legacy.h new file mode 100644 index 0000000000..d014445642 --- /dev/null +++ b/src/lib/elementary/elm_calendar_eo.legacy.h @@ -0,0 +1,524 @@ +#ifndef _ELM_CALENDAR_EO_LEGACY_H_ +#define _ELM_CALENDAR_EO_LEGACY_H_ + +#ifndef _ELM_CALENDAR_EO_CLASS_TYPE +#define _ELM_CALENDAR_EO_CLASS_TYPE + +typedef Eo Elm_Calendar; + +#endif + +#ifndef _ELM_CALENDAR_EO_TYPES +#define _ELM_CALENDAR_EO_TYPES + +/** + * @brief Event periodicity, used to define if a mark should be repeated beyond + * event's day. + * + * It's set when a mark is added. So, for a mark added to 13th May with + * periodicity set to WEEKLY, there will be marks every week after this date. + * Marks will be displayed at 13th, 20th, 27th, 3rd June ... + * + * Values don't work as bitmask, only one can be chosen. See also + * @ref elm_calendar_mark_add. + * + * @ingroup Elm_Calendar_Mark_Repeat + */ +typedef enum +{ + ELM_CALENDAR_UNIQUE = 0, /**< Default value. Marks will be displayed only on + * event day. */ + ELM_CALENDAR_DAILY, /**< Marks will be displayed every day after event day + * (inclusive). */ + ELM_CALENDAR_WEEKLY, /**< Marks will be displayed every week after event day + * (inclusive) - i.e. each seven days. */ + ELM_CALENDAR_MONTHLY, /**< Marks will be displayed every month day that + * coincides to event day. E.g.: if an event is set to + * 30th Jan, no marks will be displayed on Feb, but + * will be displayed on 30th Mar. */ + ELM_CALENDAR_ANNUALLY, /**< Marks will be displayed every year that coincides + * to event day (and month). E.g. an event added to + * 30th Jan 2012 will be repeated on 30th Jan 2013. */ + ELM_CALENDAR_LAST_DAY_OF_MONTH, /**< Marks will be displayed every last day of + * month after event day (inclusive). + * + * @since 1.7 */ + ELM_CALENDAR_REVERSE_DAILY /**< Marks will be displayed every day before event + * day. + * + * @since 1.19 */ +} Elm_Calendar_Mark_Repeat_Type; + +/** + * @brief A weekday + * + * See also @ref elm_calendar_first_day_of_week_set. + * + * @ingroup Elm_Calendar + */ +typedef enum +{ + ELM_DAY_SUNDAY = 0, /**< Sunday weekday */ + ELM_DAY_MONDAY, /**< Monday weekday */ + ELM_DAY_TUESDAY, /**< Tuesday weekday */ + ELM_DAY_WEDNESDAY, /**< Wednesday weekday */ + ELM_DAY_THURSDAY, /**< Thursday weekday */ + ELM_DAY_FRIDAY, /**< Friday weekday */ + ELM_DAY_SATURDAY, /**< Saturday weekday */ + ELM_DAY_LAST /**< Sentinel value to indicate last enum field during iteration + */ +} Elm_Calendar_Weekday; + +/** + * @brief The mode, who determine how user could select a day + * + * See also @ref elm_calendar_select_mode_set() + * + * @ingroup Elm_Calendar_Select + */ +typedef enum +{ + ELM_CALENDAR_SELECT_MODE_DEFAULT = 0, /**< Default value. A day is always + * selected. */ + ELM_CALENDAR_SELECT_MODE_ALWAYS, /**< A day is always selected. */ + ELM_CALENDAR_SELECT_MODE_NONE, /**< None of the days can be selected. */ + ELM_CALENDAR_SELECT_MODE_ONDEMAND /**< User may have selected a day or not. */ +} Elm_Calendar_Select_Mode; + +/** + * @brief A bitmask used to define which fields of a @c tm struct will be taken + * into account, when elm_calendar_selected_time_set() is invoked. + * + * See also @ref elm_calendar_selectable_set, + * @ref elm_calendar_selected_time_set. + * + * @since 1.8 + * + * @ingroup Elm_Calendar + */ +typedef enum +{ + ELM_CALENDAR_SELECTABLE_NONE = 0, /**< Take no field into account */ + ELM_CALENDAR_SELECTABLE_YEAR = 1 /* 1 >> 0 */, /**< Take year field into + * account */ + ELM_CALENDAR_SELECTABLE_MONTH = 2 /* 1 >> 1 */, /**< Take month field into + * account */ + ELM_CALENDAR_SELECTABLE_DAY = 4 /* 1 >> 2 */ /**< Take day field into account + */ +} Elm_Calendar_Selectable; + +/** Item handle for a calendar mark. Created with @ref elm_calendar_mark_add + * and deleted with @ref Elm.Calendar.mark_del. + * + * @ingroup Elm_Calendar + */ +typedef struct _Elm_Calendar_Mark Elm_Calendar_Mark; + + +#endif + +/** + * @brief The first day of week to use on calendar widgets'. + * + * @param[in] obj The object. + * @param[in] day Weekday enum value, see @ref Elm_Calendar_Weekday + * + * @ingroup Elm_Calendar_Group + */ +EAPI void elm_calendar_first_day_of_week_set(Elm_Calendar *obj, Elm_Calendar_Weekday day); + +/** + * @brief The first day of week to use on calendar widgets'. + * + * @param[in] obj The object. + * + * @return Weekday enum value, see @ref Elm_Calendar_Weekday + * + * @ingroup Elm_Calendar_Group + */ +EAPI Elm_Calendar_Weekday elm_calendar_first_day_of_week_get(const Elm_Calendar *obj); + +/** + * @brief Define which fields of a tm struct will be taken into account, when + * Elm.Calendar.selected_time.set is invoked. + * + * By Default the bitmask is set to use all fields of a tm struct (year, month + * and day of the month). + * + * See also @ref elm_calendar_selected_time_set. + * + * @param[in] obj The object. + * @param[in] selectable A bitmask of Elm_Calendar_Selectable + * + * @since 1.8 + * + * @ingroup Elm_Calendar_Group + */ +EAPI void elm_calendar_selectable_set(Elm_Calendar *obj, Elm_Calendar_Selectable selectable); + +/** + * @brief Define which fields of a tm struct will be taken into account, when + * Elm.Calendar.selected_time.set is invoked. + * + * By Default the bitmask is set to use all fields of a tm struct (year, month + * and day of the month). + * + * See also @ref elm_calendar_selected_time_set. + * + * @param[in] obj The object. + * + * @return A bitmask of Elm_Calendar_Selectable + * + * @since 1.8 + * + * @ingroup Elm_Calendar_Group + */ +EAPI Elm_Calendar_Selectable elm_calendar_selectable_get(const Elm_Calendar *obj); + +/** + * @brief The interval on time updates for an user mouse button hold on + * calendar widgets' month/year selection. + * + * This interval value is decreased while the user holds the mouse pointer + * either selecting next or previous month/year. + * + * This helps the user to get to a given month distant from the current one + * easier/faster, as it will start to change quicker and quicker on mouse + * button holds. + * + * The calculation for the next change interval value, starting from the one + * set with this call, is the previous interval divided by 1.05, so it + * decreases a little bit. + * + * The default starting interval value for automatic changes is 0.85 seconds. + * + * @param[in] obj The object. + * @param[in] interval The (first) interval value in seconds + * + * @ingroup Elm_Calendar_Group + */ +EAPI void elm_calendar_interval_set(Elm_Calendar *obj, double interval); + +/** + * @brief The interval on time updates for an user mouse button hold on + * calendar widgets' month/year selection. + * + * This interval value is decreased while the user holds the mouse pointer + * either selecting next or previous month/year. + * + * This helps the user to get to a given month distant from the current one + * easier/faster, as it will start to change quicker and quicker on mouse + * button holds. + * + * The calculation for the next change interval value, starting from the one + * set with this call, is the previous interval divided by 1.05, so it + * decreases a little bit. + * + * The default starting interval value for automatic changes is 0.85 seconds. + * + * @param[in] obj The object. + * + * @return The (first) interval value in seconds + * + * @ingroup Elm_Calendar_Group + */ +EAPI double elm_calendar_interval_get(const Elm_Calendar *obj); + +/** + * @brief Weekdays names to be displayed by the calendar. + * + * By default, weekdays abbreviations get from system are displayed: E.g. for + * an en_US locale: "Sun, Mon, Tue, Wed, Thu, Fri, Sat" + * + * The first string should be related to Sunday, the second to Monday... + * + * See also @ref elm_calendar_weekdays_names_get. + * + * @ref calendar_example_02. @ref calendar_example_05. + * + * @param[in] obj The object. + * @param[in] weekdays Array of seven strings to be used as weekday names. + * Warning: It must have 7 elements, or it will access invalid memory. Warning: + * The strings must be @c null terminated ('@\0'). + * + * @ingroup Elm_Calendar_Group + */ +EAPI void elm_calendar_weekdays_names_set(Elm_Calendar *obj, const char **weekdays); + +/** + * @brief Weekdays names to be displayed by the calendar. + * + * By default, weekdays abbreviations get from system are displayed: E.g. for + * an en_US locale: "Sun, Mon, Tue, Wed, Thu, Fri, Sat" + * + * The first string should be related to Sunday, the second to Monday... + * + * See also @ref elm_calendar_weekdays_names_get. + * + * @ref calendar_example_02. @ref calendar_example_05. + * + * @param[in] obj The object. + * + * @return Array of seven strings to be used as weekday names. Warning: It must + * have 7 elements, or it will access invalid memory. Warning: The strings must + * be @c null terminated ('@\0'). + * + * @ingroup Elm_Calendar_Group + */ +EAPI const char **elm_calendar_weekdays_names_get(const Elm_Calendar *obj); + +/** + * @brief Select day mode to use. + * + * The day selection mode used. + * + * @param[in] obj The object. + * @param[in] mode The select mode to use. + * + * @ingroup Elm_Calendar_Group + */ +EAPI void elm_calendar_select_mode_set(Elm_Calendar *obj, Elm_Calendar_Select_Mode mode); + +/** + * @brief Select day mode to use. + * + * The day selection mode used. + * + * @param[in] obj The object. + * + * @return The select mode to use. + * + * @ingroup Elm_Calendar_Group + */ +EAPI Elm_Calendar_Select_Mode elm_calendar_select_mode_get(const Elm_Calendar *obj); + +/** + * @brief Set a function to format the string that will be used to display + * month and year; + * + * By default it uses strftime with "%B %Y" format string. It should allocate + * the memory that will be used by the string, that will be freed by the widget + * after usage. A pointer to the string and a pointer to the time struct will + * be provided. + * + * @ref calendar_example_02. + * + * @param[in] obj The object. + * @param[in] format_function Function to set the month-year string given the + * selected date. + * + * @ingroup Elm_Calendar_Group + */ +EAPI void elm_calendar_format_function_set(Elm_Calendar *obj, Elm_Calendar_Format_Cb format_function); + +/** + * @brief Get a list of all the calendar marks. + * + * See also @ref elm_calendar_mark_add, @ref Elm.Calendar.mark_del(), + * @ref elm_calendar_marks_clear. + * + * @param[in] obj The object. + * + * @return List with all calendar marks + * + * @ingroup Elm_Calendar_Group + */ +EAPI const Eina_List *elm_calendar_marks_get(const Elm_Calendar *obj); + +/** + * @brief Minimum date on calendar. + * + * See also @ref elm_calendar_date_max_set, @ref elm_calendar_date_max_get + * + * Set minimum date on calendar. + * + * Set the minimum date, changing the displayed month or year if needed. + * Displayed day also to be disabled if it is smaller than minimum date. + * + * @param[in] obj The object. + * @param[in] min A tm struct to point to minimum date. + * + * @since 1.19 + * + * @ingroup Elm_Calendar_Group + */ +EAPI void elm_calendar_date_min_set(Elm_Calendar *obj, const Efl_Time *min); + +/** + * @brief Minimum date on calendar. + * + * See also @ref elm_calendar_date_max_set, @ref elm_calendar_date_max_get + * + * Get minimum date. + * + * Default value is 1 JAN,1902. + * + * @param[in] obj The object. + * + * @return A tm struct to point to minimum date. + * + * @since 1.19 + * + * @ingroup Elm_Calendar_Group + */ +EAPI const Efl_Time *elm_calendar_date_min_get(const Elm_Calendar *obj); + +/** + * @brief Maximum date on calendar. + * + * See also @ref elm_calendar_date_min_set, @ref elm_calendar_date_min_get + * + * Set maximum date on calendar. + * + * Set the maximum date, changing the displayed month or year if needed. + * Displayed day also to be disabled if it is bigger than maximum date. + * + * @param[in] obj The object. + * @param[in] max A tm struct to point to maximum date. + * + * @since 1.19 + * + * @ingroup Elm_Calendar_Group + */ +EAPI void elm_calendar_date_max_set(Elm_Calendar *obj, const Efl_Time *max); + +/** + * @brief Maximum date on calendar. + * + * See also @ref elm_calendar_date_min_set, @ref elm_calendar_date_min_get + * + * Get maximum date. + * + * Default maximum year is -1. Default maximum day and month are 31 and DEC. + * + * If the maximum year is a negative value, it will be limited depending on the + * platform architecture (year 2037 for 32 bits); + * + * @param[in] obj The object. + * + * @return A tm struct to point to maximum date. + * + * @since 1.19 + * + * @ingroup Elm_Calendar_Group + */ +EAPI const Efl_Time *elm_calendar_date_max_get(const Elm_Calendar *obj); + +/** + * @brief Set selected date to be highlighted on calendar. + * + * Set the selected date, changing the displayed month if needed. Selected date + * changes when the user goes to next/previous month or select a day pressing + * over it on calendar. + * + * See also @ref elm_calendar_selected_time_get. + * + * @ref calendar_example_04 + * + * @param[in] obj The object. + * @param[in] selected_time A tm struct to represent the selected date. + * + * @ingroup Elm_Calendar_Group + */ +EAPI void elm_calendar_selected_time_set(Elm_Calendar *obj, Efl_Time *selected_time); + +/** + * @brief Get selected date. + * + * Get date selected by the user or set by function + * @ref elm_calendar_selected_time_set(). Selected date changes when the user + * goes to next/previous month or select a day pressing over it on calendar. + * + * See also @ref elm_calendar_selected_time_get. + * + * @ref calendar_example_05. + * + * @param[in] obj The object. + * @param[in,out] selected_time A tm struct to point to selected date. + * + * @return @c true if the method succeeded, @c false otherwise + * + * @ingroup Elm_Calendar_Group + */ +EAPI Eina_Bool elm_calendar_selected_time_get(const Elm_Calendar *obj, Efl_Time *selected_time); + +/** + * @brief Add a new mark to the calendar + * + * Add a mark that will be drawn in the calendar respecting the insertion time + * and periodicity. It will emit the type as signal to the widget theme. + * Default theme supports "holiday" and "checked", but it can be extended. + * + * It won't immediately update the calendar, drawing the marks. For this, + * @ref elm_calendar_marks_draw(). However, when user selects next or previous + * month calendar forces marks drawn. + * + * Marks created with this method can be deleted with + * @ref Elm.Calendar.mark_del(). + * + * See also @ref elm_calendar_marks_draw, @ref Elm.Calendar.mark_del(). + * + * @ref calendar_example_06 + * + * @param[in] obj The object. + * @param[in] mark_type A string used to define the type of mark. It will be + * emitted to the theme, that should display a related modification on these + * days representation. + * @param[in] mark_time A time struct to represent the date of inclusion of the + * mark. For marks that repeats it will just be displayed after the inclusion + * date in the calendar. + * @param[in] repeat Repeat the event following this periodicity. Can be a + * unique mark (that don't repeat), daily, weekly, monthly or annually. + * + * @return The newly added calendar mark + * + * @ingroup Elm_Calendar_Group + */ +EAPI Elm_Calendar_Mark *elm_calendar_mark_add(Elm_Calendar *obj, const char *mark_type, Efl_Time *mark_time, Elm_Calendar_Mark_Repeat_Type repeat); + + +/** + * @brief Remove all calendar's marks + * + * See also @ref elm_calendar_mark_add, @ref Elm.Calendar.mark_del(). + * @param[in] obj The object. + * + * @ingroup Elm_Calendar_Group + */ +EAPI void elm_calendar_marks_clear(Elm_Calendar *obj); + +/** + * @brief Draw calendar marks. + * + * Should be used after adding, removing or clearing marks. It will go through + * the entire marks list updating the calendar. If lots of marks will be added, + * add all the marks and then call this function. + * + * When the month is changed, i.e. user selects next or previous month, marks + * will be drawn. + * + * See also @ref elm_calendar_mark_add, @ref Elm.Calendar.mark_del(), + * @ref elm_calendar_marks_clear. + * + * @ref calendar_example_06 + * @param[in] obj The object. + * + * @ingroup Elm_Calendar_Group + */ +EAPI void elm_calendar_marks_draw(Elm_Calendar *obj); + +/** + * @brief Get the current time displayed in the widget + * + * @param[in] obj The object. + * @param[in,out] displayed_time A tm struct to point to displayed date. + * + * @return @c true if the method succeeded, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Calendar_Group + */ +EAPI Eina_Bool elm_calendar_displayed_time_get(const Elm_Calendar *obj, Efl_Time *displayed_time); + +#endif diff --git a/src/lib/elementary/elm_calendar_item.eo b/src/lib/elementary/elm_calendar_item.eo deleted file mode 100644 index 3bb6f4dc46..0000000000 --- a/src/lib/elementary/elm_calendar_item.eo +++ /dev/null @@ -1,17 +0,0 @@ -class Elm.Calendar.Item extends Efl.Object implements Efl.Ui.Focus.Object -{ - [[Elm Calendar Item class]] - methods { - @property day_number { - [[Day number property]] - values { - i : int; [[Day number]] - } - } - } - implements { - Efl.Ui.Focus.Object.focus {set;} - Efl.Ui.Focus.Object.focus_parent {get;} - Efl.Ui.Focus.Object.focus_geometry {get;} - } -} diff --git a/src/lib/elementary/elm_calendar_item_eo.c b/src/lib/elementary/elm_calendar_item_eo.c new file mode 100644 index 0000000000..8c98817768 --- /dev/null +++ b/src/lib/elementary/elm_calendar_item_eo.c @@ -0,0 +1,85 @@ + +void _elm_calendar_item_day_number_set(Eo *obj, Elm_Calendar_Item_Data *pd, int i); + + +static Eina_Error +__eolian_elm_calendar_item_day_number_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_calendar_item_day_number_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_calendar_item_day_number_set, EFL_FUNC_CALL(i), int i); + +int _elm_calendar_item_day_number_get(const Eo *obj, Elm_Calendar_Item_Data *pd); + + +static Eina_Value +__eolian_elm_calendar_item_day_number_get_reflect(const Eo *obj) +{ + int val = elm_calendar_item_day_number_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_calendar_item_day_number_get, int, 0); + +void _elm_calendar_item_efl_ui_focus_object_focus_set(Eo *obj, Elm_Calendar_Item_Data *pd, Eina_Bool focus); + + +Efl_Ui_Focus_Object *_elm_calendar_item_efl_ui_focus_object_focus_parent_get(const Eo *obj, Elm_Calendar_Item_Data *pd); + + +Eina_Rect _elm_calendar_item_efl_ui_focus_object_focus_geometry_get(const Eo *obj, Elm_Calendar_Item_Data *pd); + + +static Eina_Bool +_elm_calendar_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_CALENDAR_ITEM_EXTRA_OPS +#define ELM_CALENDAR_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_calendar_item_day_number_set, _elm_calendar_item_day_number_set), + EFL_OBJECT_OP_FUNC(elm_calendar_item_day_number_get, _elm_calendar_item_day_number_get), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_focus_set, _elm_calendar_item_efl_ui_focus_object_focus_set), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_focus_parent_get, _elm_calendar_item_efl_ui_focus_object_focus_parent_get), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_focus_geometry_get, _elm_calendar_item_efl_ui_focus_object_focus_geometry_get), + ELM_CALENDAR_ITEM_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"day_number", __eolian_elm_calendar_item_day_number_set_reflect, __eolian_elm_calendar_item_day_number_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_calendar_item_class_desc = { + EO_VERSION, + "Elm.Calendar.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Calendar_Item_Data), + _elm_calendar_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_calendar_item_class_get, &_elm_calendar_item_class_desc, EFL_OBJECT_CLASS, EFL_UI_FOCUS_OBJECT_MIXIN, NULL); diff --git a/src/lib/elementary/elm_calendar_item_eo.h b/src/lib/elementary/elm_calendar_item_eo.h new file mode 100644 index 0000000000..39f5c435bf --- /dev/null +++ b/src/lib/elementary/elm_calendar_item_eo.h @@ -0,0 +1,45 @@ +#ifndef _ELM_CALENDAR_ITEM_EO_H_ +#define _ELM_CALENDAR_ITEM_EO_H_ + +#ifndef _ELM_CALENDAR_ITEM_EO_CLASS_TYPE +#define _ELM_CALENDAR_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Calendar_Item; + +#endif + +#ifndef _ELM_CALENDAR_ITEM_EO_TYPES +#define _ELM_CALENDAR_ITEM_EO_TYPES + + +#endif +/** Elm Calendar Item class + * + * @ingroup Elm_Calendar_Item + */ +#define ELM_CALENDAR_ITEM_CLASS elm_calendar_item_class_get() + +EWAPI const Efl_Class *elm_calendar_item_class_get(void); + +/** + * @brief Day number property + * + * @param[in] obj The object. + * @param[in] i Day number + * + * @ingroup Elm_Calendar_Item + */ +EOAPI void elm_calendar_item_day_number_set(Eo *obj, int i); + +/** + * @brief Day number property + * + * @param[in] obj The object. + * + * @return Day number + * + * @ingroup Elm_Calendar_Item + */ +EOAPI int elm_calendar_item_day_number_get(const Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_calendar_item_eo.legacy.h b/src/lib/elementary/elm_calendar_item_eo.legacy.h new file mode 100644 index 0000000000..f406a7f060 --- /dev/null +++ b/src/lib/elementary/elm_calendar_item_eo.legacy.h @@ -0,0 +1,19 @@ +#ifndef _ELM_CALENDAR_ITEM_EO_LEGACY_H_ +#define _ELM_CALENDAR_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_CALENDAR_ITEM_EO_CLASS_TYPE +#define _ELM_CALENDAR_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Calendar_Item; + +#endif + +#ifndef _ELM_CALENDAR_ITEM_EO_TYPES +#define _ELM_CALENDAR_ITEM_EO_TYPES + + +#endif + + + +#endif diff --git a/src/lib/elementary/elm_calendar_legacy.h b/src/lib/elementary/elm_calendar_legacy.h index adb6a6b80e..8f450c79a3 100644 --- a/src/lib/elementary/elm_calendar_legacy.h +++ b/src/lib/elementary/elm_calendar_legacy.h @@ -1,4 +1,4 @@ -#include "elm_calendar.eo.legacy.h" +#include "elm_calendar_eo.legacy.h" /** * Add a new calendar widget to the given parent Elementary diff --git a/src/lib/elementary/elm_check.h b/src/lib/elementary/elm_check.h index b0e404e8bc..492494a2f8 100644 --- a/src/lib/elementary/elm_check.h +++ b/src/lib/elementary/elm_check.h @@ -59,10 +59,8 @@ * @{ */ -#ifdef EFL_EO_API_SUPPORT -#include "efl_ui_check_eo.h" #define EFL_UI_CHECK_EVENT_CHANGED EFL_UI_NSTATE_EVENT_CHANGED -#endif + #ifndef EFL_NOLEGACY_API_SUPPORT #include "elm_check_legacy.h" #endif diff --git a/src/lib/elementary/elm_check_legacy.h b/src/lib/elementary/elm_check_legacy.h index e5c702770a..075203693e 100644 --- a/src/lib/elementary/elm_check_legacy.h +++ b/src/lib/elementary/elm_check_legacy.h @@ -51,6 +51,4 @@ EAPI void elm_check_state_set(Evas_Object *obj, Eina_Bool */ EAPI void elm_check_state_pointer_set(Evas_Object *obj, Eina_Bool *statep); -#ifdef EFL_EO_API_SUPPORT -# include "efl_ui_check.eo.legacy.h" -#endif +# include "efl_ui_check_eo.legacy.h" diff --git a/src/lib/elementary/elm_clock.c b/src/lib/elementary/elm_clock.c index 2ace344c76..9b6caa147a 100644 --- a/src/lib/elementary/elm_clock.c +++ b/src/lib/elementary/elm_clock.c @@ -627,13 +627,13 @@ _time_update(Evas_Object *obj, Eina_Bool theme_update) sd->cur.ampm = -1; } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_clock_efl_ui_widget_theme_apply(Eo *obj, Elm_Clock_Data *sd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _time_update(obj, EINA_TRUE); @@ -722,7 +722,6 @@ _elm_clock_efl_canvas_group_group_add(Eo *obj, Elm_Clock_Data *priv) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->cur.ampm = -1; priv->cur.seconds = EINA_TRUE; @@ -964,4 +963,4 @@ _elm_clock_class_constructor(Efl_Class *klass) #define ELM_CLOCK_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_clock) -#include "elm_clock.eo.c" +#include "elm_clock_eo.c" diff --git a/src/lib/elementary/elm_clock.eo b/src/lib/elementary/elm_clock.eo deleted file mode 100644 index 65813b717b..0000000000 --- a/src/lib/elementary/elm_clock.eo +++ /dev/null @@ -1,172 +0,0 @@ -enum Elm.Clock.Edit_Mode -{ - [[Identifiers for which clock digits should be editable, when a - clock widget is in editing mode. Values may be OR-ed together to - make a mask, naturally. - - See also @Elm.Clock.edit.set, @Elm.Clock.edit_mode.set. - ]] - - legacy: elm_clock_edit; - default = 0, [[Default value. Means that all digits are editable, when in editing mode.]] - hour_decimal = 1 << 0, [[Decimal digit of hours value should be editable.]] - hour_unit = 1 << 1, [[Unit digit of hours value should be editable.]] - min_decimal = 1 << 2, [[Decimal digit of minutes value should be editable.]] - min_unit = 1 << 3, [[Unit digit of minutes value should be editable.]] - sec_decimal = 1 << 4, [[Decimal digit of seconds value should be editable.]] - sec_unit = 1 << 5, [[Unit digit of seconds value should be editable.]] - all = (1 << 6) - 1 [[All digits should be editable.]] -} - -class Elm.Clock extends Efl.Ui.Layout implements Efl.Ui.Focus.Composition, Efl.Ui.Legacy -{ - [[Digital clock widget - - This is a digital clock widget. In its default theme, it has a vintage "flipping numbers clock" - appearance, which will animate sheets of individual algorisms individually as time goes by. - - A newly created clock will fetch system's time (already considering local time adjustments) to - start with, and will tick accordingly. - ]] - legacy_prefix: elm_clock; - eo_prefix: elm_obj_clock; - event_prefix: elm_clock; - methods { - @property show_am_pm { - [[If the given clock widget must show hours in military or am/pm mode - - Set if the clock must show hours in military or am/pm mode. In some - countries like Brazil the military mode (00-24h-format) is used, in - opposition to the USA, where the am/pm mode is more commonly used. - ]] - set { - } - get { - } - values { - am_pm: bool; [[$true to put it in am/pm mode, $false to military mode]] - } - } - @property first_interval { - [[The first interval on time updates for a user mouse button hold - on clock widgets' time editing. - - This interval value is decreased while the user holds the - mouse pointer either incrementing or decrementing a given the - clock digit's value. - - This helps the user to get to a given time distant from the - current one easier/faster, as it will start to flip quicker and - quicker on mouse button holds. - - The calculation for the next flip interval value, starting from - the one set with this call, is the previous interval divided by - 1.05, so it decreases a little bit. - - The default starting interval value for automatic flips is - 0.85 seconds. - ]] - set { - } - get { - } - values { - interval: double; [[The first interval value in seconds]] - } - } - @property show_seconds { - [[If the given clock widget must show time with seconds or not - - This function sets if the given clock must show or not elapsed - seconds. By default, they are not shown. - ]] - set { - } - get { - } - values { - seconds: bool; [[$true to show seconds, $false otherwise.]] - } - } - @property edit { - [[Whether a given clock widget is under editing mode or - under (default) displaying-only mode. - - This function makes a clock's time to be editable or not by - user interaction. When in editing mode, clocks stop - ticking, until one brings them back to display mode. The - @.edit_mode.set function will influence which digits - of the clock will be editable. - - Note: am/pm sheets, if being shown, will always be editable - under editing mode. - ]] - set { - } - get { - } - values { - edit: bool; [[$true to put it in editing, $false to - put it back to "displaying only" mode]] - } - } - @property pause { - [[Whether the given clock widget should be paused or not. - - This function pauses or starts the clock widget. - - @since 1.9 - ]] - set { - } - get { - } - values { - paused: bool; [[$true to pause clock, $false otherwise]] - } - } - @property time { - [[Clock widget's time - - Values must be set within 0-23 for hours and - 0-59 for minutes and seconds, even if the clock - is not in "military" mode. - ]] - set { - [[Warning: The behavior for values set out of those ranges is - undefined. - ]] - } - get { - [[Note: Use $null pointers on the time values you're not - interested in: they'll be ignored by the function. - ]] - } - values { - hrs: int; [[The hours to set]] - min: int; [[The minutes to set]] - sec: int; [[The seconds to set]] - } - } - @property edit_mode { - [[Digits of the given clock widget should be editable when in editing mode.]] - set { - } - get { - } - values { - digedit: Elm.Clock.Edit_Mode; [[Bit mask indicating the digits to be editable - (values in @Elm.Clock.Edit_Mode).]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.on_access_update; - Efl.Ui.Widget.theme_apply; - } - events { - changed: void; [[The clock's user changed the time]] - } -} diff --git a/src/lib/elementary/elm_clock_eo.c b/src/lib/elementary/elm_clock_eo.c new file mode 100644 index 0000000000..b5bfc9f099 --- /dev/null +++ b/src/lib/elementary/elm_clock_eo.c @@ -0,0 +1,249 @@ +EWAPI const Efl_Event_Description _ELM_CLOCK_EVENT_CHANGED = + EFL_EVENT_DESCRIPTION("changed"); + +void _elm_clock_show_am_pm_set(Eo *obj, Elm_Clock_Data *pd, Eina_Bool am_pm); + + +static Eina_Error +__eolian_elm_clock_show_am_pm_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_clock_show_am_pm_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_clock_show_am_pm_set, EFL_FUNC_CALL(am_pm), Eina_Bool am_pm); + +Eina_Bool _elm_clock_show_am_pm_get(const Eo *obj, Elm_Clock_Data *pd); + + +static Eina_Value +__eolian_elm_clock_show_am_pm_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_clock_show_am_pm_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_clock_show_am_pm_get, Eina_Bool, 0); + +void _elm_clock_first_interval_set(Eo *obj, Elm_Clock_Data *pd, double interval); + + +static Eina_Error +__eolian_elm_clock_first_interval_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_clock_first_interval_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_clock_first_interval_set, EFL_FUNC_CALL(interval), double interval); + +double _elm_clock_first_interval_get(const Eo *obj, Elm_Clock_Data *pd); + + +static Eina_Value +__eolian_elm_clock_first_interval_get_reflect(const Eo *obj) +{ + double val = elm_obj_clock_first_interval_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_clock_first_interval_get, double, 0); + +void _elm_clock_show_seconds_set(Eo *obj, Elm_Clock_Data *pd, Eina_Bool seconds); + + +static Eina_Error +__eolian_elm_clock_show_seconds_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_clock_show_seconds_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_clock_show_seconds_set, EFL_FUNC_CALL(seconds), Eina_Bool seconds); + +Eina_Bool _elm_clock_show_seconds_get(const Eo *obj, Elm_Clock_Data *pd); + + +static Eina_Value +__eolian_elm_clock_show_seconds_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_clock_show_seconds_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_clock_show_seconds_get, Eina_Bool, 0); + +void _elm_clock_edit_set(Eo *obj, Elm_Clock_Data *pd, Eina_Bool edit); + + +static Eina_Error +__eolian_elm_clock_edit_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_clock_edit_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_clock_edit_set, EFL_FUNC_CALL(edit), Eina_Bool edit); + +Eina_Bool _elm_clock_edit_get(const Eo *obj, Elm_Clock_Data *pd); + + +static Eina_Value +__eolian_elm_clock_edit_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_clock_edit_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_clock_edit_get, Eina_Bool, 0); + +void _elm_clock_pause_set(Eo *obj, Elm_Clock_Data *pd, Eina_Bool paused); + + +static Eina_Error +__eolian_elm_clock_pause_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_clock_pause_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_clock_pause_set, EFL_FUNC_CALL(paused), Eina_Bool paused); + +Eina_Bool _elm_clock_pause_get(const Eo *obj, Elm_Clock_Data *pd); + + +static Eina_Value +__eolian_elm_clock_pause_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_clock_pause_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_clock_pause_get, Eina_Bool, 0); + +void _elm_clock_time_set(Eo *obj, Elm_Clock_Data *pd, int hrs, int min, int sec); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_clock_time_set, EFL_FUNC_CALL(hrs, min, sec), int hrs, int min, int sec); + +void _elm_clock_time_get(const Eo *obj, Elm_Clock_Data *pd, int *hrs, int *min, int *sec); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_clock_time_get, EFL_FUNC_CALL(hrs, min, sec), int *hrs, int *min, int *sec); + +void _elm_clock_edit_mode_set(Eo *obj, Elm_Clock_Data *pd, Elm_Clock_Edit_Mode digedit); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_clock_edit_mode_set, EFL_FUNC_CALL(digedit), Elm_Clock_Edit_Mode digedit); + +Elm_Clock_Edit_Mode _elm_clock_edit_mode_get(const Eo *obj, Elm_Clock_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_clock_edit_mode_get, Elm_Clock_Edit_Mode, 0); + +Efl_Object *_elm_clock_efl_object_constructor(Eo *obj, Elm_Clock_Data *pd); + + +void _elm_clock_efl_ui_widget_on_access_update(Eo *obj, Elm_Clock_Data *pd, Eina_Bool enable); + + +Eina_Error _elm_clock_efl_ui_widget_theme_apply(Eo *obj, Elm_Clock_Data *pd); + + +static Eina_Bool +_elm_clock_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_CLOCK_EXTRA_OPS +#define ELM_CLOCK_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_clock_show_am_pm_set, _elm_clock_show_am_pm_set), + EFL_OBJECT_OP_FUNC(elm_obj_clock_show_am_pm_get, _elm_clock_show_am_pm_get), + EFL_OBJECT_OP_FUNC(elm_obj_clock_first_interval_set, _elm_clock_first_interval_set), + EFL_OBJECT_OP_FUNC(elm_obj_clock_first_interval_get, _elm_clock_first_interval_get), + EFL_OBJECT_OP_FUNC(elm_obj_clock_show_seconds_set, _elm_clock_show_seconds_set), + EFL_OBJECT_OP_FUNC(elm_obj_clock_show_seconds_get, _elm_clock_show_seconds_get), + EFL_OBJECT_OP_FUNC(elm_obj_clock_edit_set, _elm_clock_edit_set), + EFL_OBJECT_OP_FUNC(elm_obj_clock_edit_get, _elm_clock_edit_get), + EFL_OBJECT_OP_FUNC(elm_obj_clock_pause_set, _elm_clock_pause_set), + EFL_OBJECT_OP_FUNC(elm_obj_clock_pause_get, _elm_clock_pause_get), + EFL_OBJECT_OP_FUNC(elm_obj_clock_time_set, _elm_clock_time_set), + EFL_OBJECT_OP_FUNC(elm_obj_clock_time_get, _elm_clock_time_get), + EFL_OBJECT_OP_FUNC(elm_obj_clock_edit_mode_set, _elm_clock_edit_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_clock_edit_mode_get, _elm_clock_edit_mode_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_clock_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_clock_efl_ui_widget_on_access_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_clock_efl_ui_widget_theme_apply), + ELM_CLOCK_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"show_am_pm", __eolian_elm_clock_show_am_pm_set_reflect, __eolian_elm_clock_show_am_pm_get_reflect}, + {"first_interval", __eolian_elm_clock_first_interval_set_reflect, __eolian_elm_clock_first_interval_get_reflect}, + {"show_seconds", __eolian_elm_clock_show_seconds_set_reflect, __eolian_elm_clock_show_seconds_get_reflect}, + {"edit", __eolian_elm_clock_edit_set_reflect, __eolian_elm_clock_edit_get_reflect}, + {"pause", __eolian_elm_clock_pause_set_reflect, __eolian_elm_clock_pause_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_clock_class_desc = { + EO_VERSION, + "Elm.Clock", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Clock_Data), + _elm_clock_class_initializer, + _elm_clock_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_clock_class_get, &_elm_clock_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_clock_eo.legacy.c" diff --git a/src/lib/elementary/elm_clock_eo.h b/src/lib/elementary/elm_clock_eo.h index 2af6c1bf69..0236dd26c4 100644 --- a/src/lib/elementary/elm_clock_eo.h +++ b/src/lib/elementary/elm_clock_eo.h @@ -1 +1,304 @@ -#include "elm_clock.eo.h" \ No newline at end of file +#ifndef _ELM_CLOCK_EO_H_ +#define _ELM_CLOCK_EO_H_ + +#ifndef _ELM_CLOCK_EO_CLASS_TYPE +#define _ELM_CLOCK_EO_CLASS_TYPE + +typedef Eo Elm_Clock; + +#endif + +#ifndef _ELM_CLOCK_EO_TYPES +#define _ELM_CLOCK_EO_TYPES + +/** + * @brief Identifiers for which clock digits should be editable, when a clock + * widget is in editing mode. Values may be OR-ed together to make a mask, + * naturally. + * + * See also @ref elm_obj_clock_edit_set, @ref elm_obj_clock_edit_mode_set. + * + * @ingroup Elm_Clock + */ +typedef enum +{ + ELM_CLOCK_EDIT_DEFAULT = 0, /**< Default value. Means that all digits are + * editable, when in editing mode. */ + ELM_CLOCK_EDIT_HOUR_DECIMAL = 1 /* 1 >> 0 */, /**< Decimal digit of hours + * value should be editable. */ + ELM_CLOCK_EDIT_HOUR_UNIT = 2 /* 1 >> 1 */, /**< Unit digit of hours value + * should be editable. */ + ELM_CLOCK_EDIT_MIN_DECIMAL = 4 /* 1 >> 2 */, /**< Decimal digit of minutes + * value should be editable. */ + ELM_CLOCK_EDIT_MIN_UNIT = 8 /* 1 >> 3 */, /**< Unit digit of minutes value + * should be editable. */ + ELM_CLOCK_EDIT_SEC_DECIMAL = 16 /* 1 >> 4 */, /**< Decimal digit of seconds + * value should be editable. */ + ELM_CLOCK_EDIT_SEC_UNIT = 32 /* 1 >> 5 */, /**< Unit digit of seconds value + * should be editable. */ + ELM_CLOCK_EDIT_ALL = 63 /* (1 >> 6) * 1 */ /**< All digits should be editable. + */ +} Elm_Clock_Edit_Mode; + + +#endif +/** + * @brief Digital clock widget + * + * This is a digital clock widget. In its default theme, it has a vintage + * "flipping numbers clock" appearance, which will animate sheets of individual + * algorisms individually as time goes by. + * + * A newly created clock will fetch system's time (already considering local + * time adjustments) to start with, and will tick accordingly. + * + * @ingroup Elm_Clock + */ +#define ELM_CLOCK_CLASS elm_clock_class_get() + +EWAPI const Efl_Class *elm_clock_class_get(void); + +/** + * @brief If the given clock widget must show hours in military or am/pm mode + * + * Set if the clock must show hours in military or am/pm mode. In some + * countries like Brazil the military mode (00-24h-format) is used, in + * opposition to the USA, where the am/pm mode is more commonly used. + * + * @param[in] obj The object. + * @param[in] am_pm @c true to put it in am/pm mode, @c false to military mode + * + * @ingroup Elm_Clock + */ +EOAPI void elm_obj_clock_show_am_pm_set(Eo *obj, Eina_Bool am_pm); + +/** + * @brief If the given clock widget must show hours in military or am/pm mode + * + * Set if the clock must show hours in military or am/pm mode. In some + * countries like Brazil the military mode (00-24h-format) is used, in + * opposition to the USA, where the am/pm mode is more commonly used. + * + * @param[in] obj The object. + * + * @return @c true to put it in am/pm mode, @c false to military mode + * + * @ingroup Elm_Clock + */ +EOAPI Eina_Bool elm_obj_clock_show_am_pm_get(const Eo *obj); + +/** + * @brief The first interval on time updates for a user mouse button hold on + * clock widgets' time editing. + * + * This interval value is decreased while the user holds the mouse pointer + * either incrementing or decrementing a given the clock digit's value. + * + * This helps the user to get to a given time distant from the current one + * easier/faster, as it will start to flip quicker and quicker on mouse button + * holds. + * + * The calculation for the next flip interval value, starting from the one set + * with this call, is the previous interval divided by 1.05, so it decreases a + * little bit. + * + * The default starting interval value for automatic flips is 0.85 seconds. + * + * @param[in] obj The object. + * @param[in] interval The first interval value in seconds + * + * @ingroup Elm_Clock + */ +EOAPI void elm_obj_clock_first_interval_set(Eo *obj, double interval); + +/** + * @brief The first interval on time updates for a user mouse button hold on + * clock widgets' time editing. + * + * This interval value is decreased while the user holds the mouse pointer + * either incrementing or decrementing a given the clock digit's value. + * + * This helps the user to get to a given time distant from the current one + * easier/faster, as it will start to flip quicker and quicker on mouse button + * holds. + * + * The calculation for the next flip interval value, starting from the one set + * with this call, is the previous interval divided by 1.05, so it decreases a + * little bit. + * + * The default starting interval value for automatic flips is 0.85 seconds. + * + * @param[in] obj The object. + * + * @return The first interval value in seconds + * + * @ingroup Elm_Clock + */ +EOAPI double elm_obj_clock_first_interval_get(const Eo *obj); + +/** + * @brief If the given clock widget must show time with seconds or not + * + * This function sets if the given clock must show or not elapsed seconds. By + * default, they are not shown. + * + * @param[in] obj The object. + * @param[in] seconds @c true to show seconds, @c false otherwise. + * + * @ingroup Elm_Clock + */ +EOAPI void elm_obj_clock_show_seconds_set(Eo *obj, Eina_Bool seconds); + +/** + * @brief If the given clock widget must show time with seconds or not + * + * This function sets if the given clock must show or not elapsed seconds. By + * default, they are not shown. + * + * @param[in] obj The object. + * + * @return @c true to show seconds, @c false otherwise. + * + * @ingroup Elm_Clock + */ +EOAPI Eina_Bool elm_obj_clock_show_seconds_get(const Eo *obj); + +/** + * @brief Whether a given clock widget is under editing mode or under (default) + * displaying-only mode. + * + * This function makes a clock's time to be editable or not by user + * interaction. When in editing mode, clocks stop ticking, until one brings + * them back to display mode. The @ref elm_obj_clock_edit_mode_set function + * will influence which digits of the clock will be editable. + * + * @note am/pm sheets, if being shown, will always be editable under editing + * mode. + * + * @param[in] obj The object. + * @param[in] edit @c true to put it in editing, @c false to put it back to + * "displaying only" mode + * + * @ingroup Elm_Clock + */ +EOAPI void elm_obj_clock_edit_set(Eo *obj, Eina_Bool edit); + +/** + * @brief Whether a given clock widget is under editing mode or under (default) + * displaying-only mode. + * + * This function makes a clock's time to be editable or not by user + * interaction. When in editing mode, clocks stop ticking, until one brings + * them back to display mode. The @ref elm_obj_clock_edit_mode_set function + * will influence which digits of the clock will be editable. + * + * @note am/pm sheets, if being shown, will always be editable under editing + * mode. + * + * @param[in] obj The object. + * + * @return @c true to put it in editing, @c false to put it back to "displaying + * only" mode + * + * @ingroup Elm_Clock + */ +EOAPI Eina_Bool elm_obj_clock_edit_get(const Eo *obj); + +/** + * @brief Whether the given clock widget should be paused or not. + * + * This function pauses or starts the clock widget. + * + * @param[in] obj The object. + * @param[in] paused @c true to pause clock, @c false otherwise + * + * @since 1.9 + * + * @ingroup Elm_Clock + */ +EOAPI void elm_obj_clock_pause_set(Eo *obj, Eina_Bool paused); + +/** + * @brief Whether the given clock widget should be paused or not. + * + * This function pauses or starts the clock widget. + * + * @param[in] obj The object. + * + * @return @c true to pause clock, @c false otherwise + * + * @since 1.9 + * + * @ingroup Elm_Clock + */ +EOAPI Eina_Bool elm_obj_clock_pause_get(const Eo *obj); + +/** + * @brief Clock widget's time + * + * Values must be set within 0-23 for hours and 0-59 for minutes and seconds, + * even if the clock is not in "military" mode. + * + * @warning The behavior for values set out of those ranges is undefined. + * + * @param[in] obj The object. + * @param[in] hrs The hours to set + * @param[in] min The minutes to set + * @param[in] sec The seconds to set + * + * @ingroup Elm_Clock + */ +EOAPI void elm_obj_clock_time_set(Eo *obj, int hrs, int min, int sec); + +/** + * @brief Clock widget's time + * + * Values must be set within 0-23 for hours and 0-59 for minutes and seconds, + * even if the clock is not in "military" mode. + * + * @note Use @c null pointers on the time values you're not interested in: + * they'll be ignored by the function. + * + * @param[in] obj The object. + * @param[out] hrs The hours to set + * @param[out] min The minutes to set + * @param[out] sec The seconds to set + * + * @ingroup Elm_Clock + */ +EOAPI void elm_obj_clock_time_get(const Eo *obj, int *hrs, int *min, int *sec); + +/** + * @brief Digits of the given clock widget should be editable when in editing + * mode. + * + * @param[in] obj The object. + * @param[in] digedit Bit mask indicating the digits to be editable (values in + * @ref Elm_Clock_Edit_Mode). + * + * @ingroup Elm_Clock + */ +EOAPI void elm_obj_clock_edit_mode_set(Eo *obj, Elm_Clock_Edit_Mode digedit); + +/** + * @brief Digits of the given clock widget should be editable when in editing + * mode. + * + * @param[in] obj The object. + * + * @return Bit mask indicating the digits to be editable (values in + * @ref Elm_Clock_Edit_Mode). + * + * @ingroup Elm_Clock + */ +EOAPI Elm_Clock_Edit_Mode elm_obj_clock_edit_mode_get(const Eo *obj); + +EWAPI extern const Efl_Event_Description _ELM_CLOCK_EVENT_CHANGED; + +/** The clock's user changed the time + * + * @ingroup Elm_Clock + */ +#define ELM_CLOCK_EVENT_CHANGED (&(_ELM_CLOCK_EVENT_CHANGED)) + +#endif diff --git a/src/lib/elementary/elm_clock_eo.legacy.c b/src/lib/elementary/elm_clock_eo.legacy.c new file mode 100644 index 0000000000..1764596e17 --- /dev/null +++ b/src/lib/elementary/elm_clock_eo.legacy.c @@ -0,0 +1,84 @@ + +EAPI void +elm_clock_show_am_pm_set(Elm_Clock *obj, Eina_Bool am_pm) +{ + elm_obj_clock_show_am_pm_set(obj, am_pm); +} + +EAPI Eina_Bool +elm_clock_show_am_pm_get(const Elm_Clock *obj) +{ + return elm_obj_clock_show_am_pm_get(obj); +} + +EAPI void +elm_clock_first_interval_set(Elm_Clock *obj, double interval) +{ + elm_obj_clock_first_interval_set(obj, interval); +} + +EAPI double +elm_clock_first_interval_get(const Elm_Clock *obj) +{ + return elm_obj_clock_first_interval_get(obj); +} + +EAPI void +elm_clock_show_seconds_set(Elm_Clock *obj, Eina_Bool seconds) +{ + elm_obj_clock_show_seconds_set(obj, seconds); +} + +EAPI Eina_Bool +elm_clock_show_seconds_get(const Elm_Clock *obj) +{ + return elm_obj_clock_show_seconds_get(obj); +} + +EAPI void +elm_clock_edit_set(Elm_Clock *obj, Eina_Bool edit) +{ + elm_obj_clock_edit_set(obj, edit); +} + +EAPI Eina_Bool +elm_clock_edit_get(const Elm_Clock *obj) +{ + return elm_obj_clock_edit_get(obj); +} + +EAPI void +elm_clock_pause_set(Elm_Clock *obj, Eina_Bool paused) +{ + elm_obj_clock_pause_set(obj, paused); +} + +EAPI Eina_Bool +elm_clock_pause_get(const Elm_Clock *obj) +{ + return elm_obj_clock_pause_get(obj); +} + +EAPI void +elm_clock_time_set(Elm_Clock *obj, int hrs, int min, int sec) +{ + elm_obj_clock_time_set(obj, hrs, min, sec); +} + +EAPI void +elm_clock_time_get(const Elm_Clock *obj, int *hrs, int *min, int *sec) +{ + elm_obj_clock_time_get(obj, hrs, min, sec); +} + +EAPI void +elm_clock_edit_mode_set(Elm_Clock *obj, Elm_Clock_Edit_Mode digedit) +{ + elm_obj_clock_edit_mode_set(obj, digedit); +} + +EAPI Elm_Clock_Edit_Mode +elm_clock_edit_mode_get(const Elm_Clock *obj) +{ + return elm_obj_clock_edit_mode_get(obj); +} diff --git a/src/lib/elementary/elm_clock_eo.legacy.h b/src/lib/elementary/elm_clock_eo.legacy.h new file mode 100644 index 0000000000..957150e1f5 --- /dev/null +++ b/src/lib/elementary/elm_clock_eo.legacy.h @@ -0,0 +1,281 @@ +#ifndef _ELM_CLOCK_EO_LEGACY_H_ +#define _ELM_CLOCK_EO_LEGACY_H_ + +#ifndef _ELM_CLOCK_EO_CLASS_TYPE +#define _ELM_CLOCK_EO_CLASS_TYPE + +typedef Eo Elm_Clock; + +#endif + +#ifndef _ELM_CLOCK_EO_TYPES +#define _ELM_CLOCK_EO_TYPES + +/** + * @brief Identifiers for which clock digits should be editable, when a clock + * widget is in editing mode. Values may be OR-ed together to make a mask, + * naturally. + * + * See also @ref elm_clock_edit_set, @ref elm_clock_edit_mode_set. + * + * @ingroup Elm_Clock + */ +typedef enum +{ + ELM_CLOCK_EDIT_DEFAULT = 0, /**< Default value. Means that all digits are + * editable, when in editing mode. */ + ELM_CLOCK_EDIT_HOUR_DECIMAL = 1 /* 1 >> 0 */, /**< Decimal digit of hours + * value should be editable. */ + ELM_CLOCK_EDIT_HOUR_UNIT = 2 /* 1 >> 1 */, /**< Unit digit of hours value + * should be editable. */ + ELM_CLOCK_EDIT_MIN_DECIMAL = 4 /* 1 >> 2 */, /**< Decimal digit of minutes + * value should be editable. */ + ELM_CLOCK_EDIT_MIN_UNIT = 8 /* 1 >> 3 */, /**< Unit digit of minutes value + * should be editable. */ + ELM_CLOCK_EDIT_SEC_DECIMAL = 16 /* 1 >> 4 */, /**< Decimal digit of seconds + * value should be editable. */ + ELM_CLOCK_EDIT_SEC_UNIT = 32 /* 1 >> 5 */, /**< Unit digit of seconds value + * should be editable. */ + ELM_CLOCK_EDIT_ALL = 63 /* (1 >> 6) * 1 */ /**< All digits should be editable. + */ +} Elm_Clock_Edit_Mode; + + +#endif + +/** + * @brief If the given clock widget must show hours in military or am/pm mode + * + * Set if the clock must show hours in military or am/pm mode. In some + * countries like Brazil the military mode (00-24h-format) is used, in + * opposition to the USA, where the am/pm mode is more commonly used. + * + * @param[in] obj The object. + * @param[in] am_pm @c true to put it in am/pm mode, @c false to military mode + * + * @ingroup Elm_Clock_Group + */ +EAPI void elm_clock_show_am_pm_set(Elm_Clock *obj, Eina_Bool am_pm); + +/** + * @brief If the given clock widget must show hours in military or am/pm mode + * + * Set if the clock must show hours in military or am/pm mode. In some + * countries like Brazil the military mode (00-24h-format) is used, in + * opposition to the USA, where the am/pm mode is more commonly used. + * + * @param[in] obj The object. + * + * @return @c true to put it in am/pm mode, @c false to military mode + * + * @ingroup Elm_Clock_Group + */ +EAPI Eina_Bool elm_clock_show_am_pm_get(const Elm_Clock *obj); + +/** + * @brief The first interval on time updates for a user mouse button hold on + * clock widgets' time editing. + * + * This interval value is decreased while the user holds the mouse pointer + * either incrementing or decrementing a given the clock digit's value. + * + * This helps the user to get to a given time distant from the current one + * easier/faster, as it will start to flip quicker and quicker on mouse button + * holds. + * + * The calculation for the next flip interval value, starting from the one set + * with this call, is the previous interval divided by 1.05, so it decreases a + * little bit. + * + * The default starting interval value for automatic flips is 0.85 seconds. + * + * @param[in] obj The object. + * @param[in] interval The first interval value in seconds + * + * @ingroup Elm_Clock_Group + */ +EAPI void elm_clock_first_interval_set(Elm_Clock *obj, double interval); + +/** + * @brief The first interval on time updates for a user mouse button hold on + * clock widgets' time editing. + * + * This interval value is decreased while the user holds the mouse pointer + * either incrementing or decrementing a given the clock digit's value. + * + * This helps the user to get to a given time distant from the current one + * easier/faster, as it will start to flip quicker and quicker on mouse button + * holds. + * + * The calculation for the next flip interval value, starting from the one set + * with this call, is the previous interval divided by 1.05, so it decreases a + * little bit. + * + * The default starting interval value for automatic flips is 0.85 seconds. + * + * @param[in] obj The object. + * + * @return The first interval value in seconds + * + * @ingroup Elm_Clock_Group + */ +EAPI double elm_clock_first_interval_get(const Elm_Clock *obj); + +/** + * @brief If the given clock widget must show time with seconds or not + * + * This function sets if the given clock must show or not elapsed seconds. By + * default, they are not shown. + * + * @param[in] obj The object. + * @param[in] seconds @c true to show seconds, @c false otherwise. + * + * @ingroup Elm_Clock_Group + */ +EAPI void elm_clock_show_seconds_set(Elm_Clock *obj, Eina_Bool seconds); + +/** + * @brief If the given clock widget must show time with seconds or not + * + * This function sets if the given clock must show or not elapsed seconds. By + * default, they are not shown. + * + * @param[in] obj The object. + * + * @return @c true to show seconds, @c false otherwise. + * + * @ingroup Elm_Clock_Group + */ +EAPI Eina_Bool elm_clock_show_seconds_get(const Elm_Clock *obj); + +/** + * @brief Whether a given clock widget is under editing mode or under (default) + * displaying-only mode. + * + * This function makes a clock's time to be editable or not by user + * interaction. When in editing mode, clocks stop ticking, until one brings + * them back to display mode. The @ref elm_clock_edit_mode_set function will + * influence which digits of the clock will be editable. + * + * @note am/pm sheets, if being shown, will always be editable under editing + * mode. + * + * @param[in] obj The object. + * @param[in] edit @c true to put it in editing, @c false to put it back to + * "displaying only" mode + * + * @ingroup Elm_Clock_Group + */ +EAPI void elm_clock_edit_set(Elm_Clock *obj, Eina_Bool edit); + +/** + * @brief Whether a given clock widget is under editing mode or under (default) + * displaying-only mode. + * + * This function makes a clock's time to be editable or not by user + * interaction. When in editing mode, clocks stop ticking, until one brings + * them back to display mode. The @ref elm_clock_edit_mode_set function will + * influence which digits of the clock will be editable. + * + * @note am/pm sheets, if being shown, will always be editable under editing + * mode. + * + * @param[in] obj The object. + * + * @return @c true to put it in editing, @c false to put it back to "displaying + * only" mode + * + * @ingroup Elm_Clock_Group + */ +EAPI Eina_Bool elm_clock_edit_get(const Elm_Clock *obj); + +/** + * @brief Whether the given clock widget should be paused or not. + * + * This function pauses or starts the clock widget. + * + * @param[in] obj The object. + * @param[in] paused @c true to pause clock, @c false otherwise + * + * @since 1.9 + * + * @ingroup Elm_Clock_Group + */ +EAPI void elm_clock_pause_set(Elm_Clock *obj, Eina_Bool paused); + +/** + * @brief Whether the given clock widget should be paused or not. + * + * This function pauses or starts the clock widget. + * + * @param[in] obj The object. + * + * @return @c true to pause clock, @c false otherwise + * + * @since 1.9 + * + * @ingroup Elm_Clock_Group + */ +EAPI Eina_Bool elm_clock_pause_get(const Elm_Clock *obj); + +/** + * @brief Clock widget's time + * + * Values must be set within 0-23 for hours and 0-59 for minutes and seconds, + * even if the clock is not in "military" mode. + * + * @warning The behavior for values set out of those ranges is undefined. + * + * @param[in] obj The object. + * @param[in] hrs The hours to set + * @param[in] min The minutes to set + * @param[in] sec The seconds to set + * + * @ingroup Elm_Clock_Group + */ +EAPI void elm_clock_time_set(Elm_Clock *obj, int hrs, int min, int sec); + +/** + * @brief Clock widget's time + * + * Values must be set within 0-23 for hours and 0-59 for minutes and seconds, + * even if the clock is not in "military" mode. + * + * @note Use @c null pointers on the time values you're not interested in: + * they'll be ignored by the function. + * + * @param[in] obj The object. + * @param[out] hrs The hours to set + * @param[out] min The minutes to set + * @param[out] sec The seconds to set + * + * @ingroup Elm_Clock_Group + */ +EAPI void elm_clock_time_get(const Elm_Clock *obj, int *hrs, int *min, int *sec); + +/** + * @brief Digits of the given clock widget should be editable when in editing + * mode. + * + * @param[in] obj The object. + * @param[in] digedit Bit mask indicating the digits to be editable (values in + * @ref Elm_Clock_Edit_Mode). + * + * @ingroup Elm_Clock_Group + */ +EAPI void elm_clock_edit_mode_set(Elm_Clock *obj, Elm_Clock_Edit_Mode digedit); + +/** + * @brief Digits of the given clock widget should be editable when in editing + * mode. + * + * @param[in] obj The object. + * + * @return Bit mask indicating the digits to be editable (values in + * @ref Elm_Clock_Edit_Mode). + * + * @ingroup Elm_Clock_Group + */ +EAPI Elm_Clock_Edit_Mode elm_clock_edit_mode_get(const Elm_Clock *obj); + +#endif diff --git a/src/lib/elementary/elm_clock_legacy.h b/src/lib/elementary/elm_clock_legacy.h index 22381ac054..1a777820ab 100644 --- a/src/lib/elementary/elm_clock_legacy.h +++ b/src/lib/elementary/elm_clock_legacy.h @@ -11,4 +11,4 @@ */ EAPI Evas_Object *elm_clock_add(Evas_Object *parent); -#include "elm_clock.eo.legacy.h" \ No newline at end of file +#include "elm_clock_eo.legacy.h" \ No newline at end of file diff --git a/src/lib/elementary/elm_cnp.h b/src/lib/elementary/elm_cnp.h index 525bde9ae6..5feda3acc0 100644 --- a/src/lib/elementary/elm_cnp.h +++ b/src/lib/elementary/elm_cnp.h @@ -57,41 +57,49 @@ EAPI extern int ELM_CNP_EVENT_SELECTION_CHANGED; * @see http://www.x.org/docs/X11/xlib.pdf * for more details. */ -typedef Efl_Ui_Selection_Type Elm_Sel_Type; -#define ELM_SEL_TYPE_PRIMARY EFL_UI_SELECTION_TYPE_PRIMARY -#define ELM_SEL_TYPE_SECONDARY EFL_UI_SELECTION_TYPE_SECONDARY -#define ELM_SEL_TYPE_XDND EFL_UI_SELECTION_TYPE_DND -#define ELM_SEL_TYPE_CLIPBOARD EFL_UI_SELECTION_TYPE_CLIPBOARD +typedef enum +{ + ELM_SEL_TYPE_PRIMARY = 0, /**< Primary text selection (highlighted or + * selected text) */ + ELM_SEL_TYPE_SECONDARY, /**< Used when primary selection is in use */ + ELM_SEL_TYPE_XDND, /**< Drag and Drop */ + ELM_SEL_TYPE_CLIPBOARD /**< Clipboard selection (ctrl+C) */ +} Elm_Sel_Type; /** * Defines the types of content. */ -typedef Efl_Ui_Selection_Format Elm_Sel_Format; - -#define ELM_SEL_FORMAT_TARGETS EFL_UI_SELECTION_FORMAT_TARGETS -#define ELM_SEL_FORMAT_NONE EFL_UI_SELECTION_FORMAT_NONE -#define ELM_SEL_FORMAT_TEXT EFL_UI_SELECTION_FORMAT_TEXT -#define ELM_SEL_FORMAT_MARKUP EFL_UI_SELECTION_FORMAT_MARKUP -#define ELM_SEL_FORMAT_IMAGE EFL_UI_SELECTION_FORMAT_IMAGE -#define ELM_SEL_FORMAT_VCARD EFL_UI_SELECTION_FORMAT_VCARD -#define ELM_SEL_FORMAT_HTML EFL_UI_SELECTION_FORMAT_HTML +typedef enum +{ + ELM_SEL_FORMAT_TARGETS = -1 /* +1 */, /**< For matching every + * possible atom */ + ELM_SEL_FORMAT_NONE = 0, /**< Content is from outside of Elementary + */ + ELM_SEL_FORMAT_TEXT = 1, /**< Plain unformatted text: Used for things + * that don't want rich markup */ + ELM_SEL_FORMAT_MARKUP = 2, /**< Edje textblock markup, including + * inline images */ + ELM_SEL_FORMAT_IMAGE = 4, /**< Images */ + ELM_SEL_FORMAT_VCARD = 8, /**< Vcards */ + ELM_SEL_FORMAT_HTML = 16 /**< Raw HTML-like data (eg. webkit) */ +} Elm_Sel_Format; /** * Defines the kind of action associated with the drop data if for XDND * @since 1.8 */ -typedef Efl_Ui_Selection_Action Elm_Xdnd_Action; - -#define ELM_XDND_ACTION_UNKNOWN EFL_UI_SELECTION_ACTION_UNKNOWN -#define ELM_XDND_ACTION_COPY EFL_UI_SELECTION_ACTION_COPY -#define ELM_XDND_ACTION_MOVE EFL_UI_SELECTION_ACTION_MOVE -#define ELM_XDND_ACTION_PRIVATE EFL_UI_SELECTION_ACTION_PRIVATE -#define ELM_XDND_ACTION_ASK EFL_UI_SELECTION_ACTION_ASK -#define ELM_XDND_ACTION_LIST EFL_UI_SELECTION_ACTION_LIST -#define ELM_XDND_ACTION_LINK EFL_UI_SELECTION_ACTION_LINK -#define ELM_XDND_ACTION_DESCRIPTION EFL_UI_SELECTION_ACTION_DESCRIPTION - +typedef enum +{ + ELM_XDND_ACTION_UNKNOWN = 0, /**< Action type is unknown */ + ELM_XDND_ACTION_COPY, /**< Copy the data */ + ELM_XDND_ACTION_MOVE, /**< Move the data */ + ELM_XDND_ACTION_PRIVATE, /**< Private 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; /** * Structure holding the info about selected data. */ @@ -175,7 +183,7 @@ typedef void (*Elm_Drag_State) (void *data, Evas_Object *obj); * * @param data Application specific data * @param obj The object where the drag started - * @param accepted TRUE if the droppped-data is accepted on drop + * @param accepted TRUE if the dropped data is accepted on drop * @since 1.8 */ typedef void (*Elm_Drag_Done) (void *data, Evas_Object *obj, Eina_Bool accepted); diff --git a/src/lib/elementary/elm_code.c b/src/lib/elementary/elm_code.c index cfe1f7edf3..12c1e4e9b6 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)); + if (!ret) return NULL; ret->config.indent_style_efl = EINA_TRUE; // create an in-memory backing for this elm_code by default diff --git a/src/lib/elementary/elm_code_diff_widget.c b/src/lib/elementary/elm_code_diff_widget.c index 593f044bc7..5b4e63380b 100644 --- a/src/lib/elementary/elm_code_diff_widget.c +++ b/src/lib/elementary/elm_code_diff_widget.c @@ -5,7 +5,7 @@ #include "Elementary.h" #include "elm_code_private.h" -#include "elm_code_widget_legacy.eo.h" +#include "elm_code_widget_legacy_eo.h" #define _ELM_CODE_DIFF_WIDGET_LEFT "diffwidgetleft" #define _ELM_CODE_DIFF_WIDGET_RIGHT "diffwidgetright" @@ -96,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 = elm_legacy_add(ELM_CODE_WIDGET_LEGACY_CLASS, parent, elm_obj_code_widget_code_set(efl_added, wcode1)); + widget_left = elm_legacy_add(ELM_CODE_WIDGET_LEGACY_CLASS, parent, efl_ui_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); @@ -107,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 = elm_legacy_add(ELM_CODE_WIDGET_LEGACY_CLASS, parent, elm_obj_code_widget_code_set(efl_added, wcode2)); + widget_right = elm_legacy_add(ELM_CODE_WIDGET_LEGACY_CLASS, parent, efl_ui_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); @@ -125,8 +125,8 @@ elm_code_diff_widget_font_set(Evas_Object *widget, const char *name, int size) Elm_Code_Widget *child; child = (Elm_Code_Widget *) evas_object_data_get(widget, _ELM_CODE_DIFF_WIDGET_LEFT); - elm_obj_code_widget_font_set(child, name, size); + efl_ui_code_widget_font_set(child, name, size); child = (Elm_Code_Widget *) evas_object_data_get(widget, _ELM_CODE_DIFF_WIDGET_RIGHT); - elm_obj_code_widget_font_set(child, name, size); + efl_ui_code_widget_font_set(child, name, size); } diff --git a/src/lib/elementary/elm_code_file.c b/src/lib/elementary/elm_code_file.c index aa01cd1b8e..c5d429f639 100644 --- a/src/lib/elementary/elm_code_file.c +++ b/src/lib/elementary/elm_code_file.c @@ -97,6 +97,7 @@ EAPI char *_elm_code_file_tmp_path_get(Elm_Code_File *file) dirlen = strlen(path) - strlen(name); tmp = malloc(sizeof(char) * (strlen(path) + 6)); + if (!tmp) return NULL; snprintf(tmp, dirlen + 1, "%s", path); snprintf(tmp + dirlen, strlen(name) + 6, ".%s.tmp", name); @@ -111,6 +112,7 @@ EAPI Elm_Code_File *elm_code_file_new(Elm_Code *code) elm_code_file_free(code->file); ret = calloc(1, sizeof(Elm_Code_File)); + if (!ret) return NULL; code->file = ret; ret->parent = code; @@ -119,6 +121,8 @@ EAPI Elm_Code_File *elm_code_file_new(Elm_Code *code) EAPI Elm_Code_File *elm_code_file_open(Elm_Code *code, const char *path) { + EINA_SAFETY_ON_NULL_RETURN_VAL(code, NULL); + Elm_Code_File *ret; Eina_File *file; Eina_File_Line *line; @@ -212,7 +216,13 @@ EAPI void elm_code_file_save(Elm_Code_File *file) free(tmp); if (have_mode) - chmod(path, mode); + { + if(chmod(path, mode) < 0) + { + ERR("Error in chmod(%s, %d) - %d(%s)\n", path, mode, errno, strerror(errno)); + return; + } + } if (file->parent) { diff --git a/src/lib/elementary/elm_code_line.c b/src/lib/elementary/elm_code_line.c index fd222a3d4e..3c74a47cd0 100644 --- a/src/lib/elementary/elm_code_line.c +++ b/src/lib/elementary/elm_code_line.c @@ -98,6 +98,7 @@ _elm_code_line_merge_into(Elm_Code_Line *line1, Elm_Code_Line *line2) text2 = elm_code_line_text_get(line2, &length2); newtext = malloc(sizeof(char) * (length1 + length2 + 1)); + if (!newtext) return; if (length1 > 0) snprintf(newtext, length1 + 1, "%s", text1); if (length2 > 0) @@ -178,6 +179,7 @@ EAPI void elm_code_line_token_add(Elm_Code_Line *line, int start, int end, int l return; tok = calloc(1, sizeof(Elm_Code_Token)); + if (!tok) return; tok->start = start; tok->end = end; diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c index 39a1ee162e..0720a5253b 100644 --- a/src/lib/elementary/elm_code_widget.c +++ b/src/lib/elementary/elm_code_widget.c @@ -10,7 +10,7 @@ #include "elm_code_widget_private.h" /* FIXME: hoversel is deprecated in EO APIs */ -#include "elm_hoversel.eo.h" +#include "elm_hoversel_eo.h" #define MY_CLASS ELM_CODE_WIDGET_CLASS @@ -58,17 +58,17 @@ static Eina_Unicode status_icons[] = { static void _elm_code_widget_resize(Elm_Code_Widget *widget, Elm_Code_Line *newline); -#include "elm_code_widget_legacy.eo.h" +#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(ELM_CODE_WIDGET_LEGACY_CLASS, parent, - elm_obj_code_widget_code_set(efl_added, code)); + efl_ui_code_widget_code_set(efl_added, code)); } -#include "elm_code_widget_legacy.eo.c" +#include "elm_code_widget_legacy_eo.c" EOLIAN static Eo * _elm_code_widget_efl_object_constructor(Eo *obj, Elm_Code_Widget_Data *pd) @@ -175,7 +175,7 @@ _elm_code_widget_fill_line_tokens(Elm_Code_Widget *widget, Evas_Textgrid_Cell *c unsigned int end, length, offset; unsigned int token_start_col, token_end_col; - offset = elm_obj_code_widget_text_left_gutter_width_get(widget); + offset = efl_ui_code_widget_text_left_gutter_width_get(widget); length = elm_code_widget_line_text_column_width_get(widget, line) + offset; EINA_LIST_FOREACH(line->tokens, item, token) @@ -258,6 +258,7 @@ _elm_code_widget_fill_line_gutter(Elm_Code_Widget *widget, Evas_Textgrid_Cell *c if (line->number > 0) { number = malloc(sizeof(char) * gutter); + if (!number) return; snprintf(number, gutter, "%*d", gutter - 1, line->number); } for (g = 0; g < gutter - 1; g++) @@ -385,7 +386,7 @@ _elm_code_widget_fill_selection(Elm_Code_Widget *widget, Elm_Code_Line *line, Ev } static void -_elm_code_widget_fill_line(Elm_Code_Widget *widget, Elm_Code_Line *line) +_elm_code_widget_fill_line(Elm_Code_Widget *widget, Elm_Code_Widget_Data *pd, Elm_Code_Line *line) { char *chr; Eina_Unicode unichr; @@ -393,12 +394,10 @@ _elm_code_widget_fill_line(Elm_Code_Widget *widget, Elm_Code_Line *line) int chrpos, gutter; Evas_Object *grid; Evas_Textgrid_Cell *cells; - Elm_Code_Widget_Data *pd; EINA_SAFETY_ON_NULL_RETURN(line); - pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS); - gutter = elm_obj_code_widget_text_left_gutter_width_get(widget); + gutter = efl_ui_code_widget_text_left_gutter_width_get(widget); if (eina_list_count(pd->grids) < line->number) return; @@ -409,7 +408,6 @@ _elm_code_widget_fill_line(Elm_Code_Widget *widget, Elm_Code_Line *line) length = elm_code_widget_line_text_column_width_get(widget, line); chrpos = 0; chr = (char *)elm_code_line_text_get(line, NULL); - for (x = gutter; x < (unsigned int) w && x < length + gutter; x+=charwidth) { unichr = eina_unicode_utf8_next_get(chr, &chrpos); @@ -477,10 +475,10 @@ _elm_code_widget_fill_range(Elm_Code_Widget *widget, Elm_Code_Widget_Data *pd, unsigned int y; if (newline) - _elm_code_widget_fill_line(widget, newline); + _elm_code_widget_fill_line(widget, pd, newline); // if called from new line cb, no need to update whole range unless visible - if (newline && !elm_obj_code_widget_line_visible_get(widget, newline)) + if (newline && !efl_ui_code_widget_line_visible_get(widget, newline)) return; // cursor will be shown if it should be visible @@ -491,7 +489,7 @@ _elm_code_widget_fill_range(Elm_Code_Widget *widget, Elm_Code_Widget_Data *pd, line = elm_code_file_line_get(pd->code->file, y); if (line) - _elm_code_widget_fill_line(widget, line); + _elm_code_widget_fill_line(widget, pd, line); } if (pd->selection) @@ -678,7 +676,7 @@ _elm_code_widget_cursor_ensure_visible(Elm_Code_Widget *widget) grid = eina_list_data_get(eina_list_nth_list(pd->grids, pd->cursor_line - 1)); evas_object_geometry_get(grid, NULL, &rowy, NULL, NULL); - gutter = elm_obj_code_widget_text_left_gutter_width_get(widget); + gutter = efl_ui_code_widget_text_left_gutter_width_get(widget); curx = (pd->cursor_col + gutter - 1) * cellw; cury = rowy + viewy - oy; @@ -707,14 +705,14 @@ _elm_code_widget_cursor_move(Elm_Code_Widget *widget, Elm_Code_Widget_Data *pd, if (position < length && text[position] == '\t') pd->cursor_col = elm_code_widget_line_text_column_width_to_position(widget, line_obj, position); - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CURSOR_CHANGED, widget); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CURSOR_CHANGED, widget); if (!pd->selection || (pd->selection && pd->selection->in_progress)) _elm_code_widget_cursor_ensure_visible(widget); if (oldrow != pd->cursor_line) _elm_code_widget_refresh(widget, line_obj); else - _elm_code_widget_fill_line(widget, elm_code_file_line_get(pd->code->file, pd->cursor_line)); + _elm_code_widget_fill_line(widget, pd, elm_code_file_line_get(pd->code->file, pd->cursor_line)); elm_layout_signal_emit(pd->cursor_rect, "elm,action,show,cursor", "elm"); } @@ -739,7 +737,7 @@ _elm_code_widget_position_at_coordinates_get(Eo *obj, Elm_Code_Widget_Data *pd, y = y + sy - oy; _elm_code_widget_cell_size_get(widget, &cw, &ch); - gutter = elm_obj_code_widget_text_left_gutter_width_get(widget); + gutter = efl_ui_code_widget_text_left_gutter_width_get(widget); if (y >= 0 && ch > 0) guess = ((double) y / ch) + 1; @@ -796,7 +794,7 @@ _elm_code_widget_geometry_for_position_get(Elm_Code_Widget *widget, Elm_Code_Wid elm_code_line_text_get(line, &length); _elm_code_widget_cell_size_get(widget, &cellw, h); - gutter = elm_obj_code_widget_text_left_gutter_width_get(widget); + gutter = efl_ui_code_widget_text_left_gutter_width_get(widget); grid = eina_list_nth(pd->grids, row - 1); evas_object_geometry_get(grid, x, y, NULL, NULL); @@ -1002,7 +1000,7 @@ _elm_code_widget_clicked_gutter_cb(Elm_Code_Widget *widget, unsigned int row) return; } - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_LINE_GUTTER_CLICKED, line); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_LINE_GUTTER_CLICKED, line); } static void @@ -1038,7 +1036,7 @@ _elm_code_widget_clicked_readonly_cb(Elm_Code_Widget *widget, unsigned int row) if (!line) return; - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_LINE_CLICKED, line); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_LINE_CLICKED, line); } static void @@ -1368,7 +1366,7 @@ _elm_code_widget_cursor_move_page_height_get(Elm_Code_Widget *widget) { unsigned int lines; - lines = elm_obj_code_widget_lines_visible_get(widget); + lines = efl_ui_code_widget_lines_visible_get(widget); return lines * 0.85; } @@ -1433,6 +1431,7 @@ _elm_code_widget_change_create(unsigned int start_col, unsigned int start_line, Elm_Code_Widget_Change_Info *info; info = calloc(1, sizeof(*info)); + if (!info) return NULL; info->insert = insert; info->start_col = start_col; @@ -1492,7 +1491,7 @@ _elm_code_widget_tab_at_cursor_insert(Elm_Code_Widget *widget) return; } - elm_obj_code_widget_cursor_position_get(widget, &row, &col); + efl_ui_code_widget_cursor_position_get(widget, &row, &col); rem = (col - 1) % pd->tabstop; while (rem < pd->tabstop) @@ -1514,8 +1513,8 @@ _elm_code_widget_newline(Elm_Code_Widget *widget) if (!elm_code_widget_selection_is_empty(widget)) elm_code_widget_selection_delete(widget); - code = elm_obj_code_widget_code_get(widget); - elm_obj_code_widget_cursor_position_get(widget, &row, &col); + code = efl_ui_code_widget_code_get(widget); + efl_ui_code_widget_cursor_position_get(widget, &row, &col); line = elm_code_file_line_get(code->file, row); if (line == NULL) { @@ -1537,12 +1536,13 @@ _elm_code_widget_newline(Elm_Code_Widget *widget) elm_code_widget_text_at_cursor_insert(widget, leading); free(oldtext); - indent = elm_obj_code_widget_line_text_column_width_to_position(widget, line, + indent = efl_ui_code_widget_line_text_column_width_to_position(widget, line, strlen(leading)); - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CHANGED_USER, NULL); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CHANGED_USER, NULL); textlen = strlen(leading) + 2; text = malloc(sizeof(char) * textlen); + if (!text) return; snprintf(text, textlen, "\n%s", leading); free(leading); @@ -1560,8 +1560,8 @@ _elm_code_widget_backspaceline(Elm_Code_Widget *widget, Eina_Bool nextline) Eina_Bool cursor_move = EINA_TRUE; unsigned int row, col, oldlength, position = 0; - code = elm_obj_code_widget_code_get(widget); - elm_obj_code_widget_cursor_position_get(widget, &row, &col); + code = efl_ui_code_widget_code_get(widget); + efl_ui_code_widget_cursor_position_get(widget, &row, &col); line = elm_code_file_line_get(code->file, row); if (nextline) @@ -1600,7 +1600,7 @@ _elm_code_widget_backspaceline(Elm_Code_Widget *widget, Eina_Bool nextline) } // TODO construct and pass a change object - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CHANGED_USER, NULL); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CHANGED_USER, NULL); } void @@ -1618,8 +1618,8 @@ _elm_code_widget_backspace(Elm_Code_Widget *widget) return; } - code = elm_obj_code_widget_code_get(widget); - elm_obj_code_widget_cursor_position_get(widget, &row, &col); + code = efl_ui_code_widget_code_get(widget); + efl_ui_code_widget_cursor_position_get(widget, &row, &col); if (col <= 1) { @@ -1640,9 +1640,9 @@ _elm_code_widget_backspace(Elm_Code_Widget *widget) text = elm_code_widget_text_between_positions_get(widget, row, start_col, row, end_col); elm_code_line_text_remove(line, position - char_width, char_width); - elm_obj_code_widget_cursor_position_set(widget, row, start_col); + efl_ui_code_widget_cursor_position_set(widget, row, start_col); - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CHANGED_USER, NULL); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CHANGED_USER, NULL); change = _elm_code_widget_change_create(start_col, row, end_col - 1, row, text, char_width, EINA_FALSE); _elm_code_widget_undo_change_add(widget, change); @@ -1664,8 +1664,8 @@ _elm_code_widget_delete(Elm_Code_Widget *widget) return; } - code = elm_obj_code_widget_code_get(widget); - elm_obj_code_widget_cursor_position_get(widget, &row, &col); + code = efl_ui_code_widget_code_get(widget); + efl_ui_code_widget_cursor_position_get(widget, &row, &col); line = elm_code_file_line_get(code->file, row); if (col > elm_code_widget_line_text_column_width_get(widget, line)) { @@ -1685,8 +1685,8 @@ _elm_code_widget_delete(Elm_Code_Widget *widget) text = elm_code_widget_text_between_positions_get(widget, row, start_col, row, end_col); elm_code_line_text_remove(line, position, char_width); - elm_obj_code_widget_cursor_position_set(widget, row, start_col); - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CHANGED_USER, NULL); + efl_ui_code_widget_cursor_position_set(widget, row, start_col); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CHANGED_USER, NULL); change = _elm_code_widget_change_create(start_col, row, col - 1, row, text, char_width, EINA_FALSE); _elm_code_widget_undo_change_add(widget, change); @@ -1882,7 +1882,7 @@ _elm_code_widget_scroll_event_cb(void *data, Evas_Object *obj EINA_UNUSED, } EOLIAN static Eina_Bool -_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) +_elm_code_widget_efl_ui_widget_widget_input_event_handler(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; @@ -2020,7 +2020,7 @@ _elm_code_widget_resize(Elm_Code_Widget *widget, Elm_Code_Line *newline) Elm_Code_Widget_Data *pd; pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS); - gutter = elm_obj_code_widget_text_left_gutter_width_get(widget); + gutter = efl_ui_code_widget_text_left_gutter_width_get(widget); if (!pd->code) return; @@ -2080,9 +2080,9 @@ _elm_code_widget_resize(Elm_Code_Widget *widget, Elm_Code_Line *newline) } EOAPI void -_elm_code_widget_line_refresh(Eo *obj, Elm_Code_Widget_Data *pd EINA_UNUSED, Elm_Code_Line *line) +_elm_code_widget_line_refresh(Eo *obj, Elm_Code_Widget_Data *pd, Elm_Code_Line *line) { - _elm_code_widget_fill_line(obj, line); + _elm_code_widget_fill_line(obj, pd, line); } EOAPI Eina_Bool @@ -2188,15 +2188,15 @@ _elm_code_widget_gravity_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd } EOLIAN static void -_elm_code_widget_policy_set(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v) +_elm_code_widget_policy_set(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, Elm_Code_Widget_Scroller_Policy policy_h, Elm_Code_Widget_Scroller_Policy policy_v) { - elm_scroller_policy_set(pd->scroller, policy_h, policy_v); + elm_scroller_policy_set(pd->scroller, (Elm_Scroller_Policy)policy_h, (Elm_Scroller_Policy)policy_v); } EOLIAN static void -_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_code_widget_policy_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, Elm_Code_Widget_Scroller_Policy *policy_h, Elm_Code_Widget_Scroller_Policy *policy_v) { - elm_scroller_policy_get(pd->scroller, policy_h, policy_v); + elm_scroller_policy_get(pd->scroller, (Elm_Scroller_Policy*)policy_h, (Elm_Scroller_Policy*)policy_v); } EOLIAN static void @@ -2341,15 +2341,15 @@ _elm_code_widget_theme_refresh(Eo *obj, Elm_Code_Widget_Data *pd) } } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _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_RESULT_FAIL; + if (efl_ui_widget_theme_apply(efl_cast(obj, EFL_UI_WIDGET_CLASS)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) + return EFL_UI_THEME_APPLY_ERROR_GENERIC; _elm_code_widget_theme_refresh(obj, pd); - return EFL_UI_THEME_APPLY_RESULT_SUCCESS; + return EFL_UI_THEME_APPLY_ERROR_NONE; } EOLIAN static int @@ -2382,10 +2382,10 @@ _elm_code_widget_efl_canvas_group_group_add(Eo *obj, Elm_Code_Widget_Data *pd) elm_widget_can_focus_set(obj, EINA_TRUE); pd->alpha = 255; - if (!elm_widget_theme_object_set(obj, wd->resize_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))) + elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); scroller = elm_scroller_add(obj); @@ -2429,8 +2429,8 @@ _elm_code_widget_efl_canvas_group_group_add(Eo *obj, Elm_Code_Widget_Data *pd) efl_event_callback_add(obj, &ELM_CODE_EVENT_LINE_LOAD_DONE, _elm_code_widget_line_cb, obj); efl_event_callback_add(obj, &ELM_CODE_EVENT_FILE_LOAD_DONE, _elm_code_widget_file_cb, obj); - efl_event_callback_add(obj, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CHANGED, _elm_code_widget_selection_cb, obj); - efl_event_callback_add(obj, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CLEARED, _elm_code_widget_selection_clear_cb, obj); + efl_event_callback_add(obj, EFL_UI_CODE_WIDGET_EVENT_CODE_SELECTION_CHANGED, _elm_code_widget_selection_cb, obj); + efl_event_callback_add(obj, EFL_UI_CODE_WIDGET_EVENT_CODE_SELECTION_CLEARED, _elm_code_widget_selection_clear_cb, obj); } /* Internal EO APIs and hidden overrides */ @@ -2441,3 +2441,4 @@ _elm_code_widget_efl_canvas_group_group_add(Eo *obj, Elm_Code_Widget_Data *pd) #include "elm_code_widget_text.c" #include "elm_code_widget_undo.c" #include "elm_code_widget.eo.c" +#include "elm_code_widget_eo.legacy.c" diff --git a/src/lib/elementary/elm_code_widget.eo b/src/lib/elementary/elm_code_widget.eo index d464a5b178..0764506604 100644 --- a/src/lib/elementary/elm_code_widget.eo +++ b/src/lib/elementary/elm_code_widget.eo @@ -1,14 +1,24 @@ -import elm_interface_scrollable; +/* FIXME: this widget should just implement a scroller */ +enum @beta Elm.Code_Widget_Scroller_Policy +{ + [[Type that controls when scrollbars should appear. + + See also @Elm.Interface_Scrollable.policy.set. + ]] + auto = 0, [[Show scrollbars as needed]] + on, [[Always show scrollbars]] + off, [[Never show scrollbars]] + last [[Sentinel value to indicate last enum field during iteration]] +} /* 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 */ -class Elm.Code_Widget extends Efl.Ui.Layout implements Efl.Access.Text +class @beta Elm.Code_Widget extends Efl.Ui.Layout_Base { [[Elementary code widget]] - eo_prefix: elm_obj_code_widget; - legacy_prefix: elm_code_widget; + eo_prefix: efl_ui_code_widget; methods { @property code { set { @@ -70,8 +80,8 @@ class Elm.Code_Widget extends Efl.Ui.Layout implements Efl.Access.Text [[Get the widget's policy for scrollbar visibility.]] } values { - policy_h: Elm.Scroller.Policy; [[The horizontal scrollbar visibility policy]] - policy_v: Elm.Scroller.Policy; [[The vertical scrollbar visibility policy]] + policy_h: Elm.Code_Widget_Scroller_Policy; [[The horizontal scrollbar visibility policy]] + policy_v: Elm.Code_Widget_Scroller_Policy; [[The vertical scrollbar visibility policy]] } } @property tabstop { @@ -312,7 +322,7 @@ class Elm.Code_Widget extends Efl.Ui.Layout implements Efl.Access.Text class.constructor; Efl.Object.constructor; Efl.Object.finalize; - Efl.Ui.Widget.widget_event; + Efl.Ui.Widget.widget_input_event_handler; Efl.Ui.Widget.theme_apply; } constructors { @@ -324,11 +334,11 @@ class Elm.Code_Widget extends Efl.Ui.Layout implements Efl.Access.Text 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]] + code,selection,start: Elm.Code_Widget; [[Called when a selection is started]] + code,selection,changed: Elm.Code_Widget; [[Called when selection changed]] + code,selection,cleared: Elm.Code_Widget; [[Called when selection was cleared]] + code,selection,cut: Elm.Code_Widget; [[Called when a cut action is performed]] + code,selection,copy: Elm.Code_Widget; [[Called when a copy action is performed]] + code,selection,paste: Elm.Code_Widget; [[Called when a paste action is performed]] } } diff --git a/src/lib/elementary/elm_code_widget_eo.legacy.c b/src/lib/elementary/elm_code_widget_eo.legacy.c new file mode 100644 index 0000000000..cc91160565 --- /dev/null +++ b/src/lib/elementary/elm_code_widget_eo.legacy.c @@ -0,0 +1,270 @@ + +EAPI void +elm_code_widget_code_set(Elm_Code_Widget *obj, Elm_Code *code) +{ + efl_ui_code_widget_code_set(obj, code); +} + +EAPI Elm_Code * +elm_code_widget_code_get(const Elm_Code_Widget *obj) +{ + return efl_ui_code_widget_code_get(obj); +} + +EAPI void +elm_code_widget_font_set(Elm_Code_Widget *obj, const char *name, int size) +{ + efl_ui_code_widget_font_set(obj, name, size); +} + +EAPI void +elm_code_widget_font_get(const Elm_Code_Widget *obj, const char **name, int *size) +{ + efl_ui_code_widget_font_get(obj, name, size); +} + +EAPI unsigned int +elm_code_widget_columns_get(const Elm_Code_Widget *obj) +{ + return efl_ui_code_widget_columns_get(obj); +} + +EAPI void +elm_code_widget_gravity_set(Elm_Code_Widget *obj, double x, double y) +{ + efl_ui_code_widget_gravity_set(obj, x, y); +} + +EAPI void +elm_code_widget_gravity_get(const Elm_Code_Widget *obj, double *x, double *y) +{ + efl_ui_code_widget_gravity_get(obj, x, y); +} + +EAPI void +elm_code_widget_policy_set(Elm_Code_Widget *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v) +{ + efl_ui_code_widget_policy_set(obj, (Elm_Code_Widget_Scroller_Policy)policy_h, (Elm_Code_Widget_Scroller_Policy)policy_v); +} + +EAPI void +elm_code_widget_policy_get(const Elm_Code_Widget *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v) +{ + efl_ui_code_widget_policy_get(obj, (Elm_Code_Widget_Scroller_Policy*)policy_h, (Elm_Code_Widget_Scroller_Policy*)policy_v); +} + +EAPI void +elm_code_widget_tabstop_set(Elm_Code_Widget *obj, unsigned int tabstop) +{ + efl_ui_code_widget_tabstop_set(obj, tabstop); +} + +EAPI unsigned int +elm_code_widget_tabstop_get(const Elm_Code_Widget *obj) +{ + return efl_ui_code_widget_tabstop_get(obj); +} + +EAPI void +elm_code_widget_editable_set(Elm_Code_Widget *obj, Eina_Bool editable) +{ + efl_ui_code_widget_editable_set(obj, editable); +} + +EAPI Eina_Bool +elm_code_widget_editable_get(const Elm_Code_Widget *obj) +{ + return efl_ui_code_widget_editable_get(obj); +} + +EAPI void +elm_code_widget_line_numbers_set(Elm_Code_Widget *obj, Eina_Bool line_numbers) +{ + efl_ui_code_widget_line_numbers_set(obj, line_numbers); +} + +EAPI Eina_Bool +elm_code_widget_line_numbers_get(const Elm_Code_Widget *obj) +{ + return efl_ui_code_widget_line_numbers_get(obj); +} + +EAPI void +elm_code_widget_line_width_marker_set(Elm_Code_Widget *obj, unsigned int line_width_marker) +{ + efl_ui_code_widget_line_width_marker_set(obj, line_width_marker); +} + +EAPI unsigned int +elm_code_widget_line_width_marker_get(const Elm_Code_Widget *obj) +{ + return efl_ui_code_widget_line_width_marker_get(obj); +} + +EAPI void +elm_code_widget_show_whitespace_set(Elm_Code_Widget *obj, Eina_Bool show_whitespace) +{ + efl_ui_code_widget_show_whitespace_set(obj, show_whitespace); +} + +EAPI Eina_Bool +elm_code_widget_show_whitespace_get(const Elm_Code_Widget *obj) +{ + return efl_ui_code_widget_show_whitespace_get(obj); +} + +EAPI void +elm_code_widget_alpha_set(Elm_Code_Widget *obj, int alpha) +{ + efl_ui_code_widget_alpha_set(obj, alpha); +} + +EAPI int +elm_code_widget_alpha_get(const Elm_Code_Widget *obj) +{ + return efl_ui_code_widget_alpha_get(obj); +} + +EAPI void +elm_code_widget_syntax_enabled_set(Elm_Code_Widget *obj, Eina_Bool syntax_enabled) +{ + efl_ui_code_widget_syntax_enabled_set(obj, syntax_enabled); +} + +EAPI Eina_Bool +elm_code_widget_syntax_enabled_get(const Elm_Code_Widget *obj) +{ + return efl_ui_code_widget_syntax_enabled_get(obj); +} + +EAPI void +elm_code_widget_tab_inserts_spaces_set(Elm_Code_Widget *obj, Eina_Bool tab_inserts_spaces) +{ + efl_ui_code_widget_tab_inserts_spaces_set(obj, tab_inserts_spaces); +} + +EAPI Eina_Bool +elm_code_widget_tab_inserts_spaces_get(const Elm_Code_Widget *obj) +{ + return efl_ui_code_widget_tab_inserts_spaces_get(obj); +} + +EAPI void +elm_code_widget_cursor_position_set(Elm_Code_Widget *obj, unsigned int row, unsigned int col) +{ + efl_ui_code_widget_cursor_position_set(obj, row, col); +} + +EAPI void +elm_code_widget_cursor_position_get(const Elm_Code_Widget *obj, unsigned int *row, unsigned int *col) +{ + efl_ui_code_widget_cursor_position_get(obj, row, col); +} + +EAPI void +elm_code_widget_theme_refresh(Elm_Code_Widget *obj) +{ + efl_ui_code_widget_theme_refresh(obj); +} + +EAPI void +elm_code_widget_line_refresh(Elm_Code_Widget *obj, Elm_Code_Line *line) +{ + efl_ui_code_widget_line_refresh(obj, line); +} + +EAPI Eina_Bool +elm_code_widget_line_visible_get(Elm_Code_Widget *obj, Elm_Code_Line *line) +{ + return efl_ui_code_widget_line_visible_get(obj, line); +} + +EAPI unsigned int +elm_code_widget_lines_visible_get(Elm_Code_Widget *obj) +{ + return efl_ui_code_widget_lines_visible_get(obj); +} + +EAPI Eina_Bool +elm_code_widget_position_at_coordinates_get(Elm_Code_Widget *obj, int x, int y, unsigned int *row, int *col) +{ + return efl_ui_code_widget_position_at_coordinates_get(obj, x, y, row, col); +} + +EAPI Eina_Bool +elm_code_widget_geometry_for_position_get(Elm_Code_Widget *obj, unsigned int row, int col, int *x, int *y, int *w, int *h) +{ + return efl_ui_code_widget_geometry_for_position_get(obj, row, col, x, y, w, h); +} + +EAPI int +elm_code_widget_text_left_gutter_width_get(Elm_Code_Widget *obj) +{ + return efl_ui_code_widget_text_left_gutter_width_get(obj); +} + +EAPI char * +elm_code_widget_text_between_positions_get(Elm_Code_Widget *obj, unsigned int start_line, unsigned int start_col, unsigned int end_line, unsigned int end_col) +{ + return efl_ui_code_widget_text_between_positions_get(obj, start_line, start_col, end_line, end_col); +} + +EAPI void +elm_code_widget_text_at_cursor_insert(Elm_Code_Widget *obj, const char *text) +{ + efl_ui_code_widget_text_at_cursor_insert(obj, text); +} + +EAPI unsigned int +elm_code_widget_line_text_column_width_to_position(Elm_Code_Widget *obj, Elm_Code_Line *line, unsigned int position) +{ + return efl_ui_code_widget_line_text_column_width_to_position(obj, line, position); +} + +EAPI unsigned int +elm_code_widget_line_text_column_width_get(Elm_Code_Widget *obj, Elm_Code_Line *line) +{ + return efl_ui_code_widget_line_text_column_width_get(obj, line); +} + +EAPI unsigned int +elm_code_widget_line_text_position_for_column_get(Elm_Code_Widget *obj, Elm_Code_Line *line, unsigned int column) +{ + return efl_ui_code_widget_line_text_position_for_column_get(obj, line, column); +} + +EAPI unsigned int +elm_code_widget_text_tabwidth_at_column_get(Elm_Code_Widget *obj, unsigned int column) +{ + return efl_ui_code_widget_text_tabwidth_at_column_get(obj, column); +} + +EAPI void +elm_code_widget_line_status_toggle(Elm_Code_Widget *obj, Elm_Code_Line *line) +{ + efl_ui_code_widget_line_status_toggle(obj, line); +} + +EAPI void +elm_code_widget_undo(Elm_Code_Widget *obj) +{ + efl_ui_code_widget_undo(obj); +} + +EAPI Eina_Bool +elm_code_widget_can_undo_get(Elm_Code_Widget *obj) +{ + return efl_ui_code_widget_can_undo_get(obj); +} + +EAPI void +elm_code_widget_redo(Elm_Code_Widget *obj) +{ + efl_ui_code_widget_redo(obj); +} + +EAPI Eina_Bool +elm_code_widget_can_redo_get(Elm_Code_Widget *obj) +{ + return efl_ui_code_widget_can_redo_get(obj); +} diff --git a/src/lib/elementary/elm_code_widget_eo.legacy.h b/src/lib/elementary/elm_code_widget_eo.legacy.h new file mode 100644 index 0000000000..0d72c8c11e --- /dev/null +++ b/src/lib/elementary/elm_code_widget_eo.legacy.h @@ -0,0 +1,550 @@ +#ifndef _ELM_CODE_WIDGET_EO_LEGACY_H_ +#define _ELM_CODE_WIDGET_EO_LEGACY_H_ + +#ifndef _ELM_CODE_WIDGET_EO_CLASS_TYPE +#define _ELM_CODE_WIDGET_EO_CLASS_TYPE + +typedef Eo Elm_Code_Widget; + +#endif + +#ifndef _ELM_CODE_WIDGET_EO_TYPES +#define _ELM_CODE_WIDGET_EO_TYPES + + +#endif + +/** + * @brief Set the underlying code object that this widget renders. This can + * only be set during construction, once the widget is created the backing code + * object cannot be changed. + * + * @param[in] obj The object. + * @param[in] code Our underlying Elm.Code object + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_code_set(Elm_Code_Widget *obj, Elm_Code *code); + +/** + * @brief Get the underlying code object we are rendering + * + * @param[in] obj The object. + * + * @return Our underlying Elm.Code object + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI Elm_Code *elm_code_widget_code_get(const Elm_Code_Widget *obj); + +/** + * @brief Set the font that this widget uses, the font should be a monospaced + * scalable font. Passing NULL will load the default system monospaced font. + * + * @param[in] obj The object. + * @param[in] name The name of the font to load + * @param[in] size The font size for the widget + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_font_set(Elm_Code_Widget *obj, const char *name, int size); + +/** + * @brief Get the font currently in use. The font name is a copy ad should be + * freed once it is no longer needed + * + * @param[in] obj The object. + * @param[out] name The name of the font to load + * @param[out] size The font size for the widget + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_font_get(const Elm_Code_Widget *obj, const char **name, int *size); + +/** + * @brief Get the number of columns in the widget currently. This will be the + * max of the number of columns to represent the longest line and the minimum + * required to fill the visible widget width. + * + * @param[in] obj The object. + * + * @return The number of columns required to render the widget + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI unsigned int elm_code_widget_columns_get(const Elm_Code_Widget *obj); + +/** + * @brief Set how this widget's scroller should respond to new lines being + * added. + * + * An x value of 0.0 will maintain the distance from the left edge, 1.0 will + * ensure the rightmost edge (of the longest line) is respected With 0.0 for y + * the view will keep it's position relative to the top whereas 1.0 will scroll + * downward as lines are added. + * + * @param[in] obj The object. + * @param[in] x The horizontal value of the scroller gravity - valid values are + * 0.0 and 1.0 + * @param[in] y The vertical gravity of the widget's scroller - valid values + * are 0.0 and 1.0 + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_gravity_set(Elm_Code_Widget *obj, double x, double y); + +/** + * @brief Get the current x and y gravity of the widget's scroller + * + * @param[in] obj The object. + * @param[out] x The horizontal value of the scroller gravity - valid values + * are 0.0 and 1.0 + * @param[out] y The vertical gravity of the widget's scroller - valid values + * are 0.0 and 1.0 + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_gravity_get(const Elm_Code_Widget *obj, double *x, double *y); + +/** + * @brief Set the policy for scrollbar visibility. + * + * @param[in] obj The object. + * @param[in] policy_h The horizontal scrollbar visibility policy + * @param[in] policy_v The vertical scrollbar visibility policy + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_policy_set(Elm_Code_Widget *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v); + +/** + * @brief Get the widget's policy for scrollbar visibility. + * + * @param[in] obj The object. + * @param[out] policy_h The horizontal scrollbar visibility policy + * @param[out] policy_v The vertical scrollbar visibility policy + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_policy_get(const Elm_Code_Widget *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v); + +/** + * @brief Set the width of a tab stop, used purely for visual layout of tab + * characters. + * + * Recommended value is between 2 and 8. + * + * @param[in] obj The object. + * @param[in] tabstop Maximum width of a tab character + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_tabstop_set(Elm_Code_Widget *obj, unsigned int tabstop); + +/** + * @brief Get the current width of a tab stop. This is used to determine where + * characters after a tab should appear in the line. + * + * @param[in] obj The object. + * + * @return Maximum width of a tab character + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI unsigned int elm_code_widget_tabstop_get(const Elm_Code_Widget *obj); + +/** + * @brief 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 update to reflect the + * changes. + * + * @param[in] obj The object. + * @param[in] editable The editable state of the widget + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_editable_set(Elm_Code_Widget *obj, Eina_Bool editable); + +/** + * @brief 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 still be + * manipulated by a different widget or the filesystem. + * + * @param[in] obj The object. + * + * @return The editable state of the widget + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI Eina_Bool elm_code_widget_editable_get(const Elm_Code_Widget *obj); + +/** + * @brief Set whether line numbers should be displayed in the left gutter. + * + * Passing EINA_TRUE will reserve a space for showing line numbers, EINA_FALSE + * will turn this off. + * + * @param[in] obj The object. + * @param[in] line_numbers Whether or not line numbers (or their placeholder) + * should be shown + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_line_numbers_set(Elm_Code_Widget *obj, Eina_Bool line_numbers); + +/** + * @brief Get the status of line number display for this widget. + * + * @param[in] obj The object. + * + * @return Whether or not line numbers (or their placeholder) should be shown + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI Eina_Bool elm_code_widget_line_numbers_get(const Elm_Code_Widget *obj); + +/** + * @brief Set where the line width market should be shown. + * + * Passing a non-zero value will set which line width to mark with a vertical + * line. Passing 0 will hide this marker. + * + * @param[in] obj The object. + * @param[in] line_width_marker Where to display a line width marker, if at all + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_line_width_marker_set(Elm_Code_Widget *obj, unsigned int line_width_marker); + +/** + * @brief Get the position of the line width marker, any positive return + * indicates where the marker appears. + * + * @param[in] obj The object. + * + * @return Where to display a line width marker, if at all + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI unsigned int elm_code_widget_line_width_marker_get(const Elm_Code_Widget *obj); + +/** + * @brief Set whether white space should be shown. + * + * @param[in] obj The object. + * @param[in] show_whitespace Whether or not we show whitespace characters + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_show_whitespace_set(Elm_Code_Widget *obj, Eina_Bool show_whitespace); + +/** + * @brief Get whether or not white space will be visible. + * + * @param[in] obj The object. + * + * @return Whether or not we show whitespace characters + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI Eina_Bool elm_code_widget_show_whitespace_get(const Elm_Code_Widget *obj); + +/** + * @brief Set an alpha color value for this widget (0 - 255) default is fully + * opaque (255). + * + * @param[in] obj The object. + * @param[in] alpha Alpha value + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_alpha_set(Elm_Code_Widget *obj, int alpha); + +/** + * @brief Set an alpha color value for this widget (0 - 255) default is fully + * opaque (255). + * + * @param[in] obj The object. + * + * @return Alpha value + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI int elm_code_widget_alpha_get(const Elm_Code_Widget *obj); + +/** + * @brief Set whether syntax highlighting should be use for this widget. + * + * @param[in] obj The object. + * @param[in] syntax_enabled Whether or not to enable syntax highlighting + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_syntax_enabled_set(Elm_Code_Widget *obj, Eina_Bool syntax_enabled); + +/** + * @brief Get this widget's enabled state for syntax highlighting. + * + * @param[in] obj The object. + * + * @return Whether or not to enable syntax highlighting + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI Eina_Bool elm_code_widget_syntax_enabled_get(const Elm_Code_Widget *obj); + +/** + * @brief Set whether space characters should be inserted instead of tabs. + * + * @param[in] obj The object. + * @param[in] tab_inserts_spaces @c true if we should insert space characters + * instead of a tab when the Tab key is pressed + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_tab_inserts_spaces_set(Elm_Code_Widget *obj, Eina_Bool tab_inserts_spaces); + +/** + * @brief Get whether or not space characters will be inserted instead of tabs. + * + * @param[in] obj The object. + * + * @return @c true if we should insert space characters instead of a tab when + * the Tab key is pressed + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI Eina_Bool elm_code_widget_tab_inserts_spaces_get(const Elm_Code_Widget *obj); + +/** + * @brief Set the current location of the text cursor. + * + * @param[in] obj The object. + * @param[in] row The vertical position ov the cursur - the fist row is 1 + * @param[in] col The horizontal position of the cursor, starting from column 1 + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_cursor_position_set(Elm_Code_Widget *obj, unsigned int row, unsigned int col); + +/** + * @brief Get the current x and y position of the widget's cursor. + * + * @param[in] obj The object. + * @param[out] row The vertical position ov the cursur - the fist row is 1 + * @param[out] col The horizontal position of the cursor, starting from column + * 1 + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_cursor_position_get(const Elm_Code_Widget *obj, unsigned int *row, unsigned int *col); + +/** Update and refresh theme for widget. + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_theme_refresh(Elm_Code_Widget *obj); + +/** + * @brief Refresh code line in widget + * + * @param[in] obj The object. + * @param[in] line The line to refresh. + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_line_refresh(Elm_Code_Widget *obj, Elm_Code_Line *line); + +/** + * @brief Check if the code line is currently visible + * + * @param[in] obj The object. + * @param[in] line The line to test for visibility. + * + * @return @c true if the line specified is currently visible within the scroll + * region. + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI Eina_Bool elm_code_widget_line_visible_get(Elm_Code_Widget *obj, Elm_Code_Line *line); + +/** + * @brief Get the number of code lines currently visible in the widget + * + * @param[in] obj The object. + * + * @return the number of lines currently visible in the widget. + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI unsigned int elm_code_widget_lines_visible_get(Elm_Code_Widget *obj); + +/** + * @brief Get the row, col position for a given coordinate on the widget. + * + * @param[in] obj The object. + * @param[in] x The x coordinate in the widget + * @param[in] y The y coordinate in the widget + * @param[in] row The row for the coordinates + * @param[in] col The column for the coordinates + * + * @return @c true if a line exists at these coordinates + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI Eina_Bool elm_code_widget_position_at_coordinates_get(Elm_Code_Widget *obj, int x, int y, unsigned int *row, int *col); + +/** + * @brief Get the geometry for the cell at the specified position. + * + * @param[in] obj The object. + * @param[in] row The row for the requested position + * @param[in] col The column for the requested position + * @param[in] x The x coordinate of the cell at specified position + * @param[in] y The y coordinate of the cell at specified position + * @param[in] w The width of the cell at specified position + * @param[in] h The height of the cell at specified position + * + * @return @c true if a cell exists at the specified position + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI Eina_Bool elm_code_widget_geometry_for_position_get(Elm_Code_Widget *obj, unsigned int row, int col, int *x, int *y, int *w, int *h); + +/** + * @brief Get the column width of the gutter + * + * @param[in] obj The object. + * + * @return The current column width of the gutter for the widget. + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI int elm_code_widget_text_left_gutter_width_get(Elm_Code_Widget *obj); + +/** + * @brief Get text between given positions + * + * @param[in] obj The object. + * @param[in] start_line The line of the first character to get + * @param[in] start_col The widget column of the first character to get + * @param[in] end_line The line of the last character to get + * @param[in] end_col The widget column of the last character to get + * + * @return The text content between start and end positions + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI char *elm_code_widget_text_between_positions_get(Elm_Code_Widget *obj, unsigned int start_line, unsigned int start_col, unsigned int end_line, unsigned int end_col); + +/** + * @brief Insert the provided text at the cursor position. This will add the + * operation to the widget's undo list. + * + * @param[in] obj The object. + * @param[in] text The text to insert + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_text_at_cursor_insert(Elm_Code_Widget *obj, const char *text); + +/** + * @brief Get text column width at given position + * + * @param[in] obj The object. + * @param[in] line Code line + * @param[in] position Code position + * + * @return Text column width + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI unsigned int elm_code_widget_line_text_column_width_to_position(Elm_Code_Widget *obj, Elm_Code_Line *line, unsigned int position); + +/** + * @brief Get text column width for code line + * + * @param[in] obj The object. + * @param[in] line Code line + * + * @return Text column width + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI unsigned int elm_code_widget_line_text_column_width_get(Elm_Code_Widget *obj, Elm_Code_Line *line); + +/** + * @brief Get position from column + * + * @param[in] obj The object. + * @param[in] line Code line + * @param[in] column Column + * + * @return Position + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI unsigned int elm_code_widget_line_text_position_for_column_get(Elm_Code_Widget *obj, Elm_Code_Line *line, unsigned int column); + +/** + * @brief Get tabwidth for column + * + * @param[in] obj The object. + * @param[in] column Column + * + * @return Tabwidth + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI unsigned int elm_code_widget_text_tabwidth_at_column_get(Elm_Code_Widget *obj, unsigned int column); + +/** + * @brief Toggle the display of the line status widget + * + * @param[in] obj The object. + * @param[in] line Code line + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_line_status_toggle(Elm_Code_Widget *obj, Elm_Code_Line *line); + +/** Undo last action + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_undo(Elm_Code_Widget *obj); + +/** + * @brief Determine if there are any available undo operations + * + * @param[in] obj The object. + * + * @return @c true if there are undo operations + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI Eina_Bool elm_code_widget_can_undo_get(Elm_Code_Widget *obj); + +/** Redo last action + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI void elm_code_widget_redo(Elm_Code_Widget *obj); + +/** + * @brief Determine if there are any available redo operations + * + * @param[in] obj The object. + * + * @return @c true if there are redo operations + * + * @ingroup Elm_Code_Widget_Group + */ +EAPI Eina_Bool elm_code_widget_can_redo_get(Elm_Code_Widget *obj); + +#endif diff --git a/src/lib/elementary/elm_code_widget_legacy.eo b/src/lib/elementary/elm_code_widget_legacy.eo deleted file mode 100644 index 6de8928a25..0000000000 --- a/src/lib/elementary/elm_code_widget_legacy.eo +++ /dev/null @@ -1,5 +0,0 @@ -class Elm.Code_Widget_Legacy extends Elm.Code_Widget implements Efl.Ui.Legacy -{ - [[Elementary code widget]] - data: null; -} diff --git a/src/lib/elementary/elm_code_widget_legacy.h b/src/lib/elementary/elm_code_widget_legacy.h index 5110e301e2..e2d7661a2c 100644 --- a/src/lib/elementary/elm_code_widget_legacy.h +++ b/src/lib/elementary/elm_code_widget_legacy.h @@ -10,4 +10,4 @@ */ EAPI Evas_Object *elm_code_widget_add(Evas_Object *parent, Elm_Code *code); -#include "elm_code_widget.eo.legacy.h" +#include "elm_code_widget_eo.legacy.h" diff --git a/src/lib/elementary/elm_code_widget_legacy_eo.c b/src/lib/elementary/elm_code_widget_legacy_eo.c new file mode 100644 index 0000000000..e16bdd1cc3 --- /dev/null +++ b/src/lib/elementary/elm_code_widget_legacy_eo.c @@ -0,0 +1,27 @@ + +static Eina_Bool +_elm_code_widget_legacy_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifdef ELM_CODE_WIDGET_LEGACY_EXTRA_OPS + EFL_OPS_DEFINE(ops, ELM_CODE_WIDGET_LEGACY_EXTRA_OPS); + opsp = &ops; +#endif + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_code_widget_legacy_class_desc = { + EO_VERSION, + "Elm.Code_Widget_Legacy", + EFL_CLASS_TYPE_REGULAR, + 0, + _elm_code_widget_legacy_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_code_widget_legacy_class_get, &_elm_code_widget_legacy_class_desc, ELM_CODE_WIDGET_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_code_widget_legacy_eo.h b/src/lib/elementary/elm_code_widget_legacy_eo.h new file mode 100644 index 0000000000..4d2b5ffb26 --- /dev/null +++ b/src/lib/elementary/elm_code_widget_legacy_eo.h @@ -0,0 +1,24 @@ +#ifndef _ELM_CODE_WIDGET_LEGACY_EO_H_ +#define _ELM_CODE_WIDGET_LEGACY_EO_H_ + +#ifndef _ELM_CODE_WIDGET_LEGACY_EO_CLASS_TYPE +#define _ELM_CODE_WIDGET_LEGACY_EO_CLASS_TYPE + +typedef Eo Elm_Code_Widget_Legacy; + +#endif + +#ifndef _ELM_CODE_WIDGET_LEGACY_EO_TYPES +#define _ELM_CODE_WIDGET_LEGACY_EO_TYPES + + +#endif +/** Elementary code widget + * + * @ingroup Elm_Code_Widget_Legacy + */ +#define ELM_CODE_WIDGET_LEGACY_CLASS elm_code_widget_legacy_class_get() + +EWAPI const Efl_Class *elm_code_widget_legacy_class_get(void); + +#endif diff --git a/src/lib/elementary/elm_code_widget_legacy_eo.legacy.h b/src/lib/elementary/elm_code_widget_legacy_eo.legacy.h new file mode 100644 index 0000000000..84577e3e7f --- /dev/null +++ b/src/lib/elementary/elm_code_widget_legacy_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_CODE_WIDGET_LEGACY_EO_LEGACY_H_ +#define _ELM_CODE_WIDGET_LEGACY_EO_LEGACY_H_ + +#ifndef _ELM_CODE_WIDGET_LEGACY_EO_CLASS_TYPE +#define _ELM_CODE_WIDGET_LEGACY_EO_CLASS_TYPE + +typedef Eo Elm_Code_Widget_Legacy; + +#endif + +#ifndef _ELM_CODE_WIDGET_LEGACY_EO_TYPES +#define _ELM_CODE_WIDGET_LEGACY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_code_widget_selection.c b/src/lib/elementary/elm_code_widget_selection.c index 59a5615bd4..674f466c33 100644 --- a/src/lib/elementary/elm_code_widget_selection.c +++ b/src/lib/elementary/elm_code_widget_selection.c @@ -62,7 +62,7 @@ elm_code_widget_selection_start(Evas_Object *widget, pd->selection->start_line = line; pd->selection->start_col = col; - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_START, widget); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CODE_SELECTION_START, widget); } EAPI void @@ -90,7 +90,7 @@ elm_code_widget_selection_end(Evas_Object *widget, pd->selection->end_line = line; pd->selection->end_col = col; - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CHANGED, widget); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CODE_SELECTION_CHANGED, widget); } EAPI void @@ -110,7 +110,7 @@ elm_code_widget_selection_select_all(Evas_Object *widget) elm_code_widget_selection_end(widget, maxrow, last_col); - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CHANGED, widget); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CODE_SELECTION_CHANGED, widget); } EAPI Elm_Code_Widget_Selection_Data * @@ -166,7 +166,7 @@ elm_code_widget_selection_clear(Evas_Object *widget) free(pd->selection); pd->selection = NULL; - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CLEARED, widget); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CODE_SELECTION_CLEARED, widget); } static void @@ -292,7 +292,7 @@ _elm_code_widget_selection_delete_do(Evas_Object *widget, Eina_Bool undo) pd->selection = NULL; free(selection); - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CLEARED, widget); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CODE_SELECTION_CLEARED, widget); elm_code_widget_cursor_position_set(widget, row, col); } @@ -425,8 +425,8 @@ elm_code_widget_selection_cut(Evas_Object *widget) elm_code_widget_selection_delete(widget); - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CUT, widget); - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CHANGED_USER, NULL); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CODE_SELECTION_CUT, widget); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CHANGED_USER, NULL); } EAPI void @@ -442,7 +442,7 @@ elm_code_widget_selection_copy(Evas_Object *widget) elm_cnp_selection_loss_callback_set(widget, ELM_SEL_TYPE_CLIPBOARD, _selection_loss_cb, widget); free(text); - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_COPY, widget); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CODE_SELECTION_COPY, widget); } static Eina_Bool @@ -454,7 +454,7 @@ _selection_paste_cb(void *data, Evas_Object *obj EINA_UNUSED, Elm_Selection_Data elm_code_widget_text_at_cursor_insert(widget, ev->data); - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_PASTE, widget); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CODE_SELECTION_PASTE, widget); return EINA_TRUE; } diff --git a/src/lib/elementary/elm_code_widget_text.c b/src/lib/elementary/elm_code_widget_text.c index ce1db18ccb..f560ac382b 100644 --- a/src/lib/elementary/elm_code_widget_text.c +++ b/src/lib/elementary/elm_code_widget_text.c @@ -67,6 +67,7 @@ _elm_code_widget_text_multi_get(Elm_Code_Widget *widget, Elm_Code_Widget_Data *p } ret = malloc(sizeof(char) * (ret_len + 1)); + if (!ret) goto end; snprintf(ret, strlen(first) + newline_len + 1, "%s%s", first, newline); @@ -84,6 +85,7 @@ _elm_code_widget_text_multi_get(Elm_Code_Widget *widget, Elm_Code_Widget_Data *p } snprintf(ptr, strlen(last) + 1, "%s", last); +end: free(first); free(last); return ret; @@ -216,7 +218,7 @@ _elm_code_widget_text_insert_single(Elm_Code_Widget *widget, Elm_Code *code, if (newcol > pd->col_count) _elm_code_widget_resize(widget, line); - elm_obj_code_widget_cursor_position_set(widget, row, newcol); + efl_ui_code_widget_cursor_position_set(widget, row, newcol); } static void @@ -263,8 +265,8 @@ _elm_code_widget_text_at_cursor_insert_do(Elm_Code_Widget *widget, const char *t if (undo) elm_code_widget_selection_delete(widget); - code = elm_obj_code_widget_code_get(widget); - elm_obj_code_widget_cursor_position_get(widget, &row, &col); + code = efl_ui_code_widget_code_get(widget); + efl_ui_code_widget_cursor_position_get(widget, &row, &col); line = elm_code_file_line_get(code->file, row); if (line == NULL) { @@ -285,7 +287,7 @@ _elm_code_widget_text_at_cursor_insert_do(Elm_Code_Widget *widget, const char *t elm_code_line_text_insert(line, 0, indent_text, indent); col = elm_code_widget_line_text_column_width_to_position(widget, line, indent + 1); - elm_obj_code_widget_cursor_position_set(widget, row, col); + efl_ui_code_widget_cursor_position_set(widget, row, col); } } @@ -293,9 +295,9 @@ _elm_code_widget_text_at_cursor_insert_do(Elm_Code_Widget *widget, const char *t _elm_code_widget_text_insert_single(widget, code, col, row, text, length); else _elm_code_widget_text_insert_multi(widget, code, col, row, text, length); - elm_obj_code_widget_cursor_position_get(widget, &end_row, &end_col); + efl_ui_code_widget_cursor_position_get(widget, &end_row, &end_col); - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CHANGED_USER, NULL); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CHANGED_USER, NULL); if (undo) { diff --git a/src/lib/elementary/elm_code_widget_undo.c b/src/lib/elementary/elm_code_widget_undo.c index 7e983d0059..2143e4c244 100644 --- a/src/lib/elementary/elm_code_widget_undo.c +++ b/src/lib/elementary/elm_code_widget_undo.c @@ -31,6 +31,7 @@ _elm_code_widget_undo_info_copy(Elm_Code_Widget_Change_Info *info) Elm_Code_Widget_Change_Info *copy; copy = calloc(1, sizeof(*info)); + if (!copy) return NULL; memcpy(copy, info, sizeof(*info)); copy->content = strndup(info->content, info->length); @@ -89,7 +90,7 @@ _elm_code_widget_undo_change(Evas_Object *widget, _elm_code_widget_text_at_cursor_insert_no_undo(widget, content, textlen); - elm_obj_code_widget_cursor_position_get(widget, &row, &col); + efl_ui_code_widget_cursor_position_get(widget, &row, &col); position = elm_code_widget_line_text_position_for_column_get(widget, line, col); elm_code_line_split_at(line, position); elm_code_widget_cursor_position_set(widget, newrow + 1, 1); @@ -107,7 +108,7 @@ _elm_code_widget_undo_change(Evas_Object *widget, info->end_col + 1); } - efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CHANGED_USER, NULL); + efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CHANGED_USER, NULL); } static Eina_Bool diff --git a/src/lib/elementary/elm_color_class.c b/src/lib/elementary/elm_color_class.c index 54b6f5686c..f6ed3b9c62 100644 --- a/src/lib/elementary/elm_color_class.c +++ b/src/lib/elementary/elm_color_class.c @@ -5,7 +5,7 @@ #include #include "elm_priv.h" #include "elm_color_class.h" -#include "elm_colorselector.eo.h" +#include "elm_colorselector_eo.h" //static Eldbus_Proxy *cc_proxy; //static Ecore_Event_Handler *h1; @@ -743,7 +743,7 @@ elm_color_class_editor_add(Evas_Object *obj) elm_genlist_mode_set(gl, ELM_LIST_COMPRESS); elm_object_part_content_set(ly, "elm.swallow.list", gl); efl_event_callback_add - (gl, EFL_UI_EVENT_SELECTED, _colorclass_activate, cc); + (gl, EFL_UI_EVENT_ITEM_SELECTED, _colorclass_activate, cc); cc->reset = bt = elm_button_add(ly); elm_object_style_set(bt, "colorclass"); diff --git a/src/lib/elementary/elm_color_item.eo b/src/lib/elementary/elm_color_item.eo deleted file mode 100644 index a801d8c715..0000000000 --- a/src/lib/elementary/elm_color_item.eo +++ /dev/null @@ -1,53 +0,0 @@ -class Elm.Color.Item extends Elm.Widget.Item implements Efl.Ui.Focus.Object, Efl.Access.Widget.Action -{ - [[Elementary color item class]] - legacy_prefix: elm_color_item; - eo_prefix: elm_obj_color_item; - methods { - @property color { - get { - [[Get Palette item's color.]] - } - set { - [[Set Palette item's color.]] - } - values { - r: int; [[Red-value of color]] - g: int; [[Green-value of color]] - b: int; [[Blue-value of color]] - a: int; [[Alpha-value of color]] - } - } - @property selected { - get { - [[Get the selected state of color palette item - - @since 1.9 - ]] - } - set { - [[Set the selected state of color palette item - - @since 1.9 - ]] - } - values { - selected: bool; [[$true if selected $false otherwise]] - } - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Elm.Widget.Item.access_register; - Elm.Widget.Item.signal_emit; - Elm.Widget.Item.item_focus { get; set; } - Efl.Ui.Focus.Object.focus { set; } - Efl.Ui.Focus.Object.focus_geometry { get; } - Efl.Ui.Focus.Object.focus_parent { get; } - Efl.Ui.Focus.Object.focus_manager { 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_color_item_eo.c b/src/lib/elementary/elm_color_item_eo.c new file mode 100644 index 0000000000..f0657c5f58 --- /dev/null +++ b/src/lib/elementary/elm_color_item_eo.c @@ -0,0 +1,137 @@ + +void _elm_color_item_color_set(Eo *obj, Elm_Color_Item_Data *pd, int r, int g, int b, int a); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_color_item_color_set, EFL_FUNC_CALL(r, g, b, a), int r, int g, int b, int a); + +void _elm_color_item_color_get(const Eo *obj, Elm_Color_Item_Data *pd, int *r, int *g, int *b, int *a); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_color_item_color_get, EFL_FUNC_CALL(r, g, b, a), int *r, int *g, int *b, int *a); + +void _elm_color_item_selected_set(Eo *obj, Elm_Color_Item_Data *pd, Eina_Bool selected); + + +static Eina_Error +__eolian_elm_color_item_selected_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_color_item_selected_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_color_item_selected_set, EFL_FUNC_CALL(selected), Eina_Bool selected); + +Eina_Bool _elm_color_item_selected_get(const Eo *obj, Elm_Color_Item_Data *pd); + + +static Eina_Value +__eolian_elm_color_item_selected_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_color_item_selected_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_color_item_selected_get, Eina_Bool, 0); + +Efl_Object *_elm_color_item_efl_object_constructor(Eo *obj, Elm_Color_Item_Data *pd); + + +void _elm_color_item_efl_object_destructor(Eo *obj, Elm_Color_Item_Data *pd); + + +Efl_Canvas_Object *_elm_color_item_elm_widget_item_access_register(Eo *obj, Elm_Color_Item_Data *pd); + + +void _elm_color_item_elm_widget_item_signal_emit(Eo *obj, Elm_Color_Item_Data *pd, const char *emission, const char *source); + + +void _elm_color_item_elm_widget_item_item_focus_set(Eo *obj, Elm_Color_Item_Data *pd, Eina_Bool focused); + + +Eina_Bool _elm_color_item_elm_widget_item_item_focus_get(const Eo *obj, Elm_Color_Item_Data *pd); + + +void _elm_color_item_efl_ui_focus_object_focus_set(Eo *obj, Elm_Color_Item_Data *pd, Eina_Bool focus); + + +Eina_Rect _elm_color_item_efl_ui_focus_object_focus_geometry_get(const Eo *obj, Elm_Color_Item_Data *pd); + + +Efl_Ui_Focus_Object *_elm_color_item_efl_ui_focus_object_focus_parent_get(const Eo *obj, Elm_Color_Item_Data *pd); + + +Efl_Ui_Focus_Manager *_elm_color_item_efl_ui_focus_object_focus_manager_get(const Eo *obj, Elm_Color_Item_Data *pd); + + +Efl_Access_State_Set _elm_color_item_efl_access_object_state_set_get(const Eo *obj, Elm_Color_Item_Data *pd); + + +const char *_elm_color_item_efl_access_object_i18n_name_get(const Eo *obj, Elm_Color_Item_Data *pd); + + +const Efl_Access_Action_Data *_elm_color_item_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Color_Item_Data *pd); + + +static Eina_Bool +_elm_color_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_COLOR_ITEM_EXTRA_OPS +#define ELM_COLOR_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_color_item_color_set, _elm_color_item_color_set), + EFL_OBJECT_OP_FUNC(elm_obj_color_item_color_get, _elm_color_item_color_get), + EFL_OBJECT_OP_FUNC(elm_obj_color_item_selected_set, _elm_color_item_selected_set), + EFL_OBJECT_OP_FUNC(elm_obj_color_item_selected_get, _elm_color_item_selected_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_color_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_color_item_efl_object_destructor), + EFL_OBJECT_OP_FUNC(elm_wdg_item_access_register, _elm_color_item_elm_widget_item_access_register), + EFL_OBJECT_OP_FUNC(elm_wdg_item_signal_emit, _elm_color_item_elm_widget_item_signal_emit), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_set, _elm_color_item_elm_widget_item_item_focus_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_get, _elm_color_item_elm_widget_item_item_focus_get), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_focus_set, _elm_color_item_efl_ui_focus_object_focus_set), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_focus_geometry_get, _elm_color_item_efl_ui_focus_object_focus_geometry_get), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_focus_parent_get, _elm_color_item_efl_ui_focus_object_focus_parent_get), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_focus_manager_get, _elm_color_item_efl_ui_focus_object_focus_manager_get), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_color_item_efl_access_object_state_set_get), + EFL_OBJECT_OP_FUNC(efl_access_object_i18n_name_get, _elm_color_item_efl_access_object_i18n_name_get), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_color_item_efl_access_widget_action_elm_actions_get), + ELM_COLOR_ITEM_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"selected", __eolian_elm_color_item_selected_set_reflect, __eolian_elm_color_item_selected_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_color_item_class_desc = { + EO_VERSION, + "Elm.Color.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Color_Item_Data), + _elm_color_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_color_item_class_get, &_elm_color_item_class_desc, ELM_WIDGET_ITEM_CLASS, EFL_UI_FOCUS_OBJECT_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, NULL); + +#include "elm_color_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_color_item_eo.h b/src/lib/elementary/elm_color_item_eo.h new file mode 100644 index 0000000000..6fa8f14786 --- /dev/null +++ b/src/lib/elementary/elm_color_item_eo.h @@ -0,0 +1,75 @@ +#ifndef _ELM_COLOR_ITEM_EO_H_ +#define _ELM_COLOR_ITEM_EO_H_ + +#ifndef _ELM_COLOR_ITEM_EO_CLASS_TYPE +#define _ELM_COLOR_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Color_Item; + +#endif + +#ifndef _ELM_COLOR_ITEM_EO_TYPES +#define _ELM_COLOR_ITEM_EO_TYPES + + +#endif +/** Elementary color item class + * + * @ingroup Elm_Color_Item + */ +#define ELM_COLOR_ITEM_CLASS elm_color_item_class_get() + +EWAPI const Efl_Class *elm_color_item_class_get(void); + +/** + * @brief Set Palette item's color. + * + * @param[in] obj The object. + * @param[in] r Red-value of color + * @param[in] g Green-value of color + * @param[in] b Blue-value of color + * @param[in] a Alpha-value of color + * + * @ingroup Elm_Color_Item + */ +EOAPI void elm_obj_color_item_color_set(Eo *obj, int r, int g, int b, int a); + +/** + * @brief Get Palette item's color. + * + * @param[in] obj The object. + * @param[out] r Red-value of color + * @param[out] g Green-value of color + * @param[out] b Blue-value of color + * @param[out] a Alpha-value of color + * + * @ingroup Elm_Color_Item + */ +EOAPI void elm_obj_color_item_color_get(const Eo *obj, int *r, int *g, int *b, int *a); + +/** + * @brief Set the selected state of color palette item + * + * @param[in] obj The object. + * @param[in] selected @c true if selected @c false otherwise + * + * @since 1.9 + * + * @ingroup Elm_Color_Item + */ +EOAPI void elm_obj_color_item_selected_set(Eo *obj, Eina_Bool selected); + +/** + * @brief Get the selected state of color palette item + * + * @param[in] obj The object. + * + * @return @c true if selected @c false otherwise + * + * @since 1.9 + * + * @ingroup Elm_Color_Item + */ +EOAPI Eina_Bool elm_obj_color_item_selected_get(const Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_color_item_eo.legacy.c b/src/lib/elementary/elm_color_item_eo.legacy.c new file mode 100644 index 0000000000..3bd5aaddeb --- /dev/null +++ b/src/lib/elementary/elm_color_item_eo.legacy.c @@ -0,0 +1,24 @@ + +EAPI void +elm_color_item_color_set(Elm_Color_Item *obj, int r, int g, int b, int a) +{ + elm_obj_color_item_color_set(obj, r, g, b, a); +} + +EAPI void +elm_color_item_color_get(const Elm_Color_Item *obj, int *r, int *g, int *b, int *a) +{ + elm_obj_color_item_color_get(obj, r, g, b, a); +} + +EAPI void +elm_color_item_selected_set(Elm_Color_Item *obj, Eina_Bool selected) +{ + elm_obj_color_item_selected_set(obj, selected); +} + +EAPI Eina_Bool +elm_color_item_selected_get(const Elm_Color_Item *obj) +{ + return elm_obj_color_item_selected_get(obj); +} diff --git a/src/lib/elementary/elm_color_item_eo.legacy.h b/src/lib/elementary/elm_color_item_eo.legacy.h new file mode 100644 index 0000000000..a91f728203 --- /dev/null +++ b/src/lib/elementary/elm_color_item_eo.legacy.h @@ -0,0 +1,68 @@ +#ifndef _ELM_COLOR_ITEM_EO_LEGACY_H_ +#define _ELM_COLOR_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_COLOR_ITEM_EO_CLASS_TYPE +#define _ELM_COLOR_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Color_Item; + +#endif + +#ifndef _ELM_COLOR_ITEM_EO_TYPES +#define _ELM_COLOR_ITEM_EO_TYPES + + +#endif + +/** + * @brief Set Palette item's color. + * + * @param[in] obj The object. + * @param[in] r Red-value of color + * @param[in] g Green-value of color + * @param[in] b Blue-value of color + * @param[in] a Alpha-value of color + * + * @ingroup Elm_Color_Item_Group + */ +EAPI void elm_color_item_color_set(Elm_Color_Item *obj, int r, int g, int b, int a); + +/** + * @brief Get Palette item's color. + * + * @param[in] obj The object. + * @param[out] r Red-value of color + * @param[out] g Green-value of color + * @param[out] b Blue-value of color + * @param[out] a Alpha-value of color + * + * @ingroup Elm_Color_Item_Group + */ +EAPI void elm_color_item_color_get(const Elm_Color_Item *obj, int *r, int *g, int *b, int *a); + +/** + * @brief Set the selected state of color palette item + * + * @param[in] obj The object. + * @param[in] selected @c true if selected @c false otherwise + * + * @since 1.9 + * + * @ingroup Elm_Color_Item_Group + */ +EAPI void elm_color_item_selected_set(Elm_Color_Item *obj, Eina_Bool selected); + +/** + * @brief Get the selected state of color palette item + * + * @param[in] obj The object. + * + * @return @c true if selected @c false otherwise + * + * @since 1.9 + * + * @ingroup Elm_Color_Item_Group + */ +EAPI Eina_Bool elm_color_item_selected_get(const Elm_Color_Item *obj); + +#endif diff --git a/src/lib/elementary/elm_colorselector.c b/src/lib/elementary/elm_colorselector.c index b19f006bb7..831ff3be78 100644 --- a/src/lib/elementary/elm_colorselector.c +++ b/src/lib/elementary/elm_colorselector.c @@ -1317,7 +1317,7 @@ _color_bars_add(Evas_Object *obj) } } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_colorselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Colorselector_Data *sd) { int i; @@ -1328,11 +1328,11 @@ _elm_colorselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Colorselector_Data *sd unsigned int h_pad = DEFAULT_HOR_PAD; unsigned int v_pad = DEFAULT_VER_PAD; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; if ((sd->mode == ELM_COLORSELECTOR_PALETTE) || (sd->mode == ELM_COLORSELECTOR_ALL) || @@ -1739,7 +1739,7 @@ _item_action_activate(Evas_Object *obj, const char *params EINA_UNUSED) elm_object_signal_emit(VIEW(item), "elm,state,selected", "elm"); if (_elm_config->atspi_mode) efl_access_state_changed_signal_emit(obj, - EFL_ACCESS_STATE_CHECKED, + EFL_ACCESS_STATE_TYPE_CHECKED, EINA_TRUE); elm_colorselector_color_set(WIDGET(item), item->color->r, item->color->g, item->color->b, item->color->a); @@ -1890,7 +1890,7 @@ static inline void _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_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); efl_gfx_entity_visible_set(o, EINA_FALSE); } @@ -1954,7 +1954,6 @@ _elm_colorselector_efl_canvas_group_group_add(Eo *obj, Elm_Colorselector_Data *p ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set (obj, "colorselector", "palette", elm_object_style_get(obj))) @@ -2633,7 +2632,7 @@ _elm_color_item_efl_access_object_state_set_get(const Eo *obj, Elm_Color_Item_Da sel = elm_obj_color_item_selected_get(obj); if (sel) - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_CHECKED); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_CHECKED); return ret; } @@ -2749,5 +2748,5 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_colorselector, Elm_Colorselector_Data) ELM_LAYOUT_SIZING_EVAL_OPS(elm_colorselector), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_colorselector) -#include "elm_colorselector.eo.c" -#include "elm_color_item.eo.c" +#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 deleted file mode 100644 index 0d57a6f9f0..0000000000 --- a/src/lib/elementary/elm_colorselector.eo +++ /dev/null @@ -1,126 +0,0 @@ -enum Elm.Colorselector.Mode -{ - [[Different modes supported by Colorselector - - See also @Elm.Colorselector.mode.set, @Elm.Colorselector.mode.get. - ]] - legacy: elm_colorselector; - palette = 0, [[Only color palette is displayed.]] - components, [[Only color selector is displayed.]] - both, [[Both Palette and selector is displayed, default.]] - picker, [[Only color picker is displayed.]] - all [[All possible color selector is displayed.]] -} - -class Elm.Colorselector extends Efl.Ui.Layout implements 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 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]] - g: int; [[Green value of color]] - b: int; [[Blue value of color]] - a: int; [[Alpha value of color]] - } - } - @property palette_name { - set { - [[Set current palette's name - - When colorpalette name is set, colors will be loaded from and saved to config - using the set name. If no name is set then colors will be loaded from or - saved to "default" config. - ]] - } - get { - [[Get current palette's name - - Returns the currently set palette name using which colors will be - saved/loaded in to config. - ]] - } - values { - palette_name: string; [[Name of palette]] - } - } - @property mode { - set { - [[Set Colorselector's mode. - - Colorselector supports three modes palette only, selector only and both. - ]] - } - get { - [[Get Colorselector's mode.]] - } - values { - mode: Elm.Colorselector.Mode; [[Elm_Colorselector_Mode]] - } - } - @property palette_items { - get { - [[Get list of palette items. - - Note That palette item list is internally managed by colorselector widget and - it should not be freed/modified by application. - - @since 1.9 - ]] - return: const(list); [[The list of color palette items.]] - } - } - @property palette_selected_item { - get { - [[Get the selected item in colorselector palette. - - @since 1.9]] - - return: Elm.Widget.Item; [[The selected item, or $null if none selected.]] - } - } - palette_color_add { - [[Add a new color item to palette.]] - - return: Elm.Widget.Item; [[A new color palette Item.]] - params { - @in r: int; [[Red value of color]] - @in g: int; [[Green value of color]] - @in b: int; [[Blue value of color]] - @in a: int; [[Alpha value of color]] - } - } - palette_clear { - [[Clear the palette items.]] - } - } - implements { - class.constructor; - Efl.Object.constructor; - 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.Object.access_children { get; } - } - events { - 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_colorselector_eo.c b/src/lib/elementary/elm_colorselector_eo.c new file mode 100644 index 0000000000..aba3685bd4 --- /dev/null +++ b/src/lib/elementary/elm_colorselector_eo.c @@ -0,0 +1,151 @@ +EWAPI const Efl_Event_Description _ELM_COLORSELECTOR_EVENT_COLOR_ITEM_SELECTED = + EFL_EVENT_DESCRIPTION("color,item,selected"); +EWAPI const Efl_Event_Description _ELM_COLORSELECTOR_EVENT_COLOR_ITEM_LONGPRESSED = + EFL_EVENT_DESCRIPTION("color,item,longpressed"); +EWAPI const Efl_Event_Description _ELM_COLORSELECTOR_EVENT_CHANGED = + EFL_EVENT_DESCRIPTION("changed"); +EWAPI const Efl_Event_Description _ELM_COLORSELECTOR_EVENT_CHANGED_USER = + EFL_EVENT_DESCRIPTION("changed,user"); + +void _elm_colorselector_picked_color_set(Eo *obj, Elm_Colorselector_Data *pd, int r, int g, int b, int a); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_colorselector_picked_color_set, EFL_FUNC_CALL(r, g, b, a), int r, int g, int b, int a); + +void _elm_colorselector_picked_color_get(const Eo *obj, Elm_Colorselector_Data *pd, int *r, int *g, int *b, int *a); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_colorselector_picked_color_get, EFL_FUNC_CALL(r, g, b, a), int *r, int *g, int *b, int *a); + +void _elm_colorselector_palette_name_set(Eo *obj, Elm_Colorselector_Data *pd, const char *palette_name); + + +static Eina_Error +__eolian_elm_colorselector_palette_name_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_colorselector_palette_name_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_colorselector_palette_name_set, EFL_FUNC_CALL(palette_name), const char *palette_name); + +const char *_elm_colorselector_palette_name_get(const Eo *obj, Elm_Colorselector_Data *pd); + + +static Eina_Value +__eolian_elm_colorselector_palette_name_get_reflect(const Eo *obj) +{ + const char *val = elm_obj_colorselector_palette_name_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_colorselector_palette_name_get, const char *, NULL); + +void _elm_colorselector_mode_set(Eo *obj, Elm_Colorselector_Data *pd, Elm_Colorselector_Mode mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_colorselector_mode_set, EFL_FUNC_CALL(mode), Elm_Colorselector_Mode mode); + +Elm_Colorselector_Mode _elm_colorselector_mode_get(const Eo *obj, Elm_Colorselector_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_colorselector_mode_get, Elm_Colorselector_Mode, 0); + +const Eina_List *_elm_colorselector_palette_items_get(const Eo *obj, Elm_Colorselector_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_colorselector_palette_items_get, const Eina_List *, NULL); + +Elm_Widget_Item *_elm_colorselector_palette_selected_item_get(const Eo *obj, Elm_Colorselector_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_colorselector_palette_selected_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_colorselector_palette_color_add(Eo *obj, Elm_Colorselector_Data *pd, int r, int g, int b, int a); + +EOAPI EFL_FUNC_BODYV(elm_obj_colorselector_palette_color_add, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(r, g, b, a), int r, int g, int b, int a); + +void _elm_colorselector_palette_clear(Eo *obj, Elm_Colorselector_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_colorselector_palette_clear); + +Efl_Object *_elm_colorselector_efl_object_constructor(Eo *obj, Elm_Colorselector_Data *pd); + + +Eina_Error _elm_colorselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Colorselector_Data *pd); + + +Eina_Rect _elm_colorselector_efl_ui_widget_focus_highlight_geometry_get(const Eo *obj, Elm_Colorselector_Data *pd); + + +void _elm_colorselector_efl_ui_widget_on_access_update(Eo *obj, Elm_Colorselector_Data *pd, Eina_Bool enable); + + +Eina_Bool _elm_colorselector_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Colorselector_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +const Efl_Access_Action_Data *_elm_colorselector_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Colorselector_Data *pd); + + +Eina_List *_elm_colorselector_efl_access_object_access_children_get(const Eo *obj, Elm_Colorselector_Data *pd); + + +static Eina_Bool +_elm_colorselector_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_COLORSELECTOR_EXTRA_OPS +#define ELM_COLORSELECTOR_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_colorselector_picked_color_set, _elm_colorselector_picked_color_set), + EFL_OBJECT_OP_FUNC(elm_obj_colorselector_picked_color_get, _elm_colorselector_picked_color_get), + EFL_OBJECT_OP_FUNC(elm_obj_colorselector_palette_name_set, _elm_colorselector_palette_name_set), + EFL_OBJECT_OP_FUNC(elm_obj_colorselector_palette_name_get, _elm_colorselector_palette_name_get), + EFL_OBJECT_OP_FUNC(elm_obj_colorselector_mode_set, _elm_colorselector_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_colorselector_mode_get, _elm_colorselector_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_colorselector_palette_items_get, _elm_colorselector_palette_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_colorselector_palette_selected_item_get, _elm_colorselector_palette_selected_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_colorselector_palette_color_add, _elm_colorselector_palette_color_add), + EFL_OBJECT_OP_FUNC(elm_obj_colorselector_palette_clear, _elm_colorselector_palette_clear), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_colorselector_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_colorselector_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_highlight_geometry_get, _elm_colorselector_efl_ui_widget_focus_highlight_geometry_get), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_colorselector_efl_ui_widget_on_access_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_colorselector_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_colorselector_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_access_object_access_children_get, _elm_colorselector_efl_access_object_access_children_get), + ELM_COLORSELECTOR_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"palette_name", __eolian_elm_colorselector_palette_name_set_reflect, __eolian_elm_colorselector_palette_name_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_colorselector_class_desc = { + EO_VERSION, + "Elm.Colorselector", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Colorselector_Data), + _elm_colorselector_class_initializer, + _elm_colorselector_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_colorselector_class_get, &_elm_colorselector_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_colorselector_eo.legacy.c" diff --git a/src/lib/elementary/elm_colorselector_eo.h b/src/lib/elementary/elm_colorselector_eo.h new file mode 100644 index 0000000000..84fe60a94a --- /dev/null +++ b/src/lib/elementary/elm_colorselector_eo.h @@ -0,0 +1,203 @@ +#ifndef _ELM_COLORSELECTOR_EO_H_ +#define _ELM_COLORSELECTOR_EO_H_ + +#ifndef _ELM_COLORSELECTOR_EO_CLASS_TYPE +#define _ELM_COLORSELECTOR_EO_CLASS_TYPE + +typedef Eo Elm_Colorselector; + +#endif + +#ifndef _ELM_COLORSELECTOR_EO_TYPES +#define _ELM_COLORSELECTOR_EO_TYPES + +/** + * @brief Different modes supported by Colorselector + * + * See also @ref elm_obj_colorselector_mode_set, + * @ref elm_obj_colorselector_mode_get. + * + * @ingroup Elm_Colorselector + */ +typedef enum +{ + ELM_COLORSELECTOR_PALETTE = 0, /**< Only color palette is displayed. */ + ELM_COLORSELECTOR_COMPONENTS, /**< Only color selector is displayed. */ + ELM_COLORSELECTOR_BOTH, /**< Both Palette and selector is displayed, default. + */ + ELM_COLORSELECTOR_PICKER, /**< Only color picker is displayed. */ + ELM_COLORSELECTOR_ALL /**< All possible color selector is displayed. */ +} Elm_Colorselector_Mode; + + +#endif +/** Elementary colorselector class + * + * @ingroup Elm_Colorselector + */ +#define ELM_COLORSELECTOR_CLASS elm_colorselector_class_get() + +EWAPI const Efl_Class *elm_colorselector_class_get(void); + +/** + * @brief Set color to colorselector. + * + * @param[in] obj The object. + * @param[in] r Red value of color + * @param[in] g Green value of color + * @param[in] b Blue value of color + * @param[in] a Alpha value of color + * + * @ingroup Elm_Colorselector + */ +EOAPI void elm_obj_colorselector_picked_color_set(Eo *obj, int r, int g, int b, int a); + +/** + * @brief Get current color from colorselector. + * + * @param[in] obj The object. + * @param[out] r Red value of color + * @param[out] g Green value of color + * @param[out] b Blue value of color + * @param[out] a Alpha value of color + * + * @ingroup Elm_Colorselector + */ +EOAPI void elm_obj_colorselector_picked_color_get(const Eo *obj, int *r, int *g, int *b, int *a); + +/** + * @brief Set current palette's name + * + * When colorpalette name is set, colors will be loaded from and saved to + * config using the set name. If no name is set then colors will be loaded from + * or saved to "default" config. + * + * @param[in] obj The object. + * @param[in] palette_name Name of palette + * + * @ingroup Elm_Colorselector + */ +EOAPI void elm_obj_colorselector_palette_name_set(Eo *obj, const char *palette_name); + +/** + * @brief Get current palette's name + * + * Returns the currently set palette name using which colors will be + * saved/loaded in to config. + * + * @param[in] obj The object. + * + * @return Name of palette + * + * @ingroup Elm_Colorselector + */ +EOAPI const char *elm_obj_colorselector_palette_name_get(const Eo *obj); + +/** + * @brief Set Colorselector's mode. + * + * Colorselector supports three modes palette only, selector only and both. + * + * @param[in] obj The object. + * @param[in] mode Elm_Colorselector_Mode + * + * @ingroup Elm_Colorselector + */ +EOAPI void elm_obj_colorselector_mode_set(Eo *obj, Elm_Colorselector_Mode mode); + +/** + * @brief Get Colorselector's mode. + * + * @param[in] obj The object. + * + * @return Elm_Colorselector_Mode + * + * @ingroup Elm_Colorselector + */ +EOAPI Elm_Colorselector_Mode elm_obj_colorselector_mode_get(const Eo *obj); + +/** + * @brief Get list of palette items. + * + * Note That palette item list is internally managed by colorselector widget + * and it should not be freed/modified by application. + * + * @param[in] obj The object. + * + * @return The list of color palette items. + * + * @since 1.9 + * + * @ingroup Elm_Colorselector + */ +EOAPI const Eina_List *elm_obj_colorselector_palette_items_get(const Eo *obj); + +/** + * @brief Get the selected item in colorselector palette. + * + * @param[in] obj The object. + * + * @return The selected item, or @c null if none selected. + * + * @since 1.9 + * + * @ingroup Elm_Colorselector + */ +EOAPI Elm_Widget_Item *elm_obj_colorselector_palette_selected_item_get(const Eo *obj); + +/** + * @brief Add a new color item to palette. + * + * @param[in] obj The object. + * @param[in] r Red value of color + * @param[in] g Green value of color + * @param[in] b Blue value of color + * @param[in] a Alpha value of color + * + * @return A new color palette Item. + * + * @ingroup Elm_Colorselector + */ +EOAPI Elm_Widget_Item *elm_obj_colorselector_palette_color_add(Eo *obj, int r, int g, int b, int a); + +/** Clear the palette items. + * + * @ingroup Elm_Colorselector + */ +EOAPI void elm_obj_colorselector_palette_clear(Eo *obj); + +EWAPI extern const Efl_Event_Description _ELM_COLORSELECTOR_EVENT_COLOR_ITEM_SELECTED; + +/** Called when color item was selected + * @return Efl_Object * + * + * @ingroup Elm_Colorselector + */ +#define ELM_COLORSELECTOR_EVENT_COLOR_ITEM_SELECTED (&(_ELM_COLORSELECTOR_EVENT_COLOR_ITEM_SELECTED)) + +EWAPI extern const Efl_Event_Description _ELM_COLORSELECTOR_EVENT_COLOR_ITEM_LONGPRESSED; + +/** Called when color item got a long press + * @return Efl_Object * + * + * @ingroup Elm_Colorselector + */ +#define ELM_COLORSELECTOR_EVENT_COLOR_ITEM_LONGPRESSED (&(_ELM_COLORSELECTOR_EVENT_COLOR_ITEM_LONGPRESSED)) + +EWAPI extern const Efl_Event_Description _ELM_COLORSELECTOR_EVENT_CHANGED; + +/** Called when colorselector changed + * + * @ingroup Elm_Colorselector + */ +#define ELM_COLORSELECTOR_EVENT_CHANGED (&(_ELM_COLORSELECTOR_EVENT_CHANGED)) + +EWAPI extern const Efl_Event_Description _ELM_COLORSELECTOR_EVENT_CHANGED_USER; + +/** Called when the object changed due to user interaction + * + * @ingroup Elm_Colorselector + */ +#define ELM_COLORSELECTOR_EVENT_CHANGED_USER (&(_ELM_COLORSELECTOR_EVENT_CHANGED_USER)) + +#endif diff --git a/src/lib/elementary/elm_colorselector_eo.legacy.c b/src/lib/elementary/elm_colorselector_eo.legacy.c new file mode 100644 index 0000000000..c3d7225dee --- /dev/null +++ b/src/lib/elementary/elm_colorselector_eo.legacy.c @@ -0,0 +1,60 @@ + +EAPI void +elm_colorselector_color_set(Elm_Colorselector *obj, int r, int g, int b, int a) +{ + elm_obj_colorselector_picked_color_set(obj, r, g, b, a); +} + +EAPI void +elm_colorselector_color_get(const Elm_Colorselector *obj, int *r, int *g, int *b, int *a) +{ + elm_obj_colorselector_picked_color_get(obj, r, g, b, a); +} + +EAPI void +elm_colorselector_palette_name_set(Elm_Colorselector *obj, const char *palette_name) +{ + elm_obj_colorselector_palette_name_set(obj, palette_name); +} + +EAPI const char * +elm_colorselector_palette_name_get(const Elm_Colorselector *obj) +{ + return elm_obj_colorselector_palette_name_get(obj); +} + +EAPI void +elm_colorselector_mode_set(Elm_Colorselector *obj, Elm_Colorselector_Mode mode) +{ + elm_obj_colorselector_mode_set(obj, mode); +} + +EAPI Elm_Colorselector_Mode +elm_colorselector_mode_get(const Elm_Colorselector *obj) +{ + return elm_obj_colorselector_mode_get(obj); +} + +EAPI const Eina_List * +elm_colorselector_palette_items_get(const Elm_Colorselector *obj) +{ + return elm_obj_colorselector_palette_items_get(obj); +} + +EAPI Elm_Widget_Item * +elm_colorselector_palette_selected_item_get(const Elm_Colorselector *obj) +{ + return elm_obj_colorselector_palette_selected_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_colorselector_palette_color_add(Elm_Colorselector *obj, int r, int g, int b, int a) +{ + return elm_obj_colorselector_palette_color_add(obj, r, g, b, a); +} + +EAPI void +elm_colorselector_palette_clear(Elm_Colorselector *obj) +{ + elm_obj_colorselector_palette_clear(obj); +} diff --git a/src/lib/elementary/elm_colorselector_eo.legacy.h b/src/lib/elementary/elm_colorselector_eo.legacy.h new file mode 100644 index 0000000000..3b22f22e4a --- /dev/null +++ b/src/lib/elementary/elm_colorselector_eo.legacy.h @@ -0,0 +1,161 @@ +#ifndef _ELM_COLORSELECTOR_EO_LEGACY_H_ +#define _ELM_COLORSELECTOR_EO_LEGACY_H_ + +#ifndef _ELM_COLORSELECTOR_EO_CLASS_TYPE +#define _ELM_COLORSELECTOR_EO_CLASS_TYPE + +typedef Eo Elm_Colorselector; + +#endif + +#ifndef _ELM_COLORSELECTOR_EO_TYPES +#define _ELM_COLORSELECTOR_EO_TYPES + +/** + * @brief Different modes supported by Colorselector + * + * See also @ref elm_colorselector_mode_set, @ref elm_colorselector_mode_get. + * + * @ingroup Elm_Colorselector + */ +typedef enum +{ + ELM_COLORSELECTOR_PALETTE = 0, /**< Only color palette is displayed. */ + ELM_COLORSELECTOR_COMPONENTS, /**< Only color selector is displayed. */ + ELM_COLORSELECTOR_BOTH, /**< Both Palette and selector is displayed, default. + */ + ELM_COLORSELECTOR_PICKER, /**< Only color picker is displayed. */ + ELM_COLORSELECTOR_ALL /**< All possible color selector is displayed. */ +} Elm_Colorselector_Mode; + + +#endif + +/** + * @brief Set color to colorselector. + * + * @param[in] obj The object. + * @param[in] r Red value of color + * @param[in] g Green value of color + * @param[in] b Blue value of color + * @param[in] a Alpha value of color + * + * @ingroup Elm_Colorselector_Group + */ +EAPI void elm_colorselector_color_set(Elm_Colorselector *obj, int r, int g, int b, int a); + +/** + * @brief Get current color from colorselector. + * + * @param[in] obj The object. + * @param[out] r Red value of color + * @param[out] g Green value of color + * @param[out] b Blue value of color + * @param[out] a Alpha value of color + * + * @ingroup Elm_Colorselector_Group + */ +EAPI void elm_colorselector_color_get(const Elm_Colorselector *obj, int *r, int *g, int *b, int *a); + +/** + * @brief Set current palette's name + * + * When colorpalette name is set, colors will be loaded from and saved to + * config using the set name. If no name is set then colors will be loaded from + * or saved to "default" config. + * + * @param[in] obj The object. + * @param[in] palette_name Name of palette + * + * @ingroup Elm_Colorselector_Group + */ +EAPI void elm_colorselector_palette_name_set(Elm_Colorselector *obj, const char *palette_name); + +/** + * @brief Get current palette's name + * + * Returns the currently set palette name using which colors will be + * saved/loaded in to config. + * + * @param[in] obj The object. + * + * @return Name of palette + * + * @ingroup Elm_Colorselector_Group + */ +EAPI const char *elm_colorselector_palette_name_get(const Elm_Colorselector *obj); + +/** + * @brief Set Colorselector's mode. + * + * Colorselector supports three modes palette only, selector only and both. + * + * @param[in] obj The object. + * @param[in] mode Elm_Colorselector_Mode + * + * @ingroup Elm_Colorselector_Group + */ +EAPI void elm_colorselector_mode_set(Elm_Colorselector *obj, Elm_Colorselector_Mode mode); + +/** + * @brief Get Colorselector's mode. + * + * @param[in] obj The object. + * + * @return Elm_Colorselector_Mode + * + * @ingroup Elm_Colorselector_Group + */ +EAPI Elm_Colorselector_Mode elm_colorselector_mode_get(const Elm_Colorselector *obj); + +/** + * @brief Get list of palette items. + * + * Note That palette item list is internally managed by colorselector widget + * and it should not be freed/modified by application. + * + * @param[in] obj The object. + * + * @return The list of color palette items. + * + * @since 1.9 + * + * @ingroup Elm_Colorselector_Group + */ +EAPI const Eina_List *elm_colorselector_palette_items_get(const Elm_Colorselector *obj); + +/** + * @brief Get the selected item in colorselector palette. + * + * @param[in] obj The object. + * + * @return The selected item, or @c null if none selected. + * + * @since 1.9 + * + * @ingroup Elm_Colorselector_Group + */ +EAPI Elm_Widget_Item *elm_colorselector_palette_selected_item_get(const Elm_Colorselector *obj); + +/** + * @brief Add a new color item to palette. + * + * @param[in] obj The object. + * @param[in] r Red value of color + * @param[in] g Green value of color + * @param[in] b Blue value of color + * @param[in] a Alpha value of color + * + * @return A new color palette Item. + * + * @ingroup Elm_Colorselector_Group + */ +EAPI Elm_Widget_Item *elm_colorselector_palette_color_add(Elm_Colorselector *obj, int r, int g, int b, int a); + +/** Clear the palette items. + * + * @ingroup Elm_Colorselector_Group + */ +EAPI void elm_colorselector_palette_clear(Elm_Colorselector *obj); + +#endif diff --git a/src/lib/elementary/elm_colorselector_legacy.h b/src/lib/elementary/elm_colorselector_legacy.h index 27008db78e..a707951be6 100644 --- a/src/lib/elementary/elm_colorselector_legacy.h +++ b/src/lib/elementary/elm_colorselector_legacy.h @@ -8,4 +8,4 @@ */ EAPI Evas_Object *elm_colorselector_add(Evas_Object *parent); -#include "elm_colorselector.eo.legacy.h" +#include "elm_colorselector_eo.legacy.h" diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c index 7d7e85d438..13b59ed4fd 100644 --- a/src/lib/elementary/elm_config.c +++ b/src/lib/elementary/elm_config.c @@ -5,8 +5,6 @@ #include #include "elm_priv.h" #include -#include - #include "efl_config_global.eo.h" @@ -36,7 +34,8 @@ static void _elm_config_key_binding_hash(void); Eina_Bool _config_profile_lock = EINA_FALSE; static Ecore_Timer *_config_change_delay_timer = NULL; static Ecore_Timer *_config_profile_change_delay_timer = NULL; -static Ecore_Event_Handler *_monitor_file_modified_handler = NULL; +static Ecore_Event_Handler *_monitor_file_created_handler = NULL; +static Ecore_Event_Handler *_monitor_directory_created_handler = NULL; static Eio_Monitor *_eio_config_monitor = NULL; static Eio_Monitor *_eio_profile_monitor = NULL; @@ -190,7 +189,6 @@ static void _config_sub_apply(void); static void _config_update(void); static void _env_get(void); static void _color_overlays_cancel(void); -static Eina_Bool _file_touch(const char *file); #define ELM_CONFIG_VAL(edd, type, member, dtype) \ EET_DATA_DESCRIPTOR_ADD_BASIC(edd, type, #member, member, dtype) @@ -781,7 +779,8 @@ _elm_config_profile_derived_save(const char *profile, Elm_Config_Derived *derive eet_close(ef); if (ret) { - ecore_file_cp(buf, buf2); + if (!ecore_file_cp(buf, buf2)) + ERR("Error saving Elementary's derived configuration profile file"); ecore_file_unlink(buf); } else @@ -1626,19 +1625,20 @@ _elm_recache(void) } static Elm_Config * -_config_user_load(Eina_Bool on_flush) +_config_user_load(void) { Elm_Config *cfg = NULL; Eet_File *ef; char buf[PATH_MAX]; - if (on_flush) - _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/.base.flush.cfg", - _elm_profile); + _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s", + _elm_profile); + ecore_file_mkpath(buf); + if (_eio_config_monitor) eio_monitor_del(_eio_config_monitor); + _eio_config_monitor = eio_monitor_add(buf); - if ((on_flush && !ecore_file_exists(buf)) || !on_flush) - _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg", - _elm_profile); + _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg", + _elm_profile); ef = eet_open(buf, EET_FILE_MODE_READ); if (ef) @@ -1659,6 +1659,8 @@ _config_user_load(Eina_Bool on_flush) return cfg; } +#include "elm_default_config.x" + static Elm_Config * _config_system_load(void) { @@ -1681,6 +1683,20 @@ _config_system_load(void) cfg = eet_data_read(ef, _config_edd, "config"); eet_close(ef); } + + if (!cfg) + { + Eina_Tmpstr* tmp; + ERR("System loading config failed! Check your setup! Falling back to compile time defaults"); + EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_file_mkstemp("/tmp/elementary_configXXXXXX", &tmp), NULL); + ef = eet_open(tmp, EET_FILE_MODE_WRITE); + EINA_SAFETY_ON_FALSE_RETURN_VAL(eet_data_undump(ef, "config", embedded_config, strlen(embedded_config)-1, EINA_FALSE), NULL); + eet_close(ef); + ef = eet_open(tmp, EET_FILE_MODE_READ); + cfg = eet_data_read(ef, _config_edd, "config"); + eet_close(ef); + } + return cfg; } @@ -1691,7 +1707,7 @@ _efl_config_obj_del(Eo *obj EINA_UNUSED) } static void -_config_load(Eina_Bool on_flush) +_config_load(void) { if (_efl_config_obj) { @@ -1710,7 +1726,7 @@ _config_load(Eina_Bool on_flush) efl_del_intercept_set(_efl_config_obj, _efl_config_obj_del); if (!_use_build_config) { - _elm_config = _config_user_load(on_flush); + _elm_config = _config_user_load(); if (_elm_config) { if ((_elm_config->config_version >> ELM_CONFIG_VERSION_EPOCH_OFFSET) < ELM_CONFIG_EPOCH) @@ -1738,155 +1754,20 @@ _config_load(Eina_Bool on_flush) _env_get(); return; } - /* FIXME: config load could have failed because of a non-existent - * profile. Fallback to default before moving on */ - - // config load fail - defaults - // why are these here? well if they are, it means you can make a gui - // config recovery app i guess... - _elm_config = ELM_NEW(Elm_Config); - if (!_elm_config) return; - _elm_config->config_version = ELM_CONFIG_VERSION; - _elm_config->engine = NULL; - _elm_config->accel = NULL; - _elm_config->accel_override = 0; - _elm_config->vsync = 0; - _elm_config->thumbscroll_enable = EINA_TRUE; - _elm_config->thumbscroll_threshold = 24; - _elm_config->thumbscroll_hold_threshold = 24; - _elm_config->thumbscroll_momentum_threshold = 100.0; - _elm_config->thumbscroll_flick_distance_tolerance = 1000; - _elm_config->thumbscroll_momentum_distance_max = 1000; - _elm_config->thumbscroll_friction = 1.0; - _elm_config->thumbscroll_momentum_friction = 1.0; - _elm_config->thumbscroll_min_friction = 0.5; - _elm_config->thumbscroll_friction_standard = 1000.0; - _elm_config->thumbscroll_bounce_friction = 0.5; - _elm_config->thumbscroll_bounce_enable = EINA_TRUE; - _elm_config->thumbscroll_acceleration_threshold = 500.0; - _elm_config->thumbscroll_acceleration_time_limit = 0.7; - _elm_config->thumbscroll_acceleration_weight = 1.5; - _elm_config->thumbscroll_momentum_animation_duration_min_limit = 0.3; - _elm_config->thumbscroll_momentum_animation_duration_max_limit = 1.5; - _elm_config->page_scroll_friction = 0.5; - _elm_config->bring_in_scroll_friction = 0.5; - _elm_config->zoom_friction = 0.5; - _elm_config->thumbscroll_border_friction = 0.5; - _elm_config->thumbscroll_sensitivity_friction = 0.25; // magic number! just trial and error shows this makes it behave "nicer" and not run off at high speed all the time - _elm_config->scroll_smooth_start_enable = EINA_TRUE; - _elm_config->scroll_animation_disable = EINA_FALSE; - _elm_config->scroll_accel_factor = 7.0; -// _elm_config->scroll_smooth_time_interval = 0.008; // not used anymore - _elm_config->scroll_smooth_amount = 1.0; -// _elm_config->scroll_smooth_history_weight = 0.3; // not used anymore -// _elm_config->scroll_smooth_future_time = 0.0; // not used anymore - _elm_config->scroll_smooth_time_window = 0.15; - _elm_config->scale = 1.0; - _elm_config->bgpixmap = 0; - _elm_config->compositing = 1; - _elm_config->font_hinting = 2; - _elm_config->cache_flush_poll_interval = 512; - _elm_config->cache_flush_enable = EINA_TRUE; - _elm_config->font_dirs = NULL; - _elm_config->image_cache = 4096; - _elm_config->font_cache = 512; - _elm_config->edje_cache = 32; - _elm_config->edje_collection_cache = 64; - _elm_config->finger_size = 10; - _elm_config->fps = 60.0; - _elm_config->theme = eina_stringshare_add("default"); - _elm_config->modules = NULL; - _elm_config->tooltip_delay = 1.0; - _elm_config->cursor_engine_only = EINA_TRUE; - _elm_config->focus_highlight_enable = EINA_FALSE; - _elm_config->focus_highlight_animate = EINA_TRUE; - _elm_config->focus_highlight_clip_disable = EINA_FALSE; - _elm_config->focus_move_policy = ELM_FOCUS_MOVE_POLICY_CLICK; - _elm_config->first_item_focus_on_first_focus_in = EINA_FALSE; - _elm_config->item_select_on_focus_disable = EINA_TRUE; - _elm_config->toolbar_shrink_mode = 2; - _elm_config->fileselector_expand_enable = EINA_FALSE; - _elm_config->fileselector_double_tap_navigation_enable = EINA_FALSE; - _elm_config->inwin_dialogs_enable = EINA_FALSE; - _elm_config->icon_size = 32; - _elm_config->longpress_timeout = 1.0; - _elm_config->effect_enable = EINA_TRUE; - _elm_config->desktop_entry = EINA_FALSE; - _elm_config->context_menu_disabled = EINA_FALSE; - _elm_config->is_mirrored = EINA_FALSE; /* Read sys value in env_get() */ - _elm_config->password_show_last = EINA_FALSE; - _elm_config->password_show_last_timeout = 2.0; - _elm_config->glayer_zoom_finger_enable = EINA_TRUE; - _elm_config->glayer_zoom_finger_factor = 1.0; - _elm_config->glayer_zoom_wheel_factor = 0.05; - _elm_config->glayer_zoom_distance_tolerance = 1.0; /* 1 times elm_config_finger_size_get() */ - _elm_config->glayer_rotate_finger_enable = EINA_TRUE; - _elm_config->glayer_rotate_angular_tolerance = 2.0; /* 2 DEG */ - _elm_config->glayer_line_min_length = 1.0; /* 1 times elm_config_finger_size_get() */ - _elm_config->glayer_line_distance_tolerance = 3.0; /* 3 times elm_config_finger_size_get() */ - _elm_config->glayer_line_angular_tolerance = 20.0; /* 20 DEG */ - _elm_config->glayer_flick_time_limit_ms = 120; /* ms to finish flick */ - _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 */ - _elm_config->weekend_start = 6; /* saturday */ - _elm_config->weekend_len = 2; - _elm_config->year_min = 70; - _elm_config->year_max = 137; - _elm_config->softcursor_mode = 0; /* 0 = auto, 1 = on, 2 = off */ - _elm_config->color_palette = NULL; - _elm_config->auto_norender_withdrawn = 0; - _elm_config->auto_norender_iconified_same_as_withdrawn = 1; - _elm_config->auto_flush_withdrawn = 0; - _elm_config->auto_dump_withdrawn = 0; - _elm_config->auto_throttle = 0; - _elm_config->auto_throttle_amount = 0.1; - _elm_config->indicator_service_0 = eina_stringshare_add("elm_indicator_portrait"); - _elm_config->indicator_service_90 = eina_stringshare_add("elm_indicator_landscape"); - _elm_config->indicator_service_180 = eina_stringshare_add("elm_indicator_portrait"); - _elm_config->indicator_service_270 = eina_stringshare_add("elm_indicator_landscape"); - _elm_config->disable_external_menu = EINA_FALSE; - _elm_config->magnifier_enable = EINA_TRUE; - _elm_config->spinner_min_max_filter_enable = EINA_FALSE; - _elm_config->magnifier_scale = 1.5; - _elm_config->audio_mute_effect = 0; - _elm_config->audio_mute_background = 0; - _elm_config->audio_mute_music = 0; - _elm_config->audio_mute_foreground = 0; - _elm_config->audio_mute_interface = 0; - _elm_config->audio_mute_input = 0; - _elm_config->audio_mute_alert = 0; - _elm_config->audio_mute_all = 0; - _elm_config->win_auto_focus_enable = 1; - _elm_config->win_auto_focus_animate = 1; - _elm_config->atspi_mode = ELM_ATSPI_MODE_OFF; - _elm_config->gl_depth = 0; - _elm_config->gl_msaa = 0; - _elm_config->gl_stencil = 0; - _elm_config->transition_duration_factor = 1.0; - _elm_config->naviframe_prev_btn_auto_pushed = EINA_TRUE; - _elm_config->popup_horizontal_align = 0.5; - _elm_config->popup_vertical_align = 0.5; - _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; - _elm_config->win_no_border = EINA_FALSE; - _env_get(); + else + { + ERR("Everything failed, no config found or created. This will not work"); + } } static void -_elm_config_reload_do(Eina_Bool on_flush) +_elm_config_reload_do(void) { Elm_Config *prev_config; prev_config = _elm_config; _elm_config = NULL; - _config_load(on_flush); + _config_load(); if ((prev_config) && (_elm_config)) { #define KEEP_VAL(xxx) \ @@ -2107,7 +1988,7 @@ _config_flush_get(void) _elm_config_font_overlays_cancel(); _color_overlays_cancel(); - _elm_config_reload_do(EINA_TRUE); + _elm_config_reload_do(); /* restore prev value which is not part of the EET file */ _elm_config->is_mirrored = is_mirrored; @@ -2191,36 +2072,6 @@ _elm_config_eet_close_error_get(Eet_File *ef, return NULL; } -static char * -_elm_config_profile_name_get() -{ - char buf[PATH_MAX], *p; - Eet_File *ef = NULL; - int len = 0; - char *rst = NULL; - - _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg"); - - ef = eet_open(buf, EET_FILE_MODE_READ); - if (ef) - { - p = eet_read(ef, "config", &len); - if (p) - { - rst = calloc(1, len+1); - memcpy(rst, p, len); - rst[len] = '\0'; - free(p); - } - eet_close(ef); - } - - if (rst) - return rst; - else - return strdup("default"); -} - static Eina_Bool _elm_config_profile_save(const char *profile) { @@ -2230,50 +2081,43 @@ _elm_config_profile_save(const char *profile) const char *err, *s; Eet_File *ef; size_t len; - char *_file_profile = NULL; if ((s = getenv("ELM_PROFILE_NOSAVE")) && atoi(s)) return EINA_TRUE; - _file_profile = _elm_config_profile_name_get(); + len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg"); + if (len + 1 >= sizeof(buf)) + return EINA_FALSE; - if (!_file_profile || strcmp(_elm_profile, _file_profile)) + len = _elm_config_user_dir_snprintf(buf2, sizeof(buf2), + "config/profile.cfg.tmp"); + if (len + 1 >= sizeof(buf2)) + return EINA_FALSE; + + ef = eet_open(buf2, EET_FILE_MODE_WRITE); + if (!ef) + return EINA_FALSE; + + ok = eet_write(ef, "config", _elm_profile, strlen(_elm_profile), 0); + if (!ok) + goto err; + + err = _elm_config_eet_close_error_get(ef, buf2); + if (err) { - len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg"); - if (len + 1 >= sizeof(buf)) - return EINA_FALSE; - - len = _elm_config_user_dir_snprintf(buf2, sizeof(buf2), - "config/profile.cfg.tmp"); - if (len + 1 >= sizeof(buf2)) - return EINA_FALSE; - - ef = eet_open(buf2, EET_FILE_MODE_WRITE); - if (!ef) - return EINA_FALSE; - - ok = eet_write(ef, "config", _elm_profile, strlen(_elm_profile), 0); - if (!ok) - goto err; - - err = _elm_config_eet_close_error_get(ef, buf2); - if (err) - { - ERR("%s", err); - free((void *)err); - goto err; - } - - ret = ecore_file_cp(buf2, buf); - if (!ret) - { - ERR("Error saving Elementary's configuration profile file"); - goto err; - } - - ecore_file_unlink(buf2); + ERR("%s", err); + free((void *)err); + goto err; } - free(_file_profile); + + ret = ecore_file_cp(buf2, buf); + if (!ret) + { + ERR("Error saving Elementary's configuration profile file"); + goto err; + } + + ecore_file_unlink(buf2); derived = _elm_config_derived_load(profile ? profile : _elm_profile); if (derived) @@ -2595,10 +2439,10 @@ _env_get(void) eina_stringshare_replace(&_elm_config->engine, s); else if ((!strcasecmp(s, "ews"))) eina_stringshare_replace(&_elm_config->engine, ELM_EWS); - else if ((!strcasecmp(s, "wayland_shm")) || + else if ((!strcasecmp(s, "wayland_shm")) || (!strcasecmp(s, "wayland-shm"))) eina_stringshare_replace(&_elm_config->engine, ELM_WAYLAND_SHM); - else if ((!strcasecmp(s, "wayland_egl")) || + else if ((!strcasecmp(s, "wayland_egl")) || (!strcasecmp(s, "wayland-egl"))) eina_stringshare_replace(&_elm_config->engine, ELM_WAYLAND_EGL); else if ((!strcasecmp(s, "drm"))) @@ -3106,7 +2950,7 @@ elm_config_save(void) EAPI void elm_config_reload(void) { - _elm_config_reload(EINA_FALSE); + _elm_config_reload(); } EAPI const char * @@ -4245,10 +4089,9 @@ elm_config_popup_scrollable_set(Eina_Bool scrollable) EAPI void elm_config_all_flush(void) { - char buf[PATH_MAX], buf2[PATH_MAX]; + char buf[PATH_MAX]; int ok = 0; size_t len; - Eet_File *ef = NULL; len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "themes/"); if (len + 1 >= sizeof(buf)) @@ -4280,27 +4123,6 @@ elm_config_all_flush(void) return; } - _elm_config_user_dir_snprintf(buf, sizeof(buf), - "config/%s/.base.flush.cfg.tmp", _elm_profile); - - _elm_config_user_dir_snprintf(buf2, sizeof(buf2), - "config/%s/.base.flush.cfg", _elm_profile); - - ef = eet_open(buf, EET_FILE_MODE_WRITE); - if (ef) - { - ok = eet_data_write(ef, _config_edd, "config", _elm_config, 1); - if (!ok) - { - eet_close(ef); - ERR("Failed to save config"); - return; - } - eet_close(ef); - ecore_file_cp(buf, buf2); - } - ecore_file_unlink(buf); - elm_config_save(); return; } @@ -4346,7 +4168,7 @@ _elm_config_init(void) _desc_init(); _elm_config_profile_derived_init(); _profile_fetch_from_conf(); - _config_load(EINA_FALSE); + _config_load(); if (_elm_config) _env_get(); ELM_SAFE_FREE(_elm_accel_preference, eina_stringshare_del); ELM_SAFE_FREE(_elm_gl_preference, eina_stringshare_del); @@ -4374,27 +4196,17 @@ _elm_config_sub_shutdown(void) ELM_SAFE_FREE(_eio_profile_monitor, eio_monitor_del); ELM_SAFE_FREE(_config_change_delay_timer, ecore_timer_del); ELM_SAFE_FREE(_config_profile_change_delay_timer, ecore_timer_del); - ELM_SAFE_FREE(_monitor_file_modified_handler, ecore_event_handler_del); + ELM_SAFE_FREE(_monitor_file_created_handler, ecore_event_handler_del); + ELM_SAFE_FREE(_monitor_directory_created_handler, ecore_event_handler_del); } static Eina_Bool _config_profile_change_delay_cb(void *data EINA_UNUSED) { char *pprof = NULL; - char buf[PATH_MAX]; if (_elm_profile) pprof = strdup(_elm_profile); _profile_fetch_from_conf(); - - _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg", _elm_profile); - if(!ecore_file_exists(buf)) _file_touch(buf); - - _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/.base.flush.cfg", _elm_profile); - if(!ecore_file_exists(buf)) _file_touch(buf); - - ELM_SAFE_FREE(_eio_config_monitor, eio_monitor_del); - _eio_config_monitor = eio_monitor_add(buf); - if ((!pprof) || (!(!strcmp(pprof, _elm_profile)))) { _config_flush_get(); @@ -4407,7 +4219,7 @@ _config_profile_change_delay_cb(void *data EINA_UNUSED) static Eina_Bool _config_change_delay_cb(void *data EINA_UNUSED) { - _elm_config_reload(EINA_TRUE); + _elm_config_reload(); _config_change_delay_timer = NULL; return ECORE_CALLBACK_CANCEL; @@ -4423,21 +4235,42 @@ _elm_config_file_monitor_cb(void *data EINA_UNUSED, if (ev->monitor == _eio_config_monitor) { - if (!strcmp(file, ".base.flush.cfg")) + if (type == EIO_MONITOR_FILE_CREATED) { - if (_config_change_delay_timer) - ecore_timer_del(_config_change_delay_timer); - _config_change_delay_timer = ecore_timer_add(0.1, _config_change_delay_cb, NULL); + if (!strcmp(file, "base.cfg")) + { + if (_config_change_delay_timer) + ecore_timer_del(_config_change_delay_timer); + _config_change_delay_timer = ecore_timer_add(0.1, _config_change_delay_cb, NULL); + } } } - if (ev->monitor == _eio_profile_monitor) { - if (!strcmp(file, "profile.cfg")) + if (type == EIO_MONITOR_FILE_CREATED) { - if (_config_profile_change_delay_timer) - ecore_timer_del(_config_profile_change_delay_timer); - _config_profile_change_delay_timer = ecore_timer_add(0.1, _config_profile_change_delay_cb, NULL); + if ((!_config_profile_lock) && (!strcmp(file, "profile.cfg"))) + { + if (_config_profile_change_delay_timer) + ecore_timer_del(_config_profile_change_delay_timer); + _config_profile_change_delay_timer = ecore_timer_add(0.1, _config_profile_change_delay_cb, NULL); + } + } + else if (type == EIO_MONITOR_DIRECTORY_CREATED) + { + if (!_eio_config_monitor) + { + char buf[PATH_MAX]; + + _eio_config_monitor = eio_monitor_add(ev->filename); + snprintf(buf, sizeof(buf), "%s/base.cfg", ev->filename); + if (ecore_file_exists(buf)) + { + if (_config_change_delay_timer) + ecore_timer_del(_config_change_delay_timer); + _config_change_delay_timer = ecore_timer_add(0.1, _config_change_delay_cb, NULL); + } + } } } @@ -4464,29 +4297,18 @@ _elm_config_sub_init(void) buf); goto end; } - - _elm_config_profile_save(NULL); - - _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg"); - if(!ecore_file_exists(buf)) _file_touch(buf); _eio_profile_monitor = eio_monitor_add(buf); - - _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg", _elm_profile); - if(!ecore_file_exists(buf)) _file_touch(buf); - - _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/.base.flush.cfg", _elm_profile); - if(!ecore_file_exists(buf)) _file_touch(buf); - _eio_config_monitor = eio_monitor_add(buf); - - _monitor_file_modified_handler = ecore_event_handler_add - (EIO_MONITOR_FILE_MODIFIED, _elm_config_file_monitor_cb, NULL); + _monitor_file_created_handler = ecore_event_handler_add + (EIO_MONITOR_FILE_CREATED, _elm_config_file_monitor_cb, NULL); + _monitor_directory_created_handler = ecore_event_handler_add + (EIO_MONITOR_DIRECTORY_CREATED, _elm_config_file_monitor_cb, NULL); end: _config_sub_apply(); } void -_elm_config_reload(Eina_Bool on_flush) +_elm_config_reload(void) { Eina_Bool is_mirrored; Eina_Bool translate; @@ -4520,8 +4342,8 @@ _elm_config_reload(Eina_Bool on_flush) is_mirrored = _elm_config->is_mirrored; translate = _elm_config->translate; - _elm_config_reload_do(on_flush); - + _elm_config_reload_do(); + /* restore prev value which is not part of the EET file */ _elm_config->is_mirrored = is_mirrored; _elm_config->translate = translate; @@ -4806,7 +4628,6 @@ _elm_config_profile_set(const char *profile) Eina_Bool translate; is_mirrored = _elm_config->is_mirrored; translate = _elm_config->translate; - char buf[PATH_MAX]; if (!profile) return; @@ -4820,15 +4641,9 @@ _elm_config_profile_set(const char *profile) _elm_profile = strdup(profile); - _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg", _elm_profile); - if(!ecore_file_exists(buf)) _file_touch(buf); - - _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/.base.flush.cfg", _elm_profile); - if(!ecore_file_exists(buf)) _file_touch(buf); - _color_overlays_cancel(); - _elm_config_reload_do(EINA_FALSE); + _elm_config_reload_do(); /* restore prev value which is not part of the EET file */ _elm_config->is_mirrored = is_mirrored; @@ -4964,7 +4779,7 @@ static const struct { const char *str; } _enum_map_focus_move_policy[] = { { EFL_UI_FOCUS_MOVE_POLICY_CLICK, "click" }, -{ EFL_UI_FOCUS_MOVE_POLICY_IN, "in" }, +{ EFL_UI_FOCUS_MOVE_POLICY_MOVE_IN, "in" }, { EFL_UI_FOCUS_MOVE_POLICY_KEY_ONLY, "key_only" } }; @@ -5392,25 +5207,6 @@ EOLIAN static void _efl_config_global_profile_derived_del(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, const char *profile) { elm_config_profile_derived_del(profile); - -} -static Eina_Bool -_file_touch(const char *file) -{ - if (!file) return EINA_FALSE; - - const char *dir = ecore_file_dir_get(file); - if(!dir) return EINA_FALSE; - if(!ecore_file_mkpath(dir)) return EINA_FALSE; - - Eo *f = efl_add_ref(EFL_IO_FILE_CLASS, NULL, - efl_file_set(efl_added, file, NULL), - efl_io_file_flags_set(efl_added, O_CREAT|O_RDWR), - efl_io_file_mode_set(efl_added, 0644)); - if (!f) return EINA_FALSE; - efl_unref(f); - - return EINA_TRUE; } #include "efl_config_global.eo.c" diff --git a/src/lib/elementary/elm_config.h b/src/lib/elementary/elm_config.h index 91c99fa8c1..284757c334 100644 --- a/src/lib/elementary/elm_config.h +++ b/src/lib/elementary/elm_config.h @@ -651,7 +651,7 @@ EAPI double elm_config_scroll_thumbscroll_smooth_amount_get(void); * * Scrolling with your finger can be smoothed out and the amount to smooth * is determined by this parameter. 0.0 means to not smooth at all and - * 1.0 is to smoth as much as possible. + * 1.0 is to smooth as much as possible. * * @param amount the amount to smooth from 0.0 to 1.0 with 0.0 being none * @@ -1675,8 +1675,8 @@ EAPI Eina_Bool elm_config_vsync_get(void); EAPI void elm_config_vsync_set(Eina_Bool enabled); /** - * Get the configure flag that will define if a window agressively drop its - * ressource when minimized. + * Get the configure flag that will define if a window aggressively drop its + * resources when minimized. * * @return if it does. * @@ -1685,8 +1685,8 @@ EAPI void elm_config_vsync_set(Eina_Bool enabled); EAPI Eina_Bool elm_config_agressive_withdrawn_get(void); /** - * Set the configure flag that will make a window agressively drop its - * ressource when minimized. + * Set the configure flag that will make a window aggressively drop its + * resources when minimized. * * @param enabled This should be @c EINA_TRUE if enabled, or @c EINA_FALSE if * not. @@ -2136,7 +2136,7 @@ EAPI void elm_config_audio_mute_set(Edje_Channel channel, Eina_Bool mute); * This determines if elementary will show a focus box indicating the focused * widget automatically if keyboard controls like "Tab" are used to switch * focus between widgets. Mouse or touch control will hide this auto shown - * focus, unless focus display has been expliccitly forced on for the window. + * focus, unless focus display has been explicitly forced on for the window. * * @return The enabled state for auto focus display * @since 1.14 @@ -2149,7 +2149,7 @@ EAPI Eina_Bool elm_config_window_auto_focus_enable_get(void); * This determines if elementary will show a focus box indicating the focused * widget automatically if keyboard controls like "Tab" are used to switch * focus between widgets. Mouse or touch control will hide this auto shown - * focus, unless focus display has been expliccitly forced on for the window. + * focus, unless focus display has been explicitly forced on for the window. * * @param enable the auto focus display enabled state * @since 1.14 @@ -2356,7 +2356,8 @@ EAPI void elm_config_drag_anim_duration_set(double set); /* new efl.config interface helpers in C */ -#ifdef EFL_EO_API_SUPPORT +/* FIXME these depend on stuff from Efl.h but this is included before that */ +#ifdef EFL_BETA_API_SUPPORT static inline Eina_Bool efl_config_bool_set(Efl_Config *obj, const char * name, Eina_Bool val) diff --git a/src/lib/elementary/elm_conform.c b/src/lib/elementary/elm_conform.c index 4c4035df3c..55c6bc8488 100644 --- a/src/lib/elementary/elm_conform.c +++ b/src/lib/elementary/elm_conform.c @@ -11,9 +11,9 @@ #include "elm_widget_conform.h" #include "elm_widget_layout.h" #include "elm_widget_plug.h" -#include "elm_scroller.eo.h" -#include "elm_genlist.eo.h" -#include "elm_conformant.eo.h" +#include "elm_scroller_eo.h" +#include "elm_genlist_eo.h" +#include "elm_conformant_eo.h" #define MY_CLASS ELM_CONFORMANT_CLASS #define MY_CLASS_PFX elm_conformant @@ -573,13 +573,13 @@ _on_rotation_changed(void *data, const Efl_Event *event EINA_UNUSED) } } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_conformant_efl_ui_widget_theme_apply(Eo *obj, Elm_Conformant_Data *_pd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _conformant_parts_swallow(obj); @@ -927,7 +927,6 @@ EOLIAN static void _elm_conformant_efl_canvas_group_group_add(Eo *obj, Elm_Conformant_Data *_pd EINA_UNUSED) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_FALSE); if (!elm_layout_theme_set @@ -960,14 +959,24 @@ _elm_conformant_efl_canvas_group_group_del(Eo *obj, Elm_Conformant_Data *sd) evas_object_data_set(sd->win, "\377 elm,conformant", NULL); efl_event_callback_del(sd->win, EFL_UI_WIN_EVENT_INDICATOR_PROP_CHANGED, _on_indicator_mode_changed, obj); - efl_event_callback_del(sd->win, EFL_UI_WIN_EVENT_ROTATION_CHANGED, _on_rotation_changed, obj); + efl_event_callback_del(sd->win, EFL_UI_WIN_EVENT_WIN_ROTATION_CHANGED, _on_rotation_changed, obj); efl_canvas_group_del(efl_super(obj, MY_CLASS)); } -EOLIAN static void -_elm_conformant_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Conformant_Data *sd, Evas_Object *parent) +EAPI Evas_Object * +elm_conformant_add(Evas_Object *parent) { + EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); + return elm_legacy_add(MY_CLASS, parent); +} + +EOLIAN static Eo * +_elm_conformant_efl_object_constructor(Eo *obj, Elm_Conformant_Data *sd) +{ + Eo *parent; + obj = efl_constructor(efl_super(obj, MY_CLASS)); + parent = efl_parent_get(obj); #ifdef HAVE_ELEMENTARY_X Evas_Object *top = elm_widget_top_get(parent); Ecore_X_Window xwin = elm_win_xwindow_get(parent); @@ -986,19 +995,7 @@ _elm_conformant_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Conformant_Data *sd (void)sd; (void)parent; #endif -} -EAPI Evas_Object * -elm_conformant_add(Evas_Object *parent) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - return elm_legacy_add(MY_CLASS, parent); -} - -EOLIAN static Eo * -_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_object_role_set(obj, EFL_ACCESS_ROLE_FILLER); @@ -1015,7 +1012,7 @@ _elm_conformant_efl_object_constructor(Eo *obj, Elm_Conformant_Data *sd) evas_object_data_set(sd->win, "\377 elm,conformant", obj); efl_event_callback_add(sd->win, EFL_UI_WIN_EVENT_INDICATOR_PROP_CHANGED, _on_indicator_mode_changed, obj); - efl_event_callback_add(sd->win, EFL_UI_WIN_EVENT_ROTATION_CHANGED, _on_rotation_changed, obj); + efl_event_callback_add(sd->win, EFL_UI_WIN_EVENT_WIN_ROTATION_CHANGED, _on_rotation_changed, obj); return obj; } @@ -1034,4 +1031,4 @@ ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX) ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_conformant) -#include "elm_conformant.eo.c" +#include "elm_conformant_eo.c" diff --git a/src/lib/elementary/elm_conformant.eo b/src/lib/elementary/elm_conformant.eo deleted file mode 100644 index 1baafd3c7f..0000000000 --- a/src/lib/elementary/elm_conformant.eo +++ /dev/null @@ -1,19 +0,0 @@ -class Elm.Conformant extends Efl.Ui.Layout implements Efl.Ui.Legacy -{ - [[Elementary conformant class]] - legacy_prefix: elm_conformant; - eo_prefix: elm_obj_conformant; - event_prefix: elm_conformant; - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.widget_parent { set; } - Efl.Ui.Widget.theme_apply; - } - events { - 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_conformant_eo.c b/src/lib/elementary/elm_conformant_eo.c new file mode 100644 index 0000000000..379426c52f --- /dev/null +++ b/src/lib/elementary/elm_conformant_eo.c @@ -0,0 +1,47 @@ +EWAPI const Efl_Event_Description _ELM_CONFORMANT_EVENT_VIRTUALKEYPAD_STATE_ON = + EFL_EVENT_DESCRIPTION("virtualkeypad,state,on"); +EWAPI const Efl_Event_Description _ELM_CONFORMANT_EVENT_VIRTUALKEYPAD_STATE_OFF = + EFL_EVENT_DESCRIPTION("virtualkeypad,state,off"); +EWAPI const Efl_Event_Description _ELM_CONFORMANT_EVENT_CLIPBOARD_STATE_ON = + EFL_EVENT_DESCRIPTION("clipboard,state,on"); +EWAPI const Efl_Event_Description _ELM_CONFORMANT_EVENT_CLIPBOARD_STATE_OFF = + EFL_EVENT_DESCRIPTION("clipboard,state,off"); + +Efl_Object *_elm_conformant_efl_object_constructor(Eo *obj, Elm_Conformant_Data *pd); + + +Eina_Error _elm_conformant_efl_ui_widget_theme_apply(Eo *obj, Elm_Conformant_Data *pd); + + +static Eina_Bool +_elm_conformant_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_CONFORMANT_EXTRA_OPS +#define ELM_CONFORMANT_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_conformant_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_conformant_efl_ui_widget_theme_apply), + ELM_CONFORMANT_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_conformant_class_desc = { + EO_VERSION, + "Elm.Conformant", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Conformant_Data), + _elm_conformant_class_initializer, + _elm_conformant_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_conformant_class_get, &_elm_conformant_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_conformant_eo.h b/src/lib/elementary/elm_conformant_eo.h new file mode 100644 index 0000000000..e3f449f4e4 --- /dev/null +++ b/src/lib/elementary/elm_conformant_eo.h @@ -0,0 +1,56 @@ +#ifndef _ELM_CONFORMANT_EO_H_ +#define _ELM_CONFORMANT_EO_H_ + +#ifndef _ELM_CONFORMANT_EO_CLASS_TYPE +#define _ELM_CONFORMANT_EO_CLASS_TYPE + +typedef Eo Elm_Conformant; + +#endif + +#ifndef _ELM_CONFORMANT_EO_TYPES +#define _ELM_CONFORMANT_EO_TYPES + + +#endif +/** Elementary conformant class + * + * @ingroup Elm_Conformant + */ +#define ELM_CONFORMANT_CLASS elm_conformant_class_get() + +EWAPI const Efl_Class *elm_conformant_class_get(void); + +EWAPI extern const Efl_Event_Description _ELM_CONFORMANT_EVENT_VIRTUALKEYPAD_STATE_ON; + +/** Called when virtualkeypad was enabled + * + * @ingroup Elm_Conformant + */ +#define ELM_CONFORMANT_EVENT_VIRTUALKEYPAD_STATE_ON (&(_ELM_CONFORMANT_EVENT_VIRTUALKEYPAD_STATE_ON)) + +EWAPI extern const Efl_Event_Description _ELM_CONFORMANT_EVENT_VIRTUALKEYPAD_STATE_OFF; + +/** Called when virtualkeypad was disabled + * + * @ingroup Elm_Conformant + */ +#define ELM_CONFORMANT_EVENT_VIRTUALKEYPAD_STATE_OFF (&(_ELM_CONFORMANT_EVENT_VIRTUALKEYPAD_STATE_OFF)) + +EWAPI extern const Efl_Event_Description _ELM_CONFORMANT_EVENT_CLIPBOARD_STATE_ON; + +/** Called when clipboard was enabled + * + * @ingroup Elm_Conformant + */ +#define ELM_CONFORMANT_EVENT_CLIPBOARD_STATE_ON (&(_ELM_CONFORMANT_EVENT_CLIPBOARD_STATE_ON)) + +EWAPI extern const Efl_Event_Description _ELM_CONFORMANT_EVENT_CLIPBOARD_STATE_OFF; + +/** Called when clipboard was disabled + * + * @ingroup Elm_Conformant + */ +#define ELM_CONFORMANT_EVENT_CLIPBOARD_STATE_OFF (&(_ELM_CONFORMANT_EVENT_CLIPBOARD_STATE_OFF)) + +#endif diff --git a/src/lib/elementary/elm_conformant_eo.legacy.h b/src/lib/elementary/elm_conformant_eo.legacy.h new file mode 100644 index 0000000000..3549b17308 --- /dev/null +++ b/src/lib/elementary/elm_conformant_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_CONFORMANT_EO_LEGACY_H_ +#define _ELM_CONFORMANT_EO_LEGACY_H_ + +#ifndef _ELM_CONFORMANT_EO_CLASS_TYPE +#define _ELM_CONFORMANT_EO_CLASS_TYPE + +typedef Eo Elm_Conformant; + +#endif + +#ifndef _ELM_CONFORMANT_EO_TYPES +#define _ELM_CONFORMANT_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_ctxpopup.eo b/src/lib/elementary/elm_ctxpopup.eo deleted file mode 100644 index 7d94b87fe4..0000000000 --- a/src/lib/elementary/elm_ctxpopup.eo +++ /dev/null @@ -1,249 +0,0 @@ -enum Elm.Ctxpopup.Direction -{ - [[Direction in which to show the popup.]] - down, [[Ctxpopup show appear below clicked area.]] - right, [[Ctxpopup show appear to the right of the clicked area.]] - left, [[Ctxpopup show appear to the left of the clicked area.]] - up, [[Ctxpopup show appear above the clicked area.]] - unknown [[Ctxpopup does not determine it's direction yet.]] -} - -class Elm.Ctxpopup extends Efl.Ui.Layout implements 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); [[const list to widget items]] - } - } - - @property horizontal { - set { - [[Change the ctxpopup's orientation to horizontal or vertical.]] - } - get { - [[Get the value of current ctxpopup object's orientation. - - See also @.horizontal.set. - ]] - } - values { - horizontal: bool; [[$true for horizontal mode, $false for vertical.]] - } - } - @property auto_hide_disabled { - set { - [[Set ctxpopup auto hide mode triggered by ctxpopup policy. - - Use this function when user wants ctxpopup not to hide automatically. - By default, ctxpopup is dismissed whenever mouse clicked its background area, language is changed, - and its parent geometry is updated(changed). - Not to hide ctxpopup automatically, disable auto hide function by calling this API, - then ctxpopup won't be dismissed in those scenarios. - - Default value of disabled is $false. - - See also @.auto_hide_disabled.get. - - @since 1.9 - ]] - } - get { - [[Get ctxpopup auto hide mode triggered by ctxpopup policy. - - See also @.auto_hide_disabled.set for more information. - - @since 1.9 - ]] - } - values { - disabled: bool; [[Auto hide enable/disable.]] - } - } - @property hover_parent { - set { - [[Set the Ctxpopup's parent - - Set the parent object. - - Note: \@ref elm_ctxpopup_add will automatically call this function - with its $parent argument. - - See also \@ref elm_ctxpopup_add, - \@ref elm_hover_parent_set. - ]] - } - get { - [[Get the Ctxpopup's parent - - See also @.hover_parent.set for more information - ]] - } - values { - parent: Efl.Canvas.Object; [[The parent to use.]] - } - } - @property direction_priority { - set { - [[Set the direction priority of a ctxpopup. - - This functions gives a chance to user to set the priority of ctxpopup - showing direction. This doesn't guarantee the ctxpopup will appear in the - requested direction. - - See also @.Direction. - ]] - } - get { - [[Get the direction priority of a ctxpopup. - - See also @.direction_priority.set for more information. - ]] - } - values { - first: Elm.Ctxpopup.Direction; [[1st priority of direction]] - second: Elm.Ctxpopup.Direction; [[2nd priority of direction]] - third: Elm.Ctxpopup.Direction; [[3th priority of direction]] - fourth: Elm.Ctxpopup.Direction; [[4th priority of direction]] - } - } - @property direction { - get { - [[Get the current direction of a ctxpopup. - - Warning: Once the ctxpopup showed up, the direction would be determined - - ]] - return: Elm.Ctxpopup.Direction(Elm.Ctxpopup.Direction.unknown); [[Direction]] - } - } - dismiss { - [[Dismiss a ctxpopup object - - Use this function to simulate clicking outside of the ctxpopup to dismiss it. - In this way, the ctxpopup will be hidden and the "clicked" signal will be - emitted.]] - - } - clear { - [[Clear all items in the given ctxpopup object.]] - } - item_insert_before { - [[Insert a new item to a ctxpopup object before item $before. - - See also elm_object_content_set. - - @since 1.21 - ]] - return: Elm.Widget.Item; [[A handle to the item added or $null, on errors.]] - - params { - @in before: Elm.Widget.Item; [[The ctxpopup item to insert before.]] - @in label: string; [[The Label of the new item]] - @in icon: Efl.Canvas.Object @optional; [[Icon to be set on new item]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called when item selected]] - @in data: const(void_ptr) @optional; [[Data passed to $func]] - } - } - item_insert_after { - [[Insert a new item to a ctxpopup object after item $after. - - See also elm_object_content_set. - - @since 1.21 - ]] - return: Elm.Widget.Item; [[A handle to the item added or $null, on errors.]] - - params { - @in after: Elm.Widget.Item; [[The ctxpopup item to insert after.]] - @in label: string; [[The Label of the new item]] - @in icon: Efl.Canvas.Object @optional; [[Icon to be set on new item]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called when item selected]] - @in data: const(void_ptr) @optional; [[Data passed to $func]] - } - } - item_append { - [[Add a new item to a ctxpopup object. - - Warning:Ctxpopup can't hold both an item list and a content at the same - time. When an item is added, any previous content will be removed. - - See also \@ref elm_object_content_set. - ]] - return: Elm.Widget.Item; [[A handle to the item added or $null, on errors.]] - - params { - @in label: string; [[The Label of the new item]] - @in icon: Efl.Canvas.Object @optional; [[Icon to be set on new item]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called when item selected]] - @in data: const(void_ptr) @optional; [[Data passed to $func]] - } - } - item_prepend { - [[Prepend a new item to a ctxpopup object. - - Warning: Ctxpopup can't hold both an item list and a content at the same - time. When an item is added, any previous content will be removed. - - See also \@ref elm_object_content_set. - - @since 1.11 - ]] - return: Elm.Widget.Item; [[A handle to the item added or $null, on errors.]] - - params { - @in label: string; [[The Label of the new item]] - @in icon: Efl.Canvas.Object @optional; [[Icon to be set on new item]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called when item selected]] - @in data: const(void_ptr) @optional; [[Data passed to $func]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.widget_parent { set; } - Efl.Ui.Widget.on_disabled_update; - Efl.Ui.Widget.widget_sub_object_add; - Efl.Ui.L10n.translation_update; - 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.Object.state_set { get; } - Efl.Part.part_get; - } - events { - 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_eo.c b/src/lib/elementary/elm_ctxpopup_eo.c new file mode 100644 index 0000000000..ebd83c53fb --- /dev/null +++ b/src/lib/elementary/elm_ctxpopup_eo.c @@ -0,0 +1,225 @@ +EWAPI const Efl_Event_Description _ELM_CTXPOPUP_EVENT_DISMISSED = + EFL_EVENT_DESCRIPTION("dismissed"); +EWAPI const Efl_Event_Description _ELM_CTXPOPUP_EVENT_GEOMETRY_UPDATE = + EFL_EVENT_DESCRIPTION("geometry,update"); + +Elm_Widget_Item *_elm_ctxpopup_selected_item_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_selected_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_ctxpopup_first_item_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_first_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_ctxpopup_last_item_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_last_item_get, Elm_Widget_Item *, NULL); + +const Eina_List *_elm_ctxpopup_items_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_items_get, const Eina_List *, NULL); + +void _elm_ctxpopup_horizontal_set(Eo *obj, Elm_Ctxpopup_Data *pd, Eina_Bool horizontal); + + +static Eina_Error +__eolian_elm_ctxpopup_horizontal_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_ctxpopup_horizontal_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_ctxpopup_horizontal_set, EFL_FUNC_CALL(horizontal), Eina_Bool horizontal); + +Eina_Bool _elm_ctxpopup_horizontal_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + + +static Eina_Value +__eolian_elm_ctxpopup_horizontal_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_ctxpopup_horizontal_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_horizontal_get, Eina_Bool, 0); + +void _elm_ctxpopup_auto_hide_disabled_set(Eo *obj, Elm_Ctxpopup_Data *pd, Eina_Bool disabled); + + +static Eina_Error +__eolian_elm_ctxpopup_auto_hide_disabled_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_ctxpopup_auto_hide_disabled_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_ctxpopup_auto_hide_disabled_set, EFL_FUNC_CALL(disabled), Eina_Bool disabled); + +Eina_Bool _elm_ctxpopup_auto_hide_disabled_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + + +static Eina_Value +__eolian_elm_ctxpopup_auto_hide_disabled_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_ctxpopup_auto_hide_disabled_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_auto_hide_disabled_get, Eina_Bool, 0); + +void _elm_ctxpopup_hover_parent_set(Eo *obj, Elm_Ctxpopup_Data *pd, Efl_Canvas_Object *parent); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_ctxpopup_hover_parent_set, EFL_FUNC_CALL(parent), Efl_Canvas_Object *parent); + +Efl_Canvas_Object *_elm_ctxpopup_hover_parent_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_hover_parent_get, Efl_Canvas_Object *, NULL); + +void _elm_ctxpopup_direction_priority_set(Eo *obj, Elm_Ctxpopup_Data *pd, Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_ctxpopup_direction_priority_set, EFL_FUNC_CALL(first, second, third, fourth), Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth); + +void _elm_ctxpopup_direction_priority_get(const Eo *obj, Elm_Ctxpopup_Data *pd, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_ctxpopup_direction_priority_get, EFL_FUNC_CALL(first, second, third, fourth), Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth); + +Elm_Ctxpopup_Direction _elm_ctxpopup_direction_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_direction_get, Elm_Ctxpopup_Direction, 4 /* Elm.Ctxpopup.Direction.unknown */); + +void _elm_ctxpopup_dismiss(Eo *obj, Elm_Ctxpopup_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_ctxpopup_dismiss); + +void _elm_ctxpopup_clear(Eo *obj, Elm_Ctxpopup_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_ctxpopup_clear); + +Elm_Widget_Item *_elm_ctxpopup_item_insert_before(Eo *obj, Elm_Ctxpopup_Data *pd, Elm_Widget_Item *before, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_ctxpopup_item_insert_before, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(before, label, icon, func, data), Elm_Widget_Item *before, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +Elm_Widget_Item *_elm_ctxpopup_item_insert_after(Eo *obj, Elm_Ctxpopup_Data *pd, Elm_Widget_Item *after, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_ctxpopup_item_insert_after, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(after, label, icon, func, data), Elm_Widget_Item *after, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +Elm_Widget_Item *_elm_ctxpopup_item_append(Eo *obj, Elm_Ctxpopup_Data *pd, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_ctxpopup_item_append, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(label, icon, func, data), const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +Elm_Widget_Item *_elm_ctxpopup_item_prepend(Eo *obj, Elm_Ctxpopup_Data *pd, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_ctxpopup_item_prepend, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(label, icon, func, data), const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +Efl_Object *_elm_ctxpopup_efl_object_constructor(Eo *obj, Elm_Ctxpopup_Data *pd); + + +Eina_Bool _elm_ctxpopup_efl_ui_widget_widget_sub_object_add(Eo *obj, Elm_Ctxpopup_Data *pd, Efl_Canvas_Object *sub_obj); + + +void _elm_ctxpopup_efl_ui_l10n_translation_update(Eo *obj, Elm_Ctxpopup_Data *pd); + + +Eina_Error _elm_ctxpopup_efl_ui_widget_theme_apply(Eo *obj, Elm_Ctxpopup_Data *pd); + + +Eina_Bool _elm_ctxpopup_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Ctxpopup_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +Elm_Widget_Item *_elm_ctxpopup_elm_widget_item_container_focused_item_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + + +const Efl_Access_Action_Data *_elm_ctxpopup_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + + +Efl_Access_State_Set _elm_ctxpopup_efl_access_object_state_set_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + + +Efl_Object *_elm_ctxpopup_efl_part_part_get(const Eo *obj, Elm_Ctxpopup_Data *pd, const char *name); + + +static Eina_Bool +_elm_ctxpopup_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_CTXPOPUP_EXTRA_OPS +#define ELM_CTXPOPUP_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_selected_item_get, _elm_ctxpopup_selected_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_first_item_get, _elm_ctxpopup_first_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_last_item_get, _elm_ctxpopup_last_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_items_get, _elm_ctxpopup_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_horizontal_set, _elm_ctxpopup_horizontal_set), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_horizontal_get, _elm_ctxpopup_horizontal_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_auto_hide_disabled_set, _elm_ctxpopup_auto_hide_disabled_set), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_auto_hide_disabled_get, _elm_ctxpopup_auto_hide_disabled_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_hover_parent_set, _elm_ctxpopup_hover_parent_set), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_hover_parent_get, _elm_ctxpopup_hover_parent_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_direction_priority_set, _elm_ctxpopup_direction_priority_set), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_direction_priority_get, _elm_ctxpopup_direction_priority_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_direction_get, _elm_ctxpopup_direction_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_dismiss, _elm_ctxpopup_dismiss), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_clear, _elm_ctxpopup_clear), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_insert_before, _elm_ctxpopup_item_insert_before), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_insert_after, _elm_ctxpopup_item_insert_after), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_append, _elm_ctxpopup_item_append), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_prepend, _elm_ctxpopup_item_prepend), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_ctxpopup_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_add, _elm_ctxpopup_efl_ui_widget_widget_sub_object_add), + EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_ctxpopup_efl_ui_l10n_translation_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_ctxpopup_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_ctxpopup_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(elm_widget_item_container_focused_item_get, _elm_ctxpopup_elm_widget_item_container_focused_item_get), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_ctxpopup_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_ctxpopup_efl_access_object_state_set_get), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_ctxpopup_efl_part_part_get), + ELM_CTXPOPUP_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"horizontal", __eolian_elm_ctxpopup_horizontal_set_reflect, __eolian_elm_ctxpopup_horizontal_get_reflect}, + {"auto_hide_disabled", __eolian_elm_ctxpopup_auto_hide_disabled_set_reflect, __eolian_elm_ctxpopup_auto_hide_disabled_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_ctxpopup_class_desc = { + EO_VERSION, + "Elm.Ctxpopup", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Ctxpopup_Data), + _elm_ctxpopup_class_initializer, + _elm_ctxpopup_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_ctxpopup_class_get, &_elm_ctxpopup_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_LAYER_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); + +#include "elm_ctxpopup_eo.legacy.c" diff --git a/src/lib/elementary/elm_ctxpopup_eo.h b/src/lib/elementary/elm_ctxpopup_eo.h new file mode 100644 index 0000000000..78e8ad0a11 --- /dev/null +++ b/src/lib/elementary/elm_ctxpopup_eo.h @@ -0,0 +1,340 @@ +#ifndef _ELM_CTXPOPUP_EO_H_ +#define _ELM_CTXPOPUP_EO_H_ + +#ifndef _ELM_CTXPOPUP_EO_CLASS_TYPE +#define _ELM_CTXPOPUP_EO_CLASS_TYPE + +typedef Eo Elm_Ctxpopup; + +#endif + +#ifndef _ELM_CTXPOPUP_EO_TYPES +#define _ELM_CTXPOPUP_EO_TYPES + +/** Direction in which to show the popup. + * + * @ingroup Elm_Ctxpopup + */ +typedef enum +{ + ELM_CTXPOPUP_DIRECTION_DOWN = 0, /**< Ctxpopup show appear below clicked area. + */ + ELM_CTXPOPUP_DIRECTION_RIGHT, /**< Ctxpopup show appear to the right of the + * clicked area. */ + ELM_CTXPOPUP_DIRECTION_LEFT, /**< Ctxpopup show appear to the left of the + * clicked area. */ + ELM_CTXPOPUP_DIRECTION_UP, /**< Ctxpopup show appear above the clicked area. + */ + ELM_CTXPOPUP_DIRECTION_UNKNOWN /**< Ctxpopup does not determine it's direction + * yet. */ +} Elm_Ctxpopup_Direction; + + +#endif +/** Elementary context popup class + * + * @ingroup Elm_Ctxpopup + */ +#define ELM_CTXPOPUP_CLASS elm_ctxpopup_class_get() + +EWAPI const Efl_Class *elm_ctxpopup_class_get(void); + +/** + * @brief Get the selected item in the widget. + * + * @param[in] obj The object. + * + * @return The selected item or @c null. + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_selected_item_get(const Eo *obj); + +/** + * @brief Get the first item in the widget. + * + * @param[in] obj The object. + * + * @return The first item or @c null. + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_first_item_get(const Eo *obj); + +/** + * @brief Get the last item in the widget. + * + * @param[in] obj The object. + * + * @return The last item or @c null. + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_last_item_get(const Eo *obj); + +/** + * @brief Returns a list of the widget item. + * + * @param[in] obj The object. + * + * @return const list to widget items + * + * @ingroup Elm_Ctxpopup + */ +EOAPI const Eina_List *elm_obj_ctxpopup_items_get(const Eo *obj); + +/** + * @brief Change the ctxpopup's orientation to horizontal or vertical. + * + * @param[in] obj The object. + * @param[in] horizontal @c true for horizontal mode, @c false for vertical. + * + * @ingroup Elm_Ctxpopup + */ +EOAPI void elm_obj_ctxpopup_horizontal_set(Eo *obj, Eina_Bool horizontal); + +/** + * @brief Get the value of current ctxpopup object's orientation. + * + * See also @ref elm_obj_ctxpopup_horizontal_set. + * + * @param[in] obj The object. + * + * @return @c true for horizontal mode, @c false for vertical. + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Eina_Bool elm_obj_ctxpopup_horizontal_get(const Eo *obj); + +/** + * @brief Set ctxpopup auto hide mode triggered by ctxpopup policy. + * + * Use this function when user wants ctxpopup not to hide automatically. By + * default, ctxpopup is dismissed whenever mouse clicked its background area, + * language is changed, and its parent geometry is updated(changed). Not to + * hide ctxpopup automatically, disable auto hide function by calling this API, + * then ctxpopup won't be dismissed in those scenarios. + * + * Default value of disabled is @c false. + * + * See also @ref elm_obj_ctxpopup_auto_hide_disabled_get. + * + * @param[in] obj The object. + * @param[in] disabled Auto hide enable/disable. + * + * @since 1.9 + * + * @ingroup Elm_Ctxpopup + */ +EOAPI void elm_obj_ctxpopup_auto_hide_disabled_set(Eo *obj, Eina_Bool disabled); + +/** + * @brief Get ctxpopup auto hide mode triggered by ctxpopup policy. + * + * See also @ref elm_obj_ctxpopup_auto_hide_disabled_set for more information. + * + * @param[in] obj The object. + * + * @return Auto hide enable/disable. + * + * @since 1.9 + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Eina_Bool elm_obj_ctxpopup_auto_hide_disabled_get(const Eo *obj); + +/** + * @brief Set the Ctxpopup's parent + * + * Set the parent object. + * + * @note @ref elm_ctxpopup_add will automatically call this function with its + * @c parent argument. + * + * See also @ref elm_ctxpopup_add, @ref elm_hover_parent_set. + * + * @param[in] obj The object. + * @param[in] parent The parent to use. + * + * @ingroup Elm_Ctxpopup + */ +EOAPI void elm_obj_ctxpopup_hover_parent_set(Eo *obj, Efl_Canvas_Object *parent); + +/** + * @brief Get the Ctxpopup's parent + * + * See also @ref elm_obj_ctxpopup_hover_parent_set for more information + * + * @param[in] obj The object. + * + * @return The parent to use. + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Efl_Canvas_Object *elm_obj_ctxpopup_hover_parent_get(const Eo *obj); + +/** + * @brief Set the direction priority of a ctxpopup. + * + * This functions gives a chance to user to set the priority of ctxpopup + * showing direction. This doesn't guarantee the ctxpopup will appear in the + * requested direction. + * + * See also @ref Elm_Ctxpopup_Direction. + * + * @param[in] obj The object. + * @param[in] first 1st priority of direction + * @param[in] second 2nd priority of direction + * @param[in] third 3th priority of direction + * @param[in] fourth 4th priority of direction + * + * @ingroup Elm_Ctxpopup + */ +EOAPI void elm_obj_ctxpopup_direction_priority_set(Eo *obj, Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth); + +/** + * @brief Get the direction priority of a ctxpopup. + * + * See also @ref elm_obj_ctxpopup_direction_priority_set for more information. + * + * @param[in] obj The object. + * @param[out] first 1st priority of direction + * @param[out] second 2nd priority of direction + * @param[out] third 3th priority of direction + * @param[out] fourth 4th priority of direction + * + * @ingroup Elm_Ctxpopup + */ +EOAPI void elm_obj_ctxpopup_direction_priority_get(const Eo *obj, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth); + +/** + * @brief Get the current direction of a ctxpopup. + * + * @warning Once the ctxpopup showed up, the direction would be determined + * + * @param[in] obj The object. + * + * @return Direction + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Elm_Ctxpopup_Direction elm_obj_ctxpopup_direction_get(const Eo *obj); + +/** + * @brief Dismiss a ctxpopup object + * + * Use this function to simulate clicking outside of the ctxpopup to dismiss + * it. In this way, the ctxpopup will be hidden and the "clicked" signal will + * be emitted. + * @param[in] obj The object. + * + * @ingroup Elm_Ctxpopup + */ +EOAPI void elm_obj_ctxpopup_dismiss(Eo *obj); + +/** Clear all items in the given ctxpopup object. + * + * @ingroup Elm_Ctxpopup + */ +EOAPI void elm_obj_ctxpopup_clear(Eo *obj); + +/** + * @brief Insert a new item to a ctxpopup object before item @c before. + * + * See also elm_object_content_set. + * + * @param[in] obj The object. + * @param[in] before The ctxpopup item to insert before. + * @param[in] label The Label of the new item + * @param[in] icon Icon to be set on new item + * @param[in] func Convenience function called when item selected + * @param[in] data Data passed to @c func + * + * @return A handle to the item added or @c null, on errors. + * + * @since 1.21 + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_item_insert_before(Eo *obj, Elm_Widget_Item *before, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +/** + * @brief Insert a new item to a ctxpopup object after item @c after. + * + * See also elm_object_content_set. + * + * @param[in] obj The object. + * @param[in] after The ctxpopup item to insert after. + * @param[in] label The Label of the new item + * @param[in] icon Icon to be set on new item + * @param[in] func Convenience function called when item selected + * @param[in] data Data passed to @c func + * + * @return A handle to the item added or @c null, on errors. + * + * @since 1.21 + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_item_insert_after(Eo *obj, Elm_Widget_Item *after, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +/** + * @brief Add a new item to a ctxpopup object. + * + * Warning:Ctxpopup can't hold both an item list and a content at the same + * time. When an item is added, any previous content will be removed. + * + * See also @ref elm_object_content_set. + * + * @param[in] obj The object. + * @param[in] label The Label of the new item + * @param[in] icon Icon to be set on new item + * @param[in] func Convenience function called when item selected + * @param[in] data Data passed to @c func + * + * @return A handle to the item added or @c null, on errors. + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_item_append(Eo *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +/** + * @brief Prepend a new item to a ctxpopup object. + * + * @warning Ctxpopup can't hold both an item list and a content at the same + * time. When an item is added, any previous content will be removed. + * + * See also @ref elm_object_content_set. + * + * @param[in] obj The object. + * @param[in] label The Label of the new item + * @param[in] icon Icon to be set on new item + * @param[in] func Convenience function called when item selected + * @param[in] data Data passed to @c func + * + * @return A handle to the item added or @c null, on errors. + * + * @since 1.11 + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_item_prepend(Eo *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +EWAPI extern const Efl_Event_Description _ELM_CTXPOPUP_EVENT_DISMISSED; + +/** Called when context popup was dismissed + * + * @ingroup Elm_Ctxpopup + */ +#define ELM_CTXPOPUP_EVENT_DISMISSED (&(_ELM_CTXPOPUP_EVENT_DISMISSED)) + +EWAPI extern const Efl_Event_Description _ELM_CTXPOPUP_EVENT_GEOMETRY_UPDATE; + +/** Called when context popup geometry was updated + * @return const Eina_Rect * + * + * @ingroup Elm_Ctxpopup + */ +#define ELM_CTXPOPUP_EVENT_GEOMETRY_UPDATE (&(_ELM_CTXPOPUP_EVENT_GEOMETRY_UPDATE)) + +#endif diff --git a/src/lib/elementary/elm_ctxpopup_eo.legacy.c b/src/lib/elementary/elm_ctxpopup_eo.legacy.c new file mode 100644 index 0000000000..09d07738e2 --- /dev/null +++ b/src/lib/elementary/elm_ctxpopup_eo.legacy.c @@ -0,0 +1,114 @@ + +EAPI Elm_Widget_Item * +elm_ctxpopup_selected_item_get(const Elm_Ctxpopup *obj) +{ + return elm_obj_ctxpopup_selected_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_ctxpopup_first_item_get(const Elm_Ctxpopup *obj) +{ + return elm_obj_ctxpopup_first_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_ctxpopup_last_item_get(const Elm_Ctxpopup *obj) +{ + return elm_obj_ctxpopup_last_item_get(obj); +} + +EAPI const Eina_List * +elm_ctxpopup_items_get(const Elm_Ctxpopup *obj) +{ + return elm_obj_ctxpopup_items_get(obj); +} + +EAPI void +elm_ctxpopup_horizontal_set(Elm_Ctxpopup *obj, Eina_Bool horizontal) +{ + elm_obj_ctxpopup_horizontal_set(obj, horizontal); +} + +EAPI Eina_Bool +elm_ctxpopup_horizontal_get(const Elm_Ctxpopup *obj) +{ + return elm_obj_ctxpopup_horizontal_get(obj); +} + +EAPI void +elm_ctxpopup_auto_hide_disabled_set(Elm_Ctxpopup *obj, Eina_Bool disabled) +{ + elm_obj_ctxpopup_auto_hide_disabled_set(obj, disabled); +} + +EAPI Eina_Bool +elm_ctxpopup_auto_hide_disabled_get(const Elm_Ctxpopup *obj) +{ + return elm_obj_ctxpopup_auto_hide_disabled_get(obj); +} + +EAPI void +elm_ctxpopup_hover_parent_set(Elm_Ctxpopup *obj, Efl_Canvas_Object *parent) +{ + elm_obj_ctxpopup_hover_parent_set(obj, parent); +} + +EAPI Efl_Canvas_Object * +elm_ctxpopup_hover_parent_get(const Elm_Ctxpopup *obj) +{ + return elm_obj_ctxpopup_hover_parent_get(obj); +} + +EAPI void +elm_ctxpopup_direction_priority_set(Elm_Ctxpopup *obj, Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth) +{ + elm_obj_ctxpopup_direction_priority_set(obj, first, second, third, fourth); +} + +EAPI void +elm_ctxpopup_direction_priority_get(const Elm_Ctxpopup *obj, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth) +{ + elm_obj_ctxpopup_direction_priority_get(obj, first, second, third, fourth); +} + +EAPI Elm_Ctxpopup_Direction +elm_ctxpopup_direction_get(const Elm_Ctxpopup *obj) +{ + return elm_obj_ctxpopup_direction_get(obj); +} + +EAPI void +elm_ctxpopup_dismiss(Elm_Ctxpopup *obj) +{ + elm_obj_ctxpopup_dismiss(obj); +} + +EAPI void +elm_ctxpopup_clear(Elm_Ctxpopup *obj) +{ + elm_obj_ctxpopup_clear(obj); +} + +EAPI Elm_Widget_Item * +elm_ctxpopup_item_insert_before(Elm_Ctxpopup *obj, Elm_Widget_Item *before, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_ctxpopup_item_insert_before(obj, before, label, icon, func, data); +} + +EAPI Elm_Widget_Item * +elm_ctxpopup_item_insert_after(Elm_Ctxpopup *obj, Elm_Widget_Item *after, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_ctxpopup_item_insert_after(obj, after, label, icon, func, data); +} + +EAPI Elm_Widget_Item * +elm_ctxpopup_item_append(Elm_Ctxpopup *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_ctxpopup_item_append(obj, label, icon, func, data); +} + +EAPI Elm_Widget_Item * +elm_ctxpopup_item_prepend(Elm_Ctxpopup *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_ctxpopup_item_prepend(obj, label, icon, func, data); +} diff --git a/src/lib/elementary/elm_ctxpopup_eo.legacy.h b/src/lib/elementary/elm_ctxpopup_eo.legacy.h new file mode 100644 index 0000000000..74422ac22e --- /dev/null +++ b/src/lib/elementary/elm_ctxpopup_eo.legacy.h @@ -0,0 +1,316 @@ +#ifndef _ELM_CTXPOPUP_EO_LEGACY_H_ +#define _ELM_CTXPOPUP_EO_LEGACY_H_ + +#ifndef _ELM_CTXPOPUP_EO_CLASS_TYPE +#define _ELM_CTXPOPUP_EO_CLASS_TYPE + +typedef Eo Elm_Ctxpopup; + +#endif + +#ifndef _ELM_CTXPOPUP_EO_TYPES +#define _ELM_CTXPOPUP_EO_TYPES + +/** Direction in which to show the popup. + * + * @ingroup Elm_Ctxpopup + */ +typedef enum +{ + ELM_CTXPOPUP_DIRECTION_DOWN = 0, /**< Ctxpopup show appear below clicked area. + */ + ELM_CTXPOPUP_DIRECTION_RIGHT, /**< Ctxpopup show appear to the right of the + * clicked area. */ + ELM_CTXPOPUP_DIRECTION_LEFT, /**< Ctxpopup show appear to the left of the + * clicked area. */ + ELM_CTXPOPUP_DIRECTION_UP, /**< Ctxpopup show appear above the clicked area. + */ + ELM_CTXPOPUP_DIRECTION_UNKNOWN /**< Ctxpopup does not determine it's direction + * yet. */ +} Elm_Ctxpopup_Direction; + + +#endif + +/** + * @brief Get the selected item in the widget. + * + * @param[in] obj The object. + * + * @return The selected item or @c null. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_selected_item_get(const Elm_Ctxpopup *obj); + +/** + * @brief Get the first item in the widget. + * + * @param[in] obj The object. + * + * @return The first item or @c null. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_first_item_get(const Elm_Ctxpopup *obj); + +/** + * @brief Get the last item in the widget. + * + * @param[in] obj The object. + * + * @return The last item or @c null. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_last_item_get(const Elm_Ctxpopup *obj); + +/** + * @brief Returns a list of the widget item. + * + * @param[in] obj The object. + * + * @return const list to widget items + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI const Eina_List *elm_ctxpopup_items_get(const Elm_Ctxpopup *obj); + +/** + * @brief Change the ctxpopup's orientation to horizontal or vertical. + * + * @param[in] obj The object. + * @param[in] horizontal @c true for horizontal mode, @c false for vertical. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI void elm_ctxpopup_horizontal_set(Elm_Ctxpopup *obj, Eina_Bool horizontal); + +/** + * @brief Get the value of current ctxpopup object's orientation. + * + * See also @ref elm_ctxpopup_horizontal_set. + * + * @param[in] obj The object. + * + * @return @c true for horizontal mode, @c false for vertical. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Eina_Bool elm_ctxpopup_horizontal_get(const Elm_Ctxpopup *obj); + +/** + * @brief Set ctxpopup auto hide mode triggered by ctxpopup policy. + * + * Use this function when user wants ctxpopup not to hide automatically. By + * default, ctxpopup is dismissed whenever mouse clicked its background area, + * language is changed, and its parent geometry is updated(changed). Not to + * hide ctxpopup automatically, disable auto hide function by calling this API, + * then ctxpopup won't be dismissed in those scenarios. + * + * Default value of disabled is @c false. + * + * See also @ref elm_ctxpopup_auto_hide_disabled_get. + * + * @param[in] obj The object. + * @param[in] disabled Auto hide enable/disable. + * + * @since 1.9 + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI void elm_ctxpopup_auto_hide_disabled_set(Elm_Ctxpopup *obj, Eina_Bool disabled); + +/** + * @brief Get ctxpopup auto hide mode triggered by ctxpopup policy. + * + * See also @ref elm_ctxpopup_auto_hide_disabled_set for more information. + * + * @param[in] obj The object. + * + * @return Auto hide enable/disable. + * + * @since 1.9 + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Eina_Bool elm_ctxpopup_auto_hide_disabled_get(const Elm_Ctxpopup *obj); + +/** + * @brief Set the Ctxpopup's parent + * + * Set the parent object. + * + * @note @ref elm_ctxpopup_add will automatically call this function with its + * @c parent argument. + * + * See also @ref elm_ctxpopup_add, @ref elm_hover_parent_set. + * + * @param[in] obj The object. + * @param[in] parent The parent to use. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI void elm_ctxpopup_hover_parent_set(Elm_Ctxpopup *obj, Efl_Canvas_Object *parent); + +/** + * @brief Get the Ctxpopup's parent + * + * See also @ref elm_ctxpopup_hover_parent_set for more information + * + * @param[in] obj The object. + * + * @return The parent to use. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Efl_Canvas_Object *elm_ctxpopup_hover_parent_get(const Elm_Ctxpopup *obj); + +/** + * @brief Set the direction priority of a ctxpopup. + * + * This functions gives a chance to user to set the priority of ctxpopup + * showing direction. This doesn't guarantee the ctxpopup will appear in the + * requested direction. + * + * See also @ref Elm_Ctxpopup_Direction. + * + * @param[in] obj The object. + * @param[in] first 1st priority of direction + * @param[in] second 2nd priority of direction + * @param[in] third 3th priority of direction + * @param[in] fourth 4th priority of direction + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI void elm_ctxpopup_direction_priority_set(Elm_Ctxpopup *obj, Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth); + +/** + * @brief Get the direction priority of a ctxpopup. + * + * See also @ref elm_ctxpopup_direction_priority_set for more information. + * + * @param[in] obj The object. + * @param[out] first 1st priority of direction + * @param[out] second 2nd priority of direction + * @param[out] third 3th priority of direction + * @param[out] fourth 4th priority of direction + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI void elm_ctxpopup_direction_priority_get(const Elm_Ctxpopup *obj, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth); + +/** + * @brief Get the current direction of a ctxpopup. + * + * @warning Once the ctxpopup showed up, the direction would be determined + * + * @param[in] obj The object. + * + * @return Direction + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Elm_Ctxpopup_Direction elm_ctxpopup_direction_get(const Elm_Ctxpopup *obj); + +/** + * @brief Dismiss a ctxpopup object + * + * Use this function to simulate clicking outside of the ctxpopup to dismiss + * it. In this way, the ctxpopup will be hidden and the "clicked" signal will + * be emitted. + * @param[in] obj The object. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI void elm_ctxpopup_dismiss(Elm_Ctxpopup *obj); + +/** Clear all items in the given ctxpopup object. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI void elm_ctxpopup_clear(Elm_Ctxpopup *obj); + +/** + * @brief Insert a new item to a ctxpopup object before item @c before. + * + * See also elm_object_content_set. + * + * @param[in] obj The object. + * @param[in] before The ctxpopup item to insert before. + * @param[in] label The Label of the new item + * @param[in] icon Icon to be set on new item + * @param[in] func Convenience function called when item selected + * @param[in] data Data passed to @c func + * + * @return A handle to the item added or @c null, on errors. + * + * @since 1.21 + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_item_insert_before(Elm_Ctxpopup *obj, Elm_Widget_Item *before, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +/** + * @brief Insert a new item to a ctxpopup object after item @c after. + * + * See also elm_object_content_set. + * + * @param[in] obj The object. + * @param[in] after The ctxpopup item to insert after. + * @param[in] label The Label of the new item + * @param[in] icon Icon to be set on new item + * @param[in] func Convenience function called when item selected + * @param[in] data Data passed to @c func + * + * @return A handle to the item added or @c null, on errors. + * + * @since 1.21 + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_item_insert_after(Elm_Ctxpopup *obj, Elm_Widget_Item *after, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +/** + * @brief Add a new item to a ctxpopup object. + * + * Warning:Ctxpopup can't hold both an item list and a content at the same + * time. When an item is added, any previous content will be removed. + * + * See also @ref elm_object_content_set. + * + * @param[in] obj The object. + * @param[in] label The Label of the new item + * @param[in] icon Icon to be set on new item + * @param[in] func Convenience function called when item selected + * @param[in] data Data passed to @c func + * + * @return A handle to the item added or @c null, on errors. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_item_append(Elm_Ctxpopup *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +/** + * @brief Prepend a new item to a ctxpopup object. + * + * @warning Ctxpopup can't hold both an item list and a content at the same + * time. When an item is added, any previous content will be removed. + * + * See also @ref elm_object_content_set. + * + * @param[in] obj The object. + * @param[in] label The Label of the new item + * @param[in] icon Icon to be set on new item + * @param[in] func Convenience function called when item selected + * @param[in] data Data passed to @c func + * + * @return A handle to the item added or @c null, on errors. + * + * @since 1.11 + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_item_prepend(Elm_Ctxpopup *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +#endif diff --git a/src/lib/elementary/elm_ctxpopup_item.eo b/src/lib/elementary/elm_ctxpopup_item.eo deleted file mode 100644 index c0be337d23..0000000000 --- a/src/lib/elementary/elm_ctxpopup_item.eo +++ /dev/null @@ -1,76 +0,0 @@ -class Elm.Ctxpopup.Item extends Elm.Widget.Item implements 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]] - params { - func: Evas_Smart_Cb @nullable; [[Smart callback function]] - data: const(void_ptr) @optional; [[Data pointer]] - } - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Elm.Widget.Item.disable; - Elm.Widget.Item.signal_emit; - Elm.Widget.Item.del_pre; - Elm.Widget.Item.part_text { get; set; } - Elm.Widget.Item.part_content { get; set; } - Elm.Widget.Item.part_content_unset; - Elm.Widget.Item.item_focus { get; set; } - Efl.Access.Widget.Action.elm_actions { get; } - } -} diff --git a/src/lib/elementary/elm_ctxpopup_item_eo.c b/src/lib/elementary/elm_ctxpopup_item_eo.c new file mode 100644 index 0000000000..837c69bbf6 --- /dev/null +++ b/src/lib/elementary/elm_ctxpopup_item_eo.c @@ -0,0 +1,142 @@ + +Elm_Widget_Item *_elm_ctxpopup_item_prev_get(const Eo *obj, Elm_Ctxpopup_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_item_prev_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_ctxpopup_item_next_get(const Eo *obj, Elm_Ctxpopup_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_item_next_get, Elm_Widget_Item *, NULL); + +void _elm_ctxpopup_item_selected_set(Eo *obj, Elm_Ctxpopup_Item_Data *pd, Eina_Bool selected); + + +static Eina_Error +__eolian_elm_ctxpopup_item_selected_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_ctxpopup_item_selected_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_ctxpopup_item_selected_set, EFL_FUNC_CALL(selected), Eina_Bool selected); + +Eina_Bool _elm_ctxpopup_item_selected_get(const Eo *obj, Elm_Ctxpopup_Item_Data *pd); + + +static Eina_Value +__eolian_elm_ctxpopup_item_selected_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_ctxpopup_item_selected_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_item_selected_get, Eina_Bool, 0); + +void _elm_ctxpopup_item_init(Eo *obj, Elm_Ctxpopup_Item_Data *pd, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_ctxpopup_item_init, EFL_FUNC_CALL(func, data), Evas_Smart_Cb func, const void *data); + +Efl_Object *_elm_ctxpopup_item_efl_object_constructor(Eo *obj, Elm_Ctxpopup_Item_Data *pd); + + +void _elm_ctxpopup_item_efl_object_destructor(Eo *obj, Elm_Ctxpopup_Item_Data *pd); + + +void _elm_ctxpopup_item_elm_widget_item_disable(Eo *obj, Elm_Ctxpopup_Item_Data *pd); + + +void _elm_ctxpopup_item_elm_widget_item_signal_emit(Eo *obj, Elm_Ctxpopup_Item_Data *pd, const char *emission, const char *source); + + +void _elm_ctxpopup_item_elm_widget_item_del_pre(Eo *obj, Elm_Ctxpopup_Item_Data *pd); + + +void _elm_ctxpopup_item_elm_widget_item_part_text_set(Eo *obj, Elm_Ctxpopup_Item_Data *pd, const char *part, const char *label); + + +const char *_elm_ctxpopup_item_elm_widget_item_part_text_get(const Eo *obj, Elm_Ctxpopup_Item_Data *pd, const char *part); + + +void _elm_ctxpopup_item_elm_widget_item_part_content_set(Eo *obj, Elm_Ctxpopup_Item_Data *pd, const char *part, Efl_Canvas_Object *content); + + +Efl_Canvas_Object *_elm_ctxpopup_item_elm_widget_item_part_content_get(const Eo *obj, Elm_Ctxpopup_Item_Data *pd, const char *part); + + +Efl_Canvas_Object *_elm_ctxpopup_item_elm_widget_item_part_content_unset(Eo *obj, Elm_Ctxpopup_Item_Data *pd, const char *part); + + +void _elm_ctxpopup_item_elm_widget_item_item_focus_set(Eo *obj, Elm_Ctxpopup_Item_Data *pd, Eina_Bool focused); + + +Eina_Bool _elm_ctxpopup_item_elm_widget_item_item_focus_get(const Eo *obj, Elm_Ctxpopup_Item_Data *pd); + + +const Efl_Access_Action_Data *_elm_ctxpopup_item_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Ctxpopup_Item_Data *pd); + + +static Eina_Bool +_elm_ctxpopup_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_CTXPOPUP_ITEM_EXTRA_OPS +#define ELM_CTXPOPUP_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_prev_get, _elm_ctxpopup_item_prev_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_next_get, _elm_ctxpopup_item_next_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_selected_set, _elm_ctxpopup_item_selected_set), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_selected_get, _elm_ctxpopup_item_selected_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_init, _elm_ctxpopup_item_init), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_ctxpopup_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_ctxpopup_item_efl_object_destructor), + EFL_OBJECT_OP_FUNC(elm_wdg_item_disable, _elm_ctxpopup_item_elm_widget_item_disable), + EFL_OBJECT_OP_FUNC(elm_wdg_item_signal_emit, _elm_ctxpopup_item_elm_widget_item_signal_emit), + EFL_OBJECT_OP_FUNC(elm_wdg_item_del_pre, _elm_ctxpopup_item_elm_widget_item_del_pre), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_set, _elm_ctxpopup_item_elm_widget_item_part_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_get, _elm_ctxpopup_item_elm_widget_item_part_text_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_set, _elm_ctxpopup_item_elm_widget_item_part_content_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_get, _elm_ctxpopup_item_elm_widget_item_part_content_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_unset, _elm_ctxpopup_item_elm_widget_item_part_content_unset), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_set, _elm_ctxpopup_item_elm_widget_item_item_focus_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_get, _elm_ctxpopup_item_elm_widget_item_item_focus_get), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_ctxpopup_item_efl_access_widget_action_elm_actions_get), + ELM_CTXPOPUP_ITEM_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"selected", __eolian_elm_ctxpopup_item_selected_set_reflect, __eolian_elm_ctxpopup_item_selected_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_ctxpopup_item_class_desc = { + EO_VERSION, + "Elm.Ctxpopup.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Ctxpopup_Item_Data), + _elm_ctxpopup_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_ctxpopup_item_class_get, &_elm_ctxpopup_item_class_desc, ELM_WIDGET_ITEM_CLASS, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_ctxpopup_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_ctxpopup_item_eo.h b/src/lib/elementary/elm_ctxpopup_item_eo.h new file mode 100644 index 0000000000..1e8d30d650 --- /dev/null +++ b/src/lib/elementary/elm_ctxpopup_item_eo.h @@ -0,0 +1,97 @@ +#ifndef _ELM_CTXPOPUP_ITEM_EO_H_ +#define _ELM_CTXPOPUP_ITEM_EO_H_ + +#ifndef _ELM_CTXPOPUP_ITEM_EO_CLASS_TYPE +#define _ELM_CTXPOPUP_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Ctxpopup_Item; + +#endif + +#ifndef _ELM_CTXPOPUP_ITEM_EO_TYPES +#define _ELM_CTXPOPUP_ITEM_EO_TYPES + + +#endif +/** Elementary context popup item class + * + * @ingroup Elm_Ctxpopup_Item + */ +#define ELM_CTXPOPUP_ITEM_CLASS elm_ctxpopup_item_class_get() + +EWAPI const Efl_Class *elm_ctxpopup_item_class_get(void); + +/** + * @brief Get the item before this one in the widget's list of items. + * + * See also @ref elm_obj_ctxpopup_item_next_get. + * + * @param[in] obj The object. + * + * @return The item before the object in its parent's list. If there is no + * previous item or in case of error, @c null is returned. + * + * @ingroup Elm_Ctxpopup_Item + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_item_prev_get(const Eo *obj); + +/** + * @brief Get the item after this one in the widget's list of items. + * + * See also @ref elm_obj_ctxpopup_item_prev_get. + * + * @param[in] obj The object. + * + * @return The item after the object in its parent's list. If there is no next + * item or in case of error, @c null is returned. + * + * @ingroup Elm_Ctxpopup_Item + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_item_next_get(const Eo *obj); + +/** + * @brief Indicates whether this item is currently selected. + * + * Set the selected state of @c 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 retrieved with + * @ref elm_obj_ctxpopup_selected_item_get. + * + * Selected items will be highlighted. + * + * @param[in] obj The object. + * @param[in] selected The selection state. + * + * @ingroup Elm_Ctxpopup_Item + */ +EOAPI void elm_obj_ctxpopup_item_selected_set(Eo *obj, Eina_Bool selected); + +/** + * @brief Indicates whether this item is currently selected. + * + * Get the selected state of this item. + * + * @param[in] obj The object. + * + * @return The selection state. + * + * @ingroup Elm_Ctxpopup_Item + */ +EOAPI Eina_Bool elm_obj_ctxpopup_item_selected_get(const Eo *obj); + +/** + * @brief Init context popup item + * + * @param[in] obj The object. + * @param[in] func Smart callback function + * @param[in] data Data pointer + * + * @ingroup Elm_Ctxpopup_Item + */ +EOAPI void elm_obj_ctxpopup_item_init(Eo *obj, Evas_Smart_Cb func, const void *data); + +#endif diff --git a/src/lib/elementary/elm_ctxpopup_item_eo.legacy.c b/src/lib/elementary/elm_ctxpopup_item_eo.legacy.c new file mode 100644 index 0000000000..a4b13aa3b7 --- /dev/null +++ b/src/lib/elementary/elm_ctxpopup_item_eo.legacy.c @@ -0,0 +1,30 @@ + +EAPI Elm_Widget_Item * +elm_ctxpopup_item_prev_get(const Elm_Ctxpopup_Item *obj) +{ + return elm_obj_ctxpopup_item_prev_get(obj); +} + +EAPI Elm_Widget_Item * +elm_ctxpopup_item_next_get(const Elm_Ctxpopup_Item *obj) +{ + return elm_obj_ctxpopup_item_next_get(obj); +} + +EAPI void +elm_ctxpopup_item_selected_set(Elm_Ctxpopup_Item *obj, Eina_Bool selected) +{ + elm_obj_ctxpopup_item_selected_set(obj, selected); +} + +EAPI Eina_Bool +elm_ctxpopup_item_selected_get(const Elm_Ctxpopup_Item *obj) +{ + return elm_obj_ctxpopup_item_selected_get(obj); +} + +EAPI void +elm_ctxpopup_item_init(Elm_Ctxpopup_Item *obj, Evas_Smart_Cb func, const void *data) +{ + elm_obj_ctxpopup_item_init(obj, func, data); +} diff --git a/src/lib/elementary/elm_ctxpopup_item_eo.legacy.h b/src/lib/elementary/elm_ctxpopup_item_eo.legacy.h new file mode 100644 index 0000000000..76bf43c702 --- /dev/null +++ b/src/lib/elementary/elm_ctxpopup_item_eo.legacy.h @@ -0,0 +1,90 @@ +#ifndef _ELM_CTXPOPUP_ITEM_EO_LEGACY_H_ +#define _ELM_CTXPOPUP_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_CTXPOPUP_ITEM_EO_CLASS_TYPE +#define _ELM_CTXPOPUP_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Ctxpopup_Item; + +#endif + +#ifndef _ELM_CTXPOPUP_ITEM_EO_TYPES +#define _ELM_CTXPOPUP_ITEM_EO_TYPES + + +#endif + +/** + * @brief Get the item before this one in the widget's list of items. + * + * See also @ref elm_ctxpopup_item_next_get. + * + * @param[in] obj The object. + * + * @return The item before the object in its parent's list. If there is no + * previous item or in case of error, @c null is returned. + * + * @ingroup Elm_Ctxpopup_Item_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_item_prev_get(const Elm_Ctxpopup_Item *obj); + +/** + * @brief Get the item after this one in the widget's list of items. + * + * See also @ref elm_ctxpopup_item_prev_get. + * + * @param[in] obj The object. + * + * @return The item after the object in its parent's list. If there is no next + * item or in case of error, @c null is returned. + * + * @ingroup Elm_Ctxpopup_Item_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_item_next_get(const Elm_Ctxpopup_Item *obj); + +/** + * @brief Indicates whether this item is currently selected. + * + * Set the selected state of @c 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 retrieved with + * @ref elm_ctxpopup_selected_item_get. + * + * Selected items will be highlighted. + * + * @param[in] obj The object. + * @param[in] selected The selection state. + * + * @ingroup Elm_Ctxpopup_Item_Group + */ +EAPI void elm_ctxpopup_item_selected_set(Elm_Ctxpopup_Item *obj, Eina_Bool selected); + +/** + * @brief Indicates whether this item is currently selected. + * + * Get the selected state of this item. + * + * @param[in] obj The object. + * + * @return The selection state. + * + * @ingroup Elm_Ctxpopup_Item_Group + */ +EAPI Eina_Bool elm_ctxpopup_item_selected_get(const Elm_Ctxpopup_Item *obj); + +/** + * @brief Init context popup item + * + * @param[in] obj The object. + * @param[in] func Smart callback function + * @param[in] data Data pointer + * + * @ingroup Elm_Ctxpopup_Item_Group + */ +EAPI void elm_ctxpopup_item_init(Elm_Ctxpopup_Item *obj, Evas_Smart_Cb func, const void *data); + +#endif diff --git a/src/lib/elementary/elm_ctxpopup_part.eo b/src/lib/elementary/elm_ctxpopup_part.eo index 35c39a4c92..a78a18adce 100644 --- a/src/lib/elementary/elm_ctxpopup_part.eo +++ b/src/lib/elementary/elm_ctxpopup_part.eo @@ -1,4 +1,4 @@ -class Elm.Ctxpopup.Part extends Efl.Ui.Layout_Part_Legacy +class @beta Elm.Ctxpopup.Part extends Efl.Ui.Layout_Part_Legacy { [[Elementary contex popup internal part class]] data: null; diff --git a/src/lib/elementary/elm_cursor.h b/src/lib/elementary/elm_cursor.h index a3e983a1de..21cd1afc59 100644 --- a/src/lib/elementary/elm_cursor.h +++ b/src/lib/elementary/elm_cursor.h @@ -3,12 +3,123 @@ * @ingroup Elementary */ -#ifdef EFL_EO_API_SUPPORT -#include "efl_ui_cursor.eo.h" -#endif - #ifndef EFL_NOLEGACY_API_SUPPORT -#include "efl_ui_cursor.eo.legacy.h" + + +/** + * @brief The cursor to be shown when mouse is over the object + * + * This is the cursor that will be displayed when mouse is over the object. The + * object can have only one cursor set to it so if @ref elm_object_cursor_set + * is called twice for an object, the previous set will be unset. + * + * If using X cursors, a definition of all the valid cursor names is listed on + * Elementary_Cursors.h. If an invalid name is set the default cursor will be + * used. + * + * Sets or unsets the current cursor. + * + * If @c cursor is @c null this function will reset the cursor to the default + * one. + * + * @param[in] obj The object. + * @param[in] cursor The cursor name, defined either by the display system or + * the theme. + * + * @return @c true if successful. + * + * @ingroup Elm_Cursors + */ +EAPI Eina_Bool elm_object_cursor_set(Eo *obj, const char *cursor); + +/** + * @brief The cursor to be shown when mouse is over the object + * + * This is the cursor that will be displayed when mouse is over the object. The + * object can have only one cursor set to it so if @ref elm_object_cursor_set + * is called twice for an object, the previous set will be unset. + * + * If using X cursors, a definition of all the valid cursor names is listed on + * Elementary_Cursors.h. If an invalid name is set the default cursor will be + * used. + * + * Returns the current cursor name. + * + * @param[in] obj The object. + * + * @return The cursor name, defined either by the display system or the theme. + * + * @ingroup Elm_Cursors + */ +EAPI const char *elm_object_cursor_get(const Eo *obj); + +/** + * @brief A different style for the cursor. + * + * This only makes sense if theme cursors are used. The cursor should be set + * with @ref elm_object_cursor_set first before setting its style with this + * property. + * + * Sets a style for the current cursor. Call after @ref elm_object_cursor_set. + * + * @param[in] obj The object. + * @param[in] style A specific style to use, eg. default, transparent, .... + * + * @return @c true if successful. + * + * @ingroup Elm_Cursors + */ +EAPI Eina_Bool elm_object_cursor_style_set(Eo *obj, const char *style); + +/** + * @brief A different style for the cursor. + * + * This only makes sense if theme cursors are used. The cursor should be set + * with @ref elm_object_cursor_set first before setting its style with this + * property. + * + * Returns the current cursor style name. + * + * @param[in] obj The object. + * + * @return A specific style to use, eg. default, transparent, .... + * + * @ingroup Elm_Cursors + */ +EAPI const char *elm_object_cursor_style_get(const Eo *obj); + +/** + * @brief Whether the cursor may be looked in the theme or not. + * + * If @c false, the cursor may only come from the render engine, i.e. from the + * display manager. + * + * Enables or disables theme cursors. + * + * @param[in] obj The object. + * @param[in] allow Whether to use theme cursors. + * + * @return @c true if successful. + * + * @ingroup Elm_Cursors + */ +EAPI Eina_Bool elm_object_cursor_theme_search_enabled_set(Eo *obj, Eina_Bool allow); + +/** + * @brief Whether the cursor may be looked in the theme or not. + * + * If @c false, the cursor may only come from the render engine, i.e. from the + * display manager. + * + * Returns the current state of theme cursors search. + * + * @param[in] obj The object. + * + * @return Whether to use theme cursors. + * + * @ingroup Elm_Cursors + */ +EAPI Eina_Bool elm_object_cursor_theme_search_enabled_get(const Eo *obj); /** * Unset cursor for object diff --git a/src/lib/elementary/elm_dayselector.c b/src/lib/elementary/elm_dayselector.c index eb051c0c52..781ee0c868 100644 --- a/src/lib/elementary/elm_dayselector.c +++ b/src/lib/elementary/elm_dayselector.c @@ -123,17 +123,17 @@ _item_location_get(Elm_Dayselector_Data *sd, ELM_DAYSELECTOR_MAX; } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_dayselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Dayselector_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; Eina_List *l; char buf[1024]; Elm_Dayselector_Item_Data *it; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; EINA_LIST_FOREACH(sd->items, l, it) { @@ -445,7 +445,6 @@ EOLIAN static void _elm_dayselector_efl_canvas_group_group_add(Eo *obj, Elm_Dayselector_Data *priv) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set(obj, "dayselector", "base", elm_widget_style_get(obj))) @@ -653,6 +652,6 @@ ELM_PART_OVERRIDE_CONTENT_UNSET(elm_dayselector, ELM_DAYSELECTOR, Elm_Dayselecto ELM_LAYOUT_SIZING_EVAL_OPS(elm_dayselector), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_dayselector) -#include "elm_dayselector.eo.c" -#include "elm_dayselector_item.eo.c" +#include "elm_dayselector_eo.c" +#include "elm_dayselector_item_eo.c" diff --git a/src/lib/elementary/elm_dayselector.eo b/src/lib/elementary/elm_dayselector.eo deleted file mode 100644 index 183e582447..0000000000 --- a/src/lib/elementary/elm_dayselector.eo +++ /dev/null @@ -1,163 +0,0 @@ -enum Elm.Dayselector.Day -{ - [[Identifies the day of the week. API can call the selection/unselection - of day with this as a parameter. - - See also @Elm.Dayselector.day_selected_set, @Elm.Dayselector.day_selected_get. - ]] - - legacy: elm_dayselector; - sun = 0,[[Indicates Sunday.]] - mon, [[Indicates Monday.]] - tue, [[Indicates Tuesday.]] - wed, [[Indicates Wednesday.]] - thu, [[Indicates Thursday.]] - fri, [[Indicates Friday.]] - sat, [[Indicates Saturday.]] - max [[Sentinel value to indicate last enum field during iteration]] -} - -class Elm.Dayselector extends Efl.Ui.Layout implements Efl.Ui.Legacy -{ - [[Elementary dayselector class]] - legacy_prefix: elm_dayselector; - eo_prefix: elm_obj_dayselector; - event_prefix: elm_dayselector; - methods { - @property week_start { - set { - [[Set the starting day of Dayselector. - - See also @Elm.Dayselector.Day, - @.week_start.get. - ]] - } - get { - [[Get the starting day of Dayselector. - - See also @Elm.Dayselector.Day, - @.week_start.set. - ]] - } - values { - day: Elm.Dayselector.Day; [[Dayselector_Day the first day that the user wants to display.]] - } - } - @property weekend_length { - set { - [[Set the weekend length of Dayselector. - - See also @.weekend_length.get. - ]] - } - get { - [[Get the weekend length of Dayselector. - - See also @Elm.Dayselector.Day, - @.weekend_length.set. - ]] - } - values { - length: uint; [[Weekend length, number of days as an integer.]] - } - } - @property weekend_start { - set { - [[Set the weekend starting day of Dayselector. - - See also @Elm.Dayselector.Day, - @.weekend_start.get. - ]] - } - get { - [[Get the weekend starting day of Dayselector. - - See also @Elm.Dayselector.Day, - @.weekend_start.set. - ]] - } - values { - day: Elm.Dayselector.Day; [[Dayselector_Day the first day from where weekend starts.]] - } - } - weekdays_names_set { - [[Set weekdays names to be displayed by the Dayselector. - - By default or if weekdays is $null, weekdays abbreviations get from system are displayed: - E.g. for an en_US locale: "Sun, Mon, Tue, Wed, Thu, Fri, Sat" - - The first string should be related to Sunday, the second to Monday... - - See also @.weekdays_names_get, - @.weekend_start.set. - - @since 1.8 - ]] - /* FIXME-doc - * - * The usage should be like this: - * @code - * const char *weekdays[] = - * { - * "Sunday", "Monday", "Tuesday", "Wednesday", - * "Thursday", "Friday", "Saturday" - * }; - * elm_dayselector_wekdays_names_set(calendar, weekdays); - * @endcode - */ - - params { - @in weekdays: legacy(ptr(string)) @nullable; [[Array of seven strings to be used as weekday names. - Warning: It must have 7 elements, or it will access invalid memory. - Warning: The strings must be NULL terminated ('@\0').]] - } - } - weekdays_names_get @const { - [[Get weekdays names displayed by the calendar. - - By default, weekdays abbreviations get from system are displayed: - E.g. for an en_US locale: "Sun, Mon, Tue, Wed, Thu, Fri, Sat" - The first string is related to Sunday, the second to Monday... - - See also @.weekdays_names_set. - - @since 1.8 - ]] - return: list @owned @warn_unused; [[A list of seven strings to be used as weekday names.]] - } - day_selected_set { - [[Set the state of given Dayselector_Day. - - See also @Elm.Dayselector.Day, - @.day_selected_get. - ]] - params { - @in day: Elm.Dayselector.Day; [[Dayselector_Day that the user want to set state.]] - @in selected: bool; [[State of the day. $true is selected.]] - } - } - day_selected_get @const { - [[Get the state of given Dayselector_Day. - - See also @Elm.Dayselector.Day, - @.day_selected_set. - ]] - return: bool; [[$true on success, $false on failure]] - params { - @in day: Elm.Dayselector.Day; [[Dayselector_Day that the user want to know state.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.theme_apply; - Efl.Ui.L10n.translation_update; - Efl.Part.part_get; - } - events { - /* FIXME: Nobody emits this - dayselector,changed; [[Called when dayselector widget changed]] - */ - } -} diff --git a/src/lib/elementary/elm_dayselector_eo.c b/src/lib/elementary/elm_dayselector_eo.c new file mode 100644 index 0000000000..83b478502f --- /dev/null +++ b/src/lib/elementary/elm_dayselector_eo.c @@ -0,0 +1,131 @@ + +void _elm_dayselector_week_start_set(Eo *obj, Elm_Dayselector_Data *pd, Elm_Dayselector_Day day); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_dayselector_week_start_set, EFL_FUNC_CALL(day), Elm_Dayselector_Day day); + +Elm_Dayselector_Day _elm_dayselector_week_start_get(const Eo *obj, Elm_Dayselector_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_dayselector_week_start_get, Elm_Dayselector_Day, 0); + +void _elm_dayselector_weekend_length_set(Eo *obj, Elm_Dayselector_Data *pd, unsigned int length); + + +static Eina_Error +__eolian_elm_dayselector_weekend_length_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; unsigned int cval; + if (!eina_value_uint_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_dayselector_weekend_length_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_dayselector_weekend_length_set, EFL_FUNC_CALL(length), unsigned int length); + +unsigned int _elm_dayselector_weekend_length_get(const Eo *obj, Elm_Dayselector_Data *pd); + + +static Eina_Value +__eolian_elm_dayselector_weekend_length_get_reflect(const Eo *obj) +{ + unsigned int val = elm_obj_dayselector_weekend_length_get(obj); + return eina_value_uint_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_dayselector_weekend_length_get, unsigned int, 0); + +void _elm_dayselector_weekend_start_set(Eo *obj, Elm_Dayselector_Data *pd, Elm_Dayselector_Day day); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_dayselector_weekend_start_set, EFL_FUNC_CALL(day), Elm_Dayselector_Day day); + +Elm_Dayselector_Day _elm_dayselector_weekend_start_get(const Eo *obj, Elm_Dayselector_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_dayselector_weekend_start_get, Elm_Dayselector_Day, 0); + +void _elm_dayselector_weekdays_names_set(Eo *obj, Elm_Dayselector_Data *pd, const char **weekdays); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_dayselector_weekdays_names_set, EFL_FUNC_CALL(weekdays), const char **weekdays); + +Eina_List *_elm_dayselector_weekdays_names_get(const Eo *obj, Elm_Dayselector_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_dayselector_weekdays_names_get, Eina_List *, NULL); + +void _elm_dayselector_day_selected_set(Eo *obj, Elm_Dayselector_Data *pd, Elm_Dayselector_Day day, Eina_Bool selected); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_dayselector_day_selected_set, EFL_FUNC_CALL(day, selected), Elm_Dayselector_Day day, Eina_Bool selected); + +Eina_Bool _elm_dayselector_day_selected_get(const Eo *obj, Elm_Dayselector_Data *pd, Elm_Dayselector_Day day); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_dayselector_day_selected_get, Eina_Bool, 0, EFL_FUNC_CALL(day), Elm_Dayselector_Day day); + +Efl_Object *_elm_dayselector_efl_object_constructor(Eo *obj, Elm_Dayselector_Data *pd); + + +Eina_Error _elm_dayselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Dayselector_Data *pd); + + +void _elm_dayselector_efl_ui_l10n_translation_update(Eo *obj, Elm_Dayselector_Data *pd); + + +Efl_Object *_elm_dayselector_efl_part_part_get(const Eo *obj, Elm_Dayselector_Data *pd, const char *name); + + +static Eina_Bool +_elm_dayselector_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_DAYSELECTOR_EXTRA_OPS +#define ELM_DAYSELECTOR_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_dayselector_week_start_set, _elm_dayselector_week_start_set), + EFL_OBJECT_OP_FUNC(elm_obj_dayselector_week_start_get, _elm_dayselector_week_start_get), + EFL_OBJECT_OP_FUNC(elm_obj_dayselector_weekend_length_set, _elm_dayselector_weekend_length_set), + EFL_OBJECT_OP_FUNC(elm_obj_dayselector_weekend_length_get, _elm_dayselector_weekend_length_get), + EFL_OBJECT_OP_FUNC(elm_obj_dayselector_weekend_start_set, _elm_dayselector_weekend_start_set), + EFL_OBJECT_OP_FUNC(elm_obj_dayselector_weekend_start_get, _elm_dayselector_weekend_start_get), + EFL_OBJECT_OP_FUNC(elm_obj_dayselector_weekdays_names_set, _elm_dayselector_weekdays_names_set), + EFL_OBJECT_OP_FUNC(elm_obj_dayselector_weekdays_names_get, _elm_dayselector_weekdays_names_get), + EFL_OBJECT_OP_FUNC(elm_obj_dayselector_day_selected_set, _elm_dayselector_day_selected_set), + EFL_OBJECT_OP_FUNC(elm_obj_dayselector_day_selected_get, _elm_dayselector_day_selected_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_dayselector_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_dayselector_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_dayselector_efl_ui_l10n_translation_update), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_dayselector_efl_part_part_get), + ELM_DAYSELECTOR_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"weekend_length", __eolian_elm_dayselector_weekend_length_set_reflect, __eolian_elm_dayselector_weekend_length_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_dayselector_class_desc = { + EO_VERSION, + "Elm.Dayselector", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Dayselector_Data), + _elm_dayselector_class_initializer, + _elm_dayselector_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_dayselector_class_get, &_elm_dayselector_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_dayselector_eo.legacy.c" diff --git a/src/lib/elementary/elm_dayselector_eo.h b/src/lib/elementary/elm_dayselector_eo.h new file mode 100644 index 0000000000..02e3d6fd10 --- /dev/null +++ b/src/lib/elementary/elm_dayselector_eo.h @@ -0,0 +1,194 @@ +#ifndef _ELM_DAYSELECTOR_EO_H_ +#define _ELM_DAYSELECTOR_EO_H_ + +#ifndef _ELM_DAYSELECTOR_EO_CLASS_TYPE +#define _ELM_DAYSELECTOR_EO_CLASS_TYPE + +typedef Eo Elm_Dayselector; + +#endif + +#ifndef _ELM_DAYSELECTOR_EO_TYPES +#define _ELM_DAYSELECTOR_EO_TYPES + +/** + * @brief Identifies the day of the week. API can call the + * selection/unselection of day with this as a parameter. + * + * See also @ref elm_obj_dayselector_day_selected_set, + * @ref elm_obj_dayselector_day_selected_get. + * + * @ingroup Elm_Dayselector + */ +typedef enum +{ + ELM_DAYSELECTOR_SUN = 0, /**< Indicates Sunday. */ + ELM_DAYSELECTOR_MON, /**< Indicates Monday. */ + ELM_DAYSELECTOR_TUE, /**< Indicates Tuesday. */ + ELM_DAYSELECTOR_WED, /**< Indicates Wednesday. */ + ELM_DAYSELECTOR_THU, /**< Indicates Thursday. */ + ELM_DAYSELECTOR_FRI, /**< Indicates Friday. */ + ELM_DAYSELECTOR_SAT, /**< Indicates Saturday. */ + ELM_DAYSELECTOR_MAX /**< Sentinel value to indicate last enum field during + * iteration */ +} Elm_Dayselector_Day; + + +#endif +/** Elementary dayselector class + * + * @ingroup Elm_Dayselector + */ +#define ELM_DAYSELECTOR_CLASS elm_dayselector_class_get() + +EWAPI const Efl_Class *elm_dayselector_class_get(void); + +/** + * @brief Set the starting day of Dayselector. + * + * See also @ref Elm_Dayselector_Day, @ref elm_obj_dayselector_week_start_get. + * + * @param[in] obj The object. + * @param[in] day Dayselector_Day the first day that the user wants to display. + * + * @ingroup Elm_Dayselector + */ +EOAPI void elm_obj_dayselector_week_start_set(Eo *obj, Elm_Dayselector_Day day); + +/** + * @brief Get the starting day of Dayselector. + * + * See also @ref Elm_Dayselector_Day, @ref elm_obj_dayselector_week_start_set. + * + * @param[in] obj The object. + * + * @return Dayselector_Day the first day that the user wants to display. + * + * @ingroup Elm_Dayselector + */ +EOAPI Elm_Dayselector_Day elm_obj_dayselector_week_start_get(const Eo *obj); + +/** + * @brief Set the weekend length of Dayselector. + * + * See also @ref elm_obj_dayselector_weekend_length_get. + * + * @param[in] obj The object. + * @param[in] length Weekend length, number of days as an integer. + * + * @ingroup Elm_Dayselector + */ +EOAPI void elm_obj_dayselector_weekend_length_set(Eo *obj, unsigned int length); + +/** + * @brief Get the weekend length of Dayselector. + * + * See also @ref Elm_Dayselector_Day, + * @ref elm_obj_dayselector_weekend_length_set. + * + * @param[in] obj The object. + * + * @return Weekend length, number of days as an integer. + * + * @ingroup Elm_Dayselector + */ +EOAPI unsigned int elm_obj_dayselector_weekend_length_get(const Eo *obj); + +/** + * @brief Set the weekend starting day of Dayselector. + * + * See also @ref Elm_Dayselector_Day, + * @ref elm_obj_dayselector_weekend_start_get. + * + * @param[in] obj The object. + * @param[in] day Dayselector_Day the first day from where weekend starts. + * + * @ingroup Elm_Dayselector + */ +EOAPI void elm_obj_dayselector_weekend_start_set(Eo *obj, Elm_Dayselector_Day day); + +/** + * @brief Get the weekend starting day of Dayselector. + * + * See also @ref Elm_Dayselector_Day, + * @ref elm_obj_dayselector_weekend_start_set. + * + * @param[in] obj The object. + * + * @return Dayselector_Day the first day from where weekend starts. + * + * @ingroup Elm_Dayselector + */ +EOAPI Elm_Dayselector_Day elm_obj_dayselector_weekend_start_get(const Eo *obj); + +/** + * @brief Set weekdays names to be displayed by the Dayselector. + * + * By default or if weekdays is @c null, weekdays abbreviations get from system + * are displayed: E.g. for an en_US locale: "Sun, Mon, Tue, Wed, Thu, Fri, Sat" + * + * The first string should be related to Sunday, the second to Monday... + * + * See also @ref elm_obj_dayselector_weekdays_names_get, + * @ref elm_obj_dayselector_weekend_start_set. + * + * @param[in] obj The object. + * @param[in] weekdays Array of seven strings to be used as weekday names. + * Warning: It must have 7 elements, or it will access invalid memory. Warning: + * The strings must be NULL terminated ('@\0'). + * + * @since 1.8 + * + * @ingroup Elm_Dayselector + */ +EOAPI void elm_obj_dayselector_weekdays_names_set(Eo *obj, const char **weekdays); + +/** + * @brief Get weekdays names displayed by the calendar. + * + * By default, weekdays abbreviations get from system are displayed: E.g. for + * an en_US locale: "Sun, Mon, Tue, Wed, Thu, Fri, Sat" The first string is + * related to Sunday, the second to Monday... + * + * See also @ref elm_obj_dayselector_weekdays_names_set. + * + * @param[in] obj The object. + * + * @return A list of seven strings to be used as weekday names. + * + * @since 1.8 + * + * @ingroup Elm_Dayselector + */ +EOAPI Eina_List *elm_obj_dayselector_weekdays_names_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Set the state of given Dayselector_Day. + * + * See also @ref Elm_Dayselector_Day, + * @ref elm_obj_dayselector_day_selected_get. + * + * @param[in] obj The object. + * @param[in] day Dayselector_Day that the user want to set state. + * @param[in] selected State of the day. @c true is selected. + * + * @ingroup Elm_Dayselector + */ +EOAPI void elm_obj_dayselector_day_selected_set(Eo *obj, Elm_Dayselector_Day day, Eina_Bool selected); + +/** + * @brief Get the state of given Dayselector_Day. + * + * See also @ref Elm_Dayselector_Day, + * @ref elm_obj_dayselector_day_selected_set. + * + * @param[in] obj The object. + * @param[in] day Dayselector_Day that the user want to know state. + * + * @return @c true on success, @c false on failure + * + * @ingroup Elm_Dayselector + */ +EOAPI Eina_Bool elm_obj_dayselector_day_selected_get(const Eo *obj, Elm_Dayselector_Day day); + +#endif diff --git a/src/lib/elementary/elm_dayselector_eo.legacy.c b/src/lib/elementary/elm_dayselector_eo.legacy.c new file mode 100644 index 0000000000..20ad0d8777 --- /dev/null +++ b/src/lib/elementary/elm_dayselector_eo.legacy.c @@ -0,0 +1,60 @@ + +EAPI void +elm_dayselector_week_start_set(Elm_Dayselector *obj, Elm_Dayselector_Day day) +{ + elm_obj_dayselector_week_start_set(obj, day); +} + +EAPI Elm_Dayselector_Day +elm_dayselector_week_start_get(const Elm_Dayselector *obj) +{ + return elm_obj_dayselector_week_start_get(obj); +} + +EAPI void +elm_dayselector_weekend_length_set(Elm_Dayselector *obj, unsigned int length) +{ + elm_obj_dayselector_weekend_length_set(obj, length); +} + +EAPI unsigned int +elm_dayselector_weekend_length_get(const Elm_Dayselector *obj) +{ + return elm_obj_dayselector_weekend_length_get(obj); +} + +EAPI void +elm_dayselector_weekend_start_set(Elm_Dayselector *obj, Elm_Dayselector_Day day) +{ + elm_obj_dayselector_weekend_start_set(obj, day); +} + +EAPI Elm_Dayselector_Day +elm_dayselector_weekend_start_get(const Elm_Dayselector *obj) +{ + return elm_obj_dayselector_weekend_start_get(obj); +} + +EAPI void +elm_dayselector_weekdays_names_set(Elm_Dayselector *obj, const char **weekdays) +{ + elm_obj_dayselector_weekdays_names_set(obj, weekdays); +} + +EAPI Eina_List * +elm_dayselector_weekdays_names_get(const Elm_Dayselector *obj) +{ + return elm_obj_dayselector_weekdays_names_get(obj); +} + +EAPI void +elm_dayselector_day_selected_set(Elm_Dayselector *obj, Elm_Dayselector_Day day, Eina_Bool selected) +{ + elm_obj_dayselector_day_selected_set(obj, day, selected); +} + +EAPI Eina_Bool +elm_dayselector_day_selected_get(const Elm_Dayselector *obj, Elm_Dayselector_Day day) +{ + return elm_obj_dayselector_day_selected_get(obj, day); +} diff --git a/src/lib/elementary/elm_dayselector_eo.legacy.h b/src/lib/elementary/elm_dayselector_eo.legacy.h new file mode 100644 index 0000000000..0e524b0e2b --- /dev/null +++ b/src/lib/elementary/elm_dayselector_eo.legacy.h @@ -0,0 +1,182 @@ +#ifndef _ELM_DAYSELECTOR_EO_LEGACY_H_ +#define _ELM_DAYSELECTOR_EO_LEGACY_H_ + +#ifndef _ELM_DAYSELECTOR_EO_CLASS_TYPE +#define _ELM_DAYSELECTOR_EO_CLASS_TYPE + +typedef Eo Elm_Dayselector; + +#endif + +#ifndef _ELM_DAYSELECTOR_EO_TYPES +#define _ELM_DAYSELECTOR_EO_TYPES + +/** + * @brief Identifies the day of the week. API can call the + * selection/unselection of day with this as a parameter. + * + * See also @ref elm_dayselector_day_selected_set, + * @ref elm_dayselector_day_selected_get. + * + * @ingroup Elm_Dayselector + */ +typedef enum +{ + ELM_DAYSELECTOR_SUN = 0, /**< Indicates Sunday. */ + ELM_DAYSELECTOR_MON, /**< Indicates Monday. */ + ELM_DAYSELECTOR_TUE, /**< Indicates Tuesday. */ + ELM_DAYSELECTOR_WED, /**< Indicates Wednesday. */ + ELM_DAYSELECTOR_THU, /**< Indicates Thursday. */ + ELM_DAYSELECTOR_FRI, /**< Indicates Friday. */ + ELM_DAYSELECTOR_SAT, /**< Indicates Saturday. */ + ELM_DAYSELECTOR_MAX /**< Sentinel value to indicate last enum field during + * iteration */ +} Elm_Dayselector_Day; + + +#endif + +/** + * @brief Set the starting day of Dayselector. + * + * See also @ref Elm_Dayselector_Day, @ref elm_dayselector_week_start_get. + * + * @param[in] obj The object. + * @param[in] day Dayselector_Day the first day that the user wants to display. + * + * @ingroup Elm_Dayselector_Group + */ +EAPI void elm_dayselector_week_start_set(Elm_Dayselector *obj, Elm_Dayselector_Day day); + +/** + * @brief Get the starting day of Dayselector. + * + * See also @ref Elm_Dayselector_Day, @ref elm_dayselector_week_start_set. + * + * @param[in] obj The object. + * + * @return Dayselector_Day the first day that the user wants to display. + * + * @ingroup Elm_Dayselector_Group + */ +EAPI Elm_Dayselector_Day elm_dayselector_week_start_get(const Elm_Dayselector *obj); + +/** + * @brief Set the weekend length of Dayselector. + * + * See also @ref elm_dayselector_weekend_length_get. + * + * @param[in] obj The object. + * @param[in] length Weekend length, number of days as an integer. + * + * @ingroup Elm_Dayselector_Group + */ +EAPI void elm_dayselector_weekend_length_set(Elm_Dayselector *obj, unsigned int length); + +/** + * @brief Get the weekend length of Dayselector. + * + * See also @ref Elm_Dayselector_Day, @ref elm_dayselector_weekend_length_set. + * + * @param[in] obj The object. + * + * @return Weekend length, number of days as an integer. + * + * @ingroup Elm_Dayselector_Group + */ +EAPI unsigned int elm_dayselector_weekend_length_get(const Elm_Dayselector *obj); + +/** + * @brief Set the weekend starting day of Dayselector. + * + * See also @ref Elm_Dayselector_Day, @ref elm_dayselector_weekend_start_get. + * + * @param[in] obj The object. + * @param[in] day Dayselector_Day the first day from where weekend starts. + * + * @ingroup Elm_Dayselector_Group + */ +EAPI void elm_dayselector_weekend_start_set(Elm_Dayselector *obj, Elm_Dayselector_Day day); + +/** + * @brief Get the weekend starting day of Dayselector. + * + * See also @ref Elm_Dayselector_Day, @ref elm_dayselector_weekend_start_set. + * + * @param[in] obj The object. + * + * @return Dayselector_Day the first day from where weekend starts. + * + * @ingroup Elm_Dayselector_Group + */ +EAPI Elm_Dayselector_Day elm_dayselector_weekend_start_get(const Elm_Dayselector *obj); + +/** + * @brief Set weekdays names to be displayed by the Dayselector. + * + * By default or if weekdays is @c null, weekdays abbreviations get from system + * are displayed: E.g. for an en_US locale: "Sun, Mon, Tue, Wed, Thu, Fri, Sat" + * + * The first string should be related to Sunday, the second to Monday... + * + * See also @ref elm_dayselector_weekdays_names_get, + * @ref elm_dayselector_weekend_start_set. + * + * @param[in] obj The object. + * @param[in] weekdays Array of seven strings to be used as weekday names. + * Warning: It must have 7 elements, or it will access invalid memory. Warning: + * The strings must be NULL terminated ('@\0'). + * + * @since 1.8 + * + * @ingroup Elm_Dayselector_Group + */ +EAPI void elm_dayselector_weekdays_names_set(Elm_Dayselector *obj, const char **weekdays); + +/** + * @brief Get weekdays names displayed by the calendar. + * + * By default, weekdays abbreviations get from system are displayed: E.g. for + * an en_US locale: "Sun, Mon, Tue, Wed, Thu, Fri, Sat" The first string is + * related to Sunday, the second to Monday... + * + * See also @ref elm_dayselector_weekdays_names_set. + * + * @param[in] obj The object. + * + * @return A list of seven strings to be used as weekday names. + * + * @since 1.8 + * + * @ingroup Elm_Dayselector_Group + */ +EAPI Eina_List *elm_dayselector_weekdays_names_get(const Elm_Dayselector *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Set the state of given Dayselector_Day. + * + * See also @ref Elm_Dayselector_Day, @ref elm_dayselector_day_selected_get. + * + * @param[in] obj The object. + * @param[in] day Dayselector_Day that the user want to set state. + * @param[in] selected State of the day. @c true is selected. + * + * @ingroup Elm_Dayselector_Group + */ +EAPI void elm_dayselector_day_selected_set(Elm_Dayselector *obj, Elm_Dayselector_Day day, Eina_Bool selected); + +/** + * @brief Get the state of given Dayselector_Day. + * + * See also @ref Elm_Dayselector_Day, @ref elm_dayselector_day_selected_set. + * + * @param[in] obj The object. + * @param[in] day Dayselector_Day that the user want to know state. + * + * @return @c true on success, @c false on failure + * + * @ingroup Elm_Dayselector_Group + */ +EAPI Eina_Bool elm_dayselector_day_selected_get(const Elm_Dayselector *obj, Elm_Dayselector_Day day); + +#endif diff --git a/src/lib/elementary/elm_dayselector_item.eo b/src/lib/elementary/elm_dayselector_item.eo deleted file mode 100644 index a39a48d701..0000000000 --- a/src/lib/elementary/elm_dayselector_item.eo +++ /dev/null @@ -1,8 +0,0 @@ -class Elm.Dayselector.Item extends Elm.Widget.Item -{ - [[Elementary dayselector item class]] - eo_prefix: elm_dayselector_item; - implements { - Efl.Object.constructor; - } -} diff --git a/src/lib/elementary/elm_dayselector_item_eo.c b/src/lib/elementary/elm_dayselector_item_eo.c new file mode 100644 index 0000000000..7850ec6c14 --- /dev/null +++ b/src/lib/elementary/elm_dayselector_item_eo.c @@ -0,0 +1,35 @@ + +Efl_Object *_elm_dayselector_item_efl_object_constructor(Eo *obj, Elm_Dayselector_Item_Data *pd); + + +static Eina_Bool +_elm_dayselector_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_DAYSELECTOR_ITEM_EXTRA_OPS +#define ELM_DAYSELECTOR_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_dayselector_item_efl_object_constructor), + ELM_DAYSELECTOR_ITEM_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_dayselector_item_class_desc = { + EO_VERSION, + "Elm.Dayselector.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Dayselector_Item_Data), + _elm_dayselector_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_dayselector_item_class_get, &_elm_dayselector_item_class_desc, ELM_WIDGET_ITEM_CLASS, NULL); diff --git a/src/lib/elementary/elm_dayselector_item_eo.h b/src/lib/elementary/elm_dayselector_item_eo.h new file mode 100644 index 0000000000..192c5b41a4 --- /dev/null +++ b/src/lib/elementary/elm_dayselector_item_eo.h @@ -0,0 +1,24 @@ +#ifndef _ELM_DAYSELECTOR_ITEM_EO_H_ +#define _ELM_DAYSELECTOR_ITEM_EO_H_ + +#ifndef _ELM_DAYSELECTOR_ITEM_EO_CLASS_TYPE +#define _ELM_DAYSELECTOR_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Dayselector_Item; + +#endif + +#ifndef _ELM_DAYSELECTOR_ITEM_EO_TYPES +#define _ELM_DAYSELECTOR_ITEM_EO_TYPES + + +#endif +/** Elementary dayselector item class + * + * @ingroup Elm_Dayselector_Item + */ +#define ELM_DAYSELECTOR_ITEM_CLASS elm_dayselector_item_class_get() + +EWAPI const Efl_Class *elm_dayselector_item_class_get(void); + +#endif diff --git a/src/lib/elementary/elm_dayselector_item_eo.legacy.h b/src/lib/elementary/elm_dayselector_item_eo.legacy.h new file mode 100644 index 0000000000..e39ee863ae --- /dev/null +++ b/src/lib/elementary/elm_dayselector_item_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_DAYSELECTOR_ITEM_EO_LEGACY_H_ +#define _ELM_DAYSELECTOR_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_DAYSELECTOR_ITEM_EO_CLASS_TYPE +#define _ELM_DAYSELECTOR_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Dayselector_Item; + +#endif + +#ifndef _ELM_DAYSELECTOR_ITEM_EO_TYPES +#define _ELM_DAYSELECTOR_ITEM_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_dayselector_legacy.h b/src/lib/elementary/elm_dayselector_legacy.h index b30e574ffa..cb94d972be 100644 --- a/src/lib/elementary/elm_dayselector_legacy.h +++ b/src/lib/elementary/elm_dayselector_legacy.h @@ -8,4 +8,4 @@ */ EAPI Evas_Object *elm_dayselector_add(Evas_Object *parent); -#include "elm_dayselector.eo.legacy.h" +#include "elm_dayselector_eo.legacy.h" diff --git a/src/lib/elementary/elm_dayselector_part.eo b/src/lib/elementary/elm_dayselector_part.eo index 0a13d331ba..5a83c5555d 100644 --- a/src/lib/elementary/elm_dayselector_part.eo +++ b/src/lib/elementary/elm_dayselector_part.eo @@ -1,4 +1,4 @@ -class Elm.Dayselector.Part extends Efl.Ui.Layout_Part_Legacy +class @beta Elm.Dayselector.Part extends Efl.Ui.Layout_Part_Legacy { [[Elementary dayselector internal part class]] data: null; diff --git a/src/lib/elementary/elm_dbus_menu.c b/src/lib/elementary/elm_dbus_menu.c index 73b8a7bf0b..7d1d950986 100644 --- a/src/lib/elementary/elm_dbus_menu.c +++ b/src/lib/elementary/elm_dbus_menu.c @@ -5,7 +5,7 @@ #include #include #include "elm_priv.h" -#include "elm_icon.eo.h" +#include "elm_icon_eo.h" #include "elm_widget_menu.h" #include "elm_widget_icon.h" diff --git a/src/lib/elementary/elm_diskselector.c b/src/lib/elementary/elm_diskselector.c index 6994f8d2a8..fd2494f00c 100644 --- a/src/lib/elementary/elm_diskselector.c +++ b/src/lib/elementary/elm_diskselector.c @@ -9,10 +9,11 @@ #include #include "elm_priv.h" -#include "elm_diskselector.eo.h" -#include "elm_diskselector_item.eo.h" +#include "elm_diskselector_eo.h" +#include "elm_diskselector_item_eo.h" #include "elm_widget_diskselector.h" #include "elm_interface_scrollable.h" +#include "elm_pan_eo.h" #define DISPLAY_ITEM_NUM_MIN 3 @@ -90,8 +91,7 @@ _item_select(Elm_Diskselector_Item_Data *it) _selected_item_indicate(sd->selected_item); if (it->func) it->func((void *)WIDGET_ITEM_DATA_GET(eo_it), WIDGET(it), eo_it); - efl_event_callback_legacy_call - (WIDGET(it), EFL_UI_EVENT_SELECTED, eo_it); + evas_object_smart_callback_call(WIDGET(it), "selected", eo_it); } static int @@ -811,18 +811,18 @@ _theme_data_get(Evas_Object *obj) else sd->minh = -1; } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_diskselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Diskselector_Data *sd) { Eina_List *l; Elm_Diskselector_Item_Data *it; Evas_Object *blank; - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; Evas *evas; const char *style = elm_widget_style_get(obj); int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; evas = evas_object_evas_get(obj); evas_event_freeze(evas); @@ -1221,8 +1221,6 @@ _elm_diskselector_efl_canvas_group_group_add(Eo *obj, Elm_Diskselector_Data *pri Evas *evas; Evas_Object *blank, *edje; - elm_widget_sub_object_parent_add(obj); - evas = evas_object_evas_get(obj); evas_event_freeze(evas); @@ -1789,5 +1787,5 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_diskselector, Elm_Diskselector_Data) #define ELM_DISKSELECTOR_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_diskselector) -#include "elm_diskselector.eo.c" -#include "elm_diskselector_item.eo.c" +#include "elm_diskselector_eo.c" +#include "elm_diskselector_item_eo.c" diff --git a/src/lib/elementary/elm_diskselector.eo b/src/lib/elementary/elm_diskselector.eo deleted file mode 100644 index 8719c5e4db..0000000000 --- a/src/lib/elementary/elm_diskselector.eo +++ /dev/null @@ -1,213 +0,0 @@ -class Elm.Diskselector extends Efl.Ui.Widget implements Elm.Interface_Scrollable, - Efl.Access.Widget.Action, - Efl.Ui.Clickable, Efl.Ui.Scrollable, - Efl.Ui.Selectable, Efl.Ui.Legacy -{ - [[Elementary diskselector class]] - legacy_prefix: elm_diskselector; - eo_prefix: elm_obj_diskselector; - event_prefix: elm_diskselector; - methods { - @property side_text_max_length { - set { - [[Set the side labels max length. - - Length is the number of characters of items' label that will be - visible when it's set on side positions. It will just crop - the string after defined size. E.g.: - - An item with label "January" would be displayed on side position as - "Jan" if max length is set to 3, or "Janu", if this property - is set to 4. - - When it's selected, the entire label will be displayed, except for - width restrictions. In this case label will be cropped and "..." - will be concatenated. - - Default side label max length is 3. - - This property will be applied over all items, included before or - later this function call. - ]] - } - get { - [[Get the side labels max length. - - See also @.side_text_max_length.set for details. - ]] - } - values { - len: int; [[The max length defined for side labels.]] - } - } - @property round_enabled { - set { - [[Enable or disable round mode. - - Disabled by default. If round mode is enabled the items list will - work like a circular list, so when the user reaches the last item, - the first one will popup. - - See also @.round_enabled.get. - ]] - } - get { - [[Get a value whether round mode is enabled or not. - - See also @.round_enabled.set for details. - ]] - } - values { - enabled: bool; [[$true to enable round mode or $false to - disable it.]] - } - } - @property display_item_num { - set { - [[Set the number of items to be displayed. - - Default value is 3, and also it's the minimum. If $num is less - than 3, it will be set to 3. - - Also, it can be set on theme, using data item $display_item_num - on group "elm/diskselector/item/X", where X is style set. - ]] - /* FIXME-doc - * E.g.: - * group { name: "elm/diskselector/item/X"; - * data { - * item: "display_item_num" "5"; - * } - */ - } - get { - [[Get the number of items in the diskselector object.]] - } - values { - num: int; [[The number of items the diskselector will display.]] - } - } - @property first_item { - get { - [[Get the first item of the diskselector. - - The list of items follows append order. So it will return the first - item appended to the widget that wasn't deleted. - - See also @.item_append, - @.items.get. - ]] - return: Elm.Widget.Item; [[The first item, or $null if none.]] - } - } - @property items { - get { - [[Get a list of all the diskselector items. - - See also @.item_append, - \@ref elm_object_item_del, - @.clear. - ]] - return: const(list); [[A $list of diskselector items, or $ull on failure.]] - } - } - @property last_item { - get { - [[Get the last item of the diskselector. - - The list of items follows append order. So it will return last first - item appended to the widget that wasn't deleted. - - See also @.item_append, - @.items.get. - ]] - return: Elm.Widget.Item; [[The last item, or $null if none.]] - } - } - @property selected_item { - get { - [[Get the selected item. - - - The selected item can be unselected with - @Elm.Diskselector.Item.selected.set, and the first item of - diskselector will be selected. - - The selected item always will be centered on diskselector, with - full label displayed, i.e., max length set to side labels won't - apply on the selected item. More details on - @.side_text_max_length.set. - ]] - return: Elm.Widget.Item; [[The selected diskselector item.]] - } - } - item_append { - [[Appends a new item to the diskselector object. - - A new item will be created and appended to the diskselector, i.e., will - be set as last item. Also, if there is no selected item, it will - be selected. This will always happens for the first appended item. - - If no icon is set, label will be centered on item position, otherwise - the icon will be placed at left of the label, that will be shifted - to the right. - - Items created with this method can be deleted with - \@ref elm_object_item_del. - - Associated $data can be properly freed when item is deleted if a - callback function is set with \@ref elm_object_item_del_cb_set. - - If a function is passed as argument, it will be called every time this item - is selected, i.e., the user stops the diskselector with this - item on center position. If such function isn't needed, just passing - $null as $func is enough. The same should be done for $data. - - See also \@ref elm_object_item_del, - @.clear, - \@ref elm_icon_add. - ]] - /* FIXME-doc - * Simple example (with no function callback or data associated): - * @code - * disk = elm_diskselector_add(win); - * ic = elm_icon_add(win); - * elm_image_file_set(ic, "path/to/image", NULL); - * elm_icon_resizable_set(ic, true, true); - * elm_diskselector_item_append(disk, "label", ic, NULL, NULL); - * @endcode - */ - return: Elm.Widget.Item; [[New item]] - params { - @in label: string; [[The label of the diskselector item.]] - @in icon: Efl.Canvas.Object @optional; [[The icon object to use at left side of the item. An - icon can be any Evas object, but usually it is an icon created - with elm_icon_add(). ]] - @in func: Evas_Smart_Cb @optional; [[The function to call when the item is selected.]] - @in data: const(void_ptr) @optional; [[The data to associate with the item for related callbacks.]] - } - } - clear { - [[Remove all diskselector's items. - - See also \@ref elm_object_item_del, - @.item_append. - ]] - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Gfx.Entity.position { set; } - Efl.Gfx.Entity.size { set; } - Efl.Canvas.Group.group_member_add; - Efl.Ui.Widget.on_access_update; - Efl.Ui.Widget.theme_apply; - Efl.Ui.Focus.Object.on_focus_update; - Efl.Ui.L10n.translation_update; - 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_eo.c b/src/lib/elementary/elm_diskselector_eo.c new file mode 100644 index 0000000000..b44f2a0f9f --- /dev/null +++ b/src/lib/elementary/elm_diskselector_eo.c @@ -0,0 +1,227 @@ + +void _elm_diskselector_side_text_max_length_set(Eo *obj, Elm_Diskselector_Data *pd, int len); + + +static Eina_Error +__eolian_elm_diskselector_side_text_max_length_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_diskselector_side_text_max_length_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_diskselector_side_text_max_length_set, EFL_FUNC_CALL(len), int len); + +int _elm_diskselector_side_text_max_length_get(const Eo *obj, Elm_Diskselector_Data *pd); + + +static Eina_Value +__eolian_elm_diskselector_side_text_max_length_get_reflect(const Eo *obj) +{ + int val = elm_obj_diskselector_side_text_max_length_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_diskselector_side_text_max_length_get, int, 0); + +void _elm_diskselector_round_enabled_set(Eo *obj, Elm_Diskselector_Data *pd, Eina_Bool enabled); + + +static Eina_Error +__eolian_elm_diskselector_round_enabled_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_diskselector_round_enabled_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_diskselector_round_enabled_set, EFL_FUNC_CALL(enabled), Eina_Bool enabled); + +Eina_Bool _elm_diskselector_round_enabled_get(const Eo *obj, Elm_Diskselector_Data *pd); + + +static Eina_Value +__eolian_elm_diskselector_round_enabled_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_diskselector_round_enabled_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_diskselector_round_enabled_get, Eina_Bool, 0); + +void _elm_diskselector_display_item_num_set(Eo *obj, Elm_Diskselector_Data *pd, int num); + + +static Eina_Error +__eolian_elm_diskselector_display_item_num_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_diskselector_display_item_num_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_diskselector_display_item_num_set, EFL_FUNC_CALL(num), int num); + +int _elm_diskselector_display_item_num_get(const Eo *obj, Elm_Diskselector_Data *pd); + + +static Eina_Value +__eolian_elm_diskselector_display_item_num_get_reflect(const Eo *obj) +{ + int val = elm_obj_diskselector_display_item_num_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_diskselector_display_item_num_get, int, 0); + +Elm_Widget_Item *_elm_diskselector_first_item_get(const Eo *obj, Elm_Diskselector_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_diskselector_first_item_get, Elm_Widget_Item *, NULL); + +const Eina_List *_elm_diskselector_items_get(const Eo *obj, Elm_Diskselector_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_diskselector_items_get, const Eina_List *, NULL); + +Elm_Widget_Item *_elm_diskselector_last_item_get(const Eo *obj, Elm_Diskselector_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_diskselector_last_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_diskselector_selected_item_get(const Eo *obj, Elm_Diskselector_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_diskselector_selected_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_diskselector_item_append(Eo *obj, Elm_Diskselector_Data *pd, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_diskselector_item_append, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(label, icon, func, data), const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +void _elm_diskselector_clear(Eo *obj, Elm_Diskselector_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_diskselector_clear); + +Efl_Object *_elm_diskselector_efl_object_constructor(Eo *obj, Elm_Diskselector_Data *pd); + + +void _elm_diskselector_efl_gfx_entity_position_set(Eo *obj, Elm_Diskselector_Data *pd, Eina_Position2D pos); + + +void _elm_diskselector_efl_gfx_entity_size_set(Eo *obj, Elm_Diskselector_Data *pd, Eina_Size2D size); + + +void _elm_diskselector_efl_canvas_group_group_member_add(Eo *obj, Elm_Diskselector_Data *pd, Efl_Canvas_Object *sub_obj); + + +void _elm_diskselector_efl_ui_widget_on_access_update(Eo *obj, Elm_Diskselector_Data *pd, Eina_Bool enable); + + +Eina_Error _elm_diskselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Diskselector_Data *pd); + + +Eina_Bool _elm_diskselector_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Diskselector_Data *pd); + + +void _elm_diskselector_efl_ui_l10n_translation_update(Eo *obj, Elm_Diskselector_Data *pd); + + +Eina_Bool _elm_diskselector_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Diskselector_Data *pd, Efl_Canvas_Object *sub_obj); + + +Eina_Bool _elm_diskselector_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Diskselector_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +void _elm_diskselector_elm_interface_scrollable_policy_set(Eo *obj, Elm_Diskselector_Data *pd, Elm_Scroller_Policy hbar, Elm_Scroller_Policy vbar); + + +void _elm_diskselector_elm_interface_scrollable_policy_get(const Eo *obj, Elm_Diskselector_Data *pd, Elm_Scroller_Policy *hbar, Elm_Scroller_Policy *vbar); + + +const Efl_Access_Action_Data *_elm_diskselector_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Diskselector_Data *pd); + + +static Eina_Bool +_elm_diskselector_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_DISKSELECTOR_EXTRA_OPS +#define ELM_DISKSELECTOR_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_diskselector_side_text_max_length_set, _elm_diskselector_side_text_max_length_set), + EFL_OBJECT_OP_FUNC(elm_obj_diskselector_side_text_max_length_get, _elm_diskselector_side_text_max_length_get), + EFL_OBJECT_OP_FUNC(elm_obj_diskselector_round_enabled_set, _elm_diskselector_round_enabled_set), + EFL_OBJECT_OP_FUNC(elm_obj_diskselector_round_enabled_get, _elm_diskselector_round_enabled_get), + EFL_OBJECT_OP_FUNC(elm_obj_diskselector_display_item_num_set, _elm_diskselector_display_item_num_set), + EFL_OBJECT_OP_FUNC(elm_obj_diskselector_display_item_num_get, _elm_diskselector_display_item_num_get), + EFL_OBJECT_OP_FUNC(elm_obj_diskselector_first_item_get, _elm_diskselector_first_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_diskselector_items_get, _elm_diskselector_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_diskselector_last_item_get, _elm_diskselector_last_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_diskselector_selected_item_get, _elm_diskselector_selected_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_diskselector_item_append, _elm_diskselector_item_append), + EFL_OBJECT_OP_FUNC(elm_obj_diskselector_clear, _elm_diskselector_clear), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_diskselector_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_diskselector_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_diskselector_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_canvas_group_member_add, _elm_diskselector_efl_canvas_group_group_member_add), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_diskselector_efl_ui_widget_on_access_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_diskselector_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_on_focus_update, _elm_diskselector_efl_ui_focus_object_on_focus_update), + EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_diskselector_efl_ui_l10n_translation_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _elm_diskselector_efl_ui_widget_widget_sub_object_del), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_diskselector_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_policy_set, _elm_diskselector_elm_interface_scrollable_policy_set), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_policy_get, _elm_diskselector_elm_interface_scrollable_policy_get), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_diskselector_efl_access_widget_action_elm_actions_get), + ELM_DISKSELECTOR_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"side_text_max_length", __eolian_elm_diskselector_side_text_max_length_set_reflect, __eolian_elm_diskselector_side_text_max_length_get_reflect}, + {"round_enabled", __eolian_elm_diskselector_round_enabled_set_reflect, __eolian_elm_diskselector_round_enabled_get_reflect}, + {"display_item_num", __eolian_elm_diskselector_display_item_num_set_reflect, __eolian_elm_diskselector_display_item_num_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_diskselector_class_desc = { + EO_VERSION, + "Elm.Diskselector", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Diskselector_Data), + _elm_diskselector_class_initializer, + _elm_diskselector_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_diskselector_class_get, &_elm_diskselector_class_desc, EFL_UI_WIDGET_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_SCROLLABLE_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_diskselector_eo.legacy.c" diff --git a/src/lib/elementary/elm_diskselector_eo.h b/src/lib/elementary/elm_diskselector_eo.h new file mode 100644 index 0000000000..1c95bc125c --- /dev/null +++ b/src/lib/elementary/elm_diskselector_eo.h @@ -0,0 +1,232 @@ +#ifndef _ELM_DISKSELECTOR_EO_H_ +#define _ELM_DISKSELECTOR_EO_H_ + +#ifndef _ELM_DISKSELECTOR_EO_CLASS_TYPE +#define _ELM_DISKSELECTOR_EO_CLASS_TYPE + +typedef Eo Elm_Diskselector; + +#endif + +#ifndef _ELM_DISKSELECTOR_EO_TYPES +#define _ELM_DISKSELECTOR_EO_TYPES + + +#endif +/** Elementary diskselector class + * + * @ingroup Elm_Diskselector + */ +#define ELM_DISKSELECTOR_CLASS elm_diskselector_class_get() + +EWAPI const Efl_Class *elm_diskselector_class_get(void); + +/** + * @brief Set the side labels max length. + * + * Length is the number of characters of items' label that will be visible when + * it's set on side positions. It will just crop the string after defined size. + * E.g.: + * + * An item with label "January" would be displayed on side position as "Jan" if + * max length is set to 3, or "Janu", if this property is set to 4. + * + * When it's selected, the entire label will be displayed, except for width + * restrictions. In this case label will be cropped and "..." will be + * concatenated. + * + * Default side label max length is 3. + * + * This property will be applied over all items, included before or later this + * function call. + * + * @param[in] obj The object. + * @param[in] len The max length defined for side labels. + * + * @ingroup Elm_Diskselector + */ +EOAPI void elm_obj_diskselector_side_text_max_length_set(Eo *obj, int len); + +/** + * @brief Get the side labels max length. + * + * See also @ref elm_obj_diskselector_side_text_max_length_set for details. + * + * @param[in] obj The object. + * + * @return The max length defined for side labels. + * + * @ingroup Elm_Diskselector + */ +EOAPI int elm_obj_diskselector_side_text_max_length_get(const Eo *obj); + +/** + * @brief Enable or disable round mode. + * + * Disabled by default. If round mode is enabled the items list will work like + * a circular list, so when the user reaches the last item, the first one will + * popup. + * + * See also @ref elm_obj_diskselector_round_enabled_get. + * + * @param[in] obj The object. + * @param[in] enabled @c true to enable round mode or @c false to disable it. + * + * @ingroup Elm_Diskselector + */ +EOAPI void elm_obj_diskselector_round_enabled_set(Eo *obj, Eina_Bool enabled); + +/** + * @brief Get a value whether round mode is enabled or not. + * + * See also @ref elm_obj_diskselector_round_enabled_set for details. + * + * @param[in] obj The object. + * + * @return @c true to enable round mode or @c false to disable it. + * + * @ingroup Elm_Diskselector + */ +EOAPI Eina_Bool elm_obj_diskselector_round_enabled_get(const Eo *obj); + +/** + * @brief Set the number of items to be displayed. + * + * Default value is 3, and also it's the minimum. If @c num is less than 3, it + * will be set to 3. + * + * Also, it can be set on theme, using data item @c display_item_num on group + * "elm/diskselector/item/X", where X is style set. + * + * @param[in] obj The object. + * @param[in] num The number of items the diskselector will display. + * + * @ingroup Elm_Diskselector + */ +EOAPI void elm_obj_diskselector_display_item_num_set(Eo *obj, int num); + +/** + * @brief Get the number of items in the diskselector object. + * + * @param[in] obj The object. + * + * @return The number of items the diskselector will display. + * + * @ingroup Elm_Diskselector + */ +EOAPI int elm_obj_diskselector_display_item_num_get(const Eo *obj); + +/** + * @brief Get the first item of the diskselector. + * + * The list of items follows append order. So it will return the first item + * appended to the widget that wasn't deleted. + * + * See also @ref elm_obj_diskselector_item_append, + * @ref elm_obj_diskselector_items_get. + * + * @param[in] obj The object. + * + * @return The first item, or @c null if none. + * + * @ingroup Elm_Diskselector + */ +EOAPI Elm_Widget_Item *elm_obj_diskselector_first_item_get(const Eo *obj); + +/** + * @brief Get a list of all the diskselector items. + * + * See also @ref elm_obj_diskselector_item_append, @ref elm_object_item_del, + * @ref elm_obj_diskselector_clear. + * + * @param[in] obj The object. + * + * @return A @c list of diskselector items, or @c ull on failure. + * + * @ingroup Elm_Diskselector + */ +EOAPI const Eina_List *elm_obj_diskselector_items_get(const Eo *obj); + +/** + * @brief Get the last item of the diskselector. + * + * The list of items follows append order. So it will return last first item + * appended to the widget that wasn't deleted. + * + * See also @ref elm_obj_diskselector_item_append, + * @ref elm_obj_diskselector_items_get. + * + * @param[in] obj The object. + * + * @return The last item, or @c null if none. + * + * @ingroup Elm_Diskselector + */ +EOAPI Elm_Widget_Item *elm_obj_diskselector_last_item_get(const Eo *obj); + +/** + * @brief Get the selected item. + * + * The selected item can be unselected with + * @ref elm_obj_diskselector_item_selected_set, and the first item of + * diskselector will be selected. + * + * The selected item always will be centered on diskselector, with full label + * displayed, i.e., max length set to side labels won't apply on the selected + * item. More details on @ref elm_obj_diskselector_side_text_max_length_set. + * + * @param[in] obj The object. + * + * @return The selected diskselector item. + * + * @ingroup Elm_Diskselector + */ +EOAPI Elm_Widget_Item *elm_obj_diskselector_selected_item_get(const Eo *obj); + +/** + * @brief Appends a new item to the diskselector object. + * + * A new item will be created and appended to the diskselector, i.e., will be + * set as last item. Also, if there is no selected item, it will be selected. + * This will always happens for the first appended item. + * + * If no icon is set, label will be centered on item position, otherwise the + * icon will be placed at left of the label, that will be shifted to the right. + * + * Items created with this method can be deleted with @ref elm_object_item_del. + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with @ref elm_object_item_del_cb_set. + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user stops the diskselector with this item on center + * position. If such function isn't needed, just passing @c null as @c func is + * enough. The same should be done for @c data. + * + * See also @ref elm_object_item_del, @ref elm_obj_diskselector_clear, @ref + * elm_icon_add. + * + * @param[in] obj The object. + * @param[in] label The label of the diskselector item. + * @param[in] icon The icon object to use at left side of the item. An icon can + * be any Evas object, but usually it is an icon created with elm_icon_add(). + * @param[in] func The function to call when the item is selected. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return New item + * + * @ingroup Elm_Diskselector + */ +EOAPI Elm_Widget_Item *elm_obj_diskselector_item_append(Eo *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +/** + * @brief Remove all diskselector's items. + * + * See also @ref elm_object_item_del, @ref elm_obj_diskselector_item_append. + * @param[in] obj The object. + * + * @ingroup Elm_Diskselector + */ +EOAPI void elm_obj_diskselector_clear(Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_diskselector_eo.legacy.c b/src/lib/elementary/elm_diskselector_eo.legacy.c new file mode 100644 index 0000000000..eb4c1d92b9 --- /dev/null +++ b/src/lib/elementary/elm_diskselector_eo.legacy.c @@ -0,0 +1,72 @@ + +EAPI void +elm_diskselector_side_text_max_length_set(Elm_Diskselector *obj, int len) +{ + elm_obj_diskselector_side_text_max_length_set(obj, len); +} + +EAPI int +elm_diskselector_side_text_max_length_get(const Elm_Diskselector *obj) +{ + return elm_obj_diskselector_side_text_max_length_get(obj); +} + +EAPI void +elm_diskselector_round_enabled_set(Elm_Diskselector *obj, Eina_Bool enabled) +{ + elm_obj_diskselector_round_enabled_set(obj, enabled); +} + +EAPI Eina_Bool +elm_diskselector_round_enabled_get(const Elm_Diskselector *obj) +{ + return elm_obj_diskselector_round_enabled_get(obj); +} + +EAPI void +elm_diskselector_display_item_num_set(Elm_Diskselector *obj, int num) +{ + elm_obj_diskselector_display_item_num_set(obj, num); +} + +EAPI int +elm_diskselector_display_item_num_get(const Elm_Diskselector *obj) +{ + return elm_obj_diskselector_display_item_num_get(obj); +} + +EAPI Elm_Widget_Item * +elm_diskselector_first_item_get(const Elm_Diskselector *obj) +{ + return elm_obj_diskselector_first_item_get(obj); +} + +EAPI const Eina_List * +elm_diskselector_items_get(const Elm_Diskselector *obj) +{ + return elm_obj_diskselector_items_get(obj); +} + +EAPI Elm_Widget_Item * +elm_diskselector_last_item_get(const Elm_Diskselector *obj) +{ + return elm_obj_diskselector_last_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_diskselector_selected_item_get(const Elm_Diskselector *obj) +{ + return elm_obj_diskselector_selected_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_diskselector_item_append(Elm_Diskselector *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_diskselector_item_append(obj, label, icon, func, data); +} + +EAPI void +elm_diskselector_clear(Elm_Diskselector *obj) +{ + elm_obj_diskselector_clear(obj); +} diff --git a/src/lib/elementary/elm_diskselector_eo.legacy.h b/src/lib/elementary/elm_diskselector_eo.legacy.h new file mode 100644 index 0000000000..0f888488eb --- /dev/null +++ b/src/lib/elementary/elm_diskselector_eo.legacy.h @@ -0,0 +1,223 @@ +#ifndef _ELM_DISKSELECTOR_EO_LEGACY_H_ +#define _ELM_DISKSELECTOR_EO_LEGACY_H_ + +#ifndef _ELM_DISKSELECTOR_EO_CLASS_TYPE +#define _ELM_DISKSELECTOR_EO_CLASS_TYPE + +typedef Eo Elm_Diskselector; + +#endif + +#ifndef _ELM_DISKSELECTOR_EO_TYPES +#define _ELM_DISKSELECTOR_EO_TYPES + + +#endif + +/** + * @brief Set the side labels max length. + * + * Length is the number of characters of items' label that will be visible when + * it's set on side positions. It will just crop the string after defined size. + * E.g.: + * + * An item with label "January" would be displayed on side position as "Jan" if + * max length is set to 3, or "Janu", if this property is set to 4. + * + * When it's selected, the entire label will be displayed, except for width + * restrictions. In this case label will be cropped and "..." will be + * concatenated. + * + * Default side label max length is 3. + * + * This property will be applied over all items, included before or later this + * function call. + * + * @param[in] obj The object. + * @param[in] len The max length defined for side labels. + * + * @ingroup Elm_Diskselector_Group + */ +EAPI void elm_diskselector_side_text_max_length_set(Elm_Diskselector *obj, int len); + +/** + * @brief Get the side labels max length. + * + * See also @ref elm_diskselector_side_text_max_length_set for details. + * + * @param[in] obj The object. + * + * @return The max length defined for side labels. + * + * @ingroup Elm_Diskselector_Group + */ +EAPI int elm_diskselector_side_text_max_length_get(const Elm_Diskselector *obj); + +/** + * @brief Enable or disable round mode. + * + * Disabled by default. If round mode is enabled the items list will work like + * a circular list, so when the user reaches the last item, the first one will + * popup. + * + * See also @ref elm_diskselector_round_enabled_get. + * + * @param[in] obj The object. + * @param[in] enabled @c true to enable round mode or @c false to disable it. + * + * @ingroup Elm_Diskselector_Group + */ +EAPI void elm_diskselector_round_enabled_set(Elm_Diskselector *obj, Eina_Bool enabled); + +/** + * @brief Get a value whether round mode is enabled or not. + * + * See also @ref elm_diskselector_round_enabled_set for details. + * + * @param[in] obj The object. + * + * @return @c true to enable round mode or @c false to disable it. + * + * @ingroup Elm_Diskselector_Group + */ +EAPI Eina_Bool elm_diskselector_round_enabled_get(const Elm_Diskselector *obj); + +/** + * @brief Set the number of items to be displayed. + * + * Default value is 3, and also it's the minimum. If @c num is less than 3, it + * will be set to 3. + * + * Also, it can be set on theme, using data item @c display_item_num on group + * "elm/diskselector/item/X", where X is style set. + * + * @param[in] obj The object. + * @param[in] num The number of items the diskselector will display. + * + * @ingroup Elm_Diskselector_Group + */ +EAPI void elm_diskselector_display_item_num_set(Elm_Diskselector *obj, int num); + +/** + * @brief Get the number of items in the diskselector object. + * + * @param[in] obj The object. + * + * @return The number of items the diskselector will display. + * + * @ingroup Elm_Diskselector_Group + */ +EAPI int elm_diskselector_display_item_num_get(const Elm_Diskselector *obj); + +/** + * @brief Get the first item of the diskselector. + * + * The list of items follows append order. So it will return the first item + * appended to the widget that wasn't deleted. + * + * See also @ref elm_diskselector_item_append, @ref elm_diskselector_items_get. + * + * @param[in] obj The object. + * + * @return The first item, or @c null if none. + * + * @ingroup Elm_Diskselector_Group + */ +EAPI Elm_Widget_Item *elm_diskselector_first_item_get(const Elm_Diskselector *obj); + +/** + * @brief Get a list of all the diskselector items. + * + * See also @ref elm_diskselector_item_append, @ref elm_object_item_del, + * @ref elm_diskselector_clear. + * + * @param[in] obj The object. + * + * @return A @c list of diskselector items, or @c ull on failure. + * + * @ingroup Elm_Diskselector_Group + */ +EAPI const Eina_List *elm_diskselector_items_get(const Elm_Diskselector *obj); + +/** + * @brief Get the last item of the diskselector. + * + * The list of items follows append order. So it will return last first item + * appended to the widget that wasn't deleted. + * + * See also @ref elm_diskselector_item_append, @ref elm_diskselector_items_get. + * + * @param[in] obj The object. + * + * @return The last item, or @c null if none. + * + * @ingroup Elm_Diskselector_Group + */ +EAPI Elm_Widget_Item *elm_diskselector_last_item_get(const Elm_Diskselector *obj); + +/** + * @brief Get the selected item. + * + * The selected item can be unselected with + * @ref elm_diskselector_item_selected_set, and the first item of diskselector + * will be selected. + * + * The selected item always will be centered on diskselector, with full label + * displayed, i.e., max length set to side labels won't apply on the selected + * item. More details on @ref elm_diskselector_side_text_max_length_set. + * + * @param[in] obj The object. + * + * @return The selected diskselector item. + * + * @ingroup Elm_Diskselector_Group + */ +EAPI Elm_Widget_Item *elm_diskselector_selected_item_get(const Elm_Diskselector *obj); + +/** + * @brief Appends a new item to the diskselector object. + * + * A new item will be created and appended to the diskselector, i.e., will be + * set as last item. Also, if there is no selected item, it will be selected. + * This will always happens for the first appended item. + * + * If no icon is set, label will be centered on item position, otherwise the + * icon will be placed at left of the label, that will be shifted to the right. + * + * Items created with this method can be deleted with @ref elm_object_item_del. + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with @ref elm_object_item_del_cb_set. + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user stops the diskselector with this item on center + * position. If such function isn't needed, just passing @c null as @c func is + * enough. The same should be done for @c data. + * + * See also @ref elm_object_item_del, @ref elm_diskselector_clear, @ref + * elm_icon_add. + * + * @param[in] obj The object. + * @param[in] label The label of the diskselector item. + * @param[in] icon The icon object to use at left side of the item. An icon can + * be any Evas object, but usually it is an icon created with elm_icon_add(). + * @param[in] func The function to call when the item is selected. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return New item + * + * @ingroup Elm_Diskselector_Group + */ +EAPI Elm_Widget_Item *elm_diskselector_item_append(Elm_Diskselector *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +/** + * @brief Remove all diskselector's items. + * + * See also @ref elm_object_item_del, @ref elm_diskselector_item_append. + * @param[in] obj The object. + * + * @ingroup Elm_Diskselector_Group + */ +EAPI void elm_diskselector_clear(Elm_Diskselector *obj); + +#endif diff --git a/src/lib/elementary/elm_diskselector_item.eo b/src/lib/elementary/elm_diskselector_item.eo deleted file mode 100644 index 7653061255..0000000000 --- a/src/lib/elementary/elm_diskselector_item.eo +++ /dev/null @@ -1,90 +0,0 @@ -class Elm.Diskselector.Item extends Elm.Widget.Item implements Efl.Ui.Legacy -{ - [[Elementary diskselector item class]] - legacy_prefix: elm_diskselector_item; - eo_prefix: elm_obj_diskselector_item; - methods { - @property prev { - get { - [[Get the item before $item in diskselector. - - The list of items follows append order. So it will return item appended - just before $item and that wasn't deleted. - - If it is the first item, $null will be returned. - First item can be get by \@ref elm_diskselector_first_item_get. - - See also \@ref elm_diskselector_item_append, - \@ref elm_diskselector_items_get. - ]] - } - values { - item: Elm.Widget.Item; [[The item before $item, or $null if none or on failure.]] - } - } - @property next { - get { - [[Get the item after $item in diskselector. - - The list of items follows append order. So it will return item appended - just after $item and that wasn't deleted. - - If it is the last item, $null will be returned. - Last item can be get by \@ref elm_diskselector_last_item_get. - - See also \@ref elm_diskselector_item_append, - \@ref elm_diskselector_items_get. - ]] - } - values { - item: Elm.Widget.Item; [[The item after $item, or $null if none or on failure.]] - } - } - @property selected { - get { - [[Get whether the $item is selected or not. - - See also \@ref elm_diskselector_selected_item_set for details, - \@ref elm_diskselector_item_selected_get. - ]] - } - set { - [[Set the selected state of an item. - - This sets the selected state of the given $item as $true, - for selected and $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 elm_diskselector_selected_item_get. - - If the $item is unselected, the first item of diskselector will - be selected. - - Selected items will be visible on center position of diskselector. - So if it was on another position before selected, or was invisible, - diskselector will animate items until the selected item reaches center - position. - - See also \@ref elm_diskselector_item_selected_get, - \@ref elm_diskselector_selected_item_get. - ]] - } - values { - selected: bool; [[The selected state]] - } - } - /* init { FIXME - params { - Evas_Smart_Cb func; - const(void_ptr) data; - } - }*/ - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Elm.Widget.Item.part_text { get; set; } - Elm.Widget.Item.part_content { get; set; } - } -} diff --git a/src/lib/elementary/elm_diskselector_item_eo.c b/src/lib/elementary/elm_diskselector_item_eo.c new file mode 100644 index 0000000000..7b58d2c15e --- /dev/null +++ b/src/lib/elementary/elm_diskselector_item_eo.c @@ -0,0 +1,109 @@ + +Elm_Widget_Item *_elm_diskselector_item_prev_get(const Eo *obj, Elm_Diskselector_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_diskselector_item_prev_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_diskselector_item_next_get(const Eo *obj, Elm_Diskselector_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_diskselector_item_next_get, Elm_Widget_Item *, NULL); + +void _elm_diskselector_item_selected_set(Eo *obj, Elm_Diskselector_Item_Data *pd, Eina_Bool selected); + + +static Eina_Error +__eolian_elm_diskselector_item_selected_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_diskselector_item_selected_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_diskselector_item_selected_set, EFL_FUNC_CALL(selected), Eina_Bool selected); + +Eina_Bool _elm_diskselector_item_selected_get(const Eo *obj, Elm_Diskselector_Item_Data *pd); + + +static Eina_Value +__eolian_elm_diskselector_item_selected_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_diskselector_item_selected_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_diskselector_item_selected_get, Eina_Bool, 0); + +Efl_Object *_elm_diskselector_item_efl_object_constructor(Eo *obj, Elm_Diskselector_Item_Data *pd); + + +void _elm_diskselector_item_efl_object_destructor(Eo *obj, Elm_Diskselector_Item_Data *pd); + + +void _elm_diskselector_item_elm_widget_item_part_text_set(Eo *obj, Elm_Diskselector_Item_Data *pd, const char *part, const char *label); + + +const char *_elm_diskselector_item_elm_widget_item_part_text_get(const Eo *obj, Elm_Diskselector_Item_Data *pd, const char *part); + + +void _elm_diskselector_item_elm_widget_item_part_content_set(Eo *obj, Elm_Diskselector_Item_Data *pd, const char *part, Efl_Canvas_Object *content); + + +Efl_Canvas_Object *_elm_diskselector_item_elm_widget_item_part_content_get(const Eo *obj, Elm_Diskselector_Item_Data *pd, const char *part); + + +static Eina_Bool +_elm_diskselector_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_DISKSELECTOR_ITEM_EXTRA_OPS +#define ELM_DISKSELECTOR_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_diskselector_item_prev_get, _elm_diskselector_item_prev_get), + EFL_OBJECT_OP_FUNC(elm_obj_diskselector_item_next_get, _elm_diskselector_item_next_get), + EFL_OBJECT_OP_FUNC(elm_obj_diskselector_item_selected_set, _elm_diskselector_item_selected_set), + EFL_OBJECT_OP_FUNC(elm_obj_diskselector_item_selected_get, _elm_diskselector_item_selected_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_diskselector_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_diskselector_item_efl_object_destructor), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_set, _elm_diskselector_item_elm_widget_item_part_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_get, _elm_diskselector_item_elm_widget_item_part_text_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_set, _elm_diskselector_item_elm_widget_item_part_content_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_get, _elm_diskselector_item_elm_widget_item_part_content_get), + ELM_DISKSELECTOR_ITEM_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"selected", __eolian_elm_diskselector_item_selected_set_reflect, __eolian_elm_diskselector_item_selected_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_diskselector_item_class_desc = { + EO_VERSION, + "Elm.Diskselector.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Diskselector_Item_Data), + _elm_diskselector_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_diskselector_item_class_get, &_elm_diskselector_item_class_desc, ELM_WIDGET_ITEM_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_diskselector_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_diskselector_item_eo.h b/src/lib/elementary/elm_diskselector_item_eo.h new file mode 100644 index 0000000000..d322b4630a --- /dev/null +++ b/src/lib/elementary/elm_diskselector_item_eo.h @@ -0,0 +1,103 @@ +#ifndef _ELM_DISKSELECTOR_ITEM_EO_H_ +#define _ELM_DISKSELECTOR_ITEM_EO_H_ + +#ifndef _ELM_DISKSELECTOR_ITEM_EO_CLASS_TYPE +#define _ELM_DISKSELECTOR_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Diskselector_Item; + +#endif + +#ifndef _ELM_DISKSELECTOR_ITEM_EO_TYPES +#define _ELM_DISKSELECTOR_ITEM_EO_TYPES + + +#endif +/** Elementary diskselector item class + * + * @ingroup Elm_Diskselector_Item + */ +#define ELM_DISKSELECTOR_ITEM_CLASS elm_diskselector_item_class_get() + +EWAPI const Efl_Class *elm_diskselector_item_class_get(void); + +/** + * @brief Get the item before @c item in diskselector. + * + * The list of items follows append order. So it will return item appended just + * before @c item and that wasn't deleted. + * + * If it is the first item, @c null will be returned. First item can be get by + * @ref elm_diskselector_first_item_get. + * + * See also @ref elm_diskselector_item_append, @ref elm_diskselector_items_get. + * + * @param[in] obj The object. + * + * @return The item before @c item, or @c null if none or on failure. + * + * @ingroup Elm_Diskselector_Item + */ +EOAPI Elm_Widget_Item *elm_obj_diskselector_item_prev_get(const Eo *obj); + +/** + * @brief Get the item after @c item in diskselector. + * + * The list of items follows append order. So it will return item appended just + * after @c item and that wasn't deleted. + * + * If it is the last item, @c null will be returned. Last item can be get by + * @ref elm_diskselector_last_item_get. + * + * See also @ref elm_diskselector_item_append, @ref elm_diskselector_items_get. + * + * @param[in] obj The object. + * + * @return The item after @c item, or @c null if none or on failure. + * + * @ingroup Elm_Diskselector_Item + */ +EOAPI Elm_Widget_Item *elm_obj_diskselector_item_next_get(const Eo *obj); + +/** + * @brief Set the selected state of an item. + * + * This sets the selected state of the given @c item as @c true, for selected + * and @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 + * elm_diskselector_selected_item_get. + * + * If the @c item is unselected, the first item of diskselector will be + * selected. + * + * Selected items will be visible on center position of diskselector. So if it + * was on another position before selected, or was invisible, diskselector will + * animate items until the selected item reaches center position. + * + * See also @ref elm_diskselector_item_selected_get, @ref + * elm_diskselector_selected_item_get. + * + * @param[in] obj The object. + * @param[in] selected The selected state + * + * @ingroup Elm_Diskselector_Item + */ +EOAPI void elm_obj_diskselector_item_selected_set(Eo *obj, Eina_Bool selected); + +/** + * @brief Get whether the @c item is selected or not. + * + * See also @ref elm_diskselector_selected_item_set for details, @ref + * elm_diskselector_item_selected_get. + * + * @param[in] obj The object. + * + * @return The selected state + * + * @ingroup Elm_Diskselector_Item + */ +EOAPI Eina_Bool elm_obj_diskselector_item_selected_get(const Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_diskselector_item_eo.legacy.c b/src/lib/elementary/elm_diskselector_item_eo.legacy.c new file mode 100644 index 0000000000..f12cc63d8a --- /dev/null +++ b/src/lib/elementary/elm_diskselector_item_eo.legacy.c @@ -0,0 +1,24 @@ + +EAPI Elm_Widget_Item * +elm_diskselector_item_prev_get(const Elm_Diskselector_Item *obj) +{ + return elm_obj_diskselector_item_prev_get(obj); +} + +EAPI Elm_Widget_Item * +elm_diskselector_item_next_get(const Elm_Diskselector_Item *obj) +{ + return elm_obj_diskselector_item_next_get(obj); +} + +EAPI void +elm_diskselector_item_selected_set(Elm_Diskselector_Item *obj, Eina_Bool selected) +{ + elm_obj_diskselector_item_selected_set(obj, selected); +} + +EAPI Eina_Bool +elm_diskselector_item_selected_get(const Elm_Diskselector_Item *obj) +{ + return elm_obj_diskselector_item_selected_get(obj); +} diff --git a/src/lib/elementary/elm_diskselector_item_eo.legacy.h b/src/lib/elementary/elm_diskselector_item_eo.legacy.h new file mode 100644 index 0000000000..680cb58549 --- /dev/null +++ b/src/lib/elementary/elm_diskselector_item_eo.legacy.h @@ -0,0 +1,96 @@ +#ifndef _ELM_DISKSELECTOR_ITEM_EO_LEGACY_H_ +#define _ELM_DISKSELECTOR_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_DISKSELECTOR_ITEM_EO_CLASS_TYPE +#define _ELM_DISKSELECTOR_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Diskselector_Item; + +#endif + +#ifndef _ELM_DISKSELECTOR_ITEM_EO_TYPES +#define _ELM_DISKSELECTOR_ITEM_EO_TYPES + + +#endif + +/** + * @brief Get the item before @c item in diskselector. + * + * The list of items follows append order. So it will return item appended just + * before @c item and that wasn't deleted. + * + * If it is the first item, @c null will be returned. First item can be get by + * @ref elm_diskselector_first_item_get. + * + * See also @ref elm_diskselector_item_append, @ref elm_diskselector_items_get. + * + * @param[in] obj The object. + * + * @return The item before @c item, or @c null if none or on failure. + * + * @ingroup Elm_Diskselector_Item_Group + */ +EAPI Elm_Widget_Item *elm_diskselector_item_prev_get(const Elm_Diskselector_Item *obj); + +/** + * @brief Get the item after @c item in diskselector. + * + * The list of items follows append order. So it will return item appended just + * after @c item and that wasn't deleted. + * + * If it is the last item, @c null will be returned. Last item can be get by + * @ref elm_diskselector_last_item_get. + * + * See also @ref elm_diskselector_item_append, @ref elm_diskselector_items_get. + * + * @param[in] obj The object. + * + * @return The item after @c item, or @c null if none or on failure. + * + * @ingroup Elm_Diskselector_Item_Group + */ +EAPI Elm_Widget_Item *elm_diskselector_item_next_get(const Elm_Diskselector_Item *obj); + +/** + * @brief Set the selected state of an item. + * + * This sets the selected state of the given @c item as @c true, for selected + * and @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 + * elm_diskselector_selected_item_get. + * + * If the @c item is unselected, the first item of diskselector will be + * selected. + * + * Selected items will be visible on center position of diskselector. So if it + * was on another position before selected, or was invisible, diskselector will + * animate items until the selected item reaches center position. + * + * See also @ref elm_diskselector_item_selected_get, @ref + * elm_diskselector_selected_item_get. + * + * @param[in] obj The object. + * @param[in] selected The selected state + * + * @ingroup Elm_Diskselector_Item_Group + */ +EAPI void elm_diskselector_item_selected_set(Elm_Diskselector_Item *obj, Eina_Bool selected); + +/** + * @brief Get whether the @c item is selected or not. + * + * See also @ref elm_diskselector_selected_item_set for details, @ref + * elm_diskselector_item_selected_get. + * + * @param[in] obj The object. + * + * @return The selected state + * + * @ingroup Elm_Diskselector_Item_Group + */ +EAPI Eina_Bool elm_diskselector_item_selected_get(const Elm_Diskselector_Item *obj); + +#endif diff --git a/src/lib/elementary/elm_diskselector_legacy.h b/src/lib/elementary/elm_diskselector_legacy.h index 7ee5080a28..8f34c06332 100644 --- a/src/lib/elementary/elm_diskselector_legacy.h +++ b/src/lib/elementary/elm_diskselector_legacy.h @@ -11,5 +11,5 @@ */ EAPI Evas_Object *elm_diskselector_add(Evas_Object *parent); -#include "elm_diskselector_item.eo.legacy.h" -#include "elm_diskselector.eo.legacy.h" +#include "elm_diskselector_item_eo.legacy.h" +#include "elm_diskselector_eo.legacy.h" diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c index 8661778d09..7478a40fd8 100644 --- a/src/lib/elementary/elm_entry.c +++ b/src/lib/elementary/elm_entry.c @@ -19,7 +19,7 @@ #include "elm_entry_part.eo.h" #include "elm_part_helper.h" -#include "elm_hoversel.eo.h" +#include "elm_hoversel_eo.h" #define MY_CLASS ELM_ENTRY_CLASS #define MY_CLASS_PFX elm_entry @@ -138,16 +138,14 @@ ok: // ok - return api } static char * -_file_load(const char *file) +_file_load(Eo *obj) { Eina_File *f; char *text = NULL; void *tmp = NULL; size_t size; - f = eina_file_open(file, EINA_FALSE); - if (!f) return NULL; - + f = eina_file_dup(efl_file_mmap_get(obj)); size = eina_file_size_get(f); if (size) { @@ -175,11 +173,11 @@ _file_load(const char *file) } static char * -_plain_load(const char *file) +_plain_load(Eo *obj) { char *text; - text = _file_load(file); + text = _file_load(obj); if (text) { char *text2; @@ -192,47 +190,55 @@ _plain_load(const char *file) return NULL; } -static Eina_Bool +static Eina_Error _load_do(Evas_Object *obj) { char *text; + Eina_Bool fail = EINA_FALSE; + Eina_Error err = 0; ELM_ENTRY_DATA_GET(obj, sd); if (!sd->file) { elm_object_text_set(obj, ""); - return EINA_TRUE; + return 0; } switch (sd->format) { case ELM_TEXT_FORMAT_PLAIN_UTF8: - text = _plain_load(sd->file); + text = _plain_load(obj); + fail = !text; break; case ELM_TEXT_FORMAT_MARKUP_UTF8: - text = _file_load(sd->file); + text = _file_load(obj); + fail = !text; break; default: text = NULL; + err = EINVAL; break; } + if (fail) + { + err = errno; + /* FIXME: this is more like a hint but not totally accurate... */ + if (!err) err = ENOENT; + } if (text) { elm_object_text_set(obj, text); free(text); - return EINA_TRUE; + return 0; } - else - { - elm_object_text_set(obj, ""); + elm_object_text_set(obj, ""); - return EINA_FALSE; - } + return err; } static void @@ -278,7 +284,7 @@ _save_do(Evas_Object *obj) { ELM_ENTRY_DATA_GET(obj, sd); - if (!sd->file) return; + if (!efl_file_loaded_get(obj)) return; switch (sd->format) { case ELM_TEXT_FORMAT_PLAIN_UTF8: @@ -800,11 +806,25 @@ _get_drop_format(Evas_Object *obj) return ELM_SEL_FORMAT_MARKUP; } -/* we can't reuse layout's here, because it's on entry_edje only */ -EOLIAN static Eina_Bool -_elm_entry_efl_ui_widget_on_disabled_update(Eo *obj, Elm_Entry_Data *sd, Eina_Bool disabled) +static void +_flush_disabled_state(Eo *obj, Elm_Entry_Data *sd) { const char *emission; + emission = efl_ui_widget_disabled_get(obj) ? "elm,state,disabled" : "elm,state,enabled"; + edje_object_signal_emit(sd->entry_edje, emission, "elm"); + if (sd->scroll) + { + edje_object_signal_emit(sd->scr_edje, emission, "elm"); + elm_interface_scrollable_freeze_set(obj, efl_ui_widget_disabled_get(obj)); + } +} + +/* we can't reuse layout's here, because it's on entry_edje only */ +EOLIAN static void +_elm_entry_efl_ui_widget_disabled_set(Eo *obj, Elm_Entry_Data *sd, Eina_Bool disabled) +{ + + efl_ui_widget_disabled_set(efl_super(obj, MY_CLASS), disabled); elm_drop_target_del(obj, sd->drop_format, _dnd_enter_cb, NULL, @@ -812,16 +832,10 @@ _elm_entry_efl_ui_widget_on_disabled_update(Eo *obj, Elm_Entry_Data *sd, Eina_Bo _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"); - if (sd->scroll) - { - edje_object_signal_emit(sd->scr_edje, emission, "elm"); - elm_interface_scrollable_freeze_set(obj, disabled); - } - sd->disabled = disabled; + _flush_disabled_state(obj, sd); + sd->disabled = efl_ui_widget_disabled_get(obj); - if (!disabled) + if (!efl_ui_widget_disabled_get(obj)) { sd->drop_format = _get_drop_format(obj); elm_drop_target_add(obj, sd->drop_format, @@ -830,8 +844,6 @@ _elm_entry_efl_ui_widget_on_disabled_update(Eo *obj, Elm_Entry_Data *sd, Eina_Bo _dnd_pos_cb, NULL, _dnd_drop_cb, NULL); } - - return EINA_TRUE; } /* It gets the background object from from_edje object and @@ -861,22 +873,22 @@ _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_Result +EOLIAN static Eina_Error _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_Result theme_apply; + Eina_Error theme_apply; int cursor_pos; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); // 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, EFL_UI_WIDGET_CLASS)); - if (!theme_apply) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (theme_apply == EFL_UI_THEME_APPLY_ERROR_GENERIC) return EFL_UI_THEME_APPLY_ERROR_GENERIC; evas_event_freeze(evas_object_evas_get(obj)); @@ -963,14 +975,14 @@ _elm_entry_efl_ui_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd) if (sd->scroll) { - Efl_Ui_Theme_Apply_Result ok = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error err = EFL_UI_THEME_APPLY_ERROR_GENERIC; efl_ui_mirrored_set(obj, efl_ui_mirrored_get(obj)); if (sd->single_line) - ok = elm_widget_theme_object_set + err = elm_widget_theme_object_set (obj, sd->scr_edje, "scroller", "entry_single", style); - if (!ok) + if (err) elm_widget_theme_object_set (obj, sd->scr_edje, "scroller", "entry", style); @@ -1017,6 +1029,8 @@ _elm_entry_efl_ui_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd) evas_object_unref(obj); + _flush_disabled_state(obj, sd); + return theme_apply; } @@ -1285,7 +1299,7 @@ _elm_entry_focus_update(Eo *obj, Elm_Entry_Data *sd) !edje_object_part_text_imf_context_get(sd->entry_edje, "elm.text")) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_FOCUSED, EINA_TRUE); + efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_TYPE_FOCUSED, EINA_TRUE); _return_key_enabled_check(obj); _validate(obj); } @@ -1299,7 +1313,7 @@ _elm_entry_focus_update(Eo *obj, Elm_Entry_Data *sd) !edje_object_part_text_imf_context_get(sd->entry_edje, "elm.text")) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_FOCUSED, EINA_FALSE); + efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_TYPE_FOCUSED, EINA_FALSE); if (_elm_config->selection_clear_enable) { @@ -1877,9 +1891,8 @@ _magnifier_move(void *data) cx += ex; cy += ey; - //Move the Magnifier + // calculate the position of the magnifier edje_object_parts_extends_calc(sd->mgf_bg, &x, &y, &w, &h); - evas_object_move(sd->mgf_bg, cx - x - (w / 2), cy - y - h); mx = cx - x - (w / 2); my = cy - y - h; @@ -1906,9 +1919,11 @@ _magnifier_move(void *data) my = 0; if (my + mh > wh) my = wh - mh; - evas_object_move(sd->mgf_bg, mx, my); } + // move the magnifier to the proper position + evas_object_move(sd->mgf_bg, mx, my); + //Set the Proxy Render Area evas_object_geometry_get(data, &x, &y, &w, &h); evas_object_geometry_get(sd->mgf_proxy, &px, &py, &pw, &ph); @@ -2231,14 +2246,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_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_INSERTED, &atspi_info); + efl_access_object_event_emit( 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_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_REMOVED, &atspi_info); + efl_access_object_event_emit( data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_REMOVED, &atspi_info); } } } @@ -2263,7 +2278,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_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, + efl_access_object_event_emit( data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_INSERTED, &atspi_info); @@ -2355,7 +2370,7 @@ _entry_selection_changed_signal_cb(void *data, _selection_store(ELM_SEL_TYPE_PRIMARY, data); _update_selection_handler(data); if (_elm_config->atspi_mode) - efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_SELECTION_CHANGED, NULL); + efl_access_object_event_emit( data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_SELECTION_CHANGED, NULL); } static void @@ -2466,7 +2481,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_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL); + efl_access_object_event_emit( data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL); } static void @@ -2478,7 +2493,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_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL); + efl_access_object_event_emit( data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL); } static void @@ -2841,8 +2856,8 @@ _item_get(void *data, } o = edje_object_add(evas_object_evas_get(data)); - if (!_elm_theme_object_set - (data, o, "entry", item, style)) + if (_elm_theme_object_set + (data, o, "entry", item, style) == EFL_UI_THEME_APPLY_ERROR_GENERIC) _elm_theme_object_set (data, o, "entry/emoticon", "wtf", style); return o; @@ -2853,18 +2868,20 @@ _entry_has_new_line(const char *text) { if (!text) return EINA_FALSE; - while (*text) - { - if (!strncmp(text, "' || ((text[4] == '/') && (text[5] == '>'))) - { - return EINA_TRUE; - } - } - text++; - } + const char * pTemp = text; + while ((pTemp = strchr(pTemp, '<'))) + { + pTemp++; + if (!strncmp(pTemp, "br", 2) || !strncmp(pTemp, "ps", 2)) + { + pTemp += 2; + if (pTemp[0] != '\0' && (pTemp[0] == '>' || (pTemp[0] == '/' && pTemp[1] == '>'))) + { + return EINA_TRUE; + } + } + } return EINA_FALSE; } @@ -3140,26 +3157,30 @@ _elm_entry_efl_layout_signal_signal_emit(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd } } -EOLIAN static Eina_Bool -_elm_entry_efl_layout_signal_signal_callback_add(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data) +static Eina_Bool +_elm_entry_efl_layout_signal_signal_callback_add(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, + const char *emission, const char *source, + void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb) { Eina_Bool ok; - ok = efl_layout_signal_callback_add(sd->entry_edje, emission, source, func_cb, data); + ok = efl_layout_signal_callback_add(sd->entry_edje, emission, source, func_data, func, func_free_cb); if (sd->scr_edje) - ok = efl_layout_signal_callback_add(sd->scr_edje, emission, source, func_cb, data); + ok = efl_layout_signal_callback_add(sd->scr_edje, emission, source, func_data, func, func_free_cb); return ok; } -EOLIAN static Eina_Bool -_elm_entry_efl_layout_signal_signal_callback_del(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data) +static Eina_Bool +_elm_entry_efl_layout_signal_signal_callback_del(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, + const char *emission, const char *source, + void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb) { Eina_Bool ok; - ok = efl_layout_signal_callback_del(sd->entry_edje, emission, source, func_cb, data); + ok = efl_layout_signal_callback_del(sd->entry_edje, emission, source, func_data, func, func_free_cb); if (sd->scr_edje) - ok = efl_layout_signal_callback_del(sd->scr_edje, emission, source, func_cb, data); + ok = efl_layout_signal_callback_del(sd->scr_edje, emission, source, func_data, func, func_free_cb); return ok; } @@ -3177,7 +3198,7 @@ _elm_entry_signal_callback_add_legacy(Eo *obj, const char *emission, const char emission, source, func_cb, data); if (sd->scr_edje) - efl_layout_signal_callback_add(sd->scr_edje, emission, source, func_cb, data); + efl_layout_signal_callback_add(sd->scr_edje, emission, source, data, func_cb, NULL); } void * @@ -3193,7 +3214,7 @@ _elm_entry_signal_callback_del_legacy(Eo *obj, const char *emission, const char emission, source, func_cb); if (sd->scr_edje) - efl_layout_signal_callback_del(sd->scr_edje, emission, source, func_cb, data); + efl_layout_signal_callback_del(sd->scr_edje, emission, source, data, func_cb, NULL); return data; } @@ -3764,7 +3785,6 @@ _elm_entry_efl_canvas_group_group_add(Eo *obj, Elm_Entry_Data *priv) if (!elm_widget_theme_klass_get(obj)) elm_widget_theme_klass_set(obj, "entry"); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->entry_edje = wd->resize_obj; @@ -3782,10 +3802,10 @@ _elm_entry_efl_canvas_group_group_add(Eo *obj, Elm_Entry_Data *priv) _dnd_pos_cb, NULL, _dnd_drop_cb, NULL); - if (!elm_widget_theme_object_set(obj, wd->resize_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))) + elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) CRI("Failed to set layout!"); priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj)); @@ -4963,26 +4983,51 @@ _elm_entry_file_text_format_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Elm_Tex EAPI Eina_Bool elm_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format) { - Eina_Bool ret; + Eina_Bool ret = EINA_FALSE; + ELM_ENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, ret); + ELM_SAFE_FREE(sd->delay_write, ecore_timer_del); + if (sd->auto_save) _save_do(obj); elm_obj_entry_file_text_format_set(obj, format); - ret = efl_file_set(obj, file, NULL); + sd->file_setting = EINA_TRUE; + ret = efl_file_simple_load(obj, file, NULL); + sd->file_setting = EINA_FALSE; return ret; } -EOLIAN static Eina_Bool -_elm_entry_efl_file_file_set(Eo *obj, Elm_Entry_Data *sd, const char *file, const char *group EINA_UNUSED) +EOLIAN static void +_elm_entry_efl_file_unload(Eo *obj, Elm_Entry_Data *sd EINA_UNUSED) { - ELM_SAFE_FREE(sd->delay_write, ecore_timer_del); - if (sd->auto_save) _save_do(obj); + elm_object_text_set(obj, ""); + efl_file_unload(efl_super(obj, MY_CLASS)); +} + +EOLIAN static Eina_Error +_elm_entry_efl_file_load(Eo *obj, Elm_Entry_Data *sd) +{ + Eina_Error err; + + if (!sd->file_setting) + CRI("EO methods should not be used directly on legacy objects!"); + + if (efl_file_loaded_get(obj)) return 0; + err = efl_file_load(efl_super(obj, MY_CLASS)); + if (err) return err; + return _load_do(obj); +} + +EOLIAN static Eina_Error +_elm_entry_efl_file_file_set(Eo *obj, Elm_Entry_Data *sd, const char *file) +{ + if (!sd->file_setting) + CRI("EO methods should not be used directly on legacy objects!"); eina_stringshare_replace(&sd->file, file); - Eina_Bool int_ret = _load_do(obj); - return int_ret; + return efl_file_set(efl_super(obj, MY_CLASS), file); } EAPI void elm_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *format) { - efl_file_get(obj, file, NULL); + if (file) *file = efl_file_get(obj); if (format) { ELM_ENTRY_DATA_GET(obj, sd); @@ -4991,13 +5036,6 @@ elm_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *f } } -EOLIAN static void -_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; -} - EOLIAN static void _elm_entry_file_save(Eo *obj, Elm_Entry_Data *sd) { @@ -6139,7 +6177,7 @@ _elm_entry_efl_access_object_state_set_get(const Eo *obj, Elm_Entry_Data *_pd EI 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); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_EDITABLE); return ret; } @@ -6210,4 +6248,4 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX) ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX), \ ELM_LAYOUT_SIZING_EVAL_OPS(elm_entry) -#include "elm_entry.eo.c" +#include "elm_entry_eo.c" diff --git a/src/lib/elementary/elm_entry.eo b/src/lib/elementary/elm_entry.eo deleted file mode 100644 index f2e5e3b59a..0000000000 --- a/src/lib/elementary/elm_entry.eo +++ /dev/null @@ -1,927 +0,0 @@ -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 extends Efl.Ui.Layout implements 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.Legacy -{ - [[Elementary entry class]] - legacy_prefix: elm_entry; - eo_prefix: elm_obj_entry; - event_prefix: elm_entry; - methods { - @property scrollable { - set { - [[Enable or disable scrolling in entry - - Normally the entry is not scrollable unless you enable it with this call. - ]] - } - get { - [[Get the scrollable state of the entry - - Normally the entry is not scrollable. This gets the scrollable state - of the entry. - ]] - } - values { - scroll: bool; [[$true if it is to be scrollable, $false otherwise.]] - } - } - @property input_panel_show_on_demand { - set { - [[Set the attribute to show the input panel in case of only an user's explicit Mouse Up event. - It doesn't request to show the input panel even though it has focus. - - @since 1.9 - ]] - } - get { - [[Get the attribute to show the input panel in case of only an user's explicit Mouse Up event. - - @since 1.9 - ]] - } - values { - ondemand: bool; [[If $true, the input panel will be shown in case of only Mouse up event. - (Focus event will be ignored.) - ]] - } - } - @property context_menu_disabled { - set { - [[This disables the entry's contextual (longpress) menu.]] - } - get { - [[This returns whether the entry's contextual (longpress) menu is - disabled. - ]] - } - values { - disabled: bool; [[If $true, the menu is disabled.]] - } - } - @property cnp_mode { - set { - [[Control pasting of text and images for the widget. - - Normally the entry allows both text and images to be pasted. - By setting cnp_mode to be #ELM_CNP_MODE_NO_IMAGE, this prevents images from being copy or past. - By setting cnp_mode to be #ELM_CNP_MODE_PLAINTEXT, this remove all tags in text . - - Note: This only changes the behaviour of text. - ]] - } - get { - [[Getting elm_entry text paste/drop mode. - - Normally the entry allows both text and images to be pasted. - This gets the copy & paste mode of the entry. - ]] - } - values { - cnp_mode: Elm.Cnp_Mode; [[One of #Elm_Cnp_Mode: #ELM_CNP_MODE_MARKUP, #ELM_CNP_MODE_NO_IMAGE, #ELM_CNP_MODE_PLAINTEXT.]] - } - } - @property file_text_format { - [[Text format used to load and save the file, which could be plain text or markup text. - - Default is $ELM_TEXT_FORMAT_PLAIN_UTF8, if you want to use - $ELM_TEXT_FORMAT_MARKUP_UTF8 then you need to set the text format - before calling @Efl.File.file.set. - - You could also set it before a call to @.file_save - in order to save with the given format. - ]] - - set { - [[Use it before calling @Efl.File.file.set or @.file_save.]] - } - values { - format: Elm.Text_Format(Elm.Text_Format.plain_utf8); [[ The file format ]] - } - } - @property input_panel_language { - set { - [[Set the language mode of the input panel. - - This API can be used if you want to show the alphabet keyboard mode. - ]] - } - get { - [[Get the language mode of the input panel.]] - } - values { - lang: Elm.Input.Panel.Lang; [[Language to be set to the input panel.]] - } - } - @property selection_handler_disabled { - set { - [[This disabled the entry's selection handlers.]] - } - get { - [[This returns whether the entry's selection handlers are disabled.]] - legacy: null; - } - values { - disabled: bool; [[If $true, the selection handlers are disabled.]] - } - } - @property input_panel_layout_variation { - set { - [[Set the input panel layout variation of the entry - - @since 1.8 - ]] - } - get { - [[Get the input panel layout variation of the entry - - @since 1.8 - ]] - } - values { - variation: int; [[Layout variation type.]] - } - } - @property autocapital_type { - set { - [[Set the autocapitalization type on the immodule.]] - } - get { - [[Get the autocapitalization type on the immodule.]] - } - values { - autocapital_type: Elm.Autocapital.Type; [[The type of autocapitalization.]] - } - } - @property editable { - set { - [[Sets if the entry is to be editable or not. - - By default, entries are editable and when focused, any text input by the - user will be inserted at the current cursor position. But calling this - function with $editable as $false will prevent the user from - inputting text into the entry. - - The only way to change the text of a non-editable entry is to use - \@ref elm_object_text_set, \@ref elm_entry_entry_insert and other related - functions. - ]] - } - get { - [[Get whether the entry is editable or not.]] - } - values { - editable: bool; [[If $true, user input will be inserted in the entry, - if not, the entry is read-only and no user input is allowed.]] - } - } - @property anchor_hover_style { - set { - [[Set the style that the hover should use - - When creating the popup hover, entry will request that it's - themed according to $style. - - Setting style no $null means disabling automatic hover. - ]] - } - get { - [[Get the style that the hover should use.]] - } - values { - style: string @nullable; [[The style to use for the underlying hover.]] - } - } - @property single_line { - set { - [[Sets the entry to single line mode. - - In single line mode, entries don't ever wrap when the text reaches the - edge, and instead they keep growing horizontally. Pressing the $Enter - key will generate an $"activate" event instead of adding a new line. - - When $single_line is $false, line wrapping takes effect again - and pressing enter will break the text into a different line - without generating any events. - ]] - } - get { - [[Get whether the entry is set to be single line.]] - } - values { - single_line: bool; [[If $true, the text in the entry - will be on a single line.]] - } - } - @property password { - set { - [[Sets the entry to password mode. - - In password mode, entries are implicitly single line and the display of - any text in them is replaced with asterisks (*). - ]] - } - get { - [[Get whether the entry is set to password mode.]] - } - values { - password: bool; [[If $true, password mode is enabled.]] - } - } - @property input_panel_return_key_disabled { - set { - [[Set the return key on the input panel to be disabled.]] - } - get { - [[Get whether the return key on the input panel should be disabled or not.]] - } - values { - disabled: bool; [[The state to put in in: $true for - disabled, $false for enabled.]] - } - } - @property autosave { - set { - [[This sets the entry object to 'autosave' the loaded text file or not.]] - } - get { - [[This gets the entry object's 'autosave' status.]] - } - values { - auto_save: bool; [[Autosave the loaded file or not.]] - } - } - @property anchor_hover_parent { - set { - [[Set the parent of the hover popup - - Sets the parent object to use by the hover created by the entry - when an anchor is clicked. - ]] - } - get { - [[Get the parent of the hover popup - - Get the object used as parent for the hover created by the entry - widget. If no parent is set, the same entry object will be used. - ]] - } - values { - parent: Efl.Canvas.Object @nullable; [[The object to use as parent for the hover.]] - } - } - @property prediction_allow { - set { - [[Set whether the entry should allow to use the text prediction.]] - } - get { - [[Get whether the entry should allow to use the text prediction.]] - } - values { - prediction: bool; [[Whether the entry should allow to use the text prediction.]] - } - } - @property input_hint { - set { - [[Sets the input hint which allows input methods to fine-tune their behavior.]] - } - get { - [[Gets the value of input hint.]] - } - values { - hints: Elm.Input.Hints; [[Input hint.]] - } - } - @property input_panel_layout { - set { - [[Set the input panel layout of the entry.]] - } - get { - [[Get the input panel layout of the entry.]] - } - values { - layout: Elm.Input.Panel.Layout(Elm.Input.Panel.Layout.invalid); [[Layout type.]] - } - } - @property input_panel_return_key_type { - set { - [[Set the "return" key type. This type is used to set string or icon on the "return" key of the input panel. - - An input panel displays the string or icon associated with this type. - - Regardless of return key type, "activated" event will be generated when pressing return key in single line entry. - ]] - } - get { - [[Get the "return" key type.]] - } - values { - return_key_type: Elm.Input.Panel.Return_Key.Type; [[The type of "return" key on the input panel.]] - } - } - @property input_panel_enabled { - set { - [[Sets the attribute to show the input panel automatically.]] - } - get { - [[Get the attribute to show the input panel automatically.]] - } - values { - enabled: bool; [[If $true, the input panel is appeared when entry is clicked or has a focus.]] - } - } - @property line_wrap { - set { - [[Set the line wrap type to use on multi-line entries. - - Sets the wrap type used by the entry to any of the specified in - Elm_Wrap_Type. This tells how the text will be implicitly cut into a new - line (without inserting a line break or paragraph separator) when it - reaches the far edge of the widget. - - Note that this only makes sense for multi-line entries. A widget set - to be single line will never wrap. - ]] - } - get { - [[Get the wrap mode the entry was set to use.]] - } - values { - wrap: Elm.Wrap.Type; [[The wrap mode to use. See Elm_Wrap_Type for details on them.]] - } - } - @property cursor_pos { - set { - [[Sets the cursor position in the entry to the given value - - The value in $pos is the index of the character position within the - contents of the string as returned by @.cursor_pos.get. - ]] - } - get { - [[Get the current position of the cursor in the entry.]] - } - values { - pos: int; [[The position of the cursor.]] - } - } - @property icon_visible { - set { - [[Sets the visibility of the left-side widget of the entry, - set by \@ref elm_object_part_content_set.]] - } - values { - setting: bool; [[$true if the object should be displayed, - $false if not.]] - } - } - @property cursor_line_end { - set { - [[This moves the cursor to the end of the current line.]] - } - } - @property select_region { - set { - [[This selects a region of text within the entry. - - @since 1.9 - ]] - } - get { - [[Get the current position of the selection cursors in the entry. - - @since 1.18 - ]] - } - values { - start: int; [[The starting position.]] - end: int; [[The end position.]] - } - } - @property input_panel_return_key_autoenabled { - set { - [[Set whether the return key on the input panel is disabled automatically when entry has no text. - - If $enabled is $true, The return key on input panel is disabled when the entry has no text. - The return key on the input panel is automatically enabled when the entry has text. - The default value is $false. - ]] - } - values { - enabled: bool; [[If $enabled is $true, the return key is automatically disabled when the entry has no text.]] - } - } - @property end_visible { - set { - [[Sets the visibility of the end widget of the entry, set by - \@ref elm_object_part_content_set(ent, "end", content).]] - } - values { - setting: bool; [[$true if the object should be displayed, - false if not.]] - } - } - @property cursor_begin { - set { - [[This moves the cursor to the beginning of the entry.]] - } - } - @property cursor_line_begin { - set { - [[This moves the cursor to the beginning of the current line.]] - } - } - @property cursor_end { - set { - [[This moves the cursor to the end of the entry.]] - } - } - @property textblock { - get { - [[ - Returns the actual textblock object of the entry. - - This function exposes the internal textblock object that actually - contains and draws the text. This should be used for low-level - manipulations that are otherwise not possible. - - Changing the textblock directly from here will not notify edje/elm to - recalculate the textblock size automatically, so any modifications - done to the textblock returned by this function should be followed by - a call to \@ref elm_entry_calc_force. - - The return value is marked as const as an additional warning. - One should not use the returned object with any of the generic evas - functions (geometry_get/resize/move and etc), but only with the textblock - functions; The former will either not work at all, or break the correct - functionality. - - IMPORTANT: Many functions may change (i.e delete and create a new one) - the internal textblock object. Do NOT cache the returned object, and try - not to mix calls on this object with regular elm_entry calls (which may - change the internal textblock object). This applies to all cursors - returned from textblock calls, and all the other derivative values. - ]] - return: Efl.Canvas.Object; [[Textblock object]] - } - } - @property textblock_cursor_geometry { - get { - [[This function returns the geometry of the cursor. - - It's useful if you want to draw something on the cursor (or where it is), - 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 { - x: int; [[X coordinate]] - y: int; [[Y coordinate]] - w: int; [[Width]] - h: int; [[Height]] - } - } - @property imf_context { - get { - [[Returns the input method context of the entry. - - This function exposes the internal input method context. - - IMPORTANT: Many functions may change (i.e delete and create a new one) - the internal input method context. Do NOT cache the returned object. - ]] - return: void_ptr; [[Input method context]] - } - } - @property cursor_is_format { - get { - [[Get whether a format node exists at the current cursor position. - - A format node is anything that defines how the text is rendered. It can - be a visible format node, such as a line break or a paragraph separator, - or an invisible one, such as bold begin or end tag. - This function returns whether any format node exists at the current - cursor position. - ]] - return: bool; [[$true if format node exists, $false otherwise]] - } - } - @property textblock_cursor_content { - get { - [[Get the character pointed by the cursor at its current position. - - This function returns a string with the utf8 character stored at the - current cursor position. - 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]] - } - } - @property selection { - get { - [[Get any selected text within the entry. - - If there's any selected text in the entry, this function returns it as - a string in markup format. $null is returned if no selection exists or - if an error occurred. - - The returned value points to an internal string and should not be freed - or modified in any way. If the $entry object is deleted or its - contents are changed, the returned pointer should be considered invalid. - ]] - return: string; [[Selected string]] - } - } - @property cursor_is_visible_format { - get { - [[Get if the current cursor position holds a visible format node.]] - return: bool; [[$true if position has a visible format, $false otherwise]] - } - } - @property select_allow { - [[Allow selection in the entry. - - @since 1.18 - ]] - set { - } - get { - } - values { - allow: bool; [[If $allow is true, the text selection is allowed.]] - } - } - cursor_prev { - [[This moves the cursor one place to the left within the entry.]] - return: bool; [[$true on success, $false otherwise]] - } - text_style_user_pop { - [[Remove the style in the top of user style stack. - - @since 1.7 - ]] - } - 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.]] - } - } - input_panel_show { - [[Show the input panel (virtual keyboard) based on the input panel property of entry such as layout, autocapital types, and so on. - - Note that input panel is shown or hidden automatically according to the focus state of entry widget. - This API can be used in the case of manually controlling by using @.input_panel_enabled.set(en, $false). - ]] - } - imf_context_reset { - [[Reset the input method context of the entry if needed. - - This can be necessary in the case where modifying the buffer would confuse on-going input method behavior. - This will typically cause the Input Method Context to clear the preedit state. - ]] - } - anchor_hover_end { - [[Ends the hover popup in the entry - - When an anchor is clicked, the entry widget will create a hover - object to use as a popup with user provided content. This function - terminates this popup, returning the entry to its normal state. - ]] - } - cursor_selection_begin { - [[This begins a selection within the entry as though - the user were holding down the mouse button to make a selection.]] - } - cursor_down { - [[This moves the cursor one line down within the entry.]] - return: bool; [[$true on success, $false otherwise]] - } - file_save { - [[This function writes any changes made to the file set with - \@ref elm_entry_file_set.]] - } - selection_copy { - [[This executes a "copy" action on the selected text in the entry.]] - } - text_style_user_push { - [[Push the style to the top of user style stack. - If there is styles in the user style stack, the properties in the top style - of user style stack will replace the properties in current theme. - The input style is specified in format tag='property=value' (i.e. DEFAULT='font=Sans font_size=60'hilight=' + font_weight=Bold'). - - @since 1.7 - ]] - params { - @in style: string; [[The style user to push.]] - } - } - 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.]] - } - } - text_style_user_peek @const { - [[Get the style on the top of user style stack. - - See also @.text_style_user_push. - - @since 1.7 - ]] - return: string; [[Style]] - } - context_menu_clear { - [[This clears and frees the items in a entry's contextual (longpress) - menu. - - See also @.context_menu_item_add. - ]] - } - cursor_up { - [[This moves the cursor one line up within the entry.]] - return: bool; [[$true on success, $false otherwise]] - } - entry_insert { - [[Inserts the given text into the entry at the current cursor position. - - This inserts text at the cursor position as if it was typed - by the user (note that this also allows markup which a user - can't just "type" as it would be converted to escaped text, so this - call can be used to insert things like emoticon items or bold push/pop - tags, other font and color change tags etc.) - - If any selection exists, it will be replaced by the inserted text. - - The inserted text is subject to any filters set for the widget. - - See also @.markup_filter_append. - ]] - params { - @in entry: string; [[The text to insert.]] - } - } - input_panel_imdata_set { - [[Set the input panel-specific data to deliver to the input panel. - - This API is used by applications to deliver specific data to the input panel. - The data format MUST be negotiated by both application and the input panel. - The size and format of data are defined by the input panel. - ]] - params { - @in data: const(void_ptr); [[The specific data to be set to the input panel.]] - @in len: int; [[The length of data, in bytes, to send to the input panel.]] - } - } - input_panel_imdata_get @const { - [[Get the specific data of the current input panel.]] - params { - @out data: void; [[The specific data to be got from the input panel.]] - @out len: int; [[The length of data.]] - } - } - selection_paste { - [[This executes a "paste" action in the entry.]] - } - cursor_next { - [[This moves the cursor one place to the right within the entry.]] - return: bool; [[$true on success, $false otherwise]] - } - select_none { - [[This drops any existing text selection within the entry.]] - } - input_panel_hide { - [[Hide the input panel (virtual keyboard). - - Note that input panel is shown or hidden automatically according to the focus state of entry widget. - This API can be used in the case of manually controlling by using @.input_panel_enabled.set(en, $false) - ]] - } - select_all { - [[This selects all text within the entry.]] - } - cursor_selection_end { - [[This ends a selection within the entry as though - the user had just released the mouse button while making a selection.]] - } - selection_cut { - [[This executes a "cut" action on the selected text in the entry.]] - } - is_empty @const { - [[Get whether the entry is empty. - - Empty means no text at all. If there are any markup tags, like an item - tag for which no provider finds anything, and no text is displayed, this - function still returns $false. - ]] - return: bool(true); [[$true if empty, $false otherwise]] - } - markup_filter_remove { - [[Remove a markup filter from the list - - Removes the given callback from the filter list. See - @.markup_filter_append for more information. - ]] - params { - @in func: Elm_Entry_Filter_Cb; [[The filter function to remove.]] - @in data: void_ptr @optional; [[The user data passed when adding the function.]] - } - } - 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.]] - } - } - markup_filter_append { - [[Append a markup filter function for text inserted in the entry - - Append the given callback to the list. This functions will be called - whenever any text is inserted into the entry, with the text to be inserted - as a parameter. The type of given text is always markup. - The callback function is free to alter the text in any way it wants, but - it must remember to free the given pointer and update it. - If the new text is to be discarded, the function can free it and set its - text parameter to $null. This will also prevent any following filters from - being called. - ]] - params { - @in func: Elm_Entry_Filter_Cb; [[The function to use as text filter.]] - @in data: void_ptr @optional; [[User data to pass to $func.]] - } - } - entry_append { - [[Appends $str to the text of the entry. - - Adds the text in $str to the end of any text already present in the - widget. - - The appended text is subject to any filters set for the widget. - - See also @.markup_filter_append. - ]] - params { - @in str: string; [[The text to be appended.]] - } - } - context_menu_item_add { - [[This adds an item to the entry's contextual menu. - - A longpress on an entry will make the contextual menu show up, if this - hasn't been disabled with @.context_menu_disabled.set. - By default, this menu provides a few options like enabling selection mode, - which is useful on embedded devices that need to be explicit about it, - and when a selection exists it also shows the copy and cut actions. - - With this function, developers can add other options to this menu to - perform any action they deem necessary. - ]] - params { - @in label: string @optional; [[The item's text label.]] - @in icon_file: string @optional; [[The item's icon file.]] - @in icon_type: Elm.Icon.Type; [[The item's icon type.]] - @in func: Evas_Smart_Cb @optional; [[The callback to execute when the item is clicked.]] - @in data: const(void_ptr) @optional; [[The data to associate with the item for related functions.]] - } - } - markup_filter_prepend { - [[Prepend a markup filter function for text inserted in the entry - - Prepend the given callback to the list.]] - params { - @in func: Elm_Entry_Filter_Cb; [[The function to use as text filter.]] - @in data: void_ptr @optional; [[User data to pass to $func.]] - } - } - prediction_hint_set { - [[Sets the prediction hint to use an intelligent reply suggestion service. - - @since 1.20 - ]] - params { - 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.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; - 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.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.text_attributes { get; } - Efl.Access.Text.default_attributes { get; } - Efl.Access.Text.caret_offset { get; set; } - Efl.Access.Text.character { get; } - Efl.Access.Text.character_extents { get; } - Efl.Access.Text.character_count { get; } - Efl.Access.Text.offset_at_point { get; } - Efl.Access.Text.bounded_ranges { get; } - Efl.Access.Text.range_extents { get; } - 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.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.Access.Widget.Action.elm_actions { get; } - Efl.File.file { get; set; } - Efl.Part.part_get; - } - events { - 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 2bb08bd52b..ba41964082 100644 --- a/src/lib/elementary/elm_entry.h +++ b/src/lib/elementary/elm_entry.h @@ -77,7 +77,7 @@ * @li \...\: Generic parameters. * @li \...\: Language keywords (ex: return, NULL, while, for, etc) * @li \...\: Preprocessors definitions. - * @li \...\: Diff addeded lines. + * @li \...\: Diff added lines. * @li \...\: Diff removed lines. * @li \...\: Diff changed lines. * diff --git a/src/lib/elementary/elm_entry_eo.c b/src/lib/elementary/elm_entry_eo.c new file mode 100644 index 0000000000..09ff5794c8 --- /dev/null +++ b/src/lib/elementary/elm_entry_eo.c @@ -0,0 +1,1193 @@ +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_ACTIVATED = + EFL_EVENT_DESCRIPTION("activated"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_CHANGED = + EFL_EVENT_DESCRIPTION("changed"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_CHANGED_USER = + EFL_EVENT_DESCRIPTION("changed,user"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_VALIDATE = + EFL_EVENT_DESCRIPTION("validate"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_CONTEXT_OPEN = + EFL_EVENT_DESCRIPTION("context,open"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_ANCHOR_CLICKED = + EFL_EVENT_DESCRIPTION("anchor,clicked"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_REJECTED = + EFL_EVENT_DESCRIPTION("rejected"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_MAXLENGTH_REACHED = + EFL_EVENT_DESCRIPTION("maxlength,reached"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_PREEDIT_CHANGED = + EFL_EVENT_DESCRIPTION("preedit,changed"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_PRESS = + EFL_EVENT_DESCRIPTION("press"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_REDO_REQUEST = + EFL_EVENT_DESCRIPTION("redo,request"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_UNDO_REQUEST = + EFL_EVENT_DESCRIPTION("undo,request"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_TEXT_SET_DONE = + EFL_EVENT_DESCRIPTION("text,set,done"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_ABORTED = + EFL_EVENT_DESCRIPTION("aborted"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_ANCHOR_DOWN = + EFL_EVENT_DESCRIPTION("anchor,down"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_ANCHOR_HOVER_OPENED = + EFL_EVENT_DESCRIPTION("anchor,hover,opened"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_ANCHOR_IN = + EFL_EVENT_DESCRIPTION("anchor,in"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_ANCHOR_OUT = + EFL_EVENT_DESCRIPTION("anchor,out"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_ANCHOR_UP = + EFL_EVENT_DESCRIPTION("anchor,up"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_CURSOR_CHANGED = + EFL_EVENT_DESCRIPTION("cursor,changed"); +EWAPI const Efl_Event_Description _ELM_ENTRY_EVENT_CURSOR_CHANGED_MANUAL = + EFL_EVENT_DESCRIPTION("cursor,changed,manual"); + +void _elm_entry_scrollable_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool scroll); + + +static Eina_Error +__eolian_elm_entry_scrollable_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_scrollable_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_scrollable_set, EFL_FUNC_CALL(scroll), Eina_Bool scroll); + +Eina_Bool _elm_entry_scrollable_get(const Eo *obj, Elm_Entry_Data *pd); + + +static Eina_Value +__eolian_elm_entry_scrollable_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_entry_scrollable_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_scrollable_get, Eina_Bool, 0); + +void _elm_entry_input_panel_show_on_demand_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool ondemand); + + +static Eina_Error +__eolian_elm_entry_input_panel_show_on_demand_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_input_panel_show_on_demand_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_input_panel_show_on_demand_set, EFL_FUNC_CALL(ondemand), Eina_Bool ondemand); + +Eina_Bool _elm_entry_input_panel_show_on_demand_get(const Eo *obj, Elm_Entry_Data *pd); + + +static Eina_Value +__eolian_elm_entry_input_panel_show_on_demand_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_entry_input_panel_show_on_demand_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_input_panel_show_on_demand_get, Eina_Bool, 0); + +void _elm_entry_context_menu_disabled_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool disabled); + + +static Eina_Error +__eolian_elm_entry_context_menu_disabled_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_context_menu_disabled_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_context_menu_disabled_set, EFL_FUNC_CALL(disabled), Eina_Bool disabled); + +Eina_Bool _elm_entry_context_menu_disabled_get(const Eo *obj, Elm_Entry_Data *pd); + + +static Eina_Value +__eolian_elm_entry_context_menu_disabled_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_entry_context_menu_disabled_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_context_menu_disabled_get, Eina_Bool, 0); + +void _elm_entry_cnp_mode_set(Eo *obj, Elm_Entry_Data *pd, Elm_Cnp_Mode cnp_mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_cnp_mode_set, EFL_FUNC_CALL(cnp_mode), Elm_Cnp_Mode cnp_mode); + +Elm_Cnp_Mode _elm_entry_cnp_mode_get(const Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_cnp_mode_get, Elm_Cnp_Mode, 0); + +void _elm_entry_file_text_format_set(Eo *obj, Elm_Entry_Data *pd, Elm_Text_Format format); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_file_text_format_set, EFL_FUNC_CALL(format), Elm_Text_Format format); + +void _elm_entry_input_panel_language_set(Eo *obj, Elm_Entry_Data *pd, Elm_Input_Panel_Lang lang); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_input_panel_language_set, EFL_FUNC_CALL(lang), Elm_Input_Panel_Lang lang); + +Elm_Input_Panel_Lang _elm_entry_input_panel_language_get(const Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_input_panel_language_get, Elm_Input_Panel_Lang, 0); + +void _elm_entry_selection_handler_disabled_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool disabled); + + +static Eina_Error +__eolian_elm_entry_selection_handler_disabled_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_selection_handler_disabled_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_selection_handler_disabled_set, EFL_FUNC_CALL(disabled), Eina_Bool disabled); + +Eina_Bool _elm_entry_selection_handler_disabled_get(const Eo *obj, Elm_Entry_Data *pd); + + +static Eina_Value +__eolian_elm_entry_selection_handler_disabled_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_entry_selection_handler_disabled_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_selection_handler_disabled_get, Eina_Bool, 0); + +void _elm_entry_input_panel_layout_variation_set(Eo *obj, Elm_Entry_Data *pd, int variation); + + +static Eina_Error +__eolian_elm_entry_input_panel_layout_variation_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_input_panel_layout_variation_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_input_panel_layout_variation_set, EFL_FUNC_CALL(variation), int variation); + +int _elm_entry_input_panel_layout_variation_get(const Eo *obj, Elm_Entry_Data *pd); + + +static Eina_Value +__eolian_elm_entry_input_panel_layout_variation_get_reflect(const Eo *obj) +{ + int val = elm_obj_entry_input_panel_layout_variation_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_input_panel_layout_variation_get, int, 0); + +void _elm_entry_autocapital_type_set(Eo *obj, Elm_Entry_Data *pd, Elm_Autocapital_Type autocapital_type); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_autocapital_type_set, EFL_FUNC_CALL(autocapital_type), Elm_Autocapital_Type autocapital_type); + +Elm_Autocapital_Type _elm_entry_autocapital_type_get(const Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_autocapital_type_get, Elm_Autocapital_Type, 0); + +void _elm_entry_editable_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool editable); + + +static Eina_Error +__eolian_elm_entry_editable_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_editable_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_editable_set, EFL_FUNC_CALL(editable), Eina_Bool editable); + +Eina_Bool _elm_entry_editable_get(const Eo *obj, Elm_Entry_Data *pd); + + +static Eina_Value +__eolian_elm_entry_editable_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_entry_editable_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_editable_get, Eina_Bool, 0); + +void _elm_entry_anchor_hover_style_set(Eo *obj, Elm_Entry_Data *pd, const char *style); + + +static Eina_Error +__eolian_elm_entry_anchor_hover_style_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_anchor_hover_style_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_anchor_hover_style_set, EFL_FUNC_CALL(style), const char *style); + +const char *_elm_entry_anchor_hover_style_get(const Eo *obj, Elm_Entry_Data *pd); + + +static Eina_Value +__eolian_elm_entry_anchor_hover_style_get_reflect(const Eo *obj) +{ + const char *val = elm_obj_entry_anchor_hover_style_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_anchor_hover_style_get, const char *, NULL); + +void _elm_entry_single_line_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool single_line); + + +static Eina_Error +__eolian_elm_entry_single_line_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_single_line_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_single_line_set, EFL_FUNC_CALL(single_line), Eina_Bool single_line); + +Eina_Bool _elm_entry_single_line_get(const Eo *obj, Elm_Entry_Data *pd); + + +static Eina_Value +__eolian_elm_entry_single_line_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_entry_single_line_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_single_line_get, Eina_Bool, 0); + +void _elm_entry_password_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool password); + + +static Eina_Error +__eolian_elm_entry_password_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_password_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_password_set, EFL_FUNC_CALL(password), Eina_Bool password); + +Eina_Bool _elm_entry_password_get(const Eo *obj, Elm_Entry_Data *pd); + + +static Eina_Value +__eolian_elm_entry_password_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_entry_password_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_password_get, Eina_Bool, 0); + +void _elm_entry_input_panel_return_key_disabled_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool disabled); + + +static Eina_Error +__eolian_elm_entry_input_panel_return_key_disabled_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_input_panel_return_key_disabled_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_input_panel_return_key_disabled_set, EFL_FUNC_CALL(disabled), Eina_Bool disabled); + +Eina_Bool _elm_entry_input_panel_return_key_disabled_get(const Eo *obj, Elm_Entry_Data *pd); + + +static Eina_Value +__eolian_elm_entry_input_panel_return_key_disabled_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_entry_input_panel_return_key_disabled_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_input_panel_return_key_disabled_get, Eina_Bool, 0); + +void _elm_entry_autosave_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool auto_save); + + +static Eina_Error +__eolian_elm_entry_autosave_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_autosave_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_autosave_set, EFL_FUNC_CALL(auto_save), Eina_Bool auto_save); + +Eina_Bool _elm_entry_autosave_get(const Eo *obj, Elm_Entry_Data *pd); + + +static Eina_Value +__eolian_elm_entry_autosave_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_entry_autosave_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_autosave_get, Eina_Bool, 0); + +void _elm_entry_anchor_hover_parent_set(Eo *obj, Elm_Entry_Data *pd, Efl_Canvas_Object *parent); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_anchor_hover_parent_set, EFL_FUNC_CALL(parent), Efl_Canvas_Object *parent); + +Efl_Canvas_Object *_elm_entry_anchor_hover_parent_get(const Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_anchor_hover_parent_get, Efl_Canvas_Object *, NULL); + +void _elm_entry_prediction_allow_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool prediction); + + +static Eina_Error +__eolian_elm_entry_prediction_allow_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_prediction_allow_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_prediction_allow_set, EFL_FUNC_CALL(prediction), Eina_Bool prediction); + +Eina_Bool _elm_entry_prediction_allow_get(const Eo *obj, Elm_Entry_Data *pd); + + +static Eina_Value +__eolian_elm_entry_prediction_allow_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_entry_prediction_allow_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_prediction_allow_get, Eina_Bool, 0); + +void _elm_entry_input_hint_set(Eo *obj, Elm_Entry_Data *pd, Elm_Input_Hints hints); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_input_hint_set, EFL_FUNC_CALL(hints), Elm_Input_Hints hints); + +Elm_Input_Hints _elm_entry_input_hint_get(const Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_input_hint_get, Elm_Input_Hints, 0); + +void _elm_entry_input_panel_layout_set(Eo *obj, Elm_Entry_Data *pd, Elm_Input_Panel_Layout layout); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_input_panel_layout_set, EFL_FUNC_CALL(layout), Elm_Input_Panel_Layout layout); + +Elm_Input_Panel_Layout _elm_entry_input_panel_layout_get(const Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_input_panel_layout_get, Elm_Input_Panel_Layout, 8 /* Elm.Input.Panel.Layout.invalid */); + +void _elm_entry_input_panel_return_key_type_set(Eo *obj, Elm_Entry_Data *pd, Elm_Input_Panel_Return_Key_Type return_key_type); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_input_panel_return_key_type_set, EFL_FUNC_CALL(return_key_type), Elm_Input_Panel_Return_Key_Type return_key_type); + +Elm_Input_Panel_Return_Key_Type _elm_entry_input_panel_return_key_type_get(const Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_input_panel_return_key_type_get, Elm_Input_Panel_Return_Key_Type, 0); + +void _elm_entry_input_panel_enabled_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool enabled); + + +static Eina_Error +__eolian_elm_entry_input_panel_enabled_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_input_panel_enabled_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_input_panel_enabled_set, EFL_FUNC_CALL(enabled), Eina_Bool enabled); + +Eina_Bool _elm_entry_input_panel_enabled_get(const Eo *obj, Elm_Entry_Data *pd); + + +static Eina_Value +__eolian_elm_entry_input_panel_enabled_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_entry_input_panel_enabled_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_input_panel_enabled_get, Eina_Bool, 0); + +void _elm_entry_line_wrap_set(Eo *obj, Elm_Entry_Data *pd, Elm_Wrap_Type wrap); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_line_wrap_set, EFL_FUNC_CALL(wrap), Elm_Wrap_Type wrap); + +Elm_Wrap_Type _elm_entry_line_wrap_get(const Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_line_wrap_get, Elm_Wrap_Type, 0); + +void _elm_entry_cursor_pos_set(Eo *obj, Elm_Entry_Data *pd, int pos); + + +static Eina_Error +__eolian_elm_entry_cursor_pos_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_cursor_pos_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_cursor_pos_set, EFL_FUNC_CALL(pos), int pos); + +int _elm_entry_cursor_pos_get(const Eo *obj, Elm_Entry_Data *pd); + + +static Eina_Value +__eolian_elm_entry_cursor_pos_get_reflect(const Eo *obj) +{ + int val = elm_obj_entry_cursor_pos_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_cursor_pos_get, int, 0); + +void _elm_entry_icon_visible_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool setting); + + +static Eina_Error +__eolian_elm_entry_icon_visible_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_icon_visible_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_icon_visible_set, EFL_FUNC_CALL(setting), Eina_Bool setting); + +void _elm_entry_cursor_line_end_set(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_cursor_line_end_set); + +void _elm_entry_select_region_set(Eo *obj, Elm_Entry_Data *pd, int start, int end); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_select_region_set, EFL_FUNC_CALL(start, end), int start, int end); + +void _elm_entry_select_region_get(const Eo *obj, Elm_Entry_Data *pd, int *start, int *end); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_entry_select_region_get, EFL_FUNC_CALL(start, end), int *start, int *end); + +void _elm_entry_input_panel_return_key_autoenabled_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool enabled); + + +static Eina_Error +__eolian_elm_entry_input_panel_return_key_autoenabled_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_input_panel_return_key_autoenabled_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_input_panel_return_key_autoenabled_set, EFL_FUNC_CALL(enabled), Eina_Bool enabled); + +void _elm_entry_end_visible_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool setting); + + +static Eina_Error +__eolian_elm_entry_end_visible_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_end_visible_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_end_visible_set, EFL_FUNC_CALL(setting), Eina_Bool setting); + +void _elm_entry_cursor_begin_set(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_cursor_begin_set); + +void _elm_entry_cursor_line_begin_set(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_cursor_line_begin_set); + +void _elm_entry_cursor_end_set(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_cursor_end_set); + +Efl_Canvas_Object *_elm_entry_textblock_get(const Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_textblock_get, Efl_Canvas_Object *, NULL); + +Eina_Bool _elm_entry_textblock_cursor_geometry_get(const Eo *obj, Elm_Entry_Data *pd, int *x, int *y, int *w, int *h); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_entry_textblock_cursor_geometry_get, Eina_Bool, 0, EFL_FUNC_CALL(x, y, w, h), int *x, int *y, int *w, int *h); + +void *_elm_entry_imf_context_get(const Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_imf_context_get, void *, NULL); + +Eina_Bool _elm_entry_cursor_is_format_get(const Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_cursor_is_format_get, Eina_Bool, 0); + +char *_elm_entry_textblock_cursor_content_get(const Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_textblock_cursor_content_get, char *, NULL); + +const char *_elm_entry_selection_get(const Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_selection_get, const char *, NULL); + +Eina_Bool _elm_entry_cursor_is_visible_format_get(const Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_cursor_is_visible_format_get, Eina_Bool, 0); + +void _elm_entry_select_allow_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool allow); + + +static Eina_Error +__eolian_elm_entry_select_allow_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_entry_select_allow_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_select_allow_set, EFL_FUNC_CALL(allow), Eina_Bool allow); + +Eina_Bool _elm_entry_select_allow_get(const Eo *obj, Elm_Entry_Data *pd); + + +static Eina_Value +__eolian_elm_entry_select_allow_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_entry_select_allow_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_select_allow_get, Eina_Bool, 0); + +Eina_Bool _elm_entry_cursor_prev(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY(elm_obj_entry_cursor_prev, Eina_Bool, 0); + +void _elm_entry_text_style_user_pop(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_text_style_user_pop); + +void _elm_entry_item_provider_prepend(Eo *obj, Elm_Entry_Data *pd, Elm_Entry_Item_Provider_Cb func, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_item_provider_prepend, EFL_FUNC_CALL(func, data), Elm_Entry_Item_Provider_Cb func, void *data); + +void _elm_entry_input_panel_show(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_input_panel_show); + +void _elm_entry_imf_context_reset(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_imf_context_reset); + +void _elm_entry_anchor_hover_end(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_anchor_hover_end); + +void _elm_entry_cursor_selection_begin(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_cursor_selection_begin); + +Eina_Bool _elm_entry_cursor_down(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY(elm_obj_entry_cursor_down, Eina_Bool, 0); + +void _elm_entry_file_save(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_file_save); + +void _elm_entry_selection_copy(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_selection_copy); + +void _elm_entry_text_style_user_push(Eo *obj, Elm_Entry_Data *pd, const char *style); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_text_style_user_push, EFL_FUNC_CALL(style), const char *style); + +void _elm_entry_item_provider_remove(Eo *obj, Elm_Entry_Data *pd, Elm_Entry_Item_Provider_Cb func, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_item_provider_remove, EFL_FUNC_CALL(func, data), Elm_Entry_Item_Provider_Cb func, void *data); + +const char *_elm_entry_text_style_user_peek(const Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_text_style_user_peek, const char *, NULL); + +void _elm_entry_context_menu_clear(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_context_menu_clear); + +Eina_Bool _elm_entry_cursor_up(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY(elm_obj_entry_cursor_up, Eina_Bool, 0); + +void _elm_entry_entry_insert(Eo *obj, Elm_Entry_Data *pd, const char *entry); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_insert, EFL_FUNC_CALL(entry), const char *entry); + +void _elm_entry_input_panel_imdata_set(Eo *obj, Elm_Entry_Data *pd, const void *data, int len); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_input_panel_imdata_set, EFL_FUNC_CALL(data, len), const void *data, int len); + +void _elm_entry_input_panel_imdata_get(const Eo *obj, Elm_Entry_Data *pd, void *data, int *len); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_entry_input_panel_imdata_get, EFL_FUNC_CALL(data, len), void *data, int *len); + +void _elm_entry_selection_paste(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_selection_paste); + +Eina_Bool _elm_entry_cursor_next(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY(elm_obj_entry_cursor_next, Eina_Bool, 0); + +void _elm_entry_select_none(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_select_none); + +void _elm_entry_input_panel_hide(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_input_panel_hide); + +void _elm_entry_select_all(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_select_all); + +void _elm_entry_cursor_selection_end(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_cursor_selection_end); + +void _elm_entry_selection_cut(Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_entry_selection_cut); + +Eina_Bool _elm_entry_is_empty(const Eo *obj, Elm_Entry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_entry_is_empty, Eina_Bool, EINA_TRUE /* true */); + +void _elm_entry_markup_filter_remove(Eo *obj, Elm_Entry_Data *pd, Elm_Entry_Filter_Cb func, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_markup_filter_remove, EFL_FUNC_CALL(func, data), Elm_Entry_Filter_Cb func, void *data); + +void _elm_entry_item_provider_append(Eo *obj, Elm_Entry_Data *pd, Elm_Entry_Item_Provider_Cb func, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_item_provider_append, EFL_FUNC_CALL(func, data), Elm_Entry_Item_Provider_Cb func, void *data); + +void _elm_entry_markup_filter_append(Eo *obj, Elm_Entry_Data *pd, Elm_Entry_Filter_Cb func, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_markup_filter_append, EFL_FUNC_CALL(func, data), Elm_Entry_Filter_Cb func, void *data); + +void _elm_entry_entry_append(Eo *obj, Elm_Entry_Data *pd, const char *str); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_append, EFL_FUNC_CALL(str), const char *str); + +void _elm_entry_context_menu_item_add(Eo *obj, Elm_Entry_Data *pd, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_context_menu_item_add, EFL_FUNC_CALL(label, icon_file, icon_type, func, data), const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data); + +void _elm_entry_markup_filter_prepend(Eo *obj, Elm_Entry_Data *pd, Elm_Entry_Filter_Cb func, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_markup_filter_prepend, EFL_FUNC_CALL(func, data), Elm_Entry_Filter_Cb func, void *data); + +void _elm_entry_prediction_hint_set(Eo *obj, Elm_Entry_Data *pd, const char *prediction_hint); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_entry_prediction_hint_set, EFL_FUNC_CALL(prediction_hint), const char *prediction_hint); + +Eina_Bool _elm_entry_prediction_hint_hash_set(Eo *obj, Elm_Entry_Data *pd, const char *key, const char *value); + +EOAPI EFL_FUNC_BODYV(elm_obj_entry_prediction_hint_hash_set, Eina_Bool, 0, EFL_FUNC_CALL(key, value), const char *key, const char *value); + +Eina_Bool _elm_entry_prediction_hint_hash_del(Eo *obj, Elm_Entry_Data *pd, const char *key); + +EOAPI EFL_FUNC_BODYV(elm_obj_entry_prediction_hint_hash_del, Eina_Bool, 0, EFL_FUNC_CALL(key), const char *key); + +Efl_Object *_elm_entry_efl_object_constructor(Eo *obj, Elm_Entry_Data *pd); + + +void _elm_entry_efl_gfx_entity_visible_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool v); + + +void _elm_entry_efl_gfx_entity_position_set(Eo *obj, Elm_Entry_Data *pd, Eina_Position2D pos); + + +void _elm_entry_efl_gfx_entity_size_set(Eo *obj, Elm_Entry_Data *pd, Eina_Size2D size); + + +void _elm_entry_efl_canvas_group_group_member_add(Eo *obj, Elm_Entry_Data *pd, Efl_Canvas_Object *sub_obj); + + +Eina_Bool _elm_entry_efl_layout_signal_signal_callback_add(Eo *obj, Elm_Entry_Data *pd, const char *emission, const char *source, void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb); + + +Eina_Bool _elm_entry_efl_layout_signal_signal_callback_del(Eo *obj, Elm_Entry_Data *pd, const char *emission, const char *source, void *func_data, EflLayoutSignalCb func, Eina_Free_Cb func_free_cb); + + +void _elm_entry_efl_layout_signal_signal_emit(Eo *obj, Elm_Entry_Data *pd, const char *emission, const char *source); + + +void _elm_entry_efl_layout_calc_calc_force(Eo *obj, Elm_Entry_Data *pd); + + +Eina_Bool _elm_entry_efl_ui_widget_on_access_activate(Eo *obj, Elm_Entry_Data *pd, Efl_Ui_Activate act); + + +Eina_Error _elm_entry_efl_ui_widget_theme_apply(Eo *obj, Elm_Entry_Data *pd); + + +Efl_Ui_Focus_Manager *_elm_entry_efl_ui_widget_focus_manager_focus_manager_create(Eo *obj, Elm_Entry_Data *pd, Efl_Ui_Focus_Object *root); + + +Eina_Bool _elm_entry_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Entry_Data *pd); + + +Eina_Rect _elm_entry_efl_ui_widget_interest_region_get(const Eo *obj, Elm_Entry_Data *pd); + + +void _elm_entry_efl_ui_widget_disabled_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool disabled); + + +Eina_Bool _elm_entry_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Entry_Data *pd, Efl_Canvas_Object *sub_obj); + + +void _elm_entry_elm_interface_scrollable_policy_set(Eo *obj, Elm_Entry_Data *pd, Elm_Scroller_Policy hbar, Elm_Scroller_Policy vbar); + + +void _elm_entry_elm_interface_scrollable_bounce_allow_set(Eo *obj, Elm_Entry_Data *pd, Eina_Bool horiz, Eina_Bool vert); + + +Efl_Access_State_Set _elm_entry_efl_access_object_state_set_get(const Eo *obj, Elm_Entry_Data *pd); + + +const char *_elm_entry_efl_access_object_i18n_name_get(const Eo *obj, Elm_Entry_Data *pd); + + +char *_elm_entry_efl_access_text_access_text_get(const Eo *obj, Elm_Entry_Data *pd, int start_offset, int end_offset); + + +char *_elm_entry_efl_access_text_string_get(const Eo *obj, Elm_Entry_Data *pd, Efl_Access_Text_Granularity granularity, int *start_offset, int *end_offset); + + +Eina_Bool _elm_entry_efl_access_text_attribute_get(const Eo *obj, Elm_Entry_Data *pd, const char *name, int *start_offset, int *end_offset, char **value); + + +Eina_List *_elm_entry_efl_access_text_text_attributes_get(const Eo *obj, Elm_Entry_Data *pd, int *start_offset, int *end_offset); + + +Eina_List *_elm_entry_efl_access_text_default_attributes_get(const Eo *obj, Elm_Entry_Data *pd); + + +Eina_Bool _elm_entry_efl_access_text_caret_offset_set(Eo *obj, Elm_Entry_Data *pd, int offset); + + +int _elm_entry_efl_access_text_caret_offset_get(const Eo *obj, Elm_Entry_Data *pd); + + +Eina_Unicode _elm_entry_efl_access_text_character_get(const Eo *obj, Elm_Entry_Data *pd, int offset); + + +Eina_Bool _elm_entry_efl_access_text_character_extents_get(const Eo *obj, Elm_Entry_Data *pd, int offset, Eina_Bool screen_coords, Eina_Rect *rect); + + +int _elm_entry_efl_access_text_character_count_get(const Eo *obj, Elm_Entry_Data *pd); + + +int _elm_entry_efl_access_text_offset_at_point_get(const Eo *obj, Elm_Entry_Data *pd, Eina_Bool screen_coords, int x, int y); + + +Eina_List *_elm_entry_efl_access_text_bounded_ranges_get(const Eo *obj, Elm_Entry_Data *pd, Eina_Bool screen_coords, Eina_Rect rect, Efl_Access_Text_Clip_Type xclip, Efl_Access_Text_Clip_Type yclip); + + +Eina_Bool _elm_entry_efl_access_text_range_extents_get(const Eo *obj, Elm_Entry_Data *pd, Eina_Bool screen_coords, int start_offset, int end_offset, Eina_Rect *rect); + + +Eina_Bool _elm_entry_efl_access_text_access_selection_set(Eo *obj, Elm_Entry_Data *pd, int selection_number, int start_offset, int end_offset); + + +void _elm_entry_efl_access_text_access_selection_get(const Eo *obj, Elm_Entry_Data *pd, int selection_number, int *start_offset, int *end_offset); + + +int _elm_entry_efl_access_text_selections_count_get(const Eo *obj, Elm_Entry_Data *pd); + + +Eina_Bool _elm_entry_efl_access_text_selection_add(Eo *obj, Elm_Entry_Data *pd, int start_offset, int end_offset); + + +Eina_Bool _elm_entry_efl_access_text_selection_remove(Eo *obj, Elm_Entry_Data *pd, int selection_number); + + +Eina_Bool _elm_entry_efl_access_editable_text_text_content_set(Eo *obj, Elm_Entry_Data *pd, const char *string); + + +Eina_Bool _elm_entry_efl_access_editable_text_insert(Eo *obj, Elm_Entry_Data *pd, const char *string, int position); + + +Eina_Bool _elm_entry_efl_access_editable_text_copy(Eo *obj, Elm_Entry_Data *pd, int start, int end); + + +Eina_Bool _elm_entry_efl_access_editable_text_cut(Eo *obj, Elm_Entry_Data *pd, int start, int end); + + +Eina_Bool _elm_entry_efl_access_editable_text_delete(Eo *obj, Elm_Entry_Data *pd, int start, int end); + + +Eina_Bool _elm_entry_efl_access_editable_text_paste(Eo *obj, Elm_Entry_Data *pd, int position); + + +const Efl_Access_Action_Data *_elm_entry_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Entry_Data *pd); + + +Eina_Error _elm_entry_efl_file_file_set(Eo *obj, Elm_Entry_Data *pd, const char *file); + + +Eina_Error _elm_entry_efl_file_load(Eo *obj, Elm_Entry_Data *pd); + +void _elm_entry_efl_file_unload(Eo *obj, Elm_Entry_Data *pd); + + +Efl_Object *_elm_entry_efl_part_part_get(const Eo *obj, Elm_Entry_Data *pd, const char *name); + + +static Eina_Bool +_elm_entry_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_ENTRY_EXTRA_OPS +#define ELM_ENTRY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_entry_scrollable_set, _elm_entry_scrollable_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_scrollable_get, _elm_entry_scrollable_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_show_on_demand_set, _elm_entry_input_panel_show_on_demand_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_show_on_demand_get, _elm_entry_input_panel_show_on_demand_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_context_menu_disabled_set, _elm_entry_context_menu_disabled_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_context_menu_disabled_get, _elm_entry_context_menu_disabled_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_cnp_mode_set, _elm_entry_cnp_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_cnp_mode_get, _elm_entry_cnp_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_file_text_format_set, _elm_entry_file_text_format_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_language_set, _elm_entry_input_panel_language_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_language_get, _elm_entry_input_panel_language_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_selection_handler_disabled_set, _elm_entry_selection_handler_disabled_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_selection_handler_disabled_get, _elm_entry_selection_handler_disabled_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_layout_variation_set, _elm_entry_input_panel_layout_variation_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_layout_variation_get, _elm_entry_input_panel_layout_variation_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_autocapital_type_set, _elm_entry_autocapital_type_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_autocapital_type_get, _elm_entry_autocapital_type_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_editable_set, _elm_entry_editable_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_editable_get, _elm_entry_editable_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_anchor_hover_style_set, _elm_entry_anchor_hover_style_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_anchor_hover_style_get, _elm_entry_anchor_hover_style_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_single_line_set, _elm_entry_single_line_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_single_line_get, _elm_entry_single_line_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_password_set, _elm_entry_password_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_password_get, _elm_entry_password_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_return_key_disabled_set, _elm_entry_input_panel_return_key_disabled_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_return_key_disabled_get, _elm_entry_input_panel_return_key_disabled_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_autosave_set, _elm_entry_autosave_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_autosave_get, _elm_entry_autosave_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_anchor_hover_parent_set, _elm_entry_anchor_hover_parent_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_anchor_hover_parent_get, _elm_entry_anchor_hover_parent_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_prediction_allow_set, _elm_entry_prediction_allow_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_prediction_allow_get, _elm_entry_prediction_allow_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_hint_set, _elm_entry_input_hint_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_hint_get, _elm_entry_input_hint_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_layout_set, _elm_entry_input_panel_layout_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_layout_get, _elm_entry_input_panel_layout_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_return_key_type_set, _elm_entry_input_panel_return_key_type_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_return_key_type_get, _elm_entry_input_panel_return_key_type_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_enabled_set, _elm_entry_input_panel_enabled_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_enabled_get, _elm_entry_input_panel_enabled_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_line_wrap_set, _elm_entry_line_wrap_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_line_wrap_get, _elm_entry_line_wrap_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_cursor_pos_set, _elm_entry_cursor_pos_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_cursor_pos_get, _elm_entry_cursor_pos_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_icon_visible_set, _elm_entry_icon_visible_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_cursor_line_end_set, _elm_entry_cursor_line_end_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_select_region_set, _elm_entry_select_region_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_select_region_get, _elm_entry_select_region_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_return_key_autoenabled_set, _elm_entry_input_panel_return_key_autoenabled_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_end_visible_set, _elm_entry_end_visible_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_cursor_begin_set, _elm_entry_cursor_begin_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_cursor_line_begin_set, _elm_entry_cursor_line_begin_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_cursor_end_set, _elm_entry_cursor_end_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_textblock_get, _elm_entry_textblock_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_textblock_cursor_geometry_get, _elm_entry_textblock_cursor_geometry_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_imf_context_get, _elm_entry_imf_context_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_cursor_is_format_get, _elm_entry_cursor_is_format_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_textblock_cursor_content_get, _elm_entry_textblock_cursor_content_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_selection_get, _elm_entry_selection_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_cursor_is_visible_format_get, _elm_entry_cursor_is_visible_format_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_select_allow_set, _elm_entry_select_allow_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_select_allow_get, _elm_entry_select_allow_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_cursor_prev, _elm_entry_cursor_prev), + EFL_OBJECT_OP_FUNC(elm_obj_entry_text_style_user_pop, _elm_entry_text_style_user_pop), + EFL_OBJECT_OP_FUNC(elm_obj_entry_item_provider_prepend, _elm_entry_item_provider_prepend), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_show, _elm_entry_input_panel_show), + EFL_OBJECT_OP_FUNC(elm_obj_entry_imf_context_reset, _elm_entry_imf_context_reset), + EFL_OBJECT_OP_FUNC(elm_obj_entry_anchor_hover_end, _elm_entry_anchor_hover_end), + EFL_OBJECT_OP_FUNC(elm_obj_entry_cursor_selection_begin, _elm_entry_cursor_selection_begin), + EFL_OBJECT_OP_FUNC(elm_obj_entry_cursor_down, _elm_entry_cursor_down), + EFL_OBJECT_OP_FUNC(elm_obj_entry_file_save, _elm_entry_file_save), + EFL_OBJECT_OP_FUNC(elm_obj_entry_selection_copy, _elm_entry_selection_copy), + EFL_OBJECT_OP_FUNC(elm_obj_entry_text_style_user_push, _elm_entry_text_style_user_push), + EFL_OBJECT_OP_FUNC(elm_obj_entry_item_provider_remove, _elm_entry_item_provider_remove), + EFL_OBJECT_OP_FUNC(elm_obj_entry_text_style_user_peek, _elm_entry_text_style_user_peek), + EFL_OBJECT_OP_FUNC(elm_obj_entry_context_menu_clear, _elm_entry_context_menu_clear), + EFL_OBJECT_OP_FUNC(elm_obj_entry_cursor_up, _elm_entry_cursor_up), + EFL_OBJECT_OP_FUNC(elm_obj_entry_insert, _elm_entry_entry_insert), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_imdata_set, _elm_entry_input_panel_imdata_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_imdata_get, _elm_entry_input_panel_imdata_get), + EFL_OBJECT_OP_FUNC(elm_obj_entry_selection_paste, _elm_entry_selection_paste), + EFL_OBJECT_OP_FUNC(elm_obj_entry_cursor_next, _elm_entry_cursor_next), + EFL_OBJECT_OP_FUNC(elm_obj_entry_select_none, _elm_entry_select_none), + EFL_OBJECT_OP_FUNC(elm_obj_entry_input_panel_hide, _elm_entry_input_panel_hide), + EFL_OBJECT_OP_FUNC(elm_obj_entry_select_all, _elm_entry_select_all), + EFL_OBJECT_OP_FUNC(elm_obj_entry_cursor_selection_end, _elm_entry_cursor_selection_end), + EFL_OBJECT_OP_FUNC(elm_obj_entry_selection_cut, _elm_entry_selection_cut), + EFL_OBJECT_OP_FUNC(elm_obj_entry_is_empty, _elm_entry_is_empty), + EFL_OBJECT_OP_FUNC(elm_obj_entry_markup_filter_remove, _elm_entry_markup_filter_remove), + EFL_OBJECT_OP_FUNC(elm_obj_entry_item_provider_append, _elm_entry_item_provider_append), + EFL_OBJECT_OP_FUNC(elm_obj_entry_markup_filter_append, _elm_entry_markup_filter_append), + EFL_OBJECT_OP_FUNC(elm_obj_entry_append, _elm_entry_entry_append), + EFL_OBJECT_OP_FUNC(elm_obj_entry_context_menu_item_add, _elm_entry_context_menu_item_add), + EFL_OBJECT_OP_FUNC(elm_obj_entry_markup_filter_prepend, _elm_entry_markup_filter_prepend), + EFL_OBJECT_OP_FUNC(elm_obj_entry_prediction_hint_set, _elm_entry_prediction_hint_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_prediction_hint_hash_set, _elm_entry_prediction_hint_hash_set), + EFL_OBJECT_OP_FUNC(elm_obj_entry_prediction_hint_hash_del, _elm_entry_prediction_hint_hash_del), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_entry_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_entry_efl_gfx_entity_visible_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_entry_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_entry_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_canvas_group_member_add, _elm_entry_efl_canvas_group_group_member_add), + EFL_OBJECT_OP_FUNC(efl_layout_signal_callback_add, _elm_entry_efl_layout_signal_signal_callback_add), + EFL_OBJECT_OP_FUNC(efl_layout_signal_callback_del, _elm_entry_efl_layout_signal_signal_callback_del), + EFL_OBJECT_OP_FUNC(efl_layout_signal_emit, _elm_entry_efl_layout_signal_signal_emit), + EFL_OBJECT_OP_FUNC(efl_layout_calc_force, _elm_entry_efl_layout_calc_calc_force), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_activate, _elm_entry_efl_ui_widget_on_access_activate), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_entry_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_manager_create, _elm_entry_efl_ui_widget_focus_manager_focus_manager_create), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_on_focus_update, _elm_entry_efl_ui_focus_object_on_focus_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_interest_region_get, _elm_entry_efl_ui_widget_interest_region_get), + EFL_OBJECT_OP_FUNC(efl_ui_widget_disabled_set, _elm_entry_efl_ui_widget_disabled_set), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _elm_entry_efl_ui_widget_widget_sub_object_del), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_policy_set, _elm_entry_elm_interface_scrollable_policy_set), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_bounce_allow_set, _elm_entry_elm_interface_scrollable_bounce_allow_set), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_entry_efl_access_object_state_set_get), + EFL_OBJECT_OP_FUNC(efl_access_object_i18n_name_get, _elm_entry_efl_access_object_i18n_name_get), + EFL_OBJECT_OP_FUNC(efl_access_text_get, _elm_entry_efl_access_text_access_text_get), + EFL_OBJECT_OP_FUNC(efl_access_text_string_get, _elm_entry_efl_access_text_string_get), + EFL_OBJECT_OP_FUNC(efl_access_text_attribute_get, _elm_entry_efl_access_text_attribute_get), + EFL_OBJECT_OP_FUNC(efl_access_text_attributes_get, _elm_entry_efl_access_text_text_attributes_get), + EFL_OBJECT_OP_FUNC(efl_access_text_default_attributes_get, _elm_entry_efl_access_text_default_attributes_get), + EFL_OBJECT_OP_FUNC(efl_access_text_caret_offset_set, _elm_entry_efl_access_text_caret_offset_set), + EFL_OBJECT_OP_FUNC(efl_access_text_caret_offset_get, _elm_entry_efl_access_text_caret_offset_get), + EFL_OBJECT_OP_FUNC(efl_access_text_character_get, _elm_entry_efl_access_text_character_get), + EFL_OBJECT_OP_FUNC(efl_access_text_character_extents_get, _elm_entry_efl_access_text_character_extents_get), + EFL_OBJECT_OP_FUNC(efl_access_text_character_count_get, _elm_entry_efl_access_text_character_count_get), + EFL_OBJECT_OP_FUNC(efl_access_text_offset_at_point_get, _elm_entry_efl_access_text_offset_at_point_get), + EFL_OBJECT_OP_FUNC(efl_access_text_bounded_ranges_get, _elm_entry_efl_access_text_bounded_ranges_get), + EFL_OBJECT_OP_FUNC(efl_access_text_range_extents_get, _elm_entry_efl_access_text_range_extents_get), + EFL_OBJECT_OP_FUNC(efl_access_text_access_selection_set, _elm_entry_efl_access_text_access_selection_set), + EFL_OBJECT_OP_FUNC(efl_access_text_access_selection_get, _elm_entry_efl_access_text_access_selection_get), + EFL_OBJECT_OP_FUNC(efl_access_text_selections_count_get, _elm_entry_efl_access_text_selections_count_get), + EFL_OBJECT_OP_FUNC(efl_access_text_selection_add, _elm_entry_efl_access_text_selection_add), + EFL_OBJECT_OP_FUNC(efl_access_text_selection_remove, _elm_entry_efl_access_text_selection_remove), + EFL_OBJECT_OP_FUNC(efl_access_editable_text_content_set, _elm_entry_efl_access_editable_text_text_content_set), + EFL_OBJECT_OP_FUNC(efl_access_editable_text_insert, _elm_entry_efl_access_editable_text_insert), + EFL_OBJECT_OP_FUNC(efl_access_editable_text_copy, _elm_entry_efl_access_editable_text_copy), + EFL_OBJECT_OP_FUNC(efl_access_editable_text_cut, _elm_entry_efl_access_editable_text_cut), + EFL_OBJECT_OP_FUNC(efl_access_editable_text_delete, _elm_entry_efl_access_editable_text_delete), + EFL_OBJECT_OP_FUNC(efl_access_editable_text_paste, _elm_entry_efl_access_editable_text_paste), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_entry_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_file_set, _elm_entry_efl_file_file_set), + EFL_OBJECT_OP_FUNC(efl_file_load, _elm_entry_efl_file_load), + EFL_OBJECT_OP_FUNC(efl_file_unload, _elm_entry_efl_file_unload), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_entry_efl_part_part_get), + ELM_ENTRY_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"scrollable", __eolian_elm_entry_scrollable_set_reflect, __eolian_elm_entry_scrollable_get_reflect}, + {"input_panel_show_on_demand", __eolian_elm_entry_input_panel_show_on_demand_set_reflect, __eolian_elm_entry_input_panel_show_on_demand_get_reflect}, + {"context_menu_disabled", __eolian_elm_entry_context_menu_disabled_set_reflect, __eolian_elm_entry_context_menu_disabled_get_reflect}, + {"selection_handler_disabled", __eolian_elm_entry_selection_handler_disabled_set_reflect, __eolian_elm_entry_selection_handler_disabled_get_reflect}, + {"input_panel_layout_variation", __eolian_elm_entry_input_panel_layout_variation_set_reflect, __eolian_elm_entry_input_panel_layout_variation_get_reflect}, + {"editable", __eolian_elm_entry_editable_set_reflect, __eolian_elm_entry_editable_get_reflect}, + {"anchor_hover_style", __eolian_elm_entry_anchor_hover_style_set_reflect, __eolian_elm_entry_anchor_hover_style_get_reflect}, + {"single_line", __eolian_elm_entry_single_line_set_reflect, __eolian_elm_entry_single_line_get_reflect}, + {"password", __eolian_elm_entry_password_set_reflect, __eolian_elm_entry_password_get_reflect}, + {"input_panel_return_key_disabled", __eolian_elm_entry_input_panel_return_key_disabled_set_reflect, __eolian_elm_entry_input_panel_return_key_disabled_get_reflect}, + {"autosave", __eolian_elm_entry_autosave_set_reflect, __eolian_elm_entry_autosave_get_reflect}, + {"prediction_allow", __eolian_elm_entry_prediction_allow_set_reflect, __eolian_elm_entry_prediction_allow_get_reflect}, + {"input_panel_enabled", __eolian_elm_entry_input_panel_enabled_set_reflect, __eolian_elm_entry_input_panel_enabled_get_reflect}, + {"cursor_pos", __eolian_elm_entry_cursor_pos_set_reflect, __eolian_elm_entry_cursor_pos_get_reflect}, + {"icon_visible", __eolian_elm_entry_icon_visible_set_reflect, NULL}, + {"input_panel_return_key_autoenabled", __eolian_elm_entry_input_panel_return_key_autoenabled_set_reflect, NULL}, + {"end_visible", __eolian_elm_entry_end_visible_set_reflect, NULL}, + {"select_allow", __eolian_elm_entry_select_allow_set_reflect, __eolian_elm_entry_select_allow_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_entry_class_desc = { + EO_VERSION, + "Elm.Entry", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Entry_Data), + _elm_entry_class_initializer, + _elm_entry_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_entry_class_get, &_elm_entry_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_ACCESS_TEXT_INTERFACE, EFL_ACCESS_EDITABLE_TEXT_INTERFACE, EFL_FILE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_SCROLLABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_entry_eo.legacy.c" diff --git a/src/lib/elementary/elm_entry_eo.h b/src/lib/elementary/elm_entry_eo.h index 8d7fab352c..f762563fa7 100644 --- a/src/lib/elementary/elm_entry_eo.h +++ b/src/lib/elementary/elm_entry_eo.h @@ -1 +1,1447 @@ -#include "elm_entry.eo.h" +#ifndef _ELM_ENTRY_EO_H_ +#define _ELM_ENTRY_EO_H_ + +#ifndef _ELM_ENTRY_EO_CLASS_TYPE +#define _ELM_ENTRY_EO_CLASS_TYPE + +typedef Eo Elm_Entry; + +#endif + +#ifndef _ELM_ENTRY_EO_TYPES +#define _ELM_ENTRY_EO_TYPES + + +#endif +/** Elementary entry class + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_CLASS elm_entry_class_get() + +EWAPI const Efl_Class *elm_entry_class_get(void); + +/** + * @brief Enable or disable scrolling in entry + * + * Normally the entry is not scrollable unless you enable it with this call. + * + * @param[in] obj The object. + * @param[in] scroll @c true if it is to be scrollable, @c false otherwise. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_scrollable_set(Eo *obj, Eina_Bool scroll); + +/** + * @brief Get the scrollable state of the entry + * + * Normally the entry is not scrollable. This gets the scrollable state of the + * entry. + * + * @param[in] obj The object. + * + * @return @c true if it is to be scrollable, @c false otherwise. + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_scrollable_get(const Eo *obj); + +/** + * @brief Set the attribute to show the input panel in case of only an user's + * explicit Mouse Up event. It doesn't request to show the input panel even + * though it has focus. + * + * @param[in] obj The object. + * @param[in] ondemand If @c true, the input panel will be shown in case of + * only Mouse up event. (Focus event will be ignored.) + * + * @since 1.9 + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_input_panel_show_on_demand_set(Eo *obj, Eina_Bool ondemand); + +/** + * @brief Get the attribute to show the input panel in case of only an user's + * explicit Mouse Up event. + * + * @param[in] obj The object. + * + * @return If @c true, the input panel will be shown in case of only Mouse up + * event. (Focus event will be ignored.) + * + * @since 1.9 + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_input_panel_show_on_demand_get(const Eo *obj); + +/** + * @brief This disables the entry's contextual (longpress) menu. + * + * @param[in] obj The object. + * @param[in] disabled If @c true, the menu is disabled. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_context_menu_disabled_set(Eo *obj, Eina_Bool disabled); + +/** + * @brief This returns whether the entry's contextual (longpress) menu is + * disabled. + * + * @param[in] obj The object. + * + * @return If @c true, the menu is disabled. + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_context_menu_disabled_get(const Eo *obj); + +/** + * @brief Control pasting of text and images for the widget. + * + * Normally the entry allows both text and images to be pasted. By setting + * cnp_mode to be #ELM_CNP_MODE_NO_IMAGE, this prevents images from being copy + * or past. By setting cnp_mode to be #ELM_CNP_MODE_PLAINTEXT, this remove all + * tags in text . + * + * @note This only changes the behaviour of text. + * + * @param[in] obj The object. + * @param[in] cnp_mode One of #Elm_Cnp_Mode: #ELM_CNP_MODE_MARKUP, + * #ELM_CNP_MODE_NO_IMAGE, #ELM_CNP_MODE_PLAINTEXT. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_cnp_mode_set(Eo *obj, Elm_Cnp_Mode cnp_mode); + +/** + * @brief Getting elm_entry text paste/drop mode. + * + * Normally the entry allows both text and images to be pasted. This gets the + * copy & paste mode of the entry. + * + * @param[in] obj The object. + * + * @return One of #Elm_Cnp_Mode: #ELM_CNP_MODE_MARKUP, #ELM_CNP_MODE_NO_IMAGE, + * #ELM_CNP_MODE_PLAINTEXT. + * + * @ingroup Elm_Entry + */ +EOAPI Elm_Cnp_Mode elm_obj_entry_cnp_mode_get(const Eo *obj); + +/** + * @brief Text format used to load and save the file, which could be plain text + * or markup text. + * + * Default is @c ELM_TEXT_FORMAT_PLAIN_UTF8, if you want to use + * @c ELM_TEXT_FORMAT_MARKUP_UTF8 then you need to set the text format before + * calling @ref efl_file_load. + * + * You could also set it before a call to @ref elm_obj_entry_file_save in order + * to save with the given format. + * + * Use it before calling @ref efl_file_load or @ref elm_obj_entry_file_save. + * + * @param[in] obj The object. + * @param[in] format The file format + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_file_text_format_set(Eo *obj, Elm_Text_Format format); + +/** + * @brief Set the language mode of the input panel. + * + * This API can be used if you want to show the alphabet keyboard mode. + * + * @param[in] obj The object. + * @param[in] lang Language to be set to the input panel. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_input_panel_language_set(Eo *obj, Elm_Input_Panel_Lang lang); + +/** + * @brief Get the language mode of the input panel. + * + * @param[in] obj The object. + * + * @return Language to be set to the input panel. + * + * @ingroup Elm_Entry + */ +EOAPI Elm_Input_Panel_Lang elm_obj_entry_input_panel_language_get(const Eo *obj); + +/** + * @brief This disabled the entry's selection handlers. + * + * @param[in] obj The object. + * @param[in] disabled If @c true, the selection handlers are disabled. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_selection_handler_disabled_set(Eo *obj, Eina_Bool disabled); + +/** + * @brief This returns whether the entry's selection handlers are disabled. + * + * @param[in] obj The object. + * + * @return If @c true, the selection handlers are disabled. + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_selection_handler_disabled_get(const Eo *obj); + +/** + * @brief Set the input panel layout variation of the entry + * + * @param[in] obj The object. + * @param[in] variation Layout variation type. + * + * @since 1.8 + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_input_panel_layout_variation_set(Eo *obj, int variation); + +/** + * @brief Get the input panel layout variation of the entry + * + * @param[in] obj The object. + * + * @return Layout variation type. + * + * @since 1.8 + * + * @ingroup Elm_Entry + */ +EOAPI int elm_obj_entry_input_panel_layout_variation_get(const Eo *obj); + +/** + * @brief Set the autocapitalization type on the immodule. + * + * @param[in] obj The object. + * @param[in] autocapital_type The type of autocapitalization. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_autocapital_type_set(Eo *obj, Elm_Autocapital_Type autocapital_type); + +/** + * @brief Get the autocapitalization type on the immodule. + * + * @param[in] obj The object. + * + * @return The type of autocapitalization. + * + * @ingroup Elm_Entry + */ +EOAPI Elm_Autocapital_Type elm_obj_entry_autocapital_type_get(const Eo *obj); + +/** + * @brief Sets if the entry is to be editable or not. + * + * By default, entries are editable and when focused, any text input by the + * user will be inserted at the current cursor position. But calling this + * function with @c editable as @c false will prevent the user from inputting + * text into the entry. + * + * The only way to change the text of a non-editable entry is to use @ref + * elm_object_text_set, @ref elm_entry_entry_insert and other related + * functions. + * + * @param[in] obj The object. + * @param[in] editable If @c true, user input will be inserted in the entry, if + * not, the entry is read-only and no user input is allowed. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_editable_set(Eo *obj, Eina_Bool editable); + +/** + * @brief Get whether the entry is editable or not. + * + * @param[in] obj The object. + * + * @return If @c true, user input will be inserted in the entry, if not, the + * entry is read-only and no user input is allowed. + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_editable_get(const Eo *obj); + +/** + * @brief Set the style that the hover should use + * + * When creating the popup hover, entry will request that it's themed according + * to @c style. + * + * Setting style no @c null means disabling automatic hover. + * + * @param[in] obj The object. + * @param[in] style The style to use for the underlying hover. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_anchor_hover_style_set(Eo *obj, const char *style); + +/** + * @brief Get the style that the hover should use. + * + * @param[in] obj The object. + * + * @return The style to use for the underlying hover. + * + * @ingroup Elm_Entry + */ +EOAPI const char *elm_obj_entry_anchor_hover_style_get(const Eo *obj); + +/** + * @brief Sets the entry to single line mode. + * + * In single line mode, entries don't ever wrap when the text reaches the edge, + * and instead they keep growing horizontally. Pressing the @c Enter key will + * generate an $"activate" event instead of adding a new line. + * + * When @c single_line is @c false, line wrapping takes effect again and + * pressing enter will break the text into a different line without generating + * any events. + * + * @param[in] obj The object. + * @param[in] single_line If @c true, the text in the entry will be on a single + * line. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_single_line_set(Eo *obj, Eina_Bool single_line); + +/** + * @brief Get whether the entry is set to be single line. + * + * @param[in] obj The object. + * + * @return If @c true, the text in the entry will be on a single line. + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_single_line_get(const Eo *obj); + +/** + * @brief Sets the entry to password mode. + * + * In password mode, entries are implicitly single line and the display of any + * text in them is replaced with asterisks (*). + * + * @param[in] obj The object. + * @param[in] password If @c true, password mode is enabled. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_password_set(Eo *obj, Eina_Bool password); + +/** + * @brief Get whether the entry is set to password mode. + * + * @param[in] obj The object. + * + * @return If @c true, password mode is enabled. + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_password_get(const Eo *obj); + +/** + * @brief Set the return key on the input panel to be disabled. + * + * @param[in] obj The object. + * @param[in] disabled The state to put in in: @c true for disabled, @c false + * for enabled. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_input_panel_return_key_disabled_set(Eo *obj, Eina_Bool disabled); + +/** + * @brief Get whether the return key on the input panel should be disabled or + * not. + * + * @param[in] obj The object. + * + * @return The state to put in in: @c true for disabled, @c false for enabled. + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_input_panel_return_key_disabled_get(const Eo *obj); + +/** + * @brief This sets the entry object to 'autosave' the loaded text file or not. + * + * @param[in] obj The object. + * @param[in] auto_save Autosave the loaded file or not. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_autosave_set(Eo *obj, Eina_Bool auto_save); + +/** + * @brief This gets the entry object's 'autosave' status. + * + * @param[in] obj The object. + * + * @return Autosave the loaded file or not. + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_autosave_get(const Eo *obj); + +/** + * @brief Set the parent of the hover popup + * + * Sets the parent object to use by the hover created by the entry when an + * anchor is clicked. + * + * @param[in] obj The object. + * @param[in] parent The object to use as parent for the hover. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_anchor_hover_parent_set(Eo *obj, Efl_Canvas_Object *parent); + +/** + * @brief Get the parent of the hover popup + * + * Get the object used as parent for the hover created by the entry widget. If + * no parent is set, the same entry object will be used. + * + * @param[in] obj The object. + * + * @return The object to use as parent for the hover. + * + * @ingroup Elm_Entry + */ +EOAPI Efl_Canvas_Object *elm_obj_entry_anchor_hover_parent_get(const Eo *obj); + +/** + * @brief Set whether the entry should allow to use the text prediction. + * + * @param[in] obj The object. + * @param[in] prediction Whether the entry should allow to use the text + * prediction. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_prediction_allow_set(Eo *obj, Eina_Bool prediction); + +/** + * @brief Get whether the entry should allow to use the text prediction. + * + * @param[in] obj The object. + * + * @return Whether the entry should allow to use the text prediction. + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_prediction_allow_get(const Eo *obj); + +/** + * @brief Sets the input hint which allows input methods to fine-tune their + * behavior. + * + * @param[in] obj The object. + * @param[in] hints Input hint. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_input_hint_set(Eo *obj, Elm_Input_Hints hints); + +/** + * @brief Gets the value of input hint. + * + * @param[in] obj The object. + * + * @return Input hint. + * + * @ingroup Elm_Entry + */ +EOAPI Elm_Input_Hints elm_obj_entry_input_hint_get(const Eo *obj); + +/** + * @brief Set the input panel layout of the entry. + * + * @param[in] obj The object. + * @param[in] layout Layout type. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_input_panel_layout_set(Eo *obj, Elm_Input_Panel_Layout layout); + +/** + * @brief Get the input panel layout of the entry. + * + * @param[in] obj The object. + * + * @return Layout type. + * + * @ingroup Elm_Entry + */ +EOAPI Elm_Input_Panel_Layout elm_obj_entry_input_panel_layout_get(const Eo *obj); + +/** + * @brief Set the "return" key type. This type is used to set string or icon on + * the "return" key of the input panel. + * + * An input panel displays the string or icon associated with this type. + * + * Regardless of return key type, "activated" event will be generated when + * pressing return key in single line entry. + * + * @param[in] obj The object. + * @param[in] return_key_type The type of "return" key on the input panel. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_input_panel_return_key_type_set(Eo *obj, Elm_Input_Panel_Return_Key_Type return_key_type); + +/** + * @brief Get the "return" key type. + * + * @param[in] obj The object. + * + * @return The type of "return" key on the input panel. + * + * @ingroup Elm_Entry + */ +EOAPI Elm_Input_Panel_Return_Key_Type elm_obj_entry_input_panel_return_key_type_get(const Eo *obj); + +/** + * @brief Sets the attribute to show the input panel automatically. + * + * @param[in] obj The object. + * @param[in] enabled If @c true, the input panel is appeared when entry is + * clicked or has a focus. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_input_panel_enabled_set(Eo *obj, Eina_Bool enabled); + +/** + * @brief Get the attribute to show the input panel automatically. + * + * @param[in] obj The object. + * + * @return If @c true, the input panel is appeared when entry is clicked or has + * a focus. + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_input_panel_enabled_get(const Eo *obj); + +/** + * @brief Set the line wrap type to use on multi-line entries. + * + * Sets the wrap type used by the entry to any of the specified in + * Elm_Wrap_Type. This tells how the text will be implicitly cut into a new + * line (without inserting a line break or paragraph separator) when it reaches + * the far edge of the widget. + * + * Note that this only makes sense for multi-line entries. A widget set to be + * single line will never wrap. + * + * @param[in] obj The object. + * @param[in] wrap The wrap mode to use. See Elm_Wrap_Type for details on them. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_line_wrap_set(Eo *obj, Elm_Wrap_Type wrap); + +/** + * @brief Get the wrap mode the entry was set to use. + * + * @param[in] obj The object. + * + * @return The wrap mode to use. See Elm_Wrap_Type for details on them. + * + * @ingroup Elm_Entry + */ +EOAPI Elm_Wrap_Type elm_obj_entry_line_wrap_get(const Eo *obj); + +/** + * @brief Sets the cursor position in the entry to the given value + * + * The value in @c pos is the index of the character position within the + * contents of the string as returned by @ref elm_obj_entry_cursor_pos_get. + * + * @param[in] obj The object. + * @param[in] pos The position of the cursor. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_cursor_pos_set(Eo *obj, int pos); + +/** + * @brief Get the current position of the cursor in the entry. + * + * @param[in] obj The object. + * + * @return The position of the cursor. + * + * @ingroup Elm_Entry + */ +EOAPI int elm_obj_entry_cursor_pos_get(const Eo *obj); + +/** + * @brief Sets the visibility of the left-side widget of the entry, set by @ref + * elm_object_part_content_set. + * + * @param[in] obj The object. + * @param[in] setting @c true if the object should be displayed, @c false if + * not. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_icon_visible_set(Eo *obj, Eina_Bool setting); + +/** This moves the cursor to the end of the current line. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_cursor_line_end_set(Eo *obj); + +/** + * @brief This selects a region of text within the entry. + * + * @param[in] obj The object. + * @param[in] start The starting position. + * @param[in] end The end position. + * + * @since 1.9 + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_select_region_set(Eo *obj, int start, int end); + +/** + * @brief Get the current position of the selection cursors in the entry. + * + * @param[in] obj The object. + * @param[out] start The starting position. + * @param[out] end The end position. + * + * @since 1.18 + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_select_region_get(const Eo *obj, int *start, int *end); + +/** + * @brief Set whether the return key on the input panel is disabled + * automatically when entry has no text. + * + * If @c enabled is @c true, The return key on input panel is disabled when the + * entry has no text. The return key on the input panel is automatically + * enabled when the entry has text. The default value is @c false. + * + * @param[in] obj The object. + * @param[in] enabled If @c enabled is @c true, the return key is automatically + * disabled when the entry has no text. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_input_panel_return_key_autoenabled_set(Eo *obj, Eina_Bool enabled); + +/** + * @brief Sets the visibility of the end widget of the entry, set by @ref + * elm_object_part_content_set(ent, "end", content). + * + * @param[in] obj The object. + * @param[in] setting @c true if the object should be displayed, false if not. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_end_visible_set(Eo *obj, Eina_Bool setting); + +/** This moves the cursor to the beginning of the entry. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_cursor_begin_set(Eo *obj); + +/** This moves the cursor to the beginning of the current line. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_cursor_line_begin_set(Eo *obj); + +/** This moves the cursor to the end of the entry. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_cursor_end_set(Eo *obj); + +/** + * @brief Returns the actual textblock object of the entry. + * + * This function exposes the internal textblock object that actually contains + * and draws the text. This should be used for low-level manipulations that are + * otherwise not possible. + * + * Changing the textblock directly from here will not notify edje/elm to + * recalculate the textblock size automatically, so any modifications done to + * the textblock returned by this function should be followed by a call to @ref + * elm_entry_calc_force. + * + * The return value is marked as const as an additional warning. One should not + * use the returned object with any of the generic evas functions + * (geometry_get/resize/move and etc), but only with the textblock functions; + * The former will either not work at all, or break the correct functionality. + * + * IMPORTANT: Many functions may change (i.e delete and create a new one) the + * internal textblock object. Do NOT cache the returned object, and try not to + * mix calls on this object with regular elm_entry calls (which may change the + * internal textblock object). This applies to all cursors returned from + * textblock calls, and all the other derivative values. + * + * @param[in] obj The object. + * + * @return Textblock object + * + * @ingroup Elm_Entry + */ +EOAPI Efl_Canvas_Object *elm_obj_entry_textblock_get(const Eo *obj); + +/** + * @brief This function returns the geometry of the cursor. + * + * It's useful if you want to draw something on the cursor (or where it is), or + * for example in the case of scrolled entry where you want to show the cursor. + * + * @param[in] obj The object. + * @param[out] x X coordinate + * @param[out] y Y coordinate + * @param[out] w Width + * @param[out] h Height + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_textblock_cursor_geometry_get(const Eo *obj, int *x, int *y, int *w, int *h); + +/** + * @brief Returns the input method context of the entry. + * + * This function exposes the internal input method context. + * + * IMPORTANT: Many functions may change (i.e delete and create a new one) the + * internal input method context. Do NOT cache the returned object. + * + * @param[in] obj The object. + * + * @return Input method context + * + * @ingroup Elm_Entry + */ +EOAPI void *elm_obj_entry_imf_context_get(const Eo *obj); + +/** + * @brief Get whether a format node exists at the current cursor position. + * + * A format node is anything that defines how the text is rendered. It can be a + * visible format node, such as a line break or a paragraph separator, or an + * invisible one, such as bold begin or end tag. This function returns whether + * any format node exists at the current cursor position. + * + * @param[in] obj The object. + * + * @return @c true if format node exists, @c false otherwise + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_cursor_is_format_get(const Eo *obj); + +/** + * @brief Get the character pointed by the cursor at its current position. + * + * This function returns a string with the utf8 character stored at the current + * cursor position. 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. + * + * @param[in] obj The object. + * + * @return Character + * + * @ingroup Elm_Entry + */ +EOAPI char *elm_obj_entry_textblock_cursor_content_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get any selected text within the entry. + * + * If there's any selected text in the entry, this function returns it as a + * string in markup format. @c null is returned if no selection exists or if an + * error occurred. + * + * The returned value points to an internal string and should not be freed or + * modified in any way. If the @c entry object is deleted or its contents are + * changed, the returned pointer should be considered invalid. + * + * @param[in] obj The object. + * + * @return Selected string + * + * @ingroup Elm_Entry + */ +EOAPI const char *elm_obj_entry_selection_get(const Eo *obj); + +/** + * @brief Get if the current cursor position holds a visible format node. + * + * @param[in] obj The object. + * + * @return @c true if position has a visible format, @c false otherwise + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_cursor_is_visible_format_get(const Eo *obj); + +/** + * @brief Allow selection in the entry. + * + * @param[in] obj The object. + * @param[in] allow If @c allow is true, the text selection is allowed. + * + * @since 1.18 + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_select_allow_set(Eo *obj, Eina_Bool allow); + +/** + * @brief Allow selection in the entry. + * + * @param[in] obj The object. + * + * @return If @c allow is true, the text selection is allowed. + * + * @since 1.18 + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_select_allow_get(const Eo *obj); + +/** + * @brief This moves the cursor one place to the left within the entry. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_cursor_prev(Eo *obj); + +/** Remove the style in the top of user style stack. + * + * @since 1.7 + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_text_style_user_pop(Eo *obj); + +/** + * @brief This prepends a custom item provider to the list for that entry + * + * This prepends the given callback. + * + * @param[in] obj The object. + * @param[in] func The function called to provide the item object. + * @param[in] data The data passed to @c func. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_item_provider_prepend(Eo *obj, Elm_Entry_Item_Provider_Cb func, void *data); + +/** + * @brief Show the input panel (virtual keyboard) based on the input panel + * property of entry such as layout, autocapital types, and so on. + * + * Note that input panel is shown or hidden automatically according to the + * focus state of entry widget. This API can be used in the case of manually + * controlling by using @ref elm_obj_entry_input_panel_enabled_set(en, + * @c false). + * @param[in] obj The object. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_input_panel_show(Eo *obj); + +/** + * @brief Reset the input method context of the entry if needed. + * + * This can be necessary in the case where modifying the buffer would confuse + * on-going input method behavior. This will typically cause the Input Method + * Context to clear the preedit state. + * @param[in] obj The object. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_imf_context_reset(Eo *obj); + +/** + * @brief Ends the hover popup in the entry + * + * When an anchor is clicked, the entry widget will create a hover object to + * use as a popup with user provided content. This function terminates this + * popup, returning the entry to its normal state. + * @param[in] obj The object. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_anchor_hover_end(Eo *obj); + +/** This begins a selection within the entry as though the user were holding + * down the mouse button to make a selection. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_cursor_selection_begin(Eo *obj); + +/** + * @brief This moves the cursor one line down within the entry. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_cursor_down(Eo *obj); + +/** This function writes any changes made to the file set with @ref + * elm_entry_file_set. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_file_save(Eo *obj); + +/** This executes a "copy" action on the selected text in the entry. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_selection_copy(Eo *obj); + +/** + * @brief Push the style to the top of user style stack. If there is styles in + * the user style stack, the properties in the top style of user style stack + * will replace the properties in current theme. The input style is specified + * in format tag='property=value' (i.e. DEFAULT='font=Sans + * font_size=60'hilight=' + font_weight=Bold'). + * + * @param[in] obj The object. + * @param[in] style The style user to push. + * + * @since 1.7 + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_text_style_user_push(Eo *obj, const char *style); + +/** + * @brief This removes a custom item provider to the list for that entry + * + * This removes the given callback. See @ref elm_obj_entry_item_provider_append + * for more information + * + * @param[in] obj The object. + * @param[in] func The function called to provide the item object. + * @param[in] data The data passed to @c func. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_item_provider_remove(Eo *obj, Elm_Entry_Item_Provider_Cb func, void *data); + +/** + * @brief Get the style on the top of user style stack. + * + * See also @ref elm_obj_entry_text_style_user_push. + * + * @param[in] obj The object. + * + * @return Style + * + * @since 1.7 + * + * @ingroup Elm_Entry + */ +EOAPI const char *elm_obj_entry_text_style_user_peek(const Eo *obj); + +/** + * @brief This clears and frees the items in a entry's contextual (longpress) + * menu. + * + * See also @ref elm_obj_entry_context_menu_item_add. + * @param[in] obj The object. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_context_menu_clear(Eo *obj); + +/** + * @brief This moves the cursor one line up within the entry. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_cursor_up(Eo *obj); + +/** + * @brief Inserts the given text into the entry at the current cursor position. + * + * This inserts text at the cursor position as if it was typed by the user + * (note that this also allows markup which a user can't just "type" as it + * would be converted to escaped text, so this call can be used to insert + * things like emoticon items or bold push/pop tags, other font and color + * change tags etc.) + * + * If any selection exists, it will be replaced by the inserted text. + * + * The inserted text is subject to any filters set for the widget. + * + * See also @ref elm_obj_entry_markup_filter_append. + * + * @param[in] obj The object. + * @param[in] entry The text to insert. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_insert(Eo *obj, const char *entry); + +/** + * @brief Set the input panel-specific data to deliver to the input panel. + * + * This API is used by applications to deliver specific data to the input + * panel. The data format MUST be negotiated by both application and the input + * panel. The size and format of data are defined by the input panel. + * + * @param[in] obj The object. + * @param[in] data The specific data to be set to the input panel. + * @param[in] len The length of data, in bytes, to send to the input panel. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_input_panel_imdata_set(Eo *obj, const void *data, int len); + +/** + * @brief Get the specific data of the current input panel. + * + * @param[in] obj The object. + * @param[out] data The specific data to be got from the input panel. + * @param[out] len The length of data. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_input_panel_imdata_get(const Eo *obj, void *data, int *len); + +/** This executes a "paste" action in the entry. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_selection_paste(Eo *obj); + +/** + * @brief This moves the cursor one place to the right within the entry. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_cursor_next(Eo *obj); + +/** This drops any existing text selection within the entry. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_select_none(Eo *obj); + +/** + * @brief Hide the input panel (virtual keyboard). + * + * Note that input panel is shown or hidden automatically according to the + * focus state of entry widget. This API can be used in the case of manually + * controlling by using @ref elm_obj_entry_input_panel_enabled_set(en, + * @c false) + * @param[in] obj The object. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_input_panel_hide(Eo *obj); + +/** This selects all text within the entry. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_select_all(Eo *obj); + +/** This ends a selection within the entry as though the user had just released + * the mouse button while making a selection. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_cursor_selection_end(Eo *obj); + +/** This executes a "cut" action on the selected text in the entry. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_selection_cut(Eo *obj); + +/** + * @brief Get whether the entry is empty. + * + * Empty means no text at all. If there are any markup tags, like an item tag + * for which no provider finds anything, and no text is displayed, this + * function still returns @c false. + * + * @param[in] obj The object. + * + * @return @c true if empty, @c false otherwise + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_is_empty(const Eo *obj); + +/** + * @brief Remove a markup filter from the list + * + * Removes the given callback from the filter list. See + * @ref elm_obj_entry_markup_filter_append for more information. + * + * @param[in] obj The object. + * @param[in] func The filter function to remove. + * @param[in] data The user data passed when adding the function. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_markup_filter_remove(Eo *obj, Elm_Entry_Filter_Cb func, void *data); + +/** + * @brief 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 @c 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. + * + * @param[in] obj The object. + * @param[in] func The function called to provide the item object. + * @param[in] data The data passed to @c func. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_item_provider_append(Eo *obj, Elm_Entry_Item_Provider_Cb func, void *data); + +/** + * @brief Append a markup filter function for text inserted in the entry + * + * Append the given callback to the list. This functions will be called + * whenever any text is inserted into the entry, with the text to be inserted + * as a parameter. The type of given text is always markup. The callback + * function is free to alter the text in any way it wants, but it must remember + * to free the given pointer and update it. If the new text is to be discarded, + * the function can free it and set its text parameter to @c null. This will + * also prevent any following filters from being called. + * + * @param[in] obj The object. + * @param[in] func The function to use as text filter. + * @param[in] data User data to pass to @c func. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_markup_filter_append(Eo *obj, Elm_Entry_Filter_Cb func, void *data); + +/** + * @brief Appends @c str to the text of the entry. + * + * Adds the text in @c str to the end of any text already present in the + * widget. + * + * The appended text is subject to any filters set for the widget. + * + * See also @ref elm_obj_entry_markup_filter_append. + * + * @param[in] obj The object. + * @param[in] str The text to be appended. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_append(Eo *obj, const char *str); + +/** + * @brief This adds an item to the entry's contextual menu. + * + * A longpress on an entry will make the contextual menu show up, if this + * hasn't been disabled with @ref elm_obj_entry_context_menu_disabled_set. By + * default, this menu provides a few options like enabling selection mode, + * which is useful on embedded devices that need to be explicit about it, and + * when a selection exists it also shows the copy and cut actions. + * + * With this function, developers can add other options to this menu to perform + * any action they deem necessary. + * + * @param[in] obj The object. + * @param[in] label The item's text label. + * @param[in] icon_file The item's icon file. + * @param[in] icon_type The item's icon type. + * @param[in] func The callback to execute when the item is clicked. + * @param[in] data The data to associate with the item for related functions. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_context_menu_item_add(Eo *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data); + +/** + * @brief Prepend a markup filter function for text inserted in the entry + * + * Prepend the given callback to the list. + * + * @param[in] obj The object. + * @param[in] func The function to use as text filter. + * @param[in] data User data to pass to @c func. + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_markup_filter_prepend(Eo *obj, Elm_Entry_Filter_Cb func, void *data); + +/** + * @brief Sets the prediction hint to use an intelligent reply suggestion + * service. + * + * @param[in] obj The object. + * @param[in] prediction_hint The prediction hint text. + * + * @since 1.20 + * + * @ingroup Elm_Entry + */ +EOAPI void elm_obj_entry_prediction_hint_set(Eo *obj, const char *prediction_hint); + +/** + * @brief Sets the prediction hint data at the specified key. + * + * @param[in] obj The object. + * @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 + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_prediction_hint_hash_set(Eo *obj, const char *key, const char *value); + +/** + * @brief Removes the prediction hint data identified by a key. + * + * @param[in] obj The object. + * @param[in] key The key of the prediction hint. + * + * @return @c true on success, @c false otherwise + * + * @since 1.21 + * + * @ingroup Elm_Entry + */ +EOAPI Eina_Bool elm_obj_entry_prediction_hint_hash_del(Eo *obj, const char *key); + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_ACTIVATED; + +/** Called when entry got activated + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_ACTIVATED (&(_ELM_ENTRY_EVENT_ACTIVATED)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_CHANGED; + +/** Called when entry changed + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_CHANGED (&(_ELM_ENTRY_EVENT_CHANGED)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_CHANGED_USER; + +/** Called when the object changed due to user interaction + * @return Elm_Entry_Change_Info + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_CHANGED_USER (&(_ELM_ENTRY_EVENT_CHANGED_USER)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_VALIDATE; + +/** Called when validating + * @return Elm_Validate_Content + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_VALIDATE (&(_ELM_ENTRY_EVENT_VALIDATE)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_CONTEXT_OPEN; + +/** Called when context menu was opened + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_CONTEXT_OPEN (&(_ELM_ENTRY_EVENT_CONTEXT_OPEN)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_ANCHOR_CLICKED; + +/** Called when anchor was clicked + * @return Elm_Entry_Anchor_Info + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_ANCHOR_CLICKED (&(_ELM_ENTRY_EVENT_ANCHOR_CLICKED)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_REJECTED; + +/** Called when entry was rejected + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_REJECTED (&(_ELM_ENTRY_EVENT_REJECTED)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_MAXLENGTH_REACHED; + +/** Called when maximum entry length has been reached + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_MAXLENGTH_REACHED (&(_ELM_ENTRY_EVENT_MAXLENGTH_REACHED)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_PREEDIT_CHANGED; + +/** Called when entry preedit changed + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_PREEDIT_CHANGED (&(_ELM_ENTRY_EVENT_PREEDIT_CHANGED)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_PRESS; + +/** Called when entry pressed + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_PRESS (&(_ELM_ENTRY_EVENT_PRESS)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_REDO_REQUEST; + +/** Called when redo was requested + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_REDO_REQUEST (&(_ELM_ENTRY_EVENT_REDO_REQUEST)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_UNDO_REQUEST; + +/** Called when undo was requested + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_UNDO_REQUEST (&(_ELM_ENTRY_EVENT_UNDO_REQUEST)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_TEXT_SET_DONE; + +/** Called when text set finished + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_TEXT_SET_DONE (&(_ELM_ENTRY_EVENT_TEXT_SET_DONE)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_ABORTED; + +/** Called when entry was aborted + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_ABORTED (&(_ELM_ENTRY_EVENT_ABORTED)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_ANCHOR_DOWN; + +/** Called on anchor down + * @return Elm_Entry_Anchor_Info + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_ANCHOR_DOWN (&(_ELM_ENTRY_EVENT_ANCHOR_DOWN)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_ANCHOR_HOVER_OPENED; + +/** Called when hover opened + * @return Elm_Entry_Anchor_Hover_Info + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_ANCHOR_HOVER_OPENED (&(_ELM_ENTRY_EVENT_ANCHOR_HOVER_OPENED)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_ANCHOR_IN; + +/** Called on anchor in + * @return Elm_Entry_Anchor_Info + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_ANCHOR_IN (&(_ELM_ENTRY_EVENT_ANCHOR_IN)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_ANCHOR_OUT; + +/** Called on anchor out + * @return Elm_Entry_Anchor_Info + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_ANCHOR_OUT (&(_ELM_ENTRY_EVENT_ANCHOR_OUT)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_ANCHOR_UP; + +/** called on anchor up + * @return Elm_Entry_Anchor_Info + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_ANCHOR_UP (&(_ELM_ENTRY_EVENT_ANCHOR_UP)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_CURSOR_CHANGED; + +/** Called on cursor changed + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_CURSOR_CHANGED (&(_ELM_ENTRY_EVENT_CURSOR_CHANGED)) + +EWAPI extern const Efl_Event_Description _ELM_ENTRY_EVENT_CURSOR_CHANGED_MANUAL; + +/** Called on manual cursor change + * + * @ingroup Elm_Entry + */ +#define ELM_ENTRY_EVENT_CURSOR_CHANGED_MANUAL (&(_ELM_ENTRY_EVENT_CURSOR_CHANGED_MANUAL)) + +#endif diff --git a/src/lib/elementary/elm_entry_eo.legacy.c b/src/lib/elementary/elm_entry_eo.legacy.c new file mode 100644 index 0000000000..b5bf557b88 --- /dev/null +++ b/src/lib/elementary/elm_entry_eo.legacy.c @@ -0,0 +1,582 @@ + +EAPI void +elm_entry_scrollable_set(Elm_Entry *obj, Eina_Bool scroll) +{ + elm_obj_entry_scrollable_set(obj, scroll); +} + +EAPI Eina_Bool +elm_entry_scrollable_get(const Elm_Entry *obj) +{ + return elm_obj_entry_scrollable_get(obj); +} + +EAPI void +elm_entry_input_panel_show_on_demand_set(Elm_Entry *obj, Eina_Bool ondemand) +{ + elm_obj_entry_input_panel_show_on_demand_set(obj, ondemand); +} + +EAPI Eina_Bool +elm_entry_input_panel_show_on_demand_get(const Elm_Entry *obj) +{ + return elm_obj_entry_input_panel_show_on_demand_get(obj); +} + +EAPI void +elm_entry_context_menu_disabled_set(Elm_Entry *obj, Eina_Bool disabled) +{ + elm_obj_entry_context_menu_disabled_set(obj, disabled); +} + +EAPI Eina_Bool +elm_entry_context_menu_disabled_get(const Elm_Entry *obj) +{ + return elm_obj_entry_context_menu_disabled_get(obj); +} + +EAPI void +elm_entry_cnp_mode_set(Elm_Entry *obj, Elm_Cnp_Mode cnp_mode) +{ + elm_obj_entry_cnp_mode_set(obj, cnp_mode); +} + +EAPI Elm_Cnp_Mode +elm_entry_cnp_mode_get(const Elm_Entry *obj) +{ + return elm_obj_entry_cnp_mode_get(obj); +} + +EAPI void +elm_entry_file_text_format_set(Elm_Entry *obj, Elm_Text_Format format) +{ + elm_obj_entry_file_text_format_set(obj, format); +} + +EAPI void +elm_entry_input_panel_language_set(Elm_Entry *obj, Elm_Input_Panel_Lang lang) +{ + elm_obj_entry_input_panel_language_set(obj, lang); +} + +EAPI Elm_Input_Panel_Lang +elm_entry_input_panel_language_get(const Elm_Entry *obj) +{ + return elm_obj_entry_input_panel_language_get(obj); +} + +EAPI void +elm_entry_selection_handler_disabled_set(Elm_Entry *obj, Eina_Bool disabled) +{ + elm_obj_entry_selection_handler_disabled_set(obj, disabled); +} + +EAPI void +elm_entry_input_panel_layout_variation_set(Elm_Entry *obj, int variation) +{ + elm_obj_entry_input_panel_layout_variation_set(obj, variation); +} + +EAPI int +elm_entry_input_panel_layout_variation_get(const Elm_Entry *obj) +{ + return elm_obj_entry_input_panel_layout_variation_get(obj); +} + +EAPI void +elm_entry_autocapital_type_set(Elm_Entry *obj, Elm_Autocapital_Type autocapital_type) +{ + elm_obj_entry_autocapital_type_set(obj, autocapital_type); +} + +EAPI Elm_Autocapital_Type +elm_entry_autocapital_type_get(const Elm_Entry *obj) +{ + return elm_obj_entry_autocapital_type_get(obj); +} + +EAPI void +elm_entry_editable_set(Elm_Entry *obj, Eina_Bool editable) +{ + elm_obj_entry_editable_set(obj, editable); +} + +EAPI Eina_Bool +elm_entry_editable_get(const Elm_Entry *obj) +{ + return elm_obj_entry_editable_get(obj); +} + +EAPI void +elm_entry_anchor_hover_style_set(Elm_Entry *obj, const char *style) +{ + elm_obj_entry_anchor_hover_style_set(obj, style); +} + +EAPI const char * +elm_entry_anchor_hover_style_get(const Elm_Entry *obj) +{ + return elm_obj_entry_anchor_hover_style_get(obj); +} + +EAPI void +elm_entry_single_line_set(Elm_Entry *obj, Eina_Bool single_line) +{ + elm_obj_entry_single_line_set(obj, single_line); +} + +EAPI Eina_Bool +elm_entry_single_line_get(const Elm_Entry *obj) +{ + return elm_obj_entry_single_line_get(obj); +} + +EAPI void +elm_entry_password_set(Elm_Entry *obj, Eina_Bool password) +{ + elm_obj_entry_password_set(obj, password); +} + +EAPI Eina_Bool +elm_entry_password_get(const Elm_Entry *obj) +{ + return elm_obj_entry_password_get(obj); +} + +EAPI void +elm_entry_input_panel_return_key_disabled_set(Elm_Entry *obj, Eina_Bool disabled) +{ + elm_obj_entry_input_panel_return_key_disabled_set(obj, disabled); +} + +EAPI Eina_Bool +elm_entry_input_panel_return_key_disabled_get(const Elm_Entry *obj) +{ + return elm_obj_entry_input_panel_return_key_disabled_get(obj); +} + +EAPI void +elm_entry_autosave_set(Elm_Entry *obj, Eina_Bool auto_save) +{ + elm_obj_entry_autosave_set(obj, auto_save); +} + +EAPI Eina_Bool +elm_entry_autosave_get(const Elm_Entry *obj) +{ + return elm_obj_entry_autosave_get(obj); +} + +EAPI void +elm_entry_anchor_hover_parent_set(Elm_Entry *obj, Efl_Canvas_Object *parent) +{ + elm_obj_entry_anchor_hover_parent_set(obj, parent); +} + +EAPI Efl_Canvas_Object * +elm_entry_anchor_hover_parent_get(const Elm_Entry *obj) +{ + return elm_obj_entry_anchor_hover_parent_get(obj); +} + +EAPI void +elm_entry_prediction_allow_set(Elm_Entry *obj, Eina_Bool prediction) +{ + elm_obj_entry_prediction_allow_set(obj, prediction); +} + +EAPI Eina_Bool +elm_entry_prediction_allow_get(const Elm_Entry *obj) +{ + return elm_obj_entry_prediction_allow_get(obj); +} + +EAPI void +elm_entry_input_hint_set(Elm_Entry *obj, Elm_Input_Hints hints) +{ + elm_obj_entry_input_hint_set(obj, hints); +} + +EAPI Elm_Input_Hints +elm_entry_input_hint_get(const Elm_Entry *obj) +{ + return elm_obj_entry_input_hint_get(obj); +} + +EAPI void +elm_entry_input_panel_layout_set(Elm_Entry *obj, Elm_Input_Panel_Layout layout) +{ + elm_obj_entry_input_panel_layout_set(obj, layout); +} + +EAPI Elm_Input_Panel_Layout +elm_entry_input_panel_layout_get(const Elm_Entry *obj) +{ + return elm_obj_entry_input_panel_layout_get(obj); +} + +EAPI void +elm_entry_input_panel_return_key_type_set(Elm_Entry *obj, Elm_Input_Panel_Return_Key_Type return_key_type) +{ + elm_obj_entry_input_panel_return_key_type_set(obj, return_key_type); +} + +EAPI Elm_Input_Panel_Return_Key_Type +elm_entry_input_panel_return_key_type_get(const Elm_Entry *obj) +{ + return elm_obj_entry_input_panel_return_key_type_get(obj); +} + +EAPI void +elm_entry_input_panel_enabled_set(Elm_Entry *obj, Eina_Bool enabled) +{ + elm_obj_entry_input_panel_enabled_set(obj, enabled); +} + +EAPI Eina_Bool +elm_entry_input_panel_enabled_get(const Elm_Entry *obj) +{ + return elm_obj_entry_input_panel_enabled_get(obj); +} + +EAPI void +elm_entry_line_wrap_set(Elm_Entry *obj, Elm_Wrap_Type wrap) +{ + elm_obj_entry_line_wrap_set(obj, wrap); +} + +EAPI Elm_Wrap_Type +elm_entry_line_wrap_get(const Elm_Entry *obj) +{ + return elm_obj_entry_line_wrap_get(obj); +} + +EAPI void +elm_entry_cursor_pos_set(Elm_Entry *obj, int pos) +{ + elm_obj_entry_cursor_pos_set(obj, pos); +} + +EAPI int +elm_entry_cursor_pos_get(const Elm_Entry *obj) +{ + return elm_obj_entry_cursor_pos_get(obj); +} + +EAPI void +elm_entry_icon_visible_set(Elm_Entry *obj, Eina_Bool setting) +{ + elm_obj_entry_icon_visible_set(obj, setting); +} + +EAPI void +elm_entry_cursor_line_end_set(Elm_Entry *obj) +{ + elm_obj_entry_cursor_line_end_set(obj); +} + +EAPI void +elm_entry_select_region_set(Elm_Entry *obj, int start, int end) +{ + elm_obj_entry_select_region_set(obj, start, end); +} + +EAPI void +elm_entry_select_region_get(const Elm_Entry *obj, int *start, int *end) +{ + elm_obj_entry_select_region_get(obj, start, end); +} + +EAPI void +elm_entry_input_panel_return_key_autoenabled_set(Elm_Entry *obj, Eina_Bool enabled) +{ + elm_obj_entry_input_panel_return_key_autoenabled_set(obj, enabled); +} + +EAPI void +elm_entry_end_visible_set(Elm_Entry *obj, Eina_Bool setting) +{ + elm_obj_entry_end_visible_set(obj, setting); +} + +EAPI void +elm_entry_cursor_begin_set(Elm_Entry *obj) +{ + elm_obj_entry_cursor_begin_set(obj); +} + +EAPI void +elm_entry_cursor_line_begin_set(Elm_Entry *obj) +{ + elm_obj_entry_cursor_line_begin_set(obj); +} + +EAPI void +elm_entry_cursor_end_set(Elm_Entry *obj) +{ + elm_obj_entry_cursor_end_set(obj); +} + +EAPI Efl_Canvas_Object * +elm_entry_textblock_get(const Elm_Entry *obj) +{ + return elm_obj_entry_textblock_get(obj); +} + +EAPI Eina_Bool +elm_entry_cursor_geometry_get(const Elm_Entry *obj, int *x, int *y, int *w, int *h) +{ + return elm_obj_entry_textblock_cursor_geometry_get(obj, x, y, w, h); +} + +EAPI void * +elm_entry_imf_context_get(const Elm_Entry *obj) +{ + return elm_obj_entry_imf_context_get(obj); +} + +EAPI Eina_Bool +elm_entry_cursor_is_format_get(const Elm_Entry *obj) +{ + return elm_obj_entry_cursor_is_format_get(obj); +} + +EAPI char * +elm_entry_cursor_content_get(const Elm_Entry *obj) +{ + return elm_obj_entry_textblock_cursor_content_get(obj); +} + +EAPI const char * +elm_entry_selection_get(const Elm_Entry *obj) +{ + return elm_obj_entry_selection_get(obj); +} + +EAPI Eina_Bool +elm_entry_cursor_is_visible_format_get(const Elm_Entry *obj) +{ + return elm_obj_entry_cursor_is_visible_format_get(obj); +} + +EAPI void +elm_entry_select_allow_set(Elm_Entry *obj, Eina_Bool allow) +{ + elm_obj_entry_select_allow_set(obj, allow); +} + +EAPI Eina_Bool +elm_entry_select_allow_get(const Elm_Entry *obj) +{ + return elm_obj_entry_select_allow_get(obj); +} + +EAPI Eina_Bool +elm_entry_cursor_prev(Elm_Entry *obj) +{ + return elm_obj_entry_cursor_prev(obj); +} + +EAPI void +elm_entry_text_style_user_pop(Elm_Entry *obj) +{ + elm_obj_entry_text_style_user_pop(obj); +} + +EAPI void +elm_entry_item_provider_prepend(Elm_Entry *obj, Elm_Entry_Item_Provider_Cb func, void *data) +{ + elm_obj_entry_item_provider_prepend(obj, func, data); +} + +EAPI void +elm_entry_input_panel_show(Elm_Entry *obj) +{ + elm_obj_entry_input_panel_show(obj); +} + +EAPI void +elm_entry_imf_context_reset(Elm_Entry *obj) +{ + elm_obj_entry_imf_context_reset(obj); +} + +EAPI void +elm_entry_anchor_hover_end(Elm_Entry *obj) +{ + elm_obj_entry_anchor_hover_end(obj); +} + +EAPI void +elm_entry_cursor_selection_begin(Elm_Entry *obj) +{ + elm_obj_entry_cursor_selection_begin(obj); +} + +EAPI Eina_Bool +elm_entry_cursor_down(Elm_Entry *obj) +{ + return elm_obj_entry_cursor_down(obj); +} + +EAPI void +elm_entry_file_save(Elm_Entry *obj) +{ + elm_obj_entry_file_save(obj); +} + +EAPI void +elm_entry_selection_copy(Elm_Entry *obj) +{ + elm_obj_entry_selection_copy(obj); +} + +EAPI void +elm_entry_text_style_user_push(Elm_Entry *obj, const char *style) +{ + elm_obj_entry_text_style_user_push(obj, style); +} + +EAPI void +elm_entry_item_provider_remove(Elm_Entry *obj, Elm_Entry_Item_Provider_Cb func, void *data) +{ + elm_obj_entry_item_provider_remove(obj, func, data); +} + +EAPI const char * +elm_entry_text_style_user_peek(const Elm_Entry *obj) +{ + return elm_obj_entry_text_style_user_peek(obj); +} + +EAPI void +elm_entry_context_menu_clear(Elm_Entry *obj) +{ + elm_obj_entry_context_menu_clear(obj); +} + +EAPI Eina_Bool +elm_entry_cursor_up(Elm_Entry *obj) +{ + return elm_obj_entry_cursor_up(obj); +} + +EAPI void +elm_entry_entry_insert(Elm_Entry *obj, const char *entry) +{ + elm_obj_entry_insert(obj, entry); +} + +EAPI void +elm_entry_input_panel_imdata_set(Elm_Entry *obj, const void *data, int len) +{ + elm_obj_entry_input_panel_imdata_set(obj, data, len); +} + +EAPI void +elm_entry_input_panel_imdata_get(const Elm_Entry *obj, void *data, int *len) +{ + elm_obj_entry_input_panel_imdata_get(obj, data, len); +} + +EAPI void +elm_entry_selection_paste(Elm_Entry *obj) +{ + elm_obj_entry_selection_paste(obj); +} + +EAPI Eina_Bool +elm_entry_cursor_next(Elm_Entry *obj) +{ + return elm_obj_entry_cursor_next(obj); +} + +EAPI void +elm_entry_select_none(Elm_Entry *obj) +{ + elm_obj_entry_select_none(obj); +} + +EAPI void +elm_entry_input_panel_hide(Elm_Entry *obj) +{ + elm_obj_entry_input_panel_hide(obj); +} + +EAPI void +elm_entry_select_all(Elm_Entry *obj) +{ + elm_obj_entry_select_all(obj); +} + +EAPI void +elm_entry_cursor_selection_end(Elm_Entry *obj) +{ + elm_obj_entry_cursor_selection_end(obj); +} + +EAPI void +elm_entry_selection_cut(Elm_Entry *obj) +{ + elm_obj_entry_selection_cut(obj); +} + +EAPI Eina_Bool +elm_entry_is_empty(const Elm_Entry *obj) +{ + return elm_obj_entry_is_empty(obj); +} + +EAPI void +elm_entry_markup_filter_remove(Elm_Entry *obj, Elm_Entry_Filter_Cb func, void *data) +{ + elm_obj_entry_markup_filter_remove(obj, func, data); +} + +EAPI void +elm_entry_item_provider_append(Elm_Entry *obj, Elm_Entry_Item_Provider_Cb func, void *data) +{ + elm_obj_entry_item_provider_append(obj, func, data); +} + +EAPI void +elm_entry_markup_filter_append(Elm_Entry *obj, Elm_Entry_Filter_Cb func, void *data) +{ + elm_obj_entry_markup_filter_append(obj, func, data); +} + +EAPI void +elm_entry_entry_append(Elm_Entry *obj, const char *str) +{ + elm_obj_entry_append(obj, str); +} + +EAPI void +elm_entry_context_menu_item_add(Elm_Entry *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data) +{ + elm_obj_entry_context_menu_item_add(obj, label, icon_file, icon_type, func, data); +} + +EAPI void +elm_entry_markup_filter_prepend(Elm_Entry *obj, Elm_Entry_Filter_Cb func, void *data) +{ + elm_obj_entry_markup_filter_prepend(obj, func, data); +} + +EAPI void +elm_entry_prediction_hint_set(Elm_Entry *obj, const char *prediction_hint) +{ + elm_obj_entry_prediction_hint_set(obj, prediction_hint); +} + +EAPI Eina_Bool +elm_entry_prediction_hint_hash_set(Elm_Entry *obj, const char *key, const char *value) +{ + return elm_obj_entry_prediction_hint_hash_set(obj, key, value); +} + +EAPI Eina_Bool +elm_entry_prediction_hint_hash_del(Elm_Entry *obj, const char *key) +{ + return elm_obj_entry_prediction_hint_hash_del(obj, key); +} diff --git a/src/lib/elementary/elm_entry_eo.legacy.h b/src/lib/elementary/elm_entry_eo.legacy.h new file mode 100644 index 0000000000..6fe06089be --- /dev/null +++ b/src/lib/elementary/elm_entry_eo.legacy.h @@ -0,0 +1,1252 @@ +#ifndef _ELM_ENTRY_EO_LEGACY_H_ +#define _ELM_ENTRY_EO_LEGACY_H_ + +#ifndef _ELM_ENTRY_EO_CLASS_TYPE +#define _ELM_ENTRY_EO_CLASS_TYPE + +typedef Eo Elm_Entry; + +#endif + +#ifndef _ELM_ENTRY_EO_TYPES +#define _ELM_ENTRY_EO_TYPES + + +#endif + +/** + * @brief Enable or disable scrolling in entry + * + * Normally the entry is not scrollable unless you enable it with this call. + * + * @param[in] obj The object. + * @param[in] scroll @c true if it is to be scrollable, @c false otherwise. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_scrollable_set(Elm_Entry *obj, Eina_Bool scroll); + +/** + * @brief Get the scrollable state of the entry + * + * Normally the entry is not scrollable. This gets the scrollable state of the + * entry. + * + * @param[in] obj The object. + * + * @return @c true if it is to be scrollable, @c false otherwise. + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_scrollable_get(const Elm_Entry *obj); + +/** + * @brief Set the attribute to show the input panel in case of only an user's + * explicit Mouse Up event. It doesn't request to show the input panel even + * though it has focus. + * + * @param[in] obj The object. + * @param[in] ondemand If @c true, the input panel will be shown in case of + * only Mouse up event. (Focus event will be ignored.) + * + * @since 1.9 + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_input_panel_show_on_demand_set(Elm_Entry *obj, Eina_Bool ondemand); + +/** + * @brief Get the attribute to show the input panel in case of only an user's + * explicit Mouse Up event. + * + * @param[in] obj The object. + * + * @return If @c true, the input panel will be shown in case of only Mouse up + * event. (Focus event will be ignored.) + * + * @since 1.9 + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_input_panel_show_on_demand_get(const Elm_Entry *obj); + +/** + * @brief This disables the entry's contextual (longpress) menu. + * + * @param[in] obj The object. + * @param[in] disabled If @c true, the menu is disabled. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_context_menu_disabled_set(Elm_Entry *obj, Eina_Bool disabled); + +/** + * @brief This returns whether the entry's contextual (longpress) menu is + * disabled. + * + * @param[in] obj The object. + * + * @return If @c true, the menu is disabled. + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_context_menu_disabled_get(const Elm_Entry *obj); + +/** + * @brief Control pasting of text and images for the widget. + * + * Normally the entry allows both text and images to be pasted. By setting + * cnp_mode to be #ELM_CNP_MODE_NO_IMAGE, this prevents images from being copy + * or past. By setting cnp_mode to be #ELM_CNP_MODE_PLAINTEXT, this remove all + * tags in text . + * + * @note This only changes the behaviour of text. + * + * @param[in] obj The object. + * @param[in] cnp_mode One of #Elm_Cnp_Mode: #ELM_CNP_MODE_MARKUP, + * #ELM_CNP_MODE_NO_IMAGE, #ELM_CNP_MODE_PLAINTEXT. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_cnp_mode_set(Elm_Entry *obj, Elm_Cnp_Mode cnp_mode); + +/** + * @brief Getting elm_entry text paste/drop mode. + * + * Normally the entry allows both text and images to be pasted. This gets the + * copy & paste mode of the entry. + * + * @param[in] obj The object. + * + * @return One of #Elm_Cnp_Mode: #ELM_CNP_MODE_MARKUP, #ELM_CNP_MODE_NO_IMAGE, + * #ELM_CNP_MODE_PLAINTEXT. + * + * @ingroup Elm_Entry_Group + */ +EAPI Elm_Cnp_Mode elm_entry_cnp_mode_get(const Elm_Entry *obj); + +/** + * @brief Text format used to load and save the file, which could be plain text + * or markup text. + * + * Default is @c ELM_TEXT_FORMAT_PLAIN_UTF8, if you want to use + * @c ELM_TEXT_FORMAT_MARKUP_UTF8 then you need to set the text format before + * calling @ref Efl.File.load. + * + * You could also set it before a call to @ref elm_entry_file_save in order to + * save with the given format. + * + * Use it before calling @ref Efl.File.load or @ref elm_entry_file_save. + * + * @param[in] obj The object. + * @param[in] format The file format + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_file_text_format_set(Elm_Entry *obj, Elm_Text_Format format); + +/** + * @brief Set the language mode of the input panel. + * + * This API can be used if you want to show the alphabet keyboard mode. + * + * @param[in] obj The object. + * @param[in] lang Language to be set to the input panel. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_input_panel_language_set(Elm_Entry *obj, Elm_Input_Panel_Lang lang); + +/** + * @brief Get the language mode of the input panel. + * + * @param[in] obj The object. + * + * @return Language to be set to the input panel. + * + * @ingroup Elm_Entry_Group + */ +EAPI Elm_Input_Panel_Lang elm_entry_input_panel_language_get(const Elm_Entry *obj); + +/** + * @brief This disabled the entry's selection handlers. + * + * @param[in] obj The object. + * @param[in] disabled If @c true, the selection handlers are disabled. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_selection_handler_disabled_set(Elm_Entry *obj, Eina_Bool disabled); + + +/** + * @brief Set the input panel layout variation of the entry + * + * @param[in] obj The object. + * @param[in] variation Layout variation type. + * + * @since 1.8 + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_input_panel_layout_variation_set(Elm_Entry *obj, int variation); + +/** + * @brief Get the input panel layout variation of the entry + * + * @param[in] obj The object. + * + * @return Layout variation type. + * + * @since 1.8 + * + * @ingroup Elm_Entry_Group + */ +EAPI int elm_entry_input_panel_layout_variation_get(const Elm_Entry *obj); + +/** + * @brief Set the autocapitalization type on the immodule. + * + * @param[in] obj The object. + * @param[in] autocapital_type The type of autocapitalization. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_autocapital_type_set(Elm_Entry *obj, Elm_Autocapital_Type autocapital_type); + +/** + * @brief Get the autocapitalization type on the immodule. + * + * @param[in] obj The object. + * + * @return The type of autocapitalization. + * + * @ingroup Elm_Entry_Group + */ +EAPI Elm_Autocapital_Type elm_entry_autocapital_type_get(const Elm_Entry *obj); + +/** + * @brief Sets if the entry is to be editable or not. + * + * By default, entries are editable and when focused, any text input by the + * user will be inserted at the current cursor position. But calling this + * function with @c editable as @c false will prevent the user from inputting + * text into the entry. + * + * The only way to change the text of a non-editable entry is to use @ref + * elm_object_text_set, @ref elm_entry_entry_insert and other related + * functions. + * + * @param[in] obj The object. + * @param[in] editable If @c true, user input will be inserted in the entry, if + * not, the entry is read-only and no user input is allowed. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_editable_set(Elm_Entry *obj, Eina_Bool editable); + +/** + * @brief Get whether the entry is editable or not. + * + * @param[in] obj The object. + * + * @return If @c true, user input will be inserted in the entry, if not, the + * entry is read-only and no user input is allowed. + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_editable_get(const Elm_Entry *obj); + +/** + * @brief Set the style that the hover should use + * + * When creating the popup hover, entry will request that it's themed according + * to @c style. + * + * Setting style no @c null means disabling automatic hover. + * + * @param[in] obj The object. + * @param[in] style The style to use for the underlying hover. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_anchor_hover_style_set(Elm_Entry *obj, const char *style); + +/** + * @brief Get the style that the hover should use. + * + * @param[in] obj The object. + * + * @return The style to use for the underlying hover. + * + * @ingroup Elm_Entry_Group + */ +EAPI const char *elm_entry_anchor_hover_style_get(const Elm_Entry *obj); + +/** + * @brief Sets the entry to single line mode. + * + * In single line mode, entries don't ever wrap when the text reaches the edge, + * and instead they keep growing horizontally. Pressing the @c Enter key will + * generate an $"activate" event instead of adding a new line. + * + * When @c single_line is @c false, line wrapping takes effect again and + * pressing enter will break the text into a different line without generating + * any events. + * + * @param[in] obj The object. + * @param[in] single_line If @c true, the text in the entry will be on a single + * line. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_single_line_set(Elm_Entry *obj, Eina_Bool single_line); + +/** + * @brief Get whether the entry is set to be single line. + * + * @param[in] obj The object. + * + * @return If @c true, the text in the entry will be on a single line. + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_single_line_get(const Elm_Entry *obj); + +/** + * @brief Sets the entry to password mode. + * + * In password mode, entries are implicitly single line and the display of any + * text in them is replaced with asterisks (*). + * + * @param[in] obj The object. + * @param[in] password If @c true, password mode is enabled. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_password_set(Elm_Entry *obj, Eina_Bool password); + +/** + * @brief Get whether the entry is set to password mode. + * + * @param[in] obj The object. + * + * @return If @c true, password mode is enabled. + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_password_get(const Elm_Entry *obj); + +/** + * @brief Set the return key on the input panel to be disabled. + * + * @param[in] obj The object. + * @param[in] disabled The state to put in in: @c true for disabled, @c false + * for enabled. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_input_panel_return_key_disabled_set(Elm_Entry *obj, Eina_Bool disabled); + +/** + * @brief Get whether the return key on the input panel should be disabled or + * not. + * + * @param[in] obj The object. + * + * @return The state to put in in: @c true for disabled, @c false for enabled. + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_input_panel_return_key_disabled_get(const Elm_Entry *obj); + +/** + * @brief This sets the entry object to 'autosave' the loaded text file or not. + * + * @param[in] obj The object. + * @param[in] auto_save Autosave the loaded file or not. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_autosave_set(Elm_Entry *obj, Eina_Bool auto_save); + +/** + * @brief This gets the entry object's 'autosave' status. + * + * @param[in] obj The object. + * + * @return Autosave the loaded file or not. + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_autosave_get(const Elm_Entry *obj); + +/** + * @brief Set the parent of the hover popup + * + * Sets the parent object to use by the hover created by the entry when an + * anchor is clicked. + * + * @param[in] obj The object. + * @param[in] parent The object to use as parent for the hover. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_anchor_hover_parent_set(Elm_Entry *obj, Efl_Canvas_Object *parent); + +/** + * @brief Get the parent of the hover popup + * + * Get the object used as parent for the hover created by the entry widget. If + * no parent is set, the same entry object will be used. + * + * @param[in] obj The object. + * + * @return The object to use as parent for the hover. + * + * @ingroup Elm_Entry_Group + */ +EAPI Efl_Canvas_Object *elm_entry_anchor_hover_parent_get(const Elm_Entry *obj); + +/** + * @brief Set whether the entry should allow to use the text prediction. + * + * @param[in] obj The object. + * @param[in] prediction Whether the entry should allow to use the text + * prediction. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_prediction_allow_set(Elm_Entry *obj, Eina_Bool prediction); + +/** + * @brief Get whether the entry should allow to use the text prediction. + * + * @param[in] obj The object. + * + * @return Whether the entry should allow to use the text prediction. + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_prediction_allow_get(const Elm_Entry *obj); + +/** + * @brief Sets the input hint which allows input methods to fine-tune their + * behavior. + * + * @param[in] obj The object. + * @param[in] hints Input hint. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_input_hint_set(Elm_Entry *obj, Elm_Input_Hints hints); + +/** + * @brief Gets the value of input hint. + * + * @param[in] obj The object. + * + * @return Input hint. + * + * @ingroup Elm_Entry_Group + */ +EAPI Elm_Input_Hints elm_entry_input_hint_get(const Elm_Entry *obj); + +/** + * @brief Set the input panel layout of the entry. + * + * @param[in] obj The object. + * @param[in] layout Layout type. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_input_panel_layout_set(Elm_Entry *obj, Elm_Input_Panel_Layout layout); + +/** + * @brief Get the input panel layout of the entry. + * + * @param[in] obj The object. + * + * @return Layout type. + * + * @ingroup Elm_Entry_Group + */ +EAPI Elm_Input_Panel_Layout elm_entry_input_panel_layout_get(const Elm_Entry *obj); + +/** + * @brief Set the "return" key type. This type is used to set string or icon on + * the "return" key of the input panel. + * + * An input panel displays the string or icon associated with this type. + * + * Regardless of return key type, "activated" event will be generated when + * pressing return key in single line entry. + * + * @param[in] obj The object. + * @param[in] return_key_type The type of "return" key on the input panel. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_input_panel_return_key_type_set(Elm_Entry *obj, Elm_Input_Panel_Return_Key_Type return_key_type); + +/** + * @brief Get the "return" key type. + * + * @param[in] obj The object. + * + * @return The type of "return" key on the input panel. + * + * @ingroup Elm_Entry_Group + */ +EAPI Elm_Input_Panel_Return_Key_Type elm_entry_input_panel_return_key_type_get(const Elm_Entry *obj); + +/** + * @brief Sets the attribute to show the input panel automatically. + * + * @param[in] obj The object. + * @param[in] enabled If @c true, the input panel is appeared when entry is + * clicked or has a focus. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_input_panel_enabled_set(Elm_Entry *obj, Eina_Bool enabled); + +/** + * @brief Get the attribute to show the input panel automatically. + * + * @param[in] obj The object. + * + * @return If @c true, the input panel is appeared when entry is clicked or has + * a focus. + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_input_panel_enabled_get(const Elm_Entry *obj); + +/** + * @brief Set the line wrap type to use on multi-line entries. + * + * Sets the wrap type used by the entry to any of the specified in + * Elm_Wrap_Type. This tells how the text will be implicitly cut into a new + * line (without inserting a line break or paragraph separator) when it reaches + * the far edge of the widget. + * + * Note that this only makes sense for multi-line entries. A widget set to be + * single line will never wrap. + * + * @param[in] obj The object. + * @param[in] wrap The wrap mode to use. See Elm_Wrap_Type for details on them. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_line_wrap_set(Elm_Entry *obj, Elm_Wrap_Type wrap); + +/** + * @brief Get the wrap mode the entry was set to use. + * + * @param[in] obj The object. + * + * @return The wrap mode to use. See Elm_Wrap_Type for details on them. + * + * @ingroup Elm_Entry_Group + */ +EAPI Elm_Wrap_Type elm_entry_line_wrap_get(const Elm_Entry *obj); + +/** + * @brief Sets the cursor position in the entry to the given value + * + * The value in @c pos is the index of the character position within the + * contents of the string as returned by @ref elm_entry_cursor_pos_get. + * + * @param[in] obj The object. + * @param[in] pos The position of the cursor. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_cursor_pos_set(Elm_Entry *obj, int pos); + +/** + * @brief Get the current position of the cursor in the entry. + * + * @param[in] obj The object. + * + * @return The position of the cursor. + * + * @ingroup Elm_Entry_Group + */ +EAPI int elm_entry_cursor_pos_get(const Elm_Entry *obj); + +/** + * @brief Sets the visibility of the left-side widget of the entry, set by @ref + * elm_object_part_content_set. + * + * @param[in] obj The object. + * @param[in] setting @c true if the object should be displayed, @c false if + * not. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_icon_visible_set(Elm_Entry *obj, Eina_Bool setting); + +/** This moves the cursor to the end of the current line. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_cursor_line_end_set(Elm_Entry *obj); + +/** + * @brief This selects a region of text within the entry. + * + * @param[in] obj The object. + * @param[in] start The starting position. + * @param[in] end The end position. + * + * @since 1.9 + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_select_region_set(Elm_Entry *obj, int start, int end); + +/** + * @brief Get the current position of the selection cursors in the entry. + * + * @param[in] obj The object. + * @param[out] start The starting position. + * @param[out] end The end position. + * + * @since 1.18 + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_select_region_get(const Elm_Entry *obj, int *start, int *end); + +/** + * @brief Set whether the return key on the input panel is disabled + * automatically when entry has no text. + * + * If @c enabled is @c true, The return key on input panel is disabled when the + * entry has no text. The return key on the input panel is automatically + * enabled when the entry has text. The default value is @c false. + * + * @param[in] obj The object. + * @param[in] enabled If @c enabled is @c true, the return key is automatically + * disabled when the entry has no text. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_input_panel_return_key_autoenabled_set(Elm_Entry *obj, Eina_Bool enabled); + +/** + * @brief Sets the visibility of the end widget of the entry, set by @ref + * elm_object_part_content_set(ent, "end", content). + * + * @param[in] obj The object. + * @param[in] setting @c true if the object should be displayed, false if not. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_end_visible_set(Elm_Entry *obj, Eina_Bool setting); + +/** This moves the cursor to the beginning of the entry. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_cursor_begin_set(Elm_Entry *obj); + +/** This moves the cursor to the beginning of the current line. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_cursor_line_begin_set(Elm_Entry *obj); + +/** This moves the cursor to the end of the entry. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_cursor_end_set(Elm_Entry *obj); + +/** + * @brief Returns the actual textblock object of the entry. + * + * This function exposes the internal textblock object that actually contains + * and draws the text. This should be used for low-level manipulations that are + * otherwise not possible. + * + * Changing the textblock directly from here will not notify edje/elm to + * recalculate the textblock size automatically, so any modifications done to + * the textblock returned by this function should be followed by a call to @ref + * elm_entry_calc_force. + * + * The return value is marked as const as an additional warning. One should not + * use the returned object with any of the generic evas functions + * (geometry_get/resize/move and etc), but only with the textblock functions; + * The former will either not work at all, or break the correct functionality. + * + * IMPORTANT: Many functions may change (i.e delete and create a new one) the + * internal textblock object. Do NOT cache the returned object, and try not to + * mix calls on this object with regular elm_entry calls (which may change the + * internal textblock object). This applies to all cursors returned from + * textblock calls, and all the other derivative values. + * + * @param[in] obj The object. + * + * @return Textblock object + * + * @ingroup Elm_Entry_Group + */ +EAPI Efl_Canvas_Object *elm_entry_textblock_get(const Elm_Entry *obj); + +/** + * @brief This function returns the geometry of the cursor. + * + * It's useful if you want to draw something on the cursor (or where it is), or + * for example in the case of scrolled entry where you want to show the cursor. + * + * @param[in] obj The object. + * @param[out] x X coordinate + * @param[out] y Y coordinate + * @param[out] w Width + * @param[out] h Height + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_cursor_geometry_get(const Elm_Entry *obj, int *x, int *y, int *w, int *h); + +/** + * @brief Returns the input method context of the entry. + * + * This function exposes the internal input method context. + * + * IMPORTANT: Many functions may change (i.e delete and create a new one) the + * internal input method context. Do NOT cache the returned object. + * + * @param[in] obj The object. + * + * @return Input method context + * + * @ingroup Elm_Entry_Group + */ +EAPI void *elm_entry_imf_context_get(const Elm_Entry *obj); + +/** + * @brief Get whether a format node exists at the current cursor position. + * + * A format node is anything that defines how the text is rendered. It can be a + * visible format node, such as a line break or a paragraph separator, or an + * invisible one, such as bold begin or end tag. This function returns whether + * any format node exists at the current cursor position. + * + * @param[in] obj The object. + * + * @return @c true if format node exists, @c false otherwise + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_cursor_is_format_get(const Elm_Entry *obj); + +/** + * @brief Get the character pointed by the cursor at its current position. + * + * This function returns a string with the utf8 character stored at the current + * cursor position. 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. + * + * @param[in] obj The object. + * + * @return Character + * + * @ingroup Elm_Entry_Group + */ +EAPI char *elm_entry_cursor_content_get(const Elm_Entry *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get any selected text within the entry. + * + * If there's any selected text in the entry, this function returns it as a + * string in markup format. @c null is returned if no selection exists or if an + * error occurred. + * + * The returned value points to an internal string and should not be freed or + * modified in any way. If the @c entry object is deleted or its contents are + * changed, the returned pointer should be considered invalid. + * + * @param[in] obj The object. + * + * @return Selected string + * + * @ingroup Elm_Entry_Group + */ +EAPI const char *elm_entry_selection_get(const Elm_Entry *obj); + +/** + * @brief Get if the current cursor position holds a visible format node. + * + * @param[in] obj The object. + * + * @return @c true if position has a visible format, @c false otherwise + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_cursor_is_visible_format_get(const Elm_Entry *obj); + +/** + * @brief Allow selection in the entry. + * + * @param[in] obj The object. + * @param[in] allow If @c allow is true, the text selection is allowed. + * + * @since 1.18 + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_select_allow_set(Elm_Entry *obj, Eina_Bool allow); + +/** + * @brief Allow selection in the entry. + * + * @param[in] obj The object. + * + * @return If @c allow is true, the text selection is allowed. + * + * @since 1.18 + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_select_allow_get(const Elm_Entry *obj); + +/** + * @brief This moves the cursor one place to the left within the entry. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_cursor_prev(Elm_Entry *obj); + +/** Remove the style in the top of user style stack. + * + * @since 1.7 + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_text_style_user_pop(Elm_Entry *obj); + +/** + * @brief This prepends a custom item provider to the list for that entry + * + * This prepends the given callback. + * + * @param[in] obj The object. + * @param[in] func The function called to provide the item object. + * @param[in] data The data passed to @c func. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_item_provider_prepend(Elm_Entry *obj, Elm_Entry_Item_Provider_Cb func, void *data); + +/** + * @brief Show the input panel (virtual keyboard) based on the input panel + * property of entry such as layout, autocapital types, and so on. + * + * Note that input panel is shown or hidden automatically according to the + * focus state of entry widget. This API can be used in the case of manually + * controlling by using @ref elm_entry_input_panel_enabled_set(en, @c false). + * @param[in] obj The object. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_input_panel_show(Elm_Entry *obj); + +/** + * @brief Reset the input method context of the entry if needed. + * + * This can be necessary in the case where modifying the buffer would confuse + * on-going input method behavior. This will typically cause the Input Method + * Context to clear the preedit state. + * @param[in] obj The object. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_imf_context_reset(Elm_Entry *obj); + +/** + * @brief Ends the hover popup in the entry + * + * When an anchor is clicked, the entry widget will create a hover object to + * use as a popup with user provided content. This function terminates this + * popup, returning the entry to its normal state. + * @param[in] obj The object. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_anchor_hover_end(Elm_Entry *obj); + +/** This begins a selection within the entry as though the user were holding + * down the mouse button to make a selection. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_cursor_selection_begin(Elm_Entry *obj); + +/** + * @brief This moves the cursor one line down within the entry. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_cursor_down(Elm_Entry *obj); + +/** This function writes any changes made to the file set with @ref + * elm_entry_file_set. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_file_save(Elm_Entry *obj); + +/** This executes a "copy" action on the selected text in the entry. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_selection_copy(Elm_Entry *obj); + +/** + * @brief Push the style to the top of user style stack. If there is styles in + * the user style stack, the properties in the top style of user style stack + * will replace the properties in current theme. The input style is specified + * in format tag='property=value' (i.e. DEFAULT='font=Sans + * font_size=60'hilight=' + font_weight=Bold'). + * + * @param[in] obj The object. + * @param[in] style The style user to push. + * + * @since 1.7 + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_text_style_user_push(Elm_Entry *obj, const char *style); + +/** + * @brief This removes a custom item provider to the list for that entry + * + * This removes the given callback. See @ref elm_entry_item_provider_append for + * more information + * + * @param[in] obj The object. + * @param[in] func The function called to provide the item object. + * @param[in] data The data passed to @c func. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_item_provider_remove(Elm_Entry *obj, Elm_Entry_Item_Provider_Cb func, void *data); + +/** + * @brief Get the style on the top of user style stack. + * + * See also @ref elm_entry_text_style_user_push. + * + * @param[in] obj The object. + * + * @return Style + * + * @since 1.7 + * + * @ingroup Elm_Entry_Group + */ +EAPI const char *elm_entry_text_style_user_peek(const Elm_Entry *obj); + +/** + * @brief This clears and frees the items in a entry's contextual (longpress) + * menu. + * + * See also @ref elm_entry_context_menu_item_add. + * @param[in] obj The object. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_context_menu_clear(Elm_Entry *obj); + +/** + * @brief This moves the cursor one line up within the entry. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_cursor_up(Elm_Entry *obj); + +/** + * @brief Inserts the given text into the entry at the current cursor position. + * + * This inserts text at the cursor position as if it was typed by the user + * (note that this also allows markup which a user can't just "type" as it + * would be converted to escaped text, so this call can be used to insert + * things like emoticon items or bold push/pop tags, other font and color + * change tags etc.) + * + * If any selection exists, it will be replaced by the inserted text. + * + * The inserted text is subject to any filters set for the widget. + * + * See also @ref elm_entry_markup_filter_append. + * + * @param[in] obj The object. + * @param[in] entry The text to insert. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_entry_insert(Elm_Entry *obj, const char *entry); + +/** + * @brief Set the input panel-specific data to deliver to the input panel. + * + * This API is used by applications to deliver specific data to the input + * panel. The data format MUST be negotiated by both application and the input + * panel. The size and format of data are defined by the input panel. + * + * @param[in] obj The object. + * @param[in] data The specific data to be set to the input panel. + * @param[in] len The length of data, in bytes, to send to the input panel. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_input_panel_imdata_set(Elm_Entry *obj, const void *data, int len); + +/** + * @brief Get the specific data of the current input panel. + * + * @param[in] obj The object. + * @param[out] data The specific data to be got from the input panel. + * @param[out] len The length of data. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_input_panel_imdata_get(const Elm_Entry *obj, void *data, int *len); + +/** This executes a "paste" action in the entry. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_selection_paste(Elm_Entry *obj); + +/** + * @brief This moves the cursor one place to the right within the entry. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_cursor_next(Elm_Entry *obj); + +/** This drops any existing text selection within the entry. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_select_none(Elm_Entry *obj); + +/** + * @brief Hide the input panel (virtual keyboard). + * + * Note that input panel is shown or hidden automatically according to the + * focus state of entry widget. This API can be used in the case of manually + * controlling by using @ref elm_entry_input_panel_enabled_set(en, @c false) + * @param[in] obj The object. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_input_panel_hide(Elm_Entry *obj); + +/** This selects all text within the entry. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_select_all(Elm_Entry *obj); + +/** This ends a selection within the entry as though the user had just released + * the mouse button while making a selection. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_cursor_selection_end(Elm_Entry *obj); + +/** This executes a "cut" action on the selected text in the entry. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_selection_cut(Elm_Entry *obj); + +/** + * @brief Get whether the entry is empty. + * + * Empty means no text at all. If there are any markup tags, like an item tag + * for which no provider finds anything, and no text is displayed, this + * function still returns @c false. + * + * @param[in] obj The object. + * + * @return @c true if empty, @c false otherwise + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_is_empty(const Elm_Entry *obj); + +/** + * @brief Remove a markup filter from the list + * + * Removes the given callback from the filter list. See + * @ref elm_entry_markup_filter_append for more information. + * + * @param[in] obj The object. + * @param[in] func The filter function to remove. + * @param[in] data The user data passed when adding the function. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_markup_filter_remove(Elm_Entry *obj, Elm_Entry_Filter_Cb func, void *data); + +/** + * @brief 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 @c 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. + * + * @param[in] obj The object. + * @param[in] func The function called to provide the item object. + * @param[in] data The data passed to @c func. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_item_provider_append(Elm_Entry *obj, Elm_Entry_Item_Provider_Cb func, void *data); + +/** + * @brief Append a markup filter function for text inserted in the entry + * + * Append the given callback to the list. This functions will be called + * whenever any text is inserted into the entry, with the text to be inserted + * as a parameter. The type of given text is always markup. The callback + * function is free to alter the text in any way it wants, but it must remember + * to free the given pointer and update it. If the new text is to be discarded, + * the function can free it and set its text parameter to @c null. This will + * also prevent any following filters from being called. + * + * @param[in] obj The object. + * @param[in] func The function to use as text filter. + * @param[in] data User data to pass to @c func. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_markup_filter_append(Elm_Entry *obj, Elm_Entry_Filter_Cb func, void *data); + +/** + * @brief Appends @c str to the text of the entry. + * + * Adds the text in @c str to the end of any text already present in the + * widget. + * + * The appended text is subject to any filters set for the widget. + * + * See also @ref elm_entry_markup_filter_append. + * + * @param[in] obj The object. + * @param[in] str The text to be appended. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_entry_append(Elm_Entry *obj, const char *str); + +/** + * @brief This adds an item to the entry's contextual menu. + * + * A longpress on an entry will make the contextual menu show up, if this + * hasn't been disabled with @ref elm_entry_context_menu_disabled_set. By + * default, this menu provides a few options like enabling selection mode, + * which is useful on embedded devices that need to be explicit about it, and + * when a selection exists it also shows the copy and cut actions. + * + * With this function, developers can add other options to this menu to perform + * any action they deem necessary. + * + * @param[in] obj The object. + * @param[in] label The item's text label. + * @param[in] icon_file The item's icon file. + * @param[in] icon_type The item's icon type. + * @param[in] func The callback to execute when the item is clicked. + * @param[in] data The data to associate with the item for related functions. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_context_menu_item_add(Elm_Entry *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data); + +/** + * @brief Prepend a markup filter function for text inserted in the entry + * + * Prepend the given callback to the list. + * + * @param[in] obj The object. + * @param[in] func The function to use as text filter. + * @param[in] data User data to pass to @c func. + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_markup_filter_prepend(Elm_Entry *obj, Elm_Entry_Filter_Cb func, void *data); + +/** + * @brief Sets the prediction hint to use an intelligent reply suggestion + * service. + * + * @param[in] obj The object. + * @param[in] prediction_hint The prediction hint text. + * + * @since 1.20 + * + * @ingroup Elm_Entry_Group + */ +EAPI void elm_entry_prediction_hint_set(Elm_Entry *obj, const char *prediction_hint); + +/** + * @brief Sets the prediction hint data at the specified key. + * + * @param[in] obj The object. + * @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 + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_prediction_hint_hash_set(Elm_Entry *obj, const char *key, const char *value); + +/** + * @brief Removes the prediction hint data identified by a key. + * + * @param[in] obj The object. + * @param[in] key The key of the prediction hint. + * + * @return @c true on success, @c false otherwise + * + * @since 1.21 + * + * @ingroup Elm_Entry_Group + */ +EAPI Eina_Bool elm_entry_prediction_hint_hash_del(Elm_Entry *obj, const char *key); + +#endif diff --git a/src/lib/elementary/elm_entry_legacy.h b/src/lib/elementary/elm_entry_legacy.h index 7e54218d07..06b3f76eb7 100644 --- a/src/lib/elementary/elm_entry_legacy.h +++ b/src/lib/elementary/elm_entry_legacy.h @@ -1,4 +1,4 @@ -#include "elm_entry.eo.legacy.h" +#include "elm_entry_eo.legacy.h" /** * This adds an entry to @p parent object. diff --git a/src/lib/elementary/elm_entry_part.eo b/src/lib/elementary/elm_entry_part.eo index ebeeb88270..f33fe1a087 100644 --- a/src/lib/elementary/elm_entry_part.eo +++ b/src/lib/elementary/elm_entry_part.eo @@ -1,4 +1,4 @@ -class Elm.Entry.Part extends Efl.Ui.Layout_Part_Legacy +class @beta Elm.Entry.Part extends Efl.Ui.Layout_Part_Legacy { [[Elementary entry internal part class]] data: null; diff --git a/src/lib/elementary/elm_fileselector.eo b/src/lib/elementary/elm_fileselector.eo deleted file mode 100644 index eac99d9065..0000000000 --- a/src/lib/elementary/elm_fileselector.eo +++ /dev/null @@ -1,65 +0,0 @@ -class Elm.Fileselector extends Efl.Ui.Layout implements 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; - eo_prefix: elm_obj_fileselector; - event_prefix: elm_fileselector; - methods { - @property buttons_ok_cancel { - set { - [[Enable/disable the "ok" and "cancel" buttons on a given file - selector widget - - Note: A file selector without those buttons will never emit the - "done" smart event, and is only usable if one is just hooking - to the other two events. - - See also @.buttons_ok_cancel.get. - ]] - } - get { - [[Get whether the "ok" and "cancel" buttons on a given file - selector widget are being shown. - - See also @.buttons_ok_cancel.set for more details. - ]] - } - values { - visible: bool; [[$true to show buttons, $false to hide.]] - } - } - } - implements { - class.constructor; - class.destructor; - Efl.Object.constructor; - Efl.Ui.Widget.widget_event; - Efl.Ui.Widget.theme_apply; - Elm.Interface.Fileselector.selected_models { get; } - 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; } - Elm.Interface.Fileselector.mime_types_filter_append; - Elm.Interface.Fileselector.hidden_visible { get; set; } - Elm.Interface.Fileselector.filters_clear; - Elm.Interface.Fileselector.is_save { 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_get; - } - events { - 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 deleted file mode 100644 index 545409f229..0000000000 --- a/src/lib/elementary/elm_fileselector_button.eo +++ /dev/null @@ -1,26 +0,0 @@ -class Elm.Fileselector_Button extends Efl.Ui.Button implements Elm.Interface.Fileselector, - Efl.Ui.Legacy -{ - [[Elementary fileselector button class]] - event_prefix: elm_fileselector_button; - implements { - Efl.Object.constructor; - 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; set; } - Elm.Interface.Fileselector.hidden_visible { get; set; } - Elm.Interface.Fileselector.is_save { 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 { - /* 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_button_eo.c b/src/lib/elementary/elm_fileselector_button_eo.c new file mode 100644 index 0000000000..36436bbbde --- /dev/null +++ b/src/lib/elementary/elm_fileselector_button_eo.c @@ -0,0 +1,149 @@ +EWAPI const Efl_Event_Description _ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN = + EFL_EVENT_DESCRIPTION("file,chosen"); + +Efl_Object *_elm_fileselector_button_efl_object_constructor(Eo *obj, Elm_Fileselector_Button_Data *pd); + + +Eina_Error _elm_fileselector_button_efl_ui_widget_theme_apply(Eo *obj, Elm_Fileselector_Button_Data *pd); + + +Eina_Bool _elm_fileselector_button_efl_ui_autorepeat_autorepeat_supported_get(const Eo *obj, Elm_Fileselector_Button_Data *pd); + + +const Eina_List *_elm_fileselector_button_elm_interface_fileselector_selected_models_get(const Eo *obj, Elm_Fileselector_Button_Data *pd); + + +void _elm_fileselector_button_elm_interface_fileselector_expandable_set(Eo *obj, Elm_Fileselector_Button_Data *pd, Eina_Bool expand); + + +Eina_Bool _elm_fileselector_button_elm_interface_fileselector_expandable_get(const Eo *obj, Elm_Fileselector_Button_Data *pd); + + +void _elm_fileselector_button_elm_interface_fileselector_thumbnail_size_set(Eo *obj, Elm_Fileselector_Button_Data *pd, int w, int h); + + +void _elm_fileselector_button_elm_interface_fileselector_thumbnail_size_get(const Eo *obj, Elm_Fileselector_Button_Data *pd, int *w, int *h); + + +Eina_Bool _elm_fileselector_button_elm_interface_fileselector_selected_model_set(Eo *obj, Elm_Fileselector_Button_Data *pd, Efl_Io_Model *model); + + +Efl_Io_Model *_elm_fileselector_button_elm_interface_fileselector_selected_model_get(const Eo *obj, Elm_Fileselector_Button_Data *pd); + + +void _elm_fileselector_button_elm_interface_fileselector_hidden_visible_set(Eo *obj, Elm_Fileselector_Button_Data *pd, Eina_Bool hidden); + + +Eina_Bool _elm_fileselector_button_elm_interface_fileselector_hidden_visible_get(const Eo *obj, Elm_Fileselector_Button_Data *pd); + + +void _elm_fileselector_button_elm_interface_fileselector_is_save_set(Eo *obj, Elm_Fileselector_Button_Data *pd, Eina_Bool is_save); + + +Eina_Bool _elm_fileselector_button_elm_interface_fileselector_is_save_get(const Eo *obj, Elm_Fileselector_Button_Data *pd); + + +void _elm_fileselector_button_efl_ui_view_model_set(Eo *obj, Elm_Fileselector_Button_Data *pd, Efl_Model *model); + + +Efl_Model *_elm_fileselector_button_efl_ui_view_model_get(const Eo *obj, Elm_Fileselector_Button_Data *pd); + + +void _elm_fileselector_button_elm_interface_fileselector_sort_method_set(Eo *obj, Elm_Fileselector_Button_Data *pd, Elm_Fileselector_Sort sort); + + +Elm_Fileselector_Sort _elm_fileselector_button_elm_interface_fileselector_sort_method_get(const Eo *obj, Elm_Fileselector_Button_Data *pd); + + +void _elm_fileselector_button_elm_interface_fileselector_multi_select_set(Eo *obj, Elm_Fileselector_Button_Data *pd, Eina_Bool multi); + + +Eina_Bool _elm_fileselector_button_elm_interface_fileselector_multi_select_get(const Eo *obj, Elm_Fileselector_Button_Data *pd); + + +void _elm_fileselector_button_elm_interface_fileselector_folder_only_set(Eo *obj, Elm_Fileselector_Button_Data *pd, Eina_Bool only); + + +Eina_Bool _elm_fileselector_button_elm_interface_fileselector_folder_only_get(const Eo *obj, Elm_Fileselector_Button_Data *pd); + + +void _elm_fileselector_button_elm_interface_fileselector_mode_set(Eo *obj, Elm_Fileselector_Button_Data *pd, Elm_Fileselector_Mode mode); + + +Elm_Fileselector_Mode _elm_fileselector_button_elm_interface_fileselector_mode_get(const Eo *obj, Elm_Fileselector_Button_Data *pd); + + +void _elm_fileselector_button_elm_interface_fileselector_current_name_set(Eo *obj, Elm_Fileselector_Button_Data *pd, const char *name); + + +const char *_elm_fileselector_button_elm_interface_fileselector_current_name_get(const Eo *obj, Elm_Fileselector_Button_Data *pd); + + +Eina_Bool _elm_fileselector_button_elm_interface_fileselector_custom_filter_append(Eo *obj, Elm_Fileselector_Button_Data *pd, Elm_Fileselector_Filter_Func func, void *data, const char *filter_name); + + +Eina_Bool _elm_fileselector_button_elm_interface_fileselector_mime_types_filter_append(Eo *obj, Elm_Fileselector_Button_Data *pd, const char *mime_types, const char *filter_name); + + +void _elm_fileselector_button_elm_interface_fileselector_filters_clear(Eo *obj, Elm_Fileselector_Button_Data *pd); + + +static Eina_Bool +_elm_fileselector_button_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_FILESELECTOR_BUTTON_EXTRA_OPS +#define ELM_FILESELECTOR_BUTTON_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_fileselector_button_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_fileselector_button_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_autorepeat_supported_get, _elm_fileselector_button_efl_ui_autorepeat_autorepeat_supported_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_selected_models_get, _elm_fileselector_button_elm_interface_fileselector_selected_models_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_expandable_set, _elm_fileselector_button_elm_interface_fileselector_expandable_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_expandable_get, _elm_fileselector_button_elm_interface_fileselector_expandable_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_thumbnail_size_set, _elm_fileselector_button_elm_interface_fileselector_thumbnail_size_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_thumbnail_size_get, _elm_fileselector_button_elm_interface_fileselector_thumbnail_size_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_selected_model_set, _elm_fileselector_button_elm_interface_fileselector_selected_model_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_selected_model_get, _elm_fileselector_button_elm_interface_fileselector_selected_model_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_hidden_visible_set, _elm_fileselector_button_elm_interface_fileselector_hidden_visible_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_hidden_visible_get, _elm_fileselector_button_elm_interface_fileselector_hidden_visible_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_is_save_set, _elm_fileselector_button_elm_interface_fileselector_is_save_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_is_save_get, _elm_fileselector_button_elm_interface_fileselector_is_save_get), + EFL_OBJECT_OP_FUNC(efl_ui_view_model_set, _elm_fileselector_button_efl_ui_view_model_set), + EFL_OBJECT_OP_FUNC(efl_ui_view_model_get, _elm_fileselector_button_efl_ui_view_model_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_sort_method_set, _elm_fileselector_button_elm_interface_fileselector_sort_method_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_sort_method_get, _elm_fileselector_button_elm_interface_fileselector_sort_method_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_multi_select_set, _elm_fileselector_button_elm_interface_fileselector_multi_select_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_multi_select_get, _elm_fileselector_button_elm_interface_fileselector_multi_select_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_folder_only_set, _elm_fileselector_button_elm_interface_fileselector_folder_only_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_folder_only_get, _elm_fileselector_button_elm_interface_fileselector_folder_only_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_mode_set, _elm_fileselector_button_elm_interface_fileselector_mode_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_mode_get, _elm_fileselector_button_elm_interface_fileselector_mode_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_current_name_set, _elm_fileselector_button_elm_interface_fileselector_current_name_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_current_name_get, _elm_fileselector_button_elm_interface_fileselector_current_name_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_custom_filter_append, _elm_fileselector_button_elm_interface_fileselector_custom_filter_append), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_mime_types_filter_append, _elm_fileselector_button_elm_interface_fileselector_mime_types_filter_append), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_filters_clear, _elm_fileselector_button_elm_interface_fileselector_filters_clear), + ELM_FILESELECTOR_BUTTON_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_fileselector_button_class_desc = { + EO_VERSION, + "Elm.Fileselector_Button", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Fileselector_Button_Data), + _elm_fileselector_button_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_fileselector_button_class_get, &_elm_fileselector_button_class_desc, EFL_UI_BUTTON_CLASS, ELM_INTERFACE_FILESELECTOR_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_fileselector_button_eo.h b/src/lib/elementary/elm_fileselector_button_eo.h new file mode 100644 index 0000000000..d130945e40 --- /dev/null +++ b/src/lib/elementary/elm_fileselector_button_eo.h @@ -0,0 +1,32 @@ +#ifndef _ELM_FILESELECTOR_BUTTON_EO_H_ +#define _ELM_FILESELECTOR_BUTTON_EO_H_ + +#ifndef _ELM_FILESELECTOR_BUTTON_EO_CLASS_TYPE +#define _ELM_FILESELECTOR_BUTTON_EO_CLASS_TYPE + +typedef Eo Elm_Fileselector_Button; + +#endif + +#ifndef _ELM_FILESELECTOR_BUTTON_EO_TYPES +#define _ELM_FILESELECTOR_BUTTON_EO_TYPES + + +#endif +/** Elementary fileselector button class + * + * @ingroup Elm_Fileselector_Button + */ +#define ELM_FILESELECTOR_BUTTON_CLASS elm_fileselector_button_class_get() + +EWAPI const Efl_Class *elm_fileselector_button_class_get(void); + +EWAPI extern const Efl_Event_Description _ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN; + +/** Called when a file was chosen in the fileselector + * + * @ingroup Elm_Fileselector_Button + */ +#define ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN (&(_ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN)) + +#endif diff --git a/src/lib/elementary/elm_fileselector_button_eo.legacy.h b/src/lib/elementary/elm_fileselector_button_eo.legacy.h new file mode 100644 index 0000000000..7ae3058fe5 --- /dev/null +++ b/src/lib/elementary/elm_fileselector_button_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_FILESELECTOR_BUTTON_EO_LEGACY_H_ +#define _ELM_FILESELECTOR_BUTTON_EO_LEGACY_H_ + +#ifndef _ELM_FILESELECTOR_BUTTON_EO_CLASS_TYPE +#define _ELM_FILESELECTOR_BUTTON_EO_CLASS_TYPE + +typedef Eo Elm_Fileselector_Button; + +#endif + +#ifndef _ELM_FILESELECTOR_BUTTON_EO_TYPES +#define _ELM_FILESELECTOR_BUTTON_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_fileselector_entry.eo b/src/lib/elementary/elm_fileselector_entry.eo deleted file mode 100644 index 3a91c6ec2f..0000000000 --- a/src/lib/elementary/elm_fileselector_entry.eo +++ /dev/null @@ -1,25 +0,0 @@ -class Elm.Fileselector_Entry extends Efl.Ui.Layout implements 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; - 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; } - Efl.Ui.View.model { get; set; } - Elm.Interface.Fileselector.expandable { get; set; } - Efl.Part.part_get; - } - events { - 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_fileselector_entry_eo.c b/src/lib/elementary/elm_fileselector_entry_eo.c new file mode 100644 index 0000000000..58c0092614 --- /dev/null +++ b/src/lib/elementary/elm_fileselector_entry_eo.c @@ -0,0 +1,91 @@ +EWAPI const Efl_Event_Description _ELM_FILESELECTOR_ENTRY_EVENT_CHANGED = + EFL_EVENT_DESCRIPTION("changed"); +EWAPI const Efl_Event_Description _ELM_FILESELECTOR_ENTRY_EVENT_ACTIVATED = + EFL_EVENT_DESCRIPTION("activated"); +EWAPI const Efl_Event_Description _ELM_FILESELECTOR_ENTRY_EVENT_FILE_CHOSEN = + EFL_EVENT_DESCRIPTION("file,chosen"); +EWAPI const Efl_Event_Description _ELM_FILESELECTOR_ENTRY_EVENT_PRESS = + EFL_EVENT_DESCRIPTION("press"); + +Efl_Object *_elm_fileselector_entry_efl_object_constructor(Eo *obj, Elm_Fileselector_Entry_Data *pd); + + +Eina_Error _elm_fileselector_entry_efl_ui_widget_theme_apply(Eo *obj, Elm_Fileselector_Entry_Data *pd); + + +Eina_Bool _elm_fileselector_entry_elm_interface_fileselector_selected_model_set(Eo *obj, Elm_Fileselector_Entry_Data *pd, Efl_Io_Model *model); + + +Efl_Io_Model *_elm_fileselector_entry_elm_interface_fileselector_selected_model_get(const Eo *obj, Elm_Fileselector_Entry_Data *pd); + + +void _elm_fileselector_entry_elm_interface_fileselector_folder_only_set(Eo *obj, Elm_Fileselector_Entry_Data *pd, Eina_Bool only); + + +Eina_Bool _elm_fileselector_entry_elm_interface_fileselector_folder_only_get(const Eo *obj, Elm_Fileselector_Entry_Data *pd); + + +void _elm_fileselector_entry_elm_interface_fileselector_is_save_set(Eo *obj, Elm_Fileselector_Entry_Data *pd, Eina_Bool is_save); + + +Eina_Bool _elm_fileselector_entry_elm_interface_fileselector_is_save_get(const Eo *obj, Elm_Fileselector_Entry_Data *pd); + + +void _elm_fileselector_entry_efl_ui_view_model_set(Eo *obj, Elm_Fileselector_Entry_Data *pd, Efl_Model *model); + + +Efl_Model *_elm_fileselector_entry_efl_ui_view_model_get(const Eo *obj, Elm_Fileselector_Entry_Data *pd); + + +void _elm_fileselector_entry_elm_interface_fileselector_expandable_set(Eo *obj, Elm_Fileselector_Entry_Data *pd, Eina_Bool expand); + + +Eina_Bool _elm_fileselector_entry_elm_interface_fileselector_expandable_get(const Eo *obj, Elm_Fileselector_Entry_Data *pd); + + +Efl_Object *_elm_fileselector_entry_efl_part_part_get(const Eo *obj, Elm_Fileselector_Entry_Data *pd, const char *name); + + +static Eina_Bool +_elm_fileselector_entry_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_FILESELECTOR_ENTRY_EXTRA_OPS +#define ELM_FILESELECTOR_ENTRY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_fileselector_entry_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_fileselector_entry_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_selected_model_set, _elm_fileselector_entry_elm_interface_fileselector_selected_model_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_selected_model_get, _elm_fileselector_entry_elm_interface_fileselector_selected_model_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_folder_only_set, _elm_fileselector_entry_elm_interface_fileselector_folder_only_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_folder_only_get, _elm_fileselector_entry_elm_interface_fileselector_folder_only_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_is_save_set, _elm_fileselector_entry_elm_interface_fileselector_is_save_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_is_save_get, _elm_fileselector_entry_elm_interface_fileselector_is_save_get), + EFL_OBJECT_OP_FUNC(efl_ui_view_model_set, _elm_fileselector_entry_efl_ui_view_model_set), + EFL_OBJECT_OP_FUNC(efl_ui_view_model_get, _elm_fileselector_entry_efl_ui_view_model_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_expandable_set, _elm_fileselector_entry_elm_interface_fileselector_expandable_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_expandable_get, _elm_fileselector_entry_elm_interface_fileselector_expandable_get), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_fileselector_entry_efl_part_part_get), + ELM_FILESELECTOR_ENTRY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_fileselector_entry_class_desc = { + EO_VERSION, + "Elm.Fileselector_Entry", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Fileselector_Entry_Data), + _elm_fileselector_entry_class_initializer, + _elm_fileselector_entry_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_fileselector_entry_class_get, &_elm_fileselector_entry_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_FILESELECTOR_INTERFACE, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_fileselector_entry_eo.h b/src/lib/elementary/elm_fileselector_entry_eo.h new file mode 100644 index 0000000000..b343a7e212 --- /dev/null +++ b/src/lib/elementary/elm_fileselector_entry_eo.h @@ -0,0 +1,56 @@ +#ifndef _ELM_FILESELECTOR_ENTRY_EO_H_ +#define _ELM_FILESELECTOR_ENTRY_EO_H_ + +#ifndef _ELM_FILESELECTOR_ENTRY_EO_CLASS_TYPE +#define _ELM_FILESELECTOR_ENTRY_EO_CLASS_TYPE + +typedef Eo Elm_Fileselector_Entry; + +#endif + +#ifndef _ELM_FILESELECTOR_ENTRY_EO_TYPES +#define _ELM_FILESELECTOR_ENTRY_EO_TYPES + + +#endif +/** Elementary fileselector entry class + * + * @ingroup Elm_Fileselector_Entry + */ +#define ELM_FILESELECTOR_ENTRY_CLASS elm_fileselector_entry_class_get() + +EWAPI const Efl_Class *elm_fileselector_entry_class_get(void); + +EWAPI extern const Efl_Event_Description _ELM_FILESELECTOR_ENTRY_EVENT_CHANGED; + +/** Called when the entry changed + * + * @ingroup Elm_Fileselector_Entry + */ +#define ELM_FILESELECTOR_ENTRY_EVENT_CHANGED (&(_ELM_FILESELECTOR_ENTRY_EVENT_CHANGED)) + +EWAPI extern const Efl_Event_Description _ELM_FILESELECTOR_ENTRY_EVENT_ACTIVATED; + +/** Called when the entry was activated + * + * @ingroup Elm_Fileselector_Entry + */ +#define ELM_FILESELECTOR_ENTRY_EVENT_ACTIVATED (&(_ELM_FILESELECTOR_ENTRY_EVENT_ACTIVATED)) + +EWAPI extern const Efl_Event_Description _ELM_FILESELECTOR_ENTRY_EVENT_FILE_CHOSEN; + +/** Called when a file was chosen in the fileselector + * + * @ingroup Elm_Fileselector_Entry + */ +#define ELM_FILESELECTOR_ENTRY_EVENT_FILE_CHOSEN (&(_ELM_FILESELECTOR_ENTRY_EVENT_FILE_CHOSEN)) + +EWAPI extern const Efl_Event_Description _ELM_FILESELECTOR_ENTRY_EVENT_PRESS; + +/** Called when entry was pressed + * + * @ingroup Elm_Fileselector_Entry + */ +#define ELM_FILESELECTOR_ENTRY_EVENT_PRESS (&(_ELM_FILESELECTOR_ENTRY_EVENT_PRESS)) + +#endif diff --git a/src/lib/elementary/elm_fileselector_entry_eo.legacy.h b/src/lib/elementary/elm_fileselector_entry_eo.legacy.h new file mode 100644 index 0000000000..e0fbd6ab19 --- /dev/null +++ b/src/lib/elementary/elm_fileselector_entry_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_FILESELECTOR_ENTRY_EO_LEGACY_H_ +#define _ELM_FILESELECTOR_ENTRY_EO_LEGACY_H_ + +#ifndef _ELM_FILESELECTOR_ENTRY_EO_CLASS_TYPE +#define _ELM_FILESELECTOR_ENTRY_EO_CLASS_TYPE + +typedef Eo Elm_Fileselector_Entry; + +#endif + +#ifndef _ELM_FILESELECTOR_ENTRY_EO_TYPES +#define _ELM_FILESELECTOR_ENTRY_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_fileselector_entry_part.eo b/src/lib/elementary/elm_fileselector_entry_part.eo index 691edaa191..da932d8d27 100644 --- a/src/lib/elementary/elm_fileselector_entry_part.eo +++ b/src/lib/elementary/elm_fileselector_entry_part.eo @@ -1,4 +1,4 @@ -class Elm.Fileselector.Entry.Part extends Efl.Ui.Layout_Part_Legacy +class @beta Elm.Fileselector.Entry.Part extends Efl.Ui.Layout_Part_Legacy { [[Elementary fileselector entry internal part class]] data: null; diff --git a/src/lib/elementary/elm_fileselector_eo.c b/src/lib/elementary/elm_fileselector_eo.c new file mode 100644 index 0000000000..fa3e9d6408 --- /dev/null +++ b/src/lib/elementary/elm_fileselector_eo.c @@ -0,0 +1,207 @@ +EWAPI const Efl_Event_Description _ELM_FILESELECTOR_EVENT_DONE = + EFL_EVENT_DESCRIPTION("done"); +EWAPI const Efl_Event_Description _ELM_FILESELECTOR_EVENT_ACTIVATED = + EFL_EVENT_DESCRIPTION("activated"); +EWAPI const Efl_Event_Description _ELM_FILESELECTOR_EVENT_SELECTED_INVALID = + EFL_EVENT_DESCRIPTION("selected,invalid"); +EWAPI const Efl_Event_Description _ELM_FILESELECTOR_EVENT_DIRECTORY_OPEN = + EFL_EVENT_DESCRIPTION("directory,open"); + +void _elm_fileselector_buttons_ok_cancel_set(Eo *obj, Elm_Fileselector_Data *pd, Eina_Bool visible); + + +static Eina_Error +__eolian_elm_fileselector_buttons_ok_cancel_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_fileselector_buttons_ok_cancel_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_fileselector_buttons_ok_cancel_set, EFL_FUNC_CALL(visible), Eina_Bool visible); + +Eina_Bool _elm_fileselector_buttons_ok_cancel_get(const Eo *obj, Elm_Fileselector_Data *pd); + + +static Eina_Value +__eolian_elm_fileselector_buttons_ok_cancel_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_fileselector_buttons_ok_cancel_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_fileselector_buttons_ok_cancel_get, Eina_Bool, 0); + +Efl_Object *_elm_fileselector_efl_object_constructor(Eo *obj, Elm_Fileselector_Data *pd); + + +Eina_Bool _elm_fileselector_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Fileselector_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +Eina_Error _elm_fileselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Fileselector_Data *pd); + + +const Eina_List *_elm_fileselector_elm_interface_fileselector_selected_models_get(const Eo *obj, Elm_Fileselector_Data *pd); + + +Eina_Bool _elm_fileselector_elm_interface_fileselector_selected_model_set(Eo *obj, Elm_Fileselector_Data *pd, Efl_Io_Model *model); + + +Efl_Io_Model *_elm_fileselector_elm_interface_fileselector_selected_model_get(const Eo *obj, Elm_Fileselector_Data *pd); + + +Eina_Bool _elm_fileselector_elm_interface_fileselector_custom_filter_append(Eo *obj, Elm_Fileselector_Data *pd, Elm_Fileselector_Filter_Func func, void *data, const char *filter_name); + + +void _elm_fileselector_elm_interface_fileselector_expandable_set(Eo *obj, Elm_Fileselector_Data *pd, Eina_Bool expand); + + +Eina_Bool _elm_fileselector_elm_interface_fileselector_expandable_get(const Eo *obj, Elm_Fileselector_Data *pd); + + +void _elm_fileselector_elm_interface_fileselector_thumbnail_size_set(Eo *obj, Elm_Fileselector_Data *pd, int w, int h); + + +void _elm_fileselector_elm_interface_fileselector_thumbnail_size_get(const Eo *obj, Elm_Fileselector_Data *pd, int *w, int *h); + + +Eina_Bool _elm_fileselector_elm_interface_fileselector_mime_types_filter_append(Eo *obj, Elm_Fileselector_Data *pd, const char *mime_types, const char *filter_name); + + +void _elm_fileselector_elm_interface_fileselector_hidden_visible_set(Eo *obj, Elm_Fileselector_Data *pd, Eina_Bool hidden); + + +Eina_Bool _elm_fileselector_elm_interface_fileselector_hidden_visible_get(const Eo *obj, Elm_Fileselector_Data *pd); + + +void _elm_fileselector_elm_interface_fileselector_filters_clear(Eo *obj, Elm_Fileselector_Data *pd); + + +void _elm_fileselector_elm_interface_fileselector_is_save_set(Eo *obj, Elm_Fileselector_Data *pd, Eina_Bool is_save); + + +Eina_Bool _elm_fileselector_elm_interface_fileselector_is_save_get(const Eo *obj, Elm_Fileselector_Data *pd); + + +void _elm_fileselector_efl_ui_view_model_set(Eo *obj, Elm_Fileselector_Data *pd, Efl_Model *model); + + +Efl_Model *_elm_fileselector_efl_ui_view_model_get(const Eo *obj, Elm_Fileselector_Data *pd); + + +void _elm_fileselector_elm_interface_fileselector_sort_method_set(Eo *obj, Elm_Fileselector_Data *pd, Elm_Fileselector_Sort sort); + + +Elm_Fileselector_Sort _elm_fileselector_elm_interface_fileselector_sort_method_get(const Eo *obj, Elm_Fileselector_Data *pd); + + +void _elm_fileselector_elm_interface_fileselector_multi_select_set(Eo *obj, Elm_Fileselector_Data *pd, Eina_Bool multi); + + +Eina_Bool _elm_fileselector_elm_interface_fileselector_multi_select_get(const Eo *obj, Elm_Fileselector_Data *pd); + + +void _elm_fileselector_elm_interface_fileselector_folder_only_set(Eo *obj, Elm_Fileselector_Data *pd, Eina_Bool only); + + +Eina_Bool _elm_fileselector_elm_interface_fileselector_folder_only_get(const Eo *obj, Elm_Fileselector_Data *pd); + + +void _elm_fileselector_elm_interface_fileselector_mode_set(Eo *obj, Elm_Fileselector_Data *pd, Elm_Fileselector_Mode mode); + + +Elm_Fileselector_Mode _elm_fileselector_elm_interface_fileselector_mode_get(const Eo *obj, Elm_Fileselector_Data *pd); + + +void _elm_fileselector_elm_interface_fileselector_current_name_set(Eo *obj, Elm_Fileselector_Data *pd, const char *name); + + +const char *_elm_fileselector_elm_interface_fileselector_current_name_get(const Eo *obj, Elm_Fileselector_Data *pd); + + +const Efl_Access_Action_Data *_elm_fileselector_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Fileselector_Data *pd); + + +Efl_Object *_elm_fileselector_efl_part_part_get(const Eo *obj, Elm_Fileselector_Data *pd, const char *name); + + +static Eina_Bool +_elm_fileselector_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_FILESELECTOR_EXTRA_OPS +#define ELM_FILESELECTOR_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_fileselector_buttons_ok_cancel_set, _elm_fileselector_buttons_ok_cancel_set), + EFL_OBJECT_OP_FUNC(elm_obj_fileselector_buttons_ok_cancel_get, _elm_fileselector_buttons_ok_cancel_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_fileselector_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_fileselector_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_fileselector_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_selected_models_get, _elm_fileselector_elm_interface_fileselector_selected_models_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_selected_model_set, _elm_fileselector_elm_interface_fileselector_selected_model_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_selected_model_get, _elm_fileselector_elm_interface_fileselector_selected_model_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_custom_filter_append, _elm_fileselector_elm_interface_fileselector_custom_filter_append), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_expandable_set, _elm_fileselector_elm_interface_fileselector_expandable_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_expandable_get, _elm_fileselector_elm_interface_fileselector_expandable_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_thumbnail_size_set, _elm_fileselector_elm_interface_fileselector_thumbnail_size_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_thumbnail_size_get, _elm_fileselector_elm_interface_fileselector_thumbnail_size_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_mime_types_filter_append, _elm_fileselector_elm_interface_fileselector_mime_types_filter_append), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_hidden_visible_set, _elm_fileselector_elm_interface_fileselector_hidden_visible_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_hidden_visible_get, _elm_fileselector_elm_interface_fileselector_hidden_visible_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_filters_clear, _elm_fileselector_elm_interface_fileselector_filters_clear), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_is_save_set, _elm_fileselector_elm_interface_fileselector_is_save_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_is_save_get, _elm_fileselector_elm_interface_fileselector_is_save_get), + EFL_OBJECT_OP_FUNC(efl_ui_view_model_set, _elm_fileselector_efl_ui_view_model_set), + EFL_OBJECT_OP_FUNC(efl_ui_view_model_get, _elm_fileselector_efl_ui_view_model_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_sort_method_set, _elm_fileselector_elm_interface_fileselector_sort_method_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_sort_method_get, _elm_fileselector_elm_interface_fileselector_sort_method_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_multi_select_set, _elm_fileselector_elm_interface_fileselector_multi_select_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_multi_select_get, _elm_fileselector_elm_interface_fileselector_multi_select_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_folder_only_set, _elm_fileselector_elm_interface_fileselector_folder_only_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_folder_only_get, _elm_fileselector_elm_interface_fileselector_folder_only_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_mode_set, _elm_fileselector_elm_interface_fileselector_mode_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_mode_get, _elm_fileselector_elm_interface_fileselector_mode_get), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_current_name_set, _elm_fileselector_elm_interface_fileselector_current_name_set), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_current_name_get, _elm_fileselector_elm_interface_fileselector_current_name_get), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_fileselector_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_fileselector_efl_part_part_get), + ELM_FILESELECTOR_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"buttons_ok_cancel", __eolian_elm_fileselector_buttons_ok_cancel_set_reflect, __eolian_elm_fileselector_buttons_ok_cancel_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_fileselector_class_desc = { + EO_VERSION, + "Elm.Fileselector", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Fileselector_Data), + _elm_fileselector_class_initializer, + _elm_fileselector_class_constructor, + _elm_fileselector_class_destructor +}; + +EFL_DEFINE_CLASS(elm_fileselector_class_get, &_elm_fileselector_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_FILESELECTOR_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_fileselector_eo.legacy.c" diff --git a/src/lib/elementary/elm_fileselector_eo.h b/src/lib/elementary/elm_fileselector_eo.h new file mode 100644 index 0000000000..74ce3f1984 --- /dev/null +++ b/src/lib/elementary/elm_fileselector_eo.h @@ -0,0 +1,87 @@ +#ifndef _ELM_FILESELECTOR_EO_H_ +#define _ELM_FILESELECTOR_EO_H_ + +#ifndef _ELM_FILESELECTOR_EO_CLASS_TYPE +#define _ELM_FILESELECTOR_EO_CLASS_TYPE + +typedef Eo Elm_Fileselector; + +#endif + +#ifndef _ELM_FILESELECTOR_EO_TYPES +#define _ELM_FILESELECTOR_EO_TYPES + + +#endif +/** Elementary fileselector class + * + * @ingroup Elm_Fileselector + */ +#define ELM_FILESELECTOR_CLASS elm_fileselector_class_get() + +EWAPI const Efl_Class *elm_fileselector_class_get(void); + +/** + * @brief Enable/disable the "ok" and "cancel" buttons on a given file selector + * widget + * + * @note A file selector without those buttons will never emit the "done" smart + * event, and is only usable if one is just hooking to the other two events. + * + * See also @ref elm_obj_fileselector_buttons_ok_cancel_get. + * + * @param[in] obj The object. + * @param[in] visible @c true to show buttons, @c false to hide. + * + * @ingroup Elm_Fileselector + */ +EOAPI void elm_obj_fileselector_buttons_ok_cancel_set(Eo *obj, Eina_Bool visible); + +/** + * @brief Get whether the "ok" and "cancel" buttons on a given file selector + * widget are being shown. + * + * See also @ref elm_obj_fileselector_buttons_ok_cancel_set for more details. + * + * @param[in] obj The object. + * + * @return @c true to show buttons, @c false to hide. + * + * @ingroup Elm_Fileselector + */ +EOAPI Eina_Bool elm_obj_fileselector_buttons_ok_cancel_get(const Eo *obj); + +EWAPI extern const Efl_Event_Description _ELM_FILESELECTOR_EVENT_DONE; + +/** Called when OK button was pressed + * @return const char * + * + * @ingroup Elm_Fileselector + */ +#define ELM_FILESELECTOR_EVENT_DONE (&(_ELM_FILESELECTOR_EVENT_DONE)) + +EWAPI extern const Efl_Event_Description _ELM_FILESELECTOR_EVENT_ACTIVATED; + +/** Called when the filesector was activated + * + * @ingroup Elm_Fileselector + */ +#define ELM_FILESELECTOR_EVENT_ACTIVATED (&(_ELM_FILESELECTOR_EVENT_ACTIVATED)) + +EWAPI extern const Efl_Event_Description _ELM_FILESELECTOR_EVENT_SELECTED_INVALID; + +/** Called when fileselector was selected + * + * @ingroup Elm_Fileselector + */ +#define ELM_FILESELECTOR_EVENT_SELECTED_INVALID (&(_ELM_FILESELECTOR_EVENT_SELECTED_INVALID)) + +EWAPI extern const Efl_Event_Description _ELM_FILESELECTOR_EVENT_DIRECTORY_OPEN; + +/** Called when a directory was opened + * + * @ingroup Elm_Fileselector + */ +#define ELM_FILESELECTOR_EVENT_DIRECTORY_OPEN (&(_ELM_FILESELECTOR_EVENT_DIRECTORY_OPEN)) + +#endif diff --git a/src/lib/elementary/elm_fileselector_eo.legacy.c b/src/lib/elementary/elm_fileselector_eo.legacy.c new file mode 100644 index 0000000000..3780777255 --- /dev/null +++ b/src/lib/elementary/elm_fileselector_eo.legacy.c @@ -0,0 +1,12 @@ + +EAPI void +elm_fileselector_buttons_ok_cancel_set(Elm_Fileselector *obj, Eina_Bool visible) +{ + elm_obj_fileselector_buttons_ok_cancel_set(obj, visible); +} + +EAPI Eina_Bool +elm_fileselector_buttons_ok_cancel_get(const Elm_Fileselector *obj) +{ + return elm_obj_fileselector_buttons_ok_cancel_get(obj); +} diff --git a/src/lib/elementary/elm_fileselector_eo.legacy.h b/src/lib/elementary/elm_fileselector_eo.legacy.h new file mode 100644 index 0000000000..c9c46bef92 --- /dev/null +++ b/src/lib/elementary/elm_fileselector_eo.legacy.h @@ -0,0 +1,47 @@ +#ifndef _ELM_FILESELECTOR_EO_LEGACY_H_ +#define _ELM_FILESELECTOR_EO_LEGACY_H_ + +#ifndef _ELM_FILESELECTOR_EO_CLASS_TYPE +#define _ELM_FILESELECTOR_EO_CLASS_TYPE + +typedef Eo Elm_Fileselector; + +#endif + +#ifndef _ELM_FILESELECTOR_EO_TYPES +#define _ELM_FILESELECTOR_EO_TYPES + + +#endif + +/** + * @brief Enable/disable the "ok" and "cancel" buttons on a given file selector + * widget + * + * @note A file selector without those buttons will never emit the "done" smart + * event, and is only usable if one is just hooking to the other two events. + * + * See also @ref elm_fileselector_buttons_ok_cancel_get. + * + * @param[in] obj The object. + * @param[in] visible @c true to show buttons, @c false to hide. + * + * @ingroup Elm_Fileselector_Group + */ +EAPI void elm_fileselector_buttons_ok_cancel_set(Elm_Fileselector *obj, Eina_Bool visible); + +/** + * @brief Get whether the "ok" and "cancel" buttons on a given file selector + * widget are being shown. + * + * See also @ref elm_fileselector_buttons_ok_cancel_set for more details. + * + * @param[in] obj The object. + * + * @return @c true to show buttons, @c false to hide. + * + * @ingroup Elm_Fileselector_Group + */ +EAPI Eina_Bool elm_fileselector_buttons_ok_cancel_get(const Elm_Fileselector *obj); + +#endif diff --git a/src/lib/elementary/elm_fileselector_part.eo b/src/lib/elementary/elm_fileselector_part.eo index 8e504f443f..7a1b396ade 100644 --- a/src/lib/elementary/elm_fileselector_part.eo +++ b/src/lib/elementary/elm_fileselector_part.eo @@ -1,4 +1,4 @@ -class Elm.Fileselector.Part extends Efl.Ui.Layout_Part_Legacy +class @beta Elm.Fileselector.Part extends Efl.Ui.Layout_Part_Legacy { [[Elementary fileselector entry internal part class]] data: null; diff --git a/src/lib/elementary/elm_flip.h b/src/lib/elementary/elm_flip.h index cbac3689ae..475ce98220 100644 --- a/src/lib/elementary/elm_flip.h +++ b/src/lib/elementary/elm_flip.h @@ -35,9 +35,6 @@ * @{ */ -#ifdef EFL_EO_API_SUPPORT -#include "efl_ui_flip_eo.h" -#endif #ifndef EFL_NOLEGACY_API_SUPPORT #include "efl_ui_flip_legacy.h" #endif diff --git a/src/lib/elementary/elm_flip_part.eo b/src/lib/elementary/elm_flip_part.eo index df5a1177f9..fbf80070c0 100644 --- a/src/lib/elementary/elm_flip_part.eo +++ b/src/lib/elementary/elm_flip_part.eo @@ -1,4 +1,4 @@ -class Elm.Flip.Part extends Efl.Object implements Efl.Content +class @beta Elm.Flip.Part extends Efl.Object implements Efl.Content { [[Elementary flip internal part class]] data: null; diff --git a/src/lib/elementary/elm_flipselector.c b/src/lib/elementary/elm_flipselector.c index 4aeaf9b125..f9ba061f75 100644 --- a/src/lib/elementary/elm_flipselector.c +++ b/src/lib/elementary/elm_flipselector.c @@ -10,8 +10,8 @@ #include "elm_priv.h" #include "elm_widget_flipselector.h" -#include "elm_flipselector.eo.h" -#include "elm_flipselector_item.eo.h" +#include "elm_flipselector_eo.h" +#include "elm_flipselector_item_eo.h" #define MY_CLASS ELM_FLIPSELECTOR_CLASS @@ -233,8 +233,7 @@ _on_item_changed(Elm_Flipselector_Data *sd) if (item->func) item->func((void *)WIDGET_ITEM_DATA_GET(eo_item), WIDGET(item), eo_item); - efl_event_callback_legacy_call - (sd->obj, EFL_UI_EVENT_SELECTED, eo_item); + evas_object_smart_callback_call(sd->obj, "selected", eo_item); } static void @@ -350,16 +349,16 @@ _item_new(Evas_Object *obj, return eo_item; } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_flipselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Flipselector_Data *sd) { const char *max_len; - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; max_len = edje_object_data_get(wd->resize_obj, "max_len"); if (!max_len) sd->max_len = MAX_LEN_DEFAULT; @@ -474,7 +473,7 @@ _items_add(Evas_Object *obj) } EOLIAN static void -_elm_flipselector_efl_ui_range_range_min_max_set(Eo *obj, Elm_Flipselector_Data *sd, double min, double max) +_elm_flipselector_efl_ui_range_display_range_min_max_set(Eo *obj, Elm_Flipselector_Data *sd, double min, double max) { if ((sd->val_min == min) && (sd->val_max == max)) return; @@ -485,14 +484,14 @@ _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(const Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd, double *min, double *max) +_elm_flipselector_efl_ui_range_display_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; } EOLIAN static void -_elm_flipselector_efl_ui_range_range_step_set(Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd, double step) +_elm_flipselector_efl_ui_range_interactive_range_step_set(Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd, double step) { if (sd->step == step) return; @@ -504,13 +503,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(const Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd) +_elm_flipselector_efl_ui_range_interactive_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(const Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd) +_elm_flipselector_efl_ui_range_display_range_value_get(const Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd) { if (sd->val_min == 0 && sd->val_max == 0) { @@ -522,7 +521,7 @@ _elm_flipselector_efl_ui_range_range_value_get(const Eo *obj EINA_UNUSED, Elm_Fl } EOLIAN static void -_elm_flipselector_efl_ui_range_range_value_set(Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd, double val) +_elm_flipselector_efl_ui_range_display_range_value_set(Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd, double val) { Eina_List *l; Elm_Object_Item *it; @@ -617,7 +616,6 @@ EOLIAN static void _elm_flipselector_efl_canvas_group_group_add(Eo *obj, Elm_Flipselector_Data *priv) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set (obj, "flipselector", "base", elm_widget_style_get(obj))) @@ -903,5 +901,5 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_flipselector, Elm_Flipselector_Data) ELM_LAYOUT_SIZING_EVAL_OPS(elm_flipselector), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_flipselector) -#include "elm_flipselector_item.eo.c" -#include "elm_flipselector.eo.c" +#include "elm_flipselector_item_eo.c" +#include "elm_flipselector_eo.c" diff --git a/src/lib/elementary/elm_flipselector.eo b/src/lib/elementary/elm_flipselector.eo deleted file mode 100644 index a0dc8a2401..0000000000 --- a/src/lib/elementary/elm_flipselector.eo +++ /dev/null @@ -1,175 +0,0 @@ -class Elm.Flipselector extends Efl.Ui.Layout implements Efl.Ui.Range, - Efl.Access.Widget.Action, - Efl.Ui.Selectable, Efl.Ui.Legacy -{ - [[Elementary flipselector class]] - legacy_prefix: elm_flipselector; - eo_prefix: elm_obj_flipselector; - event_prefix: elm_flipselector; - methods { - @property items { - get { - [[Get the internal list of items in a given flip selector 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, - \@ref elm_flipselector_item_selected_get, - \@ref elm_flipselector_item_selected_set. - - Warning: This list is only valid until $obj object's internal - items list is changed. It should be fetched again with another - call to this function when changes happen. - ]] - return: const(list); [[List of items]] - } - } - @property first_item { - get { - [[Get the first item in the given flip selector widget's list of - items. - - See also @.item_append, - @.last_item.get. - ]] - return: Elm.Widget.Item; [[The first item or $null, if it has no items (and on - errors).]] - - } - } - @property last_item { - get { - [[Get the last item in the given flip selector widget's list of - items. - - See also @.item_prepend, - @.first_item.get. - ]] - return: Elm.Widget.Item; [[The last item or $null, if it has no items (and on - errors).]] - - } - } - @property selected_item { - get { - [[Get the currently selected item in a flip selector widget.]] - return: Elm.Widget.Item; [[The selected item or $null, if the widget has no items - (and on errors).]] - - } - } - @property first_interval { - set { - [[Set the interval on time updates for a user mouse button hold - on a flip selector widget. - - This interval value is decreased while the user holds the - mouse pointer either flipping up or flipping down a given flip - selector. - - This helps the user to get to a given item distant from the - current one easier/faster, as it will start to flip quicker and - quicker on mouse button holds. - - The calculation for the next flip interval value, starting from - the one set with this call, is the previous interval divided by - 1.05, so it decreases a little bit. - - The default starting interval value for automatic flips is - 0.85 seconds. - - See also @.first_interval.get. - ]] - } - get { - [[Get the interval on time updates for an user mouse button hold - on a flip selector widget. - - See also @.first_interval.set for more details. - ]] - } - values { - interval: double; [[The (first) interval value in seconds.]] - } - } - item_prepend { - [[Prepend a (text) item to a flip selector widget - - The widget's list of labels to show will be prepended with the - given value. If the user wishes so, a callback function pointer - can be passed, which will get called when this same item is - selected. - - Note: The current selection won't be modified by prepending - an element to the list. - - Note: The maximum length of the text label is going to be - determined by the widget's theme. Strings larger than - that value are going to be truncated. - ]] - return: Elm.Widget.Item; [[New widget item]] - params { - @in label: string; [[The (text) label of the new item.]] - @in func: Evas_Smart_Cb @optional; [[Convenience callback function to take place when - item is selected.]] - @in data: void_ptr @optional; [[Data passed to $func, above.]] - } - } - flip_next { - [[Programmatically select the next item of a flip selector widget - - Note: The selection will be animated. Also, if it reaches the - end of its list of member items, it will continue with the first - one onwards. - ]] - } - item_append { - [[Append a (text) item to a flip selector widget - - The widget's list of labels to show will be appended with the - given value. If the user wishes so, a callback function pointer - can be passed, which will get called when this same item is - selected. - - Note: The current selection won't be modified by appending an - element to the list. - - Note: The maximum length of the text label is going to be - determined by the widget's theme. Strings larger than - that value are going to be truncated. - ]] - return: Elm.Widget.Item; [[New widget item]] - params { - @in label: string; [[The (text) label of the new item.]] - @in func: Evas_Smart_Cb @optional; [[Convenience callback function to take place when - item is selected.]] - @in data: const(void_ptr) @optional; [[Data passed to $func, above.]] - } - } - flip_prev { - [[Programmatically select the previous item of a flip selector - widget - - Note: The selection will be animated. Also, if it reaches the - beginning of its list of member items, it will continue with the - last one backwards. - ]] - } - } - implements { - class.constructor; - Efl.Object.constructor; - 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: void; [[Called when flipselector is underflowed]] - overflowed: void; [[Called when flipselector is overflowed]] - } -} diff --git a/src/lib/elementary/elm_flipselector_eo.c b/src/lib/elementary/elm_flipselector_eo.c new file mode 100644 index 0000000000..f4bdae836b --- /dev/null +++ b/src/lib/elementary/elm_flipselector_eo.c @@ -0,0 +1,159 @@ +EWAPI const Efl_Event_Description _ELM_FLIPSELECTOR_EVENT_UNDERFLOWED = + EFL_EVENT_DESCRIPTION("underflowed"); +EWAPI const Efl_Event_Description _ELM_FLIPSELECTOR_EVENT_OVERFLOWED = + EFL_EVENT_DESCRIPTION("overflowed"); + +const Eina_List *_elm_flipselector_items_get(const Eo *obj, Elm_Flipselector_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_flipselector_items_get, const Eina_List *, NULL); + +Elm_Widget_Item *_elm_flipselector_first_item_get(const Eo *obj, Elm_Flipselector_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_flipselector_first_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_flipselector_last_item_get(const Eo *obj, Elm_Flipselector_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_flipselector_last_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_flipselector_selected_item_get(const Eo *obj, Elm_Flipselector_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_flipselector_selected_item_get, Elm_Widget_Item *, NULL); + +void _elm_flipselector_first_interval_set(Eo *obj, Elm_Flipselector_Data *pd, double interval); + + +static Eina_Error +__eolian_elm_flipselector_first_interval_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_flipselector_first_interval_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_flipselector_first_interval_set, EFL_FUNC_CALL(interval), double interval); + +double _elm_flipselector_first_interval_get(const Eo *obj, Elm_Flipselector_Data *pd); + + +static Eina_Value +__eolian_elm_flipselector_first_interval_get_reflect(const Eo *obj) +{ + double val = elm_obj_flipselector_first_interval_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_flipselector_first_interval_get, double, 0); + +Elm_Widget_Item *_elm_flipselector_item_prepend(Eo *obj, Elm_Flipselector_Data *pd, const char *label, Evas_Smart_Cb func, void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_flipselector_item_prepend, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(label, func, data), const char *label, Evas_Smart_Cb func, void *data); + +void _elm_flipselector_flip_next(Eo *obj, Elm_Flipselector_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_flipselector_flip_next); + +Elm_Widget_Item *_elm_flipselector_item_append(Eo *obj, Elm_Flipselector_Data *pd, const char *label, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_flipselector_item_append, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(label, func, data), const char *label, Evas_Smart_Cb func, const void *data); + +void _elm_flipselector_flip_prev(Eo *obj, Elm_Flipselector_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_flipselector_flip_prev); + +Efl_Object *_elm_flipselector_efl_object_constructor(Eo *obj, Elm_Flipselector_Data *pd); + + +Eina_Error _elm_flipselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Flipselector_Data *pd); + + +Eina_Bool _elm_flipselector_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Flipselector_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +void _elm_flipselector_efl_ui_range_display_range_min_max_set(Eo *obj, Elm_Flipselector_Data *pd, double min, double max); + + +void _elm_flipselector_efl_ui_range_display_range_min_max_get(const Eo *obj, Elm_Flipselector_Data *pd, double *min, double *max); + + +void _elm_flipselector_efl_ui_range_interactive_range_step_set(Eo *obj, Elm_Flipselector_Data *pd, double step); + + +double _elm_flipselector_efl_ui_range_interactive_range_step_get(const Eo *obj, Elm_Flipselector_Data *pd); + + +void _elm_flipselector_efl_ui_range_display_range_value_set(Eo *obj, Elm_Flipselector_Data *pd, double val); + + +double _elm_flipselector_efl_ui_range_display_range_value_get(const Eo *obj, Elm_Flipselector_Data *pd); + + +const Efl_Access_Action_Data *_elm_flipselector_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Flipselector_Data *pd); + + +static Eina_Bool +_elm_flipselector_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_FLIPSELECTOR_EXTRA_OPS +#define ELM_FLIPSELECTOR_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_flipselector_items_get, _elm_flipselector_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_flipselector_first_item_get, _elm_flipselector_first_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_flipselector_last_item_get, _elm_flipselector_last_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_flipselector_selected_item_get, _elm_flipselector_selected_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_flipselector_first_interval_set, _elm_flipselector_first_interval_set), + EFL_OBJECT_OP_FUNC(elm_obj_flipselector_first_interval_get, _elm_flipselector_first_interval_get), + EFL_OBJECT_OP_FUNC(elm_obj_flipselector_item_prepend, _elm_flipselector_item_prepend), + EFL_OBJECT_OP_FUNC(elm_obj_flipselector_flip_next, _elm_flipselector_flip_next), + EFL_OBJECT_OP_FUNC(elm_obj_flipselector_item_append, _elm_flipselector_item_append), + EFL_OBJECT_OP_FUNC(elm_obj_flipselector_flip_prev, _elm_flipselector_flip_prev), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_flipselector_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_flipselector_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_flipselector_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(efl_ui_range_min_max_set, _elm_flipselector_efl_ui_range_display_range_min_max_set), + EFL_OBJECT_OP_FUNC(efl_ui_range_min_max_get, _elm_flipselector_efl_ui_range_display_range_min_max_get), + EFL_OBJECT_OP_FUNC(efl_ui_range_step_set, _elm_flipselector_efl_ui_range_interactive_range_step_set), + EFL_OBJECT_OP_FUNC(efl_ui_range_step_get, _elm_flipselector_efl_ui_range_interactive_range_step_get), + EFL_OBJECT_OP_FUNC(efl_ui_range_value_set, _elm_flipselector_efl_ui_range_display_range_value_set), + EFL_OBJECT_OP_FUNC(efl_ui_range_value_get, _elm_flipselector_efl_ui_range_display_range_value_get), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_flipselector_efl_access_widget_action_elm_actions_get), + ELM_FLIPSELECTOR_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"first_interval", __eolian_elm_flipselector_first_interval_set_reflect, __eolian_elm_flipselector_first_interval_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_flipselector_class_desc = { + EO_VERSION, + "Elm.Flipselector", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Flipselector_Data), + _elm_flipselector_class_initializer, + _elm_flipselector_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_flipselector_class_get, &_elm_flipselector_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_RANGE_INTERACTIVE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_flipselector_eo.legacy.c" diff --git a/src/lib/elementary/elm_flipselector_eo.h b/src/lib/elementary/elm_flipselector_eo.h new file mode 100644 index 0000000000..59b3c483e3 --- /dev/null +++ b/src/lib/elementary/elm_flipselector_eo.h @@ -0,0 +1,212 @@ +#ifndef _ELM_FLIPSELECTOR_EO_H_ +#define _ELM_FLIPSELECTOR_EO_H_ + +#ifndef _ELM_FLIPSELECTOR_EO_CLASS_TYPE +#define _ELM_FLIPSELECTOR_EO_CLASS_TYPE + +typedef Eo Elm_Flipselector; + +#endif + +#ifndef _ELM_FLIPSELECTOR_EO_TYPES +#define _ELM_FLIPSELECTOR_EO_TYPES + + +#endif +/** Elementary flipselector class + * + * @ingroup Elm_Flipselector + */ +#define ELM_FLIPSELECTOR_CLASS elm_flipselector_class_get() + +EWAPI const Efl_Class *elm_flipselector_class_get(void); + +/** + * @brief Get the internal list of items in a given flip selector 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, @ref + * elm_flipselector_item_selected_get, @ref elm_flipselector_item_selected_set. + * + * @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. + * + * @param[in] obj The object. + * + * @return List of items + * + * @ingroup Elm_Flipselector + */ +EOAPI const Eina_List *elm_obj_flipselector_items_get(const Eo *obj); + +/** + * @brief Get the first item in the given flip selector widget's list of items. + * + * See also @ref elm_obj_flipselector_item_append, + * @ref elm_obj_flipselector_last_item_get. + * + * @param[in] obj The object. + * + * @return The first item or @c null, if it has no items (and on errors). + * + * @ingroup Elm_Flipselector + */ +EOAPI Elm_Widget_Item *elm_obj_flipselector_first_item_get(const Eo *obj); + +/** + * @brief Get the last item in the given flip selector widget's list of items. + * + * See also @ref elm_obj_flipselector_item_prepend, + * @ref elm_obj_flipselector_first_item_get. + * + * @param[in] obj The object. + * + * @return The last item or @c null, if it has no items (and on errors). + * + * @ingroup Elm_Flipselector + */ +EOAPI Elm_Widget_Item *elm_obj_flipselector_last_item_get(const Eo *obj); + +/** + * @brief Get the currently selected item in a flip selector widget. + * + * @param[in] obj The object. + * + * @return The selected item or @c null, if the widget has no items (and on + * errors). + * + * @ingroup Elm_Flipselector + */ +EOAPI Elm_Widget_Item *elm_obj_flipselector_selected_item_get(const Eo *obj); + +/** + * @brief Set the interval on time updates for a user mouse button hold on a + * flip selector widget. + * + * This interval value is decreased while the user holds the mouse pointer + * either flipping up or flipping down a given flip selector. + * + * This helps the user to get to a given item distant from the current one + * easier/faster, as it will start to flip quicker and quicker on mouse button + * holds. + * + * The calculation for the next flip interval value, starting from the one set + * with this call, is the previous interval divided by 1.05, so it decreases a + * little bit. + * + * The default starting interval value for automatic flips is 0.85 seconds. + * + * See also @ref elm_obj_flipselector_first_interval_get. + * + * @param[in] obj The object. + * @param[in] interval The (first) interval value in seconds. + * + * @ingroup Elm_Flipselector + */ +EOAPI void elm_obj_flipselector_first_interval_set(Eo *obj, double interval); + +/** + * @brief Get the interval on time updates for an user mouse button hold on a + * flip selector widget. + * + * See also @ref elm_obj_flipselector_first_interval_set for more details. + * + * @param[in] obj The object. + * + * @return The (first) interval value in seconds. + * + * @ingroup Elm_Flipselector + */ +EOAPI double elm_obj_flipselector_first_interval_get(const Eo *obj); + +/** + * @brief Prepend a (text) item to a flip selector widget + * + * The widget's list of labels to show will be prepended with the given value. + * If the user wishes so, a callback function pointer can be passed, which will + * get called when this same item is selected. + * + * @note The current selection won't be modified by prepending an element to + * the list. + * + * @note The maximum length of the text label is going to be determined by the + * widget's theme. Strings larger than that value are going to be truncated. + * + * @param[in] obj The object. + * @param[in] label The (text) label of the new item. + * @param[in] func Convenience callback function to take place when item is + * selected. + * @param[in] data Data passed to @c func, above. + * + * @return New widget item + * + * @ingroup Elm_Flipselector + */ +EOAPI Elm_Widget_Item *elm_obj_flipselector_item_prepend(Eo *obj, const char *label, Evas_Smart_Cb func, void *data); + +/** + * @brief Programmatically select the next item of a flip selector widget + * + * @note The selection will be animated. Also, if it reaches the end of its + * list of member items, it will continue with the first one onwards. + * @param[in] obj The object. + * + * @ingroup Elm_Flipselector + */ +EOAPI void elm_obj_flipselector_flip_next(Eo *obj); + +/** + * @brief Append a (text) item to a flip selector widget + * + * The widget's list of labels to show will be appended with the given value. + * If the user wishes so, a callback function pointer can be passed, which will + * get called when this same item is selected. + * + * @note The current selection won't be modified by appending an element to the + * list. + * + * @note The maximum length of the text label is going to be determined by the + * widget's theme. Strings larger than that value are going to be truncated. + * + * @param[in] obj The object. + * @param[in] label The (text) label of the new item. + * @param[in] func Convenience callback function to take place when item is + * selected. + * @param[in] data Data passed to @c func, above. + * + * @return New widget item + * + * @ingroup Elm_Flipselector + */ +EOAPI Elm_Widget_Item *elm_obj_flipselector_item_append(Eo *obj, const char *label, Evas_Smart_Cb func, const void *data); + +/** + * @brief Programmatically select the previous item of a flip selector widget + * + * @note The selection will be animated. Also, if it reaches the beginning of + * its list of member items, it will continue with the last one backwards. + * @param[in] obj The object. + * + * @ingroup Elm_Flipselector + */ +EOAPI void elm_obj_flipselector_flip_prev(Eo *obj); + +EWAPI extern const Efl_Event_Description _ELM_FLIPSELECTOR_EVENT_UNDERFLOWED; + +/** Called when flipselector is underflowed + * + * @ingroup Elm_Flipselector + */ +#define ELM_FLIPSELECTOR_EVENT_UNDERFLOWED (&(_ELM_FLIPSELECTOR_EVENT_UNDERFLOWED)) + +EWAPI extern const Efl_Event_Description _ELM_FLIPSELECTOR_EVENT_OVERFLOWED; + +/** Called when flipselector is overflowed + * + * @ingroup Elm_Flipselector + */ +#define ELM_FLIPSELECTOR_EVENT_OVERFLOWED (&(_ELM_FLIPSELECTOR_EVENT_OVERFLOWED)) + +#endif diff --git a/src/lib/elementary/elm_flipselector_eo.legacy.c b/src/lib/elementary/elm_flipselector_eo.legacy.c new file mode 100644 index 0000000000..26bdc3a228 --- /dev/null +++ b/src/lib/elementary/elm_flipselector_eo.legacy.c @@ -0,0 +1,60 @@ + +EAPI const Eina_List * +elm_flipselector_items_get(const Elm_Flipselector *obj) +{ + return elm_obj_flipselector_items_get(obj); +} + +EAPI Elm_Widget_Item * +elm_flipselector_first_item_get(const Elm_Flipselector *obj) +{ + return elm_obj_flipselector_first_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_flipselector_last_item_get(const Elm_Flipselector *obj) +{ + return elm_obj_flipselector_last_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_flipselector_selected_item_get(const Elm_Flipselector *obj) +{ + return elm_obj_flipselector_selected_item_get(obj); +} + +EAPI void +elm_flipselector_first_interval_set(Elm_Flipselector *obj, double interval) +{ + elm_obj_flipselector_first_interval_set(obj, interval); +} + +EAPI double +elm_flipselector_first_interval_get(const Elm_Flipselector *obj) +{ + return elm_obj_flipselector_first_interval_get(obj); +} + +EAPI Elm_Widget_Item * +elm_flipselector_item_prepend(Elm_Flipselector *obj, const char *label, Evas_Smart_Cb func, void *data) +{ + return elm_obj_flipselector_item_prepend(obj, label, func, data); +} + +EAPI void +elm_flipselector_flip_next(Elm_Flipselector *obj) +{ + elm_obj_flipselector_flip_next(obj); +} + +EAPI Elm_Widget_Item * +elm_flipselector_item_append(Elm_Flipselector *obj, const char *label, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_flipselector_item_append(obj, label, func, data); +} + +EAPI void +elm_flipselector_flip_prev(Elm_Flipselector *obj) +{ + elm_obj_flipselector_flip_prev(obj); +} diff --git a/src/lib/elementary/elm_flipselector_eo.legacy.h b/src/lib/elementary/elm_flipselector_eo.legacy.h new file mode 100644 index 0000000000..707d7a3d5e --- /dev/null +++ b/src/lib/elementary/elm_flipselector_eo.legacy.h @@ -0,0 +1,189 @@ +#ifndef _ELM_FLIPSELECTOR_EO_LEGACY_H_ +#define _ELM_FLIPSELECTOR_EO_LEGACY_H_ + +#ifndef _ELM_FLIPSELECTOR_EO_CLASS_TYPE +#define _ELM_FLIPSELECTOR_EO_CLASS_TYPE + +typedef Eo Elm_Flipselector; + +#endif + +#ifndef _ELM_FLIPSELECTOR_EO_TYPES +#define _ELM_FLIPSELECTOR_EO_TYPES + + +#endif + +/** + * @brief Get the internal list of items in a given flip selector 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, @ref + * elm_flipselector_item_selected_get, @ref elm_flipselector_item_selected_set. + * + * @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. + * + * @param[in] obj The object. + * + * @return List of items + * + * @ingroup Elm_Flipselector_Group + */ +EAPI const Eina_List *elm_flipselector_items_get(const Elm_Flipselector *obj); + +/** + * @brief Get the first item in the given flip selector widget's list of items. + * + * See also @ref elm_flipselector_item_append, + * @ref elm_flipselector_last_item_get. + * + * @param[in] obj The object. + * + * @return The first item or @c null, if it has no items (and on errors). + * + * @ingroup Elm_Flipselector_Group + */ +EAPI Elm_Widget_Item *elm_flipselector_first_item_get(const Elm_Flipselector *obj); + +/** + * @brief Get the last item in the given flip selector widget's list of items. + * + * See also @ref elm_flipselector_item_prepend, + * @ref elm_flipselector_first_item_get. + * + * @param[in] obj The object. + * + * @return The last item or @c null, if it has no items (and on errors). + * + * @ingroup Elm_Flipselector_Group + */ +EAPI Elm_Widget_Item *elm_flipselector_last_item_get(const Elm_Flipselector *obj); + +/** + * @brief Get the currently selected item in a flip selector widget. + * + * @param[in] obj The object. + * + * @return The selected item or @c null, if the widget has no items (and on + * errors). + * + * @ingroup Elm_Flipselector_Group + */ +EAPI Elm_Widget_Item *elm_flipselector_selected_item_get(const Elm_Flipselector *obj); + +/** + * @brief Set the interval on time updates for a user mouse button hold on a + * flip selector widget. + * + * This interval value is decreased while the user holds the mouse pointer + * either flipping up or flipping down a given flip selector. + * + * This helps the user to get to a given item distant from the current one + * easier/faster, as it will start to flip quicker and quicker on mouse button + * holds. + * + * The calculation for the next flip interval value, starting from the one set + * with this call, is the previous interval divided by 1.05, so it decreases a + * little bit. + * + * The default starting interval value for automatic flips is 0.85 seconds. + * + * See also @ref elm_flipselector_first_interval_get. + * + * @param[in] obj The object. + * @param[in] interval The (first) interval value in seconds. + * + * @ingroup Elm_Flipselector_Group + */ +EAPI void elm_flipselector_first_interval_set(Elm_Flipselector *obj, double interval); + +/** + * @brief Get the interval on time updates for an user mouse button hold on a + * flip selector widget. + * + * See also @ref elm_flipselector_first_interval_set for more details. + * + * @param[in] obj The object. + * + * @return The (first) interval value in seconds. + * + * @ingroup Elm_Flipselector_Group + */ +EAPI double elm_flipselector_first_interval_get(const Elm_Flipselector *obj); + +/** + * @brief Prepend a (text) item to a flip selector widget + * + * The widget's list of labels to show will be prepended with the given value. + * If the user wishes so, a callback function pointer can be passed, which will + * get called when this same item is selected. + * + * @note The current selection won't be modified by prepending an element to + * the list. + * + * @note The maximum length of the text label is going to be determined by the + * widget's theme. Strings larger than that value are going to be truncated. + * + * @param[in] obj The object. + * @param[in] label The (text) label of the new item. + * @param[in] func Convenience callback function to take place when item is + * selected. + * @param[in] data Data passed to @c func, above. + * + * @return New widget item + * + * @ingroup Elm_Flipselector_Group + */ +EAPI Elm_Widget_Item *elm_flipselector_item_prepend(Elm_Flipselector *obj, const char *label, Evas_Smart_Cb func, void *data); + +/** + * @brief Programmatically select the next item of a flip selector widget + * + * @note The selection will be animated. Also, if it reaches the end of its + * list of member items, it will continue with the first one onwards. + * @param[in] obj The object. + * + * @ingroup Elm_Flipselector_Group + */ +EAPI void elm_flipselector_flip_next(Elm_Flipselector *obj); + +/** + * @brief Append a (text) item to a flip selector widget + * + * The widget's list of labels to show will be appended with the given value. + * If the user wishes so, a callback function pointer can be passed, which will + * get called when this same item is selected. + * + * @note The current selection won't be modified by appending an element to the + * list. + * + * @note The maximum length of the text label is going to be determined by the + * widget's theme. Strings larger than that value are going to be truncated. + * + * @param[in] obj The object. + * @param[in] label The (text) label of the new item. + * @param[in] func Convenience callback function to take place when item is + * selected. + * @param[in] data Data passed to @c func, above. + * + * @return New widget item + * + * @ingroup Elm_Flipselector_Group + */ +EAPI Elm_Widget_Item *elm_flipselector_item_append(Elm_Flipselector *obj, const char *label, Evas_Smart_Cb func, const void *data); + +/** + * @brief Programmatically select the previous item of a flip selector widget + * + * @note The selection will be animated. Also, if it reaches the beginning of + * its list of member items, it will continue with the last one backwards. + * @param[in] obj The object. + * + * @ingroup Elm_Flipselector_Group + */ +EAPI void elm_flipselector_flip_prev(Elm_Flipselector *obj); + +#endif diff --git a/src/lib/elementary/elm_flipselector_item.eo b/src/lib/elementary/elm_flipselector_item.eo deleted file mode 100644 index 9710ebe354..0000000000 --- a/src/lib/elementary/elm_flipselector_item.eo +++ /dev/null @@ -1,55 +0,0 @@ -class Elm.Flipselector.Item extends Elm.Widget.Item -{ - [[Elementary flipselector item class]] - legacy_prefix: elm_flipselector_item; - eo_prefix: elm_obj_flipselector_item; - methods { - @property selected { - get { - [[Get whether a given flip selector widget's item is the currently - selected one. - - See also @.selected.set. - ]] - } - set { - [[Set whether a given flip selector widget's item should be the - currently selected one. - - This sets whether $item is or not the selected (thus, under - display) one. If $item is different than the one under display, - the latter will be unselected. If the $item is set to be - unselected, on the other hand, the first item in the widget's - internal members list will be the new selected one. - - See also @.selected.get. - ]] - } - values { - selected: bool; [[$true if selected, $false otherwise.]] - } - } - prev_get @const { - [[Get the item before $item in a flip selector widget's internal list of - items. - - See also @.next_get. - ]] - return: Elm.Widget.Item; [[The item before the $item, in its parent's list. If there is no previous item for $item or there's an error, $null is returned.]] - } - next_get @const { - [[Get the item after $item in a flip selector widget's - internal list of items. - - See also @.prev_get. - ]] - return: Elm.Widget.Item; [[The item after the $item, in its parent's list. If there is no next item for $item or there's an error, $null is returned.]] - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Elm.Widget.Item.signal_emit; - Elm.Widget.Item.part_text { get; set; } - } -} diff --git a/src/lib/elementary/elm_flipselector_item_eo.c b/src/lib/elementary/elm_flipselector_item_eo.c new file mode 100644 index 0000000000..fc53dcdef4 --- /dev/null +++ b/src/lib/elementary/elm_flipselector_item_eo.c @@ -0,0 +1,105 @@ + +void _elm_flipselector_item_selected_set(Eo *obj, Elm_Flipselector_Item_Data *pd, Eina_Bool selected); + + +static Eina_Error +__eolian_elm_flipselector_item_selected_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_flipselector_item_selected_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_flipselector_item_selected_set, EFL_FUNC_CALL(selected), Eina_Bool selected); + +Eina_Bool _elm_flipselector_item_selected_get(const Eo *obj, Elm_Flipselector_Item_Data *pd); + + +static Eina_Value +__eolian_elm_flipselector_item_selected_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_flipselector_item_selected_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_flipselector_item_selected_get, Eina_Bool, 0); + +Elm_Widget_Item *_elm_flipselector_item_prev_get(const Eo *obj, Elm_Flipselector_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_flipselector_item_prev_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_flipselector_item_next_get(const Eo *obj, Elm_Flipselector_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_flipselector_item_next_get, Elm_Widget_Item *, NULL); + +Efl_Object *_elm_flipselector_item_efl_object_constructor(Eo *obj, Elm_Flipselector_Item_Data *pd); + + +void _elm_flipselector_item_efl_object_destructor(Eo *obj, Elm_Flipselector_Item_Data *pd); + + +void _elm_flipselector_item_elm_widget_item_signal_emit(Eo *obj, Elm_Flipselector_Item_Data *pd, const char *emission, const char *source); + + +void _elm_flipselector_item_elm_widget_item_part_text_set(Eo *obj, Elm_Flipselector_Item_Data *pd, const char *part, const char *label); + + +const char *_elm_flipselector_item_elm_widget_item_part_text_get(const Eo *obj, Elm_Flipselector_Item_Data *pd, const char *part); + + +static Eina_Bool +_elm_flipselector_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_FLIPSELECTOR_ITEM_EXTRA_OPS +#define ELM_FLIPSELECTOR_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_flipselector_item_selected_set, _elm_flipselector_item_selected_set), + EFL_OBJECT_OP_FUNC(elm_obj_flipselector_item_selected_get, _elm_flipselector_item_selected_get), + EFL_OBJECT_OP_FUNC(elm_obj_flipselector_item_prev_get, _elm_flipselector_item_prev_get), + EFL_OBJECT_OP_FUNC(elm_obj_flipselector_item_next_get, _elm_flipselector_item_next_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_flipselector_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_flipselector_item_efl_object_destructor), + EFL_OBJECT_OP_FUNC(elm_wdg_item_signal_emit, _elm_flipselector_item_elm_widget_item_signal_emit), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_set, _elm_flipselector_item_elm_widget_item_part_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_get, _elm_flipselector_item_elm_widget_item_part_text_get), + ELM_FLIPSELECTOR_ITEM_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"selected", __eolian_elm_flipselector_item_selected_set_reflect, __eolian_elm_flipselector_item_selected_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_flipselector_item_class_desc = { + EO_VERSION, + "Elm.Flipselector.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Flipselector_Item_Data), + _elm_flipselector_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_flipselector_item_class_get, &_elm_flipselector_item_class_desc, ELM_WIDGET_ITEM_CLASS, NULL); + +#include "elm_flipselector_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_flipselector_item_eo.h b/src/lib/elementary/elm_flipselector_item_eo.h new file mode 100644 index 0000000000..ad156fe753 --- /dev/null +++ b/src/lib/elementary/elm_flipselector_item_eo.h @@ -0,0 +1,87 @@ +#ifndef _ELM_FLIPSELECTOR_ITEM_EO_H_ +#define _ELM_FLIPSELECTOR_ITEM_EO_H_ + +#ifndef _ELM_FLIPSELECTOR_ITEM_EO_CLASS_TYPE +#define _ELM_FLIPSELECTOR_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Flipselector_Item; + +#endif + +#ifndef _ELM_FLIPSELECTOR_ITEM_EO_TYPES +#define _ELM_FLIPSELECTOR_ITEM_EO_TYPES + + +#endif +/** Elementary flipselector item class + * + * @ingroup Elm_Flipselector_Item + */ +#define ELM_FLIPSELECTOR_ITEM_CLASS elm_flipselector_item_class_get() + +EWAPI const Efl_Class *elm_flipselector_item_class_get(void); + +/** + * @brief Set whether a given flip selector widget's item should be the + * currently selected one. + * + * This sets whether @c item is or not the selected (thus, under display) one. + * If @c item is different than the one under display, the latter will be + * unselected. If the @c item is set to be unselected, on the other hand, the + * first item in the widget's internal members list will be the new selected + * one. + * + * See also @ref elm_obj_flipselector_item_selected_get. + * + * @param[in] obj The object. + * @param[in] selected @c true if selected, @c false otherwise. + * + * @ingroup Elm_Flipselector_Item + */ +EOAPI void elm_obj_flipselector_item_selected_set(Eo *obj, Eina_Bool selected); + +/** + * @brief Get whether a given flip selector widget's item is the currently + * selected one. + * + * See also @ref elm_obj_flipselector_item_selected_set. + * + * @param[in] obj The object. + * + * @return @c true if selected, @c false otherwise. + * + * @ingroup Elm_Flipselector_Item + */ +EOAPI Eina_Bool elm_obj_flipselector_item_selected_get(const Eo *obj); + +/** + * @brief Get the item before @c item in a flip selector widget's internal list + * of items. + * + * See also @ref elm_obj_flipselector_item_next_get. + * + * @param[in] obj The object. + * + * @return The item before the @c item, in its parent's list. If there is no + * previous item for @c item or there's an error, @c null is returned. + * + * @ingroup Elm_Flipselector_Item + */ +EOAPI Elm_Widget_Item *elm_obj_flipselector_item_prev_get(const Eo *obj); + +/** + * @brief Get the item after @c item in a flip selector widget's internal list + * of items. + * + * See also @ref elm_obj_flipselector_item_prev_get. + * + * @param[in] obj The object. + * + * @return The item after the @c item, in its parent's list. If there is no + * next item for @c item or there's an error, @c null is returned. + * + * @ingroup Elm_Flipselector_Item + */ +EOAPI Elm_Widget_Item *elm_obj_flipselector_item_next_get(const Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_flipselector_item_eo.legacy.c b/src/lib/elementary/elm_flipselector_item_eo.legacy.c new file mode 100644 index 0000000000..85d4040f11 --- /dev/null +++ b/src/lib/elementary/elm_flipselector_item_eo.legacy.c @@ -0,0 +1,24 @@ + +EAPI void +elm_flipselector_item_selected_set(Elm_Flipselector_Item *obj, Eina_Bool selected) +{ + elm_obj_flipselector_item_selected_set(obj, selected); +} + +EAPI Eina_Bool +elm_flipselector_item_selected_get(const Elm_Flipselector_Item *obj) +{ + return elm_obj_flipselector_item_selected_get(obj); +} + +EAPI Elm_Widget_Item * +elm_flipselector_item_prev_get(const Elm_Flipselector_Item *obj) +{ + return elm_obj_flipselector_item_prev_get(obj); +} + +EAPI Elm_Widget_Item * +elm_flipselector_item_next_get(const Elm_Flipselector_Item *obj) +{ + return elm_obj_flipselector_item_next_get(obj); +} diff --git a/src/lib/elementary/elm_flipselector_item_eo.legacy.h b/src/lib/elementary/elm_flipselector_item_eo.legacy.h new file mode 100644 index 0000000000..f2e9453d9b --- /dev/null +++ b/src/lib/elementary/elm_flipselector_item_eo.legacy.h @@ -0,0 +1,80 @@ +#ifndef _ELM_FLIPSELECTOR_ITEM_EO_LEGACY_H_ +#define _ELM_FLIPSELECTOR_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_FLIPSELECTOR_ITEM_EO_CLASS_TYPE +#define _ELM_FLIPSELECTOR_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Flipselector_Item; + +#endif + +#ifndef _ELM_FLIPSELECTOR_ITEM_EO_TYPES +#define _ELM_FLIPSELECTOR_ITEM_EO_TYPES + + +#endif + +/** + * @brief Set whether a given flip selector widget's item should be the + * currently selected one. + * + * This sets whether @c item is or not the selected (thus, under display) one. + * If @c item is different than the one under display, the latter will be + * unselected. If the @c item is set to be unselected, on the other hand, the + * first item in the widget's internal members list will be the new selected + * one. + * + * See also @ref elm_flipselector_item_selected_get. + * + * @param[in] obj The object. + * @param[in] selected @c true if selected, @c false otherwise. + * + * @ingroup Elm_Flipselector_Item_Group + */ +EAPI void elm_flipselector_item_selected_set(Elm_Flipselector_Item *obj, Eina_Bool selected); + +/** + * @brief Get whether a given flip selector widget's item is the currently + * selected one. + * + * See also @ref elm_flipselector_item_selected_set. + * + * @param[in] obj The object. + * + * @return @c true if selected, @c false otherwise. + * + * @ingroup Elm_Flipselector_Item_Group + */ +EAPI Eina_Bool elm_flipselector_item_selected_get(const Elm_Flipselector_Item *obj); + +/** + * @brief Get the item before @c item in a flip selector widget's internal list + * of items. + * + * See also @ref elm_flipselector_item_next_get. + * + * @param[in] obj The object. + * + * @return The item before the @c item, in its parent's list. If there is no + * previous item for @c item or there's an error, @c null is returned. + * + * @ingroup Elm_Flipselector_Item_Group + */ +EAPI Elm_Widget_Item *elm_flipselector_item_prev_get(const Elm_Flipselector_Item *obj); + +/** + * @brief Get the item after @c item in a flip selector widget's internal list + * of items. + * + * See also @ref elm_flipselector_item_prev_get. + * + * @param[in] obj The object. + * + * @return The item after the @c item, in its parent's list. If there is no + * next item for @c item or there's an error, @c null is returned. + * + * @ingroup Elm_Flipselector_Item_Group + */ +EAPI Elm_Widget_Item *elm_flipselector_item_next_get(const Elm_Flipselector_Item *obj); + +#endif diff --git a/src/lib/elementary/elm_flipselector_legacy.h b/src/lib/elementary/elm_flipselector_legacy.h index a2fbd58ae0..8f005e8f17 100644 --- a/src/lib/elementary/elm_flipselector_legacy.h +++ b/src/lib/elementary/elm_flipselector_legacy.h @@ -11,5 +11,5 @@ */ EAPI Evas_Object *elm_flipselector_add(Evas_Object *parent); -#include "elm_flipselector_item.eo.legacy.h" -#include "elm_flipselector.eo.legacy.h" +#include "elm_flipselector_item_eo.legacy.h" +#include "elm_flipselector_eo.legacy.h" diff --git a/src/lib/elementary/elm_focus.h b/src/lib/elementary/elm_focus.h index 7e9dee7aef..a7243a9a65 100644 --- a/src/lib/elementary/elm_focus.h +++ b/src/lib/elementary/elm_focus.h @@ -318,7 +318,7 @@ EAPI const char *elm_object_focus_highlight_style_get(const Evas_Object *obj); EAPI void elm_object_focus_move_policy_set(Evas_Object *obj, Elm_Focus_Move_Policy policy); /** - * Get the focus movement policy from a given Elementary objet. + * Get the focus movement policy from a given Elementary object. * * @param obj The Elementary widget to get the information from * @return The focus movement policy @@ -352,6 +352,8 @@ EAPI Elm_Focus_Move_Policy elm_object_focus_move_policy_get(const Evas_Object * * as an item, set the mode ELM_FOCUS_REGION_SHOW_ITEM. * If then, it will be scrolled as an item. * + * This API is only implemented for Elm_Gengrid widgets. Every other widgets will always automatically show the widget. + * * @since 1.16 * * @ingroup Elm_Focus diff --git a/src/lib/elementary/elm_focus_legacy.c b/src/lib/elementary/elm_focus_legacy.c index 31e1c32db1..5108f04c40 100644 --- a/src/lib/elementary/elm_focus_legacy.c +++ b/src/lib/elementary/elm_focus_legacy.c @@ -6,8 +6,8 @@ #include "elm_priv.h" //we need those for legacy compatible code -#include "elm_genlist.eo.h" -#include "elm_gengrid.eo.h" +#include "elm_genlist_eo.h" +#include "elm_gengrid_eo.h" #define API_ENTRY()\ EINA_SAFETY_ON_NULL_RETURN(obj); \ @@ -86,12 +86,12 @@ _custom_chain_set(Efl_Ui_Widget *node, Eina_List *lst) 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); + efl_event_callback_add(node, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_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); + efl_event_callback_del(node, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_MANAGER_CHANGED, _manager_changed, NULL); pd->legacy_focus.listen_to_manager = EINA_FALSE; } @@ -107,11 +107,11 @@ elm_object_focus_next_object_set(Evas_Object *obj, 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; + #define MAP(direction, field) if ((Efl_Ui_Focus_Direction)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; + dir = efl_ui_focus_util_direction_complement(dir); + #define MAP(direction, field) if ((Efl_Ui_Focus_Direction)dir == EFL_UI_FOCUS_DIRECTION_ ##direction) next_pd->legacy_focus.field = obj; MAPPING() #undef MAP } @@ -178,13 +178,13 @@ _get_legacy_target(EINA_UNUSED Evas_Object *eo, Elm_Widget_Smart_Data *pd, Elm_F { Evas_Object *result = NULL; - #define MAP(direction, field) if (dir == EFL_UI_FOCUS_DIRECTION_ ##direction && pd->legacy_focus.item_ ##field) result = elm_object_item_widget_get(pd->legacy_focus.item_ ##field); + #define MAP(direction, field) if ((Efl_Ui_Focus_Direction)dir == EFL_UI_FOCUS_DIRECTION_ ##direction && pd->legacy_focus.item_ ##field) result = elm_object_item_widget_get(pd->legacy_focus.item_ ##field); MAPPING() #undef MAP if (!result) { - #define MAP(direction, field) if (dir == EFL_UI_FOCUS_DIRECTION_ ##direction && pd->legacy_focus.field) result = pd->legacy_focus.field; + #define MAP(direction, field) if ((Efl_Ui_Focus_Direction)dir == EFL_UI_FOCUS_DIRECTION_ ##direction && pd->legacy_focus.field) result = pd->legacy_focus.field; MAPPING() #undef MAP } @@ -218,7 +218,7 @@ elm_object_focus_next(Evas_Object *obj, 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); + manager_top = efl_ui_focus_util_active_manager(obj); logical = efl_ui_focus_manager_focus_get(manager_top); if (elm_widget_is(logical)) @@ -245,7 +245,12 @@ elm_object_focus_next(Evas_Object *obj, { Evas_Object *parent = eina_array_data_get(old_chain, i); if (!elm_widget_is(parent)) continue; - ELM_WIDGET_DATA_GET_OR_RETURN(parent, ppd); + ELM_WIDGET_DATA_GET(parent, ppd); + if (!ppd) + { + ERR("Failed to get Elm widget data for parent"); + break; + } legacy_target = _get_legacy_target(parent, ppd, dir); if (legacy_target) break; } @@ -255,7 +260,7 @@ elm_object_focus_next(Evas_Object *obj, if (legacy_target) { - efl_ui_focus_util_focus(EFL_UI_FOCUS_UTIL_CLASS, legacy_target); + efl_ui_focus_util_focus(legacy_target); if (elm_object_focused_object_get(top) == legacy_target) { legacy_focus_move = EINA_TRUE; @@ -268,7 +273,7 @@ elm_object_focus_next(Evas_Object *obj, o = efl_ui_focus_manager_move(top, dir); if (!o) { - if (dir == EFL_UI_FOCUS_DIRECTION_NEXT || dir == EFL_UI_FOCUS_DIRECTION_PREVIOUS) + if ((Efl_Ui_Focus_Direction)dir == EFL_UI_FOCUS_DIRECTION_NEXT || (Efl_Ui_Focus_Direction)dir == EFL_UI_FOCUS_DIRECTION_PREVIOUS) { Efl_Ui_Focus_Object *root; @@ -285,11 +290,11 @@ elm_object_focus_next_object_get(const Evas_Object *obj, 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; + #define MAP(direction, field) if ((Efl_Ui_Focus_Direction)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); + return efl_ui_focus_manager_request_move(efl_ui_focus_util_active_manager(top), dir, NULL, EINA_FALSE); } EAPI Elm_Object_Item * @@ -298,7 +303,7 @@ elm_object_focus_next_item_get(const Evas_Object *obj, { API_ENTRY_VAL(NULL) - #define MAP(direction, field) if (dir == EFL_UI_FOCUS_DIRECTION_ ##direction && pd->legacy_focus.item_ ##field) return pd->legacy_focus.item_ ##field; + #define MAP(direction, field) if ((Efl_Ui_Focus_Direction)dir == EFL_UI_FOCUS_DIRECTION_ ##direction && pd->legacy_focus.item_ ##field) return pd->legacy_focus.item_ ##field; MAPPING() #undef MAP @@ -312,7 +317,7 @@ elm_object_focus_next_item_set(Evas_Object *obj, { API_ENTRY() - #define MAP(direction, field) if (dir == EFL_UI_FOCUS_DIRECTION_ ##direction) pd->legacy_focus.item_ ##field = next_item; + #define MAP(direction, field) if ((Efl_Ui_Focus_Direction)dir == EFL_UI_FOCUS_DIRECTION_ ##direction) pd->legacy_focus.item_ ##field = next_item; MAPPING() #undef MAP } @@ -364,7 +369,7 @@ elm_object_focus_set(Evas_Object *obj, else if (elm_widget_is(obj)) { if (focus) - efl_ui_focus_util_focus(EFL_UI_FOCUS_UTIL_CLASS, obj); + efl_ui_focus_util_focus(obj); else { if (efl_ui_focus_manager_focus_get(efl_ui_focus_object_focus_manager_get(obj)) == obj) @@ -413,7 +418,7 @@ legacy_efl_ui_focus_manager_widget_legacy_signals(Efl_Ui_Focus_Manager *manager, state->emittee = emittee; state->focused = EINA_FALSE; - efl_event_callback_add(manager, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED, _focus_manager_focused, state); + efl_event_callback_add(manager, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _focus_manager_focused, state); efl_event_callback_add(manager, EFL_EVENT_DEL, _focus_manager_del, state); } @@ -443,10 +448,10 @@ _manager_focus_object_changed(void *data, const Efl_Event *ev EINA_UNUSED) { Legacy_Object_Focus_State *state = data; if (state->registered_manager) - efl_event_callback_del(state->registered_manager, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED, _manager_focus_changed, state); + efl_event_callback_del(state->registered_manager, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _manager_focus_changed, state); state->registered_manager = efl_ui_focus_object_focus_manager_get(state->emittee); if (state->registered_manager) - efl_event_callback_add(state->registered_manager, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED, _manager_focus_changed, state); + efl_event_callback_add(state->registered_manager, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _manager_focus_changed, state); } void @@ -455,7 +460,7 @@ legacy_child_focus_handle(Efl_Ui_Focus_Object *object) Legacy_Object_Focus_State *state = calloc(1, sizeof(Legacy_Object_Focus_State)); state->emittee = object; - efl_event_callback_add(object, EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, _manager_focus_object_changed, state); + efl_event_callback_add(object, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_MANAGER_CHANGED, _manager_focus_object_changed, state); efl_event_callback_add(object, EFL_EVENT_DEL, _focus_manager_del, state); } diff --git a/src/lib/elementary/elm_frame.h b/src/lib/elementary/elm_frame.h index ee20193983..3ae891cb98 100644 --- a/src/lib/elementary/elm_frame.h +++ b/src/lib/elementary/elm_frame.h @@ -48,9 +48,6 @@ * @{ */ -#ifdef EFL_EO_API_SUPPORT -#include "efl_ui_frame_eo.h" -#endif #ifndef EFL_NOLEGACY_API_SUPPORT #include "efl_ui_frame_legacy.h" #endif diff --git a/src/lib/elementary/elm_general.h b/src/lib/elementary/elm_general.h index a8b63d7494..94f0007d66 100644 --- a/src/lib/elementary/elm_general.h +++ b/src/lib/elementary/elm_general.h @@ -21,16 +21,17 @@ // Legacy types #include "elm_general.eot.h" -// EO types. Defined for legacy-only builds as legacy uses typedef of EO types. -#include "efl_ui.eot.h" -#define ELM_FOCUS_PREVIOUS EFL_UI_FOCUS_DIRECTION_PREVIOUS -#define ELM_FOCUS_NEXT EFL_UI_FOCUS_DIRECTION_NEXT -#define ELM_FOCUS_UP EFL_UI_FOCUS_DIRECTION_UP -#define ELM_FOCUS_DOWN EFL_UI_FOCUS_DIRECTION_DOWN -#define ELM_FOCUS_RIGHT EFL_UI_FOCUS_DIRECTION_RIGHT -#define ELM_FOCUS_LEFT EFL_UI_FOCUS_DIRECTION_LEFT -typedef Efl_Ui_Focus_Direction Elm_Focus_Direction; +typedef enum +{ + ELM_FOCUS_PREVIOUS = 0, /**< previous direction */ + ELM_FOCUS_NEXT = 1, /**< next direction */ + ELM_FOCUS_UP = 2, /**< up direction */ + ELM_FOCUS_DOWN = 3, /**< down direction */ + ELM_FOCUS_RIGHT = 4, /**< right direction */ + ELM_FOCUS_LEFT = 5, /**< left direction */ + ELM_FOCUS_LAST = 6 /**< last direction */ +} Elm_Focus_Direction; /** * Defines couple of standard Evas_Object layers to be used @@ -50,9 +51,12 @@ typedef enum } Elm_Object_Layer; /** How the focus region should be calculated (not related to input focus). */ -typedef Efl_Ui_Interest_Region_Mode Elm_Focus_Region_Show_Mode; -#define ELM_FOCUS_REGION_SHOW_WIDGET EFL_UI_INTEREST_REGION_MODE_WIDGET -#define ELM_FOCUS_REGION_SHOW_ITEM EFL_UI_INTEREST_REGION_MODE_ITEM +typedef enum +{ + ELM_FOCUS_REGION_SHOW_WIDGET = 0, /**< As a widget. */ + ELM_FOCUS_REGION_SHOW_ITEM /**< As an item. */ +} Elm_Focus_Region_Show_Mode; + /**************************************************************************/ EAPI extern int ELM_ECORE_EVENT_ETHUMB_CONNECT; @@ -337,26 +341,50 @@ EAPI Elm_Process_State elm_process_state_get(void); /* legacy to eo translation */ -typedef Efl_Ui_Focus_Autoscroll_Mode Elm_Focus_Autoscroll_Mode; -#define ELM_FOCUS_AUTOSCROLL_MODE_SHOW EFL_UI_FOCUS_AUTOSCROLL_MODE_SHOW -#define ELM_FOCUS_AUTOSCROLL_MODE_NONE EFL_UI_FOCUS_AUTOSCROLL_MODE_NONE -#define ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN EFL_UI_FOCUS_AUTOSCROLL_MODE_BRING_IN +typedef enum +{ + ELM_FOCUS_AUTOSCROLL_MODE_SHOW = 0, /**< Directly show the focused region + * or item automatically. */ + ELM_FOCUS_AUTOSCROLL_MODE_NONE, /**< Do not show the focused region or item + * automatically. */ + ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN /**< Bring in the focused region or item + * automatically which might invole the + * scrolling. */ +} Elm_Focus_Autoscroll_Mode; -typedef Efl_Ui_Softcursor_Mode Elm_Softcursor_Mode; -#define ELM_SOFTCURSOR_MODE_AUTO EFL_UI_SOFTCURSOR_MODE_AUTO -#define ELM_SOFTCURSOR_MODE_ON EFL_UI_SOFTCURSOR_MODE_ON -#define ELM_SOFTCURSOR_MODE_OFF EFL_UI_SOFTCURSOR_MODE_OFF +typedef enum +{ + ELM_SOFTCURSOR_MODE_AUTO = 0, /**< Auto-detect if a software cursor should + * be used (default). */ + ELM_SOFTCURSOR_MODE_ON, /**< Always use a softcursor. */ + ELM_SOFTCURSOR_MODE_OFF /**< Never use a softcursor. */ +} Elm_Softcursor_Mode; -typedef Efl_Ui_Slider_Indicator_Visible_Mode Elm_Slider_Indicator_Visible_Mode; -#define ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_ON_DRAG -#define ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS -#define ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS -#define ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_NONE +typedef enum +{ + ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT = 0, /**< show indicator on mouse + * down or change in slider + * value */ + ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS, /**< Always show the indicator. + */ + ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS, /**< Show the indicator on + * focus */ + ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE /**< Never show the indicator */ +} Elm_Slider_Indicator_Visible_Mode; -typedef Efl_Ui_Focus_Move_Policy Elm_Focus_Move_Policy; -#define ELM_FOCUS_MOVE_POLICY_CLICK EFL_UI_FOCUS_MOVE_POLICY_CLICK -#define ELM_FOCUS_MOVE_POLICY_IN EFL_UI_FOCUS_MOVE_POLICY_IN -#define ELM_FOCUS_MOVE_POLICY_KEY_ONLY EFL_UI_FOCUS_MOVE_POLICY_KEY_ONLY +typedef enum +{ + ELM_FOCUS_MOVE_POLICY_CLICK = 0, /**< Move focus by mouse click or touch. + * Elementary focus is set on mouse click + * and this is checked at mouse up time. + * (default) */ + ELM_FOCUS_MOVE_POLICY_IN, /**< Move focus by mouse in. Elementary focus is + * set on mouse move when the mouse pointer is + * moved into an object. */ + ELM_FOCUS_MOVE_POLICY_KEY_ONLY /**< Move focus by key. Elementary focus is + * set on key input like Left, Right, Up, + * Down, Tab, or Shift+Tab. */ +} Elm_Focus_Move_Policy; /** * @} diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c index f321edf9bb..76e540a9db 100644 --- a/src/lib/elementary/elm_gengrid.c +++ b/src/lib/elementary/elm_gengrid.c @@ -13,11 +13,12 @@ #include "elm_priv.h" #include "elm_widget_gengrid.h" #include "elm_interface_scrollable.h" -#include "efl_ui_focus_parent_provider_gen.eo.h" +#include "elm_pan_eo.h" +#include "efl_ui_focus_parent_provider_gen_eo.h" #include "efl_ui_focus_composition_adapter.eo.h" -#include "elm_gengrid_item.eo.h" -#include "elm_gengrid_pan.eo.h" -#include "elm_gengrid.eo.h" +#include "elm_gengrid_item_eo.h" +#include "elm_gengrid_pan_eo.h" +#include "elm_gengrid_eo.h" #define MY_PAN_CLASS ELM_GENGRID_PAN_CLASS @@ -205,6 +206,7 @@ _item_cache_add(Elm_Gen_Item *it, Eina_List *contents) Item_Cache *itc = NULL; ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd); Evas_Object *obj = sd->obj; + Evas_Object *win = efl_provider_find(obj, EFL_UI_WIN_CLASS); evas_event_freeze(evas_object_evas_get(obj)); if (sd->item_cache_max > 0) @@ -230,7 +232,7 @@ _item_cache_add(Elm_Gen_Item *it, Eina_List *contents) if (elm_wdg_item_disabled_get(EO_OBJ(it))) edje_object_signal_emit(itc->base_view, "elm,state,enabled", "elm"); if ((EO_OBJ(it) == sd->focused_item) && - (elm_widget_focus_highlight_enabled_get(obj) || _elm_config->win_auto_focus_enable)) + (elm_win_focus_highlight_enabled_get(win) || _elm_config->win_auto_focus_enable)) edje_object_signal_emit(itc->base_view, "elm,state,unfocused", "elm"); ELM_SAFE_FREE(it->long_timer, ecore_timer_del); @@ -719,10 +721,10 @@ _item_unselect(Elm_Gen_Item *it) { it->selected = EINA_FALSE; sd->selected = eina_list_remove(sd->selected, eo_it); - efl_event_callback_legacy_call - (WIDGET(it), EFL_UI_EVENT_UNSELECTED, eo_it); + evas_object_smart_callback_call + (WIDGET(it), "unselected", eo_it); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_SELECTED, EINA_FALSE); + efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_TYPE_SELECTED, EINA_FALSE); } } @@ -1106,6 +1108,7 @@ _item_content_realize(Elm_Gen_Item *it, _elm_widget_full_eval(content); } + elm_widget_sub_object_add(WIDGET(it), content); if (elm_wdg_item_disabled_get(EO_OBJ(it))) elm_widget_disabled_set(content, EINA_TRUE); @@ -1169,10 +1172,10 @@ _view_style_update(Elm_Gen_Item *it, Evas_Object *view, const char *style) ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd); snprintf(buf, sizeof(buf), "item/%s", style ? style : "default"); - Efl_Ui_Theme_Apply_Result th_ret = + Eina_Error th_ret = elm_widget_theme_object_set(WIDGET(it), view, "gengrid", buf, elm_widget_style_get(WIDGET(it))); - if (th_ret == EFL_UI_THEME_APPLY_RESULT_FAIL) + if (th_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) { ERR("%s is not a valid gengrid item style. " "Automatically falls back into default style.", @@ -1229,7 +1232,7 @@ _elm_gengrid_item_all_contents_unset(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it, EINA_LIST_FREE (it->contents, content) { - evas_object_smart_member_del(content); + _elm_widget_sub_object_redirect_to_top(WIDGET(it), content); // edje can be reused by item caching, // content should be un-swallowed from edje edje_object_part_unswallow(VIEW(it), content); @@ -1262,6 +1265,12 @@ _elm_gengrid_item_unrealize(Elm_Gen_Item *it, it->realized = EINA_FALSE; it->want_unrealize = EINA_FALSE; + { + ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd); + efl_ui_focus_manager_calc_unregister(sd->obj, EO_OBJ(it)); + sd->order_dirty = EINA_TRUE; + } + evas_event_thaw(evas_object_evas_get(WIDGET(it))); evas_event_thaw_eval(evas_object_evas_get(WIDGET(it))); } @@ -1315,7 +1324,7 @@ _item_mouse_up_cb(void *data, (sd->reorder_it)) { efl_event_callback_legacy_call - (WIDGET(it), EFL_UI_WIDGET_EVENT_MOVED, EO_OBJ(sd->reorder_it)); + (WIDGET(it), ELM_GENGRID_EVENT_MOVED, EO_OBJ(sd->reorder_it)); sd->reorder_it = NULL; sd->move_effect_enabled = EINA_FALSE; ecore_job_del(sd->calc_job); @@ -1560,9 +1569,10 @@ _elm_gengrid_item_focus_update(Elm_Gen_Item *it) { const char *focus_raise; Evas_Object *obj = WIDGET(it); + Evas_Object *win = efl_provider_find(obj, EFL_UI_WIN_CLASS); ELM_GENGRID_DATA_GET(obj, sd); - if (elm_widget_focus_highlight_enabled_get(obj) || _elm_config->win_auto_focus_enable) + if (elm_win_focus_highlight_enabled_get(win) || _elm_config->win_auto_focus_enable) { edje_object_signal_emit (VIEW(it), "elm,state,focused", "elm"); @@ -1589,6 +1599,12 @@ _item_realize(Elm_Gen_Item *it) ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd); Elm_Object_Item *eo_it = EO_OBJ(it); + if (!it->realized) + { + efl_ui_focus_manager_calc_register_logical(sd->obj, EO_OBJ(it), sd->obj, NULL); + sd->order_dirty = EINA_TRUE; + } + if ((it->realized) || (it->generation < sd->generation)) return; @@ -2305,7 +2321,7 @@ _elm_gengrid_pan_class_constructor(Efl_Class *klass) evas_smart_legacy_type_register(MY_PAN_CLASS_NAME_LEGACY, klass); } -#include "elm_gengrid_pan.eo.c" +#include "elm_gengrid_pan_eo.c" static void _elm_gengrid_item_focused(Elm_Object_Item *eo_it) @@ -2349,7 +2365,7 @@ _elm_gengrid_item_focused(Elm_Object_Item *eo_it) efl_event_callback_legacy_call(obj, ELM_GENGRID_EVENT_ITEM_FOCUSED, eo_it); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_FOCUSED, EINA_TRUE); + efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_TYPE_FOCUSED, EINA_TRUE); } static void @@ -2357,6 +2373,7 @@ _elm_gengrid_item_unfocused(Elm_Object_Item *eo_it) { ELM_GENGRID_ITEM_DATA_GET(eo_it, it); Evas_Object *obj = WIDGET(it); + Evas_Object *win = efl_provider_find(obj, EFL_UI_WIN_CLASS); ELM_GENGRID_DATA_GET(obj, sd); if (it->generation < sd->generation) @@ -2369,7 +2386,7 @@ _elm_gengrid_item_unfocused(Elm_Object_Item *eo_it) (eo_it != sd->focused_item)) return; - if (elm_widget_focus_highlight_enabled_get(obj) || _elm_config->win_auto_focus_enable) + if (elm_win_focus_highlight_enabled_get(win) || _elm_config->win_auto_focus_enable) { ELM_GENGRID_ITEM_DATA_GET(sd->focused_item, focus_it); edje_object_signal_emit @@ -2379,7 +2396,7 @@ _elm_gengrid_item_unfocused(Elm_Object_Item *eo_it) sd->focused_item = NULL; efl_event_callback_legacy_call(obj, ELM_GENGRID_EVENT_ITEM_UNFOCUSED, eo_it); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_FOCUSED, EINA_FALSE); + efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_TYPE_FOCUSED, EINA_FALSE); } static Eina_Bool @@ -2876,7 +2893,7 @@ _item_move_cb(void *data, double pos) efl_event_callback_legacy_call (sd->obj, ELM_GENGRID_EVENT_ITEM_REORDER_ANIM_STOP, EO_OBJ(sd->reorder.it1)); efl_event_callback_legacy_call - (sd->obj, EFL_UI_WIDGET_EVENT_MOVED, EO_OBJ(sd->reorder.it1)); + (sd->obj, ELM_GENGRID_EVENT_MOVED, EO_OBJ(sd->reorder.it1)); sd->reorder.running = EINA_FALSE; } _elm_widget_focus_highlight_start(sd->obj); @@ -3586,12 +3603,12 @@ _mirrored_set(Evas_Object *obj, } } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_gengrid_efl_ui_widget_theme_apply(Eo *obj, Elm_Gengrid_Data *sd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _mirrored_set(obj, efl_ui_mirrored_get(obj)); @@ -3953,9 +3970,9 @@ _item_select(Elm_Gen_Item *it) if (it->func.func) it->func.func((void *)it->func.data, WIDGET(it), eo_it); if (it->generation == sd->generation) { - efl_event_callback_legacy_call(WIDGET(it), EFL_UI_EVENT_SELECTED, eo_it); + evas_object_smart_callback_call(WIDGET(it), "selected", eo_it); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_SELECTED, EINA_TRUE); + efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_TYPE_SELECTED, EINA_TRUE); } efl_ref(eo_it); @@ -4022,9 +4039,7 @@ _elm_gengrid_item_new(Elm_Gengrid_Data *sd, (!strcmp(it->itc->item_style, "group_index")); sd->item_count++; - efl_ui_focus_composition_dirty(sd->obj); - - return it; + return it; } EOLIAN static void @@ -4077,7 +4092,6 @@ _elm_gengrid_efl_canvas_group_group_add(Eo *obj, Elm_Gengrid_Data *priv) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj)); evas_object_smart_member_add(priv->hit_rect, obj); @@ -4354,9 +4368,6 @@ _elm_gengrid_efl_object_constructor(Eo *obj, Elm_Gengrid_Data *sd) efl_ui_focus_parent_provider_gen_container_set(efl_added, obj), efl_ui_focus_parent_provider_gen_content_item_map_set(efl_added, sd->content_item_map)); - efl_ui_focus_composition_custom_manager_set(obj, obj); - efl_ui_focus_composition_logical_mode_set(obj, EINA_TRUE); - obj = efl_constructor(efl_super(obj, MY_CLASS)); sd->obj = obj; @@ -4364,7 +4375,7 @@ _elm_gengrid_efl_object_constructor(Eo *obj, Elm_Gengrid_Data *sd) evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_TREE_TABLE); - efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED, _gengrid_element_focused, obj); + efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _gengrid_element_focused, obj); return obj; } @@ -5479,10 +5490,10 @@ _elm_gengrid_item_efl_access_object_state_set_get(const Eo *eo_it, Elm_Gen_Item sel = elm_obj_gengrid_item_selected_get(eo_it); - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_SELECTABLE); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_SELECTABLE); if (sel) - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_SELECTED); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_SELECTED); return ret; } @@ -5607,7 +5618,7 @@ _elm_gengrid_efl_ui_widget_focus_highlight_geometry_get(const Eo *obj, Elm_Gengr } EOLIAN static Elm_Object_Item * -_elm_gengrid_efl_ui_widget_focused_item_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd) +_elm_gengrid_elm_widget_item_container_focused_item_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd) { return sd->focused_item; } @@ -5690,10 +5701,10 @@ _elm_gengrid_efl_access_object_state_set_get(const Eo *obj, Elm_Gengrid_Data *sd ret = efl_access_object_state_set_get(efl_super(obj, ELM_GENGRID_CLASS)); - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_MANAGES_DESCENDANTS); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_MANAGES_DESCENDANTS); if (elm_gengrid_multi_select_get(obj)) - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_MULTISELECTABLE); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_MULTISELECTABLE); return ret; } @@ -5807,22 +5818,27 @@ _elm_gengrid_efl_object_provider_find(const Eo *obj, Elm_Gengrid_Data *pd, const } EOLIAN static void -_elm_gengrid_efl_ui_focus_composition_prepare(Eo *obj, Elm_Gengrid_Data *pd) +_elm_gengrid_efl_ui_focus_object_setup_order(Eo *obj, Elm_Gengrid_Data *pd) { Elm_Gen_Item *item; Eina_List *order = NULL; + if (!pd->order_dirty) return; + pd->order_dirty = EINA_FALSE; + EINA_INLIST_FOREACH(pd->items, item) { if (item->base->disabled) continue; if (item->group) continue; + if (item->realized) + continue; order = eina_list_append(order, item->base->eo_obj); } - efl_ui_focus_composition_elements_set(obj, order); + efl_ui_focus_manager_calc_update_order(obj, obj, order); } EOLIAN static Eina_Bool @@ -5832,7 +5848,7 @@ _elm_gengrid_efl_ui_widget_focus_state_apply(Eo *obj, Elm_Gengrid_Data *pd EINA_ } EOLIAN static void -_elm_gengrid_item_efl_ui_focus_object_prepare_logical_none_recursive(Eo *obj, Elm_Gen_Item *pd) +_elm_gengrid_item_efl_ui_focus_object_setup_order_non_recursive(Eo *obj, Elm_Gen_Item *pd) { Eina_List *n; Efl_Ui_Widget *wid; @@ -5843,7 +5859,7 @@ _elm_gengrid_item_efl_ui_focus_object_prepare_logical_none_recursive(Eo *obj, El _elm_widget_full_eval(wid); } - efl_ui_focus_object_prepare_logical_none_recursive(efl_super(obj, ELM_GENGRID_ITEM_CLASS)); + efl_ui_focus_object_setup_order_non_recursive(efl_super(obj, ELM_GENGRID_ITEM_CLASS)); } EOLIAN static Efl_Ui_Focus_Object* @@ -5863,5 +5879,5 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_gengrid, Elm_Gengrid_Data) ELM_LAYOUT_SIZING_EVAL_OPS(elm_gengrid), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_gengrid) -#include "elm_gengrid.eo.c" -#include "elm_gengrid_item.eo.c" +#include "elm_gengrid_eo.c" +#include "elm_gengrid_item_eo.c" diff --git a/src/lib/elementary/elm_gengrid.eo b/src/lib/elementary/elm_gengrid.eo deleted file mode 100644 index 9907ba2d2d..0000000000 --- a/src/lib/elementary/elm_gengrid.eo +++ /dev/null @@ -1,552 +0,0 @@ -import elm_general; - -type @extern Ecore_Pos_Map: __undefined_type; [[External ecore position map]] - -enum Elm.Gengrid.Reorder_Type -{ - [[Gengrid reorder modes]] - normal, [[Normal reorder type]] - swap [[Swap reorder type]] -} - -class Elm.Gengrid extends Efl.Ui.Layout implements Efl.Ui.Focus.Composition, Elm.Interface_Scrollable, - Efl.Ui.Clickable, Efl.Access.Widget.Action, - Efl.Access.Selection, Efl.Ui.Legacy -{ - [[Elementary gengrid class]] - legacy_prefix: elm_gengrid; - eo_prefix: elm_obj_gengrid; - event_prefix: elm_gengrid; - methods { - @property align { - set { - [[Set the items grid's alignment within a given gengrid widget. - - This sets the alignment of the whole grid of items of a gengrid - within its given viewport. By default, those values are both - 0.5, meaning that the gengrid will have its items grid placed - exactly in the middle of its viewport. - - Note: If given alignment values are out of the cited ranges, - they'll be changed to the nearest boundary values on the valid - ranges. - ]] - } - get { - [[Get the items grid's alignment values within a given gengrid - widget. - - Note: Use $null pointers on the alignment values you're not - interested in: they'll be ignored by the function. - ]] - } - values { - align_x: double; [[Alignment in the horizontal axis (0 <= align_x <= 1).]] - align_y: double; [[Alignment in the vertical axis (0 <= align_y <= 1).]] - } - } - @property filled { - set { - [[Set how the items grid's filled within a given gengrid widget - - This sets the fill state of the whole grid of items of a - gengrid within its given viewport. By default, this value - is false, meaning that if the first line of items grid's - isn't filled, the items are centered with the alignment. - ]] - } - get { - [[Get how the items grid's filled within a given gengrid widget - - Note: Use $null pointers on the alignment values you're not - interested in: they'll be ignored by the function. - ]] - } - values { - fill: bool; [[$true if the grid is filled, $false otherwise]] - } - } - @property multi_select { - set { - [[Enable or disable multi-selection in a given gengrid widget. - - Multi-selection is the ability to have more than one item - selected, on a given gengrid, simultaneously. When it is - enabled, a sequence of clicks on different items will make - them all selected, progressively. A click on an already - selected item will unselect it. If interacting via the - keyboard, multi-selection is enabled while holding the - "Shift" key. - - Note: By default, multi-selection is disabled on gengrids. - ]] - } - get { - [[Get whether multi-selection is enabled or disabled for a given - gengrid widget. - ]] - } - values { - multi: bool; [[$true if multislect is enabled, $false otherwise]] - } - } - @property group_item_size { - set { - [[Set the size for the group items of a given gengrid widget. - - A gengrid, after creation, has still no information on the size - to give to each of its cells. So, you most probably will end up - with squares one \@ref Fingers "finger" wide, the default - size. Use this function to force a custom size for you group - items, making them as big as you wish. - ]] - } - get { - [[Get the size set for the group items of a given gengrid widget. - - Note: Use $null pointers on the size values you're not - interested in: they'll be ignored by the function. - ]] - } - values { - w: int; [[The group items' width.]] - h: int; [[The group items' height.]] - } - } - @property select_mode { - set { - [[Set the gengrid select mode. - - This changes item select mode in the gengrid widget. - #ELM_OBJECT_SELECT_MODE_DEFAULT means that items will only - call their selection func and callback when first becoming - selected. Any further clicks will do nothing, unless you set - always select mode. #ELM_OBJECT_SELECT_MODE_ALWAYS means that - even if selected, every click will make the selected callbacks - be called. #ELM_OBJECT_SELECT_MODE_NONE will turn off the - ability to select items entirely and they will neither appear - selected nor call selected callback functions. - ]] - } - get { - [[Get the gengrid select mode.]] - } - values { - mode: Elm.Object.Select_Mode(Elm.Object.Select_Mode.max); [[The select mode.]] - } - } - @property reorder_mode { - set { - [[Set whether a given gengrid widget is or not able have items - reordered. - - If a gengrid is set to allow reordering, a click held for more - than 0.5 over a given item will highlight it specially, - signaling the gengrid has entered the reordering state. From - that time on, the user will be able to, while still holding the - mouse button down, move the item freely in the gengrid's - viewport, replacing to said item to the locations it goes to. - The replacements will be animated and, whenever the user - releases the mouse button, the item being replaced gets a new - definitive place in the grid. - ]] - } - get { - [[Get whether a given gengrid widget is or not able have items - reordered. - ]] - } - values { - reorder_mode: bool; [[Use $true to turn reordering on, - $false to turn it off.]] - } - } - @property highlight_mode { - [[Control whether the gengrid items' should be highlighted when - item selected. - ]] - set {} - get {} - values { - highlight: bool; [[$true if item will be highlighted, $false otherwise]] - } - } - @property reorder_type { - set { - [[ Set the Gengrid reorder type - @since 1.11 - ]] - } - values { - type: Elm.Gengrid.Reorder_Type; [[ Reorder type value ]] - } - } - @property item_size { - set { - [[Set the size for the items of a given gengrid widget. - - A gengrid, after creation, has still no information on the size - to give to each of its cells. So, you most probably will end up - with squares one \@ref Fingers "finger" wide, the default - size. Use this function to force a custom size for you items, - making them as big as you wish. - ]] - } - get { - [[Get the size set for the items of a given gengrid widget. - - Note: Use $null pointers on the size values you're not - interested in: they'll be ignored by the function. - ]] - } - values { - w: int; [[The items' width.]] - h: int; [[The items' height.]] - } - } - @property multi_select_mode { - set { - [[Set the gengrid multi select mode. - - #ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT means that - select/unselect items whenever each item is clicked. - #ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL means that - only one item will be selected although multi-selection - is enabled, if clicked without pressing control key. This - mode is only available with multi-selection. - - @since 1.8 - ]] - } - get { - [[Get the gengrid multi select mode. - - If getting mode fails, it returns - #ELM_OBJECT_MULTI_SELECT_MODE_MAX. - - @since 1.8 - ]] - } - values { - mode: Elm.Object.Multi_Select_Mode(Elm.Object.Multi_Select_Mode.max); [[The multi select mode.]] - } - } - @property horizontal { - set { - [[Set the direction in which a given gengrid widget will - expand while placing its items. - - When in "horizontal mode" ($true), items will be placed in - columns, from top to bottom and, when the space for a column - is filled, another one is started on the right, thus expanding - the grid horizontally. When in "vertical mode" ($false), - though, items will be placed in rows, from left to right - and, when the space for a row is filled, another one is - started below, thus expanding the grid vertically. - - Note: By default, gengrid is in vertical mode, $false. - ]] - } - get { - [[Get for what direction a given gengrid widget will expand while - placing its items. - ]] - } - values { - horizontal: bool; [[$true to make the gengrid expand horizontally, - $false to expand vertically.]] - } - } - @property selected_item { - get { - [[Get the selected item in a given gengrid widget. - - This returns the selected item in $obj. If multi selection is - enabled on $obj (See @.multi_select.set), only the first item - in the list is selected, which might not be very useful. For - that case, see @.selected_items.get. - ]] - return: Elm.Widget.Item; [[The selected item's handle or $null - if none is selected at the moment - (and on errors).]] - } - } - @property realized_items { - get { - [[Get a list of realized items in gengrid. - - This returns a list of the realized items in the gengrid. The - list contains gengrid item pointers. The list must be freed by - the caller when done with eina_list_free(). The item pointers - in the list are only valid so long as those items are not - deleted or the gengrid is not deleted. - ]] - return: list @owned @warn_unused; [[ - The list of realized items or $null if none are realized. - ]] - } - } - @property first_item { - get { - [[Get the first item in a given gengrid widget. - - This returns the first item in the $obj's internal list of - items. - ]] - return: Elm.Widget.Item; [[ - The first item's handle or $null, if there are no - items in $obj (and on errors) - ]] - } - } - @property selected_items { - get { - [[Get a list of selected items in a given gengrid. - - This returns a list of the selected items, in the order that - they appear in the grid. This list is only valid as long as no - more items are selected or unselected (or unselected implicitly - by deletion). The list contains Gengrid item pointers as - data, naturally. - ]] - return: const(list); [[ - The list of selected items or $null, if none is - selected at the moment (and on errors). - ]] - } - } - @property last_item { - get { - [[Get the last item in a given gengrid widget. - - This returns the last item in the $obj's internal list of - items. - ]] - return: Elm.Widget.Item; [[The last item's handle or $null - if there are no items in $obj - (and on errors).]] - } - } - item_insert_before { - [[Insert an item before another in a gengrid widget. - - This inserts an item before another in the gengrid. - ]] - return: Elm.Widget.Item; [[A handle to the item added or $null on errors.]] - params { - @cref itc: Elm.Gengrid.Item.Class; [[The item class for the item.]] - @in data: const(void_ptr); [[The item data.]] - @in relative: Elm.Widget.Item; [[The item to place this new one before.]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called - when the item is selected.]] - @in func_data: const(void_ptr) @optional; [[Data to be passed to $func.]] - } - } - realized_items_update { - [[Update the contents of all realized items. - - This updates all realized items by calling all the item class - functions again to get the contents, texts and states. Use this - when the original item data has changed and the changes are - desired to be reflected. - - To update just one item, use \@ref elm_gengrid_item_update. - ]] - } - item_insert_after { - [[Insert an item after another in a gengrid widget. - - This inserts an item after another in the gengrid. - ]] - return: Elm.Widget.Item; [[A handle to the item added or $null on error.]] - params { - @cref itc: Elm.Gengrid.Item.Class; [[The item class for the item.]] - @in data: const(void_ptr); [[The item data.]] - @in relative: Elm.Widget.Item; [[The item to place this new one after.]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called - when the item is selected.]] - @in func_data: const(void_ptr) @optional; [[Data to be passed to $func.]] - } - } - items_count @const { - [[Return how many items are currently in a list - - This behavior is O(1) and includes items which may or may not - be realized. - ]] - return: uint; [[Items in list]] - } - at_xy_item_get @const { - [[Get the item that is at the x, y canvas coords. - - This returns the item at the given coordinates (which are canvas - relative, not object-relative). If an item is at that coordinate, - that item handle is returned, and if $xposret is not $null, the - integer pointed to is set to a value of -1, 0 or 1, depending if - the coordinate is on the left portion of that item (-1), on the - middle section (0) or on the right part (1). - - If $yposret is not $null, the integer pointed to is set to a - value of -1, 0 or 1, depending if the coordinate is on the upper - portion of that item (-1), on the middle section (0) or on the - lower part (1). If NULL is returned as an item (no item found - there), then posret may indicate -1 or 1 based if the coordinate - is above or below all items respectively in the gengrid. - ]] - return: Elm.Widget.Item; [[The item at the coordinates or $null if none.]] - params { - @in x: int; [[The input x coordinate.]] - @in y: int; [[The input y coordinate.]] - @out xposret: int; [[The position relative to the item returned here.]] - @out yposret: int; [[The position relative to the item returned here.]] - } - } - item_append { - [[Append a new item in a given gengrid widget. - - This adds an item to the beginning of the gengrid. - ]] - return: Elm.Widget.Item; [[A handle to the item added or $null on errors.]] - params { - @cref itc: Elm.Gengrid.Item.Class; [[The item class for the item.]] - @in data: const(void_ptr); [[The item data.]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called - when the item is selected.]] - @in func_data: const(void_ptr) @optional; [[Data to be passed to $func.]] - } - } - item_prepend { - [[Prepend a new item in a given gengrid widget. - - This adds an item to the end of the gengrid. - ]] - return: Elm.Widget.Item; [[A handle to the item added or $null on errors.]] - params { - @cref itc: Elm.Gengrid.Item.Class; [[The item class for the item.]] - @in data: const(void_ptr); [[The item data.]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called - when the item is selected.]] - @in func_data: const(void_ptr) @optional; [[Data to be passed to $func.]] - } - } - clear { - [[Remove all items from a given gengrid widget. - - This removes (and deletes) all items in $obj, leaving it empty. - - See \@ref elm_gengrid_item_del to remove just one item. - ]] - } - item_sorted_insert { - [[Insert an item in a gengrid widget using a user-defined sort - function. - - This inserts an item in the gengrid based on user defined - comparison function. The two arguments passed to the function - $func are gengrid item handles to compare. - ]] - return: Elm.Widget.Item; [[A handle to the item added or $null on errors.]] - params { - @cref itc: Elm.Gengrid.Item.Class; [[The item class for the item.]] - @in data: const(void_ptr); [[The item data.]] - @in comp: Eina_Compare_Cb; [[User defined comparison function - that defines the sort order based - on gengrid item and its data. - ]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called when the item is selected.]] - @in func_data: const(void_ptr) @optional; [[Data to be passed to $func.]] - } - } - search_by_text_item_get { - [[Get gengrid item by given string. - - It takes pointer to the gengrid item that will be used to start - search from it. - - This function uses globs (like "*.jpg") for searching and takes - search flags as last parameter That is a bitfield with values - to be ored together or 0 for no flags. - - @since 1.11 - ]] - return: Elm.Widget.Item; [[Pointer to the gengrid item which matches - search_string in case of success, - otherwise $null.]] - params { - @in item_to_search_from: Elm.Widget.Item @optional; [[ - Pointer to item to start search from. If $null, search will - be started from the first item of the gengrid. - ]] - @in part_name: string; [[Name of the TEXT part of gengrid item to search string in. If $null, search by "elm.text" parts.]] - @in pattern: string; [[The search pattern.]] - @in flags: Elm.Glob.Match_Flags; [[Search flags.]] - } - } - reorder_mode_start { - [[ - Starts the reorder mode of Gengrid - @since 1.10 - ]] - params { - @in tween_mode: Ecore_Pos_Map; [[ Position mappings for animation ]] - } - } - reorder_mode_stop { - [[ - Stops the reorder mode of Gengrid - @since 1.10 - ]] - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Object.provider_find; - Efl.Gfx.Entity.position { set; } - Efl.Gfx.Entity.size { set; } - Efl.Canvas.Group.group_member_add; - 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.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; } - 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; - Efl.Ui.Focus.Composition.prepare; - Efl.Ui.Widget.focus_state_apply; - Efl.Ui.Focus.Manager.setup_on_first_touch; - Efl.Ui.Focus.Manager.manager_focus { get; } - Efl.Ui.Focus.Manager.move; - } - events { - 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_eo.c b/src/lib/elementary/elm_gengrid_eo.c new file mode 100644 index 0000000000..89263f9c1f --- /dev/null +++ b/src/lib/elementary/elm_gengrid_eo.c @@ -0,0 +1,517 @@ +EWAPI const Efl_Event_Description _ELM_GENGRID_EVENT_REALIZED = + EFL_EVENT_DESCRIPTION("realized"); +EWAPI const Efl_Event_Description _ELM_GENGRID_EVENT_UNREALIZED = + EFL_EVENT_DESCRIPTION("unrealized"); +EWAPI const Efl_Event_Description _ELM_GENGRID_EVENT_INDEX_UPDATE = + EFL_EVENT_DESCRIPTION("index,update"); +EWAPI const Efl_Event_Description _ELM_GENGRID_EVENT_SCROLL_PAGE_CHANGED = + EFL_EVENT_DESCRIPTION("scroll,page,changed"); +EWAPI const Efl_Event_Description _ELM_GENGRID_EVENT_EDGE_BOTTOM = + EFL_EVENT_DESCRIPTION("edge,bottom"); +EWAPI const Efl_Event_Description _ELM_GENGRID_EVENT_EDGE_TOP = + EFL_EVENT_DESCRIPTION("edge,top"); +EWAPI const Efl_Event_Description _ELM_GENGRID_EVENT_EDGE_RIGHT = + EFL_EVENT_DESCRIPTION("edge,right"); +EWAPI const Efl_Event_Description _ELM_GENGRID_EVENT_EDGE_LEFT = + EFL_EVENT_DESCRIPTION("edge,left"); +EWAPI const Efl_Event_Description _ELM_GENGRID_EVENT_ITEM_FOCUSED = + EFL_EVENT_DESCRIPTION("item,focused"); +EWAPI const Efl_Event_Description _ELM_GENGRID_EVENT_ITEM_UNFOCUSED = + EFL_EVENT_DESCRIPTION("item,unfocused"); +EWAPI const Efl_Event_Description _ELM_GENGRID_EVENT_ITEM_REORDER_ANIM_START = + EFL_EVENT_DESCRIPTION("item,reorder,anim,start"); +EWAPI const Efl_Event_Description _ELM_GENGRID_EVENT_ITEM_REORDER_ANIM_STOP = + EFL_EVENT_DESCRIPTION("item,reorder,anim,stop"); +EWAPI const Efl_Event_Description _ELM_GENGRID_EVENT_ACTIVATED = + EFL_EVENT_DESCRIPTION("activated"); +EWAPI const Efl_Event_Description _ELM_GENGRID_EVENT_HIGHLIGHTED = + EFL_EVENT_DESCRIPTION("highlighted"); +EWAPI const Efl_Event_Description _ELM_GENGRID_EVENT_UNHIGHLIGHTED = + EFL_EVENT_DESCRIPTION("unhighlighted"); +EWAPI const Efl_Event_Description _ELM_GENGRID_EVENT_RELEASED = + EFL_EVENT_DESCRIPTION("released"); +EWAPI const Efl_Event_Description _ELM_GENGRID_EVENT_MOVED = + EFL_EVENT_DESCRIPTION("moved"); + +void _elm_gengrid_align_set(Eo *obj, Elm_Gengrid_Data *pd, double align_x, double align_y); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_align_set, EFL_FUNC_CALL(align_x, align_y), double align_x, double align_y); + +void _elm_gengrid_align_get(const Eo *obj, Elm_Gengrid_Data *pd, double *align_x, double *align_y); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_gengrid_align_get, EFL_FUNC_CALL(align_x, align_y), double *align_x, double *align_y); + +void _elm_gengrid_filled_set(Eo *obj, Elm_Gengrid_Data *pd, Eina_Bool fill); + + +static Eina_Error +__eolian_elm_gengrid_filled_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_gengrid_filled_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_filled_set, EFL_FUNC_CALL(fill), Eina_Bool fill); + +Eina_Bool _elm_gengrid_filled_get(const Eo *obj, Elm_Gengrid_Data *pd); + + +static Eina_Value +__eolian_elm_gengrid_filled_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_gengrid_filled_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_filled_get, Eina_Bool, 0); + +void _elm_gengrid_multi_select_set(Eo *obj, Elm_Gengrid_Data *pd, Eina_Bool multi); + + +static Eina_Error +__eolian_elm_gengrid_multi_select_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_gengrid_multi_select_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_multi_select_set, EFL_FUNC_CALL(multi), Eina_Bool multi); + +Eina_Bool _elm_gengrid_multi_select_get(const Eo *obj, Elm_Gengrid_Data *pd); + + +static Eina_Value +__eolian_elm_gengrid_multi_select_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_gengrid_multi_select_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_multi_select_get, Eina_Bool, 0); + +void _elm_gengrid_group_item_size_set(Eo *obj, Elm_Gengrid_Data *pd, int w, int h); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_group_item_size_set, EFL_FUNC_CALL(w, h), int w, int h); + +void _elm_gengrid_group_item_size_get(const Eo *obj, Elm_Gengrid_Data *pd, int *w, int *h); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_gengrid_group_item_size_get, EFL_FUNC_CALL(w, h), int *w, int *h); + +void _elm_gengrid_select_mode_set(Eo *obj, Elm_Gengrid_Data *pd, Elm_Object_Select_Mode mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_select_mode_set, EFL_FUNC_CALL(mode), Elm_Object_Select_Mode mode); + +Elm_Object_Select_Mode _elm_gengrid_select_mode_get(const Eo *obj, Elm_Gengrid_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_select_mode_get, Elm_Object_Select_Mode, 4 /* Elm.Object.Select_Mode.max */); + +void _elm_gengrid_reorder_mode_set(Eo *obj, Elm_Gengrid_Data *pd, Eina_Bool reorder_mode); + + +static Eina_Error +__eolian_elm_gengrid_reorder_mode_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_gengrid_reorder_mode_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_reorder_mode_set, EFL_FUNC_CALL(reorder_mode), Eina_Bool reorder_mode); + +Eina_Bool _elm_gengrid_reorder_mode_get(const Eo *obj, Elm_Gengrid_Data *pd); + + +static Eina_Value +__eolian_elm_gengrid_reorder_mode_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_gengrid_reorder_mode_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_reorder_mode_get, Eina_Bool, 0); + +void _elm_gengrid_highlight_mode_set(Eo *obj, Elm_Gengrid_Data *pd, Eina_Bool highlight); + + +static Eina_Error +__eolian_elm_gengrid_highlight_mode_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_gengrid_highlight_mode_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_highlight_mode_set, EFL_FUNC_CALL(highlight), Eina_Bool highlight); + +Eina_Bool _elm_gengrid_highlight_mode_get(const Eo *obj, Elm_Gengrid_Data *pd); + + +static Eina_Value +__eolian_elm_gengrid_highlight_mode_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_gengrid_highlight_mode_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_highlight_mode_get, Eina_Bool, 0); + +void _elm_gengrid_reorder_type_set(Eo *obj, Elm_Gengrid_Data *pd, Elm_Gengrid_Reorder_Type type); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_reorder_type_set, EFL_FUNC_CALL(type), Elm_Gengrid_Reorder_Type type); + +void _elm_gengrid_item_size_set(Eo *obj, Elm_Gengrid_Data *pd, int w, int h); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_item_size_set, EFL_FUNC_CALL(w, h), int w, int h); + +void _elm_gengrid_item_size_get(const Eo *obj, Elm_Gengrid_Data *pd, int *w, int *h); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_gengrid_item_size_get, EFL_FUNC_CALL(w, h), int *w, int *h); + +void _elm_gengrid_multi_select_mode_set(Eo *obj, Elm_Gengrid_Data *pd, Elm_Object_Multi_Select_Mode mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_multi_select_mode_set, EFL_FUNC_CALL(mode), Elm_Object_Multi_Select_Mode mode); + +Elm_Object_Multi_Select_Mode _elm_gengrid_multi_select_mode_get(const Eo *obj, Elm_Gengrid_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_multi_select_mode_get, Elm_Object_Multi_Select_Mode, 2 /* Elm.Object.Multi_Select_Mode.max */); + +void _elm_gengrid_horizontal_set(Eo *obj, Elm_Gengrid_Data *pd, Eina_Bool horizontal); + + +static Eina_Error +__eolian_elm_gengrid_horizontal_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_gengrid_horizontal_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_horizontal_set, EFL_FUNC_CALL(horizontal), Eina_Bool horizontal); + +Eina_Bool _elm_gengrid_horizontal_get(const Eo *obj, Elm_Gengrid_Data *pd); + + +static Eina_Value +__eolian_elm_gengrid_horizontal_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_gengrid_horizontal_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_horizontal_get, Eina_Bool, 0); + +Elm_Widget_Item *_elm_gengrid_selected_item_get(const Eo *obj, Elm_Gengrid_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_selected_item_get, Elm_Widget_Item *, NULL); + +Eina_List *_elm_gengrid_realized_items_get(const Eo *obj, Elm_Gengrid_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_realized_items_get, Eina_List *, NULL); + +Elm_Widget_Item *_elm_gengrid_first_item_get(const Eo *obj, Elm_Gengrid_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_first_item_get, Elm_Widget_Item *, NULL); + +const Eina_List *_elm_gengrid_selected_items_get(const Eo *obj, Elm_Gengrid_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_selected_items_get, const Eina_List *, NULL); + +Elm_Widget_Item *_elm_gengrid_last_item_get(const Eo *obj, Elm_Gengrid_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_last_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_gengrid_item_insert_before(Eo *obj, Elm_Gengrid_Data *pd, const Elm_Gengrid_Item_Class *itc, const void *data, Elm_Widget_Item *relative, Evas_Smart_Cb func, const void *func_data); + +EOAPI EFL_FUNC_BODYV(elm_obj_gengrid_item_insert_before, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(itc, data, relative, func, func_data), const Elm_Gengrid_Item_Class *itc, const void *data, Elm_Widget_Item *relative, Evas_Smart_Cb func, const void *func_data); + +void _elm_gengrid_realized_items_update(Eo *obj, Elm_Gengrid_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_gengrid_realized_items_update); + +Elm_Widget_Item *_elm_gengrid_item_insert_after(Eo *obj, Elm_Gengrid_Data *pd, const Elm_Gengrid_Item_Class *itc, const void *data, Elm_Widget_Item *relative, Evas_Smart_Cb func, const void *func_data); + +EOAPI EFL_FUNC_BODYV(elm_obj_gengrid_item_insert_after, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(itc, data, relative, func, func_data), const Elm_Gengrid_Item_Class *itc, const void *data, Elm_Widget_Item *relative, Evas_Smart_Cb func, const void *func_data); + +unsigned int _elm_gengrid_items_count(const Eo *obj, Elm_Gengrid_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_items_count, unsigned int, 0); + +Elm_Widget_Item *_elm_gengrid_at_xy_item_get(const Eo *obj, Elm_Gengrid_Data *pd, int x, int y, int *xposret, int *yposret); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_gengrid_at_xy_item_get, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(x, y, xposret, yposret), int x, int y, int *xposret, int *yposret); + +Elm_Widget_Item *_elm_gengrid_item_append(Eo *obj, Elm_Gengrid_Data *pd, const Elm_Gengrid_Item_Class *itc, const void *data, Evas_Smart_Cb func, const void *func_data); + +EOAPI EFL_FUNC_BODYV(elm_obj_gengrid_item_append, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(itc, data, func, func_data), const Elm_Gengrid_Item_Class *itc, const void *data, Evas_Smart_Cb func, const void *func_data); + +Elm_Widget_Item *_elm_gengrid_item_prepend(Eo *obj, Elm_Gengrid_Data *pd, const Elm_Gengrid_Item_Class *itc, const void *data, Evas_Smart_Cb func, const void *func_data); + +EOAPI EFL_FUNC_BODYV(elm_obj_gengrid_item_prepend, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(itc, data, func, func_data), const Elm_Gengrid_Item_Class *itc, const void *data, Evas_Smart_Cb func, const void *func_data); + +void _elm_gengrid_clear(Eo *obj, Elm_Gengrid_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_gengrid_clear); + +Elm_Widget_Item *_elm_gengrid_item_sorted_insert(Eo *obj, Elm_Gengrid_Data *pd, const Elm_Gengrid_Item_Class *itc, const void *data, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data); + +EOAPI EFL_FUNC_BODYV(elm_obj_gengrid_item_sorted_insert, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(itc, data, comp, func, func_data), const Elm_Gengrid_Item_Class *itc, const void *data, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data); + +Elm_Widget_Item *_elm_gengrid_search_by_text_item_get(Eo *obj, Elm_Gengrid_Data *pd, Elm_Widget_Item *item_to_search_from, const char *part_name, const char *pattern, Elm_Glob_Match_Flags flags); + +EOAPI EFL_FUNC_BODYV(elm_obj_gengrid_search_by_text_item_get, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(item_to_search_from, part_name, pattern, flags), Elm_Widget_Item *item_to_search_from, const char *part_name, const char *pattern, Elm_Glob_Match_Flags flags); + +void _elm_gengrid_reorder_mode_start(Eo *obj, Elm_Gengrid_Data *pd, Ecore_Pos_Map tween_mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_reorder_mode_start, EFL_FUNC_CALL(tween_mode), Ecore_Pos_Map tween_mode); + +void _elm_gengrid_reorder_mode_stop(Eo *obj, Elm_Gengrid_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_gengrid_reorder_mode_stop); + +Efl_Object *_elm_gengrid_efl_object_constructor(Eo *obj, Elm_Gengrid_Data *pd); + + +Efl_Object *_elm_gengrid_efl_object_provider_find(const Eo *obj, Elm_Gengrid_Data *pd, const Efl_Class *klass); + + +void _elm_gengrid_efl_gfx_entity_position_set(Eo *obj, Elm_Gengrid_Data *pd, Eina_Position2D pos); + + +void _elm_gengrid_efl_gfx_entity_size_set(Eo *obj, Elm_Gengrid_Data *pd, Eina_Size2D size); + + +void _elm_gengrid_efl_canvas_group_group_member_add(Eo *obj, Elm_Gengrid_Data *pd, Efl_Canvas_Object *sub_obj); + + +Eina_Error _elm_gengrid_efl_ui_widget_theme_apply(Eo *obj, Elm_Gengrid_Data *pd); + + +void _elm_gengrid_efl_ui_widget_on_access_update(Eo *obj, Elm_Gengrid_Data *pd, Eina_Bool enable); + + +Eina_Rect _elm_gengrid_efl_ui_widget_interest_region_get(const Eo *obj, Elm_Gengrid_Data *pd); + + +Eina_Bool _elm_gengrid_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Gengrid_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +Eina_Rect _elm_gengrid_efl_ui_widget_focus_highlight_geometry_get(const Eo *obj, Elm_Gengrid_Data *pd); + + +Elm_Widget_Item *_elm_gengrid_elm_widget_item_container_focused_item_get(const Eo *obj, Elm_Gengrid_Data *pd); + + +void _elm_gengrid_elm_interface_scrollable_item_loop_enabled_set(Eo *obj, Elm_Gengrid_Data *pd, Eina_Bool enable); + + +Eina_Bool _elm_gengrid_elm_interface_scrollable_item_loop_enabled_get(const Eo *obj, Elm_Gengrid_Data *pd); + + +void _elm_gengrid_elm_interface_scrollable_bounce_allow_set(Eo *obj, Elm_Gengrid_Data *pd, Eina_Bool horiz, Eina_Bool vert); + + +void _elm_gengrid_elm_interface_scrollable_policy_set(Eo *obj, Elm_Gengrid_Data *pd, Elm_Scroller_Policy hbar, Elm_Scroller_Policy vbar); + + +void _elm_gengrid_elm_interface_scrollable_policy_get(const Eo *obj, Elm_Gengrid_Data *pd, Elm_Scroller_Policy *hbar, Elm_Scroller_Policy *vbar); + + +Eina_List *_elm_gengrid_efl_access_object_access_children_get(const Eo *obj, Elm_Gengrid_Data *pd); + + +Efl_Access_State_Set _elm_gengrid_efl_access_object_state_set_get(const Eo *obj, Elm_Gengrid_Data *pd); + + +const Efl_Access_Action_Data *_elm_gengrid_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Gengrid_Data *pd); + + +int _elm_gengrid_efl_access_selection_selected_children_count_get(const Eo *obj, Elm_Gengrid_Data *pd); + + +Efl_Object *_elm_gengrid_efl_access_selection_selected_child_get(const Eo *obj, Elm_Gengrid_Data *pd, int selected_child_index); + + +Eina_Bool _elm_gengrid_efl_access_selection_selected_child_deselect(Eo *obj, Elm_Gengrid_Data *pd, int child_index); + + +Eina_Bool _elm_gengrid_efl_access_selection_child_select(Eo *obj, Elm_Gengrid_Data *pd, int child_index); + + +Eina_Bool _elm_gengrid_efl_access_selection_child_deselect(Eo *obj, Elm_Gengrid_Data *pd, int child_index); + + +Eina_Bool _elm_gengrid_efl_access_selection_is_child_selected(Eo *obj, Elm_Gengrid_Data *pd, int child_index); + + +Eina_Bool _elm_gengrid_efl_access_selection_all_children_select(Eo *obj, Elm_Gengrid_Data *pd); + + +Eina_Bool _elm_gengrid_efl_access_selection_access_selection_clear(Eo *obj, Elm_Gengrid_Data *pd); + + +void _elm_gengrid_efl_ui_focus_object_setup_order(Eo *obj, Elm_Gengrid_Data *pd); + + +Eina_Bool _elm_gengrid_efl_ui_widget_focus_state_apply(Eo *obj, Elm_Gengrid_Data *pd, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect); + + +void _elm_gengrid_efl_ui_focus_manager_setup_on_first_touch(Eo *obj, Elm_Gengrid_Data *pd, Efl_Ui_Focus_Direction direction, Efl_Ui_Focus_Object *entry); + + +Efl_Ui_Focus_Object *_elm_gengrid_efl_ui_focus_manager_manager_focus_get(const Eo *obj, Elm_Gengrid_Data *pd); + + +Efl_Ui_Focus_Object *_elm_gengrid_efl_ui_focus_manager_move(Eo *obj, Elm_Gengrid_Data *pd, Efl_Ui_Focus_Direction direction); + + +static Eina_Bool +_elm_gengrid_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_GENGRID_EXTRA_OPS +#define ELM_GENGRID_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_align_set, _elm_gengrid_align_set), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_align_get, _elm_gengrid_align_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_filled_set, _elm_gengrid_filled_set), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_filled_get, _elm_gengrid_filled_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_multi_select_set, _elm_gengrid_multi_select_set), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_multi_select_get, _elm_gengrid_multi_select_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_group_item_size_set, _elm_gengrid_group_item_size_set), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_group_item_size_get, _elm_gengrid_group_item_size_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_select_mode_set, _elm_gengrid_select_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_select_mode_get, _elm_gengrid_select_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_reorder_mode_set, _elm_gengrid_reorder_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_reorder_mode_get, _elm_gengrid_reorder_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_highlight_mode_set, _elm_gengrid_highlight_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_highlight_mode_get, _elm_gengrid_highlight_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_reorder_type_set, _elm_gengrid_reorder_type_set), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_size_set, _elm_gengrid_item_size_set), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_size_get, _elm_gengrid_item_size_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_multi_select_mode_set, _elm_gengrid_multi_select_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_multi_select_mode_get, _elm_gengrid_multi_select_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_horizontal_set, _elm_gengrid_horizontal_set), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_horizontal_get, _elm_gengrid_horizontal_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_selected_item_get, _elm_gengrid_selected_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_realized_items_get, _elm_gengrid_realized_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_first_item_get, _elm_gengrid_first_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_selected_items_get, _elm_gengrid_selected_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_last_item_get, _elm_gengrid_last_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_insert_before, _elm_gengrid_item_insert_before), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_realized_items_update, _elm_gengrid_realized_items_update), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_insert_after, _elm_gengrid_item_insert_after), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_items_count, _elm_gengrid_items_count), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_at_xy_item_get, _elm_gengrid_at_xy_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_append, _elm_gengrid_item_append), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_prepend, _elm_gengrid_item_prepend), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_clear, _elm_gengrid_clear), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_sorted_insert, _elm_gengrid_item_sorted_insert), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_search_by_text_item_get, _elm_gengrid_search_by_text_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_reorder_mode_start, _elm_gengrid_reorder_mode_start), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_reorder_mode_stop, _elm_gengrid_reorder_mode_stop), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_gengrid_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_provider_find, _elm_gengrid_efl_object_provider_find), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_gengrid_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_gengrid_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_canvas_group_member_add, _elm_gengrid_efl_canvas_group_group_member_add), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_gengrid_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_gengrid_efl_ui_widget_on_access_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_interest_region_get, _elm_gengrid_efl_ui_widget_interest_region_get), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_gengrid_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_highlight_geometry_get, _elm_gengrid_efl_ui_widget_focus_highlight_geometry_get), + EFL_OBJECT_OP_FUNC(elm_widget_item_container_focused_item_get, _elm_gengrid_elm_widget_item_container_focused_item_get), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_item_loop_enabled_set, _elm_gengrid_elm_interface_scrollable_item_loop_enabled_set), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_item_loop_enabled_get, _elm_gengrid_elm_interface_scrollable_item_loop_enabled_get), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_bounce_allow_set, _elm_gengrid_elm_interface_scrollable_bounce_allow_set), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_policy_set, _elm_gengrid_elm_interface_scrollable_policy_set), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_policy_get, _elm_gengrid_elm_interface_scrollable_policy_get), + EFL_OBJECT_OP_FUNC(efl_access_object_access_children_get, _elm_gengrid_efl_access_object_access_children_get), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_gengrid_efl_access_object_state_set_get), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_gengrid_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_children_count_get, _elm_gengrid_efl_access_selection_selected_children_count_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_child_get, _elm_gengrid_efl_access_selection_selected_child_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_child_deselect, _elm_gengrid_efl_access_selection_selected_child_deselect), + EFL_OBJECT_OP_FUNC(efl_access_selection_child_select, _elm_gengrid_efl_access_selection_child_select), + EFL_OBJECT_OP_FUNC(efl_access_selection_child_deselect, _elm_gengrid_efl_access_selection_child_deselect), + EFL_OBJECT_OP_FUNC(efl_access_selection_is_child_selected, _elm_gengrid_efl_access_selection_is_child_selected), + EFL_OBJECT_OP_FUNC(efl_access_selection_all_children_select, _elm_gengrid_efl_access_selection_all_children_select), + EFL_OBJECT_OP_FUNC(efl_access_selection_clear, _elm_gengrid_efl_access_selection_access_selection_clear), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_setup_order, _elm_gengrid_efl_ui_focus_object_setup_order), + EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_state_apply, _elm_gengrid_efl_ui_widget_focus_state_apply), + EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_setup_on_first_touch, _elm_gengrid_efl_ui_focus_manager_setup_on_first_touch), + EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_focus_get, _elm_gengrid_efl_ui_focus_manager_manager_focus_get), + EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_move, _elm_gengrid_efl_ui_focus_manager_move), + ELM_GENGRID_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"filled", __eolian_elm_gengrid_filled_set_reflect, __eolian_elm_gengrid_filled_get_reflect}, + {"multi_select", __eolian_elm_gengrid_multi_select_set_reflect, __eolian_elm_gengrid_multi_select_get_reflect}, + {"reorder_mode", __eolian_elm_gengrid_reorder_mode_set_reflect, __eolian_elm_gengrid_reorder_mode_get_reflect}, + {"highlight_mode", __eolian_elm_gengrid_highlight_mode_set_reflect, __eolian_elm_gengrid_highlight_mode_get_reflect}, + {"horizontal", __eolian_elm_gengrid_horizontal_set_reflect, __eolian_elm_gengrid_horizontal_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_gengrid_class_desc = { + EO_VERSION, + "Elm.Gengrid", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Gengrid_Data), + _elm_gengrid_class_initializer, + _elm_gengrid_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_gengrid_class_get, &_elm_gengrid_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); + +#include "elm_gengrid_eo.legacy.c" diff --git a/src/lib/elementary/elm_gengrid_eo.h b/src/lib/elementary/elm_gengrid_eo.h new file mode 100644 index 0000000000..340a273cd8 --- /dev/null +++ b/src/lib/elementary/elm_gengrid_eo.h @@ -0,0 +1,782 @@ +#ifndef _ELM_GENGRID_EO_H_ +#define _ELM_GENGRID_EO_H_ + +#ifndef _ELM_GENGRID_EO_CLASS_TYPE +#define _ELM_GENGRID_EO_CLASS_TYPE + +typedef Eo Elm_Gengrid; + +#endif + +#ifndef _ELM_GENGRID_EO_TYPES +#define _ELM_GENGRID_EO_TYPES + +/** Gengrid reorder modes + * + * @ingroup Elm_Gengrid + */ +typedef enum +{ + ELM_GENGRID_REORDER_TYPE_NORMAL = 0, /**< Normal reorder type */ + ELM_GENGRID_REORDER_TYPE_SWAP /**< Swap reorder type */ +} Elm_Gengrid_Reorder_Type; + + +#endif +/** Elementary gengrid class + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_CLASS elm_gengrid_class_get() + +EWAPI const Efl_Class *elm_gengrid_class_get(void); + +/** + * @brief Set the items grid's alignment within a given gengrid widget. + * + * This sets the alignment of the whole grid of items of a gengrid within its + * given viewport. By default, those values are both 0.5, meaning that the + * gengrid will have its items grid placed exactly in the middle of its + * viewport. + * + * @note If given alignment values are out of the cited ranges, they'll be + * changed to the nearest boundary values on the valid ranges. + * + * @param[in] obj The object. + * @param[in] align_x Alignment in the horizontal axis (0 <= align_x <= 1). + * @param[in] align_y Alignment in the vertical axis (0 <= align_y <= 1). + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_align_set(Eo *obj, double align_x, double align_y); + +/** + * @brief Get the items grid's alignment values within a given gengrid widget. + * + * @note Use @c null pointers on the alignment values you're not interested in: + * they'll be ignored by the function. + * + * @param[in] obj The object. + * @param[out] align_x Alignment in the horizontal axis (0 <= align_x <= 1). + * @param[out] align_y Alignment in the vertical axis (0 <= align_y <= 1). + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_align_get(const Eo *obj, double *align_x, double *align_y); + +/** + * @brief Set how the items grid's filled within a given gengrid widget + * + * This sets the fill state of the whole grid of items of a gengrid within its + * given viewport. By default, this value is false, meaning that if the first + * line of items grid's isn't filled, the items are centered with the + * alignment. + * + * @param[in] obj The object. + * @param[in] fill @c true if the grid is filled, @c false otherwise + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_filled_set(Eo *obj, Eina_Bool fill); + +/** + * @brief Get how the items grid's filled within a given gengrid widget + * + * @note Use @c null pointers on the alignment values you're not interested in: + * they'll be ignored by the function. + * + * @param[in] obj The object. + * + * @return @c true if the grid is filled, @c false otherwise + * + * @ingroup Elm_Gengrid + */ +EOAPI Eina_Bool elm_obj_gengrid_filled_get(const Eo *obj); + +/** + * @brief Enable or disable multi-selection in a given gengrid widget. + * + * Multi-selection is the ability to have more than one item selected, on a + * given gengrid, simultaneously. When it is enabled, a sequence of clicks on + * different items will make them all selected, progressively. A click on an + * already selected item will unselect it. If interacting via the keyboard, + * multi-selection is enabled while holding the "Shift" key. + * + * @note By default, multi-selection is disabled on gengrids. + * + * @param[in] obj The object. + * @param[in] multi @c true if multislect is enabled, @c false otherwise + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_multi_select_set(Eo *obj, Eina_Bool multi); + +/** + * @brief Get whether multi-selection is enabled or disabled for a given + * gengrid widget. + * + * @param[in] obj The object. + * + * @return @c true if multislect is enabled, @c false otherwise + * + * @ingroup Elm_Gengrid + */ +EOAPI Eina_Bool elm_obj_gengrid_multi_select_get(const Eo *obj); + +/** + * @brief Set the size for the group items of a given gengrid widget. + * + * A gengrid, after creation, has still no information on the size to give to + * each of its cells. So, you most probably will end up with squares one @ref + * Fingers "finger" wide, the default size. Use this function to force a custom + * size for you group items, making them as big as you wish. + * + * @param[in] obj The object. + * @param[in] w The group items' width. + * @param[in] h The group items' height. + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_group_item_size_set(Eo *obj, int w, int h); + +/** + * @brief Get the size set for the group items of a given gengrid widget. + * + * @note Use @c null pointers on the size values you're not interested in: + * they'll be ignored by the function. + * + * @param[in] obj The object. + * @param[out] w The group items' width. + * @param[out] h The group items' height. + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_group_item_size_get(const Eo *obj, int *w, int *h); + +/** + * @brief Set the gengrid select mode. + * + * This changes item select mode in the gengrid widget. + * #ELM_OBJECT_SELECT_MODE_DEFAULT means that items will only call their + * selection func and callback when first becoming selected. Any further clicks + * will do nothing, unless you set always select mode. + * #ELM_OBJECT_SELECT_MODE_ALWAYS means that even if selected, every click will + * make the selected callbacks be called. #ELM_OBJECT_SELECT_MODE_NONE will + * turn off the ability to select items entirely and they will neither appear + * selected nor call selected callback functions. + * + * @param[in] obj The object. + * @param[in] mode The select mode. + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_select_mode_set(Eo *obj, Elm_Object_Select_Mode mode); + +/** + * @brief Get the gengrid select mode. + * + * @param[in] obj The object. + * + * @return The select mode. + * + * @ingroup Elm_Gengrid + */ +EOAPI Elm_Object_Select_Mode elm_obj_gengrid_select_mode_get(const Eo *obj); + +/** + * @brief Set whether a given gengrid widget is or not able have items + * reordered. + * + * If a gengrid is set to allow reordering, a click held for more than 0.5 over + * a given item will highlight it specially, signaling the gengrid has entered + * the reordering state. From that time on, the user will be able to, while + * still holding the mouse button down, move the item freely in the gengrid's + * viewport, replacing to said item to the locations it goes to. The + * replacements will be animated and, whenever the user releases the mouse + * button, the item being replaced gets a new definitive place in the grid. + * + * @param[in] obj The object. + * @param[in] reorder_mode Use @c true to turn reordering on, @c false to turn + * it off. + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_reorder_mode_set(Eo *obj, Eina_Bool reorder_mode); + +/** + * @brief Get whether a given gengrid widget is or not able have items + * reordered. + * + * @param[in] obj The object. + * + * @return Use @c true to turn reordering on, @c false to turn it off. + * + * @ingroup Elm_Gengrid + */ +EOAPI Eina_Bool elm_obj_gengrid_reorder_mode_get(const Eo *obj); + +/** + * @brief Control whether the gengrid items' should be highlighted when item + * selected. + * + * @param[in] obj The object. + * @param[in] highlight @c true if item will be highlighted, @c false otherwise + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_highlight_mode_set(Eo *obj, Eina_Bool highlight); + +/** + * @brief Control whether the gengrid items' should be highlighted when item + * selected. + * + * @param[in] obj The object. + * + * @return @c true if item will be highlighted, @c false otherwise + * + * @ingroup Elm_Gengrid + */ +EOAPI Eina_Bool elm_obj_gengrid_highlight_mode_get(const Eo *obj); + +/** + * @brief Set the Gengrid reorder type + * + * @param[in] obj The object. + * @param[in] type Reorder type value + * + * @since 1.11 + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_reorder_type_set(Eo *obj, Elm_Gengrid_Reorder_Type type); + +/** + * @brief Set the size for the items of a given gengrid widget. + * + * A gengrid, after creation, has still no information on the size to give to + * each of its cells. So, you most probably will end up with squares one @ref + * Fingers "finger" wide, the default size. Use this function to force a custom + * size for you items, making them as big as you wish. + * + * @param[in] obj The object. + * @param[in] w The items' width. + * @param[in] h The items' height. + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_item_size_set(Eo *obj, int w, int h); + +/** + * @brief Get the size set for the items of a given gengrid widget. + * + * @note Use @c null pointers on the size values you're not interested in: + * they'll be ignored by the function. + * + * @param[in] obj The object. + * @param[out] w The items' width. + * @param[out] h The items' height. + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_item_size_get(const Eo *obj, int *w, int *h); + +/** + * @brief Set the gengrid multi select mode. + * + * #ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT means that select/unselect items + * whenever each item is clicked. #ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL + * means that only one item will be selected although multi-selection is + * enabled, if clicked without pressing control key. This mode is only + * available with multi-selection. + * + * @param[in] obj The object. + * @param[in] mode The multi select mode. + * + * @since 1.8 + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_multi_select_mode_set(Eo *obj, Elm_Object_Multi_Select_Mode mode); + +/** + * @brief Get the gengrid multi select mode. + * + * If getting mode fails, it returns #ELM_OBJECT_MULTI_SELECT_MODE_MAX. + * + * @param[in] obj The object. + * + * @return The multi select mode. + * + * @since 1.8 + * + * @ingroup Elm_Gengrid + */ +EOAPI Elm_Object_Multi_Select_Mode elm_obj_gengrid_multi_select_mode_get(const Eo *obj); + +/** + * @brief Set the direction in which a given gengrid widget will expand while + * placing its items. + * + * When in "horizontal mode" ($true), items will be placed in columns, from top + * to bottom and, when the space for a column is filled, another one is started + * on the right, thus expanding the grid horizontally. When in "vertical mode" + * ($false), though, items will be placed in rows, from left to right and, when + * the space for a row is filled, another one is started below, thus expanding + * the grid vertically. + * + * @note By default, gengrid is in vertical mode, @c false. + * + * @param[in] obj The object. + * @param[in] horizontal @c true to make the gengrid expand horizontally, + * @c false to expand vertically. + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_horizontal_set(Eo *obj, Eina_Bool horizontal); + +/** + * @brief Get for what direction a given gengrid widget will expand while + * placing its items. + * + * @param[in] obj The object. + * + * @return @c true to make the gengrid expand horizontally, @c false to expand + * vertically. + * + * @ingroup Elm_Gengrid + */ +EOAPI Eina_Bool elm_obj_gengrid_horizontal_get(const Eo *obj); + +/** + * @brief Get the selected item in a given gengrid widget. + * + * This returns the selected item in @c obj. If multi selection is enabled on + * @c obj (See @ref elm_obj_gengrid_multi_select_set), only the first item in + * the list is selected, which might not be very useful. For that case, see + * @ref elm_obj_gengrid_selected_items_get. + * + * @param[in] obj The object. + * + * @return The selected item's handle or @c null if none is selected at the + * moment (and on errors). + * + * @ingroup Elm_Gengrid + */ +EOAPI Elm_Widget_Item *elm_obj_gengrid_selected_item_get(const Eo *obj); + +/** + * @brief Get a list of realized items in gengrid. + * + * This returns a list of the realized items in the gengrid. The list contains + * gengrid item pointers. The list must be freed by the caller when done with + * eina_list_free(). The item pointers in the list are only valid so long as + * those items are not deleted or the gengrid is not deleted. + * + * @param[in] obj The object. + * + * @return The list of realized items or @c null if none are realized. + * + * @ingroup Elm_Gengrid + */ +EOAPI Eina_List *elm_obj_gengrid_realized_items_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get the first item in a given gengrid widget. + * + * This returns the first item in the @c obj's internal list of items. + * + * @param[in] obj The object. + * + * @return The first item's handle or @c null, if there are no items in @c obj + * (and on errors) + * + * @ingroup Elm_Gengrid + */ +EOAPI Elm_Widget_Item *elm_obj_gengrid_first_item_get(const Eo *obj); + +/** + * @brief Get a list of selected items in a given gengrid. + * + * This returns a list of the selected items, in the order that they appear in + * the grid. This list is only valid as long as no more items are selected or + * unselected (or unselected implicitly by deletion). The list contains Gengrid + * item pointers as data, naturally. + * + * @param[in] obj The object. + * + * @return The list of selected items or @c null, if none is selected at the + * moment (and on errors). + * + * @ingroup Elm_Gengrid + */ +EOAPI const Eina_List *elm_obj_gengrid_selected_items_get(const Eo *obj); + +/** + * @brief Get the last item in a given gengrid widget. + * + * This returns the last item in the @c obj's internal list of items. + * + * @param[in] obj The object. + * + * @return The last item's handle or @c null if there are no items in @c obj + * (and on errors). + * + * @ingroup Elm_Gengrid + */ +EOAPI Elm_Widget_Item *elm_obj_gengrid_last_item_get(const Eo *obj); + +/** + * @brief Insert an item before another in a gengrid widget. + * + * This inserts an item before another in the gengrid. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] relative The item to place this new one before. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data to be passed to @c func. + * + * @return A handle to the item added or @c null on errors. + * + * @ingroup Elm_Gengrid + */ +EOAPI Elm_Widget_Item *elm_obj_gengrid_item_insert_before(Eo *obj, const Elm_Gengrid_Item_Class *itc, const void *data, Elm_Widget_Item *relative, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Update the contents of all realized items. + * + * This updates all realized items by calling all the item class functions + * again to get the contents, texts and states. Use this when the original item + * data has changed and the changes are desired to be reflected. + * + * To update just one item, use @ref elm_gengrid_item_update. + * @param[in] obj The object. + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_realized_items_update(Eo *obj); + +/** + * @brief Insert an item after another in a gengrid widget. + * + * This inserts an item after another in the gengrid. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] relative The item to place this new one after. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data to be passed to @c func. + * + * @return A handle to the item added or @c null on error. + * + * @ingroup Elm_Gengrid + */ +EOAPI Elm_Widget_Item *elm_obj_gengrid_item_insert_after(Eo *obj, const Elm_Gengrid_Item_Class *itc, const void *data, Elm_Widget_Item *relative, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Return how many items are currently in a list + * + * This behavior is O(1) and includes items which may or may not be realized. + * + * @param[in] obj The object. + * + * @return Items in list + * + * @ingroup Elm_Gengrid + */ +EOAPI unsigned int elm_obj_gengrid_items_count(const Eo *obj); + +/** + * @brief Get the item that is at the x, y canvas coords. + * + * This returns the item at the given coordinates (which are canvas relative, + * not object-relative). If an item is at that coordinate, that item handle is + * returned, and if @c xposret is not @c null, the integer pointed to is set to + * a value of -1, 0 or 1, depending if the coordinate is on the left portion of + * that item (-1), on the middle section (0) or on the right part (1). + * + * If @c yposret is not @c null, the integer pointed to is set to a value of + * -1, 0 or 1, depending if the coordinate is on the upper portion of that item + * (-1), on the middle section (0) or on the lower part (1). If NULL is + * returned as an item (no item found there), then posret may indicate -1 or 1 + * based if the coordinate is above or below all items respectively in the + * gengrid. + * + * @param[in] obj The object. + * @param[in] x The input x coordinate. + * @param[in] y The input y coordinate. + * @param[out] xposret The position relative to the item returned here. + * @param[out] yposret The position relative to the item returned here. + * + * @return The item at the coordinates or @c null if none. + * + * @ingroup Elm_Gengrid + */ +EOAPI Elm_Widget_Item *elm_obj_gengrid_at_xy_item_get(const Eo *obj, int x, int y, int *xposret, int *yposret); + +/** + * @brief Append a new item in a given gengrid widget. + * + * This adds an item to the beginning of the gengrid. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data to be passed to @c func. + * + * @return A handle to the item added or @c null on errors. + * + * @ingroup Elm_Gengrid + */ +EOAPI Elm_Widget_Item *elm_obj_gengrid_item_append(Eo *obj, const Elm_Gengrid_Item_Class *itc, const void *data, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Prepend a new item in a given gengrid widget. + * + * This adds an item to the end of the gengrid. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data to be passed to @c func. + * + * @return A handle to the item added or @c null on errors. + * + * @ingroup Elm_Gengrid + */ +EOAPI Elm_Widget_Item *elm_obj_gengrid_item_prepend(Eo *obj, const Elm_Gengrid_Item_Class *itc, const void *data, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Remove all items from a given gengrid widget. + * + * This removes (and deletes) all items in @c obj, leaving it empty. + * + * See @ref elm_gengrid_item_del to remove just one item. + * @param[in] obj The object. + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_clear(Eo *obj); + +/** + * @brief Insert an item in a gengrid widget using a user-defined sort + * function. + * + * This inserts an item in the gengrid based on user defined comparison + * function. The two arguments passed to the function @c func are gengrid item + * handles to compare. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] comp User defined comparison function that defines the sort order + * based on gengrid item and its data. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data to be passed to @c func. + * + * @return A handle to the item added or @c null on errors. + * + * @ingroup Elm_Gengrid + */ +EOAPI Elm_Widget_Item *elm_obj_gengrid_item_sorted_insert(Eo *obj, const Elm_Gengrid_Item_Class *itc, const void *data, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Get gengrid item by given string. + * + * It takes pointer to the gengrid item that will be used to start search from + * it. + * + * This function uses globs (like "*.jpg") for searching and takes search flags + * as last parameter That is a bitfield with values to be ored together or 0 + * for no flags. + * + * @param[in] obj The object. + * @param[in] item_to_search_from Pointer to item to start search from. If + * @c null, search will be started from the first item of the gengrid. + * @param[in] part_name Name of the TEXT part of gengrid item to search string + * in. If @c null, search by "elm.text" parts. + * @param[in] pattern The search pattern. + * @param[in] flags Search flags. + * + * @return Pointer to the gengrid item which matches search_string in case of + * success, otherwise @c null. + * + * @since 1.11 + * + * @ingroup Elm_Gengrid + */ +EOAPI Elm_Widget_Item *elm_obj_gengrid_search_by_text_item_get(Eo *obj, Elm_Widget_Item *item_to_search_from, const char *part_name, const char *pattern, Elm_Glob_Match_Flags flags); + +/** + * @brief Starts the reorder mode of Gengrid + * + * @param[in] obj The object. + * @param[in] tween_mode Position mappings for animation + * + * @since 1.10 + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_reorder_mode_start(Eo *obj, Ecore_Pos_Map tween_mode); + +/** Stops the reorder mode of Gengrid + * + * @since 1.10 + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_reorder_mode_stop(Eo *obj); + +EWAPI extern const Efl_Event_Description _ELM_GENGRID_EVENT_REALIZED; + +/** Called when gengrid realized + * @return Efl_Object * + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_EVENT_REALIZED (&(_ELM_GENGRID_EVENT_REALIZED)) + +EWAPI extern const Efl_Event_Description _ELM_GENGRID_EVENT_UNREALIZED; + +/** Called when gengrid unrealized + * @return Efl_Object * + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_EVENT_UNREALIZED (&(_ELM_GENGRID_EVENT_UNREALIZED)) + +EWAPI extern const Efl_Event_Description _ELM_GENGRID_EVENT_INDEX_UPDATE; + +/** Called on gengrid index update + * @return Efl_Object * + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_EVENT_INDEX_UPDATE (&(_ELM_GENGRID_EVENT_INDEX_UPDATE)) + +EWAPI extern const Efl_Event_Description _ELM_GENGRID_EVENT_SCROLL_PAGE_CHANGED; + +/** Called when scroll page changed + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_EVENT_SCROLL_PAGE_CHANGED (&(_ELM_GENGRID_EVENT_SCROLL_PAGE_CHANGED)) + +EWAPI extern const Efl_Event_Description _ELM_GENGRID_EVENT_EDGE_BOTTOM; + +/** Called when bottom edge is reached + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_EVENT_EDGE_BOTTOM (&(_ELM_GENGRID_EVENT_EDGE_BOTTOM)) + +EWAPI extern const Efl_Event_Description _ELM_GENGRID_EVENT_EDGE_TOP; + +/** Called when top edge is reached + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_EVENT_EDGE_TOP (&(_ELM_GENGRID_EVENT_EDGE_TOP)) + +EWAPI extern const Efl_Event_Description _ELM_GENGRID_EVENT_EDGE_RIGHT; + +/** Called when right edge is reached + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_EVENT_EDGE_RIGHT (&(_ELM_GENGRID_EVENT_EDGE_RIGHT)) + +EWAPI extern const Efl_Event_Description _ELM_GENGRID_EVENT_EDGE_LEFT; + +/** Called when left edge is reached + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_EVENT_EDGE_LEFT (&(_ELM_GENGRID_EVENT_EDGE_LEFT)) + +EWAPI extern const Efl_Event_Description _ELM_GENGRID_EVENT_ITEM_FOCUSED; + +/** Called when item got focus + * @return Efl_Object * + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_EVENT_ITEM_FOCUSED (&(_ELM_GENGRID_EVENT_ITEM_FOCUSED)) + +EWAPI extern const Efl_Event_Description _ELM_GENGRID_EVENT_ITEM_UNFOCUSED; + +/** Called when item no longer has focus + * @return Efl_Object * + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_EVENT_ITEM_UNFOCUSED (&(_ELM_GENGRID_EVENT_ITEM_UNFOCUSED)) + +EWAPI extern const Efl_Event_Description _ELM_GENGRID_EVENT_ITEM_REORDER_ANIM_START; + +/** Called when item reorder animation started + * @return Efl_Object * + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_EVENT_ITEM_REORDER_ANIM_START (&(_ELM_GENGRID_EVENT_ITEM_REORDER_ANIM_START)) + +EWAPI extern const Efl_Event_Description _ELM_GENGRID_EVENT_ITEM_REORDER_ANIM_STOP; + +/** Called when item reorder animation stopped + * @return Efl_Object * + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_EVENT_ITEM_REORDER_ANIM_STOP (&(_ELM_GENGRID_EVENT_ITEM_REORDER_ANIM_STOP)) + +EWAPI extern const Efl_Event_Description _ELM_GENGRID_EVENT_ACTIVATED; + +/** Called when gengrid got activated + * @return Efl_Object * + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_EVENT_ACTIVATED (&(_ELM_GENGRID_EVENT_ACTIVATED)) + +EWAPI extern const Efl_Event_Description _ELM_GENGRID_EVENT_HIGHLIGHTED; + +/** Called when gengrid is highlighted + * @return Efl_Object * + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_EVENT_HIGHLIGHTED (&(_ELM_GENGRID_EVENT_HIGHLIGHTED)) + +EWAPI extern const Efl_Event_Description _ELM_GENGRID_EVENT_UNHIGHLIGHTED; + +/** Called when gengrid is no longer highlighted + * @return Efl_Object * + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_EVENT_UNHIGHLIGHTED (&(_ELM_GENGRID_EVENT_UNHIGHLIGHTED)) + +EWAPI extern const Efl_Event_Description _ELM_GENGRID_EVENT_RELEASED; + +/** Called when gengrid is released + * @return Efl_Object * + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_EVENT_RELEASED (&(_ELM_GENGRID_EVENT_RELEASED)) + +EWAPI extern const Efl_Event_Description _ELM_GENGRID_EVENT_MOVED; + +/** Called when gengrid item moved + * @return Efl_Object * + * + * @ingroup Elm_Gengrid + */ +#define ELM_GENGRID_EVENT_MOVED (&(_ELM_GENGRID_EVENT_MOVED)) + +#endif diff --git a/src/lib/elementary/elm_gengrid_eo.legacy.c b/src/lib/elementary/elm_gengrid_eo.legacy.c new file mode 100644 index 0000000000..b823e8d3a1 --- /dev/null +++ b/src/lib/elementary/elm_gengrid_eo.legacy.c @@ -0,0 +1,228 @@ + +EAPI void +elm_gengrid_align_set(Elm_Gengrid *obj, double align_x, double align_y) +{ + elm_obj_gengrid_align_set(obj, align_x, align_y); +} + +EAPI void +elm_gengrid_align_get(const Elm_Gengrid *obj, double *align_x, double *align_y) +{ + elm_obj_gengrid_align_get(obj, align_x, align_y); +} + +EAPI void +elm_gengrid_filled_set(Elm_Gengrid *obj, Eina_Bool fill) +{ + elm_obj_gengrid_filled_set(obj, fill); +} + +EAPI Eina_Bool +elm_gengrid_filled_get(const Elm_Gengrid *obj) +{ + return elm_obj_gengrid_filled_get(obj); +} + +EAPI void +elm_gengrid_multi_select_set(Elm_Gengrid *obj, Eina_Bool multi) +{ + elm_obj_gengrid_multi_select_set(obj, multi); +} + +EAPI Eina_Bool +elm_gengrid_multi_select_get(const Elm_Gengrid *obj) +{ + return elm_obj_gengrid_multi_select_get(obj); +} + +EAPI void +elm_gengrid_group_item_size_set(Elm_Gengrid *obj, int w, int h) +{ + elm_obj_gengrid_group_item_size_set(obj, w, h); +} + +EAPI void +elm_gengrid_group_item_size_get(const Elm_Gengrid *obj, int *w, int *h) +{ + elm_obj_gengrid_group_item_size_get(obj, w, h); +} + +EAPI void +elm_gengrid_select_mode_set(Elm_Gengrid *obj, Elm_Object_Select_Mode mode) +{ + elm_obj_gengrid_select_mode_set(obj, mode); +} + +EAPI Elm_Object_Select_Mode +elm_gengrid_select_mode_get(const Elm_Gengrid *obj) +{ + return elm_obj_gengrid_select_mode_get(obj); +} + +EAPI void +elm_gengrid_reorder_mode_set(Elm_Gengrid *obj, Eina_Bool reorder_mode) +{ + elm_obj_gengrid_reorder_mode_set(obj, reorder_mode); +} + +EAPI Eina_Bool +elm_gengrid_reorder_mode_get(const Elm_Gengrid *obj) +{ + return elm_obj_gengrid_reorder_mode_get(obj); +} + +EAPI void +elm_gengrid_highlight_mode_set(Elm_Gengrid *obj, Eina_Bool highlight) +{ + elm_obj_gengrid_highlight_mode_set(obj, highlight); +} + +EAPI Eina_Bool +elm_gengrid_highlight_mode_get(const Elm_Gengrid *obj) +{ + return elm_obj_gengrid_highlight_mode_get(obj); +} + +EAPI void +elm_gengrid_reorder_type_set(Elm_Gengrid *obj, Elm_Gengrid_Reorder_Type type) +{ + elm_obj_gengrid_reorder_type_set(obj, type); +} + +EAPI void +elm_gengrid_item_size_set(Elm_Gengrid *obj, int w, int h) +{ + elm_obj_gengrid_item_size_set(obj, w, h); +} + +EAPI void +elm_gengrid_item_size_get(const Elm_Gengrid *obj, int *w, int *h) +{ + elm_obj_gengrid_item_size_get(obj, w, h); +} + +EAPI void +elm_gengrid_multi_select_mode_set(Elm_Gengrid *obj, Elm_Object_Multi_Select_Mode mode) +{ + elm_obj_gengrid_multi_select_mode_set(obj, mode); +} + +EAPI Elm_Object_Multi_Select_Mode +elm_gengrid_multi_select_mode_get(const Elm_Gengrid *obj) +{ + return elm_obj_gengrid_multi_select_mode_get(obj); +} + +EAPI void +elm_gengrid_horizontal_set(Elm_Gengrid *obj, Eina_Bool horizontal) +{ + elm_obj_gengrid_horizontal_set(obj, horizontal); +} + +EAPI Eina_Bool +elm_gengrid_horizontal_get(const Elm_Gengrid *obj) +{ + return elm_obj_gengrid_horizontal_get(obj); +} + +EAPI Elm_Widget_Item * +elm_gengrid_selected_item_get(const Elm_Gengrid *obj) +{ + return elm_obj_gengrid_selected_item_get(obj); +} + +EAPI Eina_List * +elm_gengrid_realized_items_get(const Elm_Gengrid *obj) +{ + return elm_obj_gengrid_realized_items_get(obj); +} + +EAPI Elm_Widget_Item * +elm_gengrid_first_item_get(const Elm_Gengrid *obj) +{ + return elm_obj_gengrid_first_item_get(obj); +} + +EAPI const Eina_List * +elm_gengrid_selected_items_get(const Elm_Gengrid *obj) +{ + return elm_obj_gengrid_selected_items_get(obj); +} + +EAPI Elm_Widget_Item * +elm_gengrid_last_item_get(const Elm_Gengrid *obj) +{ + return elm_obj_gengrid_last_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_gengrid_item_insert_before(Elm_Gengrid *obj, const Elm_Gengrid_Item_Class *itc, const void *data, Elm_Widget_Item *relative, Evas_Smart_Cb func, const void *func_data) +{ + return elm_obj_gengrid_item_insert_before(obj, itc, data, relative, func, func_data); +} + +EAPI void +elm_gengrid_realized_items_update(Elm_Gengrid *obj) +{ + elm_obj_gengrid_realized_items_update(obj); +} + +EAPI Elm_Widget_Item * +elm_gengrid_item_insert_after(Elm_Gengrid *obj, const Elm_Gengrid_Item_Class *itc, const void *data, Elm_Widget_Item *relative, Evas_Smart_Cb func, const void *func_data) +{ + return elm_obj_gengrid_item_insert_after(obj, itc, data, relative, func, func_data); +} + +EAPI unsigned int +elm_gengrid_items_count(const Elm_Gengrid *obj) +{ + return elm_obj_gengrid_items_count(obj); +} + +EAPI Elm_Widget_Item * +elm_gengrid_at_xy_item_get(const Elm_Gengrid *obj, int x, int y, int *xposret, int *yposret) +{ + return elm_obj_gengrid_at_xy_item_get(obj, x, y, xposret, yposret); +} + +EAPI Elm_Widget_Item * +elm_gengrid_item_append(Elm_Gengrid *obj, const Elm_Gengrid_Item_Class *itc, const void *data, Evas_Smart_Cb func, const void *func_data) +{ + return elm_obj_gengrid_item_append(obj, itc, data, func, func_data); +} + +EAPI Elm_Widget_Item * +elm_gengrid_item_prepend(Elm_Gengrid *obj, const Elm_Gengrid_Item_Class *itc, const void *data, Evas_Smart_Cb func, const void *func_data) +{ + return elm_obj_gengrid_item_prepend(obj, itc, data, func, func_data); +} + +EAPI void +elm_gengrid_clear(Elm_Gengrid *obj) +{ + elm_obj_gengrid_clear(obj); +} + +EAPI Elm_Widget_Item * +elm_gengrid_item_sorted_insert(Elm_Gengrid *obj, const Elm_Gengrid_Item_Class *itc, const void *data, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data) +{ + return elm_obj_gengrid_item_sorted_insert(obj, itc, data, comp, func, func_data); +} + +EAPI Elm_Widget_Item * +elm_gengrid_search_by_text_item_get(Elm_Gengrid *obj, Elm_Widget_Item *item_to_search_from, const char *part_name, const char *pattern, Elm_Glob_Match_Flags flags) +{ + return elm_obj_gengrid_search_by_text_item_get(obj, item_to_search_from, part_name, pattern, flags); +} + +EAPI void +elm_gengrid_reorder_mode_start(Elm_Gengrid *obj, Ecore_Pos_Map tween_mode) +{ + elm_obj_gengrid_reorder_mode_start(obj, tween_mode); +} + +EAPI void +elm_gengrid_reorder_mode_stop(Elm_Gengrid *obj) +{ + elm_obj_gengrid_reorder_mode_stop(obj); +} diff --git a/src/lib/elementary/elm_gengrid_eo.legacy.h b/src/lib/elementary/elm_gengrid_eo.legacy.h new file mode 100644 index 0000000000..b454ac0653 --- /dev/null +++ b/src/lib/elementary/elm_gengrid_eo.legacy.h @@ -0,0 +1,627 @@ +#ifndef _ELM_GENGRID_EO_LEGACY_H_ +#define _ELM_GENGRID_EO_LEGACY_H_ + +#ifndef _ELM_GENGRID_EO_CLASS_TYPE +#define _ELM_GENGRID_EO_CLASS_TYPE + +typedef Eo Elm_Gengrid; + +#endif + +#ifndef _ELM_GENGRID_EO_TYPES +#define _ELM_GENGRID_EO_TYPES + +/** Gengrid reorder modes + * + * @ingroup Elm_Gengrid + */ +typedef enum +{ + ELM_GENGRID_REORDER_TYPE_NORMAL = 0, /**< Normal reorder type */ + ELM_GENGRID_REORDER_TYPE_SWAP /**< Swap reorder type */ +} Elm_Gengrid_Reorder_Type; + + +#endif + +/** + * @brief Set the items grid's alignment within a given gengrid widget. + * + * This sets the alignment of the whole grid of items of a gengrid within its + * given viewport. By default, those values are both 0.5, meaning that the + * gengrid will have its items grid placed exactly in the middle of its + * viewport. + * + * @note If given alignment values are out of the cited ranges, they'll be + * changed to the nearest boundary values on the valid ranges. + * + * @param[in] obj The object. + * @param[in] align_x Alignment in the horizontal axis (0 <= align_x <= 1). + * @param[in] align_y Alignment in the vertical axis (0 <= align_y <= 1). + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_align_set(Elm_Gengrid *obj, double align_x, double align_y); + +/** + * @brief Get the items grid's alignment values within a given gengrid widget. + * + * @note Use @c null pointers on the alignment values you're not interested in: + * they'll be ignored by the function. + * + * @param[in] obj The object. + * @param[out] align_x Alignment in the horizontal axis (0 <= align_x <= 1). + * @param[out] align_y Alignment in the vertical axis (0 <= align_y <= 1). + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_align_get(const Elm_Gengrid *obj, double *align_x, double *align_y); + +/** + * @brief Set how the items grid's filled within a given gengrid widget + * + * This sets the fill state of the whole grid of items of a gengrid within its + * given viewport. By default, this value is false, meaning that if the first + * line of items grid's isn't filled, the items are centered with the + * alignment. + * + * @param[in] obj The object. + * @param[in] fill @c true if the grid is filled, @c false otherwise + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_filled_set(Elm_Gengrid *obj, Eina_Bool fill); + +/** + * @brief Get how the items grid's filled within a given gengrid widget + * + * @note Use @c null pointers on the alignment values you're not interested in: + * they'll be ignored by the function. + * + * @param[in] obj The object. + * + * @return @c true if the grid is filled, @c false otherwise + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Eina_Bool elm_gengrid_filled_get(const Elm_Gengrid *obj); + +/** + * @brief Enable or disable multi-selection in a given gengrid widget. + * + * Multi-selection is the ability to have more than one item selected, on a + * given gengrid, simultaneously. When it is enabled, a sequence of clicks on + * different items will make them all selected, progressively. A click on an + * already selected item will unselect it. If interacting via the keyboard, + * multi-selection is enabled while holding the "Shift" key. + * + * @note By default, multi-selection is disabled on gengrids. + * + * @param[in] obj The object. + * @param[in] multi @c true if multislect is enabled, @c false otherwise + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_multi_select_set(Elm_Gengrid *obj, Eina_Bool multi); + +/** + * @brief Get whether multi-selection is enabled or disabled for a given + * gengrid widget. + * + * @param[in] obj The object. + * + * @return @c true if multislect is enabled, @c false otherwise + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Eina_Bool elm_gengrid_multi_select_get(const Elm_Gengrid *obj); + +/** + * @brief Set the size for the group items of a given gengrid widget. + * + * A gengrid, after creation, has still no information on the size to give to + * each of its cells. So, you most probably will end up with squares one @ref + * Fingers "finger" wide, the default size. Use this function to force a custom + * size for you group items, making them as big as you wish. + * + * @param[in] obj The object. + * @param[in] w The group items' width. + * @param[in] h The group items' height. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_group_item_size_set(Elm_Gengrid *obj, int w, int h); + +/** + * @brief Get the size set for the group items of a given gengrid widget. + * + * @note Use @c null pointers on the size values you're not interested in: + * they'll be ignored by the function. + * + * @param[in] obj The object. + * @param[out] w The group items' width. + * @param[out] h The group items' height. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_group_item_size_get(const Elm_Gengrid *obj, int *w, int *h); + +/** + * @brief Set the gengrid select mode. + * + * This changes item select mode in the gengrid widget. + * #ELM_OBJECT_SELECT_MODE_DEFAULT means that items will only call their + * selection func and callback when first becoming selected. Any further clicks + * will do nothing, unless you set always select mode. + * #ELM_OBJECT_SELECT_MODE_ALWAYS means that even if selected, every click will + * make the selected callbacks be called. #ELM_OBJECT_SELECT_MODE_NONE will + * turn off the ability to select items entirely and they will neither appear + * selected nor call selected callback functions. + * + * @param[in] obj The object. + * @param[in] mode The select mode. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_select_mode_set(Elm_Gengrid *obj, Elm_Object_Select_Mode mode); + +/** + * @brief Get the gengrid select mode. + * + * @param[in] obj The object. + * + * @return The select mode. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Elm_Object_Select_Mode elm_gengrid_select_mode_get(const Elm_Gengrid *obj); + +/** + * @brief Set whether a given gengrid widget is or not able have items + * reordered. + * + * If a gengrid is set to allow reordering, a click held for more than 0.5 over + * a given item will highlight it specially, signaling the gengrid has entered + * the reordering state. From that time on, the user will be able to, while + * still holding the mouse button down, move the item freely in the gengrid's + * viewport, replacing to said item to the locations it goes to. The + * replacements will be animated and, whenever the user releases the mouse + * button, the item being replaced gets a new definitive place in the grid. + * + * @param[in] obj The object. + * @param[in] reorder_mode Use @c true to turn reordering on, @c false to turn + * it off. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_reorder_mode_set(Elm_Gengrid *obj, Eina_Bool reorder_mode); + +/** + * @brief Get whether a given gengrid widget is or not able have items + * reordered. + * + * @param[in] obj The object. + * + * @return Use @c true to turn reordering on, @c false to turn it off. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Eina_Bool elm_gengrid_reorder_mode_get(const Elm_Gengrid *obj); + +/** + * @brief Control whether the gengrid items' should be highlighted when item + * selected. + * + * @param[in] obj The object. + * @param[in] highlight @c true if item will be highlighted, @c false otherwise + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_highlight_mode_set(Elm_Gengrid *obj, Eina_Bool highlight); + +/** + * @brief Control whether the gengrid items' should be highlighted when item + * selected. + * + * @param[in] obj The object. + * + * @return @c true if item will be highlighted, @c false otherwise + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Eina_Bool elm_gengrid_highlight_mode_get(const Elm_Gengrid *obj); + +/** + * @brief Set the Gengrid reorder type + * + * @param[in] obj The object. + * @param[in] type Reorder type value + * + * @since 1.11 + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_reorder_type_set(Elm_Gengrid *obj, Elm_Gengrid_Reorder_Type type); + +/** + * @brief Set the size for the items of a given gengrid widget. + * + * A gengrid, after creation, has still no information on the size to give to + * each of its cells. So, you most probably will end up with squares one @ref + * Fingers "finger" wide, the default size. Use this function to force a custom + * size for you items, making them as big as you wish. + * + * @param[in] obj The object. + * @param[in] w The items' width. + * @param[in] h The items' height. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_item_size_set(Elm_Gengrid *obj, int w, int h); + +/** + * @brief Get the size set for the items of a given gengrid widget. + * + * @note Use @c null pointers on the size values you're not interested in: + * they'll be ignored by the function. + * + * @param[in] obj The object. + * @param[out] w The items' width. + * @param[out] h The items' height. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_item_size_get(const Elm_Gengrid *obj, int *w, int *h); + +/** + * @brief Set the gengrid multi select mode. + * + * #ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT means that select/unselect items + * whenever each item is clicked. #ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL + * means that only one item will be selected although multi-selection is + * enabled, if clicked without pressing control key. This mode is only + * available with multi-selection. + * + * @param[in] obj The object. + * @param[in] mode The multi select mode. + * + * @since 1.8 + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_multi_select_mode_set(Elm_Gengrid *obj, Elm_Object_Multi_Select_Mode mode); + +/** + * @brief Get the gengrid multi select mode. + * + * If getting mode fails, it returns #ELM_OBJECT_MULTI_SELECT_MODE_MAX. + * + * @param[in] obj The object. + * + * @return The multi select mode. + * + * @since 1.8 + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Elm_Object_Multi_Select_Mode elm_gengrid_multi_select_mode_get(const Elm_Gengrid *obj); + +/** + * @brief Set the direction in which a given gengrid widget will expand while + * placing its items. + * + * When in "horizontal mode" ($true), items will be placed in columns, from top + * to bottom and, when the space for a column is filled, another one is started + * on the right, thus expanding the grid horizontally. When in "vertical mode" + * ($false), though, items will be placed in rows, from left to right and, when + * the space for a row is filled, another one is started below, thus expanding + * the grid vertically. + * + * @note By default, gengrid is in vertical mode, @c false. + * + * @param[in] obj The object. + * @param[in] horizontal @c true to make the gengrid expand horizontally, + * @c false to expand vertically. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_horizontal_set(Elm_Gengrid *obj, Eina_Bool horizontal); + +/** + * @brief Get for what direction a given gengrid widget will expand while + * placing its items. + * + * @param[in] obj The object. + * + * @return @c true to make the gengrid expand horizontally, @c false to expand + * vertically. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Eina_Bool elm_gengrid_horizontal_get(const Elm_Gengrid *obj); + +/** + * @brief Get the selected item in a given gengrid widget. + * + * This returns the selected item in @c obj. If multi selection is enabled on + * @c obj (See @ref elm_gengrid_multi_select_set), only the first item in the + * list is selected, which might not be very useful. For that case, see + * @ref elm_gengrid_selected_items_get. + * + * @param[in] obj The object. + * + * @return The selected item's handle or @c null if none is selected at the + * moment (and on errors). + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Elm_Widget_Item *elm_gengrid_selected_item_get(const Elm_Gengrid *obj); + +/** + * @brief Get a list of realized items in gengrid. + * + * This returns a list of the realized items in the gengrid. The list contains + * gengrid item pointers. The list must be freed by the caller when done with + * eina_list_free(). The item pointers in the list are only valid so long as + * those items are not deleted or the gengrid is not deleted. + * + * @param[in] obj The object. + * + * @return The list of realized items or @c null if none are realized. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Eina_List *elm_gengrid_realized_items_get(const Elm_Gengrid *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get the first item in a given gengrid widget. + * + * This returns the first item in the @c obj's internal list of items. + * + * @param[in] obj The object. + * + * @return The first item's handle or @c null, if there are no items in @c obj + * (and on errors) + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Elm_Widget_Item *elm_gengrid_first_item_get(const Elm_Gengrid *obj); + +/** + * @brief Get a list of selected items in a given gengrid. + * + * This returns a list of the selected items, in the order that they appear in + * the grid. This list is only valid as long as no more items are selected or + * unselected (or unselected implicitly by deletion). The list contains Gengrid + * item pointers as data, naturally. + * + * @param[in] obj The object. + * + * @return The list of selected items or @c null, if none is selected at the + * moment (and on errors). + * + * @ingroup Elm_Gengrid_Group + */ +EAPI const Eina_List *elm_gengrid_selected_items_get(const Elm_Gengrid *obj); + +/** + * @brief Get the last item in a given gengrid widget. + * + * This returns the last item in the @c obj's internal list of items. + * + * @param[in] obj The object. + * + * @return The last item's handle or @c null if there are no items in @c obj + * (and on errors). + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Elm_Widget_Item *elm_gengrid_last_item_get(const Elm_Gengrid *obj); + +/** + * @brief Insert an item before another in a gengrid widget. + * + * This inserts an item before another in the gengrid. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] relative The item to place this new one before. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data to be passed to @c func. + * + * @return A handle to the item added or @c null on errors. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Elm_Widget_Item *elm_gengrid_item_insert_before(Elm_Gengrid *obj, const Elm_Gengrid_Item_Class *itc, const void *data, Elm_Widget_Item *relative, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Update the contents of all realized items. + * + * This updates all realized items by calling all the item class functions + * again to get the contents, texts and states. Use this when the original item + * data has changed and the changes are desired to be reflected. + * + * To update just one item, use @ref elm_gengrid_item_update. + * @param[in] obj The object. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_realized_items_update(Elm_Gengrid *obj); + +/** + * @brief Insert an item after another in a gengrid widget. + * + * This inserts an item after another in the gengrid. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] relative The item to place this new one after. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data to be passed to @c func. + * + * @return A handle to the item added or @c null on error. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Elm_Widget_Item *elm_gengrid_item_insert_after(Elm_Gengrid *obj, const Elm_Gengrid_Item_Class *itc, const void *data, Elm_Widget_Item *relative, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Return how many items are currently in a list + * + * This behavior is O(1) and includes items which may or may not be realized. + * + * @param[in] obj The object. + * + * @return Items in list + * + * @ingroup Elm_Gengrid_Group + */ +EAPI unsigned int elm_gengrid_items_count(const Elm_Gengrid *obj); + +/** + * @brief Get the item that is at the x, y canvas coords. + * + * This returns the item at the given coordinates (which are canvas relative, + * not object-relative). If an item is at that coordinate, that item handle is + * returned, and if @c xposret is not @c null, the integer pointed to is set to + * a value of -1, 0 or 1, depending if the coordinate is on the left portion of + * that item (-1), on the middle section (0) or on the right part (1). + * + * If @c yposret is not @c null, the integer pointed to is set to a value of + * -1, 0 or 1, depending if the coordinate is on the upper portion of that item + * (-1), on the middle section (0) or on the lower part (1). If NULL is + * returned as an item (no item found there), then posret may indicate -1 or 1 + * based if the coordinate is above or below all items respectively in the + * gengrid. + * + * @param[in] obj The object. + * @param[in] x The input x coordinate. + * @param[in] y The input y coordinate. + * @param[out] xposret The position relative to the item returned here. + * @param[out] yposret The position relative to the item returned here. + * + * @return The item at the coordinates or @c null if none. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Elm_Widget_Item *elm_gengrid_at_xy_item_get(const Elm_Gengrid *obj, int x, int y, int *xposret, int *yposret); + +/** + * @brief Append a new item in a given gengrid widget. + * + * This adds an item to the beginning of the gengrid. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data to be passed to @c func. + * + * @return A handle to the item added or @c null on errors. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Elm_Widget_Item *elm_gengrid_item_append(Elm_Gengrid *obj, const Elm_Gengrid_Item_Class *itc, const void *data, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Prepend a new item in a given gengrid widget. + * + * This adds an item to the end of the gengrid. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data to be passed to @c func. + * + * @return A handle to the item added or @c null on errors. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Elm_Widget_Item *elm_gengrid_item_prepend(Elm_Gengrid *obj, const Elm_Gengrid_Item_Class *itc, const void *data, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Remove all items from a given gengrid widget. + * + * This removes (and deletes) all items in @c obj, leaving it empty. + * + * See @ref elm_gengrid_item_del to remove just one item. + * @param[in] obj The object. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_clear(Elm_Gengrid *obj); + +/** + * @brief Insert an item in a gengrid widget using a user-defined sort + * function. + * + * This inserts an item in the gengrid based on user defined comparison + * function. The two arguments passed to the function @c func are gengrid item + * handles to compare. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] comp User defined comparison function that defines the sort order + * based on gengrid item and its data. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data to be passed to @c func. + * + * @return A handle to the item added or @c null on errors. + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Elm_Widget_Item *elm_gengrid_item_sorted_insert(Elm_Gengrid *obj, const Elm_Gengrid_Item_Class *itc, const void *data, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Get gengrid item by given string. + * + * It takes pointer to the gengrid item that will be used to start search from + * it. + * + * This function uses globs (like "*.jpg") for searching and takes search flags + * as last parameter That is a bitfield with values to be ored together or 0 + * for no flags. + * + * @param[in] obj The object. + * @param[in] item_to_search_from Pointer to item to start search from. If + * @c null, search will be started from the first item of the gengrid. + * @param[in] part_name Name of the TEXT part of gengrid item to search string + * in. If @c null, search by "elm.text" parts. + * @param[in] pattern The search pattern. + * @param[in] flags Search flags. + * + * @return Pointer to the gengrid item which matches search_string in case of + * success, otherwise @c null. + * + * @since 1.11 + * + * @ingroup Elm_Gengrid_Group + */ +EAPI Elm_Widget_Item *elm_gengrid_search_by_text_item_get(Elm_Gengrid *obj, Elm_Widget_Item *item_to_search_from, const char *part_name, const char *pattern, Elm_Glob_Match_Flags flags); + +/** + * @brief Starts the reorder mode of Gengrid + * + * @param[in] obj The object. + * @param[in] tween_mode Position mappings for animation + * + * @since 1.10 + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_reorder_mode_start(Elm_Gengrid *obj, Ecore_Pos_Map tween_mode); + +/** Stops the reorder mode of Gengrid + * + * @since 1.10 + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_reorder_mode_stop(Elm_Gengrid *obj); + +#endif diff --git a/src/lib/elementary/elm_gengrid_item.eo b/src/lib/elementary/elm_gengrid_item.eo deleted file mode 100644 index e4f01c1952..0000000000 --- a/src/lib/elementary/elm_gengrid_item.eo +++ /dev/null @@ -1,236 +0,0 @@ -import elm_general; - -class Elm.Gengrid.Item extends Elm.Widget.Item.Static_Focus implements Efl.Ui.Focus.Object, Efl.Ui.Legacy -{ - [[Elementary gengrid item class]] - legacy_prefix: elm_gengrid_item; - eo_prefix: elm_obj_gengrid_item; - data: Elm_Gen_Item; - methods { - @property prev { - get { - [[Get the previous item in a gengrid widget's internal list of items, given a handle to one of those items. - - This returns the item placed before the $item, on the container - gengrid.]] - } - values { - item: Elm.Widget.Item; [[The item before $item, or $NULL if there's none (and on errors)]] - } - } - @property next { - get { - [[Get the next item in a gengrid widget's internal list of items, - given a handle to one of those items. - - This returns the item placed after the $item, on the container - gengrid.]] - } - values { - item: Elm.Widget.Item; [[The item after $item, or $NULL if there's none (and on errors)]] - } - } - @property selected { - [[Control whether a given gengrid item is selected or not - - This API returns true for all the items selected in multi-select mode as well. - - This sets the selected state of an item. If multi-selection is - not enabled on the containing gengrid and $selected is - true, any other previously selected items will get - unselected in favor of this new one.]] - get { - } - set { - } - values { - selected: bool; [[The selected state ($true selected, $false not selected)]] - } - } - @property item_class { - get { - [[Get the Gengrid Item class for the given Gengrid Item. - - This returns the Gengrid_Item_Class for the given item. It can be used to examine - the function pointers and item_style.]] - } - values { - @cref itc: Elm.Gengrid.Item.Class; [[Gengrid Item class for the given item]] - } - } - @property index { - get { - [[Get the index of the item. It is only valid once displayed.]] - } - values { - index: int(-1); [[The position inside the list of item.]] - } - } - @property pos { - get { - [[Get a given gengrid item's position, relative to the whole gengrid's grid area. - - This returns the "logical" position of the item within the - gengrid. For example, $(0, 1) would stand for first row, - second column.]] - } - values { - x: uint; [[Pointer to variable to store the item's row number.]] - y: uint; [[Pointer to variable to store the item's column number.]] - } - } - @property select_mode { - [[Control the gengrid item's select mode. - - (If getting mode fails, it returns ELM_OBJECT_SELECT_MODE_MAX) - - elm_gengrid_select_mode_set() changes item's select mode. - - ELM_OBJECT_SELECT_MODE_DEFAULT : The item will only call their selection func and - callback when first becoming selected. Any further clicks will - do nothing, unless you set always select mode. - - ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected, - every click will make the selected callbacks be called. - - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select the item - entirely and they will neither appear selected nor call selected - callback functions. - - ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY : This will apply no-finger-size rule - with ELM_OBJECT_SELECT_MODE_NONE. No-finger-size rule makes an item can be - smaller than lower limit. Clickable objects should be bigger than - human touch point device (your finger) for some touch or - small screen devices. So it is enabled, the item can be shrink than - predefined finger-size value. And the item will be updated.]] - get { - } - set { - } - values { - mode: Elm.Object.Select_Mode(Elm.Object.Select_Mode.max); [[The selected mode]] - } - } - @property custom_size { - [[Custom size mode for non-homogeneous gengrid. ]] - get { - [[Get the dimensions of a gengrid item. - - Gives the dimensions set with elm_gengrid_item_custom_size_set(). If the item - has not been modified values set with elm_gengrid_item_size_set() are obtained. - - @since 1.19]] - } - set { - [[Resize dimensions of a gengrid item. - - In case of a horizontal grid, only the widths only be resized and - in case of vertical only the heights can be resized. Item size - should be set by elm_gengrid_item_size_set() beforehand. - - The values set by elm_gengrid_item_size_set() will be used for the - dimension that remains fixed. - - @since 1.19]] - } - values { - w : int; [[The item's width.]] - h : int; [[The item's height.]] - } - } - /* init { FIXME - params { - Evas_Smart_Cb func; - const(void_ptr) data; - } - }*/ - show { - [[Show the portion of a gengrid's internal grid containing a given - item, immediately. - - This causes gengrid to redraw its viewport's contents to the - region containing the given $item item, if it is not fully - visible.]] - params { - @in type: Elm.Gengrid.Item.Scrollto_Type; [[Where to position the item in the viewport.]] - } - } - bring_in { - [[Animatedly bring in, to the visible area of a gengrid, a given item on it. - - This causes gengrid to jump to the given $item and show - it (by scrolling), if it is not fully visible. This will use - animation to do so and take a period of time to complete.]] - params { - @in type: Elm.Gengrid.Item.Scrollto_Type; [[Where to position the item in the viewport.]] - } - } - update { - [[Update the contents of a given gengrid item - - This updates an item by calling all the item class functions - again to get the contents, texts and states. Use this when the - original item data has changed and you want the changes to be - reflected.]] - } - fields_update { - [[Update the part of an item - - This updates an item's part by calling item's fetching functions again - to get the contents, texts and states. Use this when the original - item data has changed and the changes are desired to be reflected. - Second parts argument is used for globbing to match '*', '?', and '.' - It can be used at updating multi fields. - - Use elm_gengrid_realized_items_update() to update an item's all - property. - - @since 1.15]] - params { - @in parts: string; [[The name of item's part]] - @in itf: Elm.Gengrid.Item.Field_Type; [[The type of item's part type]] - } - } - item_class_update { - [[Update the item class of a gengrid item. - - This sets another class of the item, changing the way that it is - displayed. After changing the item class, elm_gengrid_item_update() is - called on the item $it.]] - params { - @cref itc: Elm.Gengrid.Item.Class; [[The gengrid item class describing the function pointers and the item style.]] - } - } - all_contents_unset{ - - [[Unset all contents fetched by the item class - - This instructs gengrid to release references to contents in the item, - meaning that they will no longer be managed by gengrid and are - floating "orphans" that can be re-used elsewhere if the user wants - to. - - @since 1.18 - ]] - params { - @out l: list @owned; [[The contents list to return.]] - } - } - } - implements { - Efl.Object.constructor; - Elm.Widget.Item.del_pre; - Elm.Widget.Item.disable; - Elm.Widget.Item.signal_emit; - 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; - Elm.Widget.Item.tooltip_style { get; set; } - Elm.Widget.Item.tooltip_window_mode { get; set; } - Elm.Widget.Item.tooltip_content_cb_set; - Elm.Widget.Item.tooltip_unset; - Elm.Widget.Item.cursor { set; } - Elm.Widget.Item.cursor_unset; - Efl.Access.Object.i18n_name { get; } - Efl.Access.Object.state_set { get; } - Efl.Ui.Focus.Object.prepare_logical_none_recursive; - Efl.Ui.Focus.Object.focus_parent { get; } - } -} diff --git a/src/lib/elementary/elm_gengrid_item_eo.c b/src/lib/elementary/elm_gengrid_item_eo.c new file mode 100644 index 0000000000..2fc58db983 --- /dev/null +++ b/src/lib/elementary/elm_gengrid_item_eo.c @@ -0,0 +1,243 @@ + +Elm_Widget_Item *_elm_gengrid_item_prev_get(const Eo *obj, Elm_Gen_Item *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_item_prev_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_gengrid_item_next_get(const Eo *obj, Elm_Gen_Item *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_item_next_get, Elm_Widget_Item *, NULL); + +void _elm_gengrid_item_selected_set(Eo *obj, Elm_Gen_Item *pd, Eina_Bool selected); + + +static Eina_Error +__eolian_elm_gengrid_item_selected_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_gengrid_item_selected_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_item_selected_set, EFL_FUNC_CALL(selected), Eina_Bool selected); + +Eina_Bool _elm_gengrid_item_selected_get(const Eo *obj, Elm_Gen_Item *pd); + + +static Eina_Value +__eolian_elm_gengrid_item_selected_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_gengrid_item_selected_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_item_selected_get, Eina_Bool, 0); + +const Elm_Gengrid_Item_Class *_elm_gengrid_item_item_class_get(const Eo *obj, Elm_Gen_Item *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_item_class_get, const Elm_Gengrid_Item_Class *, NULL); + +int _elm_gengrid_item_index_get(const Eo *obj, Elm_Gen_Item *pd); + + +static Eina_Value +__eolian_elm_gengrid_item_index_get_reflect(const Eo *obj) +{ + int val = elm_obj_gengrid_item_index_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_item_index_get, int, -1 /* +1 */); + +void _elm_gengrid_item_pos_get(const Eo *obj, Elm_Gen_Item *pd, unsigned int *x, unsigned int *y); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_gengrid_item_pos_get, EFL_FUNC_CALL(x, y), unsigned int *x, unsigned int *y); + +void _elm_gengrid_item_select_mode_set(Eo *obj, Elm_Gen_Item *pd, Elm_Object_Select_Mode mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_item_select_mode_set, EFL_FUNC_CALL(mode), Elm_Object_Select_Mode mode); + +Elm_Object_Select_Mode _elm_gengrid_item_select_mode_get(const Eo *obj, Elm_Gen_Item *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_item_select_mode_get, Elm_Object_Select_Mode, 4 /* Elm.Object.Select_Mode.max */); + +void _elm_gengrid_item_custom_size_set(Eo *obj, Elm_Gen_Item *pd, int w, int h); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_item_custom_size_set, EFL_FUNC_CALL(w, h), int w, int h); + +void _elm_gengrid_item_custom_size_get(const Eo *obj, Elm_Gen_Item *pd, int *w, int *h); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_gengrid_item_custom_size_get, EFL_FUNC_CALL(w, h), int *w, int *h); + +void _elm_gengrid_item_show(Eo *obj, Elm_Gen_Item *pd, Elm_Gengrid_Item_Scrollto_Type type); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_item_show, EFL_FUNC_CALL(type), Elm_Gengrid_Item_Scrollto_Type type); + +void _elm_gengrid_item_bring_in(Eo *obj, Elm_Gen_Item *pd, Elm_Gengrid_Item_Scrollto_Type type); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_item_bring_in, EFL_FUNC_CALL(type), Elm_Gengrid_Item_Scrollto_Type type); + +void _elm_gengrid_item_update(Eo *obj, Elm_Gen_Item *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_gengrid_item_update); + +void _elm_gengrid_item_fields_update(Eo *obj, Elm_Gen_Item *pd, const char *parts, Elm_Gengrid_Item_Field_Type itf); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_item_fields_update, EFL_FUNC_CALL(parts, itf), const char *parts, Elm_Gengrid_Item_Field_Type itf); + +void _elm_gengrid_item_item_class_update(Eo *obj, Elm_Gen_Item *pd, const Elm_Gengrid_Item_Class *itc); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_item_class_update, EFL_FUNC_CALL(itc), const Elm_Gengrid_Item_Class *itc); + +void _elm_gengrid_item_all_contents_unset(Eo *obj, Elm_Gen_Item *pd, Eina_List **l); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_item_all_contents_unset, EFL_FUNC_CALL(l), Eina_List **l); + +Efl_Object *_elm_gengrid_item_efl_object_constructor(Eo *obj, Elm_Gen_Item *pd); + + +void _elm_gengrid_item_elm_widget_item_del_pre(Eo *obj, Elm_Gen_Item *pd); + + +void _elm_gengrid_item_elm_widget_item_disable(Eo *obj, Elm_Gen_Item *pd); + + +void _elm_gengrid_item_elm_widget_item_signal_emit(Eo *obj, Elm_Gen_Item *pd, const char *emission, const char *source); + + +void _elm_gengrid_item_elm_widget_item_item_focus_set(Eo *obj, Elm_Gen_Item *pd, Eina_Bool focused); + + +Eina_Bool _elm_gengrid_item_elm_widget_item_item_focus_get(const Eo *obj, Elm_Gen_Item *pd); + + +const char *_elm_gengrid_item_elm_widget_item_part_text_get(const Eo *obj, Elm_Gen_Item *pd, const char *part); + + +Efl_Canvas_Object *_elm_gengrid_item_elm_widget_item_part_content_get(const Eo *obj, Elm_Gen_Item *pd, const char *part); + + +void _elm_gengrid_item_elm_widget_item_tooltip_text_set(Eo *obj, Elm_Gen_Item *pd, const char *text); + + +void _elm_gengrid_item_elm_widget_item_tooltip_style_set(Eo *obj, Elm_Gen_Item *pd, const char *style); + + +const char *_elm_gengrid_item_elm_widget_item_tooltip_style_get(const Eo *obj, Elm_Gen_Item *pd); + + +Eina_Bool _elm_gengrid_item_elm_widget_item_tooltip_window_mode_set(Eo *obj, Elm_Gen_Item *pd, Eina_Bool disable); + + +Eina_Bool _elm_gengrid_item_elm_widget_item_tooltip_window_mode_get(const Eo *obj, Elm_Gen_Item *pd); + + +void _elm_gengrid_item_elm_widget_item_tooltip_content_cb_set(Eo *obj, Elm_Gen_Item *pd, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb); + + +void _elm_gengrid_item_elm_widget_item_tooltip_unset(Eo *obj, Elm_Gen_Item *pd); + + +void _elm_gengrid_item_elm_widget_item_cursor_set(Eo *obj, Elm_Gen_Item *pd, const char *cursor); + + +void _elm_gengrid_item_elm_widget_item_cursor_unset(Eo *obj, Elm_Gen_Item *pd); + + +const char *_elm_gengrid_item_efl_access_object_i18n_name_get(const Eo *obj, Elm_Gen_Item *pd); + + +Efl_Access_State_Set _elm_gengrid_item_efl_access_object_state_set_get(const Eo *obj, Elm_Gen_Item *pd); + + +void _elm_gengrid_item_efl_ui_focus_object_setup_order_non_recursive(Eo *obj, Elm_Gen_Item *pd); + + +Efl_Ui_Focus_Object *_elm_gengrid_item_efl_ui_focus_object_focus_parent_get(const Eo *obj, Elm_Gen_Item *pd); + + +static Eina_Bool +_elm_gengrid_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_GENGRID_ITEM_EXTRA_OPS +#define ELM_GENGRID_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_prev_get, _elm_gengrid_item_prev_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_next_get, _elm_gengrid_item_next_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_selected_set, _elm_gengrid_item_selected_set), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_selected_get, _elm_gengrid_item_selected_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_class_get, _elm_gengrid_item_item_class_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_index_get, _elm_gengrid_item_index_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_pos_get, _elm_gengrid_item_pos_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_select_mode_set, _elm_gengrid_item_select_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_select_mode_get, _elm_gengrid_item_select_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_custom_size_set, _elm_gengrid_item_custom_size_set), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_custom_size_get, _elm_gengrid_item_custom_size_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_show, _elm_gengrid_item_show), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_bring_in, _elm_gengrid_item_bring_in), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_update, _elm_gengrid_item_update), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_fields_update, _elm_gengrid_item_fields_update), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_class_update, _elm_gengrid_item_item_class_update), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_item_all_contents_unset, _elm_gengrid_item_all_contents_unset), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_gengrid_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(elm_wdg_item_del_pre, _elm_gengrid_item_elm_widget_item_del_pre), + EFL_OBJECT_OP_FUNC(elm_wdg_item_disable, _elm_gengrid_item_elm_widget_item_disable), + EFL_OBJECT_OP_FUNC(elm_wdg_item_signal_emit, _elm_gengrid_item_elm_widget_item_signal_emit), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_set, _elm_gengrid_item_elm_widget_item_item_focus_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_get, _elm_gengrid_item_elm_widget_item_item_focus_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_get, _elm_gengrid_item_elm_widget_item_part_text_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_get, _elm_gengrid_item_elm_widget_item_part_content_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_text_set, _elm_gengrid_item_elm_widget_item_tooltip_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_style_set, _elm_gengrid_item_elm_widget_item_tooltip_style_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_style_get, _elm_gengrid_item_elm_widget_item_tooltip_style_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_window_mode_set, _elm_gengrid_item_elm_widget_item_tooltip_window_mode_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_window_mode_get, _elm_gengrid_item_elm_widget_item_tooltip_window_mode_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_content_cb_set, _elm_gengrid_item_elm_widget_item_tooltip_content_cb_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_unset, _elm_gengrid_item_elm_widget_item_tooltip_unset), + EFL_OBJECT_OP_FUNC(elm_wdg_item_cursor_set, _elm_gengrid_item_elm_widget_item_cursor_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_cursor_unset, _elm_gengrid_item_elm_widget_item_cursor_unset), + EFL_OBJECT_OP_FUNC(efl_access_object_i18n_name_get, _elm_gengrid_item_efl_access_object_i18n_name_get), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_gengrid_item_efl_access_object_state_set_get), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_setup_order_non_recursive, _elm_gengrid_item_efl_ui_focus_object_setup_order_non_recursive), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_focus_parent_get, _elm_gengrid_item_efl_ui_focus_object_focus_parent_get), + ELM_GENGRID_ITEM_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"selected", __eolian_elm_gengrid_item_selected_set_reflect, __eolian_elm_gengrid_item_selected_get_reflect}, + {"index", NULL, __eolian_elm_gengrid_item_index_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_gengrid_item_class_desc = { + EO_VERSION, + "Elm.Gengrid.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Gen_Item), + _elm_gengrid_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_gengrid_item_class_get, &_elm_gengrid_item_class_desc, ELM_WIDGET_ITEM_STATIC_FOCUS_CLASS, EFL_UI_FOCUS_OBJECT_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_gengrid_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_gengrid_item_eo.h b/src/lib/elementary/elm_gengrid_item_eo.h new file mode 100644 index 0000000000..b11d264b81 --- /dev/null +++ b/src/lib/elementary/elm_gengrid_item_eo.h @@ -0,0 +1,315 @@ +#ifndef _ELM_GENGRID_ITEM_EO_H_ +#define _ELM_GENGRID_ITEM_EO_H_ + +#ifndef _ELM_GENGRID_ITEM_EO_CLASS_TYPE +#define _ELM_GENGRID_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Gengrid_Item; + +#endif + +#ifndef _ELM_GENGRID_ITEM_EO_TYPES +#define _ELM_GENGRID_ITEM_EO_TYPES + + +#endif +/** Elementary gengrid item class + * + * @ingroup Elm_Gengrid_Item + */ +#define ELM_GENGRID_ITEM_CLASS elm_gengrid_item_class_get() + +EWAPI const Efl_Class *elm_gengrid_item_class_get(void); + +/** + * @brief Get the previous item in a gengrid widget's internal list of items, + * given a handle to one of those items. + * + * This returns the item placed before the @c item, on the container gengrid. + * + * @param[in] obj The object. + * + * @return The item before @c item, or @c NULL if there's none (and on errors) + * + * @ingroup Elm_Gengrid_Item + */ +EOAPI Elm_Widget_Item *elm_obj_gengrid_item_prev_get(const Eo *obj); + +/** + * @brief Get the next item in a gengrid widget's internal list of items, given + * a handle to one of those items. + * + * This returns the item placed after the @c item, on the container gengrid. + * + * @param[in] obj The object. + * + * @return The item after @c item, or @c NULL if there's none (and on errors) + * + * @ingroup Elm_Gengrid_Item + */ +EOAPI Elm_Widget_Item *elm_obj_gengrid_item_next_get(const Eo *obj); + +/** + * @brief Control whether a given gengrid item is selected or not + * + * This API returns true for all the items selected in multi-select mode as + * well. + * + * This sets the selected state of an item. If multi-selection is not enabled + * on the containing gengrid and @c selected is true, any other previously + * selected items will get unselected in favor of this new one. + * + * @param[in] obj The object. + * @param[in] selected The selected state ($true selected, @c false not + * selected) + * + * @ingroup Elm_Gengrid_Item + */ +EOAPI void elm_obj_gengrid_item_selected_set(Eo *obj, Eina_Bool selected); + +/** + * @brief Control whether a given gengrid item is selected or not + * + * This API returns true for all the items selected in multi-select mode as + * well. + * + * This sets the selected state of an item. If multi-selection is not enabled + * on the containing gengrid and @c selected is true, any other previously + * selected items will get unselected in favor of this new one. + * + * @param[in] obj The object. + * + * @return The selected state ($true selected, @c false not selected) + * + * @ingroup Elm_Gengrid_Item + */ +EOAPI Eina_Bool elm_obj_gengrid_item_selected_get(const Eo *obj); + +/** + * @brief Get the Gengrid Item class for the given Gengrid Item. + * + * This returns the Gengrid_Item_Class for the given item. It can be used to + * examine the function pointers and item_style. + * + * @param[in] obj The object. + * + * @return Gengrid Item class for the given item + * + * @ingroup Elm_Gengrid_Item + */ +EOAPI const Elm_Gengrid_Item_Class *elm_obj_gengrid_item_class_get(const Eo *obj); + +/** + * @brief Get the index of the item. It is only valid once displayed. + * + * @param[in] obj The object. + * + * @return The position inside the list of item. + * + * @ingroup Elm_Gengrid_Item + */ +EOAPI int elm_obj_gengrid_item_index_get(const Eo *obj); + +/** + * @brief Get a given gengrid item's position, relative to the whole gengrid's + * grid area. + * + * This returns the "logical" position of the item within the gengrid. For + * example, $(0, 1) would stand for first row, second column. + * + * @param[in] obj The object. + * @param[out] x Pointer to variable to store the item's row number. + * @param[out] y Pointer to variable to store the item's column number. + * + * @ingroup Elm_Gengrid_Item + */ +EOAPI void elm_obj_gengrid_item_pos_get(const Eo *obj, unsigned int *x, unsigned int *y); + +/** + * @brief Control the gengrid item's select mode. + * + * (If getting mode fails, it returns ELM_OBJECT_SELECT_MODE_MAX) + * + * elm_gengrid_select_mode_set() changes item's select mode. - + * ELM_OBJECT_SELECT_MODE_DEFAULT : The item will only call their selection + * func and callback when first becoming selected. Any further clicks will do + * nothing, unless you set always select mode. - ELM_OBJECT_SELECT_MODE_ALWAYS + * : This means that, even if selected, every click will make the selected + * callbacks be called. - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the + * ability to select the item entirely and they will neither appear selected + * nor call selected callback functions. - ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY + * : This will apply no-finger-size rule with ELM_OBJECT_SELECT_MODE_NONE. + * No-finger-size rule makes an item can be smaller than lower limit. Clickable + * objects should be bigger than human touch point device (your finger) for + * some touch or small screen devices. So it is enabled, the item can be shrink + * than predefined finger-size value. And the item will be updated. + * + * @param[in] obj The object. + * @param[in] mode The selected mode + * + * @ingroup Elm_Gengrid_Item + */ +EOAPI void elm_obj_gengrid_item_select_mode_set(Eo *obj, Elm_Object_Select_Mode mode); + +/** + * @brief Control the gengrid item's select mode. + * + * (If getting mode fails, it returns ELM_OBJECT_SELECT_MODE_MAX) + * + * elm_gengrid_select_mode_set() changes item's select mode. - + * ELM_OBJECT_SELECT_MODE_DEFAULT : The item will only call their selection + * func and callback when first becoming selected. Any further clicks will do + * nothing, unless you set always select mode. - ELM_OBJECT_SELECT_MODE_ALWAYS + * : This means that, even if selected, every click will make the selected + * callbacks be called. - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the + * ability to select the item entirely and they will neither appear selected + * nor call selected callback functions. - ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY + * : This will apply no-finger-size rule with ELM_OBJECT_SELECT_MODE_NONE. + * No-finger-size rule makes an item can be smaller than lower limit. Clickable + * objects should be bigger than human touch point device (your finger) for + * some touch or small screen devices. So it is enabled, the item can be shrink + * than predefined finger-size value. And the item will be updated. + * + * @param[in] obj The object. + * + * @return The selected mode + * + * @ingroup Elm_Gengrid_Item + */ +EOAPI Elm_Object_Select_Mode elm_obj_gengrid_item_select_mode_get(const Eo *obj); + +/** + * @brief Custom size mode for non-homogeneous gengrid. + * + * Resize dimensions of a gengrid item. + * + * In case of a horizontal grid, only the widths only be resized and in case of + * vertical only the heights can be resized. Item size should be set by + * elm_gengrid_item_size_set() beforehand. + * + * The values set by elm_gengrid_item_size_set() will be used for the dimension + * that remains fixed. + * + * @param[in] obj The object. + * @param[in] w The item's width. + * @param[in] h The item's height. + * + * @since 1.19 + * + * @ingroup Elm_Gengrid_Item + */ +EOAPI void elm_obj_gengrid_item_custom_size_set(Eo *obj, int w, int h); + +/** + * @brief Custom size mode for non-homogeneous gengrid. + * + * Get the dimensions of a gengrid item. + * + * Gives the dimensions set with elm_gengrid_item_custom_size_set(). If the + * item has not been modified values set with elm_gengrid_item_size_set() are + * obtained. + * + * @param[in] obj The object. + * @param[out] w The item's width. + * @param[out] h The item's height. + * + * @since 1.19 + * + * @ingroup Elm_Gengrid_Item + */ +EOAPI void elm_obj_gengrid_item_custom_size_get(const Eo *obj, int *w, int *h); + +/** + * @brief Show the portion of a gengrid's internal grid containing a given + * item, immediately. + * + * This causes gengrid to redraw its viewport's contents to the region + * containing the given @c item item, if it is not fully visible. + * + * @param[in] obj The object. + * @param[in] type Where to position the item in the viewport. + * + * @ingroup Elm_Gengrid_Item + */ +EOAPI void elm_obj_gengrid_item_show(Eo *obj, Elm_Gengrid_Item_Scrollto_Type type); + +/** + * @brief Animatedly bring in, to the visible area of a gengrid, a given item + * on it. + * + * This causes gengrid to jump to the given @c item and show it (by scrolling), + * if it is not fully visible. This will use animation to do so and take a + * period of time to complete. + * + * @param[in] obj The object. + * @param[in] type Where to position the item in the viewport. + * + * @ingroup Elm_Gengrid_Item + */ +EOAPI void elm_obj_gengrid_item_bring_in(Eo *obj, Elm_Gengrid_Item_Scrollto_Type type); + +/** + * @brief Update the contents of a given gengrid item + * + * This updates an item by calling all the item class functions again to get + * the contents, texts and states. Use this when the original item data has + * changed and you want the changes to be reflected. + * @param[in] obj The object. + * + * @ingroup Elm_Gengrid_Item + */ +EOAPI void elm_obj_gengrid_item_update(Eo *obj); + +/** + * @brief Update the part of an item + * + * This updates an item's part by calling item's fetching functions again to + * get the contents, texts and states. Use this when the original item data has + * changed and the changes are desired to be reflected. Second parts argument + * is used for globbing to match '*', '?', and '.' It can be used at updating + * multi fields. + * + * Use elm_gengrid_realized_items_update() to update an item's all property. + * + * @param[in] obj The object. + * @param[in] parts The name of item's part + * @param[in] itf The type of item's part type + * + * @since 1.15 + * + * @ingroup Elm_Gengrid_Item + */ +EOAPI void elm_obj_gengrid_item_fields_update(Eo *obj, const char *parts, Elm_Gengrid_Item_Field_Type itf); + +/** + * @brief Update the item class of a gengrid item. + * + * This sets another class of the item, changing the way that it is displayed. + * After changing the item class, elm_gengrid_item_update() is called on the + * item @c it. + * + * @param[in] obj The object. + * @param[in] itc The gengrid item class describing the function pointers and + * the item style. + * + * @ingroup Elm_Gengrid_Item + */ +EOAPI void elm_obj_gengrid_item_class_update(Eo *obj, const Elm_Gengrid_Item_Class *itc); + +/** + * @brief Unset all contents fetched by the item class + * + * This instructs gengrid to release references to contents in the item, + * meaning that they will no longer be managed by gengrid and are floating + * "orphans" that can be re-used elsewhere if the user wants to. + * + * @param[in] obj The object. + * @param[out] l The contents list to return. + * + * @since 1.18 + * + * @ingroup Elm_Gengrid_Item + */ +EOAPI void elm_obj_gengrid_item_all_contents_unset(Eo *obj, Eina_List **l); + +#endif diff --git a/src/lib/elementary/elm_gengrid_item_eo.legacy.c b/src/lib/elementary/elm_gengrid_item_eo.legacy.c new file mode 100644 index 0000000000..5464dedb9f --- /dev/null +++ b/src/lib/elementary/elm_gengrid_item_eo.legacy.c @@ -0,0 +1,102 @@ + +EAPI Elm_Widget_Item * +elm_gengrid_item_prev_get(const Elm_Gengrid_Item *obj) +{ + return elm_obj_gengrid_item_prev_get(obj); +} + +EAPI Elm_Widget_Item * +elm_gengrid_item_next_get(const Elm_Gengrid_Item *obj) +{ + return elm_obj_gengrid_item_next_get(obj); +} + +EAPI void +elm_gengrid_item_selected_set(Elm_Gengrid_Item *obj, Eina_Bool selected) +{ + elm_obj_gengrid_item_selected_set(obj, selected); +} + +EAPI Eina_Bool +elm_gengrid_item_selected_get(const Elm_Gengrid_Item *obj) +{ + return elm_obj_gengrid_item_selected_get(obj); +} + +EAPI const Elm_Gengrid_Item_Class * +elm_gengrid_item_item_class_get(const Elm_Gengrid_Item *obj) +{ + return elm_obj_gengrid_item_class_get(obj); +} + +EAPI int +elm_gengrid_item_index_get(const Elm_Gengrid_Item *obj) +{ + return elm_obj_gengrid_item_index_get(obj); +} + +EAPI void +elm_gengrid_item_pos_get(const Elm_Gengrid_Item *obj, unsigned int *x, unsigned int *y) +{ + elm_obj_gengrid_item_pos_get(obj, x, y); +} + +EAPI void +elm_gengrid_item_select_mode_set(Elm_Gengrid_Item *obj, Elm_Object_Select_Mode mode) +{ + elm_obj_gengrid_item_select_mode_set(obj, mode); +} + +EAPI Elm_Object_Select_Mode +elm_gengrid_item_select_mode_get(const Elm_Gengrid_Item *obj) +{ + return elm_obj_gengrid_item_select_mode_get(obj); +} + +EAPI void +elm_gengrid_item_custom_size_set(Elm_Gengrid_Item *obj, int w, int h) +{ + elm_obj_gengrid_item_custom_size_set(obj, w, h); +} + +EAPI void +elm_gengrid_item_custom_size_get(const Elm_Gengrid_Item *obj, int *w, int *h) +{ + elm_obj_gengrid_item_custom_size_get(obj, w, h); +} + +EAPI void +elm_gengrid_item_show(Elm_Gengrid_Item *obj, Elm_Gengrid_Item_Scrollto_Type type) +{ + elm_obj_gengrid_item_show(obj, type); +} + +EAPI void +elm_gengrid_item_bring_in(Elm_Gengrid_Item *obj, Elm_Gengrid_Item_Scrollto_Type type) +{ + elm_obj_gengrid_item_bring_in(obj, type); +} + +EAPI void +elm_gengrid_item_update(Elm_Gengrid_Item *obj) +{ + elm_obj_gengrid_item_update(obj); +} + +EAPI void +elm_gengrid_item_fields_update(Elm_Gengrid_Item *obj, const char *parts, Elm_Gengrid_Item_Field_Type itf) +{ + elm_obj_gengrid_item_fields_update(obj, parts, itf); +} + +EAPI void +elm_gengrid_item_item_class_update(Elm_Gengrid_Item *obj, const Elm_Gengrid_Item_Class *itc) +{ + elm_obj_gengrid_item_class_update(obj, itc); +} + +EAPI void +elm_gengrid_item_all_contents_unset(Elm_Gengrid_Item *obj, Eina_List **l) +{ + elm_obj_gengrid_item_all_contents_unset(obj, l); +} diff --git a/src/lib/elementary/elm_gengrid_item_eo.legacy.h b/src/lib/elementary/elm_gengrid_item_eo.legacy.h new file mode 100644 index 0000000000..01f1a634db --- /dev/null +++ b/src/lib/elementary/elm_gengrid_item_eo.legacy.h @@ -0,0 +1,308 @@ +#ifndef _ELM_GENGRID_ITEM_EO_LEGACY_H_ +#define _ELM_GENGRID_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_GENGRID_ITEM_EO_CLASS_TYPE +#define _ELM_GENGRID_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Gengrid_Item; + +#endif + +#ifndef _ELM_GENGRID_ITEM_EO_TYPES +#define _ELM_GENGRID_ITEM_EO_TYPES + + +#endif + +/** + * @brief Get the previous item in a gengrid widget's internal list of items, + * given a handle to one of those items. + * + * This returns the item placed before the @c item, on the container gengrid. + * + * @param[in] obj The object. + * + * @return The item before @c item, or @c NULL if there's none (and on errors) + * + * @ingroup Elm_Gengrid_Item_Group + */ +EAPI Elm_Widget_Item *elm_gengrid_item_prev_get(const Elm_Gengrid_Item *obj); + +/** + * @brief Get the next item in a gengrid widget's internal list of items, given + * a handle to one of those items. + * + * This returns the item placed after the @c item, on the container gengrid. + * + * @param[in] obj The object. + * + * @return The item after @c item, or @c NULL if there's none (and on errors) + * + * @ingroup Elm_Gengrid_Item_Group + */ +EAPI Elm_Widget_Item *elm_gengrid_item_next_get(const Elm_Gengrid_Item *obj); + +/** + * @brief Control whether a given gengrid item is selected or not + * + * This API returns true for all the items selected in multi-select mode as + * well. + * + * This sets the selected state of an item. If multi-selection is not enabled + * on the containing gengrid and @c selected is true, any other previously + * selected items will get unselected in favor of this new one. + * + * @param[in] obj The object. + * @param[in] selected The selected state ($true selected, @c false not + * selected) + * + * @ingroup Elm_Gengrid_Item_Group + */ +EAPI void elm_gengrid_item_selected_set(Elm_Gengrid_Item *obj, Eina_Bool selected); + +/** + * @brief Control whether a given gengrid item is selected or not + * + * This API returns true for all the items selected in multi-select mode as + * well. + * + * This sets the selected state of an item. If multi-selection is not enabled + * on the containing gengrid and @c selected is true, any other previously + * selected items will get unselected in favor of this new one. + * + * @param[in] obj The object. + * + * @return The selected state ($true selected, @c false not selected) + * + * @ingroup Elm_Gengrid_Item_Group + */ +EAPI Eina_Bool elm_gengrid_item_selected_get(const Elm_Gengrid_Item *obj); + +/** + * @brief Get the Gengrid Item class for the given Gengrid Item. + * + * This returns the Gengrid_Item_Class for the given item. It can be used to + * examine the function pointers and item_style. + * + * @param[in] obj The object. + * + * @return Gengrid Item class for the given item + * + * @ingroup Elm_Gengrid_Item_Group + */ +EAPI const Elm_Gengrid_Item_Class *elm_gengrid_item_item_class_get(const Elm_Gengrid_Item *obj); + +/** + * @brief Get the index of the item. It is only valid once displayed. + * + * @param[in] obj The object. + * + * @return The position inside the list of item. + * + * @ingroup Elm_Gengrid_Item_Group + */ +EAPI int elm_gengrid_item_index_get(const Elm_Gengrid_Item *obj); + +/** + * @brief Get a given gengrid item's position, relative to the whole gengrid's + * grid area. + * + * This returns the "logical" position of the item within the gengrid. For + * example, $(0, 1) would stand for first row, second column. + * + * @param[in] obj The object. + * @param[out] x Pointer to variable to store the item's row number. + * @param[out] y Pointer to variable to store the item's column number. + * + * @ingroup Elm_Gengrid_Item_Group + */ +EAPI void elm_gengrid_item_pos_get(const Elm_Gengrid_Item *obj, unsigned int *x, unsigned int *y); + +/** + * @brief Control the gengrid item's select mode. + * + * (If getting mode fails, it returns ELM_OBJECT_SELECT_MODE_MAX) + * + * elm_gengrid_select_mode_set() changes item's select mode. - + * ELM_OBJECT_SELECT_MODE_DEFAULT : The item will only call their selection + * func and callback when first becoming selected. Any further clicks will do + * nothing, unless you set always select mode. - ELM_OBJECT_SELECT_MODE_ALWAYS + * : This means that, even if selected, every click will make the selected + * callbacks be called. - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the + * ability to select the item entirely and they will neither appear selected + * nor call selected callback functions. - ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY + * : This will apply no-finger-size rule with ELM_OBJECT_SELECT_MODE_NONE. + * No-finger-size rule makes an item can be smaller than lower limit. Clickable + * objects should be bigger than human touch point device (your finger) for + * some touch or small screen devices. So it is enabled, the item can be shrink + * than predefined finger-size value. And the item will be updated. + * + * @param[in] obj The object. + * @param[in] mode The selected mode + * + * @ingroup Elm_Gengrid_Item_Group + */ +EAPI void elm_gengrid_item_select_mode_set(Elm_Gengrid_Item *obj, Elm_Object_Select_Mode mode); + +/** + * @brief Control the gengrid item's select mode. + * + * (If getting mode fails, it returns ELM_OBJECT_SELECT_MODE_MAX) + * + * elm_gengrid_select_mode_set() changes item's select mode. - + * ELM_OBJECT_SELECT_MODE_DEFAULT : The item will only call their selection + * func and callback when first becoming selected. Any further clicks will do + * nothing, unless you set always select mode. - ELM_OBJECT_SELECT_MODE_ALWAYS + * : This means that, even if selected, every click will make the selected + * callbacks be called. - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the + * ability to select the item entirely and they will neither appear selected + * nor call selected callback functions. - ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY + * : This will apply no-finger-size rule with ELM_OBJECT_SELECT_MODE_NONE. + * No-finger-size rule makes an item can be smaller than lower limit. Clickable + * objects should be bigger than human touch point device (your finger) for + * some touch or small screen devices. So it is enabled, the item can be shrink + * than predefined finger-size value. And the item will be updated. + * + * @param[in] obj The object. + * + * @return The selected mode + * + * @ingroup Elm_Gengrid_Item_Group + */ +EAPI Elm_Object_Select_Mode elm_gengrid_item_select_mode_get(const Elm_Gengrid_Item *obj); + +/** + * @brief Custom size mode for non-homogeneous gengrid. + * + * Resize dimensions of a gengrid item. + * + * In case of a horizontal grid, only the widths only be resized and in case of + * vertical only the heights can be resized. Item size should be set by + * elm_gengrid_item_size_set() beforehand. + * + * The values set by elm_gengrid_item_size_set() will be used for the dimension + * that remains fixed. + * + * @param[in] obj The object. + * @param[in] w The item's width. + * @param[in] h The item's height. + * + * @since 1.19 + * + * @ingroup Elm_Gengrid_Item_Group + */ +EAPI void elm_gengrid_item_custom_size_set(Elm_Gengrid_Item *obj, int w, int h); + +/** + * @brief Custom size mode for non-homogeneous gengrid. + * + * Get the dimensions of a gengrid item. + * + * Gives the dimensions set with elm_gengrid_item_custom_size_set(). If the + * item has not been modified values set with elm_gengrid_item_size_set() are + * obtained. + * + * @param[in] obj The object. + * @param[out] w The item's width. + * @param[out] h The item's height. + * + * @since 1.19 + * + * @ingroup Elm_Gengrid_Item_Group + */ +EAPI void elm_gengrid_item_custom_size_get(const Elm_Gengrid_Item *obj, int *w, int *h); + +/** + * @brief Show the portion of a gengrid's internal grid containing a given + * item, immediately. + * + * This causes gengrid to redraw its viewport's contents to the region + * containing the given @c item item, if it is not fully visible. + * + * @param[in] obj The object. + * @param[in] type Where to position the item in the viewport. + * + * @ingroup Elm_Gengrid_Item_Group + */ +EAPI void elm_gengrid_item_show(Elm_Gengrid_Item *obj, Elm_Gengrid_Item_Scrollto_Type type); + +/** + * @brief Animatedly bring in, to the visible area of a gengrid, a given item + * on it. + * + * This causes gengrid to jump to the given @c item and show it (by scrolling), + * if it is not fully visible. This will use animation to do so and take a + * period of time to complete. + * + * @param[in] obj The object. + * @param[in] type Where to position the item in the viewport. + * + * @ingroup Elm_Gengrid_Item_Group + */ +EAPI void elm_gengrid_item_bring_in(Elm_Gengrid_Item *obj, Elm_Gengrid_Item_Scrollto_Type type); + +/** + * @brief Update the contents of a given gengrid item + * + * This updates an item by calling all the item class functions again to get + * the contents, texts and states. Use this when the original item data has + * changed and you want the changes to be reflected. + * @param[in] obj The object. + * + * @ingroup Elm_Gengrid_Item_Group + */ +EAPI void elm_gengrid_item_update(Elm_Gengrid_Item *obj); + +/** + * @brief Update the part of an item + * + * This updates an item's part by calling item's fetching functions again to + * get the contents, texts and states. Use this when the original item data has + * changed and the changes are desired to be reflected. Second parts argument + * is used for globbing to match '*', '?', and '.' It can be used at updating + * multi fields. + * + * Use elm_gengrid_realized_items_update() to update an item's all property. + * + * @param[in] obj The object. + * @param[in] parts The name of item's part + * @param[in] itf The type of item's part type + * + * @since 1.15 + * + * @ingroup Elm_Gengrid_Item_Group + */ +EAPI void elm_gengrid_item_fields_update(Elm_Gengrid_Item *obj, const char *parts, Elm_Gengrid_Item_Field_Type itf); + +/** + * @brief Update the item class of a gengrid item. + * + * This sets another class of the item, changing the way that it is displayed. + * After changing the item class, elm_gengrid_item_update() is called on the + * item @c it. + * + * @param[in] obj The object. + * @param[in] itc The gengrid item class describing the function pointers and + * the item style. + * + * @ingroup Elm_Gengrid_Item_Group + */ +EAPI void elm_gengrid_item_item_class_update(Elm_Gengrid_Item *obj, const Elm_Gengrid_Item_Class *itc); + +/** + * @brief Unset all contents fetched by the item class + * + * This instructs gengrid to release references to contents in the item, + * meaning that they will no longer be managed by gengrid and are floating + * "orphans" that can be re-used elsewhere if the user wants to. + * + * @param[in] obj The object. + * @param[out] l The contents list to return. + * + * @since 1.18 + * + * @ingroup Elm_Gengrid_Item_Group + */ +EAPI void elm_gengrid_item_all_contents_unset(Elm_Gengrid_Item *obj, Eina_List **l); + +#endif diff --git a/src/lib/elementary/elm_gengrid_legacy.h b/src/lib/elementary/elm_gengrid_legacy.h index 0b30cb51a7..720563b896 100644 --- a/src/lib/elementary/elm_gengrid_legacy.h +++ b/src/lib/elementary/elm_gengrid_legacy.h @@ -275,5 +275,5 @@ EAPI void elm_gengrid_wheel_disabled_set(Evas_Object *obj, Eina_Bool disabled); */ 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" +#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 deleted file mode 100644 index a6ceeed60d..0000000000 --- a/src/lib/elementary/elm_gengrid_pan.eo +++ /dev/null @@ -1,18 +0,0 @@ -class Elm.Gengrid.Pan extends Elm.Pan -{ - [[Elementary gengrid pan class]] - legacy_prefix: elm_gengrid_pan; - eo_prefix: elm_obj_gengrid_pan; - event_prefix: elm_gengrid_pan; - implements { - class.constructor; - Efl.Object.destructor; - 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; } - Elm.Pan.pos_min { get; } - Elm.Pan.pos_max { get; } - } -} diff --git a/src/lib/elementary/elm_gengrid_pan_eo.c b/src/lib/elementary/elm_gengrid_pan_eo.c new file mode 100644 index 0000000000..f4b6e77892 --- /dev/null +++ b/src/lib/elementary/elm_gengrid_pan_eo.c @@ -0,0 +1,67 @@ + +void _elm_gengrid_pan_efl_object_destructor(Eo *obj, Elm_Gengrid_Pan_Data *pd); + + +void _elm_gengrid_pan_efl_gfx_entity_position_set(Eo *obj, Elm_Gengrid_Pan_Data *pd, Eina_Position2D pos); + + +void _elm_gengrid_pan_efl_gfx_entity_size_set(Eo *obj, Elm_Gengrid_Pan_Data *pd, Eina_Size2D size); + + +void _elm_gengrid_pan_efl_canvas_group_group_calculate(Eo *obj, Elm_Gengrid_Pan_Data *pd); + + +void _elm_gengrid_pan_elm_pan_content_size_get(const Eo *obj, Elm_Gengrid_Pan_Data *pd, int *w, int *h); + + +void _elm_gengrid_pan_elm_pan_pos_set(Eo *obj, Elm_Gengrid_Pan_Data *pd, int x, int y); + + +void _elm_gengrid_pan_elm_pan_pos_get(const Eo *obj, Elm_Gengrid_Pan_Data *pd, int *x, int *y); + + +void _elm_gengrid_pan_elm_pan_pos_min_get(const Eo *obj, Elm_Gengrid_Pan_Data *pd, int *x, int *y); + + +void _elm_gengrid_pan_elm_pan_pos_max_get(const Eo *obj, Elm_Gengrid_Pan_Data *pd, int *x, int *y); + + +static Eina_Bool +_elm_gengrid_pan_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_GENGRID_PAN_EXTRA_OPS +#define ELM_GENGRID_PAN_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_gengrid_pan_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_gengrid_pan_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_gengrid_pan_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _elm_gengrid_pan_efl_canvas_group_group_calculate), + EFL_OBJECT_OP_FUNC(elm_obj_pan_content_size_get, _elm_gengrid_pan_elm_pan_content_size_get), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_set, _elm_gengrid_pan_elm_pan_pos_set), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_get, _elm_gengrid_pan_elm_pan_pos_get), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_min_get, _elm_gengrid_pan_elm_pan_pos_min_get), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_max_get, _elm_gengrid_pan_elm_pan_pos_max_get), + ELM_GENGRID_PAN_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_gengrid_pan_class_desc = { + EO_VERSION, + "Elm.Gengrid.Pan", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Gengrid_Pan_Data), + _elm_gengrid_pan_class_initializer, + _elm_gengrid_pan_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_gengrid_pan_class_get, &_elm_gengrid_pan_class_desc, ELM_PAN_CLASS, NULL); diff --git a/src/lib/elementary/elm_gengrid_pan_eo.h b/src/lib/elementary/elm_gengrid_pan_eo.h new file mode 100644 index 0000000000..277f40676d --- /dev/null +++ b/src/lib/elementary/elm_gengrid_pan_eo.h @@ -0,0 +1,24 @@ +#ifndef _ELM_GENGRID_PAN_EO_H_ +#define _ELM_GENGRID_PAN_EO_H_ + +#ifndef _ELM_GENGRID_PAN_EO_CLASS_TYPE +#define _ELM_GENGRID_PAN_EO_CLASS_TYPE + +typedef Eo Elm_Gengrid_Pan; + +#endif + +#ifndef _ELM_GENGRID_PAN_EO_TYPES +#define _ELM_GENGRID_PAN_EO_TYPES + + +#endif +/** Elementary gengrid pan class + * + * @ingroup Elm_Gengrid_Pan + */ +#define ELM_GENGRID_PAN_CLASS elm_gengrid_pan_class_get() + +EWAPI const Efl_Class *elm_gengrid_pan_class_get(void); + +#endif diff --git a/src/lib/elementary/elm_gengrid_pan_eo.legacy.h b/src/lib/elementary/elm_gengrid_pan_eo.legacy.h new file mode 100644 index 0000000000..1e417d503f --- /dev/null +++ b/src/lib/elementary/elm_gengrid_pan_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_GENGRID_PAN_EO_LEGACY_H_ +#define _ELM_GENGRID_PAN_EO_LEGACY_H_ + +#ifndef _ELM_GENGRID_PAN_EO_CLASS_TYPE +#define _ELM_GENGRID_PAN_EO_CLASS_TYPE + +typedef Eo Elm_Gengrid_Pan; + +#endif + +#ifndef _ELM_GENGRID_PAN_EO_TYPES +#define _ELM_GENGRID_PAN_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c index 76d168c195..0a893b72d0 100644 --- a/src/lib/elementary/elm_genlist.c +++ b/src/lib/elementary/elm_genlist.c @@ -16,11 +16,12 @@ #include "elm_priv.h" #include "elm_widget_genlist.h" #include "elm_interface_scrollable.h" -#include "efl_ui_focus_parent_provider_gen.eo.h" +#include "elm_pan_eo.h" +#include "efl_ui_focus_parent_provider_gen_eo.h" #include "efl_ui_focus_composition_adapter.eo.h" -#include "elm_genlist_item.eo.h" -#include "elm_genlist_pan.eo.h" -#include "elm_genlist.eo.h" +#include "elm_genlist_item_eo.h" +#include "elm_genlist_pan_eo.h" +#include "elm_genlist_eo.h" #define MY_PAN_CLASS ELM_GENLIST_PAN_CLASS @@ -456,7 +457,7 @@ _item_content_realize(Elm_Gen_Item *it, 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_BASE_CLASS) elm_layout_sizing_eval(content); _widget_calculate_recursive(content); @@ -566,10 +567,10 @@ _view_style_update(Elm_Gen_Item *it, Evas_Object *view, const char *style) "",style ? : "default"); } - Efl_Ui_Theme_Apply_Result th_ret = + Eina_Error th_ret = elm_widget_theme_object_set(WIDGET(it), view, "genlist", buf, elm_widget_style_get(WIDGET(it))); - if (th_ret == EFL_UI_THEME_APPLY_RESULT_FAIL) + if (th_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) { ERR("%s is not a valid genlist item style. " "Automatically falls back into default style.", @@ -1598,6 +1599,7 @@ _item_cache_add(Elm_Gen_Item *it, Eina_List *contents) Item_Cache *itc = NULL; ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); Evas_Object *obj = sd->obj; + Evas_Object *win = efl_provider_find(obj, EFL_UI_WIN_CLASS); Evas *e = evas_object_evas_get(obj); evas_event_freeze(e); @@ -1629,7 +1631,7 @@ _item_cache_add(Elm_Gen_Item *it, Eina_List *contents) if (elm_wdg_item_disabled_get(EO_OBJ(it))) edje_object_signal_emit(itc->base_view, SIGNAL_ENABLED, "elm"); if ((EO_OBJ(it) == sd->focused_item) && - (elm_widget_focus_highlight_enabled_get(obj) || _elm_config->win_auto_focus_enable)) + (elm_win_focus_highlight_enabled_get(win) || _elm_config->win_auto_focus_enable)) edje_object_signal_emit(itc->base_view, SIGNAL_UNFOCUSED, "elm"); ELM_SAFE_FREE(it->long_timer, ecore_timer_del); @@ -1807,9 +1809,10 @@ _elm_genlist_item_focus_update(Elm_Gen_Item *it) { const char *focus_raise; Evas_Object *obj = WIDGET(it); + Evas_Object *win = efl_provider_find(obj, EFL_UI_WIN_CLASS); ELM_GENLIST_DATA_GET(obj, sd); - if (elm_widget_focus_highlight_enabled_get(obj) + if (elm_win_focus_highlight_enabled_get(win) || _elm_config->win_auto_focus_enable) edje_object_signal_emit(VIEW(it), SIGNAL_FOCUSED, "elm"); @@ -2577,7 +2580,7 @@ _elm_genlist_tree_effect_setup(Elm_Genlist_Data *sd) evas_object_stack_below(sd->event_block_rect, sd->stack[1]); evas_object_show(sd->event_block_rect); sd->start_time = ecore_time_get(); - efl_event_callback_add(sd->obj, EFL_EVENT_ANIMATOR_TICK, _tree_effect_animator_cb, sd->obj); + efl_event_callback_add(sd->obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _tree_effect_animator_cb, sd->obj); sd->tree_effect_animator = 1; return EINA_TRUE; } @@ -2590,7 +2593,7 @@ _elm_genlist_tree_effect_stop(Elm_Genlist_Data *sd) if (sd->tree_effect_animator) { sd->tree_effect_animator = 0; - efl_event_callback_del(sd->obj, EFL_EVENT_ANIMATOR_TICK, _tree_effect_animator_cb, sd->obj); + efl_event_callback_del(sd->obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _tree_effect_animator_cb, sd->obj); } } @@ -2894,7 +2897,7 @@ _elm_genlist_item_focused(Elm_Object_Item *eo_it) _elm_genlist_item_focus_update(it); efl_event_callback_legacy_call(obj, ELM_GENLIST_EVENT_ITEM_FOCUSED, eo_it); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_FOCUSED, EINA_TRUE); + efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_TYPE_FOCUSED, EINA_TRUE); } static void @@ -2904,6 +2907,7 @@ _elm_genlist_item_unfocused(Elm_Object_Item *eo_it) ELM_GENLIST_ITEM_DATA_GET(eo_it, it); Evas_Object *obj = WIDGET(it); + Evas_Object *win = efl_provider_find(obj, EFL_UI_WIN_CLASS); ELM_GENLIST_DATA_GET(obj, sd); if (_is_no_select(it)) @@ -2913,7 +2917,7 @@ _elm_genlist_item_unfocused(Elm_Object_Item *eo_it) (eo_it != sd->focused_item)) return; - if (elm_widget_focus_highlight_enabled_get(obj)) + if (elm_win_focus_highlight_enabled_get(win)) { ELM_GENLIST_ITEM_DATA_GET(sd->focused_item, focus_it); edje_object_signal_emit(VIEW(focus_it), SIGNAL_UNFOCUSED, "elm"); @@ -2922,7 +2926,7 @@ _elm_genlist_item_unfocused(Elm_Object_Item *eo_it) sd->focused_item = NULL; efl_event_callback_legacy_call(obj, ELM_GENLIST_EVENT_ITEM_UNFOCUSED, eo_it); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_FOCUSED, EINA_FALSE); + efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_TYPE_FOCUSED, EINA_FALSE); } static Eina_Bool @@ -3530,17 +3534,17 @@ _mirrored_set(Evas_Object *obj, efl_ui_mirrored_set(obj, rtl); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_genlist_efl_ui_widget_theme_apply(Eo *obj, Elm_Genlist_Data *sd) { Item_Block *itb; - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; Eina_List *l; Elm_Gen_Item *it; Evas *e; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; e = evas_object_evas_get(obj); evas_event_freeze(e); @@ -3927,10 +3931,10 @@ _item_unselect(Elm_Gen_Item *it) it->selected = EINA_FALSE; sd->selected = eina_list_remove(sd->selected, EO_OBJ(it)); - efl_event_callback_legacy_call - (WIDGET(it), EFL_UI_EVENT_UNSELECTED, EO_OBJ(it)); + evas_object_smart_callback_call + (WIDGET(it), "unselected", EO_OBJ(it)); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(EO_OBJ(it), EFL_ACCESS_STATE_SELECTED, EINA_FALSE); + efl_access_state_changed_signal_emit(EO_OBJ(it), EFL_ACCESS_STATE_TYPE_SELECTED, EINA_FALSE); } static void @@ -4151,7 +4155,7 @@ _long_press_cb(void *data) { edje_object_signal_emit(VIEW(it), SIGNAL_REORDER_ENABLED, "elm"); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(EO_OBJ(it), EFL_ACCESS_STATE_ANIMATED, EINA_TRUE); + efl_access_state_changed_signal_emit(EO_OBJ(it), EFL_ACCESS_STATE_TYPE_ANIMATED, EINA_TRUE); } } @@ -5131,7 +5135,7 @@ _item_mouse_up_cb(void *data, } edje_object_signal_emit(VIEW(it), SIGNAL_REORDER_DISABLED, "elm"); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(EO_OBJ(it), EFL_ACCESS_STATE_ANIMATED, EINA_FALSE); + efl_access_state_changed_signal_emit(EO_OBJ(it), EFL_ACCESS_STATE_TYPE_ANIMATED, EINA_FALSE); sd->reorder_it = sd->reorder_rel = NULL; elm_interface_scrollable_hold_set(sd->obj, EINA_FALSE); elm_interface_scrollable_bounce_allow_set @@ -5778,7 +5782,6 @@ _elm_genlist_efl_canvas_group_group_add(Eo *obj, Elm_Genlist_Data *priv) int i; efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->size_caches = eina_hash_pointer_new(_size_cache_free); priv->hit_rect = evas_object_rectangle_add(e); @@ -5990,7 +5993,7 @@ _elm_genlist_efl_object_constructor(Eo *obj, Elm_Genlist_Data *sd) evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_LIST); - efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED, _genlist_element_focused, obj); + efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _genlist_element_focused, obj); return obj; } @@ -6112,9 +6115,9 @@ _item_select(Elm_Gen_Item *it) if (it->func.func) it->func.func((void *)it->func.data, WIDGET(it), eo_it); // delete item if it's requested deletion in the above callbacks. if ((it->base)->on_deletion) goto item_deleted; - efl_event_callback_legacy_call(WIDGET(it), EFL_UI_EVENT_SELECTED, eo_it); + evas_object_smart_callback_call(WIDGET(it), "selected", eo_it); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_SELECTED, EINA_TRUE); + efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_TYPE_SELECTED, EINA_TRUE); // delete item if it's requested deletion in the above callbacks. if ((it->base)->on_deletion) { @@ -7200,7 +7203,7 @@ _elm_genlist_item_expanded_set(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it, Eina_B (WIDGET(it), ELM_GENLIST_EVENT_EXPANDED, EO_OBJ(it)); sd->auto_scroll_enabled = EINA_TRUE; if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(eo_item, EFL_ACCESS_STATE_EXPANDED, EINA_TRUE); + efl_access_state_changed_signal_emit(eo_item, EFL_ACCESS_STATE_TYPE_EXPANDED, EINA_TRUE); } else { @@ -7210,7 +7213,7 @@ _elm_genlist_item_expanded_set(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it, Eina_B (WIDGET(it), ELM_GENLIST_EVENT_CONTRACTED, EO_OBJ(it)); sd->auto_scroll_enabled = EINA_FALSE; if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(eo_item, EFL_ACCESS_STATE_EXPANDED, EINA_FALSE); + efl_access_state_changed_signal_emit(eo_item, EFL_ACCESS_STATE_TYPE_EXPANDED, EINA_FALSE); } } @@ -7644,7 +7647,7 @@ _elm_genlist_item_elm_widget_item_tooltip_window_mode_set(Eo *eo_it, Elm_Gen_Ite return ret; } - return EINA_TRUE; + return disable; } EAPI Eina_Bool @@ -8528,16 +8531,16 @@ _elm_genlist_item_efl_access_object_state_set_get(const Eo *eo_it, Elm_Gen_Item sel = elm_obj_genlist_item_selected_get(eo_it); - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_SELECTABLE); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_SELECTABLE); if (sel) - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_SELECTED); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_SELECTED); if (elm_genlist_item_type_get(eo_it) == ELM_GENLIST_ITEM_TREE) { - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_EXPANDABLE); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_EXPANDABLE); if (elm_genlist_item_expanded_get(eo_it)) - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_EXPANDED); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_EXPANDED); } return ret; @@ -8721,7 +8724,7 @@ _elm_genlist_search_by_text_item_get(Eo *obj EINA_UNUSED, } EOLIAN static Elm_Object_Item* -_elm_genlist_efl_ui_widget_focused_item_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd) +_elm_genlist_elm_widget_item_container_focused_item_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd) { return sd->focused_item; } @@ -8790,13 +8793,13 @@ _elm_genlist_efl_access_object_state_set_get(const Eo *obj, Elm_Genlist_Data *sd ret = efl_access_object_state_set_get(efl_super(obj, ELM_GENLIST_CLASS)); - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_MANAGES_DESCENDANTS); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_MANAGES_DESCENDANTS); if (elm_genlist_multi_select_get(obj)) - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_MULTISELECTABLE); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_MULTISELECTABLE); if (elm_genlist_reorder_mode_get(obj)) - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_ANIMATED); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_ANIMATED); return ret; } @@ -8910,7 +8913,7 @@ _elm_genlist_efl_object_provider_find(const Eo *obj, Elm_Genlist_Data *pd, const } EOLIAN static void -_elm_genlist_item_efl_ui_focus_object_prepare_logical_none_recursive(Eo *obj, Elm_Gen_Item *pd) +_elm_genlist_item_efl_ui_focus_object_setup_order_non_recursive(Eo *obj, Elm_Gen_Item *pd) { Eina_List *n; Efl_Ui_Widget *wid; @@ -8921,7 +8924,7 @@ _elm_genlist_item_efl_ui_focus_object_prepare_logical_none_recursive(Eo *obj, El _elm_widget_full_eval(wid); } - efl_ui_focus_object_prepare_logical_none_recursive(efl_super(obj, ELM_GENLIST_ITEM_CLASS)); + efl_ui_focus_object_setup_order_non_recursive(efl_super(obj, ELM_GENLIST_ITEM_CLASS)); } EOLIAN static Eina_Bool @@ -8950,6 +8953,6 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_genlist, Elm_Genlist_Data) #define ELM_GENLIST_PAN_EXTRA_OPS \ EFL_CANVAS_GROUP_DEL_OPS(elm_genlist_pan) -#include "elm_genlist.eo.c" -#include "elm_genlist_pan.eo.c" -#include "elm_genlist_item.eo.c" +#include "elm_genlist_eo.c" +#include "elm_genlist_pan_eo.c" +#include "elm_genlist_item_eo.c" diff --git a/src/lib/elementary/elm_genlist.eo b/src/lib/elementary/elm_genlist.eo deleted file mode 100644 index aeb9e6b596..0000000000 --- a/src/lib/elementary/elm_genlist.eo +++ /dev/null @@ -1,598 +0,0 @@ -import elm_general; - -class Elm.Genlist extends Efl.Ui.Layout implements 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; - eo_prefix: elm_obj_genlist; - event_prefix: elm_genlist; - methods { - @property homogeneous { - set { - [[Enable/disable homogeneous mode. - - This will enable the homogeneous mode where items are of the - same height and width so that genlist may do the lazy-loading - at its maximum (which increases the performance for scrolling - the list). In the normal mode, genlist will pre-calculate all - the items' sizes even though they are not in use. So items' - callbacks are called many times than expected. But homogeneous - mode will skip the item size pre-calculation process so - items' callbacks are called only when the item is needed. - - Note: This also works well with group index. - ]] - } - get { - [[Get whether the homogeneous mode is enabled.]] - } - values { - homogeneous: bool; [[Assume the items within the genlist are of - the same height and width. Default is $false.]] - } - } - @property select_mode { - set { - [[Set the genlist select mode. - - #ELM_OBJECT_SELECT_MODE_DEFAULT means that items will call - their selection func and callback once when first becoming - selected. Any further clicks will do nothing, unless you set - always select mode. ELM_OBJECT_SELECT_MODE_ALWAYS means that - even if selected, every click will make the selected callbacks - be called. #ELM_OBJECT_SELECT_MODE_NONE will turn off the - ability to select items entirely and they will neither appear - selected nor call selected callback functions. - ]] - } - get { - [[Get the genlist select mode.]] - } - values { - mode: Elm.Object.Select_Mode(Elm.Object.Select_Mode.max); [[The select mode.]] - } - } - @property focus_on_selection { - set { - [[Set focus upon items selection mode - - When enabled, every selection of an item inside the genlist - will automatically set focus to its first focusable widget - from the left. This is true of course if the selection was - made by clicking an unfocusable area in an item or selecting - it with a key movement. Clicking on a focusable widget inside - an item will couse this particular item to get focus as usual. - ]] - } - get { - [[Get whether focus upon item's selection mode is enabled.]] - } - values { - enabled: bool; [[The tree effect status.]] - } - } - @property longpress_timeout { - set { - [[Set the timeout in seconds for the longpress event. - - This option will change how long it takes to send an event - "longpressed" after the mouse down signal is sent to the list. - If this event occurs, no "clicked" event will be sent. - - Warning: If you set the longpress timeout value with this API, - your genlist will not be affected by the longpress value of - elementary config value later. - ]] - } - get { - [[Get the timeout in seconds for the longpress event.]] - } - values { - timeout: double; [[Timeout in seconds. Default is elm config value (1.0).]] - } - } - @property multi_select { - set { - [[Enable or disable multi-selection in the genlist. - - This enables ($true) or disables ($false) multi-selection in - the list. This allows more than 1 item to be selected. To - retrieve the list of selected items, use @.selected_items.get. - ]] - } - get { - [[Get if multi-selection in genlist is enabled or disabled.]] - } - values { - multi: bool; [[Multi-select enable/disable. Default is disabled.]] - } - } - @property reorder_mode { - set { - [[Set reorder mode. - - After turning on the reorder mode, longpress on normal item - will trigger reordering of the item. You can move the item - up and down. However, reorder does not work with group item. - ]] - } - get { - [[Get the reorder mode.]] - } - values { - reorder_mode: bool; [[The reorder mode.]] - } - } - @property decorate_mode { - set { - [[Set Genlist decorate mode. - - This sets Genlist decorate mode to all items. - ]] - } - get { - [[Get Genlist decorate mode.]] - } - values { - decorated: bool; [[The decorate mode status.]] - } - } - @property multi_select_mode { - set { - [[Set the genlist multi select mode. - - #ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT means that - select/unselect items whenever each item is clicked. - #ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL means that only - one item will be selected although multi-selection is enabled, - if clicked without pressing control key. This mode is only - available with multi-selection. - - @since 1.8 - ]] - } - get { - [[Get the genlist multi select mode. - - @since 1.8 - ]] - } - values { - mode: Elm.Object.Multi_Select_Mode(Elm.Object.Multi_Select_Mode.max); [[The multi select mode]] - } - } - @property block_count { - set { - [[Set the maximum number of items within an item block. - - This will configure the block count to tune to the target - with particular performance matrix. - - A block of objects will be used to reduce the number of - operations due to many objects in the screen. It can - determine the visibility, or if the object has changed, - it theme needs to be updated, etc. doing this kind of - calculation to the entire block, instead of per object. - - The default value for the block count is enough for most - lists, so unless you know you will have a lot of objects - visible in the screen at the same time, don't try to - change this. - ]] - } - get { - [[Get the maximum number of items within an item block.]] - } - values { - count: int; [[Maximum number of items within an item block. Default is 32.]] - } - } - @property tree_effect_enabled { - [[Control genlist tree effect.]] - set {} - get {} - values { - enabled: bool; [[The tree effect status.]] - } - } - @property highlight_mode { - set { - [[Set whether the genlist items should be highlighted on item - selection. - - This will turn on/off the highlight effect on item selection. - The selected and clicked callback functions will still be - called. - - Highlight is enabled by default. - ]] - } - get { - [[Get whether the genlist items' should be highlighted when - item selected. - ]] - } - values { - highlight: bool; [[$true to enable highlighting or $false to - disable it.]] - } - } - @property mode { - set { - [[This sets the horizontal stretching mode. - - This sets the mode used for sizing items horizontally. Valid - modes are @Elm.List.Mode.limit, @Elm.List.Mode.scroll, and - @Elm.List.Mode.compress. The default is @Elm.List.Mode.scroll. This mode - means that if items are too wide to fit, the scroller will - scroll horizontally. Otherwise items are expanded to fill - the width of the viewport of the scroller. If it is - @Elm.List.Mode.limit, items will be expanded to the viewport width - and limited to that size. If it is @Elm.List.Mode.compress, the - item width will be fixed (restricted to a minimum of) to the - list width when calculating its size in order to allow the - height to be calculated based on it. This allows, for - instance, text block to wrap lines if the Edje part is - configured with "text.min: 0 1". - - Note: @Elm.List.Mode.compress will make list resize slower as it - will have to recalculate every item height again whenever - the list width changes! - - Note: Homogeneous mode is for that all items in the genlist - same width/height. With @Elm.List.Mode.compress, it makes genlist - items to fast initializing. However there's no sub-objects - in genlist which can be on the flying resizable (such as - TEXTBLOCK). If then, some dynamic esizable objects in - genlist would not diplayed properly. - ]] - } - get { - [[Get the horizontal stretching mode.]] - } - values { - mode: Elm.List.Mode(Elm.List.Mode.last); [[The mode to use (one of @Elm.List.Mode.scroll or @Elm.List.Mode.limit).]] - } - } - @property decorated_item { - get { - [[Get active genlist mode item. - - This function returns the item that was activated with a mode, - by the function @.decorate_mode.set. - ]] - return: Elm.Widget.Item; [[The active item for that current mode. - Or $null if no item is activated with any mode.]] - } - } - @property selected_item { - get { - [[Get the selected item in the genlist. - - This gets the selected item in the list (if multi-selection - is enabled, only the item that was first selected in the list - is returned - which is not very useful, so see - @.selected_items.get for when multi-selection is used). - - If no item is selected, $null is returned. - ]] - return: Elm.Widget.Item; [[The selected item, or $null if none is selected.]] - } - } - @property first_item { - get { - [[Get the first item in the genlist. - - This returns the first item in the list. - - If filter is set on genlist, it returns - the first filtered item in the list. - ]] - return: Elm.Widget.Item; [[The first item or $null.]] - } - } - @property realized_items { - get { - [[Get a list of realized items in genlist. - - This returns a list of the realized items in the genlist. - The list contains genlist item pointers. The list must be - freed by the caller when done with \@ref eina_list_free. The - item pointers in the list are only valid so long as those - items are not deleted or the genlist is not deleted. - ]] - return: list @owned @warn_unused; [[List of realized items]] - } - } - @property selected_items { - get { - [[Get a list of selected items in the genlist. - - It returns a list of the selected items. This list pointer - is only valid so long as the selection doesn't change (no - items are selected or unselected, or unselected implicitl - by deletion). The list contains genlist items pointers. The - order of the items in this list is the order which they were - selected, i.e. the first item in this list is the first item - that was selected, and so on. - - Note: If not in multi-select mode, consider using function - @.selected_item.get instead. - ]] - return: const(list); [[List of selected items]] - } - } - @property last_item { - get { - [[Get the last item in the genlist - - This returns the last item in the list. - - If filter is set to genlist, it returns - last filtered item in the list. - ]] - return: Elm.Widget.Item; [[Last item in list]] - } - } - item_insert_before { - [[Insert an item before another in a genlist widget - - This inserts an item before another in the list. It will be in - the same tree level or group as the item it is inserted before. - ]] - return: Elm.Widget.Item; [[Handle to inserted item]] - params { - @cref itc: Elm.Genlist.Item.Class; [[The item class for the item.]] - @in data: const(void_ptr); [[The item data.]] - @in parent: Elm.Widget.Item @nullable; [[The parent item, or $null if none.]] - @in before_it: Elm.Widget.Item; [[The item to place this new one before.]] - @in type: Elm.Genlist.Item.Type; [[Item type.]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called when the item is selected.]] - @in func_data: const(void_ptr) @optional; [[Data passed to $func above.]] - } - } - realized_items_update { - [[Update the contents of all realized items. - - This updates all realized items by calling all the item class - functions again to get the contents, texts and states. Use this - when the original item data has changed and the changes are - desired to be reflected. - - To update just one item, use \@ref elm_genlist_item_update. - ]] - } - item_insert_after { - [[Insert an item after another in a genlist widget - - This inserts an item after another in the list. It will be in the - same tree level or group as the item it is inserted after. - ]] - return: Elm.Widget.Item; [[Handle to inserted item]] - params { - @cref itc: Elm.Genlist.Item.Class; [[The item class for the item.]] - @in data: const(void_ptr); [[The item data.]] - @in parent: Elm.Widget.Item @nullable; [[The parent item, or $null if none.]] - @in after_it: Elm.Widget.Item; [[The item to place this new one after.]] - @in type: Elm.Genlist.Item.Type; [[Item type.]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called when the item is selected.]] - @in func_data: const(void_ptr) @optional; [[Data passed to $func above.]] - } - } - at_xy_item_get @const { - [[Get the item that is at the x, y canvas coords. - - This returns the item at the given coordinates (which are canvas - relative, not object-relative). If an item is at that coordinate, - that item handle is returned, and if $posret is not NULL, the - integer pointed to is set to a value of -1, 0 or 1, depending if - the coordinate is on the upper portion of that item (-1), on the - middle section (0) or on the lower part (1). If NULL is returned - as an item (no item found there), then posret may indicate -1 or - 1 based if the coordinate is above or below all items - respectively in the genlist. - ]] - return: Elm.Widget.Item; [[Item at position]] - params { - @in x: int; [[The input x coordinate.]] - @in y: int; [[The input y coordinate.]] - @out posret: int; [[The position relative to the item returned here.]] - } - } - @property filter { - set { - [[Set filter mode with key. - - This initiates the filter mode of genlist with user/application - provided key. If key is NULL, the filter mode is turned off. - - The filter data passed has to be managed by application itself and - should not be deleted before genlist is deleted(or while filtering - is not done. - ]] - } - values { - key: void_ptr; [[Filter key]] - } - } - filter_iterator_new { - [[Returns an iterator over the list of filtered items. - - Return NULL if filter is not set. Application must take care - of the case while calling the API. Must be freed after use. - ]] - return: iterator @owned; [[Iterator on genlist]] - } - filtered_items_count @const { - [[Return how many items have passed the filter currently. - - This behaviour is O(1) and returns the count of items which - are currently passed by the filter. After "filter,done", the - call returns total count of the filtered items. - - @since 1.18 - ]] - return: uint; [[Count of items passing the filter]] - } - items_count @const { - [[Return how many items are currently in a list. - - This behavior is O(1) and includes items which may or may not - be realized. - ]] - return: uint; [[Item in list]] - } - item_prepend { - [[Prepend a new item in a given genlist widget. - - This adds an item to the beginning of the list or beginning of - the children of the parent if given. - ]] - return: Elm.Widget.Item; [[Handle to prepended item]] - params { - @cref itc: Elm.Genlist.Item.Class; [[The item class for the item.]] - @in data: const(void_ptr); [[The item data.]] - @in parent: Elm.Widget.Item @nullable; [[The parent item, or $null if none.]] - @in type: Elm.Genlist.Item.Type; [[Item type.]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called when the item is selected.]] - @in func_data: const(void_ptr) @optional; [[Data passed to $func above.]] - } - } - clear { - [[Remove all items from a given genlist widget. - - This removes (and deletes) all items in $obj, leaving it empty. - ]] - } - item_append { - [[Append a new item in a given genlist widget. - - This adds the given item to the end of the list or the end of - the children list if the $parent is given. - ]] - return: Elm.Widget.Item; [[Handle to appended item]] - params { - @cref itc: Elm.Genlist.Item.Class; [[The item class for the item.]] - @in data: const(void_ptr); [[The item data.]] - @in parent: Elm.Widget.Item @nullable; [[The parent item, or $null if none.]] - @in type: Elm.Genlist.Item.Type; [[Item type.]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called when the item is selected.]] - @in func_data: const(void_ptr) @optional; [[Data passed to $func above.]] - } - } - item_sorted_insert { - [[Insert a new item into the sorted genlist object - - This inserts an item in the genlist based on user defined - comparison function. The two arguments passed to the function - $func are genlist item handles to compare. - ]] - return: Elm.Widget.Item; [[Handle to inserted item]] - params { - @cref itc: Elm.Genlist.Item.Class; [[The item class for the item.]] - @in data: const(void_ptr); [[The item data.]] - @in parent: Elm.Widget.Item @nullable; [[The parent item, or $null if none.]] - @in type: Elm.Genlist.Item.Type; [[Item type.]] - @in comp: Eina_Compare_Cb; [[The function called for the sort.]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called when the item is selected.]] - @in func_data: const(void_ptr) @optional; [[Data passed to $func above.]] - } - } - search_by_text_item_get { - [[Get genlist item by given string. - - It takes pointer to the genlist item that will be used to start - search from it. - - This function uses globs (like "*.jpg") for searching and takes - search flags as last parameter That is a bitfield with values - to be ored together or 0 for no flags. - - @since 1.11 - ]] - return: Elm.Widget.Item; [[Searched item]] - params { - @in item_to_search_from: Elm.Widget.Item @optional; [[ - Pointer to item to start search from. If $null, search - will be started from the first item of the genlist. - ]] - @in part_name: string; [[Name of the TEXT part of genlist item to search string in.]] - @in pattern: string; [[The search pattern.]] - @in flags: Elm.Glob.Match_Flags; [[Search flags.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Gfx.Entity.position { set; } - Efl.Gfx.Entity.size { set; } - Efl.Canvas.Group.group_member_add; - Efl.Object.provider_find; - 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.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; } - 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; - Efl.Ui.Widget.focus_state_apply; - Efl.Ui.Focus.Manager.setup_on_first_touch; - Efl.Ui.Focus.Manager.manager_focus { get; } - Efl.Ui.Focus.Manager.move; - } - events { - 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.h b/src/lib/elementary/elm_genlist.h index 7c271267b9..e060a685e7 100644 --- a/src/lib/elementary/elm_genlist.h +++ b/src/lib/elementary/elm_genlist.h @@ -199,7 +199,7 @@ * scroller will scroll horizontally. Otherwise items are expanded to * fill the width of the viewport of the scroller. If it is * ELM_LIST_LIMIT, items will be expanded to the viewport width - * if larger than the item, but genlist widget witdh is + * if larger than the item, but genlist widget width is * limited to the largest item. Do not use ELM_LIST_LIMIT mode with homogeneous * mode turned on. ELM_LIST_COMPRESS can be combined with a different style * that uses edjes' ellipsis feature (cutting text off like this: "tex..."). diff --git a/src/lib/elementary/elm_genlist_eo.c b/src/lib/elementary/elm_genlist_eo.c new file mode 100644 index 0000000000..ca2fd5669e --- /dev/null +++ b/src/lib/elementary/elm_genlist_eo.c @@ -0,0 +1,686 @@ +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_ITEM_FOCUSED = + EFL_EVENT_DESCRIPTION("item,focused"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_ITEM_UNFOCUSED = + EFL_EVENT_DESCRIPTION("item,unfocused"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_VBAR_DRAG = + EFL_EVENT_DESCRIPTION("vbar,drag"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_VBAR_PRESS = + EFL_EVENT_DESCRIPTION("vbar,press"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_VBAR_UNPRESS = + EFL_EVENT_DESCRIPTION("vbar,unpress"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_HBAR_DRAG = + EFL_EVENT_DESCRIPTION("hbar,drag"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_HBAR_PRESS = + EFL_EVENT_DESCRIPTION("hbar,press"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_HBAR_UNPRESS = + EFL_EVENT_DESCRIPTION("hbar,unpress"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_EDGE_TOP = + EFL_EVENT_DESCRIPTION("edge,top"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_EDGE_BOTTOM = + EFL_EVENT_DESCRIPTION("edge,bottom"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_EDGE_LEFT = + EFL_EVENT_DESCRIPTION("edge,left"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_EDGE_RIGHT = + EFL_EVENT_DESCRIPTION("edge,right"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_MOVED = + EFL_EVENT_DESCRIPTION("moved"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_MOVED_BEFORE = + EFL_EVENT_DESCRIPTION("moved,before"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_MOVED_AFTER = + EFL_EVENT_DESCRIPTION("moved,after"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_SWIPE = + EFL_EVENT_DESCRIPTION("swipe"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_MULTI_PINCH_IN = + EFL_EVENT_DESCRIPTION("multi,pinch,in"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_MULTI_PINCH_OUT = + EFL_EVENT_DESCRIPTION("multi,pinch,out"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_MULTI_SWIPE_DOWN = + EFL_EVENT_DESCRIPTION("multi,swipe,down"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_MULTI_SWIPE_UP = + EFL_EVENT_DESCRIPTION("multi,swipe,up"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_MULTI_SWIPE_RIGHT = + EFL_EVENT_DESCRIPTION("multi,swipe,right"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_MULTI_SWIPE_LEFT = + EFL_EVENT_DESCRIPTION("multi,swipe,left"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_RELEASED = + EFL_EVENT_DESCRIPTION("released"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_ACTIVATED = + EFL_EVENT_DESCRIPTION("activated"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_HIGHLIGHTED = + EFL_EVENT_DESCRIPTION("highlighted"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_UNHIGHLIGHTED = + EFL_EVENT_DESCRIPTION("unhighlighted"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_REALIZED = + EFL_EVENT_DESCRIPTION("realized"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_UNREALIZED = + EFL_EVENT_DESCRIPTION("unrealized"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_CONTRACT_REQUEST = + EFL_EVENT_DESCRIPTION("contract,request"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_EXPAND_REQUEST = + EFL_EVENT_DESCRIPTION("expand,request"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_CONTRACTED = + EFL_EVENT_DESCRIPTION("contracted"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_EXPANDED = + EFL_EVENT_DESCRIPTION("expanded"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_INDEX_UPDATE = + EFL_EVENT_DESCRIPTION("index,update"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_TREE_EFFECT_FINISHED = + EFL_EVENT_DESCRIPTION("tree,effect,finished"); +EWAPI const Efl_Event_Description _ELM_GENLIST_EVENT_FILTER_DONE = + EFL_EVENT_DESCRIPTION("filter,done"); + +void _elm_genlist_homogeneous_set(Eo *obj, Elm_Genlist_Data *pd, Eina_Bool homogeneous); + + +static Eina_Error +__eolian_elm_genlist_homogeneous_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_genlist_homogeneous_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_homogeneous_set, EFL_FUNC_CALL(homogeneous), Eina_Bool homogeneous); + +Eina_Bool _elm_genlist_homogeneous_get(const Eo *obj, Elm_Genlist_Data *pd); + + +static Eina_Value +__eolian_elm_genlist_homogeneous_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_genlist_homogeneous_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_homogeneous_get, Eina_Bool, 0); + +void _elm_genlist_select_mode_set(Eo *obj, Elm_Genlist_Data *pd, Elm_Object_Select_Mode mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_select_mode_set, EFL_FUNC_CALL(mode), Elm_Object_Select_Mode mode); + +Elm_Object_Select_Mode _elm_genlist_select_mode_get(const Eo *obj, Elm_Genlist_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_select_mode_get, Elm_Object_Select_Mode, 4 /* Elm.Object.Select_Mode.max */); + +void _elm_genlist_focus_on_selection_set(Eo *obj, Elm_Genlist_Data *pd, Eina_Bool enabled); + + +static Eina_Error +__eolian_elm_genlist_focus_on_selection_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_genlist_focus_on_selection_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_focus_on_selection_set, EFL_FUNC_CALL(enabled), Eina_Bool enabled); + +Eina_Bool _elm_genlist_focus_on_selection_get(const Eo *obj, Elm_Genlist_Data *pd); + + +static Eina_Value +__eolian_elm_genlist_focus_on_selection_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_genlist_focus_on_selection_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_focus_on_selection_get, Eina_Bool, 0); + +void _elm_genlist_longpress_timeout_set(Eo *obj, Elm_Genlist_Data *pd, double timeout); + + +static Eina_Error +__eolian_elm_genlist_longpress_timeout_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_genlist_longpress_timeout_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_longpress_timeout_set, EFL_FUNC_CALL(timeout), double timeout); + +double _elm_genlist_longpress_timeout_get(const Eo *obj, Elm_Genlist_Data *pd); + + +static Eina_Value +__eolian_elm_genlist_longpress_timeout_get_reflect(const Eo *obj) +{ + double val = elm_obj_genlist_longpress_timeout_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_longpress_timeout_get, double, 0); + +void _elm_genlist_multi_select_set(Eo *obj, Elm_Genlist_Data *pd, Eina_Bool multi); + + +static Eina_Error +__eolian_elm_genlist_multi_select_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_genlist_multi_select_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_multi_select_set, EFL_FUNC_CALL(multi), Eina_Bool multi); + +Eina_Bool _elm_genlist_multi_select_get(const Eo *obj, Elm_Genlist_Data *pd); + + +static Eina_Value +__eolian_elm_genlist_multi_select_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_genlist_multi_select_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_multi_select_get, Eina_Bool, 0); + +void _elm_genlist_reorder_mode_set(Eo *obj, Elm_Genlist_Data *pd, Eina_Bool reorder_mode); + + +static Eina_Error +__eolian_elm_genlist_reorder_mode_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_genlist_reorder_mode_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_reorder_mode_set, EFL_FUNC_CALL(reorder_mode), Eina_Bool reorder_mode); + +Eina_Bool _elm_genlist_reorder_mode_get(const Eo *obj, Elm_Genlist_Data *pd); + + +static Eina_Value +__eolian_elm_genlist_reorder_mode_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_genlist_reorder_mode_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_reorder_mode_get, Eina_Bool, 0); + +void _elm_genlist_decorate_mode_set(Eo *obj, Elm_Genlist_Data *pd, Eina_Bool decorated); + + +static Eina_Error +__eolian_elm_genlist_decorate_mode_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_genlist_decorate_mode_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_decorate_mode_set, EFL_FUNC_CALL(decorated), Eina_Bool decorated); + +Eina_Bool _elm_genlist_decorate_mode_get(const Eo *obj, Elm_Genlist_Data *pd); + + +static Eina_Value +__eolian_elm_genlist_decorate_mode_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_genlist_decorate_mode_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_decorate_mode_get, Eina_Bool, 0); + +void _elm_genlist_multi_select_mode_set(Eo *obj, Elm_Genlist_Data *pd, Elm_Object_Multi_Select_Mode mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_multi_select_mode_set, EFL_FUNC_CALL(mode), Elm_Object_Multi_Select_Mode mode); + +Elm_Object_Multi_Select_Mode _elm_genlist_multi_select_mode_get(const Eo *obj, Elm_Genlist_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_multi_select_mode_get, Elm_Object_Multi_Select_Mode, 2 /* Elm.Object.Multi_Select_Mode.max */); + +void _elm_genlist_block_count_set(Eo *obj, Elm_Genlist_Data *pd, int count); + + +static Eina_Error +__eolian_elm_genlist_block_count_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_genlist_block_count_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_block_count_set, EFL_FUNC_CALL(count), int count); + +int _elm_genlist_block_count_get(const Eo *obj, Elm_Genlist_Data *pd); + + +static Eina_Value +__eolian_elm_genlist_block_count_get_reflect(const Eo *obj) +{ + int val = elm_obj_genlist_block_count_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_block_count_get, int, 0); + +void _elm_genlist_tree_effect_enabled_set(Eo *obj, Elm_Genlist_Data *pd, Eina_Bool enabled); + + +static Eina_Error +__eolian_elm_genlist_tree_effect_enabled_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_genlist_tree_effect_enabled_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_tree_effect_enabled_set, EFL_FUNC_CALL(enabled), Eina_Bool enabled); + +Eina_Bool _elm_genlist_tree_effect_enabled_get(const Eo *obj, Elm_Genlist_Data *pd); + + +static Eina_Value +__eolian_elm_genlist_tree_effect_enabled_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_genlist_tree_effect_enabled_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_tree_effect_enabled_get, Eina_Bool, 0); + +void _elm_genlist_highlight_mode_set(Eo *obj, Elm_Genlist_Data *pd, Eina_Bool highlight); + + +static Eina_Error +__eolian_elm_genlist_highlight_mode_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_genlist_highlight_mode_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_highlight_mode_set, EFL_FUNC_CALL(highlight), Eina_Bool highlight); + +Eina_Bool _elm_genlist_highlight_mode_get(const Eo *obj, Elm_Genlist_Data *pd); + + +static Eina_Value +__eolian_elm_genlist_highlight_mode_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_genlist_highlight_mode_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_highlight_mode_get, Eina_Bool, 0); + +void _elm_genlist_mode_set(Eo *obj, Elm_Genlist_Data *pd, Elm_List_Mode mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_mode_set, EFL_FUNC_CALL(mode), Elm_List_Mode mode); + +Elm_List_Mode _elm_genlist_mode_get(const Eo *obj, Elm_Genlist_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_mode_get, Elm_List_Mode, 4 /* Elm.List.Mode.last */); + +Elm_Widget_Item *_elm_genlist_decorated_item_get(const Eo *obj, Elm_Genlist_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_decorated_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_genlist_selected_item_get(const Eo *obj, Elm_Genlist_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_selected_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_genlist_first_item_get(const Eo *obj, Elm_Genlist_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_first_item_get, Elm_Widget_Item *, NULL); + +Eina_List *_elm_genlist_realized_items_get(const Eo *obj, Elm_Genlist_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_realized_items_get, Eina_List *, NULL); + +const Eina_List *_elm_genlist_selected_items_get(const Eo *obj, Elm_Genlist_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_selected_items_get, const Eina_List *, NULL); + +Elm_Widget_Item *_elm_genlist_last_item_get(const Eo *obj, Elm_Genlist_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_last_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_genlist_item_insert_before(Eo *obj, Elm_Genlist_Data *pd, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Widget_Item *before_it, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data); + +EOAPI EFL_FUNC_BODYV(elm_obj_genlist_item_insert_before, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(itc, data, parent, before_it, type, func, func_data), const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Widget_Item *before_it, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data); + +void _elm_genlist_realized_items_update(Eo *obj, Elm_Genlist_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_genlist_realized_items_update); + +Elm_Widget_Item *_elm_genlist_item_insert_after(Eo *obj, Elm_Genlist_Data *pd, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Widget_Item *after_it, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data); + +EOAPI EFL_FUNC_BODYV(elm_obj_genlist_item_insert_after, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(itc, data, parent, after_it, type, func, func_data), const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Widget_Item *after_it, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data); + +Elm_Widget_Item *_elm_genlist_at_xy_item_get(const Eo *obj, Elm_Genlist_Data *pd, int x, int y, int *posret); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_genlist_at_xy_item_get, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(x, y, posret), int x, int y, int *posret); + +void _elm_genlist_filter_set(Eo *obj, Elm_Genlist_Data *pd, void *key); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_filter_set, EFL_FUNC_CALL(key), void *key); + +Eina_Iterator *_elm_genlist_filter_iterator_new(Eo *obj, Elm_Genlist_Data *pd); + +EOAPI EFL_FUNC_BODY(elm_obj_genlist_filter_iterator_new, Eina_Iterator *, NULL); + +unsigned int _elm_genlist_filtered_items_count(const Eo *obj, Elm_Genlist_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_filtered_items_count, unsigned int, 0); + +unsigned int _elm_genlist_items_count(const Eo *obj, Elm_Genlist_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_items_count, unsigned int, 0); + +Elm_Widget_Item *_elm_genlist_item_prepend(Eo *obj, Elm_Genlist_Data *pd, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data); + +EOAPI EFL_FUNC_BODYV(elm_obj_genlist_item_prepend, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(itc, data, parent, type, func, func_data), const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data); + +void _elm_genlist_clear(Eo *obj, Elm_Genlist_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_genlist_clear); + +Elm_Widget_Item *_elm_genlist_item_append(Eo *obj, Elm_Genlist_Data *pd, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data); + +EOAPI EFL_FUNC_BODYV(elm_obj_genlist_item_append, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(itc, data, parent, type, func, func_data), const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data); + +Elm_Widget_Item *_elm_genlist_item_sorted_insert(Eo *obj, Elm_Genlist_Data *pd, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Genlist_Item_Type type, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data); + +EOAPI EFL_FUNC_BODYV(elm_obj_genlist_item_sorted_insert, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(itc, data, parent, type, comp, func, func_data), const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Genlist_Item_Type type, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data); + +Elm_Widget_Item *_elm_genlist_search_by_text_item_get(Eo *obj, Elm_Genlist_Data *pd, Elm_Widget_Item *item_to_search_from, const char *part_name, const char *pattern, Elm_Glob_Match_Flags flags); + +EOAPI EFL_FUNC_BODYV(elm_obj_genlist_search_by_text_item_get, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(item_to_search_from, part_name, pattern, flags), Elm_Widget_Item *item_to_search_from, const char *part_name, const char *pattern, Elm_Glob_Match_Flags flags); + +Efl_Object *_elm_genlist_efl_object_constructor(Eo *obj, Elm_Genlist_Data *pd); + + +void _elm_genlist_efl_gfx_entity_position_set(Eo *obj, Elm_Genlist_Data *pd, Eina_Position2D pos); + + +void _elm_genlist_efl_gfx_entity_size_set(Eo *obj, Elm_Genlist_Data *pd, Eina_Size2D size); + + +void _elm_genlist_efl_canvas_group_group_member_add(Eo *obj, Elm_Genlist_Data *pd, Efl_Canvas_Object *sub_obj); + + +Efl_Object *_elm_genlist_efl_object_provider_find(const Eo *obj, Elm_Genlist_Data *pd, const Efl_Class *klass); + + +Eina_Error _elm_genlist_efl_ui_widget_theme_apply(Eo *obj, Elm_Genlist_Data *pd); + + +Eina_Bool _elm_genlist_efl_ui_widget_widget_sub_object_add(Eo *obj, Elm_Genlist_Data *pd, Efl_Canvas_Object *sub_obj); + + +void _elm_genlist_efl_ui_widget_on_access_update(Eo *obj, Elm_Genlist_Data *pd, Eina_Bool enable); + + +Eina_Rect _elm_genlist_efl_ui_widget_focus_highlight_geometry_get(const Eo *obj, Elm_Genlist_Data *pd); + + +Eina_Bool _elm_genlist_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Genlist_Data *pd); + + +Eina_Bool _elm_genlist_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Genlist_Data *pd, Efl_Canvas_Object *sub_obj); + + +Eina_Bool _elm_genlist_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Genlist_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +Elm_Widget_Item *_elm_genlist_elm_widget_item_container_focused_item_get(const Eo *obj, Elm_Genlist_Data *pd); + + +void _elm_genlist_elm_interface_scrollable_item_loop_enabled_set(Eo *obj, Elm_Genlist_Data *pd, Eina_Bool enable); + + +Eina_Bool _elm_genlist_elm_interface_scrollable_item_loop_enabled_get(const Eo *obj, Elm_Genlist_Data *pd); + + +void _elm_genlist_elm_interface_scrollable_bounce_allow_set(Eo *obj, Elm_Genlist_Data *pd, Eina_Bool horiz, Eina_Bool vert); + + +void _elm_genlist_elm_interface_scrollable_bounce_allow_get(const Eo *obj, Elm_Genlist_Data *pd, Eina_Bool *horiz, Eina_Bool *vert); + + +void _elm_genlist_elm_interface_scrollable_policy_set(Eo *obj, Elm_Genlist_Data *pd, Elm_Scroller_Policy hbar, Elm_Scroller_Policy vbar); + + +void _elm_genlist_elm_interface_scrollable_policy_get(const Eo *obj, Elm_Genlist_Data *pd, Elm_Scroller_Policy *hbar, Elm_Scroller_Policy *vbar); + + +Eina_List *_elm_genlist_efl_access_object_access_children_get(const Eo *obj, Elm_Genlist_Data *pd); + + +Efl_Access_State_Set _elm_genlist_efl_access_object_state_set_get(const Eo *obj, Elm_Genlist_Data *pd); + + +const Efl_Access_Action_Data *_elm_genlist_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Genlist_Data *pd); + + +int _elm_genlist_efl_access_selection_selected_children_count_get(const Eo *obj, Elm_Genlist_Data *pd); + + +Efl_Object *_elm_genlist_efl_access_selection_selected_child_get(const Eo *obj, Elm_Genlist_Data *pd, int selected_child_index); + + +Eina_Bool _elm_genlist_efl_access_selection_selected_child_deselect(Eo *obj, Elm_Genlist_Data *pd, int child_index); + + +Eina_Bool _elm_genlist_efl_access_selection_child_select(Eo *obj, Elm_Genlist_Data *pd, int child_index); + + +Eina_Bool _elm_genlist_efl_access_selection_child_deselect(Eo *obj, Elm_Genlist_Data *pd, int child_index); + + +Eina_Bool _elm_genlist_efl_access_selection_is_child_selected(Eo *obj, Elm_Genlist_Data *pd, int child_index); + + +Eina_Bool _elm_genlist_efl_access_selection_all_children_select(Eo *obj, Elm_Genlist_Data *pd); + + +Eina_Bool _elm_genlist_efl_access_selection_access_selection_clear(Eo *obj, Elm_Genlist_Data *pd); + + +Eina_Bool _elm_genlist_efl_ui_widget_focus_state_apply(Eo *obj, Elm_Genlist_Data *pd, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect); + + +void _elm_genlist_efl_ui_focus_manager_setup_on_first_touch(Eo *obj, Elm_Genlist_Data *pd, Efl_Ui_Focus_Direction direction, Efl_Ui_Focus_Object *entry); + + +Efl_Ui_Focus_Object *_elm_genlist_efl_ui_focus_manager_manager_focus_get(const Eo *obj, Elm_Genlist_Data *pd); + + +Efl_Ui_Focus_Object *_elm_genlist_efl_ui_focus_manager_move(Eo *obj, Elm_Genlist_Data *pd, Efl_Ui_Focus_Direction direction); + + +static Eina_Bool +_elm_genlist_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_GENLIST_EXTRA_OPS +#define ELM_GENLIST_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_genlist_homogeneous_set, _elm_genlist_homogeneous_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_homogeneous_get, _elm_genlist_homogeneous_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_select_mode_set, _elm_genlist_select_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_select_mode_get, _elm_genlist_select_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_focus_on_selection_set, _elm_genlist_focus_on_selection_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_focus_on_selection_get, _elm_genlist_focus_on_selection_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_longpress_timeout_set, _elm_genlist_longpress_timeout_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_longpress_timeout_get, _elm_genlist_longpress_timeout_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_multi_select_set, _elm_genlist_multi_select_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_multi_select_get, _elm_genlist_multi_select_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_reorder_mode_set, _elm_genlist_reorder_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_reorder_mode_get, _elm_genlist_reorder_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_decorate_mode_set, _elm_genlist_decorate_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_decorate_mode_get, _elm_genlist_decorate_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_multi_select_mode_set, _elm_genlist_multi_select_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_multi_select_mode_get, _elm_genlist_multi_select_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_block_count_set, _elm_genlist_block_count_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_block_count_get, _elm_genlist_block_count_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_tree_effect_enabled_set, _elm_genlist_tree_effect_enabled_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_tree_effect_enabled_get, _elm_genlist_tree_effect_enabled_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_highlight_mode_set, _elm_genlist_highlight_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_highlight_mode_get, _elm_genlist_highlight_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_mode_set, _elm_genlist_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_mode_get, _elm_genlist_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_decorated_item_get, _elm_genlist_decorated_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_selected_item_get, _elm_genlist_selected_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_first_item_get, _elm_genlist_first_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_realized_items_get, _elm_genlist_realized_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_selected_items_get, _elm_genlist_selected_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_last_item_get, _elm_genlist_last_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_insert_before, _elm_genlist_item_insert_before), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_realized_items_update, _elm_genlist_realized_items_update), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_insert_after, _elm_genlist_item_insert_after), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_at_xy_item_get, _elm_genlist_at_xy_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_filter_set, _elm_genlist_filter_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_filter_iterator_new, _elm_genlist_filter_iterator_new), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_filtered_items_count, _elm_genlist_filtered_items_count), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_items_count, _elm_genlist_items_count), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_prepend, _elm_genlist_item_prepend), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_clear, _elm_genlist_clear), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_append, _elm_genlist_item_append), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_sorted_insert, _elm_genlist_item_sorted_insert), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_search_by_text_item_get, _elm_genlist_search_by_text_item_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_genlist_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_genlist_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_genlist_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_canvas_group_member_add, _elm_genlist_efl_canvas_group_group_member_add), + EFL_OBJECT_OP_FUNC(efl_provider_find, _elm_genlist_efl_object_provider_find), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_genlist_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_add, _elm_genlist_efl_ui_widget_widget_sub_object_add), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_genlist_efl_ui_widget_on_access_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_highlight_geometry_get, _elm_genlist_efl_ui_widget_focus_highlight_geometry_get), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_on_focus_update, _elm_genlist_efl_ui_focus_object_on_focus_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _elm_genlist_efl_ui_widget_widget_sub_object_del), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_genlist_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(elm_widget_item_container_focused_item_get, _elm_genlist_elm_widget_item_container_focused_item_get), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_item_loop_enabled_set, _elm_genlist_elm_interface_scrollable_item_loop_enabled_set), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_item_loop_enabled_get, _elm_genlist_elm_interface_scrollable_item_loop_enabled_get), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_bounce_allow_set, _elm_genlist_elm_interface_scrollable_bounce_allow_set), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_bounce_allow_get, _elm_genlist_elm_interface_scrollable_bounce_allow_get), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_policy_set, _elm_genlist_elm_interface_scrollable_policy_set), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_policy_get, _elm_genlist_elm_interface_scrollable_policy_get), + EFL_OBJECT_OP_FUNC(efl_access_object_access_children_get, _elm_genlist_efl_access_object_access_children_get), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_genlist_efl_access_object_state_set_get), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_genlist_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_children_count_get, _elm_genlist_efl_access_selection_selected_children_count_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_child_get, _elm_genlist_efl_access_selection_selected_child_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_child_deselect, _elm_genlist_efl_access_selection_selected_child_deselect), + EFL_OBJECT_OP_FUNC(efl_access_selection_child_select, _elm_genlist_efl_access_selection_child_select), + EFL_OBJECT_OP_FUNC(efl_access_selection_child_deselect, _elm_genlist_efl_access_selection_child_deselect), + EFL_OBJECT_OP_FUNC(efl_access_selection_is_child_selected, _elm_genlist_efl_access_selection_is_child_selected), + EFL_OBJECT_OP_FUNC(efl_access_selection_all_children_select, _elm_genlist_efl_access_selection_all_children_select), + EFL_OBJECT_OP_FUNC(efl_access_selection_clear, _elm_genlist_efl_access_selection_access_selection_clear), + EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_state_apply, _elm_genlist_efl_ui_widget_focus_state_apply), + EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_setup_on_first_touch, _elm_genlist_efl_ui_focus_manager_setup_on_first_touch), + EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_focus_get, _elm_genlist_efl_ui_focus_manager_manager_focus_get), + EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_move, _elm_genlist_efl_ui_focus_manager_move), + ELM_GENLIST_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"homogeneous", __eolian_elm_genlist_homogeneous_set_reflect, __eolian_elm_genlist_homogeneous_get_reflect}, + {"focus_on_selection", __eolian_elm_genlist_focus_on_selection_set_reflect, __eolian_elm_genlist_focus_on_selection_get_reflect}, + {"longpress_timeout", __eolian_elm_genlist_longpress_timeout_set_reflect, __eolian_elm_genlist_longpress_timeout_get_reflect}, + {"multi_select", __eolian_elm_genlist_multi_select_set_reflect, __eolian_elm_genlist_multi_select_get_reflect}, + {"reorder_mode", __eolian_elm_genlist_reorder_mode_set_reflect, __eolian_elm_genlist_reorder_mode_get_reflect}, + {"decorate_mode", __eolian_elm_genlist_decorate_mode_set_reflect, __eolian_elm_genlist_decorate_mode_get_reflect}, + {"block_count", __eolian_elm_genlist_block_count_set_reflect, __eolian_elm_genlist_block_count_get_reflect}, + {"tree_effect_enabled", __eolian_elm_genlist_tree_effect_enabled_set_reflect, __eolian_elm_genlist_tree_effect_enabled_get_reflect}, + {"highlight_mode", __eolian_elm_genlist_highlight_mode_set_reflect, __eolian_elm_genlist_highlight_mode_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_genlist_class_desc = { + EO_VERSION, + "Elm.Genlist", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Genlist_Data), + _elm_genlist_class_initializer, + _elm_genlist_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_genlist_class_get, &_elm_genlist_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); + +#include "elm_genlist_eo.legacy.c" diff --git a/src/lib/elementary/elm_genlist_eo.h b/src/lib/elementary/elm_genlist_eo.h new file mode 100644 index 0000000000..f132027980 --- /dev/null +++ b/src/lib/elementary/elm_genlist_eo.h @@ -0,0 +1,1014 @@ +#ifndef _ELM_GENLIST_EO_H_ +#define _ELM_GENLIST_EO_H_ + +#ifndef _ELM_GENLIST_EO_CLASS_TYPE +#define _ELM_GENLIST_EO_CLASS_TYPE + +typedef Eo Elm_Genlist; + +#endif + +#ifndef _ELM_GENLIST_EO_TYPES +#define _ELM_GENLIST_EO_TYPES + + +#endif +/** Elementary genlist class + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_CLASS elm_genlist_class_get() + +EWAPI const Efl_Class *elm_genlist_class_get(void); + +/** + * @brief Enable/disable homogeneous mode. + * + * This will enable the homogeneous mode where items are of the same height and + * width so that genlist may do the lazy-loading at its maximum (which + * increases the performance for scrolling the list). In the normal mode, + * genlist will pre-calculate all the items' sizes even though they are not in + * use. So items' callbacks are called many times than expected. But + * homogeneous mode will skip the item size pre-calculation process so items' + * callbacks are called only when the item is needed. + * + * @note This also works well with group index. + * + * @param[in] obj The object. + * @param[in] homogeneous Assume the items within the genlist are of the same + * height and width. Default is @c false. + * + * @ingroup Elm_Genlist + */ +EOAPI void elm_obj_genlist_homogeneous_set(Eo *obj, Eina_Bool homogeneous); + +/** + * @brief Get whether the homogeneous mode is enabled. + * + * @param[in] obj The object. + * + * @return Assume the items within the genlist are of the same height and + * width. Default is @c false. + * + * @ingroup Elm_Genlist + */ +EOAPI Eina_Bool elm_obj_genlist_homogeneous_get(const Eo *obj); + +/** + * @brief Set the genlist select mode. + * + * #ELM_OBJECT_SELECT_MODE_DEFAULT means that items will call their selection + * func and callback once when first becoming selected. Any further clicks will + * do nothing, unless you set always select mode. ELM_OBJECT_SELECT_MODE_ALWAYS + * means that even if selected, every click will make the selected callbacks be + * called. #ELM_OBJECT_SELECT_MODE_NONE will turn off the ability to select + * items entirely and they will neither appear selected nor call selected + * callback functions. + * + * @param[in] obj The object. + * @param[in] mode The select mode. + * + * @ingroup Elm_Genlist + */ +EOAPI void elm_obj_genlist_select_mode_set(Eo *obj, Elm_Object_Select_Mode mode); + +/** + * @brief Get the genlist select mode. + * + * @param[in] obj The object. + * + * @return The select mode. + * + * @ingroup Elm_Genlist + */ +EOAPI Elm_Object_Select_Mode elm_obj_genlist_select_mode_get(const Eo *obj); + +/** + * @brief Set focus upon items selection mode + * + * When enabled, every selection of an item inside the genlist will + * automatically set focus to its first focusable widget from the left. This is + * true of course if the selection was made by clicking an unfocusable area in + * an item or selecting it with a key movement. Clicking on a focusable widget + * inside an item will cause this particular item to get focus as usual. + * + * @param[in] obj The object. + * @param[in] enabled The tree effect status. + * + * @ingroup Elm_Genlist + */ +EOAPI void elm_obj_genlist_focus_on_selection_set(Eo *obj, Eina_Bool enabled); + +/** + * @brief Get whether focus upon item's selection mode is enabled. + * + * @param[in] obj The object. + * + * @return The tree effect status. + * + * @ingroup Elm_Genlist + */ +EOAPI Eina_Bool elm_obj_genlist_focus_on_selection_get(const Eo *obj); + +/** + * @brief Set the timeout in seconds for the longpress event. + * + * This option will change how long it takes to send an event "longpressed" + * after the mouse down signal is sent to the list. If this event occurs, no + * "clicked" event will be sent. + * + * @warning If you set the longpress timeout value with this API, your genlist + * will not be affected by the longpress value of elementary config value + * later. + * + * @param[in] obj The object. + * @param[in] timeout Timeout in seconds. Default is elm config value (1.0). + * + * @ingroup Elm_Genlist + */ +EOAPI void elm_obj_genlist_longpress_timeout_set(Eo *obj, double timeout); + +/** + * @brief Get the timeout in seconds for the longpress event. + * + * @param[in] obj The object. + * + * @return Timeout in seconds. Default is elm config value (1.0). + * + * @ingroup Elm_Genlist + */ +EOAPI double elm_obj_genlist_longpress_timeout_get(const Eo *obj); + +/** + * @brief Enable or disable multi-selection in the genlist. + * + * This enables ($true) or disables ($false) multi-selection in the list. This + * allows more than 1 item to be selected. To retrieve the list of selected + * items, use @ref elm_obj_genlist_selected_items_get. + * + * @param[in] obj The object. + * @param[in] multi Multi-select enable/disable. Default is disabled. + * + * @ingroup Elm_Genlist + */ +EOAPI void elm_obj_genlist_multi_select_set(Eo *obj, Eina_Bool multi); + +/** + * @brief Get if multi-selection in genlist is enabled or disabled. + * + * @param[in] obj The object. + * + * @return Multi-select enable/disable. Default is disabled. + * + * @ingroup Elm_Genlist + */ +EOAPI Eina_Bool elm_obj_genlist_multi_select_get(const Eo *obj); + +/** + * @brief Set reorder mode. + * + * After turning on the reorder mode, longpress on normal item will trigger + * reordering of the item. You can move the item up and down. However, reorder + * does not work with group item. + * + * @param[in] obj The object. + * @param[in] reorder_mode The reorder mode. + * + * @ingroup Elm_Genlist + */ +EOAPI void elm_obj_genlist_reorder_mode_set(Eo *obj, Eina_Bool reorder_mode); + +/** + * @brief Get the reorder mode. + * + * @param[in] obj The object. + * + * @return The reorder mode. + * + * @ingroup Elm_Genlist + */ +EOAPI Eina_Bool elm_obj_genlist_reorder_mode_get(const Eo *obj); + +/** + * @brief Set Genlist decorate mode. + * + * This sets Genlist decorate mode to all items. + * + * @param[in] obj The object. + * @param[in] decorated The decorate mode status. + * + * @ingroup Elm_Genlist + */ +EOAPI void elm_obj_genlist_decorate_mode_set(Eo *obj, Eina_Bool decorated); + +/** + * @brief Get Genlist decorate mode. + * + * @param[in] obj The object. + * + * @return The decorate mode status. + * + * @ingroup Elm_Genlist + */ +EOAPI Eina_Bool elm_obj_genlist_decorate_mode_get(const Eo *obj); + +/** + * @brief Set the genlist multi select mode. + * + * #ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT means that select/unselect items + * whenever each item is clicked. #ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL + * means that only one item will be selected although multi-selection is + * enabled, if clicked without pressing control key. This mode is only + * available with multi-selection. + * + * @param[in] obj The object. + * @param[in] mode The multi select mode + * + * @since 1.8 + * + * @ingroup Elm_Genlist + */ +EOAPI void elm_obj_genlist_multi_select_mode_set(Eo *obj, Elm_Object_Multi_Select_Mode mode); + +/** + * @brief Get the genlist multi select mode. + * + * @param[in] obj The object. + * + * @return The multi select mode + * + * @since 1.8 + * + * @ingroup Elm_Genlist + */ +EOAPI Elm_Object_Multi_Select_Mode elm_obj_genlist_multi_select_mode_get(const Eo *obj); + +/** + * @brief Set the maximum number of items within an item block. + * + * This will configure the block count to tune to the target with particular + * performance matrix. + * + * A block of objects will be used to reduce the number of operations due to + * many objects in the screen. It can determine the visibility, or if the + * object has changed, it theme needs to be updated, etc. doing this kind of + * calculation to the entire block, instead of per object. + * + * The default value for the block count is enough for most lists, so unless + * you know you will have a lot of objects visible in the screen at the same + * time, don't try to change this. + * + * @param[in] obj The object. + * @param[in] count Maximum number of items within an item block. Default is + * 32. + * + * @ingroup Elm_Genlist + */ +EOAPI void elm_obj_genlist_block_count_set(Eo *obj, int count); + +/** + * @brief Get the maximum number of items within an item block. + * + * @param[in] obj The object. + * + * @return Maximum number of items within an item block. Default is 32. + * + * @ingroup Elm_Genlist + */ +EOAPI int elm_obj_genlist_block_count_get(const Eo *obj); + +/** + * @brief Control genlist tree effect. + * + * @param[in] obj The object. + * @param[in] enabled The tree effect status. + * + * @ingroup Elm_Genlist + */ +EOAPI void elm_obj_genlist_tree_effect_enabled_set(Eo *obj, Eina_Bool enabled); + +/** + * @brief Control genlist tree effect. + * + * @param[in] obj The object. + * + * @return The tree effect status. + * + * @ingroup Elm_Genlist + */ +EOAPI Eina_Bool elm_obj_genlist_tree_effect_enabled_get(const Eo *obj); + +/** + * @brief Set whether the genlist items should be highlighted on item + * selection. + * + * This will turn on/off the highlight effect on item selection. The selected + * and clicked callback functions will still be called. + * + * Highlight is enabled by default. + * + * @param[in] obj The object. + * @param[in] highlight @c true to enable highlighting or @c false to disable + * it. + * + * @ingroup Elm_Genlist + */ +EOAPI void elm_obj_genlist_highlight_mode_set(Eo *obj, Eina_Bool highlight); + +/** + * @brief Get whether the genlist items' should be highlighted when item + * selected. + * + * @param[in] obj The object. + * + * @return @c true to enable highlighting or @c false to disable it. + * + * @ingroup Elm_Genlist + */ +EOAPI Eina_Bool elm_obj_genlist_highlight_mode_get(const Eo *obj); + +/** + * @brief This sets the horizontal stretching mode. + * + * This sets the mode used for sizing items horizontally. Valid modes are + * @ref ELM_LIST_LIMIT, @ref ELM_LIST_SCROLL, and @ref ELM_LIST_COMPRESS. The + * default is @ref ELM_LIST_SCROLL. This mode means that if items are too wide + * to fit, the scroller will scroll horizontally. Otherwise items are expanded + * to fill the width of the viewport of the scroller. If it is + * @ref ELM_LIST_LIMIT, items will be expanded to the viewport width and + * limited to that size. If it is @ref ELM_LIST_COMPRESS, the item width will + * be fixed (restricted to a minimum of) to the list width when calculating its + * size in order to allow the height to be calculated based on it. This allows, + * for instance, text block to wrap lines if the Edje part is configured with + * "text.min: 0 1". + * + * @note @ref ELM_LIST_COMPRESS will make list resize slower as it will have to + * recalculate every item height again whenever the list width changes! + * + * @note Homogeneous mode gives all items in the genlist the same width/height. + * With @ref ELM_LIST_COMPRESS, genlist items initialize fast, but there cannot + * be any sub-objects in the genlist which require on-the-fly resizing (such as + * TEXTBLOCK). In this case some dynamic resizable objects in the genlist might + * not diplay properly. + * + * @param[in] obj The object. + * @param[in] mode The mode to use (one of @ref ELM_LIST_SCROLL or + * @ref ELM_LIST_LIMIT). + * + * @ingroup Elm_Genlist + */ +EOAPI void elm_obj_genlist_mode_set(Eo *obj, Elm_List_Mode mode); + +/** + * @brief Get the horizontal stretching mode. + * + * @param[in] obj The object. + * + * @return The mode to use (one of @ref ELM_LIST_SCROLL or + * @ref ELM_LIST_LIMIT). + * + * @ingroup Elm_Genlist + */ +EOAPI Elm_List_Mode elm_obj_genlist_mode_get(const Eo *obj); + +/** + * @brief Get active genlist mode item. + * + * This function returns the item that was activated with a mode, by the + * function @ref elm_obj_genlist_decorate_mode_set. + * + * @param[in] obj The object. + * + * @return The active item for that current mode. Or @c null if no item is + * activated with any mode. + * + * @ingroup Elm_Genlist + */ +EOAPI Elm_Widget_Item *elm_obj_genlist_decorated_item_get(const Eo *obj); + +/** + * @brief Get the selected item in the genlist. + * + * This gets the selected item in the list (if multi-selection is enabled, only + * the item that was first selected in the list is returned - which is not very + * useful, so see @ref elm_obj_genlist_selected_items_get for when + * multi-selection is used). + * + * If no item is selected, @c null is returned. + * + * @param[in] obj The object. + * + * @return The selected item, or @c null if none is selected. + * + * @ingroup Elm_Genlist + */ +EOAPI Elm_Widget_Item *elm_obj_genlist_selected_item_get(const Eo *obj); + +/** + * @brief Get the first item in the genlist. + * + * This returns the first item in the list. + * + * If filter is set on genlist, it returns the first filtered item in the list. + * + * @param[in] obj The object. + * + * @return The first item or @c null. + * + * @ingroup Elm_Genlist + */ +EOAPI Elm_Widget_Item *elm_obj_genlist_first_item_get(const Eo *obj); + +/** + * @brief Get a list of realized items in genlist. + * + * This returns a list of the realized items in the genlist. The list contains + * genlist item pointers. The list must be freed by the caller when done with + * @ref eina_list_free. The item pointers in the list are only valid so long as + * those items are not deleted or the genlist is not deleted. + * + * @param[in] obj The object. + * + * @return List of realized items + * + * @ingroup Elm_Genlist + */ +EOAPI Eina_List *elm_obj_genlist_realized_items_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get a list of selected items in the genlist. + * + * It returns a list of the selected items. This list pointer is only valid so + * long as the selection doesn't change (no items are selected or unselected, + * or unselected implicitl by deletion). The list contains genlist items + * pointers. The order of the items in this list is the order which they were + * selected, i.e. the first item in this list is the first item that was + * selected, and so on. + * + * @note If not in multi-select mode, consider using function + * @ref elm_obj_genlist_selected_item_get instead. + * + * @param[in] obj The object. + * + * @return List of selected items + * + * @ingroup Elm_Genlist + */ +EOAPI const Eina_List *elm_obj_genlist_selected_items_get(const Eo *obj); + +/** + * @brief Get the last item in the genlist + * + * This returns the last item in the list. + * + * If filter is set to genlist, it returns last filtered item in the list. + * + * @param[in] obj The object. + * + * @return Last item in list + * + * @ingroup Elm_Genlist + */ +EOAPI Elm_Widget_Item *elm_obj_genlist_last_item_get(const Eo *obj); + +/** + * @brief Insert an item before another in a genlist widget + * + * This inserts an item before another in the list. It will be in the same tree + * level or group as the item it is inserted before. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] parent The parent item, or @c null if none. + * @param[in] before_it The item to place this new one before. + * @param[in] type Item type. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data passed to @c func above. + * + * @return Handle to inserted item + * + * @ingroup Elm_Genlist + */ +EOAPI Elm_Widget_Item *elm_obj_genlist_item_insert_before(Eo *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Widget_Item *before_it, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Update the contents of all realized items. + * + * This updates all realized items by calling all the item class functions + * again to get the contents, texts and states. Use this when the original item + * data has changed and the changes are desired to be reflected. + * + * To update just one item, use @ref elm_genlist_item_update. + * @param[in] obj The object. + * + * @ingroup Elm_Genlist + */ +EOAPI void elm_obj_genlist_realized_items_update(Eo *obj); + +/** + * @brief Insert an item after another in a genlist widget + * + * This inserts an item after another in the list. It will be in the same tree + * level or group as the item it is inserted after. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] parent The parent item, or @c null if none. + * @param[in] after_it The item to place this new one after. + * @param[in] type Item type. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data passed to @c func above. + * + * @return Handle to inserted item + * + * @ingroup Elm_Genlist + */ +EOAPI Elm_Widget_Item *elm_obj_genlist_item_insert_after(Eo *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Widget_Item *after_it, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Get the item that is at the x, y canvas coords. + * + * This returns the item at the given coordinates (which are canvas relative, + * not object-relative). If an item is at that coordinate, that item handle is + * returned, and if @c posret is not NULL, the integer pointed to is set to a + * value of -1, 0 or 1, depending if the coordinate is on the upper portion of + * that item (-1), on the middle section (0) or on the lower part (1). If NULL + * is returned as an item (no item found there), then posret may indicate -1 or + * 1 based if the coordinate is above or below all items respectively in the + * genlist. + * + * @param[in] obj The object. + * @param[in] x The input x coordinate. + * @param[in] y The input y coordinate. + * @param[out] posret The position relative to the item returned here. + * + * @return Item at position + * + * @ingroup Elm_Genlist + */ +EOAPI Elm_Widget_Item *elm_obj_genlist_at_xy_item_get(const Eo *obj, int x, int y, int *posret); + +/** + * @brief Set filter mode with key. + * + * This initiates the filter mode of genlist with user/application provided + * key. If key is NULL, the filter mode is turned off. + * + * The filter data passed has to be managed by application itself and should + * not be deleted before genlist is deleted(or while filtering is not done. + * + * @param[in] obj The object. + * @param[in] key Filter key + * + * @ingroup Elm_Genlist + */ +EOAPI void elm_obj_genlist_filter_set(Eo *obj, void *key); + +/** + * @brief Returns an iterator over the list of filtered items. + * + * Return NULL if filter is not set. Application must take care of the case + * while calling the API. Must be freed after use. + * + * @param[in] obj The object. + * + * @return Iterator on genlist + * + * @ingroup Elm_Genlist + */ +EOAPI Eina_Iterator *elm_obj_genlist_filter_iterator_new(Eo *obj); + +/** + * @brief Return how many items have passed the filter currently. + * + * This behaviour is O(1) and returns the count of items which are currently + * passed by the filter. After "filter,done", the call returns total count of + * the filtered items. + * + * @param[in] obj The object. + * + * @return Count of items passing the filter + * + * @since 1.18 + * + * @ingroup Elm_Genlist + */ +EOAPI unsigned int elm_obj_genlist_filtered_items_count(const Eo *obj); + +/** + * @brief Return how many items are currently in a list. + * + * This behavior is O(1) and includes items which may or may not be realized. + * + * @param[in] obj The object. + * + * @return Item in list + * + * @ingroup Elm_Genlist + */ +EOAPI unsigned int elm_obj_genlist_items_count(const Eo *obj); + +/** + * @brief Prepend a new item in a given genlist widget. + * + * This adds an item to the beginning of the list or beginning of the children + * of the parent if given. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] parent The parent item, or @c null if none. + * @param[in] type Item type. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data passed to @c func above. + * + * @return Handle to prepended item + * + * @ingroup Elm_Genlist + */ +EOAPI Elm_Widget_Item *elm_obj_genlist_item_prepend(Eo *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Remove all items from a given genlist widget. + * + * This removes (and deletes) all items in @c obj, leaving it empty. + * @param[in] obj The object. + * + * @ingroup Elm_Genlist + */ +EOAPI void elm_obj_genlist_clear(Eo *obj); + +/** + * @brief Append a new item in a given genlist widget. + * + * This adds the given item to the end of the list or the end of the children + * list if the @c parent is given. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] parent The parent item, or @c null if none. + * @param[in] type Item type. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data passed to @c func above. + * + * @return Handle to appended item + * + * @ingroup Elm_Genlist + */ +EOAPI Elm_Widget_Item *elm_obj_genlist_item_append(Eo *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Insert a new item into the sorted genlist object + * + * This inserts an item in the genlist based on user defined comparison + * function. The two arguments passed to the function @c func are genlist item + * handles to compare. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] parent The parent item, or @c null if none. + * @param[in] type Item type. + * @param[in] comp The function called for the sort. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data passed to @c func above. + * + * @return Handle to inserted item + * + * @ingroup Elm_Genlist + */ +EOAPI Elm_Widget_Item *elm_obj_genlist_item_sorted_insert(Eo *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Genlist_Item_Type type, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Get genlist item by given string. + * + * It takes pointer to the genlist item that will be used to start search from + * it. + * + * This function uses globs (like "*.jpg") for searching and takes search flags + * as last parameter That is a bitfield with values to be ored together or 0 + * for no flags. + * + * @param[in] obj The object. + * @param[in] item_to_search_from Pointer to item to start search from. If + * @c null, search will be started from the first item of the genlist. + * @param[in] part_name Name of the TEXT part of genlist item to search string + * in. + * @param[in] pattern The search pattern. + * @param[in] flags Search flags. + * + * @return Searched item + * + * @since 1.11 + * + * @ingroup Elm_Genlist + */ +EOAPI Elm_Widget_Item *elm_obj_genlist_search_by_text_item_get(Eo *obj, Elm_Widget_Item *item_to_search_from, const char *part_name, const char *pattern, Elm_Glob_Match_Flags flags); + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_ITEM_FOCUSED; + +/** Called when genlist item got focus + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_ITEM_FOCUSED (&(_ELM_GENLIST_EVENT_ITEM_FOCUSED)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_ITEM_UNFOCUSED; + +/** Called when genlist item lost focus + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_ITEM_UNFOCUSED (&(_ELM_GENLIST_EVENT_ITEM_UNFOCUSED)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_VBAR_DRAG; + +/** Called when vertical bar is dragged + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_VBAR_DRAG (&(_ELM_GENLIST_EVENT_VBAR_DRAG)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_VBAR_PRESS; + +/** Called when vertical bar is pressed + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_VBAR_PRESS (&(_ELM_GENLIST_EVENT_VBAR_PRESS)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_VBAR_UNPRESS; + +/** Called when vertical bar is no longer pressed + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_VBAR_UNPRESS (&(_ELM_GENLIST_EVENT_VBAR_UNPRESS)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_HBAR_DRAG; + +/** Called when horizontal bar is dragged + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_HBAR_DRAG (&(_ELM_GENLIST_EVENT_HBAR_DRAG)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_HBAR_PRESS; + +/** Called when horizontal bar is pressed + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_HBAR_PRESS (&(_ELM_GENLIST_EVENT_HBAR_PRESS)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_HBAR_UNPRESS; + +/** Called when horizontal bar is no longer pressed + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_HBAR_UNPRESS (&(_ELM_GENLIST_EVENT_HBAR_UNPRESS)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_EDGE_TOP; + +/** Called when top edge is reached + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_EDGE_TOP (&(_ELM_GENLIST_EVENT_EDGE_TOP)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_EDGE_BOTTOM; + +/** Called when bottom edge is reached + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_EDGE_BOTTOM (&(_ELM_GENLIST_EVENT_EDGE_BOTTOM)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_EDGE_LEFT; + +/** Called when left edge is reached + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_EDGE_LEFT (&(_ELM_GENLIST_EVENT_EDGE_LEFT)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_EDGE_RIGHT; + +/** Called when right edge is reached + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_EDGE_RIGHT (&(_ELM_GENLIST_EVENT_EDGE_RIGHT)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_MOVED; + +/** Called when genlist item moved + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_MOVED (&(_ELM_GENLIST_EVENT_MOVED)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_MOVED_BEFORE; + +/** Called when genlist item moved before + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_MOVED_BEFORE (&(_ELM_GENLIST_EVENT_MOVED_BEFORE)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_MOVED_AFTER; + +/** Called when genlist item moved after + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_MOVED_AFTER (&(_ELM_GENLIST_EVENT_MOVED_AFTER)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_SWIPE; + +/** Called when swipe is detected + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_SWIPE (&(_ELM_GENLIST_EVENT_SWIPE)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_MULTI_PINCH_IN; + +/** Called when multitouch pinch in detected + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_MULTI_PINCH_IN (&(_ELM_GENLIST_EVENT_MULTI_PINCH_IN)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_MULTI_PINCH_OUT; + +/** Called when multitouch pinch out detected + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_MULTI_PINCH_OUT (&(_ELM_GENLIST_EVENT_MULTI_PINCH_OUT)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_MULTI_SWIPE_DOWN; + +/** Called when multitouch swipe down detected + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_MULTI_SWIPE_DOWN (&(_ELM_GENLIST_EVENT_MULTI_SWIPE_DOWN)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_MULTI_SWIPE_UP; + +/** Called when multitouch swipe up detected + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_MULTI_SWIPE_UP (&(_ELM_GENLIST_EVENT_MULTI_SWIPE_UP)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_MULTI_SWIPE_RIGHT; + +/** Called when multitouch swipe right detected + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_MULTI_SWIPE_RIGHT (&(_ELM_GENLIST_EVENT_MULTI_SWIPE_RIGHT)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_MULTI_SWIPE_LEFT; + +/** Called when multitouch swipe left detected + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_MULTI_SWIPE_LEFT (&(_ELM_GENLIST_EVENT_MULTI_SWIPE_LEFT)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_RELEASED; + +/** Called when genlist is released + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_RELEASED (&(_ELM_GENLIST_EVENT_RELEASED)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_ACTIVATED; + +/** called when genlist is activated + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_ACTIVATED (&(_ELM_GENLIST_EVENT_ACTIVATED)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_HIGHLIGHTED; + +/** Called when genlist is highlighted + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_HIGHLIGHTED (&(_ELM_GENLIST_EVENT_HIGHLIGHTED)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_UNHIGHLIGHTED; + +/** Called when genlist is no longer highlighted + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_UNHIGHLIGHTED (&(_ELM_GENLIST_EVENT_UNHIGHLIGHTED)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_REALIZED; + +/** Called when genlist is realized + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_REALIZED (&(_ELM_GENLIST_EVENT_REALIZED)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_UNREALIZED; + +/** Called when genlist is unrealized + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_UNREALIZED (&(_ELM_GENLIST_EVENT_UNREALIZED)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_CONTRACT_REQUEST; + +/** Called when contract is requested + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_CONTRACT_REQUEST (&(_ELM_GENLIST_EVENT_CONTRACT_REQUEST)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_EXPAND_REQUEST; + +/** Called when expand is requested + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_EXPAND_REQUEST (&(_ELM_GENLIST_EVENT_EXPAND_REQUEST)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_CONTRACTED; + +/** called when genlist is contracted + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_CONTRACTED (&(_ELM_GENLIST_EVENT_CONTRACTED)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_EXPANDED; + +/** Called when genlist is expanded + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_EXPANDED (&(_ELM_GENLIST_EVENT_EXPANDED)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_INDEX_UPDATE; + +/** Called when genlist index updated + * @return Efl_Object * + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_INDEX_UPDATE (&(_ELM_GENLIST_EVENT_INDEX_UPDATE)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_TREE_EFFECT_FINISHED; + +/** Called when genlist tree effect finished + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_TREE_EFFECT_FINISHED (&(_ELM_GENLIST_EVENT_TREE_EFFECT_FINISHED)) + +EWAPI extern const Efl_Event_Description _ELM_GENLIST_EVENT_FILTER_DONE; + +/** Called when genlist filter is done + * + * @ingroup Elm_Genlist + */ +#define ELM_GENLIST_EVENT_FILTER_DONE (&(_ELM_GENLIST_EVENT_FILTER_DONE)) + +#endif diff --git a/src/lib/elementary/elm_genlist_eo.legacy.c b/src/lib/elementary/elm_genlist_eo.legacy.c new file mode 100644 index 0000000000..6f9cdf2eda --- /dev/null +++ b/src/lib/elementary/elm_genlist_eo.legacy.c @@ -0,0 +1,258 @@ + +EAPI void +elm_genlist_homogeneous_set(Elm_Genlist *obj, Eina_Bool homogeneous) +{ + elm_obj_genlist_homogeneous_set(obj, homogeneous); +} + +EAPI Eina_Bool +elm_genlist_homogeneous_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_homogeneous_get(obj); +} + +EAPI void +elm_genlist_select_mode_set(Elm_Genlist *obj, Elm_Object_Select_Mode mode) +{ + elm_obj_genlist_select_mode_set(obj, mode); +} + +EAPI Elm_Object_Select_Mode +elm_genlist_select_mode_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_select_mode_get(obj); +} + +EAPI void +elm_genlist_focus_on_selection_set(Elm_Genlist *obj, Eina_Bool enabled) +{ + elm_obj_genlist_focus_on_selection_set(obj, enabled); +} + +EAPI Eina_Bool +elm_genlist_focus_on_selection_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_focus_on_selection_get(obj); +} + +EAPI void +elm_genlist_longpress_timeout_set(Elm_Genlist *obj, double timeout) +{ + elm_obj_genlist_longpress_timeout_set(obj, timeout); +} + +EAPI double +elm_genlist_longpress_timeout_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_longpress_timeout_get(obj); +} + +EAPI void +elm_genlist_multi_select_set(Elm_Genlist *obj, Eina_Bool multi) +{ + elm_obj_genlist_multi_select_set(obj, multi); +} + +EAPI Eina_Bool +elm_genlist_multi_select_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_multi_select_get(obj); +} + +EAPI void +elm_genlist_reorder_mode_set(Elm_Genlist *obj, Eina_Bool reorder_mode) +{ + elm_obj_genlist_reorder_mode_set(obj, reorder_mode); +} + +EAPI Eina_Bool +elm_genlist_reorder_mode_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_reorder_mode_get(obj); +} + +EAPI void +elm_genlist_decorate_mode_set(Elm_Genlist *obj, Eina_Bool decorated) +{ + elm_obj_genlist_decorate_mode_set(obj, decorated); +} + +EAPI Eina_Bool +elm_genlist_decorate_mode_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_decorate_mode_get(obj); +} + +EAPI void +elm_genlist_multi_select_mode_set(Elm_Genlist *obj, Elm_Object_Multi_Select_Mode mode) +{ + elm_obj_genlist_multi_select_mode_set(obj, mode); +} + +EAPI Elm_Object_Multi_Select_Mode +elm_genlist_multi_select_mode_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_multi_select_mode_get(obj); +} + +EAPI void +elm_genlist_block_count_set(Elm_Genlist *obj, int count) +{ + elm_obj_genlist_block_count_set(obj, count); +} + +EAPI int +elm_genlist_block_count_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_block_count_get(obj); +} + +EAPI void +elm_genlist_tree_effect_enabled_set(Elm_Genlist *obj, Eina_Bool enabled) +{ + elm_obj_genlist_tree_effect_enabled_set(obj, enabled); +} + +EAPI Eina_Bool +elm_genlist_tree_effect_enabled_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_tree_effect_enabled_get(obj); +} + +EAPI void +elm_genlist_highlight_mode_set(Elm_Genlist *obj, Eina_Bool highlight) +{ + elm_obj_genlist_highlight_mode_set(obj, highlight); +} + +EAPI Eina_Bool +elm_genlist_highlight_mode_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_highlight_mode_get(obj); +} + +EAPI void +elm_genlist_mode_set(Elm_Genlist *obj, Elm_List_Mode mode) +{ + elm_obj_genlist_mode_set(obj, mode); +} + +EAPI Elm_List_Mode +elm_genlist_mode_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_mode_get(obj); +} + +EAPI Elm_Widget_Item * +elm_genlist_decorated_item_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_decorated_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_genlist_selected_item_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_selected_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_genlist_first_item_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_first_item_get(obj); +} + +EAPI Eina_List * +elm_genlist_realized_items_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_realized_items_get(obj); +} + +EAPI const Eina_List * +elm_genlist_selected_items_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_selected_items_get(obj); +} + +EAPI Elm_Widget_Item * +elm_genlist_last_item_get(const Elm_Genlist *obj) +{ + return elm_obj_genlist_last_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_genlist_item_insert_before(Elm_Genlist *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Widget_Item *before_it, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data) +{ + return elm_obj_genlist_item_insert_before(obj, itc, data, parent, before_it, type, func, func_data); +} + +EAPI void +elm_genlist_realized_items_update(Elm_Genlist *obj) +{ + elm_obj_genlist_realized_items_update(obj); +} + +EAPI Elm_Widget_Item * +elm_genlist_item_insert_after(Elm_Genlist *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Widget_Item *after_it, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data) +{ + return elm_obj_genlist_item_insert_after(obj, itc, data, parent, after_it, type, func, func_data); +} + +EAPI Elm_Widget_Item * +elm_genlist_at_xy_item_get(const Elm_Genlist *obj, int x, int y, int *posret) +{ + return elm_obj_genlist_at_xy_item_get(obj, x, y, posret); +} + +EAPI void +elm_genlist_filter_set(Elm_Genlist *obj, void *key) +{ + elm_obj_genlist_filter_set(obj, key); +} + +EAPI Eina_Iterator * +elm_genlist_filter_iterator_new(Elm_Genlist *obj) +{ + return elm_obj_genlist_filter_iterator_new(obj); +} + +EAPI unsigned int +elm_genlist_filtered_items_count(const Elm_Genlist *obj) +{ + return elm_obj_genlist_filtered_items_count(obj); +} + +EAPI unsigned int +elm_genlist_items_count(const Elm_Genlist *obj) +{ + return elm_obj_genlist_items_count(obj); +} + +EAPI Elm_Widget_Item * +elm_genlist_item_prepend(Elm_Genlist *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data) +{ + return elm_obj_genlist_item_prepend(obj, itc, data, parent, type, func, func_data); +} + +EAPI void +elm_genlist_clear(Elm_Genlist *obj) +{ + elm_obj_genlist_clear(obj); +} + +EAPI Elm_Widget_Item * +elm_genlist_item_append(Elm_Genlist *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data) +{ + return elm_obj_genlist_item_append(obj, itc, data, parent, type, func, func_data); +} + +EAPI Elm_Widget_Item * +elm_genlist_item_sorted_insert(Elm_Genlist *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Genlist_Item_Type type, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data) +{ + return elm_obj_genlist_item_sorted_insert(obj, itc, data, parent, type, comp, func, func_data); +} + +EAPI Elm_Widget_Item * +elm_genlist_search_by_text_item_get(Elm_Genlist *obj, Elm_Widget_Item *item_to_search_from, const char *part_name, const char *pattern, Elm_Glob_Match_Flags flags) +{ + return elm_obj_genlist_search_by_text_item_get(obj, item_to_search_from, part_name, pattern, flags); +} diff --git a/src/lib/elementary/elm_genlist_eo.legacy.h b/src/lib/elementary/elm_genlist_eo.legacy.h new file mode 100644 index 0000000000..bf0025851c --- /dev/null +++ b/src/lib/elementary/elm_genlist_eo.legacy.h @@ -0,0 +1,704 @@ +#ifndef _ELM_GENLIST_EO_LEGACY_H_ +#define _ELM_GENLIST_EO_LEGACY_H_ + +#ifndef _ELM_GENLIST_EO_CLASS_TYPE +#define _ELM_GENLIST_EO_CLASS_TYPE + +typedef Eo Elm_Genlist; + +#endif + +#ifndef _ELM_GENLIST_EO_TYPES +#define _ELM_GENLIST_EO_TYPES + + +#endif + +/** + * @brief Enable/disable homogeneous mode. + * + * This will enable the homogeneous mode where items are of the same height and + * width so that genlist may do the lazy-loading at its maximum (which + * increases the performance for scrolling the list). In the normal mode, + * genlist will pre-calculate all the items' sizes even though they are not in + * use. So items' callbacks are called many times than expected. But + * homogeneous mode will skip the item size pre-calculation process so items' + * callbacks are called only when the item is needed. + * + * @note This also works well with group index. + * + * @param[in] obj The object. + * @param[in] homogeneous Assume the items within the genlist are of the same + * height and width. Default is @c false. + * + * @ingroup Elm_Genlist_Group + */ +EAPI void elm_genlist_homogeneous_set(Elm_Genlist *obj, Eina_Bool homogeneous); + +/** + * @brief Get whether the homogeneous mode is enabled. + * + * @param[in] obj The object. + * + * @return Assume the items within the genlist are of the same height and + * width. Default is @c false. + * + * @ingroup Elm_Genlist_Group + */ +EAPI Eina_Bool elm_genlist_homogeneous_get(const Elm_Genlist *obj); + +/** + * @brief Set the genlist select mode. + * + * #ELM_OBJECT_SELECT_MODE_DEFAULT means that items will call their selection + * func and callback once when first becoming selected. Any further clicks will + * do nothing, unless you set always select mode. ELM_OBJECT_SELECT_MODE_ALWAYS + * means that even if selected, every click will make the selected callbacks be + * called. #ELM_OBJECT_SELECT_MODE_NONE will turn off the ability to select + * items entirely and they will neither appear selected nor call selected + * callback functions. + * + * @param[in] obj The object. + * @param[in] mode The select mode. + * + * @ingroup Elm_Genlist_Group + */ +EAPI void elm_genlist_select_mode_set(Elm_Genlist *obj, Elm_Object_Select_Mode mode); + +/** + * @brief Get the genlist select mode. + * + * @param[in] obj The object. + * + * @return The select mode. + * + * @ingroup Elm_Genlist_Group + */ +EAPI Elm_Object_Select_Mode elm_genlist_select_mode_get(const Elm_Genlist *obj); + +/** + * @brief Set focus upon items selection mode + * + * When enabled, every selection of an item inside the genlist will + * automatically set focus to its first focusable widget from the left. This is + * true of course if the selection was made by clicking an unfocusable area in + * an item or selecting it with a key movement. Clicking on a focusable widget + * inside an item will cause this particular item to get focus as usual. + * + * @param[in] obj The object. + * @param[in] enabled The tree effect status. + * + * @ingroup Elm_Genlist_Group + */ +EAPI void elm_genlist_focus_on_selection_set(Elm_Genlist *obj, Eina_Bool enabled); + +/** + * @brief Get whether focus upon item's selection mode is enabled. + * + * @param[in] obj The object. + * + * @return The tree effect status. + * + * @ingroup Elm_Genlist_Group + */ +EAPI Eina_Bool elm_genlist_focus_on_selection_get(const Elm_Genlist *obj); + +/** + * @brief Set the timeout in seconds for the longpress event. + * + * This option will change how long it takes to send an event "longpressed" + * after the mouse down signal is sent to the list. If this event occurs, no + * "clicked" event will be sent. + * + * @warning If you set the longpress timeout value with this API, your genlist + * will not be affected by the longpress value of elementary config value + * later. + * + * @param[in] obj The object. + * @param[in] timeout Timeout in seconds. Default is elm config value (1.0). + * + * @ingroup Elm_Genlist_Group + */ +EAPI void elm_genlist_longpress_timeout_set(Elm_Genlist *obj, double timeout); + +/** + * @brief Get the timeout in seconds for the longpress event. + * + * @param[in] obj The object. + * + * @return Timeout in seconds. Default is elm config value (1.0). + * + * @ingroup Elm_Genlist_Group + */ +EAPI double elm_genlist_longpress_timeout_get(const Elm_Genlist *obj); + +/** + * @brief Enable or disable multi-selection in the genlist. + * + * This enables ($true) or disables ($false) multi-selection in the list. This + * allows more than 1 item to be selected. To retrieve the list of selected + * items, use @ref elm_genlist_selected_items_get. + * + * @param[in] obj The object. + * @param[in] multi Multi-select enable/disable. Default is disabled. + * + * @ingroup Elm_Genlist_Group + */ +EAPI void elm_genlist_multi_select_set(Elm_Genlist *obj, Eina_Bool multi); + +/** + * @brief Get if multi-selection in genlist is enabled or disabled. + * + * @param[in] obj The object. + * + * @return Multi-select enable/disable. Default is disabled. + * + * @ingroup Elm_Genlist_Group + */ +EAPI Eina_Bool elm_genlist_multi_select_get(const Elm_Genlist *obj); + +/** + * @brief Set reorder mode. + * + * After turning on the reorder mode, longpress on normal item will trigger + * reordering of the item. You can move the item up and down. However, reorder + * does not work with group item. + * + * @param[in] obj The object. + * @param[in] reorder_mode The reorder mode. + * + * @ingroup Elm_Genlist_Group + */ +EAPI void elm_genlist_reorder_mode_set(Elm_Genlist *obj, Eina_Bool reorder_mode); + +/** + * @brief Get the reorder mode. + * + * @param[in] obj The object. + * + * @return The reorder mode. + * + * @ingroup Elm_Genlist_Group + */ +EAPI Eina_Bool elm_genlist_reorder_mode_get(const Elm_Genlist *obj); + +/** + * @brief Set Genlist decorate mode. + * + * This sets Genlist decorate mode to all items. + * + * @param[in] obj The object. + * @param[in] decorated The decorate mode status. + * + * @ingroup Elm_Genlist_Group + */ +EAPI void elm_genlist_decorate_mode_set(Elm_Genlist *obj, Eina_Bool decorated); + +/** + * @brief Get Genlist decorate mode. + * + * @param[in] obj The object. + * + * @return The decorate mode status. + * + * @ingroup Elm_Genlist_Group + */ +EAPI Eina_Bool elm_genlist_decorate_mode_get(const Elm_Genlist *obj); + +/** + * @brief Set the genlist multi select mode. + * + * #ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT means that select/unselect items + * whenever each item is clicked. #ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL + * means that only one item will be selected although multi-selection is + * enabled, if clicked without pressing control key. This mode is only + * available with multi-selection. + * + * @param[in] obj The object. + * @param[in] mode The multi select mode + * + * @since 1.8 + * + * @ingroup Elm_Genlist_Group + */ +EAPI void elm_genlist_multi_select_mode_set(Elm_Genlist *obj, Elm_Object_Multi_Select_Mode mode); + +/** + * @brief Get the genlist multi select mode. + * + * @param[in] obj The object. + * + * @return The multi select mode + * + * @since 1.8 + * + * @ingroup Elm_Genlist_Group + */ +EAPI Elm_Object_Multi_Select_Mode elm_genlist_multi_select_mode_get(const Elm_Genlist *obj); + +/** + * @brief Set the maximum number of items within an item block. + * + * This will configure the block count to tune to the target with particular + * performance matrix. + * + * A block of objects will be used to reduce the number of operations due to + * many objects in the screen. It can determine the visibility, or if the + * object has changed, it theme needs to be updated, etc. doing this kind of + * calculation to the entire block, instead of per object. + * + * The default value for the block count is enough for most lists, so unless + * you know you will have a lot of objects visible in the screen at the same + * time, don't try to change this. + * + * @param[in] obj The object. + * @param[in] count Maximum number of items within an item block. Default is + * 32. + * + * @ingroup Elm_Genlist_Group + */ +EAPI void elm_genlist_block_count_set(Elm_Genlist *obj, int count); + +/** + * @brief Get the maximum number of items within an item block. + * + * @param[in] obj The object. + * + * @return Maximum number of items within an item block. Default is 32. + * + * @ingroup Elm_Genlist_Group + */ +EAPI int elm_genlist_block_count_get(const Elm_Genlist *obj); + +/** + * @brief Control genlist tree effect. + * + * @param[in] obj The object. + * @param[in] enabled The tree effect status. + * + * @ingroup Elm_Genlist_Group + */ +EAPI void elm_genlist_tree_effect_enabled_set(Elm_Genlist *obj, Eina_Bool enabled); + +/** + * @brief Control genlist tree effect. + * + * @param[in] obj The object. + * + * @return The tree effect status. + * + * @ingroup Elm_Genlist_Group + */ +EAPI Eina_Bool elm_genlist_tree_effect_enabled_get(const Elm_Genlist *obj); + +/** + * @brief Set whether the genlist items should be highlighted on item + * selection. + * + * This will turn on/off the highlight effect on item selection. The selected + * and clicked callback functions will still be called. + * + * Highlight is enabled by default. + * + * @param[in] obj The object. + * @param[in] highlight @c true to enable highlighting or @c false to disable + * it. + * + * @ingroup Elm_Genlist_Group + */ +EAPI void elm_genlist_highlight_mode_set(Elm_Genlist *obj, Eina_Bool highlight); + +/** + * @brief Get whether the genlist items' should be highlighted when item + * selected. + * + * @param[in] obj The object. + * + * @return @c true to enable highlighting or @c false to disable it. + * + * @ingroup Elm_Genlist_Group + */ +EAPI Eina_Bool elm_genlist_highlight_mode_get(const Elm_Genlist *obj); + +/** + * @brief This sets the horizontal stretching mode. + * + * This sets the mode used for sizing items horizontally. Valid modes are + * @ref ELM_LIST_LIMIT, @ref ELM_LIST_SCROLL, and @ref ELM_LIST_COMPRESS. The + * default is @ref ELM_LIST_SCROLL. This mode means that if items are too wide + * to fit, the scroller will scroll horizontally. Otherwise items are expanded + * to fill the width of the viewport of the scroller. If it is + * @ref ELM_LIST_LIMIT, items will be expanded to the viewport width and + * limited to that size. If it is @ref ELM_LIST_COMPRESS, the item width will + * be fixed (restricted to a minimum of) to the list width when calculating its + * size in order to allow the height to be calculated based on it. This allows, + * for instance, text block to wrap lines if the Edje part is configured with + * "text.min: 0 1". + * + * @note @ref ELM_LIST_COMPRESS will make list resize slower as it will have to + * recalculate every item height again whenever the list width changes! + * + * @note Homogeneous mode gives all items in the genlist the same width/height. + * With @ref ELM_LIST_COMPRESS, genlist items initialize fast, but there cannot + * be any sub-objects in the genlist which require on-the-fly resizing (such as + * TEXTBLOCK). In this case some dynamic resizable objects in the genlist might + * not diplay properly. + * + * @param[in] obj The object. + * @param[in] mode The mode to use (one of @ref ELM_LIST_SCROLL or + * @ref ELM_LIST_LIMIT). + * + * @ingroup Elm_Genlist_Group + */ +EAPI void elm_genlist_mode_set(Elm_Genlist *obj, Elm_List_Mode mode); + +/** + * @brief Get the horizontal stretching mode. + * + * @param[in] obj The object. + * + * @return The mode to use (one of @ref ELM_LIST_SCROLL or + * @ref ELM_LIST_LIMIT). + * + * @ingroup Elm_Genlist_Group + */ +EAPI Elm_List_Mode elm_genlist_mode_get(const Elm_Genlist *obj); + +/** + * @brief Get active genlist mode item. + * + * This function returns the item that was activated with a mode, by the + * function @ref elm_genlist_decorate_mode_set. + * + * @param[in] obj The object. + * + * @return The active item for that current mode. Or @c null if no item is + * activated with any mode. + * + * @ingroup Elm_Genlist_Group + */ +EAPI Elm_Widget_Item *elm_genlist_decorated_item_get(const Elm_Genlist *obj); + +/** + * @brief Get the selected item in the genlist. + * + * This gets the selected item in the list (if multi-selection is enabled, only + * the item that was first selected in the list is returned - which is not very + * useful, so see @ref elm_genlist_selected_items_get for when multi-selection + * is used). + * + * If no item is selected, @c null is returned. + * + * @param[in] obj The object. + * + * @return The selected item, or @c null if none is selected. + * + * @ingroup Elm_Genlist_Group + */ +EAPI Elm_Widget_Item *elm_genlist_selected_item_get(const Elm_Genlist *obj); + +/** + * @brief Get the first item in the genlist. + * + * This returns the first item in the list. + * + * If filter is set on genlist, it returns the first filtered item in the list. + * + * @param[in] obj The object. + * + * @return The first item or @c null. + * + * @ingroup Elm_Genlist_Group + */ +EAPI Elm_Widget_Item *elm_genlist_first_item_get(const Elm_Genlist *obj); + +/** + * @brief Get a list of realized items in genlist. + * + * This returns a list of the realized items in the genlist. The list contains + * genlist item pointers. The list must be freed by the caller when done with + * @ref eina_list_free. The item pointers in the list are only valid so long as + * those items are not deleted or the genlist is not deleted. + * + * @param[in] obj The object. + * + * @return List of realized items + * + * @ingroup Elm_Genlist_Group + */ +EAPI Eina_List *elm_genlist_realized_items_get(const Elm_Genlist *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get a list of selected items in the genlist. + * + * It returns a list of the selected items. This list pointer is only valid so + * long as the selection doesn't change (no items are selected or unselected, + * or unselected implicitl by deletion). The list contains genlist items + * pointers. The order of the items in this list is the order which they were + * selected, i.e. the first item in this list is the first item that was + * selected, and so on. + * + * @note If not in multi-select mode, consider using function + * @ref elm_genlist_selected_item_get instead. + * + * @param[in] obj The object. + * + * @return List of selected items + * + * @ingroup Elm_Genlist_Group + */ +EAPI const Eina_List *elm_genlist_selected_items_get(const Elm_Genlist *obj); + +/** + * @brief Get the last item in the genlist + * + * This returns the last item in the list. + * + * If filter is set to genlist, it returns last filtered item in the list. + * + * @param[in] obj The object. + * + * @return Last item in list + * + * @ingroup Elm_Genlist_Group + */ +EAPI Elm_Widget_Item *elm_genlist_last_item_get(const Elm_Genlist *obj); + +/** + * @brief Insert an item before another in a genlist widget + * + * This inserts an item before another in the list. It will be in the same tree + * level or group as the item it is inserted before. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] parent The parent item, or @c null if none. + * @param[in] before_it The item to place this new one before. + * @param[in] type Item type. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data passed to @c func above. + * + * @return Handle to inserted item + * + * @ingroup Elm_Genlist_Group + */ +EAPI Elm_Widget_Item *elm_genlist_item_insert_before(Elm_Genlist *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Widget_Item *before_it, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Update the contents of all realized items. + * + * This updates all realized items by calling all the item class functions + * again to get the contents, texts and states. Use this when the original item + * data has changed and the changes are desired to be reflected. + * + * To update just one item, use @ref elm_genlist_item_update. + * @param[in] obj The object. + * + * @ingroup Elm_Genlist_Group + */ +EAPI void elm_genlist_realized_items_update(Elm_Genlist *obj); + +/** + * @brief Insert an item after another in a genlist widget + * + * This inserts an item after another in the list. It will be in the same tree + * level or group as the item it is inserted after. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] parent The parent item, or @c null if none. + * @param[in] after_it The item to place this new one after. + * @param[in] type Item type. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data passed to @c func above. + * + * @return Handle to inserted item + * + * @ingroup Elm_Genlist_Group + */ +EAPI Elm_Widget_Item *elm_genlist_item_insert_after(Elm_Genlist *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Widget_Item *after_it, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Get the item that is at the x, y canvas coords. + * + * This returns the item at the given coordinates (which are canvas relative, + * not object-relative). If an item is at that coordinate, that item handle is + * returned, and if @c posret is not NULL, the integer pointed to is set to a + * value of -1, 0 or 1, depending if the coordinate is on the upper portion of + * that item (-1), on the middle section (0) or on the lower part (1). If NULL + * is returned as an item (no item found there), then posret may indicate -1 or + * 1 based if the coordinate is above or below all items respectively in the + * genlist. + * + * @param[in] obj The object. + * @param[in] x The input x coordinate. + * @param[in] y The input y coordinate. + * @param[out] posret The position relative to the item returned here. + * + * @return Item at position + * + * @ingroup Elm_Genlist_Group + */ +EAPI Elm_Widget_Item *elm_genlist_at_xy_item_get(const Elm_Genlist *obj, int x, int y, int *posret); + +/** + * @brief Set filter mode with key. + * + * This initiates the filter mode of genlist with user/application provided + * key. If key is NULL, the filter mode is turned off. + * + * The filter data passed has to be managed by application itself and should + * not be deleted before genlist is deleted(or while filtering is not done. + * + * @param[in] obj The object. + * @param[in] key Filter key + * + * @ingroup Elm_Genlist_Group + */ +EAPI void elm_genlist_filter_set(Elm_Genlist *obj, void *key); + +/** + * @brief Returns an iterator over the list of filtered items. + * + * Return NULL if filter is not set. Application must take care of the case + * while calling the API. Must be freed after use. + * + * @param[in] obj The object. + * + * @return Iterator on genlist + * + * @ingroup Elm_Genlist_Group + */ +EAPI Eina_Iterator *elm_genlist_filter_iterator_new(Elm_Genlist *obj); + +/** + * @brief Return how many items have passed the filter currently. + * + * This behaviour is O(1) and returns the count of items which are currently + * passed by the filter. After "filter,done", the call returns total count of + * the filtered items. + * + * @param[in] obj The object. + * + * @return Count of items passing the filter + * + * @since 1.18 + * + * @ingroup Elm_Genlist_Group + */ +EAPI unsigned int elm_genlist_filtered_items_count(const Elm_Genlist *obj); + +/** + * @brief Return how many items are currently in a list. + * + * This behavior is O(1) and includes items which may or may not be realized. + * + * @param[in] obj The object. + * + * @return Item in list + * + * @ingroup Elm_Genlist_Group + */ +EAPI unsigned int elm_genlist_items_count(const Elm_Genlist *obj); + +/** + * @brief Prepend a new item in a given genlist widget. + * + * This adds an item to the beginning of the list or beginning of the children + * of the parent if given. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] parent The parent item, or @c null if none. + * @param[in] type Item type. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data passed to @c func above. + * + * @return Handle to prepended item + * + * @ingroup Elm_Genlist_Group + */ +EAPI Elm_Widget_Item *elm_genlist_item_prepend(Elm_Genlist *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Remove all items from a given genlist widget. + * + * This removes (and deletes) all items in @c obj, leaving it empty. + * @param[in] obj The object. + * + * @ingroup Elm_Genlist_Group + */ +EAPI void elm_genlist_clear(Elm_Genlist *obj); + +/** + * @brief Append a new item in a given genlist widget. + * + * This adds the given item to the end of the list or the end of the children + * list if the @c parent is given. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] parent The parent item, or @c null if none. + * @param[in] type Item type. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data passed to @c func above. + * + * @return Handle to appended item + * + * @ingroup Elm_Genlist_Group + */ +EAPI Elm_Widget_Item *elm_genlist_item_append(Elm_Genlist *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Insert a new item into the sorted genlist object + * + * This inserts an item in the genlist based on user defined comparison + * function. The two arguments passed to the function @c func are genlist item + * handles to compare. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item data. + * @param[in] parent The parent item, or @c null if none. + * @param[in] type Item type. + * @param[in] comp The function called for the sort. + * @param[in] func Convenience function called when the item is selected. + * @param[in] func_data Data passed to @c func above. + * + * @return Handle to inserted item + * + * @ingroup Elm_Genlist_Group + */ +EAPI Elm_Widget_Item *elm_genlist_item_sorted_insert(Elm_Genlist *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Widget_Item *parent, Elm_Genlist_Item_Type type, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data); + +/** + * @brief Get genlist item by given string. + * + * It takes pointer to the genlist item that will be used to start search from + * it. + * + * This function uses globs (like "*.jpg") for searching and takes search flags + * as last parameter That is a bitfield with values to be ored together or 0 + * for no flags. + * + * @param[in] obj The object. + * @param[in] item_to_search_from Pointer to item to start search from. If + * @c null, search will be started from the first item of the genlist. + * @param[in] part_name Name of the TEXT part of genlist item to search string + * in. + * @param[in] pattern The search pattern. + * @param[in] flags Search flags. + * + * @return Searched item + * + * @since 1.11 + * + * @ingroup Elm_Genlist_Group + */ +EAPI Elm_Widget_Item *elm_genlist_search_by_text_item_get(Elm_Genlist *obj, Elm_Widget_Item *item_to_search_from, const char *part_name, const char *pattern, Elm_Glob_Match_Flags flags); + +#endif diff --git a/src/lib/elementary/elm_genlist_item.eo b/src/lib/elementary/elm_genlist_item.eo deleted file mode 100644 index b9fa121452..0000000000 --- a/src/lib/elementary/elm_genlist_item.eo +++ /dev/null @@ -1,437 +0,0 @@ -import elm_general; - -class Elm.Genlist.Item extends Elm.Widget.Item.Static_Focus implements Efl.Ui.Legacy -{ - [[Elementary genlist item class]] - legacy_prefix: elm_genlist_item; - eo_prefix: elm_obj_genlist_item; - data: Elm_Gen_Item; - methods { - @property prev { - get { - [[Get the previous item in a genlist widget's internal - list of items, given a handle to one of those items. - - This returns the item placed before the $item, on - the container genlist. - - 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 { - item: Elm.Widget.Item; [[The item before $item, or $null if there's none (and on errors).]] - } - } - @property next { - get { - [[Get the next item in a genlist widget's internal lis - of items, given a handle to one of those items. - - This returns the item placed after the $item, on - the container genlist. - - If filter is set on genlist, this returns the filtered - item placed after $item in the list. - - 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_item { - get { - [[Get the parent item of the given item - - This returns the item that was specified as parent - 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.]] - } - } - @property subitems { - get { - [[Get the list of subitems of a given item - - This returns the list of subitems that an item - possesses. It cannot be changed. - - @since 1.9 - ]] - } - values { - subitems: const(list); [[The list of subitems, $null on error.]] - } - } - @property selected { - get { - [[Get whether a given genlist item is selected or not.]] - } - set { - [[Set whether a given genlist item is selected or not - - This sets the selected state of an item. If multi - selection is not enabled on the containing genlist - and $selected is $true, any other previously selected - items will get unselected in favor of this new one. - ]] - } - values { - selected: bool; [[The selected state ($true selected, $false not selected).]] - } - } - @property expanded { - get { - [[Get the expanded state of an item - - This gets the expanded state of an item. - ]] - } - set { - [[Sets the expanded state of an item. - - This function flags the item of type - #ELM_GENLIST_ITEM_TREE as expanded or not. - - The theme will respond to this change visually, and - a signal "expanded" or "contracted" will be sent - from the genlist with a pointer to the item that - has been expanded/contracted. - - Calling this function won't show or hide any child - of this item (if it is a parent). You must manually - delete and create them on the callbacks of - the "expanded" or "contracted" signals. - ]] - } - values { - expanded: bool; [[The expanded state ($true expanded, $false not expanded).]] - } - } - @property expanded_depth { - get { - [[Get the depth of expanded item.]] - } - values { - depth: int; [[The depth of expanded item.]] - } - } - @property item_class { - get { - [[Get the Genlist Item class for the given Genlist Item. - - This returns the Genlist_Item_Class for the given item. - It can be used to examine the function pointers and - item_style. - ]] - } - values { - @cref itc: Elm.Genlist.Item.Class; [[Genlist Item class for the given item.]] - } - } - @property index { - get { - [[Get the index of the item. It is only valid once displayed. - - The index start from 1. - ]] - } - values { - index: int(-1); [[The position inside the list of item.]] - } - } - @property decorate_mode { - get { - [[Get the item's decorate mode. - - This function just returns the name of the item's - decorate mode. - ]] - } - values { - decorate_it_type: string; [[Name of the item's decorate mode.]] - } - } - @property flip { - get { - [[Get the flip state of a given genlist item. - - This function returns the flip state of a given - genlist item. If the parameter is invalid, it - returns $false. - ]] - } - set { - [[Set the flip state of a given genlist item. - - This function sets the flip state of a given genlist - item. Flip mode overrides current item object. - It can be used for on-the-fly item replace. - Flip mode can be used with/without decorate mode. - ]] - } - values { - flip: bool; [[The flip mode.]] - } - } - @property select_mode { - get { - [[Get the genlist item's select mode. - - It's ELM_OBJECT_SELECT_MODE_MAX on failure. - ]] - } - set { - [[Set the genlist item's select mode. - - ELM_OBJECT_SELECT_MODE_DEFAULT means that the item - will only call their selection func and callback - when first becoming selected. Any further clicks will - do nothing, unless you set always select mode. - - ELM_OBJECT_SELECT_MODE_ALWAYS means that even if - selected, every click will make the selected - callbacks be called. - - ELM_OBJECT_SELECT_MODE_NONE will turn off the ability - to select the item entirely and they will neither - appear selected nor call selected callback functions. - - ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY will apply - no-finger-size rule with ELM_OBJECT_SELECT_MODE_NONE. - No-finger-size rule makes an item can be smaller - than lower limit. Clickable objects should be bigger - than human touch point device (your finger) for - some touch or small screen devices. So it is - enabled, the item can be shrink than predefined - finger-size value. And the item will be updated. - ]] - } - values { - mode: Elm.Object.Select_Mode(Elm.Object.Select_Mode.max); [[The selected mode.]] - } - } - @property type { - get { - [[Get the Item's type. - - This function returns the item's type. Normally the - item's type. If it failed, return value is - ELM_GENLIST_ITEM_MAX. - ]] - } - values { - type: Elm.Genlist.Item.Type(Elm.Genlist.Item.Type.max); [[Item type.]] - } - } - @property pin { - get { - [[Get whether a given genlist item is pinned or not.]] - } - set { - [[Set whether a given genlist item is pinned or not - - This sets a genlist item as pinned so that it will be always available in - the viewport available for user interaction. Group items cannot be pinned. - Also when a new item is pinned, the current pinned item will get unpinned. - Item pinning cannot be done in reorder mode too. - ]] - } - values { - pin: bool; [[The item pin state state ($true pin item, $false unpin item).]] - } - } - /* init { FIXME - params { - Evas_Smart_Cb func; - const(void_ptr) data; - } - }*/ - subitems_count { - [[Get the number of subitems of a given item. - - This returns the number of subitems that an item possesses. - - @since 1.9 - ]] - return: uint; [[The number of subitems, 0 on error.]] - } - subitems_clear{ - [[Remove all sub-items (children) of the given item. - - This removes all items that are children (and their - descendants) of the given item $it. - ]] - } - promote { - [[Promote an item to the top of the list.]] - } - demote { - [[Demote an item to the end of the list.]] - } - show { - [[Show the portion of a genlist's internal list containing - a given item, immediately. - - This causes genlist to jump to the given item $it and - show it (by jumping to that position), if it is not - fully visible. - ]] - params { - @in type: Elm.Genlist.Item.Scrollto_Type; [[The position to bring in, the given item to. - \@ref Elm_Genlist_Item_Scrollto_Type.]] - } - } - bring_in { - [[Animatedly bring in, to the visible area of a genlist, a - given item on it. - - This causes genlist to jump to the given item $it and - show it (by animatedly scrolling), if it is not fully - visible. This may use animation and take a some time - to do so. - ]] - params { - @in type: Elm.Genlist.Item.Scrollto_Type; [[The position to bring in, the given item to. - \@ref Elm_Genlist_Item_Scrollto_Type.]] - } - } - all_contents_unset { - [[Unset all contents fetched by the item class. - - This instructs genlist to release references to contents - in the item, meaning that they will no longer be managed - by genlist and are floating "orphans" that can be re-used - elsewhere if the user wants to. - ]] - params { - @out l: list @owned; [[The contents list to return.]] - } - } - update { - [[Update all the contents of an item. - - This updates an item by calling all the item class - functions again to get the contents, texts and states. - Use this when the original item data has changed and the - changes are desired to be reflected. - - Use elm_genlist_realized_items_update() to update all - already realized items. - - Note: This also updates internal genlist item object - (edje_object as of now). So when this is called between - mouse down and mouse up, mouse up event will be ignored - because edje_object is deleted and created again by this - API. If you want to avoid this, please use - \@ref elm_genlist_item_fields_update. - ]] - } - fields_update { - [[Update the part of an item. - - This updates an item's part by calling item's fetching - functions again to get the contents, texts and states. - Use this when the original item data has changed and the - changes are desired to be reflected. Second part - argument is used for globbing to match '*', '?', and '.' - It can be used at updating multi fields. - - Use \@ref elm_genlist_realized_items_update to update an - item's all property. - ]] - params { - @in parts: string; [[The name of item's part.]] - @in itf: Elm.Genlist.Item.Field_Type; [[The type of item's part type.]] - } - } - item_class_update { - [[Update the item class of an item. - - This sets another class of the item, changing the way - that it is displayed. After changing the item class - @.update is called on the item $it. - ]] - params { - @cref itc: Elm.Genlist.Item.Class; [[The item class for the item.]] - } - } - decorate_mode_set { - [[Activate a genlist mode on an item. - - A genlist mode is a different way of selecting an item. - Once a mode is activated on an item, any other selected - item is immediately unselected. This feature provides an - easy way of implementing a new kind of animation for - selecting an item, without having to entirely rewrite - the item style theme. However, the elm_genlist_selected_* - API can't be used to get what item is activate for a mode. - - The current item style will still be used, but applying - a genlist mode to an item will select it using a - different kind of animation. - - The current active item for a mode can be found by - \@ref elm_genlist_decorated_item_get. - - Only one mode can be active at any time, and for only one - item. Genlist handles deactivating other items when one - item is activated. A mode is defined in the genlist theme - (edc), and more modes can easily be added. A mode style - and the genlist item style are different things. They - can be combined to provide a default style to the item, - with some kind of animation for that item when the mode - is activated. - - When a mode is activated on an item, a new view for that - item is created. The theme of this mode defines the - animation that will be used to transit the item from - the old view to the new view. This second (new) view will - be active for that item while the mode is active on the - item, and will be destroyed after the mode is totally - deactivated from that item. - ]] - params { - @in decorate_it_type: string; [[Mode name.]] - @in decorate_it_set: bool; [[Boolean to define set or unset mode.]] - } - } - } - implements { - Efl.Object.constructor; - Elm.Widget.Item.del_pre; - Elm.Widget.Item.disable; - Elm.Widget.Item.signal_emit; - Elm.Widget.Item.style { 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; - Elm.Widget.Item.tooltip_style { get; set; } - Elm.Widget.Item.tooltip_window_mode { get; set; } - Elm.Widget.Item.tooltip_content_cb_set; - Elm.Widget.Item.tooltip_unset; - Elm.Widget.Item.cursor { set; } - Elm.Widget.Item.cursor_unset; - Efl.Access.Object.i18n_name { get; } - Efl.Access.Object.state_set { get; } - Efl.Ui.Focus.Object.prepare_logical_none_recursive; - Efl.Ui.Focus.Object.focus_parent { get; } - } -} diff --git a/src/lib/elementary/elm_genlist_item_eo.c b/src/lib/elementary/elm_genlist_item_eo.c new file mode 100644 index 0000000000..236c6ac994 --- /dev/null +++ b/src/lib/elementary/elm_genlist_item_eo.c @@ -0,0 +1,409 @@ + +Elm_Widget_Item *_elm_genlist_item_prev_get(const Eo *obj, Elm_Gen_Item *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_item_prev_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_genlist_item_next_get(const Eo *obj, Elm_Gen_Item *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_item_next_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_genlist_item_parent_item_get(const Eo *obj, Elm_Gen_Item *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_item_parent_item_get, Elm_Widget_Item *, NULL); + +const Eina_List *_elm_genlist_item_subitems_get(const Eo *obj, Elm_Gen_Item *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_item_subitems_get, const Eina_List *, NULL); + +void _elm_genlist_item_selected_set(Eo *obj, Elm_Gen_Item *pd, Eina_Bool selected); + + +static Eina_Error +__eolian_elm_genlist_item_selected_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_genlist_item_selected_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_item_selected_set, EFL_FUNC_CALL(selected), Eina_Bool selected); + +Eina_Bool _elm_genlist_item_selected_get(const Eo *obj, Elm_Gen_Item *pd); + + +static Eina_Value +__eolian_elm_genlist_item_selected_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_genlist_item_selected_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_item_selected_get, Eina_Bool, 0); + +void _elm_genlist_item_expanded_set(Eo *obj, Elm_Gen_Item *pd, Eina_Bool expanded); + + +static Eina_Error +__eolian_elm_genlist_item_expanded_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_genlist_item_expanded_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_item_expanded_set, EFL_FUNC_CALL(expanded), Eina_Bool expanded); + +Eina_Bool _elm_genlist_item_expanded_get(const Eo *obj, Elm_Gen_Item *pd); + + +static Eina_Value +__eolian_elm_genlist_item_expanded_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_genlist_item_expanded_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_item_expanded_get, Eina_Bool, 0); + +int _elm_genlist_item_expanded_depth_get(const Eo *obj, Elm_Gen_Item *pd); + + +static Eina_Value +__eolian_elm_genlist_item_expanded_depth_get_reflect(const Eo *obj) +{ + int val = elm_obj_genlist_item_expanded_depth_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_item_expanded_depth_get, int, 0); + +const Elm_Genlist_Item_Class *_elm_genlist_item_item_class_get(const Eo *obj, Elm_Gen_Item *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_item_class_get, const Elm_Genlist_Item_Class *, NULL); + +int _elm_genlist_item_index_get(const Eo *obj, Elm_Gen_Item *pd); + + +static Eina_Value +__eolian_elm_genlist_item_index_get_reflect(const Eo *obj) +{ + int val = elm_obj_genlist_item_index_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_item_index_get, int, -1 /* +1 */); + +const char *_elm_genlist_item_decorate_mode_get(const Eo *obj, Elm_Gen_Item *pd); + + +static Eina_Value +__eolian_elm_genlist_item_decorate_mode_get_reflect(const Eo *obj) +{ + const char *val = elm_obj_genlist_item_decorate_mode_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_item_decorate_mode_get, const char *, NULL); + +void _elm_genlist_item_flip_set(Eo *obj, Elm_Gen_Item *pd, Eina_Bool flip); + + +static Eina_Error +__eolian_elm_genlist_item_flip_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_genlist_item_flip_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_item_flip_set, EFL_FUNC_CALL(flip), Eina_Bool flip); + +Eina_Bool _elm_genlist_item_flip_get(const Eo *obj, Elm_Gen_Item *pd); + + +static Eina_Value +__eolian_elm_genlist_item_flip_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_genlist_item_flip_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_item_flip_get, Eina_Bool, 0); + +void _elm_genlist_item_select_mode_set(Eo *obj, Elm_Gen_Item *pd, Elm_Object_Select_Mode mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_item_select_mode_set, EFL_FUNC_CALL(mode), Elm_Object_Select_Mode mode); + +Elm_Object_Select_Mode _elm_genlist_item_select_mode_get(const Eo *obj, Elm_Gen_Item *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_item_select_mode_get, Elm_Object_Select_Mode, 4 /* Elm.Object.Select_Mode.max */); + +Elm_Genlist_Item_Type _elm_genlist_item_type_get(const Eo *obj, Elm_Gen_Item *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_item_type_get, Elm_Genlist_Item_Type, 4 /* Elm.Genlist.Item.Type.max */); + +void _elm_genlist_item_pin_set(Eo *obj, Elm_Gen_Item *pd, Eina_Bool pin); + + +static Eina_Error +__eolian_elm_genlist_item_pin_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_genlist_item_pin_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_item_pin_set, EFL_FUNC_CALL(pin), Eina_Bool pin); + +Eina_Bool _elm_genlist_item_pin_get(const Eo *obj, Elm_Gen_Item *pd); + + +static Eina_Value +__eolian_elm_genlist_item_pin_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_genlist_item_pin_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_genlist_item_pin_get, Eina_Bool, 0); + +unsigned int _elm_genlist_item_subitems_count(Eo *obj, Elm_Gen_Item *pd); + +EOAPI EFL_FUNC_BODY(elm_obj_genlist_item_subitems_count, unsigned int, 0); + +void _elm_genlist_item_subitems_clear(Eo *obj, Elm_Gen_Item *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_genlist_item_subitems_clear); + +void _elm_genlist_item_promote(Eo *obj, Elm_Gen_Item *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_genlist_item_promote); + +void _elm_genlist_item_demote(Eo *obj, Elm_Gen_Item *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_genlist_item_demote); + +void _elm_genlist_item_show(Eo *obj, Elm_Gen_Item *pd, Elm_Genlist_Item_Scrollto_Type type); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_item_show, EFL_FUNC_CALL(type), Elm_Genlist_Item_Scrollto_Type type); + +void _elm_genlist_item_bring_in(Eo *obj, Elm_Gen_Item *pd, Elm_Genlist_Item_Scrollto_Type type); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_item_bring_in, EFL_FUNC_CALL(type), Elm_Genlist_Item_Scrollto_Type type); + +void _elm_genlist_item_all_contents_unset(Eo *obj, Elm_Gen_Item *pd, Eina_List **l); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_item_all_contents_unset, EFL_FUNC_CALL(l), Eina_List **l); + +void _elm_genlist_item_update(Eo *obj, Elm_Gen_Item *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_genlist_item_update); + +void _elm_genlist_item_fields_update(Eo *obj, Elm_Gen_Item *pd, const char *parts, Elm_Genlist_Item_Field_Type itf); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_item_fields_update, EFL_FUNC_CALL(parts, itf), const char *parts, Elm_Genlist_Item_Field_Type itf); + +void _elm_genlist_item_item_class_update(Eo *obj, Elm_Gen_Item *pd, const Elm_Genlist_Item_Class *itc); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_item_class_update, EFL_FUNC_CALL(itc), const Elm_Genlist_Item_Class *itc); + +void _elm_genlist_item_decorate_mode_set(Eo *obj, Elm_Gen_Item *pd, const char *decorate_it_type, Eina_Bool decorate_it_set); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_genlist_item_decorate_mode_set, EFL_FUNC_CALL(decorate_it_type, decorate_it_set), const char *decorate_it_type, Eina_Bool decorate_it_set); + +Efl_Object *_elm_genlist_item_efl_object_constructor(Eo *obj, Elm_Gen_Item *pd); + + +void _elm_genlist_item_elm_widget_item_del_pre(Eo *obj, Elm_Gen_Item *pd); + + +void _elm_genlist_item_elm_widget_item_disable(Eo *obj, Elm_Gen_Item *pd); + + +void _elm_genlist_item_elm_widget_item_signal_emit(Eo *obj, Elm_Gen_Item *pd, const char *emission, const char *source); + + +void _elm_genlist_item_elm_widget_item_style_set(Eo *obj, Elm_Gen_Item *pd, const char *style); + + +const char *_elm_genlist_item_elm_widget_item_style_get(const Eo *obj, Elm_Gen_Item *pd); + + +void _elm_genlist_item_elm_widget_item_item_focus_set(Eo *obj, Elm_Gen_Item *pd, Eina_Bool focused); + + +Eina_Bool _elm_genlist_item_elm_widget_item_item_focus_get(const Eo *obj, Elm_Gen_Item *pd); + + +const char *_elm_genlist_item_elm_widget_item_part_text_get(const Eo *obj, Elm_Gen_Item *pd, const char *part); + + +Efl_Canvas_Object *_elm_genlist_item_elm_widget_item_part_content_get(const Eo *obj, Elm_Gen_Item *pd, const char *part); + + +void _elm_genlist_item_elm_widget_item_tooltip_text_set(Eo *obj, Elm_Gen_Item *pd, const char *text); + + +void _elm_genlist_item_elm_widget_item_tooltip_style_set(Eo *obj, Elm_Gen_Item *pd, const char *style); + + +const char *_elm_genlist_item_elm_widget_item_tooltip_style_get(const Eo *obj, Elm_Gen_Item *pd); + + +Eina_Bool _elm_genlist_item_elm_widget_item_tooltip_window_mode_set(Eo *obj, Elm_Gen_Item *pd, Eina_Bool disable); + + +Eina_Bool _elm_genlist_item_elm_widget_item_tooltip_window_mode_get(const Eo *obj, Elm_Gen_Item *pd); + + +void _elm_genlist_item_elm_widget_item_tooltip_content_cb_set(Eo *obj, Elm_Gen_Item *pd, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb); + + +void _elm_genlist_item_elm_widget_item_tooltip_unset(Eo *obj, Elm_Gen_Item *pd); + + +void _elm_genlist_item_elm_widget_item_cursor_set(Eo *obj, Elm_Gen_Item *pd, const char *cursor); + + +void _elm_genlist_item_elm_widget_item_cursor_unset(Eo *obj, Elm_Gen_Item *pd); + + +const char *_elm_genlist_item_efl_access_object_i18n_name_get(const Eo *obj, Elm_Gen_Item *pd); + + +Efl_Access_State_Set _elm_genlist_item_efl_access_object_state_set_get(const Eo *obj, Elm_Gen_Item *pd); + + +void _elm_genlist_item_efl_ui_focus_object_setup_order_non_recursive(Eo *obj, Elm_Gen_Item *pd); + + +Efl_Ui_Focus_Object *_elm_genlist_item_efl_ui_focus_object_focus_parent_get(const Eo *obj, Elm_Gen_Item *pd); + + +static Eina_Bool +_elm_genlist_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_GENLIST_ITEM_EXTRA_OPS +#define ELM_GENLIST_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_prev_get, _elm_genlist_item_prev_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_next_get, _elm_genlist_item_next_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_parent_item_get, _elm_genlist_item_parent_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_subitems_get, _elm_genlist_item_subitems_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_selected_set, _elm_genlist_item_selected_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_selected_get, _elm_genlist_item_selected_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_expanded_set, _elm_genlist_item_expanded_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_expanded_get, _elm_genlist_item_expanded_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_expanded_depth_get, _elm_genlist_item_expanded_depth_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_class_get, _elm_genlist_item_item_class_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_index_get, _elm_genlist_item_index_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_decorate_mode_get, _elm_genlist_item_decorate_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_flip_set, _elm_genlist_item_flip_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_flip_get, _elm_genlist_item_flip_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_select_mode_set, _elm_genlist_item_select_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_select_mode_get, _elm_genlist_item_select_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_type_get, _elm_genlist_item_type_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_pin_set, _elm_genlist_item_pin_set), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_pin_get, _elm_genlist_item_pin_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_subitems_count, _elm_genlist_item_subitems_count), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_subitems_clear, _elm_genlist_item_subitems_clear), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_promote, _elm_genlist_item_promote), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_demote, _elm_genlist_item_demote), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_show, _elm_genlist_item_show), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_bring_in, _elm_genlist_item_bring_in), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_all_contents_unset, _elm_genlist_item_all_contents_unset), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_update, _elm_genlist_item_update), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_fields_update, _elm_genlist_item_fields_update), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_class_update, _elm_genlist_item_item_class_update), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_item_decorate_mode_set, _elm_genlist_item_decorate_mode_set), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_genlist_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(elm_wdg_item_del_pre, _elm_genlist_item_elm_widget_item_del_pre), + EFL_OBJECT_OP_FUNC(elm_wdg_item_disable, _elm_genlist_item_elm_widget_item_disable), + EFL_OBJECT_OP_FUNC(elm_wdg_item_signal_emit, _elm_genlist_item_elm_widget_item_signal_emit), + EFL_OBJECT_OP_FUNC(elm_wdg_item_style_set, _elm_genlist_item_elm_widget_item_style_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_style_get, _elm_genlist_item_elm_widget_item_style_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_set, _elm_genlist_item_elm_widget_item_item_focus_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_get, _elm_genlist_item_elm_widget_item_item_focus_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_get, _elm_genlist_item_elm_widget_item_part_text_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_get, _elm_genlist_item_elm_widget_item_part_content_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_text_set, _elm_genlist_item_elm_widget_item_tooltip_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_style_set, _elm_genlist_item_elm_widget_item_tooltip_style_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_style_get, _elm_genlist_item_elm_widget_item_tooltip_style_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_window_mode_set, _elm_genlist_item_elm_widget_item_tooltip_window_mode_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_window_mode_get, _elm_genlist_item_elm_widget_item_tooltip_window_mode_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_content_cb_set, _elm_genlist_item_elm_widget_item_tooltip_content_cb_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_unset, _elm_genlist_item_elm_widget_item_tooltip_unset), + EFL_OBJECT_OP_FUNC(elm_wdg_item_cursor_set, _elm_genlist_item_elm_widget_item_cursor_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_cursor_unset, _elm_genlist_item_elm_widget_item_cursor_unset), + EFL_OBJECT_OP_FUNC(efl_access_object_i18n_name_get, _elm_genlist_item_efl_access_object_i18n_name_get), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_genlist_item_efl_access_object_state_set_get), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_setup_order_non_recursive, _elm_genlist_item_efl_ui_focus_object_setup_order_non_recursive), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_focus_parent_get, _elm_genlist_item_efl_ui_focus_object_focus_parent_get), + ELM_GENLIST_ITEM_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"selected", __eolian_elm_genlist_item_selected_set_reflect, __eolian_elm_genlist_item_selected_get_reflect}, + {"expanded", __eolian_elm_genlist_item_expanded_set_reflect, __eolian_elm_genlist_item_expanded_get_reflect}, + {"expanded_depth", NULL, __eolian_elm_genlist_item_expanded_depth_get_reflect}, + {"index", NULL, __eolian_elm_genlist_item_index_get_reflect}, + {"decorate_mode", NULL, __eolian_elm_genlist_item_decorate_mode_get_reflect}, + {"flip", __eolian_elm_genlist_item_flip_set_reflect, __eolian_elm_genlist_item_flip_get_reflect}, + {"pin", __eolian_elm_genlist_item_pin_set_reflect, __eolian_elm_genlist_item_pin_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_genlist_item_class_desc = { + EO_VERSION, + "Elm.Genlist.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Gen_Item), + _elm_genlist_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_genlist_item_class_get, &_elm_genlist_item_class_desc, ELM_WIDGET_ITEM_STATIC_FOCUS_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_genlist_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_genlist_item_eo.h b/src/lib/elementary/elm_genlist_item_eo.h new file mode 100644 index 0000000000..ef73deb4d2 --- /dev/null +++ b/src/lib/elementary/elm_genlist_item_eo.h @@ -0,0 +1,496 @@ +#ifndef _ELM_GENLIST_ITEM_EO_H_ +#define _ELM_GENLIST_ITEM_EO_H_ + +#ifndef _ELM_GENLIST_ITEM_EO_CLASS_TYPE +#define _ELM_GENLIST_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Genlist_Item; + +#endif + +#ifndef _ELM_GENLIST_ITEM_EO_TYPES +#define _ELM_GENLIST_ITEM_EO_TYPES + + +#endif +/** Elementary genlist item class + * + * @ingroup Elm_Genlist_Item + */ +#define ELM_GENLIST_ITEM_CLASS elm_genlist_item_class_get() + +EWAPI const Efl_Class *elm_genlist_item_class_get(void); + +/** + * @brief Get the previous item in a genlist widget's internal list of items, + * given a handle to one of those items. + * + * This returns the item placed before the @c item, on the container genlist. + * + * If filter is set on genlist, this returns the filtered item placed before + * @c 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. + * + * @param[in] obj The object. + * + * @return The item before @c item, or @c null if there's none (and on errors). + * + * @ingroup Elm_Genlist_Item + */ +EOAPI Elm_Widget_Item *elm_obj_genlist_item_prev_get(const Eo *obj); + +/** + * @brief Get the next item in a genlist widget's internal lis of items, given + * a handle to one of those items. + * + * This returns the item placed after the @c item, on the container genlist. + * + * If filter is set on genlist, this returns the filtered item placed after + * @c item in the list. + * + * 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. + * + * @param[in] obj The object. + * + * @return The item after @c item, or @c null if there's none (and on errors). + * + * @ingroup Elm_Genlist_Item + */ +EOAPI Elm_Widget_Item *elm_obj_genlist_item_next_get(const Eo *obj); + +/** + * @brief Get the parent item of the given item + * + * This returns the item that was specified as parent of the item @c it on @ref + * elm_genlist_item_append and insertion related functions. + * + * @param[in] obj The object. + * + * @return The parent of the item or @c null if it has no parent. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI Elm_Widget_Item *elm_obj_genlist_item_parent_item_get(const Eo *obj); + +/** + * @brief Get the list of subitems of a given item + * + * This returns the list of subitems that an item possesses. It cannot be + * changed. + * + * @param[in] obj The object. + * + * @return The list of subitems, @c null on error. + * + * @since 1.9 + * + * @ingroup Elm_Genlist_Item + */ +EOAPI const Eina_List *elm_obj_genlist_item_subitems_get(const Eo *obj); + +/** + * @brief Set whether a given genlist item is selected or not + * + * This sets the selected state of an item. If multi selection is not enabled + * on the containing genlist and @c selected is @c true, any other previously + * selected items will get unselected in favor of this new one. + * + * @param[in] obj The object. + * @param[in] selected The selected state ($true selected, @c false not + * selected). + * + * @ingroup Elm_Genlist_Item + */ +EOAPI void elm_obj_genlist_item_selected_set(Eo *obj, Eina_Bool selected); + +/** + * @brief Get whether a given genlist item is selected or not. + * + * @param[in] obj The object. + * + * @return The selected state ($true selected, @c false not selected). + * + * @ingroup Elm_Genlist_Item + */ +EOAPI Eina_Bool elm_obj_genlist_item_selected_get(const Eo *obj); + +/** + * @brief Sets the expanded state of an item. + * + * This function flags the item of type #ELM_GENLIST_ITEM_TREE as expanded or + * not. + * + * The theme will respond to this change visually, and a signal "expanded" or + * "contracted" will be sent from the genlist with a pointer to the item that + * has been expanded/contracted. + * + * Calling this function won't show or hide any child of this item (if it is a + * parent). You must manually delete and create them on the callbacks of the + * "expanded" or "contracted" signals. + * + * @param[in] obj The object. + * @param[in] expanded The expanded state ($true expanded, @c false not + * expanded). + * + * @ingroup Elm_Genlist_Item + */ +EOAPI void elm_obj_genlist_item_expanded_set(Eo *obj, Eina_Bool expanded); + +/** + * @brief Get the expanded state of an item + * + * This gets the expanded state of an item. + * + * @param[in] obj The object. + * + * @return The expanded state ($true expanded, @c false not expanded). + * + * @ingroup Elm_Genlist_Item + */ +EOAPI Eina_Bool elm_obj_genlist_item_expanded_get(const Eo *obj); + +/** + * @brief Get the depth of expanded item. + * + * @param[in] obj The object. + * + * @return The depth of expanded item. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI int elm_obj_genlist_item_expanded_depth_get(const Eo *obj); + +/** + * @brief Get the Genlist Item class for the given Genlist Item. + * + * This returns the Genlist_Item_Class for the given item. It can be used to + * examine the function pointers and item_style. + * + * @param[in] obj The object. + * + * @return Genlist Item class for the given item. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI const Elm_Genlist_Item_Class *elm_obj_genlist_item_class_get(const Eo *obj); + +/** + * @brief Get the index of the item. It is only valid once displayed. + * + * The index start from 1. + * + * @param[in] obj The object. + * + * @return The position inside the list of item. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI int elm_obj_genlist_item_index_get(const Eo *obj); + +/** + * @brief Get the item's decorate mode. + * + * This function just returns the name of the item's decorate mode. + * + * @param[in] obj The object. + * + * @return Name of the item's decorate mode. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI const char *elm_obj_genlist_item_decorate_mode_get(const Eo *obj); + +/** + * @brief Set the flip state of a given genlist item. + * + * This function sets the flip state of a given genlist item. Flip mode + * overrides current item object. It can be used for on-the-fly item replace. + * Flip mode can be used with/without decorate mode. + * + * @param[in] obj The object. + * @param[in] flip The flip mode. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI void elm_obj_genlist_item_flip_set(Eo *obj, Eina_Bool flip); + +/** + * @brief Get the flip state of a given genlist item. + * + * This function returns the flip state of a given genlist item. If the + * parameter is invalid, it returns @c false. + * + * @param[in] obj The object. + * + * @return The flip mode. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI Eina_Bool elm_obj_genlist_item_flip_get(const Eo *obj); + +/** + * @brief Set the genlist item's select mode. + * + * ELM_OBJECT_SELECT_MODE_DEFAULT means that the item will only call their + * selection func and callback when first becoming selected. Any further clicks + * will do nothing, unless you set always select mode. + * + * ELM_OBJECT_SELECT_MODE_ALWAYS means that even if selected, every click will + * make the selected callbacks be called. + * + * ELM_OBJECT_SELECT_MODE_NONE will turn off the ability to select the item + * entirely and they will neither appear selected nor call selected callback + * functions. + * + * ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY will apply no-finger-size rule with + * ELM_OBJECT_SELECT_MODE_NONE. No-finger-size rule makes an item can be + * smaller than lower limit. Clickable objects should be bigger than human + * touch point device (your finger) for some touch or small screen devices. So + * it is enabled, the item can be shrink than predefined finger-size value. And + * the item will be updated. + * + * @param[in] obj The object. + * @param[in] mode The selected mode. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI void elm_obj_genlist_item_select_mode_set(Eo *obj, Elm_Object_Select_Mode mode); + +/** + * @brief Get the genlist item's select mode. + * + * It's ELM_OBJECT_SELECT_MODE_MAX on failure. + * + * @param[in] obj The object. + * + * @return The selected mode. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI Elm_Object_Select_Mode elm_obj_genlist_item_select_mode_get(const Eo *obj); + +/** + * @brief Get the Item's type. + * + * This function returns the item's type. Normally the item's type. If it + * failed, return value is ELM_GENLIST_ITEM_MAX. + * + * @param[in] obj The object. + * + * @return Item type. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI Elm_Genlist_Item_Type elm_obj_genlist_item_type_get(const Eo *obj); + +/** + * @brief Set whether a given genlist item is pinned or not + * + * This sets a genlist item as pinned so that it will be always available in + * the viewport available for user interaction. Group items cannot be pinned. + * Also when a new item is pinned, the current pinned item will get unpinned. + * Item pinning cannot be done in reorder mode too. + * + * @param[in] obj The object. + * @param[in] pin The item pin state state ($true pin item, @c false unpin + * item). + * + * @ingroup Elm_Genlist_Item + */ +EOAPI void elm_obj_genlist_item_pin_set(Eo *obj, Eina_Bool pin); + +/** + * @brief Get whether a given genlist item is pinned or not. + * + * @param[in] obj The object. + * + * @return The item pin state state ($true pin item, @c false unpin item). + * + * @ingroup Elm_Genlist_Item + */ +EOAPI Eina_Bool elm_obj_genlist_item_pin_get(const Eo *obj); + +/** + * @brief Get the number of subitems of a given item. + * + * This returns the number of subitems that an item possesses. + * + * @param[in] obj The object. + * + * @return The number of subitems, 0 on error. + * + * @since 1.9 + * + * @ingroup Elm_Genlist_Item + */ +EOAPI unsigned int elm_obj_genlist_item_subitems_count(Eo *obj); + +/** + * @brief Remove all sub-items (children) of the given item. + * + * This removes all items that are children (and their descendants) of the + * given item @c it. + * @param[in] obj The object. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI void elm_obj_genlist_item_subitems_clear(Eo *obj); + +/** Promote an item to the top of the list. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI void elm_obj_genlist_item_promote(Eo *obj); + +/** Demote an item to the end of the list. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI void elm_obj_genlist_item_demote(Eo *obj); + +/** + * @brief Show the portion of a genlist's internal list containing a given + * item, immediately. + * + * This causes genlist to jump to the given item @c it and show it (by jumping + * to that position), if it is not fully visible. + * + * @param[in] obj The object. + * @param[in] type The position to bring in, the given item to. @ref + * Elm_Genlist_Item_Scrollto_Type. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI void elm_obj_genlist_item_show(Eo *obj, Elm_Genlist_Item_Scrollto_Type type); + +/** + * @brief Animatedly bring in, to the visible area of a genlist, a given item + * on it. + * + * This causes genlist to jump to the given item @c it and show it (by + * animatedly scrolling), if it is not fully visible. This may use animation + * and take a some time to do so. + * + * @param[in] obj The object. + * @param[in] type The position to bring in, the given item to. @ref + * Elm_Genlist_Item_Scrollto_Type. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI void elm_obj_genlist_item_bring_in(Eo *obj, Elm_Genlist_Item_Scrollto_Type type); + +/** + * @brief Unset all contents fetched by the item class. + * + * This instructs genlist to release references to contents in the item, + * meaning that they will no longer be managed by genlist and are floating + * "orphans" that can be re-used elsewhere if the user wants to. + * + * @param[in] obj The object. + * @param[out] l The contents list to return. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI void elm_obj_genlist_item_all_contents_unset(Eo *obj, Eina_List **l); + +/** + * @brief Update all the contents of an item. + * + * This updates an item by calling all the item class functions again to get + * the contents, texts and states. Use this when the original item data has + * changed and the changes are desired to be reflected. + * + * Use elm_genlist_realized_items_update() to update all already realized + * items. + * + * @note This also updates internal genlist item object (edje_object as of + * now). So when this is called between mouse down and mouse up, mouse up event + * will be ignored because edje_object is deleted and created again by this + * API. If you want to avoid this, please use @ref + * elm_genlist_item_fields_update. + * @param[in] obj The object. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI void elm_obj_genlist_item_update(Eo *obj); + +/** + * @brief Update the part of an item. + * + * This updates an item's part by calling item's fetching functions again to + * get the contents, texts and states. Use this when the original item data has + * changed and the changes are desired to be reflected. Second part argument is + * used for globbing to match '*', '?', and '.' It can be used at updating + * multi fields. + * + * Use @ref elm_genlist_realized_items_update to update an item's all property. + * + * @param[in] obj The object. + * @param[in] parts The name of item's part. + * @param[in] itf The type of item's part type. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI void elm_obj_genlist_item_fields_update(Eo *obj, const char *parts, Elm_Genlist_Item_Field_Type itf); + +/** + * @brief Update the item class of an item. + * + * This sets another class of the item, changing the way that it is displayed. + * After changing the item class @ref elm_obj_genlist_item_update is called on + * the item @c it. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI void elm_obj_genlist_item_class_update(Eo *obj, const Elm_Genlist_Item_Class *itc); + +/** + * @brief Activate a genlist mode on an item. + * + * A genlist mode is a different way of selecting an item. Once a mode is + * activated on an item, any other selected item is immediately unselected. + * This feature provides an easy way of implementing a new kind of animation + * for selecting an item, without having to entirely rewrite the item style + * theme. However, the elm_genlist_selected_* API can't be used to get what + * item is activate for a mode. + * + * The current item style will still be used, but applying a genlist mode to an + * item will select it using a different kind of animation. + * + * The current active item for a mode can be found by @ref + * elm_genlist_decorated_item_get. + * + * Only one mode can be active at any time, and for only one item. Genlist + * handles deactivating other items when one item is activated. A mode is + * defined in the genlist theme (edc), and more modes can easily be added. A + * mode style and the genlist item style are different things. They can be + * combined to provide a default style to the item, with some kind of animation + * for that item when the mode is activated. + * + * When a mode is activated on an item, a new view for that item is created. + * The theme of this mode defines the animation that will be used to transit + * the item from the old view to the new view. This second (new) view will be + * active for that item while the mode is active on the item, and will be + * destroyed after the mode is totally deactivated from that item. + * + * @param[in] obj The object. + * @param[in] decorate_it_type Mode name. + * @param[in] decorate_it_set Boolean to define set or unset mode. + * + * @ingroup Elm_Genlist_Item + */ +EOAPI void elm_obj_genlist_item_decorate_mode_set(Eo *obj, const char *decorate_it_type, Eina_Bool decorate_it_set); + +#endif diff --git a/src/lib/elementary/elm_genlist_item_eo.legacy.c b/src/lib/elementary/elm_genlist_item_eo.legacy.c new file mode 100644 index 0000000000..34dfb28b64 --- /dev/null +++ b/src/lib/elementary/elm_genlist_item_eo.legacy.c @@ -0,0 +1,180 @@ + +EAPI Elm_Widget_Item * +elm_genlist_item_prev_get(const Elm_Genlist_Item *obj) +{ + return elm_obj_genlist_item_prev_get(obj); +} + +EAPI Elm_Widget_Item * +elm_genlist_item_next_get(const Elm_Genlist_Item *obj) +{ + return elm_obj_genlist_item_next_get(obj); +} + +EAPI Elm_Widget_Item * +elm_genlist_item_parent_get(const Elm_Genlist_Item *obj) +{ + return elm_obj_genlist_item_parent_item_get(obj); +} + +EAPI const Eina_List * +elm_genlist_item_subitems_get(const Elm_Genlist_Item *obj) +{ + return elm_obj_genlist_item_subitems_get(obj); +} + +EAPI void +elm_genlist_item_selected_set(Elm_Genlist_Item *obj, Eina_Bool selected) +{ + elm_obj_genlist_item_selected_set(obj, selected); +} + +EAPI Eina_Bool +elm_genlist_item_selected_get(const Elm_Genlist_Item *obj) +{ + return elm_obj_genlist_item_selected_get(obj); +} + +EAPI void +elm_genlist_item_expanded_set(Elm_Genlist_Item *obj, Eina_Bool expanded) +{ + elm_obj_genlist_item_expanded_set(obj, expanded); +} + +EAPI Eina_Bool +elm_genlist_item_expanded_get(const Elm_Genlist_Item *obj) +{ + return elm_obj_genlist_item_expanded_get(obj); +} + +EAPI int +elm_genlist_item_expanded_depth_get(const Elm_Genlist_Item *obj) +{ + return elm_obj_genlist_item_expanded_depth_get(obj); +} + +EAPI const Elm_Genlist_Item_Class * +elm_genlist_item_item_class_get(const Elm_Genlist_Item *obj) +{ + return elm_obj_genlist_item_class_get(obj); +} + +EAPI int +elm_genlist_item_index_get(const Elm_Genlist_Item *obj) +{ + return elm_obj_genlist_item_index_get(obj); +} + +EAPI const char * +elm_genlist_item_decorate_mode_get(const Elm_Genlist_Item *obj) +{ + return elm_obj_genlist_item_decorate_mode_get(obj); +} + +EAPI void +elm_genlist_item_flip_set(Elm_Genlist_Item *obj, Eina_Bool flip) +{ + elm_obj_genlist_item_flip_set(obj, flip); +} + +EAPI Eina_Bool +elm_genlist_item_flip_get(const Elm_Genlist_Item *obj) +{ + return elm_obj_genlist_item_flip_get(obj); +} + +EAPI void +elm_genlist_item_select_mode_set(Elm_Genlist_Item *obj, Elm_Object_Select_Mode mode) +{ + elm_obj_genlist_item_select_mode_set(obj, mode); +} + +EAPI Elm_Object_Select_Mode +elm_genlist_item_select_mode_get(const Elm_Genlist_Item *obj) +{ + return elm_obj_genlist_item_select_mode_get(obj); +} + +EAPI Elm_Genlist_Item_Type +elm_genlist_item_type_get(const Elm_Genlist_Item *obj) +{ + return elm_obj_genlist_item_type_get(obj); +} + +EAPI void +elm_genlist_item_pin_set(Elm_Genlist_Item *obj, Eina_Bool pin) +{ + elm_obj_genlist_item_pin_set(obj, pin); +} + +EAPI Eina_Bool +elm_genlist_item_pin_get(const Elm_Genlist_Item *obj) +{ + return elm_obj_genlist_item_pin_get(obj); +} + +EAPI unsigned int +elm_genlist_item_subitems_count(Elm_Genlist_Item *obj) +{ + return elm_obj_genlist_item_subitems_count(obj); +} + +EAPI void +elm_genlist_item_subitems_clear(Elm_Genlist_Item *obj) +{ + elm_obj_genlist_item_subitems_clear(obj); +} + +EAPI void +elm_genlist_item_promote(Elm_Genlist_Item *obj) +{ + elm_obj_genlist_item_promote(obj); +} + +EAPI void +elm_genlist_item_demote(Elm_Genlist_Item *obj) +{ + elm_obj_genlist_item_demote(obj); +} + +EAPI void +elm_genlist_item_show(Elm_Genlist_Item *obj, Elm_Genlist_Item_Scrollto_Type type) +{ + elm_obj_genlist_item_show(obj, type); +} + +EAPI void +elm_genlist_item_bring_in(Elm_Genlist_Item *obj, Elm_Genlist_Item_Scrollto_Type type) +{ + elm_obj_genlist_item_bring_in(obj, type); +} + +EAPI void +elm_genlist_item_all_contents_unset(Elm_Genlist_Item *obj, Eina_List **l) +{ + elm_obj_genlist_item_all_contents_unset(obj, l); +} + +EAPI void +elm_genlist_item_update(Elm_Genlist_Item *obj) +{ + elm_obj_genlist_item_update(obj); +} + +EAPI void +elm_genlist_item_fields_update(Elm_Genlist_Item *obj, const char *parts, Elm_Genlist_Item_Field_Type itf) +{ + elm_obj_genlist_item_fields_update(obj, parts, itf); +} + +EAPI void +elm_genlist_item_item_class_update(Elm_Genlist_Item *obj, const Elm_Genlist_Item_Class *itc) +{ + elm_obj_genlist_item_class_update(obj, itc); +} + +EAPI void +elm_genlist_item_decorate_mode_set(Elm_Genlist_Item *obj, const char *decorate_it_type, Eina_Bool decorate_it_set) +{ + elm_obj_genlist_item_decorate_mode_set(obj, decorate_it_type, decorate_it_set); +} diff --git a/src/lib/elementary/elm_genlist_item_eo.legacy.h b/src/lib/elementary/elm_genlist_item_eo.legacy.h new file mode 100644 index 0000000000..7ef94fcb32 --- /dev/null +++ b/src/lib/elementary/elm_genlist_item_eo.legacy.h @@ -0,0 +1,489 @@ +#ifndef _ELM_GENLIST_ITEM_EO_LEGACY_H_ +#define _ELM_GENLIST_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_GENLIST_ITEM_EO_CLASS_TYPE +#define _ELM_GENLIST_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Genlist_Item; + +#endif + +#ifndef _ELM_GENLIST_ITEM_EO_TYPES +#define _ELM_GENLIST_ITEM_EO_TYPES + + +#endif + +/** + * @brief Get the previous item in a genlist widget's internal list of items, + * given a handle to one of those items. + * + * This returns the item placed before the @c item, on the container genlist. + * + * If filter is set on genlist, this returns the filtered item placed before + * @c 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. + * + * @param[in] obj The object. + * + * @return The item before @c item, or @c null if there's none (and on errors). + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI Elm_Widget_Item *elm_genlist_item_prev_get(const Elm_Genlist_Item *obj); + +/** + * @brief Get the next item in a genlist widget's internal lis of items, given + * a handle to one of those items. + * + * This returns the item placed after the @c item, on the container genlist. + * + * If filter is set on genlist, this returns the filtered item placed after + * @c item in the list. + * + * 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. + * + * @param[in] obj The object. + * + * @return The item after @c item, or @c null if there's none (and on errors). + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI Elm_Widget_Item *elm_genlist_item_next_get(const Elm_Genlist_Item *obj); + +/** + * @brief Get the parent item of the given item + * + * This returns the item that was specified as parent of the item @c it on @ref + * elm_genlist_item_append and insertion related functions. + * + * @param[in] obj The object. + * + * @return The parent of the item or @c null if it has no parent. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI Elm_Widget_Item *elm_genlist_item_parent_get(const Elm_Genlist_Item *obj); + +/** + * @brief Get the list of subitems of a given item + * + * This returns the list of subitems that an item possesses. It cannot be + * changed. + * + * @param[in] obj The object. + * + * @return The list of subitems, @c null on error. + * + * @since 1.9 + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI const Eina_List *elm_genlist_item_subitems_get(const Elm_Genlist_Item *obj); + +/** + * @brief Set whether a given genlist item is selected or not + * + * This sets the selected state of an item. If multi selection is not enabled + * on the containing genlist and @c selected is @c true, any other previously + * selected items will get unselected in favor of this new one. + * + * @param[in] obj The object. + * @param[in] selected The selected state ($true selected, @c false not + * selected). + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI void elm_genlist_item_selected_set(Elm_Genlist_Item *obj, Eina_Bool selected); + +/** + * @brief Get whether a given genlist item is selected or not. + * + * @param[in] obj The object. + * + * @return The selected state ($true selected, @c false not selected). + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI Eina_Bool elm_genlist_item_selected_get(const Elm_Genlist_Item *obj); + +/** + * @brief Sets the expanded state of an item. + * + * This function flags the item of type #ELM_GENLIST_ITEM_TREE as expanded or + * not. + * + * The theme will respond to this change visually, and a signal "expanded" or + * "contracted" will be sent from the genlist with a pointer to the item that + * has been expanded/contracted. + * + * Calling this function won't show or hide any child of this item (if it is a + * parent). You must manually delete and create them on the callbacks of the + * "expanded" or "contracted" signals. + * + * @param[in] obj The object. + * @param[in] expanded The expanded state ($true expanded, @c false not + * expanded). + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI void elm_genlist_item_expanded_set(Elm_Genlist_Item *obj, Eina_Bool expanded); + +/** + * @brief Get the expanded state of an item + * + * This gets the expanded state of an item. + * + * @param[in] obj The object. + * + * @return The expanded state ($true expanded, @c false not expanded). + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI Eina_Bool elm_genlist_item_expanded_get(const Elm_Genlist_Item *obj); + +/** + * @brief Get the depth of expanded item. + * + * @param[in] obj The object. + * + * @return The depth of expanded item. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI int elm_genlist_item_expanded_depth_get(const Elm_Genlist_Item *obj); + +/** + * @brief Get the Genlist Item class for the given Genlist Item. + * + * This returns the Genlist_Item_Class for the given item. It can be used to + * examine the function pointers and item_style. + * + * @param[in] obj The object. + * + * @return Genlist Item class for the given item. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI const Elm_Genlist_Item_Class *elm_genlist_item_item_class_get(const Elm_Genlist_Item *obj); + +/** + * @brief Get the index of the item. It is only valid once displayed. + * + * The index start from 1. + * + * @param[in] obj The object. + * + * @return The position inside the list of item. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI int elm_genlist_item_index_get(const Elm_Genlist_Item *obj); + +/** + * @brief Get the item's decorate mode. + * + * This function just returns the name of the item's decorate mode. + * + * @param[in] obj The object. + * + * @return Name of the item's decorate mode. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI const char *elm_genlist_item_decorate_mode_get(const Elm_Genlist_Item *obj); + +/** + * @brief Set the flip state of a given genlist item. + * + * This function sets the flip state of a given genlist item. Flip mode + * overrides current item object. It can be used for on-the-fly item replace. + * Flip mode can be used with/without decorate mode. + * + * @param[in] obj The object. + * @param[in] flip The flip mode. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI void elm_genlist_item_flip_set(Elm_Genlist_Item *obj, Eina_Bool flip); + +/** + * @brief Get the flip state of a given genlist item. + * + * This function returns the flip state of a given genlist item. If the + * parameter is invalid, it returns @c false. + * + * @param[in] obj The object. + * + * @return The flip mode. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI Eina_Bool elm_genlist_item_flip_get(const Elm_Genlist_Item *obj); + +/** + * @brief Set the genlist item's select mode. + * + * ELM_OBJECT_SELECT_MODE_DEFAULT means that the item will only call their + * selection func and callback when first becoming selected. Any further clicks + * will do nothing, unless you set always select mode. + * + * ELM_OBJECT_SELECT_MODE_ALWAYS means that even if selected, every click will + * make the selected callbacks be called. + * + * ELM_OBJECT_SELECT_MODE_NONE will turn off the ability to select the item + * entirely and they will neither appear selected nor call selected callback + * functions. + * + * ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY will apply no-finger-size rule with + * ELM_OBJECT_SELECT_MODE_NONE. No-finger-size rule makes an item can be + * smaller than lower limit. Clickable objects should be bigger than human + * touch point device (your finger) for some touch or small screen devices. So + * it is enabled, the item can be shrink than predefined finger-size value. And + * the item will be updated. + * + * @param[in] obj The object. + * @param[in] mode The selected mode. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI void elm_genlist_item_select_mode_set(Elm_Genlist_Item *obj, Elm_Object_Select_Mode mode); + +/** + * @brief Get the genlist item's select mode. + * + * It's ELM_OBJECT_SELECT_MODE_MAX on failure. + * + * @param[in] obj The object. + * + * @return The selected mode. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI Elm_Object_Select_Mode elm_genlist_item_select_mode_get(const Elm_Genlist_Item *obj); + +/** + * @brief Get the Item's type. + * + * This function returns the item's type. Normally the item's type. If it + * failed, return value is ELM_GENLIST_ITEM_MAX. + * + * @param[in] obj The object. + * + * @return Item type. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI Elm_Genlist_Item_Type elm_genlist_item_type_get(const Elm_Genlist_Item *obj); + +/** + * @brief Set whether a given genlist item is pinned or not + * + * This sets a genlist item as pinned so that it will be always available in + * the viewport available for user interaction. Group items cannot be pinned. + * Also when a new item is pinned, the current pinned item will get unpinned. + * Item pinning cannot be done in reorder mode too. + * + * @param[in] obj The object. + * @param[in] pin The item pin state state ($true pin item, @c false unpin + * item). + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI void elm_genlist_item_pin_set(Elm_Genlist_Item *obj, Eina_Bool pin); + +/** + * @brief Get whether a given genlist item is pinned or not. + * + * @param[in] obj The object. + * + * @return The item pin state state ($true pin item, @c false unpin item). + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI Eina_Bool elm_genlist_item_pin_get(const Elm_Genlist_Item *obj); + +/** + * @brief Get the number of subitems of a given item. + * + * This returns the number of subitems that an item possesses. + * + * @param[in] obj The object. + * + * @return The number of subitems, 0 on error. + * + * @since 1.9 + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI unsigned int elm_genlist_item_subitems_count(Elm_Genlist_Item *obj); + +/** + * @brief Remove all sub-items (children) of the given item. + * + * This removes all items that are children (and their descendants) of the + * given item @c it. + * @param[in] obj The object. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI void elm_genlist_item_subitems_clear(Elm_Genlist_Item *obj); + +/** Promote an item to the top of the list. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI void elm_genlist_item_promote(Elm_Genlist_Item *obj); + +/** Demote an item to the end of the list. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI void elm_genlist_item_demote(Elm_Genlist_Item *obj); + +/** + * @brief Show the portion of a genlist's internal list containing a given + * item, immediately. + * + * This causes genlist to jump to the given item @c it and show it (by jumping + * to that position), if it is not fully visible. + * + * @param[in] obj The object. + * @param[in] type The position to bring in, the given item to. @ref + * Elm_Genlist_Item_Scrollto_Type. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI void elm_genlist_item_show(Elm_Genlist_Item *obj, Elm_Genlist_Item_Scrollto_Type type); + +/** + * @brief Animatedly bring in, to the visible area of a genlist, a given item + * on it. + * + * This causes genlist to jump to the given item @c it and show it (by + * animatedly scrolling), if it is not fully visible. This may use animation + * and take a some time to do so. + * + * @param[in] obj The object. + * @param[in] type The position to bring in, the given item to. @ref + * Elm_Genlist_Item_Scrollto_Type. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI void elm_genlist_item_bring_in(Elm_Genlist_Item *obj, Elm_Genlist_Item_Scrollto_Type type); + +/** + * @brief Unset all contents fetched by the item class. + * + * This instructs genlist to release references to contents in the item, + * meaning that they will no longer be managed by genlist and are floating + * "orphans" that can be re-used elsewhere if the user wants to. + * + * @param[in] obj The object. + * @param[out] l The contents list to return. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI void elm_genlist_item_all_contents_unset(Elm_Genlist_Item *obj, Eina_List **l); + +/** + * @brief Update all the contents of an item. + * + * This updates an item by calling all the item class functions again to get + * the contents, texts and states. Use this when the original item data has + * changed and the changes are desired to be reflected. + * + * Use elm_genlist_realized_items_update() to update all already realized + * items. + * + * @note This also updates internal genlist item object (edje_object as of + * now). So when this is called between mouse down and mouse up, mouse up event + * will be ignored because edje_object is deleted and created again by this + * API. If you want to avoid this, please use @ref + * elm_genlist_item_fields_update. + * @param[in] obj The object. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI void elm_genlist_item_update(Elm_Genlist_Item *obj); + +/** + * @brief Update the part of an item. + * + * This updates an item's part by calling item's fetching functions again to + * get the contents, texts and states. Use this when the original item data has + * changed and the changes are desired to be reflected. Second part argument is + * used for globbing to match '*', '?', and '.' It can be used at updating + * multi fields. + * + * Use @ref elm_genlist_realized_items_update to update an item's all property. + * + * @param[in] obj The object. + * @param[in] parts The name of item's part. + * @param[in] itf The type of item's part type. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI void elm_genlist_item_fields_update(Elm_Genlist_Item *obj, const char *parts, Elm_Genlist_Item_Field_Type itf); + +/** + * @brief Update the item class of an item. + * + * This sets another class of the item, changing the way that it is displayed. + * After changing the item class @ref elm_genlist_item_update is called on the + * item @c it. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI void elm_genlist_item_item_class_update(Elm_Genlist_Item *obj, const Elm_Genlist_Item_Class *itc); + +/** + * @brief Activate a genlist mode on an item. + * + * A genlist mode is a different way of selecting an item. Once a mode is + * activated on an item, any other selected item is immediately unselected. + * This feature provides an easy way of implementing a new kind of animation + * for selecting an item, without having to entirely rewrite the item style + * theme. However, the elm_genlist_selected_* API can't be used to get what + * item is activate for a mode. + * + * The current item style will still be used, but applying a genlist mode to an + * item will select it using a different kind of animation. + * + * The current active item for a mode can be found by @ref + * elm_genlist_decorated_item_get. + * + * Only one mode can be active at any time, and for only one item. Genlist + * handles deactivating other items when one item is activated. A mode is + * defined in the genlist theme (edc), and more modes can easily be added. A + * mode style and the genlist item style are different things. They can be + * combined to provide a default style to the item, with some kind of animation + * for that item when the mode is activated. + * + * When a mode is activated on an item, a new view for that item is created. + * The theme of this mode defines the animation that will be used to transit + * the item from the old view to the new view. This second (new) view will be + * active for that item while the mode is active on the item, and will be + * destroyed after the mode is totally deactivated from that item. + * + * @param[in] obj The object. + * @param[in] decorate_it_type Mode name. + * @param[in] decorate_it_set Boolean to define set or unset mode. + * + * @ingroup Elm_Genlist_Item_Group + */ +EAPI void elm_genlist_item_decorate_mode_set(Elm_Genlist_Item *obj, const char *decorate_it_type, Eina_Bool decorate_it_set); + +#endif diff --git a/src/lib/elementary/elm_genlist_legacy.h b/src/lib/elementary/elm_genlist_legacy.h index 3817f0571d..938c6b8f29 100644 --- a/src/lib/elementary/elm_genlist_legacy.h +++ b/src/lib/elementary/elm_genlist_legacy.h @@ -31,5 +31,5 @@ EAPI Evas_Object *elm_genlist_add(Evas_Object *parent); EAPI Elm_Object_Item * elm_genlist_nth_item_get(const Evas_Object *obj, unsigned int nth); -#include "elm_genlist_item.eo.legacy.h" -#include "elm_genlist.eo.legacy.h" +#include "elm_genlist_item_eo.legacy.h" +#include "elm_genlist_eo.legacy.h" diff --git a/src/lib/elementary/elm_genlist_pan.eo b/src/lib/elementary/elm_genlist_pan.eo deleted file mode 100644 index 3c92efe1d0..0000000000 --- a/src/lib/elementary/elm_genlist_pan.eo +++ /dev/null @@ -1,24 +0,0 @@ -class Elm.Genlist.Pan extends Elm.Pan -{ - [[Elementary genlist pan class]] - legacy_prefix: elm_genlist_pan; - eo_prefix: elm_obj_genlist_pan; - event_prefix: elm_genlist_pan; - implements { - class.constructor; - Efl.Object.destructor; - 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; } - Elm.Pan.pos_min { get; } - 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_genlist_pan_eo.c b/src/lib/elementary/elm_genlist_pan_eo.c new file mode 100644 index 0000000000..5e8cab0b1f --- /dev/null +++ b/src/lib/elementary/elm_genlist_pan_eo.c @@ -0,0 +1,67 @@ + +void _elm_genlist_pan_efl_object_destructor(Eo *obj, Elm_Genlist_Pan_Data *pd); + + +void _elm_genlist_pan_efl_gfx_entity_position_set(Eo *obj, Elm_Genlist_Pan_Data *pd, Eina_Position2D pos); + + +void _elm_genlist_pan_efl_gfx_entity_size_set(Eo *obj, Elm_Genlist_Pan_Data *pd, Eina_Size2D size); + + +void _elm_genlist_pan_efl_canvas_group_group_calculate(Eo *obj, Elm_Genlist_Pan_Data *pd); + + +void _elm_genlist_pan_elm_pan_content_size_get(const Eo *obj, Elm_Genlist_Pan_Data *pd, int *w, int *h); + + +void _elm_genlist_pan_elm_pan_pos_set(Eo *obj, Elm_Genlist_Pan_Data *pd, int x, int y); + + +void _elm_genlist_pan_elm_pan_pos_get(const Eo *obj, Elm_Genlist_Pan_Data *pd, int *x, int *y); + + +void _elm_genlist_pan_elm_pan_pos_min_get(const Eo *obj, Elm_Genlist_Pan_Data *pd, int *x, int *y); + + +void _elm_genlist_pan_elm_pan_pos_max_get(const Eo *obj, Elm_Genlist_Pan_Data *pd, int *x, int *y); + + +static Eina_Bool +_elm_genlist_pan_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_GENLIST_PAN_EXTRA_OPS +#define ELM_GENLIST_PAN_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_genlist_pan_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_genlist_pan_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_genlist_pan_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _elm_genlist_pan_efl_canvas_group_group_calculate), + EFL_OBJECT_OP_FUNC(elm_obj_pan_content_size_get, _elm_genlist_pan_elm_pan_content_size_get), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_set, _elm_genlist_pan_elm_pan_pos_set), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_get, _elm_genlist_pan_elm_pan_pos_get), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_min_get, _elm_genlist_pan_elm_pan_pos_min_get), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_max_get, _elm_genlist_pan_elm_pan_pos_max_get), + ELM_GENLIST_PAN_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_genlist_pan_class_desc = { + EO_VERSION, + "Elm.Genlist.Pan", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Genlist_Pan_Data), + _elm_genlist_pan_class_initializer, + _elm_genlist_pan_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_genlist_pan_class_get, &_elm_genlist_pan_class_desc, ELM_PAN_CLASS, NULL); diff --git a/src/lib/elementary/elm_genlist_pan_eo.h b/src/lib/elementary/elm_genlist_pan_eo.h new file mode 100644 index 0000000000..1826f84584 --- /dev/null +++ b/src/lib/elementary/elm_genlist_pan_eo.h @@ -0,0 +1,24 @@ +#ifndef _ELM_GENLIST_PAN_EO_H_ +#define _ELM_GENLIST_PAN_EO_H_ + +#ifndef _ELM_GENLIST_PAN_EO_CLASS_TYPE +#define _ELM_GENLIST_PAN_EO_CLASS_TYPE + +typedef Eo Elm_Genlist_Pan; + +#endif + +#ifndef _ELM_GENLIST_PAN_EO_TYPES +#define _ELM_GENLIST_PAN_EO_TYPES + + +#endif +/** Elementary genlist pan class + * + * @ingroup Elm_Genlist_Pan + */ +#define ELM_GENLIST_PAN_CLASS elm_genlist_pan_class_get() + +EWAPI const Efl_Class *elm_genlist_pan_class_get(void); + +#endif diff --git a/src/lib/elementary/elm_genlist_pan_eo.legacy.h b/src/lib/elementary/elm_genlist_pan_eo.legacy.h new file mode 100644 index 0000000000..970a8040cd --- /dev/null +++ b/src/lib/elementary/elm_genlist_pan_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_GENLIST_PAN_EO_LEGACY_H_ +#define _ELM_GENLIST_PAN_EO_LEGACY_H_ + +#ifndef _ELM_GENLIST_PAN_EO_CLASS_TYPE +#define _ELM_GENLIST_PAN_EO_CLASS_TYPE + +typedef Eo Elm_Genlist_Pan; + +#endif + +#ifndef _ELM_GENLIST_PAN_EO_TYPES +#define _ELM_GENLIST_PAN_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_gesture_layer.c b/src/lib/elementary/elm_gesture_layer.c index 2ea1c69589..de1fe793e3 100644 --- a/src/lib/elementary/elm_gesture_layer.c +++ b/src/lib/elementary/elm_gesture_layer.c @@ -4,7 +4,7 @@ #include #include "elm_priv.h" -#include "elm_gesture_layer.eo.h" +#include "elm_gesture_layer_eo.h" #define MY_CLASS ELM_GESTURE_LAYER_CLASS @@ -619,7 +619,7 @@ _state_report(Gesture_Info *gesture, flags |= cb_info->cb(cb_info->user_data, info); } - return EVAS_EVENT_FLAG_NONE; + return flags; } /** @@ -3296,9 +3296,6 @@ _zoom_with_wheel_test(Evas_Object *obj, if (st->zoom_wheel->z > 0) /* zoom out */ st->info.zoom -= (sd->zoom_finger_factor * sd->zoom_wheel_factor); - if (st->info.zoom < 0.0) - st->info.zoom = 0.0; - st->info.momentum = _zoom_momentum_get (st, st->zoom_wheel->timestamp, st->info.zoom); @@ -3736,22 +3733,21 @@ _rotate_test(Evas_Object *obj, } } -EOLIAN static Eina_Bool -_elm_gesture_layer_efl_ui_widget_on_disabled_update(Eo *obj, Elm_Gesture_Layer_Data *_pd EINA_UNUSED, Eina_Bool disabled) +EOLIAN static void +_elm_gesture_layer_efl_ui_widget_disabled_set(Eo *obj, Elm_Gesture_Layer_Data *_pd EINA_UNUSED, Eina_Bool disabled) { - if (disabled) + efl_ui_widget_disabled_set(efl_super(obj, MY_CLASS), disabled); + + if (efl_ui_widget_disabled_get(obj)) _callbacks_unregister(obj); else _callbacks_register(obj); - - return EINA_TRUE; } EOLIAN static void _elm_gesture_layer_efl_canvas_group_group_add(Eo *obj, Elm_Gesture_Layer_Data *priv) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->line_min_length = _elm_config->glayer_line_min_length * elm_config_finger_size_get(); @@ -4178,4 +4174,4 @@ _elm_gesture_layer_class_constructor(Efl_Class *klass) #define ELM_GESTURE_LAYER_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_gesture_layer) -#include "elm_gesture_layer.eo.c" +#include "elm_gesture_layer_eo.c" diff --git a/src/lib/elementary/elm_gesture_layer.eo b/src/lib/elementary/elm_gesture_layer.eo deleted file mode 100644 index 46a3479564..0000000000 --- a/src/lib/elementary/elm_gesture_layer.eo +++ /dev/null @@ -1,167 +0,0 @@ -type Elm_Gesture_Event_Cb: __undefined_type; [[Elementary gesture event callback type]] - -enum Elm.Gesture.Type -{ - [[ - Enum of supported gesture types. - ]] - legacy: elm_gesture; - first = 0, [[First type used for iteration over the enum]] - n_taps, [[N fingers single taps]] - n_long_taps, [[N fingers single long-taps]] - n_double_taps, [[N fingers double-single taps]] - n_triple_taps, [[N fingers triple-single taps]] - momentum, [[Reports momentum in the direction of move]] - n_lines, [[N fingers line gesture]] - n_flicks, [[N fingers flick gesture]] - zoom, [[Zoom]] - rotate, [[Rotate]] - last [[Sentinel value to indicate last enum field during iteration]] -} - -enum Elm.Gesture.State -{ - [[ - Enum of gesture states. - ]] - undefined = -1, [[Gesture not started]] - start, [[Gesture started]] - move, [[Gesture is ongoing]] - end, [[Gesture completed]] - abort [[Ongoing gesture was aborted]] -} - -class Elm.Gesture_Layer extends Efl.Ui.Widget implements Efl.Ui.Legacy -{ - [[Elementary gesture layer class]] - legacy_prefix: elm_gesture_layer; - eo_prefix: elm_obj_gesture_layer; - methods { - @property zoom_step { - [[Control step value for zoom action.]] - set { - [[When recognizing the zoom gesture, it should be recognized as zooming larger - than step. - ]] - } - get { - } - values { - step: double; [[The zoom step value.]] - } - } - @property tap_finger_size { - set { - [[This function sets the gesture layer finger-size for taps. - - If not set, it's taken from elm_config. - Set to 0 if you want GLayer to use the system finger size - value (default). - - @since 1.8 - ]] - } - get { - [[This function returns the gesture layer finger-size for taps - - @since 1.8 - ]] - } - values { - sz: int; [[The finger size.]] - } - } - @property hold_events { - set { - [[This function makes gesture-layer repeat events. - - Set this if you like to get the raw events only if gestures - were not detected. - - Clear this if you like gesture layer to forward events as - testing gestures. - ]] - } - get { - [[Get the repeat-events setting.]] - } - values { - hold_events: bool; [[If $true get events only if gesture was not detected, $false otherwise]] - } - } - @property rotate_step { - [[This function returns step-value for rotate action.]] - set { - [[Set to 0 to cancel step setting. - - When recognizing the rotate gesture, the rotated size must be larger - than step. - ]] - } - get { - } - values { - step: double; [[New rotate step value.]] - } - } - @property cb { - set { - [[Set the gesture state change callback. - - When all callbacks for the gesture are set to $null, - it means this gesture is disabled. - ]] - } - values { - idx: Elm.Gesture.Type; [[The gesture you want to track state of.]] - cb_type: Elm.Gesture.State; [[The event the callback tracks (START, MOVE, END, ABORT).]] - cb: Elm_Gesture_Event_Cb; [[The callback itself.]] - data: void_ptr @optional; [[Custom data to be passed.]] - } - } - attach { - [[Attach a gesture layer widget to an Evas object (setting the - widget's target). - - A gesture layer's target may be any Evas object. This object - will be used to listen to mouse and key events. - ]] - return: bool; [[$true on success, $false otherwise.]] - params { - @in target: Efl.Canvas.Object; [[The object to attach.]] - } - } - cb_del { - [[Remove a gesture callback.]] - params { - @in idx: Elm.Gesture.Type; [[The gesture you want to track state of.]] - @in cb_type: Elm.Gesture.State; [[The event the callback tracks (START, MOVE, END, ABORT).]] - @in cb: Elm_Gesture_Event_Cb; [[The callback itself.]] - @in data: void_ptr @nullable; [[Custom callback data.]] - } - } - cb_add { - [[Add a gesture state change callback. - - When all callbacks for the gesture are set to $null, - it means this gesture is disabled. - - If a function was already set for this gesture/type/state, it - will be replaced by the new one. For ABI compat, callbacks - added by @.cb_add will be removed. It is recommended to - use only one of these functions for a gesture object. - ]] - params { - @in idx: Elm.Gesture.Type; [[The gesture you want to track state of.]] - @in cb_type: Elm.Gesture.State; [[The event the callback tracks (START, MOVE, END, ABORT).]] - @in cb: Elm_Gesture_Event_Cb; [[The callback itself.]] - @in data: void_ptr @optional; [[Custom data to be passed.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.on_disabled_update; - } -} diff --git a/src/lib/elementary/elm_gesture_layer_eo.c b/src/lib/elementary/elm_gesture_layer_eo.c new file mode 100644 index 0000000000..d83e663601 --- /dev/null +++ b/src/lib/elementary/elm_gesture_layer_eo.c @@ -0,0 +1,208 @@ + +void _elm_gesture_layer_zoom_step_set(Eo *obj, Elm_Gesture_Layer_Data *pd, double step); + + +static Eina_Error +__eolian_elm_gesture_layer_zoom_step_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_gesture_layer_zoom_step_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gesture_layer_zoom_step_set, EFL_FUNC_CALL(step), double step); + +double _elm_gesture_layer_zoom_step_get(const Eo *obj, Elm_Gesture_Layer_Data *pd); + + +static Eina_Value +__eolian_elm_gesture_layer_zoom_step_get_reflect(const Eo *obj) +{ + double val = elm_obj_gesture_layer_zoom_step_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gesture_layer_zoom_step_get, double, 0); + +void _elm_gesture_layer_tap_finger_size_set(Eo *obj, Elm_Gesture_Layer_Data *pd, int sz); + + +static Eina_Error +__eolian_elm_gesture_layer_tap_finger_size_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_gesture_layer_tap_finger_size_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gesture_layer_tap_finger_size_set, EFL_FUNC_CALL(sz), int sz); + +int _elm_gesture_layer_tap_finger_size_get(const Eo *obj, Elm_Gesture_Layer_Data *pd); + + +static Eina_Value +__eolian_elm_gesture_layer_tap_finger_size_get_reflect(const Eo *obj) +{ + int val = elm_obj_gesture_layer_tap_finger_size_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gesture_layer_tap_finger_size_get, int, 0); + +void _elm_gesture_layer_hold_events_set(Eo *obj, Elm_Gesture_Layer_Data *pd, Eina_Bool hold_events); + + +static Eina_Error +__eolian_elm_gesture_layer_hold_events_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_gesture_layer_hold_events_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gesture_layer_hold_events_set, EFL_FUNC_CALL(hold_events), Eina_Bool hold_events); + +Eina_Bool _elm_gesture_layer_hold_events_get(const Eo *obj, Elm_Gesture_Layer_Data *pd); + + +static Eina_Value +__eolian_elm_gesture_layer_hold_events_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_gesture_layer_hold_events_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gesture_layer_hold_events_get, Eina_Bool, 0); + +void _elm_gesture_layer_rotate_step_set(Eo *obj, Elm_Gesture_Layer_Data *pd, double step); + + +static Eina_Error +__eolian_elm_gesture_layer_rotate_step_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_gesture_layer_rotate_step_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gesture_layer_rotate_step_set, EFL_FUNC_CALL(step), double step); + +double _elm_gesture_layer_rotate_step_get(const Eo *obj, Elm_Gesture_Layer_Data *pd); + + +static Eina_Value +__eolian_elm_gesture_layer_rotate_step_get_reflect(const Eo *obj) +{ + double val = elm_obj_gesture_layer_rotate_step_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gesture_layer_rotate_step_get, double, 0); + +void _elm_gesture_layer_cb_set(Eo *obj, Elm_Gesture_Layer_Data *pd, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gesture_layer_cb_set, EFL_FUNC_CALL(idx, cb_type, cb, data), Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data); + +Eina_Bool _elm_gesture_layer_attach(Eo *obj, Elm_Gesture_Layer_Data *pd, Efl_Canvas_Object *target); + +EOAPI EFL_FUNC_BODYV(elm_obj_gesture_layer_attach, Eina_Bool, 0, EFL_FUNC_CALL(target), Efl_Canvas_Object *target); + +void _elm_gesture_layer_cb_del(Eo *obj, Elm_Gesture_Layer_Data *pd, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gesture_layer_cb_del, EFL_FUNC_CALL(idx, cb_type, cb, data), Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data); + +void _elm_gesture_layer_cb_add(Eo *obj, Elm_Gesture_Layer_Data *pd, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gesture_layer_cb_add, EFL_FUNC_CALL(idx, cb_type, cb, data), Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data); + +Efl_Object *_elm_gesture_layer_efl_object_constructor(Eo *obj, Elm_Gesture_Layer_Data *pd); + + +void _elm_gesture_layer_efl_ui_widget_disabled_set(Eo *obj, Elm_Gesture_Layer_Data *pd, Eina_Bool disabled); + + +static Eina_Bool +_elm_gesture_layer_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_GESTURE_LAYER_EXTRA_OPS +#define ELM_GESTURE_LAYER_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_gesture_layer_zoom_step_set, _elm_gesture_layer_zoom_step_set), + EFL_OBJECT_OP_FUNC(elm_obj_gesture_layer_zoom_step_get, _elm_gesture_layer_zoom_step_get), + EFL_OBJECT_OP_FUNC(elm_obj_gesture_layer_tap_finger_size_set, _elm_gesture_layer_tap_finger_size_set), + EFL_OBJECT_OP_FUNC(elm_obj_gesture_layer_tap_finger_size_get, _elm_gesture_layer_tap_finger_size_get), + EFL_OBJECT_OP_FUNC(elm_obj_gesture_layer_hold_events_set, _elm_gesture_layer_hold_events_set), + EFL_OBJECT_OP_FUNC(elm_obj_gesture_layer_hold_events_get, _elm_gesture_layer_hold_events_get), + EFL_OBJECT_OP_FUNC(elm_obj_gesture_layer_rotate_step_set, _elm_gesture_layer_rotate_step_set), + EFL_OBJECT_OP_FUNC(elm_obj_gesture_layer_rotate_step_get, _elm_gesture_layer_rotate_step_get), + EFL_OBJECT_OP_FUNC(elm_obj_gesture_layer_cb_set, _elm_gesture_layer_cb_set), + EFL_OBJECT_OP_FUNC(elm_obj_gesture_layer_attach, _elm_gesture_layer_attach), + EFL_OBJECT_OP_FUNC(elm_obj_gesture_layer_cb_del, _elm_gesture_layer_cb_del), + EFL_OBJECT_OP_FUNC(elm_obj_gesture_layer_cb_add, _elm_gesture_layer_cb_add), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_gesture_layer_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_disabled_set, _elm_gesture_layer_efl_ui_widget_disabled_set), + ELM_GESTURE_LAYER_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"zoom_step", __eolian_elm_gesture_layer_zoom_step_set_reflect, __eolian_elm_gesture_layer_zoom_step_get_reflect}, + {"tap_finger_size", __eolian_elm_gesture_layer_tap_finger_size_set_reflect, __eolian_elm_gesture_layer_tap_finger_size_get_reflect}, + {"hold_events", __eolian_elm_gesture_layer_hold_events_set_reflect, __eolian_elm_gesture_layer_hold_events_get_reflect}, + {"rotate_step", __eolian_elm_gesture_layer_rotate_step_set_reflect, __eolian_elm_gesture_layer_rotate_step_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_gesture_layer_class_desc = { + EO_VERSION, + "Elm.Gesture_Layer", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Gesture_Layer_Data), + _elm_gesture_layer_class_initializer, + _elm_gesture_layer_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_gesture_layer_class_get, &_elm_gesture_layer_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_gesture_layer_eo.legacy.c" diff --git a/src/lib/elementary/elm_gesture_layer_eo.h b/src/lib/elementary/elm_gesture_layer_eo.h new file mode 100644 index 0000000000..2f15a10660 --- /dev/null +++ b/src/lib/elementary/elm_gesture_layer_eo.h @@ -0,0 +1,229 @@ +#ifndef _ELM_GESTURE_LAYER_EO_H_ +#define _ELM_GESTURE_LAYER_EO_H_ + +#ifndef _ELM_GESTURE_LAYER_EO_CLASS_TYPE +#define _ELM_GESTURE_LAYER_EO_CLASS_TYPE + +typedef Eo Elm_Gesture_Layer; + +#endif + +#ifndef _ELM_GESTURE_LAYER_EO_TYPES +#define _ELM_GESTURE_LAYER_EO_TYPES + +/** Enum of supported gesture types. + * + * @ingroup Elm_Gesture + */ +typedef enum +{ + ELM_GESTURE_FIRST = 0, /**< First type used for iteration over the enum */ + ELM_GESTURE_N_TAPS, /**< N fingers single taps */ + ELM_GESTURE_N_LONG_TAPS, /**< N fingers single long-taps */ + ELM_GESTURE_N_DOUBLE_TAPS, /**< N fingers double-single taps */ + ELM_GESTURE_N_TRIPLE_TAPS, /**< N fingers triple-single taps */ + ELM_GESTURE_MOMENTUM, /**< Reports momentum in the direction of move */ + ELM_GESTURE_N_LINES, /**< N fingers line gesture */ + ELM_GESTURE_N_FLICKS, /**< N fingers flick gesture */ + ELM_GESTURE_ZOOM, /**< Zoom */ + ELM_GESTURE_ROTATE, /**< Rotate */ + ELM_GESTURE_LAST /**< Sentinel value to indicate last enum field during + * iteration */ +} Elm_Gesture_Type; + +/** Enum of gesture states. + * + * @ingroup Elm_Gesture + */ +typedef enum +{ + ELM_GESTURE_STATE_UNDEFINED = -1 /* +1 */, /**< Gesture not started */ + ELM_GESTURE_STATE_START, /**< Gesture started */ + ELM_GESTURE_STATE_MOVE, /**< Gesture is ongoing */ + ELM_GESTURE_STATE_END, /**< Gesture completed */ + ELM_GESTURE_STATE_ABORT /**< Ongoing gesture was aborted */ +} Elm_Gesture_State; + + +#endif +/** Elementary gesture layer class + * + * @ingroup Elm_Gesture_Layer + */ +#define ELM_GESTURE_LAYER_CLASS elm_gesture_layer_class_get() + +EWAPI const Efl_Class *elm_gesture_layer_class_get(void); + +/** + * @brief Control step value for zoom action. + * + * When recognizing the zoom gesture, it should be recognized as zooming larger + * than step. + * + * @param[in] obj The object. + * @param[in] step The zoom step value. + * + * @ingroup Elm_Gesture_Layer + */ +EOAPI void elm_obj_gesture_layer_zoom_step_set(Eo *obj, double step); + +/** + * @brief Control step value for zoom action. + * + * @param[in] obj The object. + * + * @return The zoom step value. + * + * @ingroup Elm_Gesture_Layer + */ +EOAPI double elm_obj_gesture_layer_zoom_step_get(const Eo *obj); + +/** + * @brief This function sets the gesture layer finger-size for taps. + * + * If not set, it's taken from elm_config. Set to 0 if you want GLayer to use + * the system finger size value (default). + * + * @param[in] obj The object. + * @param[in] sz The finger size. + * + * @since 1.8 + * + * @ingroup Elm_Gesture_Layer + */ +EOAPI void elm_obj_gesture_layer_tap_finger_size_set(Eo *obj, int sz); + +/** + * @brief This function returns the gesture layer finger-size for taps + * + * @param[in] obj The object. + * + * @return The finger size. + * + * @since 1.8 + * + * @ingroup Elm_Gesture_Layer + */ +EOAPI int elm_obj_gesture_layer_tap_finger_size_get(const Eo *obj); + +/** + * @brief This function makes gesture-layer repeat events. + * + * Set this if you like to get the raw events only if gestures were not + * detected. + * + * Clear this if you like gesture layer to forward events as testing gestures. + * + * @param[in] obj The object. + * @param[in] hold_events If @c true get events only if gesture was not + * detected, @c false otherwise + * + * @ingroup Elm_Gesture_Layer + */ +EOAPI void elm_obj_gesture_layer_hold_events_set(Eo *obj, Eina_Bool hold_events); + +/** + * @brief Get the repeat-events setting. + * + * @param[in] obj The object. + * + * @return If @c true get events only if gesture was not detected, @c false + * otherwise + * + * @ingroup Elm_Gesture_Layer + */ +EOAPI Eina_Bool elm_obj_gesture_layer_hold_events_get(const Eo *obj); + +/** + * @brief This function returns step-value for rotate action. + * + * Set to 0 to cancel step setting. + * + * When recognizing the rotate gesture, the rotated size must be larger than + * step. + * + * @param[in] obj The object. + * @param[in] step New rotate step value. + * + * @ingroup Elm_Gesture_Layer + */ +EOAPI void elm_obj_gesture_layer_rotate_step_set(Eo *obj, double step); + +/** + * @brief This function returns step-value for rotate action. + * + * @param[in] obj The object. + * + * @return New rotate step value. + * + * @ingroup Elm_Gesture_Layer + */ +EOAPI double elm_obj_gesture_layer_rotate_step_get(const Eo *obj); + +/** + * @brief Set the gesture state change callback. + * + * When all callbacks for the gesture are set to @c null, it means this gesture + * is disabled. + * + * @param[in] obj The object. + * @param[in] idx The gesture you want to track state of. + * @param[in] cb_type The event the callback tracks (START, MOVE, END, ABORT). + * @param[in] cb The callback itself. + * @param[in] data Custom data to be passed. + * + * @ingroup Elm_Gesture_Layer + */ +EOAPI void elm_obj_gesture_layer_cb_set(Eo *obj, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data); + +/** + * @brief Attach a gesture layer widget to an Evas object (setting the widget's + * target). + * + * A gesture layer's target may be any Evas object. This object will be used to + * listen to mouse and key events. + * + * @param[in] obj The object. + * @param[in] target The object to attach. + * + * @return @c true on success, @c false otherwise. + * + * @ingroup Elm_Gesture_Layer + */ +EOAPI Eina_Bool elm_obj_gesture_layer_attach(Eo *obj, Efl_Canvas_Object *target); + +/** + * @brief Remove a gesture callback. + * + * @param[in] obj The object. + * @param[in] idx The gesture you want to track state of. + * @param[in] cb_type The event the callback tracks (START, MOVE, END, ABORT). + * @param[in] cb The callback itself. + * @param[in] data Custom callback data. + * + * @ingroup Elm_Gesture_Layer + */ +EOAPI void elm_obj_gesture_layer_cb_del(Eo *obj, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data); + +/** + * @brief Add a gesture state change callback. + * + * When all callbacks for the gesture are set to @c null, it means this gesture + * is disabled. + * + * If a function was already set for this gesture/type/state, it will be + * replaced by the new one. For ABI compat, callbacks added by + * @ref elm_obj_gesture_layer_cb_add will be removed. It is recommended to use + * only one of these functions for a gesture object. + * + * @param[in] obj The object. + * @param[in] idx The gesture you want to track state of. + * @param[in] cb_type The event the callback tracks (START, MOVE, END, ABORT). + * @param[in] cb The callback itself. + * @param[in] data Custom data to be passed. + * + * @ingroup Elm_Gesture_Layer + */ +EOAPI void elm_obj_gesture_layer_cb_add(Eo *obj, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data); + +#endif diff --git a/src/lib/elementary/elm_gesture_layer_eo.legacy.c b/src/lib/elementary/elm_gesture_layer_eo.legacy.c new file mode 100644 index 0000000000..ab6c4c95bd --- /dev/null +++ b/src/lib/elementary/elm_gesture_layer_eo.legacy.c @@ -0,0 +1,72 @@ + +EAPI void +elm_gesture_layer_zoom_step_set(Elm_Gesture_Layer *obj, double step) +{ + elm_obj_gesture_layer_zoom_step_set(obj, step); +} + +EAPI double +elm_gesture_layer_zoom_step_get(const Elm_Gesture_Layer *obj) +{ + return elm_obj_gesture_layer_zoom_step_get(obj); +} + +EAPI void +elm_gesture_layer_tap_finger_size_set(Elm_Gesture_Layer *obj, int sz) +{ + elm_obj_gesture_layer_tap_finger_size_set(obj, sz); +} + +EAPI int +elm_gesture_layer_tap_finger_size_get(const Elm_Gesture_Layer *obj) +{ + return elm_obj_gesture_layer_tap_finger_size_get(obj); +} + +EAPI void +elm_gesture_layer_hold_events_set(Elm_Gesture_Layer *obj, Eina_Bool hold_events) +{ + elm_obj_gesture_layer_hold_events_set(obj, hold_events); +} + +EAPI Eina_Bool +elm_gesture_layer_hold_events_get(const Elm_Gesture_Layer *obj) +{ + return elm_obj_gesture_layer_hold_events_get(obj); +} + +EAPI void +elm_gesture_layer_rotate_step_set(Elm_Gesture_Layer *obj, double step) +{ + elm_obj_gesture_layer_rotate_step_set(obj, step); +} + +EAPI double +elm_gesture_layer_rotate_step_get(const Elm_Gesture_Layer *obj) +{ + return elm_obj_gesture_layer_rotate_step_get(obj); +} + +EAPI void +elm_gesture_layer_cb_set(Elm_Gesture_Layer *obj, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data) +{ + elm_obj_gesture_layer_cb_set(obj, idx, cb_type, cb, data); +} + +EAPI Eina_Bool +elm_gesture_layer_attach(Elm_Gesture_Layer *obj, Efl_Canvas_Object *target) +{ + return elm_obj_gesture_layer_attach(obj, target); +} + +EAPI void +elm_gesture_layer_cb_del(Elm_Gesture_Layer *obj, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data) +{ + elm_obj_gesture_layer_cb_del(obj, idx, cb_type, cb, data); +} + +EAPI void +elm_gesture_layer_cb_add(Elm_Gesture_Layer *obj, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data) +{ + elm_obj_gesture_layer_cb_add(obj, idx, cb_type, cb, data); +} diff --git a/src/lib/elementary/elm_gesture_layer_eo.legacy.h b/src/lib/elementary/elm_gesture_layer_eo.legacy.h new file mode 100644 index 0000000000..268eab1aec --- /dev/null +++ b/src/lib/elementary/elm_gesture_layer_eo.legacy.h @@ -0,0 +1,222 @@ +#ifndef _ELM_GESTURE_LAYER_EO_LEGACY_H_ +#define _ELM_GESTURE_LAYER_EO_LEGACY_H_ + +#ifndef _ELM_GESTURE_LAYER_EO_CLASS_TYPE +#define _ELM_GESTURE_LAYER_EO_CLASS_TYPE + +typedef Eo Elm_Gesture_Layer; + +#endif + +#ifndef _ELM_GESTURE_LAYER_EO_TYPES +#define _ELM_GESTURE_LAYER_EO_TYPES + +/** Enum of supported gesture types. + * + * @ingroup Elm_Gesture + */ +typedef enum +{ + ELM_GESTURE_FIRST = 0, /**< First type used for iteration over the enum */ + ELM_GESTURE_N_TAPS, /**< N fingers single taps */ + ELM_GESTURE_N_LONG_TAPS, /**< N fingers single long-taps */ + ELM_GESTURE_N_DOUBLE_TAPS, /**< N fingers double-single taps */ + ELM_GESTURE_N_TRIPLE_TAPS, /**< N fingers triple-single taps */ + ELM_GESTURE_MOMENTUM, /**< Reports momentum in the direction of move */ + ELM_GESTURE_N_LINES, /**< N fingers line gesture */ + ELM_GESTURE_N_FLICKS, /**< N fingers flick gesture */ + ELM_GESTURE_ZOOM, /**< Zoom */ + ELM_GESTURE_ROTATE, /**< Rotate */ + ELM_GESTURE_LAST /**< Sentinel value to indicate last enum field during + * iteration */ +} Elm_Gesture_Type; + +/** Enum of gesture states. + * + * @ingroup Elm_Gesture + */ +typedef enum +{ + ELM_GESTURE_STATE_UNDEFINED = -1 /* +1 */, /**< Gesture not started */ + ELM_GESTURE_STATE_START, /**< Gesture started */ + ELM_GESTURE_STATE_MOVE, /**< Gesture is ongoing */ + ELM_GESTURE_STATE_END, /**< Gesture completed */ + ELM_GESTURE_STATE_ABORT /**< Ongoing gesture was aborted */ +} Elm_Gesture_State; + + +#endif + +/** + * @brief Control step value for zoom action. + * + * When recognizing the zoom gesture, it should be recognized as zooming larger + * than step. + * + * @param[in] obj The object. + * @param[in] step The zoom step value. + * + * @ingroup Elm_Gesture_Layer_Group + */ +EAPI void elm_gesture_layer_zoom_step_set(Elm_Gesture_Layer *obj, double step); + +/** + * @brief Control step value for zoom action. + * + * @param[in] obj The object. + * + * @return The zoom step value. + * + * @ingroup Elm_Gesture_Layer_Group + */ +EAPI double elm_gesture_layer_zoom_step_get(const Elm_Gesture_Layer *obj); + +/** + * @brief This function sets the gesture layer finger-size for taps. + * + * If not set, it's taken from elm_config. Set to 0 if you want GLayer to use + * the system finger size value (default). + * + * @param[in] obj The object. + * @param[in] sz The finger size. + * + * @since 1.8 + * + * @ingroup Elm_Gesture_Layer_Group + */ +EAPI void elm_gesture_layer_tap_finger_size_set(Elm_Gesture_Layer *obj, int sz); + +/** + * @brief This function returns the gesture layer finger-size for taps + * + * @param[in] obj The object. + * + * @return The finger size. + * + * @since 1.8 + * + * @ingroup Elm_Gesture_Layer_Group + */ +EAPI int elm_gesture_layer_tap_finger_size_get(const Elm_Gesture_Layer *obj); + +/** + * @brief This function makes gesture-layer repeat events. + * + * Set this if you like to get the raw events only if gestures were not + * detected. + * + * Clear this if you like gesture layer to forward events as testing gestures. + * + * @param[in] obj The object. + * @param[in] hold_events If @c true get events only if gesture was not + * detected, @c false otherwise + * + * @ingroup Elm_Gesture_Layer_Group + */ +EAPI void elm_gesture_layer_hold_events_set(Elm_Gesture_Layer *obj, Eina_Bool hold_events); + +/** + * @brief Get the repeat-events setting. + * + * @param[in] obj The object. + * + * @return If @c true get events only if gesture was not detected, @c false + * otherwise + * + * @ingroup Elm_Gesture_Layer_Group + */ +EAPI Eina_Bool elm_gesture_layer_hold_events_get(const Elm_Gesture_Layer *obj); + +/** + * @brief This function returns step-value for rotate action. + * + * Set to 0 to cancel step setting. + * + * When recognizing the rotate gesture, the rotated size must be larger than + * step. + * + * @param[in] obj The object. + * @param[in] step New rotate step value. + * + * @ingroup Elm_Gesture_Layer_Group + */ +EAPI void elm_gesture_layer_rotate_step_set(Elm_Gesture_Layer *obj, double step); + +/** + * @brief This function returns step-value for rotate action. + * + * @param[in] obj The object. + * + * @return New rotate step value. + * + * @ingroup Elm_Gesture_Layer_Group + */ +EAPI double elm_gesture_layer_rotate_step_get(const Elm_Gesture_Layer *obj); + +/** + * @brief Set the gesture state change callback. + * + * When all callbacks for the gesture are set to @c null, it means this gesture + * is disabled. + * + * @param[in] obj The object. + * @param[in] idx The gesture you want to track state of. + * @param[in] cb_type The event the callback tracks (START, MOVE, END, ABORT). + * @param[in] cb The callback itself. + * @param[in] data Custom data to be passed. + * + * @ingroup Elm_Gesture_Layer_Group + */ +EAPI void elm_gesture_layer_cb_set(Elm_Gesture_Layer *obj, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data); + +/** + * @brief Attach a gesture layer widget to an Evas object (setting the widget's + * target). + * + * A gesture layer's target may be any Evas object. This object will be used to + * listen to mouse and key events. + * + * @param[in] obj The object. + * @param[in] target The object to attach. + * + * @return @c true on success, @c false otherwise. + * + * @ingroup Elm_Gesture_Layer_Group + */ +EAPI Eina_Bool elm_gesture_layer_attach(Elm_Gesture_Layer *obj, Efl_Canvas_Object *target); + +/** + * @brief Remove a gesture callback. + * + * @param[in] obj The object. + * @param[in] idx The gesture you want to track state of. + * @param[in] cb_type The event the callback tracks (START, MOVE, END, ABORT). + * @param[in] cb The callback itself. + * @param[in] data Custom callback data. + * + * @ingroup Elm_Gesture_Layer_Group + */ +EAPI void elm_gesture_layer_cb_del(Elm_Gesture_Layer *obj, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data); + +/** + * @brief Add a gesture state change callback. + * + * When all callbacks for the gesture are set to @c null, it means this gesture + * is disabled. + * + * If a function was already set for this gesture/type/state, it will be + * replaced by the new one. For ABI compat, callbacks added by + * @ref elm_gesture_layer_cb_add will be removed. It is recommended to use only + * one of these functions for a gesture object. + * + * @param[in] obj The object. + * @param[in] idx The gesture you want to track state of. + * @param[in] cb_type The event the callback tracks (START, MOVE, END, ABORT). + * @param[in] cb The callback itself. + * @param[in] data Custom data to be passed. + * + * @ingroup Elm_Gesture_Layer_Group + */ +EAPI void elm_gesture_layer_cb_add(Elm_Gesture_Layer *obj, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data); + +#endif diff --git a/src/lib/elementary/elm_gesture_layer_legacy.h b/src/lib/elementary/elm_gesture_layer_legacy.h index f6f76e9dfe..7c67737e93 100644 --- a/src/lib/elementary/elm_gesture_layer_legacy.h +++ b/src/lib/elementary/elm_gesture_layer_legacy.h @@ -1,4 +1,4 @@ -#include "elm_gesture_layer.eo.legacy.h" +#include "elm_gesture_layer_eo.legacy.h" /** * Call this function to construct a new gesture-layer object. diff --git a/src/lib/elementary/elm_glview.c b/src/lib/elementary/elm_glview.c index 82308479af..51e3cb6da6 100644 --- a/src/lib/elementary/elm_glview.c +++ b/src/lib/elementary/elm_glview.c @@ -224,8 +224,6 @@ _elm_glview_efl_canvas_group_group_add(Eo *obj, Elm_Glview_Data *priv EINA_UNUSE { Evas_Object *img; - elm_widget_sub_object_parent_add(obj); - // Create image to render Evas_GL Surface img = evas_object_image_filled_add(evas_object_evas_get(obj)); elm_widget_resize_object_set(obj, img); @@ -627,4 +625,4 @@ elm_glview_render_func_set(Elm_Glview *obj, Elm_GLView_Func_Cb func) #define ELM_GLVIEW_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_glview) -#include "elm_glview.eo.c" +#include "elm_glview_eo.c" diff --git a/src/lib/elementary/elm_glview.eo b/src/lib/elementary/elm_glview.eo deleted file mode 100644 index faa03f2691..0000000000 --- a/src/lib/elementary/elm_glview.eo +++ /dev/null @@ -1,234 +0,0 @@ -type Evas_GL: __undefined_type; [[Evas GL type]] -type Evas_GL_API: __undefined_type; [[Evas GL API type]] -type Evas_GL_Context_Version: __undefined_type; [[Evas GL context version type]] - -enum Elm.GLView.Mode -{ - [[ - Selects the target surface properties - - An OR combination of Elm_GLView_Mode values should be passed to - elm_glview_mode_set when setting up a GL widget. These flags will - specify the properties of the rendering target surface; in particular, - the mode can request the surface to support alpha, depth and stencil buffers. - - ELM_GLVIEW_CLIENT_SIDE_ROTATION is a special value that indicates - to EFL that the application will handle the view rotation when the - device is rotated. This is needed only when the application requests - direct rendering. Please refer to Evas_GL - for more information about direct rendering. - - See @Elm.Glview.mode.set - See elm_opengl_page - ]] - legacy: elm_glview; - none = 0, [[Default mode]] - // 0x1 is reserved for future use - alpha = (1<<1), [[Alpha channel enabled rendering mode]] - depth = (1<<2), [[Depth buffer enabled rendering mode (24 bits by default)]] - stencil = (1<<3), [[Stencil buffer enabled rendering mode (8 bits by default)]] - direct = (1<<4), [[Request direct rendering, unless there must be a fallback]] - client_side_rotation = (1<<5), [[Client will handle GL view rotation if direct rendering is enabled]] - // Depth buffer sizes (3 bits) - depth_8 = Elm.GLView.Mode.depth | (1 << 6), [[Request min. 8 bits for the depth buffer]] - depth_16 = Elm.GLView.Mode.depth | (2 << 6), [[Request min. 16 bits for the depth buffer]] - depth_24 = Elm.GLView.Mode.depth | (3 << 6), [[Request min. 24 bits for the depth buffer (default)]] - depth_32 = Elm.GLView.Mode.depth | (4 << 6), [[Request min. 32 bits for the depth buffer]] - // Stencil buffer sizes (3 bits) - stencil_1 = Elm.GLView.Mode.stencil | (1 << 9), [[Request min. 1 bits for the stencil buffer]] - stencil_2 = Elm.GLView.Mode.stencil | (2 << 9), [[Request min. 2 bits for the stencil buffer]] - stencil_4 = Elm.GLView.Mode.stencil | (3 << 9), [[Request min. 4 bits for the stencil buffer]] - stencil_8 = Elm.GLView.Mode.stencil | (4 << 9), [[Request min. 8 bits for the stencil buffer (default)]] - stencil_16 = Elm.GLView.Mode.stencil | (5 << 9), [[Request min. 16 bits for the stencil buffer]] - // MSAA params (2 bits) - multisample_low = (1 << 12), [[MSAA with minimum number of samples]] - multisample_med = (2 << 12), [[MSAA with half the number of maximum samples]] - multisample_high = (3 << 12) [[MSAA with maximum number of samples]] - -} - -enum Elm.GLView.Resize.Policy -{ - [[ - Defines a policy for the glview resizing. - - The resizing policy tells glview what to do with the underlying - surface when resize happens. ELM_GLVIEW_RESIZE_POLICY_RECREATE - will destroy the current surface and recreate the surface to the - new size. ELM_GLVIEW_RESIZE_POLICY_SCALE will instead keep the - current surface but only display the result at the desired size scaled. - - Default is @Elm.GLView.Resize.Policy.recreate - ]] - recreate = 1, [[Resize the internal surface along with the image]] - scale = 2 [[Only resize the internal image and not the surface]] -} - -enum Elm.GLView.Render.Policy -{ - [[ - Defines a policy for gl rendering. - - The rendering policy tells glview where to run the gl rendering code. - ELM_GLVIEW_RENDER_POLICY_ON_DEMAND tells glview to call the rendering - calls on demand, which means that the rendering code gets called - only when it is visible. - - Default is @Elm.GLView.Render.Policy.on_demand - ]] - on_demand = 1, [[Render only when there is a need for redrawing]] - always = 2 [[Render always even when it is not visible]] -} - -class Elm.Glview extends Efl.Ui.Widget implements Efl.Gfx.View, Efl.Ui.Legacy -{ - [[Elementary GL view class]] - legacy_prefix: elm_glview; - eo_prefix: elm_obj_glview; - event_prefix: elm_glview; - methods { - version_constructor { - [[Constructor with context version number.]] - legacy: null; - params { - @in version: Evas_GL_Context_Version; [[GL context version]] - } - } - @property resize_policy { - set { - [[Set the resize policy for the glview object. - - By default, the resize policy is set to - #ELM_GLVIEW_RESIZE_POLICY_RECREATE. When resize is called - it destroys the previous surface and recreates the newly - specified size. If the policy is set to - #ELM_GLVIEW_RESIZE_POLICY_SCALE, however, glview only - scales the image object and not the underlying GL Surface. - ]] - return: bool; [[$true on success, $false otherwise]] - } - values { - policy: Elm.GLView.Resize.Policy; [[The scaling policy.]] - } - } - @property render_policy { - set { - [[Set the render policy for the glview object. - - By default, the render policy is set to - #ELM_GLVIEW_RENDER_POLICY_ON_DEMAND. This policy is set - such that during the render loop, glview is only redrawn - if it needs to be redrawn. (i.e. when it is visible) If the - policy is set to #ELM_GLVIEWW_RENDER_POLICY_ALWAYS, it - redraws regardless of whether it is visible or needs - redrawing. - ]] - return: bool; [[$true on success, $false otherwise]] - } - values { - policy: Elm.GLView.Render.Policy; [[The render policy.]] - } - } - @property mode { - set { - [[Set the mode of the GLView. Supports alpha, depth, stencil. - - Direct is a hint for the elm_glview to render directly to - the window given that the right conditions are met. Otherwise - it falls back to rendering to an offscreen buffer before it - gets composited to the window. - ]] - return: bool; [[$true on success, $false otherwise]] - } - values { - mode: Elm.GLView.Mode; [[The mode Options OR'ed enabling Alpha, Depth, Stencil, Direct.]] - } - } - @property gl_api { - get { - [[Get the gl api struct for gl rendering.]] - return: ptr(Evas_GL_API); [[GL API]] - } - } - @property evas_gl { - get { - [[Get the internal Evas GL attached to this view. - - Note: The returned Evas_GL must not be destroyed as it is - still owned by the view. But this pointer can be used then - to call all the evas_gl_ functions. - - @since 1.12 - ]] - return: ptr(Evas_GL); [[Evas GL]] - } - } - @property rotation { - get { - [[Get the current GL view's rotation when using direct rendering - - Note: This rotation can be different from the device - orientation. This rotation value must be used in case of - direct rendering and should be taken into account by the - application when setting the internal rotation matrix for - the view. - - @since 1.12 - ]] - return: int; [[A window rotation in degrees (0, 90, 180 or 270).]] - } - } - draw_request { - [[Notifies that there has been changes in the GLView. - - @since 1.18 - ]] - legacy: null; - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Object.finalize; - Efl.Gfx.Entity.size { set; } - Efl.Ui.Focus.Object.on_focus_update; - Efl.Gfx.View.view_size { get; set; } - } - events { - 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: 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: void; - [[Event dispatched when resize happens. - - The resized event callback functions gets called - during the render loop. The callback function allows - glview to hide all the rendering context/surface - details and have the user just call GL alls that - they desire when resize happens. - ]] - 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 - @.draw_request gets called. - ]] - } - constructors { - .version_constructor; - } -} diff --git a/src/lib/elementary/elm_glview_eo.c b/src/lib/elementary/elm_glview_eo.c new file mode 100644 index 0000000000..2a6f9a3379 --- /dev/null +++ b/src/lib/elementary/elm_glview_eo.c @@ -0,0 +1,105 @@ +EWAPI const Efl_Event_Description _ELM_GLVIEW_EVENT_CREATED = + EFL_EVENT_DESCRIPTION("created"); +EWAPI const Efl_Event_Description _ELM_GLVIEW_EVENT_DESTROYED = + EFL_EVENT_DESCRIPTION("destroyed"); +EWAPI const Efl_Event_Description _ELM_GLVIEW_EVENT_RESIZED = + EFL_EVENT_DESCRIPTION("resized"); +EWAPI const Efl_Event_Description _ELM_GLVIEW_EVENT_RENDER = + EFL_EVENT_DESCRIPTION("render"); + +void _elm_glview_version_constructor(Eo *obj, Elm_Glview_Data *pd, Evas_GL_Context_Version version); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_glview_version_constructor, EFL_FUNC_CALL(version), Evas_GL_Context_Version version); + +Eina_Bool _elm_glview_resize_policy_set(Eo *obj, Elm_Glview_Data *pd, Elm_GLView_Resize_Policy policy); + +EOAPI EFL_FUNC_BODYV(elm_obj_glview_resize_policy_set, Eina_Bool, 0, EFL_FUNC_CALL(policy), Elm_GLView_Resize_Policy policy); + +Eina_Bool _elm_glview_render_policy_set(Eo *obj, Elm_Glview_Data *pd, Elm_GLView_Render_Policy policy); + +EOAPI EFL_FUNC_BODYV(elm_obj_glview_render_policy_set, Eina_Bool, 0, EFL_FUNC_CALL(policy), Elm_GLView_Render_Policy policy); + +Eina_Bool _elm_glview_mode_set(Eo *obj, Elm_Glview_Data *pd, Elm_GLView_Mode mode); + +EOAPI EFL_FUNC_BODYV(elm_obj_glview_mode_set, Eina_Bool, 0, EFL_FUNC_CALL(mode), Elm_GLView_Mode mode); + +Evas_GL_API *_elm_glview_gl_api_get(const Eo *obj, Elm_Glview_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_glview_gl_api_get, Evas_GL_API *, NULL); + +Evas_GL *_elm_glview_evas_gl_get(const Eo *obj, Elm_Glview_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_glview_evas_gl_get, Evas_GL *, NULL); + +int _elm_glview_rotation_get(const Eo *obj, Elm_Glview_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_glview_rotation_get, int, 0); + +void _elm_glview_draw_request(Eo *obj, Elm_Glview_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_glview_draw_request); + +Efl_Object *_elm_glview_efl_object_constructor(Eo *obj, Elm_Glview_Data *pd); + + +Efl_Object *_elm_glview_efl_object_finalize(Eo *obj, Elm_Glview_Data *pd); + + +void _elm_glview_efl_gfx_entity_size_set(Eo *obj, Elm_Glview_Data *pd, Eina_Size2D size); + + +Eina_Bool _elm_glview_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Glview_Data *pd); + + +void _elm_glview_efl_gfx_view_view_size_set(Eo *obj, Elm_Glview_Data *pd, Eina_Size2D size); + + +Eina_Size2D _elm_glview_efl_gfx_view_view_size_get(const Eo *obj, Elm_Glview_Data *pd); + + +static Eina_Bool +_elm_glview_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_GLVIEW_EXTRA_OPS +#define ELM_GLVIEW_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_glview_version_constructor, _elm_glview_version_constructor), + EFL_OBJECT_OP_FUNC(elm_obj_glview_resize_policy_set, _elm_glview_resize_policy_set), + EFL_OBJECT_OP_FUNC(elm_obj_glview_render_policy_set, _elm_glview_render_policy_set), + EFL_OBJECT_OP_FUNC(elm_obj_glview_mode_set, _elm_glview_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_glview_gl_api_get, _elm_glview_gl_api_get), + EFL_OBJECT_OP_FUNC(elm_obj_glview_evas_gl_get, _elm_glview_evas_gl_get), + EFL_OBJECT_OP_FUNC(elm_obj_glview_rotation_get, _elm_glview_rotation_get), + EFL_OBJECT_OP_FUNC(elm_obj_glview_draw_request, _elm_glview_draw_request), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_glview_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_finalize, _elm_glview_efl_object_finalize), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_glview_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_on_focus_update, _elm_glview_efl_ui_focus_object_on_focus_update), + EFL_OBJECT_OP_FUNC(efl_gfx_view_size_set, _elm_glview_efl_gfx_view_view_size_set), + EFL_OBJECT_OP_FUNC(efl_gfx_view_size_get, _elm_glview_efl_gfx_view_view_size_get), + ELM_GLVIEW_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_glview_class_desc = { + EO_VERSION, + "Elm.Glview", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Glview_Data), + _elm_glview_class_initializer, + _elm_glview_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_glview_class_get, &_elm_glview_class_desc, EFL_UI_WIDGET_CLASS, EFL_GFX_VIEW_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_glview_eo.legacy.c" diff --git a/src/lib/elementary/elm_glview_eo.h b/src/lib/elementary/elm_glview_eo.h new file mode 100644 index 0000000000..9e8879b805 --- /dev/null +++ b/src/lib/elementary/elm_glview_eo.h @@ -0,0 +1,294 @@ +#ifndef _ELM_GLVIEW_EO_H_ +#define _ELM_GLVIEW_EO_H_ + +#ifndef _ELM_GLVIEW_EO_CLASS_TYPE +#define _ELM_GLVIEW_EO_CLASS_TYPE + +typedef Eo Elm_Glview; + +#endif + +#ifndef _ELM_GLVIEW_EO_TYPES +#define _ELM_GLVIEW_EO_TYPES + +/** + * @brief Selects the target surface properties + * + * An OR combination of Elm_GLView_Mode values should be passed to + * elm_glview_mode_set when setting up a GL widget. These flags will specify + * the properties of the rendering target surface; in particular, the mode can + * request the surface to support alpha, depth and stencil buffers. + * + * ELM_GLVIEW_CLIENT_SIDE_ROTATION is a special value that indicates to EFL + * that the application will handle the view rotation when the device is + * rotated. This is needed only when the application requests direct rendering. + * Please refer to Evas_GL for more information about direct rendering. + * + * See @ref elm_obj_glview_mode_set See elm_opengl_page + * + * @ingroup Elm_GLView + */ +typedef enum +{ + ELM_GLVIEW_NONE = 0, /**< Default mode */ + ELM_GLVIEW_ALPHA = 2 /* 1 >> 1 */, /**< Alpha channel enabled rendering mode + */ + ELM_GLVIEW_DEPTH = 4 /* 1 >> 2 */, /**< Depth buffer enabled rendering mode + * (24 bits by default) */ + ELM_GLVIEW_STENCIL = 8 /* 1 >> 3 */, /**< Stencil buffer enabled rendering + * mode (8 bits by default) */ + ELM_GLVIEW_DIRECT = 16 /* 1 >> 4 */, /**< Request direct rendering, unless + * there must be a fallback */ + ELM_GLVIEW_CLIENT_SIDE_ROTATION = 32 /* 1 >> 5 */, /**< Client will handle GL + * view rotation if direct + * rendering is enabled */ + ELM_GLVIEW_DEPTH_8 = 68 /* Elm.GLView.Mode.depth ^ (1 >> 6) */, /**< Request min. 8 bits for the depth + * buffer */ + ELM_GLVIEW_DEPTH_16 = 132 /* Elm.GLView.Mode.depth ^ (2 >> 6) */, /**< Request min. 16 bits for the depth + * buffer */ + ELM_GLVIEW_DEPTH_24 = 196 /* Elm.GLView.Mode.depth ^ (3 >> 6) */, /**< Request min. 24 bits for the depth + * buffer (default) */ + ELM_GLVIEW_DEPTH_32 = 260 /* Elm.GLView.Mode.depth ^ (4 >> 6) */, /**< Request min. 32 bits for the depth + * buffer */ + ELM_GLVIEW_STENCIL_1 = 520 /* Elm.GLView.Mode.stencil ^ (1 >> 9) */, /**< Request min. 1 bits for the stencil + * buffer */ + ELM_GLVIEW_STENCIL_2 = 1032 /* Elm.GLView.Mode.stencil ^ (2 >> 9) */, /**< Request min. 2 bits for the stencil + * buffer */ + ELM_GLVIEW_STENCIL_4 = 1544 /* Elm.GLView.Mode.stencil ^ (3 >> 9) */, /**< Request min. 4 bits for the stencil + * buffer */ + ELM_GLVIEW_STENCIL_8 = 2056 /* Elm.GLView.Mode.stencil ^ (4 >> 9) */, /**< Request min. 8 bits for the stencil + * buffer (default) */ + ELM_GLVIEW_STENCIL_16 = 2568 /* Elm.GLView.Mode.stencil ^ (5 >> 9) */, /**< Request min. 16 bits for the + * stencil buffer */ + ELM_GLVIEW_MULTISAMPLE_LOW = 4096 /* 1 >> 12 */, /**< MSAA with minimum number + * of samples */ + ELM_GLVIEW_MULTISAMPLE_MED = 8192 /* 2 >> 12 */, /**< MSAA with half the + * number of maximum samples + */ + ELM_GLVIEW_MULTISAMPLE_HIGH = 12288 /* 3 >> 12 */ /**< MSAA with maximum + * number of samples */ +} Elm_GLView_Mode; + +/** + * @brief Defines a policy for the glview resizing. + * + * The resizing policy tells glview what to do with the underlying surface when + * resize happens. ELM_GLVIEW_RESIZE_POLICY_RECREATE will destroy the current + * surface and recreate the surface to the new size. + * ELM_GLVIEW_RESIZE_POLICY_SCALE will instead keep the current surface but + * only display the result at the desired size scaled. + * + * Default is @ref ELM_GLVIEW_RESIZE_POLICY_RECREATE + * + * @ingroup Elm_GLView_Resize + */ +typedef enum +{ + ELM_GLVIEW_RESIZE_POLICY_RECREATE = 1, /**< Resize the internal surface along + * with the image */ + ELM_GLVIEW_RESIZE_POLICY_SCALE = 2 /**< Only resize the internal image and not + * the surface */ +} Elm_GLView_Resize_Policy; + +/** + * @brief Defines a policy for gl rendering. + * + * The rendering policy tells glview where to run the gl rendering code. + * ELM_GLVIEW_RENDER_POLICY_ON_DEMAND tells glview to call the rendering calls + * on demand, which means that the rendering code gets called only when it is + * visible. + * + * Default is @ref ELM_GLVIEW_RENDER_POLICY_ON_DEMAND + * + * @ingroup Elm_GLView_Render + */ +typedef enum +{ + ELM_GLVIEW_RENDER_POLICY_ON_DEMAND = 1, /**< Render only when there is a need + * for redrawing */ + ELM_GLVIEW_RENDER_POLICY_ALWAYS = 2 /**< Render always even when it is not + * visible */ +} Elm_GLView_Render_Policy; + + +#endif +/** Elementary GL view class + * + * @ingroup Elm_Glview + */ +#define ELM_GLVIEW_CLASS elm_glview_class_get() + +EWAPI const Efl_Class *elm_glview_class_get(void); + +/** + * @brief Constructor with context version number. + * + * @param[in] obj The object. + * @param[in] version GL context version + * + * @ingroup Elm_Glview + */ +EOAPI void elm_obj_glview_version_constructor(Eo *obj, Evas_GL_Context_Version version); + +/** + * @brief Set the resize policy for the glview object. + * + * By default, the resize policy is set to #ELM_GLVIEW_RESIZE_POLICY_RECREATE. + * When resize is called it destroys the previous surface and recreates the + * newly specified size. If the policy is set to + * #ELM_GLVIEW_RESIZE_POLICY_SCALE, however, glview only scales the image + * object and not the underlying GL Surface. + * + * @param[in] obj The object. + * @param[in] policy The scaling policy. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Glview + */ +EOAPI Eina_Bool elm_obj_glview_resize_policy_set(Eo *obj, Elm_GLView_Resize_Policy policy); + +/** + * @brief Set the render policy for the glview object. + * + * By default, the render policy is set to #ELM_GLVIEW_RENDER_POLICY_ON_DEMAND. + * This policy is set such that during the render loop, glview is only redrawn + * if it needs to be redrawn. (i.e. when it is visible) If the policy is set to + * #ELM_GLVIEWW_RENDER_POLICY_ALWAYS, it redraws regardless of whether it is + * visible or needs redrawing. + * + * @param[in] obj The object. + * @param[in] policy The render policy. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Glview + */ +EOAPI Eina_Bool elm_obj_glview_render_policy_set(Eo *obj, Elm_GLView_Render_Policy policy); + +/** + * @brief Set the mode of the GLView. Supports alpha, depth, stencil. + * + * Direct is a hint for the elm_glview to render directly to the window given + * that the right conditions are met. Otherwise it falls back to rendering to + * an offscreen buffer before it gets composited to the window. + * + * @param[in] obj The object. + * @param[in] mode The mode Options OR'ed enabling Alpha, Depth, Stencil, + * Direct. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Glview + */ +EOAPI Eina_Bool elm_obj_glview_mode_set(Eo *obj, Elm_GLView_Mode mode); + +/** + * @brief Get the gl api struct for gl rendering. + * + * @param[in] obj The object. + * + * @return GL API + * + * @ingroup Elm_Glview + */ +EOAPI Evas_GL_API *elm_obj_glview_gl_api_get(const Eo *obj); + +/** + * @brief Get the internal Evas GL attached to this view. + * + * @note The returned Evas_GL must not be destroyed as it is still owned by the + * view. But this pointer can be used then to call all the evas_gl_ functions. + * + * @param[in] obj The object. + * + * @return Evas GL + * + * @since 1.12 + * + * @ingroup Elm_Glview + */ +EOAPI Evas_GL *elm_obj_glview_evas_gl_get(const Eo *obj); + +/** + * @brief Get the current GL view's rotation when using direct rendering + * + * @note This rotation can be different from the device orientation. This + * rotation value must be used in case of direct rendering and should be taken + * into account by the application when setting the internal rotation matrix + * for the view. + * + * @param[in] obj The object. + * + * @return A window rotation in degrees (0, 90, 180 or 270). + * + * @since 1.12 + * + * @ingroup Elm_Glview + */ +EOAPI int elm_obj_glview_rotation_get(const Eo *obj); + +/** Notifies that there has been changes in the GLView. + * + * @since 1.18 + * + * @ingroup Elm_Glview + */ +EOAPI void elm_obj_glview_draw_request(Eo *obj); + +EWAPI extern const Efl_Event_Description _ELM_GLVIEW_EVENT_CREATED; + +/** + * @brief 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. + * + * @ingroup Elm_Glview + */ +#define ELM_GLVIEW_EVENT_CREATED (&(_ELM_GLVIEW_EVENT_CREATED)) + +EWAPI extern const Efl_Event_Description _ELM_GLVIEW_EVENT_DESTROYED; + +/** + * @brief 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. + * + * @ingroup Elm_Glview + */ +#define ELM_GLVIEW_EVENT_DESTROYED (&(_ELM_GLVIEW_EVENT_DESTROYED)) + +EWAPI extern const Efl_Event_Description _ELM_GLVIEW_EVENT_RESIZED; + +/** + * @brief Event dispatched when resize happens. + * + * The resized event callback functions gets called during the render loop. The + * callback function allows glview to hide all the rendering context/surface + * details and have the user just call GL alls that they desire when resize + * happens. + * + * @ingroup Elm_Glview + */ +#define ELM_GLVIEW_EVENT_RESIZED (&(_ELM_GLVIEW_EVENT_RESIZED)) + +EWAPI extern const Efl_Event_Description _ELM_GLVIEW_EVENT_RENDER; + +/** + * @brief 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 @ref elm_obj_glview_draw_request + * gets called. + * + * @ingroup Elm_Glview + */ +#define ELM_GLVIEW_EVENT_RENDER (&(_ELM_GLVIEW_EVENT_RENDER)) + +#endif diff --git a/src/lib/elementary/elm_glview_eo.legacy.c b/src/lib/elementary/elm_glview_eo.legacy.c new file mode 100644 index 0000000000..5275f6d19e --- /dev/null +++ b/src/lib/elementary/elm_glview_eo.legacy.c @@ -0,0 +1,36 @@ + +EAPI Eina_Bool +elm_glview_resize_policy_set(Elm_Glview *obj, Elm_GLView_Resize_Policy policy) +{ + return elm_obj_glview_resize_policy_set(obj, policy); +} + +EAPI Eina_Bool +elm_glview_render_policy_set(Elm_Glview *obj, Elm_GLView_Render_Policy policy) +{ + return elm_obj_glview_render_policy_set(obj, policy); +} + +EAPI Eina_Bool +elm_glview_mode_set(Elm_Glview *obj, Elm_GLView_Mode mode) +{ + return elm_obj_glview_mode_set(obj, mode); +} + +EAPI Evas_GL_API * +elm_glview_gl_api_get(const Elm_Glview *obj) +{ + return elm_obj_glview_gl_api_get(obj); +} + +EAPI Evas_GL * +elm_glview_evas_gl_get(const Elm_Glview *obj) +{ + return elm_obj_glview_evas_gl_get(obj); +} + +EAPI int +elm_glview_rotation_get(const Elm_Glview *obj) +{ + return elm_obj_glview_rotation_get(obj); +} diff --git a/src/lib/elementary/elm_glview_eo.legacy.h b/src/lib/elementary/elm_glview_eo.legacy.h new file mode 100644 index 0000000000..562b31207d --- /dev/null +++ b/src/lib/elementary/elm_glview_eo.legacy.h @@ -0,0 +1,216 @@ +#ifndef _ELM_GLVIEW_EO_LEGACY_H_ +#define _ELM_GLVIEW_EO_LEGACY_H_ + +#ifndef _ELM_GLVIEW_EO_CLASS_TYPE +#define _ELM_GLVIEW_EO_CLASS_TYPE + +typedef Eo Elm_Glview; + +#endif + +#ifndef _ELM_GLVIEW_EO_TYPES +#define _ELM_GLVIEW_EO_TYPES + +/** + * @brief Selects the target surface properties + * + * An OR combination of Elm_GLView_Mode values should be passed to + * elm_glview_mode_set when setting up a GL widget. These flags will specify + * the properties of the rendering target surface; in particular, the mode can + * request the surface to support alpha, depth and stencil buffers. + * + * ELM_GLVIEW_CLIENT_SIDE_ROTATION is a special value that indicates to EFL + * that the application will handle the view rotation when the device is + * rotated. This is needed only when the application requests direct rendering. + * Please refer to Evas_GL for more information about direct rendering. + * + * See @ref elm_glview_mode_set See elm_opengl_page + * + * @ingroup Elm_GLView + */ +typedef enum +{ + ELM_GLVIEW_NONE = 0, /**< Default mode */ + ELM_GLVIEW_ALPHA = 2 /* 1 >> 1 */, /**< Alpha channel enabled rendering mode + */ + ELM_GLVIEW_DEPTH = 4 /* 1 >> 2 */, /**< Depth buffer enabled rendering mode + * (24 bits by default) */ + ELM_GLVIEW_STENCIL = 8 /* 1 >> 3 */, /**< Stencil buffer enabled rendering + * mode (8 bits by default) */ + ELM_GLVIEW_DIRECT = 16 /* 1 >> 4 */, /**< Request direct rendering, unless + * there must be a fallback */ + ELM_GLVIEW_CLIENT_SIDE_ROTATION = 32 /* 1 >> 5 */, /**< Client will handle GL + * view rotation if direct + * rendering is enabled */ + ELM_GLVIEW_DEPTH_8 = 68 /* Elm.GLView.Mode.depth ^ (1 >> 6) */, /**< Request min. 8 bits for the depth + * buffer */ + ELM_GLVIEW_DEPTH_16 = 132 /* Elm.GLView.Mode.depth ^ (2 >> 6) */, /**< Request min. 16 bits for the depth + * buffer */ + ELM_GLVIEW_DEPTH_24 = 196 /* Elm.GLView.Mode.depth ^ (3 >> 6) */, /**< Request min. 24 bits for the depth + * buffer (default) */ + ELM_GLVIEW_DEPTH_32 = 260 /* Elm.GLView.Mode.depth ^ (4 >> 6) */, /**< Request min. 32 bits for the depth + * buffer */ + ELM_GLVIEW_STENCIL_1 = 520 /* Elm.GLView.Mode.stencil ^ (1 >> 9) */, /**< Request min. 1 bits for the stencil + * buffer */ + ELM_GLVIEW_STENCIL_2 = 1032 /* Elm.GLView.Mode.stencil ^ (2 >> 9) */, /**< Request min. 2 bits for the stencil + * buffer */ + ELM_GLVIEW_STENCIL_4 = 1544 /* Elm.GLView.Mode.stencil ^ (3 >> 9) */, /**< Request min. 4 bits for the stencil + * buffer */ + ELM_GLVIEW_STENCIL_8 = 2056 /* Elm.GLView.Mode.stencil ^ (4 >> 9) */, /**< Request min. 8 bits for the stencil + * buffer (default) */ + ELM_GLVIEW_STENCIL_16 = 2568 /* Elm.GLView.Mode.stencil ^ (5 >> 9) */, /**< Request min. 16 bits for the + * stencil buffer */ + ELM_GLVIEW_MULTISAMPLE_LOW = 4096 /* 1 >> 12 */, /**< MSAA with minimum number + * of samples */ + ELM_GLVIEW_MULTISAMPLE_MED = 8192 /* 2 >> 12 */, /**< MSAA with half the + * number of maximum samples + */ + ELM_GLVIEW_MULTISAMPLE_HIGH = 12288 /* 3 >> 12 */ /**< MSAA with maximum + * number of samples */ +} Elm_GLView_Mode; + +/** + * @brief Defines a policy for the glview resizing. + * + * The resizing policy tells glview what to do with the underlying surface when + * resize happens. ELM_GLVIEW_RESIZE_POLICY_RECREATE will destroy the current + * surface and recreate the surface to the new size. + * ELM_GLVIEW_RESIZE_POLICY_SCALE will instead keep the current surface but + * only display the result at the desired size scaled. + * + * Default is @ref ELM_GLVIEW_RESIZE_POLICY_RECREATE + * + * @ingroup Elm_GLView_Resize + */ +typedef enum +{ + ELM_GLVIEW_RESIZE_POLICY_RECREATE = 1, /**< Resize the internal surface along + * with the image */ + ELM_GLVIEW_RESIZE_POLICY_SCALE = 2 /**< Only resize the internal image and not + * the surface */ +} Elm_GLView_Resize_Policy; + +/** + * @brief Defines a policy for gl rendering. + * + * The rendering policy tells glview where to run the gl rendering code. + * ELM_GLVIEW_RENDER_POLICY_ON_DEMAND tells glview to call the rendering calls + * on demand, which means that the rendering code gets called only when it is + * visible. + * + * Default is @ref ELM_GLVIEW_RENDER_POLICY_ON_DEMAND + * + * @ingroup Elm_GLView_Render + */ +typedef enum +{ + ELM_GLVIEW_RENDER_POLICY_ON_DEMAND = 1, /**< Render only when there is a need + * for redrawing */ + ELM_GLVIEW_RENDER_POLICY_ALWAYS = 2 /**< Render always even when it is not + * visible */ +} Elm_GLView_Render_Policy; + + +#endif + + +/** + * @brief Set the resize policy for the glview object. + * + * By default, the resize policy is set to #ELM_GLVIEW_RESIZE_POLICY_RECREATE. + * When resize is called it destroys the previous surface and recreates the + * newly specified size. If the policy is set to + * #ELM_GLVIEW_RESIZE_POLICY_SCALE, however, glview only scales the image + * object and not the underlying GL Surface. + * + * @param[in] obj The object. + * @param[in] policy The scaling policy. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Glview_Group + */ +EAPI Eina_Bool elm_glview_resize_policy_set(Elm_Glview *obj, Elm_GLView_Resize_Policy policy); + +/** + * @brief Set the render policy for the glview object. + * + * By default, the render policy is set to #ELM_GLVIEW_RENDER_POLICY_ON_DEMAND. + * This policy is set such that during the render loop, glview is only redrawn + * if it needs to be redrawn. (i.e. when it is visible) If the policy is set to + * #ELM_GLVIEWW_RENDER_POLICY_ALWAYS, it redraws regardless of whether it is + * visible or needs redrawing. + * + * @param[in] obj The object. + * @param[in] policy The render policy. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Glview_Group + */ +EAPI Eina_Bool elm_glview_render_policy_set(Elm_Glview *obj, Elm_GLView_Render_Policy policy); + +/** + * @brief Set the mode of the GLView. Supports alpha, depth, stencil. + * + * Direct is a hint for the elm_glview to render directly to the window given + * that the right conditions are met. Otherwise it falls back to rendering to + * an offscreen buffer before it gets composited to the window. + * + * @param[in] obj The object. + * @param[in] mode The mode Options OR'ed enabling Alpha, Depth, Stencil, + * Direct. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Glview_Group + */ +EAPI Eina_Bool elm_glview_mode_set(Elm_Glview *obj, Elm_GLView_Mode mode); + +/** + * @brief Get the gl api struct for gl rendering. + * + * @param[in] obj The object. + * + * @return GL API + * + * @ingroup Elm_Glview_Group + */ +EAPI Evas_GL_API *elm_glview_gl_api_get(const Elm_Glview *obj); + +/** + * @brief Get the internal Evas GL attached to this view. + * + * @note The returned Evas_GL must not be destroyed as it is still owned by the + * view. But this pointer can be used then to call all the evas_gl_ functions. + * + * @param[in] obj The object. + * + * @return Evas GL + * + * @since 1.12 + * + * @ingroup Elm_Glview_Group + */ +EAPI Evas_GL *elm_glview_evas_gl_get(const Elm_Glview *obj); + +/** + * @brief Get the current GL view's rotation when using direct rendering + * + * @note This rotation can be different from the device orientation. This + * rotation value must be used in case of direct rendering and should be taken + * into account by the application when setting the internal rotation matrix + * for the view. + * + * @param[in] obj The object. + * + * @return A window rotation in degrees (0, 90, 180 or 270). + * + * @since 1.12 + * + * @ingroup Elm_Glview_Group + */ +EAPI int elm_glview_rotation_get(const Elm_Glview *obj); + + +#endif diff --git a/src/lib/elementary/elm_glview_legacy.h b/src/lib/elementary/elm_glview_legacy.h index 1f0bea4b7e..84e148c511 100644 --- a/src/lib/elementary/elm_glview_legacy.h +++ b/src/lib/elementary/elm_glview_legacy.h @@ -89,4 +89,4 @@ EAPI void elm_glview_resize_func_set(Evas_Object *obj, Elm_GLView_Func_Cb func); * @ingroup Elm_GLView */ EAPI void elm_glview_render_func_set(Evas_Object *obj, Elm_GLView_Func_Cb func); -#include "elm_glview.eo.legacy.h" +#include "elm_glview_eo.legacy.h" diff --git a/src/lib/elementary/elm_grid.c b/src/lib/elementary/elm_grid.c index b9279817b5..6548f21e16 100644 --- a/src/lib/elementary/elm_grid.c +++ b/src/lib/elementary/elm_grid.c @@ -6,7 +6,7 @@ #define EFL_UI_FOCUS_COMPOSITION_PROTECTED #include -#include +#include #include "elm_priv.h" #include "elm_widget_grid.h" @@ -40,13 +40,13 @@ _mirrored_set(Evas_Object *obj, Eina_Bool rtl) evas_object_grid_mirrored_set(wd->resize_obj, rtl); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_grid_efl_ui_widget_theme_apply(Eo *obj, void *sd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _mirrored_set(obj, efl_ui_mirrored_get(obj)); @@ -59,8 +59,6 @@ _elm_grid_efl_canvas_group_group_add(Eo *obj, void *_pd EINA_UNUSED) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); Evas_Object *grid; - elm_widget_sub_object_parent_add(obj); - grid = evas_object_grid_add(evas_object_evas_get(obj)); elm_widget_resize_object_set(obj, grid); evas_object_grid_size_set(wd->resize_obj, 100, 100); @@ -217,4 +215,4 @@ _elm_grid_class_constructor(Efl_Class *klass) #define ELM_GRID_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_grid) -#include "elm_grid.eo.c" +#include "elm_grid_eo.c" diff --git a/src/lib/elementary/elm_grid.eo b/src/lib/elementary/elm_grid.eo deleted file mode 100644 index 157d87544f..0000000000 --- a/src/lib/elementary/elm_grid.eo +++ /dev/null @@ -1,63 +0,0 @@ -class Elm.Grid extends Efl.Ui.Widget implements Efl.Ui.Focus.Composition, Efl.Ui.Legacy -{ - [[Elementary grid class]] - legacy_prefix: elm_grid; - eo_prefix: elm_obj_grid; - data: null; - methods { - @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]] - h: int; [[The virtual height of the grid]] - } - } - @property children { - get { - [[Get the list of the children for the grid. - - Note: This is a duplicate of the list kept by the grid internally. - It's up to the user to destroy it when it no longer needs it. - It's possible to remove objects from the grid when walking this - list, but these removals won't be reflected on it. - ]] - return: list @owned @warn_unused; [[List of children]] - } - } - clear { - [[Faster way to remove all child objects from a grid object.]] - params { - @in clear: bool; [[If $true, it will delete just removed children]] - } - } - unpack { - [[Unpack a child from a grid object]] - params { - @in subobj: Efl.Canvas.Object; [[The child to unpack]] - } - } - pack { - [[Pack child at given position and size]] - params { - @in subobj: Efl.Canvas.Object; [[The child to pack.]] - @in x: int; [[The virtual x coord at which to pack it.]] - @in y: int; [[The virtual y coord at which to pack it.]] - @in w: int; [[The virtual width at which to pack it.]] - @in h: int; [[The virtual height at which to pack it.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.theme_apply; - Efl.Ui.Focus.Composition.prepare; - } -} diff --git a/src/lib/elementary/elm_grid_eo.c b/src/lib/elementary/elm_grid_eo.c new file mode 100644 index 0000000000..9502a45b77 --- /dev/null +++ b/src/lib/elementary/elm_grid_eo.c @@ -0,0 +1,75 @@ + +void _elm_grid_grid_size_set(Eo *obj, void *pd, int w, int h); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_grid_size_set, EFL_FUNC_CALL(w, h), int w, int h); + +void _elm_grid_grid_size_get(const Eo *obj, void *pd, int *w, int *h); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_grid_size_get, EFL_FUNC_CALL(w, h), int *w, int *h); + +Eina_List *_elm_grid_children_get(const Eo *obj, void *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_grid_children_get, Eina_List *, NULL); + +void _elm_grid_clear(Eo *obj, void *pd, Eina_Bool clear); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_grid_clear, EFL_FUNC_CALL(clear), Eina_Bool clear); + +void _elm_grid_unpack(Eo *obj, void *pd, Efl_Canvas_Object *subobj); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_grid_unpack, EFL_FUNC_CALL(subobj), Efl_Canvas_Object *subobj); + +void _elm_grid_pack(Eo *obj, void *pd, Efl_Canvas_Object *subobj, int x, int y, int w, int h); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_grid_pack, EFL_FUNC_CALL(subobj, x, y, w, h), Efl_Canvas_Object *subobj, int x, int y, int w, int h); + +Efl_Object *_elm_grid_efl_object_constructor(Eo *obj, void *pd); + + +Eina_Error _elm_grid_efl_ui_widget_theme_apply(Eo *obj, void *pd); + + +void _elm_grid_efl_ui_focus_composition_prepare(Eo *obj, void *pd); + + +static Eina_Bool +_elm_grid_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_GRID_EXTRA_OPS +#define ELM_GRID_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_grid_size_set, _elm_grid_grid_size_set), + EFL_OBJECT_OP_FUNC(elm_obj_grid_size_get, _elm_grid_grid_size_get), + EFL_OBJECT_OP_FUNC(elm_obj_grid_children_get, _elm_grid_children_get), + EFL_OBJECT_OP_FUNC(elm_obj_grid_clear, _elm_grid_clear), + EFL_OBJECT_OP_FUNC(elm_obj_grid_unpack, _elm_grid_unpack), + EFL_OBJECT_OP_FUNC(elm_obj_grid_pack, _elm_grid_pack), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_grid_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_grid_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_focus_composition_prepare, _elm_grid_efl_ui_focus_composition_prepare), + ELM_GRID_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_grid_class_desc = { + EO_VERSION, + "Elm.Grid", + EFL_CLASS_TYPE_REGULAR, + 0, + _elm_grid_class_initializer, + _elm_grid_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_grid_class_get, &_elm_grid_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_grid_eo.legacy.c" diff --git a/src/lib/elementary/elm_grid_eo.h b/src/lib/elementary/elm_grid_eo.h new file mode 100644 index 0000000000..d9ae0a821e --- /dev/null +++ b/src/lib/elementary/elm_grid_eo.h @@ -0,0 +1,96 @@ +#ifndef _ELM_GRID_EO_H_ +#define _ELM_GRID_EO_H_ + +#ifndef _ELM_GRID_EO_CLASS_TYPE +#define _ELM_GRID_EO_CLASS_TYPE + +typedef Eo Elm_Grid; + +#endif + +#ifndef _ELM_GRID_EO_TYPES +#define _ELM_GRID_EO_TYPES + + +#endif +/** Elementary grid class + * + * @ingroup Elm_Grid + */ +#define ELM_GRID_CLASS elm_grid_class_get() + +EWAPI const Efl_Class *elm_grid_class_get(void); + +/** + * @brief Set the virtual size of the grid + * + * @param[in] obj The object. + * @param[in] w The virtual width of the grid + * @param[in] h The virtual height of the grid + * + * @ingroup Elm_Grid + */ +EOAPI void elm_obj_grid_size_set(Eo *obj, int w, int h); + +/** + * @brief Get the virtual size of the grid + * + * @param[in] obj The object. + * @param[out] w The virtual width of the grid + * @param[out] h The virtual height of the grid + * + * @ingroup Elm_Grid + */ +EOAPI void elm_obj_grid_size_get(const Eo *obj, int *w, int *h); + +/** + * @brief Get the list of the children for the grid. + * + * @note This is a duplicate of the list kept by the grid internally. It's up + * to the user to destroy it when it no longer needs it. It's possible to + * remove objects from the grid when walking this list, but these removals + * won't be reflected on it. + * + * @param[in] obj The object. + * + * @return List of children + * + * @ingroup Elm_Grid + */ +EOAPI Eina_List *elm_obj_grid_children_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Faster way to remove all child objects from a grid object. + * + * @param[in] obj The object. + * @param[in] clear If @c true, it will delete just removed children + * + * @ingroup Elm_Grid + */ +EOAPI void elm_obj_grid_clear(Eo *obj, Eina_Bool clear); + +/** + * @brief Unpack a child from a grid object + * + * @param[in] obj The object. + * @param[in] subobj The child to unpack + * + * @ingroup Elm_Grid + */ +EOAPI void elm_obj_grid_unpack(Eo *obj, Efl_Canvas_Object *subobj); + +/** + * @brief Pack child at given position and size + * + * @param[in] obj The object. + * @param[in] subobj The child to pack. + * @param[in] x The virtual x coord at which to pack it. + * @param[in] y The virtual y coord at which to pack it. + * @param[in] w The virtual width at which to pack it. + * @param[in] h The virtual height at which to pack it. + * + * @ingroup Elm_Grid + */ +EOAPI void elm_obj_grid_pack(Eo *obj, Efl_Canvas_Object *subobj, int x, int y, int w, int h); + +#endif diff --git a/src/lib/elementary/elm_grid_eo.legacy.c b/src/lib/elementary/elm_grid_eo.legacy.c new file mode 100644 index 0000000000..074d488e9a --- /dev/null +++ b/src/lib/elementary/elm_grid_eo.legacy.c @@ -0,0 +1,36 @@ + +EAPI void +elm_grid_size_set(Elm_Grid *obj, int w, int h) +{ + elm_obj_grid_size_set(obj, w, h); +} + +EAPI void +elm_grid_size_get(const Elm_Grid *obj, int *w, int *h) +{ + elm_obj_grid_size_get(obj, w, h); +} + +EAPI Eina_List * +elm_grid_children_get(const Elm_Grid *obj) +{ + return elm_obj_grid_children_get(obj); +} + +EAPI void +elm_grid_clear(Elm_Grid *obj, Eina_Bool clear) +{ + elm_obj_grid_clear(obj, clear); +} + +EAPI void +elm_grid_unpack(Elm_Grid *obj, Efl_Canvas_Object *subobj) +{ + elm_obj_grid_unpack(obj, subobj); +} + +EAPI void +elm_grid_pack(Elm_Grid *obj, Efl_Canvas_Object *subobj, int x, int y, int w, int h) +{ + elm_obj_grid_pack(obj, subobj, x, y, w, h); +} diff --git a/src/lib/elementary/elm_grid_eo.legacy.h b/src/lib/elementary/elm_grid_eo.legacy.h new file mode 100644 index 0000000000..7dae7b5905 --- /dev/null +++ b/src/lib/elementary/elm_grid_eo.legacy.h @@ -0,0 +1,89 @@ +#ifndef _ELM_GRID_EO_LEGACY_H_ +#define _ELM_GRID_EO_LEGACY_H_ + +#ifndef _ELM_GRID_EO_CLASS_TYPE +#define _ELM_GRID_EO_CLASS_TYPE + +typedef Eo Elm_Grid; + +#endif + +#ifndef _ELM_GRID_EO_TYPES +#define _ELM_GRID_EO_TYPES + + +#endif + +/** + * @brief Set the virtual size of the grid + * + * @param[in] obj The object. + * @param[in] w The virtual width of the grid + * @param[in] h The virtual height of the grid + * + * @ingroup Elm_Grid_Group + */ +EAPI void elm_grid_size_set(Elm_Grid *obj, int w, int h); + +/** + * @brief Get the virtual size of the grid + * + * @param[in] obj The object. + * @param[out] w The virtual width of the grid + * @param[out] h The virtual height of the grid + * + * @ingroup Elm_Grid_Group + */ +EAPI void elm_grid_size_get(const Elm_Grid *obj, int *w, int *h); + +/** + * @brief Get the list of the children for the grid. + * + * @note This is a duplicate of the list kept by the grid internally. It's up + * to the user to destroy it when it no longer needs it. It's possible to + * remove objects from the grid when walking this list, but these removals + * won't be reflected on it. + * + * @param[in] obj The object. + * + * @return List of children + * + * @ingroup Elm_Grid_Group + */ +EAPI Eina_List *elm_grid_children_get(const Elm_Grid *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Faster way to remove all child objects from a grid object. + * + * @param[in] obj The object. + * @param[in] clear If @c true, it will delete just removed children + * + * @ingroup Elm_Grid_Group + */ +EAPI void elm_grid_clear(Elm_Grid *obj, Eina_Bool clear); + +/** + * @brief Unpack a child from a grid object + * + * @param[in] obj The object. + * @param[in] subobj The child to unpack + * + * @ingroup Elm_Grid_Group + */ +EAPI void elm_grid_unpack(Elm_Grid *obj, Efl_Canvas_Object *subobj); + +/** + * @brief Pack child at given position and size + * + * @param[in] obj The object. + * @param[in] subobj The child to pack. + * @param[in] x The virtual x coord at which to pack it. + * @param[in] y The virtual y coord at which to pack it. + * @param[in] w The virtual width at which to pack it. + * @param[in] h The virtual height at which to pack it. + * + * @ingroup Elm_Grid_Group + */ +EAPI void elm_grid_pack(Elm_Grid *obj, Efl_Canvas_Object *subobj, int x, int y, int w, int h); + +#endif diff --git a/src/lib/elementary/elm_grid_legacy.h b/src/lib/elementary/elm_grid_legacy.h index d67c9216ac..6884fb1c06 100644 --- a/src/lib/elementary/elm_grid_legacy.h +++ b/src/lib/elementary/elm_grid_legacy.h @@ -34,4 +34,4 @@ EAPI void elm_grid_pack_set(Evas_Object *subobj, Evas_Coord x, Evas_Coor */ EAPI void elm_grid_pack_get(Evas_Object *subobj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); -#include "elm_grid.eo.legacy.h" \ No newline at end of file +#include "elm_grid_eo.legacy.h" \ No newline at end of file diff --git a/src/lib/elementary/elm_helper.h b/src/lib/elementary/elm_helper.h index 2cc350e869..488372939a 100644 --- a/src/lib/elementary/elm_helper.h +++ b/src/lib/elementary/elm_helper.h @@ -77,7 +77,7 @@ elm_validator_regexp_free(Elm_Validator_Regexp *validator) EINA_ARG_NONNULL(1); EAPI Elm_Regexp_Status elm_validator_regexp_status_get(Elm_Validator_Regexp *validator) EINA_ARG_NONNULL(1); -#if defined(EFL_BETA_API_SUPPORT) && defined(EFL_EO_API_SUPPORT) +#if defined(EFL_BETA_API_SUPPORT) /** * @brief The regex validator. Used as callback to validate event. * diff --git a/src/lib/elementary/elm_hover.c b/src/lib/elementary/elm_hover.c index c653b3651c..271436f707 100644 --- a/src/lib/elementary/elm_hover.c +++ b/src/lib/elementary/elm_hover.c @@ -298,12 +298,12 @@ _hov_show_do(Evas_Object *obj) } } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_hover_efl_ui_widget_theme_apply(Eo *obj, Elm_Hover_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; if (sd->smt_sub) _elm_hover_smt_sub_re_eval(obj); @@ -582,7 +582,6 @@ EOLIAN static void _elm_hover_efl_canvas_group_group_add(Eo *obj, Elm_Hover_Data *sd) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); ELM_HOVER_PARTS_FOREACH sd->subs[i].swallow = _content_aliases[i].alias; @@ -689,6 +688,29 @@ elm_hover_add(Evas_Object *parent) return elm_legacy_add(MY_CLASS, parent); } +static void +_parent_setup(Eo *obj, Elm_Hover_Data *sd, Evas_Object *parent) +{ + _elm_hover_parent_detach(obj); + + sd->parent = parent; + if (sd->parent) + { + evas_object_event_callback_add + (sd->parent, EVAS_CALLBACK_MOVE, _parent_move_cb, obj); + evas_object_event_callback_add + (sd->parent, EVAS_CALLBACK_RESIZE, _parent_resize_cb, obj); + evas_object_event_callback_add + (sd->parent, EVAS_CALLBACK_SHOW, _parent_show_cb, obj); + evas_object_event_callback_add + (sd->parent, EVAS_CALLBACK_HIDE, _parent_hide_cb, obj); + evas_object_event_callback_add + (sd->parent, EVAS_CALLBACK_DEL, _parent_del_cb, obj); + } + + elm_layout_sizing_eval(obj); +} + EOLIAN static Eo * _elm_hover_efl_object_constructor(Eo *obj, Elm_Hover_Data *pd EINA_UNUSED) { @@ -697,6 +719,7 @@ _elm_hover_efl_object_constructor(Eo *obj, Elm_Hover_Data *pd EINA_UNUSED) evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_POPUP_MENU); legacy_child_focus_handle(obj); + _parent_setup(obj, pd, efl_parent_get(obj)); return obj; } @@ -735,30 +758,9 @@ elm_hover_parent_set(Evas_Object *obj, Evas_Object *parent) { ELM_HOVER_CHECK(obj); - efl_ui_widget_parent_set(obj, parent); -} - -EOLIAN static void -_elm_hover_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Hover_Data *sd, Evas_Object *parent) -{ - _elm_hover_parent_detach(obj); - - sd->parent = parent; - if (sd->parent) - { - evas_object_event_callback_add - (sd->parent, EVAS_CALLBACK_MOVE, _parent_move_cb, obj); - evas_object_event_callback_add - (sd->parent, EVAS_CALLBACK_RESIZE, _parent_resize_cb, obj); - evas_object_event_callback_add - (sd->parent, EVAS_CALLBACK_SHOW, _parent_show_cb, obj); - evas_object_event_callback_add - (sd->parent, EVAS_CALLBACK_HIDE, _parent_hide_cb, obj); - evas_object_event_callback_add - (sd->parent, EVAS_CALLBACK_DEL, _parent_del_cb, obj); - } - - elm_layout_sizing_eval(obj); + ELM_HOVER_DATA_GET(obj, sd); + efl_ui_widget_sub_object_add(parent, obj); + _parent_setup(obj, sd, parent); } EOLIAN static Evas_Object* @@ -774,12 +776,6 @@ elm_hover_parent_get(const Evas_Object *obj) return efl_ui_widget_parent_get((Eo *) obj); } -EOLIAN static Evas_Object* -_elm_hover_efl_ui_widget_widget_parent_get(const Eo *obj EINA_UNUSED, Elm_Hover_Data *sd) -{ - return sd->parent; -} - EOLIAN static const char* _elm_hover_best_content_location_get(const Eo *obj EINA_UNUSED, Elm_Hover_Data *sd, Elm_Hover_Axis pref_axis) { @@ -859,7 +855,7 @@ _elm_hover_efl_access_object_state_set_get(const Eo *obj, Elm_Hover_Data *pd EIN Efl_Access_State_Set states; states = efl_access_object_state_set_get(efl_super(obj, MY_CLASS)); - STATE_TYPE_SET(states, EFL_ACCESS_STATE_MODAL); + STATE_TYPE_SET(states, EFL_ACCESS_STATE_TYPE_MODAL); return states; } @@ -883,4 +879,4 @@ ELM_PART_OVERRIDE_CONTENT_UNSET(elm_hover, ELM_HOVER, Elm_Hover_Data) ELM_LAYOUT_SIZING_EVAL_OPS(elm_hover), \ _ELM_LAYOUT_ALIASES_OPS(elm_hover, content) -#include "elm_hover.eo.c" +#include "elm_hover_eo.c" diff --git a/src/lib/elementary/elm_hover.eo b/src/lib/elementary/elm_hover.eo deleted file mode 100644 index 69acfb9b3f..0000000000 --- a/src/lib/elementary/elm_hover.eo +++ /dev/null @@ -1,80 +0,0 @@ -enum Elm.Hover.Axis -{ - [[The orientation axis for the hover object]] - none, [[ELM_HOVER_AXIS_NONE -- no preferred orientation.]] - horizontal, [[ELM_HOVER_AXIS_HORIZONTAL -- horizontal.]] - vertical, [[ELM_HOVER_AXIS_VERTICAL -- vertical.]] - both [[ELM_HOVER_AXIS_BOTH -- both.]] -} - -class Elm.Hover extends Efl.Ui.Layout implements Efl.Ui.Focus.Layer, Efl.Ui.Clickable, - Efl.Access.Widget.Action, Efl.Ui.Legacy -{ - [[Elementary hover class]] - legacy_prefix: elm_hover; - eo_prefix: elm_obj_hover; - event_prefix: elm_hover; - methods { - @property target { - set { - [[Sets the target object for the hover. - - This function will cause the hover to be centered on the - target object. - ]] - } - get { - [[Get the target object for the hover.]] - } - values { - target: Efl.Canvas.Object; [[The target object.]] - } - } - best_content_location_get @const { - [[Returns the best swallow location for content in the hover. - - Best is defined here as the location at which there is the most - available space. - - $pref_axis may be either #ELM_HOVER_AXIS_NONE (for no preferred - orientation), #ELM_HOVER_AXIS_HORIZONTAL, #ELM_HOVER_AXIS_VERTICAL - or #ELM_HOVER_AXIS_BOTH. - - If #ELM_HOVER_AXIS_HORIZONTAL is chosen the returned position - will necessarily be along the horizontal axis("left" or "right"). - If #ELM_HOVER_AXIS_VERTICAL is chosen the returned position will - necessarily be along the vertical axis("top" or "bottom"). - Choosing #ELM_HOVER_AXIS_BOTH or #ELM_HOVER_AXIS_NONE has the - same effect and the returned position may be in either axis. - - See also \@ref elm_object_part_content_set. - ]] - return: string; [[Swallow location]] - params { - @in pref_axis: Elm.Hover.Axis; [[The preferred orientation axis - for the hover object to use]] - } - } - dismiss { - [[Dismiss a hover object]] - } - } - implements { - class.constructor; - Efl.Object.constructor; - 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.Object.state_set { get; } - Efl.Part.part_get; - } - events { - smart,changed: string; [[Called when hover changed]] - dismissed: void; [[Called when hover was dismissed]] - } -} diff --git a/src/lib/elementary/elm_hover_eo.c b/src/lib/elementary/elm_hover_eo.c new file mode 100644 index 0000000000..5ca798a132 --- /dev/null +++ b/src/lib/elementary/elm_hover_eo.c @@ -0,0 +1,97 @@ +EWAPI const Efl_Event_Description _ELM_HOVER_EVENT_SMART_CHANGED = + EFL_EVENT_DESCRIPTION("smart,changed"); +EWAPI const Efl_Event_Description _ELM_HOVER_EVENT_DISMISSED = + EFL_EVENT_DESCRIPTION("dismissed"); + +void _elm_hover_target_set(Eo *obj, Elm_Hover_Data *pd, Efl_Canvas_Object *target); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_hover_target_set, EFL_FUNC_CALL(target), Efl_Canvas_Object *target); + +Efl_Canvas_Object *_elm_hover_target_get(const Eo *obj, Elm_Hover_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_hover_target_get, Efl_Canvas_Object *, NULL); + +const char *_elm_hover_best_content_location_get(const Eo *obj, Elm_Hover_Data *pd, Elm_Hover_Axis pref_axis); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_hover_best_content_location_get, const char *, NULL, EFL_FUNC_CALL(pref_axis), Elm_Hover_Axis pref_axis); + +void _elm_hover_dismiss(Eo *obj, Elm_Hover_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_hover_dismiss); + +Efl_Object *_elm_hover_efl_object_constructor(Eo *obj, Elm_Hover_Data *pd); + + +void _elm_hover_efl_gfx_entity_visible_set(Eo *obj, Elm_Hover_Data *pd, Eina_Bool v); + + +void _elm_hover_efl_gfx_entity_position_set(Eo *obj, Elm_Hover_Data *pd, Eina_Position2D pos); + + +void _elm_hover_efl_gfx_entity_size_set(Eo *obj, Elm_Hover_Data *pd, Eina_Size2D size); + + +Eina_Error _elm_hover_efl_ui_widget_theme_apply(Eo *obj, Elm_Hover_Data *pd); + + +Eina_Bool _elm_hover_efl_ui_widget_widget_sub_object_add(Eo *obj, Elm_Hover_Data *pd, Efl_Canvas_Object *sub_obj); + + +Eina_Bool _elm_hover_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Hover_Data *pd, Efl_Canvas_Object *sub_obj); + + +const Efl_Access_Action_Data *_elm_hover_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Hover_Data *pd); + + +Efl_Access_State_Set _elm_hover_efl_access_object_state_set_get(const Eo *obj, Elm_Hover_Data *pd); + + +Efl_Object *_elm_hover_efl_part_part_get(const Eo *obj, Elm_Hover_Data *pd, const char *name); + + +static Eina_Bool +_elm_hover_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_HOVER_EXTRA_OPS +#define ELM_HOVER_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_hover_target_set, _elm_hover_target_set), + EFL_OBJECT_OP_FUNC(elm_obj_hover_target_get, _elm_hover_target_get), + EFL_OBJECT_OP_FUNC(elm_obj_hover_best_content_location_get, _elm_hover_best_content_location_get), + EFL_OBJECT_OP_FUNC(elm_obj_hover_dismiss, _elm_hover_dismiss), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_hover_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_hover_efl_gfx_entity_visible_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_hover_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_hover_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_hover_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_add, _elm_hover_efl_ui_widget_widget_sub_object_add), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _elm_hover_efl_ui_widget_widget_sub_object_del), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_hover_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_hover_efl_access_object_state_set_get), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_hover_efl_part_part_get), + ELM_HOVER_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_hover_class_desc = { + EO_VERSION, + "Elm.Hover", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Hover_Data), + _elm_hover_class_initializer, + _elm_hover_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_hover_class_get, &_elm_hover_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_LAYER_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_hover_eo.legacy.c" diff --git a/src/lib/elementary/elm_hover_eo.h b/src/lib/elementary/elm_hover_eo.h new file mode 100644 index 0000000000..8030a27851 --- /dev/null +++ b/src/lib/elementary/elm_hover_eo.h @@ -0,0 +1,112 @@ +#ifndef _ELM_HOVER_EO_H_ +#define _ELM_HOVER_EO_H_ + +#ifndef _ELM_HOVER_EO_CLASS_TYPE +#define _ELM_HOVER_EO_CLASS_TYPE + +typedef Eo Elm_Hover; + +#endif + +#ifndef _ELM_HOVER_EO_TYPES +#define _ELM_HOVER_EO_TYPES + +/** The orientation axis for the hover object + * + * @ingroup Elm_Hover + */ +typedef enum +{ + ELM_HOVER_AXIS_NONE = 0, /**< ELM_HOVER_AXIS_NONE -- no preferred orientation. + */ + ELM_HOVER_AXIS_HORIZONTAL, /**< ELM_HOVER_AXIS_HORIZONTAL -- horizontal. */ + ELM_HOVER_AXIS_VERTICAL, /**< ELM_HOVER_AXIS_VERTICAL -- vertical. */ + ELM_HOVER_AXIS_BOTH /**< ELM_HOVER_AXIS_BOTH -- both. */ +} Elm_Hover_Axis; + + +#endif +/** Elementary hover class + * + * @ingroup Elm_Hover + */ +#define ELM_HOVER_CLASS elm_hover_class_get() + +EWAPI const Efl_Class *elm_hover_class_get(void); + +/** + * @brief Sets the target object for the hover. + * + * This function will cause the hover to be centered on the target object. + * + * @param[in] obj The object. + * @param[in] target The target object. + * + * @ingroup Elm_Hover + */ +EOAPI void elm_obj_hover_target_set(Eo *obj, Efl_Canvas_Object *target); + +/** + * @brief Get the target object for the hover. + * + * @param[in] obj The object. + * + * @return The target object. + * + * @ingroup Elm_Hover + */ +EOAPI Efl_Canvas_Object *elm_obj_hover_target_get(const Eo *obj); + +/** + * @brief Returns the best swallow location for content in the hover. + * + * Best is defined here as the location at which there is the most available + * space. + * + * @c pref_axis may be either #ELM_HOVER_AXIS_NONE (for no preferred + * orientation), #ELM_HOVER_AXIS_HORIZONTAL, #ELM_HOVER_AXIS_VERTICAL or + * #ELM_HOVER_AXIS_BOTH. + * + * If #ELM_HOVER_AXIS_HORIZONTAL is chosen the returned position will + * necessarily be along the horizontal axis("left" or "right"). If + * #ELM_HOVER_AXIS_VERTICAL is chosen the returned position will necessarily be + * along the vertical axis("top" or "bottom"). Choosing #ELM_HOVER_AXIS_BOTH or + * #ELM_HOVER_AXIS_NONE has the same effect and the returned position may be in + * either axis. + * + * See also @ref elm_object_part_content_set. + * + * @param[in] obj The object. + * @param[in] pref_axis The preferred orientation axis for the hover object to + * use + * + * @return Swallow location + * + * @ingroup Elm_Hover + */ +EOAPI const char *elm_obj_hover_best_content_location_get(const Eo *obj, Elm_Hover_Axis pref_axis); + +/** Dismiss a hover object + * + * @ingroup Elm_Hover + */ +EOAPI void elm_obj_hover_dismiss(Eo *obj); + +EWAPI extern const Efl_Event_Description _ELM_HOVER_EVENT_SMART_CHANGED; + +/** Called when hover changed + * @return const char * + * + * @ingroup Elm_Hover + */ +#define ELM_HOVER_EVENT_SMART_CHANGED (&(_ELM_HOVER_EVENT_SMART_CHANGED)) + +EWAPI extern const Efl_Event_Description _ELM_HOVER_EVENT_DISMISSED; + +/** Called when hover was dismissed + * + * @ingroup Elm_Hover + */ +#define ELM_HOVER_EVENT_DISMISSED (&(_ELM_HOVER_EVENT_DISMISSED)) + +#endif diff --git a/src/lib/elementary/elm_hover_eo.legacy.c b/src/lib/elementary/elm_hover_eo.legacy.c new file mode 100644 index 0000000000..78b556250f --- /dev/null +++ b/src/lib/elementary/elm_hover_eo.legacy.c @@ -0,0 +1,24 @@ + +EAPI void +elm_hover_target_set(Elm_Hover *obj, Efl_Canvas_Object *target) +{ + elm_obj_hover_target_set(obj, target); +} + +EAPI Efl_Canvas_Object * +elm_hover_target_get(const Elm_Hover *obj) +{ + return elm_obj_hover_target_get(obj); +} + +EAPI const char * +elm_hover_best_content_location_get(const Elm_Hover *obj, Elm_Hover_Axis pref_axis) +{ + return elm_obj_hover_best_content_location_get(obj, pref_axis); +} + +EAPI void +elm_hover_dismiss(Elm_Hover *obj) +{ + elm_obj_hover_dismiss(obj); +} diff --git a/src/lib/elementary/elm_hover_eo.legacy.h b/src/lib/elementary/elm_hover_eo.legacy.h new file mode 100644 index 0000000000..8f186950ce --- /dev/null +++ b/src/lib/elementary/elm_hover_eo.legacy.h @@ -0,0 +1,88 @@ +#ifndef _ELM_HOVER_EO_LEGACY_H_ +#define _ELM_HOVER_EO_LEGACY_H_ + +#ifndef _ELM_HOVER_EO_CLASS_TYPE +#define _ELM_HOVER_EO_CLASS_TYPE + +typedef Eo Elm_Hover; + +#endif + +#ifndef _ELM_HOVER_EO_TYPES +#define _ELM_HOVER_EO_TYPES + +/** The orientation axis for the hover object + * + * @ingroup Elm_Hover + */ +typedef enum +{ + ELM_HOVER_AXIS_NONE = 0, /**< ELM_HOVER_AXIS_NONE -- no preferred orientation. + */ + ELM_HOVER_AXIS_HORIZONTAL, /**< ELM_HOVER_AXIS_HORIZONTAL -- horizontal. */ + ELM_HOVER_AXIS_VERTICAL, /**< ELM_HOVER_AXIS_VERTICAL -- vertical. */ + ELM_HOVER_AXIS_BOTH /**< ELM_HOVER_AXIS_BOTH -- both. */ +} Elm_Hover_Axis; + + +#endif + +/** + * @brief Sets the target object for the hover. + * + * This function will cause the hover to be centered on the target object. + * + * @param[in] obj The object. + * @param[in] target The target object. + * + * @ingroup Elm_Hover_Group + */ +EAPI void elm_hover_target_set(Elm_Hover *obj, Efl_Canvas_Object *target); + +/** + * @brief Get the target object for the hover. + * + * @param[in] obj The object. + * + * @return The target object. + * + * @ingroup Elm_Hover_Group + */ +EAPI Efl_Canvas_Object *elm_hover_target_get(const Elm_Hover *obj); + +/** + * @brief Returns the best swallow location for content in the hover. + * + * Best is defined here as the location at which there is the most available + * space. + * + * @c pref_axis may be either #ELM_HOVER_AXIS_NONE (for no preferred + * orientation), #ELM_HOVER_AXIS_HORIZONTAL, #ELM_HOVER_AXIS_VERTICAL or + * #ELM_HOVER_AXIS_BOTH. + * + * If #ELM_HOVER_AXIS_HORIZONTAL is chosen the returned position will + * necessarily be along the horizontal axis("left" or "right"). If + * #ELM_HOVER_AXIS_VERTICAL is chosen the returned position will necessarily be + * along the vertical axis("top" or "bottom"). Choosing #ELM_HOVER_AXIS_BOTH or + * #ELM_HOVER_AXIS_NONE has the same effect and the returned position may be in + * either axis. + * + * See also @ref elm_object_part_content_set. + * + * @param[in] obj The object. + * @param[in] pref_axis The preferred orientation axis for the hover object to + * use + * + * @return Swallow location + * + * @ingroup Elm_Hover_Group + */ +EAPI const char *elm_hover_best_content_location_get(const Elm_Hover *obj, Elm_Hover_Axis pref_axis); + +/** Dismiss a hover object + * + * @ingroup Elm_Hover_Group + */ +EAPI void elm_hover_dismiss(Elm_Hover *obj); + +#endif diff --git a/src/lib/elementary/elm_hover_legacy.h b/src/lib/elementary/elm_hover_legacy.h index 407d97e287..d940317dc3 100644 --- a/src/lib/elementary/elm_hover_legacy.h +++ b/src/lib/elementary/elm_hover_legacy.h @@ -33,4 +33,4 @@ EAPI void elm_hover_parent_set(Evas_Object *obj, Evas_Object *parent); */ EAPI Evas_Object *elm_hover_parent_get(const Evas_Object *obj); -#include "elm_hover.eo.legacy.h" \ No newline at end of file +#include "elm_hover_eo.legacy.h" \ No newline at end of file diff --git a/src/lib/elementary/elm_hover_part.eo b/src/lib/elementary/elm_hover_part.eo index 2473dc5e89..71f85a4601 100644 --- a/src/lib/elementary/elm_hover_part.eo +++ b/src/lib/elementary/elm_hover_part.eo @@ -1,4 +1,4 @@ -class Elm.Hover.Part extends Efl.Ui.Layout_Part_Legacy +class @beta Elm.Hover.Part extends Efl.Ui.Layout_Part_Legacy { [[elementary hover internal part class]] data: null; diff --git a/src/lib/elementary/elm_hoversel.eo b/src/lib/elementary/elm_hoversel.eo deleted file mode 100644 index 0290850dbc..0000000000 --- a/src/lib/elementary/elm_hoversel.eo +++ /dev/null @@ -1,113 +0,0 @@ -import elm_general; - -class Elm.Hoversel extends Efl.Ui.Button_Legacy implements Efl.Ui.Selectable, - Efl.Ui.Clickable, - Efl.Access.Widget.Action, - Efl.Ui.Legacy -{ - [[Elementary hoversel class]] - legacy_prefix: elm_hoversel; - eo_prefix: elm_obj_hoversel; - event_prefix: elm_hoversel; - methods { - @property horizontal { - [[Control if the hoversel should expand horizontally. - - Note: The initial button will display horizontally regradless of this setting.]] - set { - } - get { - } - values { - horizontal: bool; [[If $true, the hover will expand horizontally to the right.]] - } - } - @property hover_parent { - [[Control the hover parent. - - Sets the hover parent object, the area that will be darkened when the - hoversel is clicked. Should probably be the window that the hoversel is - in.]] - set { - } - get { - } - values { - parent: Efl.Canvas.Object @nullable; [[The parent to use]] - } - } - @property expanded { - get { - [[Returns whether the hoversel is expanded.]] - return: bool; [[$true if the hoversel is expanded or $false otherwise]] - } - } - @property items { - get { - [[Get the list of items within the given hoversel.]] - return: const(list); [[List of items]] - } - } - @property auto_update { - [[Update icon and text of hoversel same to those of selected item automatically.]] - get{ - } - set{ - } - values { - auto_update: bool; [[$true if hoversel is updated automatically or $false otherwise]] - } - } - hover_begin { - [[This triggers the hoversel popup from code, the same as if the user had clicked the button.]] - } - clear { - [[This will remove all the children items from the hoversel. - - Warning Should *not* be called while the hoversel is active; use - @Elm.Hoversel.expanded.get to check first.]] - } - hover_end { - [[This dismisses the hoversel popup as if the user had clicked outside the hover.]] - } - item_add { - [[Add an item to the hoversel button - - This adds an item to the hoversel to show when it is clicked. Note: if you - need to use an icon from an edje file then use Elm.Hoversel.Item.icon.set - right after this function, and set icon_file to $null here.]] - - /* FIXME: Make the hoversel_item reference in the doc a real ref. */ - /* FIXME-doc - For more information on what $icon_file and $icon_type are, see the - @ref Icon "icon documentation". */ - return: Elm.Widget.Item; [[A handle to the added item.]] - params { - @in label: string @optional; [[The text label to use for the item (NULL if not desired)]] - @in icon_file: string @optional; [[An image file path on disk to use for the icon or standard icon name (NULL if not desired)]] - @in icon_type: Elm.Icon.Type; [[The icon type if relevant]] - @in func: Evas_Smart_Cb @optional; [[Convenience function to call when this item is selected. The last parameter $event_info of $func is the selected item pointer.]] - @in data: const(void_ptr) @optional; [[Data to pass to item-related functions]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Object.destructor; - Efl.Gfx.Entity.visible { set; } - Efl.Ui.Widget.widget_parent { set; } - Efl.Ui.Widget.theme_apply; - Efl.Ui.L10n.translation_update; - Efl.Ui.Widget.widget_event; - Efl.Ui.Autorepeat.autorepeat_supported { get; } - Efl.Access.Widget.Action.elm_actions { get; } - Efl.Access.Object.access_children { get; } - } - events { - 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_eo.c b/src/lib/elementary/elm_hoversel_eo.c new file mode 100644 index 0000000000..a9a04effc4 --- /dev/null +++ b/src/lib/elementary/elm_hoversel_eo.c @@ -0,0 +1,194 @@ +EWAPI const Efl_Event_Description _ELM_HOVERSEL_EVENT_DISMISSED = + EFL_EVENT_DESCRIPTION("dismissed"); +EWAPI const Efl_Event_Description _ELM_HOVERSEL_EVENT_EXPANDED = + EFL_EVENT_DESCRIPTION("expanded"); +EWAPI const Efl_Event_Description _ELM_HOVERSEL_EVENT_ITEM_FOCUSED = + EFL_EVENT_DESCRIPTION("item,focused"); +EWAPI const Efl_Event_Description _ELM_HOVERSEL_EVENT_ITEM_UNFOCUSED = + EFL_EVENT_DESCRIPTION("item,unfocused"); + +void _elm_hoversel_horizontal_set(Eo *obj, Elm_Hoversel_Data *pd, Eina_Bool horizontal); + + +static Eina_Error +__eolian_elm_hoversel_horizontal_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_hoversel_horizontal_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_hoversel_horizontal_set, EFL_FUNC_CALL(horizontal), Eina_Bool horizontal); + +Eina_Bool _elm_hoversel_horizontal_get(const Eo *obj, Elm_Hoversel_Data *pd); + + +static Eina_Value +__eolian_elm_hoversel_horizontal_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_hoversel_horizontal_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_hoversel_horizontal_get, Eina_Bool, 0); + +void _elm_hoversel_hover_parent_set(Eo *obj, Elm_Hoversel_Data *pd, Efl_Canvas_Object *parent); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_hoversel_hover_parent_set, EFL_FUNC_CALL(parent), Efl_Canvas_Object *parent); + +Efl_Canvas_Object *_elm_hoversel_hover_parent_get(const Eo *obj, Elm_Hoversel_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_hoversel_hover_parent_get, Efl_Canvas_Object *, NULL); + +Eina_Bool _elm_hoversel_expanded_get(const Eo *obj, Elm_Hoversel_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_hoversel_expanded_get, Eina_Bool, 0); + +const Eina_List *_elm_hoversel_items_get(const Eo *obj, Elm_Hoversel_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_hoversel_items_get, const Eina_List *, NULL); + +void _elm_hoversel_auto_update_set(Eo *obj, Elm_Hoversel_Data *pd, Eina_Bool auto_update); + + +static Eina_Error +__eolian_elm_hoversel_auto_update_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_hoversel_auto_update_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_hoversel_auto_update_set, EFL_FUNC_CALL(auto_update), Eina_Bool auto_update); + +Eina_Bool _elm_hoversel_auto_update_get(const Eo *obj, Elm_Hoversel_Data *pd); + + +static Eina_Value +__eolian_elm_hoversel_auto_update_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_hoversel_auto_update_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_hoversel_auto_update_get, Eina_Bool, 0); + +void _elm_hoversel_hover_begin(Eo *obj, Elm_Hoversel_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_hoversel_hover_begin); + +void _elm_hoversel_clear(Eo *obj, Elm_Hoversel_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_hoversel_clear); + +void _elm_hoversel_hover_end(Eo *obj, Elm_Hoversel_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_hoversel_hover_end); + +Elm_Widget_Item *_elm_hoversel_item_add(Eo *obj, Elm_Hoversel_Data *pd, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_hoversel_item_add, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(label, icon_file, icon_type, func, data), const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data); + +Efl_Object *_elm_hoversel_efl_object_constructor(Eo *obj, Elm_Hoversel_Data *pd); + + +void _elm_hoversel_efl_object_destructor(Eo *obj, Elm_Hoversel_Data *pd); + + +void _elm_hoversel_efl_gfx_entity_visible_set(Eo *obj, Elm_Hoversel_Data *pd, Eina_Bool v); + + +Eina_Error _elm_hoversel_efl_ui_widget_theme_apply(Eo *obj, Elm_Hoversel_Data *pd); + + +void _elm_hoversel_efl_ui_l10n_translation_update(Eo *obj, Elm_Hoversel_Data *pd); + + +Eina_Bool _elm_hoversel_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Hoversel_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +Eina_Bool _elm_hoversel_efl_ui_autorepeat_autorepeat_supported_get(const Eo *obj, Elm_Hoversel_Data *pd); + + +const Efl_Access_Action_Data *_elm_hoversel_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Hoversel_Data *pd); + + +Eina_List *_elm_hoversel_efl_access_object_access_children_get(const Eo *obj, Elm_Hoversel_Data *pd); + + +static Eina_Bool +_elm_hoversel_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_HOVERSEL_EXTRA_OPS +#define ELM_HOVERSEL_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_hoversel_horizontal_set, _elm_hoversel_horizontal_set), + EFL_OBJECT_OP_FUNC(elm_obj_hoversel_horizontal_get, _elm_hoversel_horizontal_get), + EFL_OBJECT_OP_FUNC(elm_obj_hoversel_hover_parent_set, _elm_hoversel_hover_parent_set), + EFL_OBJECT_OP_FUNC(elm_obj_hoversel_hover_parent_get, _elm_hoversel_hover_parent_get), + EFL_OBJECT_OP_FUNC(elm_obj_hoversel_expanded_get, _elm_hoversel_expanded_get), + EFL_OBJECT_OP_FUNC(elm_obj_hoversel_items_get, _elm_hoversel_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_hoversel_auto_update_set, _elm_hoversel_auto_update_set), + EFL_OBJECT_OP_FUNC(elm_obj_hoversel_auto_update_get, _elm_hoversel_auto_update_get), + EFL_OBJECT_OP_FUNC(elm_obj_hoversel_hover_begin, _elm_hoversel_hover_begin), + EFL_OBJECT_OP_FUNC(elm_obj_hoversel_clear, _elm_hoversel_clear), + EFL_OBJECT_OP_FUNC(elm_obj_hoversel_hover_end, _elm_hoversel_hover_end), + EFL_OBJECT_OP_FUNC(elm_obj_hoversel_item_add, _elm_hoversel_item_add), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_hoversel_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_hoversel_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_hoversel_efl_gfx_entity_visible_set), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_hoversel_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_hoversel_efl_ui_l10n_translation_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_hoversel_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(efl_ui_autorepeat_supported_get, _elm_hoversel_efl_ui_autorepeat_autorepeat_supported_get), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_hoversel_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_access_object_access_children_get, _elm_hoversel_efl_access_object_access_children_get), + ELM_HOVERSEL_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"horizontal", __eolian_elm_hoversel_horizontal_set_reflect, __eolian_elm_hoversel_horizontal_get_reflect}, + {"auto_update", __eolian_elm_hoversel_auto_update_set_reflect, __eolian_elm_hoversel_auto_update_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_hoversel_class_desc = { + EO_VERSION, + "Elm.Hoversel", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Hoversel_Data), + _elm_hoversel_class_initializer, + _elm_hoversel_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_hoversel_class_get, &_elm_hoversel_class_desc, EFL_UI_BUTTON_LEGACY_CLASS, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_CLICKABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_hoversel_eo.legacy.c" diff --git a/src/lib/elementary/elm_hoversel_eo.h b/src/lib/elementary/elm_hoversel_eo.h new file mode 100644 index 0000000000..cdbf7fcc42 --- /dev/null +++ b/src/lib/elementary/elm_hoversel_eo.h @@ -0,0 +1,206 @@ +#ifndef _ELM_HOVERSEL_EO_H_ +#define _ELM_HOVERSEL_EO_H_ + +#ifndef _ELM_HOVERSEL_EO_CLASS_TYPE +#define _ELM_HOVERSEL_EO_CLASS_TYPE + +typedef Eo Elm_Hoversel; + +#endif + +#ifndef _ELM_HOVERSEL_EO_TYPES +#define _ELM_HOVERSEL_EO_TYPES + + +#endif +/** Elementary hoversel class + * + * @ingroup Elm_Hoversel + */ +#define ELM_HOVERSEL_CLASS elm_hoversel_class_get() + +EWAPI const Efl_Class *elm_hoversel_class_get(void); + +/** + * @brief Control if the hoversel should expand horizontally. + * + * @note The initial button will display horizontally regradless of this + * setting. + * + * @param[in] obj The object. + * @param[in] horizontal If @c true, the hover will expand horizontally to the + * right. + * + * @ingroup Elm_Hoversel + */ +EOAPI void elm_obj_hoversel_horizontal_set(Eo *obj, Eina_Bool horizontal); + +/** + * @brief Control if the hoversel should expand horizontally. + * + * @note The initial button will display horizontally regradless of this + * setting. + * + * @param[in] obj The object. + * + * @return If @c true, the hover will expand horizontally to the right. + * + * @ingroup Elm_Hoversel + */ +EOAPI Eina_Bool elm_obj_hoversel_horizontal_get(const Eo *obj); + +/** + * @brief Control the hover parent. + * + * Sets the hover parent object, the area that will be darkened when the + * hoversel is clicked. Should probably be the window that the hoversel is in. + * + * @param[in] obj The object. + * @param[in] parent The parent to use + * + * @ingroup Elm_Hoversel + */ +EOAPI void elm_obj_hoversel_hover_parent_set(Eo *obj, Efl_Canvas_Object *parent); + +/** + * @brief Control the hover parent. + * + * Sets the hover parent object, the area that will be darkened when the + * hoversel is clicked. Should probably be the window that the hoversel is in. + * + * @param[in] obj The object. + * + * @return The parent to use + * + * @ingroup Elm_Hoversel + */ +EOAPI Efl_Canvas_Object *elm_obj_hoversel_hover_parent_get(const Eo *obj); + +/** + * @brief Returns whether the hoversel is expanded. + * + * @param[in] obj The object. + * + * @return @c true if the hoversel is expanded or @c false otherwise + * + * @ingroup Elm_Hoversel + */ +EOAPI Eina_Bool elm_obj_hoversel_expanded_get(const Eo *obj); + +/** + * @brief Get the list of items within the given hoversel. + * + * @param[in] obj The object. + * + * @return List of items + * + * @ingroup Elm_Hoversel + */ +EOAPI const Eina_List *elm_obj_hoversel_items_get(const Eo *obj); + +/** + * @brief Update icon and text of hoversel same to those of selected item + * automatically. + * + * @param[in] obj The object. + * @param[in] auto_update @c true if hoversel is updated automatically or + * @c false otherwise + * + * @ingroup Elm_Hoversel + */ +EOAPI void elm_obj_hoversel_auto_update_set(Eo *obj, Eina_Bool auto_update); + +/** + * @brief Update icon and text of hoversel same to those of selected item + * automatically. + * + * @param[in] obj The object. + * + * @return @c true if hoversel is updated automatically or @c false otherwise + * + * @ingroup Elm_Hoversel + */ +EOAPI Eina_Bool elm_obj_hoversel_auto_update_get(const Eo *obj); + +/** This triggers the hoversel popup from code, the same as if the user had + * clicked the button. + * + * @ingroup Elm_Hoversel + */ +EOAPI void elm_obj_hoversel_hover_begin(Eo *obj); + +/** + * @brief This will remove all the children items from the hoversel. + * + * Warning Should *not* be called while the hoversel is active; use + * @ref elm_obj_hoversel_expanded_get to check first. + * @param[in] obj The object. + * + * @ingroup Elm_Hoversel + */ +EOAPI void elm_obj_hoversel_clear(Eo *obj); + +/** This dismisses the hoversel popup as if the user had clicked outside the + * hover. + * + * @ingroup Elm_Hoversel + */ +EOAPI void elm_obj_hoversel_hover_end(Eo *obj); + +/** + * @brief Add an item to the hoversel button + * + * This adds an item to the hoversel to show when it is clicked. Note: if you + * need to use an icon from an edje file then use Elm.Hoversel.Item.icon.set + * right after this function, and set icon_file to @c null here. + * + * @param[in] obj The object. + * @param[in] label The text label to use for the item (NULL if not desired) + * @param[in] icon_file An image file path on disk to use for the icon or + * standard icon name (NULL if not desired) + * @param[in] icon_type The icon type if relevant + * @param[in] func Convenience function to call when this item is selected. The + * last parameter @c event_info of @c func is the selected item pointer. + * @param[in] data Data to pass to item-related functions + * + * @return A handle to the added item. + * + * @ingroup Elm_Hoversel + */ +EOAPI Elm_Widget_Item *elm_obj_hoversel_item_add(Eo *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data); + +EWAPI extern const Efl_Event_Description _ELM_HOVERSEL_EVENT_DISMISSED; + +/** Called when hoversel is dismissed + * + * @ingroup Elm_Hoversel + */ +#define ELM_HOVERSEL_EVENT_DISMISSED (&(_ELM_HOVERSEL_EVENT_DISMISSED)) + +EWAPI extern const Efl_Event_Description _ELM_HOVERSEL_EVENT_EXPANDED; + +/** Called when hoversel is expanded + * + * @ingroup Elm_Hoversel + */ +#define ELM_HOVERSEL_EVENT_EXPANDED (&(_ELM_HOVERSEL_EVENT_EXPANDED)) + +EWAPI extern const Efl_Event_Description _ELM_HOVERSEL_EVENT_ITEM_FOCUSED; + +/** Called when hoversel item got focus + * @return Efl_Object * + * + * @ingroup Elm_Hoversel + */ +#define ELM_HOVERSEL_EVENT_ITEM_FOCUSED (&(_ELM_HOVERSEL_EVENT_ITEM_FOCUSED)) + +EWAPI extern const Efl_Event_Description _ELM_HOVERSEL_EVENT_ITEM_UNFOCUSED; + +/** Called when hoversel item lost focus + * @return Efl_Object * + * + * @ingroup Elm_Hoversel + */ +#define ELM_HOVERSEL_EVENT_ITEM_UNFOCUSED (&(_ELM_HOVERSEL_EVENT_ITEM_UNFOCUSED)) + +#endif diff --git a/src/lib/elementary/elm_hoversel_eo.legacy.c b/src/lib/elementary/elm_hoversel_eo.legacy.c new file mode 100644 index 0000000000..2697d7aee6 --- /dev/null +++ b/src/lib/elementary/elm_hoversel_eo.legacy.c @@ -0,0 +1,72 @@ + +EAPI void +elm_hoversel_horizontal_set(Elm_Hoversel *obj, Eina_Bool horizontal) +{ + elm_obj_hoversel_horizontal_set(obj, horizontal); +} + +EAPI Eina_Bool +elm_hoversel_horizontal_get(const Elm_Hoversel *obj) +{ + return elm_obj_hoversel_horizontal_get(obj); +} + +EAPI void +elm_hoversel_hover_parent_set(Elm_Hoversel *obj, Efl_Canvas_Object *parent) +{ + elm_obj_hoversel_hover_parent_set(obj, parent); +} + +EAPI Efl_Canvas_Object * +elm_hoversel_hover_parent_get(const Elm_Hoversel *obj) +{ + return elm_obj_hoversel_hover_parent_get(obj); +} + +EAPI Eina_Bool +elm_hoversel_expanded_get(const Elm_Hoversel *obj) +{ + return elm_obj_hoversel_expanded_get(obj); +} + +EAPI const Eina_List * +elm_hoversel_items_get(const Elm_Hoversel *obj) +{ + return elm_obj_hoversel_items_get(obj); +} + +EAPI void +elm_hoversel_auto_update_set(Elm_Hoversel *obj, Eina_Bool auto_update) +{ + elm_obj_hoversel_auto_update_set(obj, auto_update); +} + +EAPI Eina_Bool +elm_hoversel_auto_update_get(const Elm_Hoversel *obj) +{ + return elm_obj_hoversel_auto_update_get(obj); +} + +EAPI void +elm_hoversel_hover_begin(Elm_Hoversel *obj) +{ + elm_obj_hoversel_hover_begin(obj); +} + +EAPI void +elm_hoversel_clear(Elm_Hoversel *obj) +{ + elm_obj_hoversel_clear(obj); +} + +EAPI void +elm_hoversel_hover_end(Elm_Hoversel *obj) +{ + elm_obj_hoversel_hover_end(obj); +} + +EAPI Elm_Widget_Item * +elm_hoversel_item_add(Elm_Hoversel *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_hoversel_item_add(obj, label, icon_file, icon_type, func, data); +} diff --git a/src/lib/elementary/elm_hoversel_eo.legacy.h b/src/lib/elementary/elm_hoversel_eo.legacy.h new file mode 100644 index 0000000000..3196b9dc4d --- /dev/null +++ b/src/lib/elementary/elm_hoversel_eo.legacy.h @@ -0,0 +1,165 @@ +#ifndef _ELM_HOVERSEL_EO_LEGACY_H_ +#define _ELM_HOVERSEL_EO_LEGACY_H_ + +#ifndef _ELM_HOVERSEL_EO_CLASS_TYPE +#define _ELM_HOVERSEL_EO_CLASS_TYPE + +typedef Eo Elm_Hoversel; + +#endif + +#ifndef _ELM_HOVERSEL_EO_TYPES +#define _ELM_HOVERSEL_EO_TYPES + + +#endif + +/** + * @brief Control if the hoversel should expand horizontally. + * + * @note The initial button will display horizontally regradless of this + * setting. + * + * @param[in] obj The object. + * @param[in] horizontal If @c true, the hover will expand horizontally to the + * right. + * + * @ingroup Elm_Hoversel_Group + */ +EAPI void elm_hoversel_horizontal_set(Elm_Hoversel *obj, Eina_Bool horizontal); + +/** + * @brief Control if the hoversel should expand horizontally. + * + * @note The initial button will display horizontally regradless of this + * setting. + * + * @param[in] obj The object. + * + * @return If @c true, the hover will expand horizontally to the right. + * + * @ingroup Elm_Hoversel_Group + */ +EAPI Eina_Bool elm_hoversel_horizontal_get(const Elm_Hoversel *obj); + +/** + * @brief Control the hover parent. + * + * Sets the hover parent object, the area that will be darkened when the + * hoversel is clicked. Should probably be the window that the hoversel is in. + * + * @param[in] obj The object. + * @param[in] parent The parent to use + * + * @ingroup Elm_Hoversel_Group + */ +EAPI void elm_hoversel_hover_parent_set(Elm_Hoversel *obj, Efl_Canvas_Object *parent); + +/** + * @brief Control the hover parent. + * + * Sets the hover parent object, the area that will be darkened when the + * hoversel is clicked. Should probably be the window that the hoversel is in. + * + * @param[in] obj The object. + * + * @return The parent to use + * + * @ingroup Elm_Hoversel_Group + */ +EAPI Efl_Canvas_Object *elm_hoversel_hover_parent_get(const Elm_Hoversel *obj); + +/** + * @brief Returns whether the hoversel is expanded. + * + * @param[in] obj The object. + * + * @return @c true if the hoversel is expanded or @c false otherwise + * + * @ingroup Elm_Hoversel_Group + */ +EAPI Eina_Bool elm_hoversel_expanded_get(const Elm_Hoversel *obj); + +/** + * @brief Get the list of items within the given hoversel. + * + * @param[in] obj The object. + * + * @return List of items + * + * @ingroup Elm_Hoversel_Group + */ +EAPI const Eina_List *elm_hoversel_items_get(const Elm_Hoversel *obj); + +/** + * @brief Update icon and text of hoversel same to those of selected item + * automatically. + * + * @param[in] obj The object. + * @param[in] auto_update @c true if hoversel is updated automatically or + * @c false otherwise + * + * @ingroup Elm_Hoversel_Group + */ +EAPI void elm_hoversel_auto_update_set(Elm_Hoversel *obj, Eina_Bool auto_update); + +/** + * @brief Update icon and text of hoversel same to those of selected item + * automatically. + * + * @param[in] obj The object. + * + * @return @c true if hoversel is updated automatically or @c false otherwise + * + * @ingroup Elm_Hoversel_Group + */ +EAPI Eina_Bool elm_hoversel_auto_update_get(const Elm_Hoversel *obj); + +/** This triggers the hoversel popup from code, the same as if the user had + * clicked the button. + * + * @ingroup Elm_Hoversel_Group + */ +EAPI void elm_hoversel_hover_begin(Elm_Hoversel *obj); + +/** + * @brief This will remove all the children items from the hoversel. + * + * Warning Should *not* be called while the hoversel is active; use + * @ref elm_hoversel_expanded_get to check first. + * @param[in] obj The object. + * + * @ingroup Elm_Hoversel_Group + */ +EAPI void elm_hoversel_clear(Elm_Hoversel *obj); + +/** This dismisses the hoversel popup as if the user had clicked outside the + * hover. + * + * @ingroup Elm_Hoversel_Group + */ +EAPI void elm_hoversel_hover_end(Elm_Hoversel *obj); + +/** + * @brief Add an item to the hoversel button + * + * This adds an item to the hoversel to show when it is clicked. Note: if you + * need to use an icon from an edje file then use Elm.Hoversel.Item.icon.set + * right after this function, and set icon_file to @c null here. + * + * @param[in] obj The object. + * @param[in] label The text label to use for the item (NULL if not desired) + * @param[in] icon_file An image file path on disk to use for the icon or + * standard icon name (NULL if not desired) + * @param[in] icon_type The icon type if relevant + * @param[in] func Convenience function to call when this item is selected. The + * last parameter @c event_info of @c func is the selected item pointer. + * @param[in] data Data to pass to item-related functions + * + * @return A handle to the added item. + * + * @ingroup Elm_Hoversel_Group + */ +EAPI Elm_Widget_Item *elm_hoversel_item_add(Elm_Hoversel *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data); + +#endif diff --git a/src/lib/elementary/elm_hoversel_item.eo b/src/lib/elementary/elm_hoversel_item.eo deleted file mode 100644 index dcbfbc03fa..0000000000 --- a/src/lib/elementary/elm_hoversel_item.eo +++ /dev/null @@ -1,33 +0,0 @@ -import elm_general; - -class Elm.Hoversel.Item extends Elm.Widget.Item implements Efl.Ui.Legacy -{ - [[Elementary hoversel item class]] - legacy_prefix: elm_hoversel_item; - eo_prefix: elm_obj_hoversel_item; - methods { - @property icon { - [[This controls the icon for the given hoversel item. - - The icon can be loaded from the standard set, from an image file, or from an edje file.]] - get { - } - set { - } - values { - icon_file: string @nullable; [[An image file path on disk to use for the icon or standard icon name]] - icon_group: string @nullable; [[The edje group to use if $icon_file is an edje file. Set this to NULL if the icon is not an edje file]] - icon_type: Elm.Icon.Type; [[The icon type]] - } - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Elm.Widget.Item.disable; - Elm.Widget.Item.signal_emit; - Elm.Widget.Item.part_text { get; set; } - Elm.Widget.Item.style { get; set; } - Elm.Widget.Item.item_focus { get; set; } - } -} diff --git a/src/lib/elementary/elm_hoversel_item_eo.c b/src/lib/elementary/elm_hoversel_item_eo.c new file mode 100644 index 0000000000..7a04565fd2 --- /dev/null +++ b/src/lib/elementary/elm_hoversel_item_eo.c @@ -0,0 +1,83 @@ + +void _elm_hoversel_item_icon_set(Eo *obj, Elm_Hoversel_Item_Data *pd, const char *icon_file, const char *icon_group, Elm_Icon_Type icon_type); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_hoversel_item_icon_set, EFL_FUNC_CALL(icon_file, icon_group, icon_type), const char *icon_file, const char *icon_group, Elm_Icon_Type icon_type); + +void _elm_hoversel_item_icon_get(const Eo *obj, Elm_Hoversel_Item_Data *pd, const char **icon_file, const char **icon_group, Elm_Icon_Type *icon_type); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_hoversel_item_icon_get, EFL_FUNC_CALL(icon_file, icon_group, icon_type), const char **icon_file, const char **icon_group, Elm_Icon_Type *icon_type); + +Efl_Object *_elm_hoversel_item_efl_object_constructor(Eo *obj, Elm_Hoversel_Item_Data *pd); + + +void _elm_hoversel_item_efl_object_destructor(Eo *obj, Elm_Hoversel_Item_Data *pd); + + +void _elm_hoversel_item_elm_widget_item_disable(Eo *obj, Elm_Hoversel_Item_Data *pd); + + +void _elm_hoversel_item_elm_widget_item_signal_emit(Eo *obj, Elm_Hoversel_Item_Data *pd, const char *emission, const char *source); + + +void _elm_hoversel_item_elm_widget_item_part_text_set(Eo *obj, Elm_Hoversel_Item_Data *pd, const char *part, const char *label); + + +const char *_elm_hoversel_item_elm_widget_item_part_text_get(const Eo *obj, Elm_Hoversel_Item_Data *pd, const char *part); + + +void _elm_hoversel_item_elm_widget_item_style_set(Eo *obj, Elm_Hoversel_Item_Data *pd, const char *style); + + +const char *_elm_hoversel_item_elm_widget_item_style_get(const Eo *obj, Elm_Hoversel_Item_Data *pd); + + +void _elm_hoversel_item_elm_widget_item_item_focus_set(Eo *obj, Elm_Hoversel_Item_Data *pd, Eina_Bool focused); + + +Eina_Bool _elm_hoversel_item_elm_widget_item_item_focus_get(const Eo *obj, Elm_Hoversel_Item_Data *pd); + + +static Eina_Bool +_elm_hoversel_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_HOVERSEL_ITEM_EXTRA_OPS +#define ELM_HOVERSEL_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_hoversel_item_icon_set, _elm_hoversel_item_icon_set), + EFL_OBJECT_OP_FUNC(elm_obj_hoversel_item_icon_get, _elm_hoversel_item_icon_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_hoversel_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_hoversel_item_efl_object_destructor), + EFL_OBJECT_OP_FUNC(elm_wdg_item_disable, _elm_hoversel_item_elm_widget_item_disable), + EFL_OBJECT_OP_FUNC(elm_wdg_item_signal_emit, _elm_hoversel_item_elm_widget_item_signal_emit), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_set, _elm_hoversel_item_elm_widget_item_part_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_get, _elm_hoversel_item_elm_widget_item_part_text_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_style_set, _elm_hoversel_item_elm_widget_item_style_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_style_get, _elm_hoversel_item_elm_widget_item_style_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_set, _elm_hoversel_item_elm_widget_item_item_focus_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_get, _elm_hoversel_item_elm_widget_item_item_focus_get), + ELM_HOVERSEL_ITEM_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_hoversel_item_class_desc = { + EO_VERSION, + "Elm.Hoversel.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Hoversel_Item_Data), + _elm_hoversel_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_hoversel_item_class_get, &_elm_hoversel_item_class_desc, ELM_WIDGET_ITEM_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_hoversel_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_hoversel_item_eo.h b/src/lib/elementary/elm_hoversel_item_eo.h new file mode 100644 index 0000000000..13953aef0c --- /dev/null +++ b/src/lib/elementary/elm_hoversel_item_eo.h @@ -0,0 +1,58 @@ +#ifndef _ELM_HOVERSEL_ITEM_EO_H_ +#define _ELM_HOVERSEL_ITEM_EO_H_ + +#ifndef _ELM_HOVERSEL_ITEM_EO_CLASS_TYPE +#define _ELM_HOVERSEL_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Hoversel_Item; + +#endif + +#ifndef _ELM_HOVERSEL_ITEM_EO_TYPES +#define _ELM_HOVERSEL_ITEM_EO_TYPES + + +#endif +/** Elementary hoversel item class + * + * @ingroup Elm_Hoversel_Item + */ +#define ELM_HOVERSEL_ITEM_CLASS elm_hoversel_item_class_get() + +EWAPI const Efl_Class *elm_hoversel_item_class_get(void); + +/** + * @brief This controls the icon for the given hoversel item. + * + * The icon can be loaded from the standard set, from an image file, or from an + * edje file. + * + * @param[in] obj The object. + * @param[in] icon_file An image file path on disk to use for the icon or + * standard icon name + * @param[in] icon_group The edje group to use if @c icon_file is an edje file. + * Set this to NULL if the icon is not an edje file + * @param[in] icon_type The icon type + * + * @ingroup Elm_Hoversel_Item + */ +EOAPI void elm_obj_hoversel_item_icon_set(Eo *obj, const char *icon_file, const char *icon_group, Elm_Icon_Type icon_type); + +/** + * @brief This controls the icon for the given hoversel item. + * + * The icon can be loaded from the standard set, from an image file, or from an + * edje file. + * + * @param[in] obj The object. + * @param[out] icon_file An image file path on disk to use for the icon or + * standard icon name + * @param[out] icon_group The edje group to use if @c icon_file is an edje + * file. Set this to NULL if the icon is not an edje file + * @param[out] icon_type The icon type + * + * @ingroup Elm_Hoversel_Item + */ +EOAPI void elm_obj_hoversel_item_icon_get(const Eo *obj, const char **icon_file, const char **icon_group, Elm_Icon_Type *icon_type); + +#endif diff --git a/src/lib/elementary/elm_hoversel_item_eo.legacy.c b/src/lib/elementary/elm_hoversel_item_eo.legacy.c new file mode 100644 index 0000000000..2883608a76 --- /dev/null +++ b/src/lib/elementary/elm_hoversel_item_eo.legacy.c @@ -0,0 +1,12 @@ + +EAPI void +elm_hoversel_item_icon_set(Elm_Hoversel_Item *obj, const char *icon_file, const char *icon_group, Elm_Icon_Type icon_type) +{ + elm_obj_hoversel_item_icon_set(obj, icon_file, icon_group, icon_type); +} + +EAPI void +elm_hoversel_item_icon_get(const Elm_Hoversel_Item *obj, const char **icon_file, const char **icon_group, Elm_Icon_Type *icon_type) +{ + elm_obj_hoversel_item_icon_get(obj, icon_file, icon_group, icon_type); +} diff --git a/src/lib/elementary/elm_hoversel_item_eo.legacy.h b/src/lib/elementary/elm_hoversel_item_eo.legacy.h new file mode 100644 index 0000000000..3e34757eb0 --- /dev/null +++ b/src/lib/elementary/elm_hoversel_item_eo.legacy.h @@ -0,0 +1,51 @@ +#ifndef _ELM_HOVERSEL_ITEM_EO_LEGACY_H_ +#define _ELM_HOVERSEL_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_HOVERSEL_ITEM_EO_CLASS_TYPE +#define _ELM_HOVERSEL_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Hoversel_Item; + +#endif + +#ifndef _ELM_HOVERSEL_ITEM_EO_TYPES +#define _ELM_HOVERSEL_ITEM_EO_TYPES + + +#endif + +/** + * @brief This controls the icon for the given hoversel item. + * + * The icon can be loaded from the standard set, from an image file, or from an + * edje file. + * + * @param[in] obj The object. + * @param[in] icon_file An image file path on disk to use for the icon or + * standard icon name + * @param[in] icon_group The edje group to use if @c icon_file is an edje file. + * Set this to NULL if the icon is not an edje file + * @param[in] icon_type The icon type + * + * @ingroup Elm_Hoversel_Item_Group + */ +EAPI void elm_hoversel_item_icon_set(Elm_Hoversel_Item *obj, const char *icon_file, const char *icon_group, Elm_Icon_Type icon_type); + +/** + * @brief This controls the icon for the given hoversel item. + * + * The icon can be loaded from the standard set, from an image file, or from an + * edje file. + * + * @param[in] obj The object. + * @param[out] icon_file An image file path on disk to use for the icon or + * standard icon name + * @param[out] icon_group The edje group to use if @c icon_file is an edje + * file. Set this to NULL if the icon is not an edje file + * @param[out] icon_type The icon type + * + * @ingroup Elm_Hoversel_Item_Group + */ +EAPI void elm_hoversel_item_icon_get(const Elm_Hoversel_Item *obj, const char **icon_file, const char **icon_group, Elm_Icon_Type *icon_type); + +#endif diff --git a/src/lib/elementary/elm_icon.c b/src/lib/elementary/elm_icon.c index 2d612afafa..3011a4d252 100644 --- a/src/lib/elementary/elm_icon.c +++ b/src/lib/elementary/elm_icon.c @@ -9,7 +9,7 @@ #include "elm_priv.h" #include "elm_widget_icon.h" #include "efl_ui_widget_image.h" -#include "elm_icon.eo.h" +#include "elm_icon_eo.h" #define NON_EXISTING (void *)-1 @@ -312,22 +312,25 @@ _edje_signals_free(Elm_Icon_Data *sd) } } -EOLIAN static Eina_Bool -_elm_icon_efl_file_file_set(Eo *obj, Elm_Icon_Data *sd, const char *file, const char *key) +EOLIAN static Eina_Error +_elm_icon_efl_file_load(Eo *obj, Elm_Icon_Data *sd) { Evas_Object *pclip; + const char *key; + Eina_Error err; + if (efl_file_loaded_get(obj)) return 0; + err = efl_file_load(efl_super(obj, MY_CLASS)); + if (err) return err; + Efl_Ui_Image_Data *id = efl_data_scope_get(obj, EFL_UI_IMAGE_CLASS); - EINA_SAFETY_ON_NULL_RETURN_VAL(file, EINA_FALSE); - _edje_signals_free(sd); if (!sd->freedesktop.use) ELM_SAFE_FREE(sd->stdicon, eina_stringshare_del); - if (!sd->is_video) - return efl_file_set(efl_super(obj, MY_CLASS), file, key); + if (!sd->is_video) return 0; /* parent's edje file setting path replicated here (we got .eet * extension, so bypassing it) */ @@ -346,30 +349,33 @@ _elm_icon_efl_file_file_set(Eo *obj, Elm_Icon_Data *sd, const char *file, const evas_object_clip_set(id->img, pclip); id->edje = EINA_TRUE; } - - if (!edje_object_file_set(id->img, file, key)) + key = efl_file_key_get(obj); + efl_file_key_set(id->img, key); + err = efl_file_mmap_set(id->img, efl_file_mmap_get(obj)); + if (!err) err = efl_file_load(id->img); + if (err) { - ERR("failed to set edje file '%s', group '%s': %s", file, key, + ERR("failed to set edje file '%s', group '%s': %s", efl_file_get(id->img), key, edje_load_error_str (edje_object_load_error_get(id->img))); - return EINA_FALSE; + return err; } evas_object_geometry_set(id->img, id->img_x, id->img_y, id->img_w, id->img_h); - return EINA_TRUE; + return 0; } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_icon_efl_ui_widget_theme_apply(Eo *obj, Elm_Icon_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; if (sd->stdicon) _elm_theme_object_icon_set(obj, sd->stdicon, elm_widget_style_get(obj)); int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; return int_ret; } @@ -487,7 +493,6 @@ EOLIAN static void _elm_icon_efl_canvas_group_group_add(Eo *obj, Elm_Icon_Data *priv) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->thumb.request = NULL; } @@ -652,7 +657,7 @@ elm_icon_file_set(Evas_Object *obj, ELM_ICON_CHECK(obj) EINA_FALSE; EINA_SAFETY_ON_NULL_RETURN_VAL(file, EINA_FALSE); - return efl_file_set(obj, file, group); + return efl_file_simple_load(obj, file, group); } EAPI void @@ -917,4 +922,4 @@ elm_icon_order_lookup_get(const Evas_Object *obj EINA_UNUSED) #define ELM_ICON_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_icon) -#include "elm_icon.eo.c" +#include "elm_icon_eo.c" diff --git a/src/lib/elementary/elm_icon.eo b/src/lib/elementary/elm_icon.eo deleted file mode 100644 index 35ce8a9e59..0000000000 --- a/src/lib/elementary/elm_icon.eo +++ /dev/null @@ -1,19 +0,0 @@ -class Elm.Icon extends Efl.Ui.Image implements Efl.Ui.Legacy -{ - [[Elementary Icon Class]] - legacy_prefix: elm_icon; - eo_prefix: elm_obj_icon; - event_prefix: elm_icon; - methods { - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.theme_apply; - Efl.File.file { set; } - } - events { - 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_icon_eo.c b/src/lib/elementary/elm_icon_eo.c new file mode 100644 index 0000000000..ce76bed57a --- /dev/null +++ b/src/lib/elementary/elm_icon_eo.c @@ -0,0 +1,47 @@ +EWAPI const Efl_Event_Description _ELM_ICON_EVENT_THUMB_DONE = + EFL_EVENT_DESCRIPTION("thumb,done"); +EWAPI const Efl_Event_Description _ELM_ICON_EVENT_THUMB_ERROR = + EFL_EVENT_DESCRIPTION("thumb,error"); + +Efl_Object *_elm_icon_efl_object_constructor(Eo *obj, Elm_Icon_Data *pd); + + +Eina_Error _elm_icon_efl_ui_widget_theme_apply(Eo *obj, Elm_Icon_Data *pd); + + +Eina_Error _elm_icon_efl_file_load(Eo *obj, Elm_Icon_Data *pd); + + +static Eina_Bool +_elm_icon_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_ICON_EXTRA_OPS +#define ELM_ICON_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_icon_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_icon_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_file_load, _elm_icon_efl_file_load), + ELM_ICON_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_icon_class_desc = { + EO_VERSION, + "Elm.Icon", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Icon_Data), + _elm_icon_class_initializer, + _elm_icon_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_icon_class_get, &_elm_icon_class_desc, EFL_UI_IMAGE_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_icon_eo.h b/src/lib/elementary/elm_icon_eo.h new file mode 100644 index 0000000000..b53fed2b44 --- /dev/null +++ b/src/lib/elementary/elm_icon_eo.h @@ -0,0 +1,40 @@ +#ifndef _ELM_ICON_EO_H_ +#define _ELM_ICON_EO_H_ + +#ifndef _ELM_ICON_EO_CLASS_TYPE +#define _ELM_ICON_EO_CLASS_TYPE + +typedef Eo Elm_Icon; + +#endif + +#ifndef _ELM_ICON_EO_TYPES +#define _ELM_ICON_EO_TYPES + + +#endif +/** Elementary Icon Class + * + * @ingroup Elm_Icon + */ +#define ELM_ICON_CLASS elm_icon_class_get() + +EWAPI const Efl_Class *elm_icon_class_get(void); + +EWAPI extern const Efl_Event_Description _ELM_ICON_EVENT_THUMB_DONE; + +/** Called when thumb nailing is successfully done + * + * @ingroup Elm_Icon + */ +#define ELM_ICON_EVENT_THUMB_DONE (&(_ELM_ICON_EVENT_THUMB_DONE)) + +EWAPI extern const Efl_Event_Description _ELM_ICON_EVENT_THUMB_ERROR; + +/** Called when thumb nailing failed + * + * @ingroup Elm_Icon + */ +#define ELM_ICON_EVENT_THUMB_ERROR (&(_ELM_ICON_EVENT_THUMB_ERROR)) + +#endif diff --git a/src/lib/elementary/elm_icon_eo.legacy.h b/src/lib/elementary/elm_icon_eo.legacy.h new file mode 100644 index 0000000000..0639c787e5 --- /dev/null +++ b/src/lib/elementary/elm_icon_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_ICON_EO_LEGACY_H_ +#define _ELM_ICON_EO_LEGACY_H_ + +#ifndef _ELM_ICON_EO_CLASS_TYPE +#define _ELM_ICON_EO_CLASS_TYPE + +typedef Eo Elm_Icon; + +#endif + +#ifndef _ELM_ICON_EO_TYPES +#define _ELM_ICON_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_icon_legacy.h b/src/lib/elementary/elm_icon_legacy.h index fa19077600..4adda268bc 100644 --- a/src/lib/elementary/elm_icon_legacy.h +++ b/src/lib/elementary/elm_icon_legacy.h @@ -103,4 +103,4 @@ EAPI Eina_Bool elm_icon_standard_set(Evas_Object *obj, const char *name); */ EAPI const char *elm_icon_standard_get(const Evas_Object *obj); -#include "elm_icon.eo.legacy.h" +#include "elm_icon_eo.legacy.h" diff --git a/src/lib/elementary/elm_image.h b/src/lib/elementary/elm_image.h index 3e63d445d2..ab3f7b59d9 100644 --- a/src/lib/elementary/elm_image.h +++ b/src/lib/elementary/elm_image.h @@ -55,7 +55,7 @@ * if preload is enabled. (since 1.19) * @li @c "load,error" - Triggered if an async I/O or decoding error occurred, * if async open or preload is enabled (since 1.19) - * @li @c "load,cancel" - Triggered whenener async I/O was cancelled. (since 1.19) + * @li @c "load,cancel" - Triggered whenever async I/O was cancelled. (since 1.19) * * An example of usage for this API follows: * @li @ref tutorial_image @@ -67,9 +67,6 @@ * @{ */ -#ifdef EFL_EO_API_SUPPORT -#include -#endif #ifndef EFL_NOLEGACY_API_SUPPORT #include #endif diff --git a/src/lib/elementary/elm_image_legacy.h b/src/lib/elementary/elm_image_legacy.h index a53e063a5c..d09060f969 100644 --- a/src/lib/elementary/elm_image_legacy.h +++ b/src/lib/elementary/elm_image_legacy.h @@ -434,7 +434,7 @@ EAPI Elm_Image_Orient elm_image_orient_get(const Evas_Object *obj); * * @note Be careful to not manipulate it, as it is under control of elementary. * - * @warning It doesn't gurantee the inlined object must be a type of Evas_Object_Image. + * @warning It doesn't guarantee the inlined object must be a type of Evas_Object_Image. * It would be one of @c Evas_Object_Image or @c Edje_Object depending on image file type. * diff --git a/src/lib/elementary/elm_index.c b/src/lib/elementary/elm_index.c index c82ab64189..c046080a6e 100644 --- a/src/lib/elementary/elm_index.c +++ b/src/lib/elementary/elm_index.c @@ -432,13 +432,13 @@ _index_priority_change(void *data, Elm_Index_Item_Data *it) } } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_index_efl_ui_widget_theme_apply(Eo *obj, Elm_Index_Data *sd) { Evas_Coord minw = 0, minh = 0; Elm_Object_Item *eo_item; - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); @@ -451,7 +451,7 @@ _elm_index_efl_ui_widget_theme_apply(Eo *obj, Elm_Index_Data *sd) elm_widget_theme_element_set(obj, "base/vertical"); int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; elm_coords_finger_size_adjust(1, &minw, 1, &minh); evas_object_size_hint_min_set(sd->event_rect[0], minw, minh); @@ -863,8 +863,7 @@ _on_mouse_up(void *data, { efl_event_callback_legacy_call (data, EFL_UI_EVENT_CLICKED, eo_item); - efl_event_callback_legacy_call - (data, EFL_UI_EVENT_SELECTED, eo_item); + evas_object_smart_callback_call(data, "selected", eo_item); eo_id_item = eo_item; ELM_INDEX_ITEM_DATA_GET(eo_id_item, id_item); if (id_item->func) @@ -1046,7 +1045,6 @@ _elm_index_efl_canvas_group_group_add(Eo *obj, Elm_Index_Data *priv) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set (obj, "index", "base/vertical", elm_widget_style_get(obj))) @@ -1298,13 +1296,12 @@ _elm_index_item_selected_set(Eo *eo_it, efl_event_callback_legacy_call (obj, ELM_INDEX_EVENT_CHANGED, eo_it); - efl_event_callback_legacy_call - (obj, EFL_UI_EVENT_SELECTED, eo_it); + evas_object_smart_callback_call(obj, "selected", eo_it); ecore_timer_del(sd->delay); sd->delay = ecore_timer_add(sd->delay_change_time, _delay_change_cb, obj); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_SELECTED, EINA_TRUE); + efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_TYPE_SELECTED, EINA_TRUE); } else { @@ -1710,5 +1707,5 @@ _elm_index_item_efl_access_widget_action_elm_actions_get(const Eo *eo_it EINA_UN ELM_LAYOUT_SIZING_EVAL_OPS(elm_index), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_index) -#include "elm_index_item.eo.c" -#include "elm_index.eo.c" +#include "elm_index_item_eo.c" +#include "elm_index_eo.c" diff --git a/src/lib/elementary/elm_index.eo b/src/lib/elementary/elm_index.eo deleted file mode 100644 index adc7b6e6a6..0000000000 --- a/src/lib/elementary/elm_index.eo +++ /dev/null @@ -1,211 +0,0 @@ -class Elm.Index extends Efl.Ui.Layout implements Efl.Ui.Direction, - Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.Legacy -{ - [[elementary index class]] - legacy_prefix: elm_index; - eo_prefix: elm_obj_index; - event_prefix: elm_index; - methods { - @property autohide_disabled { - [[Enable or disable auto hiding feature for a given index widget.]] - values { - disabled: bool; [[$true to disable auto hiding, $false to enable]] - } - } - @property omit_enabled { - [[Enable or disable omit feature for a given index widget. - - @since 1.8]] - values { - enabled: bool; [[$true to enable omit feature, $false to disable]] - } - } - @property standard_priority { - [[Control standard_priority group of index. Priority group will be shown as many items as it can, and other group will be shown one character only. - - @since 1.16]] - values { - priority: int; [[$priority target priority value in index]] - } - } - @property delay_change_time { - [[Set a delay change time for index object. - - Note: delay time is 0.2 sec by default.]] - values { - dtime: double; [[The delay change time to set.]] - } - } - @property indicator_disabled { - [[Control the indicator as to be disabled. - - In Index widget, Indicator notes popup text, which shows a letter has been selecting.]] - values { - disabled: bool; [[$true to disable it, $false to enable it]] - } - } - @property item_level { - [[Set the items level for a given index widget. - - See: elm_index_item_level_get()]] - values { - level: int; [[$0 or $1, the currently implemented levels.]] - } - } - level_go { - [[Flush the changes made to the index items so they work correctly - - This flushes any changes made to items indicating the object is ready to - go. You should call this before any changes you expect to work. This - is similar to elm_list_go(). - - Warning: If not called, it won't display the index properly.]] - params { - @in level: int; [[The index level (one of $0 or $1) where changes were made]] - } - } - item_prepend { - [[Prepend a new item on a given index widget. - - - Despite the most common usage of the $letter argument is for - single char strings, one could use arbitrary strings as index - entries. - - $item will be the pointer returned back on $"changed", - "delay,changed" and $"selected" smart events.]] - - return: Elm.Widget.Item; [[A handle to the item added or $NULL, on errors]] - params { - @in letter: string; [[Letter under which the item should be indexed]] - @in func: Evas_Smart_Cb @optional; [[The function to call when the item is selected.]] - @in data: const(void_ptr) @optional; [[The item data to set for the index's item]] - } - } - item_clear { - [[Removes all items from a given index widget. - - If deletion callbacks are set, via elm_object_item_del_cb_set(), - that callback function will be called for each item in $obj.]] - } - item_insert_after { - [[Insert a new item into the index object after item $after. - - Despite the most common usage of the $letter argument is for - single char strings, one could use arbitrary strings as index - entries. - - $item will be the pointer returned back on $"changed", - "delay,changed" and $"selected" smart events. - - 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]] - params { - @in after: Elm.Widget.Item; [[The index item to insert after.]] - @in letter: string; [[Letter under which the item should be indexed]] - @in func: Evas_Smart_Cb @optional; [[The function to call when the item is clicked.]] - @in data: const(void_ptr) @optional; [[The item data to set for the index's item]] - } - } - item_find { - [[Find a given index widget's item, using item data.]] - - return: Elm.Widget.Item; [[The index item handle, if found, or $NULL otherwise]] - params { - @in data: const(void_ptr); [[The item data pointed to by the desired index item]] - } - } - item_insert_before { - [[Insert a new item into the index object before item $before. - - Despite the most common usage of the $letter argument is for - single char strings, one could use arbitrary strings as index - entries. - - $item will be the pointer returned back on $"changed", - "delay,changed" and $"selected" smart events. - - 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]] - params { - @in before: Elm.Widget.Item; [[The index item to insert after.]] - @in letter: string; [[Letter under which the item should be indexed]] - @in func: Evas_Smart_Cb @optional; [[The function to call when the item is clicked.]] - @in data: const(void_ptr) @optional; [[The item data to set for the index's item]] - } - } - item_append { - [[Append a new item on a given index widget. - - Despite the most common usage of the $letter argument is for - single char strings, one could use arbitrary strings as index - entries. - - $item will be the pointer returned back on $"changed", - "delay,changed" and $"selected" smart events.]] - - return: Elm.Widget.Item; [[A handle to the item added or $NULL, on errors]] - params { - @in letter: string; [[Letter under which the item should be indexed]] - @in func: Evas_Smart_Cb @optional; [[The function to call when the item is selected.]] - @in data: const(void_ptr) @optional; [[The item data to set for the index's item]] - } - } - selected_item_get @const { - [[Returns the last selected item, for a given index widget.]] - - return: Elm.Widget.Item; [[The last item selected on $obj (or $NULL, on errors).]] - params { - @in level: int; [[$0 or $1, the currently implemented levels.]] - } - } - item_sorted_insert { - [[Insert a new item into the given index widget, using $cmp_func function to sort items (by item handles). - - Despite the most common usage of the $letter argument is for - single char strings, one could use arbitrary strings as index - entries. - - $item will be the pointer returned back on $"changed", - "delay,changed" and $"selected" smart events.]] - - return: Elm.Widget.Item; [[A handle to the item added or $NULL, on errors]] - params { - @in letter: string; [[Letter under which the item should be indexed]] - @in func: Evas_Smart_Cb @optional; [[The function to call when the item is clicked.]] - @in data: const(void_ptr) @optional; [[The item data to set for the index's item]] - @in cmp_func: Eina_Compare_Cb; [[The comparing function to be used to sort index items by index item handles]] - @in cmp_data_func: Eina_Compare_Cb @optional; [[A fallback function to be called for the - sorting of index items by item data). It will be used - when $cmp_func returns $0 (equality), which means an index - item with provided item data already exists. To decide which - data item should be pointed to by the index item in question, - $cmp_data_func will be used. If $cmp_data_func returns a - non-negative value, the previous index item data will be - replaced by the given $item pointer. If the previous data need - to be freed, it should be done by the $cmp_data_func function, - because all references to it will be lost. If this function is - not provided ($NULL is given), index items will be - duplicated, if $cmp_func returns $0.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - 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.Object.access_children { get; } - } - events { - 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_eo.c b/src/lib/elementary/elm_index_eo.c new file mode 100644 index 0000000000..9c935c7f92 --- /dev/null +++ b/src/lib/elementary/elm_index_eo.c @@ -0,0 +1,327 @@ +EWAPI const Efl_Event_Description _ELM_INDEX_EVENT_CHANGED = + EFL_EVENT_DESCRIPTION("changed"); +EWAPI const Efl_Event_Description _ELM_INDEX_EVENT_DELAY_CHANGED = + EFL_EVENT_DESCRIPTION("delay,changed"); +EWAPI const Efl_Event_Description _ELM_INDEX_EVENT_LEVEL_UP = + EFL_EVENT_DESCRIPTION("level,up"); +EWAPI const Efl_Event_Description _ELM_INDEX_EVENT_LEVEL_DOWN = + EFL_EVENT_DESCRIPTION("level,down"); + +void _elm_index_autohide_disabled_set(Eo *obj, Elm_Index_Data *pd, Eina_Bool disabled); + + +static Eina_Error +__eolian_elm_index_autohide_disabled_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_index_autohide_disabled_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_index_autohide_disabled_set, EFL_FUNC_CALL(disabled), Eina_Bool disabled); + +Eina_Bool _elm_index_autohide_disabled_get(const Eo *obj, Elm_Index_Data *pd); + + +static Eina_Value +__eolian_elm_index_autohide_disabled_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_index_autohide_disabled_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_index_autohide_disabled_get, Eina_Bool, 0); + +void _elm_index_omit_enabled_set(Eo *obj, Elm_Index_Data *pd, Eina_Bool enabled); + + +static Eina_Error +__eolian_elm_index_omit_enabled_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_index_omit_enabled_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_index_omit_enabled_set, EFL_FUNC_CALL(enabled), Eina_Bool enabled); + +Eina_Bool _elm_index_omit_enabled_get(const Eo *obj, Elm_Index_Data *pd); + + +static Eina_Value +__eolian_elm_index_omit_enabled_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_index_omit_enabled_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_index_omit_enabled_get, Eina_Bool, 0); + +void _elm_index_standard_priority_set(Eo *obj, Elm_Index_Data *pd, int priority); + + +static Eina_Error +__eolian_elm_index_standard_priority_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_index_standard_priority_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_index_standard_priority_set, EFL_FUNC_CALL(priority), int priority); + +int _elm_index_standard_priority_get(const Eo *obj, Elm_Index_Data *pd); + + +static Eina_Value +__eolian_elm_index_standard_priority_get_reflect(const Eo *obj) +{ + int val = elm_obj_index_standard_priority_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_index_standard_priority_get, int, 0); + +void _elm_index_delay_change_time_set(Eo *obj, Elm_Index_Data *pd, double dtime); + + +static Eina_Error +__eolian_elm_index_delay_change_time_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_index_delay_change_time_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_index_delay_change_time_set, EFL_FUNC_CALL(dtime), double dtime); + +double _elm_index_delay_change_time_get(const Eo *obj, Elm_Index_Data *pd); + + +static Eina_Value +__eolian_elm_index_delay_change_time_get_reflect(const Eo *obj) +{ + double val = elm_obj_index_delay_change_time_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_index_delay_change_time_get, double, 0); + +void _elm_index_indicator_disabled_set(Eo *obj, Elm_Index_Data *pd, Eina_Bool disabled); + + +static Eina_Error +__eolian_elm_index_indicator_disabled_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_index_indicator_disabled_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_index_indicator_disabled_set, EFL_FUNC_CALL(disabled), Eina_Bool disabled); + +Eina_Bool _elm_index_indicator_disabled_get(const Eo *obj, Elm_Index_Data *pd); + + +static Eina_Value +__eolian_elm_index_indicator_disabled_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_index_indicator_disabled_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_index_indicator_disabled_get, Eina_Bool, 0); + +void _elm_index_item_level_set(Eo *obj, Elm_Index_Data *pd, int level); + + +static Eina_Error +__eolian_elm_index_item_level_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_index_item_level_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_index_item_level_set, EFL_FUNC_CALL(level), int level); + +int _elm_index_item_level_get(const Eo *obj, Elm_Index_Data *pd); + + +static Eina_Value +__eolian_elm_index_item_level_get_reflect(const Eo *obj) +{ + int val = elm_obj_index_item_level_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_index_item_level_get, int, 0); + +void _elm_index_level_go(Eo *obj, Elm_Index_Data *pd, int level); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_index_level_go, EFL_FUNC_CALL(level), int level); + +Elm_Widget_Item *_elm_index_item_prepend(Eo *obj, Elm_Index_Data *pd, const char *letter, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_index_item_prepend, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(letter, func, data), const char *letter, Evas_Smart_Cb func, const void *data); + +void _elm_index_item_clear(Eo *obj, Elm_Index_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_index_item_clear); + +Elm_Widget_Item *_elm_index_item_insert_after(Eo *obj, Elm_Index_Data *pd, Elm_Widget_Item *after, const char *letter, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_index_item_insert_after, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(after, letter, func, data), Elm_Widget_Item *after, const char *letter, Evas_Smart_Cb func, const void *data); + +Elm_Widget_Item *_elm_index_item_find(Eo *obj, Elm_Index_Data *pd, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_index_item_find, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(data), const void *data); + +Elm_Widget_Item *_elm_index_item_insert_before(Eo *obj, Elm_Index_Data *pd, Elm_Widget_Item *before, const char *letter, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_index_item_insert_before, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(before, letter, func, data), Elm_Widget_Item *before, const char *letter, Evas_Smart_Cb func, const void *data); + +Elm_Widget_Item *_elm_index_item_append(Eo *obj, Elm_Index_Data *pd, const char *letter, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_index_item_append, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(letter, func, data), const char *letter, Evas_Smart_Cb func, const void *data); + +Elm_Widget_Item *_elm_index_selected_item_get(const Eo *obj, Elm_Index_Data *pd, int level); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_index_selected_item_get, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(level), int level); + +Elm_Widget_Item *_elm_index_item_sorted_insert(Eo *obj, Elm_Index_Data *pd, const char *letter, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func, Eina_Compare_Cb cmp_data_func); + +EOAPI EFL_FUNC_BODYV(elm_obj_index_item_sorted_insert, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(letter, func, data, cmp_func, cmp_data_func), const char *letter, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func, Eina_Compare_Cb cmp_data_func); + +Efl_Object *_elm_index_efl_object_constructor(Eo *obj, Elm_Index_Data *pd); + + +Eina_Error _elm_index_efl_ui_widget_theme_apply(Eo *obj, Elm_Index_Data *pd); + + +void _elm_index_efl_ui_widget_on_access_update(Eo *obj, Elm_Index_Data *pd, Eina_Bool enable); + + +void _elm_index_efl_ui_direction_direction_set(Eo *obj, Elm_Index_Data *pd, Efl_Ui_Dir dir); + + +Efl_Ui_Dir _elm_index_efl_ui_direction_direction_get(const Eo *obj, Elm_Index_Data *pd); + + +Eina_List *_elm_index_efl_access_object_access_children_get(const Eo *obj, Elm_Index_Data *pd); + + +static Eina_Bool +_elm_index_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_INDEX_EXTRA_OPS +#define ELM_INDEX_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_index_autohide_disabled_set, _elm_index_autohide_disabled_set), + EFL_OBJECT_OP_FUNC(elm_obj_index_autohide_disabled_get, _elm_index_autohide_disabled_get), + EFL_OBJECT_OP_FUNC(elm_obj_index_omit_enabled_set, _elm_index_omit_enabled_set), + EFL_OBJECT_OP_FUNC(elm_obj_index_omit_enabled_get, _elm_index_omit_enabled_get), + EFL_OBJECT_OP_FUNC(elm_obj_index_standard_priority_set, _elm_index_standard_priority_set), + EFL_OBJECT_OP_FUNC(elm_obj_index_standard_priority_get, _elm_index_standard_priority_get), + EFL_OBJECT_OP_FUNC(elm_obj_index_delay_change_time_set, _elm_index_delay_change_time_set), + EFL_OBJECT_OP_FUNC(elm_obj_index_delay_change_time_get, _elm_index_delay_change_time_get), + EFL_OBJECT_OP_FUNC(elm_obj_index_indicator_disabled_set, _elm_index_indicator_disabled_set), + EFL_OBJECT_OP_FUNC(elm_obj_index_indicator_disabled_get, _elm_index_indicator_disabled_get), + EFL_OBJECT_OP_FUNC(elm_obj_index_item_level_set, _elm_index_item_level_set), + EFL_OBJECT_OP_FUNC(elm_obj_index_item_level_get, _elm_index_item_level_get), + EFL_OBJECT_OP_FUNC(elm_obj_index_level_go, _elm_index_level_go), + EFL_OBJECT_OP_FUNC(elm_obj_index_item_prepend, _elm_index_item_prepend), + EFL_OBJECT_OP_FUNC(elm_obj_index_item_clear, _elm_index_item_clear), + EFL_OBJECT_OP_FUNC(elm_obj_index_item_insert_after, _elm_index_item_insert_after), + EFL_OBJECT_OP_FUNC(elm_obj_index_item_find, _elm_index_item_find), + EFL_OBJECT_OP_FUNC(elm_obj_index_item_insert_before, _elm_index_item_insert_before), + EFL_OBJECT_OP_FUNC(elm_obj_index_item_append, _elm_index_item_append), + EFL_OBJECT_OP_FUNC(elm_obj_index_selected_item_get, _elm_index_selected_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_index_item_sorted_insert, _elm_index_item_sorted_insert), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_index_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_index_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_index_efl_ui_widget_on_access_update), + EFL_OBJECT_OP_FUNC(efl_ui_direction_set, _elm_index_efl_ui_direction_direction_set), + EFL_OBJECT_OP_FUNC(efl_ui_direction_get, _elm_index_efl_ui_direction_direction_get), + EFL_OBJECT_OP_FUNC(efl_access_object_access_children_get, _elm_index_efl_access_object_access_children_get), + ELM_INDEX_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"autohide_disabled", __eolian_elm_index_autohide_disabled_set_reflect, __eolian_elm_index_autohide_disabled_get_reflect}, + {"omit_enabled", __eolian_elm_index_omit_enabled_set_reflect, __eolian_elm_index_omit_enabled_get_reflect}, + {"standard_priority", __eolian_elm_index_standard_priority_set_reflect, __eolian_elm_index_standard_priority_get_reflect}, + {"delay_change_time", __eolian_elm_index_delay_change_time_set_reflect, __eolian_elm_index_delay_change_time_get_reflect}, + {"indicator_disabled", __eolian_elm_index_indicator_disabled_set_reflect, __eolian_elm_index_indicator_disabled_get_reflect}, + {"item_level", __eolian_elm_index_item_level_set_reflect, __eolian_elm_index_item_level_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_index_class_desc = { + EO_VERSION, + "Elm.Index", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Index_Data), + _elm_index_class_initializer, + _elm_index_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_index_class_get, &_elm_index_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_DIRECTION_INTERFACE, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_index_eo.legacy.c" diff --git a/src/lib/elementary/elm_index_eo.h b/src/lib/elementary/elm_index_eo.h new file mode 100644 index 0000000000..32af5b1d7b --- /dev/null +++ b/src/lib/elementary/elm_index_eo.h @@ -0,0 +1,382 @@ +#ifndef _ELM_INDEX_EO_H_ +#define _ELM_INDEX_EO_H_ + +#ifndef _ELM_INDEX_EO_CLASS_TYPE +#define _ELM_INDEX_EO_CLASS_TYPE + +typedef Eo Elm_Index; + +#endif + +#ifndef _ELM_INDEX_EO_TYPES +#define _ELM_INDEX_EO_TYPES + + +#endif +/** elementary index class + * + * @ingroup Elm_Index + */ +#define ELM_INDEX_CLASS elm_index_class_get() + +EWAPI const Efl_Class *elm_index_class_get(void); + +/** + * @brief Enable or disable auto hiding feature for a given index widget. + * + * @param[in] obj The object. + * @param[in] disabled @c true to disable auto hiding, @c false to enable + * + * @ingroup Elm_Index + */ +EOAPI void elm_obj_index_autohide_disabled_set(Eo *obj, Eina_Bool disabled); + +/** + * @brief Enable or disable auto hiding feature for a given index widget. + * + * @param[in] obj The object. + * + * @return @c true to disable auto hiding, @c false to enable + * + * @ingroup Elm_Index + */ +EOAPI Eina_Bool elm_obj_index_autohide_disabled_get(const Eo *obj); + +/** + * @brief Enable or disable omit feature for a given index widget. + * + * @param[in] obj The object. + * @param[in] enabled @c true to enable omit feature, @c false to disable + * + * @since 1.8 + * + * @ingroup Elm_Index + */ +EOAPI void elm_obj_index_omit_enabled_set(Eo *obj, Eina_Bool enabled); + +/** + * @brief Enable or disable omit feature for a given index widget. + * + * @param[in] obj The object. + * + * @return @c true to enable omit feature, @c false to disable + * + * @since 1.8 + * + * @ingroup Elm_Index + */ +EOAPI Eina_Bool elm_obj_index_omit_enabled_get(const Eo *obj); + +/** + * @brief Control standard_priority group of index. Priority group will be + * shown as many items as it can, and other group will be shown one character + * only. + * + * @param[in] obj The object. + * @param[in] priority @c priority target priority value in index + * + * @since 1.16 + * + * @ingroup Elm_Index + */ +EOAPI void elm_obj_index_standard_priority_set(Eo *obj, int priority); + +/** + * @brief Control standard_priority group of index. Priority group will be + * shown as many items as it can, and other group will be shown one character + * only. + * + * @param[in] obj The object. + * + * @return @c priority target priority value in index + * + * @since 1.16 + * + * @ingroup Elm_Index + */ +EOAPI int elm_obj_index_standard_priority_get(const Eo *obj); + +/** + * @brief Set a delay change time for index object. + * + * @note delay time is 0.2 sec by default. + * + * @param[in] obj The object. + * @param[in] dtime The delay change time to set. + * + * @ingroup Elm_Index + */ +EOAPI void elm_obj_index_delay_change_time_set(Eo *obj, double dtime); + +/** + * @brief Set a delay change time for index object. + * + * @note delay time is 0.2 sec by default. + * + * @param[in] obj The object. + * + * @return The delay change time to set. + * + * @ingroup Elm_Index + */ +EOAPI double elm_obj_index_delay_change_time_get(const Eo *obj); + +/** + * @brief Control the indicator as to be disabled. + * + * In Index widget, Indicator notes popup text, which shows a letter has been + * selecting. + * + * @param[in] obj The object. + * @param[in] disabled @c true to disable it, @c false to enable it + * + * @ingroup Elm_Index + */ +EOAPI void elm_obj_index_indicator_disabled_set(Eo *obj, Eina_Bool disabled); + +/** + * @brief Control the indicator as to be disabled. + * + * In Index widget, Indicator notes popup text, which shows a letter has been + * selecting. + * + * @param[in] obj The object. + * + * @return @c true to disable it, @c false to enable it + * + * @ingroup Elm_Index + */ +EOAPI Eina_Bool elm_obj_index_indicator_disabled_get(const Eo *obj); + +/** + * @brief Set the items level for a given index widget. + * + * See: elm_index_item_level_get() + * + * @param[in] obj The object. + * @param[in] level $0 or $1, the currently implemented levels. + * + * @ingroup Elm_Index + */ +EOAPI void elm_obj_index_item_level_set(Eo *obj, int level); + +/** + * @brief Set the items level for a given index widget. + * + * See: elm_index_item_level_get() + * + * @param[in] obj The object. + * + * @return $0 or $1, the currently implemented levels. + * + * @ingroup Elm_Index + */ +EOAPI int elm_obj_index_item_level_get(const Eo *obj); + +/** + * @brief Flush the changes made to the index items so they work correctly + * + * This flushes any changes made to items indicating the object is ready to go. + * You should call this before any changes you expect to work. This is similar + * to elm_list_go(). + * + * @warning If not called, it won't display the index properly. + * + * @param[in] obj The object. + * @param[in] level The index level (one of $0 or $1) where changes were made + * + * @ingroup Elm_Index + */ +EOAPI void elm_obj_index_level_go(Eo *obj, int level); + +/** + * @brief Prepend a new item on a given index widget. + * + * Despite the most common usage of the @c letter argument is for single char + * strings, one could use arbitrary strings as index entries. + * + * @c item will be the pointer returned back on $"changed", "delay,changed" and + * $"selected" smart events. + * + * @param[in] obj The object. + * @param[in] letter Letter under which the item should be indexed + * @param[in] func The function to call when the item is selected. + * @param[in] data The item data to set for the index's item + * + * @return A handle to the item added or @c NULL, on errors + * + * @ingroup Elm_Index + */ +EOAPI Elm_Widget_Item *elm_obj_index_item_prepend(Eo *obj, const char *letter, Evas_Smart_Cb func, const void *data); + +/** + * @brief Removes all items from a given index widget. + * + * If deletion callbacks are set, via elm_object_item_del_cb_set(), that + * callback function will be called for each item in @c obj. + * @param[in] obj The object. + * + * @ingroup Elm_Index + */ +EOAPI void elm_obj_index_item_clear(Eo *obj); + +/** + * @brief Insert a new item into the index object after item @c after. + * + * Despite the most common usage of the @c letter argument is for single char + * strings, one could use arbitrary strings as index entries. + * + * @c item will be the pointer returned back on $"changed", "delay,changed" and + * $"selected" smart events. + * + * @note If @c after is @c NULL this function will behave as + * elm_index_item_append(). + * + * @param[in] obj The object. + * @param[in] after The index item to insert after. + * @param[in] letter Letter under which the item should be indexed + * @param[in] func The function to call when the item is clicked. + * @param[in] data The item data to set for the index's item + * + * @return A handle to the item added or @c NULL, on errors + * + * @ingroup Elm_Index + */ +EOAPI Elm_Widget_Item *elm_obj_index_item_insert_after(Eo *obj, Elm_Widget_Item *after, const char *letter, Evas_Smart_Cb func, const void *data); + +/** + * @brief Find a given index widget's item, using item data. + * + * @param[in] obj The object. + * @param[in] data The item data pointed to by the desired index item + * + * @return The index item handle, if found, or @c NULL otherwise + * + * @ingroup Elm_Index + */ +EOAPI Elm_Widget_Item *elm_obj_index_item_find(Eo *obj, const void *data); + +/** + * @brief Insert a new item into the index object before item @c before. + * + * Despite the most common usage of the @c letter argument is for single char + * strings, one could use arbitrary strings as index entries. + * + * @c item will be the pointer returned back on $"changed", "delay,changed" and + * $"selected" smart events. + * + * @note If @c before is @c NULL this function will behave as + * elm_index_item_prepend(). + * + * @param[in] obj The object. + * @param[in] before The index item to insert after. + * @param[in] letter Letter under which the item should be indexed + * @param[in] func The function to call when the item is clicked. + * @param[in] data The item data to set for the index's item + * + * @return A handle to the item added or @c NULL, on errors + * + * @ingroup Elm_Index + */ +EOAPI Elm_Widget_Item *elm_obj_index_item_insert_before(Eo *obj, Elm_Widget_Item *before, const char *letter, Evas_Smart_Cb func, const void *data); + +/** + * @brief Append a new item on a given index widget. + * + * Despite the most common usage of the @c letter argument is for single char + * strings, one could use arbitrary strings as index entries. + * + * @c item will be the pointer returned back on $"changed", "delay,changed" and + * $"selected" smart events. + * + * @param[in] obj The object. + * @param[in] letter Letter under which the item should be indexed + * @param[in] func The function to call when the item is selected. + * @param[in] data The item data to set for the index's item + * + * @return A handle to the item added or @c NULL, on errors + * + * @ingroup Elm_Index + */ +EOAPI Elm_Widget_Item *elm_obj_index_item_append(Eo *obj, const char *letter, Evas_Smart_Cb func, const void *data); + +/** + * @brief Returns the last selected item, for a given index widget. + * + * @param[in] obj The object. + * @param[in] level $0 or $1, the currently implemented levels. + * + * @return The last item selected on @c obj (or @c NULL, on errors). + * + * @ingroup Elm_Index + */ +EOAPI Elm_Widget_Item *elm_obj_index_selected_item_get(const Eo *obj, int level); + +/** + * @brief Insert a new item into the given index widget, using @c cmp_func + * function to sort items (by item handles). + * + * Despite the most common usage of the @c letter argument is for single char + * strings, one could use arbitrary strings as index entries. + * + * @c item will be the pointer returned back on $"changed", "delay,changed" and + * $"selected" smart events. + * + * @param[in] obj The object. + * @param[in] letter Letter under which the item should be indexed + * @param[in] func The function to call when the item is clicked. + * @param[in] data The item data to set for the index's item + * @param[in] cmp_func The comparing function to be used to sort index items by + * index item handles + * @param[in] cmp_data_func A fallback function to be called for the sorting of + * index items by item data). It will be used when @c cmp_func returns $0 + * (equality), which means an index item with provided item data already + * exists. To decide which data item should be pointed to by the index item in + * question, @c cmp_data_func will be used. If @c cmp_data_func returns a + * non-negative value, the previous index item data will be replaced by the + * given @c item pointer. If the previous data need to be freed, it should be + * done by the @c cmp_data_func function, because all references to it will be + * lost. If this function is not provided ($NULL is given), index items will be + * duplicated, if @c cmp_func returns $0. + * + * @return A handle to the item added or @c NULL, on errors + * + * @ingroup Elm_Index + */ +EOAPI Elm_Widget_Item *elm_obj_index_item_sorted_insert(Eo *obj, const char *letter, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func, Eina_Compare_Cb cmp_data_func); + +EWAPI extern const Efl_Event_Description _ELM_INDEX_EVENT_CHANGED; + +/** Called when index changed + * @return Efl_Object * + * + * @ingroup Elm_Index + */ +#define ELM_INDEX_EVENT_CHANGED (&(_ELM_INDEX_EVENT_CHANGED)) + +EWAPI extern const Efl_Event_Description _ELM_INDEX_EVENT_DELAY_CHANGED; + +/** Called when delay changed + * @return Efl_Object * + * + * @ingroup Elm_Index + */ +#define ELM_INDEX_EVENT_DELAY_CHANGED (&(_ELM_INDEX_EVENT_DELAY_CHANGED)) + +EWAPI extern const Efl_Event_Description _ELM_INDEX_EVENT_LEVEL_UP; + +/** Called when level increased + * + * @ingroup Elm_Index + */ +#define ELM_INDEX_EVENT_LEVEL_UP (&(_ELM_INDEX_EVENT_LEVEL_UP)) + +EWAPI extern const Efl_Event_Description _ELM_INDEX_EVENT_LEVEL_DOWN; + +/** Called when level decreased + * + * @ingroup Elm_Index + */ +#define ELM_INDEX_EVENT_LEVEL_DOWN (&(_ELM_INDEX_EVENT_LEVEL_DOWN)) + +#endif diff --git a/src/lib/elementary/elm_index_eo.legacy.c b/src/lib/elementary/elm_index_eo.legacy.c new file mode 100644 index 0000000000..52b5426009 --- /dev/null +++ b/src/lib/elementary/elm_index_eo.legacy.c @@ -0,0 +1,126 @@ + +EAPI void +elm_index_autohide_disabled_set(Elm_Index *obj, Eina_Bool disabled) +{ + elm_obj_index_autohide_disabled_set(obj, disabled); +} + +EAPI Eina_Bool +elm_index_autohide_disabled_get(const Elm_Index *obj) +{ + return elm_obj_index_autohide_disabled_get(obj); +} + +EAPI void +elm_index_omit_enabled_set(Elm_Index *obj, Eina_Bool enabled) +{ + elm_obj_index_omit_enabled_set(obj, enabled); +} + +EAPI Eina_Bool +elm_index_omit_enabled_get(const Elm_Index *obj) +{ + return elm_obj_index_omit_enabled_get(obj); +} + +EAPI void +elm_index_standard_priority_set(Elm_Index *obj, int priority) +{ + elm_obj_index_standard_priority_set(obj, priority); +} + +EAPI int +elm_index_standard_priority_get(const Elm_Index *obj) +{ + return elm_obj_index_standard_priority_get(obj); +} + +EAPI void +elm_index_delay_change_time_set(Elm_Index *obj, double dtime) +{ + elm_obj_index_delay_change_time_set(obj, dtime); +} + +EAPI double +elm_index_delay_change_time_get(const Elm_Index *obj) +{ + return elm_obj_index_delay_change_time_get(obj); +} + +EAPI void +elm_index_indicator_disabled_set(Elm_Index *obj, Eina_Bool disabled) +{ + elm_obj_index_indicator_disabled_set(obj, disabled); +} + +EAPI Eina_Bool +elm_index_indicator_disabled_get(const Elm_Index *obj) +{ + return elm_obj_index_indicator_disabled_get(obj); +} + +EAPI void +elm_index_item_level_set(Elm_Index *obj, int level) +{ + elm_obj_index_item_level_set(obj, level); +} + +EAPI int +elm_index_item_level_get(const Elm_Index *obj) +{ + return elm_obj_index_item_level_get(obj); +} + +EAPI void +elm_index_level_go(Elm_Index *obj, int level) +{ + elm_obj_index_level_go(obj, level); +} + +EAPI Elm_Widget_Item * +elm_index_item_prepend(Elm_Index *obj, const char *letter, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_index_item_prepend(obj, letter, func, data); +} + +EAPI void +elm_index_item_clear(Elm_Index *obj) +{ + elm_obj_index_item_clear(obj); +} + +EAPI Elm_Widget_Item * +elm_index_item_insert_after(Elm_Index *obj, Elm_Widget_Item *after, const char *letter, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_index_item_insert_after(obj, after, letter, func, data); +} + +EAPI Elm_Widget_Item * +elm_index_item_find(Elm_Index *obj, const void *data) +{ + return elm_obj_index_item_find(obj, data); +} + +EAPI Elm_Widget_Item * +elm_index_item_insert_before(Elm_Index *obj, Elm_Widget_Item *before, const char *letter, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_index_item_insert_before(obj, before, letter, func, data); +} + +EAPI Elm_Widget_Item * +elm_index_item_append(Elm_Index *obj, const char *letter, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_index_item_append(obj, letter, func, data); +} + +EAPI Elm_Widget_Item * +elm_index_selected_item_get(const Elm_Index *obj, int level) +{ + return elm_obj_index_selected_item_get(obj, level); +} + +EAPI Elm_Widget_Item * +elm_index_item_sorted_insert(Elm_Index *obj, const char *letter, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func, Eina_Compare_Cb cmp_data_func) +{ + return elm_obj_index_item_sorted_insert(obj, letter, func, data, cmp_func, cmp_data_func); +} diff --git a/src/lib/elementary/elm_index_eo.legacy.h b/src/lib/elementary/elm_index_eo.legacy.h new file mode 100644 index 0000000000..3caed55c45 --- /dev/null +++ b/src/lib/elementary/elm_index_eo.legacy.h @@ -0,0 +1,341 @@ +#ifndef _ELM_INDEX_EO_LEGACY_H_ +#define _ELM_INDEX_EO_LEGACY_H_ + +#ifndef _ELM_INDEX_EO_CLASS_TYPE +#define _ELM_INDEX_EO_CLASS_TYPE + +typedef Eo Elm_Index; + +#endif + +#ifndef _ELM_INDEX_EO_TYPES +#define _ELM_INDEX_EO_TYPES + + +#endif + +/** + * @brief Enable or disable auto hiding feature for a given index widget. + * + * @param[in] obj The object. + * @param[in] disabled @c true to disable auto hiding, @c false to enable + * + * @ingroup Elm_Index_Group + */ +EAPI void elm_index_autohide_disabled_set(Elm_Index *obj, Eina_Bool disabled); + +/** + * @brief Enable or disable auto hiding feature for a given index widget. + * + * @param[in] obj The object. + * + * @return @c true to disable auto hiding, @c false to enable + * + * @ingroup Elm_Index_Group + */ +EAPI Eina_Bool elm_index_autohide_disabled_get(const Elm_Index *obj); + +/** + * @brief Enable or disable omit feature for a given index widget. + * + * @param[in] obj The object. + * @param[in] enabled @c true to enable omit feature, @c false to disable + * + * @since 1.8 + * + * @ingroup Elm_Index_Group + */ +EAPI void elm_index_omit_enabled_set(Elm_Index *obj, Eina_Bool enabled); + +/** + * @brief Enable or disable omit feature for a given index widget. + * + * @param[in] obj The object. + * + * @return @c true to enable omit feature, @c false to disable + * + * @since 1.8 + * + * @ingroup Elm_Index_Group + */ +EAPI Eina_Bool elm_index_omit_enabled_get(const Elm_Index *obj); + +/** + * @brief Control standard_priority group of index. Priority group will be + * shown as many items as it can, and other group will be shown one character + * only. + * + * @param[in] obj The object. + * @param[in] priority @c priority target priority value in index + * + * @since 1.16 + * + * @ingroup Elm_Index_Group + */ +EAPI void elm_index_standard_priority_set(Elm_Index *obj, int priority); + +/** + * @brief Control standard_priority group of index. Priority group will be + * shown as many items as it can, and other group will be shown one character + * only. + * + * @param[in] obj The object. + * + * @return @c priority target priority value in index + * + * @since 1.16 + * + * @ingroup Elm_Index_Group + */ +EAPI int elm_index_standard_priority_get(const Elm_Index *obj); + +/** + * @brief Set a delay change time for index object. + * + * @note delay time is 0.2 sec by default. + * + * @param[in] obj The object. + * @param[in] dtime The delay change time to set. + * + * @ingroup Elm_Index_Group + */ +EAPI void elm_index_delay_change_time_set(Elm_Index *obj, double dtime); + +/** + * @brief Set a delay change time for index object. + * + * @note delay time is 0.2 sec by default. + * + * @param[in] obj The object. + * + * @return The delay change time to set. + * + * @ingroup Elm_Index_Group + */ +EAPI double elm_index_delay_change_time_get(const Elm_Index *obj); + +/** + * @brief Control the indicator as to be disabled. + * + * In Index widget, Indicator notes popup text, which shows a letter has been + * selecting. + * + * @param[in] obj The object. + * @param[in] disabled @c true to disable it, @c false to enable it + * + * @ingroup Elm_Index_Group + */ +EAPI void elm_index_indicator_disabled_set(Elm_Index *obj, Eina_Bool disabled); + +/** + * @brief Control the indicator as to be disabled. + * + * In Index widget, Indicator notes popup text, which shows a letter has been + * selecting. + * + * @param[in] obj The object. + * + * @return @c true to disable it, @c false to enable it + * + * @ingroup Elm_Index_Group + */ +EAPI Eina_Bool elm_index_indicator_disabled_get(const Elm_Index *obj); + +/** + * @brief Set the items level for a given index widget. + * + * See: elm_index_item_level_get() + * + * @param[in] obj The object. + * @param[in] level $0 or $1, the currently implemented levels. + * + * @ingroup Elm_Index_Group + */ +EAPI void elm_index_item_level_set(Elm_Index *obj, int level); + +/** + * @brief Set the items level for a given index widget. + * + * See: elm_index_item_level_get() + * + * @param[in] obj The object. + * + * @return $0 or $1, the currently implemented levels. + * + * @ingroup Elm_Index_Group + */ +EAPI int elm_index_item_level_get(const Elm_Index *obj); + +/** + * @brief Flush the changes made to the index items so they work correctly + * + * This flushes any changes made to items indicating the object is ready to go. + * You should call this before any changes you expect to work. This is similar + * to elm_list_go(). + * + * @warning If not called, it won't display the index properly. + * + * @param[in] obj The object. + * @param[in] level The index level (one of $0 or $1) where changes were made + * + * @ingroup Elm_Index_Group + */ +EAPI void elm_index_level_go(Elm_Index *obj, int level); + +/** + * @brief Prepend a new item on a given index widget. + * + * Despite the most common usage of the @c letter argument is for single char + * strings, one could use arbitrary strings as index entries. + * + * @c item will be the pointer returned back on $"changed", "delay,changed" and + * $"selected" smart events. + * + * @param[in] obj The object. + * @param[in] letter Letter under which the item should be indexed + * @param[in] func The function to call when the item is selected. + * @param[in] data The item data to set for the index's item + * + * @return A handle to the item added or @c NULL, on errors + * + * @ingroup Elm_Index_Group + */ +EAPI Elm_Widget_Item *elm_index_item_prepend(Elm_Index *obj, const char *letter, Evas_Smart_Cb func, const void *data); + +/** + * @brief Removes all items from a given index widget. + * + * If deletion callbacks are set, via elm_object_item_del_cb_set(), that + * callback function will be called for each item in @c obj. + * @param[in] obj The object. + * + * @ingroup Elm_Index_Group + */ +EAPI void elm_index_item_clear(Elm_Index *obj); + +/** + * @brief Insert a new item into the index object after item @c after. + * + * Despite the most common usage of the @c letter argument is for single char + * strings, one could use arbitrary strings as index entries. + * + * @c item will be the pointer returned back on $"changed", "delay,changed" and + * $"selected" smart events. + * + * @note If @c after is @c NULL this function will behave as + * elm_index_item_append(). + * + * @param[in] obj The object. + * @param[in] after The index item to insert after. + * @param[in] letter Letter under which the item should be indexed + * @param[in] func The function to call when the item is clicked. + * @param[in] data The item data to set for the index's item + * + * @return A handle to the item added or @c NULL, on errors + * + * @ingroup Elm_Index_Group + */ +EAPI Elm_Widget_Item *elm_index_item_insert_after(Elm_Index *obj, Elm_Widget_Item *after, const char *letter, Evas_Smart_Cb func, const void *data); + +/** + * @brief Find a given index widget's item, using item data. + * + * @param[in] obj The object. + * @param[in] data The item data pointed to by the desired index item + * + * @return The index item handle, if found, or @c NULL otherwise + * + * @ingroup Elm_Index_Group + */ +EAPI Elm_Widget_Item *elm_index_item_find(Elm_Index *obj, const void *data); + +/** + * @brief Insert a new item into the index object before item @c before. + * + * Despite the most common usage of the @c letter argument is for single char + * strings, one could use arbitrary strings as index entries. + * + * @c item will be the pointer returned back on $"changed", "delay,changed" and + * $"selected" smart events. + * + * @note If @c before is @c NULL this function will behave as + * elm_index_item_prepend(). + * + * @param[in] obj The object. + * @param[in] before The index item to insert after. + * @param[in] letter Letter under which the item should be indexed + * @param[in] func The function to call when the item is clicked. + * @param[in] data The item data to set for the index's item + * + * @return A handle to the item added or @c NULL, on errors + * + * @ingroup Elm_Index_Group + */ +EAPI Elm_Widget_Item *elm_index_item_insert_before(Elm_Index *obj, Elm_Widget_Item *before, const char *letter, Evas_Smart_Cb func, const void *data); + +/** + * @brief Append a new item on a given index widget. + * + * Despite the most common usage of the @c letter argument is for single char + * strings, one could use arbitrary strings as index entries. + * + * @c item will be the pointer returned back on $"changed", "delay,changed" and + * $"selected" smart events. + * + * @param[in] obj The object. + * @param[in] letter Letter under which the item should be indexed + * @param[in] func The function to call when the item is selected. + * @param[in] data The item data to set for the index's item + * + * @return A handle to the item added or @c NULL, on errors + * + * @ingroup Elm_Index_Group + */ +EAPI Elm_Widget_Item *elm_index_item_append(Elm_Index *obj, const char *letter, Evas_Smart_Cb func, const void *data); + +/** + * @brief Returns the last selected item, for a given index widget. + * + * @param[in] obj The object. + * @param[in] level $0 or $1, the currently implemented levels. + * + * @return The last item selected on @c obj (or @c NULL, on errors). + * + * @ingroup Elm_Index_Group + */ +EAPI Elm_Widget_Item *elm_index_selected_item_get(const Elm_Index *obj, int level); + +/** + * @brief Insert a new item into the given index widget, using @c cmp_func + * function to sort items (by item handles). + * + * Despite the most common usage of the @c letter argument is for single char + * strings, one could use arbitrary strings as index entries. + * + * @c item will be the pointer returned back on $"changed", "delay,changed" and + * $"selected" smart events. + * + * @param[in] obj The object. + * @param[in] letter Letter under which the item should be indexed + * @param[in] func The function to call when the item is clicked. + * @param[in] data The item data to set for the index's item + * @param[in] cmp_func The comparing function to be used to sort index items by + * index item handles + * @param[in] cmp_data_func A fallback function to be called for the sorting of + * index items by item data). It will be used when @c cmp_func returns $0 + * (equality), which means an index item with provided item data already + * exists. To decide which data item should be pointed to by the index item in + * question, @c cmp_data_func will be used. If @c cmp_data_func returns a + * non-negative value, the previous index item data will be replaced by the + * given @c item pointer. If the previous data need to be freed, it should be + * done by the @c cmp_data_func function, because all references to it will be + * lost. If this function is not provided ($NULL is given), index items will be + * duplicated, if @c cmp_func returns $0. + * + * @return A handle to the item added or @c NULL, on errors + * + * @ingroup Elm_Index_Group + */ +EAPI Elm_Widget_Item *elm_index_item_sorted_insert(Elm_Index *obj, const char *letter, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func, Eina_Compare_Cb cmp_data_func); + +#endif diff --git a/src/lib/elementary/elm_index_item.eo b/src/lib/elementary/elm_index_item.eo deleted file mode 100644 index 5e4491cec9..0000000000 --- a/src/lib/elementary/elm_index_item.eo +++ /dev/null @@ -1,50 +0,0 @@ -class Elm.Index.Item extends Elm.Widget.Item implements Efl.Access.Widget.Action, Efl.Ui.Legacy -{ - [[Elementary index item class]] - legacy_prefix: elm_index_item; - eo_prefix: elm_obj_index_item; - methods { - @property selected { - set { - [[Set the selected state of an 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 get with function - elm_index_selected_item_get(). - - Selected items will be highlighted.]] - } - values { - selected: bool; [[$true if selected, $false otherwise]] - } - } - @property priority { - set { - [[Sets the priority of an item. - - The priority is -1 by default, which means that the item doesn't belong to a group. - The value of the priority starts from 0. - - In elm_index_level_go, the items are sorted in ascending order according to priority. - Items of the same priority make a group and the primary group is shown by default.]] - } - values { - priority: int; [[The priority]] - } - } - letter_get @const { - [[Get the letter (string) set on a given index widget item.]] - return: string; [[The letter string set on $item]] - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Elm.Widget.Item.access_register; - Efl.Access.Object.i18n_name { get; } - Efl.Access.Widget.Action.elm_actions { get; } - } -} diff --git a/src/lib/elementary/elm_index_item_eo.c b/src/lib/elementary/elm_index_item_eo.c new file mode 100644 index 0000000000..7ec46c3c60 --- /dev/null +++ b/src/lib/elementary/elm_index_item_eo.c @@ -0,0 +1,109 @@ + +void _elm_index_item_selected_set(Eo *obj, Elm_Index_Item_Data *pd, Eina_Bool selected); + + +static Eina_Error +__eolian_elm_index_item_selected_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_index_item_selected_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_index_item_selected_set, EFL_FUNC_CALL(selected), Eina_Bool selected); + +void _elm_index_item_priority_set(Eo *obj, Elm_Index_Item_Data *pd, int priority); + + +static Eina_Error +__eolian_elm_index_item_priority_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_index_item_priority_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_index_item_priority_set, EFL_FUNC_CALL(priority), int priority); + +const char *_elm_index_item_letter_get(const Eo *obj, Elm_Index_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_index_item_letter_get, const char *, NULL); + +Efl_Object *_elm_index_item_efl_object_constructor(Eo *obj, Elm_Index_Item_Data *pd); + + +void _elm_index_item_efl_object_destructor(Eo *obj, Elm_Index_Item_Data *pd); + + +Efl_Canvas_Object *_elm_index_item_elm_widget_item_access_register(Eo *obj, Elm_Index_Item_Data *pd); + + +const char *_elm_index_item_efl_access_object_i18n_name_get(const Eo *obj, Elm_Index_Item_Data *pd); + + +const Efl_Access_Action_Data *_elm_index_item_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Index_Item_Data *pd); + + +static Eina_Bool +_elm_index_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_INDEX_ITEM_EXTRA_OPS +#define ELM_INDEX_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_index_item_selected_set, _elm_index_item_selected_set), + EFL_OBJECT_OP_FUNC(elm_obj_index_item_priority_set, _elm_index_item_priority_set), + EFL_OBJECT_OP_FUNC(elm_obj_index_item_letter_get, _elm_index_item_letter_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_index_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_index_item_efl_object_destructor), + EFL_OBJECT_OP_FUNC(elm_wdg_item_access_register, _elm_index_item_elm_widget_item_access_register), + EFL_OBJECT_OP_FUNC(efl_access_object_i18n_name_get, _elm_index_item_efl_access_object_i18n_name_get), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_index_item_efl_access_widget_action_elm_actions_get), + ELM_INDEX_ITEM_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"selected", __eolian_elm_index_item_selected_set_reflect, NULL}, + {"priority", __eolian_elm_index_item_priority_set_reflect, NULL}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_index_item_class_desc = { + EO_VERSION, + "Elm.Index.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Index_Item_Data), + _elm_index_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_index_item_class_get, &_elm_index_item_class_desc, ELM_WIDGET_ITEM_CLASS, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_index_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_index_item_eo.h b/src/lib/elementary/elm_index_item_eo.h new file mode 100644 index 0000000000..39c8a9e0be --- /dev/null +++ b/src/lib/elementary/elm_index_item_eo.h @@ -0,0 +1,71 @@ +#ifndef _ELM_INDEX_ITEM_EO_H_ +#define _ELM_INDEX_ITEM_EO_H_ + +#ifndef _ELM_INDEX_ITEM_EO_CLASS_TYPE +#define _ELM_INDEX_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Index_Item; + +#endif + +#ifndef _ELM_INDEX_ITEM_EO_TYPES +#define _ELM_INDEX_ITEM_EO_TYPES + + +#endif +/** Elementary index item class + * + * @ingroup Elm_Index_Item + */ +#define ELM_INDEX_ITEM_CLASS elm_index_item_class_get() + +EWAPI const Efl_Class *elm_index_item_class_get(void); + +/** + * @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 + * elm_index_selected_item_get(). + * + * Selected items will be highlighted. + * + * @param[in] obj The object. + * @param[in] selected @c true if selected, @c false otherwise + * + * @ingroup Elm_Index_Item + */ +EOAPI void elm_obj_index_item_selected_set(Eo *obj, Eina_Bool selected); + +/** + * @brief Sets the priority of an item. + * + * The priority is -1 by default, which means that the item doesn't belong to a + * group. The value of the priority starts from 0. + * + * In elm_index_level_go, the items are sorted in ascending order according to + * priority. Items of the same priority make a group and the primary group is + * shown by default. + * + * @param[in] obj The object. + * @param[in] priority The priority + * + * @ingroup Elm_Index_Item + */ +EOAPI void elm_obj_index_item_priority_set(Eo *obj, int priority); + +/** + * @brief Get the letter (string) set on a given index widget item. + * + * @param[in] obj The object. + * + * @return The letter string set on @c item + * + * @ingroup Elm_Index_Item + */ +EOAPI const char *elm_obj_index_item_letter_get(const Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_index_item_eo.legacy.c b/src/lib/elementary/elm_index_item_eo.legacy.c new file mode 100644 index 0000000000..27ac98c50d --- /dev/null +++ b/src/lib/elementary/elm_index_item_eo.legacy.c @@ -0,0 +1,18 @@ + +EAPI void +elm_index_item_selected_set(Elm_Index_Item *obj, Eina_Bool selected) +{ + elm_obj_index_item_selected_set(obj, selected); +} + +EAPI void +elm_index_item_priority_set(Elm_Index_Item *obj, int priority) +{ + elm_obj_index_item_priority_set(obj, priority); +} + +EAPI const char * +elm_index_item_letter_get(const Elm_Index_Item *obj) +{ + return elm_obj_index_item_letter_get(obj); +} diff --git a/src/lib/elementary/elm_index_item_eo.legacy.h b/src/lib/elementary/elm_index_item_eo.legacy.h new file mode 100644 index 0000000000..d4286f7cef --- /dev/null +++ b/src/lib/elementary/elm_index_item_eo.legacy.h @@ -0,0 +1,64 @@ +#ifndef _ELM_INDEX_ITEM_EO_LEGACY_H_ +#define _ELM_INDEX_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_INDEX_ITEM_EO_CLASS_TYPE +#define _ELM_INDEX_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Index_Item; + +#endif + +#ifndef _ELM_INDEX_ITEM_EO_TYPES +#define _ELM_INDEX_ITEM_EO_TYPES + + +#endif + +/** + * @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 + * elm_index_selected_item_get(). + * + * Selected items will be highlighted. + * + * @param[in] obj The object. + * @param[in] selected @c true if selected, @c false otherwise + * + * @ingroup Elm_Index_Item_Group + */ +EAPI void elm_index_item_selected_set(Elm_Index_Item *obj, Eina_Bool selected); + +/** + * @brief Sets the priority of an item. + * + * The priority is -1 by default, which means that the item doesn't belong to a + * group. The value of the priority starts from 0. + * + * In elm_index_level_go, the items are sorted in ascending order according to + * priority. Items of the same priority make a group and the primary group is + * shown by default. + * + * @param[in] obj The object. + * @param[in] priority The priority + * + * @ingroup Elm_Index_Item_Group + */ +EAPI void elm_index_item_priority_set(Elm_Index_Item *obj, int priority); + +/** + * @brief Get the letter (string) set on a given index widget item. + * + * @param[in] obj The object. + * + * @return The letter string set on @c item + * + * @ingroup Elm_Index_Item_Group + */ +EAPI const char *elm_index_item_letter_get(const Elm_Index_Item *obj); + +#endif diff --git a/src/lib/elementary/elm_index_legacy.h b/src/lib/elementary/elm_index_legacy.h index 74a7e5c757..7f8e7df2eb 100644 --- a/src/lib/elementary/elm_index_legacy.h +++ b/src/lib/elementary/elm_index_legacy.h @@ -43,5 +43,5 @@ EAPI void elm_index_horizontal_set(Evas_Object *obj, Eina_Bool horizontal); */ EAPI Eina_Bool elm_index_horizontal_get(const Evas_Object *obj); -#include "elm_index_item.eo.legacy.h" -#include "elm_index.eo.legacy.h" +#include "elm_index_item_eo.legacy.h" +#include "elm_index_eo.legacy.h" diff --git a/src/lib/elementary/elm_interface_fileselector.c b/src/lib/elementary/elm_interface_fileselector.c index 091911100a..98d6552c70 100644 --- a/src/lib/elementary/elm_interface_fileselector.c +++ b/src/lib/elementary/elm_interface_fileselector.c @@ -2,11 +2,11 @@ # include "elementary_config.h" #endif -#define ELM_INTERFACE_FILESELECTOR_BETA -#include +#include "elm_priv.h" #include "Eio_Eo.h" #include "elm_interface_fileselector.h" -#include "elm_interface_fileselector.eo.c" +#include "elm_interface_fileselector_eo.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 deleted file mode 100644 index 8721c45a2e..0000000000 --- a/src/lib/elementary/elm_interface_fileselector.eo +++ /dev/null @@ -1,173 +0,0 @@ -type Elm_Fileselector_Filter_Func: __undefined_type; [[Elementary fileselector filter function type]] - -enum Elm.Fileselector.Mode -{ - [[Defines how a file selector widget is to layout its contents - (file system entries). - ]] - legacy: elm_fileselector; - list = 0, [[Layout as a list.]] - grid, [[Layout as a grid.]] - last [[Sentinel value to indicate last enum field during iteration]] -} - -enum Elm.Fileselector.Sort -{ - [[Fileselector sorting modes]] - by_filename_asc = 0, [[Alphabetical sort by ascending filename, default]] - by_filename_desc, [[Alphabetical sorting by descending filename]] - by_type_asc, [[Sort by file type]] - by_type_desc, [[Sort by file type description]] - by_size_asc, [[Sort by ascending file size]] - by_size_desc, [[Sort by descending file size]] - by_modified_asc, [[Sort by ascending modified date]] - by_modified_desc, [[Sort by descending modified date]] - last [[Sentinel value to indicate last enum field during iteration]] -} - -interface Elm.Interface.Fileselector extends Efl.Ui.View -{ - [[Elementary fileselector interface]] - eo_prefix: elm_interface_fileselector; - methods { - @property folder_only { - set { - [[Enable/disable folder-only view for a given file selector widget]] - } - get { - [[Get whether folder-only view is set for a given file selector]] - } - values { - only: bool; [[$true if folder view is set, $false otherwise]] - } - } - @property thumbnail_size { - set { - [[Set the size for the thumbnail of the file selector widget's view.]] - } - get { - [[Get the size for the thumbnail of a given file selector widget]] - } - values { - w: int; [[Width]] - h: int; [[Height]] - } - } - @property hidden_visible { - set { - [[Enable or disable visibility of hidden files/directories in the file selector widget.]] - } - get { - [[Get if hiden files/directories in the file selector are visible or not.]] - } - values { - hidden: bool; [[$true if hidden files are visible, $false otherwise]] - } - } - @property sort_method { - set { - [[Set the sort method of the file selector widget.]] - } - get { - [[Get the sort method of the file selector widget.]] - } - values { - sort: Elm.Fileselector.Sort; [[Sort method]] - } - } - @property multi_select { - set { - [[Enable or disable multi-selection in the fileselector]] - } - get { - [[Gets if multi-selection in fileselector is enabled or disabled.]] - } - values { - multi: bool; [[$true if multiselection is enabled, $false otherwise]] - } - } - @property expandable { - set { - [[Enable/disable a tree view in the given file selector widget, if it's in]] - } - get { - [[Get whether tree view is enabled for the given file selector]] - } - values { - expand: bool; [[$true if tree view is expanded, $false otherwise]] - } - } - @property mode { - set { - [[Set the mode in which a given file selector widget will display (layout) file system entries in its view]] - } - get { - [[Get the mode in which a given file selector widget is displaying]] - } - values { - mode: Elm.Fileselector.Mode; [[Fileselector mode]] - } - } - @property is_save { - set { - [[Enable/disable the file name entry box where the user can type in a name for a file, in a given file selector widget]] - } - get { - [[Get whether the given file selector is in "saving dialog" mode]] - } - values { - is_save: bool; [[$true if in saving mode, $false otherwise]] - } - } - @property selected_models { - get { - [[Get a list of models selected in the fileselector.]] - } - values { - ret: const(list); [[List of selected models]] - } - } - @property current_name { - [[ Current name property]] - set { - } - get { - } - values { - name: string; [[Name]] - } - } - @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.]] - } - } - custom_filter_append { - [[Append custom filter into filter list]] - params { - @in func: Elm_Fileselector_Filter_Func; [[Filter function]] - @in data: void_ptr; [[Data pointer]] - @in filter_name: string; [[Filter name]] - } - return: bool; [[$true on success, $false otherwise]] - } - filters_clear { - [[Clear all filters registered]] - } - mime_types_filter_append { - [[Append mime type based filter into filter list]] - params { - @in mime_types: string; [[Mime types]] - @in filter_name: string; [[Filter name]] - } - return: bool; [[$true on success, $false otherwise]] - } - } -} diff --git a/src/lib/elementary/elm_interface_fileselector.h b/src/lib/elementary/elm_interface_fileselector.h index 3938e113b6..82de538c6f 100644 --- a/src/lib/elementary/elm_interface_fileselector.h +++ b/src/lib/elementary/elm_interface_fileselector.h @@ -1,11 +1,8 @@ #ifndef ELM_INTEFARCE_FILESELECTOR_H #define ELM_INTEFARCE_FILESELECTOR_H -#ifdef EFL_EO_API_SUPPORT -#include "elm_interface_fileselector.eo.h" -#endif #ifndef EFL_NOLEGACY_API_SUPPORT -#include "elm_interface_fileselector.eo.legacy.h" +#include "elm_interface_fileselector_eo.legacy.h" #endif #define ELM_FILESELECTOR_INTERFACE_CHECK(obj, ...) \ @@ -63,9 +60,9 @@ _elm_fileselector_button_selected_paths_get_internal(const Evas_Object *obj); void -_event_to_legacy_call(Eo *obj, const Efl_Event_Description *evt_desc, void *event_info); +_event_to_legacy_call(Eo *obj, const char *evt, void *event_info); void -_model_event_call(Eo *obj, const Efl_Event_Description *evt_desc, Efl_Model *model, const char *path); +_model_event_call(Eo *obj, const Efl_Event_Description *evt_desc, const char *legacy_evt, Efl_Model *model, const char *path); #endif diff --git a/src/lib/elementary/elm_interface_fileselector_eo.c b/src/lib/elementary/elm_interface_fileselector_eo.c new file mode 100644 index 0000000000..1f6636b664 --- /dev/null +++ b/src/lib/elementary/elm_interface_fileselector_eo.c @@ -0,0 +1,236 @@ + +static Eina_Error +__eolian_elm_interface_fileselector_folder_only_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_interface_fileselector_folder_only_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_interface_fileselector_folder_only_set, EFL_FUNC_CALL(only), Eina_Bool only); + +static Eina_Value +__eolian_elm_interface_fileselector_folder_only_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_interface_fileselector_folder_only_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_interface_fileselector_folder_only_get, Eina_Bool, 0); +EOAPI EFL_VOID_FUNC_BODYV(elm_interface_fileselector_thumbnail_size_set, EFL_FUNC_CALL(w, h), int w, int h); +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_interface_fileselector_thumbnail_size_get, EFL_FUNC_CALL(w, h), int *w, int *h); + +static Eina_Error +__eolian_elm_interface_fileselector_hidden_visible_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_interface_fileselector_hidden_visible_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_interface_fileselector_hidden_visible_set, EFL_FUNC_CALL(hidden), Eina_Bool hidden); + +static Eina_Value +__eolian_elm_interface_fileselector_hidden_visible_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_interface_fileselector_hidden_visible_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_interface_fileselector_hidden_visible_get, Eina_Bool, 0); +EOAPI EFL_VOID_FUNC_BODYV(elm_interface_fileselector_sort_method_set, EFL_FUNC_CALL(sort), Elm_Fileselector_Sort sort); +EOAPI EFL_FUNC_BODY_CONST(elm_interface_fileselector_sort_method_get, Elm_Fileselector_Sort, 0); + +static Eina_Error +__eolian_elm_interface_fileselector_multi_select_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_interface_fileselector_multi_select_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_interface_fileselector_multi_select_set, EFL_FUNC_CALL(multi), Eina_Bool multi); + +static Eina_Value +__eolian_elm_interface_fileselector_multi_select_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_interface_fileselector_multi_select_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_interface_fileselector_multi_select_get, Eina_Bool, 0); + +static Eina_Error +__eolian_elm_interface_fileselector_expandable_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_interface_fileselector_expandable_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_interface_fileselector_expandable_set, EFL_FUNC_CALL(expand), Eina_Bool expand); + +static Eina_Value +__eolian_elm_interface_fileselector_expandable_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_interface_fileselector_expandable_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_interface_fileselector_expandable_get, Eina_Bool, 0); +EOAPI EFL_VOID_FUNC_BODYV(elm_interface_fileselector_mode_set, EFL_FUNC_CALL(mode), Elm_Fileselector_Mode mode); +EOAPI EFL_FUNC_BODY_CONST(elm_interface_fileselector_mode_get, Elm_Fileselector_Mode, 0); + +static Eina_Error +__eolian_elm_interface_fileselector_is_save_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_interface_fileselector_is_save_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_interface_fileselector_is_save_set, EFL_FUNC_CALL(is_save), Eina_Bool is_save); + +static Eina_Value +__eolian_elm_interface_fileselector_is_save_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_interface_fileselector_is_save_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_interface_fileselector_is_save_get, Eina_Bool, 0); +EOAPI EFL_FUNC_BODY_CONST(elm_interface_fileselector_selected_models_get, const Eina_List *, NULL); + +static Eina_Error +__eolian_elm_interface_fileselector_current_name_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_interface_fileselector_current_name_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_interface_fileselector_current_name_set, EFL_FUNC_CALL(name), const char *name); + +static Eina_Value +__eolian_elm_interface_fileselector_current_name_get_reflect(const Eo *obj) +{ + const char *val = elm_interface_fileselector_current_name_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_interface_fileselector_current_name_get, const char *, NULL); +EOAPI EFL_FUNC_BODYV(elm_interface_fileselector_selected_model_set, Eina_Bool, 0, EFL_FUNC_CALL(model), Efl_Io_Model *model); +EOAPI EFL_FUNC_BODY_CONST(elm_interface_fileselector_selected_model_get, Efl_Io_Model *, NULL); +EOAPI EFL_FUNC_BODYV(elm_interface_fileselector_custom_filter_append, Eina_Bool, 0, EFL_FUNC_CALL(func, data, filter_name), Elm_Fileselector_Filter_Func func, void *data, const char *filter_name); +EOAPI EFL_VOID_FUNC_BODY(elm_interface_fileselector_filters_clear); +EOAPI EFL_FUNC_BODYV(elm_interface_fileselector_mime_types_filter_append, Eina_Bool, 0, EFL_FUNC_CALL(mime_types, filter_name), const char *mime_types, const char *filter_name); + +static Eina_Bool +_elm_interface_fileselector_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_INTERFACE_FILESELECTOR_EXTRA_OPS +#define ELM_INTERFACE_FILESELECTOR_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_folder_only_set, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_folder_only_get, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_thumbnail_size_set, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_thumbnail_size_get, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_hidden_visible_set, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_hidden_visible_get, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_sort_method_set, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_sort_method_get, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_multi_select_set, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_multi_select_get, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_expandable_set, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_expandable_get, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_mode_set, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_mode_get, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_is_save_set, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_is_save_get, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_selected_models_get, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_current_name_set, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_current_name_get, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_selected_model_set, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_selected_model_get, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_custom_filter_append, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_filters_clear, NULL), + EFL_OBJECT_OP_FUNC(elm_interface_fileselector_mime_types_filter_append, NULL), + ELM_INTERFACE_FILESELECTOR_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"folder_only", __eolian_elm_interface_fileselector_folder_only_set_reflect, __eolian_elm_interface_fileselector_folder_only_get_reflect}, + {"hidden_visible", __eolian_elm_interface_fileselector_hidden_visible_set_reflect, __eolian_elm_interface_fileselector_hidden_visible_get_reflect}, + {"multi_select", __eolian_elm_interface_fileselector_multi_select_set_reflect, __eolian_elm_interface_fileselector_multi_select_get_reflect}, + {"expandable", __eolian_elm_interface_fileselector_expandable_set_reflect, __eolian_elm_interface_fileselector_expandable_get_reflect}, + {"is_save", __eolian_elm_interface_fileselector_is_save_set_reflect, __eolian_elm_interface_fileselector_is_save_get_reflect}, + {"current_name", __eolian_elm_interface_fileselector_current_name_set_reflect, __eolian_elm_interface_fileselector_current_name_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_interface_fileselector_class_desc = { + EO_VERSION, + "Elm.Interface.Fileselector", + EFL_CLASS_TYPE_INTERFACE, + 0, + _elm_interface_fileselector_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_interface_fileselector_interface_get, &_elm_interface_fileselector_class_desc, NULL, EFL_UI_VIEW_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_interface_fileselector_eo.h b/src/lib/elementary/elm_interface_fileselector_eo.h new file mode 100644 index 0000000000..f0996f18ae --- /dev/null +++ b/src/lib/elementary/elm_interface_fileselector_eo.h @@ -0,0 +1,326 @@ +#ifndef _ELM_INTERFACE_FILESELECTOR_EO_H_ +#define _ELM_INTERFACE_FILESELECTOR_EO_H_ + +#ifndef _ELM_INTERFACE_FILESELECTOR_EO_CLASS_TYPE +#define _ELM_INTERFACE_FILESELECTOR_EO_CLASS_TYPE + +typedef Eo Elm_Interface_Fileselector; + +#endif + +#ifndef _ELM_INTERFACE_FILESELECTOR_EO_TYPES +#define _ELM_INTERFACE_FILESELECTOR_EO_TYPES + +/** Defines how a file selector widget is to layout its contents (file system + * entries). + * + * @ingroup Elm_Fileselector + */ +typedef enum +{ + ELM_FILESELECTOR_LIST = 0, /**< Layout as a list. */ + ELM_FILESELECTOR_GRID, /**< Layout as a grid. */ + ELM_FILESELECTOR_LAST /**< Sentinel value to indicate last enum field during + * iteration */ +} Elm_Fileselector_Mode; + +/** Fileselector sorting modes + * + * @ingroup Elm_Fileselector + */ +typedef enum +{ + ELM_FILESELECTOR_SORT_BY_FILENAME_ASC = 0, /**< Alphabetical sort by ascending + * filename, default */ + ELM_FILESELECTOR_SORT_BY_FILENAME_DESC, /**< Alphabetical sorting by + * descending filename */ + ELM_FILESELECTOR_SORT_BY_TYPE_ASC, /**< Sort by file type */ + ELM_FILESELECTOR_SORT_BY_TYPE_DESC, /**< Sort by file type description */ + ELM_FILESELECTOR_SORT_BY_SIZE_ASC, /**< Sort by ascending file size */ + ELM_FILESELECTOR_SORT_BY_SIZE_DESC, /**< Sort by descending file size */ + ELM_FILESELECTOR_SORT_BY_MODIFIED_ASC, /**< Sort by ascending modified date */ + ELM_FILESELECTOR_SORT_BY_MODIFIED_DESC, /**< Sort by descending modified date + */ + ELM_FILESELECTOR_SORT_LAST /**< Sentinel value to indicate last enum field + * during iteration */ +} Elm_Fileselector_Sort; + + +#endif +/** Elementary fileselector interface + * + * @ingroup Elm_Interface_Fileselector + */ +#define ELM_INTERFACE_FILESELECTOR_INTERFACE elm_interface_fileselector_interface_get() + +EWAPI const Efl_Class *elm_interface_fileselector_interface_get(void); + +/** + * @brief Enable/disable folder-only view for a given file selector widget + * + * @param[in] obj The object. + * @param[in] only @c true if folder view is set, @c false otherwise + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI void elm_interface_fileselector_folder_only_set(Eo *obj, Eina_Bool only); + +/** + * @brief Get whether folder-only view is set for a given file selector + * + * @param[in] obj The object. + * + * @return @c true if folder view is set, @c false otherwise + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI Eina_Bool elm_interface_fileselector_folder_only_get(const Eo *obj); + +/** + * @brief Set the size for the thumbnail of the file selector widget's view. + * + * @param[in] obj The object. + * @param[in] w Width + * @param[in] h Height + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI void elm_interface_fileselector_thumbnail_size_set(Eo *obj, int w, int h); + +/** + * @brief Get the size for the thumbnail of a given file selector widget + * + * @param[in] obj The object. + * @param[out] w Width + * @param[out] h Height + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI void elm_interface_fileselector_thumbnail_size_get(const Eo *obj, int *w, int *h); + +/** + * @brief Enable or disable visibility of hidden files/directories in the file + * selector widget. + * + * @param[in] obj The object. + * @param[in] hidden @c true if hidden files are visible, @c false otherwise + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI void elm_interface_fileselector_hidden_visible_set(Eo *obj, Eina_Bool hidden); + +/** + * @brief Get if hiden files/directories in the file selector are visible or + * not. + * + * @param[in] obj The object. + * + * @return @c true if hidden files are visible, @c false otherwise + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI Eina_Bool elm_interface_fileselector_hidden_visible_get(const Eo *obj); + +/** + * @brief Set the sort method of the file selector widget. + * + * @param[in] obj The object. + * @param[in] sort Sort method + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI void elm_interface_fileselector_sort_method_set(Eo *obj, Elm_Fileselector_Sort sort); + +/** + * @brief Get the sort method of the file selector widget. + * + * @param[in] obj The object. + * + * @return Sort method + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI Elm_Fileselector_Sort elm_interface_fileselector_sort_method_get(const Eo *obj); + +/** + * @brief Enable or disable multi-selection in the fileselector + * + * @param[in] obj The object. + * @param[in] multi @c true if multiselection is enabled, @c false otherwise + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI void elm_interface_fileselector_multi_select_set(Eo *obj, Eina_Bool multi); + +/** + * @brief Gets if multi-selection in fileselector is enabled or disabled. + * + * @param[in] obj The object. + * + * @return @c true if multiselection is enabled, @c false otherwise + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI Eina_Bool elm_interface_fileselector_multi_select_get(const Eo *obj); + +/** + * @brief Enable/disable a tree view in the given file selector widget, if + * it's in + * + * @param[in] obj The object. + * @param[in] expand @c true if tree view is expanded, @c false otherwise + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI void elm_interface_fileselector_expandable_set(Eo *obj, Eina_Bool expand); + +/** + * @brief Get whether tree view is enabled for the given file selector + * + * @param[in] obj The object. + * + * @return @c true if tree view is expanded, @c false otherwise + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI Eina_Bool elm_interface_fileselector_expandable_get(const Eo *obj); + +/** + * @brief Set the mode in which a given file selector widget will display + * (layout) file system entries in its view + * + * @param[in] obj The object. + * @param[in] mode Fileselector mode + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI void elm_interface_fileselector_mode_set(Eo *obj, Elm_Fileselector_Mode mode); + +/** + * @brief Get the mode in which a given file selector widget is displaying + * + * @param[in] obj The object. + * + * @return Fileselector mode + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI Elm_Fileselector_Mode elm_interface_fileselector_mode_get(const Eo *obj); + +/** + * @brief Enable/disable the file name entry box where the user can type in a + * name for a file, in a given file selector widget + * + * @param[in] obj The object. + * @param[in] is_save @c true if in saving mode, @c false otherwise + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI void elm_interface_fileselector_is_save_set(Eo *obj, Eina_Bool is_save); + +/** + * @brief Get whether the given file selector is in "saving dialog" mode + * + * @param[in] obj The object. + * + * @return @c true if in saving mode, @c false otherwise + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI Eina_Bool elm_interface_fileselector_is_save_get(const Eo *obj); + +/** + * @brief Get a list of models selected in the fileselector. + * + * @param[in] obj The object. + * + * @return List of selected models + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI const Eina_List *elm_interface_fileselector_selected_models_get(const Eo *obj); + +/** + * @brief The filename that will be displayed in the filename entry + * + * @param[in] obj The object. + * @param[in] name Name + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI void elm_interface_fileselector_current_name_set(Eo *obj, const char *name); + +/** + * @brief The filename that will be displayed in the filename entry + * + * @param[in] obj The object. + * + * @return Name + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI const char *elm_interface_fileselector_current_name_get(const Eo *obj); + +#ifdef EFL_BETA_API_SUPPORT +/** + * @brief Set, programmatically, the currently selected file/directory in the + * given file selector widget + * + * @param[in] obj The object. + * @param[in] model Model to be set, NULL reset it. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI Eina_Bool elm_interface_fileselector_selected_model_set(Eo *obj, Efl_Io_Model *model); +#endif /* EFL_BETA_API_SUPPORT */ + +#ifdef EFL_BETA_API_SUPPORT +/** + * @brief Get the currently selected item's model, in the given file the given + * file selector widget + * + * @param[in] obj The object. + * + * @return Model to be set, NULL reset it. + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI Efl_Io_Model *elm_interface_fileselector_selected_model_get(const Eo *obj); +#endif /* EFL_BETA_API_SUPPORT */ + +/** + * @brief Append custom filter into filter list + * + * @param[in] obj The object. + * @param[in] func Filter function + * @param[in] data Data pointer + * @param[in] filter_name Filter name + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI Eina_Bool elm_interface_fileselector_custom_filter_append(Eo *obj, Elm_Fileselector_Filter_Func func, void *data, const char *filter_name); + +/** Clear all filters registered + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI void elm_interface_fileselector_filters_clear(Eo *obj); + +/** + * @brief Append mime type based filter into filter list + * + * @param[in] obj The object. + * @param[in] mime_types Mime types + * @param[in] filter_name Filter name + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Interface_Fileselector + */ +EOAPI Eina_Bool elm_interface_fileselector_mime_types_filter_append(Eo *obj, const char *mime_types, const char *filter_name); + +#endif diff --git a/src/lib/elementary/elm_interface_fileselector_eo.legacy.h b/src/lib/elementary/elm_interface_fileselector_eo.legacy.h new file mode 100644 index 0000000000..31c7a45dc2 --- /dev/null +++ b/src/lib/elementary/elm_interface_fileselector_eo.legacy.h @@ -0,0 +1,73 @@ +#ifndef _ELM_INTERFACE_FILESELECTOR_EO_LEGACY_H_ +#define _ELM_INTERFACE_FILESELECTOR_EO_LEGACY_H_ + +#ifndef _ELM_INTERFACE_FILESELECTOR_EO_CLASS_TYPE +#define _ELM_INTERFACE_FILESELECTOR_EO_CLASS_TYPE + +typedef Eo Elm_Interface_Fileselector; + +#endif + +#ifndef _ELM_INTERFACE_FILESELECTOR_EO_TYPES +#define _ELM_INTERFACE_FILESELECTOR_EO_TYPES + +/** Defines how a file selector widget is to layout its contents (file system + * entries). + * + * @ingroup Elm_Fileselector + */ +typedef enum +{ + ELM_FILESELECTOR_LIST = 0, /**< Layout as a list. */ + ELM_FILESELECTOR_GRID, /**< Layout as a grid. */ + ELM_FILESELECTOR_LAST /**< Sentinel value to indicate last enum field during + * iteration */ +} Elm_Fileselector_Mode; + +/** Fileselector sorting modes + * + * @ingroup Elm_Fileselector + */ +typedef enum +{ + ELM_FILESELECTOR_SORT_BY_FILENAME_ASC = 0, /**< Alphabetical sort by ascending + * filename, default */ + ELM_FILESELECTOR_SORT_BY_FILENAME_DESC, /**< Alphabetical sorting by + * descending filename */ + ELM_FILESELECTOR_SORT_BY_TYPE_ASC, /**< Sort by file type */ + ELM_FILESELECTOR_SORT_BY_TYPE_DESC, /**< Sort by file type description */ + ELM_FILESELECTOR_SORT_BY_SIZE_ASC, /**< Sort by ascending file size */ + ELM_FILESELECTOR_SORT_BY_SIZE_DESC, /**< Sort by descending file size */ + ELM_FILESELECTOR_SORT_BY_MODIFIED_ASC, /**< Sort by ascending modified date */ + ELM_FILESELECTOR_SORT_BY_MODIFIED_DESC, /**< Sort by descending modified date + */ + ELM_FILESELECTOR_SORT_LAST /**< Sentinel value to indicate last enum field + * during iteration */ +} Elm_Fileselector_Sort; + + +#endif + + + + + + + + + + + + + + + + + + + + + + + +#endif diff --git a/src/lib/elementary/elm_interface_scrollable.c b/src/lib/elementary/elm_interface_scrollable.c index ccd0df348d..6ac896e242 100644 --- a/src/lib/elementary/elm_interface_scrollable.c +++ b/src/lib/elementary/elm_interface_scrollable.c @@ -8,6 +8,7 @@ #include "elm_priv.h" #include "elm_interface_scrollable.h" +#include "elm_pan_eo.h" #define MY_PAN_CLASS ELM_PAN_CLASS @@ -33,12 +34,12 @@ } #define ELM_ANIMATOR_CONNECT(Obj, Bool, Callback, Data) \ - efl_event_callback_del(Obj, EFL_EVENT_ANIMATOR_TICK, Callback, Data); \ - efl_event_callback_add(Obj, EFL_EVENT_ANIMATOR_TICK, Callback, Data); \ + efl_event_callback_del(Obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, Callback, Data); \ + efl_event_callback_add(Obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, Callback, Data); \ Bool = 1; #define ELM_ANIMATOR_DISCONNECT(Obj, Bool, Callback, Data) \ - efl_event_callback_del(Obj, EFL_EVENT_ANIMATOR_TICK, Callback, Data); \ + efl_event_callback_del(Obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, Callback, Data); \ Bool = 0; #ifndef CLAMP @@ -4972,4 +4973,4 @@ _elm_interface_scrollable_item_loop_enabled_get(const Eo *obj EINA_UNUSED, Elm_S EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_interface_scrollable) #include "elm_interface_scrollable.eo.c" -#include "elm_pan.eo.c" +#include "elm_pan_eo.c" diff --git a/src/lib/elementary/elm_interface_scrollable.eo b/src/lib/elementary/elm_interface_scrollable.eo index 3d81d15d3f..6fc578882d 100644 --- a/src/lib/elementary/elm_interface_scrollable.eo +++ b/src/lib/elementary/elm_interface_scrollable.eo @@ -27,7 +27,7 @@ enum Elm.Scroller.Single_Direction last [[Sentinel value to indicate last enum field during iteration]] } -mixin Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrollable, Efl.Ui.Focus.Manager_Sub, Efl.Ui.Widget_Focus_Manager +mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrollable, Efl.Ui.Focus.Manager_Sub, Efl.Ui.Widget_Focus_Manager { [[Elm scrollable mixin]] eo_prefix: elm_interface_scrollable; @@ -42,7 +42,7 @@ mixin Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrollable, The scroller will adjust the view to glue itself as follows. x=0.0, for staying where it is relative to the left edge of the content - x=1.0, for staying where it is relative to the rigth edge of the content + x=1.0, for staying where it is relative to the right edge of the content y=0.0, for staying where it is relative to the top edge of the content y=1.0, for staying where it is relative to the bottom edge of the content @@ -216,8 +216,7 @@ mixin Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrollable, Note: If $obj is not set to have pages, nothing will happen after this call. - - @since 1.8]] + ]] set { } get { @@ -251,8 +250,7 @@ mixin Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrollable, such as the movement angle. If the user scrolls roughly in one direction only, it will only move according to it while if the move was clearly wanted on both axes, it will happen on both of them. - - @since 1.8]] + ]] set { } get { @@ -274,8 +272,7 @@ mixin Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrollable, } @property content_loop { [[Controls an infinite loop for a scroller. - - @since 1.14]] + ]] set { } get { diff --git a/src/lib/elementary/elm_interface_scrollable.h b/src/lib/elementary/elm_interface_scrollable.h index 4da12df41e..cf9806f501 100644 --- a/src/lib/elementary/elm_interface_scrollable.h +++ b/src/lib/elementary/elm_interface_scrollable.h @@ -31,11 +31,8 @@ * Elm_Scrollable_Smart_Interface::extern_pan_set. */ -#ifdef EFL_EO_API_SUPPORT -#include "elm_pan.eo.h" -#endif #ifndef EFL_NOLEGACY_API_SUPPORT -#include "elm_pan.eo.legacy.h" +#include "elm_pan_eo.legacy.h" #endif /** @@ -61,12 +58,7 @@ typedef void (*Elm_Interface_Scrollable_Resize_Cb)(Evas_Object *obj, Evas_C typedef struct _Elm_Scrollable_Smart_Interface_Data Elm_Scrollable_Smart_Interface_Data; -#ifdef EFL_EO_API_SUPPORT #include "elm_interface_scrollable.eo.h" -#endif -#ifndef EFL_NOLEGACY_API_SUPPORT -#include "elm_interface_scrollable.eo.legacy.h" -#endif struct _Elm_Scrollable_Smart_Interface_Data { @@ -250,7 +242,7 @@ struct _Elm_Scrollable_Smart_Interface_Data return __VA_ARGS__; \ } -#if defined(EFL_EO_API_SUPPORT) && defined(EFL_BETA_API_SUPPORT) +#ifdef EFL_BETA_API_SUPPORT EAPI void elm_pan_gravity_set(Elm_Pan *, double x, double) EINA_DEPRECATED; EAPI void elm_pan_gravity_get(const Elm_Pan *, double *, double *) EINA_DEPRECATED; #endif diff --git a/src/lib/elementary/elm_interfaces.h b/src/lib/elementary/elm_interfaces.h index bcbe8e646f..2c0f33a260 100644 --- a/src/lib/elementary/elm_interfaces.h +++ b/src/lib/elementary/elm_interfaces.h @@ -3,13 +3,7 @@ #include "efl_access_widget_action.h" #include "efl_access_window.h" -// FIXME FIXME FIXME -- Still required because of photocam -#ifdef EFL_EO_API_SUPPORT -# include "elm_interface_scrollable.h" -#endif - #ifdef EFL_BETA_API_SUPPORT -#ifdef EFL_EO_API_SUPPORT #include "efl_access_action.eo.h" #include "efl_access_component.eo.h" #include "efl_access_editable_text.eo.h" @@ -17,12 +11,3 @@ #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_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 110a614575..e50128027e 100644 --- a/src/lib/elementary/elm_inwin.c +++ b/src/lib/elementary/elm_inwin.c @@ -10,7 +10,7 @@ #include #include "elm_priv.h" -#include "elm_inwin.eo.h" +#include "elm_inwin_eo.h" #include "elm_widget_inwin.h" #include "elm_widget_layout.h" #include "elm_part_helper.h" @@ -46,7 +46,6 @@ EOLIAN static void _elm_inwin_efl_canvas_group_group_add(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_FALSE); elm_widget_highlight_ignore_set(obj, EINA_TRUE); @@ -57,14 +56,6 @@ _elm_inwin_efl_canvas_group_group_add(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED) CRI("Failed to set layout!"); } -EOLIAN static void -_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); - - elm_layout_sizing_eval(obj); -} - EAPI Evas_Object * elm_win_inwin_add(Evas_Object *parent) { @@ -86,6 +77,8 @@ _elm_inwin_efl_object_constructor(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED) } obj = efl_constructor(efl_super(obj, MY_CLASS)); + elm_win_resize_object_add(efl_parent_get(obj), obj); + elm_layout_sizing_eval(obj); efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_GLASS_PANE); @@ -141,4 +134,4 @@ ELM_PART_CONTENT_DEFAULT_IMPLEMENT(elm_inwin, Elm_Inwin_Data) EFL_CANVAS_GROUP_ADD_OPS(elm_inwin), \ ELM_LAYOUT_SIZING_EVAL_OPS(elm_inwin) -#include "elm_inwin.eo.c" +#include "elm_inwin_eo.c" diff --git a/src/lib/elementary/elm_inwin.eo b/src/lib/elementary/elm_inwin.eo deleted file mode 100644 index 594d1e5e7f..0000000000 --- a/src/lib/elementary/elm_inwin.eo +++ /dev/null @@ -1,28 +0,0 @@ -class Elm.Inwin extends Efl.Ui.Layout implements Efl.Ui.Focus.Layer, Efl.Content, Efl.Ui.Legacy -{ - [[Elementary inwin class]] - legacy_prefix: elm_inwin; - eo_prefix: elm_obj_win_inwin; - methods { - activate { - [[Activates an inwin object, ensuring its visibility - - This function will make sure that the inwin $obj is completely visible - by calling evas_object_show() and evas_object_raise() on it, to bring it - to the front. It also sets the keyboard focus to it, which will be passed - onto its content. - - The object's theme will also receive the signal "elm,action,show" with - source "elm".]] - - legacy: elm_win_inwin_activate; - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.widget_parent { set; } - Efl.Content.content { get; set; } - Efl.Content.content_unset; - } -} diff --git a/src/lib/elementary/elm_inwin_eo.c b/src/lib/elementary/elm_inwin_eo.c new file mode 100644 index 0000000000..887f9ee453 --- /dev/null +++ b/src/lib/elementary/elm_inwin_eo.c @@ -0,0 +1,54 @@ + +void _elm_inwin_activate(Eo *obj, Elm_Inwin_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_win_inwin_activate); + +Efl_Object *_elm_inwin_efl_object_constructor(Eo *obj, Elm_Inwin_Data *pd); + + +Eina_Bool _elm_inwin_efl_content_content_set(Eo *obj, Elm_Inwin_Data *pd, Efl_Gfx_Entity *content); + + +Efl_Gfx_Entity *_elm_inwin_efl_content_content_get(const Eo *obj, Elm_Inwin_Data *pd); + + +Efl_Gfx_Entity *_elm_inwin_efl_content_content_unset(Eo *obj, Elm_Inwin_Data *pd); + + +static Eina_Bool +_elm_inwin_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_INWIN_EXTRA_OPS +#define ELM_INWIN_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_win_inwin_activate, _elm_inwin_activate), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_inwin_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_content_set, _elm_inwin_efl_content_content_set), + EFL_OBJECT_OP_FUNC(efl_content_get, _elm_inwin_efl_content_content_get), + EFL_OBJECT_OP_FUNC(efl_content_unset, _elm_inwin_efl_content_content_unset), + ELM_INWIN_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_inwin_class_desc = { + EO_VERSION, + "Elm.Inwin", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Inwin_Data), + _elm_inwin_class_initializer, + _elm_inwin_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_inwin_class_get, &_elm_inwin_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_LAYER_MIXIN, EFL_CONTENT_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_inwin_eo.legacy.c" diff --git a/src/lib/elementary/elm_inwin_eo.h b/src/lib/elementary/elm_inwin_eo.h new file mode 100644 index 0000000000..cb6ad90fd7 --- /dev/null +++ b/src/lib/elementary/elm_inwin_eo.h @@ -0,0 +1,40 @@ +#ifndef _ELM_INWIN_EO_H_ +#define _ELM_INWIN_EO_H_ + +#ifndef _ELM_INWIN_EO_CLASS_TYPE +#define _ELM_INWIN_EO_CLASS_TYPE + +typedef Eo Elm_Inwin; + +#endif + +#ifndef _ELM_INWIN_EO_TYPES +#define _ELM_INWIN_EO_TYPES + + +#endif +/** Elementary inwin class + * + * @ingroup Elm_Inwin + */ +#define ELM_INWIN_CLASS elm_inwin_class_get() + +EWAPI const Efl_Class *elm_inwin_class_get(void); + +/** + * @brief Activates an inwin object, ensuring its visibility + * + * This function will make sure that the inwin @c obj is completely visible by + * calling evas_object_show() and evas_object_raise() on it, to bring it to the + * front. It also sets the keyboard focus to it, which will be passed onto its + * content. + * + * The object's theme will also receive the signal "elm,action,show" with + * source "elm". + * @param[in] obj The object. + * + * @ingroup Elm_Inwin + */ +EOAPI void elm_obj_win_inwin_activate(Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_inwin_eo.legacy.c b/src/lib/elementary/elm_inwin_eo.legacy.c new file mode 100644 index 0000000000..1f6b21296c --- /dev/null +++ b/src/lib/elementary/elm_inwin_eo.legacy.c @@ -0,0 +1,6 @@ + +EAPI void +elm_win_inwin_activate(Elm_Inwin *obj) +{ + elm_obj_win_inwin_activate(obj); +} diff --git a/src/lib/elementary/elm_inwin_eo.legacy.h b/src/lib/elementary/elm_inwin_eo.legacy.h new file mode 100644 index 0000000000..b0e4170d76 --- /dev/null +++ b/src/lib/elementary/elm_inwin_eo.legacy.h @@ -0,0 +1,33 @@ +#ifndef _ELM_INWIN_EO_LEGACY_H_ +#define _ELM_INWIN_EO_LEGACY_H_ + +#ifndef _ELM_INWIN_EO_CLASS_TYPE +#define _ELM_INWIN_EO_CLASS_TYPE + +typedef Eo Elm_Inwin; + +#endif + +#ifndef _ELM_INWIN_EO_TYPES +#define _ELM_INWIN_EO_TYPES + + +#endif + +/** + * @brief Activates an inwin object, ensuring its visibility + * + * This function will make sure that the inwin @c obj is completely visible by + * calling evas_object_show() and evas_object_raise() on it, to bring it to the + * front. It also sets the keyboard focus to it, which will be passed onto its + * content. + * + * The object's theme will also receive the signal "elm,action,show" with + * source "elm". + * @param[in] obj The object. + * + * @ingroup Elm_Inwin_Group + */ +EAPI void elm_win_inwin_activate(Elm_Inwin *obj); + +#endif diff --git a/src/lib/elementary/elm_inwin_legacy.h b/src/lib/elementary/elm_inwin_legacy.h index a085db0006..0f672e9886 100644 --- a/src/lib/elementary/elm_inwin_legacy.h +++ b/src/lib/elementary/elm_inwin_legacy.h @@ -63,4 +63,4 @@ EAPI Evas_Object *elm_win_inwin_content_get(const Evas_Object *obj); */ EAPI Evas_Object *elm_win_inwin_content_unset(Evas_Object *obj); -#include "elm_inwin.eo.legacy.h" +#include "elm_inwin_eo.legacy.h" diff --git a/src/lib/elementary/elm_label.c b/src/lib/elementary/elm_label.c index 51c367ad09..4468b72bd0 100644 --- a/src/lib/elementary/elm_label.c +++ b/src/lib/elementary/elm_label.c @@ -182,17 +182,17 @@ _elm_label_horizontal_size_policy_update(Eo *obj, Elm_Label_Data *sd) edje_object_message_signal_process(wd->resize_obj); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_label_efl_ui_widget_theme_apply(Eo *obj, Elm_Label_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); evas_event_freeze(evas_object_evas_get(obj)); int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _elm_label_horizontal_size_policy_update(obj, sd); @@ -380,8 +380,6 @@ _elm_label_efl_canvas_group_group_add(Eo *obj, Elm_Label_Data *priv) efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); - priv->linewrap = ELM_WRAP_NONE; priv->wrap_w = -1; priv->slide_duration = 10; @@ -632,4 +630,4 @@ ELM_PART_OVERRIDE_TEXT_SET(elm_label, ELM_LABEL, Elm_Label_Data) ELM_LAYOUT_SIZING_EVAL_OPS(elm_label), \ EFL_CANVAS_GROUP_ADD_OPS(elm_label) -#include "elm_label.eo.c" +#include "elm_label_eo.c" diff --git a/src/lib/elementary/elm_label.eo b/src/lib/elementary/elm_label.eo deleted file mode 100644 index f9e147db76..0000000000 --- a/src/lib/elementary/elm_label.eo +++ /dev/null @@ -1,133 +0,0 @@ -import elm_general; - -enum Elm.Label.Slide_Mode -{ - [[Slide mode of a label widget]] - none = 0, [[No slide effect.]] - auto, [[Slide only if the label area is bigger than the text width length.]] - always [[Slide always.]] -} - -class Elm.Label extends Efl.Ui.Layout implements Efl.Ui.Legacy -{ - [[Elementary label class]] - legacy_prefix: elm_label; - eo_prefix: elm_obj_label; - event_prefix: elm_label; - methods { - @property wrap_width { - [[Control wrap width of the label - - This function sets the maximum width size hint of the label. - - Warning: This is only relevant if the label is inside a container.]] - set { - } - get { - } - values { - w: int; [[The wrap width in pixels at a minimum where words need to wrap]] - } - } - @property slide_speed { - [[Control the slide speed of the label - - Note: If you set the duration of the slide using @.slide_duration.set - you cannot get the correct speed using this function until the label - is actually rendered and resized. - - See @.slide_duration.set]] - set { - } - get { - } - values { - speed: double; [[The speed of the slide animation in px per seconds]] - } - } - @property slide_mode { - [[Control the slide mode of the label widget. - - By default, slide mode is none. Possible values for $mode are: - @Elm.Label.Slide_Mode.none - no slide effect - @Elm.Label.Slide_Mode.auto - slide only if the label area is bigger than - the text width length - @Elm.Label.Slide_Mode.always - slide always - - Warning: @Elm.Label.Slide_Mode.auto, @Elm.Label.Slide_Mode.always only work - with the themes "slide_short", "slide_long" and "slide_bounce". - Warning: @Elm.Label.Slide_Mode.auto, @Elm.Label.Slide_Mode.always don't work - if the line wrap(elm_label_line_wrap_set()) or - ellipsis(elm_label_ellipsis_set()) is set. - - @since 1.8]] - set { - } - get { - } - values { - mode: Elm.Label.Slide_Mode; [[The slide mode]] - } - } - @property slide_duration { - [[Control the slide duration of the label - - Note: If you set the speed of the slide using @.slide_speed.set - you cannot get the correct duration using this function until the label - is actually rendered and resized.]] - set { - } - get { - } - values { - duration: double; [[The duration in seconds in moving text from slide begin position to slide end position]] - } - } - @property line_wrap { - [[Control the wrapping behavior of the label - - By default no wrapping is done. Possible values for $wrap are: - $ELM_WRAP_NONE - No wrapping - $ELM_WRAP_CHAR - wrap between characters - $ELM_WRAP_WORD - wrap between words - $ELM_WRAP_MIXED - Word wrap, and if that fails, char wrap]] - set { - } - get { - } - values { - wrap: Elm.Wrap.Type; [[To wrap text or not]] - } - } - @property ellipsis { - [[Control the ellipsis behavior of the label - - If set to true and the text doesn't fit in the label an ellipsis("...") - will be shown at the end of the widget. - - Warning This doesn't work with slide(elm_label_slide_set()) or if the - chosen wrap method was $ELM_WRAP_WORD.]] - set { - } - get { - } - values { - ellipsis: bool; [[To ellipsis text or not]] - } - } - slide_go { - [[Start slide effect. - - See @.slide_mode.set.]] - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.theme_apply; - Efl.Part.part_get; - } - events { - slide,end: void; [[Called when slide stopped]] - } -} diff --git a/src/lib/elementary/elm_label_eo.c b/src/lib/elementary/elm_label_eo.c new file mode 100644 index 0000000000..d19545f842 --- /dev/null +++ b/src/lib/elementary/elm_label_eo.c @@ -0,0 +1,219 @@ +EWAPI const Efl_Event_Description _ELM_LABEL_EVENT_SLIDE_END = + EFL_EVENT_DESCRIPTION("slide,end"); + +void _elm_label_wrap_width_set(Eo *obj, Elm_Label_Data *pd, int w); + + +static Eina_Error +__eolian_elm_label_wrap_width_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_label_wrap_width_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_label_wrap_width_set, EFL_FUNC_CALL(w), int w); + +int _elm_label_wrap_width_get(const Eo *obj, Elm_Label_Data *pd); + + +static Eina_Value +__eolian_elm_label_wrap_width_get_reflect(const Eo *obj) +{ + int val = elm_obj_label_wrap_width_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_label_wrap_width_get, int, 0); + +void _elm_label_slide_speed_set(Eo *obj, Elm_Label_Data *pd, double speed); + + +static Eina_Error +__eolian_elm_label_slide_speed_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_label_slide_speed_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_label_slide_speed_set, EFL_FUNC_CALL(speed), double speed); + +double _elm_label_slide_speed_get(const Eo *obj, Elm_Label_Data *pd); + + +static Eina_Value +__eolian_elm_label_slide_speed_get_reflect(const Eo *obj) +{ + double val = elm_obj_label_slide_speed_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_label_slide_speed_get, double, 0); + +void _elm_label_slide_mode_set(Eo *obj, Elm_Label_Data *pd, Elm_Label_Slide_Mode mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_label_slide_mode_set, EFL_FUNC_CALL(mode), Elm_Label_Slide_Mode mode); + +Elm_Label_Slide_Mode _elm_label_slide_mode_get(const Eo *obj, Elm_Label_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_label_slide_mode_get, Elm_Label_Slide_Mode, 0); + +void _elm_label_slide_duration_set(Eo *obj, Elm_Label_Data *pd, double duration); + + +static Eina_Error +__eolian_elm_label_slide_duration_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_label_slide_duration_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_label_slide_duration_set, EFL_FUNC_CALL(duration), double duration); + +double _elm_label_slide_duration_get(const Eo *obj, Elm_Label_Data *pd); + + +static Eina_Value +__eolian_elm_label_slide_duration_get_reflect(const Eo *obj) +{ + double val = elm_obj_label_slide_duration_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_label_slide_duration_get, double, 0); + +void _elm_label_line_wrap_set(Eo *obj, Elm_Label_Data *pd, Elm_Wrap_Type wrap); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_label_line_wrap_set, EFL_FUNC_CALL(wrap), Elm_Wrap_Type wrap); + +Elm_Wrap_Type _elm_label_line_wrap_get(const Eo *obj, Elm_Label_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_label_line_wrap_get, Elm_Wrap_Type, 0); + +void _elm_label_ellipsis_set(Eo *obj, Elm_Label_Data *pd, Eina_Bool ellipsis); + + +static Eina_Error +__eolian_elm_label_ellipsis_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_label_ellipsis_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_label_ellipsis_set, EFL_FUNC_CALL(ellipsis), Eina_Bool ellipsis); + +Eina_Bool _elm_label_ellipsis_get(const Eo *obj, Elm_Label_Data *pd); + + +static Eina_Value +__eolian_elm_label_ellipsis_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_label_ellipsis_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_label_ellipsis_get, Eina_Bool, 0); + +void _elm_label_slide_go(Eo *obj, Elm_Label_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_label_slide_go); + +Efl_Object *_elm_label_efl_object_constructor(Eo *obj, Elm_Label_Data *pd); + + +Eina_Error _elm_label_efl_ui_widget_theme_apply(Eo *obj, Elm_Label_Data *pd); + + +Efl_Object *_elm_label_efl_part_part_get(const Eo *obj, Elm_Label_Data *pd, const char *name); + + +static Eina_Bool +_elm_label_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_LABEL_EXTRA_OPS +#define ELM_LABEL_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_label_wrap_width_set, _elm_label_wrap_width_set), + EFL_OBJECT_OP_FUNC(elm_obj_label_wrap_width_get, _elm_label_wrap_width_get), + EFL_OBJECT_OP_FUNC(elm_obj_label_slide_speed_set, _elm_label_slide_speed_set), + EFL_OBJECT_OP_FUNC(elm_obj_label_slide_speed_get, _elm_label_slide_speed_get), + EFL_OBJECT_OP_FUNC(elm_obj_label_slide_mode_set, _elm_label_slide_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_label_slide_mode_get, _elm_label_slide_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_label_slide_duration_set, _elm_label_slide_duration_set), + EFL_OBJECT_OP_FUNC(elm_obj_label_slide_duration_get, _elm_label_slide_duration_get), + EFL_OBJECT_OP_FUNC(elm_obj_label_line_wrap_set, _elm_label_line_wrap_set), + EFL_OBJECT_OP_FUNC(elm_obj_label_line_wrap_get, _elm_label_line_wrap_get), + EFL_OBJECT_OP_FUNC(elm_obj_label_ellipsis_set, _elm_label_ellipsis_set), + EFL_OBJECT_OP_FUNC(elm_obj_label_ellipsis_get, _elm_label_ellipsis_get), + EFL_OBJECT_OP_FUNC(elm_obj_label_slide_go, _elm_label_slide_go), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_label_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_label_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_label_efl_part_part_get), + ELM_LABEL_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"wrap_width", __eolian_elm_label_wrap_width_set_reflect, __eolian_elm_label_wrap_width_get_reflect}, + {"slide_speed", __eolian_elm_label_slide_speed_set_reflect, __eolian_elm_label_slide_speed_get_reflect}, + {"slide_duration", __eolian_elm_label_slide_duration_set_reflect, __eolian_elm_label_slide_duration_get_reflect}, + {"ellipsis", __eolian_elm_label_ellipsis_set_reflect, __eolian_elm_label_ellipsis_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_label_class_desc = { + EO_VERSION, + "Elm.Label", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Label_Data), + _elm_label_class_initializer, + _elm_label_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_label_class_get, &_elm_label_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_label_eo.legacy.c" diff --git a/src/lib/elementary/elm_label_eo.h b/src/lib/elementary/elm_label_eo.h new file mode 100644 index 0000000000..56a0016f76 --- /dev/null +++ b/src/lib/elementary/elm_label_eo.h @@ -0,0 +1,258 @@ +#ifndef _ELM_LABEL_EO_H_ +#define _ELM_LABEL_EO_H_ + +#ifndef _ELM_LABEL_EO_CLASS_TYPE +#define _ELM_LABEL_EO_CLASS_TYPE + +typedef Eo Elm_Label; + +#endif + +#ifndef _ELM_LABEL_EO_TYPES +#define _ELM_LABEL_EO_TYPES + +/** Slide mode of a label widget + * + * @ingroup Elm_Label + */ +typedef enum +{ + ELM_LABEL_SLIDE_MODE_NONE = 0, /**< No slide effect. */ + ELM_LABEL_SLIDE_MODE_AUTO, /**< Slide only if the label area is bigger than + * the text width length. */ + ELM_LABEL_SLIDE_MODE_ALWAYS /**< Slide always. */ +} Elm_Label_Slide_Mode; + + +#endif +/** Elementary label class + * + * @ingroup Elm_Label + */ +#define ELM_LABEL_CLASS elm_label_class_get() + +EWAPI const Efl_Class *elm_label_class_get(void); + +/** + * @brief Control wrap width of the label + * + * This function sets the maximum width size hint of the label. + * + * @warning This is only relevant if the label is inside a container. + * + * @param[in] obj The object. + * @param[in] w The wrap width in pixels at a minimum where words need to wrap + * + * @ingroup Elm_Label + */ +EOAPI void elm_obj_label_wrap_width_set(Eo *obj, int w); + +/** + * @brief Control wrap width of the label + * + * This function sets the maximum width size hint of the label. + * + * @warning This is only relevant if the label is inside a container. + * + * @param[in] obj The object. + * + * @return The wrap width in pixels at a minimum where words need to wrap + * + * @ingroup Elm_Label + */ +EOAPI int elm_obj_label_wrap_width_get(const Eo *obj); + +/** + * @brief Control the slide speed of the label + * + * @note If you set the duration of the slide using + * @ref elm_obj_label_slide_duration_set you cannot get the correct speed using + * this function until the label is actually rendered and resized. + * + * See @ref elm_obj_label_slide_duration_set + * + * @param[in] obj The object. + * @param[in] speed The speed of the slide animation in px per seconds + * + * @ingroup Elm_Label + */ +EOAPI void elm_obj_label_slide_speed_set(Eo *obj, double speed); + +/** + * @brief Control the slide speed of the label + * + * @note If you set the duration of the slide using + * @ref elm_obj_label_slide_duration_set you cannot get the correct speed using + * this function until the label is actually rendered and resized. + * + * See @ref elm_obj_label_slide_duration_set + * + * @param[in] obj The object. + * + * @return The speed of the slide animation in px per seconds + * + * @ingroup Elm_Label + */ +EOAPI double elm_obj_label_slide_speed_get(const Eo *obj); + +/** + * @brief Control the slide mode of the label widget. + * + * By default, slide mode is none. Possible values for @c mode are: + * @ref ELM_LABEL_SLIDE_MODE_NONE - no slide effect + * @ref ELM_LABEL_SLIDE_MODE_AUTO - slide only if the label area is bigger than + * the text width length @ref ELM_LABEL_SLIDE_MODE_ALWAYS - slide always + * + * @warning @ref ELM_LABEL_SLIDE_MODE_AUTO, @ref ELM_LABEL_SLIDE_MODE_ALWAYS + * only work with the themes "slide_short", "slide_long" and "slide_bounce". + * Warning: @ref ELM_LABEL_SLIDE_MODE_AUTO, @ref ELM_LABEL_SLIDE_MODE_ALWAYS + * don't work if the line wrap(elm_label_line_wrap_set()) or + * ellipsis(elm_label_ellipsis_set()) is set. + * + * @param[in] obj The object. + * @param[in] mode The slide mode + * + * @since 1.8 + * + * @ingroup Elm_Label + */ +EOAPI void elm_obj_label_slide_mode_set(Eo *obj, Elm_Label_Slide_Mode mode); + +/** + * @brief Control the slide mode of the label widget. + * + * By default, slide mode is none. Possible values for @c mode are: + * @ref ELM_LABEL_SLIDE_MODE_NONE - no slide effect + * @ref ELM_LABEL_SLIDE_MODE_AUTO - slide only if the label area is bigger than + * the text width length @ref ELM_LABEL_SLIDE_MODE_ALWAYS - slide always + * + * @warning @ref ELM_LABEL_SLIDE_MODE_AUTO, @ref ELM_LABEL_SLIDE_MODE_ALWAYS + * only work with the themes "slide_short", "slide_long" and "slide_bounce". + * Warning: @ref ELM_LABEL_SLIDE_MODE_AUTO, @ref ELM_LABEL_SLIDE_MODE_ALWAYS + * don't work if the line wrap(elm_label_line_wrap_set()) or + * ellipsis(elm_label_ellipsis_set()) is set. + * + * @param[in] obj The object. + * + * @return The slide mode + * + * @since 1.8 + * + * @ingroup Elm_Label + */ +EOAPI Elm_Label_Slide_Mode elm_obj_label_slide_mode_get(const Eo *obj); + +/** + * @brief Control the slide duration of the label + * + * @note If you set the speed of the slide using + * @ref elm_obj_label_slide_speed_set you cannot get the correct duration using + * this function until the label is actually rendered and resized. + * + * @param[in] obj The object. + * @param[in] duration The duration in seconds in moving text from slide begin + * position to slide end position + * + * @ingroup Elm_Label + */ +EOAPI void elm_obj_label_slide_duration_set(Eo *obj, double duration); + +/** + * @brief Control the slide duration of the label + * + * @note If you set the speed of the slide using + * @ref elm_obj_label_slide_speed_set you cannot get the correct duration using + * this function until the label is actually rendered and resized. + * + * @param[in] obj The object. + * + * @return The duration in seconds in moving text from slide begin position to + * slide end position + * + * @ingroup Elm_Label + */ +EOAPI double elm_obj_label_slide_duration_get(const Eo *obj); + +/** + * @brief Control the wrapping behavior of the label + * + * By default no wrapping is done. Possible values for @c wrap are: + * @c ELM_WRAP_NONE - No wrapping @c ELM_WRAP_CHAR - wrap between characters + * @c ELM_WRAP_WORD - wrap between words @c ELM_WRAP_MIXED - Word wrap, and if + * that fails, char wrap + * + * @param[in] obj The object. + * @param[in] wrap To wrap text or not + * + * @ingroup Elm_Label + */ +EOAPI void elm_obj_label_line_wrap_set(Eo *obj, Elm_Wrap_Type wrap); + +/** + * @brief Control the wrapping behavior of the label + * + * By default no wrapping is done. Possible values for @c wrap are: + * @c ELM_WRAP_NONE - No wrapping @c ELM_WRAP_CHAR - wrap between characters + * @c ELM_WRAP_WORD - wrap between words @c ELM_WRAP_MIXED - Word wrap, and if + * that fails, char wrap + * + * @param[in] obj The object. + * + * @return To wrap text or not + * + * @ingroup Elm_Label + */ +EOAPI Elm_Wrap_Type elm_obj_label_line_wrap_get(const Eo *obj); + +/** + * @brief Control the ellipsis behavior of the label + * + * If set to true and the text doesn't fit in the label an ellipsis("...") will + * be shown at the end of the widget. + * + * Warning This doesn't work with slide(elm_label_slide_set()) or if the chosen + * wrap method was @c ELM_WRAP_WORD. + * + * @param[in] obj The object. + * @param[in] ellipsis To ellipsis text or not + * + * @ingroup Elm_Label + */ +EOAPI void elm_obj_label_ellipsis_set(Eo *obj, Eina_Bool ellipsis); + +/** + * @brief Control the ellipsis behavior of the label + * + * If set to true and the text doesn't fit in the label an ellipsis("...") will + * be shown at the end of the widget. + * + * Warning This doesn't work with slide(elm_label_slide_set()) or if the chosen + * wrap method was @c ELM_WRAP_WORD. + * + * @param[in] obj The object. + * + * @return To ellipsis text or not + * + * @ingroup Elm_Label + */ +EOAPI Eina_Bool elm_obj_label_ellipsis_get(const Eo *obj); + +/** + * @brief Start slide effect. + * + * See @ref elm_obj_label_slide_mode_set. + * @param[in] obj The object. + * + * @ingroup Elm_Label + */ +EOAPI void elm_obj_label_slide_go(Eo *obj); + +EWAPI extern const Efl_Event_Description _ELM_LABEL_EVENT_SLIDE_END; + +/** Called when slide stopped + * + * @ingroup Elm_Label + */ +#define ELM_LABEL_EVENT_SLIDE_END (&(_ELM_LABEL_EVENT_SLIDE_END)) + +#endif diff --git a/src/lib/elementary/elm_label_eo.legacy.c b/src/lib/elementary/elm_label_eo.legacy.c new file mode 100644 index 0000000000..649b6d5a32 --- /dev/null +++ b/src/lib/elementary/elm_label_eo.legacy.c @@ -0,0 +1,78 @@ + +EAPI void +elm_label_wrap_width_set(Elm_Label *obj, int w) +{ + elm_obj_label_wrap_width_set(obj, w); +} + +EAPI int +elm_label_wrap_width_get(const Elm_Label *obj) +{ + return elm_obj_label_wrap_width_get(obj); +} + +EAPI void +elm_label_slide_speed_set(Elm_Label *obj, double speed) +{ + elm_obj_label_slide_speed_set(obj, speed); +} + +EAPI double +elm_label_slide_speed_get(const Elm_Label *obj) +{ + return elm_obj_label_slide_speed_get(obj); +} + +EAPI void +elm_label_slide_mode_set(Elm_Label *obj, Elm_Label_Slide_Mode mode) +{ + elm_obj_label_slide_mode_set(obj, mode); +} + +EAPI Elm_Label_Slide_Mode +elm_label_slide_mode_get(const Elm_Label *obj) +{ + return elm_obj_label_slide_mode_get(obj); +} + +EAPI void +elm_label_slide_duration_set(Elm_Label *obj, double duration) +{ + elm_obj_label_slide_duration_set(obj, duration); +} + +EAPI double +elm_label_slide_duration_get(const Elm_Label *obj) +{ + return elm_obj_label_slide_duration_get(obj); +} + +EAPI void +elm_label_line_wrap_set(Elm_Label *obj, Elm_Wrap_Type wrap) +{ + elm_obj_label_line_wrap_set(obj, wrap); +} + +EAPI Elm_Wrap_Type +elm_label_line_wrap_get(const Elm_Label *obj) +{ + return elm_obj_label_line_wrap_get(obj); +} + +EAPI void +elm_label_ellipsis_set(Elm_Label *obj, Eina_Bool ellipsis) +{ + elm_obj_label_ellipsis_set(obj, ellipsis); +} + +EAPI Eina_Bool +elm_label_ellipsis_get(const Elm_Label *obj) +{ + return elm_obj_label_ellipsis_get(obj); +} + +EAPI void +elm_label_slide_go(Elm_Label *obj) +{ + elm_obj_label_slide_go(obj); +} diff --git a/src/lib/elementary/elm_label_eo.legacy.h b/src/lib/elementary/elm_label_eo.legacy.h new file mode 100644 index 0000000000..126207a228 --- /dev/null +++ b/src/lib/elementary/elm_label_eo.legacy.h @@ -0,0 +1,243 @@ +#ifndef _ELM_LABEL_EO_LEGACY_H_ +#define _ELM_LABEL_EO_LEGACY_H_ + +#ifndef _ELM_LABEL_EO_CLASS_TYPE +#define _ELM_LABEL_EO_CLASS_TYPE + +typedef Eo Elm_Label; + +#endif + +#ifndef _ELM_LABEL_EO_TYPES +#define _ELM_LABEL_EO_TYPES + +/** Slide mode of a label widget + * + * @ingroup Elm_Label + */ +typedef enum +{ + ELM_LABEL_SLIDE_MODE_NONE = 0, /**< No slide effect. */ + ELM_LABEL_SLIDE_MODE_AUTO, /**< Slide only if the label area is bigger than + * the text width length. */ + ELM_LABEL_SLIDE_MODE_ALWAYS /**< Slide always. */ +} Elm_Label_Slide_Mode; + + +#endif + +/** + * @brief Control wrap width of the label + * + * This function sets the maximum width size hint of the label. + * + * @warning This is only relevant if the label is inside a container. + * + * @param[in] obj The object. + * @param[in] w The wrap width in pixels at a minimum where words need to wrap + * + * @ingroup Elm_Label_Group + */ +EAPI void elm_label_wrap_width_set(Elm_Label *obj, int w); + +/** + * @brief Control wrap width of the label + * + * This function sets the maximum width size hint of the label. + * + * @warning This is only relevant if the label is inside a container. + * + * @param[in] obj The object. + * + * @return The wrap width in pixels at a minimum where words need to wrap + * + * @ingroup Elm_Label_Group + */ +EAPI int elm_label_wrap_width_get(const Elm_Label *obj); + +/** + * @brief Control the slide speed of the label + * + * @note If you set the duration of the slide using + * @ref elm_label_slide_duration_set you cannot get the correct speed using + * this function until the label is actually rendered and resized. + * + * See @ref elm_label_slide_duration_set + * + * @param[in] obj The object. + * @param[in] speed The speed of the slide animation in px per seconds + * + * @ingroup Elm_Label_Group + */ +EAPI void elm_label_slide_speed_set(Elm_Label *obj, double speed); + +/** + * @brief Control the slide speed of the label + * + * @note If you set the duration of the slide using + * @ref elm_label_slide_duration_set you cannot get the correct speed using + * this function until the label is actually rendered and resized. + * + * See @ref elm_label_slide_duration_set + * + * @param[in] obj The object. + * + * @return The speed of the slide animation in px per seconds + * + * @ingroup Elm_Label_Group + */ +EAPI double elm_label_slide_speed_get(const Elm_Label *obj); + +/** + * @brief Control the slide mode of the label widget. + * + * By default, slide mode is none. Possible values for @c mode are: + * @ref ELM_LABEL_SLIDE_MODE_NONE - no slide effect + * @ref ELM_LABEL_SLIDE_MODE_AUTO - slide only if the label area is bigger than + * the text width length @ref ELM_LABEL_SLIDE_MODE_ALWAYS - slide always + * + * @warning @ref ELM_LABEL_SLIDE_MODE_AUTO, @ref ELM_LABEL_SLIDE_MODE_ALWAYS + * only work with the themes "slide_short", "slide_long" and "slide_bounce". + * Warning: @ref ELM_LABEL_SLIDE_MODE_AUTO, @ref ELM_LABEL_SLIDE_MODE_ALWAYS + * don't work if the line wrap(elm_label_line_wrap_set()) or + * ellipsis(elm_label_ellipsis_set()) is set. + * + * @param[in] obj The object. + * @param[in] mode The slide mode + * + * @since 1.8 + * + * @ingroup Elm_Label_Group + */ +EAPI void elm_label_slide_mode_set(Elm_Label *obj, Elm_Label_Slide_Mode mode); + +/** + * @brief Control the slide mode of the label widget. + * + * By default, slide mode is none. Possible values for @c mode are: + * @ref ELM_LABEL_SLIDE_MODE_NONE - no slide effect + * @ref ELM_LABEL_SLIDE_MODE_AUTO - slide only if the label area is bigger than + * the text width length @ref ELM_LABEL_SLIDE_MODE_ALWAYS - slide always + * + * @warning @ref ELM_LABEL_SLIDE_MODE_AUTO, @ref ELM_LABEL_SLIDE_MODE_ALWAYS + * only work with the themes "slide_short", "slide_long" and "slide_bounce". + * Warning: @ref ELM_LABEL_SLIDE_MODE_AUTO, @ref ELM_LABEL_SLIDE_MODE_ALWAYS + * don't work if the line wrap(elm_label_line_wrap_set()) or + * ellipsis(elm_label_ellipsis_set()) is set. + * + * @param[in] obj The object. + * + * @return The slide mode + * + * @since 1.8 + * + * @ingroup Elm_Label_Group + */ +EAPI Elm_Label_Slide_Mode elm_label_slide_mode_get(const Elm_Label *obj); + +/** + * @brief Control the slide duration of the label + * + * @note If you set the speed of the slide using @ref elm_label_slide_speed_set + * you cannot get the correct duration using this function until the label is + * actually rendered and resized. + * + * @param[in] obj The object. + * @param[in] duration The duration in seconds in moving text from slide begin + * position to slide end position + * + * @ingroup Elm_Label_Group + */ +EAPI void elm_label_slide_duration_set(Elm_Label *obj, double duration); + +/** + * @brief Control the slide duration of the label + * + * @note If you set the speed of the slide using @ref elm_label_slide_speed_set + * you cannot get the correct duration using this function until the label is + * actually rendered and resized. + * + * @param[in] obj The object. + * + * @return The duration in seconds in moving text from slide begin position to + * slide end position + * + * @ingroup Elm_Label_Group + */ +EAPI double elm_label_slide_duration_get(const Elm_Label *obj); + +/** + * @brief Control the wrapping behavior of the label + * + * By default no wrapping is done. Possible values for @c wrap are: + * @c ELM_WRAP_NONE - No wrapping @c ELM_WRAP_CHAR - wrap between characters + * @c ELM_WRAP_WORD - wrap between words @c ELM_WRAP_MIXED - Word wrap, and if + * that fails, char wrap + * + * @param[in] obj The object. + * @param[in] wrap To wrap text or not + * + * @ingroup Elm_Label_Group + */ +EAPI void elm_label_line_wrap_set(Elm_Label *obj, Elm_Wrap_Type wrap); + +/** + * @brief Control the wrapping behavior of the label + * + * By default no wrapping is done. Possible values for @c wrap are: + * @c ELM_WRAP_NONE - No wrapping @c ELM_WRAP_CHAR - wrap between characters + * @c ELM_WRAP_WORD - wrap between words @c ELM_WRAP_MIXED - Word wrap, and if + * that fails, char wrap + * + * @param[in] obj The object. + * + * @return To wrap text or not + * + * @ingroup Elm_Label_Group + */ +EAPI Elm_Wrap_Type elm_label_line_wrap_get(const Elm_Label *obj); + +/** + * @brief Control the ellipsis behavior of the label + * + * If set to true and the text doesn't fit in the label an ellipsis("...") will + * be shown at the end of the widget. + * + * Warning This doesn't work with slide(elm_label_slide_set()) or if the chosen + * wrap method was @c ELM_WRAP_WORD. + * + * @param[in] obj The object. + * @param[in] ellipsis To ellipsis text or not + * + * @ingroup Elm_Label_Group + */ +EAPI void elm_label_ellipsis_set(Elm_Label *obj, Eina_Bool ellipsis); + +/** + * @brief Control the ellipsis behavior of the label + * + * If set to true and the text doesn't fit in the label an ellipsis("...") will + * be shown at the end of the widget. + * + * Warning This doesn't work with slide(elm_label_slide_set()) or if the chosen + * wrap method was @c ELM_WRAP_WORD. + * + * @param[in] obj The object. + * + * @return To ellipsis text or not + * + * @ingroup Elm_Label_Group + */ +EAPI Eina_Bool elm_label_ellipsis_get(const Elm_Label *obj); + +/** + * @brief Start slide effect. + * + * See @ref elm_label_slide_mode_set. + * @param[in] obj The object. + * + * @ingroup Elm_Label_Group + */ +EAPI void elm_label_slide_go(Elm_Label *obj); + +#endif diff --git a/src/lib/elementary/elm_label_legacy.h b/src/lib/elementary/elm_label_legacy.h index f072006e73..afd0927945 100644 --- a/src/lib/elementary/elm_label_legacy.h +++ b/src/lib/elementary/elm_label_legacy.h @@ -8,4 +8,4 @@ */ EAPI Evas_Object *elm_label_add(Evas_Object *parent); -#include "elm_label.eo.legacy.h" +#include "elm_label_eo.legacy.h" diff --git a/src/lib/elementary/elm_label_part.eo b/src/lib/elementary/elm_label_part.eo index cbbbeaaac4..c2d6110d6a 100644 --- a/src/lib/elementary/elm_label_part.eo +++ b/src/lib/elementary/elm_label_part.eo @@ -1,4 +1,4 @@ -class Elm_Label.Part extends Efl.Ui.Layout_Part_Legacy +class @beta Elm_Label.Part extends Efl.Ui.Layout_Part_Legacy { [[Elementary button internal part class]] data: null; diff --git a/src/lib/elementary/elm_layout.h b/src/lib/elementary/elm_layout.h index a59fd7c650..475ac1c54c 100644 --- a/src/lib/elementary/elm_layout.h +++ b/src/lib/elementary/elm_layout.h @@ -167,9 +167,6 @@ */ #include -#ifdef EFL_EO_API_SUPPORT -#include -#endif #ifndef EFL_NOLEGACY_API_SUPPORT #include #endif diff --git a/src/lib/elementary/elm_list.c b/src/lib/elementary/elm_list.c index 7310201c27..da40668a02 100644 --- a/src/lib/elementary/elm_list.c +++ b/src/lib/elementary/elm_list.c @@ -13,6 +13,7 @@ #include "elm_priv.h" #include "elm_widget_list.h" #include "elm_interface_scrollable.h" +#include "elm_pan_eo.h" #define MY_CLASS ELM_LIST_CLASS @@ -296,7 +297,7 @@ _elm_list_item_content_focus_set(Elm_List_Item_Data *it, Elm_Focus_Direction dir Evas_Object *focus_chain[2]; Evas_Object *focused = NULL; int idx; - + if (it->icon && elm_object_widget_check(it->icon) && elm_object_focus_allow_get(it->icon)) focus_chain[focus_objs++] = it->icon; if (it->end && elm_object_widget_check(it->end) && elm_object_focus_allow_get(it->end)) @@ -1077,13 +1078,12 @@ _show_region_hook(void *data EINA_UNUSED, Evas_Object *obj, Eina_Rect r) elm_interface_scrollable_content_region_set(obj, r.x, r.y, r.w, r.h); } -EOLIAN static Eina_Bool -_elm_list_efl_ui_widget_on_disabled_update(Eo *obj, Elm_List_Data *sd, Eina_Bool disabled) +EOLIAN static void +_elm_list_efl_ui_widget_disabled_set(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; + efl_ui_widget_disabled_set(efl_super(obj, MY_CLASS), disabled); - if (disabled) + if (efl_ui_widget_disabled_get(obj)) { elm_widget_scroll_freeze_push(obj); elm_widget_scroll_hold_push(obj); @@ -1096,8 +1096,6 @@ _elm_list_efl_ui_widget_on_disabled_update(Eo *obj, Elm_List_Data *sd, Eina_Bool elm_widget_scroll_freeze_pop(obj); elm_widget_scroll_hold_pop(obj); } - - return EINA_TRUE; } static void @@ -1118,15 +1116,15 @@ _mirrored_set(Evas_Object *obj, } } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_list_efl_ui_widget_theme_apply(Eo *obj, Elm_List_Data *sd) { Elm_Object_Item *eo_it; Eina_List *n; - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _mirrored_set(obj, efl_ui_mirrored_get(obj)); @@ -1150,6 +1148,7 @@ _elm_list_item_focused(Elm_Object_Item *eo_it) { ELM_LIST_ITEM_DATA_GET(eo_it, it); ELM_LIST_DATA_GET_FROM_ITEM(it, sd); + Evas_Object *win = elm_widget_top_get(WIDGET(it)); Evas_Coord x, y, w, h, sx, sy, sw, sh; const char *focus_raise; @@ -1173,7 +1172,7 @@ _elm_list_item_focused(Elm_Object_Item *eo_it) } } sd->focused_item = eo_it; - if (elm_widget_focus_highlight_enabled_get(WIDGET(it)) || _elm_config->win_auto_focus_enable) + if (elm_win_focus_highlight_enabled_get(win) || _elm_config->win_auto_focus_enable) { edje_object_signal_emit (VIEW(it), "elm,state,focused", "elm"); @@ -1184,7 +1183,7 @@ _elm_list_item_focused(Elm_Object_Item *eo_it) efl_event_callback_legacy_call (WIDGET(it), ELM_LIST_EVENT_ITEM_FOCUSED, eo_it); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_FOCUSED, EINA_TRUE); + efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_TYPE_FOCUSED, EINA_TRUE); } static void @@ -1192,6 +1191,7 @@ _elm_list_item_unfocused(Elm_Object_Item *eo_it) { ELM_LIST_ITEM_DATA_GET(eo_it, it); Evas_Object *obj = WIDGET(it); + Evas_Object *win = elm_widget_top_get(obj); ELM_LIST_DATA_GET(obj, sd); if ((!sd) || (!sd->focused_item) || @@ -1201,7 +1201,7 @@ _elm_list_item_unfocused(Elm_Object_Item *eo_it) if (_is_no_select(it)) return; - if (elm_widget_focus_highlight_enabled_get(obj) || _elm_config->win_auto_focus_enable) + if (elm_win_focus_highlight_enabled_get(win) || _elm_config->win_auto_focus_enable) { ELM_LIST_ITEM_DATA_GET(sd->focused_item, focus_it); edje_object_signal_emit @@ -1211,7 +1211,7 @@ _elm_list_item_unfocused(Elm_Object_Item *eo_it) sd->focused_item = NULL; efl_event_callback_legacy_call(obj, ELM_LIST_EVENT_ITEM_UNFOCUSED, eo_it); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_FOCUSED, EINA_FALSE); + efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_TYPE_FOCUSED, EINA_FALSE); } /* @@ -1448,9 +1448,9 @@ call: _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); + evas_object_smart_callback_call(obj, "selected", eo_it); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_SELECTED, EINA_TRUE); + efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_TYPE_SELECTED, EINA_TRUE); sd->last_selected_item = eo_it; _elm_list_unwalk(obj, sd); @@ -1523,10 +1523,10 @@ _item_unselect(Elm_List_Item_Data *it) sd->selected = eina_list_remove(sd->selected, EO_OBJ(it)); if (!(it->base->disabled || (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE))) - efl_event_callback_legacy_call - (WIDGET(it), EFL_UI_EVENT_UNSELECTED, EO_OBJ(it)); + evas_object_smart_callback_call + (WIDGET(it), "unselected", EO_OBJ(it)); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(EO_OBJ(it), EFL_ACCESS_STATE_SELECTED, EINA_FALSE); + efl_access_state_changed_signal_emit(EO_OBJ(it), EFL_ACCESS_STATE_TYPE_SELECTED, EINA_FALSE); } _elm_list_unwalk(obj, sd); @@ -2142,13 +2142,13 @@ _elm_list_item_efl_access_object_state_set_get(const Eo *eo_it, Elm_List_Item_Da if (elm_object_item_disabled_get(eo_it)) return ret; - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_SELECTABLE); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_SELECTABLE); sel = elm_obj_list_item_selected_get(eo_it); if (sel) - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_SELECTED); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_SELECTED); else - STATE_TYPE_UNSET(ret, EFL_ACCESS_STATE_SELECTED); + STATE_TYPE_UNSET(ret, EFL_ACCESS_STATE_TYPE_SELECTED); return ret; } @@ -2352,7 +2352,6 @@ _elm_list_efl_canvas_group_group_add(Eo *obj, Elm_List_Data *priv) 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); @@ -3052,7 +3051,7 @@ _elm_list_efl_ui_widget_focus_highlight_geometry_get(const Eo *obj, Elm_List_Dat } EOLIAN static Elm_Object_Item* -_elm_list_efl_ui_widget_focused_item_get(const Eo *obj EINA_UNUSED, Elm_List_Data *sd) +_elm_list_elm_widget_item_container_focused_item_get(const Eo *obj EINA_UNUSED, Elm_List_Data *sd) { return sd->focused_item; } @@ -3214,5 +3213,5 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_list, Elm_List_Data) ELM_LAYOUT_SIZING_EVAL_OPS(elm_list), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_list) -#include "elm_list.eo.c" -#include "elm_list_item.eo.c" +#include "elm_list_eo.c" +#include "elm_list_item_eo.c" diff --git a/src/lib/elementary/elm_list.eo b/src/lib/elementary/elm_list.eo deleted file mode 100644 index d180a766fd..0000000000 --- a/src/lib/elementary/elm_list.eo +++ /dev/null @@ -1,439 +0,0 @@ -import elm_general; - -class Elm.List extends Efl.Ui.Layout implements 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; - eo_prefix: elm_obj_list; - event_prefix: elm_list; - methods { - @property horizontal { - [[Control horizontal mode on the list object. - - Note: Vertical mode is set by default. - - On horizontal mode items are displayed on list from left to right, - instead of from top to bottom. Also, the list will scroll horizontally. - Each item will presents left icon on top and right icon, or end, at - the bottom.]] - set { - } - get { - } - values { - horizontal: bool; [[$true to enable horizontal or $false to disable it, i.e., to enable vertical mode.]] - } - } - @property select_mode { - [[Control the list select mode. - - elm_list_select_mode_set() changes item select mode in the list widget. - - #ELM_OBJECT_SELECT_MODE_DEFAULT : Items will only call their selection func and - callback when first becoming selected. Any further clicks will - do nothing, unless you set always select mode. - - #ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected, - every click will make the selected callbacks be called. - - #ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select items - entirely and they will neither appear selected nor call selected - callback functions.]] - set { - } - get { - } - values { - mode: Elm.Object.Select_Mode(Elm.Object.Select_Mode.max); [[The select mode]] - } - } - @property focus_on_selection { - [[Control focus upon items selection mode - - When enabled, every selection of an item inside the genlist will automatically set focus to - its first focusable widget from the left. This is true of course if the selection was made by - clicking an unfocusable area in an item or selecting it with a key movement. Clicking on a - focusable widget inside an item will couse this particular item to get focus as usual.]] - set { - } - get { - } - values { - enabled: bool; [[The tree effect status ($true = enabled, $false = disabled)]] - } - } - @property multi_select { - [[Control multiple items selection on the list object. - - Disabled by default. If disabled, the user can select a single item of - the list each time. Selected items are highlighted on list. - If enabled, many items can be selected. - - If a selected item is selected again, it will be unselected.]] - set { - } - get { - } - values { - multi: bool; [[$true to enable multi selection or $false to disable it.]] - } - } - @property multi_select_mode { - [[Control the list multi select mode. - - - #ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT : select/unselect items whenever each - item is clicked. - - #ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL : Only one item will be selected - although multi-selection is enabled, if clicked without pressing control - key. This mode is only available with multi-selection. - - See: @.multi_select - - @since 1.8]] - set { - } - get { - } - values { - mode: Elm.Object.Multi_Select_Mode(Elm.Object.Multi_Select_Mode.max); [[The multi select mode]] - } - } - @property mode { - [[Control which mode to use for the list object. - - Set list's resize behavior, transverse axis scroll and - items cropping. See each mode's description for more details. - - Note: Default value is #ELM_LIST_SCROLL. - - Only one mode at a time can be set. If a previous one was set, it - will be changed by the new mode after this call. Bitmasks won't - work here as well. - - Warning: This function's behavior will clash with those of - elm_scroller_content_min_limit(), so use either one of them, but - not both.]] - set { - } - get { - } - values { - mode: Elm.List.Mode(Elm.List.Mode.last); [[One of #Elm_List_Mode: #ELM_LIST_COMPRESS, #ELM_LIST_SCROLL, #ELM_LIST_LIMIT or #ELM_LIST_EXPAND.]] - } - } - @property selected_item { - get { - [[Get the selected item. - - The selected item can be unselected with function - elm_list_item_selected_set(). - - The selected item always will be highlighted on list.]] - - return: Elm.Widget.Item; [[The selected list item.]] - } - } - @property items { - get { - [[Get a list of all the list items.]] - - return: const(list); [[A $list of list items, #Elm.Widget.Item, or $NULL on failure.]] - } - } - @property first_item { - get { - [[Get the first item in the list - - This returns the first item in the list.]] - - return: Elm.Widget.Item; [[The first item, or NULL if none]] - } - } - @property selected_items { - get { - [[Return a list of the currently selected list items. - - Multiple items can be selected if multi select is enabled. It can be - done with elm_list_multi_select_set().]] - - return: const(list); [[An $list of list items, #Elm.Widget.Item, or $NULL on failure.]] - } - } - @property last_item { - get { - [[Get the last item in the list - - This returns the last item in the list.]] - - return: Elm.Widget.Item; [[The last item, or NULL if none]] - } - } - item_insert_before { - [[Insert a new item into the list object before item $before. - - A new item will be created and added to the list. Its position in - this list will be just before item $before. - - Items created with this method can be deleted with elm_object_item_del(). - - Associated $data can be properly freed when item is deleted if a - callback function is set with elm_object_item_del_cb_set(). - - If a function is passed as argument, it will be called every time this item - is selected, i.e., the user clicks over an unselected item. - If always select is enabled it will call this function every time - user clicks over an item (already selected or not). - If such function isn't needed, just passing - $NULL as $func is enough. The same should be done for $data. - - Note: Remember that the label parameter is copied inside the list. So if an - application dynamically allocated the label, the application should free the - label after this call.]] - - return: Elm.Widget.Item; [[The created item or $NULL upon failure.]] - params { - @in before: Elm.Widget.Item; [[The list item to insert before.]] - @in label: string; [[The label of the list item.]] - @in icon: Efl.Canvas.Object @optional; [[The icon object to use for the left side of the item. An icon can be any Evas object, but usually it is an icon created with elm_icon_add().]] - @in end: Efl.Canvas.Object @optional; [[The icon object to use for the right side of the item. An icon can be any Evas object.]] - @in func: Evas_Smart_Cb @optional; [[The function to call when the item is clicked.]] - @in data: const(void_ptr) @optional; [[The data to associate with the item for related callbacks.]] - } - } - go { - [[Starts the list. - - Note: Call before running show() on the list object. - Warning: If not called, it won't display the list properly.]] - - /* FIXME-doc - @code - li = elm_list_add(win); - elm_list_item_append(li, "First", NULL, NULL, NULL, NULL); - elm_list_item_append(li, "Second", NULL, NULL, NULL, NULL); - elm_list_go(li); - evas_object_show(li); - @endcode */ - } - item_insert_after { - [[Insert a new item into the list object after item $after. - - A new item will be created and added to the list. Its position in - this list will be just after item $after. - - Items created with this method can be deleted with elm_object_item_del(). - - Associated $data can be properly freed when item is deleted if a - callback function is set with elm_object_item_del_cb_set(). - - If a function is passed as argument, it will be called every time this item - is selected, i.e., the user clicks over an unselected item. - If always select is enabled it will call this function every time - user clicks over an item (already selected or not). - If such function isn't needed, just passing - $NULL as $func is enough. The same should be done for $data. - - Note: Remember that the label parameter is copied inside the list. So if an - application dynamically allocated the label, the application should free the - label after this call.]] - - return: Elm.Widget.Item; [[The created item or $NULL upon failure.]] - params { - @in after: Elm.Widget.Item; [[The list item to insert after.]] - @in label: string; [[The label of the list item.]] - @in icon: Efl.Canvas.Object @optional; [[The icon object to use for the left side of the item. An icon can be any Evas object, but usually it is an icon created with elm_icon_add().]] - @in end: Efl.Canvas.Object @optional; [[The icon object to use for the right side of the item. An icon can be any Evas object.]] - @in func: Evas_Smart_Cb @optional; [[The function to call when the item is clicked.]] - @in data: const(void_ptr) @optional; [[The data to associate with the item for related callbacks.]] - } - } - at_xy_item_get @const { - [[Get the item that is at the x, y canvas coords. - - This returns the item at the given coordinates (which are canvas - relative, not object-relative). If an item is at that coordinate, - that item handle is returned, and if $posret is not NULL, the - integer pointed to is set to a value of -1, 0 or 1, depending if - the coordinate is on the upper portion of that item (-1), on the - middle section (0) or on the lower part (1). If NULL is returned as - an item (no item found there), then posret may indicate -1 or 1 - based if the coordinate is above or below all items respectively in - the list.]] - - return: Elm.Widget.Item; [[The item at the coordinates or NULL if none]] - params { - @in x: int; [[The input x coordinate]] - @in y: int; [[The input y coordinate]] - @out posret: int; [[The position relative to the item returned here]] - } - } - item_append { - [[Append a new item to the list object. - - A new item will be created and appended to the list, i.e., will - be set as last item. - - Items created with this method can be deleted with elm_object_item_del(). - - Associated $data can be properly freed when item is deleted if a - callback function is set with elm_object_item_del_cb_set(). - - If a function is passed as argument, it will be called every time this item - is selected, i.e., the user clicks over an unselected item. - If always select is enabled it will call this function every time - user clicks over an item (already selected or not). - If such function isn't needed, just passing - $NULL as $func is enough. The same should be done for $data. - - Note: Remember that the label parameter is copied inside the list. So if an - application dynamically allocated the label, the application should free the - label after this call.]] - - /* FIXME-doc - Simple example (with no function callback or data associated): - @code - li = elm_list_add(win); - ic = elm_icon_add(win); - elm_image_file_set(ic, "path/to/image", NULL); - elm_icon_resizable_set(ic, true, true); - elm_list_item_append(li, "label", ic, NULL, NULL, NULL); - elm_list_go(li); - evas_object_show(li); - @endcode - - @see elm_list_select_mode_set() - @see elm_object_item_del() - @see elm_object_item_del_cb_set() - @see elm_list_clear() - @see elm_icon_add() - */ - - return: Elm.Widget.Item; [[The created item or $NULL upon failure.]] - params { - @in label: string; [[The label of the list item.]] - @in icon: Efl.Canvas.Object @optional; [[The icon object to use for the left side of the item. An icon can be any Evas object, but usually it is an icon created with elm_icon_add().]] - @in end: Efl.Canvas.Object @optional; [[The icon object to use for the right side of the item. An icon can be any Evas object.]] - @in func: Evas_Smart_Cb @optional; [[The function to call when the item is clicked.]] - @in data: const(void_ptr) @optional; [[The data to associate with the item for related callbacks.]] - } - } - item_prepend { - [[Prepend a new item to the list object. - - A new item will be created and prepended to the list, i.e., will - be set as first item. - - Items created with this method can be deleted with elm_object_item_del(). - - Associated $data can be properly freed when item is deleted if a - callback function is set with elm_object_item_del_cb_set(). - - If a function is passed as argument, it will be called every time this item - is selected, i.e., the user clicks over an unselected item. - If always select is enabled it will call this function every time - user clicks over an item (already selected or not). - If such function isn't needed, just passing - $NULL as $func is enough. The same should be done for $data. - - Note: Remember that the label parameter is copied inside the list. So if an - application dynamically allocated the label, the application should free the - label after this call.]] - - return: Elm.Widget.Item; [[The created item or $NULL upon failure.]] - params { - @in label: string; [[The label of the list item.]] - @in icon: Efl.Canvas.Object @optional; [[The icon object to use for the left side of the item. An icon can be any Evas object, but usually it is an icon created with elm_icon_add().]] - @in end: Efl.Canvas.Object @optional; [[The icon object to use for the right side of the item. An icon can be any Evas object.]] - @in func: Evas_Smart_Cb @optional; [[The function to call when the item is clicked.]] - @in data: const(void_ptr) @optional; [[The data to associate with the item for related callbacks.]] - } - } - clear { - [[Remove all list's items.]] - } - item_sorted_insert { - [[Insert a new item into the sorted list object. - - Note: This function inserts values into a list object assuming it was - sorted and the result will be sorted. - - A new item will be created and added to the list. Its position in - this list will be found comparing the new item with previously inserted - items using function $cmp_func. - - Items created with this method can be deleted with elm_object_item_del(). - - Associated $data can be properly freed when item is deleted if a - callback function is set with elm_object_item_del_cb_set(). - - If a function is passed as argument, it will be called every time this item - is selected, i.e., the user clicks over an unselected item. - If always select is enabled it will call this function every time - user clicks over an item (already selected or not). - If such function isn't needed, just passing - $NULL as $func is enough. The same should be done for $data. - - Note: Remember that the label parameter is copied inside the list. So if an - application dynamically allocated the label, the application should free the - label after this call.]] - - return: Elm.Widget.Item; [[The created item or $NULL upon failure.]] - params { - @in label: string; [[The label of the list item.]] - @in icon: Efl.Canvas.Object @optional; [[The icon object to use for the left side of the item. An icon can be any Evas object, but usually it is an icon created with elm_icon_add().]] - @in end: Efl.Canvas.Object @optional; [[The icon object to use for the right side of the item. An icon can be any Evas object.]] - @in func: Evas_Smart_Cb @optional; [[The function to call when the item is clicked.]] - @in data: const(void_ptr) @optional; [[The data to associate with the item for related callbacks.]] - @in cmp_func: Eina_Compare_Cb; [[The comparing function to be used to sort list - items by #Elm.Widget.Item item handles. This function will - receive two items and compare them, returning a non-negative integer - if the second item should be place after the first, or negative value - if should be placed before.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Gfx.Entity.position { set; } - Efl.Gfx.Entity.size { set; } - Efl.Canvas.Group.group_member_add; - 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.L10n.translation_update; - Efl.Ui.Widget.widget_sub_object_del; - Efl.Ui.Widget.widget_event; - Efl.Ui.Widget.focused_item { get; } - Efl.Ui.Widget.focus_state_apply; - Elm.Interface_Scrollable.item_loop_enabled { get; set; } - Elm.Interface_Scrollable.policy { set; } - 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; - } - events { - 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_eo.c b/src/lib/elementary/elm_list_eo.c new file mode 100644 index 0000000000..9668aa5e07 --- /dev/null +++ b/src/lib/elementary/elm_list_eo.c @@ -0,0 +1,368 @@ +EWAPI const Efl_Event_Description _ELM_LIST_EVENT_ACTIVATED = + EFL_EVENT_DESCRIPTION("activated"); +EWAPI const Efl_Event_Description _ELM_LIST_EVENT_EDGE_TOP = + EFL_EVENT_DESCRIPTION("edge,top"); +EWAPI const Efl_Event_Description _ELM_LIST_EVENT_EDGE_BOTTOM = + EFL_EVENT_DESCRIPTION("edge,bottom"); +EWAPI const Efl_Event_Description _ELM_LIST_EVENT_EDGE_LEFT = + EFL_EVENT_DESCRIPTION("edge,left"); +EWAPI const Efl_Event_Description _ELM_LIST_EVENT_EDGE_RIGHT = + EFL_EVENT_DESCRIPTION("edge,right"); +EWAPI const Efl_Event_Description _ELM_LIST_EVENT_SWIPE = + EFL_EVENT_DESCRIPTION("swipe"); +EWAPI const Efl_Event_Description _ELM_LIST_EVENT_HIGHLIGHTED = + EFL_EVENT_DESCRIPTION("highlighted"); +EWAPI const Efl_Event_Description _ELM_LIST_EVENT_UNHIGHLIGHTED = + EFL_EVENT_DESCRIPTION("unhighlighted"); +EWAPI const Efl_Event_Description _ELM_LIST_EVENT_ITEM_FOCUSED = + EFL_EVENT_DESCRIPTION("item,focused"); +EWAPI const Efl_Event_Description _ELM_LIST_EVENT_ITEM_UNFOCUSED = + EFL_EVENT_DESCRIPTION("item,unfocused"); + +void _elm_list_horizontal_set(Eo *obj, Elm_List_Data *pd, Eina_Bool horizontal); + + +static Eina_Error +__eolian_elm_list_horizontal_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_list_horizontal_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_list_horizontal_set, EFL_FUNC_CALL(horizontal), Eina_Bool horizontal); + +Eina_Bool _elm_list_horizontal_get(const Eo *obj, Elm_List_Data *pd); + + +static Eina_Value +__eolian_elm_list_horizontal_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_list_horizontal_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_list_horizontal_get, Eina_Bool, 0); + +void _elm_list_select_mode_set(Eo *obj, Elm_List_Data *pd, Elm_Object_Select_Mode mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_list_select_mode_set, EFL_FUNC_CALL(mode), Elm_Object_Select_Mode mode); + +Elm_Object_Select_Mode _elm_list_select_mode_get(const Eo *obj, Elm_List_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_list_select_mode_get, Elm_Object_Select_Mode, 4 /* Elm.Object.Select_Mode.max */); + +void _elm_list_focus_on_selection_set(Eo *obj, Elm_List_Data *pd, Eina_Bool enabled); + + +static Eina_Error +__eolian_elm_list_focus_on_selection_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_list_focus_on_selection_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_list_focus_on_selection_set, EFL_FUNC_CALL(enabled), Eina_Bool enabled); + +Eina_Bool _elm_list_focus_on_selection_get(const Eo *obj, Elm_List_Data *pd); + + +static Eina_Value +__eolian_elm_list_focus_on_selection_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_list_focus_on_selection_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_list_focus_on_selection_get, Eina_Bool, 0); + +void _elm_list_multi_select_set(Eo *obj, Elm_List_Data *pd, Eina_Bool multi); + + +static Eina_Error +__eolian_elm_list_multi_select_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_list_multi_select_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_list_multi_select_set, EFL_FUNC_CALL(multi), Eina_Bool multi); + +Eina_Bool _elm_list_multi_select_get(const Eo *obj, Elm_List_Data *pd); + + +static Eina_Value +__eolian_elm_list_multi_select_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_list_multi_select_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_list_multi_select_get, Eina_Bool, 0); + +void _elm_list_multi_select_mode_set(Eo *obj, Elm_List_Data *pd, Elm_Object_Multi_Select_Mode mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_list_multi_select_mode_set, EFL_FUNC_CALL(mode), Elm_Object_Multi_Select_Mode mode); + +Elm_Object_Multi_Select_Mode _elm_list_multi_select_mode_get(const Eo *obj, Elm_List_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_list_multi_select_mode_get, Elm_Object_Multi_Select_Mode, 2 /* Elm.Object.Multi_Select_Mode.max */); + +void _elm_list_mode_set(Eo *obj, Elm_List_Data *pd, Elm_List_Mode mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_list_mode_set, EFL_FUNC_CALL(mode), Elm_List_Mode mode); + +Elm_List_Mode _elm_list_mode_get(const Eo *obj, Elm_List_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_list_mode_get, Elm_List_Mode, 4 /* Elm.List.Mode.last */); + +Elm_Widget_Item *_elm_list_selected_item_get(const Eo *obj, Elm_List_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_list_selected_item_get, Elm_Widget_Item *, NULL); + +const Eina_List *_elm_list_items_get(const Eo *obj, Elm_List_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_list_items_get, const Eina_List *, NULL); + +Elm_Widget_Item *_elm_list_first_item_get(const Eo *obj, Elm_List_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_list_first_item_get, Elm_Widget_Item *, NULL); + +const Eina_List *_elm_list_selected_items_get(const Eo *obj, Elm_List_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_list_selected_items_get, const Eina_List *, NULL); + +Elm_Widget_Item *_elm_list_last_item_get(const Eo *obj, Elm_List_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_list_last_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_list_item_insert_before(Eo *obj, Elm_List_Data *pd, Elm_Widget_Item *before, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_list_item_insert_before, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(before, label, icon, end, func, data), Elm_Widget_Item *before, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data); + +void _elm_list_go(Eo *obj, Elm_List_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_list_go); + +Elm_Widget_Item *_elm_list_item_insert_after(Eo *obj, Elm_List_Data *pd, Elm_Widget_Item *after, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_list_item_insert_after, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(after, label, icon, end, func, data), Elm_Widget_Item *after, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data); + +Elm_Widget_Item *_elm_list_at_xy_item_get(const Eo *obj, Elm_List_Data *pd, int x, int y, int *posret); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_list_at_xy_item_get, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(x, y, posret), int x, int y, int *posret); + +Elm_Widget_Item *_elm_list_item_append(Eo *obj, Elm_List_Data *pd, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_list_item_append, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(label, icon, end, func, data), const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data); + +Elm_Widget_Item *_elm_list_item_prepend(Eo *obj, Elm_List_Data *pd, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_list_item_prepend, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(label, icon, end, func, data), const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data); + +void _elm_list_clear(Eo *obj, Elm_List_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_list_clear); + +Elm_Widget_Item *_elm_list_item_sorted_insert(Eo *obj, Elm_List_Data *pd, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func); + +EOAPI EFL_FUNC_BODYV(elm_obj_list_item_sorted_insert, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(label, icon, end, func, data, cmp_func), const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func); + +Efl_Object *_elm_list_efl_object_constructor(Eo *obj, Elm_List_Data *pd); + + +void _elm_list_efl_gfx_entity_position_set(Eo *obj, Elm_List_Data *pd, Eina_Position2D pos); + + +void _elm_list_efl_gfx_entity_size_set(Eo *obj, Elm_List_Data *pd, Eina_Size2D size); + + +void _elm_list_efl_canvas_group_group_member_add(Eo *obj, Elm_List_Data *pd, Efl_Canvas_Object *sub_obj); + + +Eina_Error _elm_list_efl_ui_widget_theme_apply(Eo *obj, Elm_List_Data *pd); + + +void _elm_list_efl_ui_widget_on_access_update(Eo *obj, Elm_List_Data *pd, Eina_Bool enable); + + +Eina_Rect _elm_list_efl_ui_widget_focus_highlight_geometry_get(const Eo *obj, Elm_List_Data *pd); + + +void _elm_list_efl_ui_widget_disabled_set(Eo *obj, Elm_List_Data *pd, Eina_Bool disabled); + + +Eina_Bool _elm_list_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_List_Data *pd); + + +void _elm_list_efl_ui_l10n_translation_update(Eo *obj, Elm_List_Data *pd); + + +Eina_Bool _elm_list_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_List_Data *pd, Efl_Canvas_Object *sub_obj); + + +Eina_Bool _elm_list_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_List_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +Elm_Widget_Item *_elm_list_elm_widget_item_container_focused_item_get(const Eo *obj, Elm_List_Data *pd); + + +Eina_Bool _elm_list_efl_ui_widget_focus_state_apply(Eo *obj, Elm_List_Data *pd, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect); + + +void _elm_list_elm_interface_scrollable_item_loop_enabled_set(Eo *obj, Elm_List_Data *pd, Eina_Bool enable); + + +Eina_Bool _elm_list_elm_interface_scrollable_item_loop_enabled_get(const Eo *obj, Elm_List_Data *pd); + + +void _elm_list_elm_interface_scrollable_policy_set(Eo *obj, Elm_List_Data *pd, Elm_Scroller_Policy hbar, Elm_Scroller_Policy vbar); + + +const Efl_Access_Action_Data *_elm_list_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_List_Data *pd); + + +Eina_List *_elm_list_efl_access_object_access_children_get(const Eo *obj, Elm_List_Data *pd); + + +int _elm_list_efl_access_selection_selected_children_count_get(const Eo *obj, Elm_List_Data *pd); + + +Efl_Object *_elm_list_efl_access_selection_selected_child_get(const Eo *obj, Elm_List_Data *pd, int selected_child_index); + + +Eina_Bool _elm_list_efl_access_selection_selected_child_deselect(Eo *obj, Elm_List_Data *pd, int child_index); + + +Eina_Bool _elm_list_efl_access_selection_child_select(Eo *obj, Elm_List_Data *pd, int child_index); + + +Eina_Bool _elm_list_efl_access_selection_child_deselect(Eo *obj, Elm_List_Data *pd, int child_index); + + +Eina_Bool _elm_list_efl_access_selection_is_child_selected(Eo *obj, Elm_List_Data *pd, int child_index); + + +Eina_Bool _elm_list_efl_access_selection_all_children_select(Eo *obj, Elm_List_Data *pd); + + +Eina_Bool _elm_list_efl_access_selection_access_selection_clear(Eo *obj, Elm_List_Data *pd); + + +static Eina_Bool +_elm_list_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_LIST_EXTRA_OPS +#define ELM_LIST_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_list_horizontal_set, _elm_list_horizontal_set), + EFL_OBJECT_OP_FUNC(elm_obj_list_horizontal_get, _elm_list_horizontal_get), + EFL_OBJECT_OP_FUNC(elm_obj_list_select_mode_set, _elm_list_select_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_list_select_mode_get, _elm_list_select_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_list_focus_on_selection_set, _elm_list_focus_on_selection_set), + EFL_OBJECT_OP_FUNC(elm_obj_list_focus_on_selection_get, _elm_list_focus_on_selection_get), + EFL_OBJECT_OP_FUNC(elm_obj_list_multi_select_set, _elm_list_multi_select_set), + EFL_OBJECT_OP_FUNC(elm_obj_list_multi_select_get, _elm_list_multi_select_get), + EFL_OBJECT_OP_FUNC(elm_obj_list_multi_select_mode_set, _elm_list_multi_select_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_list_multi_select_mode_get, _elm_list_multi_select_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_list_mode_set, _elm_list_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_list_mode_get, _elm_list_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_list_selected_item_get, _elm_list_selected_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_list_items_get, _elm_list_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_list_first_item_get, _elm_list_first_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_list_selected_items_get, _elm_list_selected_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_list_last_item_get, _elm_list_last_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_list_item_insert_before, _elm_list_item_insert_before), + EFL_OBJECT_OP_FUNC(elm_obj_list_go, _elm_list_go), + EFL_OBJECT_OP_FUNC(elm_obj_list_item_insert_after, _elm_list_item_insert_after), + EFL_OBJECT_OP_FUNC(elm_obj_list_at_xy_item_get, _elm_list_at_xy_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_list_item_append, _elm_list_item_append), + EFL_OBJECT_OP_FUNC(elm_obj_list_item_prepend, _elm_list_item_prepend), + EFL_OBJECT_OP_FUNC(elm_obj_list_clear, _elm_list_clear), + EFL_OBJECT_OP_FUNC(elm_obj_list_item_sorted_insert, _elm_list_item_sorted_insert), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_list_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_list_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_list_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_canvas_group_member_add, _elm_list_efl_canvas_group_group_member_add), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_list_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_list_efl_ui_widget_on_access_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_highlight_geometry_get, _elm_list_efl_ui_widget_focus_highlight_geometry_get), + EFL_OBJECT_OP_FUNC(efl_ui_widget_disabled_set, _elm_list_efl_ui_widget_disabled_set), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_on_focus_update, _elm_list_efl_ui_focus_object_on_focus_update), + EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_list_efl_ui_l10n_translation_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _elm_list_efl_ui_widget_widget_sub_object_del), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_list_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(elm_widget_item_container_focused_item_get, _elm_list_elm_widget_item_container_focused_item_get), + EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_state_apply, _elm_list_efl_ui_widget_focus_state_apply), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_item_loop_enabled_set, _elm_list_elm_interface_scrollable_item_loop_enabled_set), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_item_loop_enabled_get, _elm_list_elm_interface_scrollable_item_loop_enabled_get), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_policy_set, _elm_list_elm_interface_scrollable_policy_set), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_list_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_access_object_access_children_get, _elm_list_efl_access_object_access_children_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_children_count_get, _elm_list_efl_access_selection_selected_children_count_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_child_get, _elm_list_efl_access_selection_selected_child_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_child_deselect, _elm_list_efl_access_selection_selected_child_deselect), + EFL_OBJECT_OP_FUNC(efl_access_selection_child_select, _elm_list_efl_access_selection_child_select), + EFL_OBJECT_OP_FUNC(efl_access_selection_child_deselect, _elm_list_efl_access_selection_child_deselect), + EFL_OBJECT_OP_FUNC(efl_access_selection_is_child_selected, _elm_list_efl_access_selection_is_child_selected), + EFL_OBJECT_OP_FUNC(efl_access_selection_all_children_select, _elm_list_efl_access_selection_all_children_select), + EFL_OBJECT_OP_FUNC(efl_access_selection_clear, _elm_list_efl_access_selection_access_selection_clear), + ELM_LIST_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"horizontal", __eolian_elm_list_horizontal_set_reflect, __eolian_elm_list_horizontal_get_reflect}, + {"focus_on_selection", __eolian_elm_list_focus_on_selection_set_reflect, __eolian_elm_list_focus_on_selection_get_reflect}, + {"multi_select", __eolian_elm_list_multi_select_set_reflect, __eolian_elm_list_multi_select_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_list_class_desc = { + EO_VERSION, + "Elm.List", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_List_Data), + _elm_list_class_initializer, + _elm_list_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_list_class_get, &_elm_list_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_ACCESS_OBJECT_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); + +#include "elm_list_eo.legacy.c" diff --git a/src/lib/elementary/elm_list_eo.h b/src/lib/elementary/elm_list_eo.h new file mode 100644 index 0000000000..4587ed0744 --- /dev/null +++ b/src/lib/elementary/elm_list_eo.h @@ -0,0 +1,640 @@ +#ifndef _ELM_LIST_EO_H_ +#define _ELM_LIST_EO_H_ + +#ifndef _ELM_LIST_EO_CLASS_TYPE +#define _ELM_LIST_EO_CLASS_TYPE + +typedef Eo Elm_List; + +#endif + +#ifndef _ELM_LIST_EO_TYPES +#define _ELM_LIST_EO_TYPES + + +#endif +/** Elementary list class + * + * @ingroup Elm_List + */ +#define ELM_LIST_CLASS elm_list_class_get() + +EWAPI const Efl_Class *elm_list_class_get(void); + +/** + * @brief Control horizontal mode on the list object. + * + * @note Vertical mode is set by default. + * + * On horizontal mode items are displayed on list from left to right, instead + * of from top to bottom. Also, the list will scroll horizontally. Each item + * will presents left icon on top and right icon, or end, at the bottom. + * + * @param[in] obj The object. + * @param[in] horizontal @c true to enable horizontal or @c false to disable + * it, i.e., to enable vertical mode. + * + * @ingroup Elm_List + */ +EOAPI void elm_obj_list_horizontal_set(Eo *obj, Eina_Bool horizontal); + +/** + * @brief Control horizontal mode on the list object. + * + * @note Vertical mode is set by default. + * + * On horizontal mode items are displayed on list from left to right, instead + * of from top to bottom. Also, the list will scroll horizontally. Each item + * will presents left icon on top and right icon, or end, at the bottom. + * + * @param[in] obj The object. + * + * @return @c true to enable horizontal or @c false to disable it, i.e., to + * enable vertical mode. + * + * @ingroup Elm_List + */ +EOAPI Eina_Bool elm_obj_list_horizontal_get(const Eo *obj); + +/** + * @brief Control the list select mode. + * + * elm_list_select_mode_set() changes item select mode in the list widget. - + * #ELM_OBJECT_SELECT_MODE_DEFAULT : Items will only call their selection func + * and callback when first becoming selected. Any further clicks will do + * nothing, unless you set always select mode. - #ELM_OBJECT_SELECT_MODE_ALWAYS + * : This means that, even if selected, every click will make the selected + * callbacks be called. - #ELM_OBJECT_SELECT_MODE_NONE : This will turn off the + * ability to select items entirely and they will neither appear selected nor + * call selected callback functions. + * + * @param[in] obj The object. + * @param[in] mode The select mode + * + * @ingroup Elm_List + */ +EOAPI void elm_obj_list_select_mode_set(Eo *obj, Elm_Object_Select_Mode mode); + +/** + * @brief Control the list select mode. + * + * elm_list_select_mode_set() changes item select mode in the list widget. - + * #ELM_OBJECT_SELECT_MODE_DEFAULT : Items will only call their selection func + * and callback when first becoming selected. Any further clicks will do + * nothing, unless you set always select mode. - #ELM_OBJECT_SELECT_MODE_ALWAYS + * : This means that, even if selected, every click will make the selected + * callbacks be called. - #ELM_OBJECT_SELECT_MODE_NONE : This will turn off the + * ability to select items entirely and they will neither appear selected nor + * call selected callback functions. + * + * @param[in] obj The object. + * + * @return The select mode + * + * @ingroup Elm_List + */ +EOAPI Elm_Object_Select_Mode elm_obj_list_select_mode_get(const Eo *obj); + +/** + * @brief Control focus upon items selection mode + * + * When enabled, every selection of an item inside the genlist will + * automatically set focus to its first focusable widget from the left. This is + * true of course if the selection was made by clicking an unfocusable area in + * an item or selecting it with a key movement. Clicking on a focusable widget + * inside an item will cause this particular item to get focus as usual. + * + * @param[in] obj The object. + * @param[in] enabled The tree effect status ($true = enabled, @c false = + * disabled) + * + * @ingroup Elm_List + */ +EOAPI void elm_obj_list_focus_on_selection_set(Eo *obj, Eina_Bool enabled); + +/** + * @brief Control focus upon items selection mode + * + * When enabled, every selection of an item inside the genlist will + * automatically set focus to its first focusable widget from the left. This is + * true of course if the selection was made by clicking an unfocusable area in + * an item or selecting it with a key movement. Clicking on a focusable widget + * inside an item will cause this particular item to get focus as usual. + * + * @param[in] obj The object. + * + * @return The tree effect status ($true = enabled, @c false = disabled) + * + * @ingroup Elm_List + */ +EOAPI Eina_Bool elm_obj_list_focus_on_selection_get(const Eo *obj); + +/** + * @brief Control multiple items selection on the list object. + * + * Disabled by default. If disabled, the user can select a single item of the + * list each time. Selected items are highlighted on list. If enabled, many + * items can be selected. + * + * If a selected item is selected again, it will be unselected. + * + * @param[in] obj The object. + * @param[in] multi @c true to enable multi selection or @c false to disable + * it. + * + * @ingroup Elm_List + */ +EOAPI void elm_obj_list_multi_select_set(Eo *obj, Eina_Bool multi); + +/** + * @brief Control multiple items selection on the list object. + * + * Disabled by default. If disabled, the user can select a single item of the + * list each time. Selected items are highlighted on list. If enabled, many + * items can be selected. + * + * If a selected item is selected again, it will be unselected. + * + * @param[in] obj The object. + * + * @return @c true to enable multi selection or @c false to disable it. + * + * @ingroup Elm_List + */ +EOAPI Eina_Bool elm_obj_list_multi_select_get(const Eo *obj); + +/** + * @brief Control the list multi select mode. + * + * - #ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT : select/unselect items whenever + * each item is clicked. - #ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL : Only + * one item will be selected although multi-selection is enabled, if clicked + * without pressing control key. This mode is only available with + * multi-selection. + * + * See: @ref elm_obj_list_multi_select_get + * + * @param[in] obj The object. + * @param[in] mode The multi select mode + * + * @since 1.8 + * + * @ingroup Elm_List + */ +EOAPI void elm_obj_list_multi_select_mode_set(Eo *obj, Elm_Object_Multi_Select_Mode mode); + +/** + * @brief Control the list multi select mode. + * + * - #ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT : select/unselect items whenever + * each item is clicked. - #ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL : Only + * one item will be selected although multi-selection is enabled, if clicked + * without pressing control key. This mode is only available with + * multi-selection. + * + * See: @ref elm_obj_list_multi_select_get + * + * @param[in] obj The object. + * + * @return The multi select mode + * + * @since 1.8 + * + * @ingroup Elm_List + */ +EOAPI Elm_Object_Multi_Select_Mode elm_obj_list_multi_select_mode_get(const Eo *obj); + +/** + * @brief Control which mode to use for the list object. + * + * Set list's resize behavior, transverse axis scroll and items cropping. See + * each mode's description for more details. + * + * @note Default value is #ELM_LIST_SCROLL. + * + * Only one mode at a time can be set. If a previous one was set, it will be + * changed by the new mode after this call. Bitmasks won't work here as well. + * + * @warning This function's behavior will clash with those of + * elm_scroller_content_min_limit(), so use either one of them, but not both. + * + * @param[in] obj The object. + * @param[in] mode One of #Elm_List_Mode: #ELM_LIST_COMPRESS, #ELM_LIST_SCROLL, + * #ELM_LIST_LIMIT or #ELM_LIST_EXPAND. + * + * @ingroup Elm_List + */ +EOAPI void elm_obj_list_mode_set(Eo *obj, Elm_List_Mode mode); + +/** + * @brief Control which mode to use for the list object. + * + * Set list's resize behavior, transverse axis scroll and items cropping. See + * each mode's description for more details. + * + * @note Default value is #ELM_LIST_SCROLL. + * + * Only one mode at a time can be set. If a previous one was set, it will be + * changed by the new mode after this call. Bitmasks won't work here as well. + * + * @warning This function's behavior will clash with those of + * elm_scroller_content_min_limit(), so use either one of them, but not both. + * + * @param[in] obj The object. + * + * @return One of #Elm_List_Mode: #ELM_LIST_COMPRESS, #ELM_LIST_SCROLL, + * #ELM_LIST_LIMIT or #ELM_LIST_EXPAND. + * + * @ingroup Elm_List + */ +EOAPI Elm_List_Mode elm_obj_list_mode_get(const Eo *obj); + +/** + * @brief Get the selected item. + * + * The selected item can be unselected with function + * elm_list_item_selected_set(). + * + * The selected item always will be highlighted on list. + * + * @param[in] obj The object. + * + * @return The selected list item. + * + * @ingroup Elm_List + */ +EOAPI Elm_Widget_Item *elm_obj_list_selected_item_get(const Eo *obj); + +/** + * @brief Get a list of all the list items. + * + * @param[in] obj The object. + * + * @return A @c list of list items, #Elm.Widget.Item, or @c NULL on failure. + * + * @ingroup Elm_List + */ +EOAPI const Eina_List *elm_obj_list_items_get(const Eo *obj); + +/** + * @brief Get the first item in the list + * + * This returns the first item in the list. + * + * @param[in] obj The object. + * + * @return The first item, or NULL if none + * + * @ingroup Elm_List + */ +EOAPI Elm_Widget_Item *elm_obj_list_first_item_get(const Eo *obj); + +/** + * @brief Return a list of the currently selected list items. + * + * Multiple items can be selected if multi select is enabled. It can be done + * with elm_list_multi_select_set(). + * + * @param[in] obj The object. + * + * @return An @c list of list items, #Elm.Widget.Item, or @c NULL on failure. + * + * @ingroup Elm_List + */ +EOAPI const Eina_List *elm_obj_list_selected_items_get(const Eo *obj); + +/** + * @brief Get the last item in the list + * + * This returns the last item in the list. + * + * @param[in] obj The object. + * + * @return The last item, or NULL if none + * + * @ingroup Elm_List + */ +EOAPI Elm_Widget_Item *elm_obj_list_last_item_get(const Eo *obj); + +/** + * @brief Insert a new item into the list object before item @c before. + * + * A new item will be created and added to the list. Its position in this list + * will be just before item @c before. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If always select + * is enabled it will call this function every time user clicks over an item + * (already selected or not). If such function isn't needed, just passing + * @c NULL as @c func is enough. The same should be done for @c data. + * + * @note Remember that the label parameter is copied inside the list. So if an + * application dynamically allocated the label, the application should free the + * label after this call. + * + * @param[in] obj The object. + * @param[in] before The list item to insert before. + * @param[in] label The label of the list item. + * @param[in] icon The icon object to use for the left side of the item. An + * icon can be any Evas object, but usually it is an icon created with + * elm_icon_add(). + * @param[in] end The icon object to use for the right side of the item. An + * icon can be any Evas object. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_List + */ +EOAPI Elm_Widget_Item *elm_obj_list_item_insert_before(Eo *obj, Elm_Widget_Item *before, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data); + +/** + * @brief Starts the list. + * + * @note Call before running show() on the list object. Warning: If not called, + * it won't display the list properly. + * @param[in] obj The object. + * + * @ingroup Elm_List + */ +EOAPI void elm_obj_list_go(Eo *obj); + +/** + * @brief Insert a new item into the list object after item @c after. + * + * A new item will be created and added to the list. Its position in this list + * will be just after item @c after. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If always select + * is enabled it will call this function every time user clicks over an item + * (already selected or not). If such function isn't needed, just passing + * @c NULL as @c func is enough. The same should be done for @c data. + * + * @note Remember that the label parameter is copied inside the list. So if an + * application dynamically allocated the label, the application should free the + * label after this call. + * + * @param[in] obj The object. + * @param[in] after The list item to insert after. + * @param[in] label The label of the list item. + * @param[in] icon The icon object to use for the left side of the item. An + * icon can be any Evas object, but usually it is an icon created with + * elm_icon_add(). + * @param[in] end The icon object to use for the right side of the item. An + * icon can be any Evas object. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_List + */ +EOAPI Elm_Widget_Item *elm_obj_list_item_insert_after(Eo *obj, Elm_Widget_Item *after, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data); + +/** + * @brief Get the item that is at the x, y canvas coords. + * + * This returns the item at the given coordinates (which are canvas relative, + * not object-relative). If an item is at that coordinate, that item handle is + * returned, and if @c posret is not NULL, the integer pointed to is set to a + * value of -1, 0 or 1, depending if the coordinate is on the upper portion of + * that item (-1), on the middle section (0) or on the lower part (1). If NULL + * is returned as an item (no item found there), then posret may indicate -1 or + * 1 based if the coordinate is above or below all items respectively in the + * list. + * + * @param[in] obj The object. + * @param[in] x The input x coordinate + * @param[in] y The input y coordinate + * @param[out] posret The position relative to the item returned here + * + * @return The item at the coordinates or NULL if none + * + * @ingroup Elm_List + */ +EOAPI Elm_Widget_Item *elm_obj_list_at_xy_item_get(const Eo *obj, int x, int y, int *posret); + +/** + * @brief Append a new item to the list object. + * + * A new item will be created and appended to the list, i.e., will be set as + * last item. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If always select + * is enabled it will call this function every time user clicks over an item + * (already selected or not). If such function isn't needed, just passing + * @c NULL as @c func is enough. The same should be done for @c data. + * + * @note Remember that the label parameter is copied inside the list. So if an + * application dynamically allocated the label, the application should free the + * label after this call. + * + * @param[in] obj The object. + * @param[in] label The label of the list item. + * @param[in] icon The icon object to use for the left side of the item. An + * icon can be any Evas object, but usually it is an icon created with + * elm_icon_add(). + * @param[in] end The icon object to use for the right side of the item. An + * icon can be any Evas object. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_List + */ +EOAPI Elm_Widget_Item *elm_obj_list_item_append(Eo *obj, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data); + +/** + * @brief Prepend a new item to the list object. + * + * A new item will be created and prepended to the list, i.e., will be set as + * first item. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If always select + * is enabled it will call this function every time user clicks over an item + * (already selected or not). If such function isn't needed, just passing + * @c NULL as @c func is enough. The same should be done for @c data. + * + * @note Remember that the label parameter is copied inside the list. So if an + * application dynamically allocated the label, the application should free the + * label after this call. + * + * @param[in] obj The object. + * @param[in] label The label of the list item. + * @param[in] icon The icon object to use for the left side of the item. An + * icon can be any Evas object, but usually it is an icon created with + * elm_icon_add(). + * @param[in] end The icon object to use for the right side of the item. An + * icon can be any Evas object. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_List + */ +EOAPI Elm_Widget_Item *elm_obj_list_item_prepend(Eo *obj, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data); + +/** Remove all list's items. + * + * @ingroup Elm_List + */ +EOAPI void elm_obj_list_clear(Eo *obj); + +/** + * @brief Insert a new item into the sorted list object. + * + * @note This function inserts values into a list object assuming it was sorted + * and the result will be sorted. + * + * A new item will be created and added to the list. Its position in this list + * will be found comparing the new item with previously inserted items using + * function @c cmp_func. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If always select + * is enabled it will call this function every time user clicks over an item + * (already selected or not). If such function isn't needed, just passing + * @c NULL as @c func is enough. The same should be done for @c data. + * + * @note Remember that the label parameter is copied inside the list. So if an + * application dynamically allocated the label, the application should free the + * label after this call. + * + * @param[in] obj The object. + * @param[in] label The label of the list item. + * @param[in] icon The icon object to use for the left side of the item. An + * icon can be any Evas object, but usually it is an icon created with + * elm_icon_add(). + * @param[in] end The icon object to use for the right side of the item. An + * icon can be any Evas object. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * @param[in] cmp_func The comparing function to be used to sort list items by + * #Elm.Widget.Item item handles. This function will receive two items and + * compare them, returning a non-negative integer if the second item should be + * place after the first, or negative value if should be placed before. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_List + */ +EOAPI Elm_Widget_Item *elm_obj_list_item_sorted_insert(Eo *obj, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func); + +EWAPI extern const Efl_Event_Description _ELM_LIST_EVENT_ACTIVATED; + +/** Called when activated + * @return Efl_Object * + * + * @ingroup Elm_List + */ +#define ELM_LIST_EVENT_ACTIVATED (&(_ELM_LIST_EVENT_ACTIVATED)) + +EWAPI extern const Efl_Event_Description _ELM_LIST_EVENT_EDGE_TOP; + +/** Called when top edge was reached + * + * @ingroup Elm_List + */ +#define ELM_LIST_EVENT_EDGE_TOP (&(_ELM_LIST_EVENT_EDGE_TOP)) + +EWAPI extern const Efl_Event_Description _ELM_LIST_EVENT_EDGE_BOTTOM; + +/** Called when bottom edge was reached + * + * @ingroup Elm_List + */ +#define ELM_LIST_EVENT_EDGE_BOTTOM (&(_ELM_LIST_EVENT_EDGE_BOTTOM)) + +EWAPI extern const Efl_Event_Description _ELM_LIST_EVENT_EDGE_LEFT; + +/** Called when left edge was reached + * + * @ingroup Elm_List + */ +#define ELM_LIST_EVENT_EDGE_LEFT (&(_ELM_LIST_EVENT_EDGE_LEFT)) + +EWAPI extern const Efl_Event_Description _ELM_LIST_EVENT_EDGE_RIGHT; + +/** Called when right edge was reached + * + * @ingroup Elm_List + */ +#define ELM_LIST_EVENT_EDGE_RIGHT (&(_ELM_LIST_EVENT_EDGE_RIGHT)) + +EWAPI extern const Efl_Event_Description _ELM_LIST_EVENT_SWIPE; + +/** Called when swipe is detected + * @return Efl_Object * + * + * @ingroup Elm_List + */ +#define ELM_LIST_EVENT_SWIPE (&(_ELM_LIST_EVENT_SWIPE)) + +EWAPI extern const Efl_Event_Description _ELM_LIST_EVENT_HIGHLIGHTED; + +/** Called when highlighted + * @return Efl_Object * + * + * @ingroup Elm_List + */ +#define ELM_LIST_EVENT_HIGHLIGHTED (&(_ELM_LIST_EVENT_HIGHLIGHTED)) + +EWAPI extern const Efl_Event_Description _ELM_LIST_EVENT_UNHIGHLIGHTED; + +/** Called when no longer highlighted + * @return Efl_Object * + * + * @ingroup Elm_List + */ +#define ELM_LIST_EVENT_UNHIGHLIGHTED (&(_ELM_LIST_EVENT_UNHIGHLIGHTED)) + +EWAPI extern const Efl_Event_Description _ELM_LIST_EVENT_ITEM_FOCUSED; + +/** Called when item got focus + * @return Efl_Object * + * + * @ingroup Elm_List + */ +#define ELM_LIST_EVENT_ITEM_FOCUSED (&(_ELM_LIST_EVENT_ITEM_FOCUSED)) + +EWAPI extern const Efl_Event_Description _ELM_LIST_EVENT_ITEM_UNFOCUSED; + +/** Called when item no longer has focus + * @return Efl_Object * + * + * @ingroup Elm_List + */ +#define ELM_LIST_EVENT_ITEM_UNFOCUSED (&(_ELM_LIST_EVENT_ITEM_UNFOCUSED)) + +#endif diff --git a/src/lib/elementary/elm_list_eo.legacy.c b/src/lib/elementary/elm_list_eo.legacy.c new file mode 100644 index 0000000000..40f09ef183 --- /dev/null +++ b/src/lib/elementary/elm_list_eo.legacy.c @@ -0,0 +1,150 @@ + +EAPI void +elm_list_horizontal_set(Elm_List *obj, Eina_Bool horizontal) +{ + elm_obj_list_horizontal_set(obj, horizontal); +} + +EAPI Eina_Bool +elm_list_horizontal_get(const Elm_List *obj) +{ + return elm_obj_list_horizontal_get(obj); +} + +EAPI void +elm_list_select_mode_set(Elm_List *obj, Elm_Object_Select_Mode mode) +{ + elm_obj_list_select_mode_set(obj, mode); +} + +EAPI Elm_Object_Select_Mode +elm_list_select_mode_get(const Elm_List *obj) +{ + return elm_obj_list_select_mode_get(obj); +} + +EAPI void +elm_list_focus_on_selection_set(Elm_List *obj, Eina_Bool enabled) +{ + elm_obj_list_focus_on_selection_set(obj, enabled); +} + +EAPI Eina_Bool +elm_list_focus_on_selection_get(const Elm_List *obj) +{ + return elm_obj_list_focus_on_selection_get(obj); +} + +EAPI void +elm_list_multi_select_set(Elm_List *obj, Eina_Bool multi) +{ + elm_obj_list_multi_select_set(obj, multi); +} + +EAPI Eina_Bool +elm_list_multi_select_get(const Elm_List *obj) +{ + return elm_obj_list_multi_select_get(obj); +} + +EAPI void +elm_list_multi_select_mode_set(Elm_List *obj, Elm_Object_Multi_Select_Mode mode) +{ + elm_obj_list_multi_select_mode_set(obj, mode); +} + +EAPI Elm_Object_Multi_Select_Mode +elm_list_multi_select_mode_get(const Elm_List *obj) +{ + return elm_obj_list_multi_select_mode_get(obj); +} + +EAPI void +elm_list_mode_set(Elm_List *obj, Elm_List_Mode mode) +{ + elm_obj_list_mode_set(obj, mode); +} + +EAPI Elm_List_Mode +elm_list_mode_get(const Elm_List *obj) +{ + return elm_obj_list_mode_get(obj); +} + +EAPI Elm_Widget_Item * +elm_list_selected_item_get(const Elm_List *obj) +{ + return elm_obj_list_selected_item_get(obj); +} + +EAPI const Eina_List * +elm_list_items_get(const Elm_List *obj) +{ + return elm_obj_list_items_get(obj); +} + +EAPI Elm_Widget_Item * +elm_list_first_item_get(const Elm_List *obj) +{ + return elm_obj_list_first_item_get(obj); +} + +EAPI const Eina_List * +elm_list_selected_items_get(const Elm_List *obj) +{ + return elm_obj_list_selected_items_get(obj); +} + +EAPI Elm_Widget_Item * +elm_list_last_item_get(const Elm_List *obj) +{ + return elm_obj_list_last_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_list_item_insert_before(Elm_List *obj, Elm_Widget_Item *before, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_list_item_insert_before(obj, before, label, icon, end, func, data); +} + +EAPI void +elm_list_go(Elm_List *obj) +{ + elm_obj_list_go(obj); +} + +EAPI Elm_Widget_Item * +elm_list_item_insert_after(Elm_List *obj, Elm_Widget_Item *after, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_list_item_insert_after(obj, after, label, icon, end, func, data); +} + +EAPI Elm_Widget_Item * +elm_list_at_xy_item_get(const Elm_List *obj, int x, int y, int *posret) +{ + return elm_obj_list_at_xy_item_get(obj, x, y, posret); +} + +EAPI Elm_Widget_Item * +elm_list_item_append(Elm_List *obj, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_list_item_append(obj, label, icon, end, func, data); +} + +EAPI Elm_Widget_Item * +elm_list_item_prepend(Elm_List *obj, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_list_item_prepend(obj, label, icon, end, func, data); +} + +EAPI void +elm_list_clear(Elm_List *obj) +{ + elm_obj_list_clear(obj); +} + +EAPI Elm_Widget_Item * +elm_list_item_sorted_insert(Elm_List *obj, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func) +{ + return elm_obj_list_item_sorted_insert(obj, label, icon, end, func, data, cmp_func); +} diff --git a/src/lib/elementary/elm_list_eo.legacy.h b/src/lib/elementary/elm_list_eo.legacy.h new file mode 100644 index 0000000000..6885674baf --- /dev/null +++ b/src/lib/elementary/elm_list_eo.legacy.h @@ -0,0 +1,547 @@ +#ifndef _ELM_LIST_EO_LEGACY_H_ +#define _ELM_LIST_EO_LEGACY_H_ + +#ifndef _ELM_LIST_EO_CLASS_TYPE +#define _ELM_LIST_EO_CLASS_TYPE + +typedef Eo Elm_List; + +#endif + +#ifndef _ELM_LIST_EO_TYPES +#define _ELM_LIST_EO_TYPES + + +#endif + +/** + * @brief Control horizontal mode on the list object. + * + * @note Vertical mode is set by default. + * + * On horizontal mode items are displayed on list from left to right, instead + * of from top to bottom. Also, the list will scroll horizontally. Each item + * will presents left icon on top and right icon, or end, at the bottom. + * + * @param[in] obj The object. + * @param[in] horizontal @c true to enable horizontal or @c false to disable + * it, i.e., to enable vertical mode. + * + * @ingroup Elm_List_Group + */ +EAPI void elm_list_horizontal_set(Elm_List *obj, Eina_Bool horizontal); + +/** + * @brief Control horizontal mode on the list object. + * + * @note Vertical mode is set by default. + * + * On horizontal mode items are displayed on list from left to right, instead + * of from top to bottom. Also, the list will scroll horizontally. Each item + * will presents left icon on top and right icon, or end, at the bottom. + * + * @param[in] obj The object. + * + * @return @c true to enable horizontal or @c false to disable it, i.e., to + * enable vertical mode. + * + * @ingroup Elm_List_Group + */ +EAPI Eina_Bool elm_list_horizontal_get(const Elm_List *obj); + +/** + * @brief Control the list select mode. + * + * elm_list_select_mode_set() changes item select mode in the list widget. - + * #ELM_OBJECT_SELECT_MODE_DEFAULT : Items will only call their selection func + * and callback when first becoming selected. Any further clicks will do + * nothing, unless you set always select mode. - #ELM_OBJECT_SELECT_MODE_ALWAYS + * : This means that, even if selected, every click will make the selected + * callbacks be called. - #ELM_OBJECT_SELECT_MODE_NONE : This will turn off the + * ability to select items entirely and they will neither appear selected nor + * call selected callback functions. + * + * @param[in] obj The object. + * @param[in] mode The select mode + * + * @ingroup Elm_List_Group + */ +EAPI void elm_list_select_mode_set(Elm_List *obj, Elm_Object_Select_Mode mode); + +/** + * @brief Control the list select mode. + * + * elm_list_select_mode_set() changes item select mode in the list widget. - + * #ELM_OBJECT_SELECT_MODE_DEFAULT : Items will only call their selection func + * and callback when first becoming selected. Any further clicks will do + * nothing, unless you set always select mode. - #ELM_OBJECT_SELECT_MODE_ALWAYS + * : This means that, even if selected, every click will make the selected + * callbacks be called. - #ELM_OBJECT_SELECT_MODE_NONE : This will turn off the + * ability to select items entirely and they will neither appear selected nor + * call selected callback functions. + * + * @param[in] obj The object. + * + * @return The select mode + * + * @ingroup Elm_List_Group + */ +EAPI Elm_Object_Select_Mode elm_list_select_mode_get(const Elm_List *obj); + +/** + * @brief Control focus upon items selection mode + * + * When enabled, every selection of an item inside the genlist will + * automatically set focus to its first focusable widget from the left. This is + * true of course if the selection was made by clicking an unfocusable area in + * an item or selecting it with a key movement. Clicking on a focusable widget + * inside an item will cause this particular item to get focus as usual. + * + * @param[in] obj The object. + * @param[in] enabled The tree effect status ($true = enabled, @c false = + * disabled) + * + * @ingroup Elm_List_Group + */ +EAPI void elm_list_focus_on_selection_set(Elm_List *obj, Eina_Bool enabled); + +/** + * @brief Control focus upon items selection mode + * + * When enabled, every selection of an item inside the genlist will + * automatically set focus to its first focusable widget from the left. This is + * true of course if the selection was made by clicking an unfocusable area in + * an item or selecting it with a key movement. Clicking on a focusable widget + * inside an item will cause this particular item to get focus as usual. + * + * @param[in] obj The object. + * + * @return The tree effect status ($true = enabled, @c false = disabled) + * + * @ingroup Elm_List_Group + */ +EAPI Eina_Bool elm_list_focus_on_selection_get(const Elm_List *obj); + +/** + * @brief Control multiple items selection on the list object. + * + * Disabled by default. If disabled, the user can select a single item of the + * list each time. Selected items are highlighted on list. If enabled, many + * items can be selected. + * + * If a selected item is selected again, it will be unselected. + * + * @param[in] obj The object. + * @param[in] multi @c true to enable multi selection or @c false to disable + * it. + * + * @ingroup Elm_List_Group + */ +EAPI void elm_list_multi_select_set(Elm_List *obj, Eina_Bool multi); + +/** + * @brief Control multiple items selection on the list object. + * + * Disabled by default. If disabled, the user can select a single item of the + * list each time. Selected items are highlighted on list. If enabled, many + * items can be selected. + * + * If a selected item is selected again, it will be unselected. + * + * @param[in] obj The object. + * + * @return @c true to enable multi selection or @c false to disable it. + * + * @ingroup Elm_List_Group + */ +EAPI Eina_Bool elm_list_multi_select_get(const Elm_List *obj); + +/** + * @brief Control the list multi select mode. + * + * - #ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT : select/unselect items whenever + * each item is clicked. - #ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL : Only + * one item will be selected although multi-selection is enabled, if clicked + * without pressing control key. This mode is only available with + * multi-selection. + * + * See: @ref elm_list_multi_select_get + * + * @param[in] obj The object. + * @param[in] mode The multi select mode + * + * @since 1.8 + * + * @ingroup Elm_List_Group + */ +EAPI void elm_list_multi_select_mode_set(Elm_List *obj, Elm_Object_Multi_Select_Mode mode); + +/** + * @brief Control the list multi select mode. + * + * - #ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT : select/unselect items whenever + * each item is clicked. - #ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL : Only + * one item will be selected although multi-selection is enabled, if clicked + * without pressing control key. This mode is only available with + * multi-selection. + * + * See: @ref elm_list_multi_select_get + * + * @param[in] obj The object. + * + * @return The multi select mode + * + * @since 1.8 + * + * @ingroup Elm_List_Group + */ +EAPI Elm_Object_Multi_Select_Mode elm_list_multi_select_mode_get(const Elm_List *obj); + +/** + * @brief Control which mode to use for the list object. + * + * Set list's resize behavior, transverse axis scroll and items cropping. See + * each mode's description for more details. + * + * @note Default value is #ELM_LIST_SCROLL. + * + * Only one mode at a time can be set. If a previous one was set, it will be + * changed by the new mode after this call. Bitmasks won't work here as well. + * + * @warning This function's behavior will clash with those of + * elm_scroller_content_min_limit(), so use either one of them, but not both. + * + * @param[in] obj The object. + * @param[in] mode One of #Elm_List_Mode: #ELM_LIST_COMPRESS, #ELM_LIST_SCROLL, + * #ELM_LIST_LIMIT or #ELM_LIST_EXPAND. + * + * @ingroup Elm_List_Group + */ +EAPI void elm_list_mode_set(Elm_List *obj, Elm_List_Mode mode); + +/** + * @brief Control which mode to use for the list object. + * + * Set list's resize behavior, transverse axis scroll and items cropping. See + * each mode's description for more details. + * + * @note Default value is #ELM_LIST_SCROLL. + * + * Only one mode at a time can be set. If a previous one was set, it will be + * changed by the new mode after this call. Bitmasks won't work here as well. + * + * @warning This function's behavior will clash with those of + * elm_scroller_content_min_limit(), so use either one of them, but not both. + * + * @param[in] obj The object. + * + * @return One of #Elm_List_Mode: #ELM_LIST_COMPRESS, #ELM_LIST_SCROLL, + * #ELM_LIST_LIMIT or #ELM_LIST_EXPAND. + * + * @ingroup Elm_List_Group + */ +EAPI Elm_List_Mode elm_list_mode_get(const Elm_List *obj); + +/** + * @brief Get the selected item. + * + * The selected item can be unselected with function + * elm_list_item_selected_set(). + * + * The selected item always will be highlighted on list. + * + * @param[in] obj The object. + * + * @return The selected list item. + * + * @ingroup Elm_List_Group + */ +EAPI Elm_Widget_Item *elm_list_selected_item_get(const Elm_List *obj); + +/** + * @brief Get a list of all the list items. + * + * @param[in] obj The object. + * + * @return A @c list of list items, #Elm.Widget.Item, or @c NULL on failure. + * + * @ingroup Elm_List_Group + */ +EAPI const Eina_List *elm_list_items_get(const Elm_List *obj); + +/** + * @brief Get the first item in the list + * + * This returns the first item in the list. + * + * @param[in] obj The object. + * + * @return The first item, or NULL if none + * + * @ingroup Elm_List_Group + */ +EAPI Elm_Widget_Item *elm_list_first_item_get(const Elm_List *obj); + +/** + * @brief Return a list of the currently selected list items. + * + * Multiple items can be selected if multi select is enabled. It can be done + * with elm_list_multi_select_set(). + * + * @param[in] obj The object. + * + * @return An @c list of list items, #Elm.Widget.Item, or @c NULL on failure. + * + * @ingroup Elm_List_Group + */ +EAPI const Eina_List *elm_list_selected_items_get(const Elm_List *obj); + +/** + * @brief Get the last item in the list + * + * This returns the last item in the list. + * + * @param[in] obj The object. + * + * @return The last item, or NULL if none + * + * @ingroup Elm_List_Group + */ +EAPI Elm_Widget_Item *elm_list_last_item_get(const Elm_List *obj); + +/** + * @brief Insert a new item into the list object before item @c before. + * + * A new item will be created and added to the list. Its position in this list + * will be just before item @c before. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If always select + * is enabled it will call this function every time user clicks over an item + * (already selected or not). If such function isn't needed, just passing + * @c NULL as @c func is enough. The same should be done for @c data. + * + * @note Remember that the label parameter is copied inside the list. So if an + * application dynamically allocated the label, the application should free the + * label after this call. + * + * @param[in] obj The object. + * @param[in] before The list item to insert before. + * @param[in] label The label of the list item. + * @param[in] icon The icon object to use for the left side of the item. An + * icon can be any Evas object, but usually it is an icon created with + * elm_icon_add(). + * @param[in] end The icon object to use for the right side of the item. An + * icon can be any Evas object. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_List_Group + */ +EAPI Elm_Widget_Item *elm_list_item_insert_before(Elm_List *obj, Elm_Widget_Item *before, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data); + +/** + * @brief Starts the list. + * + * @note Call before running show() on the list object. Warning: If not called, + * it won't display the list properly. + * @param[in] obj The object. + * + * @ingroup Elm_List_Group + */ +EAPI void elm_list_go(Elm_List *obj); + +/** + * @brief Insert a new item into the list object after item @c after. + * + * A new item will be created and added to the list. Its position in this list + * will be just after item @c after. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If always select + * is enabled it will call this function every time user clicks over an item + * (already selected or not). If such function isn't needed, just passing + * @c NULL as @c func is enough. The same should be done for @c data. + * + * @note Remember that the label parameter is copied inside the list. So if an + * application dynamically allocated the label, the application should free the + * label after this call. + * + * @param[in] obj The object. + * @param[in] after The list item to insert after. + * @param[in] label The label of the list item. + * @param[in] icon The icon object to use for the left side of the item. An + * icon can be any Evas object, but usually it is an icon created with + * elm_icon_add(). + * @param[in] end The icon object to use for the right side of the item. An + * icon can be any Evas object. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_List_Group + */ +EAPI Elm_Widget_Item *elm_list_item_insert_after(Elm_List *obj, Elm_Widget_Item *after, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data); + +/** + * @brief Get the item that is at the x, y canvas coords. + * + * This returns the item at the given coordinates (which are canvas relative, + * not object-relative). If an item is at that coordinate, that item handle is + * returned, and if @c posret is not NULL, the integer pointed to is set to a + * value of -1, 0 or 1, depending if the coordinate is on the upper portion of + * that item (-1), on the middle section (0) or on the lower part (1). If NULL + * is returned as an item (no item found there), then posret may indicate -1 or + * 1 based if the coordinate is above or below all items respectively in the + * list. + * + * @param[in] obj The object. + * @param[in] x The input x coordinate + * @param[in] y The input y coordinate + * @param[out] posret The position relative to the item returned here + * + * @return The item at the coordinates or NULL if none + * + * @ingroup Elm_List_Group + */ +EAPI Elm_Widget_Item *elm_list_at_xy_item_get(const Elm_List *obj, int x, int y, int *posret); + +/** + * @brief Append a new item to the list object. + * + * A new item will be created and appended to the list, i.e., will be set as + * last item. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If always select + * is enabled it will call this function every time user clicks over an item + * (already selected or not). If such function isn't needed, just passing + * @c NULL as @c func is enough. The same should be done for @c data. + * + * @note Remember that the label parameter is copied inside the list. So if an + * application dynamically allocated the label, the application should free the + * label after this call. + * + * @param[in] obj The object. + * @param[in] label The label of the list item. + * @param[in] icon The icon object to use for the left side of the item. An + * icon can be any Evas object, but usually it is an icon created with + * elm_icon_add(). + * @param[in] end The icon object to use for the right side of the item. An + * icon can be any Evas object. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_List_Group + */ +EAPI Elm_Widget_Item *elm_list_item_append(Elm_List *obj, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data); + +/** + * @brief Prepend a new item to the list object. + * + * A new item will be created and prepended to the list, i.e., will be set as + * first item. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If always select + * is enabled it will call this function every time user clicks over an item + * (already selected or not). If such function isn't needed, just passing + * @c NULL as @c func is enough. The same should be done for @c data. + * + * @note Remember that the label parameter is copied inside the list. So if an + * application dynamically allocated the label, the application should free the + * label after this call. + * + * @param[in] obj The object. + * @param[in] label The label of the list item. + * @param[in] icon The icon object to use for the left side of the item. An + * icon can be any Evas object, but usually it is an icon created with + * elm_icon_add(). + * @param[in] end The icon object to use for the right side of the item. An + * icon can be any Evas object. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_List_Group + */ +EAPI Elm_Widget_Item *elm_list_item_prepend(Elm_List *obj, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data); + +/** Remove all list's items. + * + * @ingroup Elm_List_Group + */ +EAPI void elm_list_clear(Elm_List *obj); + +/** + * @brief Insert a new item into the sorted list object. + * + * @note This function inserts values into a list object assuming it was sorted + * and the result will be sorted. + * + * A new item will be created and added to the list. Its position in this list + * will be found comparing the new item with previously inserted items using + * function @c cmp_func. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If always select + * is enabled it will call this function every time user clicks over an item + * (already selected or not). If such function isn't needed, just passing + * @c NULL as @c func is enough. The same should be done for @c data. + * + * @note Remember that the label parameter is copied inside the list. So if an + * application dynamically allocated the label, the application should free the + * label after this call. + * + * @param[in] obj The object. + * @param[in] label The label of the list item. + * @param[in] icon The icon object to use for the left side of the item. An + * icon can be any Evas object, but usually it is an icon created with + * elm_icon_add(). + * @param[in] end The icon object to use for the right side of the item. An + * icon can be any Evas object. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * @param[in] cmp_func The comparing function to be used to sort list items by + * #Elm.Widget.Item item handles. This function will receive two items and + * compare them, returning a non-negative integer if the second item should be + * place after the first, or negative value if should be placed before. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_List_Group + */ +EAPI Elm_Widget_Item *elm_list_item_sorted_insert(Elm_List *obj, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func); + +#endif diff --git a/src/lib/elementary/elm_list_item.eo b/src/lib/elementary/elm_list_item.eo deleted file mode 100644 index c3d18ba99f..0000000000 --- a/src/lib/elementary/elm_list_item.eo +++ /dev/null @@ -1,123 +0,0 @@ -class Elm.List.Item extends Elm.Widget.Item implements Efl.Ui.Legacy -{ - [[Elementary list item class]] - legacy_prefix: elm_list_item; - eo_prefix: elm_obj_list_item; - methods { - @property separator { - get { - [[Get a value whether item is a separator or not.]] - } - set { - [[Set or unset item as a separator. - - Items aren't set as separator by default. - - If set as separator it will display separator theme, - so won't display icons or label. - ]] - } - values { - setting: bool; [[$true means item $it is a separator. - $false indicates it's not.]] - } - } - @property selected { - get { - [[Get whether the item is selected or not.]] - } - set { - [[Set the selected state of an item. - - This sets the selected state of the given item. - - If a new item is selected the previously selected - will be unselected, unless multiple selection is - enabled with \@ref elm_list_multi_select_set. - Previously selected item can be get with function - \@ref elm_list_selected_item_get. - - Selected items will be highlighted. - ]] - } - values { - selected: bool; [[The selected state.]] - } - } - @property object { - get { - [[Get the real Evas(Edje) object created to implement - the view of a given list item. - - Base object is the $Evas_Object that represents that - item. - ]] - } - values { - obj: Efl.Canvas.Object; [[The base Edje object associated with the item.]] - } - } - @property prev { - get { - [[Get the item before the item in list. - - Note: If it is the first item, $null will be returned. - ]] - legacy: elm_list_item_prev; - } - values { - item: Elm.Widget.Item; [[The item before or $null.]] - } - } - @property next { - get { - [[Get the item after the item in list. - - Note: If it is the last item, $null will be returned. - ]] - legacy: elm_list_item_next; - } - values { - item: Elm.Widget.Item; [[The item after or $null.]] - } - } - /* init { FIXME - params { - Evas_Smart_Cb func; - const(void_ptr) data; - } - }*/ - show { - [[Show item in the list view. - - It won't animate list until item is visible. If such - behavior is wanted, use @.bring_in instead. - ]] - } - bring_in { - [[Bring in the given item to list view. - - This causes list to jump to the given item and show it - (by scrolling), if it is not fully visible. - - This may use animation to do so and take a period of time. - - If animation isn't wanted, @.show can be used. - ]] - } - } - 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.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.Object.i18n_name { get; } - Efl.Access.Object.state_set { get; } - } -} diff --git a/src/lib/elementary/elm_list_item_eo.c b/src/lib/elementary/elm_list_item_eo.c new file mode 100644 index 0000000000..6e66802e6c --- /dev/null +++ b/src/lib/elementary/elm_list_item_eo.c @@ -0,0 +1,195 @@ + +void _elm_list_item_separator_set(Eo *obj, Elm_List_Item_Data *pd, Eina_Bool setting); + + +static Eina_Error +__eolian_elm_list_item_separator_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_list_item_separator_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_list_item_separator_set, EFL_FUNC_CALL(setting), Eina_Bool setting); + +Eina_Bool _elm_list_item_separator_get(const Eo *obj, Elm_List_Item_Data *pd); + + +static Eina_Value +__eolian_elm_list_item_separator_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_list_item_separator_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_list_item_separator_get, Eina_Bool, 0); + +void _elm_list_item_selected_set(Eo *obj, Elm_List_Item_Data *pd, Eina_Bool selected); + + +static Eina_Error +__eolian_elm_list_item_selected_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_list_item_selected_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_list_item_selected_set, EFL_FUNC_CALL(selected), Eina_Bool selected); + +Eina_Bool _elm_list_item_selected_get(const Eo *obj, Elm_List_Item_Data *pd); + + +static Eina_Value +__eolian_elm_list_item_selected_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_list_item_selected_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_list_item_selected_get, Eina_Bool, 0); + +Efl_Canvas_Object *_elm_list_item_object_get(const Eo *obj, Elm_List_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_list_item_object_get, Efl_Canvas_Object *, NULL); + +Elm_Widget_Item *_elm_list_item_prev_get(const Eo *obj, Elm_List_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_list_item_prev_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_list_item_next_get(const Eo *obj, Elm_List_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_list_item_next_get, Elm_Widget_Item *, NULL); + +void _elm_list_item_show(Eo *obj, Elm_List_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_list_item_show); + +void _elm_list_item_bring_in(Eo *obj, Elm_List_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_list_item_bring_in); + +Efl_Object *_elm_list_item_efl_object_constructor(Eo *obj, Elm_List_Item_Data *pd); + + +void _elm_list_item_efl_object_invalidate(Eo *obj, Elm_List_Item_Data *pd); + + +void _elm_list_item_efl_object_destructor(Eo *obj, Elm_List_Item_Data *pd); + + +void _elm_list_item_elm_widget_item_disable(Eo *obj, Elm_List_Item_Data *pd); + + +void _elm_list_item_elm_widget_item_del_pre(Eo *obj, Elm_List_Item_Data *pd); + + +void _elm_list_item_elm_widget_item_signal_emit(Eo *obj, Elm_List_Item_Data *pd, const char *emission, const char *source); + + +void _elm_list_item_elm_widget_item_item_focus_set(Eo *obj, Elm_List_Item_Data *pd, Eina_Bool focused); + + +Eina_Bool _elm_list_item_elm_widget_item_item_focus_get(const Eo *obj, Elm_List_Item_Data *pd); + + +void _elm_list_item_elm_widget_item_part_text_set(Eo *obj, Elm_List_Item_Data *pd, const char *part, const char *label); + + +const char *_elm_list_item_elm_widget_item_part_text_get(const Eo *obj, Elm_List_Item_Data *pd, const char *part); + + +void _elm_list_item_elm_widget_item_part_content_set(Eo *obj, Elm_List_Item_Data *pd, const char *part, Efl_Canvas_Object *content); + + +Efl_Canvas_Object *_elm_list_item_elm_widget_item_part_content_get(const Eo *obj, Elm_List_Item_Data *pd, const char *part); + + +Efl_Canvas_Object *_elm_list_item_elm_widget_item_part_content_unset(Eo *obj, Elm_List_Item_Data *pd, const char *part); + + +const char *_elm_list_item_efl_access_object_i18n_name_get(const Eo *obj, Elm_List_Item_Data *pd); + + +Efl_Access_State_Set _elm_list_item_efl_access_object_state_set_get(const Eo *obj, Elm_List_Item_Data *pd); + + +static Eina_Bool +_elm_list_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_LIST_ITEM_EXTRA_OPS +#define ELM_LIST_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_list_item_separator_set, _elm_list_item_separator_set), + EFL_OBJECT_OP_FUNC(elm_obj_list_item_separator_get, _elm_list_item_separator_get), + EFL_OBJECT_OP_FUNC(elm_obj_list_item_selected_set, _elm_list_item_selected_set), + EFL_OBJECT_OP_FUNC(elm_obj_list_item_selected_get, _elm_list_item_selected_get), + EFL_OBJECT_OP_FUNC(elm_obj_list_item_object_get, _elm_list_item_object_get), + EFL_OBJECT_OP_FUNC(elm_obj_list_item_prev_get, _elm_list_item_prev_get), + EFL_OBJECT_OP_FUNC(elm_obj_list_item_next_get, _elm_list_item_next_get), + EFL_OBJECT_OP_FUNC(elm_obj_list_item_show, _elm_list_item_show), + EFL_OBJECT_OP_FUNC(elm_obj_list_item_bring_in, _elm_list_item_bring_in), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_list_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_invalidate, _elm_list_item_efl_object_invalidate), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_list_item_efl_object_destructor), + EFL_OBJECT_OP_FUNC(elm_wdg_item_disable, _elm_list_item_elm_widget_item_disable), + EFL_OBJECT_OP_FUNC(elm_wdg_item_del_pre, _elm_list_item_elm_widget_item_del_pre), + EFL_OBJECT_OP_FUNC(elm_wdg_item_signal_emit, _elm_list_item_elm_widget_item_signal_emit), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_set, _elm_list_item_elm_widget_item_item_focus_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_get, _elm_list_item_elm_widget_item_item_focus_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_set, _elm_list_item_elm_widget_item_part_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_get, _elm_list_item_elm_widget_item_part_text_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_set, _elm_list_item_elm_widget_item_part_content_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_get, _elm_list_item_elm_widget_item_part_content_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_unset, _elm_list_item_elm_widget_item_part_content_unset), + EFL_OBJECT_OP_FUNC(efl_access_object_i18n_name_get, _elm_list_item_efl_access_object_i18n_name_get), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_list_item_efl_access_object_state_set_get), + ELM_LIST_ITEM_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"separator", __eolian_elm_list_item_separator_set_reflect, __eolian_elm_list_item_separator_get_reflect}, + {"selected", __eolian_elm_list_item_selected_set_reflect, __eolian_elm_list_item_selected_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_list_item_class_desc = { + EO_VERSION, + "Elm.List.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_List_Item_Data), + _elm_list_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_list_item_class_get, &_elm_list_item_class_desc, ELM_WIDGET_ITEM_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_list_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_list_item_eo.h b/src/lib/elementary/elm_list_item_eo.h new file mode 100644 index 0000000000..8aef9230a9 --- /dev/null +++ b/src/lib/elementary/elm_list_item_eo.h @@ -0,0 +1,148 @@ +#ifndef _ELM_LIST_ITEM_EO_H_ +#define _ELM_LIST_ITEM_EO_H_ + +#ifndef _ELM_LIST_ITEM_EO_CLASS_TYPE +#define _ELM_LIST_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_List_Item; + +#endif + +#ifndef _ELM_LIST_ITEM_EO_TYPES +#define _ELM_LIST_ITEM_EO_TYPES + + +#endif +/** Elementary list item class + * + * @ingroup Elm_List_Item + */ +#define ELM_LIST_ITEM_CLASS elm_list_item_class_get() + +EWAPI const Efl_Class *elm_list_item_class_get(void); + +/** + * @brief Set or unset item as a separator. + * + * Items aren't set as separator by default. + * + * If set as separator it will display separator theme, so won't display icons + * or label. + * + * @param[in] obj The object. + * @param[in] setting @c true means item @c it is a separator. @c false + * indicates it's not. + * + * @ingroup Elm_List_Item + */ +EOAPI void elm_obj_list_item_separator_set(Eo *obj, Eina_Bool setting); + +/** + * @brief Get a value whether item is a separator or not. + * + * @param[in] obj The object. + * + * @return @c true means item @c it is a separator. @c false indicates it's + * not. + * + * @ingroup Elm_List_Item + */ +EOAPI Eina_Bool elm_obj_list_item_separator_get(const Eo *obj); + +/** + * @brief Set the selected state of an item. + * + * This sets the selected state of the given item. + * + * If a new item is selected the previously selected will be unselected, unless + * multiple selection is enabled with @ref elm_list_multi_select_set. + * Previously selected item can be get with function @ref + * elm_list_selected_item_get. + * + * Selected items will be highlighted. + * + * @param[in] obj The object. + * @param[in] selected The selected state. + * + * @ingroup Elm_List_Item + */ +EOAPI void elm_obj_list_item_selected_set(Eo *obj, Eina_Bool selected); + +/** + * @brief Get whether the item is selected or not. + * + * @param[in] obj The object. + * + * @return The selected state. + * + * @ingroup Elm_List_Item + */ +EOAPI Eina_Bool elm_obj_list_item_selected_get(const Eo *obj); + +/** + * @brief Get the real Evas(Edje) object created to implement the view of a + * given list item. + * + * Base object is the @c Evas_Object that represents that item. + * + * @param[in] obj The object. + * + * @return The base Edje object associated with the item. + * + * @ingroup Elm_List_Item + */ +EOAPI Efl_Canvas_Object *elm_obj_list_item_object_get(const Eo *obj); + +/** + * @brief Get the item before the item in list. + * + * @note If it is the first item, @c null will be returned. + * + * @param[in] obj The object. + * + * @return The item before or @c null. + * + * @ingroup Elm_List_Item + */ +EOAPI Elm_Widget_Item *elm_obj_list_item_prev_get(const Eo *obj); + +/** + * @brief Get the item after the item in list. + * + * @note If it is the last item, @c null will be returned. + * + * @param[in] obj The object. + * + * @return The item after or @c null. + * + * @ingroup Elm_List_Item + */ +EOAPI Elm_Widget_Item *elm_obj_list_item_next_get(const Eo *obj); + +/** + * @brief Show item in the list view. + * + * It won't animate list until item is visible. If such behavior is wanted, use + * @ref elm_obj_list_item_bring_in instead. + * @param[in] obj The object. + * + * @ingroup Elm_List_Item + */ +EOAPI void elm_obj_list_item_show(Eo *obj); + +/** + * @brief Bring in the given item to list view. + * + * This causes list to jump to the given item and show it (by scrolling), if it + * is not fully visible. + * + * This may use animation to do so and take a period of time. + * + * If animation isn't wanted, @ref elm_obj_list_item_show can be used. + * @param[in] obj The object. + * + * @ingroup Elm_List_Item + */ +EOAPI void elm_obj_list_item_bring_in(Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_list_item_eo.legacy.c b/src/lib/elementary/elm_list_item_eo.legacy.c new file mode 100644 index 0000000000..609a9fbd5c --- /dev/null +++ b/src/lib/elementary/elm_list_item_eo.legacy.c @@ -0,0 +1,54 @@ + +EAPI void +elm_list_item_separator_set(Elm_List_Item *obj, Eina_Bool setting) +{ + elm_obj_list_item_separator_set(obj, setting); +} + +EAPI Eina_Bool +elm_list_item_separator_get(const Elm_List_Item *obj) +{ + return elm_obj_list_item_separator_get(obj); +} + +EAPI void +elm_list_item_selected_set(Elm_List_Item *obj, Eina_Bool selected) +{ + elm_obj_list_item_selected_set(obj, selected); +} + +EAPI Eina_Bool +elm_list_item_selected_get(const Elm_List_Item *obj) +{ + return elm_obj_list_item_selected_get(obj); +} + +EAPI Efl_Canvas_Object * +elm_list_item_object_get(const Elm_List_Item *obj) +{ + return elm_obj_list_item_object_get(obj); +} + +EAPI Elm_Widget_Item * +elm_list_item_prev(const Elm_List_Item *obj) +{ + return elm_obj_list_item_prev_get(obj); +} + +EAPI Elm_Widget_Item * +elm_list_item_next(const Elm_List_Item *obj) +{ + return elm_obj_list_item_next_get(obj); +} + +EAPI void +elm_list_item_show(Elm_List_Item *obj) +{ + elm_obj_list_item_show(obj); +} + +EAPI void +elm_list_item_bring_in(Elm_List_Item *obj) +{ + elm_obj_list_item_bring_in(obj); +} diff --git a/src/lib/elementary/elm_list_item_eo.legacy.h b/src/lib/elementary/elm_list_item_eo.legacy.h new file mode 100644 index 0000000000..af74d6ea03 --- /dev/null +++ b/src/lib/elementary/elm_list_item_eo.legacy.h @@ -0,0 +1,141 @@ +#ifndef _ELM_LIST_ITEM_EO_LEGACY_H_ +#define _ELM_LIST_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_LIST_ITEM_EO_CLASS_TYPE +#define _ELM_LIST_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_List_Item; + +#endif + +#ifndef _ELM_LIST_ITEM_EO_TYPES +#define _ELM_LIST_ITEM_EO_TYPES + + +#endif + +/** + * @brief Set or unset item as a separator. + * + * Items aren't set as separator by default. + * + * If set as separator it will display separator theme, so won't display icons + * or label. + * + * @param[in] obj The object. + * @param[in] setting @c true means item @c it is a separator. @c false + * indicates it's not. + * + * @ingroup Elm_List_Item_Group + */ +EAPI void elm_list_item_separator_set(Elm_List_Item *obj, Eina_Bool setting); + +/** + * @brief Get a value whether item is a separator or not. + * + * @param[in] obj The object. + * + * @return @c true means item @c it is a separator. @c false indicates it's + * not. + * + * @ingroup Elm_List_Item_Group + */ +EAPI Eina_Bool elm_list_item_separator_get(const Elm_List_Item *obj); + +/** + * @brief Set the selected state of an item. + * + * This sets the selected state of the given item. + * + * If a new item is selected the previously selected will be unselected, unless + * multiple selection is enabled with @ref elm_list_multi_select_set. + * Previously selected item can be get with function @ref + * elm_list_selected_item_get. + * + * Selected items will be highlighted. + * + * @param[in] obj The object. + * @param[in] selected The selected state. + * + * @ingroup Elm_List_Item_Group + */ +EAPI void elm_list_item_selected_set(Elm_List_Item *obj, Eina_Bool selected); + +/** + * @brief Get whether the item is selected or not. + * + * @param[in] obj The object. + * + * @return The selected state. + * + * @ingroup Elm_List_Item_Group + */ +EAPI Eina_Bool elm_list_item_selected_get(const Elm_List_Item *obj); + +/** + * @brief Get the real Evas(Edje) object created to implement the view of a + * given list item. + * + * Base object is the @c Evas_Object that represents that item. + * + * @param[in] obj The object. + * + * @return The base Edje object associated with the item. + * + * @ingroup Elm_List_Item_Group + */ +EAPI Efl_Canvas_Object *elm_list_item_object_get(const Elm_List_Item *obj); + +/** + * @brief Get the item before the item in list. + * + * @note If it is the first item, @c null will be returned. + * + * @param[in] obj The object. + * + * @return The item before or @c null. + * + * @ingroup Elm_List_Item_Group + */ +EAPI Elm_Widget_Item *elm_list_item_prev(const Elm_List_Item *obj); + +/** + * @brief Get the item after the item in list. + * + * @note If it is the last item, @c null will be returned. + * + * @param[in] obj The object. + * + * @return The item after or @c null. + * + * @ingroup Elm_List_Item_Group + */ +EAPI Elm_Widget_Item *elm_list_item_next(const Elm_List_Item *obj); + +/** + * @brief Show item in the list view. + * + * It won't animate list until item is visible. If such behavior is wanted, use + * @ref elm_list_item_bring_in instead. + * @param[in] obj The object. + * + * @ingroup Elm_List_Item_Group + */ +EAPI void elm_list_item_show(Elm_List_Item *obj); + +/** + * @brief Bring in the given item to list view. + * + * This causes list to jump to the given item and show it (by scrolling), if it + * is not fully visible. + * + * This may use animation to do so and take a period of time. + * + * If animation isn't wanted, @ref elm_list_item_show can be used. + * @param[in] obj The object. + * + * @ingroup Elm_List_Item_Group + */ +EAPI void elm_list_item_bring_in(Elm_List_Item *obj); + +#endif diff --git a/src/lib/elementary/elm_list_legacy.h b/src/lib/elementary/elm_list_legacy.h index a99532dfd2..0cdb591984 100644 --- a/src/lib/elementary/elm_list_legacy.h +++ b/src/lib/elementary/elm_list_legacy.h @@ -11,5 +11,5 @@ */ EAPI Evas_Object *elm_list_add(Evas_Object *parent); -#include "elm_list_item.eo.legacy.h" -#include "elm_list.eo.legacy.h" +#include "elm_list_item_eo.legacy.h" +#include "elm_list_eo.legacy.h" diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c index b4c83e3105..676f1a9e8a 100644 --- a/src/lib/elementary/elm_main.c +++ b/src/lib/elementary/elm_main.c @@ -23,10 +23,12 @@ #include "elm_priv.h" #include "elm_interface_scrollable.h" +#include "elm_pan_eo.h" //we need those for legacy compatible code -#include "elm_genlist.eo.h" -#include "elm_gengrid.eo.h" +#include "elm_genlist_eo.h" +#include "elm_gengrid_eo.h" +#include "elm_widget_gengrid.h" #define SEMI_BROKEN_QUICKLAUNCH 1 @@ -44,14 +46,15 @@ EAPI Elm_Version *elm_version = &_version; static void _focus_ev_redirect_cb(void *data, const Efl_Event *ev EINA_UNUSED) { - efl_event_callback_call(data, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_GEOMETRY_CHANGED, NULL); + Eina_Rect rect = efl_ui_focus_object_focus_geometry_get(data); + efl_event_callback_call(data, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_GEOMETRY_CHANGED, &rect); } void _efl_ui_focus_event_redirector(Efl_Ui_Focus_Object *obj, Efl_Ui_Focus_Object *goal) { - efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_MOVE, _focus_ev_redirect_cb, goal); - efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_RESIZE, _focus_ev_redirect_cb, goal); + efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _focus_ev_redirect_cb, goal); + efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _focus_ev_redirect_cb, goal); } void @@ -59,7 +62,7 @@ _efl_ui_focus_manager_redirect_events_del(Efl_Ui_Focus_Manager *manager, Eo *obj { efl_event_callback_forwarder_del(manager, EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, obj); efl_event_callback_forwarder_del(manager, EFL_UI_FOCUS_MANAGER_EVENT_REDIRECT_CHANGED, obj); - efl_event_callback_forwarder_del(manager, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED , obj); + efl_event_callback_forwarder_del(manager, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED , obj); efl_event_callback_forwarder_del(manager, EFL_UI_FOCUS_MANAGER_EVENT_COORDS_DIRTY, obj); efl_event_callback_forwarder_del(manager, EFL_UI_FOCUS_MANAGER_EVENT_DIRTY_LOGIC_FREEZE_CHANGED, obj); } @@ -69,7 +72,7 @@ _efl_ui_focus_manager_redirect_events_add(Efl_Ui_Focus_Manager *manager, Eo *obj { efl_event_callback_forwarder_add(manager, EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, obj); efl_event_callback_forwarder_add(manager, EFL_UI_FOCUS_MANAGER_EVENT_REDIRECT_CHANGED, obj); - efl_event_callback_forwarder_add(manager, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED , obj); + efl_event_callback_forwarder_add(manager, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED , obj); efl_event_callback_forwarder_add(manager, EFL_UI_FOCUS_MANAGER_EVENT_COORDS_DIRTY, obj); efl_event_callback_forwarder_add(manager, EFL_UI_FOCUS_MANAGER_EVENT_DIRTY_LOGIC_FREEZE_CHANGED, obj); } @@ -397,6 +400,19 @@ _sys_lang_changed(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA return ECORE_CALLBACK_PASS_ON; } +EAPI Eina_Error EFL_UI_THEME_APPLY_ERROR_NONE = 0; +EAPI Eina_Error EFL_UI_THEME_APPLY_ERROR_DEFAULT = 0; +EAPI Eina_Error EFL_UI_THEME_APPLY_ERROR_GENERIC = 0; + +static void +_efl_ui_theme_apply_error_init(void) +{ + if (EFL_UI_THEME_APPLY_ERROR_DEFAULT) return; + /* NONE should always be 0 */ + EFL_UI_THEME_APPLY_ERROR_DEFAULT = eina_error_msg_static_register("Fallback to default style was enabled for this widget"); + EFL_UI_THEME_APPLY_ERROR_GENERIC = eina_error_msg_static_register("An error occurred and no theme could be set for this widget"); +} + // This is necessary to keep backward compatibility static const char *bcargv[] = { "exe" }; @@ -435,6 +451,7 @@ elm_init(int argc, char **argv) if (_efl_startup_time <= 0) _efl_startup_time = _elm_startup_time; _elm_startup_time = _efl_startup_time; + _efl_ui_theme_apply_error_init(); return _elm_init_count; shutdown_ql: @@ -793,6 +810,7 @@ elm_quicklaunch_init(int argc EINA_UNUSED, } if (!_elm_data_dir) _elm_data_dir = eina_stringshare_add("/"); if (!_elm_lib_dir) _elm_lib_dir = eina_stringshare_add("/"); + if (!_property_style_ss) _property_style_ss = eina_stringshare_add("style"); eina_log_timing(_elm_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT); @@ -909,6 +927,7 @@ elm_quicklaunch_shutdown(void) pfx = NULL; ELM_SAFE_FREE(_elm_data_dir, eina_stringshare_del); ELM_SAFE_FREE(_elm_lib_dir, eina_stringshare_del); + ELM_SAFE_FREE(_property_style_ss, eina_stringshare_del); ELM_SAFE_FREE(_elm_appname, free); ELM_SAFE_FREE(_elm_exit_handler, ecore_event_handler_del); @@ -1477,7 +1496,7 @@ elm_object_domain_translatable_part_text_set(Evas_Object *obj, const char *part, { if (!part) part = efl_ui_widget_default_text_part_get(obj); - else if (efl_isa(obj, EFL_UI_LAYOUT_CLASS)) + else if (efl_isa(obj, EFL_UI_LAYOUT_BASE_CLASS)) _elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE); elm_widget_part_translatable_text_set(obj, part, text, domain); @@ -1499,7 +1518,7 @@ elm_object_translatable_part_text_get(const Evas_Object *obj, const char *part) { if (!part) part = efl_ui_widget_default_text_part_get(obj); - else if (efl_isa(obj, EFL_UI_LAYOUT_CLASS)) + else if (efl_isa(obj, EFL_UI_LAYOUT_BASE_CLASS)) _elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE); return elm_widget_part_translatable_text_get(obj, part, NULL); @@ -1558,9 +1577,7 @@ elm_object_style_set(Evas_Object *obj, const char *style) { EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE); - if (elm_widget_style_set(obj, style)) - return EINA_TRUE; - return EINA_FALSE; + return elm_widget_style_set(obj, style) == EFL_UI_THEME_APPLY_ERROR_NONE; } EAPI Eina_Bool @@ -1568,14 +1585,14 @@ elm_object_focus_highlight_style_set(Evas_Object *obj, const char *style) { EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE); - return elm_widget_focus_highlight_style_set(obj, style); + return elm_win_focus_highlight_style_set(elm_widget_top_get(obj), style); } EAPI const char * elm_object_focus_highlight_style_get(const Evas_Object *obj) { EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL); - return elm_widget_focus_highlight_style_get(obj); + return elm_win_focus_highlight_style_get(elm_widget_top_get(obj)); } EAPI const char * @@ -1590,6 +1607,20 @@ elm_object_disabled_set(Evas_Object *obj, Eina_Bool disabled) { EINA_SAFETY_ON_NULL_RETURN(obj); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd); + ELM_WIDGET_DATA_GET_OR_RETURN(efl_ui_widget_parent_get(obj), ppd); + if (disabled) + { + //we aim here for the disabled count of parent + 1 + if (pd->disabled == ppd->disabled + 1) return; + pd->disabled = ppd->disabled; + } + else + { + //we aim for the same disabled count as the parent here + if (pd->disabled == ppd->disabled) return; + pd->disabled = ppd->disabled + 1; + } elm_widget_disabled_set(obj, disabled); } @@ -1912,35 +1943,60 @@ 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) { - 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); + if (efl_isa(obj, EFL_UI_LAYOUT_BASE_CLASS)) + { + efl_ui_layout_automatic_theme_rotation_set(obj, disabled); + } + else + { + //legacy behaviour + efl_key_data_set(obj, "__orientation_mode_disabled", (void*) (intptr_t) disabled); + } } EAPI Eina_Bool elm_object_orientation_mode_disabled_get(const Evas_Object *obj) { - return efl_ui_widget_orientation_mode_get(obj) == EFL_UI_WIDGET_ORIENTATION_MODE_DISABLED; + if (efl_isa(obj, EFL_UI_LAYOUT_BASE_CLASS)) + { + return efl_ui_layout_automatic_theme_rotation_get(obj); + } + else + { + if (efl_key_data_get(obj, "__orientation_mode_disabled")) + return EINA_TRUE; + } + return EINA_FALSE; } EAPI Elm_Object_Item * elm_object_focused_item_get(const Evas_Object *obj) { EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL); - return efl_ui_widget_focused_item_get(obj); + if (!efl_isa(obj, ELM_WIDGET_ITEM_CONTAINER_INTERFACE)) + return NULL; + return elm_widget_item_container_focused_item_get(obj); } EAPI void elm_object_focus_region_show_mode_set(Evas_Object *obj, Elm_Focus_Region_Show_Mode mode) { - elm_widget_focus_region_show_mode_set(obj, mode); + if (efl_isa(obj, ELM_GENGRID_CLASS)) + { + Elm_Gengrid_Data *pd = efl_data_scope_get(obj, ELM_GENGRID_CLASS); + pd->mode = mode; + } } EAPI Elm_Focus_Region_Show_Mode elm_object_focus_region_show_mode_get(const Evas_Object *obj) { - return elm_widget_focus_region_show_mode_get(obj); + if (efl_isa(obj, ELM_GENGRID_CLASS)) + { + Elm_Gengrid_Data *pd = efl_data_scope_get(obj, ELM_GENGRID_CLASS); + return pd->mode; + } + return ELM_FOCUS_REGION_SHOW_WIDGET; } static void @@ -1967,3 +2023,40 @@ elm_object_item_del(Eo *obj) efl_event_callback_add(obj, EFL_EVENT_NOREF, _item_noref, NULL); item->on_deletion = EINA_TRUE; } + + +EAPI Eina_Bool +elm_object_cursor_set(Eo *obj, const char *cursor) +{ + return efl_ui_widget_cursor_set(obj, cursor); +} + +EAPI const char * +elm_object_cursor_get(const Eo *obj) +{ + return efl_ui_widget_cursor_get(obj); +} + +EAPI Eina_Bool +elm_object_cursor_style_set(Eo *obj, const char *style) +{ + return efl_ui_widget_cursor_style_set(obj, style); +} + +EAPI const char * +elm_object_cursor_style_get(const Eo *obj) +{ + return efl_ui_widget_cursor_style_get(obj); +} + +EAPI Eina_Bool +elm_object_cursor_theme_search_enabled_set(Eo *obj, Eina_Bool allow) +{ + return efl_ui_widget_cursor_theme_search_enabled_set(obj, allow); +} + +EAPI Eina_Bool +elm_object_cursor_theme_search_enabled_get(const Eo *obj) +{ + return efl_ui_widget_cursor_theme_search_enabled_get(obj); +} diff --git a/src/lib/elementary/elm_map.c b/src/lib/elementary/elm_map.c index fa64e2ce82..71deea0b58 100644 --- a/src/lib/elementary/elm_map.c +++ b/src/lib/elementary/elm_map.c @@ -10,8 +10,9 @@ #include "elm_priv.h" #include "elm_widget_map.h" #include "elm_interface_scrollable.h" -#include "elm_map_pan.eo.h" -#include "elm_map.eo.h" +#include "elm_pan_eo.h" +#include "elm_map_pan_eo.h" +#include "elm_map_eo.h" #define MY_PAN_CLASS ELM_MAP_PAN_CLASS @@ -797,7 +798,7 @@ _download_job(void *data) EINA_LIST_REVERSE_FOREACH_SAFE(sd->download_list, l, ll, gi) { - Eina_Bool ret; + Eina_Bool ret, file_exists; if ((gi->g->zoom != sd->zoom) || !(_grid_item_in_viewport(gi))) { @@ -807,21 +808,41 @@ _download_job(void *data) if (sd->download_num >= MAX_CONCURRENT_DOWNLOAD) return ECORE_CALLBACK_RENEW; - ret = ecore_file_download_full - (gi->url, gi->file, _downloaded_cb, NULL, gi, &(gi->job), sd->ua); - - if ((!ret) || (!gi->job)) - ERR("Can't start to download from %s to %s", gi->url, gi->file); - else + file_exists = ecore_file_exists(gi->file); + if (!file_exists) { - sd->download_list = eina_list_remove(sd->download_list, gi); + /* Check here if we can download into this directory even if this one + disappear due to some user black magic */ + char *dir_path; + dir_path = ecore_file_dir_get(gi->file); + if (!ecore_file_exists(dir_path)) ecore_file_mkpath(dir_path); + free(dir_path); + ret = ecore_file_download_full + (gi->url, gi->file, _downloaded_cb, NULL, gi, &(gi->job), sd->ua); + + if ((!ret) || (!gi->job)) + { + ERR("Can't start to download from %s to %s", gi->url, gi->file); + continue; + } sd->try_num++; sd->download_num++; + } + sd->download_list = eina_list_remove(sd->download_list, gi); + efl_event_callback_legacy_call + (obj, ELM_MAP_EVENT_TILE_LOAD, NULL); + if (sd->download_num == 1) + edje_object_signal_emit(wd->resize_obj, + "elm,state,busy,start", "elm"); + if (file_exists) + { + /* It seem the file already exists, try to load it and let + _grid_item_update do his job. If this file isn't a image the func + will invalidate it and try to redownload it. */ + _grid_item_update(gi); + gi->wsd->finish_num++; efl_event_callback_legacy_call - (obj, ELM_MAP_EVENT_TILE_LOAD, NULL); - if (sd->download_num == 1) - edje_object_signal_emit(wd->resize_obj, - "elm,state,busy,start", "elm"); + ((gi->wsd)->obj, ELM_MAP_EVENT_TILE_LOADED, NULL); } } @@ -1214,9 +1235,9 @@ _zoom_animator_set(Elm_Map_Data *sd, Eina_Bool r = EINA_FALSE; sd->zoom_animator = !!callback; - r = efl_event_callback_del(sd->obj, EFL_EVENT_ANIMATOR_TICK, _zoom_anim_cb, sd->obj); - r |= efl_event_callback_del(sd->obj, EFL_EVENT_ANIMATOR_TICK, _zoom_bring_anim_cb, sd->obj); - if (callback) efl_event_callback_add(sd->obj, EFL_EVENT_ANIMATOR_TICK, callback, sd->obj); + r = efl_event_callback_del(sd->obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _zoom_anim_cb, sd->obj); + r |= efl_event_callback_del(sd->obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _zoom_bring_anim_cb, sd->obj); + if (callback) efl_event_callback_add(sd->obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, callback, sd->obj); return r; } @@ -3975,15 +3996,15 @@ _elm_map_pan_class_constructor(Efl_Class *klass) evas_smart_legacy_type_register(MY_PAN_CLASS_NAME_LEGACY, klass); } -#include "elm_map_pan.eo.c" +#include "elm_map_pan_eo.c" -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _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_RESULT_FAIL); - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; elm_widget_theme_object_set @@ -4071,8 +4092,6 @@ _elm_map_efl_canvas_group_group_add(Eo *obj, Elm_Map_Data *priv) Elm_Map_Pan_Data *pan_data; Evas_Object *edje; - elm_widget_sub_object_parent_add(obj); - edje = edje_object_add(evas_object_evas_get(obj)); elm_widget_resize_object_set(obj, edje); @@ -4475,7 +4494,7 @@ _elm_map_region_get(const Eo *obj EINA_UNUSED, Elm_Map_Data *sd, double *lon, do } EOLIAN static void -_elm_map_paused_set(Eo *obj, Elm_Map_Data *sd, Eina_Bool paused) +_elm_map_efl_ui_zoom_zoom_animation_set(Eo *obj, Elm_Map_Data *sd, Eina_Bool paused) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); @@ -4499,7 +4518,7 @@ _elm_map_paused_set(Eo *obj, Elm_Map_Data *sd, Eina_Bool paused) } EOLIAN static Eina_Bool -_elm_map_paused_get(const Eo *obj EINA_UNUSED, Elm_Map_Data *sd) +_elm_map_efl_ui_zoom_zoom_animation_get(const Eo *obj EINA_UNUSED, Elm_Map_Data *sd) { return sd->paused; } @@ -5504,6 +5523,18 @@ elm_map_wheel_disabled_get(const Evas_Object *obj) return elm_interface_scrollable_wheel_disabled_get(obj); } +EAPI void +elm_map_paused_set(Evas_Object *obj, Eina_Bool paused) +{ + efl_ui_zoom_animation_set(obj, paused); +} + +EAPI Eina_Bool +elm_map_paused_get(const Evas_Object *obj) +{ + return efl_ui_zoom_animation_get(obj); +} + EOLIAN static Elm_Map_Overlay* _elm_map_overlay_route_add(Eo *obj, Elm_Map_Data *sd, const Elm_Map_Route *route) { @@ -5694,4 +5725,4 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_map, Elm_Map_Data) #define ELM_MAP_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_map) -#include "elm_map.eo.c" +#include "elm_map_eo.c" diff --git a/src/lib/elementary/elm_map.eo b/src/lib/elementary/elm_map.eo deleted file mode 100644 index 33ac6a701d..0000000000 --- a/src/lib/elementary/elm_map.eo +++ /dev/null @@ -1,556 +0,0 @@ -/* FIXME: Handle properly. */ -type Elm_Map_Route: __undefined_type; [[Elementary map route type]] -type Elm_Map_Route_Cb: __undefined_type; [[Elementary map route callback type]] -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]] -type Evas.Event_Mouse_Down: __undefined_type; - -enum Elm.Map.Source_Type -{ - [[ - Set type of a external source (provider). - - See @Elm.Map.sources_get() - See @Elm.Map.source_get() - See @Elm.Map.source_set() - ]] - tile, [[Map tile provider.]] - route, [[Route service provider.]] - name, [[Name service provider.]] - last [[Sentinel value to indicate last enum field during iteration]] -} - -enum Elm.Map.Route_Type -{ - [[ - Set type of transport used on route. - - See @Elm.Map.route_add() - ]] - motocar, [[Route should consider an automobile will be used.]] - bicycle, [[Route should consider a bicycle will be used by the user.]] - foot, [[Route should consider user will be walking.]] - last [[Sentinel value to indicate last enum field during iteration]] -} - - -enum Elm.Map.Route_Method -{ - [[ - Set the routing method, what should be prioritized, time or distance. - - See @Elm.Map.route_add() - ]] - fastest, [[Route should prioritize time.]] - shortest, [[Route should prioritize distance.]] - last [[Sentinel value to indicate last enum field during iteration]] -} - - -class Elm.Map extends Efl.Ui.Widget implements Elm.Interface_Scrollable, - Efl.Access.Widget.Action, - 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 paused { - set { - [[Pause or unpause the map. - - This sets the paused state to on ($true) or off ($false) - for map. - - The default is off. - - This will stop zooming using animation, changing zoom levels - will change instantly. This will stop any existing animations - that are running. - ]] - } - get { - [[Get a value whether map is paused or not. - - This gets the current paused state for the map object. - ]] - } - values { - paused: bool; [[Use $true to pause the map $obj or $false - to unpause it.]] - } - } - @property zoom_min { - set { - [[Set the minimum zoom of the source.]] - } - get { - [[Get the minimum zoom of the source.]] - } - values { - zoom: int(-1); [[Minimum zoom value to be used.]] - } - } - @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.]] - cx: int; [[Rotation's center horizontal position.]] - cy: int; [[Rotation's center vertical position.]] - } - } - @property user_agent { - set { - [[Set the user agent used by the map object to access routing - services. - - User agent is a client application implementing a network - protocol used in communications within a clientserver - distributed computing system - - The $user_agent identification string will transmitted in - a header field $User-Agent. - ]] - } - get { - [[Get the user agent used by the map object.]] - } - values { - user_agent: string; [[The user agent to be used by the map.]] - } - } - @property zoom_max { - set { - [[Set the maximum zoom of the source.]] - } - get { - [[Get the maximum zoom of the source.]] - } - values { - zoom: int(-1); [[Maximum zoom value to be used.]] - } - } - @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 @.map_region_bring_in and @.region_show. - ]] - } - values { - lon: double; [[Pointer to store longitude.]] - lat: double; [[Pointer to store latitude.]] - } - } - @property overlays { - get { - [[Return all overlays in the map object. - - This list includes group overlays also. - So this can be changed dynamically while zooming and panning. - - @since 1.7 - ]] - return: list; [[The list of all overlays or $null upon failure.]] - } - } - @property tile_load_status { - get { - [[Get the information of tile load status. - - This gets the current tile loaded status for the map object. - ]] - } - values { - try_num: int; [[Pointer to store number of tiles download requested.]] - finish_num: int; [[Pointer to store number of tiles successfully downloaded.]] - } - } - source_set { - [[Set the current source of the map for a specific type. - - Map widget retrieves tile images that composes the map from a - web service. This web service can be set with this method - for #ELM_MAP_SOURCE_TYPE_TILE type. A different service can - return a different maps with different information and it can - use different zoom values. - - Map widget provides route data based on a external web service. - This web service can be set with this method - for #ELM_MAP_SOURCE_TYPE_ROUTE type. - - Map widget also provide geoname data based on a external web - service. This web service can be set with this method - for #ELM_MAP_SOURCE_TYPE_NAME type. - - The $source_name need to match one of the names provided by - @.sources_get. - - The current source can be get using @.source_get. - ]] - params { - @in type: Elm.Map.Source_Type; [[Source type.]] - @in source_name: string; [[The source to be used.]] - } - } - source_get @const { - [[Get the name of currently used source for a specific type.]] - return: string; [[The name of the source in use.]] - params { - @in type: Elm.Map.Source_Type; [[Source type.]] - } - } - route_add { - [[Add a new route to the map object. - - A route will be traced by point on coordinates ($flat, $flon) - to point on coordinates ($tlat, $tlon), using the route service - set with @.source_set. - - It will take $type on consideration to define the route, - depending if the user will be walking or driving, the route may - vary. One of #ELM_MAP_ROUTE_TYPE_MOTOCAR, #ELM_MAP_ROUTE_TYPE_BICYCLE, - or #ELM_MAP_ROUTE_TYPE_FOOT need to be used. - - Another parameter is what the route should prioritize, the minor - distance or the less time to be spend on the route. So $method - should be one of #ELM_MAP_ROUTE_METHOD_SHORTEST or - #ELM_MAP_ROUTE_METHOD_FASTEST. - - Routes created with this method can be deleted with - \@ref elm_map_route_del and distance can be get with - \@ref elm_map_route_distance_get. - ]] - return: ptr(Elm_Map_Route); [[The created route or $null upon failure.]] - params { - @in type: Elm.Map.Route_Type; [[The type of transport to be considered when tracing a route.]] - @in method: Elm.Map.Route_Method; [[The routing method, what should be prioritized.]] - @in flon: double; [[The start longitude.]] - @in flat: double; [[The start latitude.]] - @in tlon: double; [[The destination longitude.]] - @in tlat: double; [[The destination latitude.]] - @in route_cb: Elm_Map_Route_Cb @optional; [[The route to be traced.]] - @in data: void_ptr @optional; [[A pointer of user data.]] - } - } - track_add { - [[Add a track on the map.]] - return: Efl.Canvas.Object; [[The route object. This is an elm object of type Route.]] - params { - @in emap: void_ptr; [[The emap route object.]] - } - } - region_to_canvas_convert @const { - [[Convert geographic coordinates (longitude, latitude) - into canvas coordinates. - - This gets canvas x, y coordinates from longitude and latitude. - The canvas coordinates mean x, y coordinate from current viewport. - ]] - params { - @in lon: double; [[The longitude to convert.]] - @in lat: double; [[The latitude to convert.]] - @out x: int; [[A pointer to horizontal coordinate.]] - @out y: int; [[A pointer to vertical coordinate.]] - } - } - overlay_circle_add { - [[Add a new circle overlay to the map object. - This overlay has a circle type. - - Overlay created with this method can be deleted with - \@ref elm_map_overlay_del. - ]] - - return: ptr(Elm_Map_Overlay); [[The created overlay or $null upon failure.]] - params { - @in lon: double; [[The center longitude.]] - @in lat: double; [[The center latitude.]] - @in radius: double; [[The pixel length of radius.]] - } - } - overlay_class_add { - [[Add a new class overlay to the map object. - This overlay has a class type. - - This overlay is not shown before overlay members are appended. - if overlay members in the same class are close, group overlays - are created. If they are far away, group overlays are hidden. - When group overlays are shown, they have default style layouts - at first. - - You can change the state (hidden, paused, etc.) or set the - content or icon of the group overlays by chaning the state of - the class overlay. Do not modify the group overlay itself. - - Also these changes have a influence on the overlays in the - same class even if each overlay is alone and is not grouped. - ]] - return: ptr(Elm_Map_Overlay); [[The created overlay or $null upon failure.]] - } - overlay_bubble_add { - [[Add a new bubble overlay to the map object. - This overlay has a bubble type. - - A bubble will not be displayed before geographic coordinates - are set or any other overlays are followed. - - This overlay has a bubble style layout and icon or content can - not be set. - - Overlay created with this method can be deleted with - \@ref elm_map_overlay_del. - ]] - return: ptr(Elm_Map_Overlay); [[The created overlay or $null upon failure.]] - } - sources_get @const { - [[Get the names of available sources for a specific type. - - It will provide a list with all available sources. - Current source can be set by @.source_set, or get with - @.source_get. - - At least available sources of tile type are "Mapnik", "Osmarender", - "CycleMap" and "Maplint". - - At least available sources of route type are "Yours". - - At least available sources of name type are "Nominatim". - ]] - return: legacy(ptr(string)); [[The char pointer array of source names.]] - params { - @in type: Elm.Map.Source_Type; [[Source type.]] - } - } - overlay_polygon_add { - [[Add a new polygon overlay to the map object. - This overlay has a polygon type. - - At least 3 regions should be added to show the polygon overlay. - - Overlay created with this method can be deleted with - \@ref elm_map_overlay_del. - ]] - return: ptr(Elm_Map_Overlay); [[The created overlay or $null upon failure.]] - } - overlay_line_add { - [[Add a new line overlay to the map object. - This overlay has a line type. - - Overlay created with this method can be deleted with - \@ref elm_map_overlay_del. - ]] - return: ptr(Elm_Map_Overlay); [[The created overlay or $null upon failure.]] - params { - @in flon: double; [[The start longitude.]] - @in flat: double; [[The start latitude.]] - @in tlon: double; [[The destination longitude.]] - @in tlat: double; [[The destination latitude.]] - } - } - region_show { - [[Show the given coordinates at the center of the map, immediately. - - This causes map to redraw its viewport's contents to the region - containing the given $lat and $lon, that will be moved to the - center of the map. - - See @.map_region_bring_in for a function to move with animation. - ]] - params { - @in lon: double; [[Longitude to center at.]] - @in lat: double; [[Latitude to center at.]] - } - } - name_add @const { - [[Request a address or geographic coordinates(longitude, latitude) - from a given address or geographic coordinate(longitude, latitude). - - If you want to get address from geographic coordinates, set input - $address as $null and set $lon, $lat as you want to convert. If - address is set except NULL, $lon and $lat are checked. - - To get the string for this address, \@ref elm_map_name_address_get - should be used after callback or "name,loaded" signal is called. - - To get the longitude and latitude, \@ref elm_map_region_get - should be used. - ]] - return: ptr(Elm_Map_Name); [[A #Elm_Map_Name handle for this coordinate.]] - params { - @in address: string @optional; [[The address.]] - @in lon: double; [[The longitude.]] - @in lat: double; [[The latitude.]] - @in name_cb: Elm_Map_Name_Cb @optional; [[The callback function.]] - @in data: void_ptr @optional; [[The user callback data.]] - } - } - name_search @const { - [[Requests a list of addresses corresponding to a given name. - - \@internal - - @since 1.8 - ]] - params { - @in address: string; [[The address.]] - @in name_cb: Elm_Map_Name_List_Cb @optional; [[The callback function.]] - @in data: void_ptr @optional; [[The user callback data.]] - } - } - 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 - and show it (by scrolling) in the center of the viewport, if it - is not already centered. This will use animation to do so and - take a period of time to complete. - - 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.]] - } - } - region_zoom_bring_in { - [[Animatedly set the zoom level of the map and bring in given - coordinates to the center of the map. - - This causes map to zoom into specific zoom level and also move - to the given $lat and $lon coordinates and show it (by scrolling) - in the center of the viewport concurrently. - - See also @.map_region_bring_in. - - @since 1.11 - ]] - params { - @in zoom: int; [[The zoom level to set.]] - @in lon: double; [[Longitude to center at.]] - @in lat: double; [[Latitude to center at.]] - } - } - track_remove { - [[Remove a track from the map.]] - params { - @in route: Efl.Canvas.Object; [[The track to remove.]] - } - } - overlay_route_add { - [[Add a new route overlay to the map object. - This overlay has a route type. - - This overlay has a route style layout and icon or content can - not be set. - - The color scheme can be changed by - \@ref elm_map_overlay_content_set. - - Overlay created with this method can be deleted with - \@ref elm_map_overlay_del. - ]] - return: ptr(Elm_Map_Overlay); [[The created overlay or $null upon failure.]] - params { - @cref route: Elm_Map_Route; [[The route object to make a overlay.]] - } - } - overlay_scale_add { - [[Add a new scale overlay to the map object. This overlay has a - scale type. - - The scale overlay shows the ratio of a distance on the map to - the corresponding distance. - - Overlay created with this method can be deleted with - \@ref elm_map_overlay_del. - ]] - return: ptr(Elm_Map_Overlay); [[The created overlay or $null upon failure.]] - params { - @in x: int; [[horizontal pixel coordinate.]] - @in y: int; [[vertical pixel coordinate.]] - } - } - overlay_add { - [[Add a new overlay to the map object. This overlay has a default - type. - - A overlay will be created and shown in a specific point of the - map, defined by $lon and $lat. - - The created overlay has a default style layout before content or - icon is set. If content or icon is set, those are displayed - instead of default style layout. - - You can set by using \@ref elm_map_overlay_content_set or - \@ref elm_map_overlay_icon_set. If $null is set, default style - is shown again. - - Overlay created with this method can be deleted by - \@ref elm_map_overlay_del. - ]] - return: ptr(Elm_Map_Overlay); [[The created overlay or $null upon failure.]] - params { - @in lon: double; [[The longitude of the overlay.]] - @in lat: double; [[The latitude of the overlay.]] - } - } - canvas_to_region_convert @const { - [[Convert canvas coordinates into geographic coordinates - (longitude, latitude). - - This gets longitude and latitude from canvas x, y coordinates. - The canvas coordinates mean x, y coordinate from current viewport. - ]] - params { - @in x: int; [[Horizontal coordinate of the point to convert.]] - @in y: int; [[Vertical coordinate of the point to convert.]] - @out lon: double; [[A pointer to the longitude.]] - @out lat: double; [[A pointer to the latitude.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Object.invalidate; - Efl.Gfx.Entity.position { set; } - Efl.Gfx.Entity.size { set; } - Efl.Canvas.Group.group_member_add; - 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; get; } - Efl.Ui.Zoom.zoom_mode { set; get; } - Elm.Interface_Scrollable.wheel_disabled { set; } - } - events { - 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 */ - 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_eo.c b/src/lib/elementary/elm_map_eo.c new file mode 100644 index 0000000000..62ed9c2861 --- /dev/null +++ b/src/lib/elementary/elm_map_eo.c @@ -0,0 +1,365 @@ +EWAPI const Efl_Event_Description _ELM_MAP_EVENT_PRESS = + EFL_EVENT_DESCRIPTION("press"); +EWAPI const Efl_Event_Description _ELM_MAP_EVENT_LOADED = + EFL_EVENT_DESCRIPTION("loaded"); +EWAPI const Efl_Event_Description _ELM_MAP_EVENT_TILE_LOAD = + EFL_EVENT_DESCRIPTION("tile,load"); +EWAPI const Efl_Event_Description _ELM_MAP_EVENT_TILE_LOADED = + EFL_EVENT_DESCRIPTION("tile,loaded"); +EWAPI const Efl_Event_Description _ELM_MAP_EVENT_TILE_LOADED_FAIL = + EFL_EVENT_DESCRIPTION("tile,loaded,fail"); +EWAPI const Efl_Event_Description _ELM_MAP_EVENT_ROUTE_LOAD = + EFL_EVENT_DESCRIPTION("route,load"); +EWAPI const Efl_Event_Description _ELM_MAP_EVENT_ROUTE_LOADED = + EFL_EVENT_DESCRIPTION("route,loaded"); +EWAPI const Efl_Event_Description _ELM_MAP_EVENT_ROUTE_LOADED_FAIL = + EFL_EVENT_DESCRIPTION("route,loaded,fail"); +EWAPI const Efl_Event_Description _ELM_MAP_EVENT_NAME_LOAD = + EFL_EVENT_DESCRIPTION("name,load"); +EWAPI const Efl_Event_Description _ELM_MAP_EVENT_NAME_LOADED = + EFL_EVENT_DESCRIPTION("name,loaded"); +EWAPI const Efl_Event_Description _ELM_MAP_EVENT_NAME_LOADED_FAIL = + EFL_EVENT_DESCRIPTION("name,loaded,fail"); +EWAPI const Efl_Event_Description _ELM_MAP_EVENT_OVERLAY_CLICKED = + EFL_EVENT_DESCRIPTION("overlay,clicked"); +EWAPI const Efl_Event_Description _ELM_MAP_EVENT_OVERLAY_DEL = + EFL_EVENT_DESCRIPTION("overlay,del"); + +void _elm_map_zoom_min_set(Eo *obj, Elm_Map_Data *pd, int zoom); + + +static Eina_Error +__eolian_elm_map_zoom_min_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_map_zoom_min_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_map_zoom_min_set, EFL_FUNC_CALL(zoom), int zoom); + +int _elm_map_zoom_min_get(const Eo *obj, Elm_Map_Data *pd); + + +static Eina_Value +__eolian_elm_map_zoom_min_get_reflect(const Eo *obj) +{ + int val = elm_obj_map_zoom_min_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_map_zoom_min_get, int, -1 /* +1 */); + +void _elm_map_map_rotate_set(Eo *obj, Elm_Map_Data *pd, double degree, int cx, int cy); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_map_rotate_set, EFL_FUNC_CALL(degree, cx, cy), double degree, int cx, int cy); + +void _elm_map_map_rotate_get(const Eo *obj, Elm_Map_Data *pd, double *degree, int *cx, int *cy); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_map_rotate_get, EFL_FUNC_CALL(degree, cx, cy), double *degree, int *cx, int *cy); + +void _elm_map_user_agent_set(Eo *obj, Elm_Map_Data *pd, const char *user_agent); + + +static Eina_Error +__eolian_elm_map_user_agent_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_map_user_agent_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_map_user_agent_set, EFL_FUNC_CALL(user_agent), const char *user_agent); + +const char *_elm_map_user_agent_get(const Eo *obj, Elm_Map_Data *pd); + + +static Eina_Value +__eolian_elm_map_user_agent_get_reflect(const Eo *obj) +{ + const char *val = elm_obj_map_user_agent_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_map_user_agent_get, const char *, NULL); + +void _elm_map_zoom_max_set(Eo *obj, Elm_Map_Data *pd, int zoom); + + +static Eina_Error +__eolian_elm_map_zoom_max_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_map_zoom_max_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_map_zoom_max_set, EFL_FUNC_CALL(zoom), int zoom); + +int _elm_map_zoom_max_get(const Eo *obj, Elm_Map_Data *pd); + + +static Eina_Value +__eolian_elm_map_zoom_max_get_reflect(const Eo *obj) +{ + int val = elm_obj_map_zoom_max_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_map_zoom_max_get, int, -1 /* +1 */); + +void _elm_map_region_get(const Eo *obj, Elm_Map_Data *pd, double *lon, double *lat); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_map_region_get, EFL_FUNC_CALL(lon, lat), double *lon, double *lat); + +Eina_List *_elm_map_overlays_get(const Eo *obj, Elm_Map_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_map_overlays_get, Eina_List *, NULL); + +void _elm_map_tile_load_status_get(const Eo *obj, Elm_Map_Data *pd, int *try_num, int *finish_num); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_map_tile_load_status_get, EFL_FUNC_CALL(try_num, finish_num), int *try_num, int *finish_num); + +void _elm_map_source_set(Eo *obj, Elm_Map_Data *pd, Elm_Map_Source_Type type, const char *source_name); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_map_source_set, EFL_FUNC_CALL(type, source_name), Elm_Map_Source_Type type, const char *source_name); + +const char *_elm_map_source_get(const Eo *obj, Elm_Map_Data *pd, Elm_Map_Source_Type type); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_map_source_get, const char *, NULL, EFL_FUNC_CALL(type), Elm_Map_Source_Type type); + +Elm_Map_Route *_elm_map_route_add(Eo *obj, Elm_Map_Data *pd, Elm_Map_Route_Type type, Elm_Map_Route_Method method, double flon, double flat, double tlon, double tlat, Elm_Map_Route_Cb route_cb, void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_map_route_add, Elm_Map_Route *, NULL, EFL_FUNC_CALL(type, method, flon, flat, tlon, tlat, route_cb, data), Elm_Map_Route_Type type, Elm_Map_Route_Method method, double flon, double flat, double tlon, double tlat, Elm_Map_Route_Cb route_cb, void *data); + +Efl_Canvas_Object *_elm_map_track_add(Eo *obj, Elm_Map_Data *pd, void *emap); + +EOAPI EFL_FUNC_BODYV(elm_obj_map_track_add, Efl_Canvas_Object *, NULL, EFL_FUNC_CALL(emap), void *emap); + +void _elm_map_region_to_canvas_convert(const Eo *obj, Elm_Map_Data *pd, double lon, double lat, int *x, int *y); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_map_region_to_canvas_convert, EFL_FUNC_CALL(lon, lat, x, y), double lon, double lat, int *x, int *y); + +Elm_Map_Overlay *_elm_map_overlay_circle_add(Eo *obj, Elm_Map_Data *pd, double lon, double lat, double radius); + +EOAPI EFL_FUNC_BODYV(elm_obj_map_overlay_circle_add, Elm_Map_Overlay *, NULL, EFL_FUNC_CALL(lon, lat, radius), double lon, double lat, double radius); + +Elm_Map_Overlay *_elm_map_overlay_class_add(Eo *obj, Elm_Map_Data *pd); + +EOAPI EFL_FUNC_BODY(elm_obj_map_overlay_class_add, Elm_Map_Overlay *, NULL); + +Elm_Map_Overlay *_elm_map_overlay_bubble_add(Eo *obj, Elm_Map_Data *pd); + +EOAPI EFL_FUNC_BODY(elm_obj_map_overlay_bubble_add, Elm_Map_Overlay *, NULL); + +const char **_elm_map_sources_get(const Eo *obj, Elm_Map_Data *pd, Elm_Map_Source_Type type); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_map_sources_get, const char **, NULL, EFL_FUNC_CALL(type), Elm_Map_Source_Type type); + +Elm_Map_Overlay *_elm_map_overlay_polygon_add(Eo *obj, Elm_Map_Data *pd); + +EOAPI EFL_FUNC_BODY(elm_obj_map_overlay_polygon_add, Elm_Map_Overlay *, NULL); + +Elm_Map_Overlay *_elm_map_overlay_line_add(Eo *obj, Elm_Map_Data *pd, double flon, double flat, double tlon, double tlat); + +EOAPI EFL_FUNC_BODYV(elm_obj_map_overlay_line_add, Elm_Map_Overlay *, NULL, EFL_FUNC_CALL(flon, flat, tlon, tlat), double flon, double flat, double tlon, double tlat); + +void _elm_map_region_show(Eo *obj, Elm_Map_Data *pd, double lon, double lat); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_map_region_show, EFL_FUNC_CALL(lon, lat), double lon, double lat); + +Elm_Map_Name *_elm_map_name_add(const Eo *obj, Elm_Map_Data *pd, const char *address, double lon, double lat, Elm_Map_Name_Cb name_cb, void *data); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_map_name_add, Elm_Map_Name *, NULL, EFL_FUNC_CALL(address, lon, lat, name_cb, data), const char *address, double lon, double lat, Elm_Map_Name_Cb name_cb, void *data); + +void _elm_map_name_search(const Eo *obj, Elm_Map_Data *pd, const char *address, Elm_Map_Name_List_Cb name_cb, void *data); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_map_name_search, EFL_FUNC_CALL(address, name_cb, data), const char *address, Elm_Map_Name_List_Cb name_cb, void *data); + +void _elm_map_map_region_bring_in(Eo *obj, Elm_Map_Data *pd, double lon, double lat); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_map_region_bring_in, EFL_FUNC_CALL(lon, lat), double lon, double lat); + +void _elm_map_region_zoom_bring_in(Eo *obj, Elm_Map_Data *pd, int zoom, double lon, double lat); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_map_region_zoom_bring_in, EFL_FUNC_CALL(zoom, lon, lat), int zoom, double lon, double lat); + +void _elm_map_track_remove(Eo *obj, Elm_Map_Data *pd, Efl_Canvas_Object *route); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_map_track_remove, EFL_FUNC_CALL(route), Efl_Canvas_Object *route); + +Elm_Map_Overlay *_elm_map_overlay_route_add(Eo *obj, Elm_Map_Data *pd, const Elm_Map_Route *route); + +EOAPI EFL_FUNC_BODYV(elm_obj_map_overlay_route_add, Elm_Map_Overlay *, NULL, EFL_FUNC_CALL(route), const Elm_Map_Route *route); + +Elm_Map_Overlay *_elm_map_overlay_scale_add(Eo *obj, Elm_Map_Data *pd, int x, int y); + +EOAPI EFL_FUNC_BODYV(elm_obj_map_overlay_scale_add, Elm_Map_Overlay *, NULL, EFL_FUNC_CALL(x, y), int x, int y); + +Elm_Map_Overlay *_elm_map_overlay_add(Eo *obj, Elm_Map_Data *pd, double lon, double lat); + +EOAPI EFL_FUNC_BODYV(elm_obj_map_overlay_add, Elm_Map_Overlay *, NULL, EFL_FUNC_CALL(lon, lat), double lon, double lat); + +void _elm_map_canvas_to_region_convert(const Eo *obj, Elm_Map_Data *pd, int x, int y, double *lon, double *lat); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_map_canvas_to_region_convert, EFL_FUNC_CALL(x, y, lon, lat), int x, int y, double *lon, double *lat); + +Efl_Object *_elm_map_efl_object_constructor(Eo *obj, Elm_Map_Data *pd); + + +void _elm_map_efl_object_invalidate(Eo *obj, Elm_Map_Data *pd); + + +void _elm_map_efl_gfx_entity_position_set(Eo *obj, Elm_Map_Data *pd, Eina_Position2D pos); + + +void _elm_map_efl_gfx_entity_size_set(Eo *obj, Elm_Map_Data *pd, Eina_Size2D size); + + +void _elm_map_efl_canvas_group_group_member_add(Eo *obj, Elm_Map_Data *pd, Efl_Canvas_Object *sub_obj); + + +Eina_Error _elm_map_efl_ui_widget_theme_apply(Eo *obj, Elm_Map_Data *pd); + + +Eina_Bool _elm_map_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Map_Data *pd); + + +Eina_Bool _elm_map_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Map_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +const Efl_Access_Action_Data *_elm_map_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Map_Data *pd); + + +void _elm_map_efl_ui_zoom_zoom_level_set(Eo *obj, Elm_Map_Data *pd, double zoom); + + +double _elm_map_efl_ui_zoom_zoom_level_get(const Eo *obj, Elm_Map_Data *pd); + + +void _elm_map_efl_ui_zoom_zoom_mode_set(Eo *obj, Elm_Map_Data *pd, Efl_Ui_Zoom_Mode mode); + + +Efl_Ui_Zoom_Mode _elm_map_efl_ui_zoom_zoom_mode_get(const Eo *obj, Elm_Map_Data *pd); + + +void _elm_map_efl_ui_zoom_zoom_animation_set(Eo *obj, Elm_Map_Data *pd, Eina_Bool paused); + + +Eina_Bool _elm_map_efl_ui_zoom_zoom_animation_get(const Eo *obj, Elm_Map_Data *pd); + + +void _elm_map_elm_interface_scrollable_wheel_disabled_set(Eo *obj, Elm_Map_Data *pd, Eina_Bool disabled); + + +static Eina_Bool +_elm_map_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_MAP_EXTRA_OPS +#define ELM_MAP_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_map_zoom_min_set, _elm_map_zoom_min_set), + EFL_OBJECT_OP_FUNC(elm_obj_map_zoom_min_get, _elm_map_zoom_min_get), + EFL_OBJECT_OP_FUNC(elm_obj_map_rotate_set, _elm_map_map_rotate_set), + EFL_OBJECT_OP_FUNC(elm_obj_map_rotate_get, _elm_map_map_rotate_get), + EFL_OBJECT_OP_FUNC(elm_obj_map_user_agent_set, _elm_map_user_agent_set), + EFL_OBJECT_OP_FUNC(elm_obj_map_user_agent_get, _elm_map_user_agent_get), + EFL_OBJECT_OP_FUNC(elm_obj_map_zoom_max_set, _elm_map_zoom_max_set), + EFL_OBJECT_OP_FUNC(elm_obj_map_zoom_max_get, _elm_map_zoom_max_get), + EFL_OBJECT_OP_FUNC(elm_obj_map_region_get, _elm_map_region_get), + EFL_OBJECT_OP_FUNC(elm_obj_map_overlays_get, _elm_map_overlays_get), + EFL_OBJECT_OP_FUNC(elm_obj_map_tile_load_status_get, _elm_map_tile_load_status_get), + EFL_OBJECT_OP_FUNC(elm_obj_map_source_set, _elm_map_source_set), + EFL_OBJECT_OP_FUNC(elm_obj_map_source_get, _elm_map_source_get), + EFL_OBJECT_OP_FUNC(elm_obj_map_route_add, _elm_map_route_add), + EFL_OBJECT_OP_FUNC(elm_obj_map_track_add, _elm_map_track_add), + EFL_OBJECT_OP_FUNC(elm_obj_map_region_to_canvas_convert, _elm_map_region_to_canvas_convert), + EFL_OBJECT_OP_FUNC(elm_obj_map_overlay_circle_add, _elm_map_overlay_circle_add), + EFL_OBJECT_OP_FUNC(elm_obj_map_overlay_class_add, _elm_map_overlay_class_add), + EFL_OBJECT_OP_FUNC(elm_obj_map_overlay_bubble_add, _elm_map_overlay_bubble_add), + EFL_OBJECT_OP_FUNC(elm_obj_map_sources_get, _elm_map_sources_get), + EFL_OBJECT_OP_FUNC(elm_obj_map_overlay_polygon_add, _elm_map_overlay_polygon_add), + EFL_OBJECT_OP_FUNC(elm_obj_map_overlay_line_add, _elm_map_overlay_line_add), + EFL_OBJECT_OP_FUNC(elm_obj_map_region_show, _elm_map_region_show), + EFL_OBJECT_OP_FUNC(elm_obj_map_name_add, _elm_map_name_add), + EFL_OBJECT_OP_FUNC(elm_obj_map_name_search, _elm_map_name_search), + EFL_OBJECT_OP_FUNC(elm_obj_map_region_bring_in, _elm_map_map_region_bring_in), + EFL_OBJECT_OP_FUNC(elm_obj_map_region_zoom_bring_in, _elm_map_region_zoom_bring_in), + EFL_OBJECT_OP_FUNC(elm_obj_map_track_remove, _elm_map_track_remove), + EFL_OBJECT_OP_FUNC(elm_obj_map_overlay_route_add, _elm_map_overlay_route_add), + EFL_OBJECT_OP_FUNC(elm_obj_map_overlay_scale_add, _elm_map_overlay_scale_add), + EFL_OBJECT_OP_FUNC(elm_obj_map_overlay_add, _elm_map_overlay_add), + EFL_OBJECT_OP_FUNC(elm_obj_map_canvas_to_region_convert, _elm_map_canvas_to_region_convert), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_map_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_invalidate, _elm_map_efl_object_invalidate), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_map_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_map_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_canvas_group_member_add, _elm_map_efl_canvas_group_group_member_add), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_map_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_on_focus_update, _elm_map_efl_ui_focus_object_on_focus_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_map_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_map_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_ui_zoom_level_set, _elm_map_efl_ui_zoom_zoom_level_set), + EFL_OBJECT_OP_FUNC(efl_ui_zoom_level_get, _elm_map_efl_ui_zoom_zoom_level_get), + EFL_OBJECT_OP_FUNC(efl_ui_zoom_mode_set, _elm_map_efl_ui_zoom_zoom_mode_set), + EFL_OBJECT_OP_FUNC(efl_ui_zoom_mode_get, _elm_map_efl_ui_zoom_zoom_mode_get), + EFL_OBJECT_OP_FUNC(efl_ui_zoom_animation_set, _elm_map_efl_ui_zoom_zoom_animation_set), + EFL_OBJECT_OP_FUNC(efl_ui_zoom_animation_get, _elm_map_efl_ui_zoom_zoom_animation_get), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_wheel_disabled_set, _elm_map_elm_interface_scrollable_wheel_disabled_set), + ELM_MAP_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"zoom_min", __eolian_elm_map_zoom_min_set_reflect, __eolian_elm_map_zoom_min_get_reflect}, + {"user_agent", __eolian_elm_map_user_agent_set_reflect, __eolian_elm_map_user_agent_get_reflect}, + {"zoom_max", __eolian_elm_map_zoom_max_set_reflect, __eolian_elm_map_zoom_max_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_map_class_desc = { + EO_VERSION, + "Elm.Map", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Map_Data), + _elm_map_class_initializer, + _elm_map_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_map_class_get, &_elm_map_class_desc, EFL_UI_WIDGET_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, EFL_UI_ZOOM_INTERFACE, NULL); + +#include "elm_map_eo.legacy.c" diff --git a/src/lib/elementary/elm_map_eo.h b/src/lib/elementary/elm_map_eo.h new file mode 100644 index 0000000000..d33e955cc4 --- /dev/null +++ b/src/lib/elementary/elm_map_eo.h @@ -0,0 +1,731 @@ +#ifndef _ELM_MAP_EO_H_ +#define _ELM_MAP_EO_H_ + +#ifndef _ELM_MAP_EO_CLASS_TYPE +#define _ELM_MAP_EO_CLASS_TYPE + +typedef Eo Elm_Map; + +#endif + +#ifndef _ELM_MAP_EO_TYPES +#define _ELM_MAP_EO_TYPES + +/** + * @brief Set type of a external source (provider). + * + * See @ref elm_obj_map_sources_get() See @ref elm_obj_map_source_get() See + * @ref elm_obj_map_source_set() + * + * @ingroup Elm_Map + */ +typedef enum +{ + ELM_MAP_SOURCE_TYPE_TILE = 0, /**< Map tile provider. */ + ELM_MAP_SOURCE_TYPE_ROUTE, /**< Route service provider. */ + ELM_MAP_SOURCE_TYPE_NAME, /**< Name service provider. */ + ELM_MAP_SOURCE_TYPE_LAST /**< Sentinel value to indicate last enum field + * during iteration */ +} Elm_Map_Source_Type; + +/** + * @brief Set type of transport used on route. + * + * See @ref elm_obj_map_route_add() + * + * @ingroup Elm_Map + */ +typedef enum +{ + ELM_MAP_ROUTE_TYPE_MOTOCAR = 0, /**< Route should consider an automobile will + * be used. */ + ELM_MAP_ROUTE_TYPE_BICYCLE, /**< Route should consider a bicycle will be used + * by the user. */ + ELM_MAP_ROUTE_TYPE_FOOT, /**< Route should consider user will be walking. */ + ELM_MAP_ROUTE_TYPE_LAST /**< Sentinel value to indicate last enum field during + * iteration */ +} Elm_Map_Route_Type; + +/** + * @brief Set the routing method, what should be prioritized, time or distance. + * + * See @ref elm_obj_map_route_add() + * + * @ingroup Elm_Map + */ +typedef enum +{ + ELM_MAP_ROUTE_METHOD_FASTEST = 0, /**< Route should prioritize time. */ + ELM_MAP_ROUTE_METHOD_SHORTEST, /**< Route should prioritize distance. */ + ELM_MAP_ROUTE_METHOD_LAST /**< Sentinel value to indicate last enum field + * during iteration */ +} Elm_Map_Route_Method; + + +#endif +/** Elementary map class + * + * @ingroup Elm_Map + */ +#define ELM_MAP_CLASS elm_map_class_get() + +EWAPI const Efl_Class *elm_map_class_get(void); + +/** + * @brief Set the minimum zoom of the source. + * + * @param[in] obj The object. + * @param[in] zoom Minimum zoom value to be used. + * + * @ingroup Elm_Map + */ +EOAPI void elm_obj_map_zoom_min_set(Eo *obj, int zoom); + +/** + * @brief Get the minimum zoom of the source. + * + * @param[in] obj The object. + * + * @return Minimum zoom value to be used. + * + * @ingroup Elm_Map + */ +EOAPI int elm_obj_map_zoom_min_get(const Eo *obj); + +/** + * @brief Rotate the map. + * + * @param[in] obj The object. + * @param[in] degree Angle from 0.0 to 360.0 to rotate around Z axis. + * @param[in] cx Rotation's center horizontal position. + * @param[in] cy Rotation's center vertical position. + * + * @ingroup Elm_Map + */ +EOAPI void elm_obj_map_rotate_set(Eo *obj, double degree, int cx, int cy); + +/** + * @brief Get the rotate degree of the map. + * + * @param[in] obj The object. + * @param[out] degree Angle from 0.0 to 360.0 to rotate around Z axis. + * @param[out] cx Rotation's center horizontal position. + * @param[out] cy Rotation's center vertical position. + * + * @ingroup Elm_Map + */ +EOAPI void elm_obj_map_rotate_get(const Eo *obj, double *degree, int *cx, int *cy); + +/** + * @brief Set the user agent used by the map object to access routing services. + * + * User agent is a client application implementing a network protocol used in + * communications within a clientserver distributed computing system + * + * The @c user_agent identification string will transmitted in a header field + * @c User-Agent. + * + * @param[in] obj The object. + * @param[in] user_agent The user agent to be used by the map. + * + * @ingroup Elm_Map + */ +EOAPI void elm_obj_map_user_agent_set(Eo *obj, const char *user_agent); + +/** + * @brief Get the user agent used by the map object. + * + * @param[in] obj The object. + * + * @return The user agent to be used by the map. + * + * @ingroup Elm_Map + */ +EOAPI const char *elm_obj_map_user_agent_get(const Eo *obj); + +/** + * @brief Set the maximum zoom of the source. + * + * @param[in] obj The object. + * @param[in] zoom Maximum zoom value to be used. + * + * @ingroup Elm_Map + */ +EOAPI void elm_obj_map_zoom_max_set(Eo *obj, int zoom); + +/** + * @brief Get the maximum zoom of the source. + * + * @param[in] obj The object. + * + * @return Maximum zoom value to be used. + * + * @ingroup Elm_Map + */ +EOAPI int elm_obj_map_zoom_max_get(const Eo *obj); + +/** + * @brief Get the current geographic coordinates of the map. + * + * This gets the current center coordinates of the map object. It can be set by + * @ref elm_obj_map_region_bring_in and @ref elm_obj_map_region_show. + * + * @param[in] obj The object. + * @param[out] lon Pointer to store longitude. + * @param[out] lat Pointer to store latitude. + * + * @ingroup Elm_Map + */ +EOAPI void elm_obj_map_region_get(const Eo *obj, double *lon, double *lat); + +/** + * @brief Return all overlays in the map object. + * + * This list includes group overlays also. So this can be changed dynamically + * while zooming and panning. + * + * @param[in] obj The object. + * + * @return The list of all overlays or @c null upon failure. + * + * @since 1.7 + * + * @ingroup Elm_Map + */ +EOAPI Eina_List *elm_obj_map_overlays_get(const Eo *obj); + +/** + * @brief Get the information of tile load status. + * + * This gets the current tile loaded status for the map object. + * + * @param[in] obj The object. + * @param[out] try_num Pointer to store number of tiles download requested. + * @param[out] finish_num Pointer to store number of tiles successfully + * downloaded. + * + * @ingroup Elm_Map + */ +EOAPI void elm_obj_map_tile_load_status_get(const Eo *obj, int *try_num, int *finish_num); + +/** + * @brief Set the current source of the map for a specific type. + * + * Map widget retrieves tile images that composes the map from a web service. + * This web service can be set with this method for #ELM_MAP_SOURCE_TYPE_TILE + * type. A different service can return a different maps with different + * information and it can use different zoom values. + * + * Map widget provides route data based on a external web service. This web + * service can be set with this method for #ELM_MAP_SOURCE_TYPE_ROUTE type. + * + * Map widget also provide geoname data based on a external web service. This + * web service can be set with this method for #ELM_MAP_SOURCE_TYPE_NAME type. + * + * The @c source_name need to match one of the names provided by + * @ref elm_obj_map_sources_get. + * + * The current source can be get using @ref elm_obj_map_source_get. + * + * @param[in] obj The object. + * @param[in] type Source type. + * @param[in] source_name The source to be used. + * + * @ingroup Elm_Map + */ +EOAPI void elm_obj_map_source_set(Eo *obj, Elm_Map_Source_Type type, const char *source_name); + +/** + * @brief Get the name of currently used source for a specific type. + * + * @param[in] obj The object. + * @param[in] type Source type. + * + * @return The name of the source in use. + * + * @ingroup Elm_Map + */ +EOAPI const char *elm_obj_map_source_get(const Eo *obj, Elm_Map_Source_Type type); + +/** + * @brief Add a new route to the map object. + * + * A route will be traced by point on coordinates ($flat, @c flon) to point on + * coordinates ($tlat, @c tlon), using the route service set with + * @ref elm_obj_map_source_set. + * + * It will take @c type on consideration to define the route, depending if the + * user will be walking or driving, the route may vary. One of + * #ELM_MAP_ROUTE_TYPE_MOTOCAR, #ELM_MAP_ROUTE_TYPE_BICYCLE, or + * #ELM_MAP_ROUTE_TYPE_FOOT need to be used. + * + * Another parameter is what the route should prioritize, the minor distance or + * the less time to be spend on the route. So @c method should be one of + * #ELM_MAP_ROUTE_METHOD_SHORTEST or #ELM_MAP_ROUTE_METHOD_FASTEST. + * + * Routes created with this method can be deleted with @ref elm_map_route_del + * and distance can be get with @ref elm_map_route_distance_get. + * + * @param[in] obj The object. + * @param[in] type The type of transport to be considered when tracing a route. + * @param[in] method The routing method, what should be prioritized. + * @param[in] flon The start longitude. + * @param[in] flat The start latitude. + * @param[in] tlon The destination longitude. + * @param[in] tlat The destination latitude. + * @param[in] route_cb The route to be traced. + * @param[in] data A pointer of user data. + * + * @return The created route or @c null upon failure. + * + * @ingroup Elm_Map + */ +EOAPI Elm_Map_Route *elm_obj_map_route_add(Eo *obj, Elm_Map_Route_Type type, Elm_Map_Route_Method method, double flon, double flat, double tlon, double tlat, Elm_Map_Route_Cb route_cb, void *data); + +/** + * @brief Add a track on the map. + * + * @param[in] obj The object. + * @param[in] emap The emap route object. + * + * @return The route object. This is an elm object of type Route. + * + * @ingroup Elm_Map + */ +EOAPI Efl_Canvas_Object *elm_obj_map_track_add(Eo *obj, void *emap); + +/** + * @brief Convert geographic coordinates (longitude, latitude) into canvas + * coordinates. + * + * This gets canvas x, y coordinates from longitude and latitude. The canvas + * coordinates mean x, y coordinate from current viewport. + * + * @param[in] obj The object. + * @param[in] lon The longitude to convert. + * @param[in] lat The latitude to convert. + * @param[out] x A pointer to horizontal coordinate. + * @param[out] y A pointer to vertical coordinate. + * + * @ingroup Elm_Map + */ +EOAPI void elm_obj_map_region_to_canvas_convert(const Eo *obj, double lon, double lat, int *x, int *y); + +/** + * @brief Add a new circle overlay to the map object. This overlay has a circle + * type. + * + * Overlay created with this method can be deleted with @ref + * elm_map_overlay_del. + * + * @param[in] obj The object. + * @param[in] lon The center longitude. + * @param[in] lat The center latitude. + * @param[in] radius The pixel length of radius. + * + * @return The created overlay or @c null upon failure. + * + * @ingroup Elm_Map + */ +EOAPI Elm_Map_Overlay *elm_obj_map_overlay_circle_add(Eo *obj, double lon, double lat, double radius); + +/** + * @brief Add a new class overlay to the map object. This overlay has a class + * type. + * + * This overlay is not shown before overlay members are appended. if overlay + * members in the same class are close, group overlays are created. If they are + * far away, group overlays are hidden. When group overlays are shown, they + * have default style layouts at first. + * + * You can change the state (hidden, paused, etc.) or set the content or icon + * of the group overlays by chaning the state of the class overlay. Do not + * modify the group overlay itself. + * + * Also these changes have a influence on the overlays in the same class even + * if each overlay is alone and is not grouped. + * + * @param[in] obj The object. + * + * @return The created overlay or @c null upon failure. + * + * @ingroup Elm_Map + */ +EOAPI Elm_Map_Overlay *elm_obj_map_overlay_class_add(Eo *obj); + +/** + * @brief Add a new bubble overlay to the map object. This overlay has a bubble + * type. + * + * A bubble will not be displayed before geographic coordinates are set or any + * other overlays are followed. + * + * This overlay has a bubble style layout and icon or content can not be set. + * + * Overlay created with this method can be deleted with @ref + * elm_map_overlay_del. + * + * @param[in] obj The object. + * + * @return The created overlay or @c null upon failure. + * + * @ingroup Elm_Map + */ +EOAPI Elm_Map_Overlay *elm_obj_map_overlay_bubble_add(Eo *obj); + +/** + * @brief Get the names of available sources for a specific type. + * + * It will provide a list with all available sources. Current source can be set + * by @ref elm_obj_map_source_set, or get with @ref elm_obj_map_source_get. + * + * At least available sources of tile type are "Mapnik", "Osmarender", + * "CycleMap" and "Maplint". + * + * At least available sources of route type are "Yours". + * + * At least available sources of name type are "Nominatim". + * + * @param[in] obj The object. + * @param[in] type Source type. + * + * @return The char pointer array of source names. + * + * @ingroup Elm_Map + */ +EOAPI const char **elm_obj_map_sources_get(const Eo *obj, Elm_Map_Source_Type type); + +/** + * @brief Add a new polygon overlay to the map object. This overlay has a + * polygon type. + * + * At least 3 regions should be added to show the polygon overlay. + * + * Overlay created with this method can be deleted with @ref + * elm_map_overlay_del. + * + * @param[in] obj The object. + * + * @return The created overlay or @c null upon failure. + * + * @ingroup Elm_Map + */ +EOAPI Elm_Map_Overlay *elm_obj_map_overlay_polygon_add(Eo *obj); + +/** + * @brief Add a new line overlay to the map object. This overlay has a line + * type. + * + * Overlay created with this method can be deleted with @ref + * elm_map_overlay_del. + * + * @param[in] obj The object. + * @param[in] flon The start longitude. + * @param[in] flat The start latitude. + * @param[in] tlon The destination longitude. + * @param[in] tlat The destination latitude. + * + * @return The created overlay or @c null upon failure. + * + * @ingroup Elm_Map + */ +EOAPI Elm_Map_Overlay *elm_obj_map_overlay_line_add(Eo *obj, double flon, double flat, double tlon, double tlat); + +/** + * @brief Show the given coordinates at the center of the map, immediately. + * + * This causes map to redraw its viewport's contents to the region containing + * the given @c lat and @c lon, that will be moved to the center of the map. + * + * See @ref elm_obj_map_region_bring_in for a function to move with animation. + * + * @param[in] obj The object. + * @param[in] lon Longitude to center at. + * @param[in] lat Latitude to center at. + * + * @ingroup Elm_Map + */ +EOAPI void elm_obj_map_region_show(Eo *obj, double lon, double lat); + +/** + * @brief Request a address or geographic coordinates(longitude, latitude) from + * a given address or geographic coordinate(longitude, latitude). + * + * If you want to get address from geographic coordinates, set input @c address + * as @c null and set @c lon, @c lat as you want to convert. If address is set + * except NULL, @c lon and @c lat are checked. + * + * To get the string for this address, @ref elm_map_name_address_get should be + * used after callback or "name,loaded" signal is called. + * + * To get the longitude and latitude, @ref elm_map_region_get should be used. + * + * @param[in] obj The object. + * @param[in] address The address. + * @param[in] lon The longitude. + * @param[in] lat The latitude. + * @param[in] name_cb The callback function. + * @param[in] data The user callback data. + * + * @return A #Elm_Map_Name handle for this coordinate. + * + * @ingroup Elm_Map + */ +EOAPI Elm_Map_Name *elm_obj_map_name_add(const Eo *obj, const char *address, double lon, double lat, Elm_Map_Name_Cb name_cb, void *data); + +/** + * @brief Requests a list of addresses corresponding to a given name. + * + * @internal + * + * @param[in] obj The object. + * @param[in] address The address. + * @param[in] name_cb The callback function. + * @param[in] data The user callback data. + * + * @since 1.8 + * + * @ingroup Elm_Map + */ +EOAPI void elm_obj_map_name_search(const Eo *obj, const char *address, Elm_Map_Name_List_Cb name_cb, void *data); + +/** + * @brief Animatedly bring in given coordinates to the center of the map. + * + * This causes map to jump to the given @c lat and @c lon coordinates and show + * it (by scrolling) in the center of the viewport, if it is not already + * centered. This will use animation to do so and take a period of time to + * complete. + * + * See @ref elm_obj_map_region_show for a function to avoid animation. + * + * @param[in] obj The object. + * @param[in] lon Longitude to center at. + * @param[in] lat Latitude to center at. + * + * @ingroup Elm_Map + */ +EOAPI void elm_obj_map_region_bring_in(Eo *obj, double lon, double lat); + +/** + * @brief Animatedly set the zoom level of the map and bring in given + * coordinates to the center of the map. + * + * This causes map to zoom into specific zoom level and also move to the given + * @c lat and @c lon coordinates and show it (by scrolling) in the center of + * the viewport concurrently. + * + * See also @ref elm_obj_map_region_bring_in. + * + * @param[in] obj The object. + * @param[in] zoom The zoom level to set. + * @param[in] lon Longitude to center at. + * @param[in] lat Latitude to center at. + * + * @since 1.11 + * + * @ingroup Elm_Map + */ +EOAPI void elm_obj_map_region_zoom_bring_in(Eo *obj, int zoom, double lon, double lat); + +/** + * @brief Remove a track from the map. + * + * @param[in] obj The object. + * @param[in] route The track to remove. + * + * @ingroup Elm_Map + */ +EOAPI void elm_obj_map_track_remove(Eo *obj, Efl_Canvas_Object *route); + +/** + * @brief Add a new route overlay to the map object. This overlay has a route + * type. + * + * This overlay has a route style layout and icon or content can not be set. + * + * The color scheme can be changed by @ref elm_map_overlay_content_set. + * + * Overlay created with this method can be deleted with @ref + * elm_map_overlay_del. + * + * @param[in] obj The object. + * @param[in] route The route object to make a overlay. + * + * @return The created overlay or @c null upon failure. + * + * @ingroup Elm_Map + */ +EOAPI Elm_Map_Overlay *elm_obj_map_overlay_route_add(Eo *obj, const Elm_Map_Route *route); + +/** + * @brief Add a new scale overlay to the map object. This overlay has a scale + * type. + * + * The scale overlay shows the ratio of a distance on the map to the + * corresponding distance. + * + * Overlay created with this method can be deleted with @ref + * elm_map_overlay_del. + * + * @param[in] obj The object. + * @param[in] x horizontal pixel coordinate. + * @param[in] y vertical pixel coordinate. + * + * @return The created overlay or @c null upon failure. + * + * @ingroup Elm_Map + */ +EOAPI Elm_Map_Overlay *elm_obj_map_overlay_scale_add(Eo *obj, int x, int y); + +/** + * @brief Add a new overlay to the map object. This overlay has a default type. + * + * A overlay will be created and shown in a specific point of the map, defined + * by @c lon and @c lat. + * + * The created overlay has a default style layout before content or icon is + * set. If content or icon is set, those are displayed instead of default style + * layout. + * + * You can set by using @ref elm_map_overlay_content_set or @ref + * elm_map_overlay_icon_set. If @c null is set, default style is shown again. + * + * Overlay created with this method can be deleted by @ref elm_map_overlay_del. + * + * @param[in] obj The object. + * @param[in] lon The longitude of the overlay. + * @param[in] lat The latitude of the overlay. + * + * @return The created overlay or @c null upon failure. + * + * @ingroup Elm_Map + */ +EOAPI Elm_Map_Overlay *elm_obj_map_overlay_add(Eo *obj, double lon, double lat); + +/** + * @brief Convert canvas coordinates into geographic coordinates (longitude, + * latitude). + * + * This gets longitude and latitude from canvas x, y coordinates. The canvas + * coordinates mean x, y coordinate from current viewport. + * + * @param[in] obj The object. + * @param[in] x Horizontal coordinate of the point to convert. + * @param[in] y Vertical coordinate of the point to convert. + * @param[out] lon A pointer to the longitude. + * @param[out] lat A pointer to the latitude. + * + * @ingroup Elm_Map + */ +EOAPI void elm_obj_map_canvas_to_region_convert(const Eo *obj, int x, int y, double *lon, double *lat); + +EWAPI extern const Efl_Event_Description _ELM_MAP_EVENT_PRESS; + +/** Called when map was pressed + * @return Evas_Event_Mouse_Down + * + * @ingroup Elm_Map + */ +#define ELM_MAP_EVENT_PRESS (&(_ELM_MAP_EVENT_PRESS)) + +EWAPI extern const Efl_Event_Description _ELM_MAP_EVENT_LOADED; + +/** Called when map loaded + * + * @ingroup Elm_Map + */ +#define ELM_MAP_EVENT_LOADED (&(_ELM_MAP_EVENT_LOADED)) + +EWAPI extern const Efl_Event_Description _ELM_MAP_EVENT_TILE_LOAD; + +/** Called when title load started + * + * @ingroup Elm_Map + */ +#define ELM_MAP_EVENT_TILE_LOAD (&(_ELM_MAP_EVENT_TILE_LOAD)) + +EWAPI extern const Efl_Event_Description _ELM_MAP_EVENT_TILE_LOADED; + +/** Called when title load finished + * + * @ingroup Elm_Map + */ +#define ELM_MAP_EVENT_TILE_LOADED (&(_ELM_MAP_EVENT_TILE_LOADED)) + +EWAPI extern const Efl_Event_Description _ELM_MAP_EVENT_TILE_LOADED_FAIL; + +/** Called when title load failed + * + * @ingroup Elm_Map + */ +#define ELM_MAP_EVENT_TILE_LOADED_FAIL (&(_ELM_MAP_EVENT_TILE_LOADED_FAIL)) + +EWAPI extern const Efl_Event_Description _ELM_MAP_EVENT_ROUTE_LOAD; + +/** Called when route load started + * @return Elm_Map_Route + * + * @ingroup Elm_Map + */ +#define ELM_MAP_EVENT_ROUTE_LOAD (&(_ELM_MAP_EVENT_ROUTE_LOAD)) + +EWAPI extern const Efl_Event_Description _ELM_MAP_EVENT_ROUTE_LOADED; + +/** Called when route load finished + * + * @ingroup Elm_Map + */ +#define ELM_MAP_EVENT_ROUTE_LOADED (&(_ELM_MAP_EVENT_ROUTE_LOADED)) + +EWAPI extern const Efl_Event_Description _ELM_MAP_EVENT_ROUTE_LOADED_FAIL; + +/** Called when route load failed + * + * @ingroup Elm_Map + */ +#define ELM_MAP_EVENT_ROUTE_LOADED_FAIL (&(_ELM_MAP_EVENT_ROUTE_LOADED_FAIL)) + +EWAPI extern const Efl_Event_Description _ELM_MAP_EVENT_NAME_LOAD; + +/** Called when name load started + * + * @ingroup Elm_Map + */ +#define ELM_MAP_EVENT_NAME_LOAD (&(_ELM_MAP_EVENT_NAME_LOAD)) + +EWAPI extern const Efl_Event_Description _ELM_MAP_EVENT_NAME_LOADED; + +/** Called when name load finished + * + * @ingroup Elm_Map + */ +#define ELM_MAP_EVENT_NAME_LOADED (&(_ELM_MAP_EVENT_NAME_LOADED)) + +EWAPI extern const Efl_Event_Description _ELM_MAP_EVENT_NAME_LOADED_FAIL; + +/** Called when name load failed + * + * @ingroup Elm_Map + */ +#define ELM_MAP_EVENT_NAME_LOADED_FAIL (&(_ELM_MAP_EVENT_NAME_LOADED_FAIL)) + +EWAPI extern const Efl_Event_Description _ELM_MAP_EVENT_OVERLAY_CLICKED; + +/** Called when overlay was clicked + * @return Elm_Map_Overlay + * + * @ingroup Elm_Map + */ +#define ELM_MAP_EVENT_OVERLAY_CLICKED (&(_ELM_MAP_EVENT_OVERLAY_CLICKED)) + +EWAPI extern const Efl_Event_Description _ELM_MAP_EVENT_OVERLAY_DEL; + +/** Called when overlay was deleted + * @return Elm_Map_Overlay + * + * @ingroup Elm_Map + */ +#define ELM_MAP_EVENT_OVERLAY_DEL (&(_ELM_MAP_EVENT_OVERLAY_DEL)) + +#endif diff --git a/src/lib/elementary/elm_map_eo.legacy.c b/src/lib/elementary/elm_map_eo.legacy.c new file mode 100644 index 0000000000..a89ce86cd4 --- /dev/null +++ b/src/lib/elementary/elm_map_eo.legacy.c @@ -0,0 +1,192 @@ + +EAPI void +elm_map_zoom_min_set(Elm_Map *obj, int zoom) +{ + elm_obj_map_zoom_min_set(obj, zoom); +} + +EAPI int +elm_map_zoom_min_get(const Elm_Map *obj) +{ + return elm_obj_map_zoom_min_get(obj); +} + +EAPI void +elm_map_rotate_set(Elm_Map *obj, double degree, int cx, int cy) +{ + elm_obj_map_rotate_set(obj, degree, cx, cy); +} + +EAPI void +elm_map_rotate_get(const Elm_Map *obj, double *degree, int *cx, int *cy) +{ + elm_obj_map_rotate_get(obj, degree, cx, cy); +} + +EAPI void +elm_map_user_agent_set(Elm_Map *obj, const char *user_agent) +{ + elm_obj_map_user_agent_set(obj, user_agent); +} + +EAPI const char * +elm_map_user_agent_get(const Elm_Map *obj) +{ + return elm_obj_map_user_agent_get(obj); +} + +EAPI void +elm_map_zoom_max_set(Elm_Map *obj, int zoom) +{ + elm_obj_map_zoom_max_set(obj, zoom); +} + +EAPI int +elm_map_zoom_max_get(const Elm_Map *obj) +{ + return elm_obj_map_zoom_max_get(obj); +} + +EAPI void +elm_map_region_get(const Elm_Map *obj, double *lon, double *lat) +{ + elm_obj_map_region_get(obj, lon, lat); +} + +EAPI Eina_List * +elm_map_overlays_get(const Elm_Map *obj) +{ + return elm_obj_map_overlays_get(obj); +} + +EAPI void +elm_map_tile_load_status_get(const Elm_Map *obj, int *try_num, int *finish_num) +{ + elm_obj_map_tile_load_status_get(obj, try_num, finish_num); +} + +EAPI void +elm_map_source_set(Elm_Map *obj, Elm_Map_Source_Type type, const char *source_name) +{ + elm_obj_map_source_set(obj, type, source_name); +} + +EAPI const char * +elm_map_source_get(const Elm_Map *obj, Elm_Map_Source_Type type) +{ + return elm_obj_map_source_get(obj, type); +} + +EAPI Elm_Map_Route * +elm_map_route_add(Elm_Map *obj, Elm_Map_Route_Type type, Elm_Map_Route_Method method, double flon, double flat, double tlon, double tlat, Elm_Map_Route_Cb route_cb, void *data) +{ + return elm_obj_map_route_add(obj, type, method, flon, flat, tlon, tlat, route_cb, data); +} + +EAPI Efl_Canvas_Object * +elm_map_track_add(Elm_Map *obj, void *emap) +{ + return elm_obj_map_track_add(obj, emap); +} + +EAPI void +elm_map_region_to_canvas_convert(const Elm_Map *obj, double lon, double lat, int *x, int *y) +{ + elm_obj_map_region_to_canvas_convert(obj, lon, lat, x, y); +} + +EAPI Elm_Map_Overlay * +elm_map_overlay_circle_add(Elm_Map *obj, double lon, double lat, double radius) +{ + return elm_obj_map_overlay_circle_add(obj, lon, lat, radius); +} + +EAPI Elm_Map_Overlay * +elm_map_overlay_class_add(Elm_Map *obj) +{ + return elm_obj_map_overlay_class_add(obj); +} + +EAPI Elm_Map_Overlay * +elm_map_overlay_bubble_add(Elm_Map *obj) +{ + return elm_obj_map_overlay_bubble_add(obj); +} + +EAPI const char ** +elm_map_sources_get(const Elm_Map *obj, Elm_Map_Source_Type type) +{ + return elm_obj_map_sources_get(obj, type); +} + +EAPI Elm_Map_Overlay * +elm_map_overlay_polygon_add(Elm_Map *obj) +{ + return elm_obj_map_overlay_polygon_add(obj); +} + +EAPI Elm_Map_Overlay * +elm_map_overlay_line_add(Elm_Map *obj, double flon, double flat, double tlon, double tlat) +{ + return elm_obj_map_overlay_line_add(obj, flon, flat, tlon, tlat); +} + +EAPI void +elm_map_region_show(Elm_Map *obj, double lon, double lat) +{ + elm_obj_map_region_show(obj, lon, lat); +} + +EAPI Elm_Map_Name * +elm_map_name_add(const Elm_Map *obj, const char *address, double lon, double lat, Elm_Map_Name_Cb name_cb, void *data) +{ + return elm_obj_map_name_add(obj, address, lon, lat, name_cb, data); +} + +EAPI void +elm_map_name_search(const Elm_Map *obj, const char *address, Elm_Map_Name_List_Cb name_cb, void *data) +{ + elm_obj_map_name_search(obj, address, name_cb, data); +} + +EAPI void +elm_map_region_bring_in(Elm_Map *obj, double lon, double lat) +{ + elm_obj_map_region_bring_in(obj, lon, lat); +} + +EAPI void +elm_map_region_zoom_bring_in(Elm_Map *obj, int zoom, double lon, double lat) +{ + elm_obj_map_region_zoom_bring_in(obj, zoom, lon, lat); +} + +EAPI void +elm_map_track_remove(Elm_Map *obj, Efl_Canvas_Object *route) +{ + elm_obj_map_track_remove(obj, route); +} + +EAPI Elm_Map_Overlay * +elm_map_overlay_route_add(Elm_Map *obj, const Elm_Map_Route *route) +{ + return elm_obj_map_overlay_route_add(obj, route); +} + +EAPI Elm_Map_Overlay * +elm_map_overlay_scale_add(Elm_Map *obj, int x, int y) +{ + return elm_obj_map_overlay_scale_add(obj, x, y); +} + +EAPI Elm_Map_Overlay * +elm_map_overlay_add(Elm_Map *obj, double lon, double lat) +{ + return elm_obj_map_overlay_add(obj, lon, lat); +} + +EAPI void +elm_map_canvas_to_region_convert(const Elm_Map *obj, int x, int y, double *lon, double *lat) +{ + elm_obj_map_canvas_to_region_convert(obj, x, y, lon, lat); +} diff --git a/src/lib/elementary/elm_map_eo.legacy.h b/src/lib/elementary/elm_map_eo.legacy.h new file mode 100644 index 0000000000..cd51009b02 --- /dev/null +++ b/src/lib/elementary/elm_map_eo.legacy.h @@ -0,0 +1,616 @@ +#ifndef _ELM_MAP_EO_LEGACY_H_ +#define _ELM_MAP_EO_LEGACY_H_ + +#ifndef _ELM_MAP_EO_CLASS_TYPE +#define _ELM_MAP_EO_CLASS_TYPE + +typedef Eo Elm_Map; + +#endif + +#ifndef _ELM_MAP_EO_TYPES +#define _ELM_MAP_EO_TYPES + +/** + * @brief Set type of a external source (provider). + * + * See @ref elm_map_sources_get() See @ref elm_map_source_get() See + * @ref elm_map_source_set() + * + * @ingroup Elm_Map + */ +typedef enum +{ + ELM_MAP_SOURCE_TYPE_TILE = 0, /**< Map tile provider. */ + ELM_MAP_SOURCE_TYPE_ROUTE, /**< Route service provider. */ + ELM_MAP_SOURCE_TYPE_NAME, /**< Name service provider. */ + ELM_MAP_SOURCE_TYPE_LAST /**< Sentinel value to indicate last enum field + * during iteration */ +} Elm_Map_Source_Type; + +/** + * @brief Set type of transport used on route. + * + * See @ref elm_map_route_add() + * + * @ingroup Elm_Map + */ +typedef enum +{ + ELM_MAP_ROUTE_TYPE_MOTOCAR = 0, /**< Route should consider an automobile will + * be used. */ + ELM_MAP_ROUTE_TYPE_BICYCLE, /**< Route should consider a bicycle will be used + * by the user. */ + ELM_MAP_ROUTE_TYPE_FOOT, /**< Route should consider user will be walking. */ + ELM_MAP_ROUTE_TYPE_LAST /**< Sentinel value to indicate last enum field during + * iteration */ +} Elm_Map_Route_Type; + +/** + * @brief Set the routing method, what should be prioritized, time or distance. + * + * See @ref elm_map_route_add() + * + * @ingroup Elm_Map + */ +typedef enum +{ + ELM_MAP_ROUTE_METHOD_FASTEST = 0, /**< Route should prioritize time. */ + ELM_MAP_ROUTE_METHOD_SHORTEST, /**< Route should prioritize distance. */ + ELM_MAP_ROUTE_METHOD_LAST /**< Sentinel value to indicate last enum field + * during iteration */ +} Elm_Map_Route_Method; + + +#endif + +/** + * @brief Set the minimum zoom of the source. + * + * @param[in] obj The object. + * @param[in] zoom Minimum zoom value to be used. + * + * @ingroup Elm_Map_Group + */ +EAPI void elm_map_zoom_min_set(Elm_Map *obj, int zoom); + +/** + * @brief Get the minimum zoom of the source. + * + * @param[in] obj The object. + * + * @return Minimum zoom value to be used. + * + * @ingroup Elm_Map_Group + */ +EAPI int elm_map_zoom_min_get(const Elm_Map *obj); + +/** + * @brief Rotate the map. + * + * @param[in] obj The object. + * @param[in] degree Angle from 0.0 to 360.0 to rotate around Z axis. + * @param[in] cx Rotation's center horizontal position. + * @param[in] cy Rotation's center vertical position. + * + * @ingroup Elm_Map_Group + */ +EAPI void elm_map_rotate_set(Elm_Map *obj, double degree, int cx, int cy); + +/** + * @brief Get the rotate degree of the map. + * + * @param[in] obj The object. + * @param[out] degree Angle from 0.0 to 360.0 to rotate around Z axis. + * @param[out] cx Rotation's center horizontal position. + * @param[out] cy Rotation's center vertical position. + * + * @ingroup Elm_Map_Group + */ +EAPI void elm_map_rotate_get(const Elm_Map *obj, double *degree, int *cx, int *cy); + +/** + * @brief Set the user agent used by the map object to access routing services. + * + * User agent is a client application implementing a network protocol used in + * communications within a clientserver distributed computing system + * + * The @c user_agent identification string will transmitted in a header field + * @c User-Agent. + * + * @param[in] obj The object. + * @param[in] user_agent The user agent to be used by the map. + * + * @ingroup Elm_Map_Group + */ +EAPI void elm_map_user_agent_set(Elm_Map *obj, const char *user_agent); + +/** + * @brief Get the user agent used by the map object. + * + * @param[in] obj The object. + * + * @return The user agent to be used by the map. + * + * @ingroup Elm_Map_Group + */ +EAPI const char *elm_map_user_agent_get(const Elm_Map *obj); + +/** + * @brief Set the maximum zoom of the source. + * + * @param[in] obj The object. + * @param[in] zoom Maximum zoom value to be used. + * + * @ingroup Elm_Map_Group + */ +EAPI void elm_map_zoom_max_set(Elm_Map *obj, int zoom); + +/** + * @brief Get the maximum zoom of the source. + * + * @param[in] obj The object. + * + * @return Maximum zoom value to be used. + * + * @ingroup Elm_Map_Group + */ +EAPI int elm_map_zoom_max_get(const Elm_Map *obj); + +/** + * @brief Get the current geographic coordinates of the map. + * + * This gets the current center coordinates of the map object. It can be set by + * @ref elm_map_region_bring_in and @ref elm_map_region_show. + * + * @param[in] obj The object. + * @param[out] lon Pointer to store longitude. + * @param[out] lat Pointer to store latitude. + * + * @ingroup Elm_Map_Group + */ +EAPI void elm_map_region_get(const Elm_Map *obj, double *lon, double *lat); + +/** + * @brief Return all overlays in the map object. + * + * This list includes group overlays also. So this can be changed dynamically + * while zooming and panning. + * + * @param[in] obj The object. + * + * @return The list of all overlays or @c null upon failure. + * + * @since 1.7 + * + * @ingroup Elm_Map_Group + */ +EAPI Eina_List *elm_map_overlays_get(const Elm_Map *obj); + +/** + * @brief Get the information of tile load status. + * + * This gets the current tile loaded status for the map object. + * + * @param[in] obj The object. + * @param[out] try_num Pointer to store number of tiles download requested. + * @param[out] finish_num Pointer to store number of tiles successfully + * downloaded. + * + * @ingroup Elm_Map_Group + */ +EAPI void elm_map_tile_load_status_get(const Elm_Map *obj, int *try_num, int *finish_num); + +/** + * @brief Set the current source of the map for a specific type. + * + * Map widget retrieves tile images that composes the map from a web service. + * This web service can be set with this method for #ELM_MAP_SOURCE_TYPE_TILE + * type. A different service can return a different maps with different + * information and it can use different zoom values. + * + * Map widget provides route data based on a external web service. This web + * service can be set with this method for #ELM_MAP_SOURCE_TYPE_ROUTE type. + * + * Map widget also provide geoname data based on a external web service. This + * web service can be set with this method for #ELM_MAP_SOURCE_TYPE_NAME type. + * + * The @c source_name need to match one of the names provided by + * @ref elm_map_sources_get. + * + * The current source can be get using @ref elm_map_source_get. + * + * @param[in] obj The object. + * @param[in] type Source type. + * @param[in] source_name The source to be used. + * + * @ingroup Elm_Map_Group + */ +EAPI void elm_map_source_set(Elm_Map *obj, Elm_Map_Source_Type type, const char *source_name); + +/** + * @brief Get the name of currently used source for a specific type. + * + * @param[in] obj The object. + * @param[in] type Source type. + * + * @return The name of the source in use. + * + * @ingroup Elm_Map_Group + */ +EAPI const char *elm_map_source_get(const Elm_Map *obj, Elm_Map_Source_Type type); + +/** + * @brief Add a new route to the map object. + * + * A route will be traced by point on coordinates ($flat, @c flon) to point on + * coordinates ($tlat, @c tlon), using the route service set with + * @ref elm_map_source_set. + * + * It will take @c type on consideration to define the route, depending if the + * user will be walking or driving, the route may vary. One of + * #ELM_MAP_ROUTE_TYPE_MOTOCAR, #ELM_MAP_ROUTE_TYPE_BICYCLE, or + * #ELM_MAP_ROUTE_TYPE_FOOT need to be used. + * + * Another parameter is what the route should prioritize, the minor distance or + * the less time to be spend on the route. So @c method should be one of + * #ELM_MAP_ROUTE_METHOD_SHORTEST or #ELM_MAP_ROUTE_METHOD_FASTEST. + * + * Routes created with this method can be deleted with @ref elm_map_route_del + * and distance can be get with @ref elm_map_route_distance_get. + * + * @param[in] obj The object. + * @param[in] type The type of transport to be considered when tracing a route. + * @param[in] method The routing method, what should be prioritized. + * @param[in] flon The start longitude. + * @param[in] flat The start latitude. + * @param[in] tlon The destination longitude. + * @param[in] tlat The destination latitude. + * @param[in] route_cb The route to be traced. + * @param[in] data A pointer of user data. + * + * @return The created route or @c null upon failure. + * + * @ingroup Elm_Map_Group + */ +EAPI Elm_Map_Route *elm_map_route_add(Elm_Map *obj, Elm_Map_Route_Type type, Elm_Map_Route_Method method, double flon, double flat, double tlon, double tlat, Elm_Map_Route_Cb route_cb, void *data); + +/** + * @brief Add a track on the map. + * + * @param[in] obj The object. + * @param[in] emap The emap route object. + * + * @return The route object. This is an elm object of type Route. + * + * @ingroup Elm_Map_Group + */ +EAPI Efl_Canvas_Object *elm_map_track_add(Elm_Map *obj, void *emap); + +/** + * @brief Convert geographic coordinates (longitude, latitude) into canvas + * coordinates. + * + * This gets canvas x, y coordinates from longitude and latitude. The canvas + * coordinates mean x, y coordinate from current viewport. + * + * @param[in] obj The object. + * @param[in] lon The longitude to convert. + * @param[in] lat The latitude to convert. + * @param[out] x A pointer to horizontal coordinate. + * @param[out] y A pointer to vertical coordinate. + * + * @ingroup Elm_Map_Group + */ +EAPI void elm_map_region_to_canvas_convert(const Elm_Map *obj, double lon, double lat, int *x, int *y); + +/** + * @brief Add a new circle overlay to the map object. This overlay has a circle + * type. + * + * Overlay created with this method can be deleted with @ref + * elm_map_overlay_del. + * + * @param[in] obj The object. + * @param[in] lon The center longitude. + * @param[in] lat The center latitude. + * @param[in] radius The pixel length of radius. + * + * @return The created overlay or @c null upon failure. + * + * @ingroup Elm_Map_Group + */ +EAPI Elm_Map_Overlay *elm_map_overlay_circle_add(Elm_Map *obj, double lon, double lat, double radius); + +/** + * @brief Add a new class overlay to the map object. This overlay has a class + * type. + * + * This overlay is not shown before overlay members are appended. if overlay + * members in the same class are close, group overlays are created. If they are + * far away, group overlays are hidden. When group overlays are shown, they + * have default style layouts at first. + * + * You can change the state (hidden, paused, etc.) or set the content or icon + * of the group overlays by chaning the state of the class overlay. Do not + * modify the group overlay itself. + * + * Also these changes have a influence on the overlays in the same class even + * if each overlay is alone and is not grouped. + * + * @param[in] obj The object. + * + * @return The created overlay or @c null upon failure. + * + * @ingroup Elm_Map_Group + */ +EAPI Elm_Map_Overlay *elm_map_overlay_class_add(Elm_Map *obj); + +/** + * @brief Add a new bubble overlay to the map object. This overlay has a bubble + * type. + * + * A bubble will not be displayed before geographic coordinates are set or any + * other overlays are followed. + * + * This overlay has a bubble style layout and icon or content can not be set. + * + * Overlay created with this method can be deleted with @ref + * elm_map_overlay_del. + * + * @param[in] obj The object. + * + * @return The created overlay or @c null upon failure. + * + * @ingroup Elm_Map_Group + */ +EAPI Elm_Map_Overlay *elm_map_overlay_bubble_add(Elm_Map *obj); + +/** + * @brief Get the names of available sources for a specific type. + * + * It will provide a list with all available sources. Current source can be set + * by @ref elm_map_source_set, or get with @ref elm_map_source_get. + * + * At least available sources of tile type are "Mapnik", "Osmarender", + * "CycleMap" and "Maplint". + * + * At least available sources of route type are "Yours". + * + * At least available sources of name type are "Nominatim". + * + * @param[in] obj The object. + * @param[in] type Source type. + * + * @return The char pointer array of source names. + * + * @ingroup Elm_Map_Group + */ +EAPI const char **elm_map_sources_get(const Elm_Map *obj, Elm_Map_Source_Type type); + +/** + * @brief Add a new polygon overlay to the map object. This overlay has a + * polygon type. + * + * At least 3 regions should be added to show the polygon overlay. + * + * Overlay created with this method can be deleted with @ref + * elm_map_overlay_del. + * + * @param[in] obj The object. + * + * @return The created overlay or @c null upon failure. + * + * @ingroup Elm_Map_Group + */ +EAPI Elm_Map_Overlay *elm_map_overlay_polygon_add(Elm_Map *obj); + +/** + * @brief Add a new line overlay to the map object. This overlay has a line + * type. + * + * Overlay created with this method can be deleted with @ref + * elm_map_overlay_del. + * + * @param[in] obj The object. + * @param[in] flon The start longitude. + * @param[in] flat The start latitude. + * @param[in] tlon The destination longitude. + * @param[in] tlat The destination latitude. + * + * @return The created overlay or @c null upon failure. + * + * @ingroup Elm_Map_Group + */ +EAPI Elm_Map_Overlay *elm_map_overlay_line_add(Elm_Map *obj, double flon, double flat, double tlon, double tlat); + +/** + * @brief Show the given coordinates at the center of the map, immediately. + * + * This causes map to redraw its viewport's contents to the region containing + * the given @c lat and @c lon, that will be moved to the center of the map. + * + * See @ref elm_map_region_bring_in for a function to move with animation. + * + * @param[in] obj The object. + * @param[in] lon Longitude to center at. + * @param[in] lat Latitude to center at. + * + * @ingroup Elm_Map_Group + */ +EAPI void elm_map_region_show(Elm_Map *obj, double lon, double lat); + +/** + * @brief Request a address or geographic coordinates(longitude, latitude) from + * a given address or geographic coordinate(longitude, latitude). + * + * If you want to get address from geographic coordinates, set input @c address + * as @c null and set @c lon, @c lat as you want to convert. If address is set + * except NULL, @c lon and @c lat are checked. + * + * To get the string for this address, @ref elm_map_name_address_get should be + * used after callback or "name,loaded" signal is called. + * + * To get the longitude and latitude, @ref elm_map_region_get should be used. + * + * @param[in] obj The object. + * @param[in] address The address. + * @param[in] lon The longitude. + * @param[in] lat The latitude. + * @param[in] name_cb The callback function. + * @param[in] data The user callback data. + * + * @return A #Elm_Map_Name handle for this coordinate. + * + * @ingroup Elm_Map_Group + */ +EAPI Elm_Map_Name *elm_map_name_add(const Elm_Map *obj, const char *address, double lon, double lat, Elm_Map_Name_Cb name_cb, void *data); + +/** + * @brief Requests a list of addresses corresponding to a given name. + * + * @internal + * + * @param[in] obj The object. + * @param[in] address The address. + * @param[in] name_cb The callback function. + * @param[in] data The user callback data. + * + * @since 1.8 + * + * @ingroup Elm_Map_Group + */ +EAPI void elm_map_name_search(const Elm_Map *obj, const char *address, Elm_Map_Name_List_Cb name_cb, void *data); + +/** + * @brief Animatedly bring in given coordinates to the center of the map. + * + * This causes map to jump to the given @c lat and @c lon coordinates and show + * it (by scrolling) in the center of the viewport, if it is not already + * centered. This will use animation to do so and take a period of time to + * complete. + * + * See @ref elm_map_region_show for a function to avoid animation. + * + * @param[in] obj The object. + * @param[in] lon Longitude to center at. + * @param[in] lat Latitude to center at. + * + * @ingroup Elm_Map_Group + */ +EAPI void elm_map_region_bring_in(Elm_Map *obj, double lon, double lat); + +/** + * @brief Animatedly set the zoom level of the map and bring in given + * coordinates to the center of the map. + * + * This causes map to zoom into specific zoom level and also move to the given + * @c lat and @c lon coordinates and show it (by scrolling) in the center of + * the viewport concurrently. + * + * See also @ref elm_map_region_bring_in. + * + * @param[in] obj The object. + * @param[in] zoom The zoom level to set. + * @param[in] lon Longitude to center at. + * @param[in] lat Latitude to center at. + * + * @since 1.11 + * + * @ingroup Elm_Map_Group + */ +EAPI void elm_map_region_zoom_bring_in(Elm_Map *obj, int zoom, double lon, double lat); + +/** + * @brief Remove a track from the map. + * + * @param[in] obj The object. + * @param[in] route The track to remove. + * + * @ingroup Elm_Map_Group + */ +EAPI void elm_map_track_remove(Elm_Map *obj, Efl_Canvas_Object *route); + +/** + * @brief Add a new route overlay to the map object. This overlay has a route + * type. + * + * This overlay has a route style layout and icon or content can not be set. + * + * The color scheme can be changed by @ref elm_map_overlay_content_set. + * + * Overlay created with this method can be deleted with @ref + * elm_map_overlay_del. + * + * @param[in] obj The object. + * @param[in] route The route object to make a overlay. + * + * @return The created overlay or @c null upon failure. + * + * @ingroup Elm_Map_Group + */ +EAPI Elm_Map_Overlay *elm_map_overlay_route_add(Elm_Map *obj, const Elm_Map_Route *route); + +/** + * @brief Add a new scale overlay to the map object. This overlay has a scale + * type. + * + * The scale overlay shows the ratio of a distance on the map to the + * corresponding distance. + * + * Overlay created with this method can be deleted with @ref + * elm_map_overlay_del. + * + * @param[in] obj The object. + * @param[in] x horizontal pixel coordinate. + * @param[in] y vertical pixel coordinate. + * + * @return The created overlay or @c null upon failure. + * + * @ingroup Elm_Map_Group + */ +EAPI Elm_Map_Overlay *elm_map_overlay_scale_add(Elm_Map *obj, int x, int y); + +/** + * @brief Add a new overlay to the map object. This overlay has a default type. + * + * A overlay will be created and shown in a specific point of the map, defined + * by @c lon and @c lat. + * + * The created overlay has a default style layout before content or icon is + * set. If content or icon is set, those are displayed instead of default style + * layout. + * + * You can set by using @ref elm_map_overlay_content_set or @ref + * elm_map_overlay_icon_set. If @c null is set, default style is shown again. + * + * Overlay created with this method can be deleted by @ref elm_map_overlay_del. + * + * @param[in] obj The object. + * @param[in] lon The longitude of the overlay. + * @param[in] lat The latitude of the overlay. + * + * @return The created overlay or @c null upon failure. + * + * @ingroup Elm_Map_Group + */ +EAPI Elm_Map_Overlay *elm_map_overlay_add(Elm_Map *obj, double lon, double lat); + +/** + * @brief Convert canvas coordinates into geographic coordinates (longitude, + * latitude). + * + * This gets longitude and latitude from canvas x, y coordinates. The canvas + * coordinates mean x, y coordinate from current viewport. + * + * @param[in] obj The object. + * @param[in] x Horizontal coordinate of the point to convert. + * @param[in] y Vertical coordinate of the point to convert. + * @param[out] lon A pointer to the longitude. + * @param[out] lat A pointer to the latitude. + * + * @ingroup Elm_Map_Group + */ +EAPI void elm_map_canvas_to_region_convert(const Elm_Map *obj, int x, int y, double *lon, double *lat); + +#endif diff --git a/src/lib/elementary/elm_map_legacy.h b/src/lib/elementary/elm_map_legacy.h index b919b508b0..37fffcb737 100644 --- a/src/lib/elementary/elm_map_legacy.h +++ b/src/lib/elementary/elm_map_legacy.h @@ -141,4 +141,35 @@ EAPI void elm_map_wheel_disabled_set(Evas_Object *obj, Eina_Bool disabled); */ EAPI Eina_Bool elm_map_wheel_disabled_get(const Evas_Object *obj); -#include "elm_map.eo.legacy.h" +/** + * @brief Pause or unpause the map. + * + * This sets the paused state to on @c true or off @c false for map. + * + * The default is off. + * + * This will stop zooming using animation, changing zoom levels will change + * instantly. This will stop any existing animations that are running. + * + * @param[in] obj The object. + * @param[in] paused Use @c true to pause the map @c obj or @c false to unpause + * it. + * + * @ingroup Elm_Map_Group + */ +EAPI void elm_map_paused_set(Evas_Object *obj, Eina_Bool paused); + +/** + * @brief Get a value whether map is paused or not. + * + * This gets the current paused state for the map object. + * + * @param[in] obj The object. + * + * @return Use @c true to pause the map @c obj or @c false to unpause it. + * + * @ingroup Elm_Map_Group + */ +EAPI Eina_Bool elm_map_paused_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 deleted file mode 100644 index 61684b6ecb..0000000000 --- a/src/lib/elementary/elm_map_pan.eo +++ /dev/null @@ -1,34 +0,0 @@ -class Elm.Map.Pan extends Elm.Pan -{ - [[Elementary map pan class]] - legacy_prefix: elm_map_pan; - eo_prefix: elm_obj_map_pan; - event_prefix: elm_map_pan; - implements { - class.constructor; - Efl.Object.destructor; - 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; } - Elm.Pan.pos_min { get; } - 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]] - tile,loaded,fail; [[Called when map tile loading failed]] - route,load; [[Called when route loiding started]] - route,loaded; [[Called when route loading finsihed]] - route,loaded,fail; [[Called when route loading failed]] - name,load; [[Called when name loading started]] - name,loaded; [[Called when name loading finished]] - 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_map_pan_eo.c b/src/lib/elementary/elm_map_pan_eo.c new file mode 100644 index 0000000000..6b249ccaf8 --- /dev/null +++ b/src/lib/elementary/elm_map_pan_eo.c @@ -0,0 +1,67 @@ + +void _elm_map_pan_efl_object_destructor(Eo *obj, Elm_Map_Pan_Data *pd); + + +void _elm_map_pan_efl_gfx_entity_position_set(Eo *obj, Elm_Map_Pan_Data *pd, Eina_Position2D pos); + + +void _elm_map_pan_efl_gfx_entity_size_set(Eo *obj, Elm_Map_Pan_Data *pd, Eina_Size2D size); + + +void _elm_map_pan_efl_canvas_group_group_calculate(Eo *obj, Elm_Map_Pan_Data *pd); + + +void _elm_map_pan_elm_pan_content_size_get(const Eo *obj, Elm_Map_Pan_Data *pd, int *w, int *h); + + +void _elm_map_pan_elm_pan_pos_set(Eo *obj, Elm_Map_Pan_Data *pd, int x, int y); + + +void _elm_map_pan_elm_pan_pos_get(const Eo *obj, Elm_Map_Pan_Data *pd, int *x, int *y); + + +void _elm_map_pan_elm_pan_pos_min_get(const Eo *obj, Elm_Map_Pan_Data *pd, int *x, int *y); + + +void _elm_map_pan_elm_pan_pos_max_get(const Eo *obj, Elm_Map_Pan_Data *pd, int *x, int *y); + + +static Eina_Bool +_elm_map_pan_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_MAP_PAN_EXTRA_OPS +#define ELM_MAP_PAN_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_map_pan_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_map_pan_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_map_pan_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _elm_map_pan_efl_canvas_group_group_calculate), + EFL_OBJECT_OP_FUNC(elm_obj_pan_content_size_get, _elm_map_pan_elm_pan_content_size_get), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_set, _elm_map_pan_elm_pan_pos_set), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_get, _elm_map_pan_elm_pan_pos_get), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_min_get, _elm_map_pan_elm_pan_pos_min_get), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_max_get, _elm_map_pan_elm_pan_pos_max_get), + ELM_MAP_PAN_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_map_pan_class_desc = { + EO_VERSION, + "Elm.Map.Pan", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Map_Pan_Data), + _elm_map_pan_class_initializer, + _elm_map_pan_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_map_pan_class_get, &_elm_map_pan_class_desc, ELM_PAN_CLASS, NULL); diff --git a/src/lib/elementary/elm_map_pan_eo.h b/src/lib/elementary/elm_map_pan_eo.h new file mode 100644 index 0000000000..be8be64595 --- /dev/null +++ b/src/lib/elementary/elm_map_pan_eo.h @@ -0,0 +1,24 @@ +#ifndef _ELM_MAP_PAN_EO_H_ +#define _ELM_MAP_PAN_EO_H_ + +#ifndef _ELM_MAP_PAN_EO_CLASS_TYPE +#define _ELM_MAP_PAN_EO_CLASS_TYPE + +typedef Eo Elm_Map_Pan; + +#endif + +#ifndef _ELM_MAP_PAN_EO_TYPES +#define _ELM_MAP_PAN_EO_TYPES + + +#endif +/** Elementary map pan class + * + * @ingroup Elm_Map_Pan + */ +#define ELM_MAP_PAN_CLASS elm_map_pan_class_get() + +EWAPI const Efl_Class *elm_map_pan_class_get(void); + +#endif diff --git a/src/lib/elementary/elm_map_pan_eo.legacy.h b/src/lib/elementary/elm_map_pan_eo.legacy.h new file mode 100644 index 0000000000..d78a3571e9 --- /dev/null +++ b/src/lib/elementary/elm_map_pan_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_MAP_PAN_EO_LEGACY_H_ +#define _ELM_MAP_PAN_EO_LEGACY_H_ + +#ifndef _ELM_MAP_PAN_EO_CLASS_TYPE +#define _ELM_MAP_PAN_EO_CLASS_TYPE + +typedef Eo Elm_Map_Pan; + +#endif + +#ifndef _ELM_MAP_PAN_EO_TYPES +#define _ELM_MAP_PAN_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_mapbuf.c b/src/lib/elementary/elm_mapbuf.c index a427ec86d3..5706743243 100644 --- a/src/lib/elementary/elm_mapbuf.c +++ b/src/lib/elementary/elm_mapbuf.c @@ -10,7 +10,7 @@ #include "elm_priv.h" #include "elm_widget_mapbuf.h" #include "elm_widget_container.h" -#include "elm_mapbuf.eo.h" +#include "elm_mapbuf_eo.h" #include "elm_mapbuf_part.eo.h" #include "elm_part_helper.h" @@ -36,12 +36,12 @@ _sizing_eval(Evas_Object *obj) evas_object_size_hint_max_set(obj, maxw, maxh); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_mapbuf_efl_ui_widget_theme_apply(Eo *obj, Elm_Mapbuf_Data *sd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _sizing_eval(obj); @@ -220,7 +220,7 @@ _elm_mapbuf_content_set(Eo *obj, Elm_Mapbuf_Data *sd, const char *part, Evas_Obj } else evas_object_color_set(wd->resize_obj, 0, 0, 0, 0); - + efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, content); _sizing_eval(obj); _configure(obj); @@ -244,6 +244,7 @@ _elm_mapbuf_content_unset(Eo *obj, Elm_Mapbuf_Data *sd, const char *part) content = sd->content; _elm_widget_sub_object_redirect_to_top(obj, content); _elm_mapbuf_content_unset_internal(sd, obj, content); + efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, NULL); return content; } @@ -283,7 +284,6 @@ _elm_mapbuf_efl_canvas_group_group_add(Eo *obj, Elm_Mapbuf_Data *priv) elm_widget_resize_object_set(obj, rect); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); evas_object_static_clip_set(rect, EINA_TRUE); evas_object_pass_events_set(rect, EINA_TRUE); @@ -455,4 +455,4 @@ ELM_PART_CONTENT_DEFAULT_GET(elm_mapbuf, "default") ELM_PART_CONTENT_DEFAULT_OPS(elm_mapbuf), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_mapbuf) -#include "elm_mapbuf.eo.c" +#include "elm_mapbuf_eo.c" diff --git a/src/lib/elementary/elm_mapbuf.eo b/src/lib/elementary/elm_mapbuf.eo deleted file mode 100644 index 1f59bb8128..0000000000 --- a/src/lib/elementary/elm_mapbuf.eo +++ /dev/null @@ -1,128 +0,0 @@ -class Elm.Mapbuf extends Efl.Ui.Widget implements Efl.Content, Efl.Ui.Legacy -{ - [[Elementary mapbuf class]] - legacy_prefix: elm_mapbuf; - eo_prefix: elm_private_mapbuf; - methods { - @property auto { - set { - [[Set or unset auto flag for map rendering. - - When a ampbuf object has "auto mode" enabled, then it will - enable and disable map mode based on current visibility. - Mapbuf will track if you show or hide it AND if the object - is inside the canvas viewport or not when it is moved or - resized. Note that if you turn automode off, then map mode - will be in a disabled state at this point. When you turn it - on for the first time, the current state will be evaluated - base on current properties of the mapbuf object. - - Auto mode is disabled by default. - ]] - } - get { - [[Get a value whether auto mode is enabled or not.]] - } - values { - on: bool; [[The auto mode state.]] - } - } - @property smooth { - set { - [[Enable or disable smooth map rendering. - - This sets smoothing for map rendering. If the object is a - type that has its own smoothing settings, then both the - smooth settings for this object and the map must be turned off. - - By default smooth maps are enabled. - ]] - } - get { - [[Get a value whether smooth map rendering is enabled or not.]] - } - values { - smooth: bool; [[The smooth mode state.]] - } - } - @property alpha { - set { - [[Set or unset alpha flag for map rendering. - - This sets alpha flag for map rendering. If the object is a - type that has its own alpha settings, then this will take - precedence. Only image objects have this currently. It stops - alpha blending of the map area, and is useful if you know the - object and/or all sub-objects is 100% solid. - - Alpha is enabled by default. - ]] - } - get { - [[Get a value whether alpha blending is enabled or not.]] - } - values { - alpha: bool; [[The alpha state.]] - } - } - @property enabled { - set { - [[Enable or disable the map. - - This enables the map that is set or disables it. On enable, - the object geometry will be saved, and the new geometry will - change (position and size) to reflect the map geometry set. - - Also, when enabled, alpha and smooth states will be used, so - if the content isn't solid, alpha should be enabled, for - example, otherwise a black rectangle will fill the content. - - When disabled, the stored map will be freed and geometry prior - to enabling the map will be restored. - - It's disabled by default. - ]] - } - get { - [[Get a value whether map is enabled or not.]] - } - values { - enabled: bool; [[The enabled state.]] - } - } - @property point_color { - [[The color of a point (vertex) in the mapbuf. - - This represents the color of the vertex in the mapbuf. Colors will - be linearly interpolated between vertex points through the mapbuf. - Color will multiply the "texture" pixels (like GL_MODULATE in - OpenGL). The default color of a vertex in a mapbuf is white - solid (255, 255, 255, 255) which means it will have no effect on - modifying the texture pixels. - - @since 1.9 - ]] - keys { - idx: int; [[Index of point to change, from 0 to 3.]] - } - values { - r: int; [[Red (0 - 255)]] - g: int; [[Green (0 - 255)]] - b: int; [[Blue (0 - 255)]] - a: int; [[Alpha (0 - 255)]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - 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_get; - } -} diff --git a/src/lib/elementary/elm_mapbuf_eo.c b/src/lib/elementary/elm_mapbuf_eo.c new file mode 100644 index 0000000000..c84bc21fb3 --- /dev/null +++ b/src/lib/elementary/elm_mapbuf_eo.c @@ -0,0 +1,230 @@ + +void _elm_mapbuf_auto_set(Eo *obj, Elm_Mapbuf_Data *pd, Eina_Bool on); + + +static Eina_Error +__eolian_elm_mapbuf_auto_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_private_mapbuf_auto_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_private_mapbuf_auto_set, EFL_FUNC_CALL(on), Eina_Bool on); + +Eina_Bool _elm_mapbuf_auto_get(const Eo *obj, Elm_Mapbuf_Data *pd); + + +static Eina_Value +__eolian_elm_mapbuf_auto_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_private_mapbuf_auto_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_private_mapbuf_auto_get, Eina_Bool, 0); + +void _elm_mapbuf_smooth_set(Eo *obj, Elm_Mapbuf_Data *pd, Eina_Bool smooth); + + +static Eina_Error +__eolian_elm_mapbuf_smooth_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_private_mapbuf_smooth_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_private_mapbuf_smooth_set, EFL_FUNC_CALL(smooth), Eina_Bool smooth); + +Eina_Bool _elm_mapbuf_smooth_get(const Eo *obj, Elm_Mapbuf_Data *pd); + + +static Eina_Value +__eolian_elm_mapbuf_smooth_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_private_mapbuf_smooth_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_private_mapbuf_smooth_get, Eina_Bool, 0); + +void _elm_mapbuf_alpha_set(Eo *obj, Elm_Mapbuf_Data *pd, Eina_Bool alpha); + + +static Eina_Error +__eolian_elm_mapbuf_alpha_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_private_mapbuf_alpha_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_private_mapbuf_alpha_set, EFL_FUNC_CALL(alpha), Eina_Bool alpha); + +Eina_Bool _elm_mapbuf_alpha_get(const Eo *obj, Elm_Mapbuf_Data *pd); + + +static Eina_Value +__eolian_elm_mapbuf_alpha_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_private_mapbuf_alpha_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_private_mapbuf_alpha_get, Eina_Bool, 0); + +void _elm_mapbuf_enabled_set(Eo *obj, Elm_Mapbuf_Data *pd, Eina_Bool enabled); + + +static Eina_Error +__eolian_elm_mapbuf_enabled_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_private_mapbuf_enabled_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_private_mapbuf_enabled_set, EFL_FUNC_CALL(enabled), Eina_Bool enabled); + +Eina_Bool _elm_mapbuf_enabled_get(const Eo *obj, Elm_Mapbuf_Data *pd); + + +static Eina_Value +__eolian_elm_mapbuf_enabled_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_private_mapbuf_enabled_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_private_mapbuf_enabled_get, Eina_Bool, 0); + +void _elm_mapbuf_point_color_set(Eo *obj, Elm_Mapbuf_Data *pd, int idx, int r, int g, int b, int a); + +EOAPI EFL_VOID_FUNC_BODYV(elm_private_mapbuf_point_color_set, EFL_FUNC_CALL(idx, r, g, b, a), int idx, int r, int g, int b, int a); + +void _elm_mapbuf_point_color_get(const Eo *obj, Elm_Mapbuf_Data *pd, int idx, int *r, int *g, int *b, int *a); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_private_mapbuf_point_color_get, EFL_FUNC_CALL(idx, r, g, b, a), int idx, int *r, int *g, int *b, int *a); + +Efl_Object *_elm_mapbuf_efl_object_constructor(Eo *obj, Elm_Mapbuf_Data *pd); + + +void _elm_mapbuf_efl_gfx_entity_visible_set(Eo *obj, Elm_Mapbuf_Data *pd, Eina_Bool v); + + +void _elm_mapbuf_efl_gfx_entity_position_set(Eo *obj, Elm_Mapbuf_Data *pd, Eina_Position2D pos); + + +void _elm_mapbuf_efl_gfx_entity_size_set(Eo *obj, Elm_Mapbuf_Data *pd, Eina_Size2D size); + + +Eina_Error _elm_mapbuf_efl_ui_widget_theme_apply(Eo *obj, Elm_Mapbuf_Data *pd); + + +Eina_Bool _elm_mapbuf_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Mapbuf_Data *pd, Efl_Canvas_Object *sub_obj); + + +Eina_Bool _elm_mapbuf_efl_content_content_set(Eo *obj, Elm_Mapbuf_Data *pd, Efl_Gfx_Entity *content); + + +Efl_Gfx_Entity *_elm_mapbuf_efl_content_content_get(const Eo *obj, Elm_Mapbuf_Data *pd); + + +Efl_Gfx_Entity *_elm_mapbuf_efl_content_content_unset(Eo *obj, Elm_Mapbuf_Data *pd); + + +Efl_Object *_elm_mapbuf_efl_part_part_get(const Eo *obj, Elm_Mapbuf_Data *pd, const char *name); + + +static Eina_Bool +_elm_mapbuf_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_MAPBUF_EXTRA_OPS +#define ELM_MAPBUF_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_private_mapbuf_auto_set, _elm_mapbuf_auto_set), + EFL_OBJECT_OP_FUNC(elm_private_mapbuf_auto_get, _elm_mapbuf_auto_get), + EFL_OBJECT_OP_FUNC(elm_private_mapbuf_smooth_set, _elm_mapbuf_smooth_set), + EFL_OBJECT_OP_FUNC(elm_private_mapbuf_smooth_get, _elm_mapbuf_smooth_get), + EFL_OBJECT_OP_FUNC(elm_private_mapbuf_alpha_set, _elm_mapbuf_alpha_set), + EFL_OBJECT_OP_FUNC(elm_private_mapbuf_alpha_get, _elm_mapbuf_alpha_get), + EFL_OBJECT_OP_FUNC(elm_private_mapbuf_enabled_set, _elm_mapbuf_enabled_set), + EFL_OBJECT_OP_FUNC(elm_private_mapbuf_enabled_get, _elm_mapbuf_enabled_get), + EFL_OBJECT_OP_FUNC(elm_private_mapbuf_point_color_set, _elm_mapbuf_point_color_set), + EFL_OBJECT_OP_FUNC(elm_private_mapbuf_point_color_get, _elm_mapbuf_point_color_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_mapbuf_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_mapbuf_efl_gfx_entity_visible_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_mapbuf_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_mapbuf_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_mapbuf_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _elm_mapbuf_efl_ui_widget_widget_sub_object_del), + EFL_OBJECT_OP_FUNC(efl_content_set, _elm_mapbuf_efl_content_content_set), + EFL_OBJECT_OP_FUNC(efl_content_get, _elm_mapbuf_efl_content_content_get), + EFL_OBJECT_OP_FUNC(efl_content_unset, _elm_mapbuf_efl_content_content_unset), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_mapbuf_efl_part_part_get), + ELM_MAPBUF_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"auto", __eolian_elm_mapbuf_auto_set_reflect, __eolian_elm_mapbuf_auto_get_reflect}, + {"smooth", __eolian_elm_mapbuf_smooth_set_reflect, __eolian_elm_mapbuf_smooth_get_reflect}, + {"alpha", __eolian_elm_mapbuf_alpha_set_reflect, __eolian_elm_mapbuf_alpha_get_reflect}, + {"enabled", __eolian_elm_mapbuf_enabled_set_reflect, __eolian_elm_mapbuf_enabled_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_mapbuf_class_desc = { + EO_VERSION, + "Elm.Mapbuf", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Mapbuf_Data), + _elm_mapbuf_class_initializer, + _elm_mapbuf_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_mapbuf_class_get, &_elm_mapbuf_class_desc, EFL_UI_WIDGET_CLASS, EFL_CONTENT_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_mapbuf_eo.legacy.c" diff --git a/src/lib/elementary/elm_mapbuf_eo.h b/src/lib/elementary/elm_mapbuf_eo.h new file mode 100644 index 0000000000..b9ba3f2630 --- /dev/null +++ b/src/lib/elementary/elm_mapbuf_eo.h @@ -0,0 +1,188 @@ +#ifndef _ELM_MAPBUF_EO_H_ +#define _ELM_MAPBUF_EO_H_ + +#ifndef _ELM_MAPBUF_EO_CLASS_TYPE +#define _ELM_MAPBUF_EO_CLASS_TYPE + +typedef Eo Elm_Mapbuf; + +#endif + +#ifndef _ELM_MAPBUF_EO_TYPES +#define _ELM_MAPBUF_EO_TYPES + + +#endif +/** Elementary mapbuf class + * + * @ingroup Elm_Mapbuf + */ +#define ELM_MAPBUF_CLASS elm_mapbuf_class_get() + +EWAPI const Efl_Class *elm_mapbuf_class_get(void); + +/** + * @brief Set or unset auto flag for map rendering. + * + * When a ampbuf object has "auto mode" enabled, then it will enable and + * disable map mode based on current visibility. Mapbuf will track if you show + * or hide it AND if the object is inside the canvas viewport or not when it is + * moved or resized. Note that if you turn automode off, then map mode will be + * in a disabled state at this point. When you turn it on for the first time, + * the current state will be evaluated base on current properties of the mapbuf + * object. + * + * Auto mode is disabled by default. + * + * @param[in] obj The object. + * @param[in] on The auto mode state. + * + * @ingroup Elm_Mapbuf + */ +EOAPI void elm_private_mapbuf_auto_set(Eo *obj, Eina_Bool on); + +/** + * @brief Get a value whether auto mode is enabled or not. + * + * @param[in] obj The object. + * + * @return The auto mode state. + * + * @ingroup Elm_Mapbuf + */ +EOAPI Eina_Bool elm_private_mapbuf_auto_get(const Eo *obj); + +/** + * @brief Enable or disable smooth map rendering. + * + * This sets smoothing for map rendering. If the object is a type that has its + * own smoothing settings, then both the smooth settings for this object and + * the map must be turned off. + * + * By default smooth maps are enabled. + * + * @param[in] obj The object. + * @param[in] smooth The smooth mode state. + * + * @ingroup Elm_Mapbuf + */ +EOAPI void elm_private_mapbuf_smooth_set(Eo *obj, Eina_Bool smooth); + +/** + * @brief Get a value whether smooth map rendering is enabled or not. + * + * @param[in] obj The object. + * + * @return The smooth mode state. + * + * @ingroup Elm_Mapbuf + */ +EOAPI Eina_Bool elm_private_mapbuf_smooth_get(const Eo *obj); + +/** + * @brief Set or unset alpha flag for map rendering. + * + * This sets alpha flag for map rendering. If the object is a type that has its + * own alpha settings, then this will take precedence. Only image objects have + * this currently. It stops alpha blending of the map area, and is useful if + * you know the object and/or all sub-objects is 100% solid. + * + * Alpha is enabled by default. + * + * @param[in] obj The object. + * @param[in] alpha The alpha state. + * + * @ingroup Elm_Mapbuf + */ +EOAPI void elm_private_mapbuf_alpha_set(Eo *obj, Eina_Bool alpha); + +/** + * @brief Get a value whether alpha blending is enabled or not. + * + * @param[in] obj The object. + * + * @return The alpha state. + * + * @ingroup Elm_Mapbuf + */ +EOAPI Eina_Bool elm_private_mapbuf_alpha_get(const Eo *obj); + +/** + * @brief Enable or disable the map. + * + * This enables the map that is set or disables it. On enable, the object + * geometry will be saved, and the new geometry will change (position and size) + * to reflect the map geometry set. + * + * Also, when enabled, alpha and smooth states will be used, so if the content + * isn't solid, alpha should be enabled, for example, otherwise a black + * rectangle will fill the content. + * + * When disabled, the stored map will be freed and geometry prior to enabling + * the map will be restored. + * + * It's disabled by default. + * + * @param[in] obj The object. + * @param[in] enabled The enabled state. + * + * @ingroup Elm_Mapbuf + */ +EOAPI void elm_private_mapbuf_enabled_set(Eo *obj, Eina_Bool enabled); + +/** + * @brief Get a value whether map is enabled or not. + * + * @param[in] obj The object. + * + * @return The enabled state. + * + * @ingroup Elm_Mapbuf + */ +EOAPI Eina_Bool elm_private_mapbuf_enabled_get(const Eo *obj); + +/** + * @brief The color of a point (vertex) in the mapbuf. + * + * This represents the color of the vertex in the mapbuf. Colors will be + * linearly interpolated between vertex points through the mapbuf. Color will + * multiply the "texture" pixels (like GL_MODULATE in OpenGL). The default + * color of a vertex in a mapbuf is white solid (255, 255, 255, 255) which + * means it will have no effect on modifying the texture pixels. + * + * @param[in] obj The object. + * @param[in] idx Index of point to change, from 0 to 3. + * @param[in] r Red (0 - 255) + * @param[in] g Green (0 - 255) + * @param[in] b Blue (0 - 255) + * @param[in] a Alpha (0 - 255) + * + * @since 1.9 + * + * @ingroup Elm_Mapbuf + */ +EOAPI void elm_private_mapbuf_point_color_set(Eo *obj, int idx, int r, int g, int b, int a); + +/** + * @brief The color of a point (vertex) in the mapbuf. + * + * This represents the color of the vertex in the mapbuf. Colors will be + * linearly interpolated between vertex points through the mapbuf. Color will + * multiply the "texture" pixels (like GL_MODULATE in OpenGL). The default + * color of a vertex in a mapbuf is white solid (255, 255, 255, 255) which + * means it will have no effect on modifying the texture pixels. + * + * @param[in] obj The object. + * @param[in] idx Index of point to change, from 0 to 3. + * @param[out] r Red (0 - 255) + * @param[out] g Green (0 - 255) + * @param[out] b Blue (0 - 255) + * @param[out] a Alpha (0 - 255) + * + * @since 1.9 + * + * @ingroup Elm_Mapbuf + */ +EOAPI void elm_private_mapbuf_point_color_get(const Eo *obj, int idx, int *r, int *g, int *b, int *a); + +#endif diff --git a/src/lib/elementary/elm_mapbuf_eo.legacy.c b/src/lib/elementary/elm_mapbuf_eo.legacy.c new file mode 100644 index 0000000000..e285cbccdd --- /dev/null +++ b/src/lib/elementary/elm_mapbuf_eo.legacy.c @@ -0,0 +1,60 @@ + +EAPI void +elm_mapbuf_auto_set(Elm_Mapbuf *obj, Eina_Bool on) +{ + elm_private_mapbuf_auto_set(obj, on); +} + +EAPI Eina_Bool +elm_mapbuf_auto_get(const Elm_Mapbuf *obj) +{ + return elm_private_mapbuf_auto_get(obj); +} + +EAPI void +elm_mapbuf_smooth_set(Elm_Mapbuf *obj, Eina_Bool smooth) +{ + elm_private_mapbuf_smooth_set(obj, smooth); +} + +EAPI Eina_Bool +elm_mapbuf_smooth_get(const Elm_Mapbuf *obj) +{ + return elm_private_mapbuf_smooth_get(obj); +} + +EAPI void +elm_mapbuf_alpha_set(Elm_Mapbuf *obj, Eina_Bool alpha) +{ + elm_private_mapbuf_alpha_set(obj, alpha); +} + +EAPI Eina_Bool +elm_mapbuf_alpha_get(const Elm_Mapbuf *obj) +{ + return elm_private_mapbuf_alpha_get(obj); +} + +EAPI void +elm_mapbuf_enabled_set(Elm_Mapbuf *obj, Eina_Bool enabled) +{ + elm_private_mapbuf_enabled_set(obj, enabled); +} + +EAPI Eina_Bool +elm_mapbuf_enabled_get(const Elm_Mapbuf *obj) +{ + return elm_private_mapbuf_enabled_get(obj); +} + +EAPI void +elm_mapbuf_point_color_set(Elm_Mapbuf *obj, int idx, int r, int g, int b, int a) +{ + elm_private_mapbuf_point_color_set(obj, idx, r, g, b, a); +} + +EAPI void +elm_mapbuf_point_color_get(const Elm_Mapbuf *obj, int idx, int *r, int *g, int *b, int *a) +{ + elm_private_mapbuf_point_color_get(obj, idx, r, g, b, a); +} diff --git a/src/lib/elementary/elm_mapbuf_eo.legacy.h b/src/lib/elementary/elm_mapbuf_eo.legacy.h new file mode 100644 index 0000000000..c139e1dbbd --- /dev/null +++ b/src/lib/elementary/elm_mapbuf_eo.legacy.h @@ -0,0 +1,181 @@ +#ifndef _ELM_MAPBUF_EO_LEGACY_H_ +#define _ELM_MAPBUF_EO_LEGACY_H_ + +#ifndef _ELM_MAPBUF_EO_CLASS_TYPE +#define _ELM_MAPBUF_EO_CLASS_TYPE + +typedef Eo Elm_Mapbuf; + +#endif + +#ifndef _ELM_MAPBUF_EO_TYPES +#define _ELM_MAPBUF_EO_TYPES + + +#endif + +/** + * @brief Set or unset auto flag for map rendering. + * + * When a ampbuf object has "auto mode" enabled, then it will enable and + * disable map mode based on current visibility. Mapbuf will track if you show + * or hide it AND if the object is inside the canvas viewport or not when it is + * moved or resized. Note that if you turn automode off, then map mode will be + * in a disabled state at this point. When you turn it on for the first time, + * the current state will be evaluated base on current properties of the mapbuf + * object. + * + * Auto mode is disabled by default. + * + * @param[in] obj The object. + * @param[in] on The auto mode state. + * + * @ingroup Elm_Mapbuf_Group + */ +EAPI void elm_mapbuf_auto_set(Elm_Mapbuf *obj, Eina_Bool on); + +/** + * @brief Get a value whether auto mode is enabled or not. + * + * @param[in] obj The object. + * + * @return The auto mode state. + * + * @ingroup Elm_Mapbuf_Group + */ +EAPI Eina_Bool elm_mapbuf_auto_get(const Elm_Mapbuf *obj); + +/** + * @brief Enable or disable smooth map rendering. + * + * This sets smoothing for map rendering. If the object is a type that has its + * own smoothing settings, then both the smooth settings for this object and + * the map must be turned off. + * + * By default smooth maps are enabled. + * + * @param[in] obj The object. + * @param[in] smooth The smooth mode state. + * + * @ingroup Elm_Mapbuf_Group + */ +EAPI void elm_mapbuf_smooth_set(Elm_Mapbuf *obj, Eina_Bool smooth); + +/** + * @brief Get a value whether smooth map rendering is enabled or not. + * + * @param[in] obj The object. + * + * @return The smooth mode state. + * + * @ingroup Elm_Mapbuf_Group + */ +EAPI Eina_Bool elm_mapbuf_smooth_get(const Elm_Mapbuf *obj); + +/** + * @brief Set or unset alpha flag for map rendering. + * + * This sets alpha flag for map rendering. If the object is a type that has its + * own alpha settings, then this will take precedence. Only image objects have + * this currently. It stops alpha blending of the map area, and is useful if + * you know the object and/or all sub-objects is 100% solid. + * + * Alpha is enabled by default. + * + * @param[in] obj The object. + * @param[in] alpha The alpha state. + * + * @ingroup Elm_Mapbuf_Group + */ +EAPI void elm_mapbuf_alpha_set(Elm_Mapbuf *obj, Eina_Bool alpha); + +/** + * @brief Get a value whether alpha blending is enabled or not. + * + * @param[in] obj The object. + * + * @return The alpha state. + * + * @ingroup Elm_Mapbuf_Group + */ +EAPI Eina_Bool elm_mapbuf_alpha_get(const Elm_Mapbuf *obj); + +/** + * @brief Enable or disable the map. + * + * This enables the map that is set or disables it. On enable, the object + * geometry will be saved, and the new geometry will change (position and size) + * to reflect the map geometry set. + * + * Also, when enabled, alpha and smooth states will be used, so if the content + * isn't solid, alpha should be enabled, for example, otherwise a black + * rectangle will fill the content. + * + * When disabled, the stored map will be freed and geometry prior to enabling + * the map will be restored. + * + * It's disabled by default. + * + * @param[in] obj The object. + * @param[in] enabled The enabled state. + * + * @ingroup Elm_Mapbuf_Group + */ +EAPI void elm_mapbuf_enabled_set(Elm_Mapbuf *obj, Eina_Bool enabled); + +/** + * @brief Get a value whether map is enabled or not. + * + * @param[in] obj The object. + * + * @return The enabled state. + * + * @ingroup Elm_Mapbuf_Group + */ +EAPI Eina_Bool elm_mapbuf_enabled_get(const Elm_Mapbuf *obj); + +/** + * @brief The color of a point (vertex) in the mapbuf. + * + * This represents the color of the vertex in the mapbuf. Colors will be + * linearly interpolated between vertex points through the mapbuf. Color will + * multiply the "texture" pixels (like GL_MODULATE in OpenGL). The default + * color of a vertex in a mapbuf is white solid (255, 255, 255, 255) which + * means it will have no effect on modifying the texture pixels. + * + * @param[in] obj The object. + * @param[in] idx Index of point to change, from 0 to 3. + * @param[in] r Red (0 - 255) + * @param[in] g Green (0 - 255) + * @param[in] b Blue (0 - 255) + * @param[in] a Alpha (0 - 255) + * + * @since 1.9 + * + * @ingroup Elm_Mapbuf_Group + */ +EAPI void elm_mapbuf_point_color_set(Elm_Mapbuf *obj, int idx, int r, int g, int b, int a); + +/** + * @brief The color of a point (vertex) in the mapbuf. + * + * This represents the color of the vertex in the mapbuf. Colors will be + * linearly interpolated between vertex points through the mapbuf. Color will + * multiply the "texture" pixels (like GL_MODULATE in OpenGL). The default + * color of a vertex in a mapbuf is white solid (255, 255, 255, 255) which + * means it will have no effect on modifying the texture pixels. + * + * @param[in] obj The object. + * @param[in] idx Index of point to change, from 0 to 3. + * @param[out] r Red (0 - 255) + * @param[out] g Green (0 - 255) + * @param[out] b Blue (0 - 255) + * @param[out] a Alpha (0 - 255) + * + * @since 1.9 + * + * @ingroup Elm_Mapbuf_Group + */ +EAPI void elm_mapbuf_point_color_get(const Elm_Mapbuf *obj, int idx, int *r, int *g, int *b, int *a); + +#endif diff --git a/src/lib/elementary/elm_mapbuf_legacy.h b/src/lib/elementary/elm_mapbuf_legacy.h index bc56b1d9d4..5c659a8951 100644 --- a/src/lib/elementary/elm_mapbuf_legacy.h +++ b/src/lib/elementary/elm_mapbuf_legacy.h @@ -11,4 +11,4 @@ */ EAPI Evas_Object *elm_mapbuf_add(Evas_Object *parent); -#include "elm_mapbuf.eo.legacy.h" \ No newline at end of file +#include "elm_mapbuf_eo.legacy.h" \ No newline at end of file diff --git a/src/lib/elementary/elm_mapbuf_part.eo b/src/lib/elementary/elm_mapbuf_part.eo index a9bc129622..1a3e1e1393 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 extends Efl.Ui.Widget_Part implements Efl.Content +class @beta Elm.Mapbuf.Part extends Efl.Ui.Widget_Part implements 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 53cc85f2c9..236d859399 100644 --- a/src/lib/elementary/elm_menu.c +++ b/src/lib/elementary/elm_menu.c @@ -129,7 +129,7 @@ _submenu_sizing_eval(Elm_Menu_Item_Data *parent_it) ELM_MENU_ITEM_DATA_GET(eo_item, item); elm_layout_sizing_eval(VIEW(item)); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(eo_item, EFL_ACCESS_STATE_SHOWING, EINA_TRUE); + efl_access_state_changed_signal_emit(eo_item, EFL_ACCESS_STATE_TYPE_SHOWING, EINA_TRUE); } @@ -231,10 +231,10 @@ _sizing_eval(Evas_Object *obj) } } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_menu_efl_ui_widget_theme_apply(Eo *obj, Elm_Menu_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; Eina_List *l, *_l, *_ll, *ll = NULL; Elm_Object_Item *eo_item; @@ -242,7 +242,7 @@ _elm_menu_efl_ui_widget_theme_apply(Eo *obj, Elm_Menu_Data *sd) char style[1024]; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; if (sd->menu_bar) snprintf(style, sizeof(style), "main_menu/%s", elm_widget_style_get(obj)); @@ -498,7 +498,7 @@ _menu_item_activate_cb(void *data, if (eo_item2 != EO_OBJ(item)) elm_menu_item_selected_set(eo_item2, 0); } - efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, EO_OBJ(item->parent), EFL_ACCESS_SELECTION_EVENT_SELECTION_CHANGED, NULL); + efl_access_object_event_emit(EO_OBJ(item->parent), EFL_ACCESS_SELECTION_EVENT_ACCESS_SELECTION_CHANGED, NULL); } else { @@ -513,12 +513,12 @@ _menu_item_activate_cb(void *data, elm_menu_item_selected_set(eo_item2, 0); } } - efl_access_object_event_emit(EFL_ACCESS_OBJECT_MIXIN, WIDGET(item), EFL_ACCESS_SELECTION_EVENT_SELECTION_CHANGED, NULL); + efl_access_object_event_emit(WIDGET(item), EFL_ACCESS_SELECTION_EVENT_ACCESS_SELECTION_CHANGED, NULL); if (sd->menu_bar && was_open) _menu_item_select_cb(item, NULL, NULL, NULL); } if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(EO_OBJ(item), EFL_ACCESS_STATE_SELECTED, EINA_TRUE); + efl_access_state_changed_signal_emit(EO_OBJ(item), EFL_ACCESS_STATE_TYPE_SELECTED, EINA_TRUE); } static void @@ -532,7 +532,7 @@ _menu_item_inactivate_cb(void *data, item->selected = 0; if (item->submenu.open) _submenu_hide(item); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(EO_OBJ(item), EFL_ACCESS_STATE_SELECTED, EINA_FALSE); + efl_access_state_changed_signal_emit(EO_OBJ(item), EFL_ACCESS_STATE_TYPE_SELECTED, EINA_FALSE); } static void @@ -690,7 +690,6 @@ EOLIAN static void _elm_menu_efl_canvas_group_group_add(Eo *obj, Elm_Menu_Data *priv) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_FALSE); @@ -815,54 +814,8 @@ _elm_menu_efl_ui_widget_focus_manager_focus_manager_create(Eo *obj EINA_UNUSED, return manager; } -EOLIAN static Eo * -_elm_menu_efl_object_constructor(Eo *obj, Elm_Menu_Data *sd) -{ - Eo *parent = NULL; - - 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_object_role_set(obj, EFL_ACCESS_ROLE_MENU); - - elm_menu_parent_set(obj, parent); - elm_hover_target_set(sd->hv, sd->location); - elm_layout_content_set - (sd->hv, elm_hover_best_content_location_get - (sd->hv, ELM_HOVER_AXIS_VERTICAL), sd->bx); - - _sizing_eval(obj); - efl_event_callback_add - (obj, ELM_MENU_EVENT_ELM_ACTION_BLOCK_MENU, _block_menu, sd); - efl_event_callback_add - (obj, ELM_MENU_EVENT_ELM_ACTION_UNBLOCK_MENU, _unblock_menu, sd); - - sd->obj = obj; - return obj; -} - -EOLIAN static void -_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) - efl_del(eo_item); - - efl_destructor(efl_super(obj, MY_CLASS)); -} - -EAPI void -elm_menu_parent_set(Evas_Object *obj, - Evas_Object *parent) -{ - ELM_MENU_CHECK(obj); - efl_ui_widget_parent_set(obj, parent); -} - -EOLIAN static void -_elm_menu_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Menu_Data *sd, Evas_Object *parent) +static void +_parent_setup(Eo *obj, Elm_Menu_Data *sd, Evas_Object *parent) { Eina_List *l, *_l, *_ll, *ll = NULL; Elm_Object_Item *eo_item; @@ -904,6 +857,55 @@ _elm_menu_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Menu_Data *sd, Evas_Objec _sizing_eval(obj); } +EOLIAN static Eo * +_elm_menu_efl_object_constructor(Eo *obj, Elm_Menu_Data *sd) +{ + Eo *parent = NULL; + + obj = efl_constructor(efl_super(obj, MY_CLASS)); + _parent_setup(obj, sd, efl_parent_get(obj)); + 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_object_role_set(obj, EFL_ACCESS_ROLE_MENU); + + elm_menu_parent_set(obj, parent); + elm_hover_target_set(sd->hv, sd->location); + elm_layout_content_set + (sd->hv, elm_hover_best_content_location_get + (sd->hv, ELM_HOVER_AXIS_VERTICAL), sd->bx); + + _sizing_eval(obj); + efl_event_callback_add + (obj, ELM_MENU_EVENT_ELM_ACTION_BLOCK_MENU, _block_menu, sd); + efl_event_callback_add + (obj, ELM_MENU_EVENT_ELM_ACTION_UNBLOCK_MENU, _unblock_menu, sd); + + sd->obj = obj; + return obj; +} + +EOLIAN static void +_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) + efl_del(eo_item); + + efl_destructor(efl_super(obj, MY_CLASS)); +} + +EAPI void +elm_menu_parent_set(Evas_Object *obj, + Evas_Object *parent) +{ + ELM_MENU_CHECK(obj); + ELM_MENU_DATA_GET(obj, sd); + efl_ui_widget_sub_object_add(parent, obj); + _parent_setup(obj, sd, parent); +} + EAPI Evas_Object * elm_menu_parent_get(const Evas_Object *obj) { @@ -911,12 +913,6 @@ elm_menu_parent_get(const Evas_Object *obj) return efl_ui_widget_parent_get(obj); } -EOLIAN static Evas_Object* -_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_relative_move(Eo *obj, Elm_Menu_Data *sd, Evas_Coord x, Evas_Coord y) { @@ -1359,10 +1355,10 @@ _elm_menu_item_efl_access_object_state_set_get(const Eo *obj EINA_UNUSED, Elm_Me Efl_Access_State_Set ret; ret = efl_access_object_state_set_get(efl_super(obj, ELM_MENU_ITEM_CLASS)); - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_SELECTABLE); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_SELECTABLE); if (sd->selected) - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_SELECTED); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_SELECTED); return ret; } @@ -1461,5 +1457,5 @@ _elm_menu_efl_object_provider_find(const Eo *obj, Elm_Menu_Data *pd, const Efl_O #define ELM_MENU_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_menu) -#include "elm_menu_item.eo.c" -#include "elm_menu.eo.c" +#include "elm_menu_item_eo.c" +#include "elm_menu_eo.c" diff --git a/src/lib/elementary/elm_menu.eo b/src/lib/elementary/elm_menu.eo deleted file mode 100644 index ef0ccacc1f..0000000000 --- a/src/lib/elementary/elm_menu.eo +++ /dev/null @@ -1,106 +0,0 @@ -class Elm.Menu extends Efl.Ui.Widget implements 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 { - @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); [[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]] - } - } - item_add { - [[Add an item at the end of the given menu widget. - - Note: This function does not accept relative icon path. - ]] - return: Elm.Widget.Item; [[The new menu item.]] - params { - @in parent: Elm.Widget.Item @optional; [[The parent menu item (optional).]] - @in icon: string @optional; [[An icon display on the item. The icon will be destroyed by the menu.]] - @in label: string; [[The label of the item.]] - @in func: Evas_Smart_Cb @optional; [[Function called when the user select the item.]] - @in data: const(void_ptr) @optional; [[Data sent by the callback.]] - } - } - open { - [[Open a closed menu - - Show the menu with no child sub-menus expanded.. - ]] - } - close { - [[Close a opened menu - - Hides the menu and all it's sub-menus. - ]] - } - item_separator_add { - [[Add a separator item to menu $obj under $parent.]] - return: Elm.Widget.Item; [[The created item or $null.]] - params { - @in parent: Elm.Widget.Item; [[The item to add the separator under.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Object.destructor; - Efl.Gfx.Entity.visible { set; } - Efl.Ui.Widget.widget_parent { get; set; } - Efl.Ui.Widget.theme_apply; - Efl.Ui.L10n.translation_update; - 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.Object.provider_find; - } - events { - 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_eo.c b/src/lib/elementary/elm_menu_eo.c new file mode 100644 index 0000000000..1bc7f988da --- /dev/null +++ b/src/lib/elementary/elm_menu_eo.c @@ -0,0 +1,124 @@ +EWAPI const Efl_Event_Description _ELM_MENU_EVENT_DISMISSED = + EFL_EVENT_DESCRIPTION("dismissed"); +EWAPI const Efl_Event_Description _ELM_MENU_EVENT_ELM_ACTION_BLOCK_MENU = + EFL_EVENT_DESCRIPTION("elm,action,block_menu"); +EWAPI const Efl_Event_Description _ELM_MENU_EVENT_ELM_ACTION_UNBLOCK_MENU = + EFL_EVENT_DESCRIPTION("elm,action,unblock_menu"); + +Elm_Widget_Item *_elm_menu_selected_item_get(const Eo *obj, Elm_Menu_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_selected_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_menu_first_item_get(const Eo *obj, Elm_Menu_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_first_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_menu_last_item_get(const Eo *obj, Elm_Menu_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_last_item_get, Elm_Widget_Item *, NULL); + +const Eina_List *_elm_menu_items_get(const Eo *obj, Elm_Menu_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_items_get, const Eina_List *, NULL); + +void _elm_menu_relative_move(Eo *obj, Elm_Menu_Data *pd, int x, int y); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_menu_relative_move, EFL_FUNC_CALL(x, y), int x, int y); + +Elm_Widget_Item *_elm_menu_item_add(Eo *obj, Elm_Menu_Data *pd, Elm_Widget_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_menu_item_add, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(parent, icon, label, func, data), Elm_Widget_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +void _elm_menu_open(Eo *obj, Elm_Menu_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_menu_open); + +void _elm_menu_close(Eo *obj, Elm_Menu_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_menu_close); + +Elm_Widget_Item *_elm_menu_item_separator_add(Eo *obj, Elm_Menu_Data *pd, Elm_Widget_Item *parent); + +EOAPI EFL_FUNC_BODYV(elm_obj_menu_item_separator_add, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(parent), Elm_Widget_Item *parent); + +Efl_Object *_elm_menu_efl_object_constructor(Eo *obj, Elm_Menu_Data *pd); + + +void _elm_menu_efl_object_destructor(Eo *obj, Elm_Menu_Data *pd); + + +void _elm_menu_efl_gfx_entity_visible_set(Eo *obj, Elm_Menu_Data *pd, Eina_Bool v); + + +Eina_Error _elm_menu_efl_ui_widget_theme_apply(Eo *obj, Elm_Menu_Data *pd); + + +void _elm_menu_efl_ui_l10n_translation_update(Eo *obj, Elm_Menu_Data *pd); + + +Efl_Ui_Focus_Manager *_elm_menu_efl_ui_widget_focus_manager_focus_manager_create(Eo *obj, Elm_Menu_Data *pd, Efl_Ui_Focus_Object *root); + + +Eina_List *_elm_menu_efl_access_object_access_children_get(const Eo *obj, Elm_Menu_Data *pd); + + +int _elm_menu_efl_access_selection_selected_children_count_get(const Eo *obj, Elm_Menu_Data *pd); + + +Efl_Object *_elm_menu_efl_access_selection_selected_child_get(const Eo *obj, Elm_Menu_Data *pd, int selected_child_index); + + +Efl_Object *_elm_menu_efl_object_provider_find(const Eo *obj, Elm_Menu_Data *pd, const Efl_Class *klass); + + +static Eina_Bool +_elm_menu_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_MENU_EXTRA_OPS +#define ELM_MENU_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_menu_selected_item_get, _elm_menu_selected_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_first_item_get, _elm_menu_first_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_last_item_get, _elm_menu_last_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_items_get, _elm_menu_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_relative_move, _elm_menu_relative_move), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_add, _elm_menu_item_add), + EFL_OBJECT_OP_FUNC(elm_obj_menu_open, _elm_menu_open), + EFL_OBJECT_OP_FUNC(elm_obj_menu_close, _elm_menu_close), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_separator_add, _elm_menu_item_separator_add), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_menu_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_menu_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_menu_efl_gfx_entity_visible_set), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_menu_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_menu_efl_ui_l10n_translation_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_manager_create, _elm_menu_efl_ui_widget_focus_manager_focus_manager_create), + EFL_OBJECT_OP_FUNC(efl_access_object_access_children_get, _elm_menu_efl_access_object_access_children_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_children_count_get, _elm_menu_efl_access_selection_selected_children_count_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_child_get, _elm_menu_efl_access_selection_selected_child_get), + EFL_OBJECT_OP_FUNC(efl_provider_find, _elm_menu_efl_object_provider_find), + ELM_MENU_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_menu_class_desc = { + EO_VERSION, + "Elm.Menu", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Menu_Data), + _elm_menu_class_initializer, + _elm_menu_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_menu_class_get, &_elm_menu_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_CLICKABLE_INTERFACE, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_WIDGET_FOCUS_MANAGER_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_menu_eo.legacy.c" diff --git a/src/lib/elementary/elm_menu_eo.h b/src/lib/elementary/elm_menu_eo.h new file mode 100644 index 0000000000..1c4a8111eb --- /dev/null +++ b/src/lib/elementary/elm_menu_eo.h @@ -0,0 +1,158 @@ +#ifndef _ELM_MENU_EO_H_ +#define _ELM_MENU_EO_H_ + +#ifndef _ELM_MENU_EO_CLASS_TYPE +#define _ELM_MENU_EO_CLASS_TYPE + +typedef Eo Elm_Menu; + +#endif + +#ifndef _ELM_MENU_EO_TYPES +#define _ELM_MENU_EO_TYPES + + +#endif +/** Elementary menu class + * + * @ingroup Elm_Menu + */ +#define ELM_MENU_CLASS elm_menu_class_get() + +EWAPI const Efl_Class *elm_menu_class_get(void); + +/** + * @brief Get the selected item in the widget. + * + * @param[in] obj The object. + * + * @return The selected item or @c null. + * + * @ingroup Elm_Menu + */ +EOAPI Elm_Widget_Item *elm_obj_menu_selected_item_get(const Eo *obj); + +/** + * @brief Get the first item in the widget. + * + * @param[in] obj The object. + * + * @return The first item or @c null. + * + * @ingroup Elm_Menu + */ +EOAPI Elm_Widget_Item *elm_obj_menu_first_item_get(const Eo *obj); + +/** + * @brief Get the last item in the widget. + * + * @param[in] obj The object. + * + * @return The last item or @c null. + * + * @ingroup Elm_Menu + */ +EOAPI Elm_Widget_Item *elm_obj_menu_last_item_get(const Eo *obj); + +/** + * @brief Returns a list of the widget item. + * + * @param[in] obj The object. + * + * @return const list to widget items + * + * @ingroup Elm_Menu + */ +EOAPI const Eina_List *elm_obj_menu_items_get(const Eo *obj); + +/** + * @brief Move the menu to a new position + * + * Sets the top-left position of the menu to ($x, @c y). + * + * @note @c x and @c y coordinates are relative to parent. + * + * @param[in] obj The object. + * @param[in] x The new X coordinate + * @param[in] y The new Y coordinate + * + * @ingroup Elm_Menu + */ +EOAPI void elm_obj_menu_relative_move(Eo *obj, int x, int y); + +/** + * @brief Add an item at the end of the given menu widget. + * + * @note This function does not accept relative icon path. + * + * @param[in] obj The object. + * @param[in] parent The parent menu item (optional). + * @param[in] icon An icon display on the item. The icon will be destroyed by + * the menu. + * @param[in] label The label of the item. + * @param[in] func Function called when the user select the item. + * @param[in] data Data sent by the callback. + * + * @return The new menu item. + * + * @ingroup Elm_Menu + */ +EOAPI Elm_Widget_Item *elm_obj_menu_item_add(Eo *obj, Elm_Widget_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +/** + * @brief Open a closed menu + * + * Show the menu with no child sub-menus expanded.. + * @param[in] obj The object. + * + * @ingroup Elm_Menu + */ +EOAPI void elm_obj_menu_open(Eo *obj); + +/** + * @brief Close a opened menu + * + * Hides the menu and all it's sub-menus. + * @param[in] obj The object. + * + * @ingroup Elm_Menu + */ +EOAPI void elm_obj_menu_close(Eo *obj); + +/** + * @brief Add a separator item to menu @c obj under @c parent. + * + * @param[in] obj The object. + * @param[in] parent The item to add the separator under. + * + * @return The created item or @c null. + * + * @ingroup Elm_Menu + */ +EOAPI Elm_Widget_Item *elm_obj_menu_item_separator_add(Eo *obj, Elm_Widget_Item *parent); + +EWAPI extern const Efl_Event_Description _ELM_MENU_EVENT_DISMISSED; + +/** Called when menu widget was dismissed + * + * @ingroup Elm_Menu + */ +#define ELM_MENU_EVENT_DISMISSED (&(_ELM_MENU_EVENT_DISMISSED)) + +EWAPI extern const Efl_Event_Description _ELM_MENU_EVENT_ELM_ACTION_BLOCK_MENU; + +/** Called when menu blocking have been enabled + * + * @ingroup Elm_Menu + */ +#define ELM_MENU_EVENT_ELM_ACTION_BLOCK_MENU (&(_ELM_MENU_EVENT_ELM_ACTION_BLOCK_MENU)) + +EWAPI extern const Efl_Event_Description _ELM_MENU_EVENT_ELM_ACTION_UNBLOCK_MENU; + +/** Called when menu blocking has been disabled + * + * @ingroup Elm_Menu + */ +#define ELM_MENU_EVENT_ELM_ACTION_UNBLOCK_MENU (&(_ELM_MENU_EVENT_ELM_ACTION_UNBLOCK_MENU)) + +#endif diff --git a/src/lib/elementary/elm_menu_eo.legacy.c b/src/lib/elementary/elm_menu_eo.legacy.c new file mode 100644 index 0000000000..864be2de63 --- /dev/null +++ b/src/lib/elementary/elm_menu_eo.legacy.c @@ -0,0 +1,54 @@ + +EAPI Elm_Widget_Item * +elm_menu_selected_item_get(const Elm_Menu *obj) +{ + return elm_obj_menu_selected_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_menu_first_item_get(const Elm_Menu *obj) +{ + return elm_obj_menu_first_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_menu_last_item_get(const Elm_Menu *obj) +{ + return elm_obj_menu_last_item_get(obj); +} + +EAPI const Eina_List * +elm_menu_items_get(const Elm_Menu *obj) +{ + return elm_obj_menu_items_get(obj); +} + +EAPI void +elm_menu_move(Elm_Menu *obj, int x, int y) +{ + elm_obj_menu_relative_move(obj, x, y); +} + +EAPI Elm_Widget_Item * +elm_menu_item_add(Elm_Menu *obj, Elm_Widget_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_menu_item_add(obj, parent, icon, label, func, data); +} + +EAPI void +elm_menu_open(Elm_Menu *obj) +{ + elm_obj_menu_open(obj); +} + +EAPI void +elm_menu_close(Elm_Menu *obj) +{ + elm_obj_menu_close(obj); +} + +EAPI Elm_Widget_Item * +elm_menu_item_separator_add(Elm_Menu *obj, Elm_Widget_Item *parent) +{ + return elm_obj_menu_item_separator_add(obj, parent); +} diff --git a/src/lib/elementary/elm_menu_eo.legacy.h b/src/lib/elementary/elm_menu_eo.legacy.h new file mode 100644 index 0000000000..d54b4405c0 --- /dev/null +++ b/src/lib/elementary/elm_menu_eo.legacy.h @@ -0,0 +1,127 @@ +#ifndef _ELM_MENU_EO_LEGACY_H_ +#define _ELM_MENU_EO_LEGACY_H_ + +#ifndef _ELM_MENU_EO_CLASS_TYPE +#define _ELM_MENU_EO_CLASS_TYPE + +typedef Eo Elm_Menu; + +#endif + +#ifndef _ELM_MENU_EO_TYPES +#define _ELM_MENU_EO_TYPES + + +#endif + +/** + * @brief Get the selected item in the widget. + * + * @param[in] obj The object. + * + * @return The selected item or @c null. + * + * @ingroup Elm_Menu_Group + */ +EAPI Elm_Widget_Item *elm_menu_selected_item_get(const Elm_Menu *obj); + +/** + * @brief Get the first item in the widget. + * + * @param[in] obj The object. + * + * @return The first item or @c null. + * + * @ingroup Elm_Menu_Group + */ +EAPI Elm_Widget_Item *elm_menu_first_item_get(const Elm_Menu *obj); + +/** + * @brief Get the last item in the widget. + * + * @param[in] obj The object. + * + * @return The last item or @c null. + * + * @ingroup Elm_Menu_Group + */ +EAPI Elm_Widget_Item *elm_menu_last_item_get(const Elm_Menu *obj); + +/** + * @brief Returns a list of the widget item. + * + * @param[in] obj The object. + * + * @return const list to widget items + * + * @ingroup Elm_Menu_Group + */ +EAPI const Eina_List *elm_menu_items_get(const Elm_Menu *obj); + +/** + * @brief Move the menu to a new position + * + * Sets the top-left position of the menu to ($x, @c y). + * + * @note @c x and @c y coordinates are relative to parent. + * + * @param[in] obj The object. + * @param[in] x The new X coordinate + * @param[in] y The new Y coordinate + * + * @ingroup Elm_Menu_Group + */ +EAPI void elm_menu_move(Elm_Menu *obj, int x, int y); + +/** + * @brief Add an item at the end of the given menu widget. + * + * @note This function does not accept relative icon path. + * + * @param[in] obj The object. + * @param[in] parent The parent menu item (optional). + * @param[in] icon An icon display on the item. The icon will be destroyed by + * the menu. + * @param[in] label The label of the item. + * @param[in] func Function called when the user select the item. + * @param[in] data Data sent by the callback. + * + * @return The new menu item. + * + * @ingroup Elm_Menu_Group + */ +EAPI Elm_Widget_Item *elm_menu_item_add(Elm_Menu *obj, Elm_Widget_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +/** + * @brief Open a closed menu + * + * Show the menu with no child sub-menus expanded.. + * @param[in] obj The object. + * + * @ingroup Elm_Menu_Group + */ +EAPI void elm_menu_open(Elm_Menu *obj); + +/** + * @brief Close a opened menu + * + * Hides the menu and all it's sub-menus. + * @param[in] obj The object. + * + * @ingroup Elm_Menu_Group + */ +EAPI void elm_menu_close(Elm_Menu *obj); + +/** + * @brief Add a separator item to menu @c obj under @c parent. + * + * @param[in] obj The object. + * @param[in] parent The item to add the separator under. + * + * @return The created item or @c null. + * + * @ingroup Elm_Menu_Group + */ +EAPI Elm_Widget_Item *elm_menu_item_separator_add(Elm_Menu *obj, Elm_Widget_Item *parent); + +#endif diff --git a/src/lib/elementary/elm_menu_item.eo b/src/lib/elementary/elm_menu_item.eo deleted file mode 100644 index 8bc14ed649..0000000000 --- a/src/lib/elementary/elm_menu_item.eo +++ /dev/null @@ -1,121 +0,0 @@ -class Elm.Menu.Item extends Elm.Widget.Item implements 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 - - 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.]] - } - } - @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]] - } - subitems_clear { - [[Remove all sub-items (children) of the given item - - This removes all items that are children (and their descendants) - of the given item $it. - - @since 1.8 - ]] - } - subitems_get @const { - [[Returns a list of $item's subitems.]] - return: const(list); [[A list of $item's subitems]] - } - is_separator @const { - [[Returns whether $item is a separator.]] - return: bool; [[$true if the item is a separator.]] - } - object_get @const { - [[Get the real Evas(Edje) object created to implement the view of - a given menu item. - - Warning: Don't manipulate this object! - ]] - return: Efl.Canvas.Object; [[The base Edje object containing the - swallowed content associated with the item.]] - } - } - 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.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; } - } -} diff --git a/src/lib/elementary/elm_menu_item_eo.c b/src/lib/elementary/elm_menu_item_eo.c new file mode 100644 index 0000000000..aceea71676 --- /dev/null +++ b/src/lib/elementary/elm_menu_item_eo.c @@ -0,0 +1,205 @@ + +void _elm_menu_item_icon_name_set(Eo *obj, Elm_Menu_Item_Data *pd, const char *icon); + + +static Eina_Error +__eolian_elm_menu_item_icon_name_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_menu_item_icon_name_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_menu_item_icon_name_set, EFL_FUNC_CALL(icon), const char *icon); + +const char *_elm_menu_item_icon_name_get(const Eo *obj, Elm_Menu_Item_Data *pd); + + +static Eina_Value +__eolian_elm_menu_item_icon_name_get_reflect(const Eo *obj) +{ + const char *val = elm_obj_menu_item_icon_name_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_item_icon_name_get, const char *, NULL); + +Elm_Widget_Item *_elm_menu_item_prev_get(const Eo *obj, Elm_Menu_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_item_prev_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_menu_item_next_get(const Eo *obj, Elm_Menu_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_item_next_get, Elm_Widget_Item *, NULL); + +void _elm_menu_item_selected_set(Eo *obj, Elm_Menu_Item_Data *pd, Eina_Bool selected); + + +static Eina_Error +__eolian_elm_menu_item_selected_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_menu_item_selected_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_menu_item_selected_set, EFL_FUNC_CALL(selected), Eina_Bool selected); + +Eina_Bool _elm_menu_item_selected_get(const Eo *obj, Elm_Menu_Item_Data *pd); + + +static Eina_Value +__eolian_elm_menu_item_selected_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_menu_item_selected_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_item_selected_get, Eina_Bool, 0); + +unsigned int _elm_menu_item_index_get(const Eo *obj, Elm_Menu_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_item_index_get, unsigned int, 0); + +void _elm_menu_item_subitems_clear(Eo *obj, Elm_Menu_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_menu_item_subitems_clear); + +const Eina_List *_elm_menu_item_subitems_get(const Eo *obj, Elm_Menu_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_item_subitems_get, const Eina_List *, NULL); + +Eina_Bool _elm_menu_item_is_separator(const Eo *obj, Elm_Menu_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_item_is_separator, Eina_Bool, 0); + +Efl_Canvas_Object *_elm_menu_item_object_get(const Eo *obj, Elm_Menu_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_item_object_get, Efl_Canvas_Object *, NULL); + +Efl_Object *_elm_menu_item_efl_object_constructor(Eo *obj, Elm_Menu_Item_Data *pd); + + +void _elm_menu_item_efl_object_destructor(Eo *obj, Elm_Menu_Item_Data *pd); + + +Efl_Object *_elm_menu_item_efl_object_parent_get(const Eo *obj, Elm_Menu_Item_Data *pd); + + +void _elm_menu_item_elm_widget_item_disable(Eo *obj, Elm_Menu_Item_Data *pd); + + +void _elm_menu_item_elm_widget_item_signal_emit(Eo *obj, Elm_Menu_Item_Data *pd, const char *emission, const char *source); + + +void _elm_menu_item_elm_widget_item_part_text_set(Eo *obj, Elm_Menu_Item_Data *pd, const char *part, const char *label); + + +const char *_elm_menu_item_elm_widget_item_part_text_get(const Eo *obj, Elm_Menu_Item_Data *pd, const char *part); + + +void _elm_menu_item_elm_widget_item_part_content_set(Eo *obj, Elm_Menu_Item_Data *pd, const char *part, Efl_Canvas_Object *content); + + +Efl_Canvas_Object *_elm_menu_item_elm_widget_item_part_content_get(const Eo *obj, Elm_Menu_Item_Data *pd, const char *part); + + +Eina_List *_elm_menu_item_efl_access_object_access_children_get(const Eo *obj, Elm_Menu_Item_Data *pd); + + +Efl_Access_Role _elm_menu_item_efl_access_object_role_get(const Eo *obj, Elm_Menu_Item_Data *pd); + + +const char *_elm_menu_item_efl_access_object_i18n_name_get(const Eo *obj, Elm_Menu_Item_Data *pd); + + +Efl_Access_State_Set _elm_menu_item_efl_access_object_state_set_get(const Eo *obj, Elm_Menu_Item_Data *pd); + + +int _elm_menu_item_efl_access_selection_selected_children_count_get(const Eo *obj, Elm_Menu_Item_Data *pd); + + +Efl_Object *_elm_menu_item_efl_access_selection_selected_child_get(const Eo *obj, Elm_Menu_Item_Data *pd, int selected_child_index); + + +static Eina_Bool +_elm_menu_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_MENU_ITEM_EXTRA_OPS +#define ELM_MENU_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_icon_name_set, _elm_menu_item_icon_name_set), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_icon_name_get, _elm_menu_item_icon_name_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_prev_get, _elm_menu_item_prev_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_next_get, _elm_menu_item_next_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_selected_set, _elm_menu_item_selected_set), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_selected_get, _elm_menu_item_selected_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_index_get, _elm_menu_item_index_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_subitems_clear, _elm_menu_item_subitems_clear), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_subitems_get, _elm_menu_item_subitems_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_is_separator, _elm_menu_item_is_separator), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_object_get, _elm_menu_item_object_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_menu_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_menu_item_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_parent_get, _elm_menu_item_efl_object_parent_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_disable, _elm_menu_item_elm_widget_item_disable), + EFL_OBJECT_OP_FUNC(elm_wdg_item_signal_emit, _elm_menu_item_elm_widget_item_signal_emit), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_set, _elm_menu_item_elm_widget_item_part_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_get, _elm_menu_item_elm_widget_item_part_text_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_set, _elm_menu_item_elm_widget_item_part_content_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_get, _elm_menu_item_elm_widget_item_part_content_get), + EFL_OBJECT_OP_FUNC(efl_access_object_access_children_get, _elm_menu_item_efl_access_object_access_children_get), + EFL_OBJECT_OP_FUNC(efl_access_object_role_get, _elm_menu_item_efl_access_object_role_get), + EFL_OBJECT_OP_FUNC(efl_access_object_i18n_name_get, _elm_menu_item_efl_access_object_i18n_name_get), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_menu_item_efl_access_object_state_set_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_children_count_get, _elm_menu_item_efl_access_selection_selected_children_count_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_child_get, _elm_menu_item_efl_access_selection_selected_child_get), + ELM_MENU_ITEM_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"icon_name", __eolian_elm_menu_item_icon_name_set_reflect, __eolian_elm_menu_item_icon_name_get_reflect}, + {"selected", __eolian_elm_menu_item_selected_set_reflect, __eolian_elm_menu_item_selected_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_menu_item_class_desc = { + EO_VERSION, + "Elm.Menu.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Menu_Item_Data), + _elm_menu_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_menu_item_class_get, &_elm_menu_item_class_desc, ELM_WIDGET_ITEM_CLASS, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_menu_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_menu_item_eo.h b/src/lib/elementary/elm_menu_item_eo.h new file mode 100644 index 0000000000..708e77ed6d --- /dev/null +++ b/src/lib/elementary/elm_menu_item_eo.h @@ -0,0 +1,175 @@ +#ifndef _ELM_MENU_ITEM_EO_H_ +#define _ELM_MENU_ITEM_EO_H_ + +#ifndef _ELM_MENU_ITEM_EO_CLASS_TYPE +#define _ELM_MENU_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Menu_Item; + +#endif + +#ifndef _ELM_MENU_ITEM_EO_TYPES +#define _ELM_MENU_ITEM_EO_TYPES + + +#endif +/** Elementary menu item class + * + * @ingroup Elm_Menu_Item + */ +#define ELM_MENU_ITEM_CLASS elm_menu_item_class_get() + +EWAPI const Efl_Class *elm_menu_item_class_get(void); + +/** + * @brief 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 "". + * + * @param[in] obj The object. + * @param[in] icon The name of icon object. + * + * @ingroup Elm_Menu_Item + */ +EOAPI void elm_obj_menu_item_icon_name_set(Eo *obj, const char *icon); + +/** + * @brief 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 "". + * + * @param[in] obj The object. + * + * @return The name of icon object. + * + * @ingroup Elm_Menu_Item + */ +EOAPI const char *elm_obj_menu_item_icon_name_get(const Eo *obj); + +/** + * @brief Get the item before this one in the widget's list of items. + * + * See also @ref elm_obj_menu_item_next_get. + * + * @param[in] obj The object. + * + * @return The item before the object in its parent's list. If there is no + * previous item or in case of error, @c null is returned. + * + * @ingroup Elm_Menu_Item + */ +EOAPI Elm_Widget_Item *elm_obj_menu_item_prev_get(const Eo *obj); + +/** + * @brief Get the item after this one in the widget's list of items. + * + * See also @ref elm_obj_menu_item_prev_get. + * + * @param[in] obj The object. + * + * @return The item after the object in its parent's list. If there is no next + * item or in case of error, @c null is returned. + * + * @ingroup Elm_Menu_Item + */ +EOAPI Elm_Widget_Item *elm_obj_menu_item_next_get(const Eo *obj); + +/** + * @brief Indicates whether this item is currently selected. + * + * Set the selected state of @c 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 retrieved with + * @ref elm_obj_menu_selected_item_get. + * + * Selected items will be highlighted. + * + * @param[in] obj The object. + * @param[in] selected The selection state. + * + * @ingroup Elm_Menu_Item + */ +EOAPI void elm_obj_menu_item_selected_set(Eo *obj, Eina_Bool selected); + +/** + * @brief Indicates whether this item is currently selected. + * + * Get the selected state of this item. + * + * @param[in] obj The object. + * + * @return The selection state. + * + * @ingroup Elm_Menu_Item + */ +EOAPI Eina_Bool elm_obj_menu_item_selected_get(const Eo *obj); + +/** + * @brief Get the item index + * + * @param[in] obj The object. + * + * @return Item index + * + * @ingroup Elm_Menu_Item + */ +EOAPI unsigned int elm_obj_menu_item_index_get(const Eo *obj); + +/** + * @brief Remove all sub-items (children) of the given item + * + * This removes all items that are children (and their descendants) of the + * given item @c it. + * + * @param[in] obj The object. + * + * @since 1.8 + * + * @ingroup Elm_Menu_Item + */ +EOAPI void elm_obj_menu_item_subitems_clear(Eo *obj); + +/** + * @brief Returns a list of @c item's subitems. + * + * @param[in] obj The object. + * + * @return A list of @c item's subitems + * + * @ingroup Elm_Menu_Item + */ +EOAPI const Eina_List *elm_obj_menu_item_subitems_get(const Eo *obj); + +/** + * @brief Returns whether @c item is a separator. + * + * @param[in] obj The object. + * + * @return @c true if the item is a separator. + * + * @ingroup Elm_Menu_Item + */ +EOAPI Eina_Bool elm_obj_menu_item_is_separator(const Eo *obj); + +/** + * @brief Get the real Evas(Edje) object created to implement the view of a + * given menu item. + * + * @warning Don't manipulate this object! + * + * @param[in] obj The object. + * + * @return The base Edje object containing the swallowed content associated + * with the item. + * + * @ingroup Elm_Menu_Item + */ +EOAPI Efl_Canvas_Object *elm_obj_menu_item_object_get(const Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_menu_item_eo.legacy.c b/src/lib/elementary/elm_menu_item_eo.legacy.c new file mode 100644 index 0000000000..fa2c452613 --- /dev/null +++ b/src/lib/elementary/elm_menu_item_eo.legacy.c @@ -0,0 +1,66 @@ + +EAPI void +elm_menu_item_icon_name_set(Elm_Menu_Item *obj, const char *icon) +{ + elm_obj_menu_item_icon_name_set(obj, icon); +} + +EAPI const char * +elm_menu_item_icon_name_get(const Elm_Menu_Item *obj) +{ + return elm_obj_menu_item_icon_name_get(obj); +} + +EAPI Elm_Widget_Item * +elm_menu_item_prev_get(const Elm_Menu_Item *obj) +{ + return elm_obj_menu_item_prev_get(obj); +} + +EAPI Elm_Widget_Item * +elm_menu_item_next_get(const Elm_Menu_Item *obj) +{ + return elm_obj_menu_item_next_get(obj); +} + +EAPI void +elm_menu_item_selected_set(Elm_Menu_Item *obj, Eina_Bool selected) +{ + elm_obj_menu_item_selected_set(obj, selected); +} + +EAPI Eina_Bool +elm_menu_item_selected_get(const Elm_Menu_Item *obj) +{ + return elm_obj_menu_item_selected_get(obj); +} + +EAPI unsigned int +elm_menu_item_index_get(const Elm_Menu_Item *obj) +{ + return elm_obj_menu_item_index_get(obj); +} + +EAPI void +elm_menu_item_subitems_clear(Elm_Menu_Item *obj) +{ + elm_obj_menu_item_subitems_clear(obj); +} + +EAPI const Eina_List * +elm_menu_item_subitems_get(const Elm_Menu_Item *obj) +{ + return elm_obj_menu_item_subitems_get(obj); +} + +EAPI Eina_Bool +elm_menu_item_is_separator(const Elm_Menu_Item *obj) +{ + return elm_obj_menu_item_is_separator(obj); +} + +EAPI Efl_Canvas_Object * +elm_menu_item_object_get(const Elm_Menu_Item *obj) +{ + return elm_obj_menu_item_object_get(obj); +} diff --git a/src/lib/elementary/elm_menu_item_eo.legacy.h b/src/lib/elementary/elm_menu_item_eo.legacy.h new file mode 100644 index 0000000000..d03284c2bf --- /dev/null +++ b/src/lib/elementary/elm_menu_item_eo.legacy.h @@ -0,0 +1,168 @@ +#ifndef _ELM_MENU_ITEM_EO_LEGACY_H_ +#define _ELM_MENU_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_MENU_ITEM_EO_CLASS_TYPE +#define _ELM_MENU_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Menu_Item; + +#endif + +#ifndef _ELM_MENU_ITEM_EO_TYPES +#define _ELM_MENU_ITEM_EO_TYPES + + +#endif + +/** + * @brief 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 "". + * + * @param[in] obj The object. + * @param[in] icon The name of icon object. + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI void elm_menu_item_icon_name_set(Elm_Menu_Item *obj, const char *icon); + +/** + * @brief 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 "". + * + * @param[in] obj The object. + * + * @return The name of icon object. + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI const char *elm_menu_item_icon_name_get(const Elm_Menu_Item *obj); + +/** + * @brief Get the item before this one in the widget's list of items. + * + * See also @ref elm_menu_item_next_get. + * + * @param[in] obj The object. + * + * @return The item before the object in its parent's list. If there is no + * previous item or in case of error, @c null is returned. + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI Elm_Widget_Item *elm_menu_item_prev_get(const Elm_Menu_Item *obj); + +/** + * @brief Get the item after this one in the widget's list of items. + * + * See also @ref elm_menu_item_prev_get. + * + * @param[in] obj The object. + * + * @return The item after the object in its parent's list. If there is no next + * item or in case of error, @c null is returned. + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI Elm_Widget_Item *elm_menu_item_next_get(const Elm_Menu_Item *obj); + +/** + * @brief Indicates whether this item is currently selected. + * + * Set the selected state of @c 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 retrieved with + * @ref elm_menu_selected_item_get. + * + * Selected items will be highlighted. + * + * @param[in] obj The object. + * @param[in] selected The selection state. + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI void elm_menu_item_selected_set(Elm_Menu_Item *obj, Eina_Bool selected); + +/** + * @brief Indicates whether this item is currently selected. + * + * Get the selected state of this item. + * + * @param[in] obj The object. + * + * @return The selection state. + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI Eina_Bool elm_menu_item_selected_get(const Elm_Menu_Item *obj); + +/** + * @brief Get the item index + * + * @param[in] obj The object. + * + * @return Item index + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI unsigned int elm_menu_item_index_get(const Elm_Menu_Item *obj); + +/** + * @brief Remove all sub-items (children) of the given item + * + * This removes all items that are children (and their descendants) of the + * given item @c it. + * + * @param[in] obj The object. + * + * @since 1.8 + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI void elm_menu_item_subitems_clear(Elm_Menu_Item *obj); + +/** + * @brief Returns a list of @c item's subitems. + * + * @param[in] obj The object. + * + * @return A list of @c item's subitems + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI const Eina_List *elm_menu_item_subitems_get(const Elm_Menu_Item *obj); + +/** + * @brief Returns whether @c item is a separator. + * + * @param[in] obj The object. + * + * @return @c true if the item is a separator. + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI Eina_Bool elm_menu_item_is_separator(const Elm_Menu_Item *obj); + +/** + * @brief Get the real Evas(Edje) object created to implement the view of a + * given menu item. + * + * @warning Don't manipulate this object! + * + * @param[in] obj The object. + * + * @return The base Edje object containing the swallowed content associated + * with the item. + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI Efl_Canvas_Object *elm_menu_item_object_get(const Elm_Menu_Item *obj); + +#endif diff --git a/src/lib/elementary/elm_menu_legacy.h b/src/lib/elementary/elm_menu_legacy.h index 9c86efc722..6e6b8ef370 100644 --- a/src/lib/elementary/elm_menu_legacy.h +++ b/src/lib/elementary/elm_menu_legacy.h @@ -30,5 +30,5 @@ EAPI void elm_menu_parent_set(Evas_Object *obj, Evas_Obj */ EAPI Evas_Object *elm_menu_parent_get(const Evas_Object *obj); -#include "elm_menu_item.eo.legacy.h" -#include "elm_menu.eo.legacy.h" +#include "elm_menu_item_eo.legacy.h" +#include "elm_menu_eo.legacy.h" diff --git a/src/lib/elementary/elm_module_helper.h b/src/lib/elementary/elm_module_helper.h index 8f882dabaa..eba3237266 100644 --- a/src/lib/elementary/elm_module_helper.h +++ b/src/lib/elementary/elm_module_helper.h @@ -13,7 +13,7 @@ #endif #ifdef _WIN32 -# ifdef ELEMENTARY_BUILD +# ifdef EFL_BUILD # ifdef DLL_EXPORT # define EAPI __declspec(dllexport) # else diff --git a/src/lib/elementary/elm_multibuttonentry.eo b/src/lib/elementary/elm_multibuttonentry.eo deleted file mode 100644 index 8754d0846a..0000000000 --- a/src/lib/elementary/elm_multibuttonentry.eo +++ /dev/null @@ -1,199 +0,0 @@ -type Elm_Multibuttonentry_Item_Filter_Cb: __undefined_type; [[Elementary multibuttonentry item filter callback type]] -type Elm_Multibuttonentry_Format_Cb: __undefined_type; [[Elementary multibuttonentry format callback type]] - -class Elm.Multibuttonentry extends Efl.Ui.Layout implements 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. - - @since 1.7]] - set { - } - get { - } - values { - editable: bool; [[If $true, user can add/delete item in multibuttonentry, if not, the multibuttonentry is non-editable.]] - } - } - @property expanded { - [[Control the multibuttonentry 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 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]] - - return: const(list); [[The list of items, or NULL if none]] - } - } - @property first_item { - get { - [[Get the first item in the multibuttonentry]] - - return: Elm.Widget.Item; [[The first item, or NULL if none]] - } - } - @property last_item { - get { - [[Get the last item in the multibuttonentry]] - - return: Elm.Widget.Item; [[The last item, or NULL if none]] - } - } - @property entry { - get { - [[Get the entry of the multibuttonentry object]] - - return: Efl.Canvas.Object; [[The entry object, or NULL if none]] - } - } - @property selected_item { - get { - [[Get the selected item in the multibuttonentry]] - - return: Elm.Widget.Item; [[The selected item, or NULL if none]] - } - } - item_prepend { - [[Prepend a new item to the multibuttonentry - - See @Efl.Object.invalidate to delete the item.]] - - return: Elm.Widget.Item; [[A handle to the item added or NULL if not possible]] - params { - @in label: string; [[The label of new item]] - @in func: Evas_Smart_Cb @optional; [[The callback function to be invoked when this item is pressed.]] - @in data: void_ptr @optional; [[The pointer to the data to be attached]] - } - } - clear { - [[Remove all items in the multibuttonentry.]] - - } - item_filter_remove { - [[Remove a filter from the list - - Removes the given callback from the filter list. See elm_multibuttonentry_item_filter_append() - for more information.]] - - params { - @in func: Elm_Multibuttonentry_Item_Filter_Cb; [[The filter function to remove]] - @in data: void_ptr; [[The user data passed when adding the function]] - } - } - item_insert_before { - [[Add a new item to the multibuttonentry before the indicated object reference. - - See @Efl.Object.invalidate to delete the item.]] - - return: Elm.Widget.Item; [[A handle to the item added or NULL if not possible]] - params { - @in before: Elm.Widget.Item; [[The item before which to add it]] - @in label: string; [[The label of new item]] - @in func: Evas_Smart_Cb @optional; [[The callback function to be invoked when this item is pressed.]] - @in data: void_ptr @optional; [[The pointer to the data to be attached]] - } - } - item_append { - [[Append a new item to the multibuttonentry - - See @Efl.Object.invalidate to delete the item.]] - - return: Elm.Widget.Item; [[A handle to the item added or NULL if not possible]] - params { - @in label: string; [[The label of new item]] - @in func: Evas_Smart_Cb @optional; [[The callback function to be invoked when this item is pressed.]] - @in data: void_ptr @optional; [[The pointer to the data to be attached]] - } - } - item_filter_prepend { - [[Prepend a filter function for text inserted in the Multibuttonentry - - Prepend the given callback to the list. See elm_multibuttonentry_item_filter_append() - for more information]] - params { - @in func: Elm_Multibuttonentry_Item_Filter_Cb; [[The function to use as text filter]] - @in data: void_ptr; [[User data to pass to $func]] - } - } - item_filter_append { - [[Append an item filter function for text inserted in the Multibuttonentry - - Append the given callback to a list. This function is called - whenever any text is inserted into the Multibuttonentry, with the text to be inserted - as a parameter. The callback function is free to alter the text in any way - it wants but must free the given pointer and update it. - If the new text is to be discarded, the function can free it and set it text - parameter to NULL. This will also prevent any following filters from being - called.]] - - params { - @in func: Elm_Multibuttonentry_Item_Filter_Cb; [[The function to use as item filter]] - @in data: void_ptr; [[User data to pass to $func]] - } - } - item_insert_after { - [[Add a new item to the multibuttonentry after the indicated object - - See @Efl.Object.invalidate to delete the item.]] - - return: Elm.Widget.Item; [[A handle to the item added or NULL if not possible]] - params { - @in after: Elm.Widget.Item; [[The item after which to add it]] - @in label: string; [[The label of new item]] - @in func: Evas_Smart_Cb @optional; [[The callback function to be invoked when this item is pressed.]] - @in data: void_ptr @optional; [[The pointer to the data to be attached]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.theme_apply; - Efl.Ui.Widget.on_access_update; - Efl.Ui.L10n.translation_update; - Efl.Ui.Widget.widget_event; - Efl.Access.Object.access_children { get; } - Efl.Part.part_get; - } - events { - 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_eo.c b/src/lib/elementary/elm_multibuttonentry_eo.c new file mode 100644 index 0000000000..24dfb7fc45 --- /dev/null +++ b/src/lib/elementary/elm_multibuttonentry_eo.c @@ -0,0 +1,224 @@ +EWAPI const Efl_Event_Description _ELM_MULTIBUTTONENTRY_EVENT_ITEM_SELECTED = + EFL_EVENT_DESCRIPTION("item,selected"); +EWAPI const Efl_Event_Description _ELM_MULTIBUTTONENTRY_EVENT_ITEM_ADDED = + EFL_EVENT_DESCRIPTION("item,added"); +EWAPI const Efl_Event_Description _ELM_MULTIBUTTONENTRY_EVENT_ITEM_DELETED = + EFL_EVENT_DESCRIPTION("item,deleted"); +EWAPI const Efl_Event_Description _ELM_MULTIBUTTONENTRY_EVENT_ITEM_CLICKED = + EFL_EVENT_DESCRIPTION("item,clicked"); +EWAPI const Efl_Event_Description _ELM_MULTIBUTTONENTRY_EVENT_ITEM_LONGPRESSED = + EFL_EVENT_DESCRIPTION("item,longpressed"); +EWAPI const Efl_Event_Description _ELM_MULTIBUTTONENTRY_EVENT_EXPANDED = + EFL_EVENT_DESCRIPTION("expanded"); +EWAPI const Efl_Event_Description _ELM_MULTIBUTTONENTRY_EVENT_CONTRACTED = + EFL_EVENT_DESCRIPTION("contracted"); +EWAPI const Efl_Event_Description _ELM_MULTIBUTTONENTRY_EVENT_EXPAND_STATE_CHANGED = + EFL_EVENT_DESCRIPTION("expand,state,changed"); + +void _elm_multibuttonentry_editable_set(Eo *obj, Elm_Multibuttonentry_Data *pd, Eina_Bool editable); + + +static Eina_Error +__eolian_elm_multibuttonentry_editable_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_multibuttonentry_editable_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_multibuttonentry_editable_set, EFL_FUNC_CALL(editable), Eina_Bool editable); + +Eina_Bool _elm_multibuttonentry_editable_get(const Eo *obj, Elm_Multibuttonentry_Data *pd); + + +static Eina_Value +__eolian_elm_multibuttonentry_editable_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_multibuttonentry_editable_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_multibuttonentry_editable_get, Eina_Bool, 0); + +void _elm_multibuttonentry_expanded_set(Eo *obj, Elm_Multibuttonentry_Data *pd, Eina_Bool expanded); + + +static Eina_Error +__eolian_elm_multibuttonentry_expanded_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_multibuttonentry_expanded_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_multibuttonentry_expanded_set, EFL_FUNC_CALL(expanded), Eina_Bool expanded); + +Eina_Bool _elm_multibuttonentry_expanded_get(const Eo *obj, Elm_Multibuttonentry_Data *pd); + + +static Eina_Value +__eolian_elm_multibuttonentry_expanded_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_multibuttonentry_expanded_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_multibuttonentry_expanded_get, Eina_Bool, 0); + +void _elm_multibuttonentry_format_function_set(Eo *obj, Elm_Multibuttonentry_Data *pd, Elm_Multibuttonentry_Format_Cb format_function, const void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_multibuttonentry_format_function_set, EFL_FUNC_CALL(format_function, data), Elm_Multibuttonentry_Format_Cb format_function, const void *data); + +const Eina_List *_elm_multibuttonentry_items_get(const Eo *obj, Elm_Multibuttonentry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_multibuttonentry_items_get, const Eina_List *, NULL); + +Elm_Widget_Item *_elm_multibuttonentry_first_item_get(const Eo *obj, Elm_Multibuttonentry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_multibuttonentry_first_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_multibuttonentry_last_item_get(const Eo *obj, Elm_Multibuttonentry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_multibuttonentry_last_item_get, Elm_Widget_Item *, NULL); + +Efl_Canvas_Object *_elm_multibuttonentry_entry_get(const Eo *obj, Elm_Multibuttonentry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_multibuttonentry_entry_get, Efl_Canvas_Object *, NULL); + +Elm_Widget_Item *_elm_multibuttonentry_selected_item_get(const Eo *obj, Elm_Multibuttonentry_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_multibuttonentry_selected_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_multibuttonentry_item_prepend(Eo *obj, Elm_Multibuttonentry_Data *pd, const char *label, Evas_Smart_Cb func, void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_multibuttonentry_item_prepend, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(label, func, data), const char *label, Evas_Smart_Cb func, void *data); + +void _elm_multibuttonentry_clear(Eo *obj, Elm_Multibuttonentry_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_multibuttonentry_clear); + +void _elm_multibuttonentry_item_filter_remove(Eo *obj, Elm_Multibuttonentry_Data *pd, Elm_Multibuttonentry_Item_Filter_Cb func, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_multibuttonentry_item_filter_remove, EFL_FUNC_CALL(func, data), Elm_Multibuttonentry_Item_Filter_Cb func, void *data); + +Elm_Widget_Item *_elm_multibuttonentry_item_insert_before(Eo *obj, Elm_Multibuttonentry_Data *pd, Elm_Widget_Item *before, const char *label, Evas_Smart_Cb func, void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_multibuttonentry_item_insert_before, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(before, label, func, data), Elm_Widget_Item *before, const char *label, Evas_Smart_Cb func, void *data); + +Elm_Widget_Item *_elm_multibuttonentry_item_append(Eo *obj, Elm_Multibuttonentry_Data *pd, const char *label, Evas_Smart_Cb func, void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_multibuttonentry_item_append, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(label, func, data), const char *label, Evas_Smart_Cb func, void *data); + +void _elm_multibuttonentry_item_filter_prepend(Eo *obj, Elm_Multibuttonentry_Data *pd, Elm_Multibuttonentry_Item_Filter_Cb func, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_multibuttonentry_item_filter_prepend, EFL_FUNC_CALL(func, data), Elm_Multibuttonentry_Item_Filter_Cb func, void *data); + +void _elm_multibuttonentry_item_filter_append(Eo *obj, Elm_Multibuttonentry_Data *pd, Elm_Multibuttonentry_Item_Filter_Cb func, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_multibuttonentry_item_filter_append, EFL_FUNC_CALL(func, data), Elm_Multibuttonentry_Item_Filter_Cb func, void *data); + +Elm_Widget_Item *_elm_multibuttonentry_item_insert_after(Eo *obj, Elm_Multibuttonentry_Data *pd, Elm_Widget_Item *after, const char *label, Evas_Smart_Cb func, void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_multibuttonentry_item_insert_after, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(after, label, func, data), Elm_Widget_Item *after, const char *label, Evas_Smart_Cb func, void *data); + +Efl_Object *_elm_multibuttonentry_efl_object_constructor(Eo *obj, Elm_Multibuttonentry_Data *pd); + + +Eina_Error _elm_multibuttonentry_efl_ui_widget_theme_apply(Eo *obj, Elm_Multibuttonentry_Data *pd); + + +void _elm_multibuttonentry_efl_ui_widget_on_access_update(Eo *obj, Elm_Multibuttonentry_Data *pd, Eina_Bool enable); + + +void _elm_multibuttonentry_efl_ui_l10n_translation_update(Eo *obj, Elm_Multibuttonentry_Data *pd); + + +Eina_Bool _elm_multibuttonentry_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Multibuttonentry_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +Eina_List *_elm_multibuttonentry_efl_access_object_access_children_get(const Eo *obj, Elm_Multibuttonentry_Data *pd); + + +Efl_Object *_elm_multibuttonentry_efl_part_part_get(const Eo *obj, Elm_Multibuttonentry_Data *pd, const char *name); + + +static Eina_Bool +_elm_multibuttonentry_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_MULTIBUTTONENTRY_EXTRA_OPS +#define ELM_MULTIBUTTONENTRY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_editable_set, _elm_multibuttonentry_editable_set), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_editable_get, _elm_multibuttonentry_editable_get), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_expanded_set, _elm_multibuttonentry_expanded_set), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_expanded_get, _elm_multibuttonentry_expanded_get), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_format_function_set, _elm_multibuttonentry_format_function_set), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_items_get, _elm_multibuttonentry_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_first_item_get, _elm_multibuttonentry_first_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_last_item_get, _elm_multibuttonentry_last_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_entry_get, _elm_multibuttonentry_entry_get), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_selected_item_get, _elm_multibuttonentry_selected_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_item_prepend, _elm_multibuttonentry_item_prepend), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_clear, _elm_multibuttonentry_clear), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_item_filter_remove, _elm_multibuttonentry_item_filter_remove), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_item_insert_before, _elm_multibuttonentry_item_insert_before), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_item_append, _elm_multibuttonentry_item_append), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_item_filter_prepend, _elm_multibuttonentry_item_filter_prepend), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_item_filter_append, _elm_multibuttonentry_item_filter_append), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_item_insert_after, _elm_multibuttonentry_item_insert_after), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_multibuttonentry_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_multibuttonentry_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_multibuttonentry_efl_ui_widget_on_access_update), + EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_multibuttonentry_efl_ui_l10n_translation_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_multibuttonentry_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(efl_access_object_access_children_get, _elm_multibuttonentry_efl_access_object_access_children_get), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_multibuttonentry_efl_part_part_get), + ELM_MULTIBUTTONENTRY_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"editable", __eolian_elm_multibuttonentry_editable_set_reflect, __eolian_elm_multibuttonentry_editable_get_reflect}, + {"expanded", __eolian_elm_multibuttonentry_expanded_set_reflect, __eolian_elm_multibuttonentry_expanded_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_multibuttonentry_class_desc = { + EO_VERSION, + "Elm.Multibuttonentry", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Multibuttonentry_Data), + _elm_multibuttonentry_class_initializer, + _elm_multibuttonentry_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_multibuttonentry_class_get, &_elm_multibuttonentry_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_multibuttonentry_eo.legacy.c" diff --git a/src/lib/elementary/elm_multibuttonentry_eo.h b/src/lib/elementary/elm_multibuttonentry_eo.h new file mode 100644 index 0000000000..cac86fc139 --- /dev/null +++ b/src/lib/elementary/elm_multibuttonentry_eo.h @@ -0,0 +1,346 @@ +#ifndef _ELM_MULTIBUTTONENTRY_EO_H_ +#define _ELM_MULTIBUTTONENTRY_EO_H_ + +#ifndef _ELM_MULTIBUTTONENTRY_EO_CLASS_TYPE +#define _ELM_MULTIBUTTONENTRY_EO_CLASS_TYPE + +typedef Eo Elm_Multibuttonentry; + +#endif + +#ifndef _ELM_MULTIBUTTONENTRY_EO_TYPES +#define _ELM_MULTIBUTTONENTRY_EO_TYPES + + +#endif +/** Elementary multibuttonentry class + * + * @ingroup Elm_Multibuttonentry + */ +#define ELM_MULTIBUTTONENTRY_CLASS elm_multibuttonentry_class_get() + +EWAPI const Efl_Class *elm_multibuttonentry_class_get(void); + +/** + * @brief Control if the multibuttonentry is to be editable or not. + * + * @param[in] obj The object. + * @param[in] editable If @c true, user can add/delete item in + * multibuttonentry, if not, the multibuttonentry is non-editable. + * + * @since 1.7 + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI void elm_obj_multibuttonentry_editable_set(Eo *obj, Eina_Bool editable); + +/** + * @brief Control if the multibuttonentry is to be editable or not. + * + * @param[in] obj The object. + * + * @return If @c true, user can add/delete item in multibuttonentry, if not, + * the multibuttonentry is non-editable. + * + * @since 1.7 + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI Eina_Bool elm_obj_multibuttonentry_editable_get(const Eo *obj); + +/** + * @brief Control the multibuttonentry to expanded state. + * + * In expanded state, the complete entry will be displayed. Otherwise, only + * single line of the entry will be displayed. + * + * @param[in] obj The object. + * @param[in] expanded The value of expanded state. Set this to @c true for + * expanded state. Set this to @c false for single line state. + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI void elm_obj_multibuttonentry_expanded_set(Eo *obj, Eina_Bool expanded); + +/** + * @brief Control the multibuttonentry to expanded state. + * + * In expanded state, the complete entry will be displayed. Otherwise, only + * single line of the entry will be displayed. + * + * @param[in] obj The object. + * + * @return The value of expanded state. Set this to @c true for expanded state. + * Set this to @c false for single line state. + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI Eina_Bool elm_obj_multibuttonentry_expanded_get(const Eo *obj); + +/** + * @brief Set a function to format the string that will be used to display the + * hidden items counter. + * + * If @c format_function is @c NULL, the default format will be used, which is + * $"... + %d". + * + * @param[in] obj The object. + * @param[in] format_function Format_function The actual format function + * @param[in] data Data User data to passed to @c format_function + * + * @since 1.9 + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI void elm_obj_multibuttonentry_format_function_set(Eo *obj, Elm_Multibuttonentry_Format_Cb format_function, const void *data); + +/** + * @brief Get a list of items in the multibuttonentry + * + * @param[in] obj The object. + * + * @return The list of items, or NULL if none + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI const Eina_List *elm_obj_multibuttonentry_items_get(const Eo *obj); + +/** + * @brief Get the first item in the multibuttonentry + * + * @param[in] obj The object. + * + * @return The first item, or NULL if none + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI Elm_Widget_Item *elm_obj_multibuttonentry_first_item_get(const Eo *obj); + +/** + * @brief Get the last item in the multibuttonentry + * + * @param[in] obj The object. + * + * @return The last item, or NULL if none + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI Elm_Widget_Item *elm_obj_multibuttonentry_last_item_get(const Eo *obj); + +/** + * @brief Get the entry of the multibuttonentry object + * + * @param[in] obj The object. + * + * @return The entry object, or NULL if none + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI Efl_Canvas_Object *elm_obj_multibuttonentry_entry_get(const Eo *obj); + +/** + * @brief Get the selected item in the multibuttonentry + * + * @param[in] obj The object. + * + * @return The selected item, or NULL if none + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI Elm_Widget_Item *elm_obj_multibuttonentry_selected_item_get(const Eo *obj); + +/** + * @brief Prepend a new item to the multibuttonentry + * + * See @ref efl_invalidate to delete the item. + * + * @param[in] obj The object. + * @param[in] label The label of new item + * @param[in] func The callback function to be invoked when this item is + * pressed. + * @param[in] data The pointer to the data to be attached + * + * @return A handle to the item added or NULL if not possible + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI Elm_Widget_Item *elm_obj_multibuttonentry_item_prepend(Eo *obj, const char *label, Evas_Smart_Cb func, void *data); + +/** Remove all items in the multibuttonentry. + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI void elm_obj_multibuttonentry_clear(Eo *obj); + +/** + * @brief Remove a filter from the list + * + * Removes the given callback from the filter list. See + * elm_multibuttonentry_item_filter_append() for more information. + * + * @param[in] obj The object. + * @param[in] func The filter function to remove + * @param[in] data The user data passed when adding the function + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI void elm_obj_multibuttonentry_item_filter_remove(Eo *obj, Elm_Multibuttonentry_Item_Filter_Cb func, void *data); + +/** + * @brief Add a new item to the multibuttonentry before the indicated object + * reference. + * + * See @ref efl_invalidate to delete the item. + * + * @param[in] obj The object. + * @param[in] before The item before which to add it + * @param[in] label The label of new item + * @param[in] func The callback function to be invoked when this item is + * pressed. + * @param[in] data The pointer to the data to be attached + * + * @return A handle to the item added or NULL if not possible + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI Elm_Widget_Item *elm_obj_multibuttonentry_item_insert_before(Eo *obj, Elm_Widget_Item *before, const char *label, Evas_Smart_Cb func, void *data); + +/** + * @brief Append a new item to the multibuttonentry + * + * See @ref efl_invalidate to delete the item. + * + * @param[in] obj The object. + * @param[in] label The label of new item + * @param[in] func The callback function to be invoked when this item is + * pressed. + * @param[in] data The pointer to the data to be attached + * + * @return A handle to the item added or NULL if not possible + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI Elm_Widget_Item *elm_obj_multibuttonentry_item_append(Eo *obj, const char *label, Evas_Smart_Cb func, void *data); + +/** + * @brief Prepend a filter function for text inserted in the Multibuttonentry + * + * Prepend the given callback to the list. See + * elm_multibuttonentry_item_filter_append() for more information + * + * @param[in] obj The object. + * @param[in] func The function to use as text filter + * @param[in] data User data to pass to @c func + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI void elm_obj_multibuttonentry_item_filter_prepend(Eo *obj, Elm_Multibuttonentry_Item_Filter_Cb func, void *data); + +/** + * @brief Append an item filter function for text inserted in the + * Multibuttonentry + * + * Append the given callback to a list. This function is called whenever any + * text is inserted into the Multibuttonentry, with the text to be inserted as + * a parameter. The callback function is free to alter the text in any way it + * wants but must free the given pointer and update it. If the new text is to + * be discarded, the function can free it and set it text parameter to NULL. + * This will also prevent any following filters from being called. + * + * @param[in] obj The object. + * @param[in] func The function to use as item filter + * @param[in] data User data to pass to @c func + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI void elm_obj_multibuttonentry_item_filter_append(Eo *obj, Elm_Multibuttonentry_Item_Filter_Cb func, void *data); + +/** + * @brief Add a new item to the multibuttonentry after the indicated object + * + * See @ref efl_invalidate to delete the item. + * + * @param[in] obj The object. + * @param[in] after The item after which to add it + * @param[in] label The label of new item + * @param[in] func The callback function to be invoked when this item is + * pressed. + * @param[in] data The pointer to the data to be attached + * + * @return A handle to the item added or NULL if not possible + * + * @ingroup Elm_Multibuttonentry + */ +EOAPI Elm_Widget_Item *elm_obj_multibuttonentry_item_insert_after(Eo *obj, Elm_Widget_Item *after, const char *label, Evas_Smart_Cb func, void *data); + +EWAPI extern const Efl_Event_Description _ELM_MULTIBUTTONENTRY_EVENT_ITEM_SELECTED; + +/** Called when item was selected + * @return Efl_Object * + * + * @ingroup Elm_Multibuttonentry + */ +#define ELM_MULTIBUTTONENTRY_EVENT_ITEM_SELECTED (&(_ELM_MULTIBUTTONENTRY_EVENT_ITEM_SELECTED)) + +EWAPI extern const Efl_Event_Description _ELM_MULTIBUTTONENTRY_EVENT_ITEM_ADDED; + +/** Called when item was added + * @return Efl_Object * + * + * @ingroup Elm_Multibuttonentry + */ +#define ELM_MULTIBUTTONENTRY_EVENT_ITEM_ADDED (&(_ELM_MULTIBUTTONENTRY_EVENT_ITEM_ADDED)) + +EWAPI extern const Efl_Event_Description _ELM_MULTIBUTTONENTRY_EVENT_ITEM_DELETED; + +/** Called when item was deleted + * @return Efl_Object * + * + * @ingroup Elm_Multibuttonentry + */ +#define ELM_MULTIBUTTONENTRY_EVENT_ITEM_DELETED (&(_ELM_MULTIBUTTONENTRY_EVENT_ITEM_DELETED)) + +EWAPI extern const Efl_Event_Description _ELM_MULTIBUTTONENTRY_EVENT_ITEM_CLICKED; + +/** Called when item was clicked + * @return Efl_Object * + * + * @ingroup Elm_Multibuttonentry + */ +#define ELM_MULTIBUTTONENTRY_EVENT_ITEM_CLICKED (&(_ELM_MULTIBUTTONENTRY_EVENT_ITEM_CLICKED)) + +EWAPI extern const Efl_Event_Description _ELM_MULTIBUTTONENTRY_EVENT_ITEM_LONGPRESSED; + +/** Called when item got a longpress + * @return Efl_Object * + * + * @ingroup Elm_Multibuttonentry + */ +#define ELM_MULTIBUTTONENTRY_EVENT_ITEM_LONGPRESSED (&(_ELM_MULTIBUTTONENTRY_EVENT_ITEM_LONGPRESSED)) + +EWAPI extern const Efl_Event_Description _ELM_MULTIBUTTONENTRY_EVENT_EXPANDED; + +/** Called when expanded + * + * @ingroup Elm_Multibuttonentry + */ +#define ELM_MULTIBUTTONENTRY_EVENT_EXPANDED (&(_ELM_MULTIBUTTONENTRY_EVENT_EXPANDED)) + +EWAPI extern const Efl_Event_Description _ELM_MULTIBUTTONENTRY_EVENT_CONTRACTED; + +/** Called when contracted + * + * @ingroup Elm_Multibuttonentry + */ +#define ELM_MULTIBUTTONENTRY_EVENT_CONTRACTED (&(_ELM_MULTIBUTTONENTRY_EVENT_CONTRACTED)) + +EWAPI extern const Efl_Event_Description _ELM_MULTIBUTTONENTRY_EVENT_EXPAND_STATE_CHANGED; + +/** Called when expanded state changed + * @return int + * + * @ingroup Elm_Multibuttonentry + */ +#define ELM_MULTIBUTTONENTRY_EVENT_EXPAND_STATE_CHANGED (&(_ELM_MULTIBUTTONENTRY_EVENT_EXPAND_STATE_CHANGED)) + +#endif diff --git a/src/lib/elementary/elm_multibuttonentry_eo.legacy.c b/src/lib/elementary/elm_multibuttonentry_eo.legacy.c new file mode 100644 index 0000000000..fa95f809ee --- /dev/null +++ b/src/lib/elementary/elm_multibuttonentry_eo.legacy.c @@ -0,0 +1,108 @@ + +EAPI void +elm_multibuttonentry_editable_set(Elm_Multibuttonentry *obj, Eina_Bool editable) +{ + elm_obj_multibuttonentry_editable_set(obj, editable); +} + +EAPI Eina_Bool +elm_multibuttonentry_editable_get(const Elm_Multibuttonentry *obj) +{ + return elm_obj_multibuttonentry_editable_get(obj); +} + +EAPI void +elm_multibuttonentry_expanded_set(Elm_Multibuttonentry *obj, Eina_Bool expanded) +{ + elm_obj_multibuttonentry_expanded_set(obj, expanded); +} + +EAPI Eina_Bool +elm_multibuttonentry_expanded_get(const Elm_Multibuttonentry *obj) +{ + return elm_obj_multibuttonentry_expanded_get(obj); +} + +EAPI void +elm_multibuttonentry_format_function_set(Elm_Multibuttonentry *obj, Elm_Multibuttonentry_Format_Cb format_function, const void *data) +{ + elm_obj_multibuttonentry_format_function_set(obj, format_function, data); +} + +EAPI const Eina_List * +elm_multibuttonentry_items_get(const Elm_Multibuttonentry *obj) +{ + return elm_obj_multibuttonentry_items_get(obj); +} + +EAPI Elm_Widget_Item * +elm_multibuttonentry_first_item_get(const Elm_Multibuttonentry *obj) +{ + return elm_obj_multibuttonentry_first_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_multibuttonentry_last_item_get(const Elm_Multibuttonentry *obj) +{ + return elm_obj_multibuttonentry_last_item_get(obj); +} + +EAPI Efl_Canvas_Object * +elm_multibuttonentry_entry_get(const Elm_Multibuttonentry *obj) +{ + return elm_obj_multibuttonentry_entry_get(obj); +} + +EAPI Elm_Widget_Item * +elm_multibuttonentry_selected_item_get(const Elm_Multibuttonentry *obj) +{ + return elm_obj_multibuttonentry_selected_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_multibuttonentry_item_prepend(Elm_Multibuttonentry *obj, const char *label, Evas_Smart_Cb func, void *data) +{ + return elm_obj_multibuttonentry_item_prepend(obj, label, func, data); +} + +EAPI void +elm_multibuttonentry_clear(Elm_Multibuttonentry *obj) +{ + elm_obj_multibuttonentry_clear(obj); +} + +EAPI void +elm_multibuttonentry_item_filter_remove(Elm_Multibuttonentry *obj, Elm_Multibuttonentry_Item_Filter_Cb func, void *data) +{ + elm_obj_multibuttonentry_item_filter_remove(obj, func, data); +} + +EAPI Elm_Widget_Item * +elm_multibuttonentry_item_insert_before(Elm_Multibuttonentry *obj, Elm_Widget_Item *before, const char *label, Evas_Smart_Cb func, void *data) +{ + return elm_obj_multibuttonentry_item_insert_before(obj, before, label, func, data); +} + +EAPI Elm_Widget_Item * +elm_multibuttonentry_item_append(Elm_Multibuttonentry *obj, const char *label, Evas_Smart_Cb func, void *data) +{ + return elm_obj_multibuttonentry_item_append(obj, label, func, data); +} + +EAPI void +elm_multibuttonentry_item_filter_prepend(Elm_Multibuttonentry *obj, Elm_Multibuttonentry_Item_Filter_Cb func, void *data) +{ + elm_obj_multibuttonentry_item_filter_prepend(obj, func, data); +} + +EAPI void +elm_multibuttonentry_item_filter_append(Elm_Multibuttonentry *obj, Elm_Multibuttonentry_Item_Filter_Cb func, void *data) +{ + elm_obj_multibuttonentry_item_filter_append(obj, func, data); +} + +EAPI Elm_Widget_Item * +elm_multibuttonentry_item_insert_after(Elm_Multibuttonentry *obj, Elm_Widget_Item *after, const char *label, Evas_Smart_Cb func, void *data) +{ + return elm_obj_multibuttonentry_item_insert_after(obj, after, label, func, data); +} diff --git a/src/lib/elementary/elm_multibuttonentry_eo.legacy.h b/src/lib/elementary/elm_multibuttonentry_eo.legacy.h new file mode 100644 index 0000000000..dd99f04081 --- /dev/null +++ b/src/lib/elementary/elm_multibuttonentry_eo.legacy.h @@ -0,0 +1,269 @@ +#ifndef _ELM_MULTIBUTTONENTRY_EO_LEGACY_H_ +#define _ELM_MULTIBUTTONENTRY_EO_LEGACY_H_ + +#ifndef _ELM_MULTIBUTTONENTRY_EO_CLASS_TYPE +#define _ELM_MULTIBUTTONENTRY_EO_CLASS_TYPE + +typedef Eo Elm_Multibuttonentry; + +#endif + +#ifndef _ELM_MULTIBUTTONENTRY_EO_TYPES +#define _ELM_MULTIBUTTONENTRY_EO_TYPES + + +#endif + +/** + * @brief Control if the multibuttonentry is to be editable or not. + * + * @param[in] obj The object. + * @param[in] editable If @c true, user can add/delete item in + * multibuttonentry, if not, the multibuttonentry is non-editable. + * + * @since 1.7 + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI void elm_multibuttonentry_editable_set(Elm_Multibuttonentry *obj, Eina_Bool editable); + +/** + * @brief Control if the multibuttonentry is to be editable or not. + * + * @param[in] obj The object. + * + * @return If @c true, user can add/delete item in multibuttonentry, if not, + * the multibuttonentry is non-editable. + * + * @since 1.7 + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI Eina_Bool elm_multibuttonentry_editable_get(const Elm_Multibuttonentry *obj); + +/** + * @brief Control the multibuttonentry to expanded state. + * + * In expanded state, the complete entry will be displayed. Otherwise, only + * single line of the entry will be displayed. + * + * @param[in] obj The object. + * @param[in] expanded The value of expanded state. Set this to @c true for + * expanded state. Set this to @c false for single line state. + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI void elm_multibuttonentry_expanded_set(Elm_Multibuttonentry *obj, Eina_Bool expanded); + +/** + * @brief Control the multibuttonentry to expanded state. + * + * In expanded state, the complete entry will be displayed. Otherwise, only + * single line of the entry will be displayed. + * + * @param[in] obj The object. + * + * @return The value of expanded state. Set this to @c true for expanded state. + * Set this to @c false for single line state. + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI Eina_Bool elm_multibuttonentry_expanded_get(const Elm_Multibuttonentry *obj); + +/** + * @brief Set a function to format the string that will be used to display the + * hidden items counter. + * + * If @c format_function is @c NULL, the default format will be used, which is + * $"... + %d". + * + * @param[in] obj The object. + * @param[in] format_function Format_function The actual format function + * @param[in] data Data User data to passed to @c format_function + * + * @since 1.9 + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI void elm_multibuttonentry_format_function_set(Elm_Multibuttonentry *obj, Elm_Multibuttonentry_Format_Cb format_function, const void *data); + +/** + * @brief Get a list of items in the multibuttonentry + * + * @param[in] obj The object. + * + * @return The list of items, or NULL if none + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI const Eina_List *elm_multibuttonentry_items_get(const Elm_Multibuttonentry *obj); + +/** + * @brief Get the first item in the multibuttonentry + * + * @param[in] obj The object. + * + * @return The first item, or NULL if none + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI Elm_Widget_Item *elm_multibuttonentry_first_item_get(const Elm_Multibuttonentry *obj); + +/** + * @brief Get the last item in the multibuttonentry + * + * @param[in] obj The object. + * + * @return The last item, or NULL if none + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI Elm_Widget_Item *elm_multibuttonentry_last_item_get(const Elm_Multibuttonentry *obj); + +/** + * @brief Get the entry of the multibuttonentry object + * + * @param[in] obj The object. + * + * @return The entry object, or NULL if none + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI Efl_Canvas_Object *elm_multibuttonentry_entry_get(const Elm_Multibuttonentry *obj); + +/** + * @brief Get the selected item in the multibuttonentry + * + * @param[in] obj The object. + * + * @return The selected item, or NULL if none + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI Elm_Widget_Item *elm_multibuttonentry_selected_item_get(const Elm_Multibuttonentry *obj); + +/** + * @brief Prepend a new item to the multibuttonentry + * + * See @ref Efl.Object.invalidate to delete the item. + * + * @param[in] obj The object. + * @param[in] label The label of new item + * @param[in] func The callback function to be invoked when this item is + * pressed. + * @param[in] data The pointer to the data to be attached + * + * @return A handle to the item added or NULL if not possible + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI Elm_Widget_Item *elm_multibuttonentry_item_prepend(Elm_Multibuttonentry *obj, const char *label, Evas_Smart_Cb func, void *data); + +/** Remove all items in the multibuttonentry. + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI void elm_multibuttonentry_clear(Elm_Multibuttonentry *obj); + +/** + * @brief Remove a filter from the list + * + * Removes the given callback from the filter list. See + * elm_multibuttonentry_item_filter_append() for more information. + * + * @param[in] obj The object. + * @param[in] func The filter function to remove + * @param[in] data The user data passed when adding the function + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI void elm_multibuttonentry_item_filter_remove(Elm_Multibuttonentry *obj, Elm_Multibuttonentry_Item_Filter_Cb func, void *data); + +/** + * @brief Add a new item to the multibuttonentry before the indicated object + * reference. + * + * See @ref Efl.Object.invalidate to delete the item. + * + * @param[in] obj The object. + * @param[in] before The item before which to add it + * @param[in] label The label of new item + * @param[in] func The callback function to be invoked when this item is + * pressed. + * @param[in] data The pointer to the data to be attached + * + * @return A handle to the item added or NULL if not possible + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI Elm_Widget_Item *elm_multibuttonentry_item_insert_before(Elm_Multibuttonentry *obj, Elm_Widget_Item *before, const char *label, Evas_Smart_Cb func, void *data); + +/** + * @brief Append a new item to the multibuttonentry + * + * See @ref Efl.Object.invalidate to delete the item. + * + * @param[in] obj The object. + * @param[in] label The label of new item + * @param[in] func The callback function to be invoked when this item is + * pressed. + * @param[in] data The pointer to the data to be attached + * + * @return A handle to the item added or NULL if not possible + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI Elm_Widget_Item *elm_multibuttonentry_item_append(Elm_Multibuttonentry *obj, const char *label, Evas_Smart_Cb func, void *data); + +/** + * @brief Prepend a filter function for text inserted in the Multibuttonentry + * + * Prepend the given callback to the list. See + * elm_multibuttonentry_item_filter_append() for more information + * + * @param[in] obj The object. + * @param[in] func The function to use as text filter + * @param[in] data User data to pass to @c func + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI void elm_multibuttonentry_item_filter_prepend(Elm_Multibuttonentry *obj, Elm_Multibuttonentry_Item_Filter_Cb func, void *data); + +/** + * @brief Append an item filter function for text inserted in the + * Multibuttonentry + * + * Append the given callback to a list. This function is called whenever any + * text is inserted into the Multibuttonentry, with the text to be inserted as + * a parameter. The callback function is free to alter the text in any way it + * wants but must free the given pointer and update it. If the new text is to + * be discarded, the function can free it and set it text parameter to NULL. + * This will also prevent any following filters from being called. + * + * @param[in] obj The object. + * @param[in] func The function to use as item filter + * @param[in] data User data to pass to @c func + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI void elm_multibuttonentry_item_filter_append(Elm_Multibuttonentry *obj, Elm_Multibuttonentry_Item_Filter_Cb func, void *data); + +/** + * @brief Add a new item to the multibuttonentry after the indicated object + * + * See @ref Efl.Object.invalidate to delete the item. + * + * @param[in] obj The object. + * @param[in] after The item after which to add it + * @param[in] label The label of new item + * @param[in] func The callback function to be invoked when this item is + * pressed. + * @param[in] data The pointer to the data to be attached + * + * @return A handle to the item added or NULL if not possible + * + * @ingroup Elm_Multibuttonentry_Group + */ +EAPI Elm_Widget_Item *elm_multibuttonentry_item_insert_after(Elm_Multibuttonentry *obj, Elm_Widget_Item *after, const char *label, Evas_Smart_Cb func, void *data); + +#endif diff --git a/src/lib/elementary/elm_multibuttonentry_item.eo b/src/lib/elementary/elm_multibuttonentry_item.eo deleted file mode 100644 index 09e05fdd6c..0000000000 --- a/src/lib/elementary/elm_multibuttonentry_item.eo +++ /dev/null @@ -1,38 +0,0 @@ -class Elm.Multibuttonentry_Item extends Elm.Widget.Item implements - Efl.Access.Widget.Action, - Efl.Ui.Legacy -{ - [[Elementary multibuttonentry class]] - legacy_prefix: elm_multibuttonentry_item; - eo_prefix: elm_obj_multibuttonentry_item; - methods { - @property selected { - [[Control the selected state of an item]] - get { - } - set { - } - values { - selected: bool; [[$true if selected $false otherwise]] - } - } - prev_get @const { - [[Get the previous item in the multibuttonentry]] - return: Elm.Widget.Item; [[The item before the item]] - } - next_get @const { - [[Get the next item in the multibuttonentry]] - return: Elm.Widget.Item; [[The item after the item]] - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Elm.Widget.Item.signal_emit; - Elm.Widget.Item.part_text { get; set; } - Elm.Widget.Item.disable; - 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/elm_multibuttonentry_item_eo.c b/src/lib/elementary/elm_multibuttonentry_item_eo.c new file mode 100644 index 0000000000..153de11cf1 --- /dev/null +++ b/src/lib/elementary/elm_multibuttonentry_item_eo.c @@ -0,0 +1,121 @@ + +void _elm_multibuttonentry_item_selected_set(Eo *obj, Elm_Multibuttonentry_Item_Data *pd, Eina_Bool selected); + + +static Eina_Error +__eolian_elm_multibuttonentry_item_selected_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_multibuttonentry_item_selected_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_multibuttonentry_item_selected_set, EFL_FUNC_CALL(selected), Eina_Bool selected); + +Eina_Bool _elm_multibuttonentry_item_selected_get(const Eo *obj, Elm_Multibuttonentry_Item_Data *pd); + + +static Eina_Value +__eolian_elm_multibuttonentry_item_selected_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_multibuttonentry_item_selected_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_multibuttonentry_item_selected_get, Eina_Bool, 0); + +Elm_Widget_Item *_elm_multibuttonentry_item_prev_get(const Eo *obj, Elm_Multibuttonentry_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_multibuttonentry_item_prev_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_multibuttonentry_item_next_get(const Eo *obj, Elm_Multibuttonentry_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_multibuttonentry_item_next_get, Elm_Widget_Item *, NULL); + +Efl_Object *_elm_multibuttonentry_item_efl_object_constructor(Eo *obj, Elm_Multibuttonentry_Item_Data *pd); + + +void _elm_multibuttonentry_item_efl_object_destructor(Eo *obj, Elm_Multibuttonentry_Item_Data *pd); + + +void _elm_multibuttonentry_item_elm_widget_item_signal_emit(Eo *obj, Elm_Multibuttonentry_Item_Data *pd, const char *emission, const char *source); + + +void _elm_multibuttonentry_item_elm_widget_item_part_text_set(Eo *obj, Elm_Multibuttonentry_Item_Data *pd, const char *part, const char *label); + + +const char *_elm_multibuttonentry_item_elm_widget_item_part_text_get(const Eo *obj, Elm_Multibuttonentry_Item_Data *pd, const char *part); + + +void _elm_multibuttonentry_item_elm_widget_item_disable(Eo *obj, Elm_Multibuttonentry_Item_Data *pd); + + +const char *_elm_multibuttonentry_item_efl_access_object_i18n_name_get(const Eo *obj, Elm_Multibuttonentry_Item_Data *pd); + + +Efl_Access_State_Set _elm_multibuttonentry_item_efl_access_object_state_set_get(const Eo *obj, Elm_Multibuttonentry_Item_Data *pd); + + +const Efl_Access_Action_Data *_elm_multibuttonentry_item_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Multibuttonentry_Item_Data *pd); + + +static Eina_Bool +_elm_multibuttonentry_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_MULTIBUTTONENTRY_ITEM_EXTRA_OPS +#define ELM_MULTIBUTTONENTRY_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_item_selected_set, _elm_multibuttonentry_item_selected_set), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_item_selected_get, _elm_multibuttonentry_item_selected_get), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_item_prev_get, _elm_multibuttonentry_item_prev_get), + EFL_OBJECT_OP_FUNC(elm_obj_multibuttonentry_item_next_get, _elm_multibuttonentry_item_next_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_multibuttonentry_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_multibuttonentry_item_efl_object_destructor), + EFL_OBJECT_OP_FUNC(elm_wdg_item_signal_emit, _elm_multibuttonentry_item_elm_widget_item_signal_emit), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_set, _elm_multibuttonentry_item_elm_widget_item_part_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_get, _elm_multibuttonentry_item_elm_widget_item_part_text_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_disable, _elm_multibuttonentry_item_elm_widget_item_disable), + EFL_OBJECT_OP_FUNC(efl_access_object_i18n_name_get, _elm_multibuttonentry_item_efl_access_object_i18n_name_get), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_multibuttonentry_item_efl_access_object_state_set_get), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_multibuttonentry_item_efl_access_widget_action_elm_actions_get), + ELM_MULTIBUTTONENTRY_ITEM_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"selected", __eolian_elm_multibuttonentry_item_selected_set_reflect, __eolian_elm_multibuttonentry_item_selected_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_multibuttonentry_item_class_desc = { + EO_VERSION, + "Elm.Multibuttonentry_Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Multibuttonentry_Item_Data), + _elm_multibuttonentry_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_multibuttonentry_item_class_get, &_elm_multibuttonentry_item_class_desc, ELM_WIDGET_ITEM_CLASS, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_multibuttonentry_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_multibuttonentry_item_eo.h b/src/lib/elementary/elm_multibuttonentry_item_eo.h new file mode 100644 index 0000000000..c1f5484cce --- /dev/null +++ b/src/lib/elementary/elm_multibuttonentry_item_eo.h @@ -0,0 +1,67 @@ +#ifndef _ELM_MULTIBUTTONENTRY_ITEM_EO_H_ +#define _ELM_MULTIBUTTONENTRY_ITEM_EO_H_ + +#ifndef _ELM_MULTIBUTTONENTRY_ITEM_EO_CLASS_TYPE +#define _ELM_MULTIBUTTONENTRY_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Multibuttonentry_Item; + +#endif + +#ifndef _ELM_MULTIBUTTONENTRY_ITEM_EO_TYPES +#define _ELM_MULTIBUTTONENTRY_ITEM_EO_TYPES + + +#endif +/** Elementary multibuttonentry class + * + * @ingroup Elm_Multibuttonentry_Item + */ +#define ELM_MULTIBUTTONENTRY_ITEM_CLASS elm_multibuttonentry_item_class_get() + +EWAPI const Efl_Class *elm_multibuttonentry_item_class_get(void); + +/** + * @brief Control the selected state of an item + * + * @param[in] obj The object. + * @param[in] selected @c true if selected @c false otherwise + * + * @ingroup Elm_Multibuttonentry_Item + */ +EOAPI void elm_obj_multibuttonentry_item_selected_set(Eo *obj, Eina_Bool selected); + +/** + * @brief Control the selected state of an item + * + * @param[in] obj The object. + * + * @return @c true if selected @c false otherwise + * + * @ingroup Elm_Multibuttonentry_Item + */ +EOAPI Eina_Bool elm_obj_multibuttonentry_item_selected_get(const Eo *obj); + +/** + * @brief Get the previous item in the multibuttonentry + * + * @param[in] obj The object. + * + * @return The item before the item + * + * @ingroup Elm_Multibuttonentry_Item + */ +EOAPI Elm_Widget_Item *elm_obj_multibuttonentry_item_prev_get(const Eo *obj); + +/** + * @brief Get the next item in the multibuttonentry + * + * @param[in] obj The object. + * + * @return The item after the item + * + * @ingroup Elm_Multibuttonentry_Item + */ +EOAPI Elm_Widget_Item *elm_obj_multibuttonentry_item_next_get(const Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_multibuttonentry_item_eo.legacy.c b/src/lib/elementary/elm_multibuttonentry_item_eo.legacy.c new file mode 100644 index 0000000000..95f3250eac --- /dev/null +++ b/src/lib/elementary/elm_multibuttonentry_item_eo.legacy.c @@ -0,0 +1,24 @@ + +EAPI void +elm_multibuttonentry_item_selected_set(Elm_Multibuttonentry_Item *obj, Eina_Bool selected) +{ + elm_obj_multibuttonentry_item_selected_set(obj, selected); +} + +EAPI Eina_Bool +elm_multibuttonentry_item_selected_get(const Elm_Multibuttonentry_Item *obj) +{ + return elm_obj_multibuttonentry_item_selected_get(obj); +} + +EAPI Elm_Widget_Item * +elm_multibuttonentry_item_prev_get(const Elm_Multibuttonentry_Item *obj) +{ + return elm_obj_multibuttonentry_item_prev_get(obj); +} + +EAPI Elm_Widget_Item * +elm_multibuttonentry_item_next_get(const Elm_Multibuttonentry_Item *obj) +{ + return elm_obj_multibuttonentry_item_next_get(obj); +} diff --git a/src/lib/elementary/elm_multibuttonentry_item_eo.legacy.h b/src/lib/elementary/elm_multibuttonentry_item_eo.legacy.h new file mode 100644 index 0000000000..d4e4281ea8 --- /dev/null +++ b/src/lib/elementary/elm_multibuttonentry_item_eo.legacy.h @@ -0,0 +1,60 @@ +#ifndef _ELM_MULTIBUTTONENTRY_ITEM_EO_LEGACY_H_ +#define _ELM_MULTIBUTTONENTRY_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_MULTIBUTTONENTRY_ITEM_EO_CLASS_TYPE +#define _ELM_MULTIBUTTONENTRY_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Multibuttonentry_Item; + +#endif + +#ifndef _ELM_MULTIBUTTONENTRY_ITEM_EO_TYPES +#define _ELM_MULTIBUTTONENTRY_ITEM_EO_TYPES + + +#endif + +/** + * @brief Control the selected state of an item + * + * @param[in] obj The object. + * @param[in] selected @c true if selected @c false otherwise + * + * @ingroup Elm_Multibuttonentry_Item_Group + */ +EAPI void elm_multibuttonentry_item_selected_set(Elm_Multibuttonentry_Item *obj, Eina_Bool selected); + +/** + * @brief Control the selected state of an item + * + * @param[in] obj The object. + * + * @return @c true if selected @c false otherwise + * + * @ingroup Elm_Multibuttonentry_Item_Group + */ +EAPI Eina_Bool elm_multibuttonentry_item_selected_get(const Elm_Multibuttonentry_Item *obj); + +/** + * @brief Get the previous item in the multibuttonentry + * + * @param[in] obj The object. + * + * @return The item before the item + * + * @ingroup Elm_Multibuttonentry_Item_Group + */ +EAPI Elm_Widget_Item *elm_multibuttonentry_item_prev_get(const Elm_Multibuttonentry_Item *obj); + +/** + * @brief Get the next item in the multibuttonentry + * + * @param[in] obj The object. + * + * @return The item after the item + * + * @ingroup Elm_Multibuttonentry_Item_Group + */ +EAPI Elm_Widget_Item *elm_multibuttonentry_item_next_get(const Elm_Multibuttonentry_Item *obj); + +#endif diff --git a/src/lib/elementary/elm_multibuttonentry_part.eo b/src/lib/elementary/elm_multibuttonentry_part.eo index ce1294d413..b11d3e25ca 100644 --- a/src/lib/elementary/elm_multibuttonentry_part.eo +++ b/src/lib/elementary/elm_multibuttonentry_part.eo @@ -1,4 +1,4 @@ -class Elm.Multibuttonentry_Part extends Efl.Ui.Layout_Part_Legacy +class @beta Elm.Multibuttonentry_Part extends 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 deleted file mode 100644 index 97b5d35641..0000000000 --- a/src/lib/elementary/elm_naviframe.eo +++ /dev/null @@ -1,162 +0,0 @@ -class Elm.Naviframe extends Efl.Ui.Layout implements Efl.Access.Widget.Action, Efl.Ui.Legacy -{ - [[Elementary naviframe class]] - legacy_prefix: elm_naviframe; - eo_prefix: elm_obj_naviframe; - event_prefix: elm_naviframe; - methods { - @property event_enabled { - [[Control the event enabled when pushing/popping items - - If $enabled is $true, the contents of the naviframe item will - receives events from mouse and keyboard during view changing such as - item push/pop. - - Warning: Events will be blocked by calling evas_object_freeze_events_set() - internally. So don't call the API whiling pushing/popping items.]] - set { - } - get { - } - values { - enabled: bool; [[Events are received when enabled is $true, and ignored otherwise.]] - } - } - @property content_preserve_on_pop { - [[Preserve the content objects when items are popped.]] - set { - } - get { - } - values { - preserve: bool; [[Enable the preserve mode if $true, disable otherwise]] - } - } - @property prev_btn_auto_pushed { - [[Control if creating prev button automatically or not]] - set { - } - get { - } - values { - auto_pushed: bool; [[If $true, the previous button(back button) will be created internally when you pass the $NULL to the prev_btn parameter in elm_naviframe_item_push]] - } - } - @property items { - get { - [[Get a list of all the naviframe items.]] - - return: list @owned @warn_unused; [[A list of naviframe items, @Elm.Widget.Item, or $NULL on failure. Note: The returned list MUST be freed.]] - } - } - @property top_item { - get { - [[Get a top item on the naviframe stack]] - - return: Elm.Widget.Item; [[The top item on the naviframe stack or $NULL, if the stack is empty]] - } - } - @property bottom_item { - get { - [[Get a bottom item on the naviframe stack]] - - return: Elm.Widget.Item; [[The bottom item on the naviframe stack or $NULL, if the stack is empty]] - } - } - item_pop { - [[Pop an item that is on top of the stack - - This pops an item that is on the top(visible) of the naviframe, makes it - disappear, then deletes the item. The item that was underneath it on the - stack will become visible. - - When pop transition animation is in progress, new pop operation is blocked until current pop operation - is complete. - ]] - - return: Efl.Canvas.Object; [[$NULL or the content object(if the elm_naviframe_content_preserve_on_pop_get is true).]] - } - item_insert_before { - [[Insert a new item into the naviframe before item $before. - - The item is inserted into the naviframe straight away without any - transition operations. This item will be deleted when it is popped.]] - - return: Elm.Widget.Item; [[The created item or $NULL upon failure.]] - params { - @in before: Elm.Widget.Item; [[The naviframe item to insert before.]] - @in title_label: string @optional; [[The label in the title area. The name of the title label part is "elm.text.title"]] - @in prev_btn: Efl.Canvas.Object @nullable; [[The button to go to the previous item. If it is NULL, then naviframe will create a back button automatically. The name of the prev_btn part is "elm.swallow.prev_btn"]] - @in next_btn: Efl.Canvas.Object @nullable; [[The button to go to the next item. Or It could be just an extra function button. The name of the next_btn part is "elm.swallow.next_btn"]] - @in content: Efl.Canvas.Object; [[The main content object. The name of content part is "elm.swallow.content"]] - @in item_style: string @nullable; [[The current item style name. $NULL would be default.]] - } - } - item_push { - [[Push a new item to the top of the naviframe stack (and show it). - - - The item pushed becomes one page of the naviframe, this item will be - deleted when it is popped. - - When push transition animation is in progress, pop operation is blocked until push is complete. - - The following styles are available for this item: - "default"]] - - return: Elm.Widget.Item; [[The created item or $NULL upon failure.]] - params { - @in title_label: string @optional; [[The label in the title area. The name of the title label part is "elm.text.title"]] - @in prev_btn: Efl.Canvas.Object @nullable; [[The button to go to the previous item. If it is NULL, then naviframe will create a back button automatically. The name of the prev_btn part is "elm.swallow.prev_btn"]] - @in next_btn: Efl.Canvas.Object @nullable; [[The button to go to the next item. Or It could be just an extra function button. The name of the next_btn part is "elm.swallow.next_btn"]] - @in content: Efl.Canvas.Object; [[The main content object. The name of content part is "elm.swallow.content"]] - @in item_style: string @nullable; [[The current item style name. $NULL would be default.]] - } - } - item_simple_promote { - [[Simple version of item_promote.]] - - params { - @in content: Efl.Canvas.Object; [[Item to promote]] - } - } - item_insert_after { - [[Insert a new item into the naviframe after item $after. - - The item is inserted into the naviframe straight away without any - transition operations. This item will be deleted when it is popped. - - The following styles are available for this item: - "default"]] - - return: Elm.Widget.Item; [[The created item or $NULL upon failure.]] - params { - @in after: Elm.Widget.Item; [[The naviframe item to insert after.]] - @in title_label: string @optional; [[The label in the title area. The name of the title label part is "elm.text.title"]] - @in prev_btn: Efl.Canvas.Object @nullable; [[The button to go to the previous item. If it is NULL, then naviframe will create a back button automatically. The name of the prev_btn part is "elm.swallow.prev_btn"]] - @in next_btn: Efl.Canvas.Object @nullable; [[The button to go to the next item. Or It could be just an extra function button. The name of the next_btn part is "elm.swallow.next_btn"]] - @in content: Efl.Canvas.Object; [[The main content object. The name of content part is "elm.swallow.content"]] - @in item_style: string @nullable; [[The current item style name. $NULL would be default.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Gfx.Entity.visible { set; } - Efl.Ui.Widget.on_access_update; - Efl.Ui.L10n.translation_update; - Efl.Ui.Widget.theme_apply; - Efl.Ui.Widget.widget_event; - Efl.Layout.Signal.signal_emit; - Efl.Access.Widget.Action.elm_actions { get; } - Efl.Ui.Widget.resize_object { set; } - Efl.Part.part_get; - } - events { - 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_eo.c b/src/lib/elementary/elm_naviframe_eo.c new file mode 100644 index 0000000000..5bbd65f531 --- /dev/null +++ b/src/lib/elementary/elm_naviframe_eo.c @@ -0,0 +1,233 @@ +EWAPI const Efl_Event_Description _ELM_NAVIFRAME_EVENT_TRANSITION_FINISHED = + EFL_EVENT_DESCRIPTION("transition,finished"); +EWAPI const Efl_Event_Description _ELM_NAVIFRAME_EVENT_TITLE_TRANSITION_FINISHED = + EFL_EVENT_DESCRIPTION("title,transition,finished"); +EWAPI const Efl_Event_Description _ELM_NAVIFRAME_EVENT_TITLE_CLICKED = + EFL_EVENT_DESCRIPTION("title,clicked"); +EWAPI const Efl_Event_Description _ELM_NAVIFRAME_EVENT_ITEM_ACTIVATED = + EFL_EVENT_DESCRIPTION("item,activated"); + +void _elm_naviframe_event_enabled_set(Eo *obj, Elm_Naviframe_Data *pd, Eina_Bool enabled); + + +static Eina_Error +__eolian_elm_naviframe_event_enabled_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_naviframe_event_enabled_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_naviframe_event_enabled_set, EFL_FUNC_CALL(enabled), Eina_Bool enabled); + +Eina_Bool _elm_naviframe_event_enabled_get(const Eo *obj, Elm_Naviframe_Data *pd); + + +static Eina_Value +__eolian_elm_naviframe_event_enabled_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_naviframe_event_enabled_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_naviframe_event_enabled_get, Eina_Bool, 0); + +void _elm_naviframe_content_preserve_on_pop_set(Eo *obj, Elm_Naviframe_Data *pd, Eina_Bool preserve); + + +static Eina_Error +__eolian_elm_naviframe_content_preserve_on_pop_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_naviframe_content_preserve_on_pop_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_naviframe_content_preserve_on_pop_set, EFL_FUNC_CALL(preserve), Eina_Bool preserve); + +Eina_Bool _elm_naviframe_content_preserve_on_pop_get(const Eo *obj, Elm_Naviframe_Data *pd); + + +static Eina_Value +__eolian_elm_naviframe_content_preserve_on_pop_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_naviframe_content_preserve_on_pop_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_naviframe_content_preserve_on_pop_get, Eina_Bool, 0); + +void _elm_naviframe_prev_btn_auto_pushed_set(Eo *obj, Elm_Naviframe_Data *pd, Eina_Bool auto_pushed); + + +static Eina_Error +__eolian_elm_naviframe_prev_btn_auto_pushed_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_naviframe_prev_btn_auto_pushed_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_naviframe_prev_btn_auto_pushed_set, EFL_FUNC_CALL(auto_pushed), Eina_Bool auto_pushed); + +Eina_Bool _elm_naviframe_prev_btn_auto_pushed_get(const Eo *obj, Elm_Naviframe_Data *pd); + + +static Eina_Value +__eolian_elm_naviframe_prev_btn_auto_pushed_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_naviframe_prev_btn_auto_pushed_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_naviframe_prev_btn_auto_pushed_get, Eina_Bool, 0); + +Eina_List *_elm_naviframe_items_get(const Eo *obj, Elm_Naviframe_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_naviframe_items_get, Eina_List *, NULL); + +Elm_Widget_Item *_elm_naviframe_top_item_get(const Eo *obj, Elm_Naviframe_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_naviframe_top_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_naviframe_bottom_item_get(const Eo *obj, Elm_Naviframe_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_naviframe_bottom_item_get, Elm_Widget_Item *, NULL); + +Efl_Canvas_Object *_elm_naviframe_item_pop(Eo *obj, Elm_Naviframe_Data *pd); + +EOAPI EFL_FUNC_BODY(elm_obj_naviframe_item_pop, Efl_Canvas_Object *, NULL); + +Elm_Widget_Item *_elm_naviframe_item_insert_before(Eo *obj, Elm_Naviframe_Data *pd, Elm_Widget_Item *before, const char *title_label, Efl_Canvas_Object *prev_btn, Efl_Canvas_Object *next_btn, Efl_Canvas_Object *content, const char *item_style); + +EOAPI EFL_FUNC_BODYV(elm_obj_naviframe_item_insert_before, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(before, title_label, prev_btn, next_btn, content, item_style), Elm_Widget_Item *before, const char *title_label, Efl_Canvas_Object *prev_btn, Efl_Canvas_Object *next_btn, Efl_Canvas_Object *content, const char *item_style); + +Elm_Widget_Item *_elm_naviframe_item_push(Eo *obj, Elm_Naviframe_Data *pd, const char *title_label, Efl_Canvas_Object *prev_btn, Efl_Canvas_Object *next_btn, Efl_Canvas_Object *content, const char *item_style); + +EOAPI EFL_FUNC_BODYV(elm_obj_naviframe_item_push, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(title_label, prev_btn, next_btn, content, item_style), const char *title_label, Efl_Canvas_Object *prev_btn, Efl_Canvas_Object *next_btn, Efl_Canvas_Object *content, const char *item_style); + +void _elm_naviframe_item_simple_promote(Eo *obj, Elm_Naviframe_Data *pd, Efl_Canvas_Object *content); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_naviframe_item_simple_promote, EFL_FUNC_CALL(content), Efl_Canvas_Object *content); + +Elm_Widget_Item *_elm_naviframe_item_insert_after(Eo *obj, Elm_Naviframe_Data *pd, Elm_Widget_Item *after, const char *title_label, Efl_Canvas_Object *prev_btn, Efl_Canvas_Object *next_btn, Efl_Canvas_Object *content, const char *item_style); + +EOAPI EFL_FUNC_BODYV(elm_obj_naviframe_item_insert_after, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(after, title_label, prev_btn, next_btn, content, item_style), Elm_Widget_Item *after, const char *title_label, Efl_Canvas_Object *prev_btn, Efl_Canvas_Object *next_btn, Efl_Canvas_Object *content, const char *item_style); + +Efl_Object *_elm_naviframe_efl_object_constructor(Eo *obj, Elm_Naviframe_Data *pd); + + +void _elm_naviframe_efl_gfx_entity_visible_set(Eo *obj, Elm_Naviframe_Data *pd, Eina_Bool v); + + +void _elm_naviframe_efl_ui_widget_on_access_update(Eo *obj, Elm_Naviframe_Data *pd, Eina_Bool enable); + + +void _elm_naviframe_efl_ui_l10n_translation_update(Eo *obj, Elm_Naviframe_Data *pd); + + +Eina_Error _elm_naviframe_efl_ui_widget_theme_apply(Eo *obj, Elm_Naviframe_Data *pd); + + +Eina_Bool _elm_naviframe_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Naviframe_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +void _elm_naviframe_efl_layout_signal_signal_emit(Eo *obj, Elm_Naviframe_Data *pd, const char *emission, const char *source); + + +const Efl_Access_Action_Data *_elm_naviframe_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Naviframe_Data *pd); + + +void _elm_naviframe_efl_ui_widget_resize_object_set(Eo *obj, Elm_Naviframe_Data *pd, Efl_Canvas_Object *sobj); + + +Efl_Object *_elm_naviframe_efl_part_part_get(const Eo *obj, Elm_Naviframe_Data *pd, const char *name); + + +static Eina_Bool +_elm_naviframe_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_NAVIFRAME_EXTRA_OPS +#define ELM_NAVIFRAME_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_event_enabled_set, _elm_naviframe_event_enabled_set), + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_event_enabled_get, _elm_naviframe_event_enabled_get), + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_content_preserve_on_pop_set, _elm_naviframe_content_preserve_on_pop_set), + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_content_preserve_on_pop_get, _elm_naviframe_content_preserve_on_pop_get), + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_prev_btn_auto_pushed_set, _elm_naviframe_prev_btn_auto_pushed_set), + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_prev_btn_auto_pushed_get, _elm_naviframe_prev_btn_auto_pushed_get), + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_items_get, _elm_naviframe_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_top_item_get, _elm_naviframe_top_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_bottom_item_get, _elm_naviframe_bottom_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_item_pop, _elm_naviframe_item_pop), + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_item_insert_before, _elm_naviframe_item_insert_before), + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_item_push, _elm_naviframe_item_push), + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_item_simple_promote, _elm_naviframe_item_simple_promote), + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_item_insert_after, _elm_naviframe_item_insert_after), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_naviframe_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_naviframe_efl_gfx_entity_visible_set), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_naviframe_efl_ui_widget_on_access_update), + EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_naviframe_efl_ui_l10n_translation_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_naviframe_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_naviframe_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(efl_layout_signal_emit, _elm_naviframe_efl_layout_signal_signal_emit), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_naviframe_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_ui_widget_resize_object_set, _elm_naviframe_efl_ui_widget_resize_object_set), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_naviframe_efl_part_part_get), + ELM_NAVIFRAME_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"event_enabled", __eolian_elm_naviframe_event_enabled_set_reflect, __eolian_elm_naviframe_event_enabled_get_reflect}, + {"content_preserve_on_pop", __eolian_elm_naviframe_content_preserve_on_pop_set_reflect, __eolian_elm_naviframe_content_preserve_on_pop_get_reflect}, + {"prev_btn_auto_pushed", __eolian_elm_naviframe_prev_btn_auto_pushed_set_reflect, __eolian_elm_naviframe_prev_btn_auto_pushed_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_naviframe_class_desc = { + EO_VERSION, + "Elm.Naviframe", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Naviframe_Data), + _elm_naviframe_class_initializer, + _elm_naviframe_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_naviframe_class_get, &_elm_naviframe_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_naviframe_eo.legacy.c" diff --git a/src/lib/elementary/elm_naviframe_eo.h b/src/lib/elementary/elm_naviframe_eo.h new file mode 100644 index 0000000000..8b4f4d8c0e --- /dev/null +++ b/src/lib/elementary/elm_naviframe_eo.h @@ -0,0 +1,289 @@ +#ifndef _ELM_NAVIFRAME_EO_H_ +#define _ELM_NAVIFRAME_EO_H_ + +#ifndef _ELM_NAVIFRAME_EO_CLASS_TYPE +#define _ELM_NAVIFRAME_EO_CLASS_TYPE + +typedef Eo Elm_Naviframe; + +#endif + +#ifndef _ELM_NAVIFRAME_EO_TYPES +#define _ELM_NAVIFRAME_EO_TYPES + + +#endif +/** Elementary naviframe class + * + * @ingroup Elm_Naviframe + */ +#define ELM_NAVIFRAME_CLASS elm_naviframe_class_get() + +EWAPI const Efl_Class *elm_naviframe_class_get(void); + +/** + * @brief Control the event enabled when pushing/popping items + * + * If @c enabled is @c true, the contents of the naviframe item will receives + * events from mouse and keyboard during view changing such as item push/pop. + * + * @warning Events will be blocked by calling evas_object_freeze_events_set() + * internally. So don't call the API whiling pushing/popping items. + * + * @param[in] obj The object. + * @param[in] enabled Events are received when enabled is @c true, and ignored + * otherwise. + * + * @ingroup Elm_Naviframe + */ +EOAPI void elm_obj_naviframe_event_enabled_set(Eo *obj, Eina_Bool enabled); + +/** + * @brief Control the event enabled when pushing/popping items + * + * If @c enabled is @c true, the contents of the naviframe item will receives + * events from mouse and keyboard during view changing such as item push/pop. + * + * @warning Events will be blocked by calling evas_object_freeze_events_set() + * internally. So don't call the API whiling pushing/popping items. + * + * @param[in] obj The object. + * + * @return Events are received when enabled is @c true, and ignored otherwise. + * + * @ingroup Elm_Naviframe + */ +EOAPI Eina_Bool elm_obj_naviframe_event_enabled_get(const Eo *obj); + +/** + * @brief Preserve the content objects when items are popped. + * + * @param[in] obj The object. + * @param[in] preserve Enable the preserve mode if @c true, disable otherwise + * + * @ingroup Elm_Naviframe + */ +EOAPI void elm_obj_naviframe_content_preserve_on_pop_set(Eo *obj, Eina_Bool preserve); + +/** + * @brief Preserve the content objects when items are popped. + * + * @param[in] obj The object. + * + * @return Enable the preserve mode if @c true, disable otherwise + * + * @ingroup Elm_Naviframe + */ +EOAPI Eina_Bool elm_obj_naviframe_content_preserve_on_pop_get(const Eo *obj); + +/** + * @brief Control if creating prev button automatically or not + * + * @param[in] obj The object. + * @param[in] auto_pushed If @c true, the previous button(back button) will be + * created internally when you pass the @c NULL to the prev_btn parameter in + * elm_naviframe_item_push + * + * @ingroup Elm_Naviframe + */ +EOAPI void elm_obj_naviframe_prev_btn_auto_pushed_set(Eo *obj, Eina_Bool auto_pushed); + +/** + * @brief Control if creating prev button automatically or not + * + * @param[in] obj The object. + * + * @return If @c true, the previous button(back button) will be created + * internally when you pass the @c NULL to the prev_btn parameter in + * elm_naviframe_item_push + * + * @ingroup Elm_Naviframe + */ +EOAPI Eina_Bool elm_obj_naviframe_prev_btn_auto_pushed_get(const Eo *obj); + +/** + * @brief Get a list of all the naviframe items. + * + * @param[in] obj The object. + * + * @return A list of naviframe items, @ref Elm_Widget_Item, or @c NULL on + * failure. Note: The returned list MUST be freed. + * + * @ingroup Elm_Naviframe + */ +EOAPI Eina_List *elm_obj_naviframe_items_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get a top item on the naviframe stack + * + * @param[in] obj The object. + * + * @return The top item on the naviframe stack or @c NULL, if the stack is + * empty + * + * @ingroup Elm_Naviframe + */ +EOAPI Elm_Widget_Item *elm_obj_naviframe_top_item_get(const Eo *obj); + +/** + * @brief Get a bottom item on the naviframe stack + * + * @param[in] obj The object. + * + * @return The bottom item on the naviframe stack or @c NULL, if the stack is + * empty + * + * @ingroup Elm_Naviframe + */ +EOAPI Elm_Widget_Item *elm_obj_naviframe_bottom_item_get(const Eo *obj); + +/** + * @brief Pop an item that is on top of the stack + * + * This pops an item that is on the top(visible) of the naviframe, makes it + * disappear, then deletes the item. The item that was underneath it on the + * stack will become visible. + * + * When pop transition animation is in progress, new pop operation is blocked + * until current pop operation is complete. + * + * @param[in] obj The object. + * + * @return @c NULL or the content object(if the + * elm_naviframe_content_preserve_on_pop_get is true). + * + * @ingroup Elm_Naviframe + */ +EOAPI Efl_Canvas_Object *elm_obj_naviframe_item_pop(Eo *obj); + +/** + * @brief Insert a new item into the naviframe before item @c before. + * + * The item is inserted into the naviframe straight away without any transition + * operations. This item will be deleted when it is popped. + * + * @param[in] obj The object. + * @param[in] before The naviframe item to insert before. + * @param[in] title_label The label in the title area. The name of the title + * label part is "elm.text.title" + * @param[in] prev_btn The button to go to the previous item. If it is NULL, + * then naviframe will create a back button automatically. The name of the + * prev_btn part is "elm.swallow.prev_btn" + * @param[in] next_btn The button to go to the next item. Or It could be just + * an extra function button. The name of the next_btn part is + * "elm.swallow.next_btn" + * @param[in] content The main content object. The name of content part is + * "elm.swallow.content" + * @param[in] item_style The current item style name. @c NULL would be default. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Naviframe + */ +EOAPI Elm_Widget_Item *elm_obj_naviframe_item_insert_before(Eo *obj, Elm_Widget_Item *before, const char *title_label, Efl_Canvas_Object *prev_btn, Efl_Canvas_Object *next_btn, Efl_Canvas_Object *content, const char *item_style); + +/** + * @brief Push a new item to the top of the naviframe stack (and show it). + * + * The item pushed becomes one page of the naviframe, this item will be deleted + * when it is popped. + * + * When push transition animation is in progress, pop operation is blocked + * until push is complete. + * + * The following styles are available for this item: "default" + * + * @param[in] obj The object. + * @param[in] title_label The label in the title area. The name of the title + * label part is "elm.text.title" + * @param[in] prev_btn The button to go to the previous item. If it is NULL, + * then naviframe will create a back button automatically. The name of the + * prev_btn part is "elm.swallow.prev_btn" + * @param[in] next_btn The button to go to the next item. Or It could be just + * an extra function button. The name of the next_btn part is + * "elm.swallow.next_btn" + * @param[in] content The main content object. The name of content part is + * "elm.swallow.content" + * @param[in] item_style The current item style name. @c NULL would be default. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Naviframe + */ +EOAPI Elm_Widget_Item *elm_obj_naviframe_item_push(Eo *obj, const char *title_label, Efl_Canvas_Object *prev_btn, Efl_Canvas_Object *next_btn, Efl_Canvas_Object *content, const char *item_style); + +/** + * @brief Simple version of item_promote. + * + * @param[in] obj The object. + * @param[in] content Item to promote + * + * @ingroup Elm_Naviframe + */ +EOAPI void elm_obj_naviframe_item_simple_promote(Eo *obj, Efl_Canvas_Object *content); + +/** + * @brief Insert a new item into the naviframe after item @c after. + * + * The item is inserted into the naviframe straight away without any transition + * operations. This item will be deleted when it is popped. + * + * The following styles are available for this item: "default" + * + * @param[in] obj The object. + * @param[in] after The naviframe item to insert after. + * @param[in] title_label The label in the title area. The name of the title + * label part is "elm.text.title" + * @param[in] prev_btn The button to go to the previous item. If it is NULL, + * then naviframe will create a back button automatically. The name of the + * prev_btn part is "elm.swallow.prev_btn" + * @param[in] next_btn The button to go to the next item. Or It could be just + * an extra function button. The name of the next_btn part is + * "elm.swallow.next_btn" + * @param[in] content The main content object. The name of content part is + * "elm.swallow.content" + * @param[in] item_style The current item style name. @c NULL would be default. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Naviframe + */ +EOAPI Elm_Widget_Item *elm_obj_naviframe_item_insert_after(Eo *obj, Elm_Widget_Item *after, const char *title_label, Efl_Canvas_Object *prev_btn, Efl_Canvas_Object *next_btn, Efl_Canvas_Object *content, const char *item_style); + +EWAPI extern const Efl_Event_Description _ELM_NAVIFRAME_EVENT_TRANSITION_FINISHED; + +/** Called when naviframe transition finished + * @return Efl_Object * + * + * @ingroup Elm_Naviframe + */ +#define ELM_NAVIFRAME_EVENT_TRANSITION_FINISHED (&(_ELM_NAVIFRAME_EVENT_TRANSITION_FINISHED)) + +EWAPI extern const Efl_Event_Description _ELM_NAVIFRAME_EVENT_TITLE_TRANSITION_FINISHED; + +/** Called when naviframe title transaction finished + * @return Efl_Object * + * + * @ingroup Elm_Naviframe + */ +#define ELM_NAVIFRAME_EVENT_TITLE_TRANSITION_FINISHED (&(_ELM_NAVIFRAME_EVENT_TITLE_TRANSITION_FINISHED)) + +EWAPI extern const Efl_Event_Description _ELM_NAVIFRAME_EVENT_TITLE_CLICKED; + +/** Called when naviframe title was clicked + * @return Efl_Object * + * + * @ingroup Elm_Naviframe + */ +#define ELM_NAVIFRAME_EVENT_TITLE_CLICKED (&(_ELM_NAVIFRAME_EVENT_TITLE_CLICKED)) + +EWAPI extern const Efl_Event_Description _ELM_NAVIFRAME_EVENT_ITEM_ACTIVATED; + +/** Called when naviframe item was activated + * @return Efl_Object * + * + * @ingroup Elm_Naviframe + */ +#define ELM_NAVIFRAME_EVENT_ITEM_ACTIVATED (&(_ELM_NAVIFRAME_EVENT_ITEM_ACTIVATED)) + +#endif diff --git a/src/lib/elementary/elm_naviframe_eo.legacy.c b/src/lib/elementary/elm_naviframe_eo.legacy.c new file mode 100644 index 0000000000..02d4717b7d --- /dev/null +++ b/src/lib/elementary/elm_naviframe_eo.legacy.c @@ -0,0 +1,84 @@ + +EAPI void +elm_naviframe_event_enabled_set(Elm_Naviframe *obj, Eina_Bool enabled) +{ + elm_obj_naviframe_event_enabled_set(obj, enabled); +} + +EAPI Eina_Bool +elm_naviframe_event_enabled_get(const Elm_Naviframe *obj) +{ + return elm_obj_naviframe_event_enabled_get(obj); +} + +EAPI void +elm_naviframe_content_preserve_on_pop_set(Elm_Naviframe *obj, Eina_Bool preserve) +{ + elm_obj_naviframe_content_preserve_on_pop_set(obj, preserve); +} + +EAPI Eina_Bool +elm_naviframe_content_preserve_on_pop_get(const Elm_Naviframe *obj) +{ + return elm_obj_naviframe_content_preserve_on_pop_get(obj); +} + +EAPI void +elm_naviframe_prev_btn_auto_pushed_set(Elm_Naviframe *obj, Eina_Bool auto_pushed) +{ + elm_obj_naviframe_prev_btn_auto_pushed_set(obj, auto_pushed); +} + +EAPI Eina_Bool +elm_naviframe_prev_btn_auto_pushed_get(const Elm_Naviframe *obj) +{ + return elm_obj_naviframe_prev_btn_auto_pushed_get(obj); +} + +EAPI Eina_List * +elm_naviframe_items_get(const Elm_Naviframe *obj) +{ + return elm_obj_naviframe_items_get(obj); +} + +EAPI Elm_Widget_Item * +elm_naviframe_top_item_get(const Elm_Naviframe *obj) +{ + return elm_obj_naviframe_top_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_naviframe_bottom_item_get(const Elm_Naviframe *obj) +{ + return elm_obj_naviframe_bottom_item_get(obj); +} + +EAPI Efl_Canvas_Object * +elm_naviframe_item_pop(Elm_Naviframe *obj) +{ + return elm_obj_naviframe_item_pop(obj); +} + +EAPI Elm_Widget_Item * +elm_naviframe_item_insert_before(Elm_Naviframe *obj, Elm_Widget_Item *before, const char *title_label, Efl_Canvas_Object *prev_btn, Efl_Canvas_Object *next_btn, Efl_Canvas_Object *content, const char *item_style) +{ + return elm_obj_naviframe_item_insert_before(obj, before, title_label, prev_btn, next_btn, content, item_style); +} + +EAPI Elm_Widget_Item * +elm_naviframe_item_push(Elm_Naviframe *obj, const char *title_label, Efl_Canvas_Object *prev_btn, Efl_Canvas_Object *next_btn, Efl_Canvas_Object *content, const char *item_style) +{ + return elm_obj_naviframe_item_push(obj, title_label, prev_btn, next_btn, content, item_style); +} + +EAPI void +elm_naviframe_item_simple_promote(Elm_Naviframe *obj, Efl_Canvas_Object *content) +{ + elm_obj_naviframe_item_simple_promote(obj, content); +} + +EAPI Elm_Widget_Item * +elm_naviframe_item_insert_after(Elm_Naviframe *obj, Elm_Widget_Item *after, const char *title_label, Efl_Canvas_Object *prev_btn, Efl_Canvas_Object *next_btn, Efl_Canvas_Object *content, const char *item_style) +{ + return elm_obj_naviframe_item_insert_after(obj, after, title_label, prev_btn, next_btn, content, item_style); +} diff --git a/src/lib/elementary/elm_naviframe_eo.legacy.h b/src/lib/elementary/elm_naviframe_eo.legacy.h new file mode 100644 index 0000000000..995cbb1582 --- /dev/null +++ b/src/lib/elementary/elm_naviframe_eo.legacy.h @@ -0,0 +1,216 @@ +#ifndef _ELM_NAVIFRAME_EO_LEGACY_H_ +#define _ELM_NAVIFRAME_EO_LEGACY_H_ + +#ifndef _ELM_NAVIFRAME_EO_CLASS_TYPE +#define _ELM_NAVIFRAME_EO_CLASS_TYPE + +typedef Eo Elm_Naviframe; + +#endif + +#ifndef _ELM_NAVIFRAME_EO_TYPES +#define _ELM_NAVIFRAME_EO_TYPES + + +#endif + +/** + * @brief Control the event enabled when pushing/popping items + * + * If @c enabled is @c true, the contents of the naviframe item will receives + * events from mouse and keyboard during view changing such as item push/pop. + * + * @warning Events will be blocked by calling evas_object_freeze_events_set() + * internally. So don't call the API whiling pushing/popping items. + * + * @param[in] obj The object. + * @param[in] enabled Events are received when enabled is @c true, and ignored + * otherwise. + * + * @ingroup Elm_Naviframe_Group + */ +EAPI void elm_naviframe_event_enabled_set(Elm_Naviframe *obj, Eina_Bool enabled); + +/** + * @brief Control the event enabled when pushing/popping items + * + * If @c enabled is @c true, the contents of the naviframe item will receives + * events from mouse and keyboard during view changing such as item push/pop. + * + * @warning Events will be blocked by calling evas_object_freeze_events_set() + * internally. So don't call the API whiling pushing/popping items. + * + * @param[in] obj The object. + * + * @return Events are received when enabled is @c true, and ignored otherwise. + * + * @ingroup Elm_Naviframe_Group + */ +EAPI Eina_Bool elm_naviframe_event_enabled_get(const Elm_Naviframe *obj); + +/** + * @brief Preserve the content objects when items are popped. + * + * @param[in] obj The object. + * @param[in] preserve Enable the preserve mode if @c true, disable otherwise + * + * @ingroup Elm_Naviframe_Group + */ +EAPI void elm_naviframe_content_preserve_on_pop_set(Elm_Naviframe *obj, Eina_Bool preserve); + +/** + * @brief Preserve the content objects when items are popped. + * + * @param[in] obj The object. + * + * @return Enable the preserve mode if @c true, disable otherwise + * + * @ingroup Elm_Naviframe_Group + */ +EAPI Eina_Bool elm_naviframe_content_preserve_on_pop_get(const Elm_Naviframe *obj); + +/** + * @brief Control if creating prev button automatically or not + * + * @param[in] obj The object. + * @param[in] auto_pushed If @c true, the previous button(back button) will be + * created internally when you pass the @c NULL to the prev_btn parameter in + * elm_naviframe_item_push + * + * @ingroup Elm_Naviframe_Group + */ +EAPI void elm_naviframe_prev_btn_auto_pushed_set(Elm_Naviframe *obj, Eina_Bool auto_pushed); + +/** + * @brief Control if creating prev button automatically or not + * + * @param[in] obj The object. + * + * @return If @c true, the previous button(back button) will be created + * internally when you pass the @c NULL to the prev_btn parameter in + * elm_naviframe_item_push + * + * @ingroup Elm_Naviframe_Group + */ +EAPI Eina_Bool elm_naviframe_prev_btn_auto_pushed_get(const Elm_Naviframe *obj); + +/** + * @brief Get a list of all the naviframe items. + * + * @param[in] obj The object. + * + * @return A list of naviframe items, @ref Elm_Widget_Item, or @c NULL on + * failure. Note: The returned list MUST be freed. + * + * @ingroup Elm_Naviframe_Group + */ +EAPI Eina_List *elm_naviframe_items_get(const Elm_Naviframe *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get a top item on the naviframe stack + * + * @param[in] obj The object. + * + * @return The top item on the naviframe stack or @c NULL, if the stack is + * empty + * + * @ingroup Elm_Naviframe_Group + */ +EAPI Elm_Widget_Item *elm_naviframe_top_item_get(const Elm_Naviframe *obj); + +/** + * @brief Get a bottom item on the naviframe stack + * + * @param[in] obj The object. + * + * @return The bottom item on the naviframe stack or @c NULL, if the stack is + * empty + * + * @ingroup Elm_Naviframe_Group + */ +EAPI Elm_Widget_Item *elm_naviframe_bottom_item_get(const Elm_Naviframe *obj); + +/** + * @brief Pop an item that is on top of the stack + * + * This pops an item that is on the top(visible) of the naviframe, makes it + * disappear, then deletes the item. The item that was underneath it on the + * stack will become visible. + * + * When pop transition animation is in progress, new pop operation is blocked + * until current pop operation is complete. + * + * @param[in] obj The object. + * + * @return @c NULL or the content object(if the + * elm_naviframe_content_preserve_on_pop_get is true). + * + * @ingroup Elm_Naviframe_Group + */ +EAPI Efl_Canvas_Object *elm_naviframe_item_pop(Elm_Naviframe *obj); + +/** + * @brief Insert a new item into the naviframe before item @c before. + * + * The item is inserted into the naviframe straight away without any transition + * operations. This item will be deleted when it is popped. + * + * @param[in] obj The object. + * @param[in] before The naviframe item to insert before. + * @param[in] title_label The label in the title area. The name of the title + * label part is "elm.text.title" + * @param[in] prev_btn The button to go to the previous item. If it is NULL, + * then naviframe will create a back button automatically. The name of the + * prev_btn part is "elm.swallow.prev_btn" + * @param[in] next_btn The button to go to the next item. Or It could be just + * an extra function button. The name of the next_btn part is + * "elm.swallow.next_btn" + * @param[in] content The main content object. The name of content part is + * "elm.swallow.content" + * @param[in] item_style The current item style name. @c NULL would be default. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Naviframe_Group + */ +EAPI Elm_Widget_Item *elm_naviframe_item_insert_before(Elm_Naviframe *obj, Elm_Widget_Item *before, const char *title_label, Efl_Canvas_Object *prev_btn, Efl_Canvas_Object *next_btn, Efl_Canvas_Object *content, const char *item_style); + +/** + * @brief Simple version of item_promote. + * + * @param[in] obj The object. + * @param[in] content Item to promote + * + * @ingroup Elm_Naviframe_Group + */ +EAPI void elm_naviframe_item_simple_promote(Elm_Naviframe *obj, Efl_Canvas_Object *content); + +/** + * @brief Insert a new item into the naviframe after item @c after. + * + * The item is inserted into the naviframe straight away without any transition + * operations. This item will be deleted when it is popped. + * + * The following styles are available for this item: "default" + * + * @param[in] obj The object. + * @param[in] after The naviframe item to insert after. + * @param[in] title_label The label in the title area. The name of the title + * label part is "elm.text.title" + * @param[in] prev_btn The button to go to the previous item. If it is NULL, + * then naviframe will create a back button automatically. The name of the + * prev_btn part is "elm.swallow.prev_btn" + * @param[in] next_btn The button to go to the next item. Or It could be just + * an extra function button. The name of the next_btn part is + * "elm.swallow.next_btn" + * @param[in] content The main content object. The name of content part is + * "elm.swallow.content" + * @param[in] item_style The current item style name. @c NULL would be default. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Naviframe_Group + */ +EAPI Elm_Widget_Item *elm_naviframe_item_insert_after(Elm_Naviframe *obj, Elm_Widget_Item *after, const char *title_label, Efl_Canvas_Object *prev_btn, Efl_Canvas_Object *next_btn, Efl_Canvas_Object *content, const char *item_style); + +#endif diff --git a/src/lib/elementary/elm_naviframe_item.eo b/src/lib/elementary/elm_naviframe_item.eo deleted file mode 100644 index c35f345761..0000000000 --- a/src/lib/elementary/elm_naviframe_item.eo +++ /dev/null @@ -1,78 +0,0 @@ -type Elm_Naviframe_Item_Pop_Cb: __undefined_type; [[Elementary naviframe item pop callback type]] - -class Elm.Naviframe.Item extends Elm.Widget.Item implements Efl.Ui.Legacy -{ - [[Elementary naviframe item class]] - legacy_prefix: elm_naviframe_item; - eo_prefix: elm_obj_naviframe_item; - methods { - pop_to { - [[Pop the top item and delete the items between the top and the - above one on the given item. - - The items between the top and the given item will be deleted - first, and then the top item will be popped at last. - - Warning: The pop callback function set by - elm_naviframe_item_pop_cb_set is not called for items between the - top item and the destination item since those items are deleted - without being popped. - ]] - } - title_enabled_get @const { - [[Get a value whether title area is enabled or not.]] - return: bool; [[If $true, title area will be enabled, disabled otherwise]] - } - title_enabled_set { - [[Enable/Disable the title area with transition effect - - When the title area is disabled, then the controls would be - hidden so as to expand the content area to full-size. - ]] - params { - @in enable: bool; [[If $true, title area will be enabled, disabled otherwise]] - @in transition: bool; [[If $true, transition effect of the title will be visible, invisible otherwise]] - } - } - promote { - [[Promote an item already in the naviframe stack to the top of - the stack. - - This will take the indicated item and promote it to the top of - the stack as if it had been pushed there. The item must already - be inside the naviframe stack to work. - ]] - } - - pop_cb_set { - [[Set a function to be called when an item of the naviframe is - going to be popped. - - Warning: Don't set "clicked" callback to the prev button - additionally if the function does an exact same logic with - this $func. When hardware back key is pressed then both - callbacks will be called. - Warning: The pop callback function is called only if the item is - popped. Therefore, the pop callback function is not called if the - item is deleted without being popped. - - @since 1.8 - ]] - params { - @in func: Elm_Naviframe_Item_Pop_Cb @nullable; [[The callback function.]] - @in data: void_ptr @optional; [[Data to be passed to func call.]] - } - } - } - implements { - Efl.Object.constructor; - Efl.Object.invalidate; - Efl.Object.destructor; - 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; - Elm.Widget.Item.style { set; } - Efl.Access.Object.access_children { get; } - } -} diff --git a/src/lib/elementary/elm_naviframe_item_eo.c b/src/lib/elementary/elm_naviframe_item_eo.c new file mode 100644 index 0000000000..49f0583e88 --- /dev/null +++ b/src/lib/elementary/elm_naviframe_item_eo.c @@ -0,0 +1,102 @@ + +void _elm_naviframe_item_pop_to(Eo *obj, Elm_Naviframe_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_naviframe_item_pop_to); + +Eina_Bool _elm_naviframe_item_title_enabled_get(const Eo *obj, Elm_Naviframe_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_naviframe_item_title_enabled_get, Eina_Bool, 0); + +void _elm_naviframe_item_title_enabled_set(Eo *obj, Elm_Naviframe_Item_Data *pd, Eina_Bool enable, Eina_Bool transition); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_naviframe_item_title_enabled_set, EFL_FUNC_CALL(enable, transition), Eina_Bool enable, Eina_Bool transition); + +void _elm_naviframe_item_promote(Eo *obj, Elm_Naviframe_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_naviframe_item_promote); + +void _elm_naviframe_item_pop_cb_set(Eo *obj, Elm_Naviframe_Item_Data *pd, Elm_Naviframe_Item_Pop_Cb func, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_naviframe_item_pop_cb_set, EFL_FUNC_CALL(func, data), Elm_Naviframe_Item_Pop_Cb func, void *data); + +Efl_Object *_elm_naviframe_item_efl_object_constructor(Eo *obj, Elm_Naviframe_Item_Data *pd); + + +void _elm_naviframe_item_efl_object_invalidate(Eo *obj, Elm_Naviframe_Item_Data *pd); + + +void _elm_naviframe_item_efl_object_destructor(Eo *obj, Elm_Naviframe_Item_Data *pd); + + +void _elm_naviframe_item_elm_widget_item_signal_emit(Eo *obj, Elm_Naviframe_Item_Data *pd, const char *emission, const char *source); + + +void _elm_naviframe_item_elm_widget_item_part_text_set(Eo *obj, Elm_Naviframe_Item_Data *pd, const char *part, const char *label); + + +const char *_elm_naviframe_item_elm_widget_item_part_text_get(const Eo *obj, Elm_Naviframe_Item_Data *pd, const char *part); + + +void _elm_naviframe_item_elm_widget_item_part_content_set(Eo *obj, Elm_Naviframe_Item_Data *pd, const char *part, Efl_Canvas_Object *content); + + +Efl_Canvas_Object *_elm_naviframe_item_elm_widget_item_part_content_get(const Eo *obj, Elm_Naviframe_Item_Data *pd, const char *part); + + +Efl_Canvas_Object *_elm_naviframe_item_elm_widget_item_part_content_unset(Eo *obj, Elm_Naviframe_Item_Data *pd, const char *part); + + +void _elm_naviframe_item_elm_widget_item_style_set(Eo *obj, Elm_Naviframe_Item_Data *pd, const char *style); + + +Eina_List *_elm_naviframe_item_efl_access_object_access_children_get(const Eo *obj, Elm_Naviframe_Item_Data *pd); + + +static Eina_Bool +_elm_naviframe_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_NAVIFRAME_ITEM_EXTRA_OPS +#define ELM_NAVIFRAME_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_item_pop_to, _elm_naviframe_item_pop_to), + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_item_title_enabled_get, _elm_naviframe_item_title_enabled_get), + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_item_title_enabled_set, _elm_naviframe_item_title_enabled_set), + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_item_promote, _elm_naviframe_item_promote), + EFL_OBJECT_OP_FUNC(elm_obj_naviframe_item_pop_cb_set, _elm_naviframe_item_pop_cb_set), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_naviframe_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_invalidate, _elm_naviframe_item_efl_object_invalidate), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_naviframe_item_efl_object_destructor), + EFL_OBJECT_OP_FUNC(elm_wdg_item_signal_emit, _elm_naviframe_item_elm_widget_item_signal_emit), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_set, _elm_naviframe_item_elm_widget_item_part_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_get, _elm_naviframe_item_elm_widget_item_part_text_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_set, _elm_naviframe_item_elm_widget_item_part_content_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_get, _elm_naviframe_item_elm_widget_item_part_content_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_unset, _elm_naviframe_item_elm_widget_item_part_content_unset), + EFL_OBJECT_OP_FUNC(elm_wdg_item_style_set, _elm_naviframe_item_elm_widget_item_style_set), + EFL_OBJECT_OP_FUNC(efl_access_object_access_children_get, _elm_naviframe_item_efl_access_object_access_children_get), + ELM_NAVIFRAME_ITEM_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_naviframe_item_class_desc = { + EO_VERSION, + "Elm.Naviframe.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Naviframe_Item_Data), + _elm_naviframe_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_naviframe_item_class_get, &_elm_naviframe_item_class_desc, ELM_WIDGET_ITEM_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_naviframe_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_naviframe_item_eo.h b/src/lib/elementary/elm_naviframe_item_eo.h new file mode 100644 index 0000000000..d5b86840f3 --- /dev/null +++ b/src/lib/elementary/elm_naviframe_item_eo.h @@ -0,0 +1,99 @@ +#ifndef _ELM_NAVIFRAME_ITEM_EO_H_ +#define _ELM_NAVIFRAME_ITEM_EO_H_ + +#ifndef _ELM_NAVIFRAME_ITEM_EO_CLASS_TYPE +#define _ELM_NAVIFRAME_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Naviframe_Item; + +#endif + +#ifndef _ELM_NAVIFRAME_ITEM_EO_TYPES +#define _ELM_NAVIFRAME_ITEM_EO_TYPES + + +#endif +/** Elementary naviframe item class + * + * @ingroup Elm_Naviframe_Item + */ +#define ELM_NAVIFRAME_ITEM_CLASS elm_naviframe_item_class_get() + +EWAPI const Efl_Class *elm_naviframe_item_class_get(void); + +/** + * @brief Pop the top item and delete the items between the top and the above + * one on the given item. + * + * The items between the top and the given item will be deleted first, and then + * the top item will be popped at last. + * + * @warning The pop callback function set by elm_naviframe_item_pop_cb_set is + * not called for items between the top item and the destination item since + * those items are deleted without being popped. + * @param[in] obj The object. + * + * @ingroup Elm_Naviframe_Item + */ +EOAPI void elm_obj_naviframe_item_pop_to(Eo *obj); + +/** + * @brief Get a value whether title area is enabled or not. + * + * @param[in] obj The object. + * + * @return If @c true, title area will be enabled, disabled otherwise + * + * @ingroup Elm_Naviframe_Item + */ +EOAPI Eina_Bool elm_obj_naviframe_item_title_enabled_get(const Eo *obj); + +/** + * @brief Enable/Disable the title area with transition effect + * + * When the title area is disabled, then the controls would be hidden so as to + * expand the content area to full-size. + * + * @param[in] obj The object. + * @param[in] enable If @c true, title area will be enabled, disabled otherwise + * @param[in] transition If @c true, transition effect of the title will be + * visible, invisible otherwise + * + * @ingroup Elm_Naviframe_Item + */ +EOAPI void elm_obj_naviframe_item_title_enabled_set(Eo *obj, Eina_Bool enable, Eina_Bool transition); + +/** + * @brief Promote an item already in the naviframe stack to the top of the + * stack. + * + * This will take the indicated item and promote it to the top of the stack as + * if it had been pushed there. The item must already be inside the naviframe + * stack to work. + * @param[in] obj The object. + * + * @ingroup Elm_Naviframe_Item + */ +EOAPI void elm_obj_naviframe_item_promote(Eo *obj); + +/** + * @brief Set a function to be called when an item of the naviframe is going to + * be popped. + * + * @warning Don't set "clicked" callback to the prev button additionally if the + * function does an exact same logic with this @c func. When hardware back key + * is pressed then both callbacks will be called. Warning: The pop callback + * function is called only if the item is popped. Therefore, the pop callback + * function is not called if the item is deleted without being popped. + * + * @param[in] obj The object. + * @param[in] func The callback function. + * @param[in] data Data to be passed to func call. + * + * @since 1.8 + * + * @ingroup Elm_Naviframe_Item + */ +EOAPI void elm_obj_naviframe_item_pop_cb_set(Eo *obj, Elm_Naviframe_Item_Pop_Cb func, void *data); + +#endif diff --git a/src/lib/elementary/elm_naviframe_item_eo.legacy.c b/src/lib/elementary/elm_naviframe_item_eo.legacy.c new file mode 100644 index 0000000000..83d18b5c20 --- /dev/null +++ b/src/lib/elementary/elm_naviframe_item_eo.legacy.c @@ -0,0 +1,30 @@ + +EAPI void +elm_naviframe_item_pop_to(Elm_Naviframe_Item *obj) +{ + elm_obj_naviframe_item_pop_to(obj); +} + +EAPI Eina_Bool +elm_naviframe_item_title_enabled_get(const Elm_Naviframe_Item *obj) +{ + return elm_obj_naviframe_item_title_enabled_get(obj); +} + +EAPI void +elm_naviframe_item_title_enabled_set(Elm_Naviframe_Item *obj, Eina_Bool enable, Eina_Bool transition) +{ + elm_obj_naviframe_item_title_enabled_set(obj, enable, transition); +} + +EAPI void +elm_naviframe_item_promote(Elm_Naviframe_Item *obj) +{ + elm_obj_naviframe_item_promote(obj); +} + +EAPI void +elm_naviframe_item_pop_cb_set(Elm_Naviframe_Item *obj, Elm_Naviframe_Item_Pop_Cb func, void *data) +{ + elm_obj_naviframe_item_pop_cb_set(obj, func, data); +} diff --git a/src/lib/elementary/elm_naviframe_item_eo.legacy.h b/src/lib/elementary/elm_naviframe_item_eo.legacy.h new file mode 100644 index 0000000000..70be465dc8 --- /dev/null +++ b/src/lib/elementary/elm_naviframe_item_eo.legacy.h @@ -0,0 +1,92 @@ +#ifndef _ELM_NAVIFRAME_ITEM_EO_LEGACY_H_ +#define _ELM_NAVIFRAME_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_NAVIFRAME_ITEM_EO_CLASS_TYPE +#define _ELM_NAVIFRAME_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Naviframe_Item; + +#endif + +#ifndef _ELM_NAVIFRAME_ITEM_EO_TYPES +#define _ELM_NAVIFRAME_ITEM_EO_TYPES + + +#endif + +/** + * @brief Pop the top item and delete the items between the top and the above + * one on the given item. + * + * The items between the top and the given item will be deleted first, and then + * the top item will be popped at last. + * + * @warning The pop callback function set by elm_naviframe_item_pop_cb_set is + * not called for items between the top item and the destination item since + * those items are deleted without being popped. + * @param[in] obj The object. + * + * @ingroup Elm_Naviframe_Item_Group + */ +EAPI void elm_naviframe_item_pop_to(Elm_Naviframe_Item *obj); + +/** + * @brief Get a value whether title area is enabled or not. + * + * @param[in] obj The object. + * + * @return If @c true, title area will be enabled, disabled otherwise + * + * @ingroup Elm_Naviframe_Item_Group + */ +EAPI Eina_Bool elm_naviframe_item_title_enabled_get(const Elm_Naviframe_Item *obj); + +/** + * @brief Enable/Disable the title area with transition effect + * + * When the title area is disabled, then the controls would be hidden so as to + * expand the content area to full-size. + * + * @param[in] obj The object. + * @param[in] enable If @c true, title area will be enabled, disabled otherwise + * @param[in] transition If @c true, transition effect of the title will be + * visible, invisible otherwise + * + * @ingroup Elm_Naviframe_Item_Group + */ +EAPI void elm_naviframe_item_title_enabled_set(Elm_Naviframe_Item *obj, Eina_Bool enable, Eina_Bool transition); + +/** + * @brief Promote an item already in the naviframe stack to the top of the + * stack. + * + * This will take the indicated item and promote it to the top of the stack as + * if it had been pushed there. The item must already be inside the naviframe + * stack to work. + * @param[in] obj The object. + * + * @ingroup Elm_Naviframe_Item_Group + */ +EAPI void elm_naviframe_item_promote(Elm_Naviframe_Item *obj); + +/** + * @brief Set a function to be called when an item of the naviframe is going to + * be popped. + * + * @warning Don't set "clicked" callback to the prev button additionally if the + * function does an exact same logic with this @c func. When hardware back key + * is pressed then both callbacks will be called. Warning: The pop callback + * function is called only if the item is popped. Therefore, the pop callback + * function is not called if the item is deleted without being popped. + * + * @param[in] obj The object. + * @param[in] func The callback function. + * @param[in] data Data to be passed to func call. + * + * @since 1.8 + * + * @ingroup Elm_Naviframe_Item_Group + */ +EAPI void elm_naviframe_item_pop_cb_set(Elm_Naviframe_Item *obj, Elm_Naviframe_Item_Pop_Cb func, void *data); + +#endif diff --git a/src/lib/elementary/elm_naviframe_part.eo b/src/lib/elementary/elm_naviframe_part.eo index 4f17c4ccba..e253f11523 100644 --- a/src/lib/elementary/elm_naviframe_part.eo +++ b/src/lib/elementary/elm_naviframe_part.eo @@ -1,4 +1,4 @@ -class Elm.Naviframe.Part extends Efl.Ui.Layout_Part_Legacy +class @beta Elm.Naviframe.Part extends Efl.Ui.Layout_Part_Legacy { [[Elementary naviframe internal part class]] data: null; diff --git a/src/lib/elementary/elm_need.h b/src/lib/elementary/elm_need.h index 84bba748c3..ad290dbf04 100644 --- a/src/lib/elementary/elm_need.h +++ b/src/lib/elementary/elm_need.h @@ -58,7 +58,7 @@ EAPI Eina_Bool elm_need_e_dbus(void) EINA_DEPRECATED; /** * Request that your elementary application needs eldbus * - * This initializes the eldbus (aka v2) library when called and if + * This initializes the eldbus (a.k.a. v2) library when called and if * support exists it returns @c EINA_TRUE, otherwise returns * @c EINA_FALSE. This must be called before any eldbus calls. * diff --git a/src/lib/elementary/elm_notify.c b/src/lib/elementary/elm_notify.c index c8902647c8..0f1bbd37f4 100644 --- a/src/lib/elementary/elm_notify.c +++ b/src/lib/elementary/elm_notify.c @@ -20,7 +20,7 @@ #define MY_CLASS_NAME "Elm_Notify" #define MY_CLASS_NAME_LEGACY "elm_notify" -static Efl_Ui_Theme_Apply_Result +static Eina_Error _notify_theme_apply(Evas_Object *obj) { const char *style = elm_widget_style_get(obj); @@ -139,16 +139,20 @@ _sizing_eval(Evas_Object *obj) evas_object_geometry_set(obj, x, y, w, h); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_notify_efl_ui_widget_theme_apply(Eo *obj, Elm_Notify_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; + Eina_Error notify_theme_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _mirrored_set(obj, efl_ui_mirrored_get(obj)); - int_ret &= _notify_theme_apply(obj); + notify_theme_ret = _notify_theme_apply(obj); + if (notify_theme_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) + return notify_theme_ret; + if (sd->block_events) _block_events_theme_apply(obj); edje_object_scale_set @@ -156,7 +160,11 @@ _elm_notify_efl_ui_widget_theme_apply(Eo *obj, Elm_Notify_Data *sd) _sizing_eval(obj); - return int_ret; + if ((int_ret == EFL_UI_THEME_APPLY_ERROR_DEFAULT) || + (notify_theme_ret == EFL_UI_THEME_APPLY_ERROR_DEFAULT)) + return EFL_UI_THEME_APPLY_ERROR_DEFAULT; + + return EFL_UI_THEME_APPLY_ERROR_NONE; } /* Legacy compat. Note that notify has no text parts in the default theme... */ @@ -374,6 +382,7 @@ _elm_notify_content_set(Eo *obj, Elm_Notify_Data *sd, const char *part, Evas_Obj _changed_size_hints_cb, obj); edje_object_part_swallow(sd->notify, "elm.swallow.content", content); } + efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, content); _calc(obj); @@ -399,6 +408,7 @@ _elm_notify_content_unset(Eo *obj, Elm_Notify_Data *sd, const char *part) content = sd->content; _elm_widget_sub_object_redirect_to_top(obj, sd->content); edje_object_part_unswallow(sd->notify, content); + efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, NULL); return content; } @@ -439,7 +449,6 @@ EOLIAN static void _elm_notify_efl_canvas_group_group_add(Eo *obj, Elm_Notify_Data *priv) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->allow_events = EINA_TRUE; @@ -472,26 +481,9 @@ elm_notify_add(Evas_Object *parent) return elm_legacy_add(MY_CLASS, parent); } -EOLIAN static Eo * -_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_object_role_set(obj, EFL_ACCESS_ROLE_NOTIFICATION); - return obj; -} - -EAPI void -elm_notify_parent_set(Evas_Object *obj, - Evas_Object *parent) -{ - ELM_NOTIFY_CHECK(obj); - efl_ui_widget_parent_set(obj, parent); -} - -EOLIAN static void -_elm_notify_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Notify_Data *sd, Evas_Object *parent) +static void +_parent_setup(Eo *obj, Elm_Notify_Data *sd, Evas_Object *parent) { if (sd->parent) { @@ -528,6 +520,27 @@ _elm_notify_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Notify_Data *sd, Evas_O _calc(obj); } +EOLIAN static Eo * +_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_object_role_set(obj, EFL_ACCESS_ROLE_NOTIFICATION); + _parent_setup(obj, sd, efl_parent_get(obj)); + + return obj; +} + +EAPI void +elm_notify_parent_set(Evas_Object *obj, + Evas_Object *parent) +{ + ELM_NOTIFY_CHECK(obj); + ELM_NOTIFY_DATA_GET(obj, sd); + efl_ui_widget_sub_object_add(parent, obj); + _parent_setup(obj, sd, parent); +} + EAPI Evas_Object * elm_notify_parent_get(const Evas_Object *obj) { @@ -537,12 +550,6 @@ elm_notify_parent_get(const Evas_Object *obj) return ret; } -EOLIAN static Evas_Object* -_elm_notify_efl_ui_widget_widget_parent_get(const Eo *obj EINA_UNUSED, Elm_Notify_Data *sd) -{ - return sd->parent; -} - EINA_DEPRECATED EAPI void elm_notify_orient_set(Evas_Object *obj, Elm_Notify_Orient orient) @@ -733,4 +740,4 @@ _elm_notify_part_efl_ui_l10n_l10n_text_set(Eo *obj, void *_pd EINA_UNUSED, const ELM_PART_CONTENT_DEFAULT_OPS(elm_notify), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_notify) -#include "elm_notify.eo.c" +#include "elm_notify_eo.c" diff --git a/src/lib/elementary/elm_notify.eo b/src/lib/elementary/elm_notify.eo deleted file mode 100644 index 04d1263bcf..0000000000 --- a/src/lib/elementary/elm_notify.eo +++ /dev/null @@ -1,98 +0,0 @@ -class Elm.Notify extends Efl.Ui.Widget implements Efl.Ui.Focus.Layer, Efl.Content, Efl.Ui.Legacy -{ - [[Elementary notification class]] - legacy_prefix: elm_notify; - eo_prefix: elm_obj_notify; - event_prefix: elm_notify; - methods { - @property align { - set { - [[Set the alignment of the notify object - - Sets the alignment in which the notify will appear in its parent. - - Note: To fill the notify box in the parent area, please pass the - ELM_NOTIFY_ALIGN_FILL to horizontal and vertical. - - @since 1.8 - ]] - } - get { - [[Get the alignment of the notify object - - @since 1.8 - ]] - } - values { - horizontal: double; [[The horizontal alignment of the notification]] - vertical: double; [[The vertical alignment of the notification]] - } - } - @property allow_events { - set { - [[Sets whether events should be passed to by a click outside - its area. - - When true if the user clicks outside the window the events will - be caught by the others widgets, else the events are blocked. - - Note: The default value is true. - ]] - } - get { - [[Return true if events are allowed below the notify object.]] - } - values { - allow: bool; [[$true if events are allowed, $false otherwise]] - } - } - @property timeout { - set { - [[Set the time interval after which the notify window is going to - be hidden. - - This function sets a timeout and starts the timer controlling - when the notify is hidden. Since calling evas_object_show() on - a notify restarts the timer controlling when the notify is - hidden, setting this before the notify is shown will in effect - mean starting the timer when the notify is shown. - - Note: Set a value <= 0.0 to disable a running timer. - - Note: If the value > 0.0 and the notify is previously visible, - the timer will be started with this value, canceling any running - timer. - ]] - } - get { - [[Return the timeout value (in seconds)]] - } - values { - timeout: double; [[The timeout in seconds]] - } - } - dismiss { - [[Dismiss a notify object. - @since 1.17 - ]] - } - } - implements { - class.constructor; - Efl.Object.constructor; - 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_get; - } - events { - 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_eo.c b/src/lib/elementary/elm_notify_eo.c new file mode 100644 index 0000000000..b38b2a02a5 --- /dev/null +++ b/src/lib/elementary/elm_notify_eo.c @@ -0,0 +1,171 @@ +EWAPI const Efl_Event_Description _ELM_NOTIFY_EVENT_BLOCK_CLICKED = + EFL_EVENT_DESCRIPTION("block,clicked"); +EWAPI const Efl_Event_Description _ELM_NOTIFY_EVENT_TIMEOUT = + EFL_EVENT_DESCRIPTION("timeout"); +EWAPI const Efl_Event_Description _ELM_NOTIFY_EVENT_DISMISSED = + EFL_EVENT_DESCRIPTION("dismissed"); + +void _elm_notify_align_set(Eo *obj, Elm_Notify_Data *pd, double horizontal, double vertical); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_notify_align_set, EFL_FUNC_CALL(horizontal, vertical), double horizontal, double vertical); + +void _elm_notify_align_get(const Eo *obj, Elm_Notify_Data *pd, double *horizontal, double *vertical); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_notify_align_get, EFL_FUNC_CALL(horizontal, vertical), double *horizontal, double *vertical); + +void _elm_notify_allow_events_set(Eo *obj, Elm_Notify_Data *pd, Eina_Bool allow); + + +static Eina_Error +__eolian_elm_notify_allow_events_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_notify_allow_events_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_notify_allow_events_set, EFL_FUNC_CALL(allow), Eina_Bool allow); + +Eina_Bool _elm_notify_allow_events_get(const Eo *obj, Elm_Notify_Data *pd); + + +static Eina_Value +__eolian_elm_notify_allow_events_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_notify_allow_events_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_notify_allow_events_get, Eina_Bool, 0); + +void _elm_notify_timeout_set(Eo *obj, Elm_Notify_Data *pd, double timeout); + + +static Eina_Error +__eolian_elm_notify_timeout_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_notify_timeout_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_notify_timeout_set, EFL_FUNC_CALL(timeout), double timeout); + +double _elm_notify_timeout_get(const Eo *obj, Elm_Notify_Data *pd); + + +static Eina_Value +__eolian_elm_notify_timeout_get_reflect(const Eo *obj) +{ + double val = elm_obj_notify_timeout_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_notify_timeout_get, double, 0); + +void _elm_notify_dismiss(Eo *obj, Elm_Notify_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_notify_dismiss); + +Efl_Object *_elm_notify_efl_object_constructor(Eo *obj, Elm_Notify_Data *pd); + + +void _elm_notify_efl_gfx_entity_visible_set(Eo *obj, Elm_Notify_Data *pd, Eina_Bool v); + + +void _elm_notify_efl_gfx_entity_position_set(Eo *obj, Elm_Notify_Data *pd, Eina_Position2D pos); + + +void _elm_notify_efl_gfx_entity_size_set(Eo *obj, Elm_Notify_Data *pd, Eina_Size2D size); + + +Eina_Error _elm_notify_efl_ui_widget_theme_apply(Eo *obj, Elm_Notify_Data *pd); + + +Eina_Bool _elm_notify_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Notify_Data *pd, Efl_Canvas_Object *sub_obj); + + +Eina_Bool _elm_notify_efl_content_content_set(Eo *obj, Elm_Notify_Data *pd, Efl_Gfx_Entity *content); + + +Efl_Gfx_Entity *_elm_notify_efl_content_content_get(const Eo *obj, Elm_Notify_Data *pd); + + +Efl_Gfx_Entity *_elm_notify_efl_content_content_unset(Eo *obj, Elm_Notify_Data *pd); + + +Efl_Object *_elm_notify_efl_part_part_get(const Eo *obj, Elm_Notify_Data *pd, const char *name); + + +static Eina_Bool +_elm_notify_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_NOTIFY_EXTRA_OPS +#define ELM_NOTIFY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_notify_align_set, _elm_notify_align_set), + EFL_OBJECT_OP_FUNC(elm_obj_notify_align_get, _elm_notify_align_get), + EFL_OBJECT_OP_FUNC(elm_obj_notify_allow_events_set, _elm_notify_allow_events_set), + EFL_OBJECT_OP_FUNC(elm_obj_notify_allow_events_get, _elm_notify_allow_events_get), + EFL_OBJECT_OP_FUNC(elm_obj_notify_timeout_set, _elm_notify_timeout_set), + EFL_OBJECT_OP_FUNC(elm_obj_notify_timeout_get, _elm_notify_timeout_get), + EFL_OBJECT_OP_FUNC(elm_obj_notify_dismiss, _elm_notify_dismiss), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_notify_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_notify_efl_gfx_entity_visible_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_notify_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_notify_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_notify_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _elm_notify_efl_ui_widget_widget_sub_object_del), + EFL_OBJECT_OP_FUNC(efl_content_set, _elm_notify_efl_content_content_set), + EFL_OBJECT_OP_FUNC(efl_content_get, _elm_notify_efl_content_content_get), + EFL_OBJECT_OP_FUNC(efl_content_unset, _elm_notify_efl_content_content_unset), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_notify_efl_part_part_get), + ELM_NOTIFY_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"allow_events", __eolian_elm_notify_allow_events_set_reflect, __eolian_elm_notify_allow_events_get_reflect}, + {"timeout", __eolian_elm_notify_timeout_set_reflect, __eolian_elm_notify_timeout_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_notify_class_desc = { + EO_VERSION, + "Elm.Notify", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Notify_Data), + _elm_notify_class_initializer, + _elm_notify_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_notify_class_get, &_elm_notify_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_FOCUS_LAYER_MIXIN, EFL_CONTENT_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_notify_eo.legacy.c" diff --git a/src/lib/elementary/elm_notify_eo.h b/src/lib/elementary/elm_notify_eo.h new file mode 100644 index 0000000000..37b0598982 --- /dev/null +++ b/src/lib/elementary/elm_notify_eo.h @@ -0,0 +1,145 @@ +#ifndef _ELM_NOTIFY_EO_H_ +#define _ELM_NOTIFY_EO_H_ + +#ifndef _ELM_NOTIFY_EO_CLASS_TYPE +#define _ELM_NOTIFY_EO_CLASS_TYPE + +typedef Eo Elm_Notify; + +#endif + +#ifndef _ELM_NOTIFY_EO_TYPES +#define _ELM_NOTIFY_EO_TYPES + + +#endif +/** Elementary notification class + * + * @ingroup Elm_Notify + */ +#define ELM_NOTIFY_CLASS elm_notify_class_get() + +EWAPI const Efl_Class *elm_notify_class_get(void); + +/** + * @brief Set the alignment of the notify object + * + * Sets the alignment in which the notify will appear in its parent. + * + * @note To fill the notify box in the parent area, please pass the + * ELM_NOTIFY_ALIGN_FILL to horizontal and vertical. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal alignment of the notification + * @param[in] vertical The vertical alignment of the notification + * + * @since 1.8 + * + * @ingroup Elm_Notify + */ +EOAPI void elm_obj_notify_align_set(Eo *obj, double horizontal, double vertical); + +/** + * @brief Get the alignment of the notify object + * + * @param[in] obj The object. + * @param[out] horizontal The horizontal alignment of the notification + * @param[out] vertical The vertical alignment of the notification + * + * @since 1.8 + * + * @ingroup Elm_Notify + */ +EOAPI void elm_obj_notify_align_get(const Eo *obj, double *horizontal, double *vertical); + +/** + * @brief Sets whether events should be passed to by a click outside its area. + * + * When true if the user clicks outside the window the events will be caught by + * the others widgets, else the events are blocked. + * + * @note The default value is true. + * + * @param[in] obj The object. + * @param[in] allow @c true if events are allowed, @c false otherwise + * + * @ingroup Elm_Notify + */ +EOAPI void elm_obj_notify_allow_events_set(Eo *obj, Eina_Bool allow); + +/** + * @brief Return true if events are allowed below the notify object. + * + * @param[in] obj The object. + * + * @return @c true if events are allowed, @c false otherwise + * + * @ingroup Elm_Notify + */ +EOAPI Eina_Bool elm_obj_notify_allow_events_get(const Eo *obj); + +/** + * @brief Set the time interval after which the notify window is going to be + * hidden. + * + * This function sets a timeout and starts the timer controlling when the + * notify is hidden. Since calling evas_object_show() on a notify restarts the + * timer controlling when the notify is hidden, setting this before the notify + * is shown will in effect mean starting the timer when the notify is shown. + * + * @note Set a value <= 0.0 to disable a running timer. + * + * @note If the value > 0.0 and the notify is previously visible, the timer + * will be started with this value, canceling any running timer. + * + * @param[in] obj The object. + * @param[in] timeout The timeout in seconds + * + * @ingroup Elm_Notify + */ +EOAPI void elm_obj_notify_timeout_set(Eo *obj, double timeout); + +/** + * @brief Return the timeout value (in seconds) + * + * @param[in] obj The object. + * + * @return The timeout in seconds + * + * @ingroup Elm_Notify + */ +EOAPI double elm_obj_notify_timeout_get(const Eo *obj); + +/** Dismiss a notify object. + * + * @since 1.17 + * + * @ingroup Elm_Notify + */ +EOAPI void elm_obj_notify_dismiss(Eo *obj); + +EWAPI extern const Efl_Event_Description _ELM_NOTIFY_EVENT_BLOCK_CLICKED; + +/** Called when block was clicked + * + * @ingroup Elm_Notify + */ +#define ELM_NOTIFY_EVENT_BLOCK_CLICKED (&(_ELM_NOTIFY_EVENT_BLOCK_CLICKED)) + +EWAPI extern const Efl_Event_Description _ELM_NOTIFY_EVENT_TIMEOUT; + +/** Called when notify timed out + * + * @ingroup Elm_Notify + */ +#define ELM_NOTIFY_EVENT_TIMEOUT (&(_ELM_NOTIFY_EVENT_TIMEOUT)) + +EWAPI extern const Efl_Event_Description _ELM_NOTIFY_EVENT_DISMISSED; + +/** Called when notify was dismissed + * + * @ingroup Elm_Notify + */ +#define ELM_NOTIFY_EVENT_DISMISSED (&(_ELM_NOTIFY_EVENT_DISMISSED)) + +#endif diff --git a/src/lib/elementary/elm_notify_eo.legacy.c b/src/lib/elementary/elm_notify_eo.legacy.c new file mode 100644 index 0000000000..9e951a9fad --- /dev/null +++ b/src/lib/elementary/elm_notify_eo.legacy.c @@ -0,0 +1,42 @@ + +EAPI void +elm_notify_align_set(Elm_Notify *obj, double horizontal, double vertical) +{ + elm_obj_notify_align_set(obj, horizontal, vertical); +} + +EAPI void +elm_notify_align_get(const Elm_Notify *obj, double *horizontal, double *vertical) +{ + elm_obj_notify_align_get(obj, horizontal, vertical); +} + +EAPI void +elm_notify_allow_events_set(Elm_Notify *obj, Eina_Bool allow) +{ + elm_obj_notify_allow_events_set(obj, allow); +} + +EAPI Eina_Bool +elm_notify_allow_events_get(const Elm_Notify *obj) +{ + return elm_obj_notify_allow_events_get(obj); +} + +EAPI void +elm_notify_timeout_set(Elm_Notify *obj, double timeout) +{ + elm_obj_notify_timeout_set(obj, timeout); +} + +EAPI double +elm_notify_timeout_get(const Elm_Notify *obj) +{ + return elm_obj_notify_timeout_get(obj); +} + +EAPI void +elm_notify_dismiss(Elm_Notify *obj) +{ + elm_obj_notify_dismiss(obj); +} diff --git a/src/lib/elementary/elm_notify_eo.legacy.h b/src/lib/elementary/elm_notify_eo.legacy.h new file mode 100644 index 0000000000..05e2e7de70 --- /dev/null +++ b/src/lib/elementary/elm_notify_eo.legacy.h @@ -0,0 +1,114 @@ +#ifndef _ELM_NOTIFY_EO_LEGACY_H_ +#define _ELM_NOTIFY_EO_LEGACY_H_ + +#ifndef _ELM_NOTIFY_EO_CLASS_TYPE +#define _ELM_NOTIFY_EO_CLASS_TYPE + +typedef Eo Elm_Notify; + +#endif + +#ifndef _ELM_NOTIFY_EO_TYPES +#define _ELM_NOTIFY_EO_TYPES + + +#endif + +/** + * @brief Set the alignment of the notify object + * + * Sets the alignment in which the notify will appear in its parent. + * + * @note To fill the notify box in the parent area, please pass the + * ELM_NOTIFY_ALIGN_FILL to horizontal and vertical. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal alignment of the notification + * @param[in] vertical The vertical alignment of the notification + * + * @since 1.8 + * + * @ingroup Elm_Notify_Group + */ +EAPI void elm_notify_align_set(Elm_Notify *obj, double horizontal, double vertical); + +/** + * @brief Get the alignment of the notify object + * + * @param[in] obj The object. + * @param[out] horizontal The horizontal alignment of the notification + * @param[out] vertical The vertical alignment of the notification + * + * @since 1.8 + * + * @ingroup Elm_Notify_Group + */ +EAPI void elm_notify_align_get(const Elm_Notify *obj, double *horizontal, double *vertical); + +/** + * @brief Sets whether events should be passed to by a click outside its area. + * + * When true if the user clicks outside the window the events will be caught by + * the others widgets, else the events are blocked. + * + * @note The default value is true. + * + * @param[in] obj The object. + * @param[in] allow @c true if events are allowed, @c false otherwise + * + * @ingroup Elm_Notify_Group + */ +EAPI void elm_notify_allow_events_set(Elm_Notify *obj, Eina_Bool allow); + +/** + * @brief Return true if events are allowed below the notify object. + * + * @param[in] obj The object. + * + * @return @c true if events are allowed, @c false otherwise + * + * @ingroup Elm_Notify_Group + */ +EAPI Eina_Bool elm_notify_allow_events_get(const Elm_Notify *obj); + +/** + * @brief Set the time interval after which the notify window is going to be + * hidden. + * + * This function sets a timeout and starts the timer controlling when the + * notify is hidden. Since calling evas_object_show() on a notify restarts the + * timer controlling when the notify is hidden, setting this before the notify + * is shown will in effect mean starting the timer when the notify is shown. + * + * @note Set a value <= 0.0 to disable a running timer. + * + * @note If the value > 0.0 and the notify is previously visible, the timer + * will be started with this value, canceling any running timer. + * + * @param[in] obj The object. + * @param[in] timeout The timeout in seconds + * + * @ingroup Elm_Notify_Group + */ +EAPI void elm_notify_timeout_set(Elm_Notify *obj, double timeout); + +/** + * @brief Return the timeout value (in seconds) + * + * @param[in] obj The object. + * + * @return The timeout in seconds + * + * @ingroup Elm_Notify_Group + */ +EAPI double elm_notify_timeout_get(const Elm_Notify *obj); + +/** Dismiss a notify object. + * + * @since 1.17 + * + * @ingroup Elm_Notify_Group + */ +EAPI void elm_notify_dismiss(Elm_Notify *obj); + +#endif diff --git a/src/lib/elementary/elm_notify_legacy.h b/src/lib/elementary/elm_notify_legacy.h index e3547d7439..ceb39a9dfe 100644 --- a/src/lib/elementary/elm_notify_legacy.h +++ b/src/lib/elementary/elm_notify_legacy.h @@ -33,4 +33,4 @@ EAPI void elm_notify_parent_set(Evas_Object *obj, Evas_O */ EAPI Evas_Object *elm_notify_parent_get(const Evas_Object *obj); -#include "elm_notify.eo.legacy.h" \ No newline at end of file +#include "elm_notify_eo.legacy.h" \ No newline at end of file diff --git a/src/lib/elementary/elm_notify_part.eo b/src/lib/elementary/elm_notify_part.eo index cb9892fe0a..52f8000680 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 extends Efl.Ui.Widget_Part implements Efl.Content, Efl.Text, +class @beta Elm.Notify.Part extends Efl.Ui.Widget_Part implements Efl.Content, Efl.Text, Efl.Ui.L10n { [[Elementary notification internel part class]] diff --git a/src/lib/elementary/elm_object_item.h b/src/lib/elementary/elm_object_item.h index 2956ff2278..76571bf621 100644 --- a/src/lib/elementary/elm_object_item.h +++ b/src/lib/elementary/elm_object_item.h @@ -22,7 +22,7 @@ typedef Eo Elm_Object_Item; typedef void (*Elm_Object_Item_Signal_Cb)(void *data, Elm_Object_Item *it, const char *emission, const char *source); #ifndef EFL_NOLEGACY_API_SUPPORT -#include "elm_widget_item.eo.legacy.h" +#include "elm_widget_item_eo.legacy.h" #endif #define elm_object_item_content_set(it, content) elm_object_item_part_content_set((it), NULL, (content)) diff --git a/src/lib/elementary/elm_pan.eo b/src/lib/elementary/elm_pan.eo deleted file mode 100644 index 086032e0cb..0000000000 --- a/src/lib/elementary/elm_pan.eo +++ /dev/null @@ -1,58 +0,0 @@ -class Elm.Pan extends Efl.Canvas.Group -{ - [[Elementary pan class]] - legacy_prefix: elm_pan; - eo_prefix: elm_obj_pan; - event_prefix: elm_pan; - data: Elm_Pan_Smart_Data; - methods { - @property pos { - [[Position]] - set { - } - get { - } - values { - x: int; [[X coordinate]] - y: int; [[Y coordinate]] - } - } - @property content_size { - [[Content size]] - get { - } - values { - w: int; [[Width]] - h: int; [[Height]] - } - } - @property pos_min { - [[Minimal position]] - get { - } - values { - x: int; [[X coordinate]] - y: int; [[Y coordinate]] - } - } - @property pos_max { - [[Maximal position]] - get { - } - values { - x: int; [[X coordinate]] - y: int; [[Y coordinate]] - } - } - } - implements { - Efl.Object.constructor; - class.constructor; - Efl.Gfx.Entity.visible { set; } - Efl.Gfx.Entity.position { set; } - Efl.Gfx.Entity.size { set; } - } - events { - changed: void; [[Called when pan object changed]] - } -} diff --git a/src/lib/elementary/elm_pan_eo.c b/src/lib/elementary/elm_pan_eo.c new file mode 100644 index 0000000000..7214e125a8 --- /dev/null +++ b/src/lib/elementary/elm_pan_eo.c @@ -0,0 +1,76 @@ +EWAPI const Efl_Event_Description _ELM_PAN_EVENT_CHANGED = + EFL_EVENT_DESCRIPTION("changed"); + +void _elm_pan_pos_set(Eo *obj, Elm_Pan_Smart_Data *pd, int x, int y); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_pan_pos_set, EFL_FUNC_CALL(x, y), int x, int y); + +void _elm_pan_pos_get(const Eo *obj, Elm_Pan_Smart_Data *pd, int *x, int *y); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_pan_pos_get, EFL_FUNC_CALL(x, y), int *x, int *y); + +void _elm_pan_content_size_get(const Eo *obj, Elm_Pan_Smart_Data *pd, int *w, int *h); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_pan_content_size_get, EFL_FUNC_CALL(w, h), int *w, int *h); + +void _elm_pan_pos_min_get(const Eo *obj, Elm_Pan_Smart_Data *pd, int *x, int *y); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_pan_pos_min_get, EFL_FUNC_CALL(x, y), int *x, int *y); + +void _elm_pan_pos_max_get(const Eo *obj, Elm_Pan_Smart_Data *pd, int *x, int *y); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_pan_pos_max_get, EFL_FUNC_CALL(x, y), int *x, int *y); + +Efl_Object *_elm_pan_efl_object_constructor(Eo *obj, Elm_Pan_Smart_Data *pd); + + +void _elm_pan_efl_gfx_entity_visible_set(Eo *obj, Elm_Pan_Smart_Data *pd, Eina_Bool v); + + +void _elm_pan_efl_gfx_entity_position_set(Eo *obj, Elm_Pan_Smart_Data *pd, Eina_Position2D pos); + + +void _elm_pan_efl_gfx_entity_size_set(Eo *obj, Elm_Pan_Smart_Data *pd, Eina_Size2D size); + + +static Eina_Bool +_elm_pan_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_PAN_EXTRA_OPS +#define ELM_PAN_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_set, _elm_pan_pos_set), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_get, _elm_pan_pos_get), + EFL_OBJECT_OP_FUNC(elm_obj_pan_content_size_get, _elm_pan_content_size_get), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_min_get, _elm_pan_pos_min_get), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_max_get, _elm_pan_pos_max_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_pan_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_pan_efl_gfx_entity_visible_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_pan_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_pan_efl_gfx_entity_size_set), + ELM_PAN_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_pan_class_desc = { + EO_VERSION, + "Elm.Pan", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Pan_Smart_Data), + _elm_pan_class_initializer, + _elm_pan_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_pan_class_get, &_elm_pan_class_desc, EFL_CANVAS_GROUP_CLASS, NULL); + +#include "elm_pan_eo.legacy.c" diff --git a/src/lib/elementary/elm_pan_eo.h b/src/lib/elementary/elm_pan_eo.h new file mode 100644 index 0000000000..a09652a4c8 --- /dev/null +++ b/src/lib/elementary/elm_pan_eo.h @@ -0,0 +1,87 @@ +#ifndef _ELM_PAN_EO_H_ +#define _ELM_PAN_EO_H_ + +#ifndef _ELM_PAN_EO_CLASS_TYPE +#define _ELM_PAN_EO_CLASS_TYPE + +typedef Eo Elm_Pan; + +#endif + +#ifndef _ELM_PAN_EO_TYPES +#define _ELM_PAN_EO_TYPES + + +#endif +/** Elementary pan class + * + * @ingroup Elm_Pan + */ +#define ELM_PAN_CLASS elm_pan_class_get() + +EWAPI const Efl_Class *elm_pan_class_get(void); + +/** + * @brief Position + * + * @param[in] obj The object. + * @param[in] x X coordinate + * @param[in] y Y coordinate + * + * @ingroup Elm_Pan + */ +EOAPI void elm_obj_pan_pos_set(Eo *obj, int x, int y); + +/** + * @brief Position + * + * @param[in] obj The object. + * @param[out] x X coordinate + * @param[out] y Y coordinate + * + * @ingroup Elm_Pan + */ +EOAPI void elm_obj_pan_pos_get(const Eo *obj, int *x, int *y); + +/** + * @brief Content size + * + * @param[in] obj The object. + * @param[out] w Width + * @param[out] h Height + * + * @ingroup Elm_Pan + */ +EOAPI void elm_obj_pan_content_size_get(const Eo *obj, int *w, int *h); + +/** + * @brief Minimal position + * + * @param[in] obj The object. + * @param[out] x X coordinate + * @param[out] y Y coordinate + * + * @ingroup Elm_Pan + */ +EOAPI void elm_obj_pan_pos_min_get(const Eo *obj, int *x, int *y); + +/** + * @brief Maximal position + * + * @param[in] obj The object. + * @param[out] x X coordinate + * @param[out] y Y coordinate + * + * @ingroup Elm_Pan + */ +EOAPI void elm_obj_pan_pos_max_get(const Eo *obj, int *x, int *y); + +EWAPI extern const Efl_Event_Description _ELM_PAN_EVENT_CHANGED; + +/** Called when pan object changed + * + * @ingroup Elm_Pan + */ +#define ELM_PAN_EVENT_CHANGED (&(_ELM_PAN_EVENT_CHANGED)) + +#endif diff --git a/src/lib/elementary/elm_pan_eo.legacy.c b/src/lib/elementary/elm_pan_eo.legacy.c new file mode 100644 index 0000000000..0b4e98f3da --- /dev/null +++ b/src/lib/elementary/elm_pan_eo.legacy.c @@ -0,0 +1,30 @@ + +EAPI void +elm_pan_pos_set(Elm_Pan *obj, int x, int y) +{ + elm_obj_pan_pos_set(obj, x, y); +} + +EAPI void +elm_pan_pos_get(const Elm_Pan *obj, int *x, int *y) +{ + elm_obj_pan_pos_get(obj, x, y); +} + +EAPI void +elm_pan_content_size_get(const Elm_Pan *obj, int *w, int *h) +{ + elm_obj_pan_content_size_get(obj, w, h); +} + +EAPI void +elm_pan_pos_min_get(const Elm_Pan *obj, int *x, int *y) +{ + elm_obj_pan_pos_min_get(obj, x, y); +} + +EAPI void +elm_pan_pos_max_get(const Elm_Pan *obj, int *x, int *y) +{ + elm_obj_pan_pos_max_get(obj, x, y); +} diff --git a/src/lib/elementary/elm_pan_eo.legacy.h b/src/lib/elementary/elm_pan_eo.legacy.h new file mode 100644 index 0000000000..857b2e8a75 --- /dev/null +++ b/src/lib/elementary/elm_pan_eo.legacy.h @@ -0,0 +1,72 @@ +#ifndef _ELM_PAN_EO_LEGACY_H_ +#define _ELM_PAN_EO_LEGACY_H_ + +#ifndef _ELM_PAN_EO_CLASS_TYPE +#define _ELM_PAN_EO_CLASS_TYPE + +typedef Eo Elm_Pan; + +#endif + +#ifndef _ELM_PAN_EO_TYPES +#define _ELM_PAN_EO_TYPES + + +#endif + +/** + * @brief Position + * + * @param[in] obj The object. + * @param[in] x X coordinate + * @param[in] y Y coordinate + * + * @ingroup Elm_Pan_Group + */ +EAPI void elm_pan_pos_set(Elm_Pan *obj, int x, int y); + +/** + * @brief Position + * + * @param[in] obj The object. + * @param[out] x X coordinate + * @param[out] y Y coordinate + * + * @ingroup Elm_Pan_Group + */ +EAPI void elm_pan_pos_get(const Elm_Pan *obj, int *x, int *y); + +/** + * @brief Content size + * + * @param[in] obj The object. + * @param[out] w Width + * @param[out] h Height + * + * @ingroup Elm_Pan_Group + */ +EAPI void elm_pan_content_size_get(const Elm_Pan *obj, int *w, int *h); + +/** + * @brief Minimal position + * + * @param[in] obj The object. + * @param[out] x X coordinate + * @param[out] y Y coordinate + * + * @ingroup Elm_Pan_Group + */ +EAPI void elm_pan_pos_min_get(const Elm_Pan *obj, int *x, int *y); + +/** + * @brief Maximal position + * + * @param[in] obj The object. + * @param[out] x X coordinate + * @param[out] y Y coordinate + * + * @ingroup Elm_Pan_Group + */ +EAPI void elm_pan_pos_max_get(const Elm_Pan *obj, int *x, int *y); + +#endif diff --git a/src/lib/elementary/elm_panel.c b/src/lib/elementary/elm_panel.c index 675227e654..7d9e800149 100644 --- a/src/lib/elementary/elm_panel.c +++ b/src/lib/elementary/elm_panel.c @@ -216,18 +216,18 @@ _scrollable_layout_theme_set(Eo *obj, Elm_Panel_Data *sd) _access_obj_process(obj, EINA_TRUE); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_panel_efl_ui_widget_theme_apply(Eo *obj, Elm_Panel_Data *sd) { const char *str; Evas_Coord minw = 0, minh = 0; - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _mirrored_set(obj, efl_ui_mirrored_get(obj)); @@ -726,10 +726,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_efl_ui_widget_widget_event(Eo *obj, Elm_Panel_Data *pd, const Efl_Event *eo_event, Evas_Object *src) +_elm_panel_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Panel_Data *pd, const Efl_Event *eo_event, Evas_Object *src) { if (src != obj) return EINA_FALSE; - return _panel_efl_ui_widget_widget_event(obj, pd, eo_event, src); + return _panel_efl_ui_widget_widget_input_event_handler(obj, pd, eo_event, src); } static Eina_Bool @@ -830,7 +830,6 @@ _elm_panel_efl_canvas_group_group_add(Eo *obj, Elm_Panel_Data *priv) 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); priv->panel_edje = wd->resize_obj; @@ -1242,16 +1241,30 @@ _scroll_cb(Evas_Object *obj, void *data EINA_UNUSED) (obj, EFL_UI_EVENT_SCROLL, (void *) &event); } -EOLIAN static Eina_Bool -_elm_panel_efl_ui_widget_on_disabled_update(Eo *obj, Elm_Panel_Data *sd, Eina_Bool disabled) +EOLIAN static void +_elm_panel_efl_ui_widget_disabled_set(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; + efl_ui_widget_disabled_set(efl_super(obj, MY_CLASS), disabled); if (sd->scrollable) { - if (disabled && sd->callback_added) + if (efl_ui_widget_disabled_get(obj) && sd->callback_added) { + switch (sd->orient) + { + case ELM_PANEL_ORIENT_BOTTOM: + case ELM_PANEL_ORIENT_TOP: + elm_interface_scrollable_movement_block_set + (obj, EFL_UI_SCROLL_BLOCK_VERTICAL); + break; + + case ELM_PANEL_ORIENT_RIGHT: + case ELM_PANEL_ORIENT_LEFT: + elm_interface_scrollable_movement_block_set + (obj, EFL_UI_SCROLL_BLOCK_HORIZONTAL); + break; + } + evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down); evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_MOVE, @@ -1263,8 +1276,23 @@ _elm_panel_efl_ui_widget_on_disabled_update(Eo *obj, Elm_Panel_Data *sd, Eina_Bo sd->callback_added = EINA_FALSE; } - else if (!disabled && !sd->callback_added) + else if (!efl_ui_widget_disabled_get(obj) && !sd->callback_added) { + switch (sd->orient) + { + case ELM_PANEL_ORIENT_BOTTOM: + case ELM_PANEL_ORIENT_TOP: + elm_interface_scrollable_movement_block_set + (obj, EFL_UI_SCROLL_BLOCK_HORIZONTAL); + break; + + case ELM_PANEL_ORIENT_RIGHT: + case ELM_PANEL_ORIENT_LEFT: + elm_interface_scrollable_movement_block_set + (obj, EFL_UI_SCROLL_BLOCK_VERTICAL); + break; + } + evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, sd); evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_MOVE, @@ -1277,8 +1305,6 @@ _elm_panel_efl_ui_widget_on_disabled_update(Eo *obj, Elm_Panel_Data *sd, Eina_Bo sd->callback_added = EINA_TRUE; } } - - return EINA_TRUE; } EOLIAN static double @@ -1378,6 +1404,7 @@ _elm_panel_scrollable_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool scrollable) 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); } + else _scrollable_layout_theme_set(obj, sd); elm_interface_scrollable_content_set(obj, sd->scr_ly); sd->freeze = EINA_TRUE; @@ -1439,6 +1466,22 @@ _elm_panel_scrollable_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool scrollable) elm_widget_resize_object_set(obj, sd->panel_edje); + _orient_set_do(obj); + + if (sd->hidden) + { + elm_layout_signal_emit(obj, "elm,action,hide,no_animate", "elm"); + evas_object_repeat_events_set(obj, EINA_TRUE); + } + else + { + elm_layout_signal_emit(obj, "elm,action,show,no_animate", "elm"); + evas_object_repeat_events_set(obj, EINA_FALSE); + } + + elm_widget_tree_unfocusable_set(obj, sd->hidden); + edje_object_message_signal_process(sd->panel_edje); + evas_object_hide(sd->scr_ly); elm_layout_content_unset(sd->scr_ly, "elm.swallow.content"); efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"), sd->bx); @@ -1487,4 +1530,4 @@ ELM_PART_OVERRIDE_CONTENT_UNSET(elm_panel, ELM_PANEL, Elm_Panel_Data) ELM_LAYOUT_SIZING_EVAL_OPS(elm_panel), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_panel) -#include "elm_panel.eo.c" +#include "elm_panel_eo.c" diff --git a/src/lib/elementary/elm_panel.eo b/src/lib/elementary/elm_panel.eo deleted file mode 100644 index 05ae83760a..0000000000 --- a/src/lib/elementary/elm_panel.eo +++ /dev/null @@ -1,94 +0,0 @@ -enum Elm.Panel.Orient -{ - [[Panel orientation mode]] - - top, [[Panel (dis)appears from the top]] - bottom, [[Panel (dis)appears from the bottom]] - left, [[Panel (dis)appears from the left]] - right [[Panel (dis)appears from the right]] -} - -class Elm.Panel extends Efl.Ui.Layout implements Efl.Ui.Focus.Layer, Elm.Interface_Scrollable, - Efl.Access.Widget.Action, Efl.Ui.Legacy -{ - [[Elementary panel class]] - legacy_prefix: elm_panel; - eo_prefix: elm_obj_panel; - event_prefix: elm_panel; - methods { - @property orient { - set { - [[Set the orientation of the panel - - Set from where the panel will (dis)appear. - ]] - } - get { - [[Get the orientation of the panel.]] - } - values { - orient: Elm.Panel.Orient(Elm.Panel.Orient.left); [[The panel orientation.]] - } - } - @property hidden { - set { - [[Set the state of the panel.]] - } - get { - [[Get the state of the panel.]] - } - values { - hidden: bool; [[If $true, the panel will run the animation to disappear.]] - } - } - @property scrollable { - set { - [[Set the scrollability of the panel.]] - } - get { - [[Get the state of the scrollability. - - @since 1.12 - ]] - } - values { - scrollable: bool; [[The scrollable state.]] - } - } - @property scrollable_content_size { - set { - [[Set the size of the scrollable panel.]] - } - get { - [[Get the size of the scrollable panel. - - @since 1.19 - ]] - } - values { - ratio: double; [[Size ratio]] - } - } - toggle { - [[Toggle the hidden state of the panel from code]] - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Gfx.Entity.position { set; } - Efl.Gfx.Entity.size { set; } - Efl.Canvas.Group.group_member_add; - 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.Ui.I18n.mirrored { set; } - Efl.Part.part_get; - } - events { - toggled: void; [[Called when the hidden state was toggled]] - } -} diff --git a/src/lib/elementary/elm_panel_eo.c b/src/lib/elementary/elm_panel_eo.c new file mode 100644 index 0000000000..d8b60f37e6 --- /dev/null +++ b/src/lib/elementary/elm_panel_eo.c @@ -0,0 +1,210 @@ +EWAPI const Efl_Event_Description _ELM_PANEL_EVENT_TOGGLED = + EFL_EVENT_DESCRIPTION("toggled"); + +void _elm_panel_orient_set(Eo *obj, Elm_Panel_Data *pd, Elm_Panel_Orient orient); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_panel_orient_set, EFL_FUNC_CALL(orient), Elm_Panel_Orient orient); + +Elm_Panel_Orient _elm_panel_orient_get(const Eo *obj, Elm_Panel_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_panel_orient_get, Elm_Panel_Orient, 2 /* Elm.Panel.Orient.left */); + +void _elm_panel_hidden_set(Eo *obj, Elm_Panel_Data *pd, Eina_Bool hidden); + + +static Eina_Error +__eolian_elm_panel_hidden_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_panel_hidden_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_panel_hidden_set, EFL_FUNC_CALL(hidden), Eina_Bool hidden); + +Eina_Bool _elm_panel_hidden_get(const Eo *obj, Elm_Panel_Data *pd); + + +static Eina_Value +__eolian_elm_panel_hidden_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_panel_hidden_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_panel_hidden_get, Eina_Bool, 0); + +void _elm_panel_scrollable_set(Eo *obj, Elm_Panel_Data *pd, Eina_Bool scrollable); + + +static Eina_Error +__eolian_elm_panel_scrollable_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_panel_scrollable_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_panel_scrollable_set, EFL_FUNC_CALL(scrollable), Eina_Bool scrollable); + +Eina_Bool _elm_panel_scrollable_get(const Eo *obj, Elm_Panel_Data *pd); + + +static Eina_Value +__eolian_elm_panel_scrollable_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_panel_scrollable_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_panel_scrollable_get, Eina_Bool, 0); + +void _elm_panel_scrollable_content_size_set(Eo *obj, Elm_Panel_Data *pd, double ratio); + + +static Eina_Error +__eolian_elm_panel_scrollable_content_size_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_panel_scrollable_content_size_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_panel_scrollable_content_size_set, EFL_FUNC_CALL(ratio), double ratio); + +double _elm_panel_scrollable_content_size_get(const Eo *obj, Elm_Panel_Data *pd); + + +static Eina_Value +__eolian_elm_panel_scrollable_content_size_get_reflect(const Eo *obj) +{ + double val = elm_obj_panel_scrollable_content_size_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_panel_scrollable_content_size_get, double, 0); + +void _elm_panel_toggle(Eo *obj, Elm_Panel_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_panel_toggle); + +Efl_Object *_elm_panel_efl_object_constructor(Eo *obj, Elm_Panel_Data *pd); + + +void _elm_panel_efl_gfx_entity_position_set(Eo *obj, Elm_Panel_Data *pd, Eina_Position2D pos); + + +void _elm_panel_efl_gfx_entity_size_set(Eo *obj, Elm_Panel_Data *pd, Eina_Size2D size); + + +void _elm_panel_efl_canvas_group_group_member_add(Eo *obj, Elm_Panel_Data *pd, Efl_Canvas_Object *sub_obj); + + +Eina_Error _elm_panel_efl_ui_widget_theme_apply(Eo *obj, Elm_Panel_Data *pd); + + +void _elm_panel_efl_ui_widget_disabled_set(Eo *obj, Elm_Panel_Data *pd, Eina_Bool disabled); + + +void _elm_panel_efl_ui_widget_on_access_update(Eo *obj, Elm_Panel_Data *pd, Eina_Bool enable); + + +Eina_Bool _elm_panel_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Panel_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +Eina_Rect _elm_panel_efl_ui_widget_interest_region_get(const Eo *obj, Elm_Panel_Data *pd); + + +const Efl_Access_Action_Data *_elm_panel_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Panel_Data *pd); + + +void _elm_panel_efl_ui_i18n_mirrored_set(Eo *obj, Elm_Panel_Data *pd, Eina_Bool rtl); + + +Efl_Object *_elm_panel_efl_part_part_get(const Eo *obj, Elm_Panel_Data *pd, const char *name); + + +static Eina_Bool +_elm_panel_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_PANEL_EXTRA_OPS +#define ELM_PANEL_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_panel_orient_set, _elm_panel_orient_set), + EFL_OBJECT_OP_FUNC(elm_obj_panel_orient_get, _elm_panel_orient_get), + EFL_OBJECT_OP_FUNC(elm_obj_panel_hidden_set, _elm_panel_hidden_set), + EFL_OBJECT_OP_FUNC(elm_obj_panel_hidden_get, _elm_panel_hidden_get), + EFL_OBJECT_OP_FUNC(elm_obj_panel_scrollable_set, _elm_panel_scrollable_set), + EFL_OBJECT_OP_FUNC(elm_obj_panel_scrollable_get, _elm_panel_scrollable_get), + EFL_OBJECT_OP_FUNC(elm_obj_panel_scrollable_content_size_set, _elm_panel_scrollable_content_size_set), + EFL_OBJECT_OP_FUNC(elm_obj_panel_scrollable_content_size_get, _elm_panel_scrollable_content_size_get), + EFL_OBJECT_OP_FUNC(elm_obj_panel_toggle, _elm_panel_toggle), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_panel_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_panel_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_panel_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_canvas_group_member_add, _elm_panel_efl_canvas_group_group_member_add), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_panel_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_disabled_set, _elm_panel_efl_ui_widget_disabled_set), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_panel_efl_ui_widget_on_access_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_panel_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(efl_ui_widget_interest_region_get, _elm_panel_efl_ui_widget_interest_region_get), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_panel_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_ui_mirrored_set, _elm_panel_efl_ui_i18n_mirrored_set), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_panel_efl_part_part_get), + ELM_PANEL_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"hidden", __eolian_elm_panel_hidden_set_reflect, __eolian_elm_panel_hidden_get_reflect}, + {"scrollable", __eolian_elm_panel_scrollable_set_reflect, __eolian_elm_panel_scrollable_get_reflect}, + {"scrollable_content_size", __eolian_elm_panel_scrollable_content_size_set_reflect, __eolian_elm_panel_scrollable_content_size_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_panel_class_desc = { + EO_VERSION, + "Elm.Panel", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Panel_Data), + _elm_panel_class_initializer, + _elm_panel_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_panel_class_get, &_elm_panel_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_LAYER_MIXIN, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_panel_eo.legacy.c" diff --git a/src/lib/elementary/elm_panel_eo.h b/src/lib/elementary/elm_panel_eo.h new file mode 100644 index 0000000000..5e045de3ef --- /dev/null +++ b/src/lib/elementary/elm_panel_eo.h @@ -0,0 +1,140 @@ +#ifndef _ELM_PANEL_EO_H_ +#define _ELM_PANEL_EO_H_ + +#ifndef _ELM_PANEL_EO_CLASS_TYPE +#define _ELM_PANEL_EO_CLASS_TYPE + +typedef Eo Elm_Panel; + +#endif + +#ifndef _ELM_PANEL_EO_TYPES +#define _ELM_PANEL_EO_TYPES + +/** Panel orientation mode + * + * @ingroup Elm_Panel + */ +typedef enum +{ + ELM_PANEL_ORIENT_TOP = 0, /**< Panel (dis)appears from the top */ + ELM_PANEL_ORIENT_BOTTOM, /**< Panel (dis)appears from the bottom */ + ELM_PANEL_ORIENT_LEFT, /**< Panel (dis)appears from the left */ + ELM_PANEL_ORIENT_RIGHT /**< Panel (dis)appears from the right */ +} Elm_Panel_Orient; + + +#endif +/** Elementary panel class + * + * @ingroup Elm_Panel + */ +#define ELM_PANEL_CLASS elm_panel_class_get() + +EWAPI const Efl_Class *elm_panel_class_get(void); + +/** + * @brief Set the orientation of the panel + * + * Set from where the panel will (dis)appear. + * + * @param[in] obj The object. + * @param[in] orient The panel orientation. + * + * @ingroup Elm_Panel + */ +EOAPI void elm_obj_panel_orient_set(Eo *obj, Elm_Panel_Orient orient); + +/** + * @brief Get the orientation of the panel. + * + * @param[in] obj The object. + * + * @return The panel orientation. + * + * @ingroup Elm_Panel + */ +EOAPI Elm_Panel_Orient elm_obj_panel_orient_get(const Eo *obj); + +/** + * @brief Set the state of the panel. + * + * @param[in] obj The object. + * @param[in] hidden If @c true, the panel will run the animation to disappear. + * + * @ingroup Elm_Panel + */ +EOAPI void elm_obj_panel_hidden_set(Eo *obj, Eina_Bool hidden); + +/** + * @brief Get the state of the panel. + * + * @param[in] obj The object. + * + * @return If @c true, the panel will run the animation to disappear. + * + * @ingroup Elm_Panel + */ +EOAPI Eina_Bool elm_obj_panel_hidden_get(const Eo *obj); + +/** + * @brief Set the scrollability of the panel. + * + * @param[in] obj The object. + * @param[in] scrollable The scrollable state. + * + * @ingroup Elm_Panel + */ +EOAPI void elm_obj_panel_scrollable_set(Eo *obj, Eina_Bool scrollable); + +/** + * @brief Get the state of the scrollability. + * + * @param[in] obj The object. + * + * @return The scrollable state. + * + * @since 1.12 + * + * @ingroup Elm_Panel + */ +EOAPI Eina_Bool elm_obj_panel_scrollable_get(const Eo *obj); + +/** + * @brief Set the size of the scrollable panel. + * + * @param[in] obj The object. + * @param[in] ratio Size ratio + * + * @ingroup Elm_Panel + */ +EOAPI void elm_obj_panel_scrollable_content_size_set(Eo *obj, double ratio); + +/** + * @brief Get the size of the scrollable panel. + * + * @param[in] obj The object. + * + * @return Size ratio + * + * @since 1.19 + * + * @ingroup Elm_Panel + */ +EOAPI double elm_obj_panel_scrollable_content_size_get(const Eo *obj); + +/** Toggle the hidden state of the panel from code + * + * @ingroup Elm_Panel + */ +EOAPI void elm_obj_panel_toggle(Eo *obj); + +EWAPI extern const Efl_Event_Description _ELM_PANEL_EVENT_TOGGLED; + +/** Called when the hidden state was toggled + * + * @ingroup Elm_Panel + */ +#define ELM_PANEL_EVENT_TOGGLED (&(_ELM_PANEL_EVENT_TOGGLED)) + +#endif diff --git a/src/lib/elementary/elm_panel_eo.legacy.c b/src/lib/elementary/elm_panel_eo.legacy.c new file mode 100644 index 0000000000..0dc4e86f01 --- /dev/null +++ b/src/lib/elementary/elm_panel_eo.legacy.c @@ -0,0 +1,54 @@ + +EAPI void +elm_panel_orient_set(Elm_Panel *obj, Elm_Panel_Orient orient) +{ + elm_obj_panel_orient_set(obj, orient); +} + +EAPI Elm_Panel_Orient +elm_panel_orient_get(const Elm_Panel *obj) +{ + return elm_obj_panel_orient_get(obj); +} + +EAPI void +elm_panel_hidden_set(Elm_Panel *obj, Eina_Bool hidden) +{ + elm_obj_panel_hidden_set(obj, hidden); +} + +EAPI Eina_Bool +elm_panel_hidden_get(const Elm_Panel *obj) +{ + return elm_obj_panel_hidden_get(obj); +} + +EAPI void +elm_panel_scrollable_set(Elm_Panel *obj, Eina_Bool scrollable) +{ + elm_obj_panel_scrollable_set(obj, scrollable); +} + +EAPI Eina_Bool +elm_panel_scrollable_get(const Elm_Panel *obj) +{ + return elm_obj_panel_scrollable_get(obj); +} + +EAPI void +elm_panel_scrollable_content_size_set(Elm_Panel *obj, double ratio) +{ + elm_obj_panel_scrollable_content_size_set(obj, ratio); +} + +EAPI double +elm_panel_scrollable_content_size_get(const Elm_Panel *obj) +{ + return elm_obj_panel_scrollable_content_size_get(obj); +} + +EAPI void +elm_panel_toggle(Elm_Panel *obj) +{ + elm_obj_panel_toggle(obj); +} diff --git a/src/lib/elementary/elm_panel_eo.legacy.h b/src/lib/elementary/elm_panel_eo.legacy.h new file mode 100644 index 0000000000..d6b8b49d7a --- /dev/null +++ b/src/lib/elementary/elm_panel_eo.legacy.h @@ -0,0 +1,125 @@ +#ifndef _ELM_PANEL_EO_LEGACY_H_ +#define _ELM_PANEL_EO_LEGACY_H_ + +#ifndef _ELM_PANEL_EO_CLASS_TYPE +#define _ELM_PANEL_EO_CLASS_TYPE + +typedef Eo Elm_Panel; + +#endif + +#ifndef _ELM_PANEL_EO_TYPES +#define _ELM_PANEL_EO_TYPES + +/** Panel orientation mode + * + * @ingroup Elm_Panel + */ +typedef enum +{ + ELM_PANEL_ORIENT_TOP = 0, /**< Panel (dis)appears from the top */ + ELM_PANEL_ORIENT_BOTTOM, /**< Panel (dis)appears from the bottom */ + ELM_PANEL_ORIENT_LEFT, /**< Panel (dis)appears from the left */ + ELM_PANEL_ORIENT_RIGHT /**< Panel (dis)appears from the right */ +} Elm_Panel_Orient; + + +#endif + +/** + * @brief Set the orientation of the panel + * + * Set from where the panel will (dis)appear. + * + * @param[in] obj The object. + * @param[in] orient The panel orientation. + * + * @ingroup Elm_Panel_Group + */ +EAPI void elm_panel_orient_set(Elm_Panel *obj, Elm_Panel_Orient orient); + +/** + * @brief Get the orientation of the panel. + * + * @param[in] obj The object. + * + * @return The panel orientation. + * + * @ingroup Elm_Panel_Group + */ +EAPI Elm_Panel_Orient elm_panel_orient_get(const Elm_Panel *obj); + +/** + * @brief Set the state of the panel. + * + * @param[in] obj The object. + * @param[in] hidden If @c true, the panel will run the animation to disappear. + * + * @ingroup Elm_Panel_Group + */ +EAPI void elm_panel_hidden_set(Elm_Panel *obj, Eina_Bool hidden); + +/** + * @brief Get the state of the panel. + * + * @param[in] obj The object. + * + * @return If @c true, the panel will run the animation to disappear. + * + * @ingroup Elm_Panel_Group + */ +EAPI Eina_Bool elm_panel_hidden_get(const Elm_Panel *obj); + +/** + * @brief Set the scrollability of the panel. + * + * @param[in] obj The object. + * @param[in] scrollable The scrollable state. + * + * @ingroup Elm_Panel_Group + */ +EAPI void elm_panel_scrollable_set(Elm_Panel *obj, Eina_Bool scrollable); + +/** + * @brief Get the state of the scrollability. + * + * @param[in] obj The object. + * + * @return The scrollable state. + * + * @since 1.12 + * + * @ingroup Elm_Panel_Group + */ +EAPI Eina_Bool elm_panel_scrollable_get(const Elm_Panel *obj); + +/** + * @brief Set the size of the scrollable panel. + * + * @param[in] obj The object. + * @param[in] ratio Size ratio + * + * @ingroup Elm_Panel_Group + */ +EAPI void elm_panel_scrollable_content_size_set(Elm_Panel *obj, double ratio); + +/** + * @brief Get the size of the scrollable panel. + * + * @param[in] obj The object. + * + * @return Size ratio + * + * @since 1.19 + * + * @ingroup Elm_Panel_Group + */ +EAPI double elm_panel_scrollable_content_size_get(const Elm_Panel *obj); + +/** Toggle the hidden state of the panel from code + * + * @ingroup Elm_Panel_Group + */ +EAPI void elm_panel_toggle(Elm_Panel *obj); + +#endif diff --git a/src/lib/elementary/elm_panel_legacy.h b/src/lib/elementary/elm_panel_legacy.h index 33513fc8f6..a95c31046f 100644 --- a/src/lib/elementary/elm_panel_legacy.h +++ b/src/lib/elementary/elm_panel_legacy.h @@ -9,4 +9,4 @@ */ EAPI Evas_Object *elm_panel_add(Evas_Object *parent); -#include "elm_panel.eo.legacy.h" \ No newline at end of file +#include "elm_panel_eo.legacy.h" \ No newline at end of file diff --git a/src/lib/elementary/elm_panel_part.eo b/src/lib/elementary/elm_panel_part.eo index a205b22f62..3d474c7eea 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 extends Efl.Ui.Widget_Part implements Efl.Content +class @beta Elm.Panel.Part extends Efl.Ui.Widget_Part implements Efl.Content { [[Elementary panel internal part class]] data: null; diff --git a/src/lib/elementary/elm_panes.h b/src/lib/elementary/elm_panes.h index 10eaf35e4e..9704b39c4d 100644 --- a/src/lib/elementary/elm_panes.h +++ b/src/lib/elementary/elm_panes.h @@ -54,10 +54,6 @@ * @{ */ -#ifdef EFL_EO_API_SUPPORT -#include "efl_ui_panes_eo.h" -#include "efl_ui_panes_part.eo.h" -#endif #ifndef EFL_NOLEGACY_API_SUPPORT #include "elm_panes_legacy.h" #endif diff --git a/src/lib/elementary/elm_panes_legacy.h b/src/lib/elementary/elm_panes_legacy.h index b33bbf0361..71b9d7e778 100644 --- a/src/lib/elementary/elm_panes_legacy.h +++ b/src/lib/elementary/elm_panes_legacy.h @@ -220,4 +220,4 @@ EAPI void elm_panes_content_right_min_relative_size_set(Evas_Object *obj, double */ EAPI double elm_panes_content_right_min_relative_size_get(const Evas_Object *obj); -#include "efl_ui_panes.eo.legacy.h" +#include "efl_ui_panes_eo.legacy.h" diff --git a/src/lib/elementary/elm_photo.c b/src/lib/elementary/elm_photo.c index ea83e27915..92d9aed828 100644 --- a/src/lib/elementary/elm_photo.c +++ b/src/lib/elementary/elm_photo.c @@ -8,8 +8,8 @@ #include "elm_priv.h" #include "elm_widget_photo.h" -#include "elm_photo.eo.h" -#include "elm_icon.eo.h" +#include "elm_photo_eo.h" +#include "elm_icon_eo.h" #define MY_CLASS ELM_PHOTO_CLASS @@ -49,14 +49,14 @@ _sizing_eval(Evas_Object *obj) evas_object_size_hint_max_set(obj, maxw, maxh); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_photo_efl_ui_widget_theme_apply(Eo *obj, Elm_Photo_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; 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_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; edje_object_mirrored_set (wd->resize_obj, efl_ui_mirrored_get(obj)); @@ -74,6 +74,20 @@ _elm_photo_efl_ui_widget_theme_apply(Eo *obj, Elm_Photo_Data *sd) return int_ret; } +EOLIAN static void +_elm_photo_efl_ui_draggable_drag_target_set(Eo *obj EINA_UNUSED, + Elm_Photo_Data *pd EINA_UNUSED, + Eina_Bool set EINA_UNUSED) +{ +} + +EOLIAN static Eina_Bool +_elm_photo_efl_ui_draggable_drag_target_get(const Eo *obj EINA_UNUSED, + Elm_Photo_Data *pd EINA_UNUSED) +{ + return EINA_FALSE; +} + static void _icon_move_resize_cb(void *data, Evas *e EINA_UNUSED, @@ -248,7 +262,6 @@ _elm_photo_efl_canvas_group_group_add(Eo *obj, Elm_Photo_Data *priv) 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_FALSE); @@ -300,6 +313,17 @@ elm_photo_add(Evas_Object *parent) return elm_legacy_add(MY_CLASS, parent); } +EOLIAN static Eo * +_elm_photo_efl_object_finalize(Eo *obj, Elm_Photo_Data *sd) +{ + obj = efl_finalize(efl_super(obj, MY_CLASS)); + if (!obj) return NULL; + if (efl_file_get(sd->icon) || efl_file_mmap_get(sd->icon)) + efl_file_load(sd->icon); + + return obj; +} + EOLIAN static Eo * _elm_photo_efl_object_constructor(Eo *obj, Elm_Photo_Data *_pd EINA_UNUSED) { @@ -311,21 +335,61 @@ _elm_photo_efl_object_constructor(Eo *obj, Elm_Photo_Data *_pd EINA_UNUSED) return obj; } -EOLIAN static Eina_Bool -_elm_photo_efl_file_file_set(Eo *obj, Elm_Photo_Data *sd, const char *file, const char *key EINA_UNUSED) +EOLIAN static Eina_Error +_elm_photo_efl_file_load(Eo *obj, Elm_Photo_Data *sd) { + const char *file = efl_file_get(sd->icon); + Eina_Error err = 0; if (!file) { if (!elm_icon_standard_set(sd->icon, "no_photo")) return EINA_FALSE; } else { - if (!elm_image_file_set(sd->icon, file, NULL)) return EINA_FALSE; + if (efl_file_loaded_get(obj)) return 0; + err = efl_file_load(sd->icon); + if (err) return err; } _sizing_eval(obj); - return EINA_TRUE; + return 0; +} + +EOLIAN static const Eina_File * +_elm_photo_efl_file_mmap_get(const Eo *obj EINA_UNUSED, Elm_Photo_Data *sd) +{ + return efl_file_mmap_get(sd->icon); +} + +EOLIAN static Eina_Error +_elm_photo_efl_file_mmap_set(Eo *obj EINA_UNUSED, Elm_Photo_Data *sd, const Eina_File *file) +{ + return efl_file_mmap_set(sd->icon, file); +} + +EOLIAN static Eina_Error +_elm_photo_efl_file_file_set(Eo *obj EINA_UNUSED, Elm_Photo_Data *sd, const char *file) +{ + return efl_file_set(sd->icon, file); +} + +EOLIAN static const char * +_elm_photo_efl_file_file_get(const Eo *obj EINA_UNUSED, Elm_Photo_Data *sd) +{ + return efl_file_get(sd->icon); +} + +EOLIAN static void +_elm_photo_efl_file_key_set(Eo *obj EINA_UNUSED, Elm_Photo_Data *sd, const char *key) +{ + return efl_file_key_set(sd->icon, key); +} + +EOLIAN static const char * +_elm_photo_efl_file_key_get(const Eo *obj EINA_UNUSED, Elm_Photo_Data *sd) +{ + return efl_file_key_get(sd->icon); } static void @@ -337,7 +401,7 @@ _elm_photo_class_constructor(Efl_Class *klass) EAPI Eina_Bool elm_photo_file_set(Eo *obj, const char *file) { - return efl_file_set((Eo *) obj, file, NULL); + return efl_file_simple_load((Eo *) obj, file, NULL); } /* Legacy deprecated functions */ @@ -428,4 +492,4 @@ elm_photo_thumb_set(Evas_Object *obj, const char *file, const char *group) #define ELM_PHOTO_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_photo) -#include "elm_photo.eo.c" +#include "elm_photo_eo.c" diff --git a/src/lib/elementary/elm_photo.eo b/src/lib/elementary/elm_photo.eo deleted file mode 100644 index 790382d756..0000000000 --- a/src/lib/elementary/elm_photo.eo +++ /dev/null @@ -1,13 +0,0 @@ -class Elm.Photo extends Efl.Ui.Widget implements Efl.File, Efl.Ui.Clickable, Efl.Ui.Draggable, - Efl.Ui.Legacy -{ - [[Elementary photo class]] - legacy_prefix: elm_photo; - eo_prefix: elm_obj_photo; - implements { - class.constructor; - Efl.Object.constructor; - Efl.File.file { set; } - Efl.Ui.Widget.theme_apply; - } -} diff --git a/src/lib/elementary/elm_photo_eo.c b/src/lib/elementary/elm_photo_eo.c new file mode 100644 index 0000000000..02b8a28fcf --- /dev/null +++ b/src/lib/elementary/elm_photo_eo.c @@ -0,0 +1,79 @@ + +Efl_Object *_elm_photo_efl_object_constructor(Eo *obj, Elm_Photo_Data *pd); + + +Efl_Object *_elm_photo_efl_object_finalize(Eo *obj, Elm_Photo_Data *pd); + + +Eina_Error _elm_photo_efl_file_file_set(Eo *obj, Elm_Photo_Data *pd, const char *file); + + +const char *_elm_photo_efl_file_file_get(const Eo *obj, Elm_Photo_Data *pd); + + +void _elm_photo_efl_file_key_set(Eo *obj, Elm_Photo_Data *pd, const char *key); + + +const char *_elm_photo_efl_file_key_get(const Eo *obj, Elm_Photo_Data *pd); + + +Eina_Error _elm_photo_efl_file_mmap_set(Eo *obj, Elm_Photo_Data *pd, const Eina_File *f); + + +const Eina_File *_elm_photo_efl_file_mmap_get(const Eo *obj, Elm_Photo_Data *pd); + + +Eina_Error _elm_photo_efl_file_load(Eo *obj, Elm_Photo_Data *pd); + + +Eina_Error _elm_photo_efl_ui_widget_theme_apply(Eo *obj, Elm_Photo_Data *pd); + + +void _elm_photo_efl_ui_draggable_drag_target_set(Eo *obj, Elm_Photo_Data *pd, Eina_Bool set); + + +Eina_Bool _elm_photo_efl_ui_draggable_drag_target_get(const Eo *obj, Elm_Photo_Data *pd); + + +static Eina_Bool +_elm_photo_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_PHOTO_EXTRA_OPS +#define ELM_PHOTO_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_photo_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_finalize, _elm_photo_efl_object_finalize), + EFL_OBJECT_OP_FUNC(efl_file_set, _elm_photo_efl_file_file_set), + EFL_OBJECT_OP_FUNC(efl_file_get, _elm_photo_efl_file_file_get), + EFL_OBJECT_OP_FUNC(efl_file_key_set, _elm_photo_efl_file_key_set), + EFL_OBJECT_OP_FUNC(efl_file_key_get, _elm_photo_efl_file_key_get), + EFL_OBJECT_OP_FUNC(efl_file_mmap_set, _elm_photo_efl_file_mmap_set), + EFL_OBJECT_OP_FUNC(efl_file_mmap_get, _elm_photo_efl_file_mmap_get), + EFL_OBJECT_OP_FUNC(efl_file_load, _elm_photo_efl_file_load), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_photo_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_draggable_drag_target_set, _elm_photo_efl_ui_draggable_drag_target_set), + EFL_OBJECT_OP_FUNC(efl_ui_draggable_drag_target_get, _elm_photo_efl_ui_draggable_drag_target_get), + ELM_PHOTO_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_photo_class_desc = { + EO_VERSION, + "Elm.Photo", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Photo_Data), + _elm_photo_class_initializer, + _elm_photo_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_photo_class_get, &_elm_photo_class_desc, EFL_UI_WIDGET_CLASS, EFL_FILE_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_DRAGGABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_photo_eo.h b/src/lib/elementary/elm_photo_eo.h new file mode 100644 index 0000000000..50cdb235b5 --- /dev/null +++ b/src/lib/elementary/elm_photo_eo.h @@ -0,0 +1,24 @@ +#ifndef _ELM_PHOTO_EO_H_ +#define _ELM_PHOTO_EO_H_ + +#ifndef _ELM_PHOTO_EO_CLASS_TYPE +#define _ELM_PHOTO_EO_CLASS_TYPE + +typedef Eo Elm_Photo; + +#endif + +#ifndef _ELM_PHOTO_EO_TYPES +#define _ELM_PHOTO_EO_TYPES + + +#endif +/** Elementary photo class + * + * @ingroup Elm_Photo + */ +#define ELM_PHOTO_CLASS elm_photo_class_get() + +EWAPI const Efl_Class *elm_photo_class_get(void); + +#endif diff --git a/src/lib/elementary/elm_photo_eo.legacy.h b/src/lib/elementary/elm_photo_eo.legacy.h new file mode 100644 index 0000000000..4258afa919 --- /dev/null +++ b/src/lib/elementary/elm_photo_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_PHOTO_EO_LEGACY_H_ +#define _ELM_PHOTO_EO_LEGACY_H_ + +#ifndef _ELM_PHOTO_EO_CLASS_TYPE +#define _ELM_PHOTO_EO_CLASS_TYPE + +typedef Eo Elm_Photo; + +#endif + +#ifndef _ELM_PHOTO_EO_TYPES +#define _ELM_PHOTO_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_photo_legacy.h b/src/lib/elementary/elm_photo_legacy.h index 36005de149..3368bb7426 100644 --- a/src/lib/elementary/elm_photo_legacy.h +++ b/src/lib/elementary/elm_photo_legacy.h @@ -116,4 +116,4 @@ EAPI int elm_photo_size_get(const Evas_Object *obj); */ EAPI void elm_photo_thumb_set(Evas_Object *obj, const char *file, const char *group); -#include "elm_photo.eo.legacy.h" +#include "elm_photo_eo.legacy.h" diff --git a/src/lib/elementary/elm_photocam.h b/src/lib/elementary/elm_photocam.h index 54ffb6d463..7286366711 100644 --- a/src/lib/elementary/elm_photocam.h +++ b/src/lib/elementary/elm_photocam.h @@ -80,9 +80,6 @@ struct _Elm_Photocam_Error Eina_Bool open_error; }; -#ifdef EFL_EO_API_SUPPORT -#include "efl_ui_image_zoomable_eo.h" -#endif #ifndef EFL_NOLEGACY_API_SUPPORT #include "elm_photocam_legacy.h" #endif diff --git a/src/lib/elementary/elm_photocam_legacy.h b/src/lib/elementary/elm_photocam_legacy.h index b56f8b018b..f80d8ac49b 100644 --- a/src/lib/elementary/elm_photocam_legacy.h +++ b/src/lib/elementary/elm_photocam_legacy.h @@ -1,5 +1,3 @@ -#include "interfaces/efl_ui_zoom.eo.legacy.h" - typedef Eo Elm_Photocam; /** @@ -180,13 +178,17 @@ EAPI void elm_photocam_zoom_set(Evas_Object *obj, double zoom); */ EAPI double elm_photocam_zoom_get(const Evas_Object *obj); -typedef Efl_Ui_Zoom_Mode Elm_Photocam_Zoom_Mode; -#define ELM_PHOTOCAM_ZOOM_MODE_MANUAL EFL_UI_ZOOM_MODE_MANUAL -#define ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT EFL_UI_ZOOM_MODE_AUTO_FIT -#define ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL EFL_UI_ZOOM_MODE_AUTO_FILL -#define ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT_IN EFL_UI_ZOOM_MODE_AUTO_FIT_IN -#define ELM_PHOTOCAM_ZOOM_MODE_LAST EFL_UI_ZOOM_MODE_LAST +typedef enum +{ + ELM_PHOTOCAM_ZOOM_MODE_MANUAL = 0, /**< Zoom controlled normally by elm_photocam_zoom_set */ + ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT, /**< Zoom until photo fits in zoomable object */ + ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL, /**< Zoom until photo fills zoomable object */ + ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT_IN, /**< Zoom in until photo fits in zoomable object + */ + ELM_PHOTOCAM_ZOOM_MODE_LAST /**< Sentinel value to indicate last enum field during + * iteration */ +} Elm_Photocam_Zoom_Mode; /** * @brief Set the zoom mode @@ -232,4 +234,4 @@ EAPI Elm_Photocam_Zoom_Mode elm_photocam_zoom_mode_get(const Evas_Object *obj); */ EAPI void elm_photocam_image_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h); -#include "efl_ui_image_zoomable.eo.legacy.h" +#include "efl_ui_image_zoomable_eo.legacy.h" diff --git a/src/lib/elementary/elm_player.eo b/src/lib/elementary/elm_player.eo deleted file mode 100644 index 7876d2329f..0000000000 --- a/src/lib/elementary/elm_player.eo +++ /dev/null @@ -1,28 +0,0 @@ -class Elm.Player extends Efl.Ui.Layout implements Efl.Access.Widget.Action, Efl.Ui.Legacy -{ - [[Elementary player class]] - legacy_prefix: elm_player; - eo_prefix: elm_obj_player; - event_prefix: elm_player; - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.theme_apply; - Efl.Ui.Widget.widget_event; - Efl.Access.Widget.Action.elm_actions { get; } - Efl.Part.part_get; - } - events { - 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_player_eo.c b/src/lib/elementary/elm_player_eo.c new file mode 100644 index 0000000000..067926faf6 --- /dev/null +++ b/src/lib/elementary/elm_player_eo.c @@ -0,0 +1,73 @@ +EWAPI const Efl_Event_Description _ELM_PLAYER_EVENT_FORWARD_CLICKED = + EFL_EVENT_DESCRIPTION("forward,clicked"); +EWAPI const Efl_Event_Description _ELM_PLAYER_EVENT_INFO_CLICKED = + EFL_EVENT_DESCRIPTION("info,clicked"); +EWAPI const Efl_Event_Description _ELM_PLAYER_EVENT_NEXT_CLICKED = + EFL_EVENT_DESCRIPTION("next,clicked"); +EWAPI const Efl_Event_Description _ELM_PLAYER_EVENT_PAUSE_CLICKED = + EFL_EVENT_DESCRIPTION("pause,clicked"); +EWAPI const Efl_Event_Description _ELM_PLAYER_EVENT_PLAY_CLICKED = + EFL_EVENT_DESCRIPTION("play,clicked"); +EWAPI const Efl_Event_Description _ELM_PLAYER_EVENT_PREV_CLICKED = + EFL_EVENT_DESCRIPTION("prev,clicked"); +EWAPI const Efl_Event_Description _ELM_PLAYER_EVENT_REWIND_CLICKED = + EFL_EVENT_DESCRIPTION("rewind,clicked"); +EWAPI const Efl_Event_Description _ELM_PLAYER_EVENT_QUALITY_CLICKED = + EFL_EVENT_DESCRIPTION("quality,clicked"); +EWAPI const Efl_Event_Description _ELM_PLAYER_EVENT_EJECT_CLICKED = + EFL_EVENT_DESCRIPTION("eject,clicked"); +EWAPI const Efl_Event_Description _ELM_PLAYER_EVENT_VOLUME_CLICKED = + EFL_EVENT_DESCRIPTION("volume,clicked"); +EWAPI const Efl_Event_Description _ELM_PLAYER_EVENT_MUTE_CLICKED = + EFL_EVENT_DESCRIPTION("mute,clicked"); + +Efl_Object *_elm_player_efl_object_constructor(Eo *obj, Elm_Player_Data *pd); + + +Eina_Error _elm_player_efl_ui_widget_theme_apply(Eo *obj, Elm_Player_Data *pd); + + +Eina_Bool _elm_player_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Player_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +const Efl_Access_Action_Data *_elm_player_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Player_Data *pd); + + +Efl_Object *_elm_player_efl_part_part_get(const Eo *obj, Elm_Player_Data *pd, const char *name); + + +static Eina_Bool +_elm_player_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_PLAYER_EXTRA_OPS +#define ELM_PLAYER_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_player_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_player_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_player_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_player_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_player_efl_part_part_get), + ELM_PLAYER_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_player_class_desc = { + EO_VERSION, + "Elm.Player", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Player_Data), + _elm_player_class_initializer, + _elm_player_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_player_class_get, &_elm_player_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_player_eo.h b/src/lib/elementary/elm_player_eo.h new file mode 100644 index 0000000000..8efee210e8 --- /dev/null +++ b/src/lib/elementary/elm_player_eo.h @@ -0,0 +1,112 @@ +#ifndef _ELM_PLAYER_EO_H_ +#define _ELM_PLAYER_EO_H_ + +#ifndef _ELM_PLAYER_EO_CLASS_TYPE +#define _ELM_PLAYER_EO_CLASS_TYPE + +typedef Eo Elm_Player; + +#endif + +#ifndef _ELM_PLAYER_EO_TYPES +#define _ELM_PLAYER_EO_TYPES + + +#endif +/** Elementary player class + * + * @ingroup Elm_Player + */ +#define ELM_PLAYER_CLASS elm_player_class_get() + +EWAPI const Efl_Class *elm_player_class_get(void); + +EWAPI extern const Efl_Event_Description _ELM_PLAYER_EVENT_FORWARD_CLICKED; + +/** Called when forward was clicked + * + * @ingroup Elm_Player + */ +#define ELM_PLAYER_EVENT_FORWARD_CLICKED (&(_ELM_PLAYER_EVENT_FORWARD_CLICKED)) + +EWAPI extern const Efl_Event_Description _ELM_PLAYER_EVENT_INFO_CLICKED; + +/** Called when info was clicked + * + * @ingroup Elm_Player + */ +#define ELM_PLAYER_EVENT_INFO_CLICKED (&(_ELM_PLAYER_EVENT_INFO_CLICKED)) + +EWAPI extern const Efl_Event_Description _ELM_PLAYER_EVENT_NEXT_CLICKED; + +/** Called when next was clicked + * + * @ingroup Elm_Player + */ +#define ELM_PLAYER_EVENT_NEXT_CLICKED (&(_ELM_PLAYER_EVENT_NEXT_CLICKED)) + +EWAPI extern const Efl_Event_Description _ELM_PLAYER_EVENT_PAUSE_CLICKED; + +/** Called when pause was clicked + * + * @ingroup Elm_Player + */ +#define ELM_PLAYER_EVENT_PAUSE_CLICKED (&(_ELM_PLAYER_EVENT_PAUSE_CLICKED)) + +EWAPI extern const Efl_Event_Description _ELM_PLAYER_EVENT_PLAY_CLICKED; + +/** Called when play was clicked + * + * @ingroup Elm_Player + */ +#define ELM_PLAYER_EVENT_PLAY_CLICKED (&(_ELM_PLAYER_EVENT_PLAY_CLICKED)) + +EWAPI extern const Efl_Event_Description _ELM_PLAYER_EVENT_PREV_CLICKED; + +/** Called when previous was clicked + * + * @ingroup Elm_Player + */ +#define ELM_PLAYER_EVENT_PREV_CLICKED (&(_ELM_PLAYER_EVENT_PREV_CLICKED)) + +EWAPI extern const Efl_Event_Description _ELM_PLAYER_EVENT_REWIND_CLICKED; + +/** Called when rewind was clicked + * + * @ingroup Elm_Player + */ +#define ELM_PLAYER_EVENT_REWIND_CLICKED (&(_ELM_PLAYER_EVENT_REWIND_CLICKED)) + +EWAPI extern const Efl_Event_Description _ELM_PLAYER_EVENT_QUALITY_CLICKED; + +/** Called when quality was clicked + * + * @ingroup Elm_Player + */ +#define ELM_PLAYER_EVENT_QUALITY_CLICKED (&(_ELM_PLAYER_EVENT_QUALITY_CLICKED)) + +EWAPI extern const Efl_Event_Description _ELM_PLAYER_EVENT_EJECT_CLICKED; + +/** Called when eject was clicked + * + * @ingroup Elm_Player + */ +#define ELM_PLAYER_EVENT_EJECT_CLICKED (&(_ELM_PLAYER_EVENT_EJECT_CLICKED)) + +EWAPI extern const Efl_Event_Description _ELM_PLAYER_EVENT_VOLUME_CLICKED; + +/** Called when volume was clicked + * + * @ingroup Elm_Player + */ +#define ELM_PLAYER_EVENT_VOLUME_CLICKED (&(_ELM_PLAYER_EVENT_VOLUME_CLICKED)) + +EWAPI extern const Efl_Event_Description _ELM_PLAYER_EVENT_MUTE_CLICKED; + +/** Called when mute was clicked + * + * @ingroup Elm_Player + */ +#define ELM_PLAYER_EVENT_MUTE_CLICKED (&(_ELM_PLAYER_EVENT_MUTE_CLICKED)) + +#endif diff --git a/src/lib/elementary/elm_player_eo.legacy.h b/src/lib/elementary/elm_player_eo.legacy.h new file mode 100644 index 0000000000..dfbd115a15 --- /dev/null +++ b/src/lib/elementary/elm_player_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_PLAYER_EO_LEGACY_H_ +#define _ELM_PLAYER_EO_LEGACY_H_ + +#ifndef _ELM_PLAYER_EO_CLASS_TYPE +#define _ELM_PLAYER_EO_CLASS_TYPE + +typedef Eo Elm_Player; + +#endif + +#ifndef _ELM_PLAYER_EO_TYPES +#define _ELM_PLAYER_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_player_part.eo b/src/lib/elementary/elm_player_part.eo index ed2cbc3724..3c6c198fd9 100644 --- a/src/lib/elementary/elm_player_part.eo +++ b/src/lib/elementary/elm_player_part.eo @@ -1,4 +1,4 @@ -class Elm.Player.Part extends Efl.Ui.Layout_Part_Legacy +class @beta Elm.Player.Part extends Efl.Ui.Layout_Part_Legacy { [[Elementary player internal part class]] data: null; diff --git a/src/lib/elementary/elm_plug.c b/src/lib/elementary/elm_plug.c index 178e4a9baf..4b1f005ff0 100644 --- a/src/lib/elementary/elm_plug.c +++ b/src/lib/elementary/elm_plug.c @@ -80,12 +80,12 @@ _elm_plug_efl_ui_focus_object_on_focus_update(Eo *obj, void *sd EINA_UNUSED) return EINA_TRUE; } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_plug_efl_ui_widget_theme_apply(Eo *obj, void *sd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _sizing_eval(obj); @@ -114,7 +114,6 @@ _elm_plug_efl_canvas_group_group_add(Eo *obj, void *sd EINA_UNUSED) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj)); if (!ee) return; @@ -193,4 +192,4 @@ _elm_plug_class_constructor(Efl_Class *klass) #define ELM_PLUG_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_OPS(elm_plug) -#include "elm_plug.eo.c" +#include "elm_plug_eo.c" diff --git a/src/lib/elementary/elm_plug.eo b/src/lib/elementary/elm_plug.eo deleted file mode 100644 index 5954a8cce0..0000000000 --- a/src/lib/elementary/elm_plug.eo +++ /dev/null @@ -1,43 +0,0 @@ -class Elm.Plug extends Efl.Ui.Widget implements Efl.Ui.Clickable, Efl.Ui.Legacy -{ - [[Elementary plug class]] - legacy_prefix: elm_plug; - eo_prefix: elm_obj_plug; - event_prefix: elm_plug; - data: null; - methods { - @property image_object { - get { - [[Get the basic Evas_Image object from this object (widget). - - This function allows one to get the underlying Evas object of type - Image from this elementary widget. It can be useful to do things - like get the pixel data, save the image to a file, etc. - - Note: Be careful to not manipulate it, as it is under control of - elementary. - ]] - return: Efl.Canvas.Object; [[The inlined image object or $null.]] - } - } - connect { - [[Connect a plug widget to service provided by socket image.]] - return: bool; [[$true on success, $false on error.]] - params { - @in svcname: string; [[The service name to connect to set up by the socket.]] - @in svcnum: int; [[The service number to connect to (set up by socket).]] - @in svcsys: bool; [[Boolean to set if the service is a system one or not (set up by socket).]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.theme_apply; - Efl.Ui.Focus.Object.on_focus_update; - } - events { - image,deleted: void; [[Called when image was deleted]] - image,resized: Eina.Position2D; [[Called when image was resized]] - } -} diff --git a/src/lib/elementary/elm_plug_eo.c b/src/lib/elementary/elm_plug_eo.c new file mode 100644 index 0000000000..7dc8c4daad --- /dev/null +++ b/src/lib/elementary/elm_plug_eo.c @@ -0,0 +1,59 @@ +EWAPI const Efl_Event_Description _ELM_PLUG_EVENT_IMAGE_DELETED = + EFL_EVENT_DESCRIPTION("image,deleted"); +EWAPI const Efl_Event_Description _ELM_PLUG_EVENT_IMAGE_RESIZED = + EFL_EVENT_DESCRIPTION("image,resized"); + +Efl_Canvas_Object *_elm_plug_image_object_get(const Eo *obj, void *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_plug_image_object_get, Efl_Canvas_Object *, NULL); + +Eina_Bool _elm_plug_connect(Eo *obj, void *pd, const char *svcname, int svcnum, Eina_Bool svcsys); + +EOAPI EFL_FUNC_BODYV(elm_obj_plug_connect, Eina_Bool, 0, EFL_FUNC_CALL(svcname, svcnum, svcsys), const char *svcname, int svcnum, Eina_Bool svcsys); + +Efl_Object *_elm_plug_efl_object_constructor(Eo *obj, void *pd); + + +Eina_Error _elm_plug_efl_ui_widget_theme_apply(Eo *obj, void *pd); + + +Eina_Bool _elm_plug_efl_ui_focus_object_on_focus_update(Eo *obj, void *pd); + + +static Eina_Bool +_elm_plug_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_PLUG_EXTRA_OPS +#define ELM_PLUG_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_plug_image_object_get, _elm_plug_image_object_get), + EFL_OBJECT_OP_FUNC(elm_obj_plug_connect, _elm_plug_connect), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_plug_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_plug_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_on_focus_update, _elm_plug_efl_ui_focus_object_on_focus_update), + ELM_PLUG_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_plug_class_desc = { + EO_VERSION, + "Elm.Plug", + EFL_CLASS_TYPE_REGULAR, + 0, + _elm_plug_class_initializer, + _elm_plug_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_plug_class_get, &_elm_plug_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_plug_eo.legacy.c" diff --git a/src/lib/elementary/elm_plug_eo.h b/src/lib/elementary/elm_plug_eo.h new file mode 100644 index 0000000000..f27785ff88 --- /dev/null +++ b/src/lib/elementary/elm_plug_eo.h @@ -0,0 +1,73 @@ +#ifndef _ELM_PLUG_EO_H_ +#define _ELM_PLUG_EO_H_ + +#ifndef _ELM_PLUG_EO_CLASS_TYPE +#define _ELM_PLUG_EO_CLASS_TYPE + +typedef Eo Elm_Plug; + +#endif + +#ifndef _ELM_PLUG_EO_TYPES +#define _ELM_PLUG_EO_TYPES + + +#endif +/** Elementary plug class + * + * @ingroup Elm_Plug + */ +#define ELM_PLUG_CLASS elm_plug_class_get() + +EWAPI const Efl_Class *elm_plug_class_get(void); + +/** + * @brief Get the basic Evas_Image object from this object (widget). + * + * This function allows one to get the underlying Evas object of type Image + * from this elementary widget. It can be useful to do things like get the + * pixel data, save the image to a file, etc. + * + * @note Be careful to not manipulate it, as it is under control of elementary. + * + * @param[in] obj The object. + * + * @return The inlined image object or @c null. + * + * @ingroup Elm_Plug + */ +EOAPI Efl_Canvas_Object *elm_obj_plug_image_object_get(const Eo *obj); + +/** + * @brief Connect a plug widget to service provided by socket image. + * + * @param[in] obj The object. + * @param[in] svcname The service name to connect to set up by the socket. + * @param[in] svcnum The service number to connect to (set up by socket). + * @param[in] svcsys Boolean to set if the service is a system one or not (set + * up by socket). + * + * @return @c true on success, @c false on error. + * + * @ingroup Elm_Plug + */ +EOAPI Eina_Bool elm_obj_plug_connect(Eo *obj, const char *svcname, int svcnum, Eina_Bool svcsys); + +EWAPI extern const Efl_Event_Description _ELM_PLUG_EVENT_IMAGE_DELETED; + +/** Called when image was deleted + * + * @ingroup Elm_Plug + */ +#define ELM_PLUG_EVENT_IMAGE_DELETED (&(_ELM_PLUG_EVENT_IMAGE_DELETED)) + +EWAPI extern const Efl_Event_Description _ELM_PLUG_EVENT_IMAGE_RESIZED; + +/** Called when image was resized + * @return Eina_Position2D + * + * @ingroup Elm_Plug + */ +#define ELM_PLUG_EVENT_IMAGE_RESIZED (&(_ELM_PLUG_EVENT_IMAGE_RESIZED)) + +#endif diff --git a/src/lib/elementary/elm_plug_eo.legacy.c b/src/lib/elementary/elm_plug_eo.legacy.c new file mode 100644 index 0000000000..04e3277d85 --- /dev/null +++ b/src/lib/elementary/elm_plug_eo.legacy.c @@ -0,0 +1,12 @@ + +EAPI Efl_Canvas_Object * +elm_plug_image_object_get(const Elm_Plug *obj) +{ + return elm_obj_plug_image_object_get(obj); +} + +EAPI Eina_Bool +elm_plug_connect(Elm_Plug *obj, const char *svcname, int svcnum, Eina_Bool svcsys) +{ + return elm_obj_plug_connect(obj, svcname, svcnum, svcsys); +} diff --git a/src/lib/elementary/elm_plug_eo.legacy.h b/src/lib/elementary/elm_plug_eo.legacy.h new file mode 100644 index 0000000000..8d772cba7f --- /dev/null +++ b/src/lib/elementary/elm_plug_eo.legacy.h @@ -0,0 +1,49 @@ +#ifndef _ELM_PLUG_EO_LEGACY_H_ +#define _ELM_PLUG_EO_LEGACY_H_ + +#ifndef _ELM_PLUG_EO_CLASS_TYPE +#define _ELM_PLUG_EO_CLASS_TYPE + +typedef Eo Elm_Plug; + +#endif + +#ifndef _ELM_PLUG_EO_TYPES +#define _ELM_PLUG_EO_TYPES + + +#endif + +/** + * @brief Get the basic Evas_Image object from this object (widget). + * + * This function allows one to get the underlying Evas object of type Image + * from this elementary widget. It can be useful to do things like get the + * pixel data, save the image to a file, etc. + * + * @note Be careful to not manipulate it, as it is under control of elementary. + * + * @param[in] obj The object. + * + * @return The inlined image object or @c null. + * + * @ingroup Elm_Plug_Group + */ +EAPI Efl_Canvas_Object *elm_plug_image_object_get(const Elm_Plug *obj); + +/** + * @brief Connect a plug widget to service provided by socket image. + * + * @param[in] obj The object. + * @param[in] svcname The service name to connect to set up by the socket. + * @param[in] svcnum The service number to connect to (set up by socket). + * @param[in] svcsys Boolean to set if the service is a system one or not (set + * up by socket). + * + * @return @c true on success, @c false on error. + * + * @ingroup Elm_Plug_Group + */ +EAPI Eina_Bool elm_plug_connect(Elm_Plug *obj, const char *svcname, int svcnum, Eina_Bool svcsys); + +#endif diff --git a/src/lib/elementary/elm_plug_legacy.h b/src/lib/elementary/elm_plug_legacy.h index 5c04ec36fa..58bc85424b 100644 --- a/src/lib/elementary/elm_plug_legacy.h +++ b/src/lib/elementary/elm_plug_legacy.h @@ -8,4 +8,4 @@ */ EAPI Evas_Object *elm_plug_add(Evas_Object *parent); -#include "elm_plug.eo.legacy.h" \ No newline at end of file +#include "elm_plug_eo.legacy.h" \ No newline at end of file diff --git a/src/lib/elementary/elm_popup.eo b/src/lib/elementary/elm_popup.eo deleted file mode 100644 index eab93055c8..0000000000 --- a/src/lib/elementary/elm_popup.eo +++ /dev/null @@ -1,190 +0,0 @@ -import elm_general; - -enum Elm.Popup.Orient -{ - [[Possible orient values for popup. - - These values should be used in conjunction to elm_popup_orient_set() to - set the position in which the popup should appear(relative to its parent) - and in conjunction with elm_popup_orient_get() to know where the popup - is appearing. - ]] - - top = 0, [[Popup should appear in the top of parent, default.]] - center, [[Popup should appear in the center of parent.]] - bottom, [[Popup should appear in the bottom of parent.]] - left, [[Popup should appear in the left of parent.]] - right, [[Popup should appear in the right of parent.]] - top_left, [[Popup should appear in the top left of parent.]] - top_right, [[Popup should appear in the top right of parent.]] - bottom_left, [[Popup should appear in the bottom left of parent.]] - bottom_right, [[Notify should appear in the bottom right of parent.]] - last [[Sentinel value to indicate last enum field during iteration]] -} - - -class Elm.Popup extends Efl.Ui.Layout implements Efl.Access.Widget.Action, Efl.Ui.Legacy -{ - [[Elementary popup class]] - legacy_prefix: elm_popup; - eo_prefix: elm_obj_popup; - event_prefix: elm_popup; - methods { - @property align { - set { - [[Set the alignment of the popup object. - - Sets the alignment in which the popup will appear in its parent. - - @since 1.9 - ]] - } - get { - [[Get the alignment of the popup object. - - @since 1.9 - ]] - } - values { - horizontal: double; [[The horizontal alignment of the popup.]] - vertical: double; [[The vertical alignment of the popup.]] - } - } - @property allow_events { - set { - [[Sets whether events should be passed to by a click outside. - - Enabling allow event will remove the Blocked event area and - events will pass to the lower layer objects otherwise they - are blocked. - - Note: The default value is $false. - ]] - } - get { - [[Returns value indicating whether allow event is enabled or not.]] - } - values { - allow: bool; [[If $true, events are passed to lower objects.]] - } - } - @property content_text_wrap_type { - [[Control the wrapping type of content text packed in content - area of popup object. - ]] - set {} - get {} - values { - wrap: Elm.Wrap.Type; [[Wrapping type of type Elm_Wrap_Type.]] - } - } - @property orient { - set { - [[Sets the orientation of the popup in the parent region. - - Sets the position in which popup will appear in its parent. - By default, #ELM_POPUP_ORIENT_CENTER is set. - ]] - } - get { - [[Returns the orientation of the popup.]] - } - values { - orient: Elm.Popup.Orient; [[The orientation of the popup.]] - } - } - @property timeout { - set { - [[Sets a timeout to hide popup automatically - - This function sets a timeout and starts the timer controlling - when the popup is hidden. Since calling \@ref evas_object_show - on a popup restarts the timer controlling when it is hidden, - setting this before the popup is shown will in effect mean - starting the timer when the popup is shown. Smart signal - "timeout" is called afterwards which can be handled - if needed. - - Note: Set a value <= 0.0 to disable a running timer. - - Note: If the value > 0.0 and the popup is previously visible, - the timer will be started with this value, canceling any - running timer. - ]] - } - get { - [[Returns the timeout value set to the popup (in seconds).]] - } - values { - timeout: double; [[The timeout in seconds.]] - } - } - @property scrollable { - set { - [[Enable or disable scroller in popup content area - - Normally content area does not contain scroller. - - @since 1.15.1 - ]] - } - get { - [[Get the scrollable state of popup content area - - Normally content area does not contain scroller. - - @since 1.15.1 - ]] - } - values { - scroll: bool; [[$true if it is to be scrollable, $false otherwise.]] - } - } - item_append { - [[Add a new item to a Popup object - - Both an item list and a content could not be set at the same time! - once you add an item, the previous content will be removed. - - Warning: When the first item is appended to popup object, any - previous content of the content area is deleted. At a time, - only one of content, content-text and item(s) can be there - in a popup content area. - ]] - return: Elm.Widget.Item; [[A handle to the item added or $null on errors.]] - params { - @in label: string; [[The Label of the new item.]] - @in icon: Efl.Canvas.Object @optional; [[Icon to be set on new item.]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called when item selected.]] - @in data: const(void_ptr) @optional; [[Data passed to $func above.]] - } - } - dismiss { - [[Dismiss a Popup object. - @since 1.17 - ]] - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.theme_apply; - Efl.Ui.Widget.on_access_update; - Efl.Ui.Widget.widget_parent { set; } - Efl.Ui.L10n.translation_update; - 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.Object.state_set { get; } - Efl.Access.Object.i18n_name { get; } - Efl.Part.part_get; - } - events { - 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_eo.c b/src/lib/elementary/elm_popup_eo.c new file mode 100644 index 0000000000..928638419d --- /dev/null +++ b/src/lib/elementary/elm_popup_eo.c @@ -0,0 +1,239 @@ +EWAPI const Efl_Event_Description _ELM_POPUP_EVENT_BLOCK_CLICKED = + EFL_EVENT_DESCRIPTION("block,clicked"); +EWAPI const Efl_Event_Description _ELM_POPUP_EVENT_TIMEOUT = + EFL_EVENT_DESCRIPTION("timeout"); +EWAPI const Efl_Event_Description _ELM_POPUP_EVENT_ITEM_FOCUSED = + EFL_EVENT_DESCRIPTION("item,focused"); +EWAPI const Efl_Event_Description _ELM_POPUP_EVENT_ITEM_UNFOCUSED = + EFL_EVENT_DESCRIPTION("item,unfocused"); +EWAPI const Efl_Event_Description _ELM_POPUP_EVENT_DISMISSED = + EFL_EVENT_DESCRIPTION("dismissed"); + +void _elm_popup_align_set(Eo *obj, Elm_Popup_Data *pd, double horizontal, double vertical); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_popup_align_set, EFL_FUNC_CALL(horizontal, vertical), double horizontal, double vertical); + +void _elm_popup_align_get(const Eo *obj, Elm_Popup_Data *pd, double *horizontal, double *vertical); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_popup_align_get, EFL_FUNC_CALL(horizontal, vertical), double *horizontal, double *vertical); + +void _elm_popup_allow_events_set(Eo *obj, Elm_Popup_Data *pd, Eina_Bool allow); + + +static Eina_Error +__eolian_elm_popup_allow_events_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_popup_allow_events_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_popup_allow_events_set, EFL_FUNC_CALL(allow), Eina_Bool allow); + +Eina_Bool _elm_popup_allow_events_get(const Eo *obj, Elm_Popup_Data *pd); + + +static Eina_Value +__eolian_elm_popup_allow_events_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_popup_allow_events_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_popup_allow_events_get, Eina_Bool, 0); + +void _elm_popup_content_text_wrap_type_set(Eo *obj, Elm_Popup_Data *pd, Elm_Wrap_Type wrap); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_popup_content_text_wrap_type_set, EFL_FUNC_CALL(wrap), Elm_Wrap_Type wrap); + +Elm_Wrap_Type _elm_popup_content_text_wrap_type_get(const Eo *obj, Elm_Popup_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_popup_content_text_wrap_type_get, Elm_Wrap_Type, 0); + +void _elm_popup_orient_set(Eo *obj, Elm_Popup_Data *pd, Elm_Popup_Orient orient); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_popup_orient_set, EFL_FUNC_CALL(orient), Elm_Popup_Orient orient); + +Elm_Popup_Orient _elm_popup_orient_get(const Eo *obj, Elm_Popup_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_popup_orient_get, Elm_Popup_Orient, 0); + +void _elm_popup_timeout_set(Eo *obj, Elm_Popup_Data *pd, double timeout); + + +static Eina_Error +__eolian_elm_popup_timeout_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_popup_timeout_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_popup_timeout_set, EFL_FUNC_CALL(timeout), double timeout); + +double _elm_popup_timeout_get(const Eo *obj, Elm_Popup_Data *pd); + + +static Eina_Value +__eolian_elm_popup_timeout_get_reflect(const Eo *obj) +{ + double val = elm_obj_popup_timeout_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_popup_timeout_get, double, 0); + +void _elm_popup_scrollable_set(Eo *obj, Elm_Popup_Data *pd, Eina_Bool scroll); + + +static Eina_Error +__eolian_elm_popup_scrollable_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_popup_scrollable_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_popup_scrollable_set, EFL_FUNC_CALL(scroll), Eina_Bool scroll); + +Eina_Bool _elm_popup_scrollable_get(const Eo *obj, Elm_Popup_Data *pd); + + +static Eina_Value +__eolian_elm_popup_scrollable_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_popup_scrollable_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_popup_scrollable_get, Eina_Bool, 0); + +Elm_Widget_Item *_elm_popup_item_append(Eo *obj, Elm_Popup_Data *pd, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_popup_item_append, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(label, icon, func, data), const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +void _elm_popup_dismiss(Eo *obj, Elm_Popup_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_popup_dismiss); + +Efl_Object *_elm_popup_efl_object_constructor(Eo *obj, Elm_Popup_Data *pd); + + +Eina_Error _elm_popup_efl_ui_widget_theme_apply(Eo *obj, Elm_Popup_Data *pd); + + +void _elm_popup_efl_ui_widget_on_access_update(Eo *obj, Elm_Popup_Data *pd, Eina_Bool enable); + + +void _elm_popup_efl_ui_l10n_translation_update(Eo *obj, Elm_Popup_Data *pd); + + +Eina_Bool _elm_popup_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Popup_Data *pd, Efl_Canvas_Object *sub_obj); + + +Eina_Bool _elm_popup_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Popup_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +void _elm_popup_efl_layout_signal_signal_emit(Eo *obj, Elm_Popup_Data *pd, const char *emission, const char *source); + + +const Efl_Access_Action_Data *_elm_popup_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Popup_Data *pd); + + +Efl_Access_State_Set _elm_popup_efl_access_object_state_set_get(const Eo *obj, Elm_Popup_Data *pd); + + +const char *_elm_popup_efl_access_object_i18n_name_get(const Eo *obj, Elm_Popup_Data *pd); + + +Efl_Object *_elm_popup_efl_part_part_get(const Eo *obj, Elm_Popup_Data *pd, const char *name); + + +static Eina_Bool +_elm_popup_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_POPUP_EXTRA_OPS +#define ELM_POPUP_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_popup_align_set, _elm_popup_align_set), + EFL_OBJECT_OP_FUNC(elm_obj_popup_align_get, _elm_popup_align_get), + EFL_OBJECT_OP_FUNC(elm_obj_popup_allow_events_set, _elm_popup_allow_events_set), + EFL_OBJECT_OP_FUNC(elm_obj_popup_allow_events_get, _elm_popup_allow_events_get), + EFL_OBJECT_OP_FUNC(elm_obj_popup_content_text_wrap_type_set, _elm_popup_content_text_wrap_type_set), + EFL_OBJECT_OP_FUNC(elm_obj_popup_content_text_wrap_type_get, _elm_popup_content_text_wrap_type_get), + EFL_OBJECT_OP_FUNC(elm_obj_popup_orient_set, _elm_popup_orient_set), + EFL_OBJECT_OP_FUNC(elm_obj_popup_orient_get, _elm_popup_orient_get), + EFL_OBJECT_OP_FUNC(elm_obj_popup_timeout_set, _elm_popup_timeout_set), + EFL_OBJECT_OP_FUNC(elm_obj_popup_timeout_get, _elm_popup_timeout_get), + EFL_OBJECT_OP_FUNC(elm_obj_popup_scrollable_set, _elm_popup_scrollable_set), + EFL_OBJECT_OP_FUNC(elm_obj_popup_scrollable_get, _elm_popup_scrollable_get), + EFL_OBJECT_OP_FUNC(elm_obj_popup_item_append, _elm_popup_item_append), + EFL_OBJECT_OP_FUNC(elm_obj_popup_dismiss, _elm_popup_dismiss), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_popup_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_popup_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_popup_efl_ui_widget_on_access_update), + EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_popup_efl_ui_l10n_translation_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _elm_popup_efl_ui_widget_widget_sub_object_del), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_popup_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(efl_layout_signal_emit, _elm_popup_efl_layout_signal_signal_emit), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_popup_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_popup_efl_access_object_state_set_get), + EFL_OBJECT_OP_FUNC(efl_access_object_i18n_name_get, _elm_popup_efl_access_object_i18n_name_get), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_popup_efl_part_part_get), + ELM_POPUP_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"allow_events", __eolian_elm_popup_allow_events_set_reflect, __eolian_elm_popup_allow_events_get_reflect}, + {"timeout", __eolian_elm_popup_timeout_set_reflect, __eolian_elm_popup_timeout_get_reflect}, + {"scrollable", __eolian_elm_popup_scrollable_set_reflect, __eolian_elm_popup_scrollable_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_popup_class_desc = { + EO_VERSION, + "Elm.Popup", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Popup_Data), + _elm_popup_class_initializer, + _elm_popup_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_popup_class_get, &_elm_popup_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_popup_eo.legacy.c" diff --git a/src/lib/elementary/elm_popup_eo.h b/src/lib/elementary/elm_popup_eo.h new file mode 100644 index 0000000000..e040fe6dbc --- /dev/null +++ b/src/lib/elementary/elm_popup_eo.h @@ -0,0 +1,288 @@ +#ifndef _ELM_POPUP_EO_H_ +#define _ELM_POPUP_EO_H_ + +#ifndef _ELM_POPUP_EO_CLASS_TYPE +#define _ELM_POPUP_EO_CLASS_TYPE + +typedef Eo Elm_Popup; + +#endif + +#ifndef _ELM_POPUP_EO_TYPES +#define _ELM_POPUP_EO_TYPES + +/** + * @brief Possible orient values for popup. + * + * These values should be used in conjunction to elm_popup_orient_set() to set + * the position in which the popup should appear(relative to its parent) and in + * conjunction with elm_popup_orient_get() to know where the popup is + * appearing. + * + * @ingroup Elm_Popup + */ +typedef enum +{ + ELM_POPUP_ORIENT_TOP = 0, /**< Popup should appear in the top of parent, + * default. */ + ELM_POPUP_ORIENT_CENTER, /**< Popup should appear in the center of parent. */ + ELM_POPUP_ORIENT_BOTTOM, /**< Popup should appear in the bottom of parent. */ + ELM_POPUP_ORIENT_LEFT, /**< Popup should appear in the left of parent. */ + ELM_POPUP_ORIENT_RIGHT, /**< Popup should appear in the right of parent. */ + ELM_POPUP_ORIENT_TOP_LEFT, /**< Popup should appear in the top left of parent. + */ + ELM_POPUP_ORIENT_TOP_RIGHT, /**< Popup should appear in the top right of + * parent. */ + ELM_POPUP_ORIENT_BOTTOM_LEFT, /**< Popup should appear in the bottom left of + * parent. */ + ELM_POPUP_ORIENT_BOTTOM_RIGHT, /**< Notify should appear in the bottom right + * of parent. */ + ELM_POPUP_ORIENT_LAST /**< Sentinel value to indicate last enum field during + * iteration */ +} Elm_Popup_Orient; + + +#endif +/** Elementary popup class + * + * @ingroup Elm_Popup + */ +#define ELM_POPUP_CLASS elm_popup_class_get() + +EWAPI const Efl_Class *elm_popup_class_get(void); + +/** + * @brief Set the alignment of the popup object. + * + * Sets the alignment in which the popup will appear in its parent. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal alignment of the popup. + * @param[in] vertical The vertical alignment of the popup. + * + * @since 1.9 + * + * @ingroup Elm_Popup + */ +EOAPI void elm_obj_popup_align_set(Eo *obj, double horizontal, double vertical); + +/** + * @brief Get the alignment of the popup object. + * + * @param[in] obj The object. + * @param[out] horizontal The horizontal alignment of the popup. + * @param[out] vertical The vertical alignment of the popup. + * + * @since 1.9 + * + * @ingroup Elm_Popup + */ +EOAPI void elm_obj_popup_align_get(const Eo *obj, double *horizontal, double *vertical); + +/** + * @brief Sets whether events should be passed to by a click outside. + * + * Enabling allow event will remove the Blocked event area and events will pass + * to the lower layer objects otherwise they are blocked. + * + * @note The default value is @c false. + * + * @param[in] obj The object. + * @param[in] allow If @c true, events are passed to lower objects. + * + * @ingroup Elm_Popup + */ +EOAPI void elm_obj_popup_allow_events_set(Eo *obj, Eina_Bool allow); + +/** + * @brief Returns value indicating whether allow event is enabled or not. + * + * @param[in] obj The object. + * + * @return If @c true, events are passed to lower objects. + * + * @ingroup Elm_Popup + */ +EOAPI Eina_Bool elm_obj_popup_allow_events_get(const Eo *obj); + +/** + * @brief Control the wrapping type of content text packed in content area of + * popup object. + * + * @param[in] obj The object. + * @param[in] wrap Wrapping type of type Elm_Wrap_Type. + * + * @ingroup Elm_Popup + */ +EOAPI void elm_obj_popup_content_text_wrap_type_set(Eo *obj, Elm_Wrap_Type wrap); + +/** + * @brief Control the wrapping type of content text packed in content area of + * popup object. + * + * @param[in] obj The object. + * + * @return Wrapping type of type Elm_Wrap_Type. + * + * @ingroup Elm_Popup + */ +EOAPI Elm_Wrap_Type elm_obj_popup_content_text_wrap_type_get(const Eo *obj); + +/** + * @brief Sets the orientation of the popup in the parent region. + * + * Sets the position in which popup will appear in its parent. By default, + * #ELM_POPUP_ORIENT_CENTER is set. + * + * @param[in] obj The object. + * @param[in] orient The orientation of the popup. + * + * @ingroup Elm_Popup + */ +EOAPI void elm_obj_popup_orient_set(Eo *obj, Elm_Popup_Orient orient); + +/** + * @brief Returns the orientation of the popup. + * + * @param[in] obj The object. + * + * @return The orientation of the popup. + * + * @ingroup Elm_Popup + */ +EOAPI Elm_Popup_Orient elm_obj_popup_orient_get(const Eo *obj); + +/** + * @brief Sets a timeout to hide popup automatically + * + * This function sets a timeout and starts the timer controlling when the popup + * is hidden. Since calling @ref evas_object_show on a popup restarts the timer + * controlling when it is hidden, setting this before the popup is shown will + * in effect mean starting the timer when the popup is shown. Smart signal + * "timeout" is called afterwards which can be handled if needed. + * + * @note Set a value <= 0.0 to disable a running timer. + * + * @note If the value > 0.0 and the popup is previously visible, the timer will + * be started with this value, canceling any running timer. + * + * @param[in] obj The object. + * @param[in] timeout The timeout in seconds. + * + * @ingroup Elm_Popup + */ +EOAPI void elm_obj_popup_timeout_set(Eo *obj, double timeout); + +/** + * @brief Returns the timeout value set to the popup (in seconds). + * + * @param[in] obj The object. + * + * @return The timeout in seconds. + * + * @ingroup Elm_Popup + */ +EOAPI double elm_obj_popup_timeout_get(const Eo *obj); + +/** + * @brief Enable or disable scroller in popup content area + * + * Normally content area does not contain scroller. + * + * @param[in] obj The object. + * @param[in] scroll @c true if it is to be scrollable, @c false otherwise. + * + * @since 1.15.1 + * + * @ingroup Elm_Popup + */ +EOAPI void elm_obj_popup_scrollable_set(Eo *obj, Eina_Bool scroll); + +/** + * @brief Get the scrollable state of popup content area + * + * Normally content area does not contain scroller. + * + * @param[in] obj The object. + * + * @return @c true if it is to be scrollable, @c false otherwise. + * + * @since 1.15.1 + * + * @ingroup Elm_Popup + */ +EOAPI Eina_Bool elm_obj_popup_scrollable_get(const Eo *obj); + +/** + * @brief Add a new item to a Popup object + * + * Both an item list and a content could not be set at the same time! once you + * add an item, the previous content will be removed. + * + * @warning When the first item is appended to popup object, any previous + * content of the content area is deleted. At a time, only one of content, + * content-text and item(s) can be there in a popup content area. + * + * @param[in] obj The object. + * @param[in] label The Label of the new item. + * @param[in] icon Icon to be set on new item. + * @param[in] func Convenience function called when item selected. + * @param[in] data Data passed to @c func above. + * + * @return A handle to the item added or @c null on errors. + * + * @ingroup Elm_Popup + */ +EOAPI Elm_Widget_Item *elm_obj_popup_item_append(Eo *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +/** Dismiss a Popup object. + * + * @since 1.17 + * + * @ingroup Elm_Popup + */ +EOAPI void elm_obj_popup_dismiss(Eo *obj); + +EWAPI extern const Efl_Event_Description _ELM_POPUP_EVENT_BLOCK_CLICKED; + +/** Called when popup was clicked + * + * @ingroup Elm_Popup + */ +#define ELM_POPUP_EVENT_BLOCK_CLICKED (&(_ELM_POPUP_EVENT_BLOCK_CLICKED)) + +EWAPI extern const Efl_Event_Description _ELM_POPUP_EVENT_TIMEOUT; + +/** Called when popup timed out + * + * @ingroup Elm_Popup + */ +#define ELM_POPUP_EVENT_TIMEOUT (&(_ELM_POPUP_EVENT_TIMEOUT)) + +EWAPI extern const Efl_Event_Description _ELM_POPUP_EVENT_ITEM_FOCUSED; + +/** Called when popup got focus + * @return Efl_Object * + * + * @ingroup Elm_Popup + */ +#define ELM_POPUP_EVENT_ITEM_FOCUSED (&(_ELM_POPUP_EVENT_ITEM_FOCUSED)) + +EWAPI extern const Efl_Event_Description _ELM_POPUP_EVENT_ITEM_UNFOCUSED; + +/** Called when popup lost focus + * @return Efl_Object * + * + * @ingroup Elm_Popup + */ +#define ELM_POPUP_EVENT_ITEM_UNFOCUSED (&(_ELM_POPUP_EVENT_ITEM_UNFOCUSED)) + +EWAPI extern const Efl_Event_Description _ELM_POPUP_EVENT_DISMISSED; + +/** Called when popup was dismissed + * + * @ingroup Elm_Popup + */ +#define ELM_POPUP_EVENT_DISMISSED (&(_ELM_POPUP_EVENT_DISMISSED)) + +#endif diff --git a/src/lib/elementary/elm_popup_eo.legacy.c b/src/lib/elementary/elm_popup_eo.legacy.c new file mode 100644 index 0000000000..271f6b99ae --- /dev/null +++ b/src/lib/elementary/elm_popup_eo.legacy.c @@ -0,0 +1,84 @@ + +EAPI void +elm_popup_align_set(Elm_Popup *obj, double horizontal, double vertical) +{ + elm_obj_popup_align_set(obj, horizontal, vertical); +} + +EAPI void +elm_popup_align_get(const Elm_Popup *obj, double *horizontal, double *vertical) +{ + elm_obj_popup_align_get(obj, horizontal, vertical); +} + +EAPI void +elm_popup_allow_events_set(Elm_Popup *obj, Eina_Bool allow) +{ + elm_obj_popup_allow_events_set(obj, allow); +} + +EAPI Eina_Bool +elm_popup_allow_events_get(const Elm_Popup *obj) +{ + return elm_obj_popup_allow_events_get(obj); +} + +EAPI void +elm_popup_content_text_wrap_type_set(Elm_Popup *obj, Elm_Wrap_Type wrap) +{ + elm_obj_popup_content_text_wrap_type_set(obj, wrap); +} + +EAPI Elm_Wrap_Type +elm_popup_content_text_wrap_type_get(const Elm_Popup *obj) +{ + return elm_obj_popup_content_text_wrap_type_get(obj); +} + +EAPI void +elm_popup_orient_set(Elm_Popup *obj, Elm_Popup_Orient orient) +{ + elm_obj_popup_orient_set(obj, orient); +} + +EAPI Elm_Popup_Orient +elm_popup_orient_get(const Elm_Popup *obj) +{ + return elm_obj_popup_orient_get(obj); +} + +EAPI void +elm_popup_timeout_set(Elm_Popup *obj, double timeout) +{ + elm_obj_popup_timeout_set(obj, timeout); +} + +EAPI double +elm_popup_timeout_get(const Elm_Popup *obj) +{ + return elm_obj_popup_timeout_get(obj); +} + +EAPI void +elm_popup_scrollable_set(Elm_Popup *obj, Eina_Bool scroll) +{ + elm_obj_popup_scrollable_set(obj, scroll); +} + +EAPI Eina_Bool +elm_popup_scrollable_get(const Elm_Popup *obj) +{ + return elm_obj_popup_scrollable_get(obj); +} + +EAPI Elm_Widget_Item * +elm_popup_item_append(Elm_Popup *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_popup_item_append(obj, label, icon, func, data); +} + +EAPI void +elm_popup_dismiss(Elm_Popup *obj) +{ + elm_obj_popup_dismiss(obj); +} diff --git a/src/lib/elementary/elm_popup_eo.legacy.h b/src/lib/elementary/elm_popup_eo.legacy.h new file mode 100644 index 0000000000..debf944357 --- /dev/null +++ b/src/lib/elementary/elm_popup_eo.legacy.h @@ -0,0 +1,239 @@ +#ifndef _ELM_POPUP_EO_LEGACY_H_ +#define _ELM_POPUP_EO_LEGACY_H_ + +#ifndef _ELM_POPUP_EO_CLASS_TYPE +#define _ELM_POPUP_EO_CLASS_TYPE + +typedef Eo Elm_Popup; + +#endif + +#ifndef _ELM_POPUP_EO_TYPES +#define _ELM_POPUP_EO_TYPES + +/** + * @brief Possible orient values for popup. + * + * These values should be used in conjunction to elm_popup_orient_set() to set + * the position in which the popup should appear(relative to its parent) and in + * conjunction with elm_popup_orient_get() to know where the popup is + * appearing. + * + * @ingroup Elm_Popup + */ +typedef enum +{ + ELM_POPUP_ORIENT_TOP = 0, /**< Popup should appear in the top of parent, + * default. */ + ELM_POPUP_ORIENT_CENTER, /**< Popup should appear in the center of parent. */ + ELM_POPUP_ORIENT_BOTTOM, /**< Popup should appear in the bottom of parent. */ + ELM_POPUP_ORIENT_LEFT, /**< Popup should appear in the left of parent. */ + ELM_POPUP_ORIENT_RIGHT, /**< Popup should appear in the right of parent. */ + ELM_POPUP_ORIENT_TOP_LEFT, /**< Popup should appear in the top left of parent. + */ + ELM_POPUP_ORIENT_TOP_RIGHT, /**< Popup should appear in the top right of + * parent. */ + ELM_POPUP_ORIENT_BOTTOM_LEFT, /**< Popup should appear in the bottom left of + * parent. */ + ELM_POPUP_ORIENT_BOTTOM_RIGHT, /**< Notify should appear in the bottom right + * of parent. */ + ELM_POPUP_ORIENT_LAST /**< Sentinel value to indicate last enum field during + * iteration */ +} Elm_Popup_Orient; + + +#endif + +/** + * @brief Set the alignment of the popup object. + * + * Sets the alignment in which the popup will appear in its parent. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal alignment of the popup. + * @param[in] vertical The vertical alignment of the popup. + * + * @since 1.9 + * + * @ingroup Elm_Popup_Group + */ +EAPI void elm_popup_align_set(Elm_Popup *obj, double horizontal, double vertical); + +/** + * @brief Get the alignment of the popup object. + * + * @param[in] obj The object. + * @param[out] horizontal The horizontal alignment of the popup. + * @param[out] vertical The vertical alignment of the popup. + * + * @since 1.9 + * + * @ingroup Elm_Popup_Group + */ +EAPI void elm_popup_align_get(const Elm_Popup *obj, double *horizontal, double *vertical); + +/** + * @brief Sets whether events should be passed to by a click outside. + * + * Enabling allow event will remove the Blocked event area and events will pass + * to the lower layer objects otherwise they are blocked. + * + * @note The default value is @c false. + * + * @param[in] obj The object. + * @param[in] allow If @c true, events are passed to lower objects. + * + * @ingroup Elm_Popup_Group + */ +EAPI void elm_popup_allow_events_set(Elm_Popup *obj, Eina_Bool allow); + +/** + * @brief Returns value indicating whether allow event is enabled or not. + * + * @param[in] obj The object. + * + * @return If @c true, events are passed to lower objects. + * + * @ingroup Elm_Popup_Group + */ +EAPI Eina_Bool elm_popup_allow_events_get(const Elm_Popup *obj); + +/** + * @brief Control the wrapping type of content text packed in content area of + * popup object. + * + * @param[in] obj The object. + * @param[in] wrap Wrapping type of type Elm_Wrap_Type. + * + * @ingroup Elm_Popup_Group + */ +EAPI void elm_popup_content_text_wrap_type_set(Elm_Popup *obj, Elm_Wrap_Type wrap); + +/** + * @brief Control the wrapping type of content text packed in content area of + * popup object. + * + * @param[in] obj The object. + * + * @return Wrapping type of type Elm_Wrap_Type. + * + * @ingroup Elm_Popup_Group + */ +EAPI Elm_Wrap_Type elm_popup_content_text_wrap_type_get(const Elm_Popup *obj); + +/** + * @brief Sets the orientation of the popup in the parent region. + * + * Sets the position in which popup will appear in its parent. By default, + * #ELM_POPUP_ORIENT_CENTER is set. + * + * @param[in] obj The object. + * @param[in] orient The orientation of the popup. + * + * @ingroup Elm_Popup_Group + */ +EAPI void elm_popup_orient_set(Elm_Popup *obj, Elm_Popup_Orient orient); + +/** + * @brief Returns the orientation of the popup. + * + * @param[in] obj The object. + * + * @return The orientation of the popup. + * + * @ingroup Elm_Popup_Group + */ +EAPI Elm_Popup_Orient elm_popup_orient_get(const Elm_Popup *obj); + +/** + * @brief Sets a timeout to hide popup automatically + * + * This function sets a timeout and starts the timer controlling when the popup + * is hidden. Since calling @ref evas_object_show on a popup restarts the timer + * controlling when it is hidden, setting this before the popup is shown will + * in effect mean starting the timer when the popup is shown. Smart signal + * "timeout" is called afterwards which can be handled if needed. + * + * @note Set a value <= 0.0 to disable a running timer. + * + * @note If the value > 0.0 and the popup is previously visible, the timer will + * be started with this value, canceling any running timer. + * + * @param[in] obj The object. + * @param[in] timeout The timeout in seconds. + * + * @ingroup Elm_Popup_Group + */ +EAPI void elm_popup_timeout_set(Elm_Popup *obj, double timeout); + +/** + * @brief Returns the timeout value set to the popup (in seconds). + * + * @param[in] obj The object. + * + * @return The timeout in seconds. + * + * @ingroup Elm_Popup_Group + */ +EAPI double elm_popup_timeout_get(const Elm_Popup *obj); + +/** + * @brief Enable or disable scroller in popup content area + * + * Normally content area does not contain scroller. + * + * @param[in] obj The object. + * @param[in] scroll @c true if it is to be scrollable, @c false otherwise. + * + * @since 1.15.1 + * + * @ingroup Elm_Popup_Group + */ +EAPI void elm_popup_scrollable_set(Elm_Popup *obj, Eina_Bool scroll); + +/** + * @brief Get the scrollable state of popup content area + * + * Normally content area does not contain scroller. + * + * @param[in] obj The object. + * + * @return @c true if it is to be scrollable, @c false otherwise. + * + * @since 1.15.1 + * + * @ingroup Elm_Popup_Group + */ +EAPI Eina_Bool elm_popup_scrollable_get(const Elm_Popup *obj); + +/** + * @brief Add a new item to a Popup object + * + * Both an item list and a content could not be set at the same time! once you + * add an item, the previous content will be removed. + * + * @warning When the first item is appended to popup object, any previous + * content of the content area is deleted. At a time, only one of content, + * content-text and item(s) can be there in a popup content area. + * + * @param[in] obj The object. + * @param[in] label The Label of the new item. + * @param[in] icon Icon to be set on new item. + * @param[in] func Convenience function called when item selected. + * @param[in] data Data passed to @c func above. + * + * @return A handle to the item added or @c null on errors. + * + * @ingroup Elm_Popup_Group + */ +EAPI Elm_Widget_Item *elm_popup_item_append(Elm_Popup *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +/** Dismiss a Popup object. + * + * @since 1.17 + * + * @ingroup Elm_Popup_Group + */ +EAPI void elm_popup_dismiss(Elm_Popup *obj); + +#endif diff --git a/src/lib/elementary/elm_popup_item.eo b/src/lib/elementary/elm_popup_item.eo deleted file mode 100644 index b3a408fec4..0000000000 --- a/src/lib/elementary/elm_popup_item.eo +++ /dev/null @@ -1,15 +0,0 @@ -class Elm.Popup.Item extends Elm.Widget.Item implements Efl.Ui.Legacy -{ - [[Elementary popup item class]] - legacy_prefix: elm_popup_item; - eo_prefix: elm_obj_popup_item; - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Elm.Widget.Item.disable; - 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; - } -} diff --git a/src/lib/elementary/elm_popup_item_eo.c b/src/lib/elementary/elm_popup_item_eo.c new file mode 100644 index 0000000000..07e161b6a1 --- /dev/null +++ b/src/lib/elementary/elm_popup_item_eo.c @@ -0,0 +1,67 @@ + +Efl_Object *_elm_popup_item_efl_object_constructor(Eo *obj, Elm_Popup_Item_Data *pd); + + +void _elm_popup_item_efl_object_destructor(Eo *obj, Elm_Popup_Item_Data *pd); + + +void _elm_popup_item_elm_widget_item_disable(Eo *obj, Elm_Popup_Item_Data *pd); + + +void _elm_popup_item_elm_widget_item_signal_emit(Eo *obj, Elm_Popup_Item_Data *pd, const char *emission, const char *source); + + +void _elm_popup_item_elm_widget_item_part_text_set(Eo *obj, Elm_Popup_Item_Data *pd, const char *part, const char *label); + + +const char *_elm_popup_item_elm_widget_item_part_text_get(const Eo *obj, Elm_Popup_Item_Data *pd, const char *part); + + +void _elm_popup_item_elm_widget_item_part_content_set(Eo *obj, Elm_Popup_Item_Data *pd, const char *part, Efl_Canvas_Object *content); + + +Efl_Canvas_Object *_elm_popup_item_elm_widget_item_part_content_get(const Eo *obj, Elm_Popup_Item_Data *pd, const char *part); + + +Efl_Canvas_Object *_elm_popup_item_elm_widget_item_part_content_unset(Eo *obj, Elm_Popup_Item_Data *pd, const char *part); + + +static Eina_Bool +_elm_popup_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_POPUP_ITEM_EXTRA_OPS +#define ELM_POPUP_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_popup_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_popup_item_efl_object_destructor), + EFL_OBJECT_OP_FUNC(elm_wdg_item_disable, _elm_popup_item_elm_widget_item_disable), + EFL_OBJECT_OP_FUNC(elm_wdg_item_signal_emit, _elm_popup_item_elm_widget_item_signal_emit), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_set, _elm_popup_item_elm_widget_item_part_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_get, _elm_popup_item_elm_widget_item_part_text_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_set, _elm_popup_item_elm_widget_item_part_content_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_get, _elm_popup_item_elm_widget_item_part_content_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_unset, _elm_popup_item_elm_widget_item_part_content_unset), + ELM_POPUP_ITEM_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_popup_item_class_desc = { + EO_VERSION, + "Elm.Popup.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Popup_Item_Data), + _elm_popup_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_popup_item_class_get, &_elm_popup_item_class_desc, ELM_WIDGET_ITEM_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_popup_item_eo.h b/src/lib/elementary/elm_popup_item_eo.h new file mode 100644 index 0000000000..46d6534289 --- /dev/null +++ b/src/lib/elementary/elm_popup_item_eo.h @@ -0,0 +1,24 @@ +#ifndef _ELM_POPUP_ITEM_EO_H_ +#define _ELM_POPUP_ITEM_EO_H_ + +#ifndef _ELM_POPUP_ITEM_EO_CLASS_TYPE +#define _ELM_POPUP_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Popup_Item; + +#endif + +#ifndef _ELM_POPUP_ITEM_EO_TYPES +#define _ELM_POPUP_ITEM_EO_TYPES + + +#endif +/** Elementary popup item class + * + * @ingroup Elm_Popup_Item + */ +#define ELM_POPUP_ITEM_CLASS elm_popup_item_class_get() + +EWAPI const Efl_Class *elm_popup_item_class_get(void); + +#endif diff --git a/src/lib/elementary/elm_popup_item_eo.legacy.h b/src/lib/elementary/elm_popup_item_eo.legacy.h new file mode 100644 index 0000000000..5360e3d59a --- /dev/null +++ b/src/lib/elementary/elm_popup_item_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_POPUP_ITEM_EO_LEGACY_H_ +#define _ELM_POPUP_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_POPUP_ITEM_EO_CLASS_TYPE +#define _ELM_POPUP_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Popup_Item; + +#endif + +#ifndef _ELM_POPUP_ITEM_EO_TYPES +#define _ELM_POPUP_ITEM_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_popup_part.eo b/src/lib/elementary/elm_popup_part.eo index 8c9210fedd..c969de86f1 100644 --- a/src/lib/elementary/elm_popup_part.eo +++ b/src/lib/elementary/elm_popup_part.eo @@ -1,4 +1,4 @@ -class Elm.Popup.Part extends Efl.Ui.Layout_Part_Legacy +class @beta Elm.Popup.Part extends Efl.Ui.Layout_Part_Legacy { [[Elementary popup internal part class]] data: null; diff --git a/src/lib/elementary/elm_prefs.c b/src/lib/elementary/elm_prefs.c index d9d48a4c21..a320563661 100644 --- a/src/lib/elementary/elm_prefs.c +++ b/src/lib/elementary/elm_prefs.c @@ -7,7 +7,7 @@ #include #include "elm_priv.h" -#include "elm_prefs.eo.h" +#include "elm_prefs_eo.h" #include "elm_widget_prefs.h" #include "elm_prefs_edd.x" @@ -48,7 +48,6 @@ EOLIAN static void _elm_prefs_efl_canvas_group_group_add(Eo *obj, Elm_Prefs_Data *_pd EINA_UNUSED) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); } static void _item_free(Elm_Prefs_Item_Node *it); @@ -1098,69 +1097,6 @@ _elm_prefs_values_get_user(Elm_Prefs_Data *sd, } } -EOLIAN static Eina_Bool -_elm_prefs_efl_file_file_set(Eo *obj, Elm_Prefs_Data *sd, const char *file, const char *page) -{ - const char *prefix; - - if (!_elm_prefs_init_count) - { - CRI("prefs_iface module is not loaded! you can't" - " create prefs widgets"); - return EINA_FALSE; - } - prefix = elm_app_data_dir_get(); - if (!strlen(prefix)) - { - WRN("we could not figure out the program's data" - " dir, fallbacking to local directory."); - prefix = "."; - } - - if (!file) - sd->file = eina_stringshare_printf("%s/%s", prefix, "preferences.epb"); - else - { -#ifndef _WIN32 - if (*file != '/') /* relative */ -#else - if (!evil_path_is_absolute(file)) /* relative */ -#endif - sd->file = eina_stringshare_printf("%s/%s", prefix, file); - else - sd->file = eina_stringshare_add(file); - } - - sd->page = eina_stringshare_add(page ? page : "main"); - - sd->root = _elm_prefs_page_load(obj, sd->page); - if (!sd->root) return EINA_FALSE; - - if (!_elm_prefs_page_populate(sd->root, obj)) - { - _root_node_free(sd); - sd->root = NULL; - - return EINA_FALSE; - } - - elm_widget_resize_object_set(obj, sd->root->w_obj); - - _elm_prefs_values_get_default(sd->root, EINA_FALSE); - - efl_event_callback_legacy_call - (obj, ELM_PREFS_EVENT_PAGE_LOADED, (char *)sd->root->name); - - return EINA_TRUE; -} - -EOLIAN static void -_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; -} - EOLIAN static Eina_Bool _elm_prefs_data_set(Eo *obj, Elm_Prefs_Data *sd, Elm_Prefs_Data *prefs_data) { @@ -1853,14 +1789,68 @@ _elm_prefs_class_constructor(Efl_Class *klass) EAPI Eina_Bool elm_prefs_file_set(Eo *obj, const char *file, const char *page) { - return efl_file_set((Eo *) obj, file, page); + Elm_Prefs_Data *sd = efl_data_scope_get(obj, MY_CLASS); + const char *prefix; + + EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EINA_FALSE); + + if (!_elm_prefs_init_count) + { + CRI("prefs_iface module is not loaded! you can't" + " create prefs widgets"); + return EINA_FALSE; + } + prefix = elm_app_data_dir_get(); + if (!strlen(prefix)) + { + WRN("we could not figure out the program's data" + " dir, fallbacking to local directory."); + prefix = "."; + } + + if (!file) + sd->file = eina_stringshare_printf("%s/%s", prefix, "preferences.epb"); + else + { +#ifndef _WIN32 + if (*file != '/') /* relative */ +#else + if (!evil_path_is_absolute(file)) /* relative */ +#endif + sd->file = eina_stringshare_printf("%s/%s", prefix, file); + else + sd->file = eina_stringshare_add(file); + } + + sd->page = eina_stringshare_add(page ? page : "main"); + + sd->root = _elm_prefs_page_load(obj, sd->page); + if (!sd->root) return EINA_FALSE; + + if (!_elm_prefs_page_populate(sd->root, obj)) + { + _root_node_free(sd); + sd->root = NULL; + + return EINA_FALSE; + } + + elm_widget_resize_object_set(obj, sd->root->w_obj); + + _elm_prefs_values_get_default(sd->root, EINA_FALSE); + + efl_event_callback_legacy_call + (obj, ELM_PREFS_EVENT_PAGE_LOADED, (char *)sd->root->name); + return EINA_TRUE; } EAPI Eina_Bool elm_prefs_file_get(const Eo *obj, const char **file, const char **page) { - efl_file_get((Eo *) obj, file, page); - + Elm_Prefs_Data *sd = efl_data_scope_get(obj, MY_CLASS); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EINA_FALSE); + if (file) *file = sd->file; + if (page) *page = sd->page; return EINA_TRUE; } @@ -1869,4 +1859,4 @@ elm_prefs_file_get(const Eo *obj, const char **file, const char **page) #define ELM_PREFS_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_prefs) -#include "elm_prefs.eo.c" +#include "elm_prefs_eo.c" diff --git a/src/lib/elementary/elm_prefs.eo b/src/lib/elementary/elm_prefs.eo deleted file mode 100644 index 78b19ade56..0000000000 --- a/src/lib/elementary/elm_prefs.eo +++ /dev/null @@ -1,228 +0,0 @@ -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 extends Efl.Ui.Widget implements Efl.File, Efl.Ui.Legacy -{ - [[Elementary preferences class]] - legacy_prefix: elm_prefs; - eo_prefix: elm_obj_prefs; - event_prefix: elm_prefs; - methods { - @property data { - [[Set user data for a given prefs widget - - Once a prefs widget is created, after elm_prefs_file_set() is - issued on it, all of its UI elements will get default values, when - declared on that file. To fetch an user's own, personal set of - those values, one gets to pair a prefs data handle to the - prefs widget. This is what this call is intended for. - - Prefs data values from $prefs_data with keys matching the ones - present on the file passed on elm_prefs_file_set() to $obj will - have their values applied to the respective UI elements of the - widget. - - When $obj dies, the values of the elements declared on its - $.epb file (the one set on elm_prefs_file_set()) marked as permanent - will be written back to prefs_data, if it is writable. - One is also able to make this writing event to take place - automatically after each UI element modification by using - elm_prefs_autosave_set(). - - Note: $obj will keep a reference of its own for $prefs_data, - but you should still unreference it by yourself, after the widget - is gone. - - @since 1.8]] - set { - return: bool; [[$true, on success, $false otherwise]] - } - get { - } - values { - data: ptr(Elm_Prefs_Data) @nullable; [[A valid prefs_data handle]] - } - } - @property autosave { - [[Control whether a given prefs widget should save its values back (on - the user data file, if set) automatically on every UI element - changes. - - If $autosave is $true, every call to - elm_prefs_item_value_set(), every - Elm_Prefs_Data_Event_Type.ELM_PREFS_DATA_EVENT_ITEM_CHANGED event - coming for its prefs data and every UI element direct value - changing will implicitly make the prefs values to be flushed back - to it prefs data. If a prefs data handle with no writing - permissions or no prefs data is set on $prefs, naturally nothing - will happen. - - @since 1.8]] - set { - } - get { - } - values { - autosave: bool; [[$true to save automatically, $false otherwise.]] - } - } - reset { - [[Reset the values of a given prefs widget to a previous state. - - As can be seen on #Elm_Prefs_Reset_Mode, there are two possible - actions to be taken by this call -- either to reset $prefs' - values to the defaults (declared on the $.epb file it is bound - to) or to reset to the state they were before the last modification - it got. - - @since 1.8]] - - params { - @in mode: Elm_Prefs_Reset_Mode; [[The reset mode to apply on $prefs]] - } - } - item_value_set { - [[Set the value on a given prefs widget's item. - - This will change the value of item named $name programatically. - - @since 1.8]] - - return: bool; [[$true, on success, $false otherwise]] - params { - @in name: string; [[The name of the item (as declared in the prefs collection)]] - @in value: const(any_value_ptr); [[The value to set on the item. It should be typed as the item expects, preferably, or a conversion will take place]] - } - } - item_value_get @const { - [[Get the value of a given prefs widget's item. - - This will retrieve the value of item named $name. - - @since 1.8]] - return: bool; [[$true, on success, $false otherwise]] - - params { - @in name: string; [[The name of the item (as declared in the prefs collection) to get value from]] - @out value: any_value; [[Where to store the value of the item. It will be overwritten and setup with the type the item is bound to]] - } - } - item_object_get { - [[Get the Elementary widget bound to a given prefs widget's item. - - This will retrieve a handle to the real widget implementing a given - item of $prefs, for read-only actions. - - Warning: You should never modify the state of the returned - widget, because it's meant to be managed by $prefs, solely. - - @since 1.8]] - - return: const(Efl.Canvas.Object); [[A valid widget handle, on success, or $NULL, otherwise]] - params { - @in name: string; [[The name of the item (as declared in the prefs collection) to get object from]] - } - } - item_disabled_set { - [[Set whether the widget bound to a given prefs widget's item is disabled or not. - - @since 1.8]] - - params { - @in name: string; [[The name of the item (as declared in the prefs collection) to act on]] - @in disabled: bool; [[$true, to make it disabled, $false otherwise]] - } - } - item_disabled_get @const { - [[Get whether the widget bound to a given prefs widget's item is disabled or not. - - @since 1.8]] - return: bool; [[$true, if it is disabled, $false otherwise]] - params { - @in name: string; [[The name of the item (as declared in the prefs collection) to get disabled state from]] - } - } - item_swallow { - [["Swallows" an object into a SWALLOW item of a prefs widget. - - @since 1.8]] - - return: bool; [[$true, on success, $false otherwise]] - params { - @in name: string; [[The name of the SWALLOW item (as declared in the prefs collection)]] - @in child: Efl.Canvas.Object; [[The object to occupy the item]] - } - } - item_editable_set { - [[Set whether the widget bound to a given prefs widget's item is editable or not. - - Note: Only $TEXT or $TEXTAREA items' default widgets implement - the 'editable' property. Custom registered widgets may as well - implement them. - - @since 1.8]] - - params { - @in name: string; [[The name of the item (as declared in the prefs collection) to act on]] - @in editable: bool; [[$true, to make it editable, $false otherwise]] - } - } - item_editable_get @const { - [[Get whether the widget bound to a given prefs widget's item is editable or not. - - @since 1.8]] - return: bool; [[$true, if it is editable, $false otherwise]] - params { - @in name: string; [[The name of the item (as declared in the prefs collection) to get editable state from]] - } - } - item_unswallow { - [[Unswallow an object from a SWALLOW item of a prefs widget. - - @since 1.8]] - - return: Efl.Canvas.Object; [[The unswallowed object, or NULL on errors]] - params { - @in name: string; [[The name of the SWALLOW item (as declared in the prefs collection)]] - } - } - item_visible_set { - [[Set whether the widget bound to given prefs widget's item should be visible or not. - - Each prefs item may have a default visibility state, declared on - the $.epb $prefs it was loaded with. By this call one may alter - that state, programatically. - - @since 1.8]] - - params { - @in name: string; [[The name of the item (as declared in the prefs collection) to change visibility of]] - @in visible: bool; [[$true, to make it visible, $false otherwise]] - } - } - item_visible_get @const { - [[Get whether the widget bound to a given prefs widget's item is visible or not. - - @since 1.8]] - return: bool; [[$true, if it is visible, $false otherwise]] - params { - @in name: string; [[The name of the item (as declared in the prefs collection) to get visibility state from]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.File.file { get; set; } - } - events { - 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: 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_prefs_eo.c b/src/lib/elementary/elm_prefs_eo.c new file mode 100644 index 0000000000..5cb10d01a8 --- /dev/null +++ b/src/lib/elementary/elm_prefs_eo.c @@ -0,0 +1,159 @@ +EWAPI const Efl_Event_Description _ELM_PREFS_EVENT_PAGE_CHANGED = + EFL_EVENT_DESCRIPTION("page,changed"); +EWAPI const Efl_Event_Description _ELM_PREFS_EVENT_PAGE_SAVED = + EFL_EVENT_DESCRIPTION("page,saved"); +EWAPI const Efl_Event_Description _ELM_PREFS_EVENT_PAGE_LOADED = + EFL_EVENT_DESCRIPTION("page,loaded"); +EWAPI const Efl_Event_Description _ELM_PREFS_EVENT_ITEM_CHANGED = + EFL_EVENT_DESCRIPTION("item,changed"); +EWAPI const Efl_Event_Description _ELM_PREFS_EVENT_ACTION = + EFL_EVENT_DESCRIPTION("action"); + +Eina_Bool _elm_prefs_data_set(Eo *obj, Elm_Prefs_Data *pd, Elm_Prefs_Data *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_prefs_data_set, Eina_Bool, 0, EFL_FUNC_CALL(data), Elm_Prefs_Data *data); + +Elm_Prefs_Data *_elm_prefs_data_get(const Eo *obj, Elm_Prefs_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_prefs_data_get, Elm_Prefs_Data *, NULL); + +void _elm_prefs_autosave_set(Eo *obj, Elm_Prefs_Data *pd, Eina_Bool autosave); + + +static Eina_Error +__eolian_elm_prefs_autosave_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_prefs_autosave_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_prefs_autosave_set, EFL_FUNC_CALL(autosave), Eina_Bool autosave); + +Eina_Bool _elm_prefs_autosave_get(const Eo *obj, Elm_Prefs_Data *pd); + + +static Eina_Value +__eolian_elm_prefs_autosave_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_prefs_autosave_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_prefs_autosave_get, Eina_Bool, 0); + +void _elm_prefs_reset(Eo *obj, Elm_Prefs_Data *pd, Elm_Prefs_Reset_Mode mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_prefs_reset, EFL_FUNC_CALL(mode), Elm_Prefs_Reset_Mode mode); + +Eina_Bool _elm_prefs_item_value_set(Eo *obj, Elm_Prefs_Data *pd, const char *name, const Eina_Value *value); + +EOAPI EFL_FUNC_BODYV(elm_obj_prefs_item_value_set, Eina_Bool, 0, EFL_FUNC_CALL(name, value), const char *name, const Eina_Value *value); + +Eina_Bool _elm_prefs_item_value_get(const Eo *obj, Elm_Prefs_Data *pd, const char *name, Eina_Value *value); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_prefs_item_value_get, Eina_Bool, 0, EFL_FUNC_CALL(name, value), const char *name, Eina_Value *value); + +const Efl_Canvas_Object *_elm_prefs_item_object_get(Eo *obj, Elm_Prefs_Data *pd, const char *name); + +EOAPI EFL_FUNC_BODYV(elm_obj_prefs_item_object_get, const Efl_Canvas_Object *, NULL, EFL_FUNC_CALL(name), const char *name); + +void _elm_prefs_item_disabled_set(Eo *obj, Elm_Prefs_Data *pd, const char *name, Eina_Bool disabled); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_prefs_item_disabled_set, EFL_FUNC_CALL(name, disabled), const char *name, Eina_Bool disabled); + +Eina_Bool _elm_prefs_item_disabled_get(const Eo *obj, Elm_Prefs_Data *pd, const char *name); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_prefs_item_disabled_get, Eina_Bool, 0, EFL_FUNC_CALL(name), const char *name); + +Eina_Bool _elm_prefs_item_swallow(Eo *obj, Elm_Prefs_Data *pd, const char *name, Efl_Canvas_Object *child); + +EOAPI EFL_FUNC_BODYV(elm_obj_prefs_item_swallow, Eina_Bool, 0, EFL_FUNC_CALL(name, child), const char *name, Efl_Canvas_Object *child); + +void _elm_prefs_item_editable_set(Eo *obj, Elm_Prefs_Data *pd, const char *name, Eina_Bool editable); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_prefs_item_editable_set, EFL_FUNC_CALL(name, editable), const char *name, Eina_Bool editable); + +Eina_Bool _elm_prefs_item_editable_get(const Eo *obj, Elm_Prefs_Data *pd, const char *name); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_prefs_item_editable_get, Eina_Bool, 0, EFL_FUNC_CALL(name), const char *name); + +Efl_Canvas_Object *_elm_prefs_item_unswallow(Eo *obj, Elm_Prefs_Data *pd, const char *name); + +EOAPI EFL_FUNC_BODYV(elm_obj_prefs_item_unswallow, Efl_Canvas_Object *, NULL, EFL_FUNC_CALL(name), const char *name); + +void _elm_prefs_item_visible_set(Eo *obj, Elm_Prefs_Data *pd, const char *name, Eina_Bool visible); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_prefs_item_visible_set, EFL_FUNC_CALL(name, visible), const char *name, Eina_Bool visible); + +Eina_Bool _elm_prefs_item_visible_get(const Eo *obj, Elm_Prefs_Data *pd, const char *name); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_prefs_item_visible_get, Eina_Bool, 0, EFL_FUNC_CALL(name), const char *name); + +Efl_Object *_elm_prefs_efl_object_constructor(Eo *obj, Elm_Prefs_Data *pd); + + +static Eina_Bool +_elm_prefs_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_PREFS_EXTRA_OPS +#define ELM_PREFS_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_prefs_data_set, _elm_prefs_data_set), + EFL_OBJECT_OP_FUNC(elm_obj_prefs_data_get, _elm_prefs_data_get), + EFL_OBJECT_OP_FUNC(elm_obj_prefs_autosave_set, _elm_prefs_autosave_set), + EFL_OBJECT_OP_FUNC(elm_obj_prefs_autosave_get, _elm_prefs_autosave_get), + EFL_OBJECT_OP_FUNC(elm_obj_prefs_reset, _elm_prefs_reset), + EFL_OBJECT_OP_FUNC(elm_obj_prefs_item_value_set, _elm_prefs_item_value_set), + EFL_OBJECT_OP_FUNC(elm_obj_prefs_item_value_get, _elm_prefs_item_value_get), + EFL_OBJECT_OP_FUNC(elm_obj_prefs_item_object_get, _elm_prefs_item_object_get), + EFL_OBJECT_OP_FUNC(elm_obj_prefs_item_disabled_set, _elm_prefs_item_disabled_set), + EFL_OBJECT_OP_FUNC(elm_obj_prefs_item_disabled_get, _elm_prefs_item_disabled_get), + EFL_OBJECT_OP_FUNC(elm_obj_prefs_item_swallow, _elm_prefs_item_swallow), + EFL_OBJECT_OP_FUNC(elm_obj_prefs_item_editable_set, _elm_prefs_item_editable_set), + EFL_OBJECT_OP_FUNC(elm_obj_prefs_item_editable_get, _elm_prefs_item_editable_get), + EFL_OBJECT_OP_FUNC(elm_obj_prefs_item_unswallow, _elm_prefs_item_unswallow), + EFL_OBJECT_OP_FUNC(elm_obj_prefs_item_visible_set, _elm_prefs_item_visible_set), + EFL_OBJECT_OP_FUNC(elm_obj_prefs_item_visible_get, _elm_prefs_item_visible_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_prefs_efl_object_constructor), + ELM_PREFS_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"autosave", __eolian_elm_prefs_autosave_set_reflect, __eolian_elm_prefs_autosave_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_prefs_class_desc = { + EO_VERSION, + "Elm.Prefs", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Prefs_Data), + _elm_prefs_class_initializer, + _elm_prefs_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_prefs_class_get, &_elm_prefs_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_prefs_eo.legacy.c" diff --git a/src/lib/elementary/elm_prefs_eo.h b/src/lib/elementary/elm_prefs_eo.h new file mode 100644 index 0000000000..5f6fad3bf2 --- /dev/null +++ b/src/lib/elementary/elm_prefs_eo.h @@ -0,0 +1,381 @@ +#ifndef _ELM_PREFS_EO_H_ +#define _ELM_PREFS_EO_H_ + +#ifndef _ELM_PREFS_EO_CLASS_TYPE +#define _ELM_PREFS_EO_CLASS_TYPE + +typedef Eo Elm_Prefs; + +#endif + +#ifndef _ELM_PREFS_EO_TYPES +#define _ELM_PREFS_EO_TYPES + + +#endif +/** Elementary preferences class + * + * @ingroup Elm_Prefs + */ +#define ELM_PREFS_CLASS elm_prefs_class_get() + +EWAPI const Efl_Class *elm_prefs_class_get(void); + +/** + * @brief Set user data for a given prefs widget + * + * Once a prefs widget is created, after elm_prefs_file_set() is issued on it, + * all of its UI elements will get default values, when declared on that file. + * To fetch an user's own, personal set of those values, one gets to pair a + * prefs data handle to the prefs widget. This is what this call is intended + * for. + * + * Prefs data values from @c prefs_data with keys matching the ones present on + * the file passed on elm_prefs_file_set() to @c obj will have their values + * applied to the respective UI elements of the widget. + * + * When @c obj dies, the values of the elements declared on its $.epb file (the + * one set on elm_prefs_file_set()) marked as permanent will be written back to + * prefs_data, if it is writable. One is also able to make this writing event + * to take place automatically after each UI element modification by using + * elm_prefs_autosave_set(). + * + * @note @c obj will keep a reference of its own for @c prefs_data, but you + * should still unreference it by yourself, after the widget is gone. + * + * @param[in] obj The object. + * @param[in] data A valid prefs_data handle + * + * @return @c true, on success, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs + */ +EOAPI Eina_Bool elm_obj_prefs_data_set(Eo *obj, Elm_Prefs_Data *data); + +/** + * @brief Set user data for a given prefs widget + * + * Once a prefs widget is created, after elm_prefs_file_set() is issued on it, + * all of its UI elements will get default values, when declared on that file. + * To fetch an user's own, personal set of those values, one gets to pair a + * prefs data handle to the prefs widget. This is what this call is intended + * for. + * + * Prefs data values from @c prefs_data with keys matching the ones present on + * the file passed on elm_prefs_file_set() to @c obj will have their values + * applied to the respective UI elements of the widget. + * + * When @c obj dies, the values of the elements declared on its $.epb file (the + * one set on elm_prefs_file_set()) marked as permanent will be written back to + * prefs_data, if it is writable. One is also able to make this writing event + * to take place automatically after each UI element modification by using + * elm_prefs_autosave_set(). + * + * @note @c obj will keep a reference of its own for @c prefs_data, but you + * should still unreference it by yourself, after the widget is gone. + * + * @param[in] obj The object. + * + * @return A valid prefs_data handle + * + * @since 1.8 + * + * @ingroup Elm_Prefs + */ +EOAPI Elm_Prefs_Data *elm_obj_prefs_data_get(const Eo *obj); + +/** + * @brief Control whether a given prefs widget should save its values back (on + * the user data file, if set) automatically on every UI element changes. + * + * If @c autosave is @c true, every call to elm_prefs_item_value_set(), every + * Elm_Prefs_Data_Event_Type.ELM_PREFS_DATA_EVENT_ITEM_CHANGED event coming for + * its prefs data and every UI element direct value changing will implicitly + * make the prefs values to be flushed back to it prefs data. If a prefs data + * handle with no writing permissions or no prefs data is set on @c prefs, + * naturally nothing will happen. + * + * @param[in] obj The object. + * @param[in] autosave @c true to save automatically, @c false otherwise. + * + * @since 1.8 + * + * @ingroup Elm_Prefs + */ +EOAPI void elm_obj_prefs_autosave_set(Eo *obj, Eina_Bool autosave); + +/** + * @brief Control whether a given prefs widget should save its values back (on + * the user data file, if set) automatically on every UI element changes. + * + * If @c autosave is @c true, every call to elm_prefs_item_value_set(), every + * Elm_Prefs_Data_Event_Type.ELM_PREFS_DATA_EVENT_ITEM_CHANGED event coming for + * its prefs data and every UI element direct value changing will implicitly + * make the prefs values to be flushed back to it prefs data. If a prefs data + * handle with no writing permissions or no prefs data is set on @c prefs, + * naturally nothing will happen. + * + * @param[in] obj The object. + * + * @return @c true to save automatically, @c false otherwise. + * + * @since 1.8 + * + * @ingroup Elm_Prefs + */ +EOAPI Eina_Bool elm_obj_prefs_autosave_get(const Eo *obj); + +/** + * @brief Reset the values of a given prefs widget to a previous state. + * + * As can be seen on #Elm_Prefs_Reset_Mode, there are two possible actions to + * be taken by this call -- either to reset @c prefs' values to the defaults + * (declared on the $.epb file it is bound to) or to reset to the state they + * were before the last modification it got. + * + * @param[in] obj The object. + * @param[in] mode The reset mode to apply on @c prefs + * + * @since 1.8 + * + * @ingroup Elm_Prefs + */ +EOAPI void elm_obj_prefs_reset(Eo *obj, Elm_Prefs_Reset_Mode mode); + +/** + * @brief Set the value on a given prefs widget's item. + * + * This will change the value of item named @c name programatically. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * @param[in] value The value to set on the item. It should be typed as the + * item expects, preferably, or a conversion will take place + * + * @return @c true, on success, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs + */ +EOAPI Eina_Bool elm_obj_prefs_item_value_set(Eo *obj, const char *name, const Eina_Value *value); + +/** + * @brief Get the value of a given prefs widget's item. + * + * This will retrieve the value of item named @c name. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * to get value from + * @param[out] value Where to store the value of the item. It will be + * overwritten and setup with the type the item is bound to + * + * @return @c true, on success, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs + */ +EOAPI Eina_Bool elm_obj_prefs_item_value_get(const Eo *obj, const char *name, Eina_Value *value); + +/** + * @brief Get the Elementary widget bound to a given prefs widget's item. + * + * This will retrieve a handle to the real widget implementing a given item of + * @c prefs, for read-only actions. + * + * @warning You should never modify the state of the returned widget, because + * it's meant to be managed by @c prefs, solely. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * to get object from + * + * @return A valid widget handle, on success, or @c NULL, otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs + */ +EOAPI const Efl_Canvas_Object *elm_obj_prefs_item_object_get(Eo *obj, const char *name); + +/** + * @brief Set whether the widget bound to a given prefs widget's item is + * disabled or not. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * to act on + * @param[in] disabled @c true, to make it disabled, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs + */ +EOAPI void elm_obj_prefs_item_disabled_set(Eo *obj, const char *name, Eina_Bool disabled); + +/** + * @brief Get whether the widget bound to a given prefs widget's item is + * disabled or not. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * to get disabled state from + * + * @return @c true, if it is disabled, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs + */ +EOAPI Eina_Bool elm_obj_prefs_item_disabled_get(const Eo *obj, const char *name); + +/** + * @brief "Swallows" an object into a SWALLOW item of a prefs widget. + * + * @param[in] obj The object. + * @param[in] name The name of the SWALLOW item (as declared in the prefs + * collection) + * @param[in] child The object to occupy the item + * + * @return @c true, on success, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs + */ +EOAPI Eina_Bool elm_obj_prefs_item_swallow(Eo *obj, const char *name, Efl_Canvas_Object *child); + +/** + * @brief Set whether the widget bound to a given prefs widget's item is + * editable or not. + * + * @note Only @c TEXT or @c TEXTAREA items' default widgets implement the + * 'editable' property. Custom registered widgets may as well implement them. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * to act on + * @param[in] editable @c true, to make it editable, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs + */ +EOAPI void elm_obj_prefs_item_editable_set(Eo *obj, const char *name, Eina_Bool editable); + +/** + * @brief Get whether the widget bound to a given prefs widget's item is + * editable or not. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * to get editable state from + * + * @return @c true, if it is editable, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs + */ +EOAPI Eina_Bool elm_obj_prefs_item_editable_get(const Eo *obj, const char *name); + +/** + * @brief Unswallow an object from a SWALLOW item of a prefs widget. + * + * @param[in] obj The object. + * @param[in] name The name of the SWALLOW item (as declared in the prefs + * collection) + * + * @return The unswallowed object, or NULL on errors + * + * @since 1.8 + * + * @ingroup Elm_Prefs + */ +EOAPI Efl_Canvas_Object *elm_obj_prefs_item_unswallow(Eo *obj, const char *name); + +/** + * @brief Set whether the widget bound to given prefs widget's item should be + * visible or not. + * + * Each prefs item may have a default visibility state, declared on the $.epb + * @c prefs it was loaded with. By this call one may alter that state, + * programatically. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * to change visibility of + * @param[in] visible @c true, to make it visible, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs + */ +EOAPI void elm_obj_prefs_item_visible_set(Eo *obj, const char *name, Eina_Bool visible); + +/** + * @brief Get whether the widget bound to a given prefs widget's item is + * visible or not. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * to get visibility state from + * + * @return @c true, if it is visible, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs + */ +EOAPI Eina_Bool elm_obj_prefs_item_visible_get(const Eo *obj, const char *name); + +EWAPI extern const Efl_Event_Description _ELM_PREFS_EVENT_PAGE_CHANGED; + +/** Called when page changed + * @return const char * + * + * @ingroup Elm_Prefs + */ +#define ELM_PREFS_EVENT_PAGE_CHANGED (&(_ELM_PREFS_EVENT_PAGE_CHANGED)) + +EWAPI extern const Efl_Event_Description _ELM_PREFS_EVENT_PAGE_SAVED; + +/** Called when page was saved + * @return const char * + * + * @ingroup Elm_Prefs + */ +#define ELM_PREFS_EVENT_PAGE_SAVED (&(_ELM_PREFS_EVENT_PAGE_SAVED)) + +EWAPI extern const Efl_Event_Description _ELM_PREFS_EVENT_PAGE_LOADED; + +/** Called when page got loaded + * @return const char * + * + * @ingroup Elm_Prefs + */ +#define ELM_PREFS_EVENT_PAGE_LOADED (&(_ELM_PREFS_EVENT_PAGE_LOADED)) + +EWAPI extern const Efl_Event_Description _ELM_PREFS_EVENT_ITEM_CHANGED; + +/** Called when item changed + * @return const char * + * + * @ingroup Elm_Prefs + */ +#define ELM_PREFS_EVENT_ITEM_CHANGED (&(_ELM_PREFS_EVENT_ITEM_CHANGED)) + +EWAPI extern const Efl_Event_Description _ELM_PREFS_EVENT_ACTION; + +/** Called when action was done + * @return const char * + * + * @ingroup Elm_Prefs + */ +#define ELM_PREFS_EVENT_ACTION (&(_ELM_PREFS_EVENT_ACTION)) + +#endif diff --git a/src/lib/elementary/elm_prefs_eo.legacy.c b/src/lib/elementary/elm_prefs_eo.legacy.c new file mode 100644 index 0000000000..2eef8f3b0b --- /dev/null +++ b/src/lib/elementary/elm_prefs_eo.legacy.c @@ -0,0 +1,96 @@ + +EAPI Eina_Bool +elm_prefs_data_set(Elm_Prefs *obj, Elm_Prefs_Data *data) +{ + return elm_obj_prefs_data_set(obj, data); +} + +EAPI Elm_Prefs_Data * +elm_prefs_data_get(const Elm_Prefs *obj) +{ + return elm_obj_prefs_data_get(obj); +} + +EAPI void +elm_prefs_autosave_set(Elm_Prefs *obj, Eina_Bool autosave) +{ + elm_obj_prefs_autosave_set(obj, autosave); +} + +EAPI Eina_Bool +elm_prefs_autosave_get(const Elm_Prefs *obj) +{ + return elm_obj_prefs_autosave_get(obj); +} + +EAPI void +elm_prefs_reset(Elm_Prefs *obj, Elm_Prefs_Reset_Mode mode) +{ + elm_obj_prefs_reset(obj, mode); +} + +EAPI Eina_Bool +elm_prefs_item_value_set(Elm_Prefs *obj, const char *name, const Eina_Value *value) +{ + return elm_obj_prefs_item_value_set(obj, name, value); +} + +EAPI Eina_Bool +elm_prefs_item_value_get(const Elm_Prefs *obj, const char *name, Eina_Value *value) +{ + return elm_obj_prefs_item_value_get(obj, name, value); +} + +EAPI const Efl_Canvas_Object * +elm_prefs_item_object_get(Elm_Prefs *obj, const char *name) +{ + return elm_obj_prefs_item_object_get(obj, name); +} + +EAPI void +elm_prefs_item_disabled_set(Elm_Prefs *obj, const char *name, Eina_Bool disabled) +{ + elm_obj_prefs_item_disabled_set(obj, name, disabled); +} + +EAPI Eina_Bool +elm_prefs_item_disabled_get(const Elm_Prefs *obj, const char *name) +{ + return elm_obj_prefs_item_disabled_get(obj, name); +} + +EAPI Eina_Bool +elm_prefs_item_swallow(Elm_Prefs *obj, const char *name, Efl_Canvas_Object *child) +{ + return elm_obj_prefs_item_swallow(obj, name, child); +} + +EAPI void +elm_prefs_item_editable_set(Elm_Prefs *obj, const char *name, Eina_Bool editable) +{ + elm_obj_prefs_item_editable_set(obj, name, editable); +} + +EAPI Eina_Bool +elm_prefs_item_editable_get(const Elm_Prefs *obj, const char *name) +{ + return elm_obj_prefs_item_editable_get(obj, name); +} + +EAPI Efl_Canvas_Object * +elm_prefs_item_unswallow(Elm_Prefs *obj, const char *name) +{ + return elm_obj_prefs_item_unswallow(obj, name); +} + +EAPI void +elm_prefs_item_visible_set(Elm_Prefs *obj, const char *name, Eina_Bool visible) +{ + elm_obj_prefs_item_visible_set(obj, name, visible); +} + +EAPI Eina_Bool +elm_prefs_item_visible_get(const Elm_Prefs *obj, const char *name) +{ + return elm_obj_prefs_item_visible_get(obj, name); +} diff --git a/src/lib/elementary/elm_prefs_eo.legacy.h b/src/lib/elementary/elm_prefs_eo.legacy.h new file mode 100644 index 0000000000..47fb914d56 --- /dev/null +++ b/src/lib/elementary/elm_prefs_eo.legacy.h @@ -0,0 +1,329 @@ +#ifndef _ELM_PREFS_EO_LEGACY_H_ +#define _ELM_PREFS_EO_LEGACY_H_ + +#ifndef _ELM_PREFS_EO_CLASS_TYPE +#define _ELM_PREFS_EO_CLASS_TYPE + +typedef Eo Elm_Prefs; + +#endif + +#ifndef _ELM_PREFS_EO_TYPES +#define _ELM_PREFS_EO_TYPES + + +#endif + +/** + * @brief Set user data for a given prefs widget + * + * Once a prefs widget is created, after elm_prefs_file_set() is issued on it, + * all of its UI elements will get default values, when declared on that file. + * To fetch an user's own, personal set of those values, one gets to pair a + * prefs data handle to the prefs widget. This is what this call is intended + * for. + * + * Prefs data values from @c prefs_data with keys matching the ones present on + * the file passed on elm_prefs_file_set() to @c obj will have their values + * applied to the respective UI elements of the widget. + * + * When @c obj dies, the values of the elements declared on its $.epb file (the + * one set on elm_prefs_file_set()) marked as permanent will be written back to + * prefs_data, if it is writable. One is also able to make this writing event + * to take place automatically after each UI element modification by using + * elm_prefs_autosave_set(). + * + * @note @c obj will keep a reference of its own for @c prefs_data, but you + * should still unreference it by yourself, after the widget is gone. + * + * @param[in] obj The object. + * @param[in] data A valid prefs_data handle + * + * @return @c true, on success, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs_Group + */ +EAPI Eina_Bool elm_prefs_data_set(Elm_Prefs *obj, Elm_Prefs_Data *data); + +/** + * @brief Set user data for a given prefs widget + * + * Once a prefs widget is created, after elm_prefs_file_set() is issued on it, + * all of its UI elements will get default values, when declared on that file. + * To fetch an user's own, personal set of those values, one gets to pair a + * prefs data handle to the prefs widget. This is what this call is intended + * for. + * + * Prefs data values from @c prefs_data with keys matching the ones present on + * the file passed on elm_prefs_file_set() to @c obj will have their values + * applied to the respective UI elements of the widget. + * + * When @c obj dies, the values of the elements declared on its $.epb file (the + * one set on elm_prefs_file_set()) marked as permanent will be written back to + * prefs_data, if it is writable. One is also able to make this writing event + * to take place automatically after each UI element modification by using + * elm_prefs_autosave_set(). + * + * @note @c obj will keep a reference of its own for @c prefs_data, but you + * should still unreference it by yourself, after the widget is gone. + * + * @param[in] obj The object. + * + * @return A valid prefs_data handle + * + * @since 1.8 + * + * @ingroup Elm_Prefs_Group + */ +EAPI Elm_Prefs_Data *elm_prefs_data_get(const Elm_Prefs *obj); + +/** + * @brief Control whether a given prefs widget should save its values back (on + * the user data file, if set) automatically on every UI element changes. + * + * If @c autosave is @c true, every call to elm_prefs_item_value_set(), every + * Elm_Prefs_Data_Event_Type.ELM_PREFS_DATA_EVENT_ITEM_CHANGED event coming for + * its prefs data and every UI element direct value changing will implicitly + * make the prefs values to be flushed back to it prefs data. If a prefs data + * handle with no writing permissions or no prefs data is set on @c prefs, + * naturally nothing will happen. + * + * @param[in] obj The object. + * @param[in] autosave @c true to save automatically, @c false otherwise. + * + * @since 1.8 + * + * @ingroup Elm_Prefs_Group + */ +EAPI void elm_prefs_autosave_set(Elm_Prefs *obj, Eina_Bool autosave); + +/** + * @brief Control whether a given prefs widget should save its values back (on + * the user data file, if set) automatically on every UI element changes. + * + * If @c autosave is @c true, every call to elm_prefs_item_value_set(), every + * Elm_Prefs_Data_Event_Type.ELM_PREFS_DATA_EVENT_ITEM_CHANGED event coming for + * its prefs data and every UI element direct value changing will implicitly + * make the prefs values to be flushed back to it prefs data. If a prefs data + * handle with no writing permissions or no prefs data is set on @c prefs, + * naturally nothing will happen. + * + * @param[in] obj The object. + * + * @return @c true to save automatically, @c false otherwise. + * + * @since 1.8 + * + * @ingroup Elm_Prefs_Group + */ +EAPI Eina_Bool elm_prefs_autosave_get(const Elm_Prefs *obj); + +/** + * @brief Reset the values of a given prefs widget to a previous state. + * + * As can be seen on #Elm_Prefs_Reset_Mode, there are two possible actions to + * be taken by this call -- either to reset @c prefs' values to the defaults + * (declared on the $.epb file it is bound to) or to reset to the state they + * were before the last modification it got. + * + * @param[in] obj The object. + * @param[in] mode The reset mode to apply on @c prefs + * + * @since 1.8 + * + * @ingroup Elm_Prefs_Group + */ +EAPI void elm_prefs_reset(Elm_Prefs *obj, Elm_Prefs_Reset_Mode mode); + +/** + * @brief Set the value on a given prefs widget's item. + * + * This will change the value of item named @c name programatically. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * @param[in] value The value to set on the item. It should be typed as the + * item expects, preferably, or a conversion will take place + * + * @return @c true, on success, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs_Group + */ +EAPI Eina_Bool elm_prefs_item_value_set(Elm_Prefs *obj, const char *name, const Eina_Value *value); + +/** + * @brief Get the value of a given prefs widget's item. + * + * This will retrieve the value of item named @c name. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * to get value from + * @param[out] value Where to store the value of the item. It will be + * overwritten and setup with the type the item is bound to + * + * @return @c true, on success, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs_Group + */ +EAPI Eina_Bool elm_prefs_item_value_get(const Elm_Prefs *obj, const char *name, Eina_Value *value); + +/** + * @brief Get the Elementary widget bound to a given prefs widget's item. + * + * This will retrieve a handle to the real widget implementing a given item of + * @c prefs, for read-only actions. + * + * @warning You should never modify the state of the returned widget, because + * it's meant to be managed by @c prefs, solely. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * to get object from + * + * @return A valid widget handle, on success, or @c NULL, otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs_Group + */ +EAPI const Efl_Canvas_Object *elm_prefs_item_object_get(Elm_Prefs *obj, const char *name); + +/** + * @brief Set whether the widget bound to a given prefs widget's item is + * disabled or not. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * to act on + * @param[in] disabled @c true, to make it disabled, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs_Group + */ +EAPI void elm_prefs_item_disabled_set(Elm_Prefs *obj, const char *name, Eina_Bool disabled); + +/** + * @brief Get whether the widget bound to a given prefs widget's item is + * disabled or not. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * to get disabled state from + * + * @return @c true, if it is disabled, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs_Group + */ +EAPI Eina_Bool elm_prefs_item_disabled_get(const Elm_Prefs *obj, const char *name); + +/** + * @brief "Swallows" an object into a SWALLOW item of a prefs widget. + * + * @param[in] obj The object. + * @param[in] name The name of the SWALLOW item (as declared in the prefs + * collection) + * @param[in] child The object to occupy the item + * + * @return @c true, on success, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs_Group + */ +EAPI Eina_Bool elm_prefs_item_swallow(Elm_Prefs *obj, const char *name, Efl_Canvas_Object *child); + +/** + * @brief Set whether the widget bound to a given prefs widget's item is + * editable or not. + * + * @note Only @c TEXT or @c TEXTAREA items' default widgets implement the + * 'editable' property. Custom registered widgets may as well implement them. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * to act on + * @param[in] editable @c true, to make it editable, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs_Group + */ +EAPI void elm_prefs_item_editable_set(Elm_Prefs *obj, const char *name, Eina_Bool editable); + +/** + * @brief Get whether the widget bound to a given prefs widget's item is + * editable or not. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * to get editable state from + * + * @return @c true, if it is editable, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs_Group + */ +EAPI Eina_Bool elm_prefs_item_editable_get(const Elm_Prefs *obj, const char *name); + +/** + * @brief Unswallow an object from a SWALLOW item of a prefs widget. + * + * @param[in] obj The object. + * @param[in] name The name of the SWALLOW item (as declared in the prefs + * collection) + * + * @return The unswallowed object, or NULL on errors + * + * @since 1.8 + * + * @ingroup Elm_Prefs_Group + */ +EAPI Efl_Canvas_Object *elm_prefs_item_unswallow(Elm_Prefs *obj, const char *name); + +/** + * @brief Set whether the widget bound to given prefs widget's item should be + * visible or not. + * + * Each prefs item may have a default visibility state, declared on the $.epb + * @c prefs it was loaded with. By this call one may alter that state, + * programatically. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * to change visibility of + * @param[in] visible @c true, to make it visible, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs_Group + */ +EAPI void elm_prefs_item_visible_set(Elm_Prefs *obj, const char *name, Eina_Bool visible); + +/** + * @brief Get whether the widget bound to a given prefs widget's item is + * visible or not. + * + * @param[in] obj The object. + * @param[in] name The name of the item (as declared in the prefs collection) + * to get visibility state from + * + * @return @c true, if it is visible, @c false otherwise + * + * @since 1.8 + * + * @ingroup Elm_Prefs_Group + */ +EAPI Eina_Bool elm_prefs_item_visible_get(const Elm_Prefs *obj, const char *name); + +#endif diff --git a/src/lib/elementary/elm_prefs_legacy.h b/src/lib/elementary/elm_prefs_legacy.h index d3c1785fd2..e93d045757 100644 --- a/src/lib/elementary/elm_prefs_legacy.h +++ b/src/lib/elementary/elm_prefs_legacy.h @@ -61,7 +61,7 @@ EAPI Eina_Bool elm_prefs_file_set(Eo *obj, const char *file, const char *page); */ EAPI Eina_Bool elm_prefs_file_get(const Eo *obj, const char **file, const char **page); -#include "elm_prefs.eo.legacy.h" +#include "elm_prefs_eo.legacy.h" /** * @} */ diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h index 010643d7b5..478497468d 100644 --- a/src/lib/elementary/elm_priv.h +++ b/src/lib/elementary/elm_priv.h @@ -22,8 +22,11 @@ # include // Evas internal EO APIs +# include "Evas.h" # include "Evas_Internal.h" +#include "Elementary.h" +#include "Efl_Ui.h" # ifdef EAPI # undef EAPI # endif @@ -32,7 +35,7 @@ # endif # ifdef _WIN32 -# ifdef ELEMENTARY_BUILD +# ifdef EFL_BUILD # ifdef DLL_EXPORT # define EAPI __declspec(dllexport) # else @@ -61,14 +64,112 @@ # define EWAPI EAPI EAPI_WEAK # include "elm_widget.h" -# include "elm_access.eo.h" # include "elm_code_private.h" +#include "elm_access_eo.h" +#include "elm_actionslider_eo.h" +#include "elm_atspi_app_object_eo.h" +#include "elm_atspi_bridge_eo.h" +#include "elm_box_eo.h" +#include "elm_bubble_eo.h" +#include "elm_calendar_eo.h" +#include "elm_calendar_item_eo.h" +#include "elm_clock_eo.h" +#include "elm_code_widget_legacy_eo.h" +#include "elm_color_item_eo.h" +#include "elm_colorselector_eo.h" +#include "elm_conformant_eo.h" +#include "elm_ctxpopup_eo.h" +#include "elm_ctxpopup_item_eo.h" +#include "elm_dayselector_eo.h" +#include "elm_dayselector_item_eo.h" +#include "elm_diskselector_eo.h" +#include "elm_diskselector_item_eo.h" +#include "elm_entry_eo.h" +#include "elm_fileselector_button_eo.h" +#include "elm_fileselector_entry_eo.h" +#include "elm_fileselector_eo.h" +#include "elm_flipselector_eo.h" +#include "elm_flipselector_item_eo.h" +#include "elm_gengrid_eo.h" +#include "elm_gengrid_item_eo.h" +#include "elm_gengrid_pan_eo.h" +#include "elm_genlist_eo.h" +#include "elm_genlist_item_eo.h" +#include "elm_genlist_pan_eo.h" +#include "elm_gesture_layer_eo.h" +#include "elm_glview_eo.h" +#include "elm_grid_eo.h" +#include "elm_hover_eo.h" +#include "elm_hoversel_eo.h" +#include "elm_hoversel_item_eo.h" +#include "elm_icon_eo.h" +#include "elm_image_eo.h" +#include "elm_index_eo.h" +#include "elm_index_item_eo.h" +#include "elm_interface_fileselector_eo.h" +#include "elm_inwin_eo.h" +#include "elm_label_eo.h" +#include "elm_list_eo.h" +#include "elm_list_item_eo.h" +#include "elm_mapbuf_eo.h" +#include "elm_map_eo.h" +#include "elm_map_pan_eo.h" +#include "elm_menu_eo.h" +#include "elm_menu_item_eo.h" +#include "elm_multibuttonentry_eo.h" +#include "elm_multibuttonentry_item_eo.h" +#include "elm_naviframe_eo.h" +#include "elm_naviframe_item_eo.h" +#include "elm_notify_eo.h" +#include "elm_panel_eo.h" +#include "elm_pan_eo.h" +#include "elm_photo_eo.h" +#include "elm_player_eo.h" +#include "elm_plug_eo.h" +#include "elm_popup_eo.h" +#include "elm_popup_item_eo.h" +#include "elm_prefs_eo.h" +#include "elm_route_eo.h" +#include "elm_scroller_eo.h" +#include "elm_segment_control_eo.h" +#include "elm_segment_control_item_eo.h" +#include "elm_separator_eo.h" +#include "elm_slider_eo.h" +#include "elm_slider_part_indicator_eo.h" +#include "elm_slideshow_eo.h" +#include "elm_slideshow_item_eo.h" +#include "elm_spinner_eo.h" +#include "elm_sys_notify_dbus_eo.h" +#include "elm_sys_notify_eo.h" +#include "elm_sys_notify_interface_eo.h" +#include "elm_systray_eo.h" +#include "elm_table_eo.h" +#include "elm_thumb_eo.h" +#include "elm_toolbar_eo.h" +#include "elm_toolbar_item_eo.h" +#include "elm_web_eo.h" +#include "elm_widget_item_container_eo.h" +#include "elm_widget_item_eo.h" +#include "elm_widget_item_static_focus_eo.h" +#include "elm_win_eo.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_ui_selection_manager.eo.h" +# include "elm_widget_item_static_focus_eo.h" +# include "efl_ui_selection_manager.eo.h" # include "efl_datetime_manager.eo.h" +# include "efl_ui_size_model.eo.h" +# include "efl_ui_homogeneous_model.eo.h" +# include "efl_ui_exact_model.eo.h" +# include "efl_ui_average_model.eo.h" + +extern const char *_efl_model_property_itemw; +extern const char *_efl_model_property_itemh; +extern const char *_efl_model_property_selfw; +extern const char *_efl_model_property_selfh; +extern const char *_efl_model_property_totalw; +extern const char *_efl_model_property_totalh; # ifdef HAVE_LANGINFO_H # include @@ -166,7 +267,7 @@ struct _Efl_Ui_Theme_Data * the users config doesn't need to be wiped - simply new values need * to be put in */ -# define ELM_CONFIG_FILE_GENERATION 0x0014 +# define ELM_CONFIG_FILE_GENERATION 0x0015 # define ELM_CONFIG_VERSION_EPOCH_OFFSET 16 # define ELM_CONFIG_VERSION ((ELM_CONFIG_EPOCH << ELM_CONFIG_VERSION_EPOCH_OFFSET) | \ ELM_CONFIG_FILE_GENERATION) @@ -578,7 +679,7 @@ void _elm_win_standard_init(Eo *win); Ecore_X_Window _elm_ee_xwin_get(const Ecore_Evas *ee); -Efl_Ui_Theme_Apply_Result _elm_theme_object_set(Evas_Object *parent, +Eina_Error _elm_theme_object_set(Evas_Object *parent, Evas_Object *o, const char *clas, const char *group, @@ -586,7 +687,7 @@ Efl_Ui_Theme_Apply_Result _elm_theme_object_set(Evas_Object *parent, Eina_Bool _elm_theme_object_icon_set(Evas_Object *o, const char *group, const char *style); -Efl_Ui_Theme_Apply_Result _elm_theme_set(Elm_Theme *th, +Eina_Error _elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *group, @@ -633,7 +734,7 @@ void _elm_config_sub_init(void); void _elm_config_shutdown(void); void _elm_config_sub_shutdown(void); Eina_Bool _elm_config_save(Elm_Config *cfg, const char *profile); -void _elm_config_reload(Eina_Bool on_flush); +void _elm_config_reload(void); size_t _elm_config_user_dir_snprintf(char *dst, size_t size, const char *fmt, ...) EINA_PRINTF(3, 4); @@ -773,12 +874,15 @@ void _elm_widget_full_eval_children(Eo *obj, Elm_Widget_Smart_Da 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_transition_pack(Eo *obj, int index); +EOAPI void efl_page_transition_unpack_all(Eo *obj); +EOAPI void efl_page_transition_curr_page_change(Eo *obj, int diff); +EOAPI Eina_Bool 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); +EOAPI void efl_page_indicator_unpack(Eo *obj, int index); +EOAPI void efl_page_indicator_unpack_all(Eo *obj); Eina_Bool _elm_config_accel_preference_parse(const char *pref, Eina_Stringshare **accel, int *gl_depth, int *gl_stencil, int *gl_msaa); @@ -799,6 +903,8 @@ extern const char SIG_WIDGET_ACCESS_CHANGED[]; extern const char SIG_LAYOUT_FOCUSED[]; extern const char SIG_LAYOUT_UNFOCUSED[]; +extern Eina_Stringshare *_property_style_ss; + extern Eina_Bool _config_profile_lock; # ifdef HAVE_ELEMENTARY_WL2 @@ -866,7 +972,7 @@ void efl_ui_slider_move_knob(Evas_Object *obj, double button_x, double button_y) # define ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(_pfx, _typ) \ EOLIAN static Eina_Bool \ -_##_pfx##_efl_ui_widget_widget_event(Eo *obj, _typ *_pd EINA_UNUSED, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED) \ +_##_pfx##_efl_ui_widget_widget_input_event_handler(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.h b/src/lib/elementary/elm_progressbar.h index 7df3b3e052..8c57fcf76a 100644 --- a/src/lib/elementary/elm_progressbar.h +++ b/src/lib/elementary/elm_progressbar.h @@ -63,9 +63,6 @@ */ #include "elm_progressbar_common.h" -#ifdef EFL_EO_API_SUPPORT -#include "efl_ui_progressbar_eo.h" -#endif #ifndef EFL_NOLEGACY_API_SUPPORT #include "elm_progressbar_legacy.h" #endif diff --git a/src/lib/elementary/elm_radio.h b/src/lib/elementary/elm_radio.h index 4a58cac81d..dfedb190c9 100644 --- a/src/lib/elementary/elm_radio.h +++ b/src/lib/elementary/elm_radio.h @@ -64,10 +64,6 @@ * @{ */ -#ifdef EFL_EO_API_SUPPORT -#include "efl_ui_radio_eo.h" -#define EFL_UI_RADIO_EVENT_CHANGED EFL_UI_NSTATE_EVENT_CHANGED -#endif #ifndef EFL_NOLEGACY_API_SUPPORT #include "elm_radio_legacy.h" #endif diff --git a/src/lib/elementary/elm_radio_legacy.h b/src/lib/elementary/elm_radio_legacy.h index ba8b71c53e..35a4741ad1 100644 --- a/src/lib/elementary/elm_radio_legacy.h +++ b/src/lib/elementary/elm_radio_legacy.h @@ -31,4 +31,4 @@ EAPI void elm_radio_value_set(Evas_Object *obj, int value) */ EAPI int elm_radio_value_get(const Evas_Object *obj); -#include "efl_ui_radio.eo.legacy.h" +#include "efl_ui_radio_eo.legacy.h" diff --git a/src/lib/elementary/elm_removed.h b/src/lib/elementary/elm_removed.h index 2b4ea56d84..e6e9795135 100644 --- a/src/lib/elementary/elm_removed.h +++ b/src/lib/elementary/elm_removed.h @@ -238,7 +238,7 @@ EINA_DEPRECATED EAPI void elm_cache_flush_interval_all_set(int size); * applications on the display. * * @param enabled The cache flush enabled state - * @deprecated Use elm_cache_flush_enabled_set adnd elm_config_all_flush() + * @deprecated Use elm_cache_flush_enabled_set and elm_config_all_flush() * @ingroup Elm_Caches */ EINA_DEPRECATED EAPI void elm_cache_flush_enabled_all_set(Eina_Bool enabled); diff --git a/src/lib/elementary/elm_route.c b/src/lib/elementary/elm_route.c index dc8b861974..be51b20704 100644 --- a/src/lib/elementary/elm_route.c +++ b/src/lib/elementary/elm_route.c @@ -86,12 +86,12 @@ _move_resize_cb(void *data EINA_UNUSED, _sizing_eval(obj); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_route_efl_ui_widget_theme_apply(Eo *obj, Elm_Route_Data *sd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; //TODO @@ -138,7 +138,6 @@ _elm_route_efl_canvas_group_group_add(Eo *obj, Elm_Route_Data *priv) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_FALSE); evas_object_event_callback_add @@ -265,4 +264,4 @@ _elm_route_class_constructor(Efl_Class *klass) #define ELM_ROUTE_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_route) -#include "elm_route.eo.c" +#include "elm_route_eo.c" diff --git a/src/lib/elementary/elm_route.eo b/src/lib/elementary/elm_route.eo deleted file mode 100644 index 0df51d4e0f..0000000000 --- a/src/lib/elementary/elm_route.eo +++ /dev/null @@ -1,47 +0,0 @@ -class Elm.Route extends Efl.Ui.Widget implements Efl.Ui.Legacy -{ - [[Elementary route class]] - legacy_prefix: elm_route; - eo_prefix: elm_obj_route; - methods { - @property emap { - set { - [[Set map widget for this route]] - } - values { - emap: void_ptr; [[Elementary map widget]] - } - } - @property longitude_min_max { - get { - [[Get the minimum and maximum values along the longitude. - - Note: If only one value is needed, the other pointer can be - passed as null. - ]] - } - values { - min: double; [[Pointer to store the minimum value.]] - max: double; [[Pointer to store the maximum value.]] - } - } - @property latitude_min_max { - get { - [[Get the minimum and maximum values along the latitude. - - Note: If only one value is needed, the other pointer can be - passed as null. - ]] - } - values { - min: double; [[Pointer to store the minimum value.]] - max: double; [[Pointer to store the maximum value.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.theme_apply; - } -} diff --git a/src/lib/elementary/elm_route_eo.c b/src/lib/elementary/elm_route_eo.c new file mode 100644 index 0000000000..930eacdc30 --- /dev/null +++ b/src/lib/elementary/elm_route_eo.c @@ -0,0 +1,56 @@ + +void _elm_route_emap_set(Eo *obj, Elm_Route_Data *pd, void *emap); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_route_emap_set, EFL_FUNC_CALL(emap), void *emap); + +void _elm_route_longitude_min_max_get(const Eo *obj, Elm_Route_Data *pd, double *min, double *max); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_route_longitude_min_max_get, EFL_FUNC_CALL(min, max), double *min, double *max); + +void _elm_route_latitude_min_max_get(const Eo *obj, Elm_Route_Data *pd, double *min, double *max); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_route_latitude_min_max_get, EFL_FUNC_CALL(min, max), double *min, double *max); + +Efl_Object *_elm_route_efl_object_constructor(Eo *obj, Elm_Route_Data *pd); + + +Eina_Error _elm_route_efl_ui_widget_theme_apply(Eo *obj, Elm_Route_Data *pd); + + +static Eina_Bool +_elm_route_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_ROUTE_EXTRA_OPS +#define ELM_ROUTE_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_route_emap_set, _elm_route_emap_set), + EFL_OBJECT_OP_FUNC(elm_obj_route_longitude_min_max_get, _elm_route_longitude_min_max_get), + EFL_OBJECT_OP_FUNC(elm_obj_route_latitude_min_max_get, _elm_route_latitude_min_max_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_route_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_route_efl_ui_widget_theme_apply), + ELM_ROUTE_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_route_class_desc = { + EO_VERSION, + "Elm.Route", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Route_Data), + _elm_route_class_initializer, + _elm_route_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_route_class_get, &_elm_route_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_route_eo.legacy.c" diff --git a/src/lib/elementary/elm_route_eo.h b/src/lib/elementary/elm_route_eo.h new file mode 100644 index 0000000000..a1946233e8 --- /dev/null +++ b/src/lib/elementary/elm_route_eo.h @@ -0,0 +1,60 @@ +#ifndef _ELM_ROUTE_EO_H_ +#define _ELM_ROUTE_EO_H_ + +#ifndef _ELM_ROUTE_EO_CLASS_TYPE +#define _ELM_ROUTE_EO_CLASS_TYPE + +typedef Eo Elm_Route; + +#endif + +#ifndef _ELM_ROUTE_EO_TYPES +#define _ELM_ROUTE_EO_TYPES + + +#endif +/** Elementary route class + * + * @ingroup Elm_Route + */ +#define ELM_ROUTE_CLASS elm_route_class_get() + +EWAPI const Efl_Class *elm_route_class_get(void); + +/** + * @brief Set map widget for this route + * + * @param[in] obj The object. + * @param[in] emap Elementary map widget + * + * @ingroup Elm_Route + */ +EOAPI void elm_obj_route_emap_set(Eo *obj, void *emap); + +/** + * @brief Get the minimum and maximum values along the longitude. + * + * @note If only one value is needed, the other pointer can be passed as null. + * + * @param[in] obj The object. + * @param[out] min Pointer to store the minimum value. + * @param[out] max Pointer to store the maximum value. + * + * @ingroup Elm_Route + */ +EOAPI void elm_obj_route_longitude_min_max_get(const Eo *obj, double *min, double *max); + +/** + * @brief Get the minimum and maximum values along the latitude. + * + * @note If only one value is needed, the other pointer can be passed as null. + * + * @param[in] obj The object. + * @param[out] min Pointer to store the minimum value. + * @param[out] max Pointer to store the maximum value. + * + * @ingroup Elm_Route + */ +EOAPI void elm_obj_route_latitude_min_max_get(const Eo *obj, double *min, double *max); + +#endif diff --git a/src/lib/elementary/elm_route_eo.legacy.c b/src/lib/elementary/elm_route_eo.legacy.c new file mode 100644 index 0000000000..69d8a8b77e --- /dev/null +++ b/src/lib/elementary/elm_route_eo.legacy.c @@ -0,0 +1,18 @@ + +EAPI void +elm_route_emap_set(Elm_Route *obj, void *emap) +{ + elm_obj_route_emap_set(obj, emap); +} + +EAPI void +elm_route_longitude_min_max_get(const Elm_Route *obj, double *min, double *max) +{ + elm_obj_route_longitude_min_max_get(obj, min, max); +} + +EAPI void +elm_route_latitude_min_max_get(const Elm_Route *obj, double *min, double *max) +{ + elm_obj_route_latitude_min_max_get(obj, min, max); +} diff --git a/src/lib/elementary/elm_route_eo.legacy.h b/src/lib/elementary/elm_route_eo.legacy.h new file mode 100644 index 0000000000..34650bd62e --- /dev/null +++ b/src/lib/elementary/elm_route_eo.legacy.h @@ -0,0 +1,53 @@ +#ifndef _ELM_ROUTE_EO_LEGACY_H_ +#define _ELM_ROUTE_EO_LEGACY_H_ + +#ifndef _ELM_ROUTE_EO_CLASS_TYPE +#define _ELM_ROUTE_EO_CLASS_TYPE + +typedef Eo Elm_Route; + +#endif + +#ifndef _ELM_ROUTE_EO_TYPES +#define _ELM_ROUTE_EO_TYPES + + +#endif + +/** + * @brief Set map widget for this route + * + * @param[in] obj The object. + * @param[in] emap Elementary map widget + * + * @ingroup Elm_Route_Group + */ +EAPI void elm_route_emap_set(Elm_Route *obj, void *emap); + +/** + * @brief Get the minimum and maximum values along the longitude. + * + * @note If only one value is needed, the other pointer can be passed as null. + * + * @param[in] obj The object. + * @param[out] min Pointer to store the minimum value. + * @param[out] max Pointer to store the maximum value. + * + * @ingroup Elm_Route_Group + */ +EAPI void elm_route_longitude_min_max_get(const Elm_Route *obj, double *min, double *max); + +/** + * @brief Get the minimum and maximum values along the latitude. + * + * @note If only one value is needed, the other pointer can be passed as null. + * + * @param[in] obj The object. + * @param[out] min Pointer to store the minimum value. + * @param[out] max Pointer to store the maximum value. + * + * @ingroup Elm_Route_Group + */ +EAPI void elm_route_latitude_min_max_get(const Elm_Route *obj, double *min, double *max); + +#endif diff --git a/src/lib/elementary/elm_route_legacy.h b/src/lib/elementary/elm_route_legacy.h index ad320dc5dd..7326024abd 100644 --- a/src/lib/elementary/elm_route_legacy.h +++ b/src/lib/elementary/elm_route_legacy.h @@ -8,4 +8,4 @@ */ EAPI Evas_Object *elm_route_add(Evas_Object *parent); -#include "elm_route.eo.legacy.h" \ No newline at end of file +#include "elm_route_eo.legacy.h" \ No newline at end of file diff --git a/src/lib/elementary/elm_scroller.c b/src/lib/elementary/elm_scroller.c index b32067e2cf..1eec6d866e 100644 --- a/src/lib/elementary/elm_scroller.c +++ b/src/lib/elementary/elm_scroller.c @@ -10,10 +10,11 @@ #include "elm_priv.h" #include "elm_interface_scrollable.h" +#include "elm_pan_eo.h" #include "elm_widget_layout.h" #include "elm_widget_scroller.h" -#include "elm_scroller.eo.h" +#include "elm_scroller_eo.h" #include "elm_scroller_part.eo.h" #include "elm_part_helper.h" @@ -398,12 +399,12 @@ _mirrored_set(Evas_Object *obj, efl_ui_mirrored_set(obj, mirrored); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_scroller_efl_ui_widget_theme_apply(Eo *obj, Elm_Scroller_Data *sd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _mirrored_set(obj, efl_ui_mirrored_get(obj)); @@ -690,6 +691,7 @@ _elm_scroller_content_set(Eo *obj, Elm_Scroller_Data *sd, const char *part, Evas sd->proxy_content[i] = NULL; } } + efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, content); elm_layout_sizing_eval(obj); @@ -725,6 +727,7 @@ _elm_scroller_content_unset(Eo *obj, Elm_Scroller_Data *sd, const char *part) _elm_widget_sub_object_redirect_to_top(obj, sd->content); elm_interface_scrollable_content_set(obj, NULL); sd->content = NULL; + efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, NULL); return ret; } @@ -775,7 +778,6 @@ _elm_scroller_efl_canvas_group_group_add(Eo *obj, Elm_Scroller_Data *priv) Evas_Coord minw, minh; 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 @@ -783,6 +785,7 @@ _elm_scroller_efl_canvas_group_group_add(Eo *obj, Elm_Scroller_Data *priv) CRI("Failed to set layout!"); priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj)); + evas_object_data_set(priv->hit_rect, "_elm_leaveme", obj); evas_object_smart_member_add(priv->hit_rect, obj); elm_widget_sub_object_add(obj, priv->hit_rect); @@ -884,11 +887,6 @@ _focused_element(void *data, const Efl_Event *event) 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_entity_geometry_get(obj); - geom.x = geom.y = 0; - elm_widget_show_region_set(obj, geom, EINA_TRUE); - } EOLIAN static Eo * @@ -898,7 +896,7 @@ _elm_scroller_efl_object_constructor(Eo *obj, Elm_Scroller_Data *_pd EINA_UNUSED efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_SCROLL_PANE); - efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED, _focused_element, obj); + efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _focused_element, obj); legacy_efl_ui_focus_manager_widget_legacy_signals(obj, obj); return obj; @@ -1393,4 +1391,4 @@ ELM_PART_OVERRIDE_CONTENT_UNSET(elm_scroller, ELM_SCROLLER, Elm_Scroller_Data) ELM_LAYOUT_SIZING_EVAL_OPS(elm_scroller), \ EFL_CANVAS_GROUP_ADD_OPS(elm_scroller) -#include "elm_scroller.eo.c" +#include "elm_scroller_eo.c" diff --git a/src/lib/elementary/elm_scroller.eo b/src/lib/elementary/elm_scroller.eo deleted file mode 100644 index 843386f85d..0000000000 --- a/src/lib/elementary/elm_scroller.eo +++ /dev/null @@ -1,78 +0,0 @@ -class Elm.Scroller extends Efl.Ui.Layout implements Elm.Interface_Scrollable, - Efl.Access.Widget.Action, - Efl.Ui.Scrollable, Efl.Content, Efl.Ui.Legacy -{ - [[Elementary scroller class]] - legacy_prefix: elm_scroller; - eo_prefix: elm_obj_scroller; - event_prefix: elm_scroller; - methods { - @property custom_widget_base_theme { - set { - [[Set custom theme elements for the scroller]] - } - values { - klass: string; [[Klass name]] - group: string; [[Group name]] - } - } - page_scroll_limit_set @const { - [[Set the maximum of the movable page at a flicking. - - The value of maximum movable page should be more than 1. - - @since 1.8 - ]] - params { - @in page_limit_h: int; [[The maximum of the movable horizontal page]] - @in page_limit_v: int; [[The maximum of the movable vertical page]] - } - } - page_scroll_limit_get @const { - [[Get the maximum of the movable page at a flicking. - - @since 1.8 - ]] - params { - @in page_limit_h: ptr(int); [[The maximum of the movable horizontal page]] - @in page_limit_v: ptr(int); [[The maximum of the movable vertical page]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - 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; - 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_get; - Efl.Ui.Widget.focus_state_apply; - } - events { - 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_scroller_eo.c b/src/lib/elementary/elm_scroller_eo.c new file mode 100644 index 0000000000..aa977dd549 --- /dev/null +++ b/src/lib/elementary/elm_scroller_eo.c @@ -0,0 +1,150 @@ +EWAPI const Efl_Event_Description _ELM_SCROLLER_EVENT_SCROLL_PAGE_CHANGED = + EFL_EVENT_DESCRIPTION("scroll,page,changed"); +EWAPI const Efl_Event_Description _ELM_SCROLLER_EVENT_HBAR_UNPRESS = + EFL_EVENT_DESCRIPTION("hbar,unpress"); +EWAPI const Efl_Event_Description _ELM_SCROLLER_EVENT_HBAR_PRESS = + EFL_EVENT_DESCRIPTION("hbar,press"); +EWAPI const Efl_Event_Description _ELM_SCROLLER_EVENT_HBAR_DRAG = + EFL_EVENT_DESCRIPTION("hbar,drag"); +EWAPI const Efl_Event_Description _ELM_SCROLLER_EVENT_VBAR_UNPRESS = + EFL_EVENT_DESCRIPTION("vbar,unpress"); +EWAPI const Efl_Event_Description _ELM_SCROLLER_EVENT_VBAR_PRESS = + EFL_EVENT_DESCRIPTION("vbar,press"); +EWAPI const Efl_Event_Description _ELM_SCROLLER_EVENT_VBAR_DRAG = + EFL_EVENT_DESCRIPTION("vbar,drag"); +EWAPI const Efl_Event_Description _ELM_SCROLLER_EVENT_SCROLL_LEFT = + EFL_EVENT_DESCRIPTION("scroll,left"); +EWAPI const Efl_Event_Description _ELM_SCROLLER_EVENT_SCROLL_RIGHT = + EFL_EVENT_DESCRIPTION("scroll,right"); +EWAPI const Efl_Event_Description _ELM_SCROLLER_EVENT_SCROLL_UP = + EFL_EVENT_DESCRIPTION("scroll,up"); +EWAPI const Efl_Event_Description _ELM_SCROLLER_EVENT_SCROLL_DOWN = + EFL_EVENT_DESCRIPTION("scroll,down"); +EWAPI const Efl_Event_Description _ELM_SCROLLER_EVENT_EDGE_LEFT = + EFL_EVENT_DESCRIPTION("edge,left"); +EWAPI const Efl_Event_Description _ELM_SCROLLER_EVENT_EDGE_RIGHT = + EFL_EVENT_DESCRIPTION("edge,right"); +EWAPI const Efl_Event_Description _ELM_SCROLLER_EVENT_EDGE_TOP = + EFL_EVENT_DESCRIPTION("edge,top"); +EWAPI const Efl_Event_Description _ELM_SCROLLER_EVENT_EDGE_BOTTOM = + EFL_EVENT_DESCRIPTION("edge,bottom"); + +void _elm_scroller_custom_widget_base_theme_set(Eo *obj, Elm_Scroller_Data *pd, const char *klass, const char *group); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_scroller_custom_widget_base_theme_set, EFL_FUNC_CALL(klass, group), const char *klass, const char *group); + +void _elm_scroller_page_scroll_limit_set(const Eo *obj, Elm_Scroller_Data *pd, int page_limit_h, int page_limit_v); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_scroller_page_scroll_limit_set, EFL_FUNC_CALL(page_limit_h, page_limit_v), int page_limit_h, int page_limit_v); + +void _elm_scroller_page_scroll_limit_get(const Eo *obj, Elm_Scroller_Data *pd, int *page_limit_h, int *page_limit_v); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_scroller_page_scroll_limit_get, EFL_FUNC_CALL(page_limit_h, page_limit_v), int *page_limit_h, int *page_limit_v); + +Efl_Object *_elm_scroller_efl_object_constructor(Eo *obj, Elm_Scroller_Data *pd); + + +void _elm_scroller_efl_gfx_entity_position_set(Eo *obj, Elm_Scroller_Data *pd, Eina_Position2D pos); + + +void _elm_scroller_efl_gfx_entity_size_set(Eo *obj, Elm_Scroller_Data *pd, Eina_Size2D size); + + +void _elm_scroller_efl_canvas_group_group_member_add(Eo *obj, Elm_Scroller_Data *pd, Efl_Canvas_Object *sub_obj); + + +Eina_Bool _elm_scroller_efl_content_content_set(Eo *obj, Elm_Scroller_Data *pd, Efl_Gfx_Entity *content); + + +Efl_Gfx_Entity *_elm_scroller_efl_content_content_get(const Eo *obj, Elm_Scroller_Data *pd); + + +Efl_Gfx_Entity *_elm_scroller_efl_content_content_unset(Eo *obj, Elm_Scroller_Data *pd); + + +Eina_Error _elm_scroller_efl_ui_widget_theme_apply(Eo *obj, Elm_Scroller_Data *pd); + + +Eina_Bool _elm_scroller_efl_ui_widget_on_access_activate(Eo *obj, Elm_Scroller_Data *pd, Efl_Ui_Activate act); + + +Eina_Bool _elm_scroller_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Scroller_Data *pd, Efl_Canvas_Object *sub_obj); + + +Eina_Bool _elm_scroller_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Scroller_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +void _elm_scroller_elm_interface_scrollable_page_size_set(Eo *obj, Elm_Scroller_Data *pd, int x, int y); + + +void _elm_scroller_elm_interface_scrollable_policy_set(Eo *obj, Elm_Scroller_Data *pd, Elm_Scroller_Policy hbar, Elm_Scroller_Policy vbar); + + +void _elm_scroller_elm_interface_scrollable_single_direction_set(Eo *obj, Elm_Scroller_Data *pd, Elm_Scroller_Single_Direction single_dir); + + +Elm_Scroller_Single_Direction _elm_scroller_elm_interface_scrollable_single_direction_get(const Eo *obj, Elm_Scroller_Data *pd); + + +const Efl_Access_Action_Data *_elm_scroller_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Scroller_Data *pd); + + +Efl_Object *_elm_scroller_efl_part_part_get(const Eo *obj, Elm_Scroller_Data *pd, const char *name); + + +Eina_Bool _elm_scroller_efl_ui_widget_focus_state_apply(Eo *obj, Elm_Scroller_Data *pd, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect); + + +static Eina_Bool +_elm_scroller_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_SCROLLER_EXTRA_OPS +#define ELM_SCROLLER_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_scroller_custom_widget_base_theme_set, _elm_scroller_custom_widget_base_theme_set), + EFL_OBJECT_OP_FUNC(elm_obj_scroller_page_scroll_limit_set, _elm_scroller_page_scroll_limit_set), + EFL_OBJECT_OP_FUNC(elm_obj_scroller_page_scroll_limit_get, _elm_scroller_page_scroll_limit_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_scroller_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_scroller_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_scroller_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_canvas_group_member_add, _elm_scroller_efl_canvas_group_group_member_add), + EFL_OBJECT_OP_FUNC(efl_content_set, _elm_scroller_efl_content_content_set), + EFL_OBJECT_OP_FUNC(efl_content_get, _elm_scroller_efl_content_content_get), + EFL_OBJECT_OP_FUNC(efl_content_unset, _elm_scroller_efl_content_content_unset), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_scroller_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_activate, _elm_scroller_efl_ui_widget_on_access_activate), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _elm_scroller_efl_ui_widget_widget_sub_object_del), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_scroller_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_page_size_set, _elm_scroller_elm_interface_scrollable_page_size_set), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_policy_set, _elm_scroller_elm_interface_scrollable_policy_set), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_single_direction_set, _elm_scroller_elm_interface_scrollable_single_direction_set), + EFL_OBJECT_OP_FUNC(elm_interface_scrollable_single_direction_get, _elm_scroller_elm_interface_scrollable_single_direction_get), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_scroller_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_scroller_efl_part_part_get), + EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_state_apply, _elm_scroller_efl_ui_widget_focus_state_apply), + ELM_SCROLLER_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_scroller_class_desc = { + EO_VERSION, + "Elm.Scroller", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Scroller_Data), + _elm_scroller_class_initializer, + _elm_scroller_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_scroller_class_get, &_elm_scroller_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_SCROLLABLE_INTERFACE, EFL_CONTENT_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_scroller_eo.legacy.c" diff --git a/src/lib/elementary/elm_scroller_eo.h b/src/lib/elementary/elm_scroller_eo.h new file mode 100644 index 0000000000..6d4dd6ce38 --- /dev/null +++ b/src/lib/elementary/elm_scroller_eo.h @@ -0,0 +1,183 @@ +#ifndef _ELM_SCROLLER_EO_H_ +#define _ELM_SCROLLER_EO_H_ + +#ifndef _ELM_SCROLLER_EO_CLASS_TYPE +#define _ELM_SCROLLER_EO_CLASS_TYPE + +typedef Eo Elm_Scroller; + +#endif + +#ifndef _ELM_SCROLLER_EO_TYPES +#define _ELM_SCROLLER_EO_TYPES + + +#endif +/** Elementary scroller class + * + * @ingroup Elm_Scroller + */ +#define ELM_SCROLLER_CLASS elm_scroller_class_get() + +EWAPI const Efl_Class *elm_scroller_class_get(void); + +/** + * @brief Set custom theme elements for the scroller + * + * @param[in] obj The object. + * @param[in] klass Klass name + * @param[in] group Group name + * + * @ingroup Elm_Scroller + */ +EOAPI void elm_obj_scroller_custom_widget_base_theme_set(Eo *obj, const char *klass, const char *group); + +/** + * @brief Set the maximum of the movable page at a flicking. + * + * The value of maximum movable page should be more than 1. + * + * @param[in] obj The object. + * @param[in] page_limit_h The maximum of the movable horizontal page + * @param[in] page_limit_v The maximum of the movable vertical page + * + * @since 1.8 + * + * @ingroup Elm_Scroller + */ +EOAPI void elm_obj_scroller_page_scroll_limit_set(const Eo *obj, int page_limit_h, int page_limit_v); + +/** + * @brief Get the maximum of the movable page at a flicking. + * + * @param[in] obj The object. + * @param[in] page_limit_h The maximum of the movable horizontal page + * @param[in] page_limit_v The maximum of the movable vertical page + * + * @since 1.8 + * + * @ingroup Elm_Scroller + */ +EOAPI void elm_obj_scroller_page_scroll_limit_get(const Eo *obj, int *page_limit_h, int *page_limit_v); + +EWAPI extern const Efl_Event_Description _ELM_SCROLLER_EVENT_SCROLL_PAGE_CHANGED; + +/** Called when scroll page changed + * + * @ingroup Elm_Scroller + */ +#define ELM_SCROLLER_EVENT_SCROLL_PAGE_CHANGED (&(_ELM_SCROLLER_EVENT_SCROLL_PAGE_CHANGED)) + +EWAPI extern const Efl_Event_Description _ELM_SCROLLER_EVENT_HBAR_UNPRESS; + +/** Called when horizontal bar is no longer pressed + * + * @ingroup Elm_Scroller + */ +#define ELM_SCROLLER_EVENT_HBAR_UNPRESS (&(_ELM_SCROLLER_EVENT_HBAR_UNPRESS)) + +EWAPI extern const Efl_Event_Description _ELM_SCROLLER_EVENT_HBAR_PRESS; + +/** Called when horizontal bar is pressed + * + * @ingroup Elm_Scroller + */ +#define ELM_SCROLLER_EVENT_HBAR_PRESS (&(_ELM_SCROLLER_EVENT_HBAR_PRESS)) + +EWAPI extern const Efl_Event_Description _ELM_SCROLLER_EVENT_HBAR_DRAG; + +/** Called when horizontal bar is dragged + * + * @ingroup Elm_Scroller + */ +#define ELM_SCROLLER_EVENT_HBAR_DRAG (&(_ELM_SCROLLER_EVENT_HBAR_DRAG)) + +EWAPI extern const Efl_Event_Description _ELM_SCROLLER_EVENT_VBAR_UNPRESS; + +/** Called when vertical bar is no longer pressed + * + * @ingroup Elm_Scroller + */ +#define ELM_SCROLLER_EVENT_VBAR_UNPRESS (&(_ELM_SCROLLER_EVENT_VBAR_UNPRESS)) + +EWAPI extern const Efl_Event_Description _ELM_SCROLLER_EVENT_VBAR_PRESS; + +/** Called when vertical bar is pressed + * + * @ingroup Elm_Scroller + */ +#define ELM_SCROLLER_EVENT_VBAR_PRESS (&(_ELM_SCROLLER_EVENT_VBAR_PRESS)) + +EWAPI extern const Efl_Event_Description _ELM_SCROLLER_EVENT_VBAR_DRAG; + +/** Called when vertical bar is dragged + * + * @ingroup Elm_Scroller + */ +#define ELM_SCROLLER_EVENT_VBAR_DRAG (&(_ELM_SCROLLER_EVENT_VBAR_DRAG)) + +EWAPI extern const Efl_Event_Description _ELM_SCROLLER_EVENT_SCROLL_LEFT; + +/** Called when scrolling to left + * + * @ingroup Elm_Scroller + */ +#define ELM_SCROLLER_EVENT_SCROLL_LEFT (&(_ELM_SCROLLER_EVENT_SCROLL_LEFT)) + +EWAPI extern const Efl_Event_Description _ELM_SCROLLER_EVENT_SCROLL_RIGHT; + +/** Called when scrolling to right + * + * @ingroup Elm_Scroller + */ +#define ELM_SCROLLER_EVENT_SCROLL_RIGHT (&(_ELM_SCROLLER_EVENT_SCROLL_RIGHT)) + +EWAPI extern const Efl_Event_Description _ELM_SCROLLER_EVENT_SCROLL_UP; + +/** Called scrolled upwards + * + * @ingroup Elm_Scroller + */ +#define ELM_SCROLLER_EVENT_SCROLL_UP (&(_ELM_SCROLLER_EVENT_SCROLL_UP)) + +EWAPI extern const Efl_Event_Description _ELM_SCROLLER_EVENT_SCROLL_DOWN; + +/** Called when scrolled downwards + * + * @ingroup Elm_Scroller + */ +#define ELM_SCROLLER_EVENT_SCROLL_DOWN (&(_ELM_SCROLLER_EVENT_SCROLL_DOWN)) + +EWAPI extern const Efl_Event_Description _ELM_SCROLLER_EVENT_EDGE_LEFT; + +/** Called when hitting the left edge + * + * @ingroup Elm_Scroller + */ +#define ELM_SCROLLER_EVENT_EDGE_LEFT (&(_ELM_SCROLLER_EVENT_EDGE_LEFT)) + +EWAPI extern const Efl_Event_Description _ELM_SCROLLER_EVENT_EDGE_RIGHT; + +/** Called when hitting the right edge + * + * @ingroup Elm_Scroller + */ +#define ELM_SCROLLER_EVENT_EDGE_RIGHT (&(_ELM_SCROLLER_EVENT_EDGE_RIGHT)) + +EWAPI extern const Efl_Event_Description _ELM_SCROLLER_EVENT_EDGE_TOP; + +/** Called when hitting the top edge + * + * @ingroup Elm_Scroller + */ +#define ELM_SCROLLER_EVENT_EDGE_TOP (&(_ELM_SCROLLER_EVENT_EDGE_TOP)) + +EWAPI extern const Efl_Event_Description _ELM_SCROLLER_EVENT_EDGE_BOTTOM; + +/** Called when hitting the bottom edge + * + * @ingroup Elm_Scroller + */ +#define ELM_SCROLLER_EVENT_EDGE_BOTTOM (&(_ELM_SCROLLER_EVENT_EDGE_BOTTOM)) + +#endif diff --git a/src/lib/elementary/elm_scroller_eo.legacy.c b/src/lib/elementary/elm_scroller_eo.legacy.c new file mode 100644 index 0000000000..829d5de6ab --- /dev/null +++ b/src/lib/elementary/elm_scroller_eo.legacy.c @@ -0,0 +1,18 @@ + +EAPI void +elm_scroller_custom_widget_base_theme_set(Elm_Scroller *obj, const char *klass, const char *group) +{ + elm_obj_scroller_custom_widget_base_theme_set(obj, klass, group); +} + +EAPI void +elm_scroller_page_scroll_limit_set(const Elm_Scroller *obj, int page_limit_h, int page_limit_v) +{ + elm_obj_scroller_page_scroll_limit_set(obj, page_limit_h, page_limit_v); +} + +EAPI void +elm_scroller_page_scroll_limit_get(const Elm_Scroller *obj, int *page_limit_h, int *page_limit_v) +{ + elm_obj_scroller_page_scroll_limit_get(obj, page_limit_h, page_limit_v); +} diff --git a/src/lib/elementary/elm_scroller_eo.legacy.h b/src/lib/elementary/elm_scroller_eo.legacy.h new file mode 100644 index 0000000000..04dba3497a --- /dev/null +++ b/src/lib/elementary/elm_scroller_eo.legacy.h @@ -0,0 +1,56 @@ +#ifndef _ELM_SCROLLER_EO_LEGACY_H_ +#define _ELM_SCROLLER_EO_LEGACY_H_ + +#ifndef _ELM_SCROLLER_EO_CLASS_TYPE +#define _ELM_SCROLLER_EO_CLASS_TYPE + +typedef Eo Elm_Scroller; + +#endif + +#ifndef _ELM_SCROLLER_EO_TYPES +#define _ELM_SCROLLER_EO_TYPES + + +#endif + +/** + * @brief Set custom theme elements for the scroller + * + * @param[in] obj The object. + * @param[in] klass Klass name + * @param[in] group Group name + * + * @ingroup Elm_Scroller_Group + */ +EAPI void elm_scroller_custom_widget_base_theme_set(Elm_Scroller *obj, const char *klass, const char *group); + +/** + * @brief Set the maximum of the movable page at a flicking. + * + * The value of maximum movable page should be more than 1. + * + * @param[in] obj The object. + * @param[in] page_limit_h The maximum of the movable horizontal page + * @param[in] page_limit_v The maximum of the movable vertical page + * + * @since 1.8 + * + * @ingroup Elm_Scroller_Group + */ +EAPI void elm_scroller_page_scroll_limit_set(const Elm_Scroller *obj, int page_limit_h, int page_limit_v); + +/** + * @brief Get the maximum of the movable page at a flicking. + * + * @param[in] obj The object. + * @param[in] page_limit_h The maximum of the movable horizontal page + * @param[in] page_limit_v The maximum of the movable vertical page + * + * @since 1.8 + * + * @ingroup Elm_Scroller_Group + */ +EAPI void elm_scroller_page_scroll_limit_get(const Elm_Scroller *obj, int *page_limit_h, int *page_limit_v); + +#endif diff --git a/src/lib/elementary/elm_scroller_legacy.h b/src/lib/elementary/elm_scroller_legacy.h index f39a2bad3d..6b40eff78f 100644 --- a/src/lib/elementary/elm_scroller_legacy.h +++ b/src/lib/elementary/elm_scroller_legacy.h @@ -1,5 +1,5 @@ #include "elm_interface_scrollable.eo.legacy.h" -#include "elm_scroller.eo.legacy.h" +#include "elm_scroller_eo.legacy.h" /** * Type that blocks the scroll movement in one or more direction. @@ -416,7 +416,7 @@ EAPI void elm_scroller_region_bring_in(Evas_Object *obj * The scroller will adjust the view to glue itself as follows. * * x=0.0, for staying where it is relative to the left edge of the content - * x=1.0, for staying where it is relative to the rigth edge of the content + * x=1.0, for staying where it is relative to the right edge of the content * y=0.0, for staying where it is relative to the top edge of the content * y=1.0, for staying where it is relative to the bottom edge of the content * diff --git a/src/lib/elementary/elm_scroller_part.eo b/src/lib/elementary/elm_scroller_part.eo index 5b2c1b77ab..c66113c5f3 100644 --- a/src/lib/elementary/elm_scroller_part.eo +++ b/src/lib/elementary/elm_scroller_part.eo @@ -1,4 +1,4 @@ -class Elm.Scroller.Part extends Efl.Ui.Layout_Part_Legacy +class @beta Elm.Scroller.Part extends Efl.Ui.Layout_Part_Legacy { [[Elementary scroller internal part class]] data: null; diff --git a/src/lib/elementary/elm_segment_control.c b/src/lib/elementary/elm_segment_control.c index 3bcc7207d9..0a6a3d1a19 100644 --- a/src/lib/elementary/elm_segment_control.c +++ b/src/lib/elementary/elm_segment_control.c @@ -10,8 +10,8 @@ #include #include "elm_priv.h" -#include "elm_segment_control.eo.h" -#include "elm_segment_control_item.eo.h" +#include "elm_segment_control_eo.h" +#include "elm_segment_control_item_eo.h" #include "elm_widget_segment_control.h" #define MY_CLASS ELM_SEGMENT_CONTROL_CLASS @@ -215,16 +215,16 @@ _update_list(Elm_Segment_Control_Data *sd) } } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_segment_control_efl_ui_widget_theme_apply(Eo *obj, Elm_Segment_Control_Data *sd) { Eina_List *l; Eina_Bool rtl; Elm_Object_Item *eo_item; - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; rtl = efl_ui_mirrored_get(obj); @@ -244,15 +244,12 @@ _elm_segment_control_efl_ui_widget_theme_apply(Eo *obj, Elm_Segment_Control_Data return int_ret; } -EOLIAN static Eina_Bool -_elm_segment_control_efl_ui_widget_on_disabled_update(Eo *obj, Elm_Segment_Control_Data *sd, Eina_Bool disabled) + +EOLIAN static void +_elm_segment_control_efl_ui_widget_disabled_set(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; - + efl_ui_widget_disabled_set(efl_super(obj, MY_CLASS), disabled); _update_list(sd); - - return EINA_TRUE; } // TODO: elm_widget_focus_list_next_get supports only Elm_widget list, @@ -614,7 +611,6 @@ _elm_segment_control_efl_canvas_group_group_add(Eo *obj, Elm_Segment_Control_Dat { sd->obj = obj; efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set (obj, "segment_control", "base", elm_widget_style_get(obj))) @@ -832,5 +828,5 @@ _elm_segment_control_item_efl_ui_focus_object_focus_parent_get(const Eo *obj EIN ELM_LAYOUT_SIZING_EVAL_OPS(elm_segment_control), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_segment_control) -#include "elm_segment_control_item.eo.c" -#include "elm_segment_control.eo.c" +#include "elm_segment_control_item_eo.c" +#include "elm_segment_control_eo.c" diff --git a/src/lib/elementary/elm_segment_control.eo b/src/lib/elementary/elm_segment_control.eo deleted file mode 100644 index 5bbce6f6a0..0000000000 --- a/src/lib/elementary/elm_segment_control.eo +++ /dev/null @@ -1,147 +0,0 @@ -class Elm.Segment_Control extends Efl.Ui.Layout implements Efl.Ui.Focus.Composition, Efl.Ui.Legacy -{ - [[Elementary segment control class]] - legacy_prefix: elm_segment_control; - eo_prefix: elm_obj_segment_control; - event_prefix: elm_segment_control; - methods { - @property item_count { - get { - [[Get the Segment items count from segment control. - - It will just return the number of items added to segment control $obj.]] - return: int; [[Segment items count.]] - } - } - @property item_selected { - get { - [[Get the selected item. - - The selected item can be unselected with function - elm_segment_control_item_selected_set(). - - The selected item always will be highlighted on segment control.]] - - return: Elm.Widget.Item; [[The selected item or $NULL if none of segment items is selected.]] - - } - } - item_label_get @const { - [[Get the label of item. - - The return value is a pointer to the label associated to the item when - it was created, with function elm_segment_control_item_add(), or later - with function elm_object_item_text_set. If no label - was passed as argument, it will return $NULL.]] - - return: string; [[The label of the item at $index.]] - params { - @in idx: int; [[The index of the segment item.]] - } - } - item_insert_at { - [[Insert a new item to the segment control object at specified position. - - Index values must be between $0, when item will be prepended to - segment control, and items count, that can be get with - elm_segment_control_item_count_get(), case when item will be appended - to segment control, just like elm_segment_control_item_add(). - - Items created with this function can be deleted with function - elm_object_item_del() or elm_segment_control_item_del_at(). - - Note: $label set to $NULL is different from empty string "". - If an item - only has icon, it will be displayed bigger and centered. If it has - icon and label, even that an empty string, icon will be smaller and - positioned at left.]] - - return: Elm.Widget.Item; [[The created item or $NULL upon failure.]] - params { - @in icon: Efl.Canvas.Object @optional; [[The icon object to use for the left side of the item. An icon can be any Evas object, but usually it is an icon created with elm_icon_add().]] - @in label: string @optional; [[The label of the item.]] - @in idx: int; [[Item position. Value should be between 0 and items count.]] - } - } - item_get @const { - [[Get the item placed at specified index. - - Index is the position of an item in segment control widget. Its - range is from $0 to count - 1 . - Count is the number of items, that can be get with - elm_segment_control_item_count_get().]] - - return: Elm.Widget.Item; [[The segment control item or $NULL on failure.]] - params { - @in idx: int; [[The index of the segment item.]] - } - } - item_del_at { - [[Remove a segment control item at given index from its parent, deleting it. - - Items can be added with elm_segment_control_item_add() or elm_segment_control_item_insert_at().]] - - params { - @in idx: int; [[The position of the segment control item to be deleted.]] - } - } - item_add { - [[Append a new item to the segment control object. - - A new item will be created and appended to the segment control, i.e., will - be set as last item. - - If it should be inserted at another position, - elm_segment_control_item_insert_at() should be used instead. - - Items created with this function can be deleted with function - elm_object_item_del() or elm_object_item_del_at(). - - Note: $label set to $NULL is different from empty string "". - If an item - only has icon, it will be displayed bigger and centered. If it has - icon and label, even that an empty string, icon will be smaller and - positioned at left.]] - - /* FIXME-doc - Simple example: - @code - sc = elm_segment_control_add(win); - ic = elm_icon_add(win); - elm_image_file_set(ic, "path/to/image", NULL); - elm_icon_resizable_set(ic, true, true); - elm_segment_control_item_add(sc, ic, "label"); - evas_object_show(sc); - @endcode */ - - return: Elm.Widget.Item; [[The created item or $NULL upon failure.]] - params { - @in icon: Efl.Canvas.Object @optional; [[The icon object to use for the left side of the item. An icon can be any Evas object, but usually it is an icon created with elm_icon_add().]] - @in label: string @optional; [[The label of the item. Note that, NULL is different from empty string "".]] - } - } - item_icon_get @const { - [[Get the icon associated to the item. - - The return value is a pointer to the icon associated to the item when - it was created, with function elm_segment_control_item_add(), or later - with function elm_object_item_part_content_set(). If no icon - was passed as argument, it will return $NULL.]] - return: Efl.Canvas.Object; [[The left side icon associated to the item at $index.]] - params { - @in idx: int; [[The index of the segment item.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.theme_apply; - Efl.Ui.Widget.on_access_update; - Efl.Ui.Widget.on_disabled_update; - Efl.Ui.L10n.translation_update; - } - events { - changed: Efl.Object; [[Called when segment control changed]] - } -} diff --git a/src/lib/elementary/elm_segment_control_eo.c b/src/lib/elementary/elm_segment_control_eo.c new file mode 100644 index 0000000000..931b473543 --- /dev/null +++ b/src/lib/elementary/elm_segment_control_eo.c @@ -0,0 +1,95 @@ +EWAPI const Efl_Event_Description _ELM_SEGMENT_CONTROL_EVENT_CHANGED = + EFL_EVENT_DESCRIPTION("changed"); + +int _elm_segment_control_item_count_get(const Eo *obj, Elm_Segment_Control_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_segment_control_item_count_get, int, 0); + +Elm_Widget_Item *_elm_segment_control_item_selected_get(const Eo *obj, Elm_Segment_Control_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_segment_control_item_selected_get, Elm_Widget_Item *, NULL); + +const char *_elm_segment_control_item_label_get(const Eo *obj, Elm_Segment_Control_Data *pd, int idx); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_segment_control_item_label_get, const char *, NULL, EFL_FUNC_CALL(idx), int idx); + +Elm_Widget_Item *_elm_segment_control_item_insert_at(Eo *obj, Elm_Segment_Control_Data *pd, Efl_Canvas_Object *icon, const char *label, int idx); + +EOAPI EFL_FUNC_BODYV(elm_obj_segment_control_item_insert_at, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(icon, label, idx), Efl_Canvas_Object *icon, const char *label, int idx); + +Elm_Widget_Item *_elm_segment_control_item_get(const Eo *obj, Elm_Segment_Control_Data *pd, int idx); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_segment_control_item_get, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(idx), int idx); + +void _elm_segment_control_item_del_at(Eo *obj, Elm_Segment_Control_Data *pd, int idx); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_segment_control_item_del_at, EFL_FUNC_CALL(idx), int idx); + +Elm_Widget_Item *_elm_segment_control_item_add(Eo *obj, Elm_Segment_Control_Data *pd, Efl_Canvas_Object *icon, const char *label); + +EOAPI EFL_FUNC_BODYV(elm_obj_segment_control_item_add, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(icon, label), Efl_Canvas_Object *icon, const char *label); + +Efl_Canvas_Object *_elm_segment_control_item_icon_get(const Eo *obj, Elm_Segment_Control_Data *pd, int idx); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_segment_control_item_icon_get, Efl_Canvas_Object *, NULL, EFL_FUNC_CALL(idx), int idx); + +Efl_Object *_elm_segment_control_efl_object_constructor(Eo *obj, Elm_Segment_Control_Data *pd); + + +Eina_Error _elm_segment_control_efl_ui_widget_theme_apply(Eo *obj, Elm_Segment_Control_Data *pd); + + +void _elm_segment_control_efl_ui_widget_on_access_update(Eo *obj, Elm_Segment_Control_Data *pd, Eina_Bool enable); + + +void _elm_segment_control_efl_ui_widget_disabled_set(Eo *obj, Elm_Segment_Control_Data *pd, Eina_Bool disabled); + + +void _elm_segment_control_efl_ui_l10n_translation_update(Eo *obj, Elm_Segment_Control_Data *pd); + + +static Eina_Bool +_elm_segment_control_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_SEGMENT_CONTROL_EXTRA_OPS +#define ELM_SEGMENT_CONTROL_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_segment_control_item_count_get, _elm_segment_control_item_count_get), + EFL_OBJECT_OP_FUNC(elm_obj_segment_control_item_selected_get, _elm_segment_control_item_selected_get), + EFL_OBJECT_OP_FUNC(elm_obj_segment_control_item_label_get, _elm_segment_control_item_label_get), + EFL_OBJECT_OP_FUNC(elm_obj_segment_control_item_insert_at, _elm_segment_control_item_insert_at), + EFL_OBJECT_OP_FUNC(elm_obj_segment_control_item_get, _elm_segment_control_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_segment_control_item_del_at, _elm_segment_control_item_del_at), + EFL_OBJECT_OP_FUNC(elm_obj_segment_control_item_add, _elm_segment_control_item_add), + EFL_OBJECT_OP_FUNC(elm_obj_segment_control_item_icon_get, _elm_segment_control_item_icon_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_segment_control_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_segment_control_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_segment_control_efl_ui_widget_on_access_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_disabled_set, _elm_segment_control_efl_ui_widget_disabled_set), + EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_segment_control_efl_ui_l10n_translation_update), + ELM_SEGMENT_CONTROL_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_segment_control_class_desc = { + EO_VERSION, + "Elm.Segment_Control", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Segment_Control_Data), + _elm_segment_control_class_initializer, + _elm_segment_control_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_segment_control_class_get, &_elm_segment_control_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_segment_control_eo.legacy.c" diff --git a/src/lib/elementary/elm_segment_control_eo.h b/src/lib/elementary/elm_segment_control_eo.h new file mode 100644 index 0000000000..36c78056d1 --- /dev/null +++ b/src/lib/elementary/elm_segment_control_eo.h @@ -0,0 +1,186 @@ +#ifndef _ELM_SEGMENT_CONTROL_EO_H_ +#define _ELM_SEGMENT_CONTROL_EO_H_ + +#ifndef _ELM_SEGMENT_CONTROL_EO_CLASS_TYPE +#define _ELM_SEGMENT_CONTROL_EO_CLASS_TYPE + +typedef Eo Elm_Segment_Control; + +#endif + +#ifndef _ELM_SEGMENT_CONTROL_EO_TYPES +#define _ELM_SEGMENT_CONTROL_EO_TYPES + + +#endif +/** Elementary segment control class + * + * @ingroup Elm_Segment_Control + */ +#define ELM_SEGMENT_CONTROL_CLASS elm_segment_control_class_get() + +EWAPI const Efl_Class *elm_segment_control_class_get(void); + +/** + * @brief Get the Segment items count from segment control. + * + * It will just return the number of items added to segment control @c obj. + * + * @param[in] obj The object. + * + * @return Segment items count. + * + * @ingroup Elm_Segment_Control + */ +EOAPI int elm_obj_segment_control_item_count_get(const Eo *obj); + +/** + * @brief Get the selected item. + * + * The selected item can be unselected with function + * elm_segment_control_item_selected_set(). + * + * The selected item always will be highlighted on segment control. + * + * @param[in] obj The object. + * + * @return The selected item or @c NULL if none of segment items is selected. + * + * @ingroup Elm_Segment_Control + */ +EOAPI Elm_Widget_Item *elm_obj_segment_control_item_selected_get(const Eo *obj); + +/** + * @brief Get the label of item. + * + * The return value is a pointer to the label associated to the item when it + * was created, with function elm_segment_control_item_add(), or later with + * function elm_object_item_text_set. If no label was passed as argument, it + * will return @c NULL. + * + * @param[in] obj The object. + * @param[in] idx The index of the segment item. + * + * @return The label of the item at @c index. + * + * @ingroup Elm_Segment_Control + */ +EOAPI const char *elm_obj_segment_control_item_label_get(const Eo *obj, int idx); + +/** + * @brief Insert a new item to the segment control object at specified + * position. + * + * Index values must be between $0, when item will be prepended to segment + * control, and items count, that can be get with + * elm_segment_control_item_count_get(), case when item will be appended to + * segment control, just like elm_segment_control_item_add(). + * + * Items created with this function can be deleted with function + * elm_object_item_del() or elm_segment_control_item_del_at(). + * + * @note @c label set to @c NULL is different from empty string "". If an item + * only has icon, it will be displayed bigger and centered. If it has icon and + * label, even that an empty string, icon will be smaller and positioned at + * left. + * + * @param[in] obj The object. + * @param[in] icon The icon object to use for the left side of the item. An + * icon can be any Evas object, but usually it is an icon created with + * elm_icon_add(). + * @param[in] label The label of the item. + * @param[in] idx Item position. Value should be between 0 and items count. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Segment_Control + */ +EOAPI Elm_Widget_Item *elm_obj_segment_control_item_insert_at(Eo *obj, Efl_Canvas_Object *icon, const char *label, int idx); + +/** + * @brief Get the item placed at specified index. + * + * Index is the position of an item in segment control widget. Its range is + * from $0 to count - 1 . Count is the number of items, that can be + * get with elm_segment_control_item_count_get(). + * + * @param[in] obj The object. + * @param[in] idx The index of the segment item. + * + * @return The segment control item or @c NULL on failure. + * + * @ingroup Elm_Segment_Control + */ +EOAPI Elm_Widget_Item *elm_obj_segment_control_item_get(const Eo *obj, int idx); + +/** + * @brief Remove a segment control item at given index from its parent, + * deleting it. + * + * Items can be added with elm_segment_control_item_add() or + * elm_segment_control_item_insert_at(). + * + * @param[in] obj The object. + * @param[in] idx The position of the segment control item to be deleted. + * + * @ingroup Elm_Segment_Control + */ +EOAPI void elm_obj_segment_control_item_del_at(Eo *obj, int idx); + +/** + * @brief Append a new item to the segment control object. + * + * A new item will be created and appended to the segment control, i.e., will + * be set as last item. + * + * If it should be inserted at another position, + * elm_segment_control_item_insert_at() should be used instead. + * + * Items created with this function can be deleted with function + * elm_object_item_del() or elm_object_item_del_at(). + * + * @note @c label set to @c NULL is different from empty string "". If an item + * only has icon, it will be displayed bigger and centered. If it has icon and + * label, even that an empty string, icon will be smaller and positioned at + * left. + * + * @param[in] obj The object. + * @param[in] icon The icon object to use for the left side of the item. An + * icon can be any Evas object, but usually it is an icon created with + * elm_icon_add(). + * @param[in] label The label of the item. Note that, NULL is different from + * empty string "". + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Segment_Control + */ +EOAPI Elm_Widget_Item *elm_obj_segment_control_item_add(Eo *obj, Efl_Canvas_Object *icon, const char *label); + +/** + * @brief Get the icon associated to the item. + * + * The return value is a pointer to the icon associated to the item when it was + * created, with function elm_segment_control_item_add(), or later with + * function elm_object_item_part_content_set(). If no icon was passed as + * argument, it will return @c NULL. + * + * @param[in] obj The object. + * @param[in] idx The index of the segment item. + * + * @return The left side icon associated to the item at @c index. + * + * @ingroup Elm_Segment_Control + */ +EOAPI Efl_Canvas_Object *elm_obj_segment_control_item_icon_get(const Eo *obj, int idx); + +EWAPI extern const Efl_Event_Description _ELM_SEGMENT_CONTROL_EVENT_CHANGED; + +/** Called when segment control changed + * @return Efl_Object * + * + * @ingroup Elm_Segment_Control + */ +#define ELM_SEGMENT_CONTROL_EVENT_CHANGED (&(_ELM_SEGMENT_CONTROL_EVENT_CHANGED)) + +#endif diff --git a/src/lib/elementary/elm_segment_control_eo.legacy.c b/src/lib/elementary/elm_segment_control_eo.legacy.c new file mode 100644 index 0000000000..9fc4205990 --- /dev/null +++ b/src/lib/elementary/elm_segment_control_eo.legacy.c @@ -0,0 +1,48 @@ + +EAPI int +elm_segment_control_item_count_get(const Elm_Segment_Control *obj) +{ + return elm_obj_segment_control_item_count_get(obj); +} + +EAPI Elm_Widget_Item * +elm_segment_control_item_selected_get(const Elm_Segment_Control *obj) +{ + return elm_obj_segment_control_item_selected_get(obj); +} + +EAPI const char * +elm_segment_control_item_label_get(const Elm_Segment_Control *obj, int idx) +{ + return elm_obj_segment_control_item_label_get(obj, idx); +} + +EAPI Elm_Widget_Item * +elm_segment_control_item_insert_at(Elm_Segment_Control *obj, Efl_Canvas_Object *icon, const char *label, int idx) +{ + return elm_obj_segment_control_item_insert_at(obj, icon, label, idx); +} + +EAPI Elm_Widget_Item * +elm_segment_control_item_get(const Elm_Segment_Control *obj, int idx) +{ + return elm_obj_segment_control_item_get(obj, idx); +} + +EAPI void +elm_segment_control_item_del_at(Elm_Segment_Control *obj, int idx) +{ + elm_obj_segment_control_item_del_at(obj, idx); +} + +EAPI Elm_Widget_Item * +elm_segment_control_item_add(Elm_Segment_Control *obj, Efl_Canvas_Object *icon, const char *label) +{ + return elm_obj_segment_control_item_add(obj, icon, label); +} + +EAPI Efl_Canvas_Object * +elm_segment_control_item_icon_get(const Elm_Segment_Control *obj, int idx) +{ + return elm_obj_segment_control_item_icon_get(obj, idx); +} diff --git a/src/lib/elementary/elm_segment_control_eo.legacy.h b/src/lib/elementary/elm_segment_control_eo.legacy.h new file mode 100644 index 0000000000..02ce531ad8 --- /dev/null +++ b/src/lib/elementary/elm_segment_control_eo.legacy.h @@ -0,0 +1,170 @@ +#ifndef _ELM_SEGMENT_CONTROL_EO_LEGACY_H_ +#define _ELM_SEGMENT_CONTROL_EO_LEGACY_H_ + +#ifndef _ELM_SEGMENT_CONTROL_EO_CLASS_TYPE +#define _ELM_SEGMENT_CONTROL_EO_CLASS_TYPE + +typedef Eo Elm_Segment_Control; + +#endif + +#ifndef _ELM_SEGMENT_CONTROL_EO_TYPES +#define _ELM_SEGMENT_CONTROL_EO_TYPES + + +#endif + +/** + * @brief Get the Segment items count from segment control. + * + * It will just return the number of items added to segment control @c obj. + * + * @param[in] obj The object. + * + * @return Segment items count. + * + * @ingroup Elm_Segment_Control_Group + */ +EAPI int elm_segment_control_item_count_get(const Elm_Segment_Control *obj); + +/** + * @brief Get the selected item. + * + * The selected item can be unselected with function + * elm_segment_control_item_selected_set(). + * + * The selected item always will be highlighted on segment control. + * + * @param[in] obj The object. + * + * @return The selected item or @c NULL if none of segment items is selected. + * + * @ingroup Elm_Segment_Control_Group + */ +EAPI Elm_Widget_Item *elm_segment_control_item_selected_get(const Elm_Segment_Control *obj); + +/** + * @brief Get the label of item. + * + * The return value is a pointer to the label associated to the item when it + * was created, with function elm_segment_control_item_add(), or later with + * function elm_object_item_text_set. If no label was passed as argument, it + * will return @c NULL. + * + * @param[in] obj The object. + * @param[in] idx The index of the segment item. + * + * @return The label of the item at @c index. + * + * @ingroup Elm_Segment_Control_Group + */ +EAPI const char *elm_segment_control_item_label_get(const Elm_Segment_Control *obj, int idx); + +/** + * @brief Insert a new item to the segment control object at specified + * position. + * + * Index values must be between $0, when item will be prepended to segment + * control, and items count, that can be get with + * elm_segment_control_item_count_get(), case when item will be appended to + * segment control, just like elm_segment_control_item_add(). + * + * Items created with this function can be deleted with function + * elm_object_item_del() or elm_segment_control_item_del_at(). + * + * @note @c label set to @c NULL is different from empty string "". If an item + * only has icon, it will be displayed bigger and centered. If it has icon and + * label, even that an empty string, icon will be smaller and positioned at + * left. + * + * @param[in] obj The object. + * @param[in] icon The icon object to use for the left side of the item. An + * icon can be any Evas object, but usually it is an icon created with + * elm_icon_add(). + * @param[in] label The label of the item. + * @param[in] idx Item position. Value should be between 0 and items count. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Segment_Control_Group + */ +EAPI Elm_Widget_Item *elm_segment_control_item_insert_at(Elm_Segment_Control *obj, Efl_Canvas_Object *icon, const char *label, int idx); + +/** + * @brief Get the item placed at specified index. + * + * Index is the position of an item in segment control widget. Its range is + * from $0 to count - 1 . Count is the number of items, that can be + * get with elm_segment_control_item_count_get(). + * + * @param[in] obj The object. + * @param[in] idx The index of the segment item. + * + * @return The segment control item or @c NULL on failure. + * + * @ingroup Elm_Segment_Control_Group + */ +EAPI Elm_Widget_Item *elm_segment_control_item_get(const Elm_Segment_Control *obj, int idx); + +/** + * @brief Remove a segment control item at given index from its parent, + * deleting it. + * + * Items can be added with elm_segment_control_item_add() or + * elm_segment_control_item_insert_at(). + * + * @param[in] obj The object. + * @param[in] idx The position of the segment control item to be deleted. + * + * @ingroup Elm_Segment_Control_Group + */ +EAPI void elm_segment_control_item_del_at(Elm_Segment_Control *obj, int idx); + +/** + * @brief Append a new item to the segment control object. + * + * A new item will be created and appended to the segment control, i.e., will + * be set as last item. + * + * If it should be inserted at another position, + * elm_segment_control_item_insert_at() should be used instead. + * + * Items created with this function can be deleted with function + * elm_object_item_del() or elm_object_item_del_at(). + * + * @note @c label set to @c NULL is different from empty string "". If an item + * only has icon, it will be displayed bigger and centered. If it has icon and + * label, even that an empty string, icon will be smaller and positioned at + * left. + * + * @param[in] obj The object. + * @param[in] icon The icon object to use for the left side of the item. An + * icon can be any Evas object, but usually it is an icon created with + * elm_icon_add(). + * @param[in] label The label of the item. Note that, NULL is different from + * empty string "". + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Segment_Control_Group + */ +EAPI Elm_Widget_Item *elm_segment_control_item_add(Elm_Segment_Control *obj, Efl_Canvas_Object *icon, const char *label); + +/** + * @brief Get the icon associated to the item. + * + * The return value is a pointer to the icon associated to the item when it was + * created, with function elm_segment_control_item_add(), or later with + * function elm_object_item_part_content_set(). If no icon was passed as + * argument, it will return @c NULL. + * + * @param[in] obj The object. + * @param[in] idx The index of the segment item. + * + * @return The left side icon associated to the item at @c index. + * + * @ingroup Elm_Segment_Control_Group + */ +EAPI Efl_Canvas_Object *elm_segment_control_item_icon_get(const Elm_Segment_Control *obj, int idx); + +#endif diff --git a/src/lib/elementary/elm_segment_control_item.eo b/src/lib/elementary/elm_segment_control_item.eo deleted file mode 100644 index 971f32ab9e..0000000000 --- a/src/lib/elementary/elm_segment_control_item.eo +++ /dev/null @@ -1,47 +0,0 @@ -class Elm.Segment_Control.Item extends Elm.Widget.Item implements Efl.Ui.Focus.Object, Efl.Ui.Legacy -{ - [[Elementary segment control item class]] - legacy_prefix: elm_segment_control_item; - eo_prefix: elm_obj_segment_control_item; - methods { - index_get @const { - [[Get the index of an item. - - Index is the position of an item in segment control widget. Its - range is from 0 to (count - 1). - Count is the number of items, that can be get with elm_segment_control_item_count_get()]] - - return: int(-1); [[The position of item in segment control widget.]] - } - object_get @const { - [[Get the real Evas(Edje) object created to implement the view of a given segment_control item. - - Base object is the @Efl.Canvas.Object that represents that item.]] - return: Efl.Canvas.Object; [[The base Edje object associated with $it]] - } - selected_set { - [[Set the selected state of an 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. - Selected item can be got with function elm_segment_control_item_selected_get(). - - The selected item always will be highlighted on segment control.]] - - params { - selected: bool; [[The selected state.]] - } - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Elm.Widget.Item.access_register; - Elm.Widget.Item.part_text { get; set; } - Elm.Widget.Item.part_content { get; set; } - Efl.Ui.Focus.Object.focus_geometry {get; } - Efl.Ui.Focus.Object.focus_parent {get;} - } -} diff --git a/src/lib/elementary/elm_segment_control_item_eo.c b/src/lib/elementary/elm_segment_control_item_eo.c new file mode 100644 index 0000000000..aa2f1f4c3f --- /dev/null +++ b/src/lib/elementary/elm_segment_control_item_eo.c @@ -0,0 +1,84 @@ + +int _elm_segment_control_item_index_get(const Eo *obj, Elm_Segment_Control_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_segment_control_item_index_get, int, -1 /* +1 */); + +Efl_Canvas_Object *_elm_segment_control_item_object_get(const Eo *obj, Elm_Segment_Control_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_segment_control_item_object_get, Efl_Canvas_Object *, NULL); + +void _elm_segment_control_item_selected_set(Eo *obj, Elm_Segment_Control_Item_Data *pd, Eina_Bool selected); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_segment_control_item_selected_set, EFL_FUNC_CALL(selected), Eina_Bool selected); + +Efl_Object *_elm_segment_control_item_efl_object_constructor(Eo *obj, Elm_Segment_Control_Item_Data *pd); + + +void _elm_segment_control_item_efl_object_destructor(Eo *obj, Elm_Segment_Control_Item_Data *pd); + + +Efl_Canvas_Object *_elm_segment_control_item_elm_widget_item_access_register(Eo *obj, Elm_Segment_Control_Item_Data *pd); + + +void _elm_segment_control_item_elm_widget_item_part_text_set(Eo *obj, Elm_Segment_Control_Item_Data *pd, const char *part, const char *label); + + +const char *_elm_segment_control_item_elm_widget_item_part_text_get(const Eo *obj, Elm_Segment_Control_Item_Data *pd, const char *part); + + +void _elm_segment_control_item_elm_widget_item_part_content_set(Eo *obj, Elm_Segment_Control_Item_Data *pd, const char *part, Efl_Canvas_Object *content); + + +Efl_Canvas_Object *_elm_segment_control_item_elm_widget_item_part_content_get(const Eo *obj, Elm_Segment_Control_Item_Data *pd, const char *part); + + +Eina_Rect _elm_segment_control_item_efl_ui_focus_object_focus_geometry_get(const Eo *obj, Elm_Segment_Control_Item_Data *pd); + + +Efl_Ui_Focus_Object *_elm_segment_control_item_efl_ui_focus_object_focus_parent_get(const Eo *obj, Elm_Segment_Control_Item_Data *pd); + + +static Eina_Bool +_elm_segment_control_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_SEGMENT_CONTROL_ITEM_EXTRA_OPS +#define ELM_SEGMENT_CONTROL_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_segment_control_item_index_get, _elm_segment_control_item_index_get), + EFL_OBJECT_OP_FUNC(elm_obj_segment_control_item_object_get, _elm_segment_control_item_object_get), + EFL_OBJECT_OP_FUNC(elm_obj_segment_control_item_selected_set, _elm_segment_control_item_selected_set), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_segment_control_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_segment_control_item_efl_object_destructor), + EFL_OBJECT_OP_FUNC(elm_wdg_item_access_register, _elm_segment_control_item_elm_widget_item_access_register), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_set, _elm_segment_control_item_elm_widget_item_part_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_get, _elm_segment_control_item_elm_widget_item_part_text_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_set, _elm_segment_control_item_elm_widget_item_part_content_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_get, _elm_segment_control_item_elm_widget_item_part_content_get), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_focus_geometry_get, _elm_segment_control_item_efl_ui_focus_object_focus_geometry_get), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_focus_parent_get, _elm_segment_control_item_efl_ui_focus_object_focus_parent_get), + ELM_SEGMENT_CONTROL_ITEM_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_segment_control_item_class_desc = { + EO_VERSION, + "Elm.Segment_Control.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Segment_Control_Item_Data), + _elm_segment_control_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_segment_control_item_class_get, &_elm_segment_control_item_class_desc, ELM_WIDGET_ITEM_CLASS, EFL_UI_FOCUS_OBJECT_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_segment_control_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_segment_control_item_eo.h b/src/lib/elementary/elm_segment_control_item_eo.h new file mode 100644 index 0000000000..b61ba74a05 --- /dev/null +++ b/src/lib/elementary/elm_segment_control_item_eo.h @@ -0,0 +1,72 @@ +#ifndef _ELM_SEGMENT_CONTROL_ITEM_EO_H_ +#define _ELM_SEGMENT_CONTROL_ITEM_EO_H_ + +#ifndef _ELM_SEGMENT_CONTROL_ITEM_EO_CLASS_TYPE +#define _ELM_SEGMENT_CONTROL_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Segment_Control_Item; + +#endif + +#ifndef _ELM_SEGMENT_CONTROL_ITEM_EO_TYPES +#define _ELM_SEGMENT_CONTROL_ITEM_EO_TYPES + + +#endif +/** Elementary segment control item class + * + * @ingroup Elm_Segment_Control_Item + */ +#define ELM_SEGMENT_CONTROL_ITEM_CLASS elm_segment_control_item_class_get() + +EWAPI const Efl_Class *elm_segment_control_item_class_get(void); + +/** + * @brief Get the index of an item. + * + * Index is the position of an item in segment control widget. Its range is + * from 0 to (count - 1). Count is the number of items, that can be get with + * elm_segment_control_item_count_get() + * + * @param[in] obj The object. + * + * @return The position of item in segment control widget. + * + * @ingroup Elm_Segment_Control_Item + */ +EOAPI int elm_obj_segment_control_item_index_get(const Eo *obj); + +/** + * @brief Get the real Evas(Edje) object created to implement the view of a + * given segment_control item. + * + * Base object is the @ref Efl_Canvas_Object that represents that item. + * + * @param[in] obj The object. + * + * @return The base Edje object associated with @c it + * + * @ingroup Elm_Segment_Control_Item + */ +EOAPI Efl_Canvas_Object *elm_obj_segment_control_item_object_get(const Eo *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. + * Selected item can be got with function + * elm_segment_control_item_selected_get(). + * + * The selected item always will be highlighted on segment control. + * + * @param[in] obj The object. + * @param[in] selected The selected state. + * + * @ingroup Elm_Segment_Control_Item + */ +EOAPI void elm_obj_segment_control_item_selected_set(Eo *obj, Eina_Bool selected); + +#endif diff --git a/src/lib/elementary/elm_segment_control_item_eo.legacy.c b/src/lib/elementary/elm_segment_control_item_eo.legacy.c new file mode 100644 index 0000000000..1f7461cb26 --- /dev/null +++ b/src/lib/elementary/elm_segment_control_item_eo.legacy.c @@ -0,0 +1,18 @@ + +EAPI int +elm_segment_control_item_index_get(const Elm_Segment_Control_Item *obj) +{ + return elm_obj_segment_control_item_index_get(obj); +} + +EAPI Efl_Canvas_Object * +elm_segment_control_item_object_get(const Elm_Segment_Control_Item *obj) +{ + return elm_obj_segment_control_item_object_get(obj); +} + +EAPI void +elm_segment_control_item_selected_set(Elm_Segment_Control_Item *obj, Eina_Bool selected) +{ + elm_obj_segment_control_item_selected_set(obj, selected); +} diff --git a/src/lib/elementary/elm_segment_control_item_eo.legacy.h b/src/lib/elementary/elm_segment_control_item_eo.legacy.h new file mode 100644 index 0000000000..43788d4e56 --- /dev/null +++ b/src/lib/elementary/elm_segment_control_item_eo.legacy.h @@ -0,0 +1,65 @@ +#ifndef _ELM_SEGMENT_CONTROL_ITEM_EO_LEGACY_H_ +#define _ELM_SEGMENT_CONTROL_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_SEGMENT_CONTROL_ITEM_EO_CLASS_TYPE +#define _ELM_SEGMENT_CONTROL_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Segment_Control_Item; + +#endif + +#ifndef _ELM_SEGMENT_CONTROL_ITEM_EO_TYPES +#define _ELM_SEGMENT_CONTROL_ITEM_EO_TYPES + + +#endif + +/** + * @brief Get the index of an item. + * + * Index is the position of an item in segment control widget. Its range is + * from 0 to (count - 1). Count is the number of items, that can be get with + * elm_segment_control_item_count_get() + * + * @param[in] obj The object. + * + * @return The position of item in segment control widget. + * + * @ingroup Elm_Segment_Control_Item_Group + */ +EAPI int elm_segment_control_item_index_get(const Elm_Segment_Control_Item *obj); + +/** + * @brief Get the real Evas(Edje) object created to implement the view of a + * given segment_control item. + * + * Base object is the @ref Efl_Canvas_Object that represents that item. + * + * @param[in] obj The object. + * + * @return The base Edje object associated with @c it + * + * @ingroup Elm_Segment_Control_Item_Group + */ +EAPI Efl_Canvas_Object *elm_segment_control_item_object_get(const Elm_Segment_Control_Item *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. + * Selected item can be got with function + * elm_segment_control_item_selected_get(). + * + * The selected item always will be highlighted on segment control. + * + * @param[in] obj The object. + * @param[in] selected The selected state. + * + * @ingroup Elm_Segment_Control_Item_Group + */ +EAPI void elm_segment_control_item_selected_set(Elm_Segment_Control_Item *obj, Eina_Bool selected); + +#endif diff --git a/src/lib/elementary/elm_segment_control_legacy.h b/src/lib/elementary/elm_segment_control_legacy.h index 8b9e0a078b..fc89f57cba 100644 --- a/src/lib/elementary/elm_segment_control_legacy.h +++ b/src/lib/elementary/elm_segment_control_legacy.h @@ -11,5 +11,5 @@ */ EAPI Evas_Object *elm_segment_control_add(Evas_Object *parent); -#include "elm_segment_control_item.eo.legacy.h" -#include "elm_segment_control.eo.legacy.h" +#include "elm_segment_control_item_eo.legacy.h" +#include "elm_segment_control_eo.legacy.h" diff --git a/src/lib/elementary/elm_separator.c b/src/lib/elementary/elm_separator.c index 482ebcf1a2..792a74294f 100644 --- a/src/lib/elementary/elm_separator.c +++ b/src/lib/elementary/elm_separator.c @@ -7,7 +7,7 @@ #include #include "elm_priv.h" -#include "elm_separator.eo.h" +#include "elm_separator_eo.h" #include "elm_widget_separator.h" #include "elm_widget_layout.h" @@ -16,10 +16,10 @@ #define MY_CLASS_NAME "Elm_Separator" #define MY_CLASS_NAME_LEGACY "elm_separator" -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_separator_efl_ui_widget_theme_apply(Eo *obj, Elm_Separator_Data *sd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; if (sd->horizontal) elm_widget_theme_element_set(obj, "horizontal"); @@ -27,7 +27,7 @@ _elm_separator_efl_ui_widget_theme_apply(Eo *obj, Elm_Separator_Data *sd EINA_UN elm_widget_theme_element_set(obj, "vertical"); int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; return int_ret; } @@ -48,7 +48,6 @@ EOLIAN static void _elm_separator_efl_canvas_group_group_add(Eo *obj, Elm_Separator_Data *sd EINA_UNUSED) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_FALSE); if (!elm_layout_theme_set @@ -104,4 +103,4 @@ _elm_separator_class_constructor(Efl_Class *klass) ELM_LAYOUT_SIZING_EVAL_OPS(elm_separator), \ EFL_CANVAS_GROUP_ADD_OPS(elm_separator) -#include "elm_separator.eo.c" +#include "elm_separator_eo.c" diff --git a/src/lib/elementary/elm_separator.eo b/src/lib/elementary/elm_separator.eo deleted file mode 100644 index 56f024dea2..0000000000 --- a/src/lib/elementary/elm_separator.eo +++ /dev/null @@ -1,24 +0,0 @@ -class Elm.Separator extends Efl.Ui.Layout implements Efl.Ui.Legacy -{ - [[Elementary separator class]] - legacy_prefix: elm_separator; - eo_prefix: elm_obj_separator; - methods { - @property horizontal { - set { - [[Set the horizontal mode of a separator object]] - } - get { - [[Get the horizontal mode of a separator object]] - } - values { - horizontal: bool; [[If true, the separator is horizontal]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.theme_apply; - } -} diff --git a/src/lib/elementary/elm_separator_eo.c b/src/lib/elementary/elm_separator_eo.c new file mode 100644 index 0000000000..5dc45a041a --- /dev/null +++ b/src/lib/elementary/elm_separator_eo.c @@ -0,0 +1,83 @@ + +void _elm_separator_horizontal_set(Eo *obj, Elm_Separator_Data *pd, Eina_Bool horizontal); + + +static Eina_Error +__eolian_elm_separator_horizontal_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_separator_horizontal_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_separator_horizontal_set, EFL_FUNC_CALL(horizontal), Eina_Bool horizontal); + +Eina_Bool _elm_separator_horizontal_get(const Eo *obj, Elm_Separator_Data *pd); + + +static Eina_Value +__eolian_elm_separator_horizontal_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_separator_horizontal_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_separator_horizontal_get, Eina_Bool, 0); + +Efl_Object *_elm_separator_efl_object_constructor(Eo *obj, Elm_Separator_Data *pd); + + +Eina_Error _elm_separator_efl_ui_widget_theme_apply(Eo *obj, Elm_Separator_Data *pd); + + +static Eina_Bool +_elm_separator_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_SEPARATOR_EXTRA_OPS +#define ELM_SEPARATOR_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_separator_horizontal_set, _elm_separator_horizontal_set), + EFL_OBJECT_OP_FUNC(elm_obj_separator_horizontal_get, _elm_separator_horizontal_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_separator_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_separator_efl_ui_widget_theme_apply), + ELM_SEPARATOR_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"horizontal", __eolian_elm_separator_horizontal_set_reflect, __eolian_elm_separator_horizontal_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_separator_class_desc = { + EO_VERSION, + "Elm.Separator", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Separator_Data), + _elm_separator_class_initializer, + _elm_separator_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_separator_class_get, &_elm_separator_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_separator_eo.legacy.c" diff --git a/src/lib/elementary/elm_separator_eo.h b/src/lib/elementary/elm_separator_eo.h new file mode 100644 index 0000000000..ce4d5e0539 --- /dev/null +++ b/src/lib/elementary/elm_separator_eo.h @@ -0,0 +1,45 @@ +#ifndef _ELM_SEPARATOR_EO_H_ +#define _ELM_SEPARATOR_EO_H_ + +#ifndef _ELM_SEPARATOR_EO_CLASS_TYPE +#define _ELM_SEPARATOR_EO_CLASS_TYPE + +typedef Eo Elm_Separator; + +#endif + +#ifndef _ELM_SEPARATOR_EO_TYPES +#define _ELM_SEPARATOR_EO_TYPES + + +#endif +/** Elementary separator class + * + * @ingroup Elm_Separator + */ +#define ELM_SEPARATOR_CLASS elm_separator_class_get() + +EWAPI const Efl_Class *elm_separator_class_get(void); + +/** + * @brief Set the horizontal mode of a separator object + * + * @param[in] obj The object. + * @param[in] horizontal If true, the separator is horizontal + * + * @ingroup Elm_Separator + */ +EOAPI void elm_obj_separator_horizontal_set(Eo *obj, Eina_Bool horizontal); + +/** + * @brief Get the horizontal mode of a separator object + * + * @param[in] obj The object. + * + * @return If true, the separator is horizontal + * + * @ingroup Elm_Separator + */ +EOAPI Eina_Bool elm_obj_separator_horizontal_get(const Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_separator_eo.legacy.c b/src/lib/elementary/elm_separator_eo.legacy.c new file mode 100644 index 0000000000..13de3002c2 --- /dev/null +++ b/src/lib/elementary/elm_separator_eo.legacy.c @@ -0,0 +1,12 @@ + +EAPI void +elm_separator_horizontal_set(Elm_Separator *obj, Eina_Bool horizontal) +{ + elm_obj_separator_horizontal_set(obj, horizontal); +} + +EAPI Eina_Bool +elm_separator_horizontal_get(const Elm_Separator *obj) +{ + return elm_obj_separator_horizontal_get(obj); +} diff --git a/src/lib/elementary/elm_separator_eo.legacy.h b/src/lib/elementary/elm_separator_eo.legacy.h new file mode 100644 index 0000000000..907250b2f1 --- /dev/null +++ b/src/lib/elementary/elm_separator_eo.legacy.h @@ -0,0 +1,38 @@ +#ifndef _ELM_SEPARATOR_EO_LEGACY_H_ +#define _ELM_SEPARATOR_EO_LEGACY_H_ + +#ifndef _ELM_SEPARATOR_EO_CLASS_TYPE +#define _ELM_SEPARATOR_EO_CLASS_TYPE + +typedef Eo Elm_Separator; + +#endif + +#ifndef _ELM_SEPARATOR_EO_TYPES +#define _ELM_SEPARATOR_EO_TYPES + + +#endif + +/** + * @brief Set the horizontal mode of a separator object + * + * @param[in] obj The object. + * @param[in] horizontal If true, the separator is horizontal + * + * @ingroup Elm_Separator_Group + */ +EAPI void elm_separator_horizontal_set(Elm_Separator *obj, Eina_Bool horizontal); + +/** + * @brief Get the horizontal mode of a separator object + * + * @param[in] obj The object. + * + * @return If true, the separator is horizontal + * + * @ingroup Elm_Separator_Group + */ +EAPI Eina_Bool elm_separator_horizontal_get(const Elm_Separator *obj); + +#endif diff --git a/src/lib/elementary/elm_separator_legacy.h b/src/lib/elementary/elm_separator_legacy.h index 82cf44ee0b..bd5ac73f31 100644 --- a/src/lib/elementary/elm_separator_legacy.h +++ b/src/lib/elementary/elm_separator_legacy.h @@ -9,4 +9,4 @@ */ EAPI Evas_Object *elm_separator_add(Evas_Object *parent); -#include "elm_separator.eo.legacy.h" \ No newline at end of file +#include "elm_separator_eo.legacy.h" \ No newline at end of file diff --git a/src/lib/elementary/elm_slider.c b/src/lib/elementary/elm_slider.c index d7af7d66de..d5a5f04ea8 100644 --- a/src/lib/elementary/elm_slider.c +++ b/src/lib/elementary/elm_slider.c @@ -398,17 +398,17 @@ _key_action_drag(Evas_Object *obj, const char *params) return EINA_TRUE; } -// _slider_efl_ui_widget_widget_event +// _slider_efl_ui_widget_widget_input_event_handler 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) +_elm_slider_efl_ui_widget_widget_input_event_handler(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)) + if (!_slider_efl_ui_widget_widget_input_event_handler(obj, sd, eo_event, src)) return EINA_FALSE; } else if (eo_event->desc == EFL_EVENT_KEY_UP) @@ -804,12 +804,12 @@ _elm_slider_theme_group_get(Evas_Object *obj, Elm_Slider_Data *sd) return eina_strbuf_release(new_group); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_slider_efl_ui_widget_theme_apply(Eo *obj, Elm_Slider_Data *sd) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); - EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd2, EFL_UI_THEME_APPLY_RESULT_FAIL); + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); + EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd2, EFL_UI_THEME_APPLY_ERROR_GENERIC); char *group; group = _elm_slider_theme_group_get(obj, sd); @@ -820,7 +820,7 @@ _elm_slider_efl_ui_widget_theme_apply(Eo *obj, Elm_Slider_Data *sd) } int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; if (_is_horizontal(sd2->dir)) evas_object_size_hint_min_set @@ -1193,7 +1193,7 @@ _elm_slider_part_indicator_visible_mode_get(const Eo *obj, void *_pd EINA_UNUSED return sd->indicator_visible_mode; } -#include "elm_slider_part_indicator.eo.c" +#include "elm_slider_part_indicator_eo.c" /* Efl.Part end */ @@ -1490,4 +1490,4 @@ ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(elm_slider) EFL_UI_SLIDER_DOWN_KNOB_OPS(elm_slider), \ EFL_UI_SLIDER_MOVE_KNOB_OPS(elm_slider) -#include "elm_slider.eo.c" +#include "elm_slider_eo.c" diff --git a/src/lib/elementary/elm_slider.eo b/src/lib/elementary/elm_slider.eo deleted file mode 100644 index 52435f9926..0000000000 --- a/src/lib/elementary/elm_slider.eo +++ /dev/null @@ -1,25 +0,0 @@ -class Elm.Slider extends Efl.Ui.Slider_Interval implements Efl.Ui.Legacy, - Efl.Text, Efl.Text_Markup, Efl.Ui.Format -{ - [[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.L10n.l10n_text { get; set; } - Efl.Part.part_get; - } -} diff --git a/src/lib/elementary/elm_slider.h b/src/lib/elementary/elm_slider.h index 5e04927026..2895342fcd 100644 --- a/src/lib/elementary/elm_slider.h +++ b/src/lib/elementary/elm_slider.h @@ -75,10 +75,6 @@ */ #include "elm_slider_common.h" -#ifdef EFL_EO_API_SUPPORT -#include "elm_slider.eo.h" -#include "elm_slider_part_indicator.eo.h" -#endif #ifndef EFL_NOLEGACY_API_SUPPORT #include "elm_slider_legacy.h" #endif diff --git a/src/lib/elementary/elm_slider_eo.c b/src/lib/elementary/elm_slider_eo.c new file mode 100644 index 0000000000..12debeef34 --- /dev/null +++ b/src/lib/elementary/elm_slider_eo.c @@ -0,0 +1,87 @@ + +Efl_Object *_elm_slider_efl_object_constructor(Eo *obj, Elm_Slider_Data *pd); + + +void _elm_slider_efl_object_destructor(Eo *obj, Elm_Slider_Data *pd); + + +void _elm_slider_efl_canvas_group_group_calculate(Eo *obj, Elm_Slider_Data *pd); + + +Eina_Error _elm_slider_efl_ui_widget_theme_apply(Eo *obj, Elm_Slider_Data *pd); + + +Eina_Bool _elm_slider_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Slider_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +Eina_Bool _elm_slider_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Slider_Data *pd); + + +void _elm_slider_efl_text_text_set(Eo *obj, Elm_Slider_Data *pd, const char *text); + + +const char *_elm_slider_efl_text_text_get(const Eo *obj, Elm_Slider_Data *pd); + + +void _elm_slider_efl_text_markup_markup_set(Eo *obj, Elm_Slider_Data *pd, const char *markup); + + +const char *_elm_slider_efl_text_markup_markup_get(const Eo *obj, Elm_Slider_Data *pd); + + +void _elm_slider_efl_ui_format_format_cb_set(Eo *obj, Elm_Slider_Data *pd, void *func_data, Efl_Ui_Format_Func_Cb func, Eina_Free_Cb func_free_cb); + + +void _elm_slider_efl_ui_l10n_l10n_text_set(Eo *obj, Elm_Slider_Data *pd, const char *label, const char *domain); + + +const char *_elm_slider_efl_ui_l10n_l10n_text_get(const Eo *obj, Elm_Slider_Data *pd, const char **domain); + + +Efl_Object *_elm_slider_efl_part_part_get(const Eo *obj, Elm_Slider_Data *pd, const char *name); + + +static Eina_Bool +_elm_slider_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_SLIDER_EXTRA_OPS +#define ELM_SLIDER_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_slider_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_slider_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _elm_slider_efl_canvas_group_group_calculate), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_slider_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_slider_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_on_focus_update, _elm_slider_efl_ui_focus_object_on_focus_update), + EFL_OBJECT_OP_FUNC(efl_text_set, _elm_slider_efl_text_text_set), + EFL_OBJECT_OP_FUNC(efl_text_get, _elm_slider_efl_text_text_get), + EFL_OBJECT_OP_FUNC(efl_text_markup_set, _elm_slider_efl_text_markup_markup_set), + EFL_OBJECT_OP_FUNC(efl_text_markup_get, _elm_slider_efl_text_markup_markup_get), + EFL_OBJECT_OP_FUNC(efl_ui_format_cb_set, _elm_slider_efl_ui_format_format_cb_set), + EFL_OBJECT_OP_FUNC(efl_ui_l10n_text_set, _elm_slider_efl_ui_l10n_l10n_text_set), + EFL_OBJECT_OP_FUNC(efl_ui_l10n_text_get, _elm_slider_efl_ui_l10n_l10n_text_get), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_slider_efl_part_part_get), + ELM_SLIDER_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_slider_class_desc = { + EO_VERSION, + "Elm.Slider", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Slider_Data), + _elm_slider_class_initializer, + _elm_slider_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_slider_class_get, &_elm_slider_class_desc, EFL_UI_SLIDER_INTERVAL_CLASS, EFL_UI_LEGACY_INTERFACE, EFL_TEXT_INTERFACE, EFL_TEXT_MARKUP_INTERFACE, EFL_UI_FORMAT_MIXIN, NULL); diff --git a/src/lib/elementary/elm_slider_eo.h b/src/lib/elementary/elm_slider_eo.h new file mode 100644 index 0000000000..1f95ec1770 --- /dev/null +++ b/src/lib/elementary/elm_slider_eo.h @@ -0,0 +1,24 @@ +#ifndef _ELM_SLIDER_EO_H_ +#define _ELM_SLIDER_EO_H_ + +#ifndef _ELM_SLIDER_EO_CLASS_TYPE +#define _ELM_SLIDER_EO_CLASS_TYPE + +typedef Eo Elm_Slider; + +#endif + +#ifndef _ELM_SLIDER_EO_TYPES +#define _ELM_SLIDER_EO_TYPES + + +#endif +/** Elementary slider class + * + * @ingroup Elm_Slider + */ +#define ELM_SLIDER_CLASS elm_slider_class_get() + +EWAPI const Efl_Class *elm_slider_class_get(void); + +#endif diff --git a/src/lib/elementary/elm_slider_eo.legacy.h b/src/lib/elementary/elm_slider_eo.legacy.h new file mode 100644 index 0000000000..cbca7aa864 --- /dev/null +++ b/src/lib/elementary/elm_slider_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_SLIDER_EO_LEGACY_H_ +#define _ELM_SLIDER_EO_LEGACY_H_ + +#ifndef _ELM_SLIDER_EO_CLASS_TYPE +#define _ELM_SLIDER_EO_CLASS_TYPE + +typedef Eo Elm_Slider; + +#endif + +#ifndef _ELM_SLIDER_EO_TYPES +#define _ELM_SLIDER_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_slider_part_indicator.eo b/src/lib/elementary/elm_slider_part_indicator.eo deleted file mode 100644 index d899d9d5fe..0000000000 --- a/src/lib/elementary/elm_slider_part_indicator.eo +++ /dev/null @@ -1,20 +0,0 @@ -import efl_ui; - -class Elm.Slider_Part_Indicator extends Efl.Ui.Layout_Part implements Efl.Ui.Format -{ - [[Elementary slider internal part class]] - data: null; - methods { - @property visible_mode { - [[Set/Get the visible mode of indicator. - ]] - values { - mode: Efl.Ui.Slider_Indicator_Visible_Mode; [[The indicator visible mode.]] - } - } - } - implements { - Efl.Ui.Format.format_cb { set; } - Efl.Ui.Format.format_string { set; get; } - } -} diff --git a/src/lib/elementary/elm_slider_part_indicator_eo.c b/src/lib/elementary/elm_slider_part_indicator_eo.c new file mode 100644 index 0000000000..915e1cea7f --- /dev/null +++ b/src/lib/elementary/elm_slider_part_indicator_eo.c @@ -0,0 +1,53 @@ + +void _elm_slider_part_indicator_visible_mode_set(Eo *obj, void *pd, Elm_Slider_Indicator_Visible_Mode mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_slider_part_indicator_visible_mode_set, EFL_FUNC_CALL(mode), Elm_Slider_Indicator_Visible_Mode mode); + +Elm_Slider_Indicator_Visible_Mode _elm_slider_part_indicator_visible_mode_get(const Eo *obj, void *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_slider_part_indicator_visible_mode_get, Elm_Slider_Indicator_Visible_Mode, 0); + +void _elm_slider_part_indicator_efl_ui_format_format_cb_set(Eo *obj, void *pd, void *func_data, Efl_Ui_Format_Func_Cb func, Eina_Free_Cb func_free_cb); + + +void _elm_slider_part_indicator_efl_ui_format_format_string_set(Eo *obj, void *pd, const char *units); + + +const char *_elm_slider_part_indicator_efl_ui_format_format_string_get(const Eo *obj, void *pd); + + +static Eina_Bool +_elm_slider_part_indicator_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_SLIDER_PART_INDICATOR_EXTRA_OPS +#define ELM_SLIDER_PART_INDICATOR_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_slider_part_indicator_visible_mode_set, _elm_slider_part_indicator_visible_mode_set), + EFL_OBJECT_OP_FUNC(elm_slider_part_indicator_visible_mode_get, _elm_slider_part_indicator_visible_mode_get), + EFL_OBJECT_OP_FUNC(efl_ui_format_cb_set, _elm_slider_part_indicator_efl_ui_format_format_cb_set), + EFL_OBJECT_OP_FUNC(efl_ui_format_string_set, _elm_slider_part_indicator_efl_ui_format_format_string_set), + EFL_OBJECT_OP_FUNC(efl_ui_format_string_get, _elm_slider_part_indicator_efl_ui_format_format_string_get), + ELM_SLIDER_PART_INDICATOR_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_slider_part_indicator_class_desc = { + EO_VERSION, + "Elm.Slider_Part_Indicator", + EFL_CLASS_TYPE_REGULAR, + 0, + _elm_slider_part_indicator_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_slider_part_indicator_class_get, &_elm_slider_part_indicator_class_desc, EFL_UI_LAYOUT_PART_CLASS, EFL_UI_FORMAT_MIXIN, NULL); diff --git a/src/lib/elementary/elm_slider_part_indicator_eo.h b/src/lib/elementary/elm_slider_part_indicator_eo.h new file mode 100644 index 0000000000..058a44a356 --- /dev/null +++ b/src/lib/elementary/elm_slider_part_indicator_eo.h @@ -0,0 +1,45 @@ +#ifndef _ELM_SLIDER_PART_INDICATOR_EO_H_ +#define _ELM_SLIDER_PART_INDICATOR_EO_H_ + +#ifndef _ELM_SLIDER_PART_INDICATOR_EO_CLASS_TYPE +#define _ELM_SLIDER_PART_INDICATOR_EO_CLASS_TYPE + +typedef Eo Elm_Slider_Part_Indicator; + +#endif + +#ifndef _ELM_SLIDER_PART_INDICATOR_EO_TYPES +#define _ELM_SLIDER_PART_INDICATOR_EO_TYPES + + +#endif +/** Elementary slider internal part class + * + * @ingroup Elm_Slider_Part_Indicator + */ +#define ELM_SLIDER_PART_INDICATOR_CLASS elm_slider_part_indicator_class_get() + +EWAPI const Efl_Class *elm_slider_part_indicator_class_get(void); + +/** + * @brief Set/Get the visible mode of indicator. + * + * @param[in] obj The object. + * @param[in] mode The indicator visible mode. + * + * @ingroup Elm_Slider_Part_Indicator + */ +EOAPI void elm_slider_part_indicator_visible_mode_set(Eo *obj, Elm_Slider_Indicator_Visible_Mode mode); + +/** + * @brief Set/Get the visible mode of indicator. + * + * @param[in] obj The object. + * + * @return The indicator visible mode. + * + * @ingroup Elm_Slider_Part_Indicator + */ +EOAPI Elm_Slider_Indicator_Visible_Mode elm_slider_part_indicator_visible_mode_get(const Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_slider_part_indicator_eo.legacy.h b/src/lib/elementary/elm_slider_part_indicator_eo.legacy.h new file mode 100644 index 0000000000..a351cc4ab9 --- /dev/null +++ b/src/lib/elementary/elm_slider_part_indicator_eo.legacy.h @@ -0,0 +1,19 @@ +#ifndef _ELM_SLIDER_PART_INDICATOR_EO_LEGACY_H_ +#define _ELM_SLIDER_PART_INDICATOR_EO_LEGACY_H_ + +#ifndef _ELM_SLIDER_PART_INDICATOR_EO_CLASS_TYPE +#define _ELM_SLIDER_PART_INDICATOR_EO_CLASS_TYPE + +typedef Eo Elm_Slider_Part_Indicator; + +#endif + +#ifndef _ELM_SLIDER_PART_INDICATOR_EO_TYPES +#define _ELM_SLIDER_PART_INDICATOR_EO_TYPES + + +#endif + + + +#endif diff --git a/src/lib/elementary/elm_slideshow.c b/src/lib/elementary/elm_slideshow.c index 925930b758..da8887413d 100644 --- a/src/lib/elementary/elm_slideshow.c +++ b/src/lib/elementary/elm_slideshow.c @@ -9,8 +9,8 @@ #include #include "elm_priv.h" -#include "elm_slideshow.eo.h" -#include "elm_slideshow_item.eo.h" +#include "elm_slideshow_eo.h" +#include "elm_slideshow_item_eo.h" #include "elm_widget_slideshow.h" #define MY_CLASS ELM_SLIDESHOW_CLASS @@ -310,7 +310,6 @@ _elm_slideshow_efl_canvas_group_group_add(Eo *obj, Elm_Slideshow_Data *priv) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->count_item_pre_before = 2; priv->count_item_pre_after = 2; @@ -717,5 +716,5 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_slideshow, Elm_Slideshow_Data) ELM_LAYOUT_SIZING_EVAL_OPS(elm_slideshow), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_slideshow) -#include "elm_slideshow_item.eo.c" -#include "elm_slideshow.eo.c" +#include "elm_slideshow_item_eo.c" +#include "elm_slideshow_eo.c" diff --git a/src/lib/elementary/elm_slideshow.eo b/src/lib/elementary/elm_slideshow.eo deleted file mode 100644 index 97cf3cf99c..0000000000 --- a/src/lib/elementary/elm_slideshow.eo +++ /dev/null @@ -1,316 +0,0 @@ -type Elm_Slideshow_Item_Class: __undefined_type; [[Elementary slideshow item class type]] - -class Elm.Slideshow extends Efl.Ui.Layout implements Efl.Access.Widget.Action, Efl.Ui.Legacy -{ - [[Elementary slideshow class]] - eo_prefix: elm_obj_slideshow; - legacy_prefix: elm_slideshow; - event_prefix: elm_slideshow; - methods { - @property cache_after { - set { - [[Set the number of items to cache, on a given slideshow widget, - after the current item. - - The default value for this property is 2. See - \@ref Slideshow_Caching "slideshow caching" for more details. - ]] - } - get { - [[Get the number of items to cache, on a given slideshow widget, - after the current item. - ]] - } - values { - count: int; [[Number of items to cache after the current one.]] - } - } - @property cache_before { - set { - [[Set the number of items to cache, on a given slideshow widget, - before the current item. - - The default value for this property is 2. See - \@ref Slideshow_Caching "slideshow caching" for more details. - ]] - } - get { - [[Get the number of items to cache, on a given slideshow widget, - before the current item. - ]] - } - values { - count: int; [[Number of items to cache before the current one.]] - } - } - @property layout { - set { - [[Set the current slide layout in use for a given slideshow widget - - If $layout is implemented in $obj's theme (i.e., is contained - in the list returned by elm_slideshow_layouts_get()), this new - images layout will be used on the widget. - - See @.layouts.get for more details. - ]] - } - get { - [[Get the current slide layout in use for a given slideshow widget.]] - } - values { - layout: string; [[The new layout's name string.]] - } - } - @property transition { - set { - [[Set the current slide transition/effect in use for a given - slideshow widget. - - If $transition is implemented in $obj's theme (i.e., is - contained in the list returned by @.transitions.get), this - new sliding effect will be used on the widget. - ]] - } - get { - [[Get the current slide transition/effect in use for a given - slideshow widget. - ]] - } - values { - transition: string @nullable; [[The new transition's name string.]] - } - } - @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. - - 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 - $false for it to stop at the end of $obj's - internal list of items.]] - } - } - @property timeout { - set { - [[Set the interval between each image transition on a given - slideshow widget and start the slideshow itself. - - After this call, the slideshow widget will start cycling its - view, sequentially and automatically, with the images of the - items it has. The time between each new image displayed is - going to be $timeout, in seconds. If a different timeout was - set previously and an slideshow was in progress, it will - continue with the new time between transitions, after this call. - - Note: A value less than or equal to 0 on $timeout will disable - the widget's internal timer, thus halting any slideshow which - could be happening on $obj. - ]] - } - get { - [[Get the interval set for image transitions on a given - slideshow widget. - ]] - } - values { - timeout: double; [[The new displaying timeout for images.]] - } - } - @property items { - get { - [[Get the internal list of items in a given slideshow widget. - - This list is not to be modified in any way and must not be - freed. - - Warning: This list is only valid until $obj object's internal - items list is changed. It should be fetched again with another - call to this function when changes happen. - ]] - return: const(list); [[ - The list of items (#Elm.Widget.Item as data) or $null on - errors. - ]] - } - } - @property transitions { - get { - [[Returns the list of sliding transition/effect names available, - for a given slideshow widget. - - The transitions, which come from $obj's theme, must be an EDC - data item named $"transitions" on the theme file, with (prefix) - names of EDC programs actually implementing them. - - The available transitions for slideshows on the default theme - are "fade" (the current item fades out, while the new one - fades in to the slideshow's viewport), "black_fade" (the - current item fades to black, and just then, the new item - will fade in), "horizontal" (the current item slides - horizontally, until it gets out of the slideshow's viewport, - while the new item comes from the left to take its place), - "vertical" (the current item slides vertically, until it - gets out of the slideshow's viewport, while the new item - comes from the bottom to take its place), "square" (the - new item starts to appear from the middle of the current - one, but with a tiny size, growing until its target (full) - size and covering the old one. - - Warning: The stringshared strings get no new references - exclusive to the user grabbing the list, here, so if you'd - like to use them out of this call's context, you'd better - \@ref eina_stringshare_ref them. Also the list is an internal - list and so is only valid for as long as the slideshow object - is valid and has not internally changed its list for some - reason, so make a copy if you need it around. - ]] - return: const(list); [[ - The list of transitions (list of stringshared strings - as data). - ]] - } - } - @property count { - get { - [[Get the number of items stored in a given slideshow widget.]] - return: uint; [[The number of items on $obj, at the moment of this call.]] - } - } - @property item_current { - get { - [[Returns the currently displayed item, in a given slideshow widget.]] - return: Elm.Widget.Item; [[A handle to the item being displayed - in $obj or $null, if none is (and - on errors)]] - } - } - @property layouts { - get { - [[Returns the list of layout names available, for a given - slideshow widget. - - Slideshow layouts will change how the widget is to dispose - each image item in its viewport, with regard to cropping, - scaling, etc. - - The layouts, which come from $obj's theme, must be an EDC - data item name $"layouts" on the theme file, with (prefix) - names of EDC programs actually implementing them. - - The available layouts for slideshows on the default theme are - "fullscreen" (item images with original aspect, scaled to - touch top and down slideshow borders or, if the image's height - is not enough, left and right slideshow borders) and - "not_fullscreen" (the same behavior as the "fullscreen" - one, but always leaving 10% of the slideshow's dimensions of - distance between the item image's borders and the slideshow - borders, for each axis)- - - Warning: The stringshared strings get no new references - exclusive to the user grabbing the list, here, so if you'd - like to use them out of this call's context, you'd better - \@ref eina_stringshare_ref them. - ]] - return: const(list); [[ - The list of layouts (list of stringshared strings as data) - ]] - } - } - previous { - [[Slide to the previous item, in a given slideshow widget - - The sliding animation $obj is set to use will be the - transition effect used, after this call is issued. - - Note: If the beginning of the slideshow's internal list of items - is reached, it'll wrap around to the list's end, again. - ]] - } - item_nth_get @const { - [[Get the the item, in a given slideshow widget, placed at - position $nth, in its internal items list. - ]] - return: Elm.Widget.Item; [[The item stored in $obj at position - $nth or $null if there's no item with - that index (and on errors).]] - params { - @in nth: uint; [[The number of the item to grab a handle to - (0 being the first).]] - } - } - next { - [[Slide to the next item, in a given slideshow widget. - - The sliding animation $obj is set to use will be the - transition effect used, after this call is issued. - - Note: If the end of the slideshow's internal list of items is - reached, it'll wrap around to the list's beginning, again. - ]] - } - clear { - [[Remove all items from a given slideshow widget. - - This removes (and deletes) all items in $obj, leaving it empty. - ]] - } - item_add { - [[Add (append) a new item in a given slideshow widget. - - Add a new item to $obj's internal list of items, appending it. - The item's class must contain the function really fetching the - image object to show for this item, which could be an Evas image - object or an Elementary photo, for example. The $data - parameter is going to be passed to both class functions of the - item. - ]] - return: Elm.Widget.Item; [[A handle to the item added or $null on errors.]] - params { - @cref itc: Elm_Slideshow_Item_Class; [[The item class for the item.]] - @in data: const(void_ptr); [[The item's data.]] - } - } - item_sorted_insert { - [[Insert a new item into the given slideshow widget, using the - $func function to sort items (by item handles). - - Add a new item to $obj's internal list of items, in a position - determined by the $func comparing function. The item's class - must contain the function really fetching the image object to - show for this item, which could be an Evas image object or an - Elementary photo, for example. The $data parameter is going to - be passed to both class functions of the item. - ]] - return: Elm.Widget.Item; [[Returns The slideshow item handle, - on success, or $null on errors.]] - params { - @cref itc: Elm_Slideshow_Item_Class; [[The item class for the item.]] - @in data: const(void_ptr); [[The item's data.]] - @in func: Eina_Compare_Cb; [[The comparing function to be used to sort the slideshow - items by #Elm_Slideshow_Item_Class item handles.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.widget_event; - Efl.Access.Widget.Action.elm_actions { get; } - } - events { - changed: Efl.Object; [[Called when slideshow widget changed]] - transition,end: Efl.Object; [[Called on transition end]] - } -} diff --git a/src/lib/elementary/elm_slideshow_eo.c b/src/lib/elementary/elm_slideshow_eo.c new file mode 100644 index 0000000000..8860bf95e6 --- /dev/null +++ b/src/lib/elementary/elm_slideshow_eo.c @@ -0,0 +1,321 @@ +EWAPI const Efl_Event_Description _ELM_SLIDESHOW_EVENT_CHANGED = + EFL_EVENT_DESCRIPTION("changed"); +EWAPI const Efl_Event_Description _ELM_SLIDESHOW_EVENT_TRANSITION_END = + EFL_EVENT_DESCRIPTION("transition,end"); + +void _elm_slideshow_cache_after_set(Eo *obj, Elm_Slideshow_Data *pd, int count); + + +static Eina_Error +__eolian_elm_slideshow_cache_after_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_slideshow_cache_after_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_slideshow_cache_after_set, EFL_FUNC_CALL(count), int count); + +int _elm_slideshow_cache_after_get(const Eo *obj, Elm_Slideshow_Data *pd); + + +static Eina_Value +__eolian_elm_slideshow_cache_after_get_reflect(const Eo *obj) +{ + int val = elm_obj_slideshow_cache_after_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_cache_after_get, int, 0); + +void _elm_slideshow_cache_before_set(Eo *obj, Elm_Slideshow_Data *pd, int count); + + +static Eina_Error +__eolian_elm_slideshow_cache_before_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_slideshow_cache_before_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_slideshow_cache_before_set, EFL_FUNC_CALL(count), int count); + +int _elm_slideshow_cache_before_get(const Eo *obj, Elm_Slideshow_Data *pd); + + +static Eina_Value +__eolian_elm_slideshow_cache_before_get_reflect(const Eo *obj) +{ + int val = elm_obj_slideshow_cache_before_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_cache_before_get, int, 0); + +void _elm_slideshow_layout_set(Eo *obj, Elm_Slideshow_Data *pd, const char *layout); + + +static Eina_Error +__eolian_elm_slideshow_layout_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_slideshow_layout_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_slideshow_layout_set, EFL_FUNC_CALL(layout), const char *layout); + +const char *_elm_slideshow_layout_get(const Eo *obj, Elm_Slideshow_Data *pd); + + +static Eina_Value +__eolian_elm_slideshow_layout_get_reflect(const Eo *obj) +{ + const char *val = elm_obj_slideshow_layout_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_layout_get, const char *, NULL); + +void _elm_slideshow_transition_set(Eo *obj, Elm_Slideshow_Data *pd, const char *transition); + + +static Eina_Error +__eolian_elm_slideshow_transition_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_slideshow_transition_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_slideshow_transition_set, EFL_FUNC_CALL(transition), const char *transition); + +const char *_elm_slideshow_transition_get(const Eo *obj, Elm_Slideshow_Data *pd); + + +static Eina_Value +__eolian_elm_slideshow_transition_get_reflect(const Eo *obj) +{ + const char *val = elm_obj_slideshow_transition_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_transition_get, const char *, NULL); + +void _elm_slideshow_items_loop_set(Eo *obj, Elm_Slideshow_Data *pd, Eina_Bool loop); + + +static Eina_Error +__eolian_elm_slideshow_items_loop_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_slideshow_items_loop_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_slideshow_items_loop_set, EFL_FUNC_CALL(loop), Eina_Bool loop); + +Eina_Bool _elm_slideshow_items_loop_get(const Eo *obj, Elm_Slideshow_Data *pd); + + +static Eina_Value +__eolian_elm_slideshow_items_loop_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_slideshow_items_loop_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_items_loop_get, Eina_Bool, 0); + +void _elm_slideshow_timeout_set(Eo *obj, Elm_Slideshow_Data *pd, double timeout); + + +static Eina_Error +__eolian_elm_slideshow_timeout_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_slideshow_timeout_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_slideshow_timeout_set, EFL_FUNC_CALL(timeout), double timeout); + +double _elm_slideshow_timeout_get(const Eo *obj, Elm_Slideshow_Data *pd); + + +static Eina_Value +__eolian_elm_slideshow_timeout_get_reflect(const Eo *obj) +{ + double val = elm_obj_slideshow_timeout_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_timeout_get, double, 0); + +const Eina_List *_elm_slideshow_items_get(const Eo *obj, Elm_Slideshow_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_items_get, const Eina_List *, NULL); + +const Eina_List *_elm_slideshow_transitions_get(const Eo *obj, Elm_Slideshow_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_transitions_get, const Eina_List *, NULL); + +unsigned int _elm_slideshow_count_get(const Eo *obj, Elm_Slideshow_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_count_get, unsigned int, 0); + +Elm_Widget_Item *_elm_slideshow_item_current_get(const Eo *obj, Elm_Slideshow_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_item_current_get, Elm_Widget_Item *, NULL); + +const Eina_List *_elm_slideshow_layouts_get(const Eo *obj, Elm_Slideshow_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_layouts_get, const Eina_List *, NULL); + +void _elm_slideshow_previous(Eo *obj, Elm_Slideshow_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_slideshow_previous); + +Elm_Widget_Item *_elm_slideshow_item_nth_get(const Eo *obj, Elm_Slideshow_Data *pd, unsigned int nth); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_slideshow_item_nth_get, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(nth), unsigned int nth); + +void _elm_slideshow_next(Eo *obj, Elm_Slideshow_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_slideshow_next); + +void _elm_slideshow_clear(Eo *obj, Elm_Slideshow_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_slideshow_clear); + +Elm_Widget_Item *_elm_slideshow_item_add(Eo *obj, Elm_Slideshow_Data *pd, const Elm_Slideshow_Item_Class *itc, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_slideshow_item_add, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(itc, data), const Elm_Slideshow_Item_Class *itc, const void *data); + +Elm_Widget_Item *_elm_slideshow_item_sorted_insert(Eo *obj, Elm_Slideshow_Data *pd, const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func); + +EOAPI EFL_FUNC_BODYV(elm_obj_slideshow_item_sorted_insert, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(itc, data, func), const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func); + +Efl_Object *_elm_slideshow_efl_object_constructor(Eo *obj, Elm_Slideshow_Data *pd); + + +Eina_Bool _elm_slideshow_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Slideshow_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +const Efl_Access_Action_Data *_elm_slideshow_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Slideshow_Data *pd); + + +static Eina_Bool +_elm_slideshow_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_SLIDESHOW_EXTRA_OPS +#define ELM_SLIDESHOW_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_cache_after_set, _elm_slideshow_cache_after_set), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_cache_after_get, _elm_slideshow_cache_after_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_cache_before_set, _elm_slideshow_cache_before_set), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_cache_before_get, _elm_slideshow_cache_before_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_layout_set, _elm_slideshow_layout_set), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_layout_get, _elm_slideshow_layout_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_transition_set, _elm_slideshow_transition_set), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_transition_get, _elm_slideshow_transition_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_items_loop_set, _elm_slideshow_items_loop_set), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_items_loop_get, _elm_slideshow_items_loop_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_timeout_set, _elm_slideshow_timeout_set), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_timeout_get, _elm_slideshow_timeout_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_items_get, _elm_slideshow_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_transitions_get, _elm_slideshow_transitions_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_count_get, _elm_slideshow_count_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_item_current_get, _elm_slideshow_item_current_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_layouts_get, _elm_slideshow_layouts_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_previous, _elm_slideshow_previous), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_item_nth_get, _elm_slideshow_item_nth_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_next, _elm_slideshow_next), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_clear, _elm_slideshow_clear), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_item_add, _elm_slideshow_item_add), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_item_sorted_insert, _elm_slideshow_item_sorted_insert), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_slideshow_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_slideshow_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_slideshow_efl_access_widget_action_elm_actions_get), + ELM_SLIDESHOW_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"cache_after", __eolian_elm_slideshow_cache_after_set_reflect, __eolian_elm_slideshow_cache_after_get_reflect}, + {"cache_before", __eolian_elm_slideshow_cache_before_set_reflect, __eolian_elm_slideshow_cache_before_get_reflect}, + {"layout", __eolian_elm_slideshow_layout_set_reflect, __eolian_elm_slideshow_layout_get_reflect}, + {"transition", __eolian_elm_slideshow_transition_set_reflect, __eolian_elm_slideshow_transition_get_reflect}, + {"items_loop", __eolian_elm_slideshow_items_loop_set_reflect, __eolian_elm_slideshow_items_loop_get_reflect}, + {"timeout", __eolian_elm_slideshow_timeout_set_reflect, __eolian_elm_slideshow_timeout_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_slideshow_class_desc = { + EO_VERSION, + "Elm.Slideshow", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Slideshow_Data), + _elm_slideshow_class_initializer, + _elm_slideshow_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_slideshow_class_get, &_elm_slideshow_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_slideshow_eo.legacy.c" diff --git a/src/lib/elementary/elm_slideshow_eo.h b/src/lib/elementary/elm_slideshow_eo.h new file mode 100644 index 0000000000..00dd7aeeb8 --- /dev/null +++ b/src/lib/elementary/elm_slideshow_eo.h @@ -0,0 +1,408 @@ +#ifndef _ELM_SLIDESHOW_EO_H_ +#define _ELM_SLIDESHOW_EO_H_ + +#ifndef _ELM_SLIDESHOW_EO_CLASS_TYPE +#define _ELM_SLIDESHOW_EO_CLASS_TYPE + +typedef Eo Elm_Slideshow; + +#endif + +#ifndef _ELM_SLIDESHOW_EO_TYPES +#define _ELM_SLIDESHOW_EO_TYPES + + +#endif +/** Elementary slideshow class + * + * @ingroup Elm_Slideshow + */ +#define ELM_SLIDESHOW_CLASS elm_slideshow_class_get() + +EWAPI const Efl_Class *elm_slideshow_class_get(void); + +/** + * @brief Set the number of items to cache, on a given slideshow widget, after + * the current item. + * + * The default value for this property is 2. See @ref Slideshow_Caching + * "slideshow caching" for more details. + * + * @param[in] obj The object. + * @param[in] count Number of items to cache after the current one. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_cache_after_set(Eo *obj, int count); + +/** + * @brief Get the number of items to cache, on a given slideshow widget, after + * the current item. + * + * @param[in] obj The object. + * + * @return Number of items to cache after the current one. + * + * @ingroup Elm_Slideshow + */ +EOAPI int elm_obj_slideshow_cache_after_get(const Eo *obj); + +/** + * @brief Set the number of items to cache, on a given slideshow widget, before + * the current item. + * + * The default value for this property is 2. See @ref Slideshow_Caching + * "slideshow caching" for more details. + * + * @param[in] obj The object. + * @param[in] count Number of items to cache before the current one. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_cache_before_set(Eo *obj, int count); + +/** + * @brief Get the number of items to cache, on a given slideshow widget, before + * the current item. + * + * @param[in] obj The object. + * + * @return Number of items to cache before the current one. + * + * @ingroup Elm_Slideshow + */ +EOAPI int elm_obj_slideshow_cache_before_get(const Eo *obj); + +/** + * @brief Set the current slide layout in use for a given slideshow widget + * + * If @c layout is implemented in @c obj's theme (i.e., is contained in the + * list returned by elm_slideshow_layouts_get()), this new images layout will + * be used on the widget. + * + * See @ref elm_obj_slideshow_layouts_get for more details. + * + * @param[in] obj The object. + * @param[in] layout The new layout's name string. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_layout_set(Eo *obj, const char *layout); + +/** + * @brief Get the current slide layout in use for a given slideshow widget. + * + * @param[in] obj The object. + * + * @return The new layout's name string. + * + * @ingroup Elm_Slideshow + */ +EOAPI const char *elm_obj_slideshow_layout_get(const Eo *obj); + +/** + * @brief Set the current slide transition/effect in use for a given slideshow + * widget. + * + * If @c transition is implemented in @c obj's theme (i.e., is contained in the + * list returned by @ref elm_obj_slideshow_transitions_get), this new sliding + * effect will be used on the widget. + * + * @param[in] obj The object. + * @param[in] transition The new transition's name string. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_transition_set(Eo *obj, const char *transition); + +/** + * @brief Get the current slide transition/effect in use for a given slideshow + * widget. + * + * @param[in] obj The object. + * + * @return The new transition's name string. + * + * @ingroup Elm_Slideshow + */ +EOAPI const char *elm_obj_slideshow_transition_get(const Eo *obj); + +/** + * @brief Set if the slideshow items should be displayed cyclically or not, so + * when the end is reached it will restart from the first item. + * + * @note This will affect the "automatic" slidshow behaviour and the + * @ref elm_obj_slideshow_next and @ref elm_obj_slideshow_previous functions as + * well. + * + * @param[in] obj The object. + * @param[in] loop Use @c true to make it cycle through items or @c false for + * it to stop at the end of @c obj's internal list of items. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_items_loop_set(Eo *obj, Eina_Bool loop); + +/** + * @brief Get if, after a slideshow is started, for a given slideshow widget, + * its items are to be displayed cyclically or not. + * + * @param[in] obj The object. + * + * @return Use @c true to make it cycle through items or @c false for it to + * stop at the end of @c obj's internal list of items. + * + * @ingroup Elm_Slideshow + */ +EOAPI Eina_Bool elm_obj_slideshow_items_loop_get(const Eo *obj); + +/** + * @brief Set the interval between each image transition on a given slideshow + * widget and start the slideshow itself. + * + * After this call, the slideshow widget will start cycling its view, + * sequentially and automatically, with the images of the items it has. The + * time between each new image displayed is going to be @c timeout, in seconds. + * If a different timeout was set previously and an slideshow was in progress, + * it will continue with the new time between transitions, after this call. + * + * @note A value less than or equal to 0 on @c timeout will disable the + * widget's internal timer, thus halting any slideshow which could be happening + * on @c obj. + * + * @param[in] obj The object. + * @param[in] timeout The new displaying timeout for images. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_timeout_set(Eo *obj, double timeout); + +/** + * @brief Get the interval set for image transitions on a given slideshow + * widget. + * + * @param[in] obj The object. + * + * @return The new displaying timeout for images. + * + * @ingroup Elm_Slideshow + */ +EOAPI double elm_obj_slideshow_timeout_get(const Eo *obj); + +/** + * @brief Get the internal list of items in a given slideshow widget. + * + * This list is not to be modified in any way and must not be freed. + * + * @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. + * + * @param[in] obj The object. + * + * @return The list of items (#Elm.Widget.Item as data) or @c null on errors. + * + * @ingroup Elm_Slideshow + */ +EOAPI const Eina_List *elm_obj_slideshow_items_get(const Eo *obj); + +/** + * @brief Returns the list of sliding transition/effect names available, for a + * given slideshow widget. + * + * The transitions, which come from @c obj's theme, must be an EDC data item + * named $"transitions" on the theme file, with (prefix) names of EDC programs + * actually implementing them. + * + * The available transitions for slideshows on the default theme are "fade" + * (the current item fades out, while the new one fades in to the slideshow's + * viewport), "black_fade" (the current item fades to black, and just then, the + * new item will fade in), "horizontal" (the current item slides horizontally, + * until it gets out of the slideshow's viewport, while the new item comes from + * the left to take its place), "vertical" (the current item slides vertically, + * until it gets out of the slideshow's viewport, while the new item comes from + * the bottom to take its place), "square" (the new item starts to appear from + * the middle of the current one, but with a tiny size, growing until its + * target (full) size and covering the old one. + * + * @warning The stringshared strings get no new references exclusive to the + * user grabbing the list, here, so if you'd like to use them out of this + * call's context, you'd better @ref eina_stringshare_ref them. Also the list + * is an internal list and so is only valid for as long as the slideshow object + * is valid and has not internally changed its list for some reason, so make a + * copy if you need it around. + * + * @param[in] obj The object. + * + * @return The list of transitions (list of stringshared strings as data). + * + * @ingroup Elm_Slideshow + */ +EOAPI const Eina_List *elm_obj_slideshow_transitions_get(const Eo *obj); + +/** + * @brief Get the number of items stored in a given slideshow widget. + * + * @param[in] obj The object. + * + * @return The number of items on @c obj, at the moment of this call. + * + * @ingroup Elm_Slideshow + */ +EOAPI unsigned int elm_obj_slideshow_count_get(const Eo *obj); + +/** + * @brief Returns the currently displayed item, in a given slideshow widget. + * + * @param[in] obj The object. + * + * @return A handle to the item being displayed in @c obj or @c null, if none + * is (and on errors) + * + * @ingroup Elm_Slideshow + */ +EOAPI Elm_Widget_Item *elm_obj_slideshow_item_current_get(const Eo *obj); + +/** + * @brief Returns the list of layout names available, for a given slideshow + * widget. + * + * Slideshow layouts will change how the widget is to dispose each image item + * in its viewport, with regard to cropping, scaling, etc. + * + * The layouts, which come from @c obj's theme, must be an EDC data item name + * $"layouts" on the theme file, with (prefix) names of EDC programs actually + * implementing them. + * + * The available layouts for slideshows on the default theme are "fullscreen" + * (item images with original aspect, scaled to touch top and down slideshow + * borders or, if the image's height is not enough, left and right slideshow + * borders) and "not_fullscreen" (the same behavior as the "fullscreen" one, + * but always leaving 10% of the slideshow's dimensions of distance between the + * item image's borders and the slideshow borders, for each axis)- + * + * @warning The stringshared strings get no new references exclusive to the + * user grabbing the list, here, so if you'd like to use them out of this + * call's context, you'd better @ref eina_stringshare_ref them. + * + * @param[in] obj The object. + * + * @return The list of layouts (list of stringshared strings as data) + * + * @ingroup Elm_Slideshow + */ +EOAPI const Eina_List *elm_obj_slideshow_layouts_get(const Eo *obj); + +/** + * @brief Slide to the previous item, in a given slideshow widget + * + * The sliding animation @c obj is set to use will be the transition effect + * used, after this call is issued. + * + * @note If the beginning of the slideshow's internal list of items is reached, + * it'll wrap around to the list's end, again. + * @param[in] obj The object. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_previous(Eo *obj); + +/** + * @brief Get the the item, in a given slideshow widget, placed at position + * @c nth, in its internal items list. + * + * @param[in] obj The object. + * @param[in] nth The number of the item to grab a handle to (0 being the + * first). + * + * @return The item stored in @c obj at position @c nth or @c null if there's + * no item with that index (and on errors). + * + * @ingroup Elm_Slideshow + */ +EOAPI Elm_Widget_Item *elm_obj_slideshow_item_nth_get(const Eo *obj, unsigned int nth); + +/** + * @brief Slide to the next item, in a given slideshow widget. + * + * The sliding animation @c obj is set to use will be the transition effect + * used, after this call is issued. + * + * @note If the end of the slideshow's internal list of items is reached, it'll + * wrap around to the list's beginning, again. + * @param[in] obj The object. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_next(Eo *obj); + +/** + * @brief Remove all items from a given slideshow widget. + * + * This removes (and deletes) all items in @c obj, leaving it empty. + * @param[in] obj The object. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_clear(Eo *obj); + +/** + * @brief Add (append) a new item in a given slideshow widget. + * + * Add a new item to @c obj's internal list of items, appending it. The item's + * class must contain the function really fetching the image object to show for + * this item, which could be an Evas image object or an Elementary photo, for + * example. The @c data parameter is going to be passed to both class functions + * of the item. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item's data. + * + * @return A handle to the item added or @c null on errors. + * + * @ingroup Elm_Slideshow + */ +EOAPI Elm_Widget_Item *elm_obj_slideshow_item_add(Eo *obj, const Elm_Slideshow_Item_Class *itc, const void *data); + +/** + * @brief Insert a new item into the given slideshow widget, using the @c func + * function to sort items (by item handles). + * + * Add a new item to @c obj's internal list of items, in a position determined + * by the @c func comparing function. The item's class must contain the + * function really fetching the image object to show for this item, which could + * be an Evas image object or an Elementary photo, for example. The @c data + * parameter is going to be passed to both class functions of the item. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item's data. + * @param[in] func The comparing function to be used to sort the slideshow + * items by #Elm_Slideshow_Item_Class item handles. + * + * @return Returns The slideshow item handle, on success, or @c null on errors. + * + * @ingroup Elm_Slideshow + */ +EOAPI Elm_Widget_Item *elm_obj_slideshow_item_sorted_insert(Eo *obj, const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func); + +EWAPI extern const Efl_Event_Description _ELM_SLIDESHOW_EVENT_CHANGED; + +/** Called when slideshow widget changed + * @return Efl_Object * + * + * @ingroup Elm_Slideshow + */ +#define ELM_SLIDESHOW_EVENT_CHANGED (&(_ELM_SLIDESHOW_EVENT_CHANGED)) + +EWAPI extern const Efl_Event_Description _ELM_SLIDESHOW_EVENT_TRANSITION_END; + +/** Called on transition end + * @return Efl_Object * + * + * @ingroup Elm_Slideshow + */ +#define ELM_SLIDESHOW_EVENT_TRANSITION_END (&(_ELM_SLIDESHOW_EVENT_TRANSITION_END)) + +#endif diff --git a/src/lib/elementary/elm_slideshow_eo.legacy.c b/src/lib/elementary/elm_slideshow_eo.legacy.c new file mode 100644 index 0000000000..3cda2750bb --- /dev/null +++ b/src/lib/elementary/elm_slideshow_eo.legacy.c @@ -0,0 +1,138 @@ + +EAPI void +elm_slideshow_cache_after_set(Elm_Slideshow *obj, int count) +{ + elm_obj_slideshow_cache_after_set(obj, count); +} + +EAPI int +elm_slideshow_cache_after_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_cache_after_get(obj); +} + +EAPI void +elm_slideshow_cache_before_set(Elm_Slideshow *obj, int count) +{ + elm_obj_slideshow_cache_before_set(obj, count); +} + +EAPI int +elm_slideshow_cache_before_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_cache_before_get(obj); +} + +EAPI void +elm_slideshow_layout_set(Elm_Slideshow *obj, const char *layout) +{ + elm_obj_slideshow_layout_set(obj, layout); +} + +EAPI const char * +elm_slideshow_layout_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_layout_get(obj); +} + +EAPI void +elm_slideshow_transition_set(Elm_Slideshow *obj, const char *transition) +{ + elm_obj_slideshow_transition_set(obj, transition); +} + +EAPI const char * +elm_slideshow_transition_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_transition_get(obj); +} + +EAPI void +elm_slideshow_loop_set(Elm_Slideshow *obj, Eina_Bool loop) +{ + elm_obj_slideshow_items_loop_set(obj, loop); +} + +EAPI Eina_Bool +elm_slideshow_loop_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_items_loop_get(obj); +} + +EAPI void +elm_slideshow_timeout_set(Elm_Slideshow *obj, double timeout) +{ + elm_obj_slideshow_timeout_set(obj, timeout); +} + +EAPI double +elm_slideshow_timeout_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_timeout_get(obj); +} + +EAPI const Eina_List * +elm_slideshow_items_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_items_get(obj); +} + +EAPI const Eina_List * +elm_slideshow_transitions_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_transitions_get(obj); +} + +EAPI unsigned int +elm_slideshow_count_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_count_get(obj); +} + +EAPI Elm_Widget_Item * +elm_slideshow_item_current_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_item_current_get(obj); +} + +EAPI const Eina_List * +elm_slideshow_layouts_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_layouts_get(obj); +} + +EAPI void +elm_slideshow_previous(Elm_Slideshow *obj) +{ + elm_obj_slideshow_previous(obj); +} + +EAPI Elm_Widget_Item * +elm_slideshow_item_nth_get(const Elm_Slideshow *obj, unsigned int nth) +{ + return elm_obj_slideshow_item_nth_get(obj, nth); +} + +EAPI void +elm_slideshow_next(Elm_Slideshow *obj) +{ + elm_obj_slideshow_next(obj); +} + +EAPI void +elm_slideshow_clear(Elm_Slideshow *obj) +{ + elm_obj_slideshow_clear(obj); +} + +EAPI Elm_Widget_Item * +elm_slideshow_item_add(Elm_Slideshow *obj, const Elm_Slideshow_Item_Class *itc, const void *data) +{ + return elm_obj_slideshow_item_add(obj, itc, data); +} + +EAPI Elm_Widget_Item * +elm_slideshow_item_sorted_insert(Elm_Slideshow *obj, const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func) +{ + return elm_obj_slideshow_item_sorted_insert(obj, itc, data, func); +} diff --git a/src/lib/elementary/elm_slideshow_eo.legacy.h b/src/lib/elementary/elm_slideshow_eo.legacy.h new file mode 100644 index 0000000000..3670d7c913 --- /dev/null +++ b/src/lib/elementary/elm_slideshow_eo.legacy.h @@ -0,0 +1,382 @@ +#ifndef _ELM_SLIDESHOW_EO_LEGACY_H_ +#define _ELM_SLIDESHOW_EO_LEGACY_H_ + +#ifndef _ELM_SLIDESHOW_EO_CLASS_TYPE +#define _ELM_SLIDESHOW_EO_CLASS_TYPE + +typedef Eo Elm_Slideshow; + +#endif + +#ifndef _ELM_SLIDESHOW_EO_TYPES +#define _ELM_SLIDESHOW_EO_TYPES + + +#endif + +/** + * @brief Set the number of items to cache, on a given slideshow widget, after + * the current item. + * + * The default value for this property is 2. See @ref Slideshow_Caching + * "slideshow caching" for more details. + * + * @param[in] obj The object. + * @param[in] count Number of items to cache after the current one. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_cache_after_set(Elm_Slideshow *obj, int count); + +/** + * @brief Get the number of items to cache, on a given slideshow widget, after + * the current item. + * + * @param[in] obj The object. + * + * @return Number of items to cache after the current one. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI int elm_slideshow_cache_after_get(const Elm_Slideshow *obj); + +/** + * @brief Set the number of items to cache, on a given slideshow widget, before + * the current item. + * + * The default value for this property is 2. See @ref Slideshow_Caching + * "slideshow caching" for more details. + * + * @param[in] obj The object. + * @param[in] count Number of items to cache before the current one. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_cache_before_set(Elm_Slideshow *obj, int count); + +/** + * @brief Get the number of items to cache, on a given slideshow widget, before + * the current item. + * + * @param[in] obj The object. + * + * @return Number of items to cache before the current one. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI int elm_slideshow_cache_before_get(const Elm_Slideshow *obj); + +/** + * @brief Set the current slide layout in use for a given slideshow widget + * + * If @c layout is implemented in @c obj's theme (i.e., is contained in the + * list returned by elm_slideshow_layouts_get()), this new images layout will + * be used on the widget. + * + * See @ref elm_slideshow_layouts_get for more details. + * + * @param[in] obj The object. + * @param[in] layout The new layout's name string. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_layout_set(Elm_Slideshow *obj, const char *layout); + +/** + * @brief Get the current slide layout in use for a given slideshow widget. + * + * @param[in] obj The object. + * + * @return The new layout's name string. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI const char *elm_slideshow_layout_get(const Elm_Slideshow *obj); + +/** + * @brief Set the current slide transition/effect in use for a given slideshow + * widget. + * + * If @c transition is implemented in @c obj's theme (i.e., is contained in the + * list returned by @ref elm_slideshow_transitions_get), this new sliding + * effect will be used on the widget. + * + * @param[in] obj The object. + * @param[in] transition The new transition's name string. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_transition_set(Elm_Slideshow *obj, const char *transition); + +/** + * @brief Get the current slide transition/effect in use for a given slideshow + * widget. + * + * @param[in] obj The object. + * + * @return The new transition's name string. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI const char *elm_slideshow_transition_get(const Elm_Slideshow *obj); + +/** + * @brief Set if the slideshow items should be displayed cyclically or not, so + * when the end is reached it will restart from the first item. + * + * @note This will affect the "automatic" slidshow behaviour and the + * @ref elm_slideshow_next and @ref elm_slideshow_previous functions as well. + * + * @param[in] obj The object. + * @param[in] loop Use @c true to make it cycle through items or @c false for + * it to stop at the end of @c obj's internal list of items. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_loop_set(Elm_Slideshow *obj, Eina_Bool loop); + +/** + * @brief Get if, after a slideshow is started, for a given slideshow widget, + * its items are to be displayed cyclically or not. + * + * @param[in] obj The object. + * + * @return Use @c true to make it cycle through items or @c false for it to + * stop at the end of @c obj's internal list of items. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI Eina_Bool elm_slideshow_loop_get(const Elm_Slideshow *obj); + +/** + * @brief Set the interval between each image transition on a given slideshow + * widget and start the slideshow itself. + * + * After this call, the slideshow widget will start cycling its view, + * sequentially and automatically, with the images of the items it has. The + * time between each new image displayed is going to be @c timeout, in seconds. + * If a different timeout was set previously and an slideshow was in progress, + * it will continue with the new time between transitions, after this call. + * + * @note A value less than or equal to 0 on @c timeout will disable the + * widget's internal timer, thus halting any slideshow which could be happening + * on @c obj. + * + * @param[in] obj The object. + * @param[in] timeout The new displaying timeout for images. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_timeout_set(Elm_Slideshow *obj, double timeout); + +/** + * @brief Get the interval set for image transitions on a given slideshow + * widget. + * + * @param[in] obj The object. + * + * @return The new displaying timeout for images. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI double elm_slideshow_timeout_get(const Elm_Slideshow *obj); + +/** + * @brief Get the internal list of items in a given slideshow widget. + * + * This list is not to be modified in any way and must not be freed. + * + * @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. + * + * @param[in] obj The object. + * + * @return The list of items (#Elm.Widget.Item as data) or @c null on errors. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI const Eina_List *elm_slideshow_items_get(const Elm_Slideshow *obj); + +/** + * @brief Returns the list of sliding transition/effect names available, for a + * given slideshow widget. + * + * The transitions, which come from @c obj's theme, must be an EDC data item + * named $"transitions" on the theme file, with (prefix) names of EDC programs + * actually implementing them. + * + * The available transitions for slideshows on the default theme are "fade" + * (the current item fades out, while the new one fades in to the slideshow's + * viewport), "black_fade" (the current item fades to black, and just then, the + * new item will fade in), "horizontal" (the current item slides horizontally, + * until it gets out of the slideshow's viewport, while the new item comes from + * the left to take its place), "vertical" (the current item slides vertically, + * until it gets out of the slideshow's viewport, while the new item comes from + * the bottom to take its place), "square" (the new item starts to appear from + * the middle of the current one, but with a tiny size, growing until its + * target (full) size and covering the old one. + * + * @warning The stringshared strings get no new references exclusive to the + * user grabbing the list, here, so if you'd like to use them out of this + * call's context, you'd better @ref eina_stringshare_ref them. Also the list + * is an internal list and so is only valid for as long as the slideshow object + * is valid and has not internally changed its list for some reason, so make a + * copy if you need it around. + * + * @param[in] obj The object. + * + * @return The list of transitions (list of stringshared strings as data). + * + * @ingroup Elm_Slideshow_Group + */ +EAPI const Eina_List *elm_slideshow_transitions_get(const Elm_Slideshow *obj); + +/** + * @brief Get the number of items stored in a given slideshow widget. + * + * @param[in] obj The object. + * + * @return The number of items on @c obj, at the moment of this call. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI unsigned int elm_slideshow_count_get(const Elm_Slideshow *obj); + +/** + * @brief Returns the currently displayed item, in a given slideshow widget. + * + * @param[in] obj The object. + * + * @return A handle to the item being displayed in @c obj or @c null, if none + * is (and on errors) + * + * @ingroup Elm_Slideshow_Group + */ +EAPI Elm_Widget_Item *elm_slideshow_item_current_get(const Elm_Slideshow *obj); + +/** + * @brief Returns the list of layout names available, for a given slideshow + * widget. + * + * Slideshow layouts will change how the widget is to dispose each image item + * in its viewport, with regard to cropping, scaling, etc. + * + * The layouts, which come from @c obj's theme, must be an EDC data item name + * $"layouts" on the theme file, with (prefix) names of EDC programs actually + * implementing them. + * + * The available layouts for slideshows on the default theme are "fullscreen" + * (item images with original aspect, scaled to touch top and down slideshow + * borders or, if the image's height is not enough, left and right slideshow + * borders) and "not_fullscreen" (the same behavior as the "fullscreen" one, + * but always leaving 10% of the slideshow's dimensions of distance between the + * item image's borders and the slideshow borders, for each axis)- + * + * @warning The stringshared strings get no new references exclusive to the + * user grabbing the list, here, so if you'd like to use them out of this + * call's context, you'd better @ref eina_stringshare_ref them. + * + * @param[in] obj The object. + * + * @return The list of layouts (list of stringshared strings as data) + * + * @ingroup Elm_Slideshow_Group + */ +EAPI const Eina_List *elm_slideshow_layouts_get(const Elm_Slideshow *obj); + +/** + * @brief Slide to the previous item, in a given slideshow widget + * + * The sliding animation @c obj is set to use will be the transition effect + * used, after this call is issued. + * + * @note If the beginning of the slideshow's internal list of items is reached, + * it'll wrap around to the list's end, again. + * @param[in] obj The object. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_previous(Elm_Slideshow *obj); + +/** + * @brief Get the the item, in a given slideshow widget, placed at position + * @c nth, in its internal items list. + * + * @param[in] obj The object. + * @param[in] nth The number of the item to grab a handle to (0 being the + * first). + * + * @return The item stored in @c obj at position @c nth or @c null if there's + * no item with that index (and on errors). + * + * @ingroup Elm_Slideshow_Group + */ +EAPI Elm_Widget_Item *elm_slideshow_item_nth_get(const Elm_Slideshow *obj, unsigned int nth); + +/** + * @brief Slide to the next item, in a given slideshow widget. + * + * The sliding animation @c obj is set to use will be the transition effect + * used, after this call is issued. + * + * @note If the end of the slideshow's internal list of items is reached, it'll + * wrap around to the list's beginning, again. + * @param[in] obj The object. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_next(Elm_Slideshow *obj); + +/** + * @brief Remove all items from a given slideshow widget. + * + * This removes (and deletes) all items in @c obj, leaving it empty. + * @param[in] obj The object. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_clear(Elm_Slideshow *obj); + +/** + * @brief Add (append) a new item in a given slideshow widget. + * + * Add a new item to @c obj's internal list of items, appending it. The item's + * class must contain the function really fetching the image object to show for + * this item, which could be an Evas image object or an Elementary photo, for + * example. The @c data parameter is going to be passed to both class functions + * of the item. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item's data. + * + * @return A handle to the item added or @c null on errors. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI Elm_Widget_Item *elm_slideshow_item_add(Elm_Slideshow *obj, const Elm_Slideshow_Item_Class *itc, const void *data); + +/** + * @brief Insert a new item into the given slideshow widget, using the @c func + * function to sort items (by item handles). + * + * Add a new item to @c obj's internal list of items, in a position determined + * by the @c func comparing function. The item's class must contain the + * function really fetching the image object to show for this item, which could + * be an Evas image object or an Elementary photo, for example. The @c data + * parameter is going to be passed to both class functions of the item. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item's data. + * @param[in] func The comparing function to be used to sort the slideshow + * items by #Elm_Slideshow_Item_Class item handles. + * + * @return Returns The slideshow item handle, on success, or @c null on errors. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI Elm_Widget_Item *elm_slideshow_item_sorted_insert(Elm_Slideshow *obj, const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func); + +#endif diff --git a/src/lib/elementary/elm_slideshow_item.eo b/src/lib/elementary/elm_slideshow_item.eo deleted file mode 100644 index c6d768630f..0000000000 --- a/src/lib/elementary/elm_slideshow_item.eo +++ /dev/null @@ -1,36 +0,0 @@ -class Elm.Slideshow.Item extends Elm.Widget.Item -{ - [[Elementary slideshow class]] - legacy_prefix: elm_slideshow_item; - eo_prefix: elm_obj_slideshow_item; - event_prefix: elm_slideshow_item; - methods { - show { - [[Display a given slideshow widget's item, programmatically. - - The change between the current item and $item will use the - transition $obj is set to use. - - See: Elm.Slidshow.transition.get]] - /* FIXME Make a proper ref ^ */ - } - object_get @const { - [[Get the real Evas object created to implement the view of a given slideshow item. - - This returns the actual Evas object used to implement the - specified slideshow item's view. This may be $null, as it may - not have been created or may have been deleted, at any time, by - the slideshow. **Do not modify this object** (move, resize, - show, hide, etc.), as the slideshow is controlling it. This - function is for querying, emitting custom signals or hooking - lower level callbacks for events on that object. Do not delete - this object under any circumstances.]] - - return: Efl.Canvas.Object; [[Real evas object]] - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - } -} diff --git a/src/lib/elementary/elm_slideshow_item_eo.c b/src/lib/elementary/elm_slideshow_item_eo.c new file mode 100644 index 0000000000..4c919d210b --- /dev/null +++ b/src/lib/elementary/elm_slideshow_item_eo.c @@ -0,0 +1,51 @@ + +void _elm_slideshow_item_show(Eo *obj, Elm_Slideshow_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_slideshow_item_show); + +Efl_Canvas_Object *_elm_slideshow_item_object_get(const Eo *obj, Elm_Slideshow_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_item_object_get, Efl_Canvas_Object *, NULL); + +Efl_Object *_elm_slideshow_item_efl_object_constructor(Eo *obj, Elm_Slideshow_Item_Data *pd); + + +void _elm_slideshow_item_efl_object_destructor(Eo *obj, Elm_Slideshow_Item_Data *pd); + + +static Eina_Bool +_elm_slideshow_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_SLIDESHOW_ITEM_EXTRA_OPS +#define ELM_SLIDESHOW_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_item_show, _elm_slideshow_item_show), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_item_object_get, _elm_slideshow_item_object_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_slideshow_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_slideshow_item_efl_object_destructor), + ELM_SLIDESHOW_ITEM_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_slideshow_item_class_desc = { + EO_VERSION, + "Elm.Slideshow.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Slideshow_Item_Data), + _elm_slideshow_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_slideshow_item_class_get, &_elm_slideshow_item_class_desc, ELM_WIDGET_ITEM_CLASS, NULL); + +#include "elm_slideshow_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_slideshow_item_eo.h b/src/lib/elementary/elm_slideshow_item_eo.h new file mode 100644 index 0000000000..065a7f6b83 --- /dev/null +++ b/src/lib/elementary/elm_slideshow_item_eo.h @@ -0,0 +1,57 @@ +#ifndef _ELM_SLIDESHOW_ITEM_EO_H_ +#define _ELM_SLIDESHOW_ITEM_EO_H_ + +#ifndef _ELM_SLIDESHOW_ITEM_EO_CLASS_TYPE +#define _ELM_SLIDESHOW_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Slideshow_Item; + +#endif + +#ifndef _ELM_SLIDESHOW_ITEM_EO_TYPES +#define _ELM_SLIDESHOW_ITEM_EO_TYPES + + +#endif +/** Elementary slideshow class + * + * @ingroup Elm_Slideshow_Item + */ +#define ELM_SLIDESHOW_ITEM_CLASS elm_slideshow_item_class_get() + +EWAPI const Efl_Class *elm_slideshow_item_class_get(void); + +/** + * @brief Display a given slideshow widget's item, programmatically. + * + * The change between the current item and @c item will use the transition + * @c obj is set to use. + * + * See: Elm.Slidshow.transition.get + * @param[in] obj The object. + * + * @ingroup Elm_Slideshow_Item + */ +EOAPI void elm_obj_slideshow_item_show(Eo *obj); + +/** + * @brief Get the real Evas object created to implement the view of a given + * slideshow item. + * + * This returns the actual Evas object used to implement the specified + * slideshow item's view. This may be @c null, as it may not have been created + * or may have been deleted, at any time, by the slideshow. **Do not modify + * this object** (move, resize, show, hide, etc.), as the slideshow is + * controlling it. This function is for querying, emitting custom signals or + * hooking lower level callbacks for events on that object. Do not delete this + * object under any circumstances. + * + * @param[in] obj The object. + * + * @return Real evas object + * + * @ingroup Elm_Slideshow_Item + */ +EOAPI Efl_Canvas_Object *elm_obj_slideshow_item_object_get(const Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_slideshow_item_eo.legacy.c b/src/lib/elementary/elm_slideshow_item_eo.legacy.c new file mode 100644 index 0000000000..b919b5186c --- /dev/null +++ b/src/lib/elementary/elm_slideshow_item_eo.legacy.c @@ -0,0 +1,12 @@ + +EAPI void +elm_slideshow_item_show(Elm_Slideshow_Item *obj) +{ + elm_obj_slideshow_item_show(obj); +} + +EAPI Efl_Canvas_Object * +elm_slideshow_item_object_get(const Elm_Slideshow_Item *obj) +{ + return elm_obj_slideshow_item_object_get(obj); +} diff --git a/src/lib/elementary/elm_slideshow_item_eo.legacy.h b/src/lib/elementary/elm_slideshow_item_eo.legacy.h new file mode 100644 index 0000000000..7ce66ccb85 --- /dev/null +++ b/src/lib/elementary/elm_slideshow_item_eo.legacy.h @@ -0,0 +1,50 @@ +#ifndef _ELM_SLIDESHOW_ITEM_EO_LEGACY_H_ +#define _ELM_SLIDESHOW_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_SLIDESHOW_ITEM_EO_CLASS_TYPE +#define _ELM_SLIDESHOW_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Slideshow_Item; + +#endif + +#ifndef _ELM_SLIDESHOW_ITEM_EO_TYPES +#define _ELM_SLIDESHOW_ITEM_EO_TYPES + + +#endif + +/** + * @brief Display a given slideshow widget's item, programmatically. + * + * The change between the current item and @c item will use the transition + * @c obj is set to use. + * + * See: Elm.Slidshow.transition.get + * @param[in] obj The object. + * + * @ingroup Elm_Slideshow_Item_Group + */ +EAPI void elm_slideshow_item_show(Elm_Slideshow_Item *obj); + +/** + * @brief Get the real Evas object created to implement the view of a given + * slideshow item. + * + * This returns the actual Evas object used to implement the specified + * slideshow item's view. This may be @c null, as it may not have been created + * or may have been deleted, at any time, by the slideshow. **Do not modify + * this object** (move, resize, show, hide, etc.), as the slideshow is + * controlling it. This function is for querying, emitting custom signals or + * hooking lower level callbacks for events on that object. Do not delete this + * object under any circumstances. + * + * @param[in] obj The object. + * + * @return Real evas object + * + * @ingroup Elm_Slideshow_Item_Group + */ +EAPI Efl_Canvas_Object *elm_slideshow_item_object_get(const Elm_Slideshow_Item *obj); + +#endif diff --git a/src/lib/elementary/elm_slideshow_legacy.h b/src/lib/elementary/elm_slideshow_legacy.h index d16ad0eb93..95a68b67f4 100644 --- a/src/lib/elementary/elm_slideshow_legacy.h +++ b/src/lib/elementary/elm_slideshow_legacy.h @@ -11,5 +11,5 @@ */ EAPI Evas_Object *elm_slideshow_add(Evas_Object *parent); -#include "elm_slideshow_item.eo.legacy.h" -#include "elm_slideshow.eo.legacy.h" +#include "elm_slideshow_item_eo.legacy.h" +#include "elm_slideshow_eo.legacy.h" diff --git a/src/lib/elementary/elm_spinner.c b/src/lib/elementary/elm_spinner.c index 1e6dee9123..3c35f0e2ce 100644 --- a/src/lib/elementary/elm_spinner.c +++ b/src/lib/elementary/elm_spinner.c @@ -12,7 +12,7 @@ #include "elm_priv.h" #include "elm_widget_spinner.h" -#include "elm_entry.eo.h" +#include "elm_entry_eo.h" #include "Eo.h" @@ -744,7 +744,7 @@ _key_action_toggle(Evas_Object *obj, const char *params EINA_UNUSED) } EOLIAN static Eina_Bool -_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) +_elm_spinner_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Spinner_Data *sd EINA_UNUSED, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED) { Eo *ev = eo_event->info; @@ -1187,7 +1187,6 @@ _elm_spinner_efl_canvas_group_group_add(Eo *obj, Elm_Spinner_Data *priv) ELM_SPINNER_DATA_GET(obj, sd); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); priv->val_max = 100.0; priv->step = 1.0; @@ -1299,15 +1298,15 @@ _elm_spinner_efl_canvas_group_group_del(Eo *obj, Elm_Spinner_Data *sd) efl_canvas_group_del(efl_super(obj, MY_CLASS)); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _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_RESULT_FAIL); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); - if (!efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS))) + if (efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)) == EFL_UI_THEME_APPLY_ERROR_GENERIC) { CRI("Failed to set layout!"); - return EFL_UI_THEME_APPLY_RESULT_FAIL; + return EFL_UI_THEME_APPLY_ERROR_GENERIC; } if (edje_object_part_exists(wd->resize_obj, "elm.swallow.dec_button")) @@ -1351,7 +1350,7 @@ _elm_spinner_efl_ui_widget_theme_apply(Eo *obj, Elm_Spinner_Data *sd) _access_spinner_register(obj, EINA_TRUE); elm_layout_sizing_eval(obj); - return EFL_UI_THEME_APPLY_RESULT_SUCCESS; + return EFL_UI_THEME_APPLY_ERROR_NONE; } static Eina_Bool _elm_spinner_smart_focus_next_enable = EINA_FALSE; @@ -1450,7 +1449,7 @@ _elm_spinner_label_format_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd) } EOLIAN static void -_elm_spinner_efl_ui_range_range_min_max_set(Eo *obj, Elm_Spinner_Data *sd, double min, double max) +_elm_spinner_efl_ui_range_display_range_min_max_set(Eo *obj, Elm_Spinner_Data *sd, double min, double max) { if ((sd->val_min == min) && (sd->val_max == max)) return; @@ -1465,26 +1464,26 @@ _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(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double *min, double *max) +_elm_spinner_efl_ui_range_display_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; } EOLIAN static void -_elm_spinner_efl_ui_range_range_step_set(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double step) +_elm_spinner_efl_ui_range_interactive_range_step_set(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double step) { sd->step = step; } EOLIAN static double -_elm_spinner_efl_ui_range_range_step_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd) +_elm_spinner_efl_ui_range_interactive_range_step_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd) { return sd->step; } EOLIAN static void -_elm_spinner_efl_ui_range_range_value_set(Eo *obj, Elm_Spinner_Data *sd, double val) +_elm_spinner_efl_ui_range_display_range_value_set(Eo *obj, Elm_Spinner_Data *sd, double val) { if (sd->val == val) return; @@ -1509,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(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd) +_elm_spinner_efl_ui_range_display_range_value_get(const Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd) { return sd->val; } @@ -1722,4 +1721,4 @@ _elm_spinner_efl_access_object_i18n_name_get(const Eo *obj, Elm_Spinner_Data *sd ELM_LAYOUT_SIZING_EVAL_OPS(elm_spinner), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_spinner) -#include "elm_spinner.eo.c" +#include "elm_spinner_eo.c" diff --git a/src/lib/elementary/elm_spinner.eo b/src/lib/elementary/elm_spinner.eo deleted file mode 100644 index 612a8ec3ea..0000000000 --- a/src/lib/elementary/elm_spinner.eo +++ /dev/null @@ -1,195 +0,0 @@ -class Elm.Spinner extends Efl.Ui.Layout implements Efl.Ui.Range, Efl.Ui.Focus.Composition, - Efl.Access.Value, Efl.Access.Widget.Action, Efl.Ui.Legacy -{ - [[Elementary spinner class]] - legacy_prefix: elm_spinner; - eo_prefix: elm_obj_spinner; - event_prefix: elm_spinner; - methods { - @property wrap { - [[Control whether the spinner should wrap when it reaches its minimum or maximum value. - - Disabled by default. If disabled, when the user tries to increment the - value, - but displayed value plus step value is bigger than maximum value, - the new value will be the maximum value. - The same happens when the user tries to decrement it, - but the value less step is less than minimum value. In this case, - the new displayed value will be the minimum value. - - When wrap is enabled, when the user tries to increment the value, - but displayed value plus step value is bigger than maximum value, - the new value will be the minimum value. When the the user tries to - decrement it, but the value less step is less than minimum value, - the new displayed value will be the maximum value. - - E.g.: - $min = 10 - $max = 50 - $step = 20 - $displayed = 20 - - When the user decrement value (using left or bottom arrow), it will - displays $50.]] - set { - } - get { - } - values { - wrap: bool; [[$true to enable wrap or $false to disable it.]] - } - } - @property interval { - [[Control the interval on time updates for an user mouse button hold on spinner widgets' arrows. - - This interval value is decreased while the user holds the - mouse pointer either incrementing or decrementing spinner's value. - - This helps the user to get to a given value distant from the - current one easier/faster, as it will start to change quicker and - quicker on mouse button holds. - - The calculation for the next change interval value, starting from - the one set with this call, is the previous interval divided by - $1.05, so it decreases a little bit. - - The default starting interval value for automatic changes is - $0.85 seconds.]] - set { - } - get { - } - values { - interval: double; [[The (first) interval value in seconds.]] - } - } - @property round { - [[Control the round value for rounding - - Sets the rounding value used for value rounding in the spinner.]] - set { - } - get { - } - values { - rnd: int; [[The rounding value]] - } - } - @property editable { - [[Control whether the spinner can be directly edited by the user or not. - - Spinner objects can have edition disabled, in which state they will - be changed only by arrows. - Useful for contexts - where you don't want your users to interact with it writing the value. - Specially - when using special values, the user can see real value instead - of special label on edition. - - It's enabled by default.]] - set { - } - get { - } - values { - editable: bool; [[$true to allow users to edit it or $false to don't allow users to edit it directly.]] - } - } - @property base { - [[Control the base for rounding - - Rounding works as follows: - - rounded_val = base + (double)(((value - base) / round) * round) - - Where rounded_val, value and base are doubles, and round is an integer. - - This means that things will be rounded to increments (or decrements) of - "round" starting from value $base. The default base for rounding is 0. - - Example: round = 3, base = 2 - Values: ..., -2, 0, 2, 5, 8, 11, 14, ... - - Example: round = 2, base = 5.5 - Values: ..., -0.5, 1.5, 3.5, 5.5, 7.5, 9.5, 11.5, ...]] - set { - } - get { - } - values { - base: double; [[The base value]] - } - } - @property label_format { - [[Control the format string of the displayed label. - - If $NULL, this sets the format to "%.0f". If not it sets the format - string for the label text. The label text is provided a floating point - value, so the label text can display up to 1 floating point value. - Note that this is optional. - - Use a format string such as "%1.2f meters" for example, and it will - display values like: "3.14 meters" for a value equal to 3.14159. - - Default is "%0.f".]] - set { - } - get { - } - values { - fmt: string @nullable; [[The format string for the label display.]] - } - } - special_value_add { - [[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.]] - - /* FIXME-doc - E.g.: - @code - sp = elm_spinner_add(win); - elm_spinner_min_max_set(sp, 1, 3); - elm_spinner_special_value_add(sp, 1, "January"); - elm_spinner_special_value_add(sp, 2, "February"); - elm_spinner_special_value_add(sp, 3, "March"); - evas_object_show(sp); - @endcode - */ - params { - @in value: double; [[The value to be replaced.]] - @in label: string; [[The label to be used.]] - - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - 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.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 { - /* 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_spinner.h b/src/lib/elementary/elm_spinner.h index 16c040a3e7..bbfe2f2fa4 100644 --- a/src/lib/elementary/elm_spinner.h +++ b/src/lib/elementary/elm_spinner.h @@ -57,9 +57,6 @@ * @{ */ -#ifdef EFL_EO_API_SUPPORT -#include "elm_spinner.eo.h" -#endif #ifndef EFL_NOLEGACY_API_SUPPORT #include "elm_spinner_legacy.h" #endif diff --git a/src/lib/elementary/elm_spinner_eo.c b/src/lib/elementary/elm_spinner_eo.c new file mode 100644 index 0000000000..d8ac147ba0 --- /dev/null +++ b/src/lib/elementary/elm_spinner_eo.c @@ -0,0 +1,335 @@ +EWAPI const Efl_Event_Description _ELM_SPINNER_EVENT_CHANGED = + EFL_EVENT_DESCRIPTION("changed"); +EWAPI const Efl_Event_Description _ELM_SPINNER_EVENT_DELAY_CHANGED = + EFL_EVENT_DESCRIPTION("delay,changed"); +EWAPI const Efl_Event_Description _ELM_SPINNER_EVENT_SPINNER_DRAG_START = + EFL_EVENT_DESCRIPTION("spinner,drag,start"); +EWAPI const Efl_Event_Description _ELM_SPINNER_EVENT_SPINNER_DRAG_STOP = + EFL_EVENT_DESCRIPTION("spinner,drag,stop"); +EWAPI const Efl_Event_Description _ELM_SPINNER_EVENT_MIN_REACHED = + EFL_EVENT_DESCRIPTION("min,reached"); +EWAPI const Efl_Event_Description _ELM_SPINNER_EVENT_MAX_REACHED = + EFL_EVENT_DESCRIPTION("max,reached"); + +void _elm_spinner_wrap_set(Eo *obj, Elm_Spinner_Data *pd, Eina_Bool wrap); + + +static Eina_Error +__eolian_elm_spinner_wrap_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_spinner_wrap_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_spinner_wrap_set, EFL_FUNC_CALL(wrap), Eina_Bool wrap); + +Eina_Bool _elm_spinner_wrap_get(const Eo *obj, Elm_Spinner_Data *pd); + + +static Eina_Value +__eolian_elm_spinner_wrap_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_spinner_wrap_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_spinner_wrap_get, Eina_Bool, 0); + +void _elm_spinner_interval_set(Eo *obj, Elm_Spinner_Data *pd, double interval); + + +static Eina_Error +__eolian_elm_spinner_interval_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_spinner_interval_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_spinner_interval_set, EFL_FUNC_CALL(interval), double interval); + +double _elm_spinner_interval_get(const Eo *obj, Elm_Spinner_Data *pd); + + +static Eina_Value +__eolian_elm_spinner_interval_get_reflect(const Eo *obj) +{ + double val = elm_obj_spinner_interval_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_spinner_interval_get, double, 0); + +void _elm_spinner_round_set(Eo *obj, Elm_Spinner_Data *pd, int rnd); + + +static Eina_Error +__eolian_elm_spinner_round_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_spinner_round_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_spinner_round_set, EFL_FUNC_CALL(rnd), int rnd); + +int _elm_spinner_round_get(const Eo *obj, Elm_Spinner_Data *pd); + + +static Eina_Value +__eolian_elm_spinner_round_get_reflect(const Eo *obj) +{ + int val = elm_obj_spinner_round_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_spinner_round_get, int, 0); + +void _elm_spinner_editable_set(Eo *obj, Elm_Spinner_Data *pd, Eina_Bool editable); + + +static Eina_Error +__eolian_elm_spinner_editable_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_spinner_editable_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_spinner_editable_set, EFL_FUNC_CALL(editable), Eina_Bool editable); + +Eina_Bool _elm_spinner_editable_get(const Eo *obj, Elm_Spinner_Data *pd); + + +static Eina_Value +__eolian_elm_spinner_editable_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_spinner_editable_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_spinner_editable_get, Eina_Bool, 0); + +void _elm_spinner_base_set(Eo *obj, Elm_Spinner_Data *pd, double base); + + +static Eina_Error +__eolian_elm_spinner_base_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_spinner_base_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_spinner_base_set, EFL_FUNC_CALL(base), double base); + +double _elm_spinner_base_get(const Eo *obj, Elm_Spinner_Data *pd); + + +static Eina_Value +__eolian_elm_spinner_base_get_reflect(const Eo *obj) +{ + double val = elm_obj_spinner_base_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_spinner_base_get, double, 0); + +void _elm_spinner_label_format_set(Eo *obj, Elm_Spinner_Data *pd, const char *fmt); + + +static Eina_Error +__eolian_elm_spinner_label_format_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_spinner_label_format_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_spinner_label_format_set, EFL_FUNC_CALL(fmt), const char *fmt); + +const char *_elm_spinner_label_format_get(const Eo *obj, Elm_Spinner_Data *pd); + + +static Eina_Value +__eolian_elm_spinner_label_format_get_reflect(const Eo *obj) +{ + const char *val = elm_obj_spinner_label_format_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_spinner_label_format_get, const char *, NULL); + +void _elm_spinner_special_value_add(Eo *obj, Elm_Spinner_Data *pd, double value, const char *label); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_spinner_special_value_add, EFL_FUNC_CALL(value, label), double value, const char *label); + +Efl_Object *_elm_spinner_efl_object_constructor(Eo *obj, Elm_Spinner_Data *pd); + + +Eina_Error _elm_spinner_efl_ui_widget_theme_apply(Eo *obj, Elm_Spinner_Data *pd); + + +void _elm_spinner_efl_ui_widget_on_access_update(Eo *obj, Elm_Spinner_Data *pd, Eina_Bool enable); + + +Eina_Bool _elm_spinner_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Spinner_Data *pd); + + +Eina_Bool _elm_spinner_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Spinner_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +void _elm_spinner_efl_ui_range_display_range_min_max_set(Eo *obj, Elm_Spinner_Data *pd, double min, double max); + + +void _elm_spinner_efl_ui_range_display_range_min_max_get(const Eo *obj, Elm_Spinner_Data *pd, double *min, double *max); + + +void _elm_spinner_efl_ui_range_interactive_range_step_set(Eo *obj, Elm_Spinner_Data *pd, double step); + + +double _elm_spinner_efl_ui_range_interactive_range_step_get(const Eo *obj, Elm_Spinner_Data *pd); + + +void _elm_spinner_efl_ui_range_display_range_value_set(Eo *obj, Elm_Spinner_Data *pd, double val); + + +double _elm_spinner_efl_ui_range_display_range_value_get(const Eo *obj, Elm_Spinner_Data *pd); + + +const char *_elm_spinner_efl_access_object_i18n_name_get(const Eo *obj, Elm_Spinner_Data *pd); + + +Eina_Bool _elm_spinner_efl_access_value_value_and_text_set(Eo *obj, Elm_Spinner_Data *pd, double value, const char *text); + + +void _elm_spinner_efl_access_value_value_and_text_get(const Eo *obj, Elm_Spinner_Data *pd, double *value, const char **text); + + +void _elm_spinner_efl_access_value_range_get(const Eo *obj, Elm_Spinner_Data *pd, double *lower_limit, double *upper_limit, const char **description); + + +double _elm_spinner_efl_access_value_increment_get(const Eo *obj, Elm_Spinner_Data *pd); + + +const Efl_Access_Action_Data *_elm_spinner_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Spinner_Data *pd); + + +static Eina_Bool +_elm_spinner_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_SPINNER_EXTRA_OPS +#define ELM_SPINNER_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_spinner_wrap_set, _elm_spinner_wrap_set), + EFL_OBJECT_OP_FUNC(elm_obj_spinner_wrap_get, _elm_spinner_wrap_get), + EFL_OBJECT_OP_FUNC(elm_obj_spinner_interval_set, _elm_spinner_interval_set), + EFL_OBJECT_OP_FUNC(elm_obj_spinner_interval_get, _elm_spinner_interval_get), + EFL_OBJECT_OP_FUNC(elm_obj_spinner_round_set, _elm_spinner_round_set), + EFL_OBJECT_OP_FUNC(elm_obj_spinner_round_get, _elm_spinner_round_get), + EFL_OBJECT_OP_FUNC(elm_obj_spinner_editable_set, _elm_spinner_editable_set), + EFL_OBJECT_OP_FUNC(elm_obj_spinner_editable_get, _elm_spinner_editable_get), + EFL_OBJECT_OP_FUNC(elm_obj_spinner_base_set, _elm_spinner_base_set), + EFL_OBJECT_OP_FUNC(elm_obj_spinner_base_get, _elm_spinner_base_get), + EFL_OBJECT_OP_FUNC(elm_obj_spinner_label_format_set, _elm_spinner_label_format_set), + EFL_OBJECT_OP_FUNC(elm_obj_spinner_label_format_get, _elm_spinner_label_format_get), + EFL_OBJECT_OP_FUNC(elm_obj_spinner_special_value_add, _elm_spinner_special_value_add), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_spinner_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_spinner_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_spinner_efl_ui_widget_on_access_update), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_on_focus_update, _elm_spinner_efl_ui_focus_object_on_focus_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_spinner_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(efl_ui_range_min_max_set, _elm_spinner_efl_ui_range_display_range_min_max_set), + EFL_OBJECT_OP_FUNC(efl_ui_range_min_max_get, _elm_spinner_efl_ui_range_display_range_min_max_get), + EFL_OBJECT_OP_FUNC(efl_ui_range_step_set, _elm_spinner_efl_ui_range_interactive_range_step_set), + EFL_OBJECT_OP_FUNC(efl_ui_range_step_get, _elm_spinner_efl_ui_range_interactive_range_step_get), + EFL_OBJECT_OP_FUNC(efl_ui_range_value_set, _elm_spinner_efl_ui_range_display_range_value_set), + EFL_OBJECT_OP_FUNC(efl_ui_range_value_get, _elm_spinner_efl_ui_range_display_range_value_get), + EFL_OBJECT_OP_FUNC(efl_access_object_i18n_name_get, _elm_spinner_efl_access_object_i18n_name_get), + EFL_OBJECT_OP_FUNC(efl_access_value_and_text_set, _elm_spinner_efl_access_value_value_and_text_set), + EFL_OBJECT_OP_FUNC(efl_access_value_and_text_get, _elm_spinner_efl_access_value_value_and_text_get), + EFL_OBJECT_OP_FUNC(efl_access_value_range_get, _elm_spinner_efl_access_value_range_get), + EFL_OBJECT_OP_FUNC(efl_access_value_increment_get, _elm_spinner_efl_access_value_increment_get), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_spinner_efl_access_widget_action_elm_actions_get), + ELM_SPINNER_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"wrap", __eolian_elm_spinner_wrap_set_reflect, __eolian_elm_spinner_wrap_get_reflect}, + {"interval", __eolian_elm_spinner_interval_set_reflect, __eolian_elm_spinner_interval_get_reflect}, + {"round", __eolian_elm_spinner_round_set_reflect, __eolian_elm_spinner_round_get_reflect}, + {"editable", __eolian_elm_spinner_editable_set_reflect, __eolian_elm_spinner_editable_get_reflect}, + {"base", __eolian_elm_spinner_base_set_reflect, __eolian_elm_spinner_base_get_reflect}, + {"label_format", __eolian_elm_spinner_label_format_set_reflect, __eolian_elm_spinner_label_format_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_spinner_class_desc = { + EO_VERSION, + "Elm.Spinner", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Spinner_Data), + _elm_spinner_class_initializer, + _elm_spinner_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_spinner_class_get, &_elm_spinner_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_RANGE_INTERACTIVE_INTERFACE, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_ACCESS_VALUE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_spinner_eo.legacy.c" diff --git a/src/lib/elementary/elm_spinner_eo.h b/src/lib/elementary/elm_spinner_eo.h new file mode 100644 index 0000000000..ff9205c262 --- /dev/null +++ b/src/lib/elementary/elm_spinner_eo.h @@ -0,0 +1,350 @@ +#ifndef _ELM_SPINNER_EO_H_ +#define _ELM_SPINNER_EO_H_ + +#ifndef _ELM_SPINNER_EO_CLASS_TYPE +#define _ELM_SPINNER_EO_CLASS_TYPE + +typedef Eo Elm_Spinner; + +#endif + +#ifndef _ELM_SPINNER_EO_TYPES +#define _ELM_SPINNER_EO_TYPES + + +#endif +/** Elementary spinner class + * + * @ingroup Elm_Spinner + */ +#define ELM_SPINNER_CLASS elm_spinner_class_get() + +EWAPI const Efl_Class *elm_spinner_class_get(void); + +/** + * @brief Control whether the spinner should wrap when it reaches its minimum + * or maximum value. + * + * Disabled by default. If disabled, when the user tries to increment the + * value, but displayed value plus step value is bigger than maximum value, the + * new value will be the maximum value. The same happens when the user tries to + * decrement it, but the value less step is less than minimum value. In this + * case, the new displayed value will be the minimum value. + * + * When wrap is enabled, when the user tries to increment the value, but + * displayed value plus step value is bigger than maximum value, the new value + * will be the minimum value. When the the user tries to decrement it, but the + * value less step is less than minimum value, the new displayed value will be + * the maximum value. + * + * E.g.: @c min = 10 @c max = 50 @c step = 20 @c displayed = 20 + * + * When the user decrement value (using left or bottom arrow), it will displays + * $50. + * + * @param[in] obj The object. + * @param[in] wrap @c true to enable wrap or @c false to disable it. + * + * @ingroup Elm_Spinner + */ +EOAPI void elm_obj_spinner_wrap_set(Eo *obj, Eina_Bool wrap); + +/** + * @brief Control whether the spinner should wrap when it reaches its minimum + * or maximum value. + * + * Disabled by default. If disabled, when the user tries to increment the + * value, but displayed value plus step value is bigger than maximum value, the + * new value will be the maximum value. The same happens when the user tries to + * decrement it, but the value less step is less than minimum value. In this + * case, the new displayed value will be the minimum value. + * + * When wrap is enabled, when the user tries to increment the value, but + * displayed value plus step value is bigger than maximum value, the new value + * will be the minimum value. When the the user tries to decrement it, but the + * value less step is less than minimum value, the new displayed value will be + * the maximum value. + * + * E.g.: @c min = 10 @c max = 50 @c step = 20 @c displayed = 20 + * + * When the user decrement value (using left or bottom arrow), it will displays + * $50. + * + * @param[in] obj The object. + * + * @return @c true to enable wrap or @c false to disable it. + * + * @ingroup Elm_Spinner + */ +EOAPI Eina_Bool elm_obj_spinner_wrap_get(const Eo *obj); + +/** + * @brief Control the interval on time updates for an user mouse button hold on + * spinner widgets' arrows. + * + * This interval value is decreased while the user holds the mouse pointer + * either incrementing or decrementing spinner's value. + * + * This helps the user to get to a given value distant from the current one + * easier/faster, as it will start to change quicker and quicker on mouse + * button holds. + * + * The calculation for the next change interval value, starting from the one + * set with this call, is the previous interval divided by $1.05, so it + * decreases a little bit. + * + * The default starting interval value for automatic changes is $0.85 seconds. + * + * @param[in] obj The object. + * @param[in] interval The (first) interval value in seconds. + * + * @ingroup Elm_Spinner + */ +EOAPI void elm_obj_spinner_interval_set(Eo *obj, double interval); + +/** + * @brief Control the interval on time updates for an user mouse button hold on + * spinner widgets' arrows. + * + * This interval value is decreased while the user holds the mouse pointer + * either incrementing or decrementing spinner's value. + * + * This helps the user to get to a given value distant from the current one + * easier/faster, as it will start to change quicker and quicker on mouse + * button holds. + * + * The calculation for the next change interval value, starting from the one + * set with this call, is the previous interval divided by $1.05, so it + * decreases a little bit. + * + * The default starting interval value for automatic changes is $0.85 seconds. + * + * @param[in] obj The object. + * + * @return The (first) interval value in seconds. + * + * @ingroup Elm_Spinner + */ +EOAPI double elm_obj_spinner_interval_get(const Eo *obj); + +/** + * @brief Control the round value for rounding + * + * Sets the rounding value used for value rounding in the spinner. + * + * @param[in] obj The object. + * @param[in] rnd The rounding value + * + * @ingroup Elm_Spinner + */ +EOAPI void elm_obj_spinner_round_set(Eo *obj, int rnd); + +/** + * @brief Control the round value for rounding + * + * Sets the rounding value used for value rounding in the spinner. + * + * @param[in] obj The object. + * + * @return The rounding value + * + * @ingroup Elm_Spinner + */ +EOAPI int elm_obj_spinner_round_get(const Eo *obj); + +/** + * @brief Control whether the spinner can be directly edited by the user or + * not. + * + * Spinner objects can have edition disabled, in which state they will be + * changed only by arrows. Useful for contexts where you don't want your users + * to interact with it writing the value. Specially when using special values, + * the user can see real value instead of special label on edition. + * + * It's enabled by default. + * + * @param[in] obj The object. + * @param[in] editable @c true to allow users to edit it or @c false to don't + * allow users to edit it directly. + * + * @ingroup Elm_Spinner + */ +EOAPI void elm_obj_spinner_editable_set(Eo *obj, Eina_Bool editable); + +/** + * @brief Control whether the spinner can be directly edited by the user or + * not. + * + * Spinner objects can have edition disabled, in which state they will be + * changed only by arrows. Useful for contexts where you don't want your users + * to interact with it writing the value. Specially when using special values, + * the user can see real value instead of special label on edition. + * + * It's enabled by default. + * + * @param[in] obj The object. + * + * @return @c true to allow users to edit it or @c false to don't allow users + * to edit it directly. + * + * @ingroup Elm_Spinner + */ +EOAPI Eina_Bool elm_obj_spinner_editable_get(const Eo *obj); + +/** + * @brief Control the base for rounding + * + * Rounding works as follows: + * + * rounded_val = base + (double)(((value - base) / round) * round) + * + * Where rounded_val, value and base are doubles, and round is an integer. + * + * This means that things will be rounded to increments (or decrements) of + * "round" starting from value @c base. The default base for rounding is 0. + * + * Example: round = 3, base = 2 Values: ..., -2, 0, 2, 5, 8, 11, 14, ... + * + * Example: round = 2, base = 5.5 Values: ..., -0.5, 1.5, 3.5, 5.5, 7.5, 9.5, + * 11.5, ... + * + * @param[in] obj The object. + * @param[in] base The base value + * + * @ingroup Elm_Spinner + */ +EOAPI void elm_obj_spinner_base_set(Eo *obj, double base); + +/** + * @brief Control the base for rounding + * + * Rounding works as follows: + * + * rounded_val = base + (double)(((value - base) / round) * round) + * + * Where rounded_val, value and base are doubles, and round is an integer. + * + * This means that things will be rounded to increments (or decrements) of + * "round" starting from value @c base. The default base for rounding is 0. + * + * Example: round = 3, base = 2 Values: ..., -2, 0, 2, 5, 8, 11, 14, ... + * + * Example: round = 2, base = 5.5 Values: ..., -0.5, 1.5, 3.5, 5.5, 7.5, 9.5, + * 11.5, ... + * + * @param[in] obj The object. + * + * @return The base value + * + * @ingroup Elm_Spinner + */ +EOAPI double elm_obj_spinner_base_get(const Eo *obj); + +/** + * @brief Control the format string of the displayed label. + * + * If @c NULL, this sets the format to "%.0f". If not it sets the format string + * for the label text. The label text is provided a floating point value, so + * the label text can display up to 1 floating point value. Note that this is + * optional. + * + * Use a format string such as "%1.2f meters" for example, and it will display + * values like: "3.14 meters" for a value equal to 3.14159. + * + * Default is "%0.f". + * + * @param[in] obj The object. + * @param[in] fmt The format string for the label display. + * + * @ingroup Elm_Spinner + */ +EOAPI void elm_obj_spinner_label_format_set(Eo *obj, const char *fmt); + +/** + * @brief Control the format string of the displayed label. + * + * If @c NULL, this sets the format to "%.0f". If not it sets the format string + * for the label text. The label text is provided a floating point value, so + * the label text can display up to 1 floating point value. Note that this is + * optional. + * + * Use a format string such as "%1.2f meters" for example, and it will display + * values like: "3.14 meters" for a value equal to 3.14159. + * + * Default is "%0.f". + * + * @param[in] obj The object. + * + * @return The format string for the label display. + * + * @ingroup Elm_Spinner + */ +EOAPI const char *elm_obj_spinner_label_format_get(const Eo *obj); + +/** + * @brief 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 @c value, it will be replaced + * by the new label. + * + * @param[in] obj The object. + * @param[in] value The value to be replaced. + * @param[in] label The label to be used. + * + * @ingroup Elm_Spinner + */ +EOAPI void elm_obj_spinner_special_value_add(Eo *obj, double value, const char *label); + +EWAPI extern const Efl_Event_Description _ELM_SPINNER_EVENT_CHANGED; + +/** Called when spinner changed + * + * @ingroup Elm_Spinner + */ +#define ELM_SPINNER_EVENT_CHANGED (&(_ELM_SPINNER_EVENT_CHANGED)) + +EWAPI extern const Efl_Event_Description _ELM_SPINNER_EVENT_DELAY_CHANGED; + +/** Called when spinner delay changed + * + * @ingroup Elm_Spinner + */ +#define ELM_SPINNER_EVENT_DELAY_CHANGED (&(_ELM_SPINNER_EVENT_DELAY_CHANGED)) + +EWAPI extern const Efl_Event_Description _ELM_SPINNER_EVENT_SPINNER_DRAG_START; + +/** Called when spinner drag started + * + * @ingroup Elm_Spinner + */ +#define ELM_SPINNER_EVENT_SPINNER_DRAG_START (&(_ELM_SPINNER_EVENT_SPINNER_DRAG_START)) + +EWAPI extern const Efl_Event_Description _ELM_SPINNER_EVENT_SPINNER_DRAG_STOP; + +/** Called when spinner drag stopped + * + * @ingroup Elm_Spinner + */ +#define ELM_SPINNER_EVENT_SPINNER_DRAG_STOP (&(_ELM_SPINNER_EVENT_SPINNER_DRAG_STOP)) + +EWAPI extern const Efl_Event_Description _ELM_SPINNER_EVENT_MIN_REACHED; + +/** Called when spinner value reached min + * + * @ingroup Elm_Spinner + */ +#define ELM_SPINNER_EVENT_MIN_REACHED (&(_ELM_SPINNER_EVENT_MIN_REACHED)) + +EWAPI extern const Efl_Event_Description _ELM_SPINNER_EVENT_MAX_REACHED; + +/** Called when spinner value reached max + * + * @ingroup Elm_Spinner + */ +#define ELM_SPINNER_EVENT_MAX_REACHED (&(_ELM_SPINNER_EVENT_MAX_REACHED)) + +#endif diff --git a/src/lib/elementary/elm_spinner_eo.legacy.c b/src/lib/elementary/elm_spinner_eo.legacy.c new file mode 100644 index 0000000000..ed35ba1df0 --- /dev/null +++ b/src/lib/elementary/elm_spinner_eo.legacy.c @@ -0,0 +1,78 @@ + +EAPI void +elm_spinner_wrap_set(Elm_Spinner *obj, Eina_Bool wrap) +{ + elm_obj_spinner_wrap_set(obj, wrap); +} + +EAPI Eina_Bool +elm_spinner_wrap_get(const Elm_Spinner *obj) +{ + return elm_obj_spinner_wrap_get(obj); +} + +EAPI void +elm_spinner_interval_set(Elm_Spinner *obj, double interval) +{ + elm_obj_spinner_interval_set(obj, interval); +} + +EAPI double +elm_spinner_interval_get(const Elm_Spinner *obj) +{ + return elm_obj_spinner_interval_get(obj); +} + +EAPI void +elm_spinner_round_set(Elm_Spinner *obj, int rnd) +{ + elm_obj_spinner_round_set(obj, rnd); +} + +EAPI int +elm_spinner_round_get(const Elm_Spinner *obj) +{ + return elm_obj_spinner_round_get(obj); +} + +EAPI void +elm_spinner_editable_set(Elm_Spinner *obj, Eina_Bool editable) +{ + elm_obj_spinner_editable_set(obj, editable); +} + +EAPI Eina_Bool +elm_spinner_editable_get(const Elm_Spinner *obj) +{ + return elm_obj_spinner_editable_get(obj); +} + +EAPI void +elm_spinner_base_set(Elm_Spinner *obj, double base) +{ + elm_obj_spinner_base_set(obj, base); +} + +EAPI double +elm_spinner_base_get(const Elm_Spinner *obj) +{ + return elm_obj_spinner_base_get(obj); +} + +EAPI void +elm_spinner_label_format_set(Elm_Spinner *obj, const char *fmt) +{ + elm_obj_spinner_label_format_set(obj, fmt); +} + +EAPI const char * +elm_spinner_label_format_get(const Elm_Spinner *obj) +{ + return elm_obj_spinner_label_format_get(obj); +} + +EAPI void +elm_spinner_special_value_add(Elm_Spinner *obj, double value, const char *label) +{ + elm_obj_spinner_special_value_add(obj, value, label); +} diff --git a/src/lib/elementary/elm_spinner_eo.legacy.h b/src/lib/elementary/elm_spinner_eo.legacy.h new file mode 100644 index 0000000000..798ec39d37 --- /dev/null +++ b/src/lib/elementary/elm_spinner_eo.legacy.h @@ -0,0 +1,295 @@ +#ifndef _ELM_SPINNER_EO_LEGACY_H_ +#define _ELM_SPINNER_EO_LEGACY_H_ + +#ifndef _ELM_SPINNER_EO_CLASS_TYPE +#define _ELM_SPINNER_EO_CLASS_TYPE + +typedef Eo Elm_Spinner; + +#endif + +#ifndef _ELM_SPINNER_EO_TYPES +#define _ELM_SPINNER_EO_TYPES + + +#endif + +/** + * @brief Control whether the spinner should wrap when it reaches its minimum + * or maximum value. + * + * Disabled by default. If disabled, when the user tries to increment the + * value, but displayed value plus step value is bigger than maximum value, the + * new value will be the maximum value. The same happens when the user tries to + * decrement it, but the value less step is less than minimum value. In this + * case, the new displayed value will be the minimum value. + * + * When wrap is enabled, when the user tries to increment the value, but + * displayed value plus step value is bigger than maximum value, the new value + * will be the minimum value. When the the user tries to decrement it, but the + * value less step is less than minimum value, the new displayed value will be + * the maximum value. + * + * E.g.: @c min = 10 @c max = 50 @c step = 20 @c displayed = 20 + * + * When the user decrement value (using left or bottom arrow), it will displays + * $50. + * + * @param[in] obj The object. + * @param[in] wrap @c true to enable wrap or @c false to disable it. + * + * @ingroup Elm_Spinner_Group + */ +EAPI void elm_spinner_wrap_set(Elm_Spinner *obj, Eina_Bool wrap); + +/** + * @brief Control whether the spinner should wrap when it reaches its minimum + * or maximum value. + * + * Disabled by default. If disabled, when the user tries to increment the + * value, but displayed value plus step value is bigger than maximum value, the + * new value will be the maximum value. The same happens when the user tries to + * decrement it, but the value less step is less than minimum value. In this + * case, the new displayed value will be the minimum value. + * + * When wrap is enabled, when the user tries to increment the value, but + * displayed value plus step value is bigger than maximum value, the new value + * will be the minimum value. When the the user tries to decrement it, but the + * value less step is less than minimum value, the new displayed value will be + * the maximum value. + * + * E.g.: @c min = 10 @c max = 50 @c step = 20 @c displayed = 20 + * + * When the user decrement value (using left or bottom arrow), it will displays + * $50. + * + * @param[in] obj The object. + * + * @return @c true to enable wrap or @c false to disable it. + * + * @ingroup Elm_Spinner_Group + */ +EAPI Eina_Bool elm_spinner_wrap_get(const Elm_Spinner *obj); + +/** + * @brief Control the interval on time updates for an user mouse button hold on + * spinner widgets' arrows. + * + * This interval value is decreased while the user holds the mouse pointer + * either incrementing or decrementing spinner's value. + * + * This helps the user to get to a given value distant from the current one + * easier/faster, as it will start to change quicker and quicker on mouse + * button holds. + * + * The calculation for the next change interval value, starting from the one + * set with this call, is the previous interval divided by $1.05, so it + * decreases a little bit. + * + * The default starting interval value for automatic changes is $0.85 seconds. + * + * @param[in] obj The object. + * @param[in] interval The (first) interval value in seconds. + * + * @ingroup Elm_Spinner_Group + */ +EAPI void elm_spinner_interval_set(Elm_Spinner *obj, double interval); + +/** + * @brief Control the interval on time updates for an user mouse button hold on + * spinner widgets' arrows. + * + * This interval value is decreased while the user holds the mouse pointer + * either incrementing or decrementing spinner's value. + * + * This helps the user to get to a given value distant from the current one + * easier/faster, as it will start to change quicker and quicker on mouse + * button holds. + * + * The calculation for the next change interval value, starting from the one + * set with this call, is the previous interval divided by $1.05, so it + * decreases a little bit. + * + * The default starting interval value for automatic changes is $0.85 seconds. + * + * @param[in] obj The object. + * + * @return The (first) interval value in seconds. + * + * @ingroup Elm_Spinner_Group + */ +EAPI double elm_spinner_interval_get(const Elm_Spinner *obj); + +/** + * @brief Control the round value for rounding + * + * Sets the rounding value used for value rounding in the spinner. + * + * @param[in] obj The object. + * @param[in] rnd The rounding value + * + * @ingroup Elm_Spinner_Group + */ +EAPI void elm_spinner_round_set(Elm_Spinner *obj, int rnd); + +/** + * @brief Control the round value for rounding + * + * Sets the rounding value used for value rounding in the spinner. + * + * @param[in] obj The object. + * + * @return The rounding value + * + * @ingroup Elm_Spinner_Group + */ +EAPI int elm_spinner_round_get(const Elm_Spinner *obj); + +/** + * @brief Control whether the spinner can be directly edited by the user or + * not. + * + * Spinner objects can have edition disabled, in which state they will be + * changed only by arrows. Useful for contexts where you don't want your users + * to interact with it writing the value. Specially when using special values, + * the user can see real value instead of special label on edition. + * + * It's enabled by default. + * + * @param[in] obj The object. + * @param[in] editable @c true to allow users to edit it or @c false to don't + * allow users to edit it directly. + * + * @ingroup Elm_Spinner_Group + */ +EAPI void elm_spinner_editable_set(Elm_Spinner *obj, Eina_Bool editable); + +/** + * @brief Control whether the spinner can be directly edited by the user or + * not. + * + * Spinner objects can have edition disabled, in which state they will be + * changed only by arrows. Useful for contexts where you don't want your users + * to interact with it writing the value. Specially when using special values, + * the user can see real value instead of special label on edition. + * + * It's enabled by default. + * + * @param[in] obj The object. + * + * @return @c true to allow users to edit it or @c false to don't allow users + * to edit it directly. + * + * @ingroup Elm_Spinner_Group + */ +EAPI Eina_Bool elm_spinner_editable_get(const Elm_Spinner *obj); + +/** + * @brief Control the base for rounding + * + * Rounding works as follows: + * + * rounded_val = base + (double)(((value - base) / round) * round) + * + * Where rounded_val, value and base are doubles, and round is an integer. + * + * This means that things will be rounded to increments (or decrements) of + * "round" starting from value @c base. The default base for rounding is 0. + * + * Example: round = 3, base = 2 Values: ..., -2, 0, 2, 5, 8, 11, 14, ... + * + * Example: round = 2, base = 5.5 Values: ..., -0.5, 1.5, 3.5, 5.5, 7.5, 9.5, + * 11.5, ... + * + * @param[in] obj The object. + * @param[in] base The base value + * + * @ingroup Elm_Spinner_Group + */ +EAPI void elm_spinner_base_set(Elm_Spinner *obj, double base); + +/** + * @brief Control the base for rounding + * + * Rounding works as follows: + * + * rounded_val = base + (double)(((value - base) / round) * round) + * + * Where rounded_val, value and base are doubles, and round is an integer. + * + * This means that things will be rounded to increments (or decrements) of + * "round" starting from value @c base. The default base for rounding is 0. + * + * Example: round = 3, base = 2 Values: ..., -2, 0, 2, 5, 8, 11, 14, ... + * + * Example: round = 2, base = 5.5 Values: ..., -0.5, 1.5, 3.5, 5.5, 7.5, 9.5, + * 11.5, ... + * + * @param[in] obj The object. + * + * @return The base value + * + * @ingroup Elm_Spinner_Group + */ +EAPI double elm_spinner_base_get(const Elm_Spinner *obj); + +/** + * @brief Control the format string of the displayed label. + * + * If @c NULL, this sets the format to "%.0f". If not it sets the format string + * for the label text. The label text is provided a floating point value, so + * the label text can display up to 1 floating point value. Note that this is + * optional. + * + * Use a format string such as "%1.2f meters" for example, and it will display + * values like: "3.14 meters" for a value equal to 3.14159. + * + * Default is "%0.f". + * + * @param[in] obj The object. + * @param[in] fmt The format string for the label display. + * + * @ingroup Elm_Spinner_Group + */ +EAPI void elm_spinner_label_format_set(Elm_Spinner *obj, const char *fmt); + +/** + * @brief Control the format string of the displayed label. + * + * If @c NULL, this sets the format to "%.0f". If not it sets the format string + * for the label text. The label text is provided a floating point value, so + * the label text can display up to 1 floating point value. Note that this is + * optional. + * + * Use a format string such as "%1.2f meters" for example, and it will display + * values like: "3.14 meters" for a value equal to 3.14159. + * + * Default is "%0.f". + * + * @param[in] obj The object. + * + * @return The format string for the label display. + * + * @ingroup Elm_Spinner_Group + */ +EAPI const char *elm_spinner_label_format_get(const Elm_Spinner *obj); + +/** + * @brief 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 @c value, it will be replaced + * by the new label. + * + * @param[in] obj The object. + * @param[in] value The value to be replaced. + * @param[in] label The label to be used. + * + * @ingroup Elm_Spinner_Group + */ +EAPI void elm_spinner_special_value_add(Elm_Spinner *obj, double value, const char *label); + +#endif diff --git a/src/lib/elementary/elm_spinner_legacy.h b/src/lib/elementary/elm_spinner_legacy.h index 8c4812b013..1b4e241c0c 100644 --- a/src/lib/elementary/elm_spinner_legacy.h +++ b/src/lib/elementary/elm_spinner_legacy.h @@ -148,4 +148,4 @@ EAPI void elm_spinner_value_set(Evas_Object *obj, double val); */ EAPI double elm_spinner_value_get(const Evas_Object *obj); -#include "elm_spinner.eo.legacy.h" +#include "elm_spinner_eo.legacy.h" diff --git a/src/lib/elementary/elm_store.c b/src/lib/elementary/elm_store.c index 59ab8aa03d..fa57d43534 100644 --- a/src/lib/elementary/elm_store.c +++ b/src/lib/elementary/elm_store.c @@ -6,7 +6,7 @@ #include #include "elm_priv.h" -#include "elm_genlist.eo.h" +#include "elm_genlist_eo.h" typedef struct _Elm_Store_Filesystem Elm_Store_Filesystem; typedef struct _Elm_Store_Item_Filesystem Elm_Store_Item_Filesystem; diff --git a/src/lib/elementary/elm_sys_notify.c b/src/lib/elementary/elm_sys_notify.c index a993a8cc3a..0b0e7f12fe 100644 --- a/src/lib/elementary/elm_sys_notify.c +++ b/src/lib/elementary/elm_sys_notify.c @@ -6,10 +6,10 @@ #include "elm_priv.h" -#include "elm_sys_notify_interface.eo.h" -#include "elm_sys_notify.eo.h" -#include "elm_sys_notify_dbus.eo.h" -#include "elm_sys_notify_dbus.eo.legacy.h" +#include "elm_sys_notify_interface_eo.h" +#include "elm_sys_notify_eo.h" +#include "elm_sys_notify_dbus_eo.h" +#include "elm_sys_notify_dbus_eo.legacy.h" #define MY_CLASS ELM_SYS_NOTIFY_CLASS @@ -199,8 +199,7 @@ _elm_sys_notify_servers_get(const Eo *obj EINA_UNUSED, } EOLIAN static Elm_Sys_Notify * -_elm_sys_notify_singleton_get(Eo *obj EINA_UNUSED, - void *sd EINA_UNUSED) +_elm_sys_notify_singleton_get(void) { if (!_singleton) _singleton = efl_add(MY_CLASS, efl_main_loop_get()); @@ -224,7 +223,7 @@ _elm_sys_notify_class_constructor(Efl_Class *klass EINA_UNUSED) void _elm_unneed_sys_notify(void) { - Elm_Sys_Notify *manager = elm_sys_notify_singleton_get(); + Elm_Sys_Notify *manager = elm_obj_sys_notify_singleton_get(); if (manager) { elm_obj_sys_notify_servers_set(manager, ELM_SYS_NOTIFY_SERVER_NONE); @@ -242,7 +241,7 @@ elm_need_sys_notify(void) /* In theory, there can be N notification managers, but * in the implementation there will be only one: the * singleton which is initialized here. */ - manager = elm_sys_notify_singleton_get(); + manager = elm_obj_sys_notify_singleton_get(); if (EINA_UNLIKELY(!manager)) { CRI("Failed to get notification manager"); @@ -289,5 +288,5 @@ elm_sys_notify_close(unsigned int id) elm_obj_sys_notify_interface_close(_singleton, id); } -#include "elm_sys_notify.eo.c" +#include "elm_sys_notify_eo.c" diff --git a/src/lib/elementary/elm_sys_notify.eo b/src/lib/elementary/elm_sys_notify.eo deleted file mode 100644 index cf557a0ab9..0000000000 --- a/src/lib/elementary/elm_sys_notify.eo +++ /dev/null @@ -1,96 +0,0 @@ -enum Elm.Sys_Notify.Server -{ - [[System notification server types]] - none = 0, [[No notificationserver (disables notifications)]] - dbus = 1 << 0 [[Use DBus as a notification server]] -} - -enum Elm.Sys_Notify.Closed_Reason -{ - [[The reason the notification was closed - - @since 1.8 - ]] - - legacy: elm_sys_notify_closed; - - expired, [[The notification expired]] - dismissed, [[The notification was dismissed by the user]] - requested, [[The notification was closed by a call to CloseNotification method]] - undefined [[Undefined/reserved reasons]] -} - -struct Elm.Sys_Notify.Notification_Closed -{ - [[Data on event when notification closed is emitted - - @since 1.8 - ]] - id: uint; [[ID of the notification]] - reason: Elm.Sys_Notify.Closed_Reason; [[The reason the notification was closed]] -} - -struct Elm.Sys_Notify.Action_Invoked -{ - [[Data on event when the action invoked is emitted - - @since 1.8 - ]] - id: uint; [[ID of the notification]] - action_key: ptr(char); [[The key of the action invoked. These match the - keys sent over in the list of actions]] -} - -class Elm.Sys_Notify extends Efl.Object implements Elm.Sys_Notify_Interface -{ - [[Elementary system notification class]] - legacy_prefix: elm_sys_notify; - eo_prefix: elm_obj_sys_notify; - - methods { - @property servers { - get { - [[Get the notification servers that have been registered - - @since 1.17 - ]] - } - set { - [[Set the notifications server to be used. - - Note: This is an advanced function that should be used only to - fullfill very specific purposes. Use elm_need_sys_notify() - which activates the default available notification - servers. - - @since 1.17 - ]] - return: bool; [[$true on success, $false on failure]] - } - values { - servers: Elm.Sys_Notify.Server; [[Binary mask of servers to enable. - If a server is not present in the binary mask but was previously - registered, it will be unregistered.]] - } - } - - singleton_get @class { - [[Returns the singleton instance of the notification manager - Elm.Sys_Notify. It is initialized upon the first call of this - function - - @since 1.17 - ]] - return: Elm.Sys_Notify; [[The unique notification manager]] - } - } - - implements { - class.constructor; - Efl.Object.constructor; - Efl.Object.destructor; - Elm.Sys_Notify_Interface.send; - Elm.Sys_Notify_Interface.simple_send; - Elm.Sys_Notify_Interface.close; - } -} diff --git a/src/lib/elementary/elm_sys_notify.h b/src/lib/elementary/elm_sys_notify.h index 429ae92f9f..aaf55f8593 100644 --- a/src/lib/elementary/elm_sys_notify.h +++ b/src/lib/elementary/elm_sys_notify.h @@ -4,8 +4,8 @@ typedef void (*Elm_Sys_Notify_Send_Cb)(void *data, unsigned int id); #ifndef EFL_NOLEGACY_API_SUPPORT -#include "elm_sys_notify_interface.eo.legacy.h" -#include "elm_sys_notify.eo.legacy.h" +#include "elm_sys_notify_interface_eo.legacy.h" +#include "elm_sys_notify_eo.legacy.h" #endif /** diff --git a/src/lib/elementary/elm_sys_notify_dbus.c b/src/lib/elementary/elm_sys_notify_dbus.c index e2784cd0c7..b1be50d532 100644 --- a/src/lib/elementary/elm_sys_notify_dbus.c +++ b/src/lib/elementary/elm_sys_notify_dbus.c @@ -6,10 +6,10 @@ #include "elm_priv.h" -#include "elm_sys_notify_interface.eo.h" -#include "elm_sys_notify.eo.h" -#include "elm_sys_notify_dbus.eo.h" -#include "elm_sys_notify_dbus.eo.legacy.h" +#include "elm_sys_notify_interface_eo.h" +#include "elm_sys_notify_eo.h" +#include "elm_sys_notify_dbus_eo.h" +#include "elm_sys_notify_dbus_eo.legacy.h" #define MY_CLASS ELM_SYS_NOTIFY_DBUS_CLASS @@ -396,5 +396,5 @@ _elm_sys_notify_dbus_efl_object_destructor(Eo *obj, } -#include "elm_sys_notify_dbus.eo.c" +#include "elm_sys_notify_dbus_eo.c" diff --git a/src/lib/elementary/elm_sys_notify_dbus.eo b/src/lib/elementary/elm_sys_notify_dbus.eo deleted file mode 100644 index eea26674b0..0000000000 --- a/src/lib/elementary/elm_sys_notify_dbus.eo +++ /dev/null @@ -1,15 +0,0 @@ -class Elm.Sys_Notify.Dbus extends Efl.Object implements Elm.Sys_Notify_Interface -{ - [[Elementary system notification DBus class]] - legacy_prefix: elm_sys_notify_dbus; - eo_prefix: elm_obj_sys_notify_dbus; - data: null; - - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Elm.Sys_Notify_Interface.send; - Elm.Sys_Notify_Interface.simple_send; - Elm.Sys_Notify_Interface.close; - } -} diff --git a/src/lib/elementary/elm_sys_notify_dbus_eo.c b/src/lib/elementary/elm_sys_notify_dbus_eo.c new file mode 100644 index 0000000000..59259da0c5 --- /dev/null +++ b/src/lib/elementary/elm_sys_notify_dbus_eo.c @@ -0,0 +1,51 @@ + +Efl_Object *_elm_sys_notify_dbus_efl_object_constructor(Eo *obj, void *pd); + + +void _elm_sys_notify_dbus_efl_object_destructor(Eo *obj, void *pd); + + +void _elm_sys_notify_dbus_elm_sys_notify_interface_send(const Eo *obj, void *pd, unsigned int replaces_id, const char *icon, const char *summary, const char *body, Elm_Sys_Notify_Urgency urgency, int timeout, Elm_Sys_Notify_Send_Cb cb, const void *cb_data); + + +void _elm_sys_notify_dbus_elm_sys_notify_interface_simple_send(const Eo *obj, void *pd, const char *icon, const char *summary, const char *body); + + +void _elm_sys_notify_dbus_elm_sys_notify_interface_close(const Eo *obj, void *pd, unsigned int id); + + +static Eina_Bool +_elm_sys_notify_dbus_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_SYS_NOTIFY_DBUS_EXTRA_OPS +#define ELM_SYS_NOTIFY_DBUS_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_sys_notify_dbus_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_sys_notify_dbus_efl_object_destructor), + EFL_OBJECT_OP_FUNC(elm_obj_sys_notify_interface_send, _elm_sys_notify_dbus_elm_sys_notify_interface_send), + EFL_OBJECT_OP_FUNC(elm_obj_sys_notify_interface_simple_send, _elm_sys_notify_dbus_elm_sys_notify_interface_simple_send), + EFL_OBJECT_OP_FUNC(elm_obj_sys_notify_interface_close, _elm_sys_notify_dbus_elm_sys_notify_interface_close), + ELM_SYS_NOTIFY_DBUS_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_sys_notify_dbus_class_desc = { + EO_VERSION, + "Elm.Sys_Notify.Dbus", + EFL_CLASS_TYPE_REGULAR, + 0, + _elm_sys_notify_dbus_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_sys_notify_dbus_class_get, &_elm_sys_notify_dbus_class_desc, EFL_OBJECT_CLASS, ELM_SYS_NOTIFY_INTERFACE_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_sys_notify_dbus_eo.h b/src/lib/elementary/elm_sys_notify_dbus_eo.h new file mode 100644 index 0000000000..c5976e4450 --- /dev/null +++ b/src/lib/elementary/elm_sys_notify_dbus_eo.h @@ -0,0 +1,24 @@ +#ifndef _ELM_SYS_NOTIFY_DBUS_EO_H_ +#define _ELM_SYS_NOTIFY_DBUS_EO_H_ + +#ifndef _ELM_SYS_NOTIFY_DBUS_EO_CLASS_TYPE +#define _ELM_SYS_NOTIFY_DBUS_EO_CLASS_TYPE + +typedef Eo Elm_Sys_Notify_Dbus; + +#endif + +#ifndef _ELM_SYS_NOTIFY_DBUS_EO_TYPES +#define _ELM_SYS_NOTIFY_DBUS_EO_TYPES + + +#endif +/** Elementary system notification DBus class + * + * @ingroup Elm_Sys_Notify_Dbus + */ +#define ELM_SYS_NOTIFY_DBUS_CLASS elm_sys_notify_dbus_class_get() + +EWAPI const Efl_Class *elm_sys_notify_dbus_class_get(void); + +#endif diff --git a/src/lib/elementary/elm_sys_notify_dbus_eo.legacy.h b/src/lib/elementary/elm_sys_notify_dbus_eo.legacy.h new file mode 100644 index 0000000000..8d42845366 --- /dev/null +++ b/src/lib/elementary/elm_sys_notify_dbus_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_SYS_NOTIFY_DBUS_EO_LEGACY_H_ +#define _ELM_SYS_NOTIFY_DBUS_EO_LEGACY_H_ + +#ifndef _ELM_SYS_NOTIFY_DBUS_EO_CLASS_TYPE +#define _ELM_SYS_NOTIFY_DBUS_EO_CLASS_TYPE + +typedef Eo Elm_Sys_Notify_Dbus; + +#endif + +#ifndef _ELM_SYS_NOTIFY_DBUS_EO_TYPES +#define _ELM_SYS_NOTIFY_DBUS_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_sys_notify_eo.c b/src/lib/elementary/elm_sys_notify_eo.c new file mode 100644 index 0000000000..7b57eca751 --- /dev/null +++ b/src/lib/elementary/elm_sys_notify_eo.c @@ -0,0 +1,76 @@ + +Eina_Bool _elm_sys_notify_servers_set(Eo *obj, Elm_Sys_Notify_Data *pd, Elm_Sys_Notify_Server servers); + +EOAPI EFL_FUNC_BODYV(elm_obj_sys_notify_servers_set, Eina_Bool, 0, EFL_FUNC_CALL(servers), Elm_Sys_Notify_Server servers); + +Elm_Sys_Notify_Server _elm_sys_notify_servers_get(const Eo *obj, Elm_Sys_Notify_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_sys_notify_servers_get, Elm_Sys_Notify_Server, 0); + +Elm_Sys_Notify *_elm_sys_notify_singleton_get(void); + +EOAPI Elm_Sys_Notify * elm_obj_sys_notify_singleton_get(void) +{ + elm_sys_notify_class_get(); + return _elm_sys_notify_singleton_get(); +} +EOAPI Elm_Sys_Notify * elm_sys_notify_singleton_get(void) +{ + elm_sys_notify_class_get(); + return _elm_sys_notify_singleton_get(); +} + +Efl_Object *_elm_sys_notify_efl_object_constructor(Eo *obj, Elm_Sys_Notify_Data *pd); + + +void _elm_sys_notify_efl_object_destructor(Eo *obj, Elm_Sys_Notify_Data *pd); + + +void _elm_sys_notify_elm_sys_notify_interface_send(const Eo *obj, Elm_Sys_Notify_Data *pd, unsigned int replaces_id, const char *icon, const char *summary, const char *body, Elm_Sys_Notify_Urgency urgency, int timeout, Elm_Sys_Notify_Send_Cb cb, const void *cb_data); + + +void _elm_sys_notify_elm_sys_notify_interface_simple_send(const Eo *obj, Elm_Sys_Notify_Data *pd, const char *icon, const char *summary, const char *body); + + +void _elm_sys_notify_elm_sys_notify_interface_close(const Eo *obj, Elm_Sys_Notify_Data *pd, unsigned int id); + + +static Eina_Bool +_elm_sys_notify_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_SYS_NOTIFY_EXTRA_OPS +#define ELM_SYS_NOTIFY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_sys_notify_servers_set, _elm_sys_notify_servers_set), + EFL_OBJECT_OP_FUNC(elm_obj_sys_notify_servers_get, _elm_sys_notify_servers_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_sys_notify_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_sys_notify_efl_object_destructor), + EFL_OBJECT_OP_FUNC(elm_obj_sys_notify_interface_send, _elm_sys_notify_elm_sys_notify_interface_send), + EFL_OBJECT_OP_FUNC(elm_obj_sys_notify_interface_simple_send, _elm_sys_notify_elm_sys_notify_interface_simple_send), + EFL_OBJECT_OP_FUNC(elm_obj_sys_notify_interface_close, _elm_sys_notify_elm_sys_notify_interface_close), + ELM_SYS_NOTIFY_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_sys_notify_class_desc = { + EO_VERSION, + "Elm.Sys_Notify", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Sys_Notify_Data), + _elm_sys_notify_class_initializer, + _elm_sys_notify_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_sys_notify_class_get, &_elm_sys_notify_class_desc, EFL_OBJECT_CLASS, ELM_SYS_NOTIFY_INTERFACE_INTERFACE, NULL); + +#include "elm_sys_notify_eo.legacy.c" diff --git a/src/lib/elementary/elm_sys_notify_eo.h b/src/lib/elementary/elm_sys_notify_eo.h new file mode 100644 index 0000000000..0f1f194f07 --- /dev/null +++ b/src/lib/elementary/elm_sys_notify_eo.h @@ -0,0 +1,124 @@ +#ifndef _ELM_SYS_NOTIFY_EO_H_ +#define _ELM_SYS_NOTIFY_EO_H_ + +#ifndef _ELM_SYS_NOTIFY_EO_CLASS_TYPE +#define _ELM_SYS_NOTIFY_EO_CLASS_TYPE + +typedef Eo Elm_Sys_Notify; + +#endif + +#ifndef _ELM_SYS_NOTIFY_EO_TYPES +#define _ELM_SYS_NOTIFY_EO_TYPES + +/** System notification server types + * + * @ingroup Elm_Sys_Notify + */ +typedef enum +{ + ELM_SYS_NOTIFY_SERVER_NONE = 0, /**< No notificationserver (disables + * notifications) */ + ELM_SYS_NOTIFY_SERVER_DBUS = 1 /* 1 >> 0 */ /**< Use DBus as a notification + * server */ +} Elm_Sys_Notify_Server; + +/** The reason the notification was closed + * + * @since 1.8 + * + * @ingroup Elm_Sys_Notify + */ +typedef enum +{ + ELM_SYS_NOTIFY_CLOSED_EXPIRED = 0, /**< The notification expired */ + ELM_SYS_NOTIFY_CLOSED_DISMISSED, /**< The notification was dismissed by the + * user */ + ELM_SYS_NOTIFY_CLOSED_REQUESTED, /**< The notification was closed by a call to + * CloseNotification method */ + ELM_SYS_NOTIFY_CLOSED_UNDEFINED /**< Undefined/reserved reasons */ +} Elm_Sys_Notify_Closed_Reason; + +/** Data on event when notification closed is emitted + * + * @since 1.8 + * + * @ingroup Elm_Sys_Notify + */ +typedef struct _Elm_Sys_Notify_Notification_Closed +{ + unsigned int id; /**< ID of the notification */ + Elm_Sys_Notify_Closed_Reason reason; /**< The reason the notification was + * closed */ +} Elm_Sys_Notify_Notification_Closed; + +/** Data on event when the action invoked is emitted + * + * @since 1.8 + * + * @ingroup Elm_Sys_Notify + */ +typedef struct _Elm_Sys_Notify_Action_Invoked +{ + unsigned int id; /**< ID of the notification */ + char *action_key; /**< The key of the action invoked. These match the keys + * sent over in the list of actions */ +} Elm_Sys_Notify_Action_Invoked; + + +#endif +/** Elementary system notification class + * + * @ingroup Elm_Sys_Notify + */ +#define ELM_SYS_NOTIFY_CLASS elm_sys_notify_class_get() + +EWAPI const Efl_Class *elm_sys_notify_class_get(void); + +/** + * @brief Set the notifications server to be used. + * + * @note This is an advanced function that should be used only to fulfill very + * specific purposes. Use elm_need_sys_notify() which activates the default + * available notification servers. + * + * @param[in] obj The object. + * @param[in] servers Binary mask of servers to enable. If a server is not + * present in the binary mask but was previously registered, it will be + * unregistered. + * + * @return @c true on success, @c false on failure + * + * @since 1.17 + * + * @ingroup Elm_Sys_Notify + */ +EOAPI Eina_Bool elm_obj_sys_notify_servers_set(Eo *obj, Elm_Sys_Notify_Server servers); + +/** + * @brief Get the notification servers that have been registered + * + * @param[in] obj The object. + * + * @return Binary mask of servers to enable. If a server is not present in the + * binary mask but was previously registered, it will be unregistered. + * + * @since 1.17 + * + * @ingroup Elm_Sys_Notify + */ +EOAPI Elm_Sys_Notify_Server elm_obj_sys_notify_servers_get(const Eo *obj); + +/** + * @brief Returns the singleton instance of the notification manager + * Elm.Sys_Notify. It is initialized upon the first call of this function + * + * @return The unique notification manager + * + * @since 1.17 + * + * @ingroup Elm_Sys_Notify + */ +EOAPI Elm_Sys_Notify *elm_obj_sys_notify_singleton_get(void); + +#endif diff --git a/src/lib/elementary/elm_sys_notify_eo.legacy.c b/src/lib/elementary/elm_sys_notify_eo.legacy.c new file mode 100644 index 0000000000..93e0d17e84 --- /dev/null +++ b/src/lib/elementary/elm_sys_notify_eo.legacy.c @@ -0,0 +1,12 @@ + +EAPI Eina_Bool +elm_sys_notify_servers_set(Elm_Sys_Notify *obj, Elm_Sys_Notify_Server servers) +{ + return elm_obj_sys_notify_servers_set(obj, servers); +} + +EAPI Elm_Sys_Notify_Server +elm_sys_notify_servers_get(const Elm_Sys_Notify *obj) +{ + return elm_obj_sys_notify_servers_get(obj); +} diff --git a/src/lib/elementary/elm_sys_notify_eo.legacy.h b/src/lib/elementary/elm_sys_notify_eo.legacy.h new file mode 100644 index 0000000000..74dafc8182 --- /dev/null +++ b/src/lib/elementary/elm_sys_notify_eo.legacy.h @@ -0,0 +1,117 @@ +#ifndef _ELM_SYS_NOTIFY_EO_LEGACY_H_ +#define _ELM_SYS_NOTIFY_EO_LEGACY_H_ + +#ifndef _ELM_SYS_NOTIFY_EO_CLASS_TYPE +#define _ELM_SYS_NOTIFY_EO_CLASS_TYPE + +typedef Eo Elm_Sys_Notify; + +#endif + +#ifndef _ELM_SYS_NOTIFY_EO_TYPES +#define _ELM_SYS_NOTIFY_EO_TYPES + +/** System notification server types + * + * @ingroup Elm_Sys_Notify + */ +typedef enum +{ + ELM_SYS_NOTIFY_SERVER_NONE = 0, /**< No notificationserver (disables + * notifications) */ + ELM_SYS_NOTIFY_SERVER_DBUS = 1 /* 1 >> 0 */ /**< Use DBus as a notification + * server */ +} Elm_Sys_Notify_Server; + +/** The reason the notification was closed + * + * @since 1.8 + * + * @ingroup Elm_Sys_Notify + */ +typedef enum +{ + ELM_SYS_NOTIFY_CLOSED_EXPIRED = 0, /**< The notification expired */ + ELM_SYS_NOTIFY_CLOSED_DISMISSED, /**< The notification was dismissed by the + * user */ + ELM_SYS_NOTIFY_CLOSED_REQUESTED, /**< The notification was closed by a call to + * CloseNotification method */ + ELM_SYS_NOTIFY_CLOSED_UNDEFINED /**< Undefined/reserved reasons */ +} Elm_Sys_Notify_Closed_Reason; + +/** Data on event when notification closed is emitted + * + * @since 1.8 + * + * @ingroup Elm_Sys_Notify + */ +typedef struct _Elm_Sys_Notify_Notification_Closed +{ + unsigned int id; /**< ID of the notification */ + Elm_Sys_Notify_Closed_Reason reason; /**< The reason the notification was + * closed */ +} Elm_Sys_Notify_Notification_Closed; + +/** Data on event when the action invoked is emitted + * + * @since 1.8 + * + * @ingroup Elm_Sys_Notify + */ +typedef struct _Elm_Sys_Notify_Action_Invoked +{ + unsigned int id; /**< ID of the notification */ + char *action_key; /**< The key of the action invoked. These match the keys + * sent over in the list of actions */ +} Elm_Sys_Notify_Action_Invoked; + + +#endif + +/** + * @brief Set the notifications server to be used. + * + * @note This is an advanced function that should be used only to fulfill very + * specific purposes. Use elm_need_sys_notify() which activates the default + * available notification servers. + * + * @param[in] obj The object. + * @param[in] servers Binary mask of servers to enable. If a server is not + * present in the binary mask but was previously registered, it will be + * unregistered. + * + * @return @c true on success, @c false on failure + * + * @since 1.17 + * + * @ingroup Elm_Sys_Notify_Group + */ +EAPI Eina_Bool elm_sys_notify_servers_set(Elm_Sys_Notify *obj, Elm_Sys_Notify_Server servers); + +/** + * @brief Get the notification servers that have been registered + * + * @param[in] obj The object. + * + * @return Binary mask of servers to enable. If a server is not present in the + * binary mask but was previously registered, it will be unregistered. + * + * @since 1.17 + * + * @ingroup Elm_Sys_Notify_Group + */ +EAPI Elm_Sys_Notify_Server elm_sys_notify_servers_get(const Elm_Sys_Notify *obj); + +/** + * @brief Returns the singleton instance of the notification manager + * Elm.Sys_Notify. It is initialized upon the first call of this function + * + * @return The unique notification manager + * + * @since 1.17 + * + * @ingroup Elm_Sys_Notify_Group + */ +EAPI Elm_Sys_Notify *elm_sys_notify_singleton_get(void); + +#endif diff --git a/src/lib/elementary/elm_sys_notify_interface.c b/src/lib/elementary/elm_sys_notify_interface.c index c630afec63..ace17338c5 100644 --- a/src/lib/elementary/elm_sys_notify_interface.c +++ b/src/lib/elementary/elm_sys_notify_interface.c @@ -5,5 +5,5 @@ #include #include "elm_priv.h" -#include "elm_sys_notify_interface.eo.c" +#include "elm_sys_notify_interface_eo.c" diff --git a/src/lib/elementary/elm_sys_notify_interface.eo b/src/lib/elementary/elm_sys_notify_interface.eo deleted file mode 100644 index eddf330496..0000000000 --- a/src/lib/elementary/elm_sys_notify_interface.eo +++ /dev/null @@ -1,68 +0,0 @@ -type Elm_Sys_Notify_Send_Cb: __undefined_type; [[elementary system notify send callback type]] - -enum Elm.Sys_Notify.Urgency -{ - [[Urgency levels of a notification - - @since 1.8 - ]] - low, [[Low urgency]] - normal, [[Normal urgency]] - critical [[Critical urgency]] -} - -interface Elm.Sys_Notify_Interface -{ - [[Elementary system notify interface]] - eo_prefix: elm_obj_sys_notify_interface; - legacy_prefix: elm_sys_notify_interface; - - methods { - send @const { - [[Causes a notification to be forcefully closed and removed from the - user's view. It can be used, for example, in the event that what the - notification pertains to is no longer relevant, or to cancel a - notification with no expiration time. - - @since 1.8 - ]] - params { - @in replaces_id: uint; [[Notification ID that this notification replaces. - The value 0 means a new notification.]] - @in icon: string; [[The optional program icon of the calling application]] - @in summary: string; [[The summary text briefly describing the notification]] - @in body: string @optional; [[The optional detailed body text. Can be empty]] - @in urgency: Elm.Sys_Notify.Urgency; [[The urgency level]] - @in timeout: int; [[Timeout display in milliseconds]] - @in cb: Elm_Sys_Notify_Send_Cb; [[Callback used to retrieve the notification id - returned by the Notification Server]] - @in cb_data: const(void_ptr) @optional; [[Optional context data]] - } - } - simple_send @const { - [[Create a new notification just with Icon, Body and Summary. - It is a helper that wraps the send method - - @since 1.16 - ]] - - params { - @in icon: string; [[The optional program icon of the calling application]] - @in summary: string; [[The summary text briefly describing the notification]] - @in body: string; [[The optional detailed body text. Can be empty]] - } - } - close @const { - [[Causes a notification to be forcefully closed and removed from the - user's view. It can be used, for example, in the event that what the - notification pertains to is no longer relevant, or to cancel a - notification with no expiration time. - - @since 1.8 - ]] - params { - @in id: uint; [[Notification ID]] - } - } - } -} diff --git a/src/lib/elementary/elm_sys_notify_interface_eo.c b/src/lib/elementary/elm_sys_notify_interface_eo.c new file mode 100644 index 0000000000..febf76279b --- /dev/null +++ b/src/lib/elementary/elm_sys_notify_interface_eo.c @@ -0,0 +1,39 @@ +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_sys_notify_interface_send, EFL_FUNC_CALL(replaces_id, icon, summary, body, urgency, timeout, cb, cb_data), unsigned int replaces_id, const char *icon, const char *summary, const char *body, Elm_Sys_Notify_Urgency urgency, int timeout, Elm_Sys_Notify_Send_Cb cb, const void *cb_data); +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_sys_notify_interface_simple_send, EFL_FUNC_CALL(icon, summary, body), const char *icon, const char *summary, const char *body); +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_sys_notify_interface_close, EFL_FUNC_CALL(id), unsigned int id); + +static Eina_Bool +_elm_sys_notify_interface_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_SYS_NOTIFY_INTERFACE_EXTRA_OPS +#define ELM_SYS_NOTIFY_INTERFACE_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_sys_notify_interface_send, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_sys_notify_interface_simple_send, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_sys_notify_interface_close, NULL), + ELM_SYS_NOTIFY_INTERFACE_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_sys_notify_interface_class_desc = { + EO_VERSION, + "Elm.Sys_Notify_Interface", + EFL_CLASS_TYPE_INTERFACE, + 0, + _elm_sys_notify_interface_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_sys_notify_interface_interface_get, &_elm_sys_notify_interface_class_desc, NULL, NULL); + +#include "elm_sys_notify_interface_eo.legacy.c" diff --git a/src/lib/elementary/elm_sys_notify_interface_eo.h b/src/lib/elementary/elm_sys_notify_interface_eo.h new file mode 100644 index 0000000000..0c91b0135d --- /dev/null +++ b/src/lib/elementary/elm_sys_notify_interface_eo.h @@ -0,0 +1,91 @@ +#ifndef _ELM_SYS_NOTIFY_INTERFACE_EO_H_ +#define _ELM_SYS_NOTIFY_INTERFACE_EO_H_ + +#ifndef _ELM_SYS_NOTIFY_INTERFACE_EO_CLASS_TYPE +#define _ELM_SYS_NOTIFY_INTERFACE_EO_CLASS_TYPE + +typedef Eo Elm_Sys_Notify_Interface; + +#endif + +#ifndef _ELM_SYS_NOTIFY_INTERFACE_EO_TYPES +#define _ELM_SYS_NOTIFY_INTERFACE_EO_TYPES + +/** Urgency levels of a notification + * + * @since 1.8 + * + * @ingroup Elm_Sys_Notify + */ +typedef enum +{ + ELM_SYS_NOTIFY_URGENCY_LOW = 0, /**< Low urgency */ + ELM_SYS_NOTIFY_URGENCY_NORMAL, /**< Normal urgency */ + ELM_SYS_NOTIFY_URGENCY_CRITICAL /**< Critical urgency */ +} Elm_Sys_Notify_Urgency; + + +#endif +/** Elementary system notify interface + * + * @ingroup Elm_Sys_Notify_Interface + */ +#define ELM_SYS_NOTIFY_INTERFACE_INTERFACE elm_sys_notify_interface_interface_get() + +EWAPI const Efl_Class *elm_sys_notify_interface_interface_get(void); + +/** + * @brief Causes a notification to be forcefully closed and removed from the + * user's view. It can be used, for example, in the event that what the + * notification pertains to is no longer relevant, or to cancel a notification + * with no expiration time. + * + * @param[in] obj The object. + * @param[in] replaces_id Notification ID that this notification replaces. The + * value 0 means a new notification. + * @param[in] icon The optional program icon of the calling application + * @param[in] summary The summary text briefly describing the notification + * @param[in] body The optional detailed body text. Can be empty + * @param[in] urgency The urgency level + * @param[in] timeout Timeout display in milliseconds + * @param[in] cb Callback used to retrieve the notification id returned by the + * Notification Server + * @param[in] cb_data Optional context data + * + * @since 1.8 + * + * @ingroup Elm_Sys_Notify_Interface + */ +EOAPI void elm_obj_sys_notify_interface_send(const Eo *obj, unsigned int replaces_id, const char *icon, const char *summary, const char *body, Elm_Sys_Notify_Urgency urgency, int timeout, Elm_Sys_Notify_Send_Cb cb, const void *cb_data); + +/** + * @brief Create a new notification just with Icon, Body and Summary. It is a + * helper that wraps the send method + * + * @param[in] obj The object. + * @param[in] icon The optional program icon of the calling application + * @param[in] summary The summary text briefly describing the notification + * @param[in] body The optional detailed body text. Can be empty + * + * @since 1.16 + * + * @ingroup Elm_Sys_Notify_Interface + */ +EOAPI void elm_obj_sys_notify_interface_simple_send(const Eo *obj, const char *icon, const char *summary, const char *body); + +/** + * @brief Causes a notification to be forcefully closed and removed from the + * user's view. It can be used, for example, in the event that what the + * notification pertains to is no longer relevant, or to cancel a notification + * with no expiration time. + * + * @param[in] obj The object. + * @param[in] id Notification ID + * + * @since 1.8 + * + * @ingroup Elm_Sys_Notify_Interface + */ +EOAPI void elm_obj_sys_notify_interface_close(const Eo *obj, unsigned int id); + +#endif diff --git a/src/lib/elementary/elm_sys_notify_interface_eo.legacy.c b/src/lib/elementary/elm_sys_notify_interface_eo.legacy.c new file mode 100644 index 0000000000..9554388cce --- /dev/null +++ b/src/lib/elementary/elm_sys_notify_interface_eo.legacy.c @@ -0,0 +1,18 @@ + +EAPI void +elm_sys_notify_interface_send(const Elm_Sys_Notify_Interface *obj, unsigned int replaces_id, const char *icon, const char *summary, const char *body, Elm_Sys_Notify_Urgency urgency, int timeout, Elm_Sys_Notify_Send_Cb cb, const void *cb_data) +{ + elm_obj_sys_notify_interface_send(obj, replaces_id, icon, summary, body, urgency, timeout, cb, cb_data); +} + +EAPI void +elm_sys_notify_interface_simple_send(const Elm_Sys_Notify_Interface *obj, const char *icon, const char *summary, const char *body) +{ + elm_obj_sys_notify_interface_simple_send(obj, icon, summary, body); +} + +EAPI void +elm_sys_notify_interface_close(const Elm_Sys_Notify_Interface *obj, unsigned int id) +{ + elm_obj_sys_notify_interface_close(obj, id); +} diff --git a/src/lib/elementary/elm_sys_notify_interface_eo.legacy.h b/src/lib/elementary/elm_sys_notify_interface_eo.legacy.h new file mode 100644 index 0000000000..89903c59d5 --- /dev/null +++ b/src/lib/elementary/elm_sys_notify_interface_eo.legacy.h @@ -0,0 +1,84 @@ +#ifndef _ELM_SYS_NOTIFY_INTERFACE_EO_LEGACY_H_ +#define _ELM_SYS_NOTIFY_INTERFACE_EO_LEGACY_H_ + +#ifndef _ELM_SYS_NOTIFY_INTERFACE_EO_CLASS_TYPE +#define _ELM_SYS_NOTIFY_INTERFACE_EO_CLASS_TYPE + +typedef Eo Elm_Sys_Notify_Interface; + +#endif + +#ifndef _ELM_SYS_NOTIFY_INTERFACE_EO_TYPES +#define _ELM_SYS_NOTIFY_INTERFACE_EO_TYPES + +/** Urgency levels of a notification + * + * @since 1.8 + * + * @ingroup Elm_Sys_Notify + */ +typedef enum +{ + ELM_SYS_NOTIFY_URGENCY_LOW = 0, /**< Low urgency */ + ELM_SYS_NOTIFY_URGENCY_NORMAL, /**< Normal urgency */ + ELM_SYS_NOTIFY_URGENCY_CRITICAL /**< Critical urgency */ +} Elm_Sys_Notify_Urgency; + + +#endif + +/** + * @brief Causes a notification to be forcefully closed and removed from the + * user's view. It can be used, for example, in the event that what the + * notification pertains to is no longer relevant, or to cancel a notification + * with no expiration time. + * + * @param[in] obj The object. + * @param[in] replaces_id Notification ID that this notification replaces. The + * value 0 means a new notification. + * @param[in] icon The optional program icon of the calling application + * @param[in] summary The summary text briefly describing the notification + * @param[in] body The optional detailed body text. Can be empty + * @param[in] urgency The urgency level + * @param[in] timeout Timeout display in milliseconds + * @param[in] cb Callback used to retrieve the notification id returned by the + * Notification Server + * @param[in] cb_data Optional context data + * + * @since 1.8 + * + * @ingroup Elm_Sys_Notify_Interface_Group + */ +EAPI void elm_sys_notify_interface_send(const Elm_Sys_Notify_Interface *obj, unsigned int replaces_id, const char *icon, const char *summary, const char *body, Elm_Sys_Notify_Urgency urgency, int timeout, Elm_Sys_Notify_Send_Cb cb, const void *cb_data); + +/** + * @brief Create a new notification just with Icon, Body and Summary. It is a + * helper that wraps the send method + * + * @param[in] obj The object. + * @param[in] icon The optional program icon of the calling application + * @param[in] summary The summary text briefly describing the notification + * @param[in] body The optional detailed body text. Can be empty + * + * @since 1.16 + * + * @ingroup Elm_Sys_Notify_Interface_Group + */ +EAPI void elm_sys_notify_interface_simple_send(const Elm_Sys_Notify_Interface *obj, const char *icon, const char *summary, const char *body); + +/** + * @brief Causes a notification to be forcefully closed and removed from the + * user's view. It can be used, for example, in the event that what the + * notification pertains to is no longer relevant, or to cancel a notification + * with no expiration time. + * + * @param[in] obj The object. + * @param[in] id Notification ID + * + * @since 1.8 + * + * @ingroup Elm_Sys_Notify_Interface_Group + */ +EAPI void elm_sys_notify_interface_close(const Elm_Sys_Notify_Interface *obj, unsigned int id); + +#endif diff --git a/src/lib/elementary/elm_systray.c b/src/lib/elementary/elm_systray.c index 0c6c3f0a09..a7bff14701 100644 --- a/src/lib/elementary/elm_systray.c +++ b/src/lib/elementary/elm_systray.c @@ -5,7 +5,7 @@ #include #include "elm_priv.h" -#include "elm_systray.eo.h" +#include "elm_systray_eo.h" #include "elm_systray_watcher.h" EAPI int ELM_EVENT_SYSTRAY_READY = 0; @@ -514,4 +514,4 @@ _elm_unneed_systray(void) } } -#include "elm_systray.eo.c" +#include "elm_systray_eo.c" diff --git a/src/lib/elementary/elm_systray.eo b/src/lib/elementary/elm_systray.eo deleted file mode 100644 index 076177fa71..0000000000 --- a/src/lib/elementary/elm_systray.eo +++ /dev/null @@ -1,125 +0,0 @@ -enum Elm.Systray.Category -{ - [[ - Category of the Status Notifier Item. - @since 1.8 - ]] - app_status, [[Indicators of application status]] - communications, [[Communications apps]] - sys_services, [[System Service apps]] - hardware, [[Hardware indicators]] - other [[Undefined category]] -} - -enum Elm.Systray.Status -{ - [[ - Application status information. - @since 1.8 - ]] - passive, [[Passive (normal)]] - active, [[Active]] - attention [[Needs Attention]] -} - -class Elm.Systray extends Efl.Object -{ - [[Elementary systray class]] - legacy_prefix: elm_systray; - eo_prefix: elm_obj_systray; - data: null; - methods { - @property id { - set { - [[Set the id of the Status Notifier Item.]] - } - get { - [[Get the id of the Status Notifier Item.]] - } - values { - id: string @nullable; [[Status notifier item ID]] - } - } - @property category { - set { - [[Set the category of the Status Notifier Item.]] - } - get { - [[Get the category of the Status Notifier Item.]] - } - values { - cat: Elm.Systray.Category; [[Category]] - } - } - @property icon_theme_path { - set { - [[Set the path to the theme where the icons can be found. Set this value to "" to use the default path.]] - } - get { - [[Get the path to the icon's theme currently in use.]] - } - values { - icon_theme_path: string @nullable; [[Icon theme path]] - } - } - @property menu { - set { - [[Set the object path of the D-Bus Menu that is to be show when the Status Notifier Item is activated by the user.]] - } - get { - [[Get the object path of the D-Bus Menu currently in use.]] - } - values { - menu: const(Efl.Object) @nullable; [[Object path for DBus menu]] - } - } - @property att_icon_name { - set { - [[Set the name of the attention icon to be used by the Status Notifier Item.]] - } - get { - [[Get the name of the attention icon used by the Status Notifier Item.]] - } - values { - att_icon_name: string @nullable; [[Attention icon name]] - } - } - @property status { - set { - [[Set the status of the Status Notifier Item.]] - } - get { - [[Get the status of the Status Notifier Item.]] - } - values { - st: Elm.Systray.Status; [[Status]] - } - } - @property icon_name { - set { - [[Set the name of the icon to be used by the Status Notifier Item.]] - } - get { - [[Get the name of the icon used by the Status Notifier Item.]] - } - values { - icon_name: string @nullable; [[Status icon name]] - } - } - @property title { - set { - [[Set the title of the Status Notifier Item.]] - } - get { - [[Get the title of the Status Notifier Item.]] - } - values { - title: string @nullable; [[Title]] - } - } - register { - [[Register this Status Notifier Item in the System Tray Watcher. This function should only be called after the event #ELM_EVENT_SYSTRAY_READY is emitted.]] - return: bool; [[$true on success, $false otherwise]] - } - } -} diff --git a/src/lib/elementary/elm_systray.h b/src/lib/elementary/elm_systray.h index 0e1953b472..b41ce8ce99 100644 --- a/src/lib/elementary/elm_systray.h +++ b/src/lib/elementary/elm_systray.h @@ -2,6 +2,6 @@ #ifdef EFL_BETA_API_SUPPORT # ifndef EFL_NOLEGACY_API_SUPPORT -# include "elm_systray.eo.legacy.h" +# include "elm_systray_eo.legacy.h" # endif #endif diff --git a/src/lib/elementary/elm_systray_eo.c b/src/lib/elementary/elm_systray_eo.c new file mode 100644 index 0000000000..ca5dba3c93 --- /dev/null +++ b/src/lib/elementary/elm_systray_eo.c @@ -0,0 +1,250 @@ + +void _elm_systray_id_set(Eo *obj, void *pd, const char *id); + + +static Eina_Error +__eolian_elm_systray_id_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_systray_id_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_systray_id_set, EFL_FUNC_CALL(id), const char *id); + +const char *_elm_systray_id_get(const Eo *obj, void *pd); + + +static Eina_Value +__eolian_elm_systray_id_get_reflect(const Eo *obj) +{ + const char *val = elm_obj_systray_id_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_systray_id_get, const char *, NULL); + +void _elm_systray_category_set(Eo *obj, void *pd, Elm_Systray_Category cat); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_systray_category_set, EFL_FUNC_CALL(cat), Elm_Systray_Category cat); + +Elm_Systray_Category _elm_systray_category_get(const Eo *obj, void *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_systray_category_get, Elm_Systray_Category, 0); + +void _elm_systray_icon_theme_path_set(Eo *obj, void *pd, const char *icon_theme_path); + + +static Eina_Error +__eolian_elm_systray_icon_theme_path_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_systray_icon_theme_path_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_systray_icon_theme_path_set, EFL_FUNC_CALL(icon_theme_path), const char *icon_theme_path); + +const char *_elm_systray_icon_theme_path_get(const Eo *obj, void *pd); + + +static Eina_Value +__eolian_elm_systray_icon_theme_path_get_reflect(const Eo *obj) +{ + const char *val = elm_obj_systray_icon_theme_path_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_systray_icon_theme_path_get, const char *, NULL); + +void _elm_systray_menu_set(Eo *obj, void *pd, const Efl_Object *menu); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_systray_menu_set, EFL_FUNC_CALL(menu), const Efl_Object *menu); + +const Efl_Object *_elm_systray_menu_get(const Eo *obj, void *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_systray_menu_get, const Efl_Object *, NULL); + +void _elm_systray_att_icon_name_set(Eo *obj, void *pd, const char *att_icon_name); + + +static Eina_Error +__eolian_elm_systray_att_icon_name_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_systray_att_icon_name_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_systray_att_icon_name_set, EFL_FUNC_CALL(att_icon_name), const char *att_icon_name); + +const char *_elm_systray_att_icon_name_get(const Eo *obj, void *pd); + + +static Eina_Value +__eolian_elm_systray_att_icon_name_get_reflect(const Eo *obj) +{ + const char *val = elm_obj_systray_att_icon_name_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_systray_att_icon_name_get, const char *, NULL); + +void _elm_systray_status_set(Eo *obj, void *pd, Elm_Systray_Status st); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_systray_status_set, EFL_FUNC_CALL(st), Elm_Systray_Status st); + +Elm_Systray_Status _elm_systray_status_get(const Eo *obj, void *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_systray_status_get, Elm_Systray_Status, 0); + +void _elm_systray_icon_name_set(Eo *obj, void *pd, const char *icon_name); + + +static Eina_Error +__eolian_elm_systray_icon_name_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_systray_icon_name_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_systray_icon_name_set, EFL_FUNC_CALL(icon_name), const char *icon_name); + +const char *_elm_systray_icon_name_get(const Eo *obj, void *pd); + + +static Eina_Value +__eolian_elm_systray_icon_name_get_reflect(const Eo *obj) +{ + const char *val = elm_obj_systray_icon_name_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_systray_icon_name_get, const char *, NULL); + +void _elm_systray_title_set(Eo *obj, void *pd, const char *title); + + +static Eina_Error +__eolian_elm_systray_title_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_systray_title_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_systray_title_set, EFL_FUNC_CALL(title), const char *title); + +const char *_elm_systray_title_get(const Eo *obj, void *pd); + + +static Eina_Value +__eolian_elm_systray_title_get_reflect(const Eo *obj) +{ + const char *val = elm_obj_systray_title_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_systray_title_get, const char *, NULL); + +Eina_Bool _elm_systray_register(Eo *obj, void *pd); + +EOAPI EFL_FUNC_BODY(elm_obj_systray_register, Eina_Bool, 0); + +static Eina_Bool +_elm_systray_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_SYSTRAY_EXTRA_OPS +#define ELM_SYSTRAY_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_systray_id_set, _elm_systray_id_set), + EFL_OBJECT_OP_FUNC(elm_obj_systray_id_get, _elm_systray_id_get), + EFL_OBJECT_OP_FUNC(elm_obj_systray_category_set, _elm_systray_category_set), + EFL_OBJECT_OP_FUNC(elm_obj_systray_category_get, _elm_systray_category_get), + EFL_OBJECT_OP_FUNC(elm_obj_systray_icon_theme_path_set, _elm_systray_icon_theme_path_set), + EFL_OBJECT_OP_FUNC(elm_obj_systray_icon_theme_path_get, _elm_systray_icon_theme_path_get), + EFL_OBJECT_OP_FUNC(elm_obj_systray_menu_set, _elm_systray_menu_set), + EFL_OBJECT_OP_FUNC(elm_obj_systray_menu_get, _elm_systray_menu_get), + EFL_OBJECT_OP_FUNC(elm_obj_systray_att_icon_name_set, _elm_systray_att_icon_name_set), + EFL_OBJECT_OP_FUNC(elm_obj_systray_att_icon_name_get, _elm_systray_att_icon_name_get), + EFL_OBJECT_OP_FUNC(elm_obj_systray_status_set, _elm_systray_status_set), + EFL_OBJECT_OP_FUNC(elm_obj_systray_status_get, _elm_systray_status_get), + EFL_OBJECT_OP_FUNC(elm_obj_systray_icon_name_set, _elm_systray_icon_name_set), + EFL_OBJECT_OP_FUNC(elm_obj_systray_icon_name_get, _elm_systray_icon_name_get), + EFL_OBJECT_OP_FUNC(elm_obj_systray_title_set, _elm_systray_title_set), + EFL_OBJECT_OP_FUNC(elm_obj_systray_title_get, _elm_systray_title_get), + EFL_OBJECT_OP_FUNC(elm_obj_systray_register, _elm_systray_register), + ELM_SYSTRAY_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"id", __eolian_elm_systray_id_set_reflect, __eolian_elm_systray_id_get_reflect}, + {"icon_theme_path", __eolian_elm_systray_icon_theme_path_set_reflect, __eolian_elm_systray_icon_theme_path_get_reflect}, + {"att_icon_name", __eolian_elm_systray_att_icon_name_set_reflect, __eolian_elm_systray_att_icon_name_get_reflect}, + {"icon_name", __eolian_elm_systray_icon_name_set_reflect, __eolian_elm_systray_icon_name_get_reflect}, + {"title", __eolian_elm_systray_title_set_reflect, __eolian_elm_systray_title_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_systray_class_desc = { + EO_VERSION, + "Elm.Systray", + EFL_CLASS_TYPE_REGULAR, + 0, + _elm_systray_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_systray_class_get, &_elm_systray_class_desc, EFL_OBJECT_CLASS, NULL); + +#include "elm_systray_eo.legacy.c" diff --git a/src/lib/elementary/elm_systray_eo.h b/src/lib/elementary/elm_systray_eo.h new file mode 100644 index 0000000000..d50dc412b8 --- /dev/null +++ b/src/lib/elementary/elm_systray_eo.h @@ -0,0 +1,236 @@ +#ifndef _ELM_SYSTRAY_EO_H_ +#define _ELM_SYSTRAY_EO_H_ + +#ifndef _ELM_SYSTRAY_EO_CLASS_TYPE +#define _ELM_SYSTRAY_EO_CLASS_TYPE + +typedef Eo Elm_Systray; + +#endif + +#ifndef _ELM_SYSTRAY_EO_TYPES +#define _ELM_SYSTRAY_EO_TYPES + +/** Category of the Status Notifier Item. + * + * @since 1.8 + * + * @ingroup Elm_Systray + */ +typedef enum +{ + ELM_SYSTRAY_CATEGORY_APP_STATUS = 0, /**< Indicators of application status */ + ELM_SYSTRAY_CATEGORY_COMMUNICATIONS, /**< Communications apps */ + ELM_SYSTRAY_CATEGORY_SYS_SERVICES, /**< System Service apps */ + ELM_SYSTRAY_CATEGORY_HARDWARE, /**< Hardware indicators */ + ELM_SYSTRAY_CATEGORY_OTHER /**< Undefined category */ +} Elm_Systray_Category; + +/** Application status information. + * + * @since 1.8 + * + * @ingroup Elm_Systray + */ +typedef enum +{ + ELM_SYSTRAY_STATUS_PASSIVE = 0, /**< Passive (normal) */ + ELM_SYSTRAY_STATUS_ACTIVE, /**< Active */ + ELM_SYSTRAY_STATUS_ATTENTION /**< Needs Attention */ +} Elm_Systray_Status; + + +#endif +/** Elementary systray class + * + * @ingroup Elm_Systray + */ +#define ELM_SYSTRAY_CLASS elm_systray_class_get() + +EWAPI const Efl_Class *elm_systray_class_get(void); + +/** + * @brief Set the id of the Status Notifier Item. + * + * @param[in] obj The object. + * @param[in] id Status notifier item ID + * + * @ingroup Elm_Systray + */ +EOAPI void elm_obj_systray_id_set(Eo *obj, const char *id); + +/** + * @brief Get the id of the Status Notifier Item. + * + * @param[in] obj The object. + * + * @return Status notifier item ID + * + * @ingroup Elm_Systray + */ +EOAPI const char *elm_obj_systray_id_get(const Eo *obj); + +/** + * @brief Set the category of the Status Notifier Item. + * + * @param[in] obj The object. + * @param[in] cat Category + * + * @ingroup Elm_Systray + */ +EOAPI void elm_obj_systray_category_set(Eo *obj, Elm_Systray_Category cat); + +/** + * @brief Get the category of the Status Notifier Item. + * + * @param[in] obj The object. + * + * @return Category + * + * @ingroup Elm_Systray + */ +EOAPI Elm_Systray_Category elm_obj_systray_category_get(const Eo *obj); + +/** + * @brief Set the path to the theme where the icons can be found. Set this + * value to "" to use the default path. + * + * @param[in] obj The object. + * @param[in] icon_theme_path Icon theme path + * + * @ingroup Elm_Systray + */ +EOAPI void elm_obj_systray_icon_theme_path_set(Eo *obj, const char *icon_theme_path); + +/** + * @brief Get the path to the icon's theme currently in use. + * + * @param[in] obj The object. + * + * @return Icon theme path + * + * @ingroup Elm_Systray + */ +EOAPI const char *elm_obj_systray_icon_theme_path_get(const Eo *obj); + +/** + * @brief Set the object path of the D-Bus Menu that is to be show when the + * Status Notifier Item is activated by the user. + * + * @param[in] obj The object. + * @param[in] menu Object path for DBus menu + * + * @ingroup Elm_Systray + */ +EOAPI void elm_obj_systray_menu_set(Eo *obj, const Efl_Object *menu); + +/** + * @brief Get the object path of the D-Bus Menu currently in use. + * + * @param[in] obj The object. + * + * @return Object path for DBus menu + * + * @ingroup Elm_Systray + */ +EOAPI const Efl_Object *elm_obj_systray_menu_get(const Eo *obj); + +/** + * @brief Set the name of the attention icon to be used by the Status Notifier + * Item. + * + * @param[in] obj The object. + * @param[in] att_icon_name Attention icon name + * + * @ingroup Elm_Systray + */ +EOAPI void elm_obj_systray_att_icon_name_set(Eo *obj, const char *att_icon_name); + +/** + * @brief Get the name of the attention icon used by the Status Notifier Item. + * + * @param[in] obj The object. + * + * @return Attention icon name + * + * @ingroup Elm_Systray + */ +EOAPI const char *elm_obj_systray_att_icon_name_get(const Eo *obj); + +/** + * @brief Set the status of the Status Notifier Item. + * + * @param[in] obj The object. + * @param[in] st Status + * + * @ingroup Elm_Systray + */ +EOAPI void elm_obj_systray_status_set(Eo *obj, Elm_Systray_Status st); + +/** + * @brief Get the status of the Status Notifier Item. + * + * @param[in] obj The object. + * + * @return Status + * + * @ingroup Elm_Systray + */ +EOAPI Elm_Systray_Status elm_obj_systray_status_get(const Eo *obj); + +/** + * @brief Set the name of the icon to be used by the Status Notifier Item. + * + * @param[in] obj The object. + * @param[in] icon_name Status icon name + * + * @ingroup Elm_Systray + */ +EOAPI void elm_obj_systray_icon_name_set(Eo *obj, const char *icon_name); + +/** + * @brief Get the name of the icon used by the Status Notifier Item. + * + * @param[in] obj The object. + * + * @return Status icon name + * + * @ingroup Elm_Systray + */ +EOAPI const char *elm_obj_systray_icon_name_get(const Eo *obj); + +/** + * @brief Set the title of the Status Notifier Item. + * + * @param[in] obj The object. + * @param[in] title Title + * + * @ingroup Elm_Systray + */ +EOAPI void elm_obj_systray_title_set(Eo *obj, const char *title); + +/** + * @brief Get the title of the Status Notifier Item. + * + * @param[in] obj The object. + * + * @return Title + * + * @ingroup Elm_Systray + */ +EOAPI const char *elm_obj_systray_title_get(const Eo *obj); + +/** + * @brief Register this Status Notifier Item in the System Tray Watcher. This + * function should only be called after the event #ELM_EVENT_SYSTRAY_READY is + * emitted. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Systray + */ +EOAPI Eina_Bool elm_obj_systray_register(Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_systray_eo.legacy.c b/src/lib/elementary/elm_systray_eo.legacy.c new file mode 100644 index 0000000000..d898bbd7ee --- /dev/null +++ b/src/lib/elementary/elm_systray_eo.legacy.c @@ -0,0 +1,102 @@ + +EAPI void +elm_systray_id_set(Elm_Systray *obj, const char *id) +{ + elm_obj_systray_id_set(obj, id); +} + +EAPI const char * +elm_systray_id_get(const Elm_Systray *obj) +{ + return elm_obj_systray_id_get(obj); +} + +EAPI void +elm_systray_category_set(Elm_Systray *obj, Elm_Systray_Category cat) +{ + elm_obj_systray_category_set(obj, cat); +} + +EAPI Elm_Systray_Category +elm_systray_category_get(const Elm_Systray *obj) +{ + return elm_obj_systray_category_get(obj); +} + +EAPI void +elm_systray_icon_theme_path_set(Elm_Systray *obj, const char *icon_theme_path) +{ + elm_obj_systray_icon_theme_path_set(obj, icon_theme_path); +} + +EAPI const char * +elm_systray_icon_theme_path_get(const Elm_Systray *obj) +{ + return elm_obj_systray_icon_theme_path_get(obj); +} + +EAPI void +elm_systray_menu_set(Elm_Systray *obj, const Efl_Object *menu) +{ + elm_obj_systray_menu_set(obj, menu); +} + +EAPI const Efl_Object * +elm_systray_menu_get(const Elm_Systray *obj) +{ + return elm_obj_systray_menu_get(obj); +} + +EAPI void +elm_systray_att_icon_name_set(Elm_Systray *obj, const char *att_icon_name) +{ + elm_obj_systray_att_icon_name_set(obj, att_icon_name); +} + +EAPI const char * +elm_systray_att_icon_name_get(const Elm_Systray *obj) +{ + return elm_obj_systray_att_icon_name_get(obj); +} + +EAPI void +elm_systray_status_set(Elm_Systray *obj, Elm_Systray_Status st) +{ + elm_obj_systray_status_set(obj, st); +} + +EAPI Elm_Systray_Status +elm_systray_status_get(const Elm_Systray *obj) +{ + return elm_obj_systray_status_get(obj); +} + +EAPI void +elm_systray_icon_name_set(Elm_Systray *obj, const char *icon_name) +{ + elm_obj_systray_icon_name_set(obj, icon_name); +} + +EAPI const char * +elm_systray_icon_name_get(const Elm_Systray *obj) +{ + return elm_obj_systray_icon_name_get(obj); +} + +EAPI void +elm_systray_title_set(Elm_Systray *obj, const char *title) +{ + elm_obj_systray_title_set(obj, title); +} + +EAPI const char * +elm_systray_title_get(const Elm_Systray *obj) +{ + return elm_obj_systray_title_get(obj); +} + +EAPI Eina_Bool +elm_systray_register(Elm_Systray *obj) +{ + return elm_obj_systray_register(obj); +} diff --git a/src/lib/elementary/elm_systray_eo.legacy.h b/src/lib/elementary/elm_systray_eo.legacy.h new file mode 100644 index 0000000000..485ced58df --- /dev/null +++ b/src/lib/elementary/elm_systray_eo.legacy.h @@ -0,0 +1,229 @@ +#ifndef _ELM_SYSTRAY_EO_LEGACY_H_ +#define _ELM_SYSTRAY_EO_LEGACY_H_ + +#ifndef _ELM_SYSTRAY_EO_CLASS_TYPE +#define _ELM_SYSTRAY_EO_CLASS_TYPE + +typedef Eo Elm_Systray; + +#endif + +#ifndef _ELM_SYSTRAY_EO_TYPES +#define _ELM_SYSTRAY_EO_TYPES + +/** Category of the Status Notifier Item. + * + * @since 1.8 + * + * @ingroup Elm_Systray + */ +typedef enum +{ + ELM_SYSTRAY_CATEGORY_APP_STATUS = 0, /**< Indicators of application status */ + ELM_SYSTRAY_CATEGORY_COMMUNICATIONS, /**< Communications apps */ + ELM_SYSTRAY_CATEGORY_SYS_SERVICES, /**< System Service apps */ + ELM_SYSTRAY_CATEGORY_HARDWARE, /**< Hardware indicators */ + ELM_SYSTRAY_CATEGORY_OTHER /**< Undefined category */ +} Elm_Systray_Category; + +/** Application status information. + * + * @since 1.8 + * + * @ingroup Elm_Systray + */ +typedef enum +{ + ELM_SYSTRAY_STATUS_PASSIVE = 0, /**< Passive (normal) */ + ELM_SYSTRAY_STATUS_ACTIVE, /**< Active */ + ELM_SYSTRAY_STATUS_ATTENTION /**< Needs Attention */ +} Elm_Systray_Status; + + +#endif + +/** + * @brief Set the id of the Status Notifier Item. + * + * @param[in] obj The object. + * @param[in] id Status notifier item ID + * + * @ingroup Elm_Systray_Group + */ +EAPI void elm_systray_id_set(Elm_Systray *obj, const char *id); + +/** + * @brief Get the id of the Status Notifier Item. + * + * @param[in] obj The object. + * + * @return Status notifier item ID + * + * @ingroup Elm_Systray_Group + */ +EAPI const char *elm_systray_id_get(const Elm_Systray *obj); + +/** + * @brief Set the category of the Status Notifier Item. + * + * @param[in] obj The object. + * @param[in] cat Category + * + * @ingroup Elm_Systray_Group + */ +EAPI void elm_systray_category_set(Elm_Systray *obj, Elm_Systray_Category cat); + +/** + * @brief Get the category of the Status Notifier Item. + * + * @param[in] obj The object. + * + * @return Category + * + * @ingroup Elm_Systray_Group + */ +EAPI Elm_Systray_Category elm_systray_category_get(const Elm_Systray *obj); + +/** + * @brief Set the path to the theme where the icons can be found. Set this + * value to "" to use the default path. + * + * @param[in] obj The object. + * @param[in] icon_theme_path Icon theme path + * + * @ingroup Elm_Systray_Group + */ +EAPI void elm_systray_icon_theme_path_set(Elm_Systray *obj, const char *icon_theme_path); + +/** + * @brief Get the path to the icon's theme currently in use. + * + * @param[in] obj The object. + * + * @return Icon theme path + * + * @ingroup Elm_Systray_Group + */ +EAPI const char *elm_systray_icon_theme_path_get(const Elm_Systray *obj); + +/** + * @brief Set the object path of the D-Bus Menu that is to be show when the + * Status Notifier Item is activated by the user. + * + * @param[in] obj The object. + * @param[in] menu Object path for DBus menu + * + * @ingroup Elm_Systray_Group + */ +EAPI void elm_systray_menu_set(Elm_Systray *obj, const Efl_Object *menu); + +/** + * @brief Get the object path of the D-Bus Menu currently in use. + * + * @param[in] obj The object. + * + * @return Object path for DBus menu + * + * @ingroup Elm_Systray_Group + */ +EAPI const Efl_Object *elm_systray_menu_get(const Elm_Systray *obj); + +/** + * @brief Set the name of the attention icon to be used by the Status Notifier + * Item. + * + * @param[in] obj The object. + * @param[in] att_icon_name Attention icon name + * + * @ingroup Elm_Systray_Group + */ +EAPI void elm_systray_att_icon_name_set(Elm_Systray *obj, const char *att_icon_name); + +/** + * @brief Get the name of the attention icon used by the Status Notifier Item. + * + * @param[in] obj The object. + * + * @return Attention icon name + * + * @ingroup Elm_Systray_Group + */ +EAPI const char *elm_systray_att_icon_name_get(const Elm_Systray *obj); + +/** + * @brief Set the status of the Status Notifier Item. + * + * @param[in] obj The object. + * @param[in] st Status + * + * @ingroup Elm_Systray_Group + */ +EAPI void elm_systray_status_set(Elm_Systray *obj, Elm_Systray_Status st); + +/** + * @brief Get the status of the Status Notifier Item. + * + * @param[in] obj The object. + * + * @return Status + * + * @ingroup Elm_Systray_Group + */ +EAPI Elm_Systray_Status elm_systray_status_get(const Elm_Systray *obj); + +/** + * @brief Set the name of the icon to be used by the Status Notifier Item. + * + * @param[in] obj The object. + * @param[in] icon_name Status icon name + * + * @ingroup Elm_Systray_Group + */ +EAPI void elm_systray_icon_name_set(Elm_Systray *obj, const char *icon_name); + +/** + * @brief Get the name of the icon used by the Status Notifier Item. + * + * @param[in] obj The object. + * + * @return Status icon name + * + * @ingroup Elm_Systray_Group + */ +EAPI const char *elm_systray_icon_name_get(const Elm_Systray *obj); + +/** + * @brief Set the title of the Status Notifier Item. + * + * @param[in] obj The object. + * @param[in] title Title + * + * @ingroup Elm_Systray_Group + */ +EAPI void elm_systray_title_set(Elm_Systray *obj, const char *title); + +/** + * @brief Get the title of the Status Notifier Item. + * + * @param[in] obj The object. + * + * @return Title + * + * @ingroup Elm_Systray_Group + */ +EAPI const char *elm_systray_title_get(const Elm_Systray *obj); + +/** + * @brief Register this Status Notifier Item in the System Tray Watcher. This + * function should only be called after the event #ELM_EVENT_SYSTRAY_READY is + * emitted. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Systray_Group + */ +EAPI Eina_Bool elm_systray_register(Elm_Systray *obj); + +#endif diff --git a/src/lib/elementary/elm_table.c b/src/lib/elementary/elm_table.c index 87bda3a3a7..fa07e5912b 100644 --- a/src/lib/elementary/elm_table.c +++ b/src/lib/elementary/elm_table.c @@ -6,7 +6,7 @@ #define EFL_UI_FOCUS_COMPOSITION_PROTECTED #include -#include +#include #include "elm_priv.h" #include "elm_widget_table.h" @@ -41,12 +41,12 @@ _mirrored_set(Evas_Object *obj, Eina_Bool rtl) evas_object_table_mirrored_set(wd->resize_obj, rtl); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_table_efl_ui_widget_theme_apply(Eo *obj, void *sd EINA_UNUSED) { - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; _mirrored_set(obj, efl_ui_mirrored_get(obj)); @@ -92,8 +92,6 @@ _elm_table_efl_canvas_group_group_add(Eo *obj, void *_pd EINA_UNUSED) { Evas_Object *table; - elm_widget_sub_object_parent_add(obj); - table = evas_object_table_add(evas_object_evas_get(obj)); elm_widget_resize_object_set(obj, table); @@ -346,4 +344,4 @@ _elm_table_efl_canvas_group_group_calculate(Eo *obj, void *pd EINA_UNUSED) #define ELM_TABLE_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_table) -#include "elm_table.eo.c" +#include "elm_table_eo.c" diff --git a/src/lib/elementary/elm_table.eo b/src/lib/elementary/elm_table.eo deleted file mode 100644 index 4f68be9eb5..0000000000 --- a/src/lib/elementary/elm_table.eo +++ /dev/null @@ -1,128 +0,0 @@ -class Elm.Table extends Efl.Ui.Widget implements Efl.Ui.Focus.Composition, Efl.Ui.Legacy -{ - [[Elementary table class]] - legacy_prefix: elm_table; - eo_prefix: elm_obj_table; - data: null; - methods { - @property homogeneous { - [[Control the homogenous state in a table.]] - set {} - get {} - values { - homogeneous: bool; [[A boolean to set if the layout is - homogeneous in the table.]] - } - } - @property padding { - set { - [[Set padding between cells. Default value is 0.]] - } - get { - [[Get padding between cells.]] - } - values { - horizontal: int; [[The horizontal padding.]] - vertical: int; [[The vertical padding.]] - } - } - @property align { - set { - [[Set alignment of table. Default value is 0.5. - - @since 1.13 - ]] - } - get { - [[Get alignment of table. - - @since 1.13 - ]] - } - values { - horizontal: double; [[The horizontal alignment.]] - vertical: double; [[The vertical alignment.]] - } - } - clear { - [[Faster way to remove all child objects from a table object.]] - params { - @in clear: bool; [[If $true, will delete children, else just remove from table.]] - } - } - child_get @const { - [[Get child object of table at given coordinates.]] - return: Efl.Canvas.Object; [[Child of object if find if not return $null.]] - params { - @in col: int; [[Column number of child object.]] - @in row: int; [[Row number of child object.]] - } - } - pack_set { - [[Set the packing location of an existing child of the table - - Modifies the position of an object already in the table. - - Note: All positioning inside the table is relative to rows and - columns, so a value of 0 for col and row, means the top left - cell of the table, and a value of 1 for colspan and rowspan - means only takes that 1 cell. - ]] - params { - @in subobj: Efl.Canvas.Object; [[The subobject to be modified in the table.]] - @in column: int; [[Column number.]] - @in row: int; [[Row number.]] - @in colspan: int; [[Columns span.]] - @in rowspan: int; [[Rows span.]] - } - legacy: null; - } - pack_get { - [[Get the packing location of an existing child of the table.]] - params { - @in subobj: Efl.Canvas.Object; [[The subobject to be modified in the table.]] - @out column: int; [[Column number.]] - @out row: int; [[Row number.]] - @out colspan: int; [[Columns span.]] - @out rowspan: int; [[Rows span.]] - } - legacy: null; - } - unpack { - [[Remove child from table.]] - params { - @in subobj: Efl.Canvas.Object; [[The subobject.]] - } - } - pack { - [[Add a subobject on the table with the coordinates passed. - - Note: All positioning inside the table is relative to rows and - columns, so a value of 0 for x and y, means the top left cell of - the table, and a value of 1 for w and h means $subobj only takes - that 1 cell. - - Note: Columns and rows only guarantee 16bit unsigned values - at best. That means that col + colspan AND row + rowspan must fit - inside 16bit unsigned values cleanly. You will be warned once - values exceed 15bit storage, and attempting to use values not - able to fit in 16bits will result in failure. - ]] - params { - @in subobj: Efl.Canvas.Object; [[The subobject to be added to the table.]] - @in column: int; [[Column number.]] - @in row: int; [[Row number.]] - @in colspan: int; [[Columns span.]] - @in rowspan: int; [[Rows span.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Canvas.Group.group_calculate; - Efl.Ui.Widget.theme_apply; - Efl.Ui.Widget.widget_sub_object_del; - Efl.Ui.Focus.Composition.prepare; - } -} diff --git a/src/lib/elementary/elm_table_eo.c b/src/lib/elementary/elm_table_eo.c new file mode 100644 index 0000000000..9f0e01f5d7 --- /dev/null +++ b/src/lib/elementary/elm_table_eo.c @@ -0,0 +1,145 @@ + +void _elm_table_homogeneous_set(Eo *obj, void *pd, Eina_Bool homogeneous); + + +static Eina_Error +__eolian_elm_table_homogeneous_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_table_homogeneous_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_table_homogeneous_set, EFL_FUNC_CALL(homogeneous), Eina_Bool homogeneous); + +Eina_Bool _elm_table_homogeneous_get(const Eo *obj, void *pd); + + +static Eina_Value +__eolian_elm_table_homogeneous_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_table_homogeneous_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_table_homogeneous_get, Eina_Bool, 0); + +void _elm_table_padding_set(Eo *obj, void *pd, int horizontal, int vertical); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_table_padding_set, EFL_FUNC_CALL(horizontal, vertical), int horizontal, int vertical); + +void _elm_table_padding_get(const Eo *obj, void *pd, int *horizontal, int *vertical); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_table_padding_get, EFL_FUNC_CALL(horizontal, vertical), int *horizontal, int *vertical); + +void _elm_table_align_set(Eo *obj, void *pd, double horizontal, double vertical); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_table_align_set, EFL_FUNC_CALL(horizontal, vertical), double horizontal, double vertical); + +void _elm_table_align_get(const Eo *obj, void *pd, double *horizontal, double *vertical); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_table_align_get, EFL_FUNC_CALL(horizontal, vertical), double *horizontal, double *vertical); + +void _elm_table_clear(Eo *obj, void *pd, Eina_Bool clear); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_table_clear, EFL_FUNC_CALL(clear), Eina_Bool clear); + +Efl_Canvas_Object *_elm_table_child_get(const Eo *obj, void *pd, int col, int row); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_table_child_get, Efl_Canvas_Object *, NULL, EFL_FUNC_CALL(col, row), int col, int row); + +void _elm_table_pack_set(Eo *obj, void *pd, Efl_Canvas_Object *subobj, int column, int row, int colspan, int rowspan); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_table_pack_set, EFL_FUNC_CALL(subobj, column, row, colspan, rowspan), Efl_Canvas_Object *subobj, int column, int row, int colspan, int rowspan); + +void _elm_table_pack_get(Eo *obj, void *pd, Efl_Canvas_Object *subobj, int *column, int *row, int *colspan, int *rowspan); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_table_pack_get, EFL_FUNC_CALL(subobj, column, row, colspan, rowspan), Efl_Canvas_Object *subobj, int *column, int *row, int *colspan, int *rowspan); + +void _elm_table_unpack(Eo *obj, void *pd, Efl_Canvas_Object *subobj); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_table_unpack, EFL_FUNC_CALL(subobj), Efl_Canvas_Object *subobj); + +void _elm_table_pack(Eo *obj, void *pd, Efl_Canvas_Object *subobj, int column, int row, int colspan, int rowspan); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_table_pack, EFL_FUNC_CALL(subobj, column, row, colspan, rowspan), Efl_Canvas_Object *subobj, int column, int row, int colspan, int rowspan); + +Efl_Object *_elm_table_efl_object_constructor(Eo *obj, void *pd); + + +void _elm_table_efl_canvas_group_group_calculate(Eo *obj, void *pd); + + +Eina_Error _elm_table_efl_ui_widget_theme_apply(Eo *obj, void *pd); + + +Eina_Bool _elm_table_efl_ui_widget_widget_sub_object_del(Eo *obj, void *pd, Efl_Canvas_Object *sub_obj); + + +void _elm_table_efl_ui_focus_composition_prepare(Eo *obj, void *pd); + + +static Eina_Bool +_elm_table_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_TABLE_EXTRA_OPS +#define ELM_TABLE_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_table_homogeneous_set, _elm_table_homogeneous_set), + EFL_OBJECT_OP_FUNC(elm_obj_table_homogeneous_get, _elm_table_homogeneous_get), + EFL_OBJECT_OP_FUNC(elm_obj_table_padding_set, _elm_table_padding_set), + EFL_OBJECT_OP_FUNC(elm_obj_table_padding_get, _elm_table_padding_get), + EFL_OBJECT_OP_FUNC(elm_obj_table_align_set, _elm_table_align_set), + EFL_OBJECT_OP_FUNC(elm_obj_table_align_get, _elm_table_align_get), + EFL_OBJECT_OP_FUNC(elm_obj_table_clear, _elm_table_clear), + EFL_OBJECT_OP_FUNC(elm_obj_table_child_get, _elm_table_child_get), + EFL_OBJECT_OP_FUNC(elm_obj_table_pack_set, _elm_table_pack_set), + EFL_OBJECT_OP_FUNC(elm_obj_table_pack_get, _elm_table_pack_get), + EFL_OBJECT_OP_FUNC(elm_obj_table_unpack, _elm_table_unpack), + EFL_OBJECT_OP_FUNC(elm_obj_table_pack, _elm_table_pack), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_table_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _elm_table_efl_canvas_group_group_calculate), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_table_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _elm_table_efl_ui_widget_widget_sub_object_del), + EFL_OBJECT_OP_FUNC(efl_ui_focus_composition_prepare, _elm_table_efl_ui_focus_composition_prepare), + ELM_TABLE_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"homogeneous", __eolian_elm_table_homogeneous_set_reflect, __eolian_elm_table_homogeneous_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_table_class_desc = { + EO_VERSION, + "Elm.Table", + EFL_CLASS_TYPE_REGULAR, + 0, + _elm_table_class_initializer, + _elm_table_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_table_class_get, &_elm_table_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_table_eo.legacy.c" diff --git a/src/lib/elementary/elm_table_eo.h b/src/lib/elementary/elm_table_eo.h new file mode 100644 index 0000000000..b203ddce63 --- /dev/null +++ b/src/lib/elementary/elm_table_eo.h @@ -0,0 +1,185 @@ +#ifndef _ELM_TABLE_EO_H_ +#define _ELM_TABLE_EO_H_ + +#ifndef _ELM_TABLE_EO_CLASS_TYPE +#define _ELM_TABLE_EO_CLASS_TYPE + +typedef Eo Elm_Table; + +#endif + +#ifndef _ELM_TABLE_EO_TYPES +#define _ELM_TABLE_EO_TYPES + + +#endif +/** Elementary table class + * + * @ingroup Elm_Table + */ +#define ELM_TABLE_CLASS elm_table_class_get() + +EWAPI const Efl_Class *elm_table_class_get(void); + +/** + * @brief Control the homogenous state in a table. + * + * @param[in] obj The object. + * @param[in] homogeneous A boolean to set if the layout is homogeneous in the + * table. + * + * @ingroup Elm_Table + */ +EOAPI void elm_obj_table_homogeneous_set(Eo *obj, Eina_Bool homogeneous); + +/** + * @brief Control the homogenous state in a table. + * + * @param[in] obj The object. + * + * @return A boolean to set if the layout is homogeneous in the table. + * + * @ingroup Elm_Table + */ +EOAPI Eina_Bool elm_obj_table_homogeneous_get(const Eo *obj); + +/** + * @brief Set padding between cells. Default value is 0. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal padding. + * @param[in] vertical The vertical padding. + * + * @ingroup Elm_Table + */ +EOAPI void elm_obj_table_padding_set(Eo *obj, int horizontal, int vertical); + +/** + * @brief Get padding between cells. + * + * @param[in] obj The object. + * @param[out] horizontal The horizontal padding. + * @param[out] vertical The vertical padding. + * + * @ingroup Elm_Table + */ +EOAPI void elm_obj_table_padding_get(const Eo *obj, int *horizontal, int *vertical); + +/** + * @brief Set alignment of table. Default value is 0.5. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal alignment. + * @param[in] vertical The vertical alignment. + * + * @since 1.13 + * + * @ingroup Elm_Table + */ +EOAPI void elm_obj_table_align_set(Eo *obj, double horizontal, double vertical); + +/** + * @brief Get alignment of table. + * + * @param[in] obj The object. + * @param[out] horizontal The horizontal alignment. + * @param[out] vertical The vertical alignment. + * + * @since 1.13 + * + * @ingroup Elm_Table + */ +EOAPI void elm_obj_table_align_get(const Eo *obj, double *horizontal, double *vertical); + +/** + * @brief Faster way to remove all child objects from a table object. + * + * @param[in] obj The object. + * @param[in] clear If @c true, will delete children, else just remove from + * table. + * + * @ingroup Elm_Table + */ +EOAPI void elm_obj_table_clear(Eo *obj, Eina_Bool clear); + +/** + * @brief Get child object of table at given coordinates. + * + * @param[in] obj The object. + * @param[in] col Column number of child object. + * @param[in] row Row number of child object. + * + * @return Child of object if find if not return @c null. + * + * @ingroup Elm_Table + */ +EOAPI Efl_Canvas_Object *elm_obj_table_child_get(const Eo *obj, int col, int row); + +/** + * @brief Set the packing location of an existing child of the table + * + * Modifies the position of an object already in the table. + * + * @note All positioning inside the table is relative to rows and columns, so a + * value of 0 for col and row, means the top left cell of the table, and a + * value of 1 for colspan and rowspan means only takes that 1 cell. + * + * @param[in] obj The object. + * @param[in] subobj The subobject to be modified in the table. + * @param[in] column Column number. + * @param[in] row Row number. + * @param[in] colspan Columns span. + * @param[in] rowspan Rows span. + * + * @ingroup Elm_Table + */ +EOAPI void elm_obj_table_pack_set(Eo *obj, Efl_Canvas_Object *subobj, int column, int row, int colspan, int rowspan); + +/** + * @brief Get the packing location of an existing child of the table. + * + * @param[in] obj The object. + * @param[in] subobj The subobject to be modified in the table. + * @param[out] column Column number. + * @param[out] row Row number. + * @param[out] colspan Columns span. + * @param[out] rowspan Rows span. + * + * @ingroup Elm_Table + */ +EOAPI void elm_obj_table_pack_get(Eo *obj, Efl_Canvas_Object *subobj, int *column, int *row, int *colspan, int *rowspan); + +/** + * @brief Remove child from table. + * + * @param[in] obj The object. + * @param[in] subobj The subobject. + * + * @ingroup Elm_Table + */ +EOAPI void elm_obj_table_unpack(Eo *obj, Efl_Canvas_Object *subobj); + +/** + * @brief Add a subobject on the table with the coordinates passed. + * + * @note All positioning inside the table is relative to rows and columns, so a + * value of 0 for x and y, means the top left cell of the table, and a value of + * 1 for w and h means @c subobj only takes that 1 cell. + * + * @note Columns and rows only guarantee 16bit unsigned values at best. That + * means that col + colspan AND row + rowspan must fit inside 16bit unsigned + * values cleanly. You will be warned once values exceed 15bit storage, and + * attempting to use values not able to fit in 16bits will result in failure. + * + * @param[in] obj The object. + * @param[in] subobj The subobject to be added to the table. + * @param[in] column Column number. + * @param[in] row Row number. + * @param[in] colspan Columns span. + * @param[in] rowspan Rows span. + * + * @ingroup Elm_Table + */ +EOAPI void elm_obj_table_pack(Eo *obj, Efl_Canvas_Object *subobj, int column, int row, int colspan, int rowspan); + +#endif diff --git a/src/lib/elementary/elm_table_eo.legacy.c b/src/lib/elementary/elm_table_eo.legacy.c new file mode 100644 index 0000000000..a8ec872c36 --- /dev/null +++ b/src/lib/elementary/elm_table_eo.legacy.c @@ -0,0 +1,60 @@ + +EAPI void +elm_table_homogeneous_set(Elm_Table *obj, Eina_Bool homogeneous) +{ + elm_obj_table_homogeneous_set(obj, homogeneous); +} + +EAPI Eina_Bool +elm_table_homogeneous_get(const Elm_Table *obj) +{ + return elm_obj_table_homogeneous_get(obj); +} + +EAPI void +elm_table_padding_set(Elm_Table *obj, int horizontal, int vertical) +{ + elm_obj_table_padding_set(obj, horizontal, vertical); +} + +EAPI void +elm_table_padding_get(const Elm_Table *obj, int *horizontal, int *vertical) +{ + elm_obj_table_padding_get(obj, horizontal, vertical); +} + +EAPI void +elm_table_align_set(Elm_Table *obj, double horizontal, double vertical) +{ + elm_obj_table_align_set(obj, horizontal, vertical); +} + +EAPI void +elm_table_align_get(const Elm_Table *obj, double *horizontal, double *vertical) +{ + elm_obj_table_align_get(obj, horizontal, vertical); +} + +EAPI void +elm_table_clear(Elm_Table *obj, Eina_Bool clear) +{ + elm_obj_table_clear(obj, clear); +} + +EAPI Efl_Canvas_Object * +elm_table_child_get(const Elm_Table *obj, int col, int row) +{ + return elm_obj_table_child_get(obj, col, row); +} + +EAPI void +elm_table_unpack(Elm_Table *obj, Efl_Canvas_Object *subobj) +{ + elm_obj_table_unpack(obj, subobj); +} + +EAPI void +elm_table_pack(Elm_Table *obj, Efl_Canvas_Object *subobj, int column, int row, int colspan, int rowspan) +{ + elm_obj_table_pack(obj, subobj, column, row, colspan, rowspan); +} diff --git a/src/lib/elementary/elm_table_eo.legacy.h b/src/lib/elementary/elm_table_eo.legacy.h new file mode 100644 index 0000000000..507465310e --- /dev/null +++ b/src/lib/elementary/elm_table_eo.legacy.h @@ -0,0 +1,146 @@ +#ifndef _ELM_TABLE_EO_LEGACY_H_ +#define _ELM_TABLE_EO_LEGACY_H_ + +#ifndef _ELM_TABLE_EO_CLASS_TYPE +#define _ELM_TABLE_EO_CLASS_TYPE + +typedef Eo Elm_Table; + +#endif + +#ifndef _ELM_TABLE_EO_TYPES +#define _ELM_TABLE_EO_TYPES + + +#endif + +/** + * @brief Control the homogenous state in a table. + * + * @param[in] obj The object. + * @param[in] homogeneous A boolean to set if the layout is homogeneous in the + * table. + * + * @ingroup Elm_Table_Group + */ +EAPI void elm_table_homogeneous_set(Elm_Table *obj, Eina_Bool homogeneous); + +/** + * @brief Control the homogenous state in a table. + * + * @param[in] obj The object. + * + * @return A boolean to set if the layout is homogeneous in the table. + * + * @ingroup Elm_Table_Group + */ +EAPI Eina_Bool elm_table_homogeneous_get(const Elm_Table *obj); + +/** + * @brief Set padding between cells. Default value is 0. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal padding. + * @param[in] vertical The vertical padding. + * + * @ingroup Elm_Table_Group + */ +EAPI void elm_table_padding_set(Elm_Table *obj, int horizontal, int vertical); + +/** + * @brief Get padding between cells. + * + * @param[in] obj The object. + * @param[out] horizontal The horizontal padding. + * @param[out] vertical The vertical padding. + * + * @ingroup Elm_Table_Group + */ +EAPI void elm_table_padding_get(const Elm_Table *obj, int *horizontal, int *vertical); + +/** + * @brief Set alignment of table. Default value is 0.5. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal alignment. + * @param[in] vertical The vertical alignment. + * + * @since 1.13 + * + * @ingroup Elm_Table_Group + */ +EAPI void elm_table_align_set(Elm_Table *obj, double horizontal, double vertical); + +/** + * @brief Get alignment of table. + * + * @param[in] obj The object. + * @param[out] horizontal The horizontal alignment. + * @param[out] vertical The vertical alignment. + * + * @since 1.13 + * + * @ingroup Elm_Table_Group + */ +EAPI void elm_table_align_get(const Elm_Table *obj, double *horizontal, double *vertical); + +/** + * @brief Faster way to remove all child objects from a table object. + * + * @param[in] obj The object. + * @param[in] clear If @c true, will delete children, else just remove from + * table. + * + * @ingroup Elm_Table_Group + */ +EAPI void elm_table_clear(Elm_Table *obj, Eina_Bool clear); + +/** + * @brief Get child object of table at given coordinates. + * + * @param[in] obj The object. + * @param[in] col Column number of child object. + * @param[in] row Row number of child object. + * + * @return Child of object if find if not return @c null. + * + * @ingroup Elm_Table_Group + */ +EAPI Efl_Canvas_Object *elm_table_child_get(const Elm_Table *obj, int col, int row); + + + +/** + * @brief Remove child from table. + * + * @param[in] obj The object. + * @param[in] subobj The subobject. + * + * @ingroup Elm_Table_Group + */ +EAPI void elm_table_unpack(Elm_Table *obj, Efl_Canvas_Object *subobj); + +/** + * @brief Add a subobject on the table with the coordinates passed. + * + * @note All positioning inside the table is relative to rows and columns, so a + * value of 0 for x and y, means the top left cell of the table, and a value of + * 1 for w and h means @c subobj only takes that 1 cell. + * + * @note Columns and rows only guarantee 16bit unsigned values at best. That + * means that col + colspan AND row + rowspan must fit inside 16bit unsigned + * values cleanly. You will be warned once values exceed 15bit storage, and + * attempting to use values not able to fit in 16bits will result in failure. + * + * @param[in] obj The object. + * @param[in] subobj The subobject to be added to the table. + * @param[in] column Column number. + * @param[in] row Row number. + * @param[in] colspan Columns span. + * @param[in] rowspan Rows span. + * + * @ingroup Elm_Table_Group + */ +EAPI void elm_table_pack(Elm_Table *obj, Efl_Canvas_Object *subobj, int column, int row, int colspan, int rowspan); + +#endif diff --git a/src/lib/elementary/elm_table_legacy.h b/src/lib/elementary/elm_table_legacy.h index cf6aa5445f..314cf0ef39 100644 --- a/src/lib/elementary/elm_table_legacy.h +++ b/src/lib/elementary/elm_table_legacy.h @@ -42,4 +42,4 @@ EAPI void elm_table_pack_set(Evas_Object *subobj, int col, int row, int col */ EAPI void elm_table_pack_get(Evas_Object *subobj, int *col, int *row, int *colspan, int *rowspan); -#include "elm_table.eo.legacy.h" \ No newline at end of file +#include "elm_table_eo.legacy.h" \ No newline at end of file diff --git a/src/lib/elementary/elm_textpath.h b/src/lib/elementary/elm_textpath.h index 780f1fa222..064c865bf3 100644 --- a/src/lib/elementary/elm_textpath.h +++ b/src/lib/elementary/elm_textpath.h @@ -3,10 +3,6 @@ * @ingroup Elementary */ -#ifdef EFL_EO_API_SUPPORT -#include "efl_ui_textpath.eo.h" -#define EFL_UI_RADIO_EVENT_CHANGED EFL_UI_NSTATE_EVENT_CHANGED -#endif #ifndef EFL_NOLEGACY_API_SUPPORT #include "elm_textpath_legacy.h" #endif diff --git a/src/lib/elementary/elm_textpath_legacy.h b/src/lib/elementary/elm_textpath_legacy.h index b57dafff15..1795bdfa60 100644 --- a/src/lib/elementary/elm_textpath_legacy.h +++ b/src/lib/elementary/elm_textpath_legacy.h @@ -12,4 +12,4 @@ typedef Eo Elm_Textpath; */ EAPI Evas_Object *elm_textpath_add(Evas_Object *parent); -#include "efl_ui_textpath.eo.legacy.h" +#include "efl_ui_textpath_eo.legacy.h" diff --git a/src/lib/elementary/elm_theme.c b/src/lib/elementary/elm_theme.c index 9ddab3c991..538b6fa8e4 100644 --- a/src/lib/elementary/elm_theme.c +++ b/src/lib/elementary/elm_theme.c @@ -5,7 +5,7 @@ #include #include "elm_priv.h" -#include "elm_icon.eo.h" +#include "elm_icon_eo.h" #include "efl_ui_theme.eo.h" @@ -302,7 +302,7 @@ _elm_theme_data_find(Elm_Theme *th, const char *key) return NULL; } -Efl_Ui_Theme_Apply_Result +Eina_Error _elm_theme_object_set(Evas_Object *parent, Evas_Object *o, const char *clas, const char *group, const char *style) { Elm_Theme *th = NULL; @@ -323,7 +323,7 @@ _elm_theme_object_icon_set(Evas_Object *o, return _elm_theme_icon_set(th, o, group, style); } -Efl_Ui_Theme_Apply_Result +Eina_Error _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; @@ -331,9 +331,9 @@ _elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *grou const char *group_sep = "/"; const char *style_sep = ":"; - if ((!clas) || !o) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if ((!clas) || !o) return EFL_UI_THEME_APPLY_ERROR_GENERIC; if (!th) th = theme_default; - if (!th) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (!th) return EFL_UI_THEME_APPLY_ERROR_GENERIC; if (eina_streq(style, "default")) style = NULL; @@ -348,7 +348,7 @@ _elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *grou file = _elm_theme_group_file_find(th, buf2); if (file) { - if (edje_object_mmap_set(o, file, buf2)) return EFL_UI_THEME_APPLY_RESULT_SUCCESS; + if (edje_object_mmap_set(o, file, buf2)) return EFL_UI_THEME_APPLY_ERROR_NONE; else { ERR("could not set theme group '%s' from file '%s': %s", @@ -362,11 +362,12 @@ _elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *grou } if (!style) - return EFL_UI_THEME_APPLY_RESULT_FAIL; + return EFL_UI_THEME_APPLY_ERROR_GENERIC; // Use the elementary default style. - return (EFL_UI_THEME_APPLY_RESULT_DEFAULT & - _elm_theme_set(th, o, clas, group, NULL, is_legacy)); + if (_elm_theme_set(th, o, clas, group, NULL, is_legacy) == EFL_UI_THEME_APPLY_ERROR_NONE) + return EFL_UI_THEME_APPLY_ERROR_DEFAULT; + return EFL_UI_THEME_APPLY_ERROR_GENERIC; } Eina_Bool @@ -543,6 +544,7 @@ elm_theme_files_copy(Eina_Inlist **dst, Eina_Inlist **src) EINA_INLIST_FOREACH(*src, etf) { cpy = malloc(sizeof(Elm_Theme_File)); + EINA_SAFETY_ON_NULL_RETURN(cpy); cpy->item = eina_stringshare_ref(etf->item); cpy->handle = eina_file_dup(etf->handle); *dst = eina_inlist_append(*dst, EINA_INLIST_GET(cpy)); @@ -1121,7 +1123,7 @@ _efl_ui_theme_efl_object_destructor(Eo *obj, Efl_Ui_Theme_Data *pd) } EOLIAN static Efl_Ui_Theme * -_efl_ui_theme_default_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED) +_efl_ui_theme_default_get(void) { if (theme_default) return theme_default->eo_theme; diff --git a/src/lib/elementary/elm_theme.h b/src/lib/elementary/elm_theme.h index cb524b206a..7bf51d5b28 100644 --- a/src/lib/elementary/elm_theme.h +++ b/src/lib/elementary/elm_theme.h @@ -517,8 +517,7 @@ EAPI const char *elm_theme_data_get(Elm_Theme *th, const char *key); * string that is returned by functions like eina_stringshare_add() so it can * be just references via stringshare functions if desired. * - * If group is NULL, then nothing can be looked up, so it is a non-sensical - * request. + * If group is NULL, then nothing can be looked up. * * @since 1.8 * @ingroup Elm_Theme @@ -533,10 +532,10 @@ EAPI const char *elm_theme_group_path_find(Elm_Theme *th, const char *group); * @return A list of collection names (sorted) or NULL if none found * * This function will walk all theme files configured in the theme @p th (or - * NULL if its the default) and find all groups that BEGIN with the string + * NULL if it's the default) and find all groups that BEGIN with the string * @p begin and have that string as at LEAST their start, and then add the - * fulll group name that matches to the list and return that full group - * group string. + * full group name that matches to the list and return that full group + * string. * * The list returned must be freed by the caller, with each string being a * stringshared string to be freed with eina_stringshare_del(). Not doing so diff --git a/src/lib/elementary/elm_thumb.c b/src/lib/elementary/elm_thumb.c index 2671772726..67ac441d6f 100644 --- a/src/lib/elementary/elm_thumb.c +++ b/src/lib/elementary/elm_thumb.c @@ -7,7 +7,7 @@ #include #include "elm_priv.h" -#include "elm_thumb.eo.h" +#include "elm_thumb_eo.h" #include "elm_widget_thumb.h" #define MY_CLASS_NAME "Elm_Thumb" @@ -532,7 +532,6 @@ _elm_thumb_efl_canvas_group_group_add(Eo *obj, Elm_Thumb_Data *_pd EINA_UNUSED) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set(obj, "thumb", "base", elm_widget_style_get(obj))) CRI("Failed to set layout!"); @@ -581,6 +580,14 @@ elm_thumb_add(Evas_Object *parent) return elm_legacy_add(MY_CLASS, parent); } +EOLIAN static Eo * +_elm_thumb_efl_object_finalize(Eo *obj, Elm_Thumb_Data *sd) +{ + obj = efl_finalize(efl_super(obj, MY_CLASS)); + if (sd->file) efl_file_load(obj); + return obj; +} + EOLIAN static Eo * _elm_thumb_efl_object_constructor(Eo *obj, Elm_Thumb_Data *sd) { @@ -594,53 +601,71 @@ _elm_thumb_efl_object_constructor(Eo *obj, Elm_Thumb_Data *sd) return obj; } -EOLIAN static Eina_Bool -_elm_thumb_efl_file_file_set(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char *file, const char *key) +EOLIAN static Eina_Error +_elm_thumb_efl_file_file_set(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char *file) { - Eina_Bool file_replaced, key_replaced; + if (eina_stringshare_replace(&(sd->file), file)) + sd->loaded = EINA_FALSE; + return 0; +} - file_replaced = eina_stringshare_replace(&(sd->file), file); - key_replaced = eina_stringshare_replace(&(sd->key), key); +EOLIAN static void +_elm_thumb_efl_file_key_set(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char *key) +{ + if (eina_stringshare_replace(&(sd->key), key)) + sd->loaded = EINA_FALSE; +} - if (file_replaced) +EOLIAN static const char * +_elm_thumb_efl_file_file_get(const Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd) +{ + return sd->file; +} + +EOLIAN static const char * +_elm_thumb_efl_file_key_get(const Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd) +{ + return sd->key; +} + +EOLIAN static Eina_Bool +_elm_thumb_efl_file_loaded_get(const Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd) +{ + return sd->loaded; +} + +EOLIAN static Eina_Error +_elm_thumb_efl_file_load(Eo *obj, Elm_Thumb_Data *sd) +{ + int prefix_size; + const char **ext, *ptr; + static const char *extensions[] = + { + ".avi", ".mp4", ".ogv", ".mov", ".mpg", ".wmv", NULL + }; + + if (efl_file_loaded_get(obj)) return 0; + prefix_size = eina_stringshare_strlen(sd->file) - 4; + if (prefix_size >= 0) { - int prefix_size; - const char **ext, *ptr; - static const char *extensions[] = - { - ".avi", ".mp4", ".ogv", ".mov", ".mpg", ".wmv", NULL - }; - - prefix_size = eina_stringshare_strlen(sd->file) - 4; - if (prefix_size >= 0) - { - ptr = sd->file + prefix_size; - sd->is_video = EINA_FALSE; - for (ext = extensions; *ext; ext++) - if (!strcasecmp(ptr, *ext)) - { - sd->is_video = EINA_TRUE; - break; - } - } + ptr = sd->file + prefix_size; + sd->is_video = EINA_FALSE; + for (ext = extensions; *ext; ext++) + if (!strcasecmp(ptr, *ext)) + { + sd->is_video = EINA_TRUE; + break; + } } eina_stringshare_replace(&(sd->thumb.file), NULL); eina_stringshare_replace(&(sd->thumb.key), NULL); + sd->loaded = EINA_TRUE; - if (((file_replaced) || (key_replaced)) && (evas_object_visible_get(obj))) + if (evas_object_visible_get(obj)) _thumb_show(sd); - return EINA_TRUE; -} - -EOLIAN static void -_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; - if (key) - *key = sd->key; + return 0; } EAPI void * @@ -693,13 +718,13 @@ _elm_thumb_class_constructor(Efl_Class *klass) EAPI void elm_thumb_file_set(Eo *obj, const char *file, const char *key) { - efl_file_set((Eo *) obj, file, key); + efl_file_simple_load((Eo *) obj, file, key); } EAPI void elm_thumb_file_get(const Eo *obj, const char **file, const char **key) { - efl_file_get((Eo *) obj, file, key); + efl_file_simple_get((Eo *) obj, file, key); } /* Legacy deprecated functions */ @@ -910,4 +935,4 @@ elm_thumb_reload(Evas_Object *obj) #define ELM_THUMB_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_thumb) -#include "elm_thumb.eo.c" +#include "elm_thumb_eo.c" diff --git a/src/lib/elementary/elm_thumb.eo b/src/lib/elementary/elm_thumb.eo deleted file mode 100644 index 94e911e736..0000000000 --- a/src/lib/elementary/elm_thumb.eo +++ /dev/null @@ -1,22 +0,0 @@ -class Elm.Thumb extends Efl.Ui.Layout implements Efl.File, Efl.Ui.Clickable, - Efl.Ui.Draggable, Efl.Ui.Legacy -{ - [[Elementary thumbnail class]] - legacy_prefix: elm_thumb; - eo_prefix: elm_obj_thumb; - event_prefix: elm_thumb; - implements { - class.constructor; - Efl.Object.constructor; - Efl.File.file { get; set; } - Efl.Gfx.Entity.visible { set; } - Efl.Ui.Draggable.drag_target { get; set; } - } - events { - 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_thumb_eo.c b/src/lib/elementary/elm_thumb_eo.c new file mode 100644 index 0000000000..d65f2ee700 --- /dev/null +++ b/src/lib/elementary/elm_thumb_eo.c @@ -0,0 +1,85 @@ +EWAPI const Efl_Event_Description _ELM_THUMB_EVENT_GENERATE_ERROR = + EFL_EVENT_DESCRIPTION("generate,error"); +EWAPI const Efl_Event_Description _ELM_THUMB_EVENT_GENERATE_START = + EFL_EVENT_DESCRIPTION("generate,start"); +EWAPI const Efl_Event_Description _ELM_THUMB_EVENT_GENERATE_STOP = + EFL_EVENT_DESCRIPTION("generate,stop"); +EWAPI const Efl_Event_Description _ELM_THUMB_EVENT_LOAD_ERROR = + EFL_EVENT_DESCRIPTION("load,error"); +EWAPI const Efl_Event_Description _ELM_THUMB_EVENT_PRESS = + EFL_EVENT_DESCRIPTION("press"); + +Efl_Object *_elm_thumb_efl_object_constructor(Eo *obj, Elm_Thumb_Data *pd); + + +Efl_Object *_elm_thumb_efl_object_finalize(Eo *obj, Elm_Thumb_Data *pd); + + +Eina_Error _elm_thumb_efl_file_load(Eo *obj, Elm_Thumb_Data *pd); + + +Eina_Bool _elm_thumb_efl_file_loaded_get(const Eo *obj, Elm_Thumb_Data *pd); + + +Eina_Error _elm_thumb_efl_file_file_set(Eo *obj, Elm_Thumb_Data *pd, const char *file); + + +const char *_elm_thumb_efl_file_file_get(const Eo *obj, Elm_Thumb_Data *pd); + + +void _elm_thumb_efl_file_key_set(Eo *obj, Elm_Thumb_Data *pd, const char *key); + + +const char *_elm_thumb_efl_file_key_get(const Eo *obj, Elm_Thumb_Data *pd); + + +void _elm_thumb_efl_gfx_entity_visible_set(Eo *obj, Elm_Thumb_Data *pd, Eina_Bool v); + + +void _elm_thumb_efl_ui_draggable_drag_target_set(Eo *obj, Elm_Thumb_Data *pd, Eina_Bool set); + + +Eina_Bool _elm_thumb_efl_ui_draggable_drag_target_get(const Eo *obj, Elm_Thumb_Data *pd); + + +static Eina_Bool +_elm_thumb_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_THUMB_EXTRA_OPS +#define ELM_THUMB_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_thumb_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_finalize, _elm_thumb_efl_object_finalize), + EFL_OBJECT_OP_FUNC(efl_file_load, _elm_thumb_efl_file_load), + EFL_OBJECT_OP_FUNC(efl_file_loaded_get, _elm_thumb_efl_file_loaded_get), + EFL_OBJECT_OP_FUNC(efl_file_set, _elm_thumb_efl_file_file_set), + EFL_OBJECT_OP_FUNC(efl_file_get, _elm_thumb_efl_file_file_get), + EFL_OBJECT_OP_FUNC(efl_file_key_set, _elm_thumb_efl_file_key_set), + EFL_OBJECT_OP_FUNC(efl_file_key_get, _elm_thumb_efl_file_key_get), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_thumb_efl_gfx_entity_visible_set), + EFL_OBJECT_OP_FUNC(efl_ui_draggable_drag_target_set, _elm_thumb_efl_ui_draggable_drag_target_set), + EFL_OBJECT_OP_FUNC(efl_ui_draggable_drag_target_get, _elm_thumb_efl_ui_draggable_drag_target_get), + ELM_THUMB_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_thumb_class_desc = { + EO_VERSION, + "Elm.Thumb", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Thumb_Data), + _elm_thumb_class_initializer, + _elm_thumb_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_thumb_class_get, &_elm_thumb_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_FILE_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_DRAGGABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_thumb_eo.h b/src/lib/elementary/elm_thumb_eo.h new file mode 100644 index 0000000000..09eed0a0ba --- /dev/null +++ b/src/lib/elementary/elm_thumb_eo.h @@ -0,0 +1,64 @@ +#ifndef _ELM_THUMB_EO_H_ +#define _ELM_THUMB_EO_H_ + +#ifndef _ELM_THUMB_EO_CLASS_TYPE +#define _ELM_THUMB_EO_CLASS_TYPE + +typedef Eo Elm_Thumb; + +#endif + +#ifndef _ELM_THUMB_EO_TYPES +#define _ELM_THUMB_EO_TYPES + + +#endif +/** Elementary thumbnail class + * + * @ingroup Elm_Thumb + */ +#define ELM_THUMB_CLASS elm_thumb_class_get() + +EWAPI const Efl_Class *elm_thumb_class_get(void); + +EWAPI extern const Efl_Event_Description _ELM_THUMB_EVENT_GENERATE_ERROR; + +/** Called when an error occurred during thumbnail generation + * + * @ingroup Elm_Thumb + */ +#define ELM_THUMB_EVENT_GENERATE_ERROR (&(_ELM_THUMB_EVENT_GENERATE_ERROR)) + +EWAPI extern const Efl_Event_Description _ELM_THUMB_EVENT_GENERATE_START; + +/** Called when thumbnail generation started + * + * @ingroup Elm_Thumb + */ +#define ELM_THUMB_EVENT_GENERATE_START (&(_ELM_THUMB_EVENT_GENERATE_START)) + +EWAPI extern const Efl_Event_Description _ELM_THUMB_EVENT_GENERATE_STOP; + +/** Called when thumbnail generation stopped + * + * @ingroup Elm_Thumb + */ +#define ELM_THUMB_EVENT_GENERATE_STOP (&(_ELM_THUMB_EVENT_GENERATE_STOP)) + +EWAPI extern const Efl_Event_Description _ELM_THUMB_EVENT_LOAD_ERROR; + +/** Called when an error occurred during loading + * + * @ingroup Elm_Thumb + */ +#define ELM_THUMB_EVENT_LOAD_ERROR (&(_ELM_THUMB_EVENT_LOAD_ERROR)) + +EWAPI extern const Efl_Event_Description _ELM_THUMB_EVENT_PRESS; + +/** Called when pressed + * + * @ingroup Elm_Thumb + */ +#define ELM_THUMB_EVENT_PRESS (&(_ELM_THUMB_EVENT_PRESS)) + +#endif diff --git a/src/lib/elementary/elm_thumb_eo.legacy.h b/src/lib/elementary/elm_thumb_eo.legacy.h new file mode 100644 index 0000000000..cde5938537 --- /dev/null +++ b/src/lib/elementary/elm_thumb_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_THUMB_EO_LEGACY_H_ +#define _ELM_THUMB_EO_LEGACY_H_ + +#ifndef _ELM_THUMB_EO_CLASS_TYPE +#define _ELM_THUMB_EO_CLASS_TYPE + +typedef Eo Elm_Thumb; + +#endif + +#ifndef _ELM_THUMB_EO_TYPES +#define _ELM_THUMB_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_thumb_legacy.h b/src/lib/elementary/elm_thumb_legacy.h index b37e395658..48fcc1a262 100644 --- a/src/lib/elementary/elm_thumb_legacy.h +++ b/src/lib/elementary/elm_thumb_legacy.h @@ -314,4 +314,4 @@ EAPI void elm_thumb_path_get(const Evas_Object *obj, const char **file, const ch */ EAPI void elm_thumb_reload(Evas_Object *obj); -#include "elm_thumb.eo.legacy.h" +#include "elm_thumb_eo.legacy.h" diff --git a/src/lib/elementary/elm_toolbar.c b/src/lib/elementary/elm_toolbar.c index 8d6caf9c6c..0efcacb8c0 100644 --- a/src/lib/elementary/elm_toolbar.c +++ b/src/lib/elementary/elm_toolbar.c @@ -15,6 +15,7 @@ #include "elm_priv.h" #include "elm_widget_toolbar.h" #include "els_box.h" +#include "elm_pan_eo.h" #define MY_CLASS ELM_TOOLBAR_CLASS @@ -155,7 +156,7 @@ _items_visibility_fix(Elm_Toolbar *obj, } } efl_ui_focus_composition_dirty(obj); - efl_ui_focus_object_prepare_logical(obj); + efl_ui_focus_object_setup_order(obj); } static void @@ -177,9 +178,9 @@ _item_unselect(Elm_Toolbar_Item_Data *item) elm_layout_signal_emit(VIEW(item), "elm,state,unselected", "elm"); if (item->icon) elm_widget_signal_emit(item->icon, "elm,state,unselected", "elm"); - efl_event_callback_legacy_call(WIDGET(item), EFL_UI_EVENT_UNSELECTED, EO_OBJ(item)); + evas_object_smart_callback_call(WIDGET(item), "unselected", EO_OBJ(item)); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(EO_OBJ(item), EFL_ACCESS_STATE_SELECTED, EINA_FALSE); + efl_access_state_changed_signal_emit(EO_OBJ(item), EFL_ACCESS_STATE_TYPE_SELECTED, EINA_FALSE); } static void @@ -621,6 +622,7 @@ _elm_toolbar_item_focused(Elm_Object_Item *eo_it) { ELM_TOOLBAR_ITEM_DATA_GET(eo_it, it); Evas_Object *obj = WIDGET(it); + Evas_Object *win = elm_widget_top_get(obj); ELM_TOOLBAR_DATA_GET(obj, sd); const char *focus_raise; @@ -643,7 +645,7 @@ _elm_toolbar_item_focused(Elm_Object_Item *eo_it) break; } - if (elm_widget_focus_highlight_enabled_get(obj)) + if (elm_win_focus_highlight_enabled_get(win)) { elm_layout_signal_emit (VIEW(it), "elm,state,focused", "elm"); @@ -656,7 +658,7 @@ _elm_toolbar_item_focused(Elm_Object_Item *eo_it) efl_event_callback_legacy_call (obj, ELM_TOOLBAR_EVENT_ITEM_FOCUSED, EO_OBJ(it)); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(EO_OBJ(it), EFL_ACCESS_STATE_FOCUSED, EINA_TRUE); + efl_access_state_changed_signal_emit(EO_OBJ(it), EFL_ACCESS_STATE_TYPE_FOCUSED, EINA_TRUE); } static void @@ -664,6 +666,7 @@ _elm_toolbar_item_unfocused(Elm_Object_Item *eo_it) { ELM_TOOLBAR_ITEM_DATA_GET(eo_it, it); Evas_Object *obj = WIDGET(it); + Evas_Object *win = elm_widget_top_get(obj); ELM_TOOLBAR_DATA_GET(obj, sd); if ((!sd) || !sd->focused_item || @@ -671,7 +674,7 @@ _elm_toolbar_item_unfocused(Elm_Object_Item *eo_it) return; if (sd->select_mode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) return; - if (elm_widget_focus_highlight_enabled_get(obj)) + if (elm_win_focus_highlight_enabled_get(win)) { ELM_TOOLBAR_ITEM_DATA_GET(sd->focused_item, focus_it); elm_layout_signal_emit @@ -683,7 +686,7 @@ _elm_toolbar_item_unfocused(Elm_Object_Item *eo_it) efl_event_callback_legacy_call (obj, ELM_TOOLBAR_EVENT_ITEM_UNFOCUSED, eo_it); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_FOCUSED, EINA_TRUE); + efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_TYPE_FOCUSED, EINA_TRUE); } /* @@ -1091,9 +1094,9 @@ _item_select(Elm_Toolbar_Item_Data *it) { if (it->func) it->func((void *)(WIDGET_ITEM_DATA_GET(EO_OBJ(it))), WIDGET(it), EO_OBJ(it)); } - efl_event_callback_legacy_call(obj, EFL_UI_EVENT_SELECTED, EO_OBJ(it)); + evas_object_smart_callback_call(obj, "selected", EO_OBJ(it)); if (_elm_config->atspi_mode) - efl_access_state_changed_signal_emit(EO_OBJ(it), EFL_ACCESS_STATE_SELECTED, EINA_TRUE); + efl_access_state_changed_signal_emit(EO_OBJ(it), EFL_ACCESS_STATE_TYPE_SELECTED, EINA_TRUE); } /* Send order signals when item is added/deleted. @@ -1478,18 +1481,18 @@ _elm_toolbar_highlight_in_theme(Evas_Object *obj) elm_widget_highlight_in_theme_set(obj, EINA_FALSE); } -EOLIAN static Efl_Ui_Theme_Apply_Result +EOLIAN static Eina_Error _elm_toolbar_efl_ui_widget_theme_apply(Eo *obj, Elm_Toolbar_Data *sd) { Elm_Toolbar_Item_Data *it; double scale = 0; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC); - if (sd->delete_me) return EFL_UI_THEME_APPLY_RESULT_SUCCESS; + if (sd->delete_me) return EFL_UI_THEME_APPLY_ERROR_NONE; - Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; + Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; + if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; elm_widget_theme_object_set (obj, wd->resize_obj, "toolbar", "base", @@ -2737,8 +2740,6 @@ _elm_toolbar_efl_canvas_group_group_add(Eo *obj, Elm_Toolbar_Data *priv) { Evas_Object *edje; - elm_widget_sub_object_parent_add(obj); - edje = edje_object_add(evas_object_evas_get(obj)); elm_widget_resize_object_set(obj, edje); @@ -2986,8 +2987,6 @@ _elm_toolbar_efl_object_constructor(Eo *obj, Elm_Toolbar_Data *_pd EINA_UNUSED) evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_TOOL_BAR); - efl_ui_focus_composition_custom_manager_set(obj, obj); - return obj; } @@ -3864,16 +3863,16 @@ _elm_toolbar_item_efl_access_object_state_set_get(const Eo *eo_it, Elm_Toolbar_I sel = elm_toolbar_item_selected_get(eo_it); - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_SELECTABLE); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_SELECTABLE); if (sel) - STATE_TYPE_SET(ret, EFL_ACCESS_STATE_SELECTED); + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_SELECTED); return ret; } EOLIAN static Elm_Object_Item * -_elm_toolbar_efl_ui_widget_focused_item_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd) +_elm_toolbar_elm_widget_item_container_focused_item_get(const Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd) { return sd->focused_item; } @@ -4087,5 +4086,5 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_toolbar, Elm_Toolbar_Data) #define ELM_TOOLBAR_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_toolbar) -#include "elm_toolbar.eo.c" -#include "elm_toolbar_item.eo.c" +#include "elm_toolbar_eo.c" +#include "elm_toolbar_item_eo.c" diff --git a/src/lib/elementary/elm_toolbar.eo b/src/lib/elementary/elm_toolbar.eo deleted file mode 100644 index e70dafc6e4..0000000000 --- a/src/lib/elementary/elm_toolbar.eo +++ /dev/null @@ -1,379 +0,0 @@ -import elm_general; - -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. - - Default value is #ELM_TOOLBAR_SHRINK_MENU. It reads value - from elm config. - - Values don't work as bitmask, only one can be chosen. - - See also @Elm.Toolbar.shrink_mode.set, @Elm.Toolbar.shrink_mode.get. - ]] - - legacy: elm_toolbar_shrink; - - none, [[Set toolbar minimum size to fit all the items.]] - hide, [[Hide exceeding items.]] - scroll, [[Allow accessing exceeding items through a scroller.]] - menu, [[Inserts a button to pop up a menu with exceeding items.]] - expand, [[Expand all items according the size of the toolbar.]] - last [[Indicates error if returned by elm_toolbar_shrink_mode_get()]] -} - -class Elm.Toolbar extends Efl.Ui.Widget implements 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 @owned @warn_unused; [[iterator to widget items]] - } - } - @property homogeneous { - [[Control homogeneous mode. - - This will enable the homogeneous mode where items are of the same size.]] - set { - } - get { - } - values { - homogeneous: bool; [[Assume the items within the toolbar are of the same size (true = on, false = off). Default is $false.]] - } - } - @property align { - [[Control the alignment of the items. - - Alignment of toolbar items, from 0.0 to indicates to align - left, to 1.0, to align to right. 0.5 centralize - items. - - Centered items by default.]] - set { - } - get { - } - values { - align: double; [[The new alignment, a float between 0.0 and 1.0.]] - } - } - @property select_mode { - [[Control the toolbar select mode. - - elm_toolbar_select_mode_set() changes item select mode in the toolbar widget. - - #ELM_OBJECT_SELECT_MODE_DEFAULT : Items will only call their selection func and - callback when first becoming selected. Any further clicks will - do nothing, unless you set always select mode. - - #ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected, - every click will make the selected callbacks be called. - - #ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select items - entirely and they will neither appear selected nor call selected - callback functions.]] - set { - } - get { - } - values { - mode: Elm.Object.Select_Mode(Elm.Object.Select_Mode.max); [[The select mode If getting mode fails, it returns #ELM_OBJECT_SELECT_MODE_MAX]] - } - } - @property icon_size { - [[Control the icon size, in pixels, to be used by toolbar items. - - Note: Default value is $32. It reads value from elm config.]] - set { - } - get { - } - values { - icon_size: int; [[The icon size in pixels]] - } - } - @property shrink_mode { - [[Control the item displaying mode of a given toolbar widget $obj. - - The toolbar won't scroll under #ELM_TOOLBAR_SHRINK_NONE mode, but - it will enforce a minimum size, so that all the items will fit - inside it. It won't scroll and won't show the items that don't fit - under #ELM_TOOLBAR_SHRINK_HIDE mode. Finally, it'll scroll under - #ELM_TOOLBAR_SHRINK_SCROLL mode, and it will create a button to - aggregate items which didn't fit with the #ELM_TOOLBAR_SHRINK_MENU - mode. - - If shrink mode is changed, Toolbar will send one of the following - signal to each item for informing the current shrink mode. - "elm,state,shrink,default" - "elm,state,shrink,hide" - "elm,state,shrink,scroll" - "elm,state,shrink,menu" - "elm,state,shrink,expand" - - Warning: This function's behavior will clash with those of - elm_scroller_policy_set(), so use either one of them, but not both.]] - set { - } - get { - } - values { - shrink_mode: Elm.Toolbar_Shrink_Mode; [[Toolbar's items display behavior]] - } - } - @property menu_parent { - [[Control the parent object of the toolbar items' menus. - - Each item can be set as item menu, with elm_toolbar_item_menu_set(). - - For more details about setting the parent for toolbar menus, see - elm_menu_parent_set(). - - See: elm_menu_parent_set() for details. - See: elm_toolbar_item_menu_set() for details.]] - set { - } - get { - } - values { - parent: Efl.Canvas.Object; [[The parent of the menu objects.]] - } - } - @property standard_priority { - [[Set the standard priority of visible items in a toolbar - - If the priority of the item is up to standard priority, it is shown in basic panel. - The other items are located in more menu or panel. The more menu or panel can be shown when the more item is clicked. - - @since 1.7]] - set { - } - get { - } - values { - priority: int; [[The standard_priority of visible items]] - } - } - @property more_item { - get { - [[Get the more item which is auto-generated by toolbar. - - Toolbar generates 'more' item when there is no more space to fit items in - and toolbar is in #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_EXPAND mode. - The more item can be manipulated by elm_object_item_text_set() and - elm_object_item_content_set.]] - - return: Elm.Widget.Item; [[The toolbar more item.]] - } - } - item_insert_before { - [[Insert a new item into the toolbar object before item $before. - - A new item will be created and added to the toolbar. Its position in - this toolbar will be just before item $before. - - Items created with this method can be deleted with - elm_object_item_del(). - - Associated $data can be properly freed when item is deleted if a - callback function is set with elm_object_item_del_cb_set(). - - If a function is passed as argument, it will be called every time this item - is selected, i.e., the user clicks over an unselected item. - If such function isn't needed, just passing - $NULL as $func is enough. The same should be done for $data. - - Toolbar will load icon image from fdo or current theme. - This behavior can be set by elm_toolbar_icon_order_lookup_set() function. - If an absolute path is provided it will load it direct from a file. - - Note: This function does not accept relative icon path. - - See: elm_toolbar_item_icon_set()]] - - return: Elm.Widget.Item; [[The created item or $NULL upon failure.]] - params { - @in before: Elm.Widget.Item; [[The toolbar item to insert before.]] - @in icon: string @optional; [[A string with icon name or the absolute path of an image file.]] - @in label: string; [[The label of the item.]] - @in func: Evas_Smart_Cb @optional; [[The function to call when the item is clicked.]] - @in data: const(void_ptr) @optional; [[The data to associate with the item for related callbacks.]] - } - } - item_insert_after { - [[Insert a new item into the toolbar object after item $after. - - A new item will be created and added to the toolbar. Its position in - this toolbar will be just after item $after. - - Items created with this method can be deleted with - elm_object_item_del(). - - Associated $data can be properly freed when item is deleted if a - callback function is set with elm_object_item_del_cb_set(). - - If a function is passed as argument, it will be called every time this item - is selected, i.e., the user clicks over an unselected item. - If such function isn't needed, just passing - $NULL as $func is enough. The same should be done for $data. - - Toolbar will load icon image from fdo or current theme. - This behavior can be set by elm_toolbar_icon_order_lookup_set() function. - If an absolute path is provided it will load it direct from a file. - - Note: This function does not accept relative icon path. - - See: elm_toolbar_item_icon_set()]] - - return: Elm.Widget.Item; [[The created item or $NULL upon failure.]] - params { - @in after: Elm.Widget.Item; [[The toolbar item to insert after.]] - @in icon: string @optional; [[A string with icon name or the absolute path of an image file.]] - @in label: string; [[The label of the item.]] - @in func: Evas_Smart_Cb @optional; [[The function to call when the item is clicked.]] - @in data: const(void_ptr) @optional; [[The data to associate with the item for related callbacks.]] - } - } - item_append { - [[Append item to the toolbar. - - A new item will be created and appended to the toolbar, i.e., will - be set as last item. - - Items created with this method can be deleted with - elm_object_item_del(). - - Associated $data can be properly freed when item is deleted if a - callback function is set with elm_object_item_del_cb_set(). - - If a function is passed as argument, it will be called every time this item - is selected, i.e., the user clicks over an unselected item. - If such function isn't needed, just passing - $NULL as $func is enough. The same should be done for $data. - - Toolbar will load icon image from fdo or current theme. - This behavior can be set by elm_toolbar_icon_order_lookup_set() function. - If an absolute path is provided it will load it direct from a file. - - Note: This function does not accept relative icon path. - - See: elm_toolbar_item_icon_set()]] - - return: Elm.Widget.Item; [[The created item or $NULL upon failure.]] - params { - @in icon: string @optional; [[A string with icon name or the absolute path of an image file.]] - @in label: string; [[The label of the item.]] - @in func: Evas_Smart_Cb @optional; [[The function to call when the item is clicked.]] - @in data: const(void_ptr) @optional; [[The data to associate with the item for related callbacks.]] - } - } - items_count @const { - [[Get the number of items in a toolbar]] - return: uint; [[The number of items in $obj toolbar]] - } - item_prepend { - [[Prepend item to the toolbar. - - A new item will be created and prepended to the toolbar, i.e., will - be set as first item. - - Items created with this method can be deleted with - elm_object_item_del(). - - Associated $data can be properly freed when item is deleted if a - callback function is set with elm_object_item_del_cb_set(). - - If a function is passed as argument, it will be called every time this item - is selected, i.e., the user clicks over an unselected item. - If such function isn't needed, just passing - $NULL as $func is enough. The same should be done for $data. - - Toolbar will load icon image from fdo or current theme. - This behavior can be set by elm_toolbar_icon_order_lookup_set() function. - If an absolute path is provided it will load it direct from a file. - - Note: This function does not accept relative icon path. - - See: elm_toolbar_item_icon_set()]] - - return: Elm.Widget.Item; [[The created item or $NULL upon failure.]] - params { - @in icon: string @optional; [[A string with icon name or the absolute path of an image file.]] - @in label: string; [[The label of the item.]] - @in func: Evas_Smart_Cb @optional; [[The function to call when the item is clicked.]] - @in data: const(void_ptr) @optional; [[The data to associate with the item for related callbacks.]] - } - } - item_find_by_label @const { - [[Returns a pointer to a toolbar item by its label.]] - - return: Elm.Widget.Item; [[The pointer to the toolbar item matching $label or $NULL on failure.]] - params { - @in label: string; [[The label of the item to find.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Gfx.Entity.position { set; } - Efl.Gfx.Entity.size { set; } - Efl.Canvas.Group.group_calculate; - Efl.Canvas.Group.group_member_add; - Efl.Ui.Widget.on_access_update; - Efl.Ui.Widget.theme_apply; - Efl.Ui.Focus.Object.on_focus_update; - Efl.Ui.L10n.translation_update; - 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.]] } - Efl.Ui.Widget.focus_state_apply; - Efl.Access.Widget.Action.elm_actions { 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; - 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; - Efl.Ui.Focus.Composition.prepare; - } - events { - 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.h b/src/lib/elementary/elm_toolbar.h index ef237c47a5..5dcfaa838f 100644 --- a/src/lib/elementary/elm_toolbar.h +++ b/src/lib/elementary/elm_toolbar.h @@ -69,9 +69,6 @@ */ #include -#ifdef EFL_EO_API_SUPPORT -#include -#endif #ifndef EFL_NOLEGACY_API_SUPPORT #include #endif diff --git a/src/lib/elementary/elm_toolbar_eo.c b/src/lib/elementary/elm_toolbar_eo.c new file mode 100644 index 0000000000..0589b9aa71 --- /dev/null +++ b/src/lib/elementary/elm_toolbar_eo.c @@ -0,0 +1,377 @@ +EWAPI const Efl_Event_Description _ELM_TOOLBAR_EVENT_ITEM_FOCUSED = + EFL_EVENT_DESCRIPTION("item,focused"); +EWAPI const Efl_Event_Description _ELM_TOOLBAR_EVENT_ITEM_UNFOCUSED = + EFL_EVENT_DESCRIPTION("item,unfocused"); + +Elm_Widget_Item *_elm_toolbar_selected_item_get(const Eo *obj, Elm_Toolbar_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_selected_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_toolbar_first_item_get(const Eo *obj, Elm_Toolbar_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_first_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_toolbar_last_item_get(const Eo *obj, Elm_Toolbar_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_last_item_get, Elm_Widget_Item *, NULL); + +Eina_Iterator *_elm_toolbar_items_get(const Eo *obj, Elm_Toolbar_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_items_get, Eina_Iterator *, NULL); + +void _elm_toolbar_homogeneous_set(Eo *obj, Elm_Toolbar_Data *pd, Eina_Bool homogeneous); + + +static Eina_Error +__eolian_elm_toolbar_homogeneous_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_toolbar_homogeneous_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_toolbar_homogeneous_set, EFL_FUNC_CALL(homogeneous), Eina_Bool homogeneous); + +Eina_Bool _elm_toolbar_homogeneous_get(const Eo *obj, Elm_Toolbar_Data *pd); + + +static Eina_Value +__eolian_elm_toolbar_homogeneous_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_toolbar_homogeneous_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_homogeneous_get, Eina_Bool, 0); + +void _elm_toolbar_align_set(Eo *obj, Elm_Toolbar_Data *pd, double align); + + +static Eina_Error +__eolian_elm_toolbar_align_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_toolbar_align_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_toolbar_align_set, EFL_FUNC_CALL(align), double align); + +double _elm_toolbar_align_get(const Eo *obj, Elm_Toolbar_Data *pd); + + +static Eina_Value +__eolian_elm_toolbar_align_get_reflect(const Eo *obj) +{ + double val = elm_obj_toolbar_align_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_align_get, double, 0); + +void _elm_toolbar_select_mode_set(Eo *obj, Elm_Toolbar_Data *pd, Elm_Object_Select_Mode mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_toolbar_select_mode_set, EFL_FUNC_CALL(mode), Elm_Object_Select_Mode mode); + +Elm_Object_Select_Mode _elm_toolbar_select_mode_get(const Eo *obj, Elm_Toolbar_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_select_mode_get, Elm_Object_Select_Mode, 4 /* Elm.Object.Select_Mode.max */); + +void _elm_toolbar_icon_size_set(Eo *obj, Elm_Toolbar_Data *pd, int icon_size); + + +static Eina_Error +__eolian_elm_toolbar_icon_size_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_toolbar_icon_size_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_toolbar_icon_size_set, EFL_FUNC_CALL(icon_size), int icon_size); + +int _elm_toolbar_icon_size_get(const Eo *obj, Elm_Toolbar_Data *pd); + + +static Eina_Value +__eolian_elm_toolbar_icon_size_get_reflect(const Eo *obj) +{ + int val = elm_obj_toolbar_icon_size_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_icon_size_get, int, 0); + +void _elm_toolbar_shrink_mode_set(Eo *obj, Elm_Toolbar_Data *pd, Elm_Toolbar_Shrink_Mode shrink_mode); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_toolbar_shrink_mode_set, EFL_FUNC_CALL(shrink_mode), Elm_Toolbar_Shrink_Mode shrink_mode); + +Elm_Toolbar_Shrink_Mode _elm_toolbar_shrink_mode_get(const Eo *obj, Elm_Toolbar_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_shrink_mode_get, Elm_Toolbar_Shrink_Mode, 0); + +void _elm_toolbar_menu_parent_set(Eo *obj, Elm_Toolbar_Data *pd, Efl_Canvas_Object *parent); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_toolbar_menu_parent_set, EFL_FUNC_CALL(parent), Efl_Canvas_Object *parent); + +Efl_Canvas_Object *_elm_toolbar_menu_parent_get(const Eo *obj, Elm_Toolbar_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_menu_parent_get, Efl_Canvas_Object *, NULL); + +void _elm_toolbar_standard_priority_set(Eo *obj, Elm_Toolbar_Data *pd, int priority); + + +static Eina_Error +__eolian_elm_toolbar_standard_priority_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_toolbar_standard_priority_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_toolbar_standard_priority_set, EFL_FUNC_CALL(priority), int priority); + +int _elm_toolbar_standard_priority_get(const Eo *obj, Elm_Toolbar_Data *pd); + + +static Eina_Value +__eolian_elm_toolbar_standard_priority_get_reflect(const Eo *obj) +{ + int val = elm_obj_toolbar_standard_priority_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_standard_priority_get, int, 0); + +Elm_Widget_Item *_elm_toolbar_more_item_get(const Eo *obj, Elm_Toolbar_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_more_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_toolbar_item_insert_before(Eo *obj, Elm_Toolbar_Data *pd, Elm_Widget_Item *before, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_toolbar_item_insert_before, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(before, icon, label, func, data), Elm_Widget_Item *before, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +Elm_Widget_Item *_elm_toolbar_item_insert_after(Eo *obj, Elm_Toolbar_Data *pd, Elm_Widget_Item *after, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_toolbar_item_insert_after, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(after, icon, label, func, data), Elm_Widget_Item *after, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +Elm_Widget_Item *_elm_toolbar_item_append(Eo *obj, Elm_Toolbar_Data *pd, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_toolbar_item_append, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(icon, label, func, data), const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +unsigned int _elm_toolbar_items_count(const Eo *obj, Elm_Toolbar_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_items_count, unsigned int, 0); + +Elm_Widget_Item *_elm_toolbar_item_prepend(Eo *obj, Elm_Toolbar_Data *pd, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_toolbar_item_prepend, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(icon, label, func, data), const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +Elm_Widget_Item *_elm_toolbar_item_find_by_label(const Eo *obj, Elm_Toolbar_Data *pd, const char *label); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_toolbar_item_find_by_label, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(label), const char *label); + +Efl_Object *_elm_toolbar_efl_object_constructor(Eo *obj, Elm_Toolbar_Data *pd); + + +void _elm_toolbar_efl_gfx_entity_position_set(Eo *obj, Elm_Toolbar_Data *pd, Eina_Position2D pos); + + +void _elm_toolbar_efl_gfx_entity_size_set(Eo *obj, Elm_Toolbar_Data *pd, Eina_Size2D size); + + +void _elm_toolbar_efl_canvas_group_group_calculate(Eo *obj, Elm_Toolbar_Data *pd); + + +void _elm_toolbar_efl_canvas_group_group_member_add(Eo *obj, Elm_Toolbar_Data *pd, Efl_Canvas_Object *sub_obj); + + +void _elm_toolbar_efl_ui_widget_on_access_update(Eo *obj, Elm_Toolbar_Data *pd, Eina_Bool enable); + + +Eina_Error _elm_toolbar_efl_ui_widget_theme_apply(Eo *obj, Elm_Toolbar_Data *pd); + + +Eina_Bool _elm_toolbar_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Toolbar_Data *pd); + + +void _elm_toolbar_efl_ui_l10n_translation_update(Eo *obj, Elm_Toolbar_Data *pd); + + +Eina_Bool _elm_toolbar_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Toolbar_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +Eina_Rect _elm_toolbar_efl_ui_widget_focus_highlight_geometry_get(const Eo *obj, Elm_Toolbar_Data *pd); + + +Elm_Widget_Item *_elm_toolbar_elm_widget_item_container_focused_item_get(const Eo *obj, Elm_Toolbar_Data *pd); + + +void _elm_toolbar_efl_ui_direction_direction_set(Eo *obj, Elm_Toolbar_Data *pd, Efl_Ui_Dir dir); + + +Efl_Ui_Dir _elm_toolbar_efl_ui_direction_direction_get(const Eo *obj, Elm_Toolbar_Data *pd); + + +Eina_Bool _elm_toolbar_efl_ui_widget_focus_state_apply(Eo *obj, Elm_Toolbar_Data *pd, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect); + + +const Efl_Access_Action_Data *_elm_toolbar_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Toolbar_Data *pd); + + +Eina_List *_elm_toolbar_efl_access_object_access_children_get(const Eo *obj, Elm_Toolbar_Data *pd); + + +Efl_Access_State_Set _elm_toolbar_efl_access_object_state_set_get(const Eo *obj, Elm_Toolbar_Data *pd); + + +int _elm_toolbar_efl_access_selection_selected_children_count_get(const Eo *obj, Elm_Toolbar_Data *pd); + + +Efl_Object *_elm_toolbar_efl_access_selection_selected_child_get(const Eo *obj, Elm_Toolbar_Data *pd, int selected_child_index); + + +Eina_Bool _elm_toolbar_efl_access_selection_selected_child_deselect(Eo *obj, Elm_Toolbar_Data *pd, int child_index); + + +Eina_Bool _elm_toolbar_efl_access_selection_child_select(Eo *obj, Elm_Toolbar_Data *pd, int child_index); + + +Eina_Bool _elm_toolbar_efl_access_selection_child_deselect(Eo *obj, Elm_Toolbar_Data *pd, int child_index); + + +Eina_Bool _elm_toolbar_efl_access_selection_is_child_selected(Eo *obj, Elm_Toolbar_Data *pd, int child_index); + + +Eina_Bool _elm_toolbar_efl_access_selection_all_children_select(Eo *obj, Elm_Toolbar_Data *pd); + + +Eina_Bool _elm_toolbar_efl_access_selection_access_selection_clear(Eo *obj, Elm_Toolbar_Data *pd); + + +void _elm_toolbar_efl_ui_focus_composition_prepare(Eo *obj, Elm_Toolbar_Data *pd); + + +static Eina_Bool +_elm_toolbar_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_TOOLBAR_EXTRA_OPS +#define ELM_TOOLBAR_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_selected_item_get, _elm_toolbar_selected_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_first_item_get, _elm_toolbar_first_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_last_item_get, _elm_toolbar_last_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_items_get, _elm_toolbar_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_homogeneous_set, _elm_toolbar_homogeneous_set), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_homogeneous_get, _elm_toolbar_homogeneous_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_align_set, _elm_toolbar_align_set), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_align_get, _elm_toolbar_align_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_select_mode_set, _elm_toolbar_select_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_select_mode_get, _elm_toolbar_select_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_icon_size_set, _elm_toolbar_icon_size_set), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_icon_size_get, _elm_toolbar_icon_size_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_shrink_mode_set, _elm_toolbar_shrink_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_shrink_mode_get, _elm_toolbar_shrink_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_menu_parent_set, _elm_toolbar_menu_parent_set), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_menu_parent_get, _elm_toolbar_menu_parent_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_standard_priority_set, _elm_toolbar_standard_priority_set), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_standard_priority_get, _elm_toolbar_standard_priority_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_more_item_get, _elm_toolbar_more_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_insert_before, _elm_toolbar_item_insert_before), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_insert_after, _elm_toolbar_item_insert_after), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_append, _elm_toolbar_item_append), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_items_count, _elm_toolbar_items_count), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_prepend, _elm_toolbar_item_prepend), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_find_by_label, _elm_toolbar_item_find_by_label), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_toolbar_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_toolbar_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_toolbar_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _elm_toolbar_efl_canvas_group_group_calculate), + EFL_OBJECT_OP_FUNC(efl_canvas_group_member_add, _elm_toolbar_efl_canvas_group_group_member_add), + EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_toolbar_efl_ui_widget_on_access_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_toolbar_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_on_focus_update, _elm_toolbar_efl_ui_focus_object_on_focus_update), + EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_toolbar_efl_ui_l10n_translation_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_toolbar_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_highlight_geometry_get, _elm_toolbar_efl_ui_widget_focus_highlight_geometry_get), + EFL_OBJECT_OP_FUNC(elm_widget_item_container_focused_item_get, _elm_toolbar_elm_widget_item_container_focused_item_get), + EFL_OBJECT_OP_FUNC(efl_ui_direction_set, _elm_toolbar_efl_ui_direction_direction_set), + EFL_OBJECT_OP_FUNC(efl_ui_direction_get, _elm_toolbar_efl_ui_direction_direction_get), + EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_state_apply, _elm_toolbar_efl_ui_widget_focus_state_apply), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_toolbar_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_access_object_access_children_get, _elm_toolbar_efl_access_object_access_children_get), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_toolbar_efl_access_object_state_set_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_children_count_get, _elm_toolbar_efl_access_selection_selected_children_count_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_child_get, _elm_toolbar_efl_access_selection_selected_child_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_child_deselect, _elm_toolbar_efl_access_selection_selected_child_deselect), + EFL_OBJECT_OP_FUNC(efl_access_selection_child_select, _elm_toolbar_efl_access_selection_child_select), + EFL_OBJECT_OP_FUNC(efl_access_selection_child_deselect, _elm_toolbar_efl_access_selection_child_deselect), + EFL_OBJECT_OP_FUNC(efl_access_selection_is_child_selected, _elm_toolbar_efl_access_selection_is_child_selected), + EFL_OBJECT_OP_FUNC(efl_access_selection_all_children_select, _elm_toolbar_efl_access_selection_all_children_select), + EFL_OBJECT_OP_FUNC(efl_access_selection_clear, _elm_toolbar_efl_access_selection_access_selection_clear), + EFL_OBJECT_OP_FUNC(efl_ui_focus_composition_prepare, _elm_toolbar_efl_ui_focus_composition_prepare), + ELM_TOOLBAR_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"homogeneous", __eolian_elm_toolbar_homogeneous_set_reflect, __eolian_elm_toolbar_homogeneous_get_reflect}, + {"align", __eolian_elm_toolbar_align_set_reflect, __eolian_elm_toolbar_align_get_reflect}, + {"icon_size", __eolian_elm_toolbar_icon_size_set_reflect, __eolian_elm_toolbar_icon_size_get_reflect}, + {"standard_priority", __eolian_elm_toolbar_standard_priority_set_reflect, __eolian_elm_toolbar_standard_priority_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_toolbar_class_desc = { + EO_VERSION, + "Elm.Toolbar", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Toolbar_Data), + _elm_toolbar_class_initializer, + _elm_toolbar_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_toolbar_class_get, &_elm_toolbar_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_DIRECTION_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_ACCESS_OBJECT_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); + +#include "elm_toolbar_eo.legacy.c" diff --git a/src/lib/elementary/elm_toolbar_eo.h b/src/lib/elementary/elm_toolbar_eo.h index 604ca3fdcc..ae7d8ae467 100644 --- a/src/lib/elementary/elm_toolbar_eo.h +++ b/src/lib/elementary/elm_toolbar_eo.h @@ -1,13 +1,551 @@ +#ifndef _ELM_TOOLBAR_EO_H_ +#define _ELM_TOOLBAR_EO_H_ + +#ifndef _ELM_TOOLBAR_EO_CLASS_TYPE +#define _ELM_TOOLBAR_EO_CLASS_TYPE + +typedef Eo Elm_Toolbar; + +#endif + +#ifndef _ELM_TOOLBAR_EO_TYPES +#define _ELM_TOOLBAR_EO_TYPES + /** - * @ingroup Elm_Toolbar + * @brief Set toolbar's items display behavior, it can be scrollable, show a + * menu with exceeding items, or simply hide them. * - * @{ + * Default value is #ELM_TOOLBAR_SHRINK_MENU. It reads value from elm config. + * + * Values don't work as bitmask, only one can be chosen. + * + * See also @ref elm_obj_toolbar_shrink_mode_set, + * @ref elm_obj_toolbar_shrink_mode_get. + * + * @ingroup Elm */ +typedef enum +{ + ELM_TOOLBAR_SHRINK_NONE = 0, /**< Set toolbar minimum size to fit all the + * items. */ + ELM_TOOLBAR_SHRINK_HIDE, /**< Hide exceeding items. */ + ELM_TOOLBAR_SHRINK_SCROLL, /**< Allow accessing exceeding items through a + * scroller. */ + ELM_TOOLBAR_SHRINK_MENU, /**< Inserts a button to pop up a menu with exceeding + * items. */ + ELM_TOOLBAR_SHRINK_EXPAND, /**< Expand all items according the size of the + * toolbar. */ + ELM_TOOLBAR_SHRINK_LAST /**< Indicates error if returned by + * elm_toolbar_shrink_mode_get() */ +} Elm_Toolbar_Shrink_Mode; -#include "elm_toolbar_item.eo.h" -#include "elm_toolbar.eo.h" + +#endif +/** Elementary toolbar class + * + * @ingroup Elm_Toolbar + */ +#define ELM_TOOLBAR_CLASS elm_toolbar_class_get() + +EWAPI const Efl_Class *elm_toolbar_class_get(void); /** - * @} + * @brief Get the selected item in the widget. + * + * @param[in] obj The object. + * + * @return The selected item or @c null. + * + * @ingroup Elm_Toolbar */ +EOAPI Elm_Widget_Item *elm_obj_toolbar_selected_item_get(const Eo *obj); +/** + * @brief Get the first item in the widget. + * + * @param[in] obj The object. + * + * @return The first item or @c null. + * + * @ingroup Elm_Toolbar + */ +EOAPI Elm_Widget_Item *elm_obj_toolbar_first_item_get(const Eo *obj); + +/** + * @brief Get the last item in the widget. + * + * @param[in] obj The object. + * + * @return The last item or @c null. + * + * @ingroup Elm_Toolbar + */ +EOAPI Elm_Widget_Item *elm_obj_toolbar_last_item_get(const Eo *obj); + +/** + * @brief Returns a list of the widget item. + * + * @param[in] obj The object. + * + * @return iterator to widget items + * + * @ingroup Elm_Toolbar + */ +EOAPI Eina_Iterator *elm_obj_toolbar_items_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Control homogeneous mode. + * + * This will enable the homogeneous mode where items are of the same size. + * + * @param[in] obj The object. + * @param[in] homogeneous Assume the items within the toolbar are of the same + * size (true = on, false = off). Default is @c false. + * + * @ingroup Elm_Toolbar + */ +EOAPI void elm_obj_toolbar_homogeneous_set(Eo *obj, Eina_Bool homogeneous); + +/** + * @brief Control homogeneous mode. + * + * This will enable the homogeneous mode where items are of the same size. + * + * @param[in] obj The object. + * + * @return Assume the items within the toolbar are of the same size (true = on, + * false = off). Default is @c false. + * + * @ingroup Elm_Toolbar + */ +EOAPI Eina_Bool elm_obj_toolbar_homogeneous_get(const Eo *obj); + +/** + * @brief Control the alignment of the items. + * + * Alignment of toolbar items, from 0.0 to indicates to align left, to 1.0, to + * align to right. 0.5 centralize items. + * + * Centered items by default. + * + * @param[in] obj The object. + * @param[in] align The new alignment, a float between 0.0 and 1.0. + * + * @ingroup Elm_Toolbar + */ +EOAPI void elm_obj_toolbar_align_set(Eo *obj, double align); + +/** + * @brief Control the alignment of the items. + * + * Alignment of toolbar items, from 0.0 to indicates to align left, to 1.0, to + * align to right. 0.5 centralize items. + * + * Centered items by default. + * + * @param[in] obj The object. + * + * @return The new alignment, a float between 0.0 and 1.0. + * + * @ingroup Elm_Toolbar + */ +EOAPI double elm_obj_toolbar_align_get(const Eo *obj); + +/** + * @brief Control the toolbar select mode. + * + * elm_toolbar_select_mode_set() changes item select mode in the toolbar + * widget. - #ELM_OBJECT_SELECT_MODE_DEFAULT : Items will only call their + * selection func and callback when first becoming selected. Any further clicks + * will do nothing, unless you set always select mode. - + * #ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected, every + * click will make the selected callbacks be called. - + * #ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select + * items entirely and they will neither appear selected nor call selected + * callback functions. + * + * @param[in] obj The object. + * @param[in] mode The select mode If getting mode fails, it returns + * #ELM_OBJECT_SELECT_MODE_MAX + * + * @ingroup Elm_Toolbar + */ +EOAPI void elm_obj_toolbar_select_mode_set(Eo *obj, Elm_Object_Select_Mode mode); + +/** + * @brief Control the toolbar select mode. + * + * elm_toolbar_select_mode_set() changes item select mode in the toolbar + * widget. - #ELM_OBJECT_SELECT_MODE_DEFAULT : Items will only call their + * selection func and callback when first becoming selected. Any further clicks + * will do nothing, unless you set always select mode. - + * #ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected, every + * click will make the selected callbacks be called. - + * #ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select + * items entirely and they will neither appear selected nor call selected + * callback functions. + * + * @param[in] obj The object. + * + * @return The select mode If getting mode fails, it returns + * #ELM_OBJECT_SELECT_MODE_MAX + * + * @ingroup Elm_Toolbar + */ +EOAPI Elm_Object_Select_Mode elm_obj_toolbar_select_mode_get(const Eo *obj); + +/** + * @brief Control the icon size, in pixels, to be used by toolbar items. + * + * @note Default value is $32. It reads value from elm config. + * + * @param[in] obj The object. + * @param[in] icon_size The icon size in pixels + * + * @ingroup Elm_Toolbar + */ +EOAPI void elm_obj_toolbar_icon_size_set(Eo *obj, int icon_size); + +/** + * @brief Control the icon size, in pixels, to be used by toolbar items. + * + * @note Default value is $32. It reads value from elm config. + * + * @param[in] obj The object. + * + * @return The icon size in pixels + * + * @ingroup Elm_Toolbar + */ +EOAPI int elm_obj_toolbar_icon_size_get(const Eo *obj); + +/** + * @brief Control the item displaying mode of a given toolbar widget @c obj. + * + * The toolbar won't scroll under #ELM_TOOLBAR_SHRINK_NONE mode, but it will + * enforce a minimum size, so that all the items will fit inside it. It won't + * scroll and won't show the items that don't fit under + * #ELM_TOOLBAR_SHRINK_HIDE mode. Finally, it'll scroll under + * #ELM_TOOLBAR_SHRINK_SCROLL mode, and it will create a button to aggregate + * items which didn't fit with the #ELM_TOOLBAR_SHRINK_MENU mode. + * + * If shrink mode is changed, Toolbar will send one of the following signal to + * each item for informing the current shrink mode. "elm,state,shrink,default" + * "elm,state,shrink,hide" "elm,state,shrink,scroll" "elm,state,shrink,menu" + * "elm,state,shrink,expand" + * + * @warning This function's behavior will clash with those of + * elm_scroller_policy_set(), so use either one of them, but not both. + * + * @param[in] obj The object. + * @param[in] shrink_mode Toolbar's items display behavior + * + * @ingroup Elm_Toolbar + */ +EOAPI void elm_obj_toolbar_shrink_mode_set(Eo *obj, Elm_Toolbar_Shrink_Mode shrink_mode); + +/** + * @brief Control the item displaying mode of a given toolbar widget @c obj. + * + * The toolbar won't scroll under #ELM_TOOLBAR_SHRINK_NONE mode, but it will + * enforce a minimum size, so that all the items will fit inside it. It won't + * scroll and won't show the items that don't fit under + * #ELM_TOOLBAR_SHRINK_HIDE mode. Finally, it'll scroll under + * #ELM_TOOLBAR_SHRINK_SCROLL mode, and it will create a button to aggregate + * items which didn't fit with the #ELM_TOOLBAR_SHRINK_MENU mode. + * + * If shrink mode is changed, Toolbar will send one of the following signal to + * each item for informing the current shrink mode. "elm,state,shrink,default" + * "elm,state,shrink,hide" "elm,state,shrink,scroll" "elm,state,shrink,menu" + * "elm,state,shrink,expand" + * + * @warning This function's behavior will clash with those of + * elm_scroller_policy_set(), so use either one of them, but not both. + * + * @param[in] obj The object. + * + * @return Toolbar's items display behavior + * + * @ingroup Elm_Toolbar + */ +EOAPI Elm_Toolbar_Shrink_Mode elm_obj_toolbar_shrink_mode_get(const Eo *obj); + +/** + * @brief Control the parent object of the toolbar items' menus. + * + * Each item can be set as item menu, with elm_toolbar_item_menu_set(). + * + * For more details about setting the parent for toolbar menus, see + * elm_menu_parent_set(). + * + * See: elm_menu_parent_set() for details. See: elm_toolbar_item_menu_set() for + * details. + * + * @param[in] obj The object. + * @param[in] parent The parent of the menu objects. + * + * @ingroup Elm_Toolbar + */ +EOAPI void elm_obj_toolbar_menu_parent_set(Eo *obj, Efl_Canvas_Object *parent); + +/** + * @brief Control the parent object of the toolbar items' menus. + * + * Each item can be set as item menu, with elm_toolbar_item_menu_set(). + * + * For more details about setting the parent for toolbar menus, see + * elm_menu_parent_set(). + * + * See: elm_menu_parent_set() for details. See: elm_toolbar_item_menu_set() for + * details. + * + * @param[in] obj The object. + * + * @return The parent of the menu objects. + * + * @ingroup Elm_Toolbar + */ +EOAPI Efl_Canvas_Object *elm_obj_toolbar_menu_parent_get(const Eo *obj); + +/** + * @brief Set the standard priority of visible items in a toolbar + * + * If the priority of the item is up to standard priority, it is shown in basic + * panel. The other items are located in more menu or panel. The more menu or + * panel can be shown when the more item is clicked. + * + * @param[in] obj The object. + * @param[in] priority The standard_priority of visible items + * + * @since 1.7 + * + * @ingroup Elm_Toolbar + */ +EOAPI void elm_obj_toolbar_standard_priority_set(Eo *obj, int priority); + +/** + * @brief Set the standard priority of visible items in a toolbar + * + * If the priority of the item is up to standard priority, it is shown in basic + * panel. The other items are located in more menu or panel. The more menu or + * panel can be shown when the more item is clicked. + * + * @param[in] obj The object. + * + * @return The standard_priority of visible items + * + * @since 1.7 + * + * @ingroup Elm_Toolbar + */ +EOAPI int elm_obj_toolbar_standard_priority_get(const Eo *obj); + +/** + * @brief Get the more item which is auto-generated by toolbar. + * + * Toolbar generates 'more' item when there is no more space to fit items in + * and toolbar is in #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_EXPAND + * mode. The more item can be manipulated by elm_object_item_text_set() and + * elm_object_item_content_set. + * + * @param[in] obj The object. + * + * @return The toolbar more item. + * + * @ingroup Elm_Toolbar + */ +EOAPI Elm_Widget_Item *elm_obj_toolbar_more_item_get(const Eo *obj); + +/** + * @brief Insert a new item into the toolbar object before item @c before. + * + * A new item will be created and added to the toolbar. Its position in this + * toolbar will be just before item @c before. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If such function + * isn't needed, just passing @c NULL as @c func is enough. The same should be + * done for @c data. + * + * Toolbar will load icon image from fdo or current theme. This behavior can be + * set by elm_toolbar_icon_order_lookup_set() function. If an absolute path is + * provided it will load it direct from a file. + * + * @note This function does not accept relative icon path. + * + * See: elm_toolbar_item_icon_set() + * + * @param[in] obj The object. + * @param[in] before The toolbar item to insert before. + * @param[in] icon A string with icon name or the absolute path of an image + * file. + * @param[in] label The label of the item. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Toolbar + */ +EOAPI Elm_Widget_Item *elm_obj_toolbar_item_insert_before(Eo *obj, Elm_Widget_Item *before, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +/** + * @brief Insert a new item into the toolbar object after item @c after. + * + * A new item will be created and added to the toolbar. Its position in this + * toolbar will be just after item @c after. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If such function + * isn't needed, just passing @c NULL as @c func is enough. The same should be + * done for @c data. + * + * Toolbar will load icon image from fdo or current theme. This behavior can be + * set by elm_toolbar_icon_order_lookup_set() function. If an absolute path is + * provided it will load it direct from a file. + * + * @note This function does not accept relative icon path. + * + * See: elm_toolbar_item_icon_set() + * + * @param[in] obj The object. + * @param[in] after The toolbar item to insert after. + * @param[in] icon A string with icon name or the absolute path of an image + * file. + * @param[in] label The label of the item. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Toolbar + */ +EOAPI Elm_Widget_Item *elm_obj_toolbar_item_insert_after(Eo *obj, Elm_Widget_Item *after, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +/** + * @brief Append item to the toolbar. + * + * A new item will be created and appended to the toolbar, i.e., will be set as + * last item. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If such function + * isn't needed, just passing @c NULL as @c func is enough. The same should be + * done for @c data. + * + * Toolbar will load icon image from fdo or current theme. This behavior can be + * set by elm_toolbar_icon_order_lookup_set() function. If an absolute path is + * provided it will load it direct from a file. + * + * @note This function does not accept relative icon path. + * + * See: elm_toolbar_item_icon_set() + * + * @param[in] obj The object. + * @param[in] icon A string with icon name or the absolute path of an image + * file. + * @param[in] label The label of the item. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Toolbar + */ +EOAPI Elm_Widget_Item *elm_obj_toolbar_item_append(Eo *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +/** + * @brief Get the number of items in a toolbar + * + * @param[in] obj The object. + * + * @return The number of items in @c obj toolbar + * + * @ingroup Elm_Toolbar + */ +EOAPI unsigned int elm_obj_toolbar_items_count(const Eo *obj); + +/** + * @brief Prepend item to the toolbar. + * + * A new item will be created and prepended to the toolbar, i.e., will be set + * as first item. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If such function + * isn't needed, just passing @c NULL as @c func is enough. The same should be + * done for @c data. + * + * Toolbar will load icon image from fdo or current theme. This behavior can be + * set by elm_toolbar_icon_order_lookup_set() function. If an absolute path is + * provided it will load it direct from a file. + * + * @note This function does not accept relative icon path. + * + * See: elm_toolbar_item_icon_set() + * + * @param[in] obj The object. + * @param[in] icon A string with icon name or the absolute path of an image + * file. + * @param[in] label The label of the item. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Toolbar + */ +EOAPI Elm_Widget_Item *elm_obj_toolbar_item_prepend(Eo *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +/** + * @brief Returns a pointer to a toolbar item by its label. + * + * @param[in] obj The object. + * @param[in] label The label of the item to find. + * + * @return The pointer to the toolbar item matching @c label or @c NULL on + * failure. + * + * @ingroup Elm_Toolbar + */ +EOAPI Elm_Widget_Item *elm_obj_toolbar_item_find_by_label(const Eo *obj, const char *label); + +EWAPI extern const Efl_Event_Description _ELM_TOOLBAR_EVENT_ITEM_FOCUSED; + +/** Called when toolbar item got focus + * @return Efl_Object * + * + * @ingroup Elm_Toolbar + */ +#define ELM_TOOLBAR_EVENT_ITEM_FOCUSED (&(_ELM_TOOLBAR_EVENT_ITEM_FOCUSED)) + +EWAPI extern const Efl_Event_Description _ELM_TOOLBAR_EVENT_ITEM_UNFOCUSED; + +/** Called when toolbar item lost focus + * @return Efl_Object * + * + * @ingroup Elm_Toolbar + */ +#define ELM_TOOLBAR_EVENT_ITEM_UNFOCUSED (&(_ELM_TOOLBAR_EVENT_ITEM_UNFOCUSED)) + +#endif diff --git a/src/lib/elementary/elm_toolbar_eo.legacy.c b/src/lib/elementary/elm_toolbar_eo.legacy.c new file mode 100644 index 0000000000..f0083b5047 --- /dev/null +++ b/src/lib/elementary/elm_toolbar_eo.legacy.c @@ -0,0 +1,150 @@ + +EAPI Elm_Widget_Item * +elm_toolbar_selected_item_get(const Elm_Toolbar *obj) +{ + return elm_obj_toolbar_selected_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_toolbar_first_item_get(const Elm_Toolbar *obj) +{ + return elm_obj_toolbar_first_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_toolbar_last_item_get(const Elm_Toolbar *obj) +{ + return elm_obj_toolbar_last_item_get(obj); +} + +EAPI Eina_Iterator * +elm_toolbar_items_get(const Elm_Toolbar *obj) +{ + return elm_obj_toolbar_items_get(obj); +} + +EAPI void +elm_toolbar_homogeneous_set(Elm_Toolbar *obj, Eina_Bool homogeneous) +{ + elm_obj_toolbar_homogeneous_set(obj, homogeneous); +} + +EAPI Eina_Bool +elm_toolbar_homogeneous_get(const Elm_Toolbar *obj) +{ + return elm_obj_toolbar_homogeneous_get(obj); +} + +EAPI void +elm_toolbar_align_set(Elm_Toolbar *obj, double align) +{ + elm_obj_toolbar_align_set(obj, align); +} + +EAPI double +elm_toolbar_align_get(const Elm_Toolbar *obj) +{ + return elm_obj_toolbar_align_get(obj); +} + +EAPI void +elm_toolbar_select_mode_set(Elm_Toolbar *obj, Elm_Object_Select_Mode mode) +{ + elm_obj_toolbar_select_mode_set(obj, mode); +} + +EAPI Elm_Object_Select_Mode +elm_toolbar_select_mode_get(const Elm_Toolbar *obj) +{ + return elm_obj_toolbar_select_mode_get(obj); +} + +EAPI void +elm_toolbar_icon_size_set(Elm_Toolbar *obj, int icon_size) +{ + elm_obj_toolbar_icon_size_set(obj, icon_size); +} + +EAPI int +elm_toolbar_icon_size_get(const Elm_Toolbar *obj) +{ + return elm_obj_toolbar_icon_size_get(obj); +} + +EAPI void +elm_toolbar_shrink_mode_set(Elm_Toolbar *obj, Elm_Toolbar_Shrink_Mode shrink_mode) +{ + elm_obj_toolbar_shrink_mode_set(obj, shrink_mode); +} + +EAPI Elm_Toolbar_Shrink_Mode +elm_toolbar_shrink_mode_get(const Elm_Toolbar *obj) +{ + return elm_obj_toolbar_shrink_mode_get(obj); +} + +EAPI void +elm_toolbar_menu_parent_set(Elm_Toolbar *obj, Efl_Canvas_Object *parent) +{ + elm_obj_toolbar_menu_parent_set(obj, parent); +} + +EAPI Efl_Canvas_Object * +elm_toolbar_menu_parent_get(const Elm_Toolbar *obj) +{ + return elm_obj_toolbar_menu_parent_get(obj); +} + +EAPI void +elm_toolbar_standard_priority_set(Elm_Toolbar *obj, int priority) +{ + elm_obj_toolbar_standard_priority_set(obj, priority); +} + +EAPI int +elm_toolbar_standard_priority_get(const Elm_Toolbar *obj) +{ + return elm_obj_toolbar_standard_priority_get(obj); +} + +EAPI Elm_Widget_Item * +elm_toolbar_more_item_get(const Elm_Toolbar *obj) +{ + return elm_obj_toolbar_more_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_toolbar_item_insert_before(Elm_Toolbar *obj, Elm_Widget_Item *before, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_toolbar_item_insert_before(obj, before, icon, label, func, data); +} + +EAPI Elm_Widget_Item * +elm_toolbar_item_insert_after(Elm_Toolbar *obj, Elm_Widget_Item *after, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_toolbar_item_insert_after(obj, after, icon, label, func, data); +} + +EAPI Elm_Widget_Item * +elm_toolbar_item_append(Elm_Toolbar *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_toolbar_item_append(obj, icon, label, func, data); +} + +EAPI unsigned int +elm_toolbar_items_count(const Elm_Toolbar *obj) +{ + return elm_obj_toolbar_items_count(obj); +} + +EAPI Elm_Widget_Item * +elm_toolbar_item_prepend(Elm_Toolbar *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_toolbar_item_prepend(obj, icon, label, func, data); +} + +EAPI Elm_Widget_Item * +elm_toolbar_item_find_by_label(const Elm_Toolbar *obj, const char *label) +{ + return elm_obj_toolbar_item_find_by_label(obj, label); +} diff --git a/src/lib/elementary/elm_toolbar_eo.legacy.h b/src/lib/elementary/elm_toolbar_eo.legacy.h new file mode 100644 index 0000000000..d16a3b2ba5 --- /dev/null +++ b/src/lib/elementary/elm_toolbar_eo.legacy.h @@ -0,0 +1,525 @@ +#ifndef _ELM_TOOLBAR_EO_LEGACY_H_ +#define _ELM_TOOLBAR_EO_LEGACY_H_ + +#ifndef _ELM_TOOLBAR_EO_CLASS_TYPE +#define _ELM_TOOLBAR_EO_CLASS_TYPE + +typedef Eo Elm_Toolbar; + +#endif + +#ifndef _ELM_TOOLBAR_EO_TYPES +#define _ELM_TOOLBAR_EO_TYPES + +/** + * @brief Set toolbar's items display behavior, it can be scrollable, show a + * menu with exceeding items, or simply hide them. + * + * Default value is #ELM_TOOLBAR_SHRINK_MENU. It reads value from elm config. + * + * Values don't work as bitmask, only one can be chosen. + * + * See also @ref elm_toolbar_shrink_mode_set, @ref elm_toolbar_shrink_mode_get. + * + * @ingroup Elm + */ +typedef enum +{ + ELM_TOOLBAR_SHRINK_NONE = 0, /**< Set toolbar minimum size to fit all the + * items. */ + ELM_TOOLBAR_SHRINK_HIDE, /**< Hide exceeding items. */ + ELM_TOOLBAR_SHRINK_SCROLL, /**< Allow accessing exceeding items through a + * scroller. */ + ELM_TOOLBAR_SHRINK_MENU, /**< Inserts a button to pop up a menu with exceeding + * items. */ + ELM_TOOLBAR_SHRINK_EXPAND, /**< Expand all items according the size of the + * toolbar. */ + ELM_TOOLBAR_SHRINK_LAST /**< Indicates error if returned by + * elm_toolbar_shrink_mode_get() */ +} Elm_Toolbar_Shrink_Mode; + + +#endif + +/** + * @brief Get the selected item in the widget. + * + * @param[in] obj The object. + * + * @return The selected item or @c null. + * + * @ingroup Elm_Toolbar_Group + */ +EAPI Elm_Widget_Item *elm_toolbar_selected_item_get(const Elm_Toolbar *obj); + +/** + * @brief Get the first item in the widget. + * + * @param[in] obj The object. + * + * @return The first item or @c null. + * + * @ingroup Elm_Toolbar_Group + */ +EAPI Elm_Widget_Item *elm_toolbar_first_item_get(const Elm_Toolbar *obj); + +/** + * @brief Get the last item in the widget. + * + * @param[in] obj The object. + * + * @return The last item or @c null. + * + * @ingroup Elm_Toolbar_Group + */ +EAPI Elm_Widget_Item *elm_toolbar_last_item_get(const Elm_Toolbar *obj); + +/** + * @brief Returns a list of the widget item. + * + * @param[in] obj The object. + * + * @return iterator to widget items + * + * @ingroup Elm_Toolbar_Group + */ +EAPI Eina_Iterator *elm_toolbar_items_get(const Elm_Toolbar *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Control homogeneous mode. + * + * This will enable the homogeneous mode where items are of the same size. + * + * @param[in] obj The object. + * @param[in] homogeneous Assume the items within the toolbar are of the same + * size (true = on, false = off). Default is @c false. + * + * @ingroup Elm_Toolbar_Group + */ +EAPI void elm_toolbar_homogeneous_set(Elm_Toolbar *obj, Eina_Bool homogeneous); + +/** + * @brief Control homogeneous mode. + * + * This will enable the homogeneous mode where items are of the same size. + * + * @param[in] obj The object. + * + * @return Assume the items within the toolbar are of the same size (true = on, + * false = off). Default is @c false. + * + * @ingroup Elm_Toolbar_Group + */ +EAPI Eina_Bool elm_toolbar_homogeneous_get(const Elm_Toolbar *obj); + +/** + * @brief Control the alignment of the items. + * + * Alignment of toolbar items, from 0.0 to indicates to align left, to 1.0, to + * align to right. 0.5 centralize items. + * + * Centered items by default. + * + * @param[in] obj The object. + * @param[in] align The new alignment, a float between 0.0 and 1.0. + * + * @ingroup Elm_Toolbar_Group + */ +EAPI void elm_toolbar_align_set(Elm_Toolbar *obj, double align); + +/** + * @brief Control the alignment of the items. + * + * Alignment of toolbar items, from 0.0 to indicates to align left, to 1.0, to + * align to right. 0.5 centralize items. + * + * Centered items by default. + * + * @param[in] obj The object. + * + * @return The new alignment, a float between 0.0 and 1.0. + * + * @ingroup Elm_Toolbar_Group + */ +EAPI double elm_toolbar_align_get(const Elm_Toolbar *obj); + +/** + * @brief Control the toolbar select mode. + * + * elm_toolbar_select_mode_set() changes item select mode in the toolbar + * widget. - #ELM_OBJECT_SELECT_MODE_DEFAULT : Items will only call their + * selection func and callback when first becoming selected. Any further clicks + * will do nothing, unless you set always select mode. - + * #ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected, every + * click will make the selected callbacks be called. - + * #ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select + * items entirely and they will neither appear selected nor call selected + * callback functions. + * + * @param[in] obj The object. + * @param[in] mode The select mode If getting mode fails, it returns + * #ELM_OBJECT_SELECT_MODE_MAX + * + * @ingroup Elm_Toolbar_Group + */ +EAPI void elm_toolbar_select_mode_set(Elm_Toolbar *obj, Elm_Object_Select_Mode mode); + +/** + * @brief Control the toolbar select mode. + * + * elm_toolbar_select_mode_set() changes item select mode in the toolbar + * widget. - #ELM_OBJECT_SELECT_MODE_DEFAULT : Items will only call their + * selection func and callback when first becoming selected. Any further clicks + * will do nothing, unless you set always select mode. - + * #ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected, every + * click will make the selected callbacks be called. - + * #ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select + * items entirely and they will neither appear selected nor call selected + * callback functions. + * + * @param[in] obj The object. + * + * @return The select mode If getting mode fails, it returns + * #ELM_OBJECT_SELECT_MODE_MAX + * + * @ingroup Elm_Toolbar_Group + */ +EAPI Elm_Object_Select_Mode elm_toolbar_select_mode_get(const Elm_Toolbar *obj); + +/** + * @brief Control the icon size, in pixels, to be used by toolbar items. + * + * @note Default value is $32. It reads value from elm config. + * + * @param[in] obj The object. + * @param[in] icon_size The icon size in pixels + * + * @ingroup Elm_Toolbar_Group + */ +EAPI void elm_toolbar_icon_size_set(Elm_Toolbar *obj, int icon_size); + +/** + * @brief Control the icon size, in pixels, to be used by toolbar items. + * + * @note Default value is $32. It reads value from elm config. + * + * @param[in] obj The object. + * + * @return The icon size in pixels + * + * @ingroup Elm_Toolbar_Group + */ +EAPI int elm_toolbar_icon_size_get(const Elm_Toolbar *obj); + +/** + * @brief Control the item displaying mode of a given toolbar widget @c obj. + * + * The toolbar won't scroll under #ELM_TOOLBAR_SHRINK_NONE mode, but it will + * enforce a minimum size, so that all the items will fit inside it. It won't + * scroll and won't show the items that don't fit under + * #ELM_TOOLBAR_SHRINK_HIDE mode. Finally, it'll scroll under + * #ELM_TOOLBAR_SHRINK_SCROLL mode, and it will create a button to aggregate + * items which didn't fit with the #ELM_TOOLBAR_SHRINK_MENU mode. + * + * If shrink mode is changed, Toolbar will send one of the following signal to + * each item for informing the current shrink mode. "elm,state,shrink,default" + * "elm,state,shrink,hide" "elm,state,shrink,scroll" "elm,state,shrink,menu" + * "elm,state,shrink,expand" + * + * @warning This function's behavior will clash with those of + * elm_scroller_policy_set(), so use either one of them, but not both. + * + * @param[in] obj The object. + * @param[in] shrink_mode Toolbar's items display behavior + * + * @ingroup Elm_Toolbar_Group + */ +EAPI void elm_toolbar_shrink_mode_set(Elm_Toolbar *obj, Elm_Toolbar_Shrink_Mode shrink_mode); + +/** + * @brief Control the item displaying mode of a given toolbar widget @c obj. + * + * The toolbar won't scroll under #ELM_TOOLBAR_SHRINK_NONE mode, but it will + * enforce a minimum size, so that all the items will fit inside it. It won't + * scroll and won't show the items that don't fit under + * #ELM_TOOLBAR_SHRINK_HIDE mode. Finally, it'll scroll under + * #ELM_TOOLBAR_SHRINK_SCROLL mode, and it will create a button to aggregate + * items which didn't fit with the #ELM_TOOLBAR_SHRINK_MENU mode. + * + * If shrink mode is changed, Toolbar will send one of the following signal to + * each item for informing the current shrink mode. "elm,state,shrink,default" + * "elm,state,shrink,hide" "elm,state,shrink,scroll" "elm,state,shrink,menu" + * "elm,state,shrink,expand" + * + * @warning This function's behavior will clash with those of + * elm_scroller_policy_set(), so use either one of them, but not both. + * + * @param[in] obj The object. + * + * @return Toolbar's items display behavior + * + * @ingroup Elm_Toolbar_Group + */ +EAPI Elm_Toolbar_Shrink_Mode elm_toolbar_shrink_mode_get(const Elm_Toolbar *obj); + +/** + * @brief Control the parent object of the toolbar items' menus. + * + * Each item can be set as item menu, with elm_toolbar_item_menu_set(). + * + * For more details about setting the parent for toolbar menus, see + * elm_menu_parent_set(). + * + * See: elm_menu_parent_set() for details. See: elm_toolbar_item_menu_set() for + * details. + * + * @param[in] obj The object. + * @param[in] parent The parent of the menu objects. + * + * @ingroup Elm_Toolbar_Group + */ +EAPI void elm_toolbar_menu_parent_set(Elm_Toolbar *obj, Efl_Canvas_Object *parent); + +/** + * @brief Control the parent object of the toolbar items' menus. + * + * Each item can be set as item menu, with elm_toolbar_item_menu_set(). + * + * For more details about setting the parent for toolbar menus, see + * elm_menu_parent_set(). + * + * See: elm_menu_parent_set() for details. See: elm_toolbar_item_menu_set() for + * details. + * + * @param[in] obj The object. + * + * @return The parent of the menu objects. + * + * @ingroup Elm_Toolbar_Group + */ +EAPI Efl_Canvas_Object *elm_toolbar_menu_parent_get(const Elm_Toolbar *obj); + +/** + * @brief Set the standard priority of visible items in a toolbar + * + * If the priority of the item is up to standard priority, it is shown in basic + * panel. The other items are located in more menu or panel. The more menu or + * panel can be shown when the more item is clicked. + * + * @param[in] obj The object. + * @param[in] priority The standard_priority of visible items + * + * @since 1.7 + * + * @ingroup Elm_Toolbar_Group + */ +EAPI void elm_toolbar_standard_priority_set(Elm_Toolbar *obj, int priority); + +/** + * @brief Set the standard priority of visible items in a toolbar + * + * If the priority of the item is up to standard priority, it is shown in basic + * panel. The other items are located in more menu or panel. The more menu or + * panel can be shown when the more item is clicked. + * + * @param[in] obj The object. + * + * @return The standard_priority of visible items + * + * @since 1.7 + * + * @ingroup Elm_Toolbar_Group + */ +EAPI int elm_toolbar_standard_priority_get(const Elm_Toolbar *obj); + +/** + * @brief Get the more item which is auto-generated by toolbar. + * + * Toolbar generates 'more' item when there is no more space to fit items in + * and toolbar is in #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_EXPAND + * mode. The more item can be manipulated by elm_object_item_text_set() and + * elm_object_item_content_set. + * + * @param[in] obj The object. + * + * @return The toolbar more item. + * + * @ingroup Elm_Toolbar_Group + */ +EAPI Elm_Widget_Item *elm_toolbar_more_item_get(const Elm_Toolbar *obj); + +/** + * @brief Insert a new item into the toolbar object before item @c before. + * + * A new item will be created and added to the toolbar. Its position in this + * toolbar will be just before item @c before. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If such function + * isn't needed, just passing @c NULL as @c func is enough. The same should be + * done for @c data. + * + * Toolbar will load icon image from fdo or current theme. This behavior can be + * set by elm_toolbar_icon_order_lookup_set() function. If an absolute path is + * provided it will load it direct from a file. + * + * @note This function does not accept relative icon path. + * + * See: elm_toolbar_item_icon_set() + * + * @param[in] obj The object. + * @param[in] before The toolbar item to insert before. + * @param[in] icon A string with icon name or the absolute path of an image + * file. + * @param[in] label The label of the item. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Toolbar_Group + */ +EAPI Elm_Widget_Item *elm_toolbar_item_insert_before(Elm_Toolbar *obj, Elm_Widget_Item *before, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +/** + * @brief Insert a new item into the toolbar object after item @c after. + * + * A new item will be created and added to the toolbar. Its position in this + * toolbar will be just after item @c after. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If such function + * isn't needed, just passing @c NULL as @c func is enough. The same should be + * done for @c data. + * + * Toolbar will load icon image from fdo or current theme. This behavior can be + * set by elm_toolbar_icon_order_lookup_set() function. If an absolute path is + * provided it will load it direct from a file. + * + * @note This function does not accept relative icon path. + * + * See: elm_toolbar_item_icon_set() + * + * @param[in] obj The object. + * @param[in] after The toolbar item to insert after. + * @param[in] icon A string with icon name or the absolute path of an image + * file. + * @param[in] label The label of the item. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Toolbar_Group + */ +EAPI Elm_Widget_Item *elm_toolbar_item_insert_after(Elm_Toolbar *obj, Elm_Widget_Item *after, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +/** + * @brief Append item to the toolbar. + * + * A new item will be created and appended to the toolbar, i.e., will be set as + * last item. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If such function + * isn't needed, just passing @c NULL as @c func is enough. The same should be + * done for @c data. + * + * Toolbar will load icon image from fdo or current theme. This behavior can be + * set by elm_toolbar_icon_order_lookup_set() function. If an absolute path is + * provided it will load it direct from a file. + * + * @note This function does not accept relative icon path. + * + * See: elm_toolbar_item_icon_set() + * + * @param[in] obj The object. + * @param[in] icon A string with icon name or the absolute path of an image + * file. + * @param[in] label The label of the item. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Toolbar_Group + */ +EAPI Elm_Widget_Item *elm_toolbar_item_append(Elm_Toolbar *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +/** + * @brief Get the number of items in a toolbar + * + * @param[in] obj The object. + * + * @return The number of items in @c obj toolbar + * + * @ingroup Elm_Toolbar_Group + */ +EAPI unsigned int elm_toolbar_items_count(const Elm_Toolbar *obj); + +/** + * @brief Prepend item to the toolbar. + * + * A new item will be created and prepended to the toolbar, i.e., will be set + * as first item. + * + * Items created with this method can be deleted with elm_object_item_del(). + * + * Associated @c data can be properly freed when item is deleted if a callback + * function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user clicks over an unselected item. If such function + * isn't needed, just passing @c NULL as @c func is enough. The same should be + * done for @c data. + * + * Toolbar will load icon image from fdo or current theme. This behavior can be + * set by elm_toolbar_icon_order_lookup_set() function. If an absolute path is + * provided it will load it direct from a file. + * + * @note This function does not accept relative icon path. + * + * See: elm_toolbar_item_icon_set() + * + * @param[in] obj The object. + * @param[in] icon A string with icon name or the absolute path of an image + * file. + * @param[in] label The label of the item. + * @param[in] func The function to call when the item is clicked. + * @param[in] data The data to associate with the item for related callbacks. + * + * @return The created item or @c NULL upon failure. + * + * @ingroup Elm_Toolbar_Group + */ +EAPI Elm_Widget_Item *elm_toolbar_item_prepend(Elm_Toolbar *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +/** + * @brief Returns a pointer to a toolbar item by its label. + * + * @param[in] obj The object. + * @param[in] label The label of the item to find. + * + * @return The pointer to the toolbar item matching @c label or @c NULL on + * failure. + * + * @ingroup Elm_Toolbar_Group + */ +EAPI Elm_Widget_Item *elm_toolbar_item_find_by_label(const Elm_Toolbar *obj, const char *label); + +#endif diff --git a/src/lib/elementary/elm_toolbar_item.eo b/src/lib/elementary/elm_toolbar_item.eo deleted file mode 100644 index 6abdc3981b..0000000000 --- a/src/lib/elementary/elm_toolbar_item.eo +++ /dev/null @@ -1,329 +0,0 @@ -enum Elm.Toolbar_Item_Scrollto_Type -{ - [[Defines where to position the item in the toolbar.]] - legacy: elm_toolbar_item_scrollto; - - none = 0, [[no scrollto]] - in = (1 << 0), [[to the nearest viewport]] - first = (1 << 1), [[to the first of viewport]] - middle = (1 << 2), [[to the middle of viewport]] - last = (1 << 3) [[to the last of viewport]] -} - -struct Elm.Toolbar_Item_State -{ - [[ - State of a Elm_Toolbar_Item. - Can be created with elm_toolbar_item_state_add() and removed with elm_toolbar_item_state_del(). - ]] - label: string; [[Item label]] - icon_str: string; [[Item icon string]] - icon: Efl.Canvas.Object; [[Item icon]] - func: Evas_Smart_Cb ; [[Item callback function]] - data: const(void_ptr); [[Item data]] -} - -class Elm.Toolbar_Item extends Elm.Widget.Item implements 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.]] - } - set { - [[Set the priority of a toolbar item. - - This is used only when the toolbar shrink mode is set - to #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_HIDE. - When space is less than required, items with low priority - will be removed from the toolbar and added to a - dynamically-created menu, while items with higher - priority will remain on the toolbar, with the same - order they were added. - ]] - } - values { - priority: int; [[The $item priority. The default is zero - for set and 0 is returned on failure.]] - } - } - @property icon { - get { - [[Get the string used to set the icon of $item.]] - } - set { - [[Set the icon associated with $item. - - Toolbar will load icon image from fdo or current theme. - This behavior can be set by - elm_toolbar_icon_order_lookup_set function. - If an absolute path is provided it will load it direct - from a file. - - Note: This function does not accept relative icon path. - ]] - } - values { - icon: string; [[A string with icon name or the - absolute path of an image file.]] - } - } - @property object { - get { - [[Get the real Evas(Edje) object created to implement the - view of a given toolbar $item. - ]] - } - values { - obj: Efl.Canvas.Object; [[The base Edje object associated with $it.]] - } - } - @property icon_object { - get { - [[Get the icon object of $item. - - See also @.icon.set, @.icon_file_set, @.icon_memfile_set. - ]] - } - values { - obj: Efl.Canvas.Object; [[The icon object.]] - } - } - @property separator { - get { - [[Get a value whether item is a separator or not.]] - } - set { - [[Set or unset item as a separator. - - Items aren't set as separator by default. - - If set as separator it will display separator theme, so - won't display icons or label. - ]] - } - values { - separator: bool; [[$true if the item is a separator, $false otherwise]] - } - } - @property menu { - get { - [[Get toolbar item's menu. - - If $item wasn't set as menu item with @.menu_set, - this function will set it. - ]] - } - values { - menu: Efl.Canvas.Object; [[Item's menu object or $null on failure.]] - } - } - @property state { - get { - [[Get the current state of $it.]] - } - set { - [[Set $state as the current state of $it. - - If $state is $NULL, it won't select any state and the - default item's icon and label will be used. It's the - behavior as \@ref elm_toolbar_item_state_unset. - ]] - return: bool; [[$true on success, $false otherwise]] - } - values { - state: ptr(Elm.Toolbar_Item_State) @nullable; [[Item state]] - } - } - /* init { FIXME - params { - Evas_Smart_Cb func; - const(void_ptr) data; - } - }*/ - icon_memfile_set { - [[Set the icon associated with $item to an image in a binary buffer. - - Note: The icon image set by this function can be changed by - @.icon.set. - ]] - params { - @in img: const(void_ptr); [[The binary data that will be used as an image.]] - @in size: size; [[The size of binary data $img.]] - @in format: string; [[Optional format of $img to pass to the image loader.]] - @in key: string; [[Optional key of $img to pass to the image loader (eg. if $img is an edje file).]] - } - return: bool; [[$true on success, $false otherwise]] - } - icon_file_set { - [[Set the icon associated with $item to an image in a binary buffer. - - Note: The icon image set by this function can be changed by - elm_toolbar_item_icon_set(). - ]] - params { - @in file: string; [[The file that contains the image.]] - @in key: string; [[Optional key of $img to pass to the image loader (eg. if $img is an edje file).]] - } - return: bool; [[$true on success, $false otherwise]] - } - state_add { - [[Add a new state to $item. - - Toolbar will load icon image from fdo or current theme. - This behavior can be set by elm_toolbar_icon_order_lookup_set - function. If an absolute path is provided it will load it - direct from a file. - - States created with this function can be removed with - @.state_del. - ]] - params { - @in icon: string; [[A string with icon name or the absolute path of an image file.]] - @in label: string; [[The label of the new state.]] - @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.]] - } - state_del { - [[Delete a previously added state to $item.]] - params { - @in state: ptr(Elm.Toolbar_Item_State); [[The state to be deleted.]] - } - return: bool; [[$true on success or $false on failure.]] - } - state_next { - [[Get the state after selected state in toolbar's $item. - - 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.]] - } - state_prev { - [[Get the state before selected state in toolbar's $item. - - 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.]] - } - show { - [[Show a specific item, when the toolbar can be scrolled. - - @since 1.8 - ]] - params { - @in scrollto: Elm.Toolbar_Item_Scrollto_Type; [[The position the item should appear at.]] - } - } - bring_in { - [[Show a specific item with scroll animation, when the toolbar - can be scrolled. - - @since 1.8 - ]] - params { - @in scrollto: Elm.Toolbar_Item_Scrollto_Type; [[The position the item should appear at.]] - } - } - menu_set { - [[Set whether the toolbar item opens a menu. - - A toolbar item can be set to be a menu, using this function. - - Once it is set to be a menu, it can be manipulated through the - menu-like function @Elm.Toolbar.menu_parent.set and the - other elm_menu functions, using the Evas_Object $menu returned - by @.menu.get. - - So, items to be displayed in this item's menu should be added - with \@ref elm_menu_item_add. - ]] - /* FIXME-doc - The following code exemplifies the most basic usage: - @code - tb = elm_toolbar_add(win) - item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL); - elm_toolbar_item_menu_set(item, true); - elm_toolbar_menu_parent_set(tb, win); - menu = elm_toolbar_item_menu_get(item); - elm_menu_item_add(menu, NULL, "edit-cut", "Cut", NULL, NULL); - menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Copy", NULL, - NULL); - @endcode - */ - params { - @in menu: bool; [[If $true, $item will opens a menu when selected.]] - } - } - } - implements { - Efl.Object.constructor; - Efl.Object.invalidate; - Elm.Widget.Item.disable; - Elm.Widget.Item.disabled { 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.Ui.Focus.Object.focus_parent { get; } - Efl.Access.Object.i18n_name { get; } - Efl.Access.Object.state_set { get; } - } -} diff --git a/src/lib/elementary/elm_toolbar_item_eo.c b/src/lib/elementary/elm_toolbar_item_eo.c new file mode 100644 index 0000000000..14a916d508 --- /dev/null +++ b/src/lib/elementary/elm_toolbar_item_eo.c @@ -0,0 +1,328 @@ + +Elm_Widget_Item *_elm_toolbar_item_prev_get(const Eo *obj, Elm_Toolbar_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_item_prev_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_toolbar_item_next_get(const Eo *obj, Elm_Toolbar_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_item_next_get, Elm_Widget_Item *, NULL); + +void _elm_toolbar_item_selected_set(Eo *obj, Elm_Toolbar_Item_Data *pd, Eina_Bool selected); + + +static Eina_Error +__eolian_elm_toolbar_item_selected_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_toolbar_item_selected_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_toolbar_item_selected_set, EFL_FUNC_CALL(selected), Eina_Bool selected); + +Eina_Bool _elm_toolbar_item_selected_get(const Eo *obj, Elm_Toolbar_Item_Data *pd); + + +static Eina_Value +__eolian_elm_toolbar_item_selected_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_toolbar_item_selected_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_item_selected_get, Eina_Bool, 0); + +void _elm_toolbar_item_priority_set(Eo *obj, Elm_Toolbar_Item_Data *pd, int priority); + + +static Eina_Error +__eolian_elm_toolbar_item_priority_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_toolbar_item_priority_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_toolbar_item_priority_set, EFL_FUNC_CALL(priority), int priority); + +int _elm_toolbar_item_priority_get(const Eo *obj, Elm_Toolbar_Item_Data *pd); + + +static Eina_Value +__eolian_elm_toolbar_item_priority_get_reflect(const Eo *obj) +{ + int val = elm_obj_toolbar_item_priority_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_item_priority_get, int, 0); + +void _elm_toolbar_item_icon_set(Eo *obj, Elm_Toolbar_Item_Data *pd, const char *icon); + + +static Eina_Error +__eolian_elm_toolbar_item_icon_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_toolbar_item_icon_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_toolbar_item_icon_set, EFL_FUNC_CALL(icon), const char *icon); + +const char *_elm_toolbar_item_icon_get(const Eo *obj, Elm_Toolbar_Item_Data *pd); + + +static Eina_Value +__eolian_elm_toolbar_item_icon_get_reflect(const Eo *obj) +{ + const char *val = elm_obj_toolbar_item_icon_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_item_icon_get, const char *, NULL); + +Efl_Canvas_Object *_elm_toolbar_item_object_get(const Eo *obj, Elm_Toolbar_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_item_object_get, Efl_Canvas_Object *, NULL); + +Efl_Canvas_Object *_elm_toolbar_item_icon_object_get(const Eo *obj, Elm_Toolbar_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_item_icon_object_get, Efl_Canvas_Object *, NULL); + +void _elm_toolbar_item_separator_set(Eo *obj, Elm_Toolbar_Item_Data *pd, Eina_Bool separator); + + +static Eina_Error +__eolian_elm_toolbar_item_separator_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_toolbar_item_separator_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_toolbar_item_separator_set, EFL_FUNC_CALL(separator), Eina_Bool separator); + +Eina_Bool _elm_toolbar_item_separator_get(const Eo *obj, Elm_Toolbar_Item_Data *pd); + + +static Eina_Value +__eolian_elm_toolbar_item_separator_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_toolbar_item_separator_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_item_separator_get, Eina_Bool, 0); + +Efl_Canvas_Object *_elm_toolbar_item_menu_get(const Eo *obj, Elm_Toolbar_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_item_menu_get, Efl_Canvas_Object *, NULL); + +Eina_Bool _elm_toolbar_item_state_set(Eo *obj, Elm_Toolbar_Item_Data *pd, Elm_Toolbar_Item_State *state); + +EOAPI EFL_FUNC_BODYV(elm_obj_toolbar_item_state_set, Eina_Bool, 0, EFL_FUNC_CALL(state), Elm_Toolbar_Item_State *state); + +Elm_Toolbar_Item_State *_elm_toolbar_item_state_get(const Eo *obj, Elm_Toolbar_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_toolbar_item_state_get, Elm_Toolbar_Item_State *, NULL); + +Eina_Bool _elm_toolbar_item_icon_memfile_set(Eo *obj, Elm_Toolbar_Item_Data *pd, const void *img, size_t size, const char *format, const char *key); + +EOAPI EFL_FUNC_BODYV(elm_obj_toolbar_item_icon_memfile_set, Eina_Bool, 0, EFL_FUNC_CALL(img, size, format, key), const void *img, size_t size, const char *format, const char *key); + +Eina_Bool _elm_toolbar_item_icon_file_set(Eo *obj, Elm_Toolbar_Item_Data *pd, const char *file, const char *key); + +EOAPI EFL_FUNC_BODYV(elm_obj_toolbar_item_icon_file_set, Eina_Bool, 0, EFL_FUNC_CALL(file, key), const char *file, const char *key); + +Elm_Toolbar_Item_State *_elm_toolbar_item_state_add(Eo *obj, Elm_Toolbar_Item_Data *pd, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_toolbar_item_state_add, Elm_Toolbar_Item_State *, NULL, EFL_FUNC_CALL(icon, label, func, data), const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +Eina_Bool _elm_toolbar_item_state_del(Eo *obj, Elm_Toolbar_Item_Data *pd, Elm_Toolbar_Item_State *state); + +EOAPI EFL_FUNC_BODYV(elm_obj_toolbar_item_state_del, Eina_Bool, 0, EFL_FUNC_CALL(state), Elm_Toolbar_Item_State *state); + +Elm_Toolbar_Item_State *_elm_toolbar_item_state_next(Eo *obj, Elm_Toolbar_Item_Data *pd); + +EOAPI EFL_FUNC_BODY(elm_obj_toolbar_item_state_next, Elm_Toolbar_Item_State *, NULL); + +Elm_Toolbar_Item_State *_elm_toolbar_item_state_prev(Eo *obj, Elm_Toolbar_Item_Data *pd); + +EOAPI EFL_FUNC_BODY(elm_obj_toolbar_item_state_prev, Elm_Toolbar_Item_State *, NULL); + +void _elm_toolbar_item_show(Eo *obj, Elm_Toolbar_Item_Data *pd, Elm_Toolbar_Item_Scrollto_Type scrollto); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_toolbar_item_show, EFL_FUNC_CALL(scrollto), Elm_Toolbar_Item_Scrollto_Type scrollto); + +void _elm_toolbar_item_bring_in(Eo *obj, Elm_Toolbar_Item_Data *pd, Elm_Toolbar_Item_Scrollto_Type scrollto); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_toolbar_item_bring_in, EFL_FUNC_CALL(scrollto), Elm_Toolbar_Item_Scrollto_Type scrollto); + +void _elm_toolbar_item_menu_set(Eo *obj, Elm_Toolbar_Item_Data *pd, Eina_Bool menu); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_toolbar_item_menu_set, EFL_FUNC_CALL(menu), Eina_Bool menu); + +Efl_Object *_elm_toolbar_item_efl_object_constructor(Eo *obj, Elm_Toolbar_Item_Data *pd); + + +void _elm_toolbar_item_efl_object_invalidate(Eo *obj, Elm_Toolbar_Item_Data *pd); + + +void _elm_toolbar_item_elm_widget_item_disable(Eo *obj, Elm_Toolbar_Item_Data *pd); + + +void _elm_toolbar_item_elm_widget_item_disabled_set(Eo *obj, Elm_Toolbar_Item_Data *pd, Eina_Bool disable); + + +void _elm_toolbar_item_elm_widget_item_item_focus_set(Eo *obj, Elm_Toolbar_Item_Data *pd, Eina_Bool focused); + + +Eina_Bool _elm_toolbar_item_elm_widget_item_item_focus_get(const Eo *obj, Elm_Toolbar_Item_Data *pd); + + +void _elm_toolbar_item_elm_widget_item_signal_emit(Eo *obj, Elm_Toolbar_Item_Data *pd, const char *emission, const char *source); + + +void _elm_toolbar_item_elm_widget_item_part_text_set(Eo *obj, Elm_Toolbar_Item_Data *pd, const char *part, const char *label); + + +const char *_elm_toolbar_item_elm_widget_item_part_text_get(const Eo *obj, Elm_Toolbar_Item_Data *pd, const char *part); + + +void _elm_toolbar_item_elm_widget_item_part_content_set(Eo *obj, Elm_Toolbar_Item_Data *pd, const char *part, Efl_Canvas_Object *content); + + +Efl_Canvas_Object *_elm_toolbar_item_elm_widget_item_part_content_get(const Eo *obj, Elm_Toolbar_Item_Data *pd, const char *part); + + +Efl_Canvas_Object *_elm_toolbar_item_elm_widget_item_part_content_unset(Eo *obj, Elm_Toolbar_Item_Data *pd, const char *part); + + +Eina_Rect _elm_toolbar_item_efl_ui_focus_object_focus_geometry_get(const Eo *obj, Elm_Toolbar_Item_Data *pd); + + +void _elm_toolbar_item_efl_ui_focus_object_focus_set(Eo *obj, Elm_Toolbar_Item_Data *pd, Eina_Bool focus); + + +Efl_Ui_Focus_Object *_elm_toolbar_item_efl_ui_focus_object_focus_parent_get(const Eo *obj, Elm_Toolbar_Item_Data *pd); + + +const char *_elm_toolbar_item_efl_access_object_i18n_name_get(const Eo *obj, Elm_Toolbar_Item_Data *pd); + + +Efl_Access_State_Set _elm_toolbar_item_efl_access_object_state_set_get(const Eo *obj, Elm_Toolbar_Item_Data *pd); + + +static Eina_Bool +_elm_toolbar_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_TOOLBAR_ITEM_EXTRA_OPS +#define ELM_TOOLBAR_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_prev_get, _elm_toolbar_item_prev_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_next_get, _elm_toolbar_item_next_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_selected_set, _elm_toolbar_item_selected_set), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_selected_get, _elm_toolbar_item_selected_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_priority_set, _elm_toolbar_item_priority_set), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_priority_get, _elm_toolbar_item_priority_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_icon_set, _elm_toolbar_item_icon_set), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_icon_get, _elm_toolbar_item_icon_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_object_get, _elm_toolbar_item_object_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_icon_object_get, _elm_toolbar_item_icon_object_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_separator_set, _elm_toolbar_item_separator_set), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_separator_get, _elm_toolbar_item_separator_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_menu_get, _elm_toolbar_item_menu_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_state_set, _elm_toolbar_item_state_set), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_state_get, _elm_toolbar_item_state_get), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_icon_memfile_set, _elm_toolbar_item_icon_memfile_set), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_icon_file_set, _elm_toolbar_item_icon_file_set), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_state_add, _elm_toolbar_item_state_add), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_state_del, _elm_toolbar_item_state_del), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_state_next, _elm_toolbar_item_state_next), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_state_prev, _elm_toolbar_item_state_prev), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_show, _elm_toolbar_item_show), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_bring_in, _elm_toolbar_item_bring_in), + EFL_OBJECT_OP_FUNC(elm_obj_toolbar_item_menu_set, _elm_toolbar_item_menu_set), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_toolbar_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_invalidate, _elm_toolbar_item_efl_object_invalidate), + EFL_OBJECT_OP_FUNC(elm_wdg_item_disable, _elm_toolbar_item_elm_widget_item_disable), + EFL_OBJECT_OP_FUNC(elm_wdg_item_disabled_set, _elm_toolbar_item_elm_widget_item_disabled_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_set, _elm_toolbar_item_elm_widget_item_item_focus_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_get, _elm_toolbar_item_elm_widget_item_item_focus_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_signal_emit, _elm_toolbar_item_elm_widget_item_signal_emit), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_set, _elm_toolbar_item_elm_widget_item_part_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_get, _elm_toolbar_item_elm_widget_item_part_text_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_set, _elm_toolbar_item_elm_widget_item_part_content_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_get, _elm_toolbar_item_elm_widget_item_part_content_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_unset, _elm_toolbar_item_elm_widget_item_part_content_unset), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_focus_geometry_get, _elm_toolbar_item_efl_ui_focus_object_focus_geometry_get), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_focus_set, _elm_toolbar_item_efl_ui_focus_object_focus_set), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_focus_parent_get, _elm_toolbar_item_efl_ui_focus_object_focus_parent_get), + EFL_OBJECT_OP_FUNC(efl_access_object_i18n_name_get, _elm_toolbar_item_efl_access_object_i18n_name_get), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_toolbar_item_efl_access_object_state_set_get), + ELM_TOOLBAR_ITEM_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"selected", __eolian_elm_toolbar_item_selected_set_reflect, __eolian_elm_toolbar_item_selected_get_reflect}, + {"priority", __eolian_elm_toolbar_item_priority_set_reflect, __eolian_elm_toolbar_item_priority_get_reflect}, + {"icon", __eolian_elm_toolbar_item_icon_set_reflect, __eolian_elm_toolbar_item_icon_get_reflect}, + {"separator", __eolian_elm_toolbar_item_separator_set_reflect, __eolian_elm_toolbar_item_separator_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_toolbar_item_class_desc = { + EO_VERSION, + "Elm.Toolbar_Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Toolbar_Item_Data), + _elm_toolbar_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_toolbar_item_class_get, &_elm_toolbar_item_class_desc, ELM_WIDGET_ITEM_CLASS, EFL_UI_FOCUS_OBJECT_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_toolbar_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_toolbar_item_eo.h b/src/lib/elementary/elm_toolbar_item_eo.h new file mode 100644 index 0000000000..44bb2d9810 --- /dev/null +++ b/src/lib/elementary/elm_toolbar_item_eo.h @@ -0,0 +1,410 @@ +#ifndef _ELM_TOOLBAR_ITEM_EO_H_ +#define _ELM_TOOLBAR_ITEM_EO_H_ + +#ifndef _ELM_TOOLBAR_ITEM_EO_CLASS_TYPE +#define _ELM_TOOLBAR_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Toolbar_Item; + +#endif + +#ifndef _ELM_TOOLBAR_ITEM_EO_TYPES +#define _ELM_TOOLBAR_ITEM_EO_TYPES + +/** Defines where to position the item in the toolbar. + * + * @ingroup Elm + */ +typedef enum +{ + ELM_TOOLBAR_ITEM_SCROLLTO_NONE = 0, /**< no scrollto */ + ELM_TOOLBAR_ITEM_SCROLLTO_IN = 1 /* 1 >> 0 */, /**< to the nearest viewport */ + ELM_TOOLBAR_ITEM_SCROLLTO_FIRST = 2 /* 1 >> 1 */, /**< to the first of + * viewport */ + ELM_TOOLBAR_ITEM_SCROLLTO_MIDDLE = 4 /* 1 >> 2 */, /**< to the middle of + * viewport */ + ELM_TOOLBAR_ITEM_SCROLLTO_LAST = 8 /* 1 >> 3 */ /**< to the last of viewport + */ +} Elm_Toolbar_Item_Scrollto_Type; + +/** State of a Elm_Toolbar_Item. Can be created with + * elm_toolbar_item_state_add() and removed with elm_toolbar_item_state_del(). + * + * @ingroup Elm + */ +typedef struct _Elm_Toolbar_Item_State +{ + const char *label; /**< Item label */ + const char *icon_str; /**< Item icon string */ + Efl_Canvas_Object *icon; /**< Item icon */ + Evas_Smart_Cb func; /**< Item callback function */ + const void *data; /**< Item data */ +} Elm_Toolbar_Item_State; + + +#endif +/** Elementary toolbar item class + * + * @ingroup Elm_Toolbar_Item + */ +#define ELM_TOOLBAR_ITEM_CLASS elm_toolbar_item_class_get() + +EWAPI const Efl_Class *elm_toolbar_item_class_get(void); + +/** + * @brief Get the item before this one in the widget's list of items. + * + * See also @ref elm_obj_toolbar_item_next_get. + * + * @param[in] obj The object. + * + * @return The item before the object in its parent's list. If there is no + * previous item or in case of error, @c null is returned. + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI Elm_Widget_Item *elm_obj_toolbar_item_prev_get(const Eo *obj); + +/** + * @brief Get the item after this one in the widget's list of items. + * + * See also @ref elm_obj_toolbar_item_prev_get. + * + * @param[in] obj The object. + * + * @return The item after the object in its parent's list. If there is no next + * item or in case of error, @c null is returned. + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI Elm_Widget_Item *elm_obj_toolbar_item_next_get(const Eo *obj); + +/** + * @brief Indicates whether this item is currently selected. + * + * Set the selected state of @c 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 retrieved with + * @ref elm_obj_toolbar_selected_item_get. + * + * Selected items will be highlighted. + * + * @param[in] obj The object. + * @param[in] selected The selection state. + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI void elm_obj_toolbar_item_selected_set(Eo *obj, Eina_Bool selected); + +/** + * @brief Indicates whether this item is currently selected. + * + * Get the selected state of this item. + * + * @param[in] obj The object. + * + * @return The selection state. + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI Eina_Bool elm_obj_toolbar_item_selected_get(const Eo *obj); + +/** + * @brief Set the priority of a toolbar item. + * + * This is used only when the toolbar shrink mode is set to + * #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_HIDE. When space is less + * than required, items with low priority will be removed from the toolbar and + * added to a dynamically-created menu, while items with higher priority will + * remain on the toolbar, with the same order they were added. + * + * @param[in] obj The object. + * @param[in] priority The @c item priority. The default is zero for set and 0 + * is returned on failure. + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI void elm_obj_toolbar_item_priority_set(Eo *obj, int priority); + +/** + * @brief Get the priority of a toolbar item. + * + * @param[in] obj The object. + * + * @return The @c item priority. The default is zero for set and 0 is returned + * on failure. + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI int elm_obj_toolbar_item_priority_get(const Eo *obj); + +/** + * @brief Set the icon associated with @c item. + * + * Toolbar will load icon image from fdo or current theme. This behavior can be + * set by elm_toolbar_icon_order_lookup_set function. If an absolute path is + * provided it will load it direct from a file. + * + * @note This function does not accept relative icon path. + * + * @param[in] obj The object. + * @param[in] icon A string with icon name or the absolute path of an image + * file. + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI void elm_obj_toolbar_item_icon_set(Eo *obj, const char *icon); + +/** + * @brief Get the string used to set the icon of @c item. + * + * @param[in] obj The object. + * + * @return A string with icon name or the absolute path of an image file. + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI const char *elm_obj_toolbar_item_icon_get(const Eo *obj); + +/** + * @brief Get the real Evas(Edje) object created to implement the view of a + * given toolbar @c item. + * + * @param[in] obj The object. + * + * @return The base Edje object associated with @c it. + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI Efl_Canvas_Object *elm_obj_toolbar_item_object_get(const Eo *obj); + +/** + * @brief Get the icon object of @c item. + * + * See also @ref elm_obj_toolbar_item_icon_set, + * @ref elm_obj_toolbar_item_icon_file_set, + * @ref elm_obj_toolbar_item_icon_memfile_set. + * + * @param[in] obj The object. + * + * @return The icon object. + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI Efl_Canvas_Object *elm_obj_toolbar_item_icon_object_get(const Eo *obj); + +/** + * @brief Set or unset item as a separator. + * + * Items aren't set as separator by default. + * + * If set as separator it will display separator theme, so won't display icons + * or label. + * + * @param[in] obj The object. + * @param[in] separator @c true if the item is a separator, @c false otherwise + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI void elm_obj_toolbar_item_separator_set(Eo *obj, Eina_Bool separator); + +/** + * @brief Get a value whether item is a separator or not. + * + * @param[in] obj The object. + * + * @return @c true if the item is a separator, @c false otherwise + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI Eina_Bool elm_obj_toolbar_item_separator_get(const Eo *obj); + +/** + * @brief Get toolbar item's menu. + * + * If @c item wasn't set as menu item with @ref elm_obj_toolbar_item_menu_set, + * this function will set it. + * + * @param[in] obj The object. + * + * @return Item's menu object or @c null on failure. + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI Efl_Canvas_Object *elm_obj_toolbar_item_menu_get(const Eo *obj); + +/** + * @brief Set @c state as the current state of @c it. + * + * If @c state is @c NULL, it won't select any state and the default item's + * icon and label will be used. It's the behavior as @ref + * elm_toolbar_item_state_unset. + * + * @param[in] obj The object. + * @param[in] state Item state + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI Eina_Bool elm_obj_toolbar_item_state_set(Eo *obj, Elm_Toolbar_Item_State *state); + +/** + * @brief Get the current state of @c it. + * + * @param[in] obj The object. + * + * @return Item state + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI Elm_Toolbar_Item_State *elm_obj_toolbar_item_state_get(const Eo *obj); + +/** + * @brief Set the icon associated with @c item to an image in a binary buffer. + * + * @note The icon image set by this function can be changed by + * @ref elm_obj_toolbar_item_icon_set. + * + * @param[in] obj The object. + * @param[in] img The binary data that will be used as an image. + * @param[in] size The size of binary data @c img. + * @param[in] format Optional format of @c img to pass to the image loader. + * @param[in] key Optional key of @c img to pass to the image loader (eg. if + * @c img is an edje file). + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI Eina_Bool elm_obj_toolbar_item_icon_memfile_set(Eo *obj, const void *img, size_t size, const char *format, const char *key); + +/** + * @brief Set the icon associated with @c item to an image in a binary buffer. + * + * @note The icon image set by this function can be changed by + * elm_toolbar_item_icon_set(). + * + * @param[in] obj The object. + * @param[in] file The file that contains the image. + * @param[in] key Optional key of @c img to pass to the image loader (eg. if + * @c img is an edje file). + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI Eina_Bool elm_obj_toolbar_item_icon_file_set(Eo *obj, const char *file, const char *key); + +/** + * @brief Add a new state to @c item. + * + * Toolbar will load icon image from fdo or current theme. This behavior can be + * set by elm_toolbar_icon_order_lookup_set function. If an absolute path is + * provided it will load it direct from a file. + * + * States created with this function can be removed with + * @ref elm_obj_toolbar_item_state_del. + * + * @param[in] obj The object. + * @param[in] icon A string with icon name or the absolute path of an image + * file. + * @param[in] label The label of the new state. + * @param[in] func The function to call when the item is clicked when this + * state is selected. + * @param[in] data The data to associate with the state. + * + * @return The toolbar item state, or @c null upon failure. + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI Elm_Toolbar_Item_State *elm_obj_toolbar_item_state_add(Eo *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +/** + * @brief Delete a previously added state to @c item. + * + * @param[in] obj The object. + * @param[in] state The state to be deleted. + * + * @return @c true on success or @c false on failure. + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI Eina_Bool elm_obj_toolbar_item_state_del(Eo *obj, Elm_Toolbar_Item_State *state); + +/** + * @brief Get the state after selected state in toolbar's @c item. + * + * If last state is selected, this function will return first state. + * + * @param[in] obj The object. + * + * @return The state after current state, or @c null on failure. + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI Elm_Toolbar_Item_State *elm_obj_toolbar_item_state_next(Eo *obj); + +/** + * @brief Get the state before selected state in toolbar's @c item. + * + * If first state is selected, this function will return last state. + * + * @param[in] obj The object. + * + * @return The state before current state, or @c null on failure. + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI Elm_Toolbar_Item_State *elm_obj_toolbar_item_state_prev(Eo *obj); + +/** + * @brief Show a specific item, when the toolbar can be scrolled. + * + * @param[in] obj The object. + * @param[in] scrollto The position the item should appear at. + * + * @since 1.8 + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI void elm_obj_toolbar_item_show(Eo *obj, Elm_Toolbar_Item_Scrollto_Type scrollto); + +/** + * @brief Show a specific item with scroll animation, when the toolbar can be + * scrolled. + * + * @param[in] obj The object. + * @param[in] scrollto The position the item should appear at. + * + * @since 1.8 + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI void elm_obj_toolbar_item_bring_in(Eo *obj, Elm_Toolbar_Item_Scrollto_Type scrollto); + +/** + * @brief Set whether the toolbar item opens a menu. + * + * A toolbar item can be set to be a menu, using this function. + * + * Once it is set to be a menu, it can be manipulated through the menu-like + * function @ref elm_obj_toolbar_menu_parent_set and the other elm_menu + * functions, using the Evas_Object @c menu returned by + * @ref elm_obj_toolbar_item_menu_get. + * + * So, items to be displayed in this item's menu should be added with @ref + * elm_menu_item_add. + * + * @param[in] obj The object. + * @param[in] menu If @c true, @c item will opens a menu when selected. + * + * @ingroup Elm_Toolbar_Item + */ +EOAPI void elm_obj_toolbar_item_menu_set(Eo *obj, Eina_Bool menu); + +#endif diff --git a/src/lib/elementary/elm_toolbar_item_eo.legacy.c b/src/lib/elementary/elm_toolbar_item_eo.legacy.c new file mode 100644 index 0000000000..ebb4d64f09 --- /dev/null +++ b/src/lib/elementary/elm_toolbar_item_eo.legacy.c @@ -0,0 +1,144 @@ + +EAPI Elm_Widget_Item * +elm_toolbar_item_prev_get(const Elm_Toolbar_Item *obj) +{ + return elm_obj_toolbar_item_prev_get(obj); +} + +EAPI Elm_Widget_Item * +elm_toolbar_item_next_get(const Elm_Toolbar_Item *obj) +{ + return elm_obj_toolbar_item_next_get(obj); +} + +EAPI void +elm_toolbar_item_selected_set(Elm_Toolbar_Item *obj, Eina_Bool selected) +{ + elm_obj_toolbar_item_selected_set(obj, selected); +} + +EAPI Eina_Bool +elm_toolbar_item_selected_get(const Elm_Toolbar_Item *obj) +{ + return elm_obj_toolbar_item_selected_get(obj); +} + +EAPI void +elm_toolbar_item_priority_set(Elm_Toolbar_Item *obj, int priority) +{ + elm_obj_toolbar_item_priority_set(obj, priority); +} + +EAPI int +elm_toolbar_item_priority_get(const Elm_Toolbar_Item *obj) +{ + return elm_obj_toolbar_item_priority_get(obj); +} + +EAPI void +elm_toolbar_item_icon_set(Elm_Toolbar_Item *obj, const char *icon) +{ + elm_obj_toolbar_item_icon_set(obj, icon); +} + +EAPI const char * +elm_toolbar_item_icon_get(const Elm_Toolbar_Item *obj) +{ + return elm_obj_toolbar_item_icon_get(obj); +} + +EAPI Efl_Canvas_Object * +elm_toolbar_item_object_get(const Elm_Toolbar_Item *obj) +{ + return elm_obj_toolbar_item_object_get(obj); +} + +EAPI Efl_Canvas_Object * +elm_toolbar_item_icon_object_get(const Elm_Toolbar_Item *obj) +{ + return elm_obj_toolbar_item_icon_object_get(obj); +} + +EAPI void +elm_toolbar_item_separator_set(Elm_Toolbar_Item *obj, Eina_Bool separator) +{ + elm_obj_toolbar_item_separator_set(obj, separator); +} + +EAPI Eina_Bool +elm_toolbar_item_separator_get(const Elm_Toolbar_Item *obj) +{ + return elm_obj_toolbar_item_separator_get(obj); +} + +EAPI Efl_Canvas_Object * +elm_toolbar_item_menu_get(const Elm_Toolbar_Item *obj) +{ + return elm_obj_toolbar_item_menu_get(obj); +} + +EAPI Eina_Bool +elm_toolbar_item_state_set(Elm_Toolbar_Item *obj, Elm_Toolbar_Item_State *state) +{ + return elm_obj_toolbar_item_state_set(obj, state); +} + +EAPI Elm_Toolbar_Item_State * +elm_toolbar_item_state_get(const Elm_Toolbar_Item *obj) +{ + return elm_obj_toolbar_item_state_get(obj); +} + +EAPI Eina_Bool +elm_toolbar_item_icon_memfile_set(Elm_Toolbar_Item *obj, const void *img, size_t size, const char *format, const char *key) +{ + return elm_obj_toolbar_item_icon_memfile_set(obj, img, size, format, key); +} + +EAPI Eina_Bool +elm_toolbar_item_icon_file_set(Elm_Toolbar_Item *obj, const char *file, const char *key) +{ + return elm_obj_toolbar_item_icon_file_set(obj, file, key); +} + +EAPI Elm_Toolbar_Item_State * +elm_toolbar_item_state_add(Elm_Toolbar_Item *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_toolbar_item_state_add(obj, icon, label, func, data); +} + +EAPI Eina_Bool +elm_toolbar_item_state_del(Elm_Toolbar_Item *obj, Elm_Toolbar_Item_State *state) +{ + return elm_obj_toolbar_item_state_del(obj, state); +} + +EAPI Elm_Toolbar_Item_State * +elm_toolbar_item_state_next(Elm_Toolbar_Item *obj) +{ + return elm_obj_toolbar_item_state_next(obj); +} + +EAPI Elm_Toolbar_Item_State * +elm_toolbar_item_state_prev(Elm_Toolbar_Item *obj) +{ + return elm_obj_toolbar_item_state_prev(obj); +} + +EAPI void +elm_toolbar_item_show(Elm_Toolbar_Item *obj, Elm_Toolbar_Item_Scrollto_Type scrollto) +{ + elm_obj_toolbar_item_show(obj, scrollto); +} + +EAPI void +elm_toolbar_item_bring_in(Elm_Toolbar_Item *obj, Elm_Toolbar_Item_Scrollto_Type scrollto) +{ + elm_obj_toolbar_item_bring_in(obj, scrollto); +} + +EAPI void +elm_toolbar_item_menu_set(Elm_Toolbar_Item *obj, Eina_Bool menu) +{ + elm_obj_toolbar_item_menu_set(obj, menu); +} diff --git a/src/lib/elementary/elm_toolbar_item_eo.legacy.h b/src/lib/elementary/elm_toolbar_item_eo.legacy.h new file mode 100644 index 0000000000..8caac89692 --- /dev/null +++ b/src/lib/elementary/elm_toolbar_item_eo.legacy.h @@ -0,0 +1,401 @@ +#ifndef _ELM_TOOLBAR_ITEM_EO_LEGACY_H_ +#define _ELM_TOOLBAR_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_TOOLBAR_ITEM_EO_CLASS_TYPE +#define _ELM_TOOLBAR_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Toolbar_Item; + +#endif + +#ifndef _ELM_TOOLBAR_ITEM_EO_TYPES +#define _ELM_TOOLBAR_ITEM_EO_TYPES + +/** Defines where to position the item in the toolbar. + * + * @ingroup Elm + */ +typedef enum +{ + ELM_TOOLBAR_ITEM_SCROLLTO_NONE = 0, /**< no scrollto */ + ELM_TOOLBAR_ITEM_SCROLLTO_IN = 1 /* 1 >> 0 */, /**< to the nearest viewport */ + ELM_TOOLBAR_ITEM_SCROLLTO_FIRST = 2 /* 1 >> 1 */, /**< to the first of + * viewport */ + ELM_TOOLBAR_ITEM_SCROLLTO_MIDDLE = 4 /* 1 >> 2 */, /**< to the middle of + * viewport */ + ELM_TOOLBAR_ITEM_SCROLLTO_LAST = 8 /* 1 >> 3 */ /**< to the last of viewport + */ +} Elm_Toolbar_Item_Scrollto_Type; + +/** State of a Elm_Toolbar_Item. Can be created with + * elm_toolbar_item_state_add() and removed with elm_toolbar_item_state_del(). + * + * @ingroup Elm + */ +typedef struct _Elm_Toolbar_Item_State +{ + const char *label; /**< Item label */ + const char *icon_str; /**< Item icon string */ + Efl_Canvas_Object *icon; /**< Item icon */ + Evas_Smart_Cb func; /**< Item callback function */ + const void *data; /**< Item data */ +} Elm_Toolbar_Item_State; + + +#endif + +/** + * @brief Get the item before this one in the widget's list of items. + * + * See also @ref elm_toolbar_item_next_get. + * + * @param[in] obj The object. + * + * @return The item before the object in its parent's list. If there is no + * previous item or in case of error, @c null is returned. + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI Elm_Widget_Item *elm_toolbar_item_prev_get(const Elm_Toolbar_Item *obj); + +/** + * @brief Get the item after this one in the widget's list of items. + * + * See also @ref elm_toolbar_item_prev_get. + * + * @param[in] obj The object. + * + * @return The item after the object in its parent's list. If there is no next + * item or in case of error, @c null is returned. + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI Elm_Widget_Item *elm_toolbar_item_next_get(const Elm_Toolbar_Item *obj); + +/** + * @brief Indicates whether this item is currently selected. + * + * Set the selected state of @c 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 retrieved with + * @ref elm_toolbar_selected_item_get. + * + * Selected items will be highlighted. + * + * @param[in] obj The object. + * @param[in] selected The selection state. + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI void elm_toolbar_item_selected_set(Elm_Toolbar_Item *obj, Eina_Bool selected); + +/** + * @brief Indicates whether this item is currently selected. + * + * Get the selected state of this item. + * + * @param[in] obj The object. + * + * @return The selection state. + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI Eina_Bool elm_toolbar_item_selected_get(const Elm_Toolbar_Item *obj); + +/** + * @brief Set the priority of a toolbar item. + * + * This is used only when the toolbar shrink mode is set to + * #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_HIDE. When space is less + * than required, items with low priority will be removed from the toolbar and + * added to a dynamically-created menu, while items with higher priority will + * remain on the toolbar, with the same order they were added. + * + * @param[in] obj The object. + * @param[in] priority The @c item priority. The default is zero for set and 0 + * is returned on failure. + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI void elm_toolbar_item_priority_set(Elm_Toolbar_Item *obj, int priority); + +/** + * @brief Get the priority of a toolbar item. + * + * @param[in] obj The object. + * + * @return The @c item priority. The default is zero for set and 0 is returned + * on failure. + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI int elm_toolbar_item_priority_get(const Elm_Toolbar_Item *obj); + +/** + * @brief Set the icon associated with @c item. + * + * Toolbar will load icon image from fdo or current theme. This behavior can be + * set by elm_toolbar_icon_order_lookup_set function. If an absolute path is + * provided it will load it direct from a file. + * + * @note This function does not accept relative icon path. + * + * @param[in] obj The object. + * @param[in] icon A string with icon name or the absolute path of an image + * file. + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI void elm_toolbar_item_icon_set(Elm_Toolbar_Item *obj, const char *icon); + +/** + * @brief Get the string used to set the icon of @c item. + * + * @param[in] obj The object. + * + * @return A string with icon name or the absolute path of an image file. + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI const char *elm_toolbar_item_icon_get(const Elm_Toolbar_Item *obj); + +/** + * @brief Get the real Evas(Edje) object created to implement the view of a + * given toolbar @c item. + * + * @param[in] obj The object. + * + * @return The base Edje object associated with @c it. + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI Efl_Canvas_Object *elm_toolbar_item_object_get(const Elm_Toolbar_Item *obj); + +/** + * @brief Get the icon object of @c item. + * + * See also @ref elm_toolbar_item_icon_set, + * @ref elm_toolbar_item_icon_file_set, @ref elm_toolbar_item_icon_memfile_set. + * + * @param[in] obj The object. + * + * @return The icon object. + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI Efl_Canvas_Object *elm_toolbar_item_icon_object_get(const Elm_Toolbar_Item *obj); + +/** + * @brief Set or unset item as a separator. + * + * Items aren't set as separator by default. + * + * If set as separator it will display separator theme, so won't display icons + * or label. + * + * @param[in] obj The object. + * @param[in] separator @c true if the item is a separator, @c false otherwise + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI void elm_toolbar_item_separator_set(Elm_Toolbar_Item *obj, Eina_Bool separator); + +/** + * @brief Get a value whether item is a separator or not. + * + * @param[in] obj The object. + * + * @return @c true if the item is a separator, @c false otherwise + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI Eina_Bool elm_toolbar_item_separator_get(const Elm_Toolbar_Item *obj); + +/** + * @brief Get toolbar item's menu. + * + * If @c item wasn't set as menu item with @ref elm_toolbar_item_menu_set, this + * function will set it. + * + * @param[in] obj The object. + * + * @return Item's menu object or @c null on failure. + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI Efl_Canvas_Object *elm_toolbar_item_menu_get(const Elm_Toolbar_Item *obj); + +/** + * @brief Set @c state as the current state of @c it. + * + * If @c state is @c NULL, it won't select any state and the default item's + * icon and label will be used. It's the behavior as @ref + * elm_toolbar_item_state_unset. + * + * @param[in] obj The object. + * @param[in] state Item state + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI Eina_Bool elm_toolbar_item_state_set(Elm_Toolbar_Item *obj, Elm_Toolbar_Item_State *state); + +/** + * @brief Get the current state of @c it. + * + * @param[in] obj The object. + * + * @return Item state + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_get(const Elm_Toolbar_Item *obj); + +/** + * @brief Set the icon associated with @c item to an image in a binary buffer. + * + * @note The icon image set by this function can be changed by + * @ref elm_toolbar_item_icon_set. + * + * @param[in] obj The object. + * @param[in] img The binary data that will be used as an image. + * @param[in] size The size of binary data @c img. + * @param[in] format Optional format of @c img to pass to the image loader. + * @param[in] key Optional key of @c img to pass to the image loader (eg. if + * @c img is an edje file). + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI Eina_Bool elm_toolbar_item_icon_memfile_set(Elm_Toolbar_Item *obj, const void *img, size_t size, const char *format, const char *key); + +/** + * @brief Set the icon associated with @c item to an image in a binary buffer. + * + * @note The icon image set by this function can be changed by + * elm_toolbar_item_icon_set(). + * + * @param[in] obj The object. + * @param[in] file The file that contains the image. + * @param[in] key Optional key of @c img to pass to the image loader (eg. if + * @c img is an edje file). + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI Eina_Bool elm_toolbar_item_icon_file_set(Elm_Toolbar_Item *obj, const char *file, const char *key); + +/** + * @brief Add a new state to @c item. + * + * Toolbar will load icon image from fdo or current theme. This behavior can be + * set by elm_toolbar_icon_order_lookup_set function. If an absolute path is + * provided it will load it direct from a file. + * + * States created with this function can be removed with + * @ref elm_toolbar_item_state_del. + * + * @param[in] obj The object. + * @param[in] icon A string with icon name or the absolute path of an image + * file. + * @param[in] label The label of the new state. + * @param[in] func The function to call when the item is clicked when this + * state is selected. + * @param[in] data The data to associate with the state. + * + * @return The toolbar item state, or @c null upon failure. + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_add(Elm_Toolbar_Item *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +/** + * @brief Delete a previously added state to @c item. + * + * @param[in] obj The object. + * @param[in] state The state to be deleted. + * + * @return @c true on success or @c false on failure. + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI Eina_Bool elm_toolbar_item_state_del(Elm_Toolbar_Item *obj, Elm_Toolbar_Item_State *state); + +/** + * @brief Get the state after selected state in toolbar's @c item. + * + * If last state is selected, this function will return first state. + * + * @param[in] obj The object. + * + * @return The state after current state, or @c null on failure. + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_next(Elm_Toolbar_Item *obj); + +/** + * @brief Get the state before selected state in toolbar's @c item. + * + * If first state is selected, this function will return last state. + * + * @param[in] obj The object. + * + * @return The state before current state, or @c null on failure. + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_prev(Elm_Toolbar_Item *obj); + +/** + * @brief Show a specific item, when the toolbar can be scrolled. + * + * @param[in] obj The object. + * @param[in] scrollto The position the item should appear at. + * + * @since 1.8 + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI void elm_toolbar_item_show(Elm_Toolbar_Item *obj, Elm_Toolbar_Item_Scrollto_Type scrollto); + +/** + * @brief Show a specific item with scroll animation, when the toolbar can be + * scrolled. + * + * @param[in] obj The object. + * @param[in] scrollto The position the item should appear at. + * + * @since 1.8 + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI void elm_toolbar_item_bring_in(Elm_Toolbar_Item *obj, Elm_Toolbar_Item_Scrollto_Type scrollto); + +/** + * @brief Set whether the toolbar item opens a menu. + * + * A toolbar item can be set to be a menu, using this function. + * + * Once it is set to be a menu, it can be manipulated through the menu-like + * function @ref elm_toolbar_menu_parent_set and the other elm_menu functions, + * using the Evas_Object @c menu returned by @ref elm_toolbar_item_menu_get. + * + * So, items to be displayed in this item's menu should be added with @ref + * elm_menu_item_add. + * + * @param[in] obj The object. + * @param[in] menu If @c true, @c item will opens a menu when selected. + * + * @ingroup Elm_Toolbar_Item_Group + */ +EAPI void elm_toolbar_item_menu_set(Elm_Toolbar_Item *obj, Eina_Bool menu); + +#endif diff --git a/src/lib/elementary/elm_toolbar_legacy.h b/src/lib/elementary/elm_toolbar_legacy.h index 9d0fe5b007..65cdf7e6fb 100644 --- a/src/lib/elementary/elm_toolbar_legacy.h +++ b/src/lib/elementary/elm_toolbar_legacy.h @@ -109,5 +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); -#include "elm_toolbar_item.eo.legacy.h" -#include "elm_toolbar.eo.legacy.h" +#include "elm_toolbar_item_eo.legacy.h" +#include "elm_toolbar_eo.legacy.h" diff --git a/src/lib/elementary/elm_transit.h b/src/lib/elementary/elm_transit.h index a045af265e..cd8ad3a0ec 100644 --- a/src/lib/elementary/elm_transit.h +++ b/src/lib/elementary/elm_transit.h @@ -545,7 +545,7 @@ EAPI void elm_transit_tween_mode_factor_get(const Elm_Transit * ELM_TRANSIT_TWEEN_MODE_SPRING - Start at 0.0 then "wobble" like a spring rest * position 1.0, and wobble v[1] times, with decay factor of v[0] * ELM_TRANSIT_TWEEN_MODE_BEZIER_CURVE - Use an interpolated cubic-bezier curve - * ajusted with parameters from v[0] to v[3] + * adjusted with parameters from v[0] to v[3] * * @param transit The transit object. * @param v_size The size of the array pointing to v diff --git a/src/lib/elementary/elm_view_form.c b/src/lib/elementary/elm_view_form.c index 4969310f9b..48440682a1 100644 --- a/src/lib/elementary/elm_view_form.c +++ b/src/lib/elementary/elm_view_form.c @@ -9,9 +9,9 @@ #include "elm_view_list.h" #include "elm_priv.h" -#include "elm_entry.eo.h" -#include "elm_thumb.eo.h" -#include "elm_label.eo.h" +#include "elm_entry_eo.h" +#include "elm_thumb_eo.h" +#include "elm_label_eo.h" #include @@ -47,11 +47,11 @@ _link_dying(void* data, Efl_Event const* event) static Eina_Bool _elm_view_widget_add(Elm_View_Form_Data *priv, const char *property, Evas_Object *link) { - if (!efl_isa(link, EFL_UI_MODEL_CONNECT_INTERFACE)) return EINA_FALSE; + if (!efl_isa(link, EFL_UI_PROPERTY_BIND_INTERFACE)) return EINA_FALSE; if (!property) property = "default"; efl_ui_view_model_set(link, priv->model); - efl_ui_model_connect(link, "default", property); + efl_ui_property_bind(link, "default", property); efl_event_callback_add(link, EFL_EVENT_DEL, _link_dying, priv); priv->links = eina_list_append(priv->links, link); @@ -96,4 +96,4 @@ _elm_view_form_widget_add(Eo *obj EINA_UNUSED, Elm_View_Form_Data *priv, const c _elm_view_widget_add(priv, propname, evas); } -#include "elm_view_form.eo.c" +#include "elm_view_form_eo.c" diff --git a/src/lib/elementary/elm_view_form.eo b/src/lib/elementary/elm_view_form.eo deleted file mode 100644 index a6bf4cc6df..0000000000 --- a/src/lib/elementary/elm_view_form.eo +++ /dev/null @@ -1,31 +0,0 @@ -class Elm.View.Form extends Efl.Object -{ - [[Elementary view form class]] - methods { - model_set { - [[Set model - - @since 1.11 - ]] - params { - @in model: Efl.Model; [[Emodel object]] - } - } - widget_add { - [[Add new widget - - @since 1.11 - ]] - params { - @in propname: string; [[Property name]] - @in evas: Efl.Canvas.Object; [[Evas widget]] - } - } - } - implements { - Efl.Object.destructor; - } - constructors { - .model_set; - } -} diff --git a/src/lib/elementary/elm_view_form.h b/src/lib/elementary/elm_view_form.h index 3572c7c725..fc35e48644 100644 --- a/src/lib/elementary/elm_view_form.h +++ b/src/lib/elementary/elm_view_form.h @@ -1,10 +1,10 @@ -#ifdef EFL_EO_API_SUPPORT +#ifdef EFL_BETA_API_SUPPORT #ifndef ELM_VIEW_FORM_H #define ELM_VIEW_FORM_H #include -#include +#include #endif #endif diff --git a/src/lib/elementary/elm_view_form_eo.c b/src/lib/elementary/elm_view_form_eo.c new file mode 100644 index 0000000000..5a0b58d3e7 --- /dev/null +++ b/src/lib/elementary/elm_view_form_eo.c @@ -0,0 +1,45 @@ + +void _elm_view_form_model_set(Eo *obj, Elm_View_Form_Data *pd, Efl_Model *model); + +EOAPI EFL_VOID_FUNC_BODYV(elm_view_form_model_set, EFL_FUNC_CALL(model), Efl_Model *model); + +void _elm_view_form_widget_add(Eo *obj, Elm_View_Form_Data *pd, const char *propname, Efl_Canvas_Object *evas); + +EOAPI EFL_VOID_FUNC_BODYV(elm_view_form_widget_add, EFL_FUNC_CALL(propname, evas), const char *propname, Efl_Canvas_Object *evas); + +void _elm_view_form_efl_object_destructor(Eo *obj, Elm_View_Form_Data *pd); + + +static Eina_Bool +_elm_view_form_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_VIEW_FORM_EXTRA_OPS +#define ELM_VIEW_FORM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_view_form_model_set, _elm_view_form_model_set), + EFL_OBJECT_OP_FUNC(elm_view_form_widget_add, _elm_view_form_widget_add), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_view_form_efl_object_destructor), + ELM_VIEW_FORM_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_view_form_class_desc = { + EO_VERSION, + "Elm.View.Form", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_View_Form_Data), + _elm_view_form_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_view_form_class_get, &_elm_view_form_class_desc, EFL_OBJECT_CLASS, NULL); diff --git a/src/lib/elementary/elm_view_form_eo.h b/src/lib/elementary/elm_view_form_eo.h new file mode 100644 index 0000000000..83dbe7e6c2 --- /dev/null +++ b/src/lib/elementary/elm_view_form_eo.h @@ -0,0 +1,49 @@ +#ifndef _ELM_VIEW_FORM_EO_H_ +#define _ELM_VIEW_FORM_EO_H_ + +#ifndef _ELM_VIEW_FORM_EO_CLASS_TYPE +#define _ELM_VIEW_FORM_EO_CLASS_TYPE + +typedef Eo Elm_View_Form; + +#endif + +#ifndef _ELM_VIEW_FORM_EO_TYPES +#define _ELM_VIEW_FORM_EO_TYPES + + +#endif +/** Elementary view form class + * + * @ingroup Elm_View_Form + */ +#define ELM_VIEW_FORM_CLASS elm_view_form_class_get() + +EWAPI const Efl_Class *elm_view_form_class_get(void); + +/** + * @brief Set model + * + * @param[in] obj The object. + * @param[in] model Emodel object + * + * @since 1.11 + * + * @ingroup Elm_View_Form + */ +EOAPI void elm_view_form_model_set(Eo *obj, Efl_Model *model); + +/** + * @brief Add new widget + * + * @param[in] obj The object. + * @param[in] propname Property name + * @param[in] evas Evas widget + * + * @since 1.11 + * + * @ingroup Elm_View_Form + */ +EOAPI void elm_view_form_widget_add(Eo *obj, const char *propname, Efl_Canvas_Object *evas); + +#endif diff --git a/src/lib/elementary/elm_view_form_eo.legacy.h b/src/lib/elementary/elm_view_form_eo.legacy.h new file mode 100644 index 0000000000..dc641a3abd --- /dev/null +++ b/src/lib/elementary/elm_view_form_eo.legacy.h @@ -0,0 +1,19 @@ +#ifndef _ELM_VIEW_FORM_EO_LEGACY_H_ +#define _ELM_VIEW_FORM_EO_LEGACY_H_ + +#ifndef _ELM_VIEW_FORM_EO_CLASS_TYPE +#define _ELM_VIEW_FORM_EO_CLASS_TYPE + +typedef Eo Elm_View_Form; + +#endif + +#ifndef _ELM_VIEW_FORM_EO_TYPES +#define _ELM_VIEW_FORM_EO_TYPES + + +#endif + + + +#endif diff --git a/src/lib/elementary/elm_view_list.c b/src/lib/elementary/elm_view_list.c index 3ccf1d6f7c..9c52b18589 100644 --- a/src/lib/elementary/elm_view_list.c +++ b/src/lib/elementary/elm_view_list.c @@ -6,7 +6,7 @@ #include #include "elm_priv.h" -#include "elm_genlist.eo.h" +#include "elm_genlist_eo.h" #include @@ -108,7 +108,8 @@ _item_content_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part) if (!idata->item) return NULL; prop = eina_hash_find(idata->priv->connect.properties, part); - if (!prop) prop = part; + // If no property are connected, let's not try to guess randomly. + if (!prop) return NULL; value = efl_model_property_get(idata->model, prop); if (value == NULL) return NULL; @@ -432,4 +433,4 @@ _elm_view_list_model_get(const Eo *obj EINA_UNUSED, Elm_View_List_Data *priv) { return priv->connect.model; } -#include "elm_view_list.eo.c" +#include "elm_view_list_eo.c" diff --git a/src/lib/elementary/elm_view_list.eo b/src/lib/elementary/elm_view_list.eo deleted file mode 100644 index 7a8e777b4d..0000000000 --- a/src/lib/elementary/elm_view_list.eo +++ /dev/null @@ -1,65 +0,0 @@ -import elm_general; - -class Elm.View.List extends Efl.Object -{ - [[Elementary view list class]] - methods { - genlist_set { - [[Constructor wrapper - - @since 1.11 - ]] - params { - @in genlist: Efl.Canvas.Object; [[Genlist object]] - @in item_type: Elm.Genlist.Item.Type; [[Item type]] - @in item_style: string; [[The current item style name. $null would be default.]] - } - } - evas_object_get { - [[Return evas object - - @since 1.11 - ]] - params { - @out widget: Efl.Canvas.Object; [[Returned widget]] - } - } - property_connect { - [[Connect property - - @since 1.11 - ]] - params { - @in property: string; [[Property name]] - @in part: string; [[Edje's theme part]] - } - } - @property model { - set { - [[Set model - - @since 1.11 - ]] - } - get { - [[Get model - - @since 1.11 - ]] - } - 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: Efl.Object; [[Called when model was selected]] - } - implements { - Efl.Object.destructor; - } - constructors { - .genlist_set; - } -} diff --git a/src/lib/elementary/elm_view_list.h b/src/lib/elementary/elm_view_list.h index 7d9823e810..7f7ef5a553 100644 --- a/src/lib/elementary/elm_view_list.h +++ b/src/lib/elementary/elm_view_list.h @@ -1,10 +1,10 @@ -#ifdef EFL_EO_API_SUPPORT +#ifdef EFL_BETA_API_SUPPORT #ifndef ELM_VIEW_LIST_H #define ELM_VIEW_LIST_H #include -#include +#include #endif #endif // ELM_VIEW_LIST_H diff --git a/src/lib/elementary/elm_view_list_eo.c b/src/lib/elementary/elm_view_list_eo.c new file mode 100644 index 0000000000..3c9a8c208b --- /dev/null +++ b/src/lib/elementary/elm_view_list_eo.c @@ -0,0 +1,62 @@ +EWAPI const Efl_Event_Description _ELM_VIEW_LIST_EVENT_MODEL_SELECTED = + EFL_EVENT_DESCRIPTION("model,selected"); + +void _elm_view_list_genlist_set(Eo *obj, Elm_View_List_Data *pd, Efl_Canvas_Object *genlist, Elm_Genlist_Item_Type item_type, const char *item_style); + +EOAPI EFL_VOID_FUNC_BODYV(elm_view_list_genlist_set, EFL_FUNC_CALL(genlist, item_type, item_style), Efl_Canvas_Object *genlist, Elm_Genlist_Item_Type item_type, const char *item_style); + +void _elm_view_list_evas_object_get(Eo *obj, Elm_View_List_Data *pd, Efl_Canvas_Object **widget); + +EOAPI EFL_VOID_FUNC_BODYV(elm_view_list_evas_object_get, EFL_FUNC_CALL(widget), Efl_Canvas_Object **widget); + +void _elm_view_list_property_connect(Eo *obj, Elm_View_List_Data *pd, const char *property, const char *part); + +EOAPI EFL_VOID_FUNC_BODYV(elm_view_list_property_connect, EFL_FUNC_CALL(property, part), const char *property, const char *part); + +void _elm_view_list_model_set(Eo *obj, Elm_View_List_Data *pd, Efl_Model *model); + +EOAPI EFL_VOID_FUNC_BODYV(elm_view_list_model_set, EFL_FUNC_CALL(model), Efl_Model *model); + +Efl_Model *_elm_view_list_model_get(const Eo *obj, Elm_View_List_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_view_list_model_get, Efl_Model *, NULL); + +void _elm_view_list_efl_object_destructor(Eo *obj, Elm_View_List_Data *pd); + + +static Eina_Bool +_elm_view_list_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_VIEW_LIST_EXTRA_OPS +#define ELM_VIEW_LIST_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_view_list_genlist_set, _elm_view_list_genlist_set), + EFL_OBJECT_OP_FUNC(elm_view_list_evas_object_get, _elm_view_list_evas_object_get), + EFL_OBJECT_OP_FUNC(elm_view_list_property_connect, _elm_view_list_property_connect), + EFL_OBJECT_OP_FUNC(elm_view_list_model_set, _elm_view_list_model_set), + EFL_OBJECT_OP_FUNC(elm_view_list_model_get, _elm_view_list_model_get), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_view_list_efl_object_destructor), + ELM_VIEW_LIST_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_view_list_class_desc = { + EO_VERSION, + "Elm.View.List", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_View_List_Data), + _elm_view_list_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_view_list_class_get, &_elm_view_list_class_desc, EFL_OBJECT_CLASS, NULL); diff --git a/src/lib/elementary/elm_view_list_eo.h b/src/lib/elementary/elm_view_list_eo.h new file mode 100644 index 0000000000..f35c275c3b --- /dev/null +++ b/src/lib/elementary/elm_view_list_eo.h @@ -0,0 +1,97 @@ +#ifndef _ELM_VIEW_LIST_EO_H_ +#define _ELM_VIEW_LIST_EO_H_ + +#ifndef _ELM_VIEW_LIST_EO_CLASS_TYPE +#define _ELM_VIEW_LIST_EO_CLASS_TYPE + +typedef Eo Elm_View_List; + +#endif + +#ifndef _ELM_VIEW_LIST_EO_TYPES +#define _ELM_VIEW_LIST_EO_TYPES + + +#endif +/** Elementary view list class + * + * @ingroup Elm_View_List + */ +#define ELM_VIEW_LIST_CLASS elm_view_list_class_get() + +EWAPI const Efl_Class *elm_view_list_class_get(void); + +/** + * @brief Constructor wrapper + * + * @param[in] obj The object. + * @param[in] genlist Genlist object + * @param[in] item_type Item type + * @param[in] item_style The current item style name. @c null would be default. + * + * @since 1.11 + * + * @ingroup Elm_View_List + */ +EOAPI void elm_view_list_genlist_set(Eo *obj, Efl_Canvas_Object *genlist, Elm_Genlist_Item_Type item_type, const char *item_style); + +/** + * @brief Return evas object + * + * @param[in] obj The object. + * @param[out] widget Returned widget + * + * @since 1.11 + * + * @ingroup Elm_View_List + */ +EOAPI void elm_view_list_evas_object_get(Eo *obj, Efl_Canvas_Object **widget); + +/** + * @brief Connect property + * + * @param[in] obj The object. + * @param[in] property Property name + * @param[in] part Edje's theme part + * + * @since 1.11 + * + * @ingroup Elm_View_List + */ +EOAPI void elm_view_list_property_connect(Eo *obj, const char *property, const char *part); + +/** + * @brief Set model + * + * @param[in] obj The object. + * @param[in] model Efl.Model to set + * + * @since 1.11 + * + * @ingroup Elm_View_List + */ +EOAPI void elm_view_list_model_set(Eo *obj, Efl_Model *model); + +/** + * @brief Get model + * + * @param[in] obj The object. + * + * @return Efl.Model to set + * + * @since 1.11 + * + * @ingroup Elm_View_List + */ +EOAPI Efl_Model *elm_view_list_model_get(const Eo *obj); + +EWAPI extern const Efl_Event_Description _ELM_VIEW_LIST_EVENT_MODEL_SELECTED; + +/** Called when model was selected + * @return Efl_Object * + * + * @ingroup Elm_View_List + */ +#define ELM_VIEW_LIST_EVENT_MODEL_SELECTED (&(_ELM_VIEW_LIST_EVENT_MODEL_SELECTED)) + +#endif diff --git a/src/lib/elementary/elm_view_list_eo.legacy.h b/src/lib/elementary/elm_view_list_eo.legacy.h new file mode 100644 index 0000000000..d218aa2e3a --- /dev/null +++ b/src/lib/elementary/elm_view_list_eo.legacy.h @@ -0,0 +1,22 @@ +#ifndef _ELM_VIEW_LIST_EO_LEGACY_H_ +#define _ELM_VIEW_LIST_EO_LEGACY_H_ + +#ifndef _ELM_VIEW_LIST_EO_CLASS_TYPE +#define _ELM_VIEW_LIST_EO_CLASS_TYPE + +typedef Eo Elm_View_List; + +#endif + +#ifndef _ELM_VIEW_LIST_EO_TYPES +#define _ELM_VIEW_LIST_EO_TYPES + + +#endif + + + + + + +#endif diff --git a/src/lib/elementary/elm_web.eo b/src/lib/elementary/elm_web.eo deleted file mode 100644 index 42930883b0..0000000000 --- a/src/lib/elementary/elm_web.eo +++ /dev/null @@ -1,451 +0,0 @@ -type Elm_Web_Console_Message: __undefined_type; [[Elementary web console message type]] -type Elm_Web_Window_Open: __undefined_type; [[Elementary web window open type]] -type Elm_Web_Dialog_File_Selector: __undefined_type; [[Elementary web dialog file selector type]] -type Elm_Web_Dialog_Confirm: __undefined_type; [[Elementary web dialog confirm type]] -type Elm_Web_Dialog_Prompt: __undefined_type; [[Elementary web dialog prompt type]] -type Elm_Web_Dialog_Alert: __undefined_type; [[Elementary web dialog alert type]] - -abstract Elm.Web extends Efl.Ui.Widget implements Efl.Ui.Legacy, Efl.Ui.Zoom -{ - [[Elementary web view class]] - legacy_prefix: elm_web; - eo_prefix: elm_obj_web; - event_prefix: elm_web; - methods { - @property text_matches_highlight @pure_virtual { - set { - [[Sets whether to highlight the matched marks. - - If enabled, marks set with @.text_matches_mark will be - highlighted. - ]] - return: bool; [[$true on success, $false otherwise]] - } - get { - [[Get whether highlighting marks is enabled.]] - } - values { - highlight: bool; [[Whether to highlight the marks or not.]] - } - } - @property useragent @pure_virtual { - set { - [[Change useragent of a elm_web object.]] - } - get { - [[Return current useragent of elm_web object.]] - } - values { - user_agent: string; [[String for useragent.]] - } - } - @property url @pure_virtual { - set { - [[Sets the URL for the web object. - - It must be a full URL, with resource included, in the form - http://www.enlightenment.org or file:///tmp/something.html - ]] - return: bool; [[$true on success, $false otherwise]] - } - get { - [[Get the current URL for the object. - - The returned string must not be freed and is guaranteed to be - stringshared. - ]] - } - values { - url: string; [[The URL to set.]] - } - } - @property bg_color @pure_virtual { - set { - [[Sets the background color to be used by the web object. - - This is the color that will be used by default when the - loaded page does not set it's own. Color values are - pre-multiplied. - ]] - } - get { - [[Get the background color to be used by the web object. - - This is the color that will be used by default when the - loaded page does not set it's own. Color values are - pre-multiplied. - ]] - } - values { - r: int; [[Red component.]] - g: int; [[Green component.]] - b: int; [[Blue component.]] - a: int; [[Alpha component.]] - } - } - @property inwin_mode @pure_virtual { - set { - [[Sets the default dialogs to use an Inwin instead of a - normal window. - - If set, then the default implementation for the JavaScript - dialogs and file selector will be opened in an Inwin. - Otherwise they will use a normal separated window. - ]] - } - get { - [[Get whether Inwin mode is set for the current object.]] - } - values { - value: bool; [[$true if dialog will be opened as Inwin, $false otherwise]] - } - } - @property tab_propagate @pure_virtual { - set { - [[Sets whether to use tab propagation. - - If tab propagation is enabled, whenever the user presses the - Tab key, Elementary will handle it and switch focus to the - next widget. The default value is disabled, where WebKit - will handle the Tab key to cycle focus though its internal - objects, jumping to the next widget only when that cycle ends. - ]] - } - get { - [[Get the status of the tab propagation.]] - } - values { - propagate: bool; [[Whether to propagate Tab keys to Elementary or not.]] - } - } - @property history_enabled @pure_virtual { - set { - [[Enables or disables the browsing history.]] - } - get { - [[Get whether browsing history is enabled for the given object.]] - } - values { - enable: bool; [[Whether to enable or disable the browsing history.]] - } - } - @property console_message_hook { - set @pure_virtual { - [[Sets the function to call when a console message is emitted - from JS. - - This hook will be called when a console message is emitted - from JavaScript. There is no default implementation for - this feature. - ]] - } - values { - func: Elm_Web_Console_Message; [[The callback function to be used.]] - data: void_ptr; [[User data.]] - } - } - @property window_create_hook { - set @pure_virtual { - [[Sets the function to call when a new window is requested. - - This hook will be called when a request to create a new - window is issued from the web page loaded. - There is no default implementation for this feature, so - leaving this unset or passing $null in $func will prevent - new windows from opening. - ]] - } - values { - func: Elm_Web_Window_Open @nullable; [[The hook function to be called when a window is requested.]] - data: void_ptr @optional; [[User data.]] - } - } - @property dialog_file_selector_hook { - set @pure_virtual { - [[Sets the function to call when an file selector dialog. - - This hook will be called when a JavaScript file selector - dialog is requested. - If no function is set or $null is passed in $func, the default - implementation will take place. - ]] - } - values { - func: Elm_Web_Dialog_File_Selector @nullable; [[The callback function to be used.]] - data: void_ptr @optional; [[User data.]] - } - } - @property dialog_confirm_hook { - set @pure_virtual { - [[Sets the function to call when an confirm dialog. - - This hook will be called when a JavaScript confirm dialog is - requested. If no function is set or $null is passed in $func, - the default implementation will take place. - ]] - } - values { - func: Elm_Web_Dialog_Confirm @nullable; [[The callback function to be used.]] - data: void_ptr @optional; [[User data.]] - } - } - @property popup_selected { - set @pure_virtual { - [[Tells the web object which index in the currently open popup - was selected. - - When the user handles the popup creation from the - "popup,created" signal, it needs to tell the web object - which item was selected by calling this function with - the index corresponding to the item. - ]] - } - values { - idx: int; [[The index selected.]] - } - } - @property dialog_prompt_hook { - set @pure_virtual { - [[Sets the function to call when an prompt dialog. - - This hook will be called when a JavaScript prompt dialog is - requested. If no function is set or $null is passed in $func, - the default implementation will take place. - ]] - } - values { - func: Elm_Web_Dialog_Prompt @nullable; [[The callback function to be used.]] - data: void_ptr @optional; [[User data.]] - } - } - @property dialog_alert_hook { - set @pure_virtual { - [[Sets the function to call when an alert dialog. - - This hook will be called when a JavaScript alert dialog is - requested. If no function is set or $null is passed in $func, - the default implementation will take place. - ]] - } - values { - func: Elm_Web_Dialog_Alert @nullable; [[Callback function to be used.]] - data: void_ptr @optional; [[User data.]] - } - } - @property forward_possible { - get @pure_virtual { - [[Queries whether it's possible to go forward in history.]] - return: bool; [[$true if it is possible to go forward, $false otherwise]] - } - } - @property webkit_view { - get @pure_virtual { - [[Get internal ewk_view object from web object. - - Elementary may not provide some low level features of EWebKit, - instead of cluttering the API with proxy methods we opted to - return the internal reference. Be careful using it as it may - interfere with elm_web behavior. - ]] - return: Efl.Canvas.Object; [[The internal ewk_view object or $null - if it does not exist. (Failure to - create or Elementary compiled - without ewebkit)]] - } - } - @property back_possible { - get @pure_virtual { - [[Queries whether it's possible to go back in history.]] - return: bool; [[$true if it is possible to go back, $false otherwise]] - } - } - @property load_progress { - get @pure_virtual { - [[Get the overall loading progress of the page. - - Returns the estimated loading progress of the page, with a - value between 0.0 and 1.0. This is an estimated progress - accounting for all the frames included in the page. - ]] - return: double; [[A value between 0.0 and 1.0 indicating the - progress, or -1.0 on failure.]] - } - } - @property selection { - get @pure_virtual { - [[Get a copy of the currently selected text. - - The string returned must be freed by the user when it's done - with it. - ]] - /* FIXME: owned const string? */ - return: string @owned @warn_unused; [[A newly allocated string, or - $null if nothing is selected - or an error occurred.]] - } - } - @property title { - get @pure_virtual { - [[Get the current title. - - The returned string must not be freed and is guaranteed to be - stringshared. - ]] - return: stringshare @owned @warn_unused; [[ - A stringshared internal string with the current title, or $null on - failure. - ]] - } - } - navigate @pure_virtual { - [[Jumps the given number of steps in the browsing history. - - The $steps value can be a negative integer to back in history, - or a positive to move forward. - ]] - return: bool; [[$true on success, $false on error or if not enough - history exists to jump the given number of steps]] - params { - @in steps: int; [[The number of steps to jump.]] - } - } - back @pure_virtual { - [[Goes back one step in the browsing history. - - This is equivalent to calling elm_web_object_navigate(obj, -1); - ]] - return: bool; [[$true on success, $false otherwise]] - } - html_string_load @pure_virtual { - [[Loads the specified $html string as the content of the web - object. - - External objects such as stylesheets or images referenced in - the HTML document are located relative to $base_url. - - If an $unreachable_url is passed it is used as the url for the - loaded content. This is typically used to display error pages - for a failed load. - - @since 1.9 - ]] - return: bool; [[$true on success, $false otherwise]] - params { - @in html: string; [[HTML data to load.]] - @in base_url: string @optional; [[Base URL used for relative paths to external objects (optional).]] - @in unreachable_url: string @optional; [[URL that could not be reached (optional).]] - } - } - text_search @const @pure_virtual { - [[Searches the given string in a document.]] - return: bool; [[$true if the given string was found, $false if not - or failure.]] - params { - @in string: string; [[String to search.]] - @in case_sensitive: bool; [[If search should be case sensitive or not.]] - @in forward: bool; [[If search is from cursor and on or backwards.]] - @in wrap: bool; [[If search should wrap at the end.]] - } - } - popup_destroy @pure_virtual { - [[Dismisses an open dropdown popup - - When the popup from a dropdown widget is to be dismissed, either - after selecting an option or to cancel it, this function must be - called, which will later emit an "popup,willdelete" signal to - notify the user that any memory and objects related to this - popup can be freed. - ]] - return: bool; [[$true if the menu was successfully destroyed, or - $false if there was no menu to destroy.]] - } - region_show @pure_virtual { - [[Shows the given region in the web object.]] - params { - @in x: int; [[The x coordinate of the region to show.]] - @in y: int; [[The y coordinate of the region to show.]] - @in w: int; [[The width of the region to show.]] - @in h: int; [[The height of the region to show.]] - } - } - forward @pure_virtual { - [[Goes forward one step in the browsing history. - - This is equivalent to calling elm_web_object_navigate(obj, 1); - - See also @.history_enabled.set, @.forward_possible.get, - @.back, @.navigate. - ]] - return: bool; [[$true on success, $false otherwise.]] - } - text_matches_mark @pure_virtual { - [[Marks matches of the given string in a document.]] - return: uint; [[Number of matched $string.]] - params { - @in string: string; [[String to match.]] - @in case_sensitive: bool; [[If match should be case sensitive or not.]] - @in highlight: bool; [[If matches should be highlighted.]] - @in limit: uint; [[Maximum amount of matches, or zero to unlimited.]] - } - } - region_bring_in @pure_virtual { - [[Brings in the region to the visible area. - - Like @.region_show, but it animates the scrolling of the object - to show the area. - ]] - params { - @in x: int; [[The x coordinate of the region to show.]] - @in y: int; [[The y coordinate of the region to show.]] - @in w: int; [[The width of the region to show.]] - @in h: int; [[The height of the region to show.]] - } - } - stop @pure_virtual { - [[Stops loading the current page. - - Cancels the loading of the current page in the web object. This - will cause a "load,error" signal to be emitted, with the - is_cancellation flag set to $true. - ]] - return: bool; [[$true if the cancel was successful, $false otherwise.]] - } - navigate_possible_get @pure_virtual { - [[Queries whether it's possible to jump the given number of steps. - - The $steps value can be a negative integer to back in history, - or positive to move forward. - ]] - return: bool; [[$true if enough history exists to perform the - given jump, $false otherwise.]] - params { - @in steps: int; [[The number of steps to check for.]] - } - } - reload_full @pure_virtual { - [[Requests a reload of the current document, avoiding any - existing caches. - ]] - return: bool; [[$true on success, $false otherwise.]] - } - text_matches_unmark_all @pure_virtual { - [[Clears all marked matches in the document.]] - return: bool; [[$true on success, $false otherwise.]] - } - reload @pure_virtual { - [[Requests a reload of the current document in the object.]] - return: bool; [[$true on success, $false otherwise.]] - } - } - implements { - class.constructor; - 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_web.h b/src/lib/elementary/elm_web.h index 226677ef2e..3ec5e9a42a 100644 --- a/src/lib/elementary/elm_web.h +++ b/src/lib/elementary/elm_web.h @@ -93,15 +93,6 @@ */ #include "elm_web_common.h" -#ifdef EFL_EO_API_SUPPORT -#include "elm_web_eo.h" - -#undef ELM_WEB_CLASS -#define ELM_WEB_CLASS elm_web_real_class_get() - -EAPI const Efl_Class *elm_web_real_class_get(void); - -#endif #ifndef EFL_NOLEGACY_API_SUPPORT #include "elm_web_legacy.h" #endif diff --git a/src/lib/elementary/elm_web2.c b/src/lib/elementary/elm_web2.c index 3c82d927f7..90e454ca01 100644 --- a/src/lib/elementary/elm_web2.c +++ b/src/lib/elementary/elm_web2.c @@ -281,4 +281,4 @@ _elm_web_init(const char *engine) #undef ELM_WEB_CLASS #define ELM_WEB_CLASS elm_web_class_get() -#include "elm_web.eo.c" +#include "elm_web_eo.c" diff --git a/src/lib/elementary/elm_web_eo.c b/src/lib/elementary/elm_web_eo.c new file mode 100644 index 0000000000..227698359c --- /dev/null +++ b/src/lib/elementary/elm_web_eo.c @@ -0,0 +1,293 @@ + +static Eina_Error +__eolian_elm_web_text_matches_highlight_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_web_text_matches_highlight_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_FUNC_BODYV(elm_obj_web_text_matches_highlight_set, Eina_Bool, 0, EFL_FUNC_CALL(highlight), Eina_Bool highlight); + +static Eina_Value +__eolian_elm_web_text_matches_highlight_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_web_text_matches_highlight_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_web_text_matches_highlight_get, Eina_Bool, 0); + +static Eina_Error +__eolian_elm_web_useragent_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_web_useragent_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_web_useragent_set, EFL_FUNC_CALL(user_agent), const char *user_agent); + +static Eina_Value +__eolian_elm_web_useragent_get_reflect(const Eo *obj) +{ + const char *val = elm_obj_web_useragent_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_web_useragent_get, const char *, NULL); + +static Eina_Error +__eolian_elm_web_url_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_web_url_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_FUNC_BODYV(elm_obj_web_url_set, Eina_Bool, 0, EFL_FUNC_CALL(url), const char *url); + +static Eina_Value +__eolian_elm_web_url_get_reflect(const Eo *obj) +{ + const char *val = elm_obj_web_url_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_web_url_get, const char *, NULL); +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_web_bg_color_set, EFL_FUNC_CALL(r, g, b, a), int r, int g, int b, int a); +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_web_bg_color_get, EFL_FUNC_CALL(r, g, b, a), int *r, int *g, int *b, int *a); + +static Eina_Error +__eolian_elm_web_inwin_mode_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_web_inwin_mode_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_web_inwin_mode_set, EFL_FUNC_CALL(value), Eina_Bool value); + +static Eina_Value +__eolian_elm_web_inwin_mode_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_web_inwin_mode_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_web_inwin_mode_get, Eina_Bool, 0); + +static Eina_Error +__eolian_elm_web_tab_propagate_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_web_tab_propagate_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_web_tab_propagate_set, EFL_FUNC_CALL(propagate), Eina_Bool propagate); + +static Eina_Value +__eolian_elm_web_tab_propagate_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_web_tab_propagate_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_web_tab_propagate_get, Eina_Bool, 0); + +static Eina_Error +__eolian_elm_web_history_enabled_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_web_history_enabled_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_web_history_enabled_set, EFL_FUNC_CALL(enable), Eina_Bool enable); + +static Eina_Value +__eolian_elm_web_history_enabled_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_obj_web_history_enabled_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_web_history_enabled_get, Eina_Bool, 0); +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_web_console_message_hook_set, EFL_FUNC_CALL(func, data), Elm_Web_Console_Message func, void *data); +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_web_window_create_hook_set, EFL_FUNC_CALL(func, data), Elm_Web_Window_Open func, void *data); +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_web_dialog_file_selector_hook_set, EFL_FUNC_CALL(func, data), Elm_Web_Dialog_File_Selector func, void *data); +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_web_dialog_confirm_hook_set, EFL_FUNC_CALL(func, data), Elm_Web_Dialog_Confirm func, void *data); + +static Eina_Error +__eolian_elm_web_popup_selected_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_web_popup_selected_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_web_popup_selected_set, EFL_FUNC_CALL(idx), int idx); +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_web_dialog_prompt_hook_set, EFL_FUNC_CALL(func, data), Elm_Web_Dialog_Prompt func, void *data); +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_web_dialog_alert_hook_set, EFL_FUNC_CALL(func, data), Elm_Web_Dialog_Alert func, void *data); +EOAPI EFL_FUNC_BODY_CONST(elm_obj_web_forward_possible_get, Eina_Bool, 0); +EOAPI EFL_FUNC_BODY_CONST(elm_obj_web_webkit_view_get, Efl_Canvas_Object *, NULL); +EOAPI EFL_FUNC_BODY_CONST(elm_obj_web_back_possible_get, Eina_Bool, 0); +EOAPI EFL_FUNC_BODY_CONST(elm_obj_web_load_progress_get, double, 0); +EOAPI EFL_FUNC_BODY_CONST(elm_obj_web_selection_get, char *, NULL); +EOAPI EFL_FUNC_BODY_CONST(elm_obj_web_title_get, Eina_Stringshare *, NULL); +EOAPI EFL_FUNC_BODYV(elm_obj_web_navigate, Eina_Bool, 0, EFL_FUNC_CALL(steps), int steps); +EOAPI EFL_FUNC_BODY(elm_obj_web_back, Eina_Bool, 0); +EOAPI EFL_FUNC_BODYV(elm_obj_web_html_string_load, Eina_Bool, 0, EFL_FUNC_CALL(html, base_url, unreachable_url), const char *html, const char *base_url, const char *unreachable_url); +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_web_text_search, Eina_Bool, 0, EFL_FUNC_CALL(string, case_sensitive, forward, wrap), const char *string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap); +EOAPI EFL_FUNC_BODY(elm_obj_web_popup_destroy, Eina_Bool, 0); +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_web_region_show, EFL_FUNC_CALL(x, y, w, h), int x, int y, int w, int h); +EOAPI EFL_FUNC_BODY(elm_obj_web_forward, Eina_Bool, 0); +EOAPI EFL_FUNC_BODYV(elm_obj_web_text_matches_mark, unsigned int, 0, EFL_FUNC_CALL(string, case_sensitive, highlight, limit), const char *string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit); +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_web_region_bring_in, EFL_FUNC_CALL(x, y, w, h), int x, int y, int w, int h); +EOAPI EFL_FUNC_BODY(elm_obj_web_stop, Eina_Bool, 0); +EOAPI EFL_FUNC_BODYV(elm_obj_web_navigate_possible_get, Eina_Bool, 0, EFL_FUNC_CALL(steps), int steps); +EOAPI EFL_FUNC_BODY(elm_obj_web_reload_full, Eina_Bool, 0); +EOAPI EFL_FUNC_BODY(elm_obj_web_text_matches_unmark_all, Eina_Bool, 0); +EOAPI EFL_FUNC_BODY(elm_obj_web_reload, Eina_Bool, 0); + +Efl_Object *_elm_web_efl_object_constructor(Eo *obj, Elm_Web_Data *pd); + + +static Eina_Bool +_elm_web_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_WEB_EXTRA_OPS +#define ELM_WEB_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_web_text_matches_highlight_set, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_text_matches_highlight_get, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_useragent_set, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_useragent_get, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_url_set, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_url_get, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_bg_color_set, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_bg_color_get, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_inwin_mode_set, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_inwin_mode_get, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_tab_propagate_set, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_tab_propagate_get, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_history_enabled_set, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_history_enabled_get, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_console_message_hook_set, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_window_create_hook_set, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_dialog_file_selector_hook_set, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_dialog_confirm_hook_set, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_popup_selected_set, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_dialog_prompt_hook_set, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_dialog_alert_hook_set, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_forward_possible_get, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_webkit_view_get, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_back_possible_get, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_load_progress_get, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_selection_get, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_title_get, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_navigate, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_back, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_html_string_load, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_text_search, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_popup_destroy, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_region_show, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_forward, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_text_matches_mark, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_region_bring_in, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_stop, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_navigate_possible_get, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_reload_full, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_text_matches_unmark_all, NULL), + EFL_OBJECT_OP_FUNC(elm_obj_web_reload, NULL), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_web_efl_object_constructor), + ELM_WEB_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"text_matches_highlight", __eolian_elm_web_text_matches_highlight_set_reflect, __eolian_elm_web_text_matches_highlight_get_reflect}, + {"useragent", __eolian_elm_web_useragent_set_reflect, __eolian_elm_web_useragent_get_reflect}, + {"url", __eolian_elm_web_url_set_reflect, __eolian_elm_web_url_get_reflect}, + {"inwin_mode", __eolian_elm_web_inwin_mode_set_reflect, __eolian_elm_web_inwin_mode_get_reflect}, + {"tab_propagate", __eolian_elm_web_tab_propagate_set_reflect, __eolian_elm_web_tab_propagate_get_reflect}, + {"history_enabled", __eolian_elm_web_history_enabled_set_reflect, __eolian_elm_web_history_enabled_get_reflect}, + {"popup_selected", __eolian_elm_web_popup_selected_set_reflect, NULL}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_web_class_desc = { + EO_VERSION, + "Elm.Web", + EFL_CLASS_TYPE_REGULAR_NO_INSTANT, + sizeof(Elm_Web_Data), + _elm_web_class_initializer, + _elm_web_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_web_class_get, &_elm_web_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_LEGACY_INTERFACE, EFL_UI_ZOOM_INTERFACE, NULL); + +#include "elm_web_eo.legacy.c" diff --git a/src/lib/elementary/elm_web_eo.h b/src/lib/elementary/elm_web_eo.h index 33b3f7ede2..0407b40188 100644 --- a/src/lib/elementary/elm_web_eo.h +++ b/src/lib/elementary/elm_web_eo.h @@ -1 +1,602 @@ -#include "elm_web.eo.h" \ No newline at end of file +#ifndef _ELM_WEB_EO_H_ +#define _ELM_WEB_EO_H_ + +#ifndef _ELM_WEB_EO_CLASS_TYPE +#define _ELM_WEB_EO_CLASS_TYPE + +typedef Eo Elm_Web; + +#endif + +#ifndef _ELM_WEB_EO_TYPES +#define _ELM_WEB_EO_TYPES + + +#endif +/** Elementary web view class + * + * @ingroup Elm_Web + */ +#define ELM_WEB_CLASS elm_web_class_get() + +EWAPI const Efl_Class *elm_web_class_get(void); + +/** + * @brief Sets whether to highlight the matched marks. + * + * If enabled, marks set with @ref elm_obj_web_text_matches_mark will be + * highlighted. + * + * @param[in] obj The object. + * @param[in] highlight Whether to highlight the marks or not. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_text_matches_highlight_set(Eo *obj, Eina_Bool highlight); + +/** + * @brief Get whether highlighting marks is enabled. + * + * @param[in] obj The object. + * + * @return Whether to highlight the marks or not. + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_text_matches_highlight_get(const Eo *obj); + +/** + * @brief Change useragent of a elm_web object. + * + * @param[in] obj The object. + * @param[in] user_agent String for useragent. + * + * @ingroup Elm_Web + */ +EOAPI void elm_obj_web_useragent_set(Eo *obj, const char *user_agent); + +/** + * @brief Return current useragent of elm_web object. + * + * @param[in] obj The object. + * + * @return String for useragent. + * + * @ingroup Elm_Web + */ +EOAPI const char *elm_obj_web_useragent_get(const Eo *obj); + +/** + * @brief Sets the URL for the web object. + * + * It must be a full URL, with resource included, in the form + * http://www.enlightenment.org or file:///tmp/something.html + * + * @param[in] obj The object. + * @param[in] url The URL to set. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_url_set(Eo *obj, const char *url); + +/** + * @brief Get the current URL for the object. + * + * The returned string must not be freed and is guaranteed to be stringshared. + * + * @param[in] obj The object. + * + * @return The URL to set. + * + * @ingroup Elm_Web + */ +EOAPI const char *elm_obj_web_url_get(const Eo *obj); + +/** + * @brief Sets the background color to be used by the web object. + * + * This is the color that will be used by default when the loaded page does not + * set it's own. Color values are pre-multiplied. + * + * @param[in] obj The object. + * @param[in] r Red component. + * @param[in] g Green component. + * @param[in] b Blue component. + * @param[in] a Alpha component. + * + * @ingroup Elm_Web + */ +EOAPI void elm_obj_web_bg_color_set(Eo *obj, int r, int g, int b, int a); + +/** + * @brief Get the background color to be used by the web object. + * + * This is the color that will be used by default when the loaded page does not + * set it's own. Color values are pre-multiplied. + * + * @param[in] obj The object. + * @param[out] r Red component. + * @param[out] g Green component. + * @param[out] b Blue component. + * @param[out] a Alpha component. + * + * @ingroup Elm_Web + */ +EOAPI void elm_obj_web_bg_color_get(const Eo *obj, int *r, int *g, int *b, int *a); + +/** + * @brief Sets the default dialogs to use an Inwin instead of a normal window. + * + * If set, then the default implementation for the JavaScript dialogs and file + * selector will be opened in an Inwin. Otherwise they will use a normal + * separated window. + * + * @param[in] obj The object. + * @param[in] value @c true if dialog will be opened as Inwin, @c false + * otherwise + * + * @ingroup Elm_Web + */ +EOAPI void elm_obj_web_inwin_mode_set(Eo *obj, Eina_Bool value); + +/** + * @brief Get whether Inwin mode is set for the current object. + * + * @param[in] obj The object. + * + * @return @c true if dialog will be opened as Inwin, @c false otherwise + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_inwin_mode_get(const Eo *obj); + +/** + * @brief Sets whether to use tab propagation. + * + * If tab propagation is enabled, whenever the user presses the Tab key, + * Elementary will handle it and switch focus to the next widget. The default + * value is disabled, where WebKit will handle the Tab key to cycle focus + * though its internal objects, jumping to the next widget only when that cycle + * ends. + * + * @param[in] obj The object. + * @param[in] propagate Whether to propagate Tab keys to Elementary or not. + * + * @ingroup Elm_Web + */ +EOAPI void elm_obj_web_tab_propagate_set(Eo *obj, Eina_Bool propagate); + +/** + * @brief Get the status of the tab propagation. + * + * @param[in] obj The object. + * + * @return Whether to propagate Tab keys to Elementary or not. + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_tab_propagate_get(const Eo *obj); + +/** + * @brief Enables or disables the browsing history. + * + * @param[in] obj The object. + * @param[in] enable Whether to enable or disable the browsing history. + * + * @ingroup Elm_Web + */ +EOAPI void elm_obj_web_history_enabled_set(Eo *obj, Eina_Bool enable); + +/** + * @brief Get whether browsing history is enabled for the given object. + * + * @param[in] obj The object. + * + * @return Whether to enable or disable the browsing history. + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_history_enabled_get(const Eo *obj); + +/** + * @brief Sets the function to call when a console message is emitted from JS. + * + * This hook will be called when a console message is emitted from JavaScript. + * There is no default implementation for this feature. + * + * @param[in] obj The object. + * @param[in] func The callback function to be used. + * @param[in] data User data. + * + * @ingroup Elm_Web + */ +EOAPI void elm_obj_web_console_message_hook_set(Eo *obj, Elm_Web_Console_Message func, void *data); + +/** + * @brief Sets the function to call when a new window is requested. + * + * This hook will be called when a request to create a new window is issued + * from the web page loaded. There is no default implementation for this + * feature, so leaving this unset or passing @c null in @c func will prevent + * new windows from opening. + * + * @param[in] obj The object. + * @param[in] func The hook function to be called when a window is requested. + * @param[in] data User data. + * + * @ingroup Elm_Web + */ +EOAPI void elm_obj_web_window_create_hook_set(Eo *obj, Elm_Web_Window_Open func, void *data); + +/** + * @brief Sets the function to call when an file selector dialog. + * + * This hook will be called when a JavaScript file selector dialog is + * requested. If no function is set or @c null is passed in @c func, the + * default implementation will take place. + * + * @param[in] obj The object. + * @param[in] func The callback function to be used. + * @param[in] data User data. + * + * @ingroup Elm_Web + */ +EOAPI void elm_obj_web_dialog_file_selector_hook_set(Eo *obj, Elm_Web_Dialog_File_Selector func, void *data); + +/** + * @brief Sets the function to call when an confirm dialog. + * + * This hook will be called when a JavaScript confirm dialog is requested. If + * no function is set or @c null is passed in @c func, the default + * implementation will take place. + * + * @param[in] obj The object. + * @param[in] func The callback function to be used. + * @param[in] data User data. + * + * @ingroup Elm_Web + */ +EOAPI void elm_obj_web_dialog_confirm_hook_set(Eo *obj, Elm_Web_Dialog_Confirm func, void *data); + +/** + * @brief Tells the web object which index in the currently open popup was + * selected. + * + * When the user handles the popup creation from the "popup,created" signal, it + * needs to tell the web object which item was selected by calling this + * function with the index corresponding to the item. + * + * @param[in] obj The object. + * @param[in] idx The index selected. + * + * @ingroup Elm_Web + */ +EOAPI void elm_obj_web_popup_selected_set(Eo *obj, int idx); + +/** + * @brief Sets the function to call when an prompt dialog. + * + * This hook will be called when a JavaScript prompt dialog is requested. If no + * function is set or @c null is passed in @c func, the default implementation + * will take place. + * + * @param[in] obj The object. + * @param[in] func The callback function to be used. + * @param[in] data User data. + * + * @ingroup Elm_Web + */ +EOAPI void elm_obj_web_dialog_prompt_hook_set(Eo *obj, Elm_Web_Dialog_Prompt func, void *data); + +/** + * @brief Sets the function to call when an alert dialog. + * + * This hook will be called when a JavaScript alert dialog is requested. If no + * function is set or @c null is passed in @c func, the default implementation + * will take place. + * + * @param[in] obj The object. + * @param[in] func Callback function to be used. + * @param[in] data User data. + * + * @ingroup Elm_Web + */ +EOAPI void elm_obj_web_dialog_alert_hook_set(Eo *obj, Elm_Web_Dialog_Alert func, void *data); + +/** + * @brief Queries whether it's possible to go forward in history. + * + * @param[in] obj The object. + * + * @return @c true if it is possible to go forward, @c false otherwise + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_forward_possible_get(const Eo *obj); + +/** + * @brief Get internal ewk_view object from web object. + * + * Elementary may not provide some low level features of EWebKit, instead of + * cluttering the API with proxy methods we opted to return the internal + * reference. Be careful using it as it may interfere with elm_web behavior. + * + * @param[in] obj The object. + * + * @return The internal ewk_view object or @c null if it does not exist. + * (Failure to create or Elementary compiled without ewebkit) + * + * @ingroup Elm_Web + */ +EOAPI Efl_Canvas_Object *elm_obj_web_webkit_view_get(const Eo *obj); + +/** + * @brief Queries whether it's possible to go back in history. + * + * @param[in] obj The object. + * + * @return @c true if it is possible to go back, @c false otherwise + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_back_possible_get(const Eo *obj); + +/** + * @brief Get the overall loading progress of the page. + * + * Returns the estimated loading progress of the page, with a value between 0.0 + * and 1.0. This is an estimated progress accounting for all the frames + * included in the page. + * + * @param[in] obj The object. + * + * @return A value between 0.0 and 1.0 indicating the progress, or -1.0 on + * failure. + * + * @ingroup Elm_Web + */ +EOAPI double elm_obj_web_load_progress_get(const Eo *obj); + +/** + * @brief Get a copy of the currently selected text. + * + * The string returned must be freed by the user when it's done with it. + * + * @param[in] obj The object. + * + * @return A newly allocated string, or @c null if nothing is selected or an + * error occurred. + * + * @ingroup Elm_Web + */ +EOAPI char *elm_obj_web_selection_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get the current title. + * + * The returned string must not be freed and is guaranteed to be stringshared. + * + * @param[in] obj The object. + * + * @return A stringshared internal string with the current title, or @c null on + * failure. + * + * @ingroup Elm_Web + */ +EOAPI Eina_Stringshare *elm_obj_web_title_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Jumps the given number of steps in the browsing history. + * + * The @c steps value can be a negative integer to back in history, or a + * positive to move forward. + * + * @param[in] obj The object. + * @param[in] steps The number of steps to jump. + * + * @return @c true on success, @c false on error or if not enough history + * exists to jump the given number of steps + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_navigate(Eo *obj, int steps); + +/** + * @brief Goes back one step in the browsing history. + * + * This is equivalent to calling elm_web_object_navigate(obj, -1); + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_back(Eo *obj); + +/** + * @brief Loads the specified @c html string as the content of the web object. + * + * External objects such as stylesheets or images referenced in the HTML + * document are located relative to @c base_url. + * + * If an @c unreachable_url is passed it is used as the url for the loaded + * content. This is typically used to display error pages for a failed load. + * + * @param[in] obj The object. + * @param[in] html HTML data to load. + * @param[in] base_url Base URL used for relative paths to external objects + * (optional). + * @param[in] unreachable_url URL that could not be reached (optional). + * + * @return @c true on success, @c false otherwise + * + * @since 1.9 + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_html_string_load(Eo *obj, const char *html, const char *base_url, const char *unreachable_url); + +/** + * @brief Searches the given string in a document. + * + * @param[in] obj The object. + * @param[in] string String to search. + * @param[in] case_sensitive If search should be case sensitive or not. + * @param[in] forward If search is from cursor and on or backwards. + * @param[in] wrap If search should wrap at the end. + * + * @return @c true if the given string was found, @c false if not or failure. + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_text_search(const Eo *obj, const char *string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap); + +/** + * @brief Dismisses an open dropdown popup + * + * When the popup from a dropdown widget is to be dismissed, either after + * selecting an option or to cancel it, this function must be called, which + * will later emit an "popup,willdelete" signal to notify the user that any + * memory and objects related to this popup can be freed. + * + * @param[in] obj The object. + * + * @return @c true if the menu was successfully destroyed, or @c false if there + * was no menu to destroy. + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_popup_destroy(Eo *obj); + +/** + * @brief Shows the given region in the web object. + * + * @param[in] obj The object. + * @param[in] x The x coordinate of the region to show. + * @param[in] y The y coordinate of the region to show. + * @param[in] w The width of the region to show. + * @param[in] h The height of the region to show. + * + * @ingroup Elm_Web + */ +EOAPI void elm_obj_web_region_show(Eo *obj, int x, int y, int w, int h); + +/** + * @brief Goes forward one step in the browsing history. + * + * This is equivalent to calling elm_web_object_navigate(obj, 1); + * + * See also @ref elm_obj_web_history_enabled_set, + * @ref elm_obj_web_forward_possible_get, @ref elm_obj_web_back, + * @ref elm_obj_web_navigate. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise. + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_forward(Eo *obj); + +/** + * @brief Marks matches of the given string in a document. + * + * @param[in] obj The object. + * @param[in] string String to match. + * @param[in] case_sensitive If match should be case sensitive or not. + * @param[in] highlight If matches should be highlighted. + * @param[in] limit Maximum amount of matches, or zero to unlimited. + * + * @return Number of matched @c string. + * + * @ingroup Elm_Web + */ +EOAPI unsigned int elm_obj_web_text_matches_mark(Eo *obj, const char *string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit); + +/** + * @brief Brings in the region to the visible area. + * + * Like @ref elm_obj_web_region_show, but it animates the scrolling of the + * object to show the area. + * + * @param[in] obj The object. + * @param[in] x The x coordinate of the region to show. + * @param[in] y The y coordinate of the region to show. + * @param[in] w The width of the region to show. + * @param[in] h The height of the region to show. + * + * @ingroup Elm_Web + */ +EOAPI void elm_obj_web_region_bring_in(Eo *obj, int x, int y, int w, int h); + +/** + * @brief Stops loading the current page. + * + * Cancels the loading of the current page in the web object. This will cause a + * "load,error" signal to be emitted, with the is_cancellation flag set to + * @c true. + * + * @param[in] obj The object. + * + * @return @c true if the cancel was successful, @c false otherwise. + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_stop(Eo *obj); + +/** + * @brief Queries whether it's possible to jump the given number of steps. + * + * The @c steps value can be a negative integer to back in history, or positive + * to move forward. + * + * @param[in] obj The object. + * @param[in] steps The number of steps to check for. + * + * @return @c true if enough history exists to perform the given jump, @c false + * otherwise. + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_navigate_possible_get(Eo *obj, int steps); + +/** + * @brief Requests a reload of the current document, avoiding any existing + * caches. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise. + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_reload_full(Eo *obj); + +/** + * @brief Clears all marked matches in the document. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise. + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_text_matches_unmark_all(Eo *obj); + +/** + * @brief Requests a reload of the current document in the object. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise. + * + * @ingroup Elm_Web + */ +EOAPI Eina_Bool elm_obj_web_reload(Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_web_eo.legacy.c b/src/lib/elementary/elm_web_eo.legacy.c new file mode 100644 index 0000000000..a589988825 --- /dev/null +++ b/src/lib/elementary/elm_web_eo.legacy.c @@ -0,0 +1,246 @@ + +EAPI Eina_Bool +elm_web_text_matches_highlight_set(Elm_Web *obj, Eina_Bool highlight) +{ + return elm_obj_web_text_matches_highlight_set(obj, highlight); +} + +EAPI Eina_Bool +elm_web_text_matches_highlight_get(const Elm_Web *obj) +{ + return elm_obj_web_text_matches_highlight_get(obj); +} + +EAPI void +elm_web_useragent_set(Elm_Web *obj, const char *user_agent) +{ + elm_obj_web_useragent_set(obj, user_agent); +} + +EAPI const char * +elm_web_useragent_get(const Elm_Web *obj) +{ + return elm_obj_web_useragent_get(obj); +} + +EAPI Eina_Bool +elm_web_url_set(Elm_Web *obj, const char *url) +{ + return elm_obj_web_url_set(obj, url); +} + +EAPI const char * +elm_web_url_get(const Elm_Web *obj) +{ + return elm_obj_web_url_get(obj); +} + +EAPI void +elm_web_bg_color_set(Elm_Web *obj, int r, int g, int b, int a) +{ + elm_obj_web_bg_color_set(obj, r, g, b, a); +} + +EAPI void +elm_web_bg_color_get(const Elm_Web *obj, int *r, int *g, int *b, int *a) +{ + elm_obj_web_bg_color_get(obj, r, g, b, a); +} + +EAPI void +elm_web_inwin_mode_set(Elm_Web *obj, Eina_Bool value) +{ + elm_obj_web_inwin_mode_set(obj, value); +} + +EAPI Eina_Bool +elm_web_inwin_mode_get(const Elm_Web *obj) +{ + return elm_obj_web_inwin_mode_get(obj); +} + +EAPI void +elm_web_tab_propagate_set(Elm_Web *obj, Eina_Bool propagate) +{ + elm_obj_web_tab_propagate_set(obj, propagate); +} + +EAPI Eina_Bool +elm_web_tab_propagate_get(const Elm_Web *obj) +{ + return elm_obj_web_tab_propagate_get(obj); +} + +EAPI void +elm_web_history_enabled_set(Elm_Web *obj, Eina_Bool enable) +{ + elm_obj_web_history_enabled_set(obj, enable); +} + +EAPI Eina_Bool +elm_web_history_enabled_get(const Elm_Web *obj) +{ + return elm_obj_web_history_enabled_get(obj); +} + +EAPI void +elm_web_console_message_hook_set(Elm_Web *obj, Elm_Web_Console_Message func, void *data) +{ + elm_obj_web_console_message_hook_set(obj, func, data); +} + +EAPI void +elm_web_window_create_hook_set(Elm_Web *obj, Elm_Web_Window_Open func, void *data) +{ + elm_obj_web_window_create_hook_set(obj, func, data); +} + +EAPI void +elm_web_dialog_file_selector_hook_set(Elm_Web *obj, Elm_Web_Dialog_File_Selector func, void *data) +{ + elm_obj_web_dialog_file_selector_hook_set(obj, func, data); +} + +EAPI void +elm_web_dialog_confirm_hook_set(Elm_Web *obj, Elm_Web_Dialog_Confirm func, void *data) +{ + elm_obj_web_dialog_confirm_hook_set(obj, func, data); +} + +EAPI void +elm_web_popup_selected_set(Elm_Web *obj, int idx) +{ + elm_obj_web_popup_selected_set(obj, idx); +} + +EAPI void +elm_web_dialog_prompt_hook_set(Elm_Web *obj, Elm_Web_Dialog_Prompt func, void *data) +{ + elm_obj_web_dialog_prompt_hook_set(obj, func, data); +} + +EAPI void +elm_web_dialog_alert_hook_set(Elm_Web *obj, Elm_Web_Dialog_Alert func, void *data) +{ + elm_obj_web_dialog_alert_hook_set(obj, func, data); +} + +EAPI Eina_Bool +elm_web_forward_possible_get(const Elm_Web *obj) +{ + return elm_obj_web_forward_possible_get(obj); +} + +EAPI Efl_Canvas_Object * +elm_web_webkit_view_get(const Elm_Web *obj) +{ + return elm_obj_web_webkit_view_get(obj); +} + +EAPI Eina_Bool +elm_web_back_possible_get(const Elm_Web *obj) +{ + return elm_obj_web_back_possible_get(obj); +} + +EAPI double +elm_web_load_progress_get(const Elm_Web *obj) +{ + return elm_obj_web_load_progress_get(obj); +} + +EAPI char * +elm_web_selection_get(const Elm_Web *obj) +{ + return elm_obj_web_selection_get(obj); +} + +EAPI Eina_Stringshare * +elm_web_title_get(const Elm_Web *obj) +{ + return elm_obj_web_title_get(obj); +} + +EAPI Eina_Bool +elm_web_navigate(Elm_Web *obj, int steps) +{ + return elm_obj_web_navigate(obj, steps); +} + +EAPI Eina_Bool +elm_web_back(Elm_Web *obj) +{ + return elm_obj_web_back(obj); +} + +EAPI Eina_Bool +elm_web_html_string_load(Elm_Web *obj, const char *html, const char *base_url, const char *unreachable_url) +{ + return elm_obj_web_html_string_load(obj, html, base_url, unreachable_url); +} + +EAPI Eina_Bool +elm_web_text_search(const Elm_Web *obj, const char *string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap) +{ + return elm_obj_web_text_search(obj, string, case_sensitive, forward, wrap); +} + +EAPI Eina_Bool +elm_web_popup_destroy(Elm_Web *obj) +{ + return elm_obj_web_popup_destroy(obj); +} + +EAPI void +elm_web_region_show(Elm_Web *obj, int x, int y, int w, int h) +{ + elm_obj_web_region_show(obj, x, y, w, h); +} + +EAPI Eina_Bool +elm_web_forward(Elm_Web *obj) +{ + return elm_obj_web_forward(obj); +} + +EAPI unsigned int +elm_web_text_matches_mark(Elm_Web *obj, const char *string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit) +{ + return elm_obj_web_text_matches_mark(obj, string, case_sensitive, highlight, limit); +} + +EAPI void +elm_web_region_bring_in(Elm_Web *obj, int x, int y, int w, int h) +{ + elm_obj_web_region_bring_in(obj, x, y, w, h); +} + +EAPI Eina_Bool +elm_web_stop(Elm_Web *obj) +{ + return elm_obj_web_stop(obj); +} + +EAPI Eina_Bool +elm_web_navigate_possible_get(Elm_Web *obj, int steps) +{ + return elm_obj_web_navigate_possible_get(obj, steps); +} + +EAPI Eina_Bool +elm_web_reload_full(Elm_Web *obj) +{ + return elm_obj_web_reload_full(obj); +} + +EAPI Eina_Bool +elm_web_text_matches_unmark_all(Elm_Web *obj) +{ + return elm_obj_web_text_matches_unmark_all(obj); +} + +EAPI Eina_Bool +elm_web_reload(Elm_Web *obj) +{ + return elm_obj_web_reload(obj); +} diff --git a/src/lib/elementary/elm_web_eo.legacy.h b/src/lib/elementary/elm_web_eo.legacy.h new file mode 100644 index 0000000000..a872707400 --- /dev/null +++ b/src/lib/elementary/elm_web_eo.legacy.h @@ -0,0 +1,594 @@ +#ifndef _ELM_WEB_EO_LEGACY_H_ +#define _ELM_WEB_EO_LEGACY_H_ + +#ifndef _ELM_WEB_EO_CLASS_TYPE +#define _ELM_WEB_EO_CLASS_TYPE + +typedef Eo Elm_Web; + +#endif + +#ifndef _ELM_WEB_EO_TYPES +#define _ELM_WEB_EO_TYPES + + +#endif + +/** + * @brief Sets whether to highlight the matched marks. + * + * If enabled, marks set with @ref elm_web_text_matches_mark will be + * highlighted. + * + * @param[in] obj The object. + * @param[in] highlight Whether to highlight the marks or not. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_text_matches_highlight_set(Elm_Web *obj, Eina_Bool highlight); + +/** + * @brief Get whether highlighting marks is enabled. + * + * @param[in] obj The object. + * + * @return Whether to highlight the marks or not. + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_text_matches_highlight_get(const Elm_Web *obj); + +/** + * @brief Change useragent of a elm_web object. + * + * @param[in] obj The object. + * @param[in] user_agent String for useragent. + * + * @ingroup Elm_Web_Group + */ +EAPI void elm_web_useragent_set(Elm_Web *obj, const char *user_agent); + +/** + * @brief Return current useragent of elm_web object. + * + * @param[in] obj The object. + * + * @return String for useragent. + * + * @ingroup Elm_Web_Group + */ +EAPI const char *elm_web_useragent_get(const Elm_Web *obj); + +/** + * @brief Sets the URL for the web object. + * + * It must be a full URL, with resource included, in the form + * http://www.enlightenment.org or file:///tmp/something.html + * + * @param[in] obj The object. + * @param[in] url The URL to set. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_url_set(Elm_Web *obj, const char *url); + +/** + * @brief Get the current URL for the object. + * + * The returned string must not be freed and is guaranteed to be stringshared. + * + * @param[in] obj The object. + * + * @return The URL to set. + * + * @ingroup Elm_Web_Group + */ +EAPI const char *elm_web_url_get(const Elm_Web *obj); + +/** + * @brief Sets the background color to be used by the web object. + * + * This is the color that will be used by default when the loaded page does not + * set it's own. Color values are pre-multiplied. + * + * @param[in] obj The object. + * @param[in] r Red component. + * @param[in] g Green component. + * @param[in] b Blue component. + * @param[in] a Alpha component. + * + * @ingroup Elm_Web_Group + */ +EAPI void elm_web_bg_color_set(Elm_Web *obj, int r, int g, int b, int a); + +/** + * @brief Get the background color to be used by the web object. + * + * This is the color that will be used by default when the loaded page does not + * set it's own. Color values are pre-multiplied. + * + * @param[in] obj The object. + * @param[out] r Red component. + * @param[out] g Green component. + * @param[out] b Blue component. + * @param[out] a Alpha component. + * + * @ingroup Elm_Web_Group + */ +EAPI void elm_web_bg_color_get(const Elm_Web *obj, int *r, int *g, int *b, int *a); + +/** + * @brief Sets the default dialogs to use an Inwin instead of a normal window. + * + * If set, then the default implementation for the JavaScript dialogs and file + * selector will be opened in an Inwin. Otherwise they will use a normal + * separated window. + * + * @param[in] obj The object. + * @param[in] value @c true if dialog will be opened as Inwin, @c false + * otherwise + * + * @ingroup Elm_Web_Group + */ +EAPI void elm_web_inwin_mode_set(Elm_Web *obj, Eina_Bool value); + +/** + * @brief Get whether Inwin mode is set for the current object. + * + * @param[in] obj The object. + * + * @return @c true if dialog will be opened as Inwin, @c false otherwise + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_inwin_mode_get(const Elm_Web *obj); + +/** + * @brief Sets whether to use tab propagation. + * + * If tab propagation is enabled, whenever the user presses the Tab key, + * Elementary will handle it and switch focus to the next widget. The default + * value is disabled, where WebKit will handle the Tab key to cycle focus + * though its internal objects, jumping to the next widget only when that cycle + * ends. + * + * @param[in] obj The object. + * @param[in] propagate Whether to propagate Tab keys to Elementary or not. + * + * @ingroup Elm_Web_Group + */ +EAPI void elm_web_tab_propagate_set(Elm_Web *obj, Eina_Bool propagate); + +/** + * @brief Get the status of the tab propagation. + * + * @param[in] obj The object. + * + * @return Whether to propagate Tab keys to Elementary or not. + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_tab_propagate_get(const Elm_Web *obj); + +/** + * @brief Enables or disables the browsing history. + * + * @param[in] obj The object. + * @param[in] enable Whether to enable or disable the browsing history. + * + * @ingroup Elm_Web_Group + */ +EAPI void elm_web_history_enabled_set(Elm_Web *obj, Eina_Bool enable); + +/** + * @brief Get whether browsing history is enabled for the given object. + * + * @param[in] obj The object. + * + * @return Whether to enable or disable the browsing history. + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_history_enabled_get(const Elm_Web *obj); + +/** + * @brief Sets the function to call when a console message is emitted from JS. + * + * This hook will be called when a console message is emitted from JavaScript. + * There is no default implementation for this feature. + * + * @param[in] obj The object. + * @param[in] func The callback function to be used. + * @param[in] data User data. + * + * @ingroup Elm_Web_Group + */ +EAPI void elm_web_console_message_hook_set(Elm_Web *obj, Elm_Web_Console_Message func, void *data); + +/** + * @brief Sets the function to call when a new window is requested. + * + * This hook will be called when a request to create a new window is issued + * from the web page loaded. There is no default implementation for this + * feature, so leaving this unset or passing @c null in @c func will prevent + * new windows from opening. + * + * @param[in] obj The object. + * @param[in] func The hook function to be called when a window is requested. + * @param[in] data User data. + * + * @ingroup Elm_Web_Group + */ +EAPI void elm_web_window_create_hook_set(Elm_Web *obj, Elm_Web_Window_Open func, void *data); + +/** + * @brief Sets the function to call when an file selector dialog. + * + * This hook will be called when a JavaScript file selector dialog is + * requested. If no function is set or @c null is passed in @c func, the + * default implementation will take place. + * + * @param[in] obj The object. + * @param[in] func The callback function to be used. + * @param[in] data User data. + * + * @ingroup Elm_Web_Group + */ +EAPI void elm_web_dialog_file_selector_hook_set(Elm_Web *obj, Elm_Web_Dialog_File_Selector func, void *data); + +/** + * @brief Sets the function to call when an confirm dialog. + * + * This hook will be called when a JavaScript confirm dialog is requested. If + * no function is set or @c null is passed in @c func, the default + * implementation will take place. + * + * @param[in] obj The object. + * @param[in] func The callback function to be used. + * @param[in] data User data. + * + * @ingroup Elm_Web_Group + */ +EAPI void elm_web_dialog_confirm_hook_set(Elm_Web *obj, Elm_Web_Dialog_Confirm func, void *data); + +/** + * @brief Tells the web object which index in the currently open popup was + * selected. + * + * When the user handles the popup creation from the "popup,created" signal, it + * needs to tell the web object which item was selected by calling this + * function with the index corresponding to the item. + * + * @param[in] obj The object. + * @param[in] idx The index selected. + * + * @ingroup Elm_Web_Group + */ +EAPI void elm_web_popup_selected_set(Elm_Web *obj, int idx); + +/** + * @brief Sets the function to call when an prompt dialog. + * + * This hook will be called when a JavaScript prompt dialog is requested. If no + * function is set or @c null is passed in @c func, the default implementation + * will take place. + * + * @param[in] obj The object. + * @param[in] func The callback function to be used. + * @param[in] data User data. + * + * @ingroup Elm_Web_Group + */ +EAPI void elm_web_dialog_prompt_hook_set(Elm_Web *obj, Elm_Web_Dialog_Prompt func, void *data); + +/** + * @brief Sets the function to call when an alert dialog. + * + * This hook will be called when a JavaScript alert dialog is requested. If no + * function is set or @c null is passed in @c func, the default implementation + * will take place. + * + * @param[in] obj The object. + * @param[in] func Callback function to be used. + * @param[in] data User data. + * + * @ingroup Elm_Web_Group + */ +EAPI void elm_web_dialog_alert_hook_set(Elm_Web *obj, Elm_Web_Dialog_Alert func, void *data); + +/** + * @brief Queries whether it's possible to go forward in history. + * + * @param[in] obj The object. + * + * @return @c true if it is possible to go forward, @c false otherwise + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_forward_possible_get(const Elm_Web *obj); + +/** + * @brief Get internal ewk_view object from web object. + * + * Elementary may not provide some low level features of EWebKit, instead of + * cluttering the API with proxy methods we opted to return the internal + * reference. Be careful using it as it may interfere with elm_web behavior. + * + * @param[in] obj The object. + * + * @return The internal ewk_view object or @c null if it does not exist. + * (Failure to create or Elementary compiled without ewebkit) + * + * @ingroup Elm_Web_Group + */ +EAPI Efl_Canvas_Object *elm_web_webkit_view_get(const Elm_Web *obj); + +/** + * @brief Queries whether it's possible to go back in history. + * + * @param[in] obj The object. + * + * @return @c true if it is possible to go back, @c false otherwise + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_back_possible_get(const Elm_Web *obj); + +/** + * @brief Get the overall loading progress of the page. + * + * Returns the estimated loading progress of the page, with a value between 0.0 + * and 1.0. This is an estimated progress accounting for all the frames + * included in the page. + * + * @param[in] obj The object. + * + * @return A value between 0.0 and 1.0 indicating the progress, or -1.0 on + * failure. + * + * @ingroup Elm_Web_Group + */ +EAPI double elm_web_load_progress_get(const Elm_Web *obj); + +/** + * @brief Get a copy of the currently selected text. + * + * The string returned must be freed by the user when it's done with it. + * + * @param[in] obj The object. + * + * @return A newly allocated string, or @c null if nothing is selected or an + * error occurred. + * + * @ingroup Elm_Web_Group + */ +EAPI char *elm_web_selection_get(const Elm_Web *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get the current title. + * + * The returned string must not be freed and is guaranteed to be stringshared. + * + * @param[in] obj The object. + * + * @return A stringshared internal string with the current title, or @c null on + * failure. + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Stringshare *elm_web_title_get(const Elm_Web *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Jumps the given number of steps in the browsing history. + * + * The @c steps value can be a negative integer to back in history, or a + * positive to move forward. + * + * @param[in] obj The object. + * @param[in] steps The number of steps to jump. + * + * @return @c true on success, @c false on error or if not enough history + * exists to jump the given number of steps + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_navigate(Elm_Web *obj, int steps); + +/** + * @brief Goes back one step in the browsing history. + * + * This is equivalent to calling elm_web_object_navigate(obj, -1); + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_back(Elm_Web *obj); + +/** + * @brief Loads the specified @c html string as the content of the web object. + * + * External objects such as stylesheets or images referenced in the HTML + * document are located relative to @c base_url. + * + * If an @c unreachable_url is passed it is used as the url for the loaded + * content. This is typically used to display error pages for a failed load. + * + * @param[in] obj The object. + * @param[in] html HTML data to load. + * @param[in] base_url Base URL used for relative paths to external objects + * (optional). + * @param[in] unreachable_url URL that could not be reached (optional). + * + * @return @c true on success, @c false otherwise + * + * @since 1.9 + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_html_string_load(Elm_Web *obj, const char *html, const char *base_url, const char *unreachable_url); + +/** + * @brief Searches the given string in a document. + * + * @param[in] obj The object. + * @param[in] string String to search. + * @param[in] case_sensitive If search should be case sensitive or not. + * @param[in] forward If search is from cursor and on or backwards. + * @param[in] wrap If search should wrap at the end. + * + * @return @c true if the given string was found, @c false if not or failure. + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_text_search(const Elm_Web *obj, const char *string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap); + +/** + * @brief Dismisses an open dropdown popup + * + * When the popup from a dropdown widget is to be dismissed, either after + * selecting an option or to cancel it, this function must be called, which + * will later emit an "popup,willdelete" signal to notify the user that any + * memory and objects related to this popup can be freed. + * + * @param[in] obj The object. + * + * @return @c true if the menu was successfully destroyed, or @c false if there + * was no menu to destroy. + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_popup_destroy(Elm_Web *obj); + +/** + * @brief Shows the given region in the web object. + * + * @param[in] obj The object. + * @param[in] x The x coordinate of the region to show. + * @param[in] y The y coordinate of the region to show. + * @param[in] w The width of the region to show. + * @param[in] h The height of the region to show. + * + * @ingroup Elm_Web_Group + */ +EAPI void elm_web_region_show(Elm_Web *obj, int x, int y, int w, int h); + +/** + * @brief Goes forward one step in the browsing history. + * + * This is equivalent to calling elm_web_object_navigate(obj, 1); + * + * See also @ref elm_web_history_enabled_set, + * @ref elm_web_forward_possible_get, @ref elm_web_back, @ref elm_web_navigate. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise. + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_forward(Elm_Web *obj); + +/** + * @brief Marks matches of the given string in a document. + * + * @param[in] obj The object. + * @param[in] string String to match. + * @param[in] case_sensitive If match should be case sensitive or not. + * @param[in] highlight If matches should be highlighted. + * @param[in] limit Maximum amount of matches, or zero to unlimited. + * + * @return Number of matched @c string. + * + * @ingroup Elm_Web_Group + */ +EAPI unsigned int elm_web_text_matches_mark(Elm_Web *obj, const char *string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit); + +/** + * @brief Brings in the region to the visible area. + * + * Like @ref elm_web_region_show, but it animates the scrolling of the object + * to show the area. + * + * @param[in] obj The object. + * @param[in] x The x coordinate of the region to show. + * @param[in] y The y coordinate of the region to show. + * @param[in] w The width of the region to show. + * @param[in] h The height of the region to show. + * + * @ingroup Elm_Web_Group + */ +EAPI void elm_web_region_bring_in(Elm_Web *obj, int x, int y, int w, int h); + +/** + * @brief Stops loading the current page. + * + * Cancels the loading of the current page in the web object. This will cause a + * "load,error" signal to be emitted, with the is_cancellation flag set to + * @c true. + * + * @param[in] obj The object. + * + * @return @c true if the cancel was successful, @c false otherwise. + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_stop(Elm_Web *obj); + +/** + * @brief Queries whether it's possible to jump the given number of steps. + * + * The @c steps value can be a negative integer to back in history, or positive + * to move forward. + * + * @param[in] obj The object. + * @param[in] steps The number of steps to check for. + * + * @return @c true if enough history exists to perform the given jump, @c false + * otherwise. + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_navigate_possible_get(Elm_Web *obj, int steps); + +/** + * @brief Requests a reload of the current document, avoiding any existing + * caches. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise. + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_reload_full(Elm_Web *obj); + +/** + * @brief Clears all marked matches in the document. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise. + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_text_matches_unmark_all(Elm_Web *obj); + +/** + * @brief Requests a reload of the current document in the object. + * + * @param[in] obj The object. + * + * @return @c true on success, @c false otherwise. + * + * @ingroup Elm_Web_Group + */ +EAPI Eina_Bool elm_web_reload(Elm_Web *obj); + +#endif diff --git a/src/lib/elementary/elm_web_legacy.h b/src/lib/elementary/elm_web_legacy.h index 29588eded5..ea6f18c36d 100644 --- a/src/lib/elementary/elm_web_legacy.h +++ b/src/lib/elementary/elm_web_legacy.h @@ -126,4 +126,4 @@ EAPI void elm_web_zoom_set(Evas_Object *obj, double zoom); * @ingroup Elm_Web */ EAPI double elm_web_zoom_get(const Evas_Object *obj); -#include "elm_web.eo.legacy.h" +#include "elm_web_eo.legacy.h" diff --git a/src/lib/elementary/elm_widget.h b/src/lib/elementary/elm_widget.h index 99229851f8..2f4de74721 100644 --- a/src/lib/elementary/elm_widget.h +++ b/src/lib/elementary/elm_widget.h @@ -305,6 +305,7 @@ typedef void (*Elm_Widget_Item_Signal_Cb)(void *data, Elm_Objec typedef void (*Elm_Access_On_Highlight_Cb)(void *data); #include "efl_ui_widget.eo.h" +#include "elm_widget_item_container_eo.h" /** * @addtogroup Widget @@ -327,6 +328,7 @@ typedef struct _Elm_Widget_Smart_Data Evas_Object *resize_obj; /**< an unique object for each widget that shows the look of a widget. Resize object's geometry is same as the widget. This resize object is different from that of window's resize object. */ Evas_Object *hover_obj; Evas_Object *bg; + Evas_Object *window; Eina_List *tooltips, *cursors; /* "show region" coordinates. all widgets got those because this @@ -352,6 +354,7 @@ typedef struct _Elm_Widget_Smart_Data int child_drag_x_locked; int child_drag_y_locked; + int disabled; Eina_Inlist *translate_strings; Eina_List *focus_chain; @@ -363,7 +366,6 @@ typedef struct _Elm_Widget_Smart_Data Efl_Ui_Scrollable_On_Show_Region on_show_region; Eina_Free_Cb on_show_region_data_free; - int orient_mode; /* -1 is disabled */ Elm_Focus_Move_Policy focus_move_policy; Elm_Focus_Region_Show_Mode focus_region_show_mode; @@ -382,11 +384,15 @@ typedef struct _Elm_Widget_Smart_Data 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; + struct { + Efl_Model *model; + Eina_Hash *model_lookup; + Eina_Hash *view_lookup; + } properties; Eina_Bool scroll_x_locked : 1; Eina_Bool scroll_y_locked : 1; Eina_Bool can_focus : 1; - Eina_Bool child_can_focus : 1; Eina_Bool focused : 1; Eina_Bool top_win_focused : 1; Eina_Bool tree_unfocusable : 1; @@ -394,7 +400,6 @@ typedef struct _Elm_Widget_Smart_Data Eina_Bool highlight_ignore : 1; Eina_Bool highlight_in_theme : 1; Eina_Bool access_highlight_in_theme : 1; - Eina_Bool disabled : 1; Eina_Bool is_mirrored : 1; Eina_Bool mirrored_auto_mode : 1; /* This is TRUE by default */ Eina_Bool still_in : 1; @@ -580,7 +585,7 @@ struct _Elm_Widget_Item_Data EAPI Eina_Bool elm_widget_api_check(int ver); EAPI Eina_Bool elm_widget_access(Evas_Object *obj, Eina_Bool is_access); -EAPI Efl_Ui_Theme_Apply_Result elm_widget_theme(Evas_Object *obj); +EAPI Eina_Error elm_widget_theme(Evas_Object *obj); EAPI void elm_widget_theme_specific(Evas_Object *obj, Elm_Theme *th, Eina_Bool force); EAPI void elm_widget_on_show_region_hook_set(Evas_Object *obj, void *data, Efl_Ui_Scrollable_On_Show_Region func, Eina_Free_Cb data_free); EAPI Eina_Bool elm_widget_sub_object_parent_add(Evas_Object *sobj); @@ -604,7 +609,7 @@ EAPI Eina_Bool elm_widget_highlight_in_theme_get(const Evas_Object *obj); EAPI void elm_widget_access_highlight_in_theme_set(Evas_Object *obj, Eina_Bool highlight); EAPI Eina_Bool elm_widget_access_highlight_in_theme_get(const Evas_Object *obj); EAPI Eina_Bool elm_widget_highlight_get(const Evas_Object *obj); -EAPI Evas_Object *elm_widget_top_get(const Evas_Object *obj); +EAPI Eo *elm_widget_top_get(const Eo *obj); EAPI Eina_Bool elm_widget_is(const Evas_Object *obj); EAPI Evas_Object *elm_widget_parent_widget_get(const Evas_Object *obj); EAPI void elm_widget_event_callback_add(Evas_Object *obj, Elm_Event_Cb func, const void *data); @@ -647,7 +652,7 @@ EAPI void elm_widget_scroll_freeze_pop(Evas_Object *obj); EAPI int elm_widget_scroll_freeze_get(const Evas_Object *obj); EAPI void elm_widget_theme_set(Evas_Object *obj, Elm_Theme *th); EAPI Elm_Theme *elm_widget_theme_get(const Evas_Object *obj); -EAPI Efl_Ui_Theme_Apply_Result elm_widget_style_set(Evas_Object *obj, const char *style); +EAPI Eina_Error elm_widget_style_set(Evas_Object *obj, const char *style); EAPI const char *elm_widget_style_get(const Evas_Object *obj); EAPI void elm_widget_type_set(Evas_Object *obj, const char *type); EAPI const char *elm_widget_type_get(const Evas_Object *obj); @@ -659,7 +664,7 @@ EAPI void elm_widget_scroll_lock_set(Evas_Object *obj, Efl_Ui_Scroll EAPI Efl_Ui_Scroll_Block elm_widget_scroll_lock_get(const Evas_Object *obj); EAPI int elm_widget_scroll_child_locked_x_get(const Evas_Object *obj); EAPI int elm_widget_scroll_child_locked_y_get(const Evas_Object *obj); -EAPI Efl_Ui_Theme_Apply_Result elm_widget_theme_object_set(Evas_Object *obj, Evas_Object *edj, const char *wname, const char *welement, const char *wstyle); +EAPI Eina_Error elm_widget_theme_object_set(Evas_Object *obj, Evas_Object *edj, const char *wname, const char *welement, const char *wstyle); EAPI Eina_Bool elm_widget_type_check(const Evas_Object *obj, const char *type, const char *func); EAPI Evas_Object *elm_widget_name_find(const Evas_Object *obj, const char *name, int recurse); EAPI Eina_List *elm_widget_stringlist_get(const char *str); @@ -688,7 +693,7 @@ EAPI Eina_Bool elm_widget_theme_element_set(Evas_Object *obj, const char EAPI const char *elm_widget_theme_element_get(const Evas_Object *obj); EAPI Eina_Bool elm_widget_theme_style_set(Evas_Object *obj, const char *name); EAPI const char *elm_widget_theme_style_get(const Evas_Object *obj); -EAPI Efl_Ui_Theme_Apply_Result elm_widget_element_update(Evas_Object *obj, Evas_Object *component, const char *name); +EAPI Eina_Error elm_widget_element_update(Evas_Object *obj, Evas_Object *component, const char *name); /* debug function. don't use it unless you are tracking parenting issues */ EAPI void elm_widget_tree_dump(const Evas_Object *top); @@ -702,7 +707,7 @@ 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, EFL_UI_WIDGET_CLASS); \ + ptr = efl_data_scope_safe_get(o, EFL_UI_WIDGET_CLASS); \ if (EINA_UNLIKELY(!ptr)) \ { \ ERR("No widget data for object %p (%s)", \ @@ -710,6 +715,13 @@ Efl_Canvas_Object * _efl_ui_widget_bg_get(const Efl_Ui_Widget *obj); return __VA_ARGS__; \ } +#define ELM_WIDGET_DATA_GET(o, ptr) \ + Elm_Widget_Smart_Data *ptr; \ + ptr = efl_data_scope_safe_get(o, EFL_UI_WIDGET_CLASS); \ + if (EINA_UNLIKELY(!ptr)) \ + ERR("No widget data for object %p (%s)", \ + o, evas_object_type_get(o)); + #define ELM_WIDGET_CHECK(obj) \ if (EINA_UNLIKELY(!efl_isa((obj), EFL_UI_WIDGET_CLASS))) \ return @@ -802,6 +814,6 @@ const char *efl_ui_widget_default_text_part_get(const Eo *obj); #define ELM_WIDGET_ITEM_PROTECTED -#include "elm_widget_item.eo.h" +#include "elm_widget_item_eo.h" #endif diff --git a/src/lib/elementary/elm_widget_clock.h b/src/lib/elementary/elm_widget_clock.h index 195dab4687..d84d45734a 100644 --- a/src/lib/elementary/elm_widget_clock.h +++ b/src/lib/elementary/elm_widget_clock.h @@ -5,7 +5,7 @@ #include -#include "elm_clock.eo.h" +#include "elm_clock_eo.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 diff --git a/src/lib/elementary/elm_widget_colorselector.h b/src/lib/elementary/elm_widget_colorselector.h index d4f95f8d2e..535f5ae0fd 100644 --- a/src/lib/elementary/elm_widget_colorselector.h +++ b/src/lib/elementary/elm_widget_colorselector.h @@ -2,8 +2,8 @@ #define ELM_WIDGET_COLORSELECTOR_H #include "Elementary.h" -#include "elm_color_item.eo.h" -#include "elm_colorselector.eo.h" +#include "elm_color_item_eo.h" +#include "elm_colorselector_eo.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 diff --git a/src/lib/elementary/elm_widget_dayselector.h b/src/lib/elementary/elm_widget_dayselector.h index ee552e3b77..b150e976e4 100644 --- a/src/lib/elementary/elm_widget_dayselector.h +++ b/src/lib/elementary/elm_widget_dayselector.h @@ -2,8 +2,8 @@ #define ELM_WIDGET_DAYSELECTOR_H #include "Elementary.h" -#include "elm_dayselector_item.eo.h" -#include "elm_dayselector.eo.h" +#include "elm_dayselector_item_eo.h" +#include "elm_dayselector_eo.h" /* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR diff --git a/src/lib/elementary/elm_widget_entry.h b/src/lib/elementary/elm_widget_entry.h index a40df5183b..db1ea7b442 100644 --- a/src/lib/elementary/elm_widget_entry.h +++ b/src/lib/elementary/elm_widget_entry.h @@ -3,7 +3,7 @@ #include "elm_interface_scrollable.h" #include "elm_widget_layout.h" -#include "elm_entry.eo.h" +#include "elm_entry_eo.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 @@ -116,6 +116,7 @@ struct _Elm_Entry_Data Eina_Bool changed : 1; Eina_Bool scroll : 1; Eina_Bool input_panel_show_on_demand : 1; + Eina_Bool file_setting : 1; }; typedef struct _Elm_Entry_Item_Provider Elm_Entry_Item_Provider; diff --git a/src/lib/elementary/elm_widget_fileselector.h b/src/lib/elementary/elm_widget_fileselector.h index 1ebf33c0ca..efc48c11bd 100644 --- a/src/lib/elementary/elm_widget_fileselector.h +++ b/src/lib/elementary/elm_widget_fileselector.h @@ -54,7 +54,7 @@ struct _Elm_Fileselector_Data const char *path; Efl_Model *model; Efl_Model *prev_model; - Ecore_Idler *populate_idler; + Eina_List *children; Ecore_Idler *path_entry_idler; Efl_Model *target; @@ -85,6 +85,7 @@ struct _Elm_Fileselector_Data Eina_Bool dir_selected : 1; Eina_Bool hidden_visible : 1; + Eina_Bool target_ready : 1; }; struct sel_data diff --git a/src/lib/elementary/elm_widget_fileselector_button.h b/src/lib/elementary/elm_widget_fileselector_button.h index e055ae10de..86c8b53810 100644 --- a/src/lib/elementary/elm_widget_fileselector_button.h +++ b/src/lib/elementary/elm_widget_fileselector_button.h @@ -41,6 +41,7 @@ struct _Elm_Fileselector_Button_Data const char *path; Efl_Model *selection; const char *selection_path; + const char *current_name; Evas_Coord_Size thumbnail_size; Elm_Fileselector_Mode mode; Elm_Fileselector_Sort sort_type; diff --git a/src/lib/elementary/elm_widget_gengrid.h b/src/lib/elementary/elm_widget_gengrid.h index b995ed07ea..dc93910041 100644 --- a/src/lib/elementary/elm_widget_gengrid.h +++ b/src/lib/elementary/elm_widget_gengrid.h @@ -94,6 +94,8 @@ struct _Elm_Gengrid_Data Elm_Gengrid_Reorder_Type type; /**< Reorder type */ Eina_Bool running : 1; /**< animation is happening */ } reorder; + Elm_Focus_Region_Show_Mode mode; /**< the mode which describes which rectangle should be returned in the interest region getter*/ + Eina_Bool reorder_item_changed : 1; Eina_Bool move_effect_enabled : 1; @@ -152,6 +154,7 @@ struct _Elm_Gengrid_Data Eina_Bool scr_minw; Eina_Bool scr_minh; + Eina_Bool order_dirty; /* boolean flag indicating if there needs to be an update to the focus_order of the widget.*/ }; struct Elm_Gen_Item_Type diff --git a/src/lib/elementary/elm_widget_glview.h b/src/lib/elementary/elm_widget_glview.h index d561c0985e..2ce9144ed0 100644 --- a/src/lib/elementary/elm_widget_glview.h +++ b/src/lib/elementary/elm_widget_glview.h @@ -2,7 +2,7 @@ #define ELM_WIDGET_GLVIEW_H #include "Elementary.h" -#include "elm_glview.eo.h" +#include "elm_glview_eo.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 diff --git a/src/lib/elementary/elm_widget_hover.h b/src/lib/elementary/elm_widget_hover.h index 91bb3f0a9a..10cb616d3b 100644 --- a/src/lib/elementary/elm_widget_hover.h +++ b/src/lib/elementary/elm_widget_hover.h @@ -3,7 +3,7 @@ #include "Elementary.h" #include "elm_widget_layout.h" -#include "elm_hover.eo.h" +#include "elm_hover_eo.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 diff --git a/src/lib/elementary/elm_widget_index.h b/src/lib/elementary/elm_widget_index.h index 16582e2dac..3e39260abb 100644 --- a/src/lib/elementary/elm_widget_index.h +++ b/src/lib/elementary/elm_widget_index.h @@ -3,8 +3,8 @@ #include "Elementary.h" -#include "elm_index_item.eo.h" -#include "elm_index.eo.h" +#include "elm_index_item_eo.h" +#include "elm_index_eo.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 diff --git a/src/lib/elementary/elm_widget_item.eo b/src/lib/elementary/elm_widget_item.eo deleted file mode 100644 index 7f221e26d5..0000000000 --- a/src/lib/elementary/elm_widget_item.eo +++ /dev/null @@ -1,547 +0,0 @@ -import elm_general; -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 extends Efl.Object implements Efl.Access.Object, - Efl.Access.Component -{ - [[Elementary widget item class]] - eo_prefix: elm_wdg_item; - legacy_prefix: elm_object_item; - methods { - @property tooltip_window_mode { - [[Control size restriction state of an object's tooltip - - This function returns whether a tooltip is allowed to expand beyond - its parent window's canvas. - It will instead be limited only by the size of the display.]] - get { - } - set { - return: bool; [[$false on failure, $true on success]] - } - values { - disable: bool; [[If $true, size restrictions are disabled]] - } - } - @property tooltip_style { - [[Control a different style for this item tooltip. - - Note: before you set a style you should define a tooltip with - @.tooltip_content_cb_set or - @.tooltip_text_set - - See: elm_object_tooltip_style_set() for more details.]] - get { - } - set { - } - values { - style: string; [[The theme style used/to use (default, transparent, ...)]] - } - } - @property cursor { - [[Control the type of mouse pointer/cursor decoration to be shown, - when the mouse pointer is over the given item - - This function works analogously as elm_object_cursor_set(), but - here the cursor's changing area is restricted to the item's - area, and not the whole widget's. Note that that item cursors - have precedence over widget cursors, so that a mouse over an - item with custom cursor set will always show that cursor. - - If this function is called twice for an object, a previously set - cursor will be unset on the second call.]] - get { - } - set { - } - values { - cursor: string; [[The cursor type's name]] - } - } - @property cursor_style { - [[Control a different $style for a given custom cursor set for an item. - - This function only makes sense when one is using custom mouse - cursor decorations defined in a theme file, which can have, - given a cursor name/type, alternate styles on it. It - works analogously as elm_object_cursor_style_set(), but here - applies only to item objects. - - Warning: Before you set a cursor style you should have defined a - custom cursor previously on the item, with @.cursor.set]] - get { - } - set { - } - values { - style: string; [[The theme style to use/in use (e.g. $"default", $"transparent", etc)]] - } - } - @property cursor_engine_only { - [[Control if the (custom)cursor for a given item should be - searched in its theme, also, or should only rely on the - rendering engine. - - Note: This call is of use only if you've set a custom cursor - for items, with @.cursor.set. - - Note: By default, cursors will only be looked for between those - provided by the rendering engine.]] - get { - } - set { - } - values { - engine_only: bool; [[Use $true to have cursors looked for only on those provided by the rendering engine, $false to have them searched on the widget's theme, as well.]] - } - } - @property part_content { - [[Control a content of an object item - - This sets a new object to an item as a content object. If any object was - already set as a content object in the same part, previous object will be - deleted automatically.]] - get { - } - set { - } - keys { - part: string @nullable; [[The content part name (NULL for the default content)]] - } - values { - content: Efl.Canvas.Object; [[The content of the object item]] - } - } - @property part_text { - [[Control a label of an object item - - Note: Elementary object items may have many labels]] - get { - } - set { - } - keys { - part: string @nullable; [[The text part name (NULL for the default label)]] - } - values { - label: string; [[Text of the label]] - } - } - @property part_text_custom @protected { - get { - [[Get additional text part content]] - legacy: null; - } - set { - [[Save additional text part content]] - legacy: null; - } - keys { - part: string; [[Part name]] - } - values { - label: string; [[Label name]] - } - } - @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]] - } - } - @property style { - [[Control the style of an object item - - @since 1.9]] - get { - } - set { - } - values { - style: string; [[The style of object item]] - } - } - @property disabled { - [[Control the disabled state of a widget item. - - Elementary object item can be disabled, in which state they won't - receive input and, in general, will be themed differently from - their normal state, usually greyed out. Useful for contexts - where you don't want your users to interact with some of the - parts of you interface. - - This sets the state for the widget item, either disabling it or - enabling it back.]] - get { - } - set { - } - values { - disable: bool; [[$true, if the widget item is disabled, $false if it's enabled (or on errors)]] - } - } - access_order_get { - [[Get highlight order - - @since 1.8]] - return: const(list); [[List of evas canvas objects]] - } - access_order_set { - [[Set highlight order - - @since 1.8]] - params { - @in objs: list @owned; [[Order of objects to pass highlight]] - } - } - widget_get @const { - [[Get the widget object's handle which contains a given item - - Note: This returns the widget object itself that an item belongs to. - Note: Every elm_object_item supports this API]] - return: Efl.Canvas.Object; [[The widget object]] - } - pre_notify_del @protected { - [[notify deletion of widget item]] - legacy: null; - } - tooltip_text_set { - [[Set the text to be shown in a given object item's tooltips. - - Setup the text as tooltip to object. The item can have only one tooltip, - so any previous tooltip data - set with this function or - @.tooltip_content_cb_set - is removed. - - See: elm_object_tooltip_text_set() for more details.]] - params { - text: string; [[The text to set in the content.]] - } - } - tooltip_translatable_text_set @protected { - [[Set widget item tooltip as a text string]] - legacy: null; - params { - text: string; [[Tooltip text]] - } - } - tooltip_unset { - [[Unset tooltip from item. - - Remove tooltip from item. The callback provided as del_cb to - @.tooltip_content_cb_set will be called to notify - it is not used anymore. - - See: elm_object_tooltip_unset() for more details. - See: @.tooltip_content_cb_set]] - } - cursor_unset { - [[Unset any custom mouse pointer/cursor decoration set to be - shown, when the mouse pointer is over the given - item, thus making it show the default cursor again. - - Use this call to undo any custom settings on this item's cursor - decoration, bringing it back to defaults (no custom style set). - - See: elm_object_cursor_unset() - See: @.cursor.set]] - } - part_content_unset { - [[Unset a content of an object item - - Note: Elementary object items may have many contents]] - params { - part: string; [[The content part name to unset (NULL for the default content)]] - } - return: Efl.Canvas.Object; [[Content object]] - } - part_text_custom_update @protected { - [[Update additional text part content]] - legacy: null; - } - signal_callback_add { - [[Add a callback for a signal emitted by object item edje. - - This function connects a callback function to a signal emitted by the - edje object of the object item. - Globs can occur in either the emission or source name. - - @since 1.8]] - params { - emission: string; [[The signal's name.]] - source: string; [[The signal's source.]] - func: Elm_Object_Item_Signal_Cb; [[The callback function to be executed when the signal is emitted.]] - data: void_ptr; [[A pointer to data to pass to the callback function.]] - } - } - signal_callback_del { - [[Remove a signal-triggered callback from a object item edje object. - - This function removes the last callback, previously attached to - a signal emitted by an underlying Edje object of $it, whose - parameters $emission, $source and $func match exactly with - those passed to a previous call to - @.signal_callback_add. The data pointer that was passed - to this call will be returned. - - See: @.signal_callback_add - - @since 1.8]] - params { - emission: string; [[The signal's name.]] - source: string; [[The signal's source.]] - func: Elm_Object_Item_Signal_Cb; [[The callback function to be executed when the signal is emitted.]] - } - return: void_ptr; [[The data pointer of the signal callback or $NULL, on errors.]] - } - signal_emit { - [[Send a signal to the edje object of the widget item. - - This function sends a signal to the edje object of the obj item. An - edje program can respond to a signal by specifying matching - 'signal' and 'source' fields. - Don't use this unless you want to also handle resetting of part states to default on - every unrealize in case of genlist/gengrid.]] - params { - emission: string; [[The signal's name.]] - source: string; [[The signal's source.]] - } - } - access_info_set { - [[Set the text to read out when in accessibility mode]] - params { - txt: string; [[The text that describes the widget to people with poor or no vision]] - } - } - access_object_get @const { - [[Get an accessible object of the object item. - - @since 1.8]] - return: Efl.Canvas.Object; [[Accessible object of the object item or NULL for any error]] - } - domain_translatable_part_text_set { - [[Set the text for an object item's part, marking it as translatable. - - The string to set as $text must be the original one. Do not pass the - return of $gettext() here. Elementary will translate the string - internally and set it on the object item using - @.part_text.set, also storing the original string so that it - can be automatically translated when the language is changed with - elm_language_set(). The $domain will be stored along to find the - translation in the correct catalog. It can be NULL, in which case it will use - whatever domain was set by the application with $textdomain(). This is - useful in case you are building a library on top of Elementary that will have - its own translatable strings, that should not be mixed with those of programs - using the library. - - @since 1.8]] - params { - part: string; [[The name of the part to set]] - domain: string; [[The translation domain to use]] - label: string; [[The original, non-translated text to set]] - } - } - translatable_part_text_get @const { - [[Get the original string set as translatable for an object item. - - When setting translated strings, the function @.part_text.get - will return the translation returned by $gettext(). To get the original - string use this function. - - @since 1.8]] - params { - part: string; [[The name of the part that was set]] - } - return: string; [[The original, untranslated string]] - } - translate @protected { - [[Query translate]] - legacy: null; - } - domain_part_text_translatable_set { - [[Mark the part text to be translatable or not. - - Once you mark the part text to be translatable, the text will be translated - internally regardless of @.part_text.set and - @.domain_translatable_part_text_set. In other case, if you - set the Elementary policy that all text will be translatable in default, you - can set the part text to not be translated by calling this API. - - See: @.domain_translatable_part_text_set - See: @.part_text.set - See: elm_policy() - - @since 1.8]] - params { - part: string; [[The part name of the translatable text]] - domain: string; [[The translation domain to use]] - translatable: bool; [[$true, the part text will be translated internally. $false, otherwise.]] - } - } - track { - [[This returns track object of the item. - - Note: This gets a rectangle object that represents the object item's internal - object. If you want to check the geometry, visibility of the item, you - can call the evas apis such as evas_object_geometry_get(), - evas_object_visible_get() to the track object. Note that all of the - widget items may/may not have the internal object so this api may - return $NULL if the widget item doesn't have it. Additionally, the - widget item is managed/controlled by the widget, the widget item could - be changed(moved, resized even deleted) anytime by it's own widget's - decision. So please dont' change the track object as well as don't - keep the track object in your side as possible but get the track object - at the moment you need to refer. Otherwise, you need to add some - callbacks to the track object to track it's attributes changes. - - Warning: After use the track object, please call the - @.untrack() paired to elm_object_item_track - definitely to free the track object properly. Don't delete the - track object. - - See: @.untrack - See: @.track_get - - @since 1.8]] - return: Efl.Canvas.Object; [[The track object]] - } - untrack { - [[This retrieve the track object of the item. - - Note: This retrieves the track object that was returned from - @.track. - - See: @.track - See: @.track_get - - @since 1.8]] - } - track_get @const { - [[Get the track object reference count. - - Note: This gets the reference count for the track object. Whenever you call - the @.track, the reference count will be increased by - one. Likely the reference count will be decreased again when you call - the @.untrack. Unless the reference count reaches to - zero, the track object won't be deleted. So please be sure to call - @.untrack() paired to the elm_object_item_track call - count. - - See: @.track - See: @.track_get - - @since 1.8]] - return: int; [[Track object reference count]] - } - track_cancel @protected { - [[Query track_cancel]] - legacy: null; - } - del_cb_set { - [[Set the function to be called when an item from the widget is - freed. - - Note: Every elm_object_item supports this API]] - params { - del_cb: Evas_Smart_Cb @nullable; [[The function called]] - } - } - tooltip_content_cb_set { - [[Set the content to be shown in the tooltip item. - - Setup the tooltip to item. The item can have only one tooltip, - so any previous tooltip data is removed. $func(with $data) will - be called every time that need show the tooltip and it should - return a valid Evas_Object. This object is then managed fully by - tooltip system and is deleted when the tooltip is gone. - - See: elm_object_tooltip_content_cb_set() for more details.]] - params { - func: Elm_Tooltip_Item_Content_Cb @nullable; [[The function used to create the tooltip contents.]] - data: const(void_ptr) @optional; [[What to provide to $func as callback data/context.]] - del_cb: Evas_Smart_Cb @optional; [[Called when data is not needed anymore, either when another callback replaces $func, the tooltip is unset with @.tooltip_unset or the owner $item dies. This callback receives as the first parameter the given $data, and $event_info is the item.]] - - } - } - access_register { - [[Register object item as an accessible object. - - @since 1.8]] - return: Efl.Canvas.Object; [[Accessible object of the object item or NULL for any error]] - } - access_unregister { - [[Unregister accessible object of the object item. - - @since 1.8]] - } - access_order_unset { - [[Unset highlight order - - @since 1.8]] - } - disable @protected { - [[Disable widget item]] - legacy: null; - } - del_pre @protected { - [[Delete pre widget item]] - legacy: null; - } - focus_next_object_get @const { - [[Get the next object with specific focus direction. - - @since 1.16]] - params { - dir: Efl.Ui.Focus.Direction; [[Focus direction]] - } - return: Efl.Canvas.Object; [[Focus next object]] - } - focus_next_object_set { - [[Set the next object with specific focus direction. - - @since 1.16]] - params { - next: Efl.Canvas.Object @nullable; [[Focus next object]] - dir: Efl.Ui.Focus.Direction; [[Focus direction]] - } - } - focus_next_item_get @const { - [[Get the next object item with specific focus direction. - - @since 1.16]] - params { - dir: Efl.Ui.Focus.Direction; [[Focus direction]] - } - return: Elm.Widget.Item; [[Focus next object item]] - } - focus_next_item_set { - [[Set the next object item with specific focus direction. - - @since 1.16]] - params { - next_item: Elm.Widget.Item @nullable; [[Focus next object item]] - dir: Efl.Ui.Focus.Direction; [[Focus direction]] - } - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Efl.Object.invalidate; - Efl.Access.Object.state_set { get; } - Efl.Access.Object.attributes { get; } - Efl.Access.Component.extents { get; set; } - Efl.Access.Component.focus_grab; - } -} diff --git a/src/lib/elementary/elm_widget_item_container_eo.c b/src/lib/elementary/elm_widget_item_container_eo.c new file mode 100644 index 0000000000..81ca07dc76 --- /dev/null +++ b/src/lib/elementary/elm_widget_item_container_eo.c @@ -0,0 +1,33 @@ +EOAPI EFL_FUNC_BODY_CONST(elm_widget_item_container_focused_item_get, Elm_Widget_Item *, NULL); + +static Eina_Bool +_elm_widget_item_container_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_WIDGET_ITEM_CONTAINER_EXTRA_OPS +#define ELM_WIDGET_ITEM_CONTAINER_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_widget_item_container_focused_item_get, NULL), + ELM_WIDGET_ITEM_CONTAINER_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_widget_item_container_class_desc = { + EO_VERSION, + "Elm.Widget_Item_Container", + EFL_CLASS_TYPE_INTERFACE, + 0, + _elm_widget_item_container_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_widget_item_container_interface_get, &_elm_widget_item_container_class_desc, NULL, NULL); diff --git a/src/lib/elementary/elm_widget_item_container_eo.h b/src/lib/elementary/elm_widget_item_container_eo.h new file mode 100644 index 0000000000..066876e5cd --- /dev/null +++ b/src/lib/elementary/elm_widget_item_container_eo.h @@ -0,0 +1,31 @@ +#ifndef _ELM_WIDGET_ITEM_CONTAINER_EO_H_ +#define _ELM_WIDGET_ITEM_CONTAINER_EO_H_ + +#ifndef _ELM_WIDGET_ITEM_CONTAINER_EO_CLASS_TYPE +#define _ELM_WIDGET_ITEM_CONTAINER_EO_CLASS_TYPE + +typedef Eo Elm_Widget_Item_Container; + +#endif + +#ifndef _ELM_WIDGET_ITEM_CONTAINER_EO_TYPES +#define _ELM_WIDGET_ITEM_CONTAINER_EO_TYPES + + +#endif +#define ELM_WIDGET_ITEM_CONTAINER_INTERFACE elm_widget_item_container_interface_get() + +EWAPI const Efl_Class *elm_widget_item_container_interface_get(void); + +/** + * @brief Get the focused widget item. + * + * @param[in] obj The object. + * + * @return Focused item + * + * @ingroup Elm_Widget_Item_Container + */ +EOAPI Elm_Widget_Item *elm_widget_item_container_focused_item_get(const Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_widget_item_container_eo.legacy.h b/src/lib/elementary/elm_widget_item_container_eo.legacy.h new file mode 100644 index 0000000000..1408d4f228 --- /dev/null +++ b/src/lib/elementary/elm_widget_item_container_eo.legacy.h @@ -0,0 +1,18 @@ +#ifndef _ELM_WIDGET_ITEM_CONTAINER_EO_LEGACY_H_ +#define _ELM_WIDGET_ITEM_CONTAINER_EO_LEGACY_H_ + +#ifndef _ELM_WIDGET_ITEM_CONTAINER_EO_CLASS_TYPE +#define _ELM_WIDGET_ITEM_CONTAINER_EO_CLASS_TYPE + +typedef Eo Elm_Widget_Item_Container; + +#endif + +#ifndef _ELM_WIDGET_ITEM_CONTAINER_EO_TYPES +#define _ELM_WIDGET_ITEM_CONTAINER_EO_TYPES + + +#endif + + +#endif diff --git a/src/lib/elementary/elm_widget_item_eo.c b/src/lib/elementary/elm_widget_item_eo.c new file mode 100644 index 0000000000..eba2455017 --- /dev/null +++ b/src/lib/elementary/elm_widget_item_eo.c @@ -0,0 +1,558 @@ + +Eina_Bool _elm_widget_item_tooltip_window_mode_set(Eo *obj, Elm_Widget_Item_Data *pd, Eina_Bool disable); + + +static Eina_Error +__eolian_elm_widget_item_tooltip_window_mode_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_wdg_item_tooltip_window_mode_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_FUNC_BODYV(elm_wdg_item_tooltip_window_mode_set, Eina_Bool, 0, EFL_FUNC_CALL(disable), Eina_Bool disable); + +Eina_Bool _elm_widget_item_tooltip_window_mode_get(const Eo *obj, Elm_Widget_Item_Data *pd); + + +static Eina_Value +__eolian_elm_widget_item_tooltip_window_mode_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_wdg_item_tooltip_window_mode_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_wdg_item_tooltip_window_mode_get, Eina_Bool, 0); + +void _elm_widget_item_tooltip_style_set(Eo *obj, Elm_Widget_Item_Data *pd, const char *style); + + +static Eina_Error +__eolian_elm_widget_item_tooltip_style_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_wdg_item_tooltip_style_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_tooltip_style_set, EFL_FUNC_CALL(style), const char *style); + +const char *_elm_widget_item_tooltip_style_get(const Eo *obj, Elm_Widget_Item_Data *pd); + + +static Eina_Value +__eolian_elm_widget_item_tooltip_style_get_reflect(const Eo *obj) +{ + const char *val = elm_wdg_item_tooltip_style_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_wdg_item_tooltip_style_get, const char *, NULL); + +void _elm_widget_item_cursor_set(Eo *obj, Elm_Widget_Item_Data *pd, const char *cursor); + + +static Eina_Error +__eolian_elm_widget_item_cursor_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_wdg_item_cursor_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_cursor_set, EFL_FUNC_CALL(cursor), const char *cursor); + +const char *_elm_widget_item_cursor_get(const Eo *obj, Elm_Widget_Item_Data *pd); + + +static Eina_Value +__eolian_elm_widget_item_cursor_get_reflect(const Eo *obj) +{ + const char *val = elm_wdg_item_cursor_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_wdg_item_cursor_get, const char *, NULL); + +void _elm_widget_item_cursor_style_set(Eo *obj, Elm_Widget_Item_Data *pd, const char *style); + + +static Eina_Error +__eolian_elm_widget_item_cursor_style_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_wdg_item_cursor_style_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_cursor_style_set, EFL_FUNC_CALL(style), const char *style); + +const char *_elm_widget_item_cursor_style_get(const Eo *obj, Elm_Widget_Item_Data *pd); + + +static Eina_Value +__eolian_elm_widget_item_cursor_style_get_reflect(const Eo *obj) +{ + const char *val = elm_wdg_item_cursor_style_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_wdg_item_cursor_style_get, const char *, NULL); + +void _elm_widget_item_cursor_engine_only_set(Eo *obj, Elm_Widget_Item_Data *pd, Eina_Bool engine_only); + + +static Eina_Error +__eolian_elm_widget_item_cursor_engine_only_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_wdg_item_cursor_engine_only_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_cursor_engine_only_set, EFL_FUNC_CALL(engine_only), Eina_Bool engine_only); + +Eina_Bool _elm_widget_item_cursor_engine_only_get(const Eo *obj, Elm_Widget_Item_Data *pd); + + +static Eina_Value +__eolian_elm_widget_item_cursor_engine_only_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_wdg_item_cursor_engine_only_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_wdg_item_cursor_engine_only_get, Eina_Bool, 0); + +void _elm_widget_item_part_content_set(Eo *obj, Elm_Widget_Item_Data *pd, const char *part, Efl_Canvas_Object *content); + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_part_content_set, EFL_FUNC_CALL(part, content), const char *part, Efl_Canvas_Object *content); + +Efl_Canvas_Object *_elm_widget_item_part_content_get(const Eo *obj, Elm_Widget_Item_Data *pd, const char *part); + +EOAPI EFL_FUNC_BODYV_CONST(elm_wdg_item_part_content_get, Efl_Canvas_Object *, NULL, EFL_FUNC_CALL(part), const char *part); + +void _elm_widget_item_part_text_set(Eo *obj, Elm_Widget_Item_Data *pd, const char *part, const char *label); + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_part_text_set, EFL_FUNC_CALL(part, label), const char *part, const char *label); + +const char *_elm_widget_item_part_text_get(const Eo *obj, Elm_Widget_Item_Data *pd, const char *part); + +EOAPI EFL_FUNC_BODYV_CONST(elm_wdg_item_part_text_get, const char *, NULL, EFL_FUNC_CALL(part), const char *part); + +void _elm_widget_item_part_text_custom_set(Eo *obj, Elm_Widget_Item_Data *pd, const char *part, const char *label); + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_part_text_custom_set, EFL_FUNC_CALL(part, label), const char *part, const char *label); + +const char *_elm_widget_item_part_text_custom_get(const Eo *obj, Elm_Widget_Item_Data *pd, const char *part); + +EOAPI EFL_FUNC_BODYV_CONST(elm_wdg_item_part_text_custom_get, const char *, NULL, EFL_FUNC_CALL(part), const char *part); + +void _elm_widget_item_item_focus_set(Eo *obj, Elm_Widget_Item_Data *pd, Eina_Bool focused); + + +static Eina_Error +__eolian_elm_widget_item_item_focus_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_wdg_item_focus_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_focus_set, EFL_FUNC_CALL(focused), Eina_Bool focused); + +Eina_Bool _elm_widget_item_item_focus_get(const Eo *obj, Elm_Widget_Item_Data *pd); + + +static Eina_Value +__eolian_elm_widget_item_item_focus_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_wdg_item_focus_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_wdg_item_focus_get, Eina_Bool, 0); + +void _elm_widget_item_style_set(Eo *obj, Elm_Widget_Item_Data *pd, const char *style); + + +static Eina_Error +__eolian_elm_widget_item_style_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_wdg_item_style_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_style_set, EFL_FUNC_CALL(style), const char *style); + +const char *_elm_widget_item_style_get(const Eo *obj, Elm_Widget_Item_Data *pd); + + +static Eina_Value +__eolian_elm_widget_item_style_get_reflect(const Eo *obj) +{ + const char *val = elm_wdg_item_style_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_wdg_item_style_get, const char *, NULL); + +void _elm_widget_item_disabled_set(Eo *obj, Elm_Widget_Item_Data *pd, Eina_Bool disable); + + +static Eina_Error +__eolian_elm_widget_item_disabled_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_wdg_item_disabled_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_disabled_set, EFL_FUNC_CALL(disable), Eina_Bool disable); + +Eina_Bool _elm_widget_item_disabled_get(const Eo *obj, Elm_Widget_Item_Data *pd); + + +static Eina_Value +__eolian_elm_widget_item_disabled_get_reflect(const Eo *obj) +{ + Eina_Bool val = elm_wdg_item_disabled_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_wdg_item_disabled_get, Eina_Bool, 0); + +const Eina_List *_elm_widget_item_access_order_get(Eo *obj, Elm_Widget_Item_Data *pd); + +EOAPI EFL_FUNC_BODY(elm_wdg_item_access_order_get, const Eina_List *, NULL); + +void _elm_widget_item_access_order_set(Eo *obj, Elm_Widget_Item_Data *pd, Eina_List *objs); + +static void +_elm_wdg_item_access_order_set_ownership_fallback(Eina_List *objs) +{ + eina_list_free(objs); +} + +EOAPI EFL_VOID_FUNC_BODYV_FALLBACK(elm_wdg_item_access_order_set, _elm_wdg_item_access_order_set_ownership_fallback(objs);, EFL_FUNC_CALL(objs), Eina_List *objs); + +Efl_Canvas_Object *_elm_widget_item_widget_get(const Eo *obj, Elm_Widget_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_wdg_item_widget_get, Efl_Canvas_Object *, NULL); + +void _elm_widget_item_pre_notify_del(Eo *obj, Elm_Widget_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_wdg_item_pre_notify_del); + +void _elm_widget_item_tooltip_text_set(Eo *obj, Elm_Widget_Item_Data *pd, const char *text); + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_tooltip_text_set, EFL_FUNC_CALL(text), const char *text); + +void _elm_widget_item_tooltip_translatable_text_set(Eo *obj, Elm_Widget_Item_Data *pd, const char *text); + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_tooltip_translatable_text_set, EFL_FUNC_CALL(text), const char *text); + +void _elm_widget_item_tooltip_unset(Eo *obj, Elm_Widget_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_wdg_item_tooltip_unset); + +void _elm_widget_item_cursor_unset(Eo *obj, Elm_Widget_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_wdg_item_cursor_unset); + +Efl_Canvas_Object *_elm_widget_item_part_content_unset(Eo *obj, Elm_Widget_Item_Data *pd, const char *part); + +EOAPI EFL_FUNC_BODYV(elm_wdg_item_part_content_unset, Efl_Canvas_Object *, NULL, EFL_FUNC_CALL(part), const char *part); + +void _elm_widget_item_part_text_custom_update(Eo *obj, Elm_Widget_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_wdg_item_part_text_custom_update); + +void _elm_widget_item_signal_callback_add(Eo *obj, Elm_Widget_Item_Data *pd, const char *emission, const char *source, Elm_Object_Item_Signal_Cb func, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_signal_callback_add, EFL_FUNC_CALL(emission, source, func, data), const char *emission, const char *source, Elm_Object_Item_Signal_Cb func, void *data); + +void *_elm_widget_item_signal_callback_del(Eo *obj, Elm_Widget_Item_Data *pd, const char *emission, const char *source, Elm_Object_Item_Signal_Cb func); + +EOAPI EFL_FUNC_BODYV(elm_wdg_item_signal_callback_del, void *, NULL, EFL_FUNC_CALL(emission, source, func), const char *emission, const char *source, Elm_Object_Item_Signal_Cb func); + +void _elm_widget_item_signal_emit(Eo *obj, Elm_Widget_Item_Data *pd, const char *emission, const char *source); + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_signal_emit, EFL_FUNC_CALL(emission, source), const char *emission, const char *source); + +void _elm_widget_item_access_info_set(Eo *obj, Elm_Widget_Item_Data *pd, const char *txt); + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_access_info_set, EFL_FUNC_CALL(txt), const char *txt); + +Efl_Canvas_Object *_elm_widget_item_access_object_get(const Eo *obj, Elm_Widget_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_wdg_item_access_object_get, Efl_Canvas_Object *, NULL); + +void _elm_widget_item_domain_translatable_part_text_set(Eo *obj, Elm_Widget_Item_Data *pd, const char *part, const char *domain, const char *label); + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_domain_translatable_part_text_set, EFL_FUNC_CALL(part, domain, label), const char *part, const char *domain, const char *label); + +const char *_elm_widget_item_translatable_part_text_get(const Eo *obj, Elm_Widget_Item_Data *pd, const char *part); + +EOAPI EFL_FUNC_BODYV_CONST(elm_wdg_item_translatable_part_text_get, const char *, NULL, EFL_FUNC_CALL(part), const char *part); + +void _elm_widget_item_translate(Eo *obj, Elm_Widget_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_wdg_item_translate); + +void _elm_widget_item_domain_part_text_translatable_set(Eo *obj, Elm_Widget_Item_Data *pd, const char *part, const char *domain, Eina_Bool translatable); + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_domain_part_text_translatable_set, EFL_FUNC_CALL(part, domain, translatable), const char *part, const char *domain, Eina_Bool translatable); + +Efl_Canvas_Object *_elm_widget_item_track(Eo *obj, Elm_Widget_Item_Data *pd); + +EOAPI EFL_FUNC_BODY(elm_wdg_item_track, Efl_Canvas_Object *, NULL); + +void _elm_widget_item_untrack(Eo *obj, Elm_Widget_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_wdg_item_untrack); + +int _elm_widget_item_track_get(const Eo *obj, Elm_Widget_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_wdg_item_track_get, int, 0); + +void _elm_widget_item_track_cancel(Eo *obj, Elm_Widget_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_wdg_item_track_cancel); + +void _elm_widget_item_del_cb_set(Eo *obj, Elm_Widget_Item_Data *pd, Evas_Smart_Cb del_cb); + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_del_cb_set, EFL_FUNC_CALL(del_cb), Evas_Smart_Cb del_cb); + +void _elm_widget_item_tooltip_content_cb_set(Eo *obj, Elm_Widget_Item_Data *pd, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb); + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_tooltip_content_cb_set, EFL_FUNC_CALL(func, data, del_cb), Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb); + +Efl_Canvas_Object *_elm_widget_item_access_register(Eo *obj, Elm_Widget_Item_Data *pd); + +EOAPI EFL_FUNC_BODY(elm_wdg_item_access_register, Efl_Canvas_Object *, NULL); + +void _elm_widget_item_access_unregister(Eo *obj, Elm_Widget_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_wdg_item_access_unregister); + +void _elm_widget_item_access_order_unset(Eo *obj, Elm_Widget_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_wdg_item_access_order_unset); + +void _elm_widget_item_disable(Eo *obj, Elm_Widget_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_wdg_item_disable); + +void _elm_widget_item_del_pre(Eo *obj, Elm_Widget_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_wdg_item_del_pre); + +Efl_Canvas_Object *_elm_widget_item_focus_next_object_get(const Eo *obj, Elm_Widget_Item_Data *pd, Elm_Focus_Direction dir); + +EOAPI EFL_FUNC_BODYV_CONST(elm_wdg_item_focus_next_object_get, Efl_Canvas_Object *, NULL, EFL_FUNC_CALL(dir), Elm_Focus_Direction dir); + +void _elm_widget_item_focus_next_object_set(Eo *obj, Elm_Widget_Item_Data *pd, Efl_Canvas_Object *next, Elm_Focus_Direction dir); + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_focus_next_object_set, EFL_FUNC_CALL(next, dir), Efl_Canvas_Object *next, Elm_Focus_Direction dir); + +Elm_Widget_Item *_elm_widget_item_focus_next_item_get(const Eo *obj, Elm_Widget_Item_Data *pd, Elm_Focus_Direction dir); + +EOAPI EFL_FUNC_BODYV_CONST(elm_wdg_item_focus_next_item_get, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(dir), Elm_Focus_Direction dir); + +void _elm_widget_item_focus_next_item_set(Eo *obj, Elm_Widget_Item_Data *pd, Elm_Widget_Item *next_item, Elm_Focus_Direction dir); + +EOAPI EFL_VOID_FUNC_BODYV(elm_wdg_item_focus_next_item_set, EFL_FUNC_CALL(next_item, dir), Elm_Widget_Item *next_item, Elm_Focus_Direction dir); + +Efl_Object *_elm_widget_item_efl_object_constructor(Eo *obj, Elm_Widget_Item_Data *pd); + + +void _elm_widget_item_efl_object_destructor(Eo *obj, Elm_Widget_Item_Data *pd); + + +void _elm_widget_item_efl_object_invalidate(Eo *obj, Elm_Widget_Item_Data *pd); + + +Efl_Access_State_Set _elm_widget_item_efl_access_object_state_set_get(const Eo *obj, Elm_Widget_Item_Data *pd); + + +Eina_List *_elm_widget_item_efl_access_object_attributes_get(const Eo *obj, Elm_Widget_Item_Data *pd); + + +Eina_Bool _elm_widget_item_efl_access_component_extents_set(Eo *obj, Elm_Widget_Item_Data *pd, Eina_Bool screen_coords, Eina_Rect rect); + + +Eina_Rect _elm_widget_item_efl_access_component_extents_get(const Eo *obj, Elm_Widget_Item_Data *pd, Eina_Bool screen_coords); + + +Eina_Bool _elm_widget_item_efl_access_component_focus_grab(Eo *obj, Elm_Widget_Item_Data *pd); + + +static Eina_Bool +_elm_widget_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_WIDGET_ITEM_EXTRA_OPS +#define ELM_WIDGET_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_window_mode_set, _elm_widget_item_tooltip_window_mode_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_window_mode_get, _elm_widget_item_tooltip_window_mode_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_style_set, _elm_widget_item_tooltip_style_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_style_get, _elm_widget_item_tooltip_style_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_cursor_set, _elm_widget_item_cursor_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_cursor_get, _elm_widget_item_cursor_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_cursor_style_set, _elm_widget_item_cursor_style_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_cursor_style_get, _elm_widget_item_cursor_style_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_cursor_engine_only_set, _elm_widget_item_cursor_engine_only_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_cursor_engine_only_get, _elm_widget_item_cursor_engine_only_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_set, _elm_widget_item_part_content_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_get, _elm_widget_item_part_content_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_set, _elm_widget_item_part_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_get, _elm_widget_item_part_text_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_custom_set, _elm_widget_item_part_text_custom_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_custom_get, _elm_widget_item_part_text_custom_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_set, _elm_widget_item_item_focus_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_get, _elm_widget_item_item_focus_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_style_set, _elm_widget_item_style_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_style_get, _elm_widget_item_style_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_disabled_set, _elm_widget_item_disabled_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_disabled_get, _elm_widget_item_disabled_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_access_order_get, _elm_widget_item_access_order_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_access_order_set, _elm_widget_item_access_order_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_widget_get, _elm_widget_item_widget_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_pre_notify_del, _elm_widget_item_pre_notify_del), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_text_set, _elm_widget_item_tooltip_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_translatable_text_set, _elm_widget_item_tooltip_translatable_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_unset, _elm_widget_item_tooltip_unset), + EFL_OBJECT_OP_FUNC(elm_wdg_item_cursor_unset, _elm_widget_item_cursor_unset), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_unset, _elm_widget_item_part_content_unset), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_custom_update, _elm_widget_item_part_text_custom_update), + EFL_OBJECT_OP_FUNC(elm_wdg_item_signal_callback_add, _elm_widget_item_signal_callback_add), + EFL_OBJECT_OP_FUNC(elm_wdg_item_signal_callback_del, _elm_widget_item_signal_callback_del), + EFL_OBJECT_OP_FUNC(elm_wdg_item_signal_emit, _elm_widget_item_signal_emit), + EFL_OBJECT_OP_FUNC(elm_wdg_item_access_info_set, _elm_widget_item_access_info_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_access_object_get, _elm_widget_item_access_object_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_domain_translatable_part_text_set, _elm_widget_item_domain_translatable_part_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_translatable_part_text_get, _elm_widget_item_translatable_part_text_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_translate, _elm_widget_item_translate), + EFL_OBJECT_OP_FUNC(elm_wdg_item_domain_part_text_translatable_set, _elm_widget_item_domain_part_text_translatable_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_track, _elm_widget_item_track), + EFL_OBJECT_OP_FUNC(elm_wdg_item_untrack, _elm_widget_item_untrack), + EFL_OBJECT_OP_FUNC(elm_wdg_item_track_get, _elm_widget_item_track_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_track_cancel, _elm_widget_item_track_cancel), + EFL_OBJECT_OP_FUNC(elm_wdg_item_del_cb_set, _elm_widget_item_del_cb_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_tooltip_content_cb_set, _elm_widget_item_tooltip_content_cb_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_access_register, _elm_widget_item_access_register), + EFL_OBJECT_OP_FUNC(elm_wdg_item_access_unregister, _elm_widget_item_access_unregister), + EFL_OBJECT_OP_FUNC(elm_wdg_item_access_order_unset, _elm_widget_item_access_order_unset), + EFL_OBJECT_OP_FUNC(elm_wdg_item_disable, _elm_widget_item_disable), + EFL_OBJECT_OP_FUNC(elm_wdg_item_del_pre, _elm_widget_item_del_pre), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_next_object_get, _elm_widget_item_focus_next_object_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_next_object_set, _elm_widget_item_focus_next_object_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_next_item_get, _elm_widget_item_focus_next_item_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_next_item_set, _elm_widget_item_focus_next_item_set), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_widget_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_widget_item_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_invalidate, _elm_widget_item_efl_object_invalidate), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_widget_item_efl_access_object_state_set_get), + EFL_OBJECT_OP_FUNC(efl_access_object_attributes_get, _elm_widget_item_efl_access_object_attributes_get), + EFL_OBJECT_OP_FUNC(efl_access_component_extents_set, _elm_widget_item_efl_access_component_extents_set), + EFL_OBJECT_OP_FUNC(efl_access_component_extents_get, _elm_widget_item_efl_access_component_extents_get), + EFL_OBJECT_OP_FUNC(efl_access_component_focus_grab, _elm_widget_item_efl_access_component_focus_grab), + ELM_WIDGET_ITEM_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"tooltip_window_mode", __eolian_elm_widget_item_tooltip_window_mode_set_reflect, __eolian_elm_widget_item_tooltip_window_mode_get_reflect}, + {"tooltip_style", __eolian_elm_widget_item_tooltip_style_set_reflect, __eolian_elm_widget_item_tooltip_style_get_reflect}, + {"cursor", __eolian_elm_widget_item_cursor_set_reflect, __eolian_elm_widget_item_cursor_get_reflect}, + {"cursor_style", __eolian_elm_widget_item_cursor_style_set_reflect, __eolian_elm_widget_item_cursor_style_get_reflect}, + {"cursor_engine_only", __eolian_elm_widget_item_cursor_engine_only_set_reflect, __eolian_elm_widget_item_cursor_engine_only_get_reflect}, + {"item_focus", __eolian_elm_widget_item_item_focus_set_reflect, __eolian_elm_widget_item_item_focus_get_reflect}, + {"style", __eolian_elm_widget_item_style_set_reflect, __eolian_elm_widget_item_style_get_reflect}, + {"disabled", __eolian_elm_widget_item_disabled_set_reflect, __eolian_elm_widget_item_disabled_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_widget_item_class_desc = { + EO_VERSION, + "Elm.Widget.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Widget_Item_Data), + _elm_widget_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_widget_item_class_get, &_elm_widget_item_class_desc, EFL_OBJECT_CLASS, EFL_ACCESS_OBJECT_MIXIN, EFL_ACCESS_COMPONENT_MIXIN, NULL); + +#include "elm_widget_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_widget_item_eo.h b/src/lib/elementary/elm_widget_item_eo.h new file mode 100644 index 0000000000..f077e2152d --- /dev/null +++ b/src/lib/elementary/elm_widget_item_eo.h @@ -0,0 +1,883 @@ +#ifndef _ELM_WIDGET_ITEM_EO_H_ +#define _ELM_WIDGET_ITEM_EO_H_ + +#ifndef _ELM_WIDGET_ITEM_EO_CLASS_TYPE +#define _ELM_WIDGET_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Widget_Item; + +#endif + +#ifndef _ELM_WIDGET_ITEM_EO_TYPES +#define _ELM_WIDGET_ITEM_EO_TYPES + + +#endif +/** Elementary widget item class + * + * @ingroup Elm_Widget_Item + */ +#define ELM_WIDGET_ITEM_CLASS elm_widget_item_class_get() + +EWAPI const Efl_Class *elm_widget_item_class_get(void); + +/** + * @brief Control size restriction state of an object's tooltip + * + * This function returns whether a tooltip is allowed to expand beyond its + * parent window's canvas. It will instead be limited only by the size of the + * display. + * + * @param[in] obj The object. + * @param[in] disable If @c true, size restrictions are disabled + * + * @return @c false on failure, @c true on success + * + * @ingroup Elm_Widget_Item + */ +EOAPI Eina_Bool elm_wdg_item_tooltip_window_mode_set(Eo *obj, Eina_Bool disable); + +/** + * @brief Control size restriction state of an object's tooltip + * + * This function returns whether a tooltip is allowed to expand beyond its + * parent window's canvas. It will instead be limited only by the size of the + * display. + * + * @param[in] obj The object. + * + * @return If @c true, size restrictions are disabled + * + * @ingroup Elm_Widget_Item + */ +EOAPI Eina_Bool elm_wdg_item_tooltip_window_mode_get(const Eo *obj); + +/** + * @brief Control a different style for this item tooltip. + * + * @note before you set a style you should define a tooltip with + * @ref elm_wdg_item_tooltip_content_cb_set or + * @ref elm_wdg_item_tooltip_text_set + * + * See: elm_object_tooltip_style_set() for more details. + * + * @param[in] obj The object. + * @param[in] style The theme style used/to use (default, transparent, ...) + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_tooltip_style_set(Eo *obj, const char *style); + +/** + * @brief Control a different style for this item tooltip. + * + * @note before you set a style you should define a tooltip with + * @ref elm_wdg_item_tooltip_content_cb_set or + * @ref elm_wdg_item_tooltip_text_set + * + * See: elm_object_tooltip_style_set() for more details. + * + * @param[in] obj The object. + * + * @return The theme style used/to use (default, transparent, ...) + * + * @ingroup Elm_Widget_Item + */ +EOAPI const char *elm_wdg_item_tooltip_style_get(const Eo *obj); + +/** + * @brief Control the type of mouse pointer/cursor decoration to be shown, when + * the mouse pointer is over the given item + * + * This function works analogously as elm_object_cursor_set(), but here the + * cursor's changing area is restricted to the item's area, and not the whole + * widget's. Note that that item cursors have precedence over widget cursors, + * so that a mouse over an item with custom cursor set will always show that + * cursor. + * + * If this function is called twice for an object, a previously set cursor will + * be unset on the second call. + * + * @param[in] obj The object. + * @param[in] cursor The cursor type's name + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_cursor_set(Eo *obj, const char *cursor); + +/** + * @brief Control the type of mouse pointer/cursor decoration to be shown, when + * the mouse pointer is over the given item + * + * This function works analogously as elm_object_cursor_set(), but here the + * cursor's changing area is restricted to the item's area, and not the whole + * widget's. Note that that item cursors have precedence over widget cursors, + * so that a mouse over an item with custom cursor set will always show that + * cursor. + * + * If this function is called twice for an object, a previously set cursor will + * be unset on the second call. + * + * @param[in] obj The object. + * + * @return The cursor type's name + * + * @ingroup Elm_Widget_Item + */ +EOAPI const char *elm_wdg_item_cursor_get(const Eo *obj); + +/** + * @brief Control a different @c style for a given custom cursor set for an + * item. + * + * This function only makes sense when one is using custom mouse cursor + * decorations defined in a theme file, which can have, given a cursor + * name/type, alternate styles on it. It works analogously as + * elm_object_cursor_style_set(), but here applies only to item objects. + * + * @warning Before you set a cursor style you should have defined a custom + * cursor previously on the item, with @ref elm_wdg_item_cursor_set + * + * @param[in] obj The object. + * @param[in] style The theme style to use/in use (e.g. $"default", + * $"transparent", etc) + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_cursor_style_set(Eo *obj, const char *style); + +/** + * @brief Control a different @c style for a given custom cursor set for an + * item. + * + * This function only makes sense when one is using custom mouse cursor + * decorations defined in a theme file, which can have, given a cursor + * name/type, alternate styles on it. It works analogously as + * elm_object_cursor_style_set(), but here applies only to item objects. + * + * @warning Before you set a cursor style you should have defined a custom + * cursor previously on the item, with @ref elm_wdg_item_cursor_set + * + * @param[in] obj The object. + * + * @return The theme style to use/in use (e.g. $"default", $"transparent", etc) + * + * @ingroup Elm_Widget_Item + */ +EOAPI const char *elm_wdg_item_cursor_style_get(const Eo *obj); + +/** + * @brief Control if the (custom)cursor for a given item should be searched in + * its theme, also, or should only rely on the rendering engine. + * + * @note This call is of use only if you've set a custom cursor for items, with + * @ref elm_wdg_item_cursor_set. + * + * @note By default, cursors will only be looked for between those provided by + * the rendering engine. + * + * @param[in] obj The object. + * @param[in] engine_only Use @c true to have cursors looked for only on those + * provided by the rendering engine, @c false to have them searched on the + * widget's theme, as well. + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_cursor_engine_only_set(Eo *obj, Eina_Bool engine_only); + +/** + * @brief Control if the (custom)cursor for a given item should be searched in + * its theme, also, or should only rely on the rendering engine. + * + * @note This call is of use only if you've set a custom cursor for items, with + * @ref elm_wdg_item_cursor_set. + * + * @note By default, cursors will only be looked for between those provided by + * the rendering engine. + * + * @param[in] obj The object. + * + * @return Use @c true to have cursors looked for only on those provided by the + * rendering engine, @c false to have them searched on the widget's theme, as + * well. + * + * @ingroup Elm_Widget_Item + */ +EOAPI Eina_Bool elm_wdg_item_cursor_engine_only_get(const Eo *obj); + +/** + * @brief Control a content of an object item + * + * This sets a new object to an item as a content object. If any object was + * already set as a content object in the same part, previous object will be + * deleted automatically. + * + * @param[in] obj The object. + * @param[in] part The content part name (NULL for the default content) + * @param[in] content The content of the object item + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_part_content_set(Eo *obj, const char *part, Efl_Canvas_Object *content); + +/** + * @brief Control a content of an object item + * + * This sets a new object to an item as a content object. If any object was + * already set as a content object in the same part, previous object will be + * deleted automatically. + * + * @param[in] obj The object. + * @param[in] part The content part name (NULL for the default content) + * + * @return The content of the object item + * + * @ingroup Elm_Widget_Item + */ +EOAPI Efl_Canvas_Object *elm_wdg_item_part_content_get(const Eo *obj, const char *part); + +/** + * @brief Control a label of an object item + * + * @note Elementary object items may have many labels + * + * @param[in] obj The object. + * @param[in] part The text part name (NULL for the default label) + * @param[in] label Text of the label + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_part_text_set(Eo *obj, const char *part, const char *label); + +/** + * @brief Control a label of an object item + * + * @note Elementary object items may have many labels + * + * @param[in] obj The object. + * @param[in] part The text part name (NULL for the default label) + * + * @return Text of the label + * + * @ingroup Elm_Widget_Item + */ +EOAPI const char *elm_wdg_item_part_text_get(const Eo *obj, const char *part); + +#ifdef ELM_WIDGET_ITEM_PROTECTED +/** + * @brief Save additional text part content + * + * @param[in] obj The object. + * @param[in] part Part name + * @param[in] label Label name + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_part_text_custom_set(Eo *obj, const char *part, const char *label); +#endif + +#ifdef ELM_WIDGET_ITEM_PROTECTED +/** + * @brief Get additional text part content + * + * @param[in] obj The object. + * @param[in] part Part name + * + * @return Label name + * + * @ingroup Elm_Widget_Item + */ +EOAPI const char *elm_wdg_item_part_text_custom_get(const Eo *obj, const char *part); +#endif + +/** + * @brief Control the object item focused + * + * @param[in] obj The object. + * @param[in] focused The focused state + * + * @since 1.10 + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_focus_set(Eo *obj, Eina_Bool focused); + +/** + * @brief Control the object item focused + * + * @param[in] obj The object. + * + * @return The focused state + * + * @since 1.10 + * + * @ingroup Elm_Widget_Item + */ +EOAPI Eina_Bool elm_wdg_item_focus_get(const Eo *obj); + +/** + * @brief Control the style of an object item + * + * @param[in] obj The object. + * @param[in] style The style of object item + * + * @since 1.9 + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_style_set(Eo *obj, const char *style); + +/** + * @brief Control the style of an object item + * + * @param[in] obj The object. + * + * @return The style of object item + * + * @since 1.9 + * + * @ingroup Elm_Widget_Item + */ +EOAPI const char *elm_wdg_item_style_get(const Eo *obj); + +/** + * @brief Control the disabled state of a widget item. + * + * Elementary object item can be disabled, in which state they won't receive + * input and, in general, will be themed differently from their normal state, + * usually greyed out. Useful for contexts where you don't want your users to + * interact with some of the parts of you interface. + * + * This sets the state for the widget item, either disabling it or enabling it + * back. + * + * @param[in] obj The object. + * @param[in] disable @c true, if the widget item is disabled, @c false if it's + * enabled (or on errors) + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_disabled_set(Eo *obj, Eina_Bool disable); + +/** + * @brief Control the disabled state of a widget item. + * + * Elementary object item can be disabled, in which state they won't receive + * input and, in general, will be themed differently from their normal state, + * usually greyed out. Useful for contexts where you don't want your users to + * interact with some of the parts of you interface. + * + * This sets the state for the widget item, either disabling it or enabling it + * back. + * + * @param[in] obj The object. + * + * @return @c true, if the widget item is disabled, @c false if it's enabled + * (or on errors) + * + * @ingroup Elm_Widget_Item + */ +EOAPI Eina_Bool elm_wdg_item_disabled_get(const Eo *obj); + +/** + * @brief Get highlight order + * + * @param[in] obj The object. + * + * @return List of evas canvas objects + * + * @since 1.8 + * + * @ingroup Elm_Widget_Item + */ +EOAPI const Eina_List *elm_wdg_item_access_order_get(Eo *obj); + +/** + * @brief Set highlight order + * + * @param[in] obj The object. + * @param[in] objs Order of objects to pass highlight + * + * @since 1.8 + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_access_order_set(Eo *obj, Eina_List *objs); + +/** + * @brief Get the widget object's handle which contains a given item + * + * @note This returns the widget object itself that an item belongs to. Note: + * Every elm_object_item supports this API + * + * @param[in] obj The object. + * + * @return The widget object + * + * @ingroup Elm_Widget_Item + */ +EOAPI Efl_Canvas_Object *elm_wdg_item_widget_get(const Eo *obj); + +#ifdef ELM_WIDGET_ITEM_PROTECTED +/** notify deletion of widget item + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_pre_notify_del(Eo *obj); +#endif + +/** + * @brief Set the text to be shown in a given object item's tooltips. + * + * Setup the text as tooltip to object. The item can have only one tooltip, so + * any previous tooltip data - set with this function or + * @ref elm_wdg_item_tooltip_content_cb_set - is removed. + * + * See: elm_object_tooltip_text_set() for more details. + * + * @param[in] obj The object. + * @param[in] text The text to set in the content. + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_tooltip_text_set(Eo *obj, const char *text); + +#ifdef ELM_WIDGET_ITEM_PROTECTED +/** + * @brief Set widget item tooltip as a text string + * + * @param[in] obj The object. + * @param[in] text Tooltip text + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_tooltip_translatable_text_set(Eo *obj, const char *text); +#endif + +/** + * @brief Unset tooltip from item. + * + * Remove tooltip from item. The callback provided as del_cb to + * @ref elm_wdg_item_tooltip_content_cb_set will be called to notify it is not + * used anymore. + * + * See: elm_object_tooltip_unset() for more details. See: + * @ref elm_wdg_item_tooltip_content_cb_set + * @param[in] obj The object. + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_tooltip_unset(Eo *obj); + +/** + * @brief Unset any custom mouse pointer/cursor decoration set to be shown, + * when the mouse pointer is over the given item, thus making it show the + * default cursor again. + * + * Use this call to undo any custom settings on this item's cursor decoration, + * bringing it back to defaults (no custom style set). + * + * See: elm_object_cursor_unset() See: @ref elm_wdg_item_cursor_set + * @param[in] obj The object. + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_cursor_unset(Eo *obj); + +/** + * @brief Unset a content of an object item + * + * @note Elementary object items may have many contents + * + * @param[in] obj The object. + * @param[in] part The content part name to unset (NULL for the default + * content) + * + * @return Content object + * + * @ingroup Elm_Widget_Item + */ +EOAPI Efl_Canvas_Object *elm_wdg_item_part_content_unset(Eo *obj, const char *part); + +#ifdef ELM_WIDGET_ITEM_PROTECTED +/** Update additional text part content + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_part_text_custom_update(Eo *obj); +#endif + +/** + * @brief Add a callback for a signal emitted by object item edje. + * + * This function connects a callback function to a signal emitted by the edje + * object of the object item. Globs can occur in either the emission or source + * name. + * + * @param[in] obj The object. + * @param[in] emission The signal's name. + * @param[in] source The signal's source. + * @param[in] func The callback function to be executed when the signal is + * emitted. + * @param[in] data A pointer to data to pass to the callback function. + * + * @since 1.8 + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_signal_callback_add(Eo *obj, const char *emission, const char *source, Elm_Object_Item_Signal_Cb func, void *data); + +/** + * @brief Remove a signal-triggered callback from a object item edje object. + * + * This function removes the last callback, previously attached to a signal + * emitted by an underlying Edje object of @c it, whose parameters @c emission, + * @c source and @c func match exactly with those passed to a previous call to + * @ref elm_wdg_item_signal_callback_add. The data pointer that was passed to + * this call will be returned. + * + * See: @ref elm_wdg_item_signal_callback_add + * + * @param[in] obj The object. + * @param[in] emission The signal's name. + * @param[in] source The signal's source. + * @param[in] func The callback function to be executed when the signal is + * emitted. + * + * @return The data pointer of the signal callback or @c NULL, on errors. + * + * @since 1.8 + * + * @ingroup Elm_Widget_Item + */ +EOAPI void *elm_wdg_item_signal_callback_del(Eo *obj, const char *emission, const char *source, Elm_Object_Item_Signal_Cb func); + +/** + * @brief Send a signal to the edje object of the widget item. + * + * This function sends a signal to the edje object of the obj item. An edje + * program can respond to a signal by specifying matching 'signal' and 'source' + * fields. Don't use this unless you want to also handle resetting of part + * states to default on every unrealize in case of genlist/gengrid. + * + * @param[in] obj The object. + * @param[in] emission The signal's name. + * @param[in] source The signal's source. + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_signal_emit(Eo *obj, const char *emission, const char *source); + +/** + * @brief Set the text to read out when in accessibility mode + * + * @param[in] obj The object. + * @param[in] txt The text that describes the widget to people with poor or no + * vision + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_access_info_set(Eo *obj, const char *txt); + +/** + * @brief Get an accessible object of the object item. + * + * @param[in] obj The object. + * + * @return Accessible object of the object item or NULL for any error + * + * @since 1.8 + * + * @ingroup Elm_Widget_Item + */ +EOAPI Efl_Canvas_Object *elm_wdg_item_access_object_get(const Eo *obj); + +/** + * @brief Set the text for an object item's part, marking it as translatable. + * + * The string to set as @c text must be the original one. Do not pass the + * return of @c gettext() here. Elementary will translate the string internally + * and set it on the object item using @ref elm_wdg_item_part_text_set, also + * storing the original string so that it can be automatically translated when + * the language is changed with elm_language_set(). The @c domain will be + * stored along to find the translation in the correct catalog. It can be NULL, + * in which case it will use whatever domain was set by the application with + * @c textdomain(). This is useful in case you are building a library on top of + * Elementary that will have its own translatable strings, that should not be + * mixed with those of programs using the library. + * + * @param[in] obj The object. + * @param[in] part The name of the part to set + * @param[in] domain The translation domain to use + * @param[in] label The original, non-translated text to set + * + * @since 1.8 + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_domain_translatable_part_text_set(Eo *obj, const char *part, const char *domain, const char *label); + +/** + * @brief Get the original string set as translatable for an object item. + * + * When setting translated strings, the function + * @ref elm_wdg_item_part_text_get will return the translation returned by + * @c gettext(). To get the original string use this function. + * + * @param[in] obj The object. + * @param[in] part The name of the part that was set + * + * @return The original, untranslated string + * + * @since 1.8 + * + * @ingroup Elm_Widget_Item + */ +EOAPI const char *elm_wdg_item_translatable_part_text_get(const Eo *obj, const char *part); + +#ifdef ELM_WIDGET_ITEM_PROTECTED +/** Query translate + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_translate(Eo *obj); +#endif + +/** + * @brief Mark the part text to be translatable or not. + * + * Once you mark the part text to be translatable, the text will be translated + * internally regardless of @ref elm_wdg_item_part_text_set and + * @ref elm_wdg_item_domain_translatable_part_text_set. In other case, if you + * set the Elementary policy that all text will be translatable in default, you + * can set the part text to not be translated by calling this API. + * + * See: @ref elm_wdg_item_domain_translatable_part_text_set See: + * @ref elm_wdg_item_part_text_set See: elm_policy() + * + * @param[in] obj The object. + * @param[in] part The part name of the translatable text + * @param[in] domain The translation domain to use + * @param[in] translatable @c true, the part text will be translated + * internally. @c false, otherwise. + * + * @since 1.8 + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_domain_part_text_translatable_set(Eo *obj, const char *part, const char *domain, Eina_Bool translatable); + +/** + * @brief This returns track object of the item. + * + * @note This gets a rectangle object that represents the object item's + * internal object. If you want to check the geometry, visibility of the item, + * you can call the evas apis such as evas_object_geometry_get(), + * evas_object_visible_get() to the track object. Note that all of the widget + * items may/may not have the internal object so this api may return @c NULL if + * the widget item doesn't have it. Additionally, the widget item is + * managed/controlled by the widget, the widget item could be changed(moved, + * resized even deleted) anytime by it's own widget's decision. So please dont' + * change the track object as well as don't keep the track object in your side + * as possible but get the track object at the moment you need to refer. + * Otherwise, you need to add some callbacks to the track object to track it's + * attributes changes. + * + * @warning After use the track object, please call the + * @ref elm_wdg_item_untrack() paired to elm_object_item_track definitely to + * free the track object properly. Don't delete the track object. + * + * See: @ref elm_wdg_item_untrack See: @ref elm_wdg_item_track_get + * + * @param[in] obj The object. + * + * @return The track object + * + * @since 1.8 + * + * @ingroup Elm_Widget_Item + */ +EOAPI Efl_Canvas_Object *elm_wdg_item_track(Eo *obj); + +/** + * @brief This retrieve the track object of the item. + * + * @note This retrieves the track object that was returned from + * @ref elm_wdg_item_track. + * + * See: @ref elm_wdg_item_track See: @ref elm_wdg_item_track_get + * + * @param[in] obj The object. + * + * @since 1.8 + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_untrack(Eo *obj); + +/** + * @brief Get the track object reference count. + * + * @note This gets the reference count for the track object. Whenever you call + * the @ref elm_wdg_item_track, the reference count will be increased by one. + * Likely the reference count will be decreased again when you call the + * @ref elm_wdg_item_untrack. Unless the reference count reaches to zero, the + * track object won't be deleted. So please be sure to call + * @ref elm_wdg_item_untrack() paired to the elm_object_item_track call count. + * + * See: @ref elm_wdg_item_track See: @ref elm_wdg_item_track_get + * + * @param[in] obj The object. + * + * @return Track object reference count + * + * @since 1.8 + * + * @ingroup Elm_Widget_Item + */ +EOAPI int elm_wdg_item_track_get(const Eo *obj); + +#ifdef ELM_WIDGET_ITEM_PROTECTED +/** Query track_cancel + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_track_cancel(Eo *obj); +#endif + +/** + * @brief Set the function to be called when an item from the widget is freed. + * + * @note Every elm_object_item supports this API + * + * @param[in] obj The object. + * @param[in] del_cb The function called + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_del_cb_set(Eo *obj, Evas_Smart_Cb del_cb); + +/** + * @brief Set the content to be shown in the tooltip item. + * + * Setup the tooltip to item. The item can have only one tooltip, so any + * previous tooltip data is removed. @c func(with @c data) will be called every + * time that need show the tooltip and it should return a valid Evas_Object. + * This object is then managed fully by tooltip system and is deleted when the + * tooltip is gone. + * + * See: elm_object_tooltip_content_cb_set() for more details. + * + * @param[in] obj The object. + * @param[in] func The function used to create the tooltip contents. + * @param[in] data What to provide to @c func as callback data/context. + * @param[in] del_cb Called when data is not needed anymore, either when + * another callback replaces @c func, the tooltip is unset with + * @ref elm_wdg_item_tooltip_unset or the owner @c item dies. This callback + * receives as the first parameter the given @c data, and @c event_info is the + * item. + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_tooltip_content_cb_set(Eo *obj, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb); + +/** + * @brief Register object item as an accessible object. + * + * @param[in] obj The object. + * + * @return Accessible object of the object item or NULL for any error + * + * @since 1.8 + * + * @ingroup Elm_Widget_Item + */ +EOAPI Efl_Canvas_Object *elm_wdg_item_access_register(Eo *obj); + +/** Unregister accessible object of the object item. + * + * @since 1.8 + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_access_unregister(Eo *obj); + +/** Unset highlight order + * + * @since 1.8 + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_access_order_unset(Eo *obj); + +#ifdef ELM_WIDGET_ITEM_PROTECTED +/** Disable widget item + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_disable(Eo *obj); +#endif + +#ifdef ELM_WIDGET_ITEM_PROTECTED +/** Delete pre widget item + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_del_pre(Eo *obj); +#endif + +/** + * @brief Get the next object with specific focus direction. + * + * @param[in] obj The object. + * @param[in] dir Focus direction + * + * @return Focus next object + * + * @since 1.16 + * + * @ingroup Elm_Widget_Item + */ +EOAPI Efl_Canvas_Object *elm_wdg_item_focus_next_object_get(const Eo *obj, Elm_Focus_Direction dir); + +/** + * @brief Set the next object with specific focus direction. + * + * @param[in] obj The object. + * @param[in] next Focus next object + * @param[in] dir Focus direction + * + * @since 1.16 + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_focus_next_object_set(Eo *obj, Efl_Canvas_Object *next, Elm_Focus_Direction dir); + +/** + * @brief Get the next object item with specific focus direction. + * + * @param[in] obj The object. + * @param[in] dir Focus direction + * + * @return Focus next object item + * + * @since 1.16 + * + * @ingroup Elm_Widget_Item + */ +EOAPI Elm_Widget_Item *elm_wdg_item_focus_next_item_get(const Eo *obj, Elm_Focus_Direction dir); + +/** + * @brief Set the next object item with specific focus direction. + * + * @param[in] obj The object. + * @param[in] next_item Focus next object item + * @param[in] dir Focus direction + * + * @since 1.16 + * + * @ingroup Elm_Widget_Item + */ +EOAPI void elm_wdg_item_focus_next_item_set(Eo *obj, Elm_Widget_Item *next_item, Elm_Focus_Direction dir); + +#endif diff --git a/src/lib/elementary/elm_widget_item_eo.legacy.c b/src/lib/elementary/elm_widget_item_eo.legacy.c new file mode 100644 index 0000000000..52f54730fb --- /dev/null +++ b/src/lib/elementary/elm_widget_item_eo.legacy.c @@ -0,0 +1,282 @@ + +EAPI Eina_Bool +elm_object_item_tooltip_window_mode_set(Elm_Widget_Item *obj, Eina_Bool disable) +{ + return elm_wdg_item_tooltip_window_mode_set(obj, disable); +} + +EAPI Eina_Bool +elm_object_item_tooltip_window_mode_get(const Elm_Widget_Item *obj) +{ + return elm_wdg_item_tooltip_window_mode_get(obj); +} + +EAPI void +elm_object_item_tooltip_style_set(Elm_Widget_Item *obj, const char *style) +{ + elm_wdg_item_tooltip_style_set(obj, style); +} + +EAPI const char * +elm_object_item_tooltip_style_get(const Elm_Widget_Item *obj) +{ + return elm_wdg_item_tooltip_style_get(obj); +} + +EAPI void +elm_object_item_cursor_set(Elm_Widget_Item *obj, const char *cursor) +{ + elm_wdg_item_cursor_set(obj, cursor); +} + +EAPI const char * +elm_object_item_cursor_get(const Elm_Widget_Item *obj) +{ + return elm_wdg_item_cursor_get(obj); +} + +EAPI void +elm_object_item_cursor_style_set(Elm_Widget_Item *obj, const char *style) +{ + elm_wdg_item_cursor_style_set(obj, style); +} + +EAPI const char * +elm_object_item_cursor_style_get(const Elm_Widget_Item *obj) +{ + return elm_wdg_item_cursor_style_get(obj); +} + +EAPI void +elm_object_item_cursor_engine_only_set(Elm_Widget_Item *obj, Eina_Bool engine_only) +{ + elm_wdg_item_cursor_engine_only_set(obj, engine_only); +} + +EAPI Eina_Bool +elm_object_item_cursor_engine_only_get(const Elm_Widget_Item *obj) +{ + return elm_wdg_item_cursor_engine_only_get(obj); +} + +EAPI void +elm_object_item_part_content_set(Elm_Widget_Item *obj, const char *part, Efl_Canvas_Object *content) +{ + elm_wdg_item_part_content_set(obj, part, content); +} + +EAPI Efl_Canvas_Object * +elm_object_item_part_content_get(const Elm_Widget_Item *obj, const char *part) +{ + return elm_wdg_item_part_content_get(obj, part); +} + +EAPI void +elm_object_item_part_text_set(Elm_Widget_Item *obj, const char *part, const char *label) +{ + elm_wdg_item_part_text_set(obj, part, label); +} + +EAPI const char * +elm_object_item_part_text_get(const Elm_Widget_Item *obj, const char *part) +{ + return elm_wdg_item_part_text_get(obj, part); +} + +EAPI void +elm_object_item_focus_set(Elm_Widget_Item *obj, Eina_Bool focused) +{ + elm_wdg_item_focus_set(obj, focused); +} + +EAPI Eina_Bool +elm_object_item_focus_get(const Elm_Widget_Item *obj) +{ + return elm_wdg_item_focus_get(obj); +} + +EAPI void +elm_object_item_style_set(Elm_Widget_Item *obj, const char *style) +{ + elm_wdg_item_style_set(obj, style); +} + +EAPI const char * +elm_object_item_style_get(const Elm_Widget_Item *obj) +{ + return elm_wdg_item_style_get(obj); +} + +EAPI void +elm_object_item_disabled_set(Elm_Widget_Item *obj, Eina_Bool disable) +{ + elm_wdg_item_disabled_set(obj, disable); +} + +EAPI Eina_Bool +elm_object_item_disabled_get(const Elm_Widget_Item *obj) +{ + return elm_wdg_item_disabled_get(obj); +} + +EAPI const Eina_List * +elm_object_item_access_order_get(Elm_Widget_Item *obj) +{ + return elm_wdg_item_access_order_get(obj); +} + +EAPI void +elm_object_item_access_order_set(Elm_Widget_Item *obj, Eina_List *objs) +{ + elm_wdg_item_access_order_set(obj, objs); +} + +EAPI Efl_Canvas_Object * +elm_object_item_widget_get(const Elm_Widget_Item *obj) +{ + return elm_wdg_item_widget_get(obj); +} + +EAPI void +elm_object_item_tooltip_text_set(Elm_Widget_Item *obj, const char *text) +{ + elm_wdg_item_tooltip_text_set(obj, text); +} + +EAPI void +elm_object_item_tooltip_unset(Elm_Widget_Item *obj) +{ + elm_wdg_item_tooltip_unset(obj); +} + +EAPI void +elm_object_item_cursor_unset(Elm_Widget_Item *obj) +{ + elm_wdg_item_cursor_unset(obj); +} + +EAPI Efl_Canvas_Object * +elm_object_item_part_content_unset(Elm_Widget_Item *obj, const char *part) +{ + return elm_wdg_item_part_content_unset(obj, part); +} + +EAPI void +elm_object_item_signal_callback_add(Elm_Widget_Item *obj, const char *emission, const char *source, Elm_Object_Item_Signal_Cb func, void *data) +{ + elm_wdg_item_signal_callback_add(obj, emission, source, func, data); +} + +EAPI void * +elm_object_item_signal_callback_del(Elm_Widget_Item *obj, const char *emission, const char *source, Elm_Object_Item_Signal_Cb func) +{ + return elm_wdg_item_signal_callback_del(obj, emission, source, func); +} + +EAPI void +elm_object_item_signal_emit(Elm_Widget_Item *obj, const char *emission, const char *source) +{ + elm_wdg_item_signal_emit(obj, emission, source); +} + +EAPI void +elm_object_item_access_info_set(Elm_Widget_Item *obj, const char *txt) +{ + elm_wdg_item_access_info_set(obj, txt); +} + +EAPI Efl_Canvas_Object * +elm_object_item_access_object_get(const Elm_Widget_Item *obj) +{ + return elm_wdg_item_access_object_get(obj); +} + +EAPI void +elm_object_item_domain_translatable_part_text_set(Elm_Widget_Item *obj, const char *part, const char *domain, const char *label) +{ + elm_wdg_item_domain_translatable_part_text_set(obj, part, domain, label); +} + +EAPI const char * +elm_object_item_translatable_part_text_get(const Elm_Widget_Item *obj, const char *part) +{ + return elm_wdg_item_translatable_part_text_get(obj, part); +} + +EAPI void +elm_object_item_domain_part_text_translatable_set(Elm_Widget_Item *obj, const char *part, const char *domain, Eina_Bool translatable) +{ + elm_wdg_item_domain_part_text_translatable_set(obj, part, domain, translatable); +} + +EAPI Efl_Canvas_Object * +elm_object_item_track(Elm_Widget_Item *obj) +{ + return elm_wdg_item_track(obj); +} + +EAPI void +elm_object_item_untrack(Elm_Widget_Item *obj) +{ + elm_wdg_item_untrack(obj); +} + +EAPI int +elm_object_item_track_get(const Elm_Widget_Item *obj) +{ + return elm_wdg_item_track_get(obj); +} + +EAPI void +elm_object_item_del_cb_set(Elm_Widget_Item *obj, Evas_Smart_Cb del_cb) +{ + elm_wdg_item_del_cb_set(obj, del_cb); +} + +EAPI void +elm_object_item_tooltip_content_cb_set(Elm_Widget_Item *obj, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb) +{ + elm_wdg_item_tooltip_content_cb_set(obj, func, data, del_cb); +} + +EAPI Efl_Canvas_Object * +elm_object_item_access_register(Elm_Widget_Item *obj) +{ + return elm_wdg_item_access_register(obj); +} + +EAPI void +elm_object_item_access_unregister(Elm_Widget_Item *obj) +{ + elm_wdg_item_access_unregister(obj); +} + +EAPI void +elm_object_item_access_order_unset(Elm_Widget_Item *obj) +{ + elm_wdg_item_access_order_unset(obj); +} + +EAPI Efl_Canvas_Object * +elm_object_item_focus_next_object_get(const Elm_Widget_Item *obj, Elm_Focus_Direction dir) +{ + return elm_wdg_item_focus_next_object_get(obj, dir); +} + +EAPI void +elm_object_item_focus_next_object_set(Elm_Widget_Item *obj, Efl_Canvas_Object *next, Elm_Focus_Direction dir) +{ + elm_wdg_item_focus_next_object_set(obj, next, dir); +} + +EAPI Elm_Widget_Item * +elm_object_item_focus_next_item_get(const Elm_Widget_Item *obj, Elm_Focus_Direction dir) +{ + return elm_wdg_item_focus_next_item_get(obj, dir); +} + +EAPI void +elm_object_item_focus_next_item_set(Elm_Widget_Item *obj, Elm_Widget_Item *next_item, Elm_Focus_Direction dir) +{ + elm_wdg_item_focus_next_item_set(obj, next_item, dir); +} diff --git a/src/lib/elementary/elm_widget_item_eo.legacy.h b/src/lib/elementary/elm_widget_item_eo.legacy.h new file mode 100644 index 0000000000..2937be3df0 --- /dev/null +++ b/src/lib/elementary/elm_widget_item_eo.legacy.h @@ -0,0 +1,811 @@ +#ifndef _ELM_WIDGET_ITEM_EO_LEGACY_H_ +#define _ELM_WIDGET_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_WIDGET_ITEM_EO_CLASS_TYPE +#define _ELM_WIDGET_ITEM_EO_CLASS_TYPE + +/** + * @typedef Elm_Widget_Item + * An Elementary widget item handle. + * This is a sub component of an Elementary widget and it is the same as + * Elementary object item, Elm_Object_Item. + * Common functions for Elementary widget item are provided on this page. + * Each Elementary widget also provides its own functions to use Elementary + * widget item. + * For more details about how Elementary widget item is used with Elementary + * widget, please refer each Elementary widget's documents. + * @ingroup Elm_General + */ +typedef Eo Elm_Widget_Item; + +#endif + +#ifndef _ELM_WIDGET_ITEM_EO_TYPES +#define _ELM_WIDGET_ITEM_EO_TYPES + + +#endif + +/** + * @brief Control size restriction state of an object's tooltip + * + * This function returns whether a tooltip is allowed to expand beyond its + * parent window's canvas. It will instead be limited only by the size of the + * display. + * + * @param[in] obj The object. + * @param[in] disable If @c true, size restrictions are disabled + * + * @return @c false on failure, @c true on success + * + * @ingroup Elm_General + */ +EAPI Eina_Bool elm_object_item_tooltip_window_mode_set(Elm_Widget_Item *obj, Eina_Bool disable); + +/** + * @brief Control size restriction state of an object's tooltip + * + * This function returns whether a tooltip is allowed to expand beyond its + * parent window's canvas. It will instead be limited only by the size of the + * display. + * + * @param[in] obj The object. + * + * @return If @c true, size restrictions are disabled + * + * @ingroup Elm_General + */ +EAPI Eina_Bool elm_object_item_tooltip_window_mode_get(const Elm_Widget_Item *obj); + +/** + * @brief Control a different style for this item tooltip. + * + * @note before you set a style you should define a tooltip with + * @ref elm_object_item_tooltip_content_cb_set or + * @ref elm_object_item_tooltip_text_set + * + * See: elm_object_tooltip_style_set() for more details. + * + * @param[in] obj The object. + * @param[in] style The theme style used/to use (default, transparent, ...) + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_tooltip_style_set(Elm_Widget_Item *obj, const char *style); + +/** + * @brief Control a different style for this item tooltip. + * + * @note before you set a style you should define a tooltip with + * @ref elm_object_item_tooltip_content_cb_set or + * @ref elm_object_item_tooltip_text_set + * + * See: elm_object_tooltip_style_set() for more details. + * + * @param[in] obj The object. + * + * @return The theme style used/to use (default, transparent, ...) + * + * @ingroup Elm_General + */ +EAPI const char *elm_object_item_tooltip_style_get(const Elm_Widget_Item *obj); + +/** + * @brief Control the type of mouse pointer/cursor decoration to be shown, when + * the mouse pointer is over the given item + * + * This function works analogously as elm_object_cursor_set(), but here the + * cursor's changing area is restricted to the item's area, and not the whole + * widget's. Note that that item cursors have precedence over widget cursors, + * so that a mouse over an item with custom cursor set will always show that + * cursor. + * + * If this function is called twice for an object, a previously set cursor will + * be unset on the second call. + * + * @param[in] obj The object. + * @param[in] cursor The cursor type's name + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_cursor_set(Elm_Widget_Item *obj, const char *cursor); + +/** + * @brief Control the type of mouse pointer/cursor decoration to be shown, when + * the mouse pointer is over the given item + * + * This function works analogously as elm_object_cursor_set(), but here the + * cursor's changing area is restricted to the item's area, and not the whole + * widget's. Note that that item cursors have precedence over widget cursors, + * so that a mouse over an item with custom cursor set will always show that + * cursor. + * + * If this function is called twice for an object, a previously set cursor will + * be unset on the second call. + * + * @param[in] obj The object. + * + * @return The cursor type's name + * + * @ingroup Elm_General + */ +EAPI const char *elm_object_item_cursor_get(const Elm_Widget_Item *obj); + +/** + * @brief Control a different @c style for a given custom cursor set for an + * item. + * + * This function only makes sense when one is using custom mouse cursor + * decorations defined in a theme file, which can have, given a cursor + * name/type, alternate styles on it. It works analogously as + * elm_object_cursor_style_set(), but here applies only to item objects. + * + * @warning Before you set a cursor style you should have defined a custom + * cursor previously on the item, with @ref elm_object_item_cursor_set + * + * @param[in] obj The object. + * @param[in] style The theme style to use/in use (e.g. $"default", + * $"transparent", etc) + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_cursor_style_set(Elm_Widget_Item *obj, const char *style); + +/** + * @brief Control a different @c style for a given custom cursor set for an + * item. + * + * This function only makes sense when one is using custom mouse cursor + * decorations defined in a theme file, which can have, given a cursor + * name/type, alternate styles on it. It works analogously as + * elm_object_cursor_style_set(), but here applies only to item objects. + * + * @warning Before you set a cursor style you should have defined a custom + * cursor previously on the item, with @ref elm_object_item_cursor_set + * + * @param[in] obj The object. + * + * @return The theme style to use/in use (e.g. $"default", $"transparent", etc) + * + * @ingroup Elm_General + */ +EAPI const char *elm_object_item_cursor_style_get(const Elm_Widget_Item *obj); + +/** + * @brief Control if the (custom)cursor for a given item should be searched in + * its theme, also, or should only rely on the rendering engine. + * + * @note This call is of use only if you've set a custom cursor for items, with + * @ref elm_object_item_cursor_set. + * + * @note By default, cursors will only be looked for between those provided by + * the rendering engine. + * + * @param[in] obj The object. + * @param[in] engine_only Use @c true to have cursors looked for only on those + * provided by the rendering engine, @c false to have them searched on the + * widget's theme, as well. + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_cursor_engine_only_set(Elm_Widget_Item *obj, Eina_Bool engine_only); + +/** + * @brief Control if the (custom)cursor for a given item should be searched in + * its theme, also, or should only rely on the rendering engine. + * + * @note This call is of use only if you've set a custom cursor for items, with + * @ref elm_object_item_cursor_set. + * + * @note By default, cursors will only be looked for between those provided by + * the rendering engine. + * + * @param[in] obj The object. + * + * @return Use @c true to have cursors looked for only on those provided by the + * rendering engine, @c false to have them searched on the widget's theme, as + * well. + * + * @ingroup Elm_General + */ +EAPI Eina_Bool elm_object_item_cursor_engine_only_get(const Elm_Widget_Item *obj); + +/** + * @brief Control a content of an object item + * + * This sets a new object to an item as a content object. If any object was + * already set as a content object in the same part, previous object will be + * deleted automatically. + * + * @param[in] obj The object. + * @param[in] part The content part name (NULL for the default content) + * @param[in] content The content of the object item + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_part_content_set(Elm_Widget_Item *obj, const char *part, Efl_Canvas_Object *content); + +/** + * @brief Control a content of an object item + * + * This sets a new object to an item as a content object. If any object was + * already set as a content object in the same part, previous object will be + * deleted automatically. + * + * @param[in] obj The object. + * @param[in] part The content part name (NULL for the default content) + * + * @return The content of the object item + * + * @ingroup Elm_General + */ +EAPI Efl_Canvas_Object *elm_object_item_part_content_get(const Elm_Widget_Item *obj, const char *part); + +/** + * @brief Control a label of an object item + * + * @note Elementary object items may have many labels + * + * @param[in] obj The object. + * @param[in] part The text part name (NULL for the default label) + * @param[in] label Text of the label + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_part_text_set(Elm_Widget_Item *obj, const char *part, const char *label); + +/** + * @brief Control a label of an object item + * + * @note Elementary object items may have many labels + * + * @param[in] obj The object. + * @param[in] part The text part name (NULL for the default label) + * + * @return Text of the label + * + * @ingroup Elm_General + */ +EAPI const char *elm_object_item_part_text_get(const Elm_Widget_Item *obj, const char *part); + + + +/** + * @brief Control the object item focused + * + * @param[in] obj The object. + * @param[in] focused The focused state + * + * @since 1.10 + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_focus_set(Elm_Widget_Item *obj, Eina_Bool focused); + +/** + * @brief Control the object item focused + * + * @param[in] obj The object. + * + * @return The focused state + * + * @since 1.10 + * + * @ingroup Elm_General + */ +EAPI Eina_Bool elm_object_item_focus_get(const Elm_Widget_Item *obj); + +/** + * @brief Control the style of an object item + * + * @param[in] obj The object. + * @param[in] style The style of object item + * + * @since 1.9 + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_style_set(Elm_Widget_Item *obj, const char *style); + +/** + * @brief Control the style of an object item + * + * @param[in] obj The object. + * + * @return The style of object item + * + * @since 1.9 + * + * @ingroup Elm_General + */ +EAPI const char *elm_object_item_style_get(const Elm_Widget_Item *obj); + +/** + * @brief Control the disabled state of a widget item. + * + * Elementary object item can be disabled, in which state they won't receive + * input and, in general, will be themed differently from their normal state, + * usually greyed out. Useful for contexts where you don't want your users to + * interact with some of the parts of you interface. + * + * This sets the state for the widget item, either disabling it or enabling it + * back. + * + * @param[in] obj The object. + * @param[in] disable @c true, if the widget item is disabled, @c false if it's + * enabled (or on errors) + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_disabled_set(Elm_Widget_Item *obj, Eina_Bool disable); + +/** + * @brief Control the disabled state of a widget item. + * + * Elementary object item can be disabled, in which state they won't receive + * input and, in general, will be themed differently from their normal state, + * usually greyed out. Useful for contexts where you don't want your users to + * interact with some of the parts of you interface. + * + * This sets the state for the widget item, either disabling it or enabling it + * back. + * + * @param[in] obj The object. + * + * @return @c true, if the widget item is disabled, @c false if it's enabled + * (or on errors) + * + * @ingroup Elm_General + */ +EAPI Eina_Bool elm_object_item_disabled_get(const Elm_Widget_Item *obj); + +/** + * @brief Get highlight order + * + * @param[in] obj The object. + * + * @return List of evas canvas objects + * + * @since 1.8 + * + * @ingroup Elm_General + */ +EAPI const Eina_List *elm_object_item_access_order_get(Elm_Widget_Item *obj); + +/** + * @brief Set highlight order + * + * @param[in] obj The object. + * @param[in] objs Order of objects to pass highlight + * + * @since 1.8 + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_access_order_set(Elm_Widget_Item *obj, Eina_List *objs); + +/** + * @brief Get the widget object's handle which contains a given item + * + * @note This returns the widget object itself that an item belongs to. Note: + * Every elm_object_item supports this API + * + * @param[in] obj The object. + * + * @return The widget object + * + * @ingroup Elm_General + */ +EAPI Efl_Canvas_Object *elm_object_item_widget_get(const Elm_Widget_Item *obj); + + +/** + * @brief Set the text to be shown in a given object item's tooltips. + * + * Setup the text as tooltip to object. The item can have only one tooltip, so + * any previous tooltip data - set with this function or + * @ref elm_object_item_tooltip_content_cb_set - is removed. + * + * See: elm_object_tooltip_text_set() for more details. + * + * @param[in] obj The object. + * @param[in] text The text to set in the content. + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_tooltip_text_set(Elm_Widget_Item *obj, const char *text); + + +/** + * @brief Unset tooltip from item. + * + * Remove tooltip from item. The callback provided as del_cb to + * @ref elm_object_item_tooltip_content_cb_set will be called to notify it is + * not used anymore. + * + * See: elm_object_tooltip_unset() for more details. See: + * @ref elm_object_item_tooltip_content_cb_set + * @param[in] obj The object. + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_tooltip_unset(Elm_Widget_Item *obj); + +/** + * @brief Unset any custom mouse pointer/cursor decoration set to be shown, + * when the mouse pointer is over the given item, thus making it show the + * default cursor again. + * + * Use this call to undo any custom settings on this item's cursor decoration, + * bringing it back to defaults (no custom style set). + * + * See: elm_object_cursor_unset() See: @ref elm_object_item_cursor_set + * @param[in] obj The object. + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_cursor_unset(Elm_Widget_Item *obj); + +/** + * @brief Unset a content of an object item + * + * @note Elementary object items may have many contents + * + * @param[in] obj The object. + * @param[in] part The content part name to unset (NULL for the default + * content) + * + * @return Content object + * + * @ingroup Elm_General + */ +EAPI Efl_Canvas_Object *elm_object_item_part_content_unset(Elm_Widget_Item *obj, const char *part); + + +/** + * @brief Add a callback for a signal emitted by object item edje. + * + * This function connects a callback function to a signal emitted by the edje + * object of the object item. Globs can occur in either the emission or source + * name. + * + * @param[in] obj The object. + * @param[in] emission The signal's name. + * @param[in] source The signal's source. + * @param[in] func The callback function to be executed when the signal is + * emitted. + * @param[in] data A pointer to data to pass to the callback function. + * + * @since 1.8 + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_signal_callback_add(Elm_Widget_Item *obj, const char *emission, const char *source, Elm_Object_Item_Signal_Cb func, void *data); + +/** + * @brief Remove a signal-triggered callback from a object item edje object. + * + * This function removes the last callback, previously attached to a signal + * emitted by an underlying Edje object of @c it, whose parameters @c emission, + * @c source and @c func match exactly with those passed to a previous call to + * @ref elm_object_item_signal_callback_add. The data pointer that was passed + * to this call will be returned. + * + * See: @ref elm_object_item_signal_callback_add + * + * @param[in] obj The object. + * @param[in] emission The signal's name. + * @param[in] source The signal's source. + * @param[in] func The callback function to be executed when the signal is + * emitted. + * + * @return The data pointer of the signal callback or @c NULL, on errors. + * + * @since 1.8 + * + * @ingroup Elm_General + */ +EAPI void *elm_object_item_signal_callback_del(Elm_Widget_Item *obj, const char *emission, const char *source, Elm_Object_Item_Signal_Cb func); + +/** + * @brief Send a signal to the edje object of the widget item. + * + * This function sends a signal to the edje object of the obj item. An edje + * program can respond to a signal by specifying matching 'signal' and 'source' + * fields. Don't use this unless you want to also handle resetting of part + * states to default on every unrealize in case of genlist/gengrid. + * + * @param[in] obj The object. + * @param[in] emission The signal's name. + * @param[in] source The signal's source. + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_signal_emit(Elm_Widget_Item *obj, const char *emission, const char *source); + +/** + * @brief Set the text to read out when in accessibility mode + * + * @param[in] obj The object. + * @param[in] txt The text that describes the widget to people with poor or no + * vision + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_access_info_set(Elm_Widget_Item *obj, const char *txt); + +/** + * @brief Get an accessible object of the object item. + * + * @param[in] obj The object. + * + * @return Accessible object of the object item or NULL for any error + * + * @since 1.8 + * + * @ingroup Elm_General + */ +EAPI Efl_Canvas_Object *elm_object_item_access_object_get(const Elm_Widget_Item *obj); + +/** + * @brief Set the text for an object item's part, marking it as translatable. + * + * The string to set as @c text must be the original one. Do not pass the + * return of @c gettext() here. Elementary will translate the string internally + * and set it on the object item using @ref elm_object_item_part_text_set, also + * storing the original string so that it can be automatically translated when + * the language is changed with elm_language_set(). The @c domain will be + * stored along to find the translation in the correct catalog. It can be NULL, + * in which case it will use whatever domain was set by the application with + * @c textdomain(). This is useful in case you are building a library on top of + * Elementary that will have its own translatable strings, that should not be + * mixed with those of programs using the library. + * + * @param[in] obj The object. + * @param[in] part The name of the part to set + * @param[in] domain The translation domain to use + * @param[in] label The original, non-translated text to set + * + * @since 1.8 + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_domain_translatable_part_text_set(Elm_Widget_Item *obj, const char *part, const char *domain, const char *label); + +/** + * @brief Get the original string set as translatable for an object item. + * + * When setting translated strings, the function + * @ref elm_object_item_part_text_get will return the translation returned by + * @c gettext(). To get the original string use this function. + * + * @param[in] obj The object. + * @param[in] part The name of the part that was set + * + * @return The original, untranslated string + * + * @since 1.8 + * + * @ingroup Elm_General + */ +EAPI const char *elm_object_item_translatable_part_text_get(const Elm_Widget_Item *obj, const char *part); + + +/** + * @brief Mark the part text to be translatable or not. + * + * Once you mark the part text to be translatable, the text will be translated + * internally regardless of @ref elm_object_item_part_text_set and + * @ref elm_object_item_domain_translatable_part_text_set. In other case, if + * you set the Elementary policy that all text will be translatable in default, + * you can set the part text to not be translated by calling this API. + * + * See: @ref elm_object_item_domain_translatable_part_text_set See: + * @ref elm_object_item_part_text_set See: elm_policy() + * + * @param[in] obj The object. + * @param[in] part The part name of the translatable text + * @param[in] domain The translation domain to use + * @param[in] translatable @c true, the part text will be translated + * internally. @c false, otherwise. + * + * @since 1.8 + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_domain_part_text_translatable_set(Elm_Widget_Item *obj, const char *part, const char *domain, Eina_Bool translatable); + +/** + * @brief This returns track object of the item. + * + * @note This gets a rectangle object that represents the object item's + * internal object. If you want to check the geometry, visibility of the item, + * you can call the evas apis such as evas_object_geometry_get(), + * evas_object_visible_get() to the track object. Note that all of the widget + * items may/may not have the internal object so this api may return @c NULL if + * the widget item doesn't have it. Additionally, the widget item is + * managed/controlled by the widget, the widget item could be changed(moved, + * resized even deleted) anytime by it's own widget's decision. So please dont' + * change the track object as well as don't keep the track object in your side + * as possible but get the track object at the moment you need to refer. + * Otherwise, you need to add some callbacks to the track object to track it's + * attributes changes. + * + * @warning After use the track object, please call the + * @ref elm_object_item_untrack() paired to elm_object_item_track definitely to + * free the track object properly. Don't delete the track object. + * + * See: @ref elm_object_item_untrack See: @ref elm_object_item_track_get + * + * @param[in] obj The object. + * + * @return The track object + * + * @since 1.8 + * + * @ingroup Elm_General + */ +EAPI Efl_Canvas_Object *elm_object_item_track(Elm_Widget_Item *obj); + +/** + * @brief This retrieve the track object of the item. + * + * @note This retrieves the track object that was returned from + * @ref elm_object_item_track. + * + * See: @ref elm_object_item_track See: @ref elm_object_item_track_get + * + * @param[in] obj The object. + * + * @since 1.8 + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_untrack(Elm_Widget_Item *obj); + +/** + * @brief Get the track object reference count. + * + * @note This gets the reference count for the track object. Whenever you call + * the @ref elm_object_item_track, the reference count will be increased by + * one. Likely the reference count will be decreased again when you call the + * @ref elm_object_item_untrack. Unless the reference count reaches to zero, + * the track object won't be deleted. So please be sure to call + * @ref elm_object_item_untrack() paired to the elm_object_item_track call + * count. + * + * See: @ref elm_object_item_track See: @ref elm_object_item_track_get + * + * @param[in] obj The object. + * + * @return Track object reference count + * + * @since 1.8 + * + * @ingroup Elm_General + */ +EAPI int elm_object_item_track_get(const Elm_Widget_Item *obj); + + +/** + * @brief Set the function to be called when an item from the widget is freed. + * + * @note Every elm_object_item supports this API + * + * @param[in] obj The object. + * @param[in] del_cb The function called + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_del_cb_set(Elm_Widget_Item *obj, Evas_Smart_Cb del_cb); + +/** + * @brief Set the content to be shown in the tooltip item. + * + * Setup the tooltip to item. The item can have only one tooltip, so any + * previous tooltip data is removed. @c func(with @c data) will be called every + * time that need show the tooltip and it should return a valid Evas_Object. + * This object is then managed fully by tooltip system and is deleted when the + * tooltip is gone. + * + * See: elm_object_tooltip_content_cb_set() for more details. + * + * @param[in] obj The object. + * @param[in] func The function used to create the tooltip contents. + * @param[in] data What to provide to @c func as callback data/context. + * @param[in] del_cb Called when data is not needed anymore, either when + * another callback replaces @c func, the tooltip is unset with + * @ref elm_object_item_tooltip_unset or the owner @c item dies. This callback + * receives as the first parameter the given @c data, and @c event_info is the + * item. + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_tooltip_content_cb_set(Elm_Widget_Item *obj, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb); + +/** + * @brief Register object item as an accessible object. + * + * @param[in] obj The object. + * + * @return Accessible object of the object item or NULL for any error + * + * @since 1.8 + * + * @ingroup Elm_General + */ +EAPI Efl_Canvas_Object *elm_object_item_access_register(Elm_Widget_Item *obj); + +/** Unregister accessible object of the object item. + * + * @since 1.8 + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_access_unregister(Elm_Widget_Item *obj); + +/** Unset highlight order + * + * @since 1.8 + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_access_order_unset(Elm_Widget_Item *obj); + + + +/** + * @brief Get the next object with specific focus direction. + * + * @param[in] obj The object. + * @param[in] dir Focus direction + * + * @return Focus next object + * + * @since 1.16 + * + * @ingroup Elm_General + */ +EAPI Efl_Canvas_Object *elm_object_item_focus_next_object_get(const Elm_Widget_Item *obj, Elm_Focus_Direction dir); + +/** + * @brief Set the next object with specific focus direction. + * + * @param[in] obj The object. + * @param[in] next Focus next object + * @param[in] dir Focus direction + * + * @since 1.16 + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_focus_next_object_set(Elm_Widget_Item *obj, Efl_Canvas_Object *next, Elm_Focus_Direction dir); + +/** + * @brief Get the next object item with specific focus direction. + * + * @param[in] obj The object. + * @param[in] dir Focus direction + * + * @return Focus next object item + * + * @since 1.16 + * + * @ingroup Elm_General + */ +EAPI Elm_Widget_Item *elm_object_item_focus_next_item_get(const Elm_Widget_Item *obj, Elm_Focus_Direction dir); + +/** + * @brief Set the next object item with specific focus direction. + * + * @param[in] obj The object. + * @param[in] next_item Focus next object item + * @param[in] dir Focus direction + * + * @since 1.16 + * + * @ingroup Elm_General + */ +EAPI void elm_object_item_focus_next_item_set(Elm_Widget_Item *obj, Elm_Widget_Item *next_item, Elm_Focus_Direction dir); + +#endif diff --git a/src/lib/elementary/elm_widget_item_static_focus.c b/src/lib/elementary/elm_widget_item_static_focus.c index 6a8a82aa6d..c2061ed808 100644 --- a/src/lib/elementary/elm_widget_item_static_focus.c +++ b/src/lib/elementary/elm_widget_item_static_focus.c @@ -7,8 +7,8 @@ #define MY_CLASS ELM_WIDGET_ITEM_STATIC_FOCUS_CLASS #include -#include "elm_genlist.eo.h" -#include "elm_gengrid.eo.h" +#include "elm_genlist_eo.h" +#include "elm_gengrid_eo.h" #include "elm_priv.h" #include "efl_ui_focus_composition_adapter.eo.h" @@ -35,7 +35,7 @@ _list_realized_cb(void *data, const Efl_Event *ev) if (!elm_object_item_disabled_get(data) && elm_genlist_item_type_get(data) != ELM_GENLIST_ITEM_GROUP) - efl_ui_focus_object_prepare_logical(data); + efl_ui_focus_object_setup_order(data); } static void @@ -54,11 +54,7 @@ _grid_realized_cb(void *data, const Efl_Event *ev) if (!elm_object_item_disabled_get(data) && !is_group) { - Elm_Widget_Item_Data *wpd = efl_data_scope_get(data, ELM_WIDGET_ITEM_CLASS); - - //first prepare the container - efl_ui_focus_object_prepare_logical(wpd->widget); - efl_ui_focus_object_prepare_logical(data); + efl_ui_focus_object_setup_order(data); } } @@ -83,12 +79,12 @@ _unrealized_cb(void *data, const Efl_Event *ev EINA_UNUSED) } EOLIAN static void -_elm_widget_item_static_focus_efl_ui_focus_object_prepare_logical_none_recursive(Eo *obj, Elm_Widget_Item_Static_Focus_Data *pd EINA_UNUSED) +_elm_widget_item_static_focus_efl_ui_focus_object_setup_order_non_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_none_recursive(efl_super(obj, MY_CLASS)); + efl_ui_focus_object_setup_order_non_recursive(efl_super(obj, MY_CLASS)); if (!pd->realized) { @@ -183,4 +179,4 @@ _elm_widget_item_static_focus_efl_object_destructor(Eo *obj, Elm_Widget_Item_Sta } -#include "elm_widget_item_static_focus.eo.c" +#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 deleted file mode 100644 index 4722e9690d..0000000000 --- a/src/lib/elementary/elm_widget_item_static_focus.eo +++ /dev/null @@ -1,9 +0,0 @@ -class Elm.Widget.Item.Static_Focus extends Elm.Widget.Item implements 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.Object.constructor; - Efl.Object.destructor; - Efl.Ui.Focus.Object.prepare_logical_none_recursive; - } -} diff --git a/src/lib/elementary/elm_widget_item_static_focus_eo.c b/src/lib/elementary/elm_widget_item_static_focus_eo.c new file mode 100644 index 0000000000..646d5e1dcf --- /dev/null +++ b/src/lib/elementary/elm_widget_item_static_focus_eo.c @@ -0,0 +1,43 @@ + +Efl_Object *_elm_widget_item_static_focus_efl_object_constructor(Eo *obj, Elm_Widget_Item_Static_Focus_Data *pd); + + +void _elm_widget_item_static_focus_efl_object_destructor(Eo *obj, Elm_Widget_Item_Static_Focus_Data *pd); + + +void _elm_widget_item_static_focus_efl_ui_focus_object_setup_order_non_recursive(Eo *obj, Elm_Widget_Item_Static_Focus_Data *pd); + + +static Eina_Bool +_elm_widget_item_static_focus_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_WIDGET_ITEM_STATIC_FOCUS_EXTRA_OPS +#define ELM_WIDGET_ITEM_STATIC_FOCUS_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_widget_item_static_focus_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_widget_item_static_focus_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_setup_order_non_recursive, _elm_widget_item_static_focus_efl_ui_focus_object_setup_order_non_recursive), + ELM_WIDGET_ITEM_STATIC_FOCUS_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_widget_item_static_focus_class_desc = { + EO_VERSION, + "Elm.Widget.Item.Static_Focus", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Widget_Item_Static_Focus_Data), + _elm_widget_item_static_focus_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_widget_item_static_focus_class_get, &_elm_widget_item_static_focus_class_desc, ELM_WIDGET_ITEM_CLASS, EFL_UI_FOCUS_OBJECT_MIXIN, NULL); diff --git a/src/lib/elementary/elm_widget_item_static_focus_eo.h b/src/lib/elementary/elm_widget_item_static_focus_eo.h new file mode 100644 index 0000000000..c1f058f042 --- /dev/null +++ b/src/lib/elementary/elm_widget_item_static_focus_eo.h @@ -0,0 +1,26 @@ +#ifndef _ELM_WIDGET_ITEM_STATIC_FOCUS_EO_H_ +#define _ELM_WIDGET_ITEM_STATIC_FOCUS_EO_H_ + +#ifndef _ELM_WIDGET_ITEM_STATIC_FOCUS_EO_CLASS_TYPE +#define _ELM_WIDGET_ITEM_STATIC_FOCUS_EO_CLASS_TYPE + +typedef Eo Elm_Widget_Item_Static_Focus; + +#endif + +#ifndef _ELM_WIDGET_ITEM_STATIC_FOCUS_EO_TYPES +#define _ELM_WIDGET_ITEM_STATIC_FOCUS_EO_TYPES + + +#endif +/** 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. + * + * @ingroup Elm_Widget_Item_Static_Focus + */ +#define ELM_WIDGET_ITEM_STATIC_FOCUS_CLASS elm_widget_item_static_focus_class_get() + +EWAPI const Efl_Class *elm_widget_item_static_focus_class_get(void); + +#endif diff --git a/src/lib/elementary/elm_widget_item_static_focus_eo.legacy.h b/src/lib/elementary/elm_widget_item_static_focus_eo.legacy.h new file mode 100644 index 0000000000..804806b9eb --- /dev/null +++ b/src/lib/elementary/elm_widget_item_static_focus_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_WIDGET_ITEM_STATIC_FOCUS_EO_LEGACY_H_ +#define _ELM_WIDGET_ITEM_STATIC_FOCUS_EO_LEGACY_H_ + +#ifndef _ELM_WIDGET_ITEM_STATIC_FOCUS_EO_CLASS_TYPE +#define _ELM_WIDGET_ITEM_STATIC_FOCUS_EO_CLASS_TYPE + +typedef Eo Elm_Widget_Item_Static_Focus; + +#endif + +#ifndef _ELM_WIDGET_ITEM_STATIC_FOCUS_EO_TYPES +#define _ELM_WIDGET_ITEM_STATIC_FOCUS_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_widget_label.h b/src/lib/elementary/elm_widget_label.h index 899a79e815..949fcdfb00 100644 --- a/src/lib/elementary/elm_widget_label.h +++ b/src/lib/elementary/elm_widget_label.h @@ -5,7 +5,7 @@ #include -#include "elm_label.eo.h" +#include "elm_label_eo.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 diff --git a/src/lib/elementary/elm_widget_layout.h b/src/lib/elementary/elm_widget_layout.h index a8e92d566d..4fda71cdba 100644 --- a/src/lib/elementary/elm_widget_layout.h +++ b/src/lib/elementary/elm_widget_layout.h @@ -58,19 +58,19 @@ typedef struct _Elm_Layout_Smart_Data 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. */ + Eina_Bool needs_size_calc : 1; /**< This flag is set true when the layout sizing eval is already requested. This defers sizing evaluation until smart calculation to avoid unnecessary calculation. */ Eina_Bool restricted_calc_w : 1; /**< This is a flag to support edje restricted_calc in w axis. */ Eina_Bool restricted_calc_h : 1; /**< This is a flag to support edje restricted_calc in y axis. */ 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 automatic_orientation_apply : 1; } Efl_Ui_Layout_Data; /** @@ -78,10 +78,10 @@ typedef struct _Elm_Layout_Smart_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_Data * sd = efl_data_scope_get(o, EFL_UI_LAYOUT_BASE_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_BASE_CLASS))) \ return #endif diff --git a/src/lib/elementary/elm_widget_list.h b/src/lib/elementary/elm_widget_list.h index 707f170e92..a92807de0f 100644 --- a/src/lib/elementary/elm_widget_list.h +++ b/src/lib/elementary/elm_widget_list.h @@ -3,8 +3,8 @@ #include "elm_interface_scrollable.h" #include "elm_widget_layout.h" -#include "elm_list.eo.h" -#include "elm_list_item.eo.h" +#include "elm_list_eo.h" +#include "elm_list_item_eo.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 diff --git a/src/lib/elementary/elm_widget_menu.h b/src/lib/elementary/elm_widget_menu.h index be2daee861..dfcc538e90 100644 --- a/src/lib/elementary/elm_widget_menu.h +++ b/src/lib/elementary/elm_widget_menu.h @@ -3,9 +3,9 @@ #include "Elementary.h" -#include "elm_menu.eo.h" -#include "elm_menu_item.eo.h" -#include "elm_hover.eo.h" +#include "elm_menu_eo.h" +#include "elm_menu_item_eo.h" +#include "elm_hover_eo.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 diff --git a/src/lib/elementary/elm_widget_notify.h b/src/lib/elementary/elm_widget_notify.h index 0026f195f3..484377b97e 100644 --- a/src/lib/elementary/elm_widget_notify.h +++ b/src/lib/elementary/elm_widget_notify.h @@ -3,7 +3,7 @@ #include "Elementary.h" -#include +#include /* 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 diff --git a/src/lib/elementary/elm_widget_panel.h b/src/lib/elementary/elm_widget_panel.h index 7aa093fa44..dbbbf80f5c 100644 --- a/src/lib/elementary/elm_widget_panel.h +++ b/src/lib/elementary/elm_widget_panel.h @@ -3,7 +3,7 @@ #include "elm_interface_scrollable.h" #include "elm_widget_layout.h" -#include "elm_panel.eo.h" +#include "elm_panel_eo.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 diff --git a/src/lib/elementary/elm_widget_player.h b/src/lib/elementary/elm_widget_player.h index 3bc4f204b9..ace9128e88 100644 --- a/src/lib/elementary/elm_widget_player.h +++ b/src/lib/elementary/elm_widget_player.h @@ -3,7 +3,7 @@ #include "Elementary.h" -#include "elm_player.eo.h" +#include "elm_player_eo.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 diff --git a/src/lib/elementary/elm_widget_plug.h b/src/lib/elementary/elm_widget_plug.h index 8798fee764..8fb923c323 100644 --- a/src/lib/elementary/elm_widget_plug.h +++ b/src/lib/elementary/elm_widget_plug.h @@ -2,7 +2,7 @@ #define ELM_WIDGET_PLUG_H #include "Elementary.h" -#include "elm_plug.eo.h" +#include "elm_plug_eo.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 diff --git a/src/lib/elementary/elm_widget_popup.h b/src/lib/elementary/elm_widget_popup.h index a57d22f40b..6c16a76e1f 100644 --- a/src/lib/elementary/elm_widget_popup.h +++ b/src/lib/elementary/elm_widget_popup.h @@ -3,9 +3,9 @@ #include "Elementary.h" #include "elm_widget_layout.h" -#include "elm_notify.eo.h" -#include "elm_popup_item.eo.h" -#include "elm_popup.eo.h" +#include "elm_notify_eo.h" +#include "elm_popup_item_eo.h" +#include "elm_popup_eo.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 diff --git a/src/lib/elementary/elm_widget_route.h b/src/lib/elementary/elm_widget_route.h index 6c6286bf4d..651c67fd14 100644 --- a/src/lib/elementary/elm_widget_route.h +++ b/src/lib/elementary/elm_widget_route.h @@ -1,7 +1,7 @@ #ifndef ELM_WIDGET_ROUTE_H #define ELM_WIDGET_ROUTE_H -#include "elm_route.eo.h" +#include "elm_route_eo.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 diff --git a/src/lib/elementary/elm_widget_thumb.h b/src/lib/elementary/elm_widget_thumb.h index 927d79860b..dd034112d0 100644 --- a/src/lib/elementary/elm_widget_thumb.h +++ b/src/lib/elementary/elm_widget_thumb.h @@ -65,6 +65,7 @@ struct _Elm_Thumb_Data Eina_Bool on_hold : 1; Eina_Bool is_video : 1; Eina_Bool was_video : 1; + Eina_Bool loaded : 1; }; /** diff --git a/src/lib/elementary/elm_win.h b/src/lib/elementary/elm_win.h index 7720b980cb..3e45dd15ff 100644 --- a/src/lib/elementary/elm_win.h +++ b/src/lib/elementary/elm_win.h @@ -104,13 +104,11 @@ */ #include -#ifdef EFL_EO_API_SUPPORT -#include -#endif #ifndef EFL_NOLEGACY_API_SUPPORT #include #endif - +/* FIXME: what the actual fuck. */ +# include /** * @} */ diff --git a/src/lib/elementary/elm_win_eo.h b/src/lib/elementary/elm_win_eo.h index 4d3daa8884..39ec8eb4b1 100644 --- a/src/lib/elementary/elm_win_eo.h +++ b/src/lib/elementary/elm_win_eo.h @@ -1,3 +1,6 @@ +#ifndef ELM_WIN_EO_H +# define ELM_WIN_EO_H + /** * @ingroup Elm_Win * @@ -8,7 +11,7 @@ EAPI void elm_win_autodel_set(Evas_Object *obj, Eina_Bool autodel); EAPI Eina_Bool elm_win_autodel_get(const Evas_Object *obj); - +#ifdef EFL_BETA_API_SUPPORT /** * @brief Set the window's autodel state. * @@ -57,3 +60,6 @@ efl_ui_win_autodel_get(const Efl_Ui_Win *obj) /** * @} */ +#endif + +#endif diff --git a/src/lib/elementary/elm_win_legacy.h b/src/lib/elementary/elm_win_legacy.h index be2e7f987e..613e0eb74b 100644 --- a/src/lib/elementary/elm_win_legacy.h +++ b/src/lib/elementary/elm_win_legacy.h @@ -1,5 +1,3 @@ -#include "efl_ui_win.eo.legacy.h" - /** * @brief In some environments, like phones, you may have an indicator that * shows battery status, reception, time etc. This is the indicator. @@ -50,59 +48,145 @@ typedef enum ELM_ILLUME_COMMAND_CLOSE /** Closes the currently active window */ } Elm_Illume_Command; -typedef Efl_Ui_Win_Type Elm_Win_Type; -#define ELM_WIN_UNKNOWN EFL_UI_WIN_UNKNOWN -#define ELM_WIN_BASIC EFL_UI_WIN_BASIC -#define ELM_WIN_DIALOG_BASIC EFL_UI_WIN_DIALOG_BASIC -#define ELM_WIN_DESKTOP EFL_UI_WIN_DESKTOP -#define ELM_WIN_DOCK EFL_UI_WIN_DOCK -#define ELM_WIN_TOOLBAR EFL_UI_WIN_TOOLBAR -#define ELM_WIN_MENU EFL_UI_WIN_MENU -#define ELM_WIN_UTILITY EFL_UI_WIN_UTILITY -#define ELM_WIN_SPLASH EFL_UI_WIN_SPLASH -#define ELM_WIN_DROPDOWN_MENU EFL_UI_WIN_DROPDOWN_MENU -#define ELM_WIN_POPUP_MENU EFL_UI_WIN_POPUP_MENU -#define ELM_WIN_TOOLTIP EFL_UI_WIN_TOOLTIP -#define ELM_WIN_NOTIFICATION EFL_UI_WIN_NOTIFICATION -#define ELM_WIN_COMBO EFL_UI_WIN_COMBO /** - * 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(). + * @brief Defines the types of window that can be created + * + * These are hints set on a window so that a running Window Manager knows how + * the window should be handled and/or what kind of decorations it should have. + * + * Currently, only the X11 backed engines use them. + * + * @ingroup Elm_Win */ -#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 */ -#define ELM_WIN_NAVIFRAME_BASIC EFL_UI_WIN_NAVIFRAME_BASIC +typedef enum +{ + ELM_WIN_UNKNOWN = -1 /* +1 */, /**< Default, unknown, type */ + ELM_WIN_BASIC, /**< A normal window. Indicates a normal, top-level window. + * Almost every window will be created with this type. */ + ELM_WIN_DIALOG_BASIC, /**< Used for simple dialog windows. */ + ELM_WIN_DESKTOP, /**< For special desktop windows, like a background window + * holding desktop icons. */ + ELM_WIN_DOCK, /**< The window is used as a dock or panel. Usually would be + * kept on top of any other window by the Window Manager. */ + ELM_WIN_TOOLBAR, /**< The window is used to hold a floating toolbar, or + * similar. */ + ELM_WIN_MENU, /**< Similar to @.toolbar. */ + ELM_WIN_UTILITY, /**< A persistent utility window, like a toolbox or + * palette. */ + ELM_WIN_SPLASH, /**< Splash window for a starting up application. */ + ELM_WIN_DROPDOWN_MENU, /**< The window is a dropdown menu, as when an + * entry in a menubar is clicked. This hint exists + * for completion only, as the EFL way of + * implementing a menu would not normally use a + * separate window for its contents. */ + ELM_WIN_POPUP_MENU, /**< Like @.dropdown_menu, but for the menu triggered + * by right-clicking an object. */ + ELM_WIN_TOOLTIP, /**< The window is a tooltip. A short piece of explanatory + * text that typically appear after the mouse cursor + * hovers over an object for a while. Typically not very + * commonly used in the EFL. */ + ELM_WIN_NOTIFICATION, /**< A notification window, like a warning about + * battery life or a new E-Mail received. */ + ELM_WIN_COMBO, /**< A window holding the contents of a combo box. Not + * usually used in the EFL. */ -typedef Efl_Ui_Win_Keyboard_Mode Elm_Win_Keyboard_Mode; +/** +* 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(). +*/ + ELM_WIN_DND, + ELM_WIN_INLINED_IMAGE, + ELM_WIN_SOCKET_IMAGE, + ELM_WIN_FAKE, /**< See elm_win_fake_add(). @since 1.13 */ -#define ELM_WIN_KEYBOARD_UNKNOWN EFL_UI_WIN_KEYBOARD_UNKNOWN -#define ELM_WIN_KEYBOARD_OFF EFL_UI_WIN_KEYBOARD_OFF -#define ELM_WIN_KEYBOARD_ON EFL_UI_WIN_KEYBOARD_ON -#define ELM_WIN_KEYBOARD_ALPHA EFL_UI_WIN_KEYBOARD_ALPHA -#define ELM_WIN_KEYBOARD_NUMERIC EFL_UI_WIN_KEYBOARD_NUMERIC -#define ELM_WIN_KEYBOARD_PIN EFL_UI_WIN_KEYBOARD_PIN -#define ELM_WIN_KEYBOARD_PHONE_NUMBER EFL_UI_WIN_KEYBOARD_PHONE_NUMBER -#define ELM_WIN_KEYBOARD_HEX EFL_UI_WIN_KEYBOARD_HEX -#define ELM_WIN_KEYBOARD_TERMINAL EFL_UI_WIN_KEYBOARD_TERMINAL -#define ELM_WIN_KEYBOARD_PASSWORD EFL_UI_WIN_KEYBOARD_PASSWORD -#define ELM_WIN_KEYBOARD_IP EFL_UI_WIN_KEYBOARD_IP -#define ELM_WIN_KEYBOARD_HOST EFL_UI_WIN_KEYBOARD_HOST -#define ELM_WIN_KEYBOARD_FILE EFL_UI_WIN_KEYBOARD_FILE -#define ELM_WIN_KEYBOARD_URL EFL_UI_WIN_KEYBOARD_URL -#define ELM_WIN_KEYBOARD_KEYPAD EFL_UI_WIN_KEYBOARD_KEYPAD -#define ELM_WIN_KEYBOARD_J2ME EFL_UI_WIN_KEYBOARD_J2ME + ELM_WIN_NAVIFRAME_BASIC, /**< Used for naviframe style replacement with + * a back button instead of a close button. + * + * @since 1.19 */ +} Elm_Win_Type; -typedef Efl_Ui_Win_Keygrab_Mode Elm_Win_Keygrab_Mode; +/** + * @brief The different layouts that can be requested for the virtual keyboard. + * + * When the application window is being managed by Illume it may request any of + * the following layouts for the virtual keyboard. + * + * @ingroup Elm_Win + */ +typedef enum +{ + ELM_WIN_KEYBOARD_UNKNOWN = 0, /**< Unknown keyboard state */ + ELM_WIN_KEYBOARD_OFF, /**< Request to deactivate the keyboard */ + ELM_WIN_KEYBOARD_ON, /**< Enable keyboard with default layout */ + ELM_WIN_KEYBOARD_ALPHA, /**< Alpha (a-z) keyboard layout */ + ELM_WIN_KEYBOARD_NUMERIC, /**< Numeric keyboard layout */ + ELM_WIN_KEYBOARD_PIN, /**< PIN keyboard layout */ + ELM_WIN_KEYBOARD_PHONE_NUMBER, /**< Phone keyboard layout */ + ELM_WIN_KEYBOARD_HEX, /**< Hexadecimal numeric keyboard layout */ + ELM_WIN_KEYBOARD_TERMINAL, /**< Full (QWERTY) keyboard layout */ + ELM_WIN_KEYBOARD_PASSWORD, /**< Password keyboard layout */ + ELM_WIN_KEYBOARD_IP, /**< IP keyboard layout */ + ELM_WIN_KEYBOARD_HOST, /**< Host keyboard layout */ + ELM_WIN_KEYBOARD_FILE, /**< File keyboard layout */ + ELM_WIN_KEYBOARD_URL, /**< URL keyboard layout */ + ELM_WIN_KEYBOARD_KEYPAD, /**< Keypad layout */ + ELM_WIN_KEYBOARD_J2ME /**< J2ME keyboard layout */ +} Elm_Win_Keyboard_Mode; + +/** Define the keygrab modes of window. A window may send commands to the + * Keyrouter according this mode, and perform different actions. + * + * @ingroup Elm_Win + */ +typedef enum +{ + ELM_WIN_KEYGRAB_UNKNOWN = 0, /**< Unknown keygrab mode */ + ELM_WIN_KEYGRAB_SHARED = 256 /* 1 >> 8 */, /**< Get the grabbed-key + * together with the other + * client windows */ + ELM_WIN_KEYGRAB_TOPMOST = 512 /* 1 >> 9 */, /**< Get the grabbed-key only + * when window is top of the + * stack */ + ELM_WIN_KEYGRAB_EXCLUSIVE = 1024 /* 1 >> 10 */, /**< Get the grabbed-key + * exclusively regardless + * of window's position */ + ELM_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE = 2048 /* 1 >> 11 */ /**< Get the grabbed-key exclusively + * regardless of window's position. + * This is overrided by grabs from the + * other client window */ +} Elm_Win_Keygrab_Mode; + + +/** + * @brief Define the move or resize mode of window. + * + * The user can request the display server to start moving or resizing the + * window by combining these modes. However only limited combinations are + * allowed. + * + * Currently, only the following 9 combinations are permitted. More + * combinations may be added in future: 1. move, 2. top, 3. bottom, 4. left, 5. + * right, 6. top | left, 7. top | right, 8. bottom | left, 9. bottom | right. + * + * @since 1.19 + * + * @ingroup Elm_Win + */ +typedef enum +{ + ELM_WIN_MOVE_RESIZE_MOVE = 1, /**< Start moving window */ + ELM_WIN_MOVE_RESIZE_TOP = 2 /* 1 >> 1 */, /**< Start resizing window to the + * top */ + ELM_WIN_MOVE_RESIZE_BOTTOM = 4 /* 1 >> 2 */, /**< Start resizing window to + * the bottom */ + ELM_WIN_MOVE_RESIZE_LEFT = 8 /* 1 >> 3 */, /**< Start resizing window to + * the left */ + ELM_WIN_MOVE_RESIZE_RIGHT = 16 /* 1 >> 4 */ /**< Start resizing window to + * the right */ +} Elm_Win_Move_Resize_Mode; -#define ELM_WIN_KEYGRAB_UNKNOWN EFL_UI_WIN_KEYGRAB_UNKNOWN -#define ELM_WIN_KEYGRAB_SHARED EFL_UI_WIN_KEYGRAB_SHARED -#define ELM_WIN_KEYGRAB_TOPMOST EFL_UI_WIN_KEYGRAB_TOPMOST -#define ELM_WIN_KEYGRAB_EXCLUSIVE EFL_UI_WIN_KEYGRAB_EXCLUSIVE -#define ELM_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE EFL_UI_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE /** * Adds a window object. If this is the first window created, pass NULL as @@ -172,7 +256,7 @@ EAPI Evas_Object *elm_win_util_standard_add(const char *name, const cha * This creates a window like elm_win_add() but also puts in a standard * background with elm_bg_add(), as well as setting the window title to * @p title. The window type created is of type ELM_WIN_DIALOG_BASIC. - * This tipe of window will be handled in special mode by window managers + * This type of window will be handled in special mode by window managers * with regards of it's @p parent window. * * @return The created object, or @c NULL on failure @@ -356,7 +440,7 @@ EAPI Ecore_Win32_Window *elm_win_win32_window_get(const Evas_Object *obj); /** * Set the preferred rotation value. * - * This function is used to set the orientation of window @p obj to spicific angle fixed. + * This function is used to set the orientation of window @p obj to specific angle fixed. * * @param obj The window object * @param rotation The preferred rotation of the window in degrees (0-360), @@ -1164,7 +1248,7 @@ EAPI Eina_Bool elm_win_keygrab_unset(Elm_Win *obj, const char *key, Evas_Modifie /** * @brief Get the elm_win object from any child object - * + * * @return The elm_win, or @c NULL on failure * @since 1.20 */ @@ -1196,69 +1280,6 @@ EAPI Eina_Bool elm_win_socket_listen(Elm_Win *obj, const char *svcname, int svcn */ EAPI Eina_Bool elm_win_focus_get(const Elm_Win *obj); -/** - * @brief Set the style for the focus highlight on this window. - * - * Sets the style to use for theming the highlight of focused objects on the - * given window. If @c style is NULL, the default will be used. - * - * @param[in] style The style or @c null if none. - * - * @ingroup Efl_Ui_Win - */ -EAPI void elm_win_focus_highlight_style_set(Elm_Win *obj, const char *style); - -/** - * @brief Get the style set for the focus highlight object. - * - * @return The style or @c null if none. - * - * @ingroup Efl_Ui_Win - */ -EAPI const char *elm_win_focus_highlight_style_get(const Elm_Win *obj); - -/** - * @brief Set the enabled status for the focus highlight in a window. - * - * This function will enable or disable the focus highlight only for the given - * window, regardless of the global setting for it. - * - * @param[in] enabled The enabled value for the highlight. - * - * @ingroup Efl_Ui_Win - */ -EAPI void elm_win_focus_highlight_enabled_set(Elm_Win *obj, Eina_Bool enabled); - -/** - * @brief Get the enabled value of the focus highlight for this window. - * - * @return The enabled value for the highlight. - * - * @ingroup Efl_Ui_Win - */ -EAPI Eina_Bool elm_win_focus_highlight_enabled_get(const Elm_Win *obj); - -/** - * @brief Set the animate status for the focus highlight for this window. - * - * This function will enable or disable the animation of focus highlight only - * for the given window, rof the global setting for it. - * - * @param[in] animate The enabled value for the highlight animation. - * - * @ingroup Efl_Ui_Win - */ -EAPI void elm_win_focus_highlight_animate_set(Elm_Win *obj, Eina_Bool animate); - -/** - * @brief Get the animate value of the focus highlight for this window. - * - * @return The enabled value for the highlight animation. - * - * @ingroup Efl_Ui_Win - */ -EAPI Eina_Bool elm_win_focus_highlight_animate_get(const Elm_Win *obj); - /** * @brief Raise a window object. * @@ -1327,3 +1348,602 @@ EAPI void elm_win_wm_rotation_available_rotations_set(Elm_Win *obj, const int *r * @ingroup Efl_Ui_Win */ EAPI Eina_Bool elm_win_wm_rotation_available_rotations_get(const Elm_Win *obj, int **rotations, unsigned int *count); + + +/** + * @brief Constrain the maximum width and height of a window to the width and + * height of the screen. + * + * When @c constrain is @c true, @c obj will never resize larger than the + * screen. + * + * @param[in] obj The object. + * @param[in] constrain @c true to restrict the window's maximum size. + * + * @ingroup Elm_Win_Group + */ +EAPI void elm_win_screen_constrain_set(Evas_Object *obj, Eina_Bool constrain); + +/** + * @brief Get the constraints on the maximum width and height of a window + * relative to the width and height of the screen. + * + * When this function returns @c true, @c obj will never resize larger than the + * screen. + * + * @param[in] obj The object. + * + * @return @c true to restrict the window's maximum size. + * + * @ingroup Elm_Win_Group + */ +EAPI Eina_Bool elm_win_screen_constrain_get(const Evas_Object *obj); + +/** + * @brief Set the window to be skipped by keyboard focus. + * + * This sets the window to be skipped by normal keyboard input. This means a + * window manager will be asked not to focus this window as well as omit it + * from things like the taskbar, pager, "alt-tab" list etc. etc. + * + * Call this and enable it on a window BEFORE you show it for the first time, + * otherwise it may have no effect. + * + * Use this for windows that have only output information or might only be + * interacted with by the mouse or touchscreen, never for typing. This may have + * side-effects like making the window non-accessible in some cases unless the + * window is specially handled. Use this with care. + * + * @param[in] obj The object. + * @param[in] skip The skip flag state ($true if it is to be skipped). + * + * @ingroup Elm_Win_Group + */ +EAPI void elm_win_prop_focus_skip_set(Evas_Object *obj, Eina_Bool skip); + +/** + * @brief Window's autohide state. + * + * When closing the window in any way outside of the program control, like + * pressing the X button in the titlebar or using a command from the Window + * Manager, a "delete,request" signal is emitted to indicate that this event + * occurred and the developer can take any action, which may include, or not, + * destroying the window object. + * + * When this property is set to @c true, the window will be automatically + * hidden when this event occurs, after the signal is emitted. If this property + * is @c false nothing will happen, beyond the event emission. + * + * C applications can use this option along with the quit policy + * @c ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting EFL's main loop + * when all the windows are hidden. + * + * @note @c autodel and @c autohide are not mutually exclusive. The window will + * be deleted if both are set to @c true. + * + * @param[in] obj The object. + * @param[in] autohide If @c true, the window will automatically hide itself + * when closed. + * + * @ingroup Elm_Win_Group + */ +EAPI void elm_win_autohide_set(Evas_Object *obj, Eina_Bool autohide); + +/** + * @brief Window's autohide state. + * + * When closing the window in any way outside of the program control, like + * pressing the X button in the titlebar or using a command from the Window + * Manager, a "delete,request" signal is emitted to indicate that this event + * occurred and the developer can take any action, which may include, or not, + * destroying the window object. + * + * When this property is set to @c true, the window will be automatically + * hidden when this event occurs, after the signal is emitted. If this property + * is @c false nothing will happen, beyond the event emission. + * + * C applications can use this option along with the quit policy + * @c ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting EFL's main loop + * when all the windows are hidden. + * + * @note @c autodel and @c autohide are not mutually exclusive. The window will + * be deleted if both are set to @c true. + * + * @param[in] obj The object. + * + * @return If @c true, the window will automatically hide itself when closed. + * + * @ingroup Elm_Win_Group + */ +EAPI Eina_Bool elm_win_autohide_get(const Evas_Object *obj); + +/** + * @brief Set a window object's icon. + * + * This sets an image to be used as the icon for the given window, in the + * window manager decoration part. The exact pixel dimensions of the object + * (not object size) will be used and the image pixels will be used as-is when + * this function is called. If the image object has been updated, then call + * this function again to source the image pixels and place them in the + * window's icon. Note that only objects of type @ref Efl_Canvas_Image or + * @ref Efl_Ui_Image are allowed. + * + * @param[in] obj The object. + * @param[in] icon The image object to use for an icon. + * + * @ingroup Elm_Win_Group + */ +EAPI void elm_win_icon_object_set(Evas_Object *obj, Evas_Object *icon); + +/** + * @brief Get the icon object used for the window. + * + * The object returns is the one marked by @ref elm_win_icon_object_set as the + * object to use for the window icon. + * + * @param[in] obj The object. + * + * @return The Evas image object to use for an icon. + * + * @ingroup Elm_Win_Group + */ +EAPI const Evas_Object *elm_win_icon_object_get(const Evas_Object *obj); + +/** + * @brief Set the iconified state of a window. + * + * @param[in] obj The object. + * @param[in] iconified If @c true, the window is iconified. + * + * @ingroup Elm_Win_Group + */ +EAPI void elm_win_iconified_set(Evas_Object *obj, Eina_Bool iconified); + +/** + * @brief Get the iconified state of a window. + * + * @param[in] obj The object. + * + * @return If @c true, the window is iconified. + * + * @ingroup Elm_Win_Group + */ +EAPI Eina_Bool elm_win_iconified_get(const Evas_Object *obj); + +/** + * @brief Set the maximized state of a window. + * + * @param[in] obj The object. + * @param[in] maximized If @c true, the window is maximized. + * + * @ingroup Elm_Win_Group + */ +EAPI void elm_win_maximized_set(Evas_Object *obj, Eina_Bool maximized); + +/** + * @brief Get the maximized state of a window. + * + * @param[in] obj The object. + * + * @return If @c true, the window is maximized. + * + * @ingroup Elm_Win_Group + */ +EAPI Eina_Bool elm_win_maximized_get(const Evas_Object *obj); + +/** + * @brief Set the fullscreen state of a window. + * + * @param[in] obj The object. + * @param[in] fullscreen If @c true, the window is fullscreen. + * + * @ingroup Elm_Win_Group + */ +EAPI void elm_win_fullscreen_set(Evas_Object *obj, Eina_Bool fullscreen); + +/** + * @brief Get the fullscreen state of a window. + * + * @param[in] obj The object. + * + * @return If @c true, the window is fullscreen. + * + * @ingroup Elm_Win_Group + */ +EAPI Eina_Bool elm_win_fullscreen_get(const Evas_Object *obj); + +/** + * @brief Set the sticky state of the window. + * + * Hints the Window Manager that the window in @c obj should be left fixed at + * its position even when the virtual desktop it's on moves or changes. + * + * @param[in] obj The object. + * @param[in] sticky If @c true, the window's sticky state is enabled. + * + * @ingroup Elm_Win_Group + */ +EAPI void elm_win_sticky_set(Evas_Object *obj, Eina_Bool sticky); + +/** + * @brief Get the sticky state of the window. + * + * @param[in] obj The object. + * + * @return If @c true, the window's sticky state is enabled. + * + * @ingroup Elm_Win_Group + */ +EAPI Eina_Bool elm_win_sticky_get(const Evas_Object *obj); + + + + + +/** + * @brief Set the noblank property of a window. + * + * The "noblank" property is a way to request the display on which the window + * is shown does not blank, go to screensaver or otherwise hide or obscure the + * window. It is intended for uses such as media playback on a television where + * a user may not want to be interrupted by an idle screen. The noblank + * property may have no effect if the window is iconified/minimized or hidden. + * + * @param[in] obj The object. + * @param[in] noblank If @c true, the window is set to noblank. + * + * @since 1.11 + * + * @ingroup Elm_Win_Group + */ +EAPI void elm_win_noblank_set(Evas_Object *obj, Eina_Bool noblank); + +/** + * @brief Get the noblank property of a window. + * + * @param[in] obj The object. + * + * @return If @c true, the window is set to noblank. + * + * @since 1.11 + * + * @ingroup Elm_Win_Group + */ +EAPI Eina_Bool elm_win_noblank_get(const Evas_Object *obj); + +/** + * @brief Set the borderless state of a window. + * + * This function requests the Window Manager not to draw any decoration around + * the window. + * + * @param[in] obj The object. + * @param[in] borderless If @c true, the window is borderless. + * + * @ingroup Elm_Win_Group + */ +EAPI void elm_win_borderless_set(Evas_Object *obj, Eina_Bool borderless); + +/** + * @brief Get the borderless state of a window. + * + * @param[in] obj The object. + * + * @return If @c true, the window is borderless. + * + * @ingroup Elm_Win_Group + */ +EAPI Eina_Bool elm_win_borderless_get(const Evas_Object *obj); + +/** + * @brief The role of the window. + * + * It is a hint of how the Window Manager should handle it. Unlike + * @ref elm_win_type_get and @ref elm_win_name_get this can be changed at + * runtime. + * + * Set the role of the window. + * + * @param[in] obj The object. + * @param[in] role The role to set. + * + * @ingroup Elm_Win_Group + */ +EAPI void elm_win_role_set(Evas_Object *obj, const char *role); + +/** + * @brief The role of the window. + * + * It is a hint of how the Window Manager should handle it. Unlike + * @ref elm_win_type_get and @ref elm_win_name_get this can be changed at + * runtime. + * + * Get the role of the window. + * + * The returned string is an internal one and should not be freed or modified. + * It will also be invalid if a new role is set or if the window is destroyed. + * + * @param[in] obj The object. + * + * @return The role to set. + * + * @ingroup Elm_Win_Group + */ +EAPI const char *elm_win_role_get(const Evas_Object *obj); + + +/** + * @brief The window name. + * + * The meaning of name depends on the underlying windowing system. + * + * The window name is a construction property that can only be set at creation + * time, before finalize. In C this means inside @c efl_add(). + * + * @note Once set, it cannot be modified afterwards. + * + * No description supplied. + * + * @param[in] obj The object. + * + * @return Window name + * + * @since 1.18 + * + * @ingroup Elm_Win_Group + */ +EAPI const char *elm_win_name_get(const Evas_Object *obj); + + +/** + * @brief The type of the window. + * + * It is a hint of how the Window Manager should handle it. + * + * The window type is a construction property that can only be set at creation + * time, before finalize. In C this means inside @c efl_add(). + * + * @note Once set, it cannot be modified afterward. + * + * If the object is not window object, returns @c unknown. + * + * @param[in] obj The object. + * + * @return Window type + * + * @ingroup Elm_Win_Group + */ +EAPI Elm_Win_Type elm_win_type_get(const Evas_Object *obj); + + +/** + * @brief The hardware acceleration preference for this window. + * + * This is a constructor function and can only be called before + * @ref Efl.Object.finalize. + * + * This property overrides the global EFL configuration option + * "accel_preference" for this single window, and accepts the same syntax. + * + * The @c accel string is a freeform C string that indicates what kind of + * acceleration is preferred. Here "acceleration" generally refers to rendering + * and the hardware with which the unit application renders GUIs. This may or + * may not be honored but a best attempt will be made. Known strings are as + * follows: + * + * "gl", "opengl" - try use OpenGL. "3d" - try to use a 3d acceleration unit. + * "hw", "hardware", "accel" - try any acceleration unit (best possible) "none" + * - use no acceleration but software instead (since 1.16) + * + * Since 1.14, it is also possible to specify some GL properties for the GL + * window surface. This allows applications to use GLView with depth, stencil + * and MSAA buffers with direct rendering. The new accel preference string + * format is thus "{HW Accel}[:depth{value}[:stencil{value}[:msaa{str}$]$]$]". + * + * Accepted values for depth are for instance "depth", "depth16", "depth24". + * Accepted values for stencil are "stencil", "stencil1", "stencil8". For MSAA, + * only predefined strings are accepted: "msaa", "msaa_low", "msaa_mid" and + * "msaa_high". The selected configuration is not guaranteed and is only valid + * in case of GL acceleration. Only the base acceleration string will be saved + * (e.g. "gl" or "hw"). + * + * Full examples include: + * + * "gl", - try to use OpenGL "hw:depth:stencil", - use HW acceleration with + * default depth and stencil buffers "opengl:depth24:stencil8:msaa_mid" - use + * OpenGL with 24-bit depth, 8-bit stencil and a medium number of MSAA samples + * in the backbuffer. + * + * Note that this option may be overriden by environment variables or the + * configuration option "accel_preference_override". + * + * This will return the value of "accel_preference" when the window was + * created. + * + * @param[in] obj The object. + * + * @return Acceleration + * + * @since 1.18 + * + * @ingroup Elm_Win_Group + */ +EAPI const char *elm_win_accel_preference_get(const Evas_Object *obj); + +/** + * @brief Set the alpha channel state of a window. + * + * If @c alpha is true, the alpha channel of the canvas will be enabled + * possibly making parts of the window completely or partially transparent. + * This is also subject to the underlying system supporting it, for example a + * system using a compositing manager. + * + * @note Alpha window can be enabled automatically by window theme style's + * property. If "alpha" data.item is "1" or "true" in window style(eg. + * elm/win/base/default), the window is switched to alpha automatically without + * the explicit api call. + * + * @param[in] obj The object. + * @param[in] alpha @c true if the window alpha channel is enabled, @c false + * otherwise. + * + * @ingroup Elm_Win_Group + */ +EAPI void elm_win_alpha_set(Evas_Object *obj, Eina_Bool alpha); + +/** + * @brief Get the alpha channel state of a window. + * + * @param[in] obj The object. + * + * @return @c true if the window alpha channel is enabled, @c false otherwise. + * + * @ingroup Elm_Win_Group + */ +EAPI Eina_Bool elm_win_alpha_get(const Evas_Object *obj); + +/** + * @brief Activate a window object. + * + * This function sends a request to the Window Manager to activate the window + * pointed by @c obj. If honored by the WM, the window will receive the + * keyboard focus. + * + * @note This is just a request that a Window Manager may ignore, so calling + * this function does not ensure in any way that the window will be the active + * one afterwards. + * @param[in] obj The object. + * + * @ingroup Elm_Win_Group + */ +EAPI void elm_win_activate(Evas_Object *obj); + +/** + * @brief Center a window on the screen. + * + * This function centers window @c obj horizontally and/or vertically based on + * the values of @c h and @c v. + * + * @note This is just a request that a Window Manager may ignore, so calling + * this function does not ensure in any way that the window will be centered + * afterwards. + * + * @param[in] obj The object. + * @param[in] h If @c true, center horizontally. If @c false, do not change + * horizontal location. + * @param[in] v If @c true, center vertically. If @c false, do not change + * vertical location. + * + * @ingroup Elm_Win_Group + */ +EAPI void elm_win_center(Evas_Object *obj, Eina_Bool h, Eina_Bool v); + + + +/** + * @brief Start moving or resizing the window. + * + * The user can request the display server to start moving or resizing the + * window by combining modes from @ref Efl_Ui_Win_Move_Resize_Mode. This API + * can only be called if none of the following conditions is true: + * + * 1. Called in the absence of a pointer down event, 2. Called more than once + * before a pointer up event, 3. Called when the window is already being + * resized or moved, 4. Called with an unsupported combination of modes. + * + * Right usage: 1. Pointer (mouse or touch) down event, 2. + * @ref elm_win_move_resize_start called only once with a supported mode, 3. + * Pointer (mouse or touch) up event. + * + * If a pointer up event occurs after calling the function, it automatically + * ends the window move and resize operation. + * + * Currently, only the following 9 combinations are allowed, and possibly more + * combinations may be added in the future: 1. @ref ELM_WIN_MOVE_RESIZE_MOVE + * 2. @ref ELM_WIN_MOVE_RESIZE_TOP 3. @ref ELM_WIN_MOVE_RESIZE_BOTTOM 4. + * @ref ELM_WIN_MOVE_RESIZE_LEFT 5. @ref ELM_WIN_MOVE_RESIZE_RIGHT 6. + * @ref ELM_WIN_MOVE_RESIZE_TOP | @ref ELM_WIN_MOVE_RESIZE_LEFT 7. + * @ref ELM_WIN_MOVE_RESIZE_TOP | @ref ELM_WIN_MOVE_RESIZE_RIGHT 8. + * @ref ELM_WIN_MOVE_RESIZE_BOTTOM | @ref ELM_WIN_MOVE_RESIZE_LEFT 9. + * @ref ELM_WIN_MOVE_RESIZE_BOTTOM | @ref ELM_WIN_MOVE_RESIZE_RIGHT + * + * In particular move and resize cannot happen simultaneously. + * + * @note the result of this API can only guarantee that the request has been + * forwarded to the server, but there is no guarantee that the request can be + * processed by the display server. + * + * @param[in] obj The object. + * @param[in] mode The requested move or resize mode. + * + * @return @c true if the request was successfully sent to the display server, + * @c false in case of error. + * + * @since 1.19 + * + * @ingroup Elm_Win_Group + */ +EAPI Eina_Bool elm_win_move_resize_start(Evas_Object *obj, Elm_Win_Move_Resize_Mode mode); + +/** + * @brief Set the animate status for the focus highlight for this window. + * + * This function will enable or disable the animation of focus highlight only + * for the given window, regardless of the global setting for it. + * + * @param[in] animate The enabled value for the highlight animation. + * + * @ingroup Elm_Win + */ +EAPI void elm_win_focus_highlight_animate_set(Elm_Win *obj, Eina_Bool animate); + +/** + * @brief Get the animate value of the focus highlight for this window. + * + * @return The enabled value for the highlight animation. + * + * @ingroup Elm_Win + */ +EAPI Eina_Bool elm_win_focus_highlight_animate_get(const Elm_Win *obj); + +/** + * @brief Set the enabled status for the focus highlight in a window. + * + * This function will enable or disable the focus highlight only for the given + * window, regardless of the global setting for it. + * + * @param[in] enabled The enabled value for the highlight. + * + * @ingroup Elm_Win + */ +EAPI void elm_win_focus_highlight_enabled_set(Elm_Win *obj, Eina_Bool enabled); + +/** + * @brief Get the enabled value of the focus highlight for this window. + * + * @return The enabled value for the highlight. + * + * @ingroup Elm_Win + */ +EAPI Eina_Bool elm_win_focus_highlight_enabled_get(const Elm_Win *obj); + +/** + * @brief Set the style for the focus highlight on this window. + * + * Sets the style to use for theming the highlight of focused objects on the + * given window. If @c style is NULL, the default will be used. + * + * @param[in] style The style or @c null if none. + * + * @ingroup Elm_Win + */ +EAPI Eina_Bool elm_win_focus_highlight_style_set(Elm_Win *obj, const char *style); + +/** + * @brief Get the style set for the focus highlight object. + * + * @return The style or @c null if none. + * + * @ingroup Elm_Win + */ +EAPI const char *elm_win_focus_highlight_style_get(const Elm_Win *obj); diff --git a/src/lib/elementary/els_cursor.c b/src/lib/elementary/els_cursor.c index 87adefe50e..cf4bc7642c 100644 --- a/src/lib/elementary/els_cursor.c +++ b/src/lib/elementary/els_cursor.c @@ -289,8 +289,8 @@ _elm_cursor_obj_add(Evas_Object *obj, Elm_Cursor *cur) 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")) + if (elm_widget_theme_object_set(obj, cur->obj, "cursor", cur->cursor_name, + cur->style ? cur->style : "default") == EFL_UI_THEME_APPLY_ERROR_GENERIC) { ELM_SAFE_FREE(cur->obj, evas_object_del); return EINA_FALSE; @@ -672,7 +672,7 @@ elm_object_sub_cursor_set(Evas_Object *eventarea, Evas_Object *owner, const char } EOLIAN Eina_Bool -_efl_ui_widget_efl_ui_cursor_cursor_set(Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED, +_efl_ui_widget_cursor_set(Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED, const char *cursor) { EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE); @@ -688,7 +688,7 @@ elm_object_sub_cursor_get(const Evas_Object *obj) } EOLIAN const char * -_efl_ui_widget_efl_ui_cursor_cursor_get(const Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED) +_efl_ui_widget_cursor_get(const Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED) { return elm_object_sub_cursor_get(obj); } @@ -779,8 +779,8 @@ elm_object_sub_cursor_style_set(Evas_Object *obj, const char *style) } else { - if (!elm_widget_theme_object_set(obj, cur->obj, "cursor", cur->cursor_name, - style)) + if (elm_widget_theme_object_set(obj, cur->obj, "cursor", cur->cursor_name, + style) == EFL_UI_THEME_APPLY_ERROR_GENERIC) { ERR("Could not apply the theme to the cursor style=%s", style); return EINA_FALSE; @@ -793,7 +793,7 @@ elm_object_sub_cursor_style_set(Evas_Object *obj, const char *style) } EOLIAN Eina_Bool -_efl_ui_widget_efl_ui_cursor_cursor_style_set(Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED, +_efl_ui_widget_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); @@ -807,7 +807,7 @@ elm_object_sub_cursor_style_get(const Evas_Object *obj) } EOLIAN const char * -_efl_ui_widget_efl_ui_cursor_cursor_style_get(const Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED) +_efl_ui_widget_cursor_style_get(const Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED) { return elm_object_sub_cursor_style_get(obj); } @@ -820,8 +820,8 @@ void elm_cursor_theme(Elm_Cursor *cur) { if ((!cur) || (!cur->obj)) return; - if (!elm_widget_theme_object_set(cur->owner, cur->obj, "cursor", - cur->cursor_name, cur->style)) + if (elm_widget_theme_object_set(cur->owner, cur->obj, "cursor", + cur->cursor_name, cur->style) == EFL_UI_THEME_APPLY_ERROR_GENERIC) ERR("Could not apply the theme to the cursor style=%s", cur->style); else _elm_cursor_set_hot_spots(cur); @@ -838,7 +838,7 @@ elm_object_sub_cursor_theme_search_enabled_set(Evas_Object *obj, Eina_Bool theme } EOLIAN Eina_Bool -_efl_ui_widget_efl_ui_cursor_cursor_theme_search_enabled_set(Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED, +_efl_ui_widget_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); @@ -852,9 +852,7 @@ elm_object_sub_cursor_theme_search_enabled_get(const Evas_Object *obj) } 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) +_efl_ui_widget_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 9b604217e5..78b09e8373 100644 --- a/src/lib/elementary/els_tooltip.c +++ b/src/lib/elementary/els_tooltip.c @@ -445,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 ? : tt->owner, tt->tooltip, - "tooltip", NULL, style)) + if (_elm_theme_object_set(tt->tt_win ? : tt->owner, tt->tooltip, + "tooltip", NULL, style) == EFL_UI_THEME_APPLY_ERROR_GENERIC) { ERR("Could not apply the theme to the tooltip! style=%s", style); if (tt->tt_win) evas_object_del(tt->tt_win); diff --git a/src/lib/elementary/elu_ews_wm.c b/src/lib/elementary/elu_ews_wm.c index 4018424cb6..0120aea6ea 100644 --- a/src/lib/elementary/elu_ews_wm.c +++ b/src/lib/elementary/elu_ews_wm.c @@ -476,7 +476,7 @@ _elm_ews_wm_init(void) o = edje_object_add(e); if (!o) return EINA_FALSE; - if (!_elm_theme_set(NULL, o, "ews", "background", "default", EINA_TRUE)) + if (_elm_theme_set(NULL, o, "ews", "background", "default", EINA_TRUE) == EFL_UI_THEME_APPLY_ERROR_GENERIC) { ERR("Could not set background theme, fallback to rectangle"); evas_object_del(o); diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index e0c839fa2d..d4aad0fc0b 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -1,66 +1,5 @@ pub_legacy_eo_files = [ - 'efl_ui_button_legacy.eo', - 'efl_ui_check_legacy.eo', - 'efl_ui_radio_legacy.eo', - 'efl_ui_bg_legacy.eo', - 'efl_ui_video_legacy.eo', - 'efl_ui_frame_legacy.eo', - 'efl_ui_panes_legacy.eo', - 'efl_ui_image_zoomable_legacy.eo', - 'efl_ui_flip_legacy.eo', - 'efl_ui_win_legacy.eo', - 'efl_ui_image_legacy.eo', - 'efl_ui_progressbar_legacy.eo', 'efl_ui_clock_legacy.eo', - 'efl_ui_layout_legacy.eo', - 'elm_code_widget_legacy.eo', - 'efl_ui_win_socket_legacy.eo', - 'efl_ui_win_inlined_legacy.eo', - 'elm_interface_fileselector.eo', - 'elm_calendar.eo', - 'elm_calendar_item.eo', - 'elm_clock.eo', - 'elm_colorselector.eo', - 'elm_conformant.eo', - 'elm_ctxpopup.eo', - 'elm_dayselector.eo', - 'elm_entry.eo', - 'elm_fileselector.eo', - 'elm_gengrid.eo', - 'elm_gengrid_pan.eo', - 'elm_genlist.eo', - 'elm_genlist_pan.eo', - 'elm_gesture_layer.eo', - 'elm_glview.eo', - 'elm_hover.eo', - 'elm_index.eo', - 'elm_label.eo', - 'elm_list.eo', - 'elm_map.eo', - 'elm_map_pan.eo', - 'elm_menu.eo', - 'elm_notify.eo', - 'elm_panel.eo', - 'elm_player.eo', - 'elm_plug.eo', - 'elm_popup.eo', - 'elm_route.eo', - 'elm_scroller.eo', - 'elm_sys_notify_interface.eo', - 'elm_sys_notify.eo', - 'elm_sys_notify_dbus.eo', - 'elm_systray.eo', - 'elm_color_item.eo', - 'elm_dayselector_item.eo', - 'elm_flipselector_item.eo', - 'elm_menu_item.eo', - 'elm_ctxpopup_item.eo', - 'elm_index_item.eo', - 'elm_widget_item_static_focus.eo', - 'elm_genlist_item.eo', - 'elm_gengrid_item.eo', - 'elm_list_item.eo', - 'elm_popup_item.eo', 'elm_ctxpopup_part.eo', 'elm_dayselector_part.eo', 'elm_entry_part.eo', @@ -78,40 +17,10 @@ pub_legacy_eo_files = [ 'elm_actionslider_part.eo', 'elm_bubble_part.eo', 'elm_fileselector_part.eo', - 'elm_access.eo', - 'elm_actionslider.eo', - 'elm_box.eo', - 'elm_bubble.eo', - 'elm_diskselector.eo', - 'elm_diskselector_item.eo', - 'elm_fileselector_button.eo', - 'elm_fileselector_entry.eo', - 'elm_flipselector.eo', - 'elm_grid.eo', - 'elm_hoversel.eo', - 'elm_hoversel_item.eo', - 'elm_icon.eo', - 'elm_inwin.eo', - 'elm_mapbuf.eo', - 'elm_naviframe.eo', - 'elm_naviframe_item.eo', - 'elm_photo.eo', - 'elm_prefs.eo', - 'elm_segment_control.eo', - 'elm_segment_control_item.eo', - 'elm_separator.eo', - 'elm_slideshow.eo', - 'elm_slideshow_item.eo', - 'elm_table.eo', - 'elm_thumb.eo', - 'efl_ui_textpath_legacy.eo', - 'efl_ui_list_view_precise_layouter.eo' ] pub_eo_file_target = [] -priv_eo_file_target = [] - foreach eo_file : pub_legacy_eo_files pub_eo_file_target += custom_target('eolian_gen_' + eo_file, input : eo_file, @@ -141,6 +50,7 @@ pub_eo_files = [ 'efl_ui_image.eo', 'efl_ui_image_zoomable.eo', 'efl_ui_layout.eo', + 'efl_ui_layout_base.eo', 'efl_ui_nstate.eo', 'efl_ui_navigation_bar.eo', 'efl_ui_navigation_bar_part.eo', @@ -185,7 +95,6 @@ pub_eo_files = [ 'efl_ui_textpath.eo', 'efl_ui_l10n.eo', 'efl_ui_clock.eo', - 'efl_ui_cursor.eo', 'efl_ui_image_factory.eo', 'efl_ui_focus_manager.eo', 'efl_ui_focus_manager_calc.eo', @@ -207,8 +116,6 @@ pub_eo_files = [ 'efl_ui_list_view.eo', 'efl_ui_list_view_model.eo', 'efl_ui_list_view_pan.eo', - 'efl_ui_list_view_seg_array.eo', - 'efl_ui_list_view_relayout.eo', 'efl_ui_item.eo', 'efl_ui_list_item.eo', 'efl_ui_list_default_item_part_icon.eo', @@ -223,8 +130,6 @@ pub_eo_files = [ 'efl_ui_grid.eo', 'efl_ui_panes_part.eo', 'efl_ui_progressbar_part.eo', - 'elm_slider.eo', - 'elm_slider_part_indicator.eo', 'efl_ui_textpath_part.eo', 'efl_ui_widget_part.eo', 'efl_ui_widget_part_bg.eo', @@ -264,23 +169,13 @@ pub_eo_files = [ 'efl_ui_radio_legacy_part.eo', 'efl_ui_check_legacy_part.eo', 'efl_ui_progressbar_legacy_part.eo', - 'elm_spinner.eo', - 'elm_multibuttonentry.eo', - 'elm_multibuttonentry_item.eo', 'elm_multibuttonentry_part.eo', 'elm_interface_scrollable.eo', - 'elm_atspi_bridge.eo', - 'elm_atspi_app_object.eo', 'efl_ui_image_zoomable_pan.eo', - 'elm_pan.eo', - 'elm_toolbar.eo', - 'elm_toolbar_item.eo', - 'elm_view_list.eo', - 'elm_view_form.eo', - 'elm_web.eo', - 'elm_widget_item.eo', 'efl_ui_text_part.eo', 'efl_ui_caching_factory.eo', + 'efl_ui_widget_factory.eo', + 'efl_ui_relative_layout.eo', ] foreach eo_file : pub_eo_files @@ -335,13 +230,19 @@ priv_eo_files = [ 'efl_ui_focus_composition_adapter.eo', 'efl_ui_focus_parent_provider.eo', 'efl_ui_focus_parent_provider_standard.eo', - 'efl_ui_focus_parent_provider_gen.eo', - 'efl_ui_model_state.eo', + 'efl_ui_state_model.eo', 'efl_ui_selection_manager.eo', 'efl_datetime_manager.eo', + 'efl_ui_list_view_precise_layouter.eo', + 'efl_ui_list_view_relayout.eo', + 'efl_ui_size_model.eo', + 'efl_ui_homogeneous_model.eo', + 'efl_ui_exact_model.eo', + 'efl_ui_average_model.eo', ] priv_eo_file_target = [] + foreach eo_file : priv_eo_files priv_eo_file_target += custom_target('eolian_gen_' + eo_file, input : eo_file, @@ -356,9 +257,16 @@ endforeach eolian_include_directories += ['-I', meson.current_source_dir()] +embed_script = find_program('config_embed') + +embed_config = custom_target('create_embedded_default_config', + input: join_paths(meson.source_root(), 'data', 'elementary', 'config', 'standard', 'base.src.in'), + output: 'elm_default_config.x', + command: [embed_script, '@INPUT@', '@OUTPUT@'] +) + elementary_headers_unstable = [ 'elm_gen_common.h', - 'elm_atspi_bridge.h', 'efl_access_object.h', 'efl_access_text.h', 'efl_access_widget_action.h', @@ -478,7 +386,8 @@ elementary_headers_unstable = [ 'efl_page_indicator_icon.h', 'efl_ui_tab_pager_private.h', 'efl_ui_tab_bar_private.h', - 'efl_ui_tab_page_private.h' + 'efl_ui_tab_page_private.h', + 'efl_ui_relative_layout_private.h' ] elementary_pub_headers = [ @@ -509,6 +418,9 @@ elementary_pub_headers = [ 'elm_actionslider_legacy.h', 'elm_app.h', 'elm_atspi_app_object.h', + 'elm_atspi_app_object_eo.legacy.h', + 'elm_atspi_bridge.h', + 'elm_atspi_bridge_eo.legacy.h', 'elm_authors.h', 'elm_bg.h', 'elm_bg_legacy.h', @@ -518,6 +430,7 @@ elementary_pub_headers = [ 'elm_bubble.h', 'elm_bubble_legacy.h', 'elm_button.h', + 'efl_ui_widget_common.h', 'efl_ui_button_eo.h', 'elm_button_legacy.h', 'elm_cache.h', @@ -690,6 +603,121 @@ elementary_pub_headers = [ 'elm_win_legacy.h', 'elm_helper.h', 'elm_part_helper.h', + 'efl_ui_bg_eo.legacy.h', + 'efl_ui_bg_legacy_eo.legacy.h', + 'efl_ui_button_eo.legacy.h', + 'efl_ui_button_legacy_eo.legacy.h', + 'efl_ui_check_eo.legacy.h', + 'efl_ui_check_legacy_eo.legacy.h', + 'efl_ui_flip_eo.legacy.h', + 'efl_ui_flip_legacy_eo.legacy.h', + 'efl_ui_frame_eo.legacy.h', + 'efl_ui_frame_legacy_eo.legacy.h', + 'efl_ui_image_legacy_eo.legacy.h', + 'efl_ui_image_zoomable_eo.legacy.h', + 'efl_ui_image_zoomable_legacy_eo.legacy.h', + 'efl_ui_layout_legacy_eo.legacy.h', + 'efl_ui_panes_eo.legacy.h', + 'efl_ui_panes_legacy_eo.legacy.h', + 'efl_ui_progressbar_legacy_eo.legacy.h', + 'efl_ui_radio_eo.legacy.h', + 'efl_ui_radio_legacy_eo.legacy.h', + 'efl_ui_textpath_eo.legacy.h', + 'efl_ui_textpath_legacy_eo.legacy.h', + 'efl_ui_video_eo.legacy.h', + 'efl_ui_video_legacy_eo.legacy.h', + 'efl_ui_widget_eo.legacy.h', + 'efl_ui_win_inlined_legacy_eo.legacy.h', + 'efl_ui_win_legacy_eo.legacy.h', + 'efl_ui_win_socket_legacy_eo.legacy.h', + 'elm_access_eo.legacy.h', + 'elm_actionslider_eo.legacy.h', + 'elm_box_eo.legacy.h', + 'elm_bubble_eo.legacy.h', + 'elm_calendar_eo.legacy.h', + 'elm_calendar_item_eo.legacy.h', + 'elm_clock_eo.legacy.h', + 'elm_code_widget_eo.legacy.h', + 'elm_code_widget_legacy_eo.legacy.h', + 'elm_color_item_eo.legacy.h', + 'elm_colorselector_eo.legacy.h', + 'elm_conformant_eo.legacy.h', + 'elm_ctxpopup_eo.legacy.h', + 'elm_ctxpopup_item_eo.legacy.h', + 'elm_dayselector_eo.legacy.h', + 'elm_dayselector_item_eo.legacy.h', + 'elm_diskselector_eo.legacy.h', + 'elm_diskselector_item_eo.legacy.h', + 'elm_entry_eo.legacy.h', + 'elm_fileselector_button_eo.legacy.h', + 'elm_fileselector_entry_eo.legacy.h', + 'elm_fileselector_eo.legacy.h', + 'elm_flipselector_eo.legacy.h', + 'elm_flipselector_item_eo.legacy.h', + 'elm_gengrid_eo.legacy.h', + 'elm_gengrid_item_eo.legacy.h', + 'elm_gengrid_pan_eo.legacy.h', + 'elm_genlist_eo.legacy.h', + 'elm_genlist_item_eo.legacy.h', + 'elm_genlist_pan_eo.legacy.h', + 'elm_gesture_layer_eo.legacy.h', + 'elm_glview_eo.legacy.h', + 'elm_grid_eo.legacy.h', + 'elm_hover_eo.legacy.h', + 'elm_hoversel_eo.legacy.h', + 'elm_hoversel_item_eo.legacy.h', + 'elm_icon_eo.legacy.h', + 'elm_index_eo.legacy.h', + 'elm_index_item_eo.legacy.h', + 'elm_interface_fileselector_eo.legacy.h', + 'elm_inwin_eo.legacy.h', + 'elm_label_eo.legacy.h', + 'elm_list_eo.legacy.h', + 'elm_list_item_eo.legacy.h', + 'elm_mapbuf_eo.legacy.h', + 'elm_map_eo.legacy.h', + 'elm_map_pan_eo.legacy.h', + 'elm_menu_eo.legacy.h', + 'elm_menu_item_eo.legacy.h', + 'elm_multibuttonentry_eo.legacy.h', + 'elm_multibuttonentry_item_eo.legacy.h', + 'elm_naviframe_eo.legacy.h', + 'elm_naviframe_item_eo.legacy.h', + 'elm_notify_eo.legacy.h', + 'elm_panel_eo.legacy.h', + 'elm_pan_eo.legacy.h', + 'elm_photo_eo.legacy.h', + 'elm_player_eo.legacy.h', + 'elm_plug_eo.legacy.h', + 'elm_popup_eo.legacy.h', + 'elm_popup_item_eo.legacy.h', + 'elm_prefs_eo.legacy.h', + 'elm_route_eo.legacy.h', + 'elm_scroller_eo.legacy.h', + 'elm_segment_control_eo.legacy.h', + 'elm_segment_control_item_eo.legacy.h', + 'elm_separator_eo.legacy.h', + 'elm_slider_eo.legacy.h', + 'elm_slider_part_indicator_eo.legacy.h', + 'elm_slideshow_eo.legacy.h', + 'elm_slideshow_item_eo.legacy.h', + 'elm_spinner_eo.legacy.h', + 'elm_sys_notify_dbus_eo.legacy.h', + 'elm_sys_notify_eo.legacy.h', + 'elm_sys_notify_interface_eo.legacy.h', + 'elm_systray_eo.legacy.h', + 'elm_table_eo.legacy.h', + 'elm_thumb_eo.legacy.h', + 'elm_toolbar_eo.legacy.h', + 'elm_toolbar_item_eo.legacy.h', + 'elm_view_form_eo.legacy.h', + 'elm_view_list_eo.legacy.h', + 'elm_view_form_eo.h', + 'elm_view_list_eo.h', + 'elm_web_eo.legacy.h', + 'elm_widget_item_container_eo.legacy.h', + 'elm_widget_item_eo.legacy.h', + 'elm_widget_item_static_focus_eo.legacy.h', ] elementary_header_src = [ @@ -831,6 +859,7 @@ elementary_src = [ 'elm_view_form.c', 'elm_web2.c', 'efl_ui_widget.c', + 'efl_ui_widget_common.c', 'efl_ui_win.c', 'efl_ui_win_inlined.c', 'efl_ui_win_socket.c', @@ -839,6 +868,8 @@ elementary_src = [ 'els_cursor.c', 'els_tooltip.c', 'elu_ews_wm.c', + 'efl_ui_container_layout.c', + 'efl_ui_container_layout.h', 'efl_ui_box.c', 'efl_ui_box_flow.c', 'efl_ui_box_stack.c', @@ -851,6 +882,7 @@ elementary_src = [ 'efl_ui_anchor_popup.c', 'efl_ui_table.c', 'efl_ui_table_static.c', + 'efl_ui_table_layout.c', 'efl_ui_table_private.h', 'efl_ui_text.c', 'efl_ui_text_factory_images.c', @@ -904,7 +936,13 @@ elementary_src = [ 'efl_ui_tab_bar.c', 'efl_ui_tab_page.c', 'efl_ui_widget_focus_manager.c', - 'efl_ui_caching_factory.c' + 'efl_ui_caching_factory.c', + 'efl_ui_widget_factory.c', + 'efl_ui_size_model.c', + 'efl_ui_homogeneous_model.c', + 'efl_ui_exact_model.c', + 'efl_ui_average_model.c', + 'efl_ui_relative_layout.c' ] elementary_deps = [emile, eo, efl, edje, ethumb, ethumb_client, emotion, ecore_imf, ecore_con, eldbus, efreet, efreet_mime, efreet_trash, eio, atspi, dl, intl] @@ -968,7 +1006,7 @@ c = configure_file( elm_package_c_args = package_c_args + ['-DELEMENTARY_BUILD=1'] elementary_lib = library('elementary', - elementary_src, pub_eo_file_target, priv_eo_file_target, c, + elementary_src, pub_eo_file_target, priv_eo_file_target, c, embed_config, dependencies: elementary_pub_deps + elementary_deps, include_directories : config_dir + [include_directories('.')] + [include_directories(join_paths('..', '..', '..'))] + [ecore_evas_wayland_engine_include_dir], install: true, @@ -983,9 +1021,12 @@ elementary = declare_dependency( dependencies: elementary_pub_deps, ) -install_data(pub_eo_files + pub_eo_types_files, - install_dir: join_paths(eolian_include_dir, package_version_name) -) + +if get_option('install-eo-files') + install_data(pub_eo_files + pub_eo_types_files, + install_dir: join_paths(eolian_include_dir, package_version_name) + ) +endif install_headers(elementary_header_src, install_dir : dir_package_include, diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h index e38adf577d..14a706949d 100644 --- a/src/lib/elput/Elput.h +++ b/src/lib/elput/Elput.h @@ -271,7 +271,7 @@ EAPI const Eina_List *elput_manager_seats_get(Elput_Manager *manager); * input manager. Setting a window on the input manager is done so that * when we raise events (mouse movement, keyboard key, etc) then this * window is passed to the event structure as the window which the event - * occured on. + * occurred on. * * @param manager * @param window @@ -374,6 +374,20 @@ EAPI void elput_input_pointer_max_set(Elput_Manager *manager, int maxw, int maxh */ EAPI Eina_Bool elput_input_pointer_rotation_set(Elput_Manager *manager, int rotation); +/** + * Set tap-to-click status + * + * @param manager + * @param seat + * @param enabled + * + * @return EINA_TRUE on success, EINA_FALSE otherwise + * + * @ingroup Elput_Input_Group + * @since 1.22 + */ +EAPI void elput_input_touch_tap_to_click_enabled_set(Elput_Manager *manager, const char *seat, Eina_Bool enabled); + /** * Calibrate input devices for given screen size * @@ -508,7 +522,7 @@ EAPI Eina_Bool elput_touch_drag_enabled_get(Elput_Device *device); * @param device * @param enabled * - * @return EINA_TRUE on sucess, EINA_FALSE otherwise + * @return EINA_TRUE on success, EINA_FALSE otherwise * * @ingroup Elput_Touch_Group * @since 1.19 diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c index ca0e130002..392b157b1b 100644 --- a/src/lib/elput/elput_input.c +++ b/src/lib/elput/elput_input.c @@ -847,6 +847,44 @@ elput_input_pointer_accel_speed_set(Elput_Manager *manager, const char *seat, do } } +EAPI void +elput_input_touch_tap_to_click_enabled_set(Elput_Manager *manager, const char *seat, Eina_Bool enabled) +{ + Elput_Seat *eseat; + Elput_Device *edev; + Eina_List *l, *ll; + enum libinput_config_tap_state state; + + EINA_SAFETY_ON_NULL_RETURN(manager); + + state = enabled ? LIBINPUT_CONFIG_TAP_ENABLED : LIBINPUT_CONFIG_TAP_DISABLED; + + /* if no seat name is passed in, just use default seat name */ + if (!seat) seat = "seat0"; + + EINA_LIST_FOREACH(manager->input.seats, l, eseat) + { + if ((eseat->name) && (strcmp(eseat->name, seat))) + continue; + + EINA_LIST_FOREACH(eseat->devices, ll, edev) + { + if (!libinput_device_has_capability(edev->device, + LIBINPUT_DEVICE_CAP_POINTER)) + continue; + + if (libinput_device_config_tap_set_enabled(edev->device, state) + != LIBINPUT_CONFIG_STATUS_SUCCESS) + { + WRN("Failed to %s tap-to-click on device: %s", + enabled ? "enable" : "disable", + libinput_device_get_name(edev->device)); + continue; + } + } + } +} + EAPI Elput_Seat * elput_device_seat_get(const Elput_Device *dev) { diff --git a/src/lib/elua/meson.build b/src/lib/elua/meson.build index 7e0c3af7ba..33cb3f9733 100644 --- a/src/lib/elua/meson.build +++ b/src/lib/elua/meson.build @@ -1,5 +1,16 @@ elua_deps = [eina, eo, efl, ecore, ecore_file, intl] -elua_pub_deps = [luajit] +if sys_osx == true +# luajit on macro is broken, this means we need to generate our own dependency with our arguments, a library later still needs to link to luajit for the pagesize argument thingy + luajit = dependency('luajit') + lua = declare_dependency( + include_directories: include_directories(luajit.get_pkgconfig_variable('includedir')), + link_args: ['-L'+luajit.get_pkgconfig_variable('libdir'), '-l'+luajit.get_pkgconfig_variable('libname')] + ) + elua_pub_deps = [lua] +else + elua_pub_deps = [dependency('luajit')] +endif + elua_src = ['elua.c', 'io.c', 'cache.c'] elua_header_src = ['Elua.h'] diff --git a/src/lib/emile/Emile.h b/src/lib/emile/Emile.h index 741905ef2f..e517b6bb48 100644 --- a/src/lib/emile/Emile.h +++ b/src/lib/emile/Emile.h @@ -20,7 +20,6 @@ #define EMILE_H_ #include -#include #ifdef EAPI # undef EAPI diff --git a/src/lib/emile/emile_cipher_gnutls.c b/src/lib/emile/emile_cipher_gnutls.c index 966859bdfd..92f41a57d2 100644 --- a/src/lib/emile/emile_cipher_gnutls.c +++ b/src/lib/emile/emile_cipher_gnutls.c @@ -2,10 +2,6 @@ # include #endif -#ifdef HAVE_NETINET_IN_H -# include -#endif - #include #include #include @@ -220,7 +216,7 @@ emile_binbuf_cipher(Emile_Cipher_Algorithm algo, eina_binbuf_append_length(result, (unsigned char*) &salt, sizeof (salt)); memset(&salt, 0, sizeof (salt)); - tmp = htonl(eina_binbuf_length_get(data)); + tmp = eina_htonl(eina_binbuf_length_get(data)); eina_binbuf_append_length(result, (unsigned char*) &tmp, sizeof (tmp)); eina_binbuf_append_buffer(result, data); @@ -350,7 +346,7 @@ emile_binbuf_decipher(Emile_Cipher_Algorithm algo, /* Get the decrypted data size */ tmp = *(unsigned int*)(eina_binbuf_string_get(result)); - tmp = ntohl(tmp); + tmp = eina_ntohl(tmp); if (tmp > tmp_len || tmp <= 0) goto on_error; diff --git a/src/lib/emile/emile_cipher_openssl.c b/src/lib/emile/emile_cipher_openssl.c index b5ca128a23..84b024465e 100644 --- a/src/lib/emile/emile_cipher_openssl.c +++ b/src/lib/emile/emile_cipher_openssl.c @@ -2,10 +2,6 @@ # include #endif -#ifdef HAVE_NETINET_IN_H -# include -#endif - #include #include #include @@ -149,7 +145,7 @@ emile_binbuf_cipher(Emile_Cipher_Algorithm algo, eina_binbuf_append_length(result, (unsigned char*) &salt, sizeof (salt)); memset(&salt, 0, sizeof (salt)); - tmp = htonl(eina_binbuf_length_get(data)); + tmp = eina_htonl(eina_binbuf_length_get(data)); buffer = malloc(crypted_length - sizeof (int)); if (!buffer) goto on_error; *buffer = tmp; @@ -279,7 +275,7 @@ emile_binbuf_decipher(Emile_Cipher_Algorithm algo, /* Get the decrypted data size */ tmp = *(unsigned int*)(eina_binbuf_string_get(result)); - tmp = ntohl(tmp); + tmp = eina_ntohl(tmp); if (tmp > tmp_len || tmp <= 0) goto on_error; diff --git a/src/lib/emile/emile_image.c b/src/lib/emile/emile_image.c index 3432ccf9c5..4f6e11905e 100644 --- a/src/lib/emile/emile_image.c +++ b/src/lib/emile/emile_image.c @@ -2,17 +2,6 @@ #include #endif -#ifdef HAVE_NETINET_IN_H -#include -#endif - -#ifdef _WIN32 -#include -#include -#define HAVE_BOOLEAN /* This prevents libjpeg to redefine boolean */ -#define XMD_H /* This prevents libjpeg to redefine INT32 */ -#endif - #ifdef ENABLE_LIBLZ4 #include #else @@ -337,8 +326,8 @@ _emile_tgv_head(Emile_Image *image, image->compress = m[OFFSET_OPTIONS] & 0x1; image->blockless = (m[OFFSET_OPTIONS] & 0x2) != 0; - image->size.width = ntohl(*((unsigned int *)&(m[OFFSET_WIDTH]))); - image->size.height = ntohl(*((unsigned int *)&(m[OFFSET_HEIGHT]))); + image->size.width = eina_ntohl(*((unsigned int *)&(m[OFFSET_WIDTH]))); + image->size.height = eina_ntohl(*((unsigned int *)&(m[OFFSET_HEIGHT]))); if (image->blockless) { diff --git a/src/lib/emile/emile_image.h b/src/lib/emile/emile_image.h index 3c1c6f2333..d524d5247f 100644 --- a/src/lib/emile/emile_image.h +++ b/src/lib/emile/emile_image.h @@ -9,29 +9,39 @@ * @{ */ -typedef Efl_Gfx_Colorspace Emile_Colorspace; - -#define EMILE_COLORSPACE_ARGB8888 EFL_GFX_COLORSPACE_ARGB8888 -#define EMILE_COLORSPACE_YCBCR422P601_PL EFL_GFX_COLORSPACE_YCBCR422P601_PL -#define EMILE_COLORSPACE_YCBCR422P709_PL EFL_GFX_COLORSPACE_YCBCR422P709_PL -#define EMILE_COLORSPACE_RGB565_A5P EFL_GFX_COLORSPACE_RGB565_A5P -#define EMILE_COLORSPACE_GRY8 EFL_GFX_COLORSPACE_GRY8 -#define EMILE_COLORSPACE_YCBCR422601_PL EFL_GFX_COLORSPACE_YCBCR422601_PL -#define EMILE_COLORSPACE_YCBCR420NV12601_PL EFL_GFX_COLORSPACE_YCBCR420NV12601_PL -#define EMILE_COLORSPACE_YCBCR420TM12601_PL EFL_GFX_COLORSPACE_YCBCR420TM12601_PL -#define EMILE_COLORSPACE_AGRY88 EFL_GFX_COLORSPACE_AGRY88 - // ETC1/2 support -#define EMILE_COLORSPACE_ETC1 EFL_GFX_COLORSPACE_ETC1 -#define EMILE_COLORSPACE_RGB8_ETC2 EFL_GFX_COLORSPACE_RGB8_ETC2 -#define EMILE_COLORSPACE_RGBA8_ETC2_EAC EFL_GFX_COLORSPACE_RGBA8_ETC2_EAC -#define EMILE_COLORSPACE_ETC1_ALPHA EFL_GFX_COLORSPACE_ETC1_ALPHA - // S3TC support -#define EMILE_COLORSPACE_RGB_S3TC_DXT1 EFL_GFX_COLORSPACE_RGB_S3TC_DXT1 -#define EMILE_COLORSPACE_RGBA_S3TC_DXT1 EFL_GFX_COLORSPACE_RGBA_S3TC_DXT1 -#define EMILE_COLORSPACE_RGBA_S3TC_DXT2 EFL_GFX_COLORSPACE_RGBA_S3TC_DXT2 -#define EMILE_COLORSPACE_RGBA_S3TC_DXT3 EFL_GFX_COLORSPACE_RGBA_S3TC_DXT3 -#define EMILE_COLORSPACE_RGBA_S3TC_DXT4 EFL_GFX_COLORSPACE_RGBA_S3TC_DXT4 -#define EMILE_COLORSPACE_RGBA_S3TC_DXT5 EFL_GFX_COLORSPACE_RGBA_S3TC_DXT5 +/** + * @typedef Emile_Colorspace + * + * Flags that describe all colorspace known by EFL. Some routine may not know all of them. + * All the value from below enum should be the same as in Evas_Loader.h + * + * @see Evas_Colorspace + * @see Eet_Colorspace + * + * @since 1.14 + */ +typedef enum _Emile_Colorspace +{ + EMILE_COLORSPACE_ARGB8888,/**< ARGB 32 bits per pixel, high-byte is Alpha, accessed 1 32bit word at a time */ + EMILE_COLORSPACE_YCBCR422P601_PL, /**< YCbCr 4:2:2 Planar, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */ + EMILE_COLORSPACE_YCBCR422P709_PL, /**< YCbCr 4:2:2 Planar, ITU.BT-709 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */ + EMILE_COLORSPACE_RGB565_A5P, /**< 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */ + EMILE_COLORSPACE_GRY8 = 4, + EMILE_COLORSPACE_YCBCR422601_PL, /**< YCbCr 4:2:2, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to line of Y,Cb,Y,Cr bytes */ + EMILE_COLORSPACE_YCBCR420NV12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb,Cr rows. */ + EMILE_COLORSPACE_YCBCR420TM12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of tiled row pointer, pointing to the Y rows, then the Cb,Cr rows. */ + EMILE_COLORSPACE_AGRY88 = 8, /**< AY 8bits Alpha and 8bits Grey, accessed 1 16bits at a time */ + EMILE_COLORSPACE_ETC1 = 9, /**< OpenGL ETC1 encoding of RGB texture (4 bit per pixel) @since 1.10 */ + EMILE_COLORSPACE_RGB8_ETC2 = 10, /**< OpenGL GL_COMPRESSED_RGB8_ETC2 texture compression format (4 bit per pixel) @since 1.10 */ + EMILE_COLORSPACE_RGBA8_ETC2_EAC = 11, /**< OpenGL GL_COMPRESSED_RGBA8_ETC2_EAC texture compression format, supports alpha (8 bit per pixel) @since 1.10 */ + EMILE_COLORSPACE_ETC1_ALPHA = 12, /**< ETC1 with alpha support using two planes: ETC1 RGB and ETC1 grey for alpha @since 1.11 */ + EMILE_COLORSPACE_RGB_S3TC_DXT1 = 13, /**< OpenGL COMPRESSED_RGB_S3TC_DXT1_EXT format with RGB only. @since 1.11 */ + EMILE_COLORSPACE_RGBA_S3TC_DXT1 = 14, /**< OpenGL COMPRESSED_RGBA_S3TC_DXT1_EXT format with RGBA punchthrough. @since 1.11 */ + EMILE_COLORSPACE_RGBA_S3TC_DXT2 = 15, /**< DirectDraw DXT2 format with premultiplied RGBA. Not supported by OpenGL itself. @since 1.11 */ + EMILE_COLORSPACE_RGBA_S3TC_DXT3 = 16, /**< OpenGL COMPRESSED_RGBA_S3TC_DXT3_EXT format with RGBA. @since 1.11 */ + EMILE_COLORSPACE_RGBA_S3TC_DXT4 = 17, /**< DirectDraw DXT4 format with premultiplied RGBA. Not supported by OpenGL itself. @since 1.11 */ + EMILE_COLORSPACE_RGBA_S3TC_DXT5 = 18 /**< OpenGL COMPRESSED_RGBA_S3TC_DXT5_EXT format with RGBA. @since 1.11 */ +} Emile_Colorspace; /** * @typedef Emile_Image_Encoding @@ -145,7 +155,7 @@ typedef struct _Emile_Image_Property Emile_Image_Property; /** * @enum _Emile_Action * @typedef Emile_Action - * What action emile is refering to. + * What action emile is referring to. * @since 1.19 */ typedef enum _Emile_Action @@ -211,7 +221,7 @@ struct _Emile_Image_Load_Opts int smooth; /* This should have never been part of this structure, but we keep it - for ABI/API compability with Evas_Loader */ + for ABI/API compatibility with Evas_Loader */ Emile_Image_Scale_Hint scale_hint; } scale_load; double dpi; diff --git a/src/lib/emotion/Emotion.h b/src/lib/emotion/Emotion.h index d7eef3c090..e67d9a2026 100644 --- a/src/lib/emotion/Emotion.h +++ b/src/lib/emotion/Emotion.h @@ -127,9 +127,7 @@ extern "C" { #ifndef EFL_NOLEGACY_API_SUPPORT #include "Emotion_Legacy.h" #endif -#ifdef EFL_EO_API_SUPPORT #include "Emotion_Eo.h" -#endif /** * @file Emotion.h @@ -238,7 +236,7 @@ enum _Emotion_Vis /** * @enum Emotion_Suspend * - * Used for emotion pipeline ressource management. + * Used for emotion pipeline resource management. * * @see emotion_object_suspend_set() * @see emotion_object_suspend_get() @@ -248,7 +246,7 @@ enum _Emotion_Vis typedef enum { EMOTION_WAKEUP, /**< pipeline is up and running */ - EMOTION_SLEEP, /**< turn off hardware ressource usage like overlay */ + EMOTION_SLEEP, /**< turn off hardware resource usage like overlay */ EMOTION_DEEP_SLEEP, /**< destroy the pipeline, but keep full resolution pixels output around */ EMOTION_HIBERNATE /**< destroy the pipeline, and keep half resolution or object resolution if lower */ } Emotion_Suspend; @@ -372,7 +370,7 @@ EAPI extern Emotion_Version *emotion_version; */ /** - * @defgroup Emotion_Ressource Video ressource management + * @defgroup Emotion_Ressource Video resource management */ /** @@ -1183,7 +1181,7 @@ EAPI Eina_Bool emotion_object_vis_supported (const Evas_Object *obj, * Picture in Picture is needed. And most application just have a few video stream that really * deserve high frame rate, high quality output. That's why this call is for. * - * Please note that if Emotion can't acquire a priviledged hardware ressource, it will fallback + * Please note that if Emotion can't acquire a priviledged hardware resource, it will fallback * to the no-priority path. This work on the first asking first get basis system. * * @see emotion_object_priority_get() diff --git a/src/lib/emotion/Emotion_Legacy.h b/src/lib/emotion/Emotion_Legacy.h index 6db3fe0050..de4532ab53 100644 --- a/src/lib/emotion/Emotion_Legacy.h +++ b/src/lib/emotion/Emotion_Legacy.h @@ -1,3 +1,3 @@ -#include "efl_canvas_video.eo.legacy.h" +#include "efl_canvas_video_eo.legacy.h" diff --git a/src/lib/emotion/efl_canvas_video.eo b/src/lib/emotion/efl_canvas_video.eo index b9701302f7..3aa165fe74 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 extends Efl.Canvas.Group implements Efl.File, Efl.Player, Efl.Gfx.Image, Efl.Gfx.Image_Load_Controller +class @beta Efl.Canvas.Video extends Efl.Canvas.Group implements Efl.File, Efl.Player, Efl.Gfx.Image, Efl.Gfx.Image_Load_Controller { [[Efl canvas video class]] methods { @@ -12,7 +12,6 @@ class Efl.Canvas.Video extends Efl.Canvas.Group implements Efl.File, Efl.Player, Please don't use this function, consider using @Efl.Player.mute instead. ]] - legacy: emotion_object_module_option_set; } values { opt: string; [[The option that is being set. Currently @@ -39,7 +38,6 @@ class Efl.Canvas.Video extends Efl.Canvas.Group implements Efl.File, Efl.Player, See also @Efl.File.file. ]] - legacy: emotion_object_init; return: bool; [[$true if the specified module was successfully initialized for this object, $false otherwise.]] } @@ -53,7 +51,9 @@ class Efl.Canvas.Video extends Efl.Canvas.Group implements Efl.File, Efl.Player, Efl.Object.constructor; Efl.Gfx.Entity.position { set; } Efl.Gfx.Entity.size { set; } - Efl.File.file { get; set; } + Efl.File.load; + Efl.File.file { set; } + Efl.File.loaded { get; } Efl.Player.play { get; set; } Efl.Player.pos { get; set; } Efl.Player.progress { get; } diff --git a/src/lib/emotion/efl_canvas_video_eo.legacy.c b/src/lib/emotion/efl_canvas_video_eo.legacy.c new file mode 100644 index 0000000000..e7e0dcee67 --- /dev/null +++ b/src/lib/emotion/efl_canvas_video_eo.legacy.c @@ -0,0 +1,12 @@ + +EAPI void +emotion_object_module_option_set(Efl_Canvas_Video *obj, const char *opt, const char *val) +{ + efl_canvas_video_option_set(obj, opt, val); +} + +EAPI Eina_Bool +emotion_object_init(Efl_Canvas_Video *obj, const char *module_filename) +{ + return efl_canvas_video_engine_set(obj, module_filename); +} diff --git a/src/lib/emotion/efl_canvas_video_eo.legacy.h b/src/lib/emotion/efl_canvas_video_eo.legacy.h new file mode 100644 index 0000000000..205c305aea --- /dev/null +++ b/src/lib/emotion/efl_canvas_video_eo.legacy.h @@ -0,0 +1,60 @@ +#ifndef _EFL_CANVAS_VIDEO_EO_LEGACY_H_ +#define _EFL_CANVAS_VIDEO_EO_LEGACY_H_ + +#ifndef _EFL_CANVAS_VIDEO_EO_CLASS_TYPE +#define _EFL_CANVAS_VIDEO_EO_CLASS_TYPE + +typedef Eo Efl_Canvas_Video; + +#endif + +#ifndef _EFL_CANVAS_VIDEO_EO_TYPES +#define _EFL_CANVAS_VIDEO_EO_TYPES + + +#endif + +/** + * @brief Set the specified option for the current module. + * + * This function allows one to mute the video or audio of the emotion object. + * + * Please don't use this function, consider using @ref Efl.Player.mute instead. + * + * @param[in] obj The object. + * @param[in] opt The option that is being set. Currently supported options: + * "video" and "audio". + * @param[in] val The value of the option. Currently only supports "off" + * (?!?!?!) + * + * @ingroup (null)_Group + */ +EAPI void emotion_object_module_option_set(Efl_Canvas_Video *obj, const char *opt, const char *val); + +/** + * @brief Initializes an emotion object with the specified module. + * + * This function is required after creating the emotion object, in order to + * specify which module will be used with this object. Different objects can + * use different modules to play a media file. The current supported modules + * are gstreamer and xine. + * + * To use any of them, you need to make sure that support for them was compiled + * correctly. + * + * It's possible to disable the build of a module with --disable-module_name. + * + * See also @ref Efl.File.file. + * + * @param[in] obj The object. + * @param[in] module_filename The name of the module to be used (gstreamer or + * xine). + * + * @return @c true if the specified module was successfully initialized for + * this object, @c false otherwise. + * + * @ingroup (null)_Group + */ +EAPI Eina_Bool emotion_object_init(Efl_Canvas_Video *obj, const char *module_filename); + +#endif diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c index 8e59f0ac6b..e2243c818d 100644 --- a/src/lib/emotion/emotion_smart.c +++ b/src/lib/emotion/emotion_smart.c @@ -4,7 +4,6 @@ #define EFL_CANVAS_OBJECT_PROTECTED #define EFL_CANVAS_GROUP_PROTECTED -#define EFL_CANVAS_GROUP_BETA #include #include @@ -19,7 +18,7 @@ #include "Emotion.h" #include "emotion_private.h" -#include "canvas/evas_canvas.eo.h" +#include "canvas/evas_canvas_eo.h" #ifdef _WIN32 # define FMT_UCHAR "%c" @@ -120,6 +119,7 @@ struct _Efl_Canvas_Video_Data Eina_Bool remember_play : 1; Eina_Bool seek : 1; Eina_Bool seeking : 1; + Eina_Bool loaded : 1; }; struct _Emotion_Xattr_Data @@ -345,21 +345,34 @@ _efl_canvas_video_engine_set(Eo *obj, Efl_Canvas_Video_Data *pd, const char *eng EAPI Eina_Bool emotion_object_file_set(Evas_Object *obj, const char *file) { - return efl_file_set(obj, file, NULL); + return efl_file_simple_load(obj, file, NULL); } -EOLIAN static Eina_Bool -_efl_canvas_video_efl_file_file_set(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd, const char *file, const char *key EINA_UNUSED) +EOLIAN static Eina_Error +_efl_canvas_video_efl_file_file_set(Eo *obj, Efl_Canvas_Video_Data *sd, const char *file) { DBG("file=%s", file); - if (!eina_stringshare_replace(&sd->file, file)) return EINA_TRUE; + eina_stringshare_replace(&sd->file, file); + sd->loaded = 0; + return efl_file_set(efl_super(obj, MY_CLASS), file); +} +EOLIAN static Eina_Bool +_efl_canvas_video_efl_file_loaded_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd) +{ + return sd->open && sd->loaded; +} + +EOLIAN static Eina_Error +_efl_canvas_video_efl_file_load(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd) +{ + const char *file = sd->file; if (!sd->engine_instance) _engine_init(obj, sd); if (!sd->engine_instance) { WRN("No engine chosen. Please set an engine."); - return EINA_FALSE; + return EFL_GFX_IMAGE_LOAD_ERROR_GENERIC; } sd->video.w = 0; @@ -368,7 +381,6 @@ _efl_canvas_video_efl_file_file_set(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data * { char *file2 = NULL; - eina_stringshare_replace(&sd->file, file); emotion_engine_instance_file_close(sd->engine_instance); evas_object_image_data_set(sd->obj, NULL); evas_object_image_size_set(sd->obj, 1, 1); @@ -383,7 +395,7 @@ _efl_canvas_video_efl_file_file_set(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data * if (!emotion_engine_instance_file_open(sd->engine_instance, file2)) { WRN("Couldn't open file=%s", sd->file); - return EINA_FALSE; + return EFL_GFX_IMAGE_LOAD_ERROR_GENERIC; } free(file2); DBG("successfully opened file=%s", sd->file); @@ -403,23 +415,15 @@ _efl_canvas_video_efl_file_file_set(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data * sd->anim = NULL; _xattr_data_cancel(sd->xattr); + sd->loaded = 1; - return EINA_TRUE; + return 0; } EAPI const char * emotion_object_file_get(const Evas_Object *obj) { - const char *file = NULL; - efl_file_get(obj, &file, NULL); - return file; -} - -EOLIAN static void -_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; + return efl_file_get(obj); } static void @@ -1974,3 +1978,4 @@ _efl_canvas_video_efl_gfx_entity_size_set(Evas_Object *obj, Efl_Canvas_Video_Dat #include "efl_canvas_video.eo.c" +#include "efl_canvas_video_eo.legacy.c" diff --git a/src/lib/emotion/meson.build b/src/lib/emotion/meson.build index ad25dc65a6..6f2717dfa6 100644 --- a/src/lib/emotion/meson.build +++ b/src/lib/emotion/meson.build @@ -1,11 +1,11 @@ -pub_legacy_eo_files = [ +pub_eo_file = [ 'efl_canvas_video.eo' ] pub_eo_file_target = [] priv_eo_file_target = [] -foreach eo_file : pub_legacy_eo_files +foreach eo_file : pub_eo_file pub_eo_file_target += custom_target('eolian_gen_' + eo_file, input : eo_file, output : [eo_file + '.h'], @@ -17,16 +17,6 @@ foreach eo_file : pub_legacy_eo_files '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'), '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'), '-gchd', '@INPUT@']) - pub_eo_file_target += custom_target('eolian_gen_legacy_' + eo_file, - input : eo_file, - output : [eo_file + '.legacy.h'], - depfile : eo_file + '.legacy.d', - install : true, - install_dir : dir_package_include, - command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories, - '-o', 'l:' + join_paths(meson.current_build_dir(), eo_file + '.legacy.h'), - '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.legacy.d'), - '-gld', '@INPUT@']) endforeach eolian_include_directories += ['-I', meson.current_source_dir()] @@ -34,7 +24,8 @@ eolian_include_directories += ['-I', meson.current_source_dir()] emotion_header_src = [ 'Emotion.h', 'Emotion_Legacy.h', - 'Emotion_Eo.h' + 'Emotion_Eo.h', + 'efl_canvas_video_eo.legacy.h', ] emotion_src = [ @@ -71,9 +62,11 @@ emotion = declare_dependency( dependencies: emotion_pub_deps, ) -install_data(pub_legacy_eo_files, - install_dir: join_paths(eolian_include_dir, package_version_name) -) +if get_option('install-eo-files') + install_data(pub_eo_file, + install_dir: join_paths(eolian_include_dir, package_version_name) + ) +endif install_headers(emotion_header_src, install_dir : dir_package_include, diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h index 21a4bf25d2..63e4c6b89a 100644 --- a/src/lib/eo/Eo.h +++ b/src/lib/eo/Eo.h @@ -182,8 +182,6 @@ typedef Eo Efl_Class; typedef Eo Efl_Object; #define _EFL_OBJECT_EO_CLASS_TYPE -#ifdef EFL_BETA_API_SUPPORT - /** * @var _efl_class_creation_lock * This variable is used for locking purposes in the class_get function @@ -216,7 +214,6 @@ typedef void (*Efl_Del_Intercept) (Eo *obj_id); #include "efl_object_override.eo.h" #include "efl_object.eo.h" -#include "efl_interface.eo.h" #define EO_CLASS EFL_OBJECT_CLASS /** An event callback prototype. */ @@ -314,7 +311,10 @@ EOAPI Eina_Bool efl_event_callback_array_del(Eo *obj, const Efl_Callback_Array_I * @brief Call the callbacks for an event of an object. * * @param[in] desc The description of the event to call. - * @param[in] event_info Extra event info to pass to the callbacks. + * @param[in] event_info Extra event info to pass to the callbacks. Please provide objects of the same type as + * advertised in the EO file, as this is what listeners of this event will be expecting. Keep in mind that: + * 1) Objects must be passed as a normal Eo*. Event subscribers can call functions on these objects. + * 2) Structs, built-in types and containers must be passed as const pointers, with one level of indirection. * * @return @c false If one of the callbacks aborted the call, @c true otherwise */ @@ -359,7 +359,7 @@ typedef struct _Efl_Future_Cb_Desc { * @param value The operation result * @return An Eina_Value to pass to the next Eina_Future in the chain (if any). * If there is no need to convert the received value, it's @b recommended - * to pass-thru @p value argument. If you need to convert to a different type + * to passthrough @p value argument. If you need to convert to a different type * or generate a new value, use @c eina_value_setup() on @b another Eina_Value * and return it. By returning a promise Eina_Value (eina_promise_as_value()) the * whole chain will wait until the promise is resolved in @@ -378,7 +378,7 @@ typedef struct _Efl_Future_Cb_Desc { * may also return a non-error, in which case the next future in the chain will receive a regular * value, which may call its @c success. * - * If this function is not provided, then it will pass thru the error to the next error handler. + * If this function is not provided, then it will passthrough the error to the next error handler. * * It may be called with @c EINVAL if @c success_type is provided and doesn't * match the received type. @@ -779,7 +779,8 @@ enum _Efl_Class_Type EFL_CLASS_TYPE_REGULAR = 0, /**< Regular class. */ EFL_CLASS_TYPE_REGULAR_NO_INSTANT, /**< Regular non instant-able class. */ EFL_CLASS_TYPE_INTERFACE, /**< Interface */ - EFL_CLASS_TYPE_MIXIN /**< Mixin */ + EFL_CLASS_TYPE_MIXIN, /**< Mixin */ + EFL_CLASS_TYPE_INVALID }; /** @@ -826,6 +827,40 @@ struct _Efl_Class_Description void (*class_constructor)(Efl_Class *klass); /**< The constructor of the class. */ void (*class_destructor)(Efl_Class *klass); /**< The destructor of the class. */ }; +/** + * Setter type which is used to set an #Eina_Value, this function should access one particular property field + */ +typedef Eina_Error (*Efl_Object_Property_Reflection_Setter)(Eo *obj, Eina_Value value); + +/** + * Getter type which is used to get an #Eina_Value, this function should access one particular property field + */ +typedef Eina_Value (*Efl_Object_Property_Reflection_Getter)(const Eo *obj); + +/** + * @struct _Efl_Object_Property_Reflection + * + * This structure holds one line of the reflection table. + * The two fields get and set might be NULL, + * the property_name is a normal c string containing the name of the property + * that the get and set function changes. + */ +typedef struct _Efl_Object_Property_Reflection{ + const char *property_name; /**< The name of the property */ + Efl_Object_Property_Reflection_Setter set; /**< The function used to set a generic #Eina_Value on this property of the object. */ + Efl_Object_Property_Reflection_Getter get; /**< The function used to retrieve a generic #Eina_Value from this property of the object. */ +} Efl_Object_Property_Reflection; + +/** + * @struct _Efl_Object_Property_Reflection_Ops + * + * This structure holds the reflection table and the size of this table. + */ +typedef struct _Efl_Object_Property_Reflection_Ops +{ + const Efl_Object_Property_Reflection *table; /**< The reflection table. */ + size_t count; /**< Number of table lines descriptions. */ +} Efl_Object_Property_Reflection_Ops; /** * @typedef Efl_Class_Description @@ -856,13 +891,15 @@ EAPI const Efl_Class *efl_class_new(const Efl_Class_Description *desc, const Efl * @param klass_id the class whose functions we are setting. * @param object_ops The function structure we are setting for object functions * @param class_ops The function structure we are setting for class functions + * @param reflection_table The reflection table to use within eo * @return True on success, False otherwise. * * This should only be called from within the initializer function. - * + * The reflection_table contains a getter and setter per property name. Which are called when either + * efl_property_reflection_set() or efl_property_reflection_get() is called. * @see #EFL_DEFINE_CLASS */ -EAPI Eina_Bool efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Ops *class_ops); +EAPI Eina_Bool efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Property_Reflection_Ops *reflection_table); /** * @brief Override Eo functions of this object. @@ -910,9 +947,12 @@ EAPI Eina_Bool efl_object_override(Eo *obj, const Efl_Object_Ops *ops); * @brief Check if an object "is a" klass. * @param obj The object to check * @param klass The klass to check against. - * @return @c EINA_TRUE if obj implements klass, @c EINA_FALSE otherwise. + * @return @c EINA_TRUE if obj implements klass or is an Efl_Class which inherits + * from/implements klass, @c EINA_FALSE otherwise. * * Notice: This function does not support composite objects. + * Note: that an Efl_Class is also an Efl_Object, so if you pass an Efl_Class + * as obj, it will check if that class contain klass. */ EAPI Eina_Bool efl_isa(const Eo *obj, const Efl_Class *klass); @@ -971,6 +1011,7 @@ EAPI Eina_Bool efl_object_init(void); */ EAPI Eina_Bool efl_object_shutdown(void); +#ifdef EFL_BETA_API_SUPPORT /** * The virtual allocation domain where an object lives @@ -1005,7 +1046,7 @@ typedef struct _Efl_Domain_Data Efl_Domain_Data; * where it's called. Calling it after this point will result in * undefined behavior, so be sure to call this immediaetly after a thread * begins to execute. You must not change the domain of the main thread. - * + * * @see efl_domain_switch() * @see efl_domain_current_get() * @see efl_domain_current_set() @@ -1028,7 +1069,7 @@ EAPI Efl_Id_Domain efl_domain_get(void); * new domain temporarily with efl_domain_current_set(), * efl_domain_current_push() or efl_domain_current_pop(), * efl_domain_data_adopt() and efl_domain_data_return(). - * + * * @see efl_domain_get() */ EAPI Eina_Bool efl_domain_switch(Efl_Id_Domain domain); @@ -1041,7 +1082,7 @@ EAPI Eina_Bool efl_domain_switch(Efl_Id_Domain domain); * There is actually a stack of domans to use. You can alter this via * efl_domain_current_push() and efl_domain_current_pop(). This only gets * the domain for the current thread. - * + * * @see efl_domain_get() */ EAPI Efl_Id_Domain efl_domain_current_get(void); @@ -1055,7 +1096,7 @@ EAPI Efl_Id_Domain efl_domain_current_get(void); * efl_domain_current_push() and efl_domain_current_pop(). The current * domain is the one on the top of the stack, so this entry is altered * without pushing or popping. This only applies to the calling thread. - * + * * @see efl_domain_get() */ EAPI Eina_Bool efl_domain_current_set(Efl_Id_Domain domain); @@ -1068,7 +1109,7 @@ EAPI Eina_Bool efl_domain_current_set(Efl_Id_Domain domain); * This pushes a domain on the domain stack that can be popped later with * efl_domain_current_pop(). If the stack is full this may fail and return * EINA_FALSE. This applies only to the calling thread. - * + * * @see efl_domain_get() */ EAPI Eina_Bool efl_domain_current_push(Efl_Id_Domain domain); @@ -1078,7 +1119,7 @@ EAPI Eina_Bool efl_domain_current_push(Efl_Id_Domain domain); * * This pops the top domain off the domain stack for the calling thread * that was pushed with efl_domain_current_push(). - * + * * @see efl_domain_get() */ EAPI void efl_domain_current_pop(void); @@ -1117,7 +1158,7 @@ EAPI Efl_Domain_Data *efl_domain_data_get(void); * your local domain as well, but be aware that creation will require * some switch of domain by push, pop or set. Return the domain with * efl_domain_data_return() when done. - * + * * @see efl_domain_get() */ EAPI Efl_Id_Domain efl_domain_data_adopt(Efl_Domain_Data *data_in); @@ -1133,7 +1174,7 @@ EAPI Efl_Id_Domain efl_domain_data_adopt(Efl_Domain_Data *data_in); * the current domain is the same one pushed implicitly by * efl_domain_data_adopt(). You cannot return your own native local * domain, only the one that was adopted by efl_domain_data_adopt(). - * + * * @see efl_domain_get() */ EAPI Eina_Bool efl_domain_data_return(Efl_Id_Domain domain); @@ -1149,13 +1190,12 @@ EAPI Eina_Bool efl_domain_data_return(Efl_Id_Domain domain); * need to call this if you have objects from multiple domains (an * adopted domain with efl_domain_data_adopt() or the shared domain * EFL_ID_DOMAIN_SHARED where objects may be accessed by any thread). - * + * * @see efl_domain_get() */ EAPI Eina_Bool efl_compatible(const Eo *obj, const Eo *obj_target); - - +#endif // to fetch internal function and object data at once typedef struct _Efl_Object_Op_Call_Data @@ -1513,6 +1553,33 @@ EAPI Eo * _efl_add_internal_start(const char *file, int line, const Efl_Class *k */ EAPI void efl_del(const Eo *obj); +/** + * @brief Set an override for a class + * + * This can be used to override a class with another class such that when @p klass is added + * with efl_add(), an object of type @p override is returned. + * + * @param[in] klass The class to be overridden + * @param[in] override The class to override with; must inherit from or implement @p klass + * @return Return @c true if the override was successfully set + * + * @ingroup Efl_Object + */ +EAPI Eina_Bool efl_class_override_register(const Efl_Class *klass, const Efl_Class *override); + +/** + * @brief Unset an override for a class + * + * This is used to unset a previously-set override on a given class. It will only succeed if + * @p override is the currently-set override for @p klass. + * + * @param[in] klass The class to unset the override from + * @param[in] override The class override to be removed + * @return Return @c true if the override was successfully unset + * + * @ingroup Efl_Object + */ +EAPI Eina_Bool efl_class_override_unregister(const Efl_Class *klass, const Efl_Class *override); /** * @brief Get a pointer to the data of an object for a specific class. * @@ -1655,7 +1722,7 @@ EAPI int efl_ref_count(const Eo *obj); * is about to go from a reference count of 1 to 0, thus triggering actual * destruction of the object. Instead of going to a reference count of 0 and * being destroyed, the object will stay alive with a reference count of 1 - * and this intercept function will be called instead. + * and this intercept function will be called instead. * The interceptor function handles any further deletion of of the object * from here. * @@ -1670,7 +1737,7 @@ EAPI int efl_ref_count(const Eo *obj); * on its owning loop to be destroyed at some time in the future and now * set the intercept function to NULL so it is not called again on the next * "real deletion". - * + * * @see efl_del_intercept_get() * @see efl_unref() * @see efl_del() @@ -1689,7 +1756,7 @@ EAPI void efl_del_intercept_set(Eo *obj, Efl_Del_Intercept del_intercept_func); * If you want to override the interceptor be sure to call it after your * own interceptor function has finished. It's generally be a bad idea * to override these functions however. - * + * * @see efl_del_intercept_set() */ EAPI Efl_Del_Intercept efl_del_intercept_get(const Eo *obj); @@ -1788,7 +1855,7 @@ EOAPI void *efl_key_data_get(const Eo *obj, const char * key); * @brief Generic object reference with string key to object. * * The object will be automatically ref'd when set and unref'd when replaced or - * deleted or when the referring object is deleted. If the referenced object + * deleted or when the referring object is deleted. If the referenced object * is deleted, then the key is deleted automatically. * * This is the same key store used by key_data and key_value. Keys are shared @@ -1803,7 +1870,7 @@ EOAPI void efl_key_ref_set(Eo *obj, const char * key, const Efl_Object *objdata) * @brief Generic object reference with string key to object. * * The object will be automatically ref'd when set and unref'd when replaced or - * deleted or when the referring object is deleted. If the referenced object is + * deleted or when the referring object is deleted. If the referenced object is * deleted then the key is deleted automatically. * * This is the same key store used by key_data and key_value. Keys are shared @@ -1878,7 +1945,7 @@ EOAPI Eina_Value *efl_key_value_get(const Eo *obj, const char * key); * @param obj the object to work on. * @param manual_free indicates if the free is manual (EINA_TRUE) or automatic (EINA_FALSE). * - * The developer is in charge of calling the function efl_manual_free to free the memory + * The developer is in charge of calling the function efl_manual_free to free the memory * allocated for this object. * * Do not use this unless you really know what you are doing. It's used by Evas @@ -1914,6 +1981,38 @@ EAPI Eina_Bool efl_manual_free(Eo *obj); */ EAPI Eina_Bool efl_destructed_is(const Eo *obj); +/** + * @brief Set the given #Eina_Value to the property with the specified \c property_name. + * @param obj The object to set the property on + * @param property_name The name of the property to modify. + * @param value The value to set, the value passed here will be flushed by the function + * + * @see efl_property_reflection_get() and efl_property_reflection_exist() + */ +EAPI Eina_Error efl_property_reflection_set(Eo *obj, const char *property_name, Eina_Value value); + +/** + * @brief Retrieve an #Eina_Value containing the current value of the property specified with \c property_name. + * @param obj The object to set the property on + * @param property_name The name of the property to get. + * + * @return The value that got returned by the actual property in form of a generic Eina_Value. The user of this API is owning the returned Value. + * + * @see efl_property_reflection_set() and efl_property_reflection_exist() + */ +EAPI Eina_Value efl_property_reflection_get(const Eo *obj, const char *property_name); + +/** + * @brief Check if a property exist for reflection. + * @param obj The object to inspect. + * @param property_name The name of the property to check if it exist. + * + * @return EINA_TRUE if the property exist, EINA_FALSE otherwise. + * + * @see efl_property_reflection_set() and efl_property_reflection_get() + */ +EAPI Eina_Bool efl_property_reflection_exist(Eo *obj, const char *property_name); + /** * @addtogroup Efl_Class_Class Eo's Class class. * @{ @@ -1921,6 +2020,14 @@ EAPI Eina_Bool efl_destructed_is(const Eo *obj); #include "efl_class.eo.h" +/** + * @brief Get the type of this class. + * @param klass The Efl_Class to get the type from. + * + * @return The type of this class or INVALID if the klass parameter was invalid. + */ +EAPI Efl_Class_Type efl_class_type_get(const Efl_Class *klass); + /** * @} */ @@ -1978,14 +2085,6 @@ typedef void (*efl_key_data_free_func)(void *); * @{ */ -/** - * Don't use this. - * The values of the returned event structure are also internal, don't assume - * anything about them. - * @internal - */ -EAPI const Efl_Event_Description *efl_object_legacy_only_event_description_get(const char *_event_name); - /** * Helper for sorting callbacks array. Automatically used by * @ref EFL_CALLBACKS_ARRAY_DEFINE @@ -2137,7 +2236,7 @@ eina_value_object_init(Eo *obj) * @since 1.21 */ static inline Eo * -eina_value_object_get(Eina_Value *v) +eina_value_object_get(const Eina_Value *v) { Eo *r = NULL; @@ -2149,6 +2248,7 @@ eina_value_object_get(Eina_Value *v) return r; } +#ifdef EFL_BETA_API_SUPPORT /** * @brief Get if the object is in its main lifetime. * @param obj the object to check @@ -2161,6 +2261,7 @@ efl_alive_get(const Eo *obj) { return efl_finalized_get(obj) && !efl_invalidating_get(obj) && !efl_invalidated_get(obj); } +#endif /* EFL_BETA_API_SUPPORT */ /** * @brief Event triggered when a callback was added to the object @@ -2209,7 +2310,6 @@ EAPI Eina_Iterator *eo_objects_iterator_new(void); * @} */ -#endif #ifdef __cplusplus } diff --git a/src/lib/eo/efl_class.eo b/src/lib/eo/efl_class.eo index b665ec2e8c..c30df7209a 100644 --- a/src/lib/eo/efl_class.eo +++ b/src/lib/eo/efl_class.eo @@ -1,5 +1,8 @@ abstract Efl.Class { - [[Abstract Efl class]] + [[Abstract Efl class + + @since 1.22 + ]] data: null; } diff --git a/src/lib/eo/efl_interface.eo b/src/lib/eo/efl_interface.eo deleted file mode 100644 index f2d6b273b0..0000000000 --- a/src/lib/eo/efl_interface.eo +++ /dev/null @@ -1,7 +0,0 @@ -interface Efl.Interface -{ - [[An interface for other interfaces to inherit from. - This is useful when you want to create interfaces and mixins that expose - functions from a normal class such as @Efl.Object.constructor.]] -} - diff --git a/src/lib/eo/efl_object.eo b/src/lib/eo/efl_object.eo index 6049ceb29a..cb0a92e70c 100644 --- a/src/lib/eo/efl_object.eo +++ b/src/lib/eo/efl_object.eo @@ -1,7 +1,10 @@ import eina_types; struct Efl.Event_Description { - [[This struct holds the description of a specific event.]] + [[This struct holds the description of a specific event. + + @since 1.22 + ]] name: string; [[name of the event.]] unfreezable: bool; [[$true if the event cannot be frozen.]] legacy_is: bool; [[Internal use: $true if a legacy event.]] @@ -18,7 +21,9 @@ type Efl.Callback_Priority : short; specified @Efl.Callback_Priority_Default is to be assumed. See @Efl.Callback_Priority_Before @Efl.Callback_Priority_Default @Efl.Callback_Priority_After - ]] + + @since 1.22 +]] const Efl.Callback_Priority_Before : Efl.Callback_Priority = -100; [[Slightly more prioritized than default.]] @@ -29,25 +34,56 @@ const Efl.Callback_Priority_After : Efl.Callback_Priority = 100; abstract Efl.Object { - [[Abstract Efl object class]] + [[Abstract EFL object class. + + All EFL objects inherit from this class, which provides basic functionality + like naming, debugging, hierarchy traversal, event emission and life cycle + management. + + Life Cycle + Objects are created with efl_add() and mostly disposed of with efl_del(). + As an optimization, efl_add() accepts a list of initialization functions + which the programmer can use to further customize the object before it is + fully constructed. + Also, objects can have a parent which will keep them alive as long as the + parent is alive, so the programmer does not need to keep track of references. + (See the @.parent property for details). + Due to the above characteristics, EFL objects undergo the following phases + during their Life Cycle: + - Construction: The @.constructor method is called. Afterwards, any + user-supplied initialization methods are called. + - Finalization: The @.finalize method is called and @.finalized is set to + $true when it returns. Object is usable at this point. + - Invalidation: The object has lost its parent. The @.invalidate method is + called so all the object's relationships can be terminated. @.invalidated + is set to $true. + - Destruction: The object has no parent and it can be destroyed. The + @.destructor method is called, use it to return any resources the object + might have gathered during its life. + + @since 1.22 + ]] eo_prefix: efl; methods { @property parent { [[The parent of an object. - Parents keep references to their children. In order to - delete objects which have parents you need to set parent to - NULL or use efl_del(). This will both delete & unref - the object). + Parents keep references to their children and will release these + references when destroyed. In this way, objects can be assigned to + a parent upon creation, tying their life cycle so the programmer + does not need to worry about destroying the child object. + In order to destroy an object before its parent, set the parent to + $NULL and use efl_unref(), or use efl_del() directly. The Eo parent is conceptually user set. That means that a parent should not be changed behind the scenes in an unexpected way. For example: - If you have a widget that has a box internally and - when you 'swallow' a widget and the swallowed object ends up in - the box, the parent should be the widget, not the box. + If you have a widget which can swallow objects into an internal + box, the parent of the swallowed objects should be the widget, not + the internal box. The user is not even aware of the existence of + the internal box. ]] set { @@ -55,32 +91,31 @@ abstract Efl.Object get { } values { - parent: Efl.Object @nullable; [[The new parent]] + parent: Efl.Object @nullable; [[The new parent.]] } } @property name { - [[ The name of the object. + [[The name of the object. - Every object can have a string name. Names may not contain - the following characters: - / ? * [ ] ! \ : - Using any of these in a name will result in undefined - behavior later on. An empty string is considered the same as a - NULL string or no string for the name. + Every EFL object can have a name. Names may not contain the + following characters: / ? * [ ] ! \ : + Using any of these in a name will result in undefined behavior + later on. An empty string is considered the same as a $NULL string + or no string for the name. ]] set { } get { } values { - name: string @nullable; [[The name]] + name: string @nullable; [[The name.]] } } @property comment { - [[ A human readable comment for the object + [[A human readable comment for the object. - Every object can have a string comment. This is intended for developers - and debugging. An empty string is considered the same as a NULL + Every EFL object can have a comment. This is intended for developers + and debugging. An empty string is considered the same as a $NULL string or no string for the comment. ]] set { @@ -88,11 +123,11 @@ abstract Efl.Object get { } values { - comment: string @nullable; [[The comment]] + comment: string @nullable; [[The comment.]] } } debug_name_override { - [[ Build a read-only name for this object used for debugging. + [[Build a read-only name for this object used for debugging. Multiple calls using efl_super() can be chained in order to build the entire debug name, from parent to child classes. In C the usual @@ -103,60 +138,66 @@ abstract Efl.Object Usually more debug information should be added to $sb after calling the super function. - - @since 1.21 ]] params { - @in sb: ptr(Eina.Strbuf); [[A string buffer, must not be $null.]] + @in sb: strbuf; [[A string buffer, must not be $null.]] } } @property event_global_freeze_count @class { get { - [[Return freeze events of object. + [[Return the global count of freeze events. - Return event freeze count. + This is the amount of calls to @.event_global_freeze minus + the amount of calls to @.event_global_thaw. + EFL will not emit any event while this count is > 0 (Except + events marked $hot). ]] } values { - fcount: int; [[The event freeze count of the object]] + fcount: int; [[The global event freeze count.]] } } @property event_freeze_count { get { - [[Return freeze events of object. + [[Return the count of freeze events for this object. - Return event freeze count. + This is the amount of calls to @.event_freeze minus + the amount of calls to @.event_thaw. + This object will not emit any event while this count is > 0 + (Except events marked $hot). ]] } values { - fcount: int; [[The event freeze count of the object]] + fcount: int; [[The event freeze count of this object.]] } } @property finalized { - [[True if the object is already finalized, otherwise false.]] + [[$true if the object has been finalized, i.e. construction has finished. + See the Life Cycle section in this class' description.]] get { } values { - finalized: bool; [[$true if the object is finalized, $false otherwise]] + finalized: bool; [[$true if the object is finalized, $false otherwise.]] } } @property invalidated { - [[True if the object is already invalidated, otherwise false.]] + [[$true if the object has been invalidated, i.e. it has no parent. + See the Life Cycle section in this class' description.]] get { } values { - finalized: bool; [[$true if the object is invalidated, $false otherwise]] + finalized: bool; [[$true if the object is invalidated, $false otherwise.]] } } @property invalidating { - [[True if the object is about to be invalidated, and the invalidation of the children is already happening. - - Note this is true before the invalidate call on the object. - ]] + [[$true if the object has started the invalidation phase, but has not + finished it yet. + Note: This might become $true before @.invalidate is called. + See the Life Cycle section in this class' description.]] get { } values { - invalidating: bool; [[$true if the object is invalidating, $false otherwise]] + invalidating: bool; [[$true if the object is invalidating, $false otherwise.]] } } provider_find @const { @@ -170,36 +211,53 @@ abstract Efl.Object If this is not done the class cannot be found up in the object tree. ]] params { - klass : const(Efl.Class); [[The class identifier to search for]] + klass : const(Efl.Class); [[The class identifier to search for.]] } - return : Efl.Object; [[Object from the provider list]] + return : Efl.Object; [[Object from the provider list.]] } constructor { - [[Call the object's constructor. + [[Implement this method to provide optional initialization code for your object. - Should not be used with #eo_do. Only use it with #eo_do_super. - ]] - return: Efl.Object; [[The new object created, can be NULL if aborting]] + See the Life Cycle section in this class' description.]] + return: Efl.Object; [[The new object, can be $NULL if aborted.]] } destructor { - [[Call the object's destructor. + [[Implement this method to provide deinitialization code for your object if you need it. - Should not be used with #efl_do. Only use it with #efl_do_super. - Will be triggered once #invalidate and #noref have been triggered. - ]] + Will be called once @.invalidate has returned. + See the Life Cycle section in this class' description.]] } 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]] + [[Implement this method to finish the initialization of your object + after all (if any) user-provided configuration methods have been + executed. + + Use this method to delay expensive operations until user configuration + has finished, to avoid building the object in a "default" state in the + constructor, just to have to throw it all away because a user + configuration (a property being set, for example) requires a different + state. + This is the last call inside efl_add() and will set @.finalized to $true + once it returns. + This is an optimization and implementing this method is optional if you + already perform all your initialization in the @.constructor method. + See the Life Cycle section in this class' description.]] + return: Efl.Object; [[The new object. Return $NULL to abort object creation.]] } 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. + [[Implement this method to perform special actions when your object loses + its parent, if you need to. - 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.]] + It is called when the parent reference is lost or set to $NULL. After this + call returns, @.invalidated is set to $true. + This allows a simpler tear down of complex hierarchies, by performing + object destruction in two steps, first all object relationships are + broken and then the isolated objects are destroyed. Performing everything + in the @.destructor can sometimes lead to deadlocks, but implementing + this method is optional if this is not your case. + When an object with a parent is destroyed, it first receives a call to + @.invalidate and then to @.destructor. + See the Life Cycle section in this class' description.]] } name_find @const { [[Find a child object with the given name and return it. @@ -211,32 +269,41 @@ abstract Efl.Object the search will match any object of that class. ]] params { - @in search: string; [[The name search string]] + @in search: string; [[The name search string.]] } - return: Efl.Object; [[The first object found]] + return: Efl.Object; [[The first object found.]] } event_thaw { [[Thaw events of object. - Allows event callbacks to be called for an object. + Allows event callbacks to be called again for this object after a call + to @.event_freeze. The amount of thaws must match the amount of freezes + for events to be re-enabled. ]] } event_freeze { - [[Freeze events of object. + [[Freeze events of this object. - Prevents event callbacks from being called for an object. + Prevents event callbacks from being called for this object. Enable + events again using @.event_thaw. Events marked $hot cannot be stopped. ]] } event_global_thaw @class { - [[Thaw events of object. + [[Gobally thaw events for ALL EFL OBJECTS. - Allows event callbacks be called for an object. + Allows event callbacks to be called for all EFL objects after they have + been disabled by @.event_global_freeze. The amount of thaws must match + the amount of freezes for events to be re-enabled. ]] } event_global_freeze @class { - [[Freeze events of object. + [[Globally freeze events for ALL EFL OBJECTS. - Prevents event callbacks from being called for an object. + Prevents event callbacks from being called for all EFL objects. + Enable events again using @.event_global_thaw. Events marked $hot + cannot be stopped. + + Note: USE WITH CAUTION. ]] } event_callback_stop { @@ -283,7 +350,7 @@ abstract Efl.Object [[Get an iterator on all childrens]] return: iterator @owned @warn_unused; [[Children iterator]] } - composite_attach { + composite_attach @beta { [[Make an object a composite object of another. The class of comp_obj must be part of the extensions of the class of the parent. @@ -297,7 +364,7 @@ abstract Efl.Object } return: bool; [[$true if successful. $false otherwise.]] } - composite_detach { + composite_detach @beta { [[Detach a composite object from another object. This functions also sets the parent of comp_obj to $null. @@ -309,14 +376,14 @@ abstract Efl.Object } return: bool; [[$true if successful. $false otherwise.]] } - composite_part_is { + composite_part_is @beta { [[Check if an object is part of a composite object. See @.composite_attach, @.composite_part_is. ]] return: bool; [[$true if it is. $false otherwise.]] } - @property allow_parent_unref { + @property allow_parent_unref @beta { [[Allow an object to be deleted by unref even if it has a parent. This simply hides the error message warning that an object being @@ -325,13 +392,13 @@ abstract Efl.Object In a normal object use case, when ownership of an object is given to a caller, said ownership should be released with efl_unref(). If the object has a parent, this will print error messages, as - $efl_unref() is stealing the ref from the parent. + efl_unref() is stealing the ref from the parent. Warning: Use this function very carefully, unless you're absolutely sure of what you are doing. ]] values { - allow: bool(false); [[Whether to allow $efl_unref() to zero + allow: bool(false); [[Whether to allow efl_unref() to zero even if @.parent is not $null.]] } } @@ -341,12 +408,12 @@ abstract Efl.Object class.destructor; } events { - 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.]] + del @hot: void; [[Object is being deleted. See @.destructor.]] + invalidate @hot: void; [[Object is being invalidated and losing its parent. See @.invalidate.]] + noref @hot: void; [[Object has lost its last reference, only parent relationship is keeping it alive. Advanced usage.]] 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.]] + reference you keep to the object.]] } } @@ -357,5 +424,9 @@ struct Efl.Event { ]] object: Efl.Object; [[The object the callback was called on.]] desc: const(ptr(Efl.Event_Description)); [[The event description.]] - info: void_ptr; [[Extra event information passed by the event caller]] + info: void_ptr; [[Extra event information passed by the event caller. + Must be cast to the event type declared in the EO file. Keep in mind that: + 1) Objects are passed as a normal Eo*. Event subscribers can call functions on these objects. + 2) Structs, built-in types and containers are passed as const pointers, with one level of indirection. + ]] } diff --git a/src/lib/eo/efl_object_override.eo b/src/lib/eo/efl_object_override.eo index 65f46dad03..f7cc35b497 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 @beta 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 d0b3dcbcb9..95d15a4782 100644 --- a/src/lib/eo/eina_types.eot +++ b/src/lib/eo/eina_types.eot @@ -77,6 +77,7 @@ struct @extern Eina.Rw_Slice { mem: void_ptr; [[Pointer to memory segment]] } +struct @extern Eina.Value; [[Eina value placeholder so it can be referenced from docs.]] struct @extern Eina.Value_Type; [[Eina value type]] struct @extern Eina.Stat { @@ -99,7 +100,7 @@ struct @extern Eina.Stat { ctimensec: ulong; [[The nano version of the timestmap when the file was created]] } -struct @extern Eina.Promise; [[Eina promise type]] +struct @extern @free(eina_promise_free) Eina.Promise; [[Eina promise type]] /* 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 82299fe622..c16c021ef2 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -44,6 +44,7 @@ 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; +static Eina_Hash *class_overrides; typedef enum _Eo_Ref_Op { EO_REF_OP_NONE, @@ -383,6 +384,16 @@ _eo_kls_itr_next(const _Efl_Class *orig_kls, const _Efl_Class *cur_klass, return NULL; } +static inline void +_apply_auto_unref(_Eo_Object *obj, const Eo *eo_obj) +{ + if (EINA_UNLIKELY(obj && obj->auto_unref)) + { + if (obj->finalized && !(--obj->auto_unref)) + efl_unref(eo_obj); + } +} + /************************************ EO ************************************/ static EFL_FUNC_TLS _Efl_Class *_super_klass = NULL; @@ -575,11 +586,7 @@ err_func_src: err: if (is_obj) { - if (EINA_UNLIKELY(obj->auto_unref != 0)) - { - if (obj->finalized && !(--obj->auto_unref)) - efl_unref(eo_id); - } + _apply_auto_unref(obj, eo_id); _efl_unref(obj); _eo_obj_pointer_done((Eo_Id)eo_id); } @@ -643,11 +650,7 @@ _efl_object_call_end(Efl_Object_Op_Call_Data *call) { if (EINA_LIKELY(!!call->obj)) { - if (EINA_UNLIKELY(call->obj->auto_unref != 0)) - { - if (call->obj->finalized && !(--call->obj->auto_unref)) - efl_unref(call->eo_id); - } + _apply_auto_unref(call->obj, call->eo_id); _efl_unref(call->obj); _eo_obj_pointer_done((Eo_Id)call->eo_id); } @@ -714,11 +717,7 @@ _efl_object_op_api_id_get(const void *api_func, const Eo *eo_obj, const char *ap file, api_func_name, line, "Unable to resolve op for api func %p for obj=%p (%s)", api_func, eo_obj, efl_class_name_get(eo_obj)); - if (EINA_UNLIKELY(obj && obj->auto_unref)) - { - if (obj->finalized && !(--obj->auto_unref)) - efl_unref(eo_obj); - } + _apply_auto_unref(obj, eo_obj); return EFL_NOOP; } @@ -818,7 +817,7 @@ _eo_class_funcs_set(Eo_Vtable *vtable, const Efl_Object_Ops *ops, const _Efl_Cla } EAPI Eina_Bool -efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Ops *class_ops) +efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Property_Reflection_Ops *reflection_table) { EO_CLASS_POINTER_GOTO(klass_id, klass, err_klass); Efl_Object_Ops empty_ops = { 0 }; @@ -829,9 +828,9 @@ efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ if (!object_ops) object_ops = &empty_ops; - if (!class_ops) class_ops = &empty_ops; + klass->reflection = reflection_table; - klass->ops_count = object_ops->count + class_ops->count; + klass->ops_count = object_ops->count; klass->base_id = _eo_ops_last_id; _eo_ops_last_id += klass->ops_count + 1; @@ -848,8 +847,7 @@ efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ _vtable_copy_all(&klass->vtable, &(*mro_itr)->vtable); } - return _eo_class_funcs_set(&klass->vtable, object_ops, klass, klass, 0, EINA_FALSE) && - _eo_class_funcs_set(&klass->vtable, class_ops, klass, klass, object_ops->count, EINA_FALSE); + return _eo_class_funcs_set(&klass->vtable, object_ops, klass, klass, 0, EINA_FALSE); err_funcs: ERR("Class %s already had its functions set..", klass->desc->name); @@ -868,6 +866,12 @@ _efl_add_internal_start(const char *file, int line, const Efl_Class *klass_id, E if (is_fallback) fptr = _efl_add_fallback_stack_push(NULL); + if (class_overrides) + { + const Efl_Class *override = eina_hash_find(class_overrides, &klass_id); + if (override) klass_id = override; + } + EO_CLASS_POINTER_GOTO_PROXY(klass_id, klass, err_klass); // Check that in the case of efl_add we do pass a parent. @@ -975,7 +979,7 @@ _efl_add_internal_end(Eo *eo_id, Eo *finalized_id) // fails or succeeds based on if service is there. // // until there is a better solution - don't complain here. - // + // // ERR("Object of class '%s' - Finalizing the object failed.", // klass->desc->name); goto cleanup; @@ -1510,6 +1514,9 @@ efl_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ... return NULL; } break; + default: + ERR("type cannot be INVALID"); + return NULL; } } @@ -1536,6 +1543,10 @@ efl_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ... case EFL_CLASS_TYPE_MIXIN: extn_list = eina_list_append(extn_list, extn); break; + default: + ERR("type cannot be INVALID"); + va_end(p_list); + return NULL; } } extn_id = va_arg(p_list, Eo_Id *); @@ -1756,6 +1767,24 @@ efl_isa(const Eo *eo_id, const Efl_Class *klass_id) Eina_Bool isa = EINA_FALSE; if (EINA_UNLIKELY(!eo_id)) return EINA_FALSE; + + // Everything can add a override to an existing class, which pretty much means, everything is a efl override + // This is required in order to support our debug-profile for the users of efl_override + if (EINA_UNLIKELY(klass_id == EFL_OBJECT_OVERRIDE_CLASS)) return EINA_TRUE; + + // Case where we are looking if eo_id is a class that contain klass_id + if (EINA_UNLIKELY(_eo_is_a_class(eo_id))) + { + + EO_CLASS_POINTER_GOTO(klass_id, klass, err_class); + EO_CLASS_POINTER_GOTO(eo_id, lookinto, err_class0); + + const op_type_funcs *func = _vtable_func_get + (&lookinto->vtable, klass->base_id + klass->ops_count); + + return (func && (func->func == _eo_class_isa_func));; + } + domain = ((Eo_Id)eo_id >> SHIFT_DOMAIN) & MASK_DOMAIN; data = _eo_table_data_get(); tdata = _eo_table_data_table_get(data, domain); @@ -1821,6 +1850,10 @@ err_shared_obj: EINA_COLD eina_lock_release(&(_eo_table_data_shared_data->obj_lock)); return EINA_FALSE; +err_class0: + _EO_POINTER_ERR(eo_id, "Class (%p) is an invalid ref.", eo_id); + return EINA_FALSE; + err_class: EINA_COLD _EO_POINTER_ERR(klass_id, "Class (%p) is an invalid ref.", klass_id); err_obj: @@ -1924,11 +1957,11 @@ efl_unref(const Eo *obj_id) _efl_ref(obj); - if (EINA_UNLIKELY((!obj->unref_compensate) && + if (EINA_UNLIKELY((obj->noref_event) && (!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 + // We need to report efl_ref_count correctly during EFL_EVENT_NOREF, so fake it // by adjusting efl_ref_count while inside efl_unref (This should avoid // infinite loop) obj->unref_compensate = EINA_TRUE; @@ -1936,7 +1969,6 @@ efl_unref(const Eo *obj_id) // 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; } @@ -1959,6 +1991,9 @@ efl_unref(const Eo *obj_id) } _efl_unref(obj); } + + _apply_auto_unref(obj, obj_id); + _efl_unref(obj); EO_OBJ_DONE(obj_id); } @@ -2443,21 +2478,26 @@ EAPI Eina_Bool efl_domain_switch(Efl_Id_Domain domain) { Eo_Id_Data *data = _eo_table_data_get(); + Eo_Id_Data *new_data; if ((domain < EFL_ID_DOMAIN_MAIN) || (domain > EFL_ID_DOMAIN_THREAD) || (domain == EFL_ID_DOMAIN_SHARED)) { ERR("Invalid domain %i being switched to", domain); return EINA_FALSE; } - if (data) + if ((data) && (data->local_domain == domain)) + return EINA_TRUE; + + new_data = _eo_table_data_new(domain); + if (!new_data) { - if (data->local_domain == domain) return EINA_TRUE; - _eo_free_ids_tables(data); + ERR("Could not allocate domain %i table data", domain); + return EINA_FALSE; } - data = _eo_table_data_new(domain); - data->local_domain = domain; - data->domain_stack[data->stack_top] = domain; - eina_tls_set(_eo_table_data, data); + if (data) _eo_free_ids_tables(data); + new_data->local_domain = domain; + new_data->domain_stack[new_data->stack_top] = domain; + eina_tls_set(_eo_table_data, new_data); return EINA_TRUE; } @@ -2574,6 +2614,33 @@ efl_compatible(const Eo *obj, const Eo *obj_target) return EINA_FALSE; } +EAPI Eina_Bool +efl_class_override_register(const Efl_Class *klass, const Efl_Class *override) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(klass, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(override, EINA_FALSE); + EINA_SAFETY_ON_TRUE_RETURN_VAL(!efl_isa(override, klass), EINA_FALSE); + if (!class_overrides) + class_overrides = eina_hash_pointer_new(NULL); + EINA_SAFETY_ON_NULL_RETURN_VAL(class_overrides, EINA_FALSE); + + eina_hash_set(class_overrides, &klass, override); + return EINA_TRUE; +} + +EAPI Eina_Bool +efl_class_override_unregister(const Efl_Class *klass, const Efl_Class *override) +{ + const Efl_Class *set; + EINA_SAFETY_ON_NULL_RETURN_VAL(klass, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(override, EINA_FALSE); + if (!class_overrides) return EINA_TRUE; + + set = eina_hash_find(class_overrides, &klass); + if (set != override) return EINA_FALSE; + return eina_hash_del_by_key(class_overrides, &klass); +} + EAPI Eina_Bool efl_destructed_is(const Eo *obj_id) { @@ -3541,3 +3608,94 @@ static const Eina_Value_Type _EINA_VALUE_TYPE_OBJECT = { }; EOAPI const Eina_Value_Type *EINA_VALUE_TYPE_OBJECT = &_EINA_VALUE_TYPE_OBJECT; + +static const Efl_Object_Property_Reflection* +_efl_class_reflection_find(const _Efl_Class *klass, const char *property_name) +{ + const _Efl_Class **klass_iter = klass->extensions; + const Efl_Object_Property_Reflection_Ops *ref = klass->reflection; + unsigned int i; + + for (i = 0; ref && i < ref->count; ++i) + { + if (eina_streq(property_name, ref->table[i].property_name)) + return &ref->table[i]; + } + + if (klass->parent) + { + const Efl_Object_Property_Reflection *ref; + + ref = _efl_class_reflection_find(klass->parent, property_name); + if (ref) return ref; + } + + for (; *klass_iter; klass_iter++) + { + const Efl_Object_Property_Reflection *ref; + + ref = _efl_class_reflection_find(*klass_iter, property_name); + if (ref) return ref; + } + + return NULL; +} + +EAPI Eina_Error +efl_property_reflection_set(Eo *obj_id, const char *property_name, Eina_Value value) +{ + Eina_Error r = EINA_ERROR_NOT_IMPLEMENTED; + Eina_Bool freed = EINA_FALSE; + + EO_OBJ_POINTER_GOTO(obj_id, obj, end); + const Efl_Object_Property_Reflection *reflection = _efl_class_reflection_find(obj->klass, property_name); + + if (reflection && reflection->set) + { + r = reflection->set(obj_id, value); + freed = EINA_TRUE; + } + + end: + if (!freed) eina_value_flush(&value); + EO_OBJ_DONE(obj_id); + return r; +} + +EAPI Eina_Value +efl_property_reflection_get(const Eo *obj_id, const char *property_name) +{ + Eina_Value r = eina_value_error_init(EINA_ERROR_NOT_IMPLEMENTED); + + EO_OBJ_POINTER_GOTO(obj_id, obj, end); + const Efl_Object_Property_Reflection *reflection = _efl_class_reflection_find(obj->klass, property_name); + + if (reflection && reflection->get) + r = reflection->get(obj_id); + + end: + EO_OBJ_DONE(obj_id); + + return r; +} + +EAPI Eina_Bool +efl_property_reflection_exist(Eo *obj_id, const char *property_name) +{ + Eina_Bool r = EINA_FALSE; + EO_OBJ_POINTER_GOTO(obj_id, obj, end); + const Efl_Object_Property_Reflection *reflection = _efl_class_reflection_find(obj->klass, property_name); + + if (reflection) r = EINA_TRUE; + end: + EO_OBJ_DONE(obj_id); + return r; +} + +EAPI Efl_Class_Type +efl_class_type_get(const Efl_Class *klass_id) +{ + EO_CLASS_POINTER_RETURN_VAL(klass_id, klass, EFL_CLASS_TYPE_INVALID); + + return klass->desc->type; +} diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c index ef3a1ba9a8..2dc5efcec5 100644 --- a/src/lib/eo/eo_base_class.c +++ b/src/lib/eo/eo_base_class.c @@ -13,8 +13,6 @@ #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"); @@ -58,12 +56,10 @@ struct _Efl_Object_Data unsigned int callbacks_count; unsigned short event_freeze_count; -#ifdef EFL_EVENT_SPECIAL_SKIP 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 allow_parent_unref : 1; // Allows unref to zero even with a parent @@ -189,11 +185,6 @@ _efl_invalidate(_Eo_Object *obj) 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) { @@ -688,7 +679,7 @@ efl_del(const Eo *obj) } else { - ERR("Calling efl_del on an object with no parent is not advised any more."); + ERR("Calling efl_del on object %s with no parent is not advised any more.", efl_debug_name_get(obj)); efl_unref(obj); } _efl_unref(oid); @@ -1163,13 +1154,11 @@ _efl_pending_future_new(void) sizeof(Efl_Future_Pending)); } -#ifdef EFL_EVENT_SPECIAL_SKIP - #define CB_COUNT_INC(cnt) do { if ((cnt) != 0xffff) (cnt)++; } while(0) #define CB_COUNT_DEC(cnt) do { if ((cnt) != 0xffff) (cnt)--; } while(0) static inline void -_special_event_count_inc(Efl_Object_Data *pd, const Efl_Callback_Array_Item *it) +_special_event_count_inc(Eo *obj_id, Efl_Object_Data *pd, const Efl_Callback_Array_Item *it) { if (it->desc == EFL_EVENT_CALLBACK_ADD) CB_COUNT_INC(pd->event_cb_efl_event_callback_add_count); @@ -1178,13 +1167,22 @@ _special_event_count_inc(Efl_Object_Data *pd, const Efl_Callback_Array_Item *it) 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); + { + if (pd->event_cb_efl_event_noref_count == 0) + { + EO_OBJ_POINTER_RETURN(obj_id, obj); + obj->noref_event = EINA_TRUE; + EO_OBJ_DONE(obj_id); + } + + 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 -_special_event_count_dec(Efl_Object_Data *pd, const Efl_Callback_Array_Item *it) +_special_event_count_dec(Eo *obj_id, Efl_Object_Data *pd, const Efl_Callback_Array_Item *it) { if (it->desc == EFL_EVENT_CALLBACK_ADD) CB_COUNT_DEC(pd->event_cb_efl_event_callback_add_count); @@ -1193,25 +1191,31 @@ _special_event_count_dec(Efl_Object_Data *pd, const Efl_Callback_Array_Item *it) 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); + { + CB_COUNT_DEC(pd->event_cb_efl_event_noref_count); + + if (pd->event_cb_efl_event_noref_count == 0) + { + EO_OBJ_POINTER_RETURN(obj_id, obj); + obj->noref_event = EINA_FALSE; + EO_OBJ_DONE(obj_id); + } + } } -#endif /* Actually remove, doesn't care about walking list, or delete_me */ static void -_eo_callback_remove(Efl_Object_Data *pd, Eo_Callback_Description **cb) +_eo_callback_remove(Eo *obj, Efl_Object_Data *pd, Eo_Callback_Description **cb) { unsigned int length; -#ifdef EFL_EVENT_SPECIAL_SKIP const Efl_Callback_Array_Item *it; if ((*cb)->func_array) { for (it = (*cb)->items.item_array; it->func; it++) - _special_event_count_dec(pd, it); + _special_event_count_dec(obj, pd, it); } - else _special_event_count_dec(pd, &((*cb)->items.item)); -#endif + else _special_event_count_dec(obj, pd, &((*cb)->items.item)); _eo_callback_free(*cb); @@ -1242,16 +1246,14 @@ _eo_callback_remove_all(Efl_Object_Data *pd) 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 } static void -_eo_callbacks_clear(Efl_Object_Data *pd) +_eo_callbacks_clear(Eo *obj, Efl_Object_Data *pd) { Eo_Callback_Description **itr; unsigned int i = 0; @@ -1285,7 +1287,7 @@ _eo_callbacks_clear(Efl_Object_Data *pd) itr = pd->callbacks + i; if (remove_callbacks && (*itr)->delete_me) { - _eo_callback_remove(pd, itr); + _eo_callback_remove(obj, pd, itr); } else { @@ -1397,9 +1399,7 @@ _efl_object_event_callback_priority_add(Eo *obj, Efl_Object_Data *pd, 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 + _special_event_count_inc(obj, pd, &(cb->items.item)); if (EINA_UNLIKELY(desc == EFL_EVENT_DESTRUCT)) pd->has_destroyed_event_cb = EINA_TRUE; @@ -1428,7 +1428,7 @@ _efl_object_event_callback_clean(Eo *obj, Efl_Object_Data *pd, if (pd->event_frame) pd->need_cleaning = EINA_TRUE; else - _eo_callback_remove(pd, cb); + _eo_callback_remove(obj, pd, cb); efl_event_callback_call(obj, EFL_EVENT_CALLBACK_DEL, (void *)array); } @@ -1505,10 +1505,8 @@ _efl_object_event_callback_array_priority_add(Eo *obj, Efl_Object_Data *pd, if (!!cb->generation) pd->need_cleaning = EINA_TRUE; _eo_callbacks_sorted_insert(pd, cb); -#ifdef EFL_EVENT_SPECIAL_SKIP for (it = cb->items.item_array; it->func; it++) - _special_event_count_inc(pd, it); -#else + _special_event_count_inc(obj, pd, it); if (!pd->has_destroyed_event_cb) { for (it = cb->items.item_array; it->func; it++) @@ -1518,7 +1516,6 @@ _efl_object_event_callback_array_priority_add(Eo *obj, Efl_Object_Data *pd, break; } } -#endif num = 0; for (it = cb->items.item_array; it->func; it++) num++; @@ -1625,7 +1622,6 @@ _event_callback_call(Eo *obj_id, Efl_Object_Data *pd, }; if (pd->callbacks_count == 0) return EINA_FALSE; -#ifdef EFL_EVENT_SPECIAL_SKIP else if ((desc == EFL_EVENT_CALLBACK_ADD) && (pd->event_cb_efl_event_callback_add_count == 0)) return EINA_FALSE; else if ((desc == EFL_EVENT_CALLBACK_DEL) && @@ -1634,7 +1630,6 @@ _event_callback_call(Eo *obj_id, Efl_Object_Data *pd, (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 if (pd->event_frame) frame.generation = ((Efl_Event_Callback_Frame*)pd->event_frame)->generation + 1; @@ -1733,7 +1728,7 @@ end: EVENT_STACK_POP(pd); - _eo_callbacks_clear(pd); + _eo_callbacks_clear(obj_id, pd); pd->callback_stopped = callback_already_stopped; @@ -1855,13 +1850,13 @@ _efl_object_event_freeze_count_get(const Eo *obj EINA_UNUSED, Efl_Object_Data *p } EOLIAN static void -_efl_object_event_global_freeze(Eo *klass EINA_UNUSED, void *pd EINA_UNUSED) +_efl_object_event_global_freeze(void) { event_freeze_count++; } EOLIAN static void -_efl_object_event_global_thaw(Eo *klass EINA_UNUSED, void *pd EINA_UNUSED) +_efl_object_event_global_thaw(void) { if (event_freeze_count > 0) { @@ -1874,7 +1869,7 @@ _efl_object_event_global_thaw(Eo *klass EINA_UNUSED, void *pd EINA_UNUSED) } EOLIAN static int -_efl_object_event_global_freeze_count_get(const Eo *klass EINA_UNUSED, void *pd EINA_UNUSED) +_efl_object_event_global_freeze_count_get(void) { return event_freeze_count; } diff --git a/src/lib/eo/eo_class_class.c b/src/lib/eo/eo_class_class.c index e89b177543..efee21a8f8 100644 --- a/src/lib/eo/eo_class_class.c +++ b/src/lib/eo/eo_class_class.c @@ -5,4 +5,3 @@ #include "Eo.h" #include "efl_class.eo.c" -#include "efl_interface.eo.c" diff --git a/src/lib/eo/eo_internal.h b/src/lib/eo/eo_internal.h index f57d2698d5..9e2980914a 100644 --- a/src/lib/eo/eo_internal.h +++ b/src/lib/eo/eo_internal.h @@ -29,12 +29,30 @@ typedef unsigned char Eina_Bool; typedef struct _Eo_Opaque Eo; +typedef struct _Efl_Event_Description Efl_Event_Description; + +/** + * Don't use this. + * The values of the returned event structure are also internal, don't assume + * anything about them. + * @internal + */ +EAPI const Efl_Event_Description *efl_object_legacy_only_event_description_get(const char *_event_name); 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); +#define EFL_CLASS_SIMPLE_CLASS(FUNC, NAME, ABSTRACT_CLASS) \ +static const Efl_Class_Description FUNC ##_realized_class_desc = { \ + EO_VERSION, \ + NAME "_Realized", \ + EFL_CLASS_TYPE_REGULAR, \ + 0, NULL, NULL, NULL \ +}; \ +EFL_DEFINE_CLASS(FUNC ##_realized_class_get, &FUNC ##_realized_class_desc, ABSTRACT_CLASS, NULL) + #undef EAPI #define EAPI diff --git a/src/lib/eo/eo_private.h b/src/lib/eo/eo_private.h index e42078a1fd..3b046bb302 100644 --- a/src/lib/eo/eo_private.h +++ b/src/lib/eo/eo_private.h @@ -121,6 +121,7 @@ struct _Eo_Object Eina_Bool unref_compensate : 1; Eina_Bool allow_parent_unref : 1; + Eina_Bool noref_event : 1; Eina_Bool del_triggered:1; Eina_Bool destructed:1; Eina_Bool manual_free:1; @@ -184,6 +185,8 @@ struct _Efl_Class const _Efl_Class **mro; + const Efl_Object_Property_Reflection_Ops *reflection; + /* cached object for faster allocation */ struct { Eina_Trash *trash; @@ -387,7 +390,7 @@ _efl_unref_internal(_Eo_Object *obj, const char *func_name, const char *file, in while (obj->xrefs) { Eina_Inlist *nitr = obj->xrefs->next; - Eo_Xref_Node *xref = EINA_INLIST_CONTAINER_GET(obj->data_xrefs, Eo_Xref_Node); + Eo_Xref_Node *xref = EINA_INLIST_CONTAINER_GET(obj->xrefs, Eo_Xref_Node); ERR("in %s:%d: func '%s' Object %p is still referenced by object %p. Origin: %s:%d", file, line, func_name, obj_id, xref->ref_obj, xref->file, xref->line); eina_freeq_ptr_main_add(xref, free, sizeof(*xref)); diff --git a/src/lib/eo/eo_ptr_indirection.h b/src/lib/eo/eo_ptr_indirection.h index 9cde5ba0c2..33dc709d42 100644 --- a/src/lib/eo/eo_ptr_indirection.h +++ b/src/lib/eo/eo_ptr_indirection.h @@ -75,13 +75,13 @@ void _eo_pointer_error(const Eo *obj_id, const char *func_name, const char *file #define EO_CLASS_POINTER_PROXY(klass_id, klass) \ _Efl_Class *klass; \ do { \ - klass = _eo_class_pointer_get(klass_id, func_name, file, line); \ + klass = _eo_class_pointer_get(klass_id); \ } while (0) #define EO_CLASS_POINTER_RETURN_VAL(klass_id, klass, ret) \ _Efl_Class *klass; \ do { \ - klass = _eo_class_pointer_get(klass_id, __FUNCTION__, __FILE__, __LINE__); \ + klass = _eo_class_pointer_get(klass_id); \ if (!klass) { \ _EO_POINTER_ERR(klass_id, "Class (%p) is an invalid ref.", klass_id); \ return ret; \ @@ -91,7 +91,7 @@ void _eo_pointer_error(const Eo *obj_id, const char *func_name, const char *file #define EO_CLASS_POINTER_RETURN_VAL_PROXY(klass_id, klass, ret) \ _Efl_Class *klass; \ do { \ - klass = _eo_class_pointer_get(klass_id, func_name, file, line); \ + klass = _eo_class_pointer_get(klass_id); \ if (!klass) { \ _EO_POINTER_ERR(klass_id, "Class (%p) is an invalid ref.", klass_id); \ return ret; \ @@ -101,7 +101,7 @@ void _eo_pointer_error(const Eo *obj_id, const char *func_name, const char *file #define EO_CLASS_POINTER_RETURN(klass_id, klass) \ _Efl_Class *klass; \ do { \ - klass = _eo_class_pointer_get(klass_id, __FUNCTION__, __FILE__, __LINE__); \ + klass = _eo_class_pointer_get(klass_id); \ if (!klass) { \ _EO_POINTER_ERR(klass_id, "Class (%p) is an invalid ref.", klass_id); \ return; \ @@ -111,7 +111,7 @@ void _eo_pointer_error(const Eo *obj_id, const char *func_name, const char *file #define EO_CLASS_POINTER_RETURN_PROXY(klass_id, klass) \ _Efl_Class *klass; \ do { \ - klass = _eo_class_pointer_get(klass_id, func_name, file, line); \ + klass = _eo_class_pointer_get(klass_id); \ if (!klass) { \ _EO_POINTER_ERR(klass_id, "Class (%p) is an invalid ref.", klass_id); \ return; \ diff --git a/src/lib/eo/meson.build b/src/lib/eo/meson.build index 6647096d6c..abc563ff60 100644 --- a/src/lib/eo/meson.build +++ b/src/lib/eo/meson.build @@ -4,8 +4,7 @@ eo_pub_deps = [eina] pub_eo_files = [ 'efl_object.eo', 'efl_class.eo', - 'efl_object_override.eo', - 'efl_interface.eo' + 'efl_object_override.eo' ] eo_src = [ @@ -51,7 +50,7 @@ eo_lib = library('eo', version : meson.project_version() ) -library('eo_dbg', +eo_lib_dbg = library('eo_dbg', eo_src, pub_eo_file_target, dependencies: [eina, valgrind, dl, execinfo], install: true, @@ -66,10 +65,19 @@ eo = declare_dependency( dependencies: eo_deps + eo_pub_deps, ) -install_data(pub_eo_files + pub_eo_types_files, - install_dir: join_paths(eolian_include_dir, package_version_name) +eo_dbg = declare_dependency( + include_directories: [include_directories('.')], + link_with: eo_lib_dbg, + sources : pub_eo_file_target + priv_eo_file_target, + dependencies: eo_deps + eo_pub_deps, ) +if get_option('install-eo-files') + install_data(pub_eo_files + pub_eo_types_files, + install_dir: join_paths(eolian_include_dir, package_version_name) + ) +endif + install_headers(eo_header, install_dir : dir_package_include, ) diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h index fc28058c6b..c60272ef56 100644 --- a/src/lib/eolian/Eolian.h +++ b/src/lib/eolian/Eolian.h @@ -316,6 +316,9 @@ typedef enum EOLIAN_TYPE_BUILTIN_BOOL, + EOLIAN_TYPE_BUILTIN_SLICE, + EOLIAN_TYPE_BUILTIN_RW_SLICE, + EOLIAN_TYPE_BUILTIN_VOID, EOLIAN_TYPE_BUILTIN_ACCESSOR, @@ -324,8 +327,6 @@ typedef enum EOLIAN_TYPE_BUILTIN_ITERATOR, EOLIAN_TYPE_BUILTIN_HASH, EOLIAN_TYPE_BUILTIN_LIST, - EOLIAN_TYPE_BUILTIN_INARRAY, - EOLIAN_TYPE_BUILTIN_INLIST, EOLIAN_TYPE_BUILTIN_ANY_VALUE, EOLIAN_TYPE_BUILTIN_ANY_VALUE_PTR, @@ -333,6 +334,7 @@ typedef enum EOLIAN_TYPE_BUILTIN_MSTRING, EOLIAN_TYPE_BUILTIN_STRING, EOLIAN_TYPE_BUILTIN_STRINGSHARE, + EOLIAN_TYPE_BUILTIN_STRBUF, EOLIAN_TYPE_BUILTIN_VOID_PTR, EOLIAN_TYPE_BUILTIN_FREE_CB @@ -700,6 +702,19 @@ EAPI const char *eolian_object_short_name_get(const Eolian_Object *obj); */ EAPI Eina_Iterator *eolian_object_namespaces_get(const Eolian_Object *obj); +/* + * @brief Get whether an object is beta. + * + * This applies to toplevel objects (classes, types) as well as some + * others such as functions and events. + * + * @param[in] obj The object. + * @return EINA_TRUE and EINA_FALSE respectively + * + * @ingroup Eolian + */ +EAPI Eina_Bool eolian_object_is_beta(const Eolian_Object *obj); + /* * @brief Scan the given directory for .eo and .eot files. * @@ -1405,16 +1420,6 @@ EAPI Eolian_Class_Type eolian_class_type_get(const Eolian_Class *klass); */ EAPI const Eolian_Documentation *eolian_class_documentation_get(const Eolian_Class *klass); -/* - * @brief Returns the legacy prefix of a class - * - * @param[in] klass the class - * @return the legacy prefix - * - * @ingroup Eolian - */ -EAPI Eina_Stringshare *eolian_class_legacy_prefix_get(const Eolian_Class *klass); - /* * @brief Returns the eo prefix of a class * @@ -1544,22 +1549,20 @@ eolian_function_name_get(const Eolian_Function *fid) * * @param[in] function_id Id of the function * @param[in] ftype The type of function to get the name for - * @param[in] use_legacy If true, legacy prefix or name will be used when available * @return the function name * * It's here because the C API names are deduplicated (prefix of function and * suffix of prefix merge if applicable) and this helps generators not write * the same code over and over. * - * If legacy name is supplied for the given type and use_legacy is set, it - * will be used. Also, if the given type is PROP_GET or PROPERTY, a "_get" - * suffix will be applied when not using legacy name, and "_set" for PROP_SET. + * If the given type is PROP_GET or PROPERTY, a "_get" suffix will be applied, + * and "_set" for PROP_SET. * * Also, you're responsible for deleting the stringshare. * * @ingroup Eolian */ -EAPI Eina_Stringshare *eolian_function_full_c_name_get(const Eolian_Function *function_id, Eolian_Function_Type ftype, Eina_Bool use_legacy); +EAPI Eina_Stringshare *eolian_function_full_c_name_get(const Eolian_Function *function_id, Eolian_Function_Type ftype); /* * @brief Get a function in a class by its name and type @@ -1577,19 +1580,6 @@ EAPI Eina_Stringshare *eolian_function_full_c_name_get(const Eolian_Function *fu */ 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. - * - * @param[in] function_id Id of the function - * @param[in] f_type The function type, for property get/set distinction. - * @return the legacy name or NULL. - * - * Acceptable input types are METHOD, PROP_GET and PROP_SET. - * - * @ingroup Eolian - */ -EAPI Eina_Stringshare *eolian_function_legacy_get(const Eolian_Function *function_id, Eolian_Function_Type f_type); - /* * @brief Returns the implement for a function. * @@ -1600,19 +1590,6 @@ EAPI Eina_Stringshare *eolian_function_legacy_get(const Eolian_Function *functio */ EAPI const Eolian_Implement *eolian_function_implement_get(const Eolian_Function *function_id); -/* - * @brief Indicates if a function is legacy only. - * - * @param[in] function_id Id of the function - * @param[in] f_type The function type, for property get/set distinction. - * @return EINA_TRUE if legacy only, EINA_FALSE otherwise. - * - * Acceptable input types are METHOD, PROP_GET and PROP_SET. - * - * @ingroup Eolian - */ -EAPI Eina_Bool eolian_function_is_legacy_only(const Eolian_Function *function_id, Eolian_Function_Type ftype); - /* * @brief Get whether a function is a class method/property. * @@ -1626,12 +1603,15 @@ EAPI Eina_Bool eolian_function_is_class(const Eolian_Function *function_id); /* * @brief Get whether a function is beta. * - * @param[in] function_id Id of the function - * @return EINA_TRUE and EINA_FALSE respectively + * @see eolian_object_is_beta * * @ingroup Eolian */ -EAPI Eina_Bool eolian_function_is_beta(const Eolian_Function *function_id); +static inline Eina_Bool +eolian_function_is_beta(const Eolian_Function *function_id) +{ + return eolian_object_is_beta(EOLIAN_OBJECT(function_id)); +} /* * @brief Indicates if a function is a constructing function of a given class. @@ -2131,12 +2111,15 @@ EAPI Eolian_Object_Scope eolian_event_scope_get(const Eolian_Event *event); /* * @brief Get whether an event is beta. * - * @param[in] event the event handle - * @return EINA_TRUE and EINA_FALSE respectively + * @see eolian_object_is_beta * * @ingroup Eolian */ -EAPI Eina_Bool eolian_event_is_beta(const Eolian_Event *event); +static inline Eina_Bool +eolian_event_is_beta(const Eolian_Event *event) +{ + return eolian_object_is_beta(EOLIAN_OBJECT(event)); +} /* * @brief Get whether an event is hot (unfreezable). @@ -2298,6 +2281,19 @@ 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 whether a class is beta. + * + * @see eolian_object_is_beta + * + * @ingroup Eolian + */ +static inline Eina_Bool +eolian_class_is_beta(const Eolian_Class *klass) +{ + return eolian_object_is_beta(EOLIAN_OBJECT(klass)); +} + /* * @brief Get the type of a type declaration. * @@ -2493,6 +2489,19 @@ EAPI const Eolian_Type *eolian_typedecl_aliased_base_get(const Eolian_Typedecl * */ EAPI Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp); +/* + * @brief Get whether a typedecl is beta. + * + * @see eolian_object_is_beta + * + * @ingroup Eolian + */ +static inline Eina_Bool +eolian_typedecl_is_beta(const Eolian_Typedecl *tp) +{ + return eolian_object_is_beta(EOLIAN_OBJECT(tp)); +} + /* * @brief Get the full C type name of the given type. * @@ -2557,7 +2566,7 @@ eolian_typedecl_namespaces_get(const Eolian_Typedecl *tp) EAPI Eina_Stringshare *eolian_typedecl_free_func_get(const Eolian_Typedecl *tp); /* - * @breif Get the function object for this function pointer type. + * @brief Get the function object for this function pointer type. * * @param[in] tp the type. * @return the function or NULL; @@ -2994,6 +3003,19 @@ eolian_variable_namespaces_get(const Eolian_Variable *tp) */ EAPI Eina_Bool eolian_variable_is_extern(const Eolian_Variable *var); +/* + * @brief Get whether a variable is beta. + * + * @see eolian_object_is_beta + * + * @ingroup Eolian + */ +static inline Eina_Bool +eolian_variable_is_beta(const Eolian_Variable *var) +{ + return eolian_object_is_beta(EOLIAN_OBJECT(var)); +} + /* * @brief Get the summary of the documentation. * diff --git a/src/lib/eolian/Eolian_Aux.h b/src/lib/eolian/Eolian_Aux.h index 4313d49d6d..a3c90fe744 100644 --- a/src/lib/eolian/Eolian_Aux.h +++ b/src/lib/eolian/Eolian_Aux.h @@ -105,7 +105,7 @@ EAPI size_t eolian_aux_class_callables_get(const Eolian_Class *klass, Eina_List /** * @brief Get all implementations of a function in a state. * - * Given a function and a childen hierarchy from + * Given a function and a children hierarchy from * eolian_aux_state_class_children_find(), this will func * all implementations of that function in the system. This * is useful for various utilities. You need to free the list diff --git a/src/lib/eolian/database_check.c b/src/lib/eolian/database_check.c index 61afa6e281..4e448cea7a 100644 --- a/src/lib/eolian/database_check.c +++ b/src/lib/eolian/database_check.c @@ -125,6 +125,11 @@ _check_class(const Eolian_Class *cl, Eina_Hash *depset, Eina_Hash *chash) _add_dep(depset, icl->base.unit); eina_iterator_free(itr); + itr = eina_list_iterator_new(cl->requires); + 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) diff --git a/src/lib/eolian/database_class.c b/src/lib/eolian/database_class.c index bbe398ed0b..34551d3c80 100644 --- a/src/lib/eolian/database_class.c +++ b/src/lib/eolian/database_class.c @@ -31,8 +31,8 @@ database_class_del(Eolian_Class *cl) EINA_LIST_FREE(cl->parts, pt) database_part_del(pt); eina_list_free(cl->requires); eina_list_free(cl->callables); + eina_list_free(cl->composite); - 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); if (cl->data_type) eina_stringshare_del(cl->data_type); diff --git a/src/lib/eolian/database_class_api.c b/src/lib/eolian/database_class_api.c index f79cdb800b..fa7d36b541 100644 --- a/src/lib/eolian/database_class_api.c +++ b/src/lib/eolian/database_class_api.c @@ -20,13 +20,6 @@ eolian_class_documentation_get(const Eolian_Class *cl) return cl->doc; } -EAPI Eina_Stringshare* -eolian_class_legacy_prefix_get(const Eolian_Class *cl) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(cl, NULL); - return cl->legacy_prefix; -} - EAPI Eina_Stringshare* eolian_class_eo_prefix_get(const Eolian_Class *cl) { diff --git a/src/lib/eolian/database_event_api.c b/src/lib/eolian/database_event_api.c index 97c8df8b9c..74f69cd411 100644 --- a/src/lib/eolian/database_event_api.c +++ b/src/lib/eolian/database_event_api.c @@ -35,13 +35,6 @@ eolian_event_scope_get(const Eolian_Event *event) return event->scope; } -EAPI Eina_Bool -eolian_event_is_beta(const Eolian_Event *event) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(event, EINA_FALSE); - return event->is_beta; -} - EAPI Eina_Bool eolian_event_is_hot(const Eolian_Event *event) { diff --git a/src/lib/eolian/database_function.c b/src/lib/eolian/database_function.c index 15187e93d7..c3b45d3954 100644 --- a/src/lib/eolian/database_function.c +++ b/src/lib/eolian/database_function.c @@ -25,8 +25,6 @@ database_function_del(Eolian_Function *fid) database_type_del(fid->set_ret_type); database_expr_del(fid->get_ret_val); database_expr_del(fid->set_ret_val); - if (fid->get_legacy) eina_stringshare_del(fid->get_legacy); - if (fid->set_legacy) eina_stringshare_del(fid->set_legacy); database_doc_del(fid->get_return_doc); database_doc_del(fid->set_return_doc); free(fid); diff --git a/src/lib/eolian/database_function_api.c b/src/lib/eolian/database_function_api.c index 05e7bf9e51..8a38443359 100644 --- a/src/lib/eolian/database_function_api.c +++ b/src/lib/eolian/database_function_api.c @@ -38,12 +38,10 @@ eolian_function_type_get(const Eolian_Function *fid) } static const char * -_get_eo_prefix(const Eolian_Function *foo_id, char *buf, Eina_Bool use_legacy) +_get_eo_prefix(const Eolian_Function *foo_id, char *buf) { char *tmp = buf; - if (use_legacy) - return foo_id->klass->legacy_prefix; - else if (foo_id->klass->eo_prefix) + if (foo_id->klass->eo_prefix) return foo_id->klass->eo_prefix; strcpy(buf, foo_id->klass->base.name); eina_str_tolower(&buf); @@ -86,36 +84,11 @@ _get_abbreviated_name(const char *prefix, const char *fname) EAPI Eina_Stringshare * eolian_function_full_c_name_get(const Eolian_Function *foo_id, - Eolian_Function_Type ftype, - Eina_Bool use_legacy) + Eolian_Function_Type ftype) { - switch (ftype) - { - case EOLIAN_UNRESOLVED: - case EOLIAN_METHOD: - case EOLIAN_PROPERTY: - case EOLIAN_PROP_GET: - case EOLIAN_FUNCTION_POINTER: - if (foo_id->get_legacy && use_legacy) - { - if (!strcmp(foo_id->get_legacy, "null")) - return NULL; - return eina_stringshare_ref(foo_id->get_legacy); - } - break; - case EOLIAN_PROP_SET: - if (foo_id->set_legacy && use_legacy) - { - if (!strcmp(foo_id->set_legacy, "null")) - return NULL; - return eina_stringshare_ref(foo_id->set_legacy); - } - break; - } - char tbuf[512]; tbuf[0] = '\0'; - const char *prefix = (ftype != EOLIAN_FUNCTION_POINTER) ? _get_eo_prefix(foo_id, tbuf, use_legacy): tbuf; + const char *prefix = (ftype != EOLIAN_FUNCTION_POINTER) ? _get_eo_prefix(foo_id, tbuf): tbuf; if (!prefix) return NULL; @@ -124,22 +97,6 @@ eolian_function_full_c_name_get(const Eolian_Function *foo_id, Eina_Strbuf *buf = eina_strbuf_new(); Eina_Stringshare *ret; - if (use_legacy) - { - eina_strbuf_append(buf, prefix); - eina_strbuf_append_char(buf, '_'); - eina_strbuf_append(buf, funcn); - - if ((ftype == EOLIAN_PROP_GET) || (ftype == EOLIAN_PROPERTY)) - eina_strbuf_append(buf, "_get"); - else if (ftype == EOLIAN_PROP_SET) - eina_strbuf_append(buf, "_set"); - - ret = eina_stringshare_add(eina_strbuf_string_get(buf)); - eina_strbuf_free(buf); - return ret; - } - char *abbr = _get_abbreviated_name(prefix, funcn); eina_strbuf_append(buf, abbr); free(abbr); @@ -154,31 +111,6 @@ eolian_function_full_c_name_get(const Eolian_Function *foo_id, return ret; } -EAPI Eina_Stringshare * -eolian_function_legacy_get(const Eolian_Function *fid, Eolian_Function_Type ftype) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL); - EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_UNRESOLVED, NULL); - EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_PROPERTY, NULL); - switch (ftype) - { - case EOLIAN_METHOD: - if (fid->type != EOLIAN_METHOD) - return NULL; - return fid->get_legacy; - case EOLIAN_PROP_GET: - if ((fid->type != EOLIAN_PROP_GET) && (fid->type != EOLIAN_PROPERTY)) - return NULL; - return fid->get_legacy; - case EOLIAN_PROP_SET: - if ((fid->type != EOLIAN_PROP_SET) && (fid->type != EOLIAN_PROPERTY)) - return NULL; - return fid->set_legacy; - default: - return NULL; - } -} - EAPI const Eolian_Implement * eolian_function_implement_get(const Eolian_Function *fid) { @@ -186,31 +118,6 @@ eolian_function_implement_get(const Eolian_Function *fid) return fid->impl; } -EAPI Eina_Bool -eolian_function_is_legacy_only(const Eolian_Function *fid, Eolian_Function_Type ftype) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE); - EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_UNRESOLVED, EINA_FALSE); - EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_PROPERTY, EINA_FALSE); - switch (ftype) - { - case EOLIAN_METHOD: - if (fid->type != EOLIAN_METHOD) - return EINA_FALSE; - return fid->get_only_legacy; - case EOLIAN_PROP_GET: - if ((fid->type != EOLIAN_PROP_GET) && (fid->type != EOLIAN_PROPERTY)) - return EINA_FALSE; - return fid->get_only_legacy; - case EOLIAN_PROP_SET: - if ((fid->type != EOLIAN_PROP_SET) && (fid->type != EOLIAN_PROPERTY)) - return EINA_FALSE; - return fid->set_only_legacy; - default: - return EINA_FALSE; - } -} - EAPI Eina_Bool eolian_function_is_class(const Eolian_Function *fid) { @@ -394,10 +301,3 @@ eolian_function_class_get(const Eolian_Function *fid) EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL); return fid->klass; } - -EAPI Eina_Bool -eolian_function_is_beta(const Eolian_Function *fid) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE); - return fid->is_beta; -} diff --git a/src/lib/eolian/database_type.c b/src/lib/eolian/database_type.c index 31517d6487..529617e348 100644 --- a/src/lib/eolian/database_type.c +++ b/src/lib/eolian/database_type.c @@ -26,7 +26,6 @@ database_typedecl_del(Eolian_Typedecl *tp) database_type_del(tp->base_type); if (tp->fields) eina_hash_free(tp->fields); if (tp->field_list) eina_list_free(tp->field_list); - if (tp->legacy) eina_stringshare_del(tp->legacy); if (tp->freefunc) eina_stringshare_del(tp->freefunc); database_doc_del(tp->doc); free(tp); @@ -46,8 +45,9 @@ void database_struct_add(Eolian_Unit *unit, Eolian_Typedecl *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)); + Eina_Hash *sh = unit->state->staging.structs_f; + eina_hash_set(sh, tp->base.file, eina_list_append + ((Eina_List*)eina_hash_find(sh, tp->base.file), tp)); database_object_add(unit, &tp->base); } diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c index 2a4c646647..d9ca18a755 100644 --- a/src/lib/eolian/database_validate.c +++ b/src/lib/eolian/database_validate.c @@ -11,10 +11,25 @@ typedef struct _Validate_State { Eina_Bool warned; - Eina_Bool event_redef; + Eina_Bool stable; Eina_Bool unimplemented; } Validate_State; +static Eina_Bool +_set_stable(Validate_State *vals, Eina_Bool newval) +{ + Eina_Bool ret = vals->stable; + vals->stable = newval; + return ret; +} + +static Eina_Bool +_reset_stable(Validate_State *vals, Eina_Bool oldval, Eina_Bool ret) +{ + vals->stable = oldval; + return ret; +} + static Eina_Bool _validate(Eolian_Object *obj) { @@ -133,13 +148,6 @@ _ef_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, return sc->succ; } -static Eina_Bool -_obj_error(const Eolian_Object *o, const char *msg) -{ - eolian_state_log_obj(o->unit->state, o, "%s", msg); - return EINA_FALSE; -} - static Eina_Bool _validate_typedecl(Validate_State *vals, Eolian_Typedecl *tp) { @@ -149,39 +157,48 @@ _validate_typedecl(Validate_State *vals, Eolian_Typedecl *tp) if (!_validate_doc(tp->doc)) return EINA_FALSE; + /* for the time being assume all typedecls are beta unless overridden */ + Eina_Bool was_stable = _set_stable(vals, !tp->base.is_beta); + switch (tp->type) { case EOLIAN_TYPEDECL_ALIAS: if (!_validate_type(vals, tp->base_type)) - return EINA_FALSE; + return _reset_stable(vals, was_stable, EINA_FALSE); if (!tp->freefunc && tp->base_type->freefunc) tp->freefunc = eina_stringshare_ref(tp->base_type->freefunc); + _reset_stable(vals, was_stable, EINA_TRUE); return _validate(&tp->base); case EOLIAN_TYPEDECL_STRUCT: { Cb_Ret rt = { vals, EINA_TRUE }; eina_hash_foreach(tp->fields, (Eina_Hash_Foreach)_sf_map_cb, &rt); if (!rt.succ) - return EINA_FALSE; + return _reset_stable(vals, was_stable, EINA_FALSE); + _reset_stable(vals, was_stable, EINA_TRUE); return _validate(&tp->base); } case EOLIAN_TYPEDECL_STRUCT_OPAQUE: + _reset_stable(vals, was_stable, EINA_TRUE); return _validate(&tp->base); case EOLIAN_TYPEDECL_ENUM: { 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 _reset_stable(vals, was_stable, EINA_FALSE); + _reset_stable(vals, was_stable, EINA_TRUE); return _validate(&tp->base); } case EOLIAN_TYPEDECL_FUNCTION_POINTER: if (!_validate_function(vals, tp->function_pointer, NULL)) - return EINA_FALSE; + return _reset_stable(vals, was_stable, EINA_FALSE); + _reset_stable(vals, was_stable, EINA_TRUE); return _validate(&tp->base); default: - return EINA_FALSE; + return _reset_stable(vals, was_stable, EINA_FALSE); } + _reset_stable(vals, was_stable, EINA_TRUE); return _validate(&tp->base); } @@ -189,7 +206,7 @@ static const char * const eo_complex_frees[] = { "eina_accessor_free", "eina_array_free", "(void)", /* future */ "eina_iterator_free", "eina_hash_free", - "eina_list_free", "eina_inarray_free", "(void)" + "eina_list_free" }; static const char *eo_obj_free = "efl_del"; @@ -198,26 +215,39 @@ static const char *eo_strshare_free = "eina_stringshare_del"; static const char *eo_value_free = "eina_value_flush"; static const char *eo_value_ptr_free = "eina_value_free"; +static Eina_Bool +_validate_ownable(Eolian_Type *tp) +{ + if (tp->btype == EOLIAN_TYPE_BUILTIN_FUTURE) + return EINA_TRUE; + if (tp->owned && !tp->freefunc) + { + _eo_parser_log(&tp->base, "type '%s' is not ownable", tp->base.name); + return EINA_FALSE; + } + return _validate(&tp->base); +} + static Eina_Bool _validate_type(Validate_State *vals, Eolian_Type *tp) { const Eolian_Unit *src = tp->base.unit; - char buf[256]; if (tp->owned && !database_type_is_ownable(src, tp, EINA_FALSE)) { - snprintf(buf, sizeof(buf), "type '%s' is not ownable", tp->base.name); - return _obj_error(&tp->base, buf); + _eo_parser_log(&tp->base, "type '%s' is not ownable", tp->base.name); + return EINA_FALSE; } - if (tp->is_ptr && !tp->legacy) + if (tp->is_ptr) { tp->is_ptr = EINA_FALSE; Eina_Bool still_ownable = database_type_is_ownable(src, tp, EINA_FALSE); tp->is_ptr = EINA_TRUE; if (still_ownable) { - return _obj_error(&tp->base, "cannot take a pointer to pointer type"); + _eo_parser_log(&tp->base, "cannot take a pointer to pointer type"); + return EINA_FALSE; } } @@ -225,13 +255,13 @@ _validate_type(Validate_State *vals, Eolian_Type *tp) { case EOLIAN_TYPE_VOID: case EOLIAN_TYPE_UNDEFINED: - return _validate(&tp->base); + return _validate_ownable(tp); case EOLIAN_TYPE_REGULAR: { if (tp->base_type) { int kwid = eo_lexer_keyword_str_to_id(tp->base.name); - if (!tp->freefunc) + if (!tp->freefunc && kwid > KW_void) { tp->freefunc = eina_stringshare_add(eo_complex_frees[ kwid - KW_accessor]); @@ -246,15 +276,15 @@ _validate_type(Validate_State *vals, Eolian_Type *tp) { if (!database_type_is_ownable(src, itp, EINA_TRUE)) { - snprintf(buf, sizeof(buf), + _eo_parser_log(&itp->base, "%s cannot contain value types (%s)", tp->base.name, itp->base.name); - return _obj_error(&itp->base, buf); + return EINA_FALSE; } } itp = itp->next_type; } - return _validate(&tp->base); + return _validate_ownable(tp); } /* builtins */ int id = eo_lexer_keyword_str_to_id(tp->base.name); @@ -280,38 +310,51 @@ _validate_type(Validate_State *vals, Eolian_Type *tp) default: break; } - return _validate(&tp->base); + return _validate_ownable(tp); } /* user defined */ tp->tdecl = database_type_decl_find(src, tp); if (!tp->tdecl) { - snprintf(buf, sizeof(buf), "undefined type %s", tp->base.name); - return _obj_error(&tp->base, buf); + _eo_parser_log(&tp->base, "undefined type %s", tp->base.name); + return EINA_FALSE; + } + else if (vals->stable && tp->tdecl->base.is_beta) + { + /* we should enable this by default, but can't for now */ + _eo_parser_log(&tp->base, "beta type declaration '%s' used in stable context", + tp->tdecl->base.name); + return EINA_FALSE; } if (!_validate_typedecl(vals, tp->tdecl)) return EINA_FALSE; if (tp->tdecl->freefunc && !tp->freefunc) tp->freefunc = eina_stringshare_ref(tp->tdecl->freefunc); - return _validate(&tp->base); + return _validate_ownable(tp); } case EOLIAN_TYPE_CLASS: { tp->klass = (Eolian_Class *)eolian_unit_class_by_name_get(src, tp->base.name); if (!tp->klass) { - snprintf(buf, sizeof(buf), "undefined class %s " + _eo_parser_log(&tp->base, "undefined class %s " "(likely wrong namespacing)", tp->base.name); - return _obj_error(&tp->base, buf); + return EINA_FALSE; + } + else if (vals->stable && tp->klass->base.is_beta) + { + _eo_parser_log(&tp->base, "beta class '%s' used in stable context", + tp->klass->base.name); + return EINA_FALSE; } if (!tp->freefunc) tp->freefunc = eina_stringshare_add(eo_obj_free); - return _validate(&tp->base); + return _validate_ownable(tp); } default: return EINA_FALSE; } - return _validate(&tp->base); + return _validate_ownable(tp); } static Eina_Bool @@ -350,16 +393,14 @@ _validate_function(Validate_State *vals, Eolian_Function *func, Eina_Hash *nhash { Eina_List *l; Eolian_Function_Parameter *param; - char buf[512]; const Eolian_Object *oobj = nhash ? eina_hash_find(nhash, &func->base.name) : NULL; if (EINA_UNLIKELY(oobj && (oobj != &func->base))) { - snprintf(buf, sizeof(buf), + _eo_parser_log(&func->base, "%sfunction '%s' conflicts with another symbol (at %s:%d:%d)", - func->is_beta ? "beta " : "", func->base.name, oobj->file, + func->base.is_beta ? "beta " : "", func->base.name, oobj->file, oobj->line, oobj->column); - _obj_error(&func->base, buf); vals->warned = EINA_TRUE; } @@ -374,24 +415,27 @@ _validate_function(Validate_State *vals, Eolian_Function *func, Eina_Hash *nhash return EINA_TRUE; } + /* need to preserve stable flag set from the class */ + Eina_Bool was_stable = _set_stable(vals, !func->base.is_beta && vals->stable); + if (func->get_ret_type && !_validate_type(vals, func->get_ret_type)) - return EINA_FALSE; + return _reset_stable(vals, was_stable, EINA_FALSE); if (func->set_ret_type && !_validate_type(vals, func->set_ret_type)) - return EINA_FALSE; + return _reset_stable(vals, was_stable, EINA_FALSE); if (func->get_ret_val && !_validate_expr(func->get_ret_val, func->get_ret_type, 0)) - return EINA_FALSE; + return _reset_stable(vals, was_stable, EINA_FALSE); if (func->set_ret_val && !_validate_expr(func->set_ret_val, func->set_ret_type, 0)) - return EINA_FALSE; + return _reset_stable(vals, was_stable, EINA_FALSE); #define EOLIAN_PARAMS_VALIDATE(params) \ EINA_LIST_FOREACH(params, l, param) \ if (!_validate_param(vals, param)) \ - return EINA_FALSE; + return _reset_stable(vals, was_stable, EINA_FALSE); EOLIAN_PARAMS_VALIDATE(func->prop_values); EOLIAN_PARAMS_VALIDATE(func->prop_values_get); @@ -403,28 +447,28 @@ _validate_function(Validate_State *vals, Eolian_Function *func, Eina_Hash *nhash #undef EOLIAN_PARAMS_VALIDATE if (!_validate_doc(func->get_return_doc)) - return EINA_FALSE; + return _reset_stable(vals, was_stable, EINA_FALSE); if (!_validate_doc(func->set_return_doc)) - return EINA_FALSE; + return _reset_stable(vals, was_stable, EINA_FALSE); /* just for now, when dups become errors there will be no need to check */ if (!oobj && nhash) eina_hash_add(nhash, &func->base.name, &func->base); + _reset_stable(vals, was_stable, EINA_TRUE); return _validate(&func->base); } static Eina_Bool -_validate_part(Eolian_Part *part, Eina_Hash *nhash) +_validate_part(Validate_State *vals, Eolian_Part *part, Eina_Hash *nhash) { const Eolian_Object *oobj = eina_hash_find(nhash, &part->base.name); if (oobj) { - char buf[512]; - snprintf(buf, sizeof(buf), + _eo_parser_log(&part->base, "part '%s' conflicts with another symbol (at %s:%d:%d)", part->base.name, oobj->file, oobj->line, oobj->column); - _obj_error(&part->base, buf); + vals->warned = EINA_TRUE; } /* see _validate_function above */ @@ -442,10 +486,8 @@ _validate_part(Eolian_Part *part, Eina_Hash *nhash) 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?)", + _eo_parser_log(&part->base, "unknown part class '%s' (incorrect case?)", part->klass_name); - _obj_error(&part->base, buf); return EINA_FALSE; } eina_stringshare_del(part->klass_name); @@ -460,38 +502,94 @@ _validate_part(Eolian_Part *part, Eina_Hash *nhash) static Eina_Bool _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)) { - oobj = eina_hash_find(nhash, &event->base.name); - if (EINA_UNLIKELY(!!oobj)) - { - snprintf(buf, sizeof(buf), - "event '%s' conflicts with another event (at %s:%d:%d)", - event->base.name, oobj->file, oobj->line, oobj->column); - _obj_error(&event->base, buf); - vals->warned = EINA_TRUE; - } + _eo_parser_log(&event->base, + "event '%s' conflicts with another event (at %s:%d:%d)", + event->base.name, oobj->file, oobj->line, oobj->column); + vals->warned = EINA_TRUE; } if (event->base.validated) { - if (vals->event_redef && !oobj) - eina_hash_add(nhash, &event->base.name, &event->base); + eina_hash_set(nhash, &event->base.name, &event->base); return EINA_TRUE; } + Eina_Bool was_stable = _set_stable(vals, !event->base.is_beta && vals->stable); + if (!_validate_type(vals, event->type)) - return EINA_FALSE; + return _reset_stable(vals, was_stable, EINA_FALSE); + + /* if this is an alias we need the lowest type in the stack, this is + * after validation so all the necessary fields are properly filled in + */ + const Eolian_Type *tp = eolian_type_aliased_base_get(event->type); + + /* event types are specially restricted + * but stuff like pointer-to-pointer is alrady handled by _validate_type + */ + if (tp->type == EOLIAN_TYPE_REGULAR && vals->stable) + { + /* explicit pointers never allowed */ + if (tp->is_ptr) + { + _eo_parser_log(&tp->base, "pointers not allowed in events"); + return _reset_stable(vals, was_stable, EINA_FALSE); + } + /* require containers to be const for now... + * + * this is FIXME, and decision wasn't reached before 1.22 + * it is a simple search-replace anyway + */ + if (database_type_is_ownable(tp->base.unit, tp, EINA_FALSE)) + { + if (!tp->is_const) + { + _eo_parser_log(&tp->base, "event container types must be const"); + return _reset_stable(vals, was_stable, EINA_FALSE); + } + } + else if (tp->is_const) + { + _eo_parser_log(&tp->base, "event value types cannot be const"); + return _reset_stable(vals, was_stable, EINA_FALSE); + } + int kwid = eo_lexer_keyword_str_to_id(tp->base.name); + /* containers are allowed but not iterators/lists */ + if (kwid == KW_iterator || kwid == KW_list) + { + _eo_parser_log(&tp->base, "sequence containers not allowed in events"); + return _reset_stable(vals, was_stable, EINA_FALSE); + } + /* rw slices are not allowed as regular types are always immutable */ + if (kwid == KW_rw_slice) + { + _eo_parser_log(&tp->base, "mutable slices not allowed in events"); + return _reset_stable(vals, was_stable, EINA_FALSE); + } + /* any type past builtin value types and containers is not allowed, + * any_value is allowed but passed as const reference, any_value_ptr + * is not; string is allowed, but mutable strings or stringshares are + * not and neither are string buffers, the type is never owned by the + * callee, so all strings passed in are unowned and read-only + */ + if (kwid >= KW_any_value_ptr && kwid != KW_string) + { + _eo_parser_log(&tp->base, "forbidden event type"); + return _reset_stable(vals, was_stable, EINA_FALSE); + } + } if (!_validate_doc(event->doc)) - return EINA_FALSE; + return _reset_stable(vals, was_stable, EINA_FALSE); - if (vals->event_redef && !oobj) - eina_hash_add(nhash, &event->base.name, &event->base); + eina_hash_set(nhash, &event->base.name, &event->base); + _reset_stable(vals, was_stable, EINA_TRUE); return _validate(&event->base); } @@ -715,8 +813,14 @@ _db_fill_callables(Eolian_Class *cl, Eolian_Class *icl, Eina_Hash *fs, Eina_Bool EINA_LIST_FOREACH(icl->callables, l, impl) { Impl_Status ost = (Impl_Status)eina_hash_find(fs, &impl->foo_id); - Eina_Bool extd = _extend_impl(fs, impl, !allow_impl); - if (extd) + /* while regular classes are already fully checked and one may + * assume that we could just make everything coming from regular + * classes IMPL_STATUS_FULL, we still need to account for all of + * the callables of the regular class, as the full implementation + * may come from somewhere deeper in the inheritance tree and we + * may not reach it first, so follow the same logic for all + */ + if (_extend_impl(fs, impl, !allow_impl)) { /* we had an unimplementation in the list, replace * instead of appending the new thing to callables @@ -739,7 +843,8 @@ _db_fill_callables(Eolian_Class *cl, Eolian_Class *icl, Eina_Hash *fs, Eina_Bool } static Eina_Bool -_db_check_implemented(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fs) +_db_check_implemented(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fs, + Eina_Hash *cs, Eina_Hash *errh) { if (cl->type != EOLIAN_CLASS_REGULAR) return EINA_TRUE; @@ -753,8 +858,19 @@ _db_check_implemented(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fs) Eolian_Implement *impl; EINA_LIST_FOREACH(cl->callables, l, impl) { - Impl_Status st = (Impl_Status)eina_hash_find(fs, &impl->foo_id); const Eolian_Function *fid = impl->foo_id; + Impl_Status st = (Impl_Status)eina_hash_find(fs, &fid); + /* found an interface this func was originally defined in in the + * composite list; in that case, ignore it and assume it will come + * from a composite object later + */ + if (eina_hash_find(cs, &fid->klass)) + continue; + /* the error on this impl has already happened, which means it came + * from another regular class; reduce verbosity by not repeating it + */ + if (eina_hash_find(errh, &impl)) + continue; switch (st) { case IMPL_STATUS_NONE: @@ -762,6 +878,7 @@ _db_check_implemented(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fs) &cl->base, "unimplemented function '%s' (originally defined at %s:%d:%d)", fid->base.name, fid->base.file, fid->base.line, fid->base.column); succ = EINA_FALSE; + eina_hash_set(errh, &impl, impl); continue; case IMPL_STATUS_GET: case IMPL_STATUS_SET: @@ -769,6 +886,7 @@ _db_check_implemented(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fs) &cl->base, "partially implemented function '%s' (originally defined at %s:%d:%d)", fid->base.name, fid->base.file, fid->base.line, fid->base.column); succ = EINA_FALSE; + eina_hash_set(errh, &impl, impl); continue; case IMPL_STATUS_FULL: continue; @@ -880,7 +998,7 @@ end: static Eina_Bool _db_swap_inherit(Eolian_Class *cl, Eina_Bool succ, Eina_Stringshare *in_cl, - Eolian_Class **out_cl) + Eolian_Class **out_cl, Eina_Bool iface_only) { if (!succ) { @@ -891,9 +1009,19 @@ _db_swap_inherit(Eolian_Class *cl, Eina_Bool succ, Eina_Stringshare *in_cl, if (!icl) { succ = EINA_FALSE; - char buf[PATH_MAX]; - snprintf(buf, sizeof(buf), "unknown inherit '%s' (incorrect case?)", in_cl); - _obj_error(&cl->base, buf); + _eo_parser_log(&cl->base, "unknown inherit '%s' (incorrect case?)", in_cl); + } + else if (iface_only && (icl->type != EOLIAN_CLASS_INTERFACE)) + { + succ = EINA_FALSE; + _eo_parser_log(&cl->base, "non-interface class '%s' in composite list", icl->base.name); + } + else if (iface_only && !_get_impl_class(cl, icl->base.name)) + { + /* TODO: optimize check using a lookup hash later */ + succ = EINA_FALSE; + _eo_parser_log(&cl->base, "interface '%s' not found within the inheritance tree of '%s'", + icl->base.name, cl->base.name); } else *out_cl = icl; @@ -901,8 +1029,27 @@ _db_swap_inherit(Eolian_Class *cl, Eina_Bool succ, Eina_Stringshare *in_cl, return succ; } +/* this is so we can inherit composite lists into regular classes + * it doesn't need to be recursive since the parent/extension already + * has its composite stuff filled in from before + */ +static void +_add_composite(Eolian_Class *cl, const Eolian_Class *icl, Eina_Hash *ch) +{ + const Eolian_Class *ccl; + Eina_List *l; + EINA_LIST_FOREACH(icl->composite, l, ccl) + { + if (eina_hash_find(ch, &ccl)) + continue; + cl->composite = eina_list_append(cl->composite, ccl); + eina_hash_add(ch, &ccl, ccl); + } +} + static Eina_Bool -_db_fill_inherits(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fhash) +_db_fill_inherits(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fhash, + Eina_Hash *errh) { if (eina_hash_find(fhash, &cl->base.name)) return EINA_TRUE; @@ -919,25 +1066,25 @@ _db_fill_inherits(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fhash) if (cl->parent_name) { - succ = _db_swap_inherit(cl, succ, cl->parent_name, &cl->parent); + succ = _db_swap_inherit(cl, succ, cl->parent_name, &cl->parent, EINA_FALSE); if (succ) { /* 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 */ - succ = _db_fill_inherits(vals, cl->parent, fhash); + succ = _db_fill_inherits(vals, cl->parent, fhash, errh); } } EINA_LIST_FREE(il, inn) { Eolian_Class *out_cl = NULL; - succ = _db_swap_inherit(cl, succ, inn, &out_cl); + succ = _db_swap_inherit(cl, succ, inn, &out_cl, EINA_FALSE); if (!succ) continue; cl->extends = eina_list_append(cl->extends, out_cl); - succ = _db_fill_inherits(vals, out_cl, fhash); + succ = _db_fill_inherits(vals, out_cl, fhash, errh); } if (succ && cl->type == EOLIAN_CLASS_MIXIN) @@ -945,17 +1092,15 @@ _db_fill_inherits(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fhash) EINA_LIST_FREE(rl, inn) { Eolian_Class *out_cl = NULL; - succ = _db_swap_inherit(cl, succ, inn, &out_cl); + succ = _db_swap_inherit(cl, succ, inn, &out_cl, EINA_FALSE); if (succ && !(out_cl->type == EOLIAN_CLASS_REGULAR || out_cl->type == EOLIAN_CLASS_ABSTRACT)) { - char buf[PATH_MAX]; - snprintf(buf, sizeof(buf), "requires only allows regulars or abstracts"); - _obj_error(&cl->base, buf); + _eo_parser_log(&cl->base, "requires only allows regulars or abstracts"); succ = EINA_FALSE; } if (succ) { - _db_fill_inherits(vals, out_cl, fhash); + _db_fill_inherits(vals, out_cl, fhash, errh); } if (!succ) continue; @@ -964,11 +1109,42 @@ _db_fill_inherits(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fhash) } } + /* a set of interfaces for quick checks */ + Eina_Hash *ch = eina_hash_pointer_new(NULL); + + /* replace the composite list with real instances and initial-fill the hash */ + il = cl->composite; + cl->composite = NULL; + EINA_LIST_FREE(il, inn) + { + Eolian_Class *out_cl = NULL; + succ = _db_swap_inherit(cl, succ, inn, &out_cl, EINA_TRUE); + if (!succ) + continue; + cl->composite = eina_list_append(cl->composite, out_cl); + eina_hash_set(ch, &out_cl, out_cl); + } + + /* parent can be abstract, those are not checked for unimplemented, + * plus later we'll be exposing composite as an API, so we need to add + * all composite interfaces from everywhere in the inheritance tree anyway + */ + if (cl->parent) + _add_composite(cl, cl->parent, ch); + + /* iterate extensions, add any composite stuff into the hash as well */ + Eolian_Class *icl; + EINA_LIST_FOREACH(cl->extends, il, icl) + _add_composite(cl, icl, ch); + /* 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_free(ch); + return EINA_FALSE; + } eina_hash_add(fhash, &cl->base.name, cl); @@ -977,10 +1153,18 @@ _db_fill_inherits(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fhash) /* make sure impls/ctors are filled first, but do it only once */ if (!_db_fill_implements(cl, fh)) - return EINA_FALSE; + { + eina_hash_free(ch); + eina_hash_free(fh); + return EINA_FALSE; + } if (!_db_fill_ctors(cl)) - return EINA_FALSE; + { + eina_hash_free(ch); + eina_hash_free(fh); + return EINA_FALSE; + } /* fill callables list with stuff from inheritance tree, the current * class stuff is already filled in _db_fill_implements, this is needed @@ -989,15 +1173,15 @@ _db_fill_inherits(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fhash) if (cl->parent) _db_fill_callables(cl, cl->parent, fh, EINA_TRUE); - Eolian_Class *icl; EINA_LIST_FOREACH(cl->extends, il, icl) _db_fill_callables(cl, icl, fh, EINA_FALSE); /* verify that all methods are implemented on the class */ - if (!_db_check_implemented(vals, cl, fh)) + if (!_db_check_implemented(vals, cl, fh, ch, errh)) vals->warned = EINA_TRUE; eina_hash_free(fh); + eina_hash_free(ch); return EINA_TRUE; } @@ -1066,15 +1250,19 @@ _validate_class(Validate_State *vals, Eolian_Class *cl, case EOLIAN_CLASS_ABSTRACT: if (cl->parent->type != EOLIAN_CLASS_REGULAR && cl->parent->type != EOLIAN_CLASS_ABSTRACT) { - char buf[PATH_MAX]; - snprintf(buf, sizeof(buf), "regular classes ('%s') cannot inherit from non-regular classes ('%s')", - cl->base.name, cl->parent->base.name); - return _obj_error(&cl->base, buf); + _eo_parser_log(&cl->base, "regular classes ('%s') cannot inherit from non-regular classes ('%s')", + cl->base.name, cl->parent->base.name); + return EINA_FALSE; } break; default: break; } + if (!cl->base.is_beta && cl->parent->base.is_beta) + { + _eo_parser_log(&cl->base, "non-beta class cannot have beta parent"); + return EINA_FALSE; + } if (!_validate_class(vals, cl->parent, nhash, ehash, chash)) return EINA_FALSE; } @@ -1098,10 +1286,8 @@ _validate_class(Validate_State *vals, Eolian_Class *cl, case EOLIAN_CLASS_ABSTRACT: /* regular class in extensions list, forbidden */ { - char buf[PATH_MAX]; - snprintf(buf, sizeof(buf), "regular classes ('%s') cannot appear in extensions list of '%s'", - icl->base.name, cl->base.name); - _obj_error(&cl->base, buf); + _eo_parser_log(&cl->base, "regular classes ('%s') cannot appear in extensions list of '%s'", + icl->base.name, cl->base.name); vals->warned = EINA_TRUE; break; } @@ -1132,15 +1318,14 @@ _validate_class(Validate_State *vals, Eolian_Class *cl, eina_strbuf_append(classes, required_class->base.name); eina_strbuf_append_char(classes, ' '); } - char buf[PATH_MAX]; - snprintf(buf, sizeof(buf), "required classes %sare not in the inherit chain of %s", - eina_strbuf_string_get(classes), cl->base.name); + _eo_parser_log(&cl->base, "required classes %sare not in the inherit chain of %s", + eina_strbuf_string_get(classes), cl->base.name); eina_strbuf_free(classes); - _obj_error(&cl->base, buf); return EINA_FALSE; } } + _set_stable(vals, !cl->base.is_beta); EINA_LIST_FOREACH(cl->properties, l, func) if (!_validate_function(vals, func, nhash)) @@ -1155,7 +1340,7 @@ _validate_class(Validate_State *vals, Eolian_Class *cl, return EINA_FALSE; EINA_LIST_FOREACH(cl->parts, l, part) - if (!_validate_part(part, nhash)) + if (!_validate_part(vals, part, nhash)) return EINA_FALSE; EINA_LIST_FOREACH(cl->implements, l, impl) @@ -1185,15 +1370,18 @@ _validate_variable(Validate_State *vals, Eolian_Variable *var) if (var->base.validated) return EINA_TRUE; + Eina_Bool was_stable = _set_stable(vals, !var->base.is_beta && vals->stable); + if (!_validate_type(vals, var->base_type)) - return EINA_FALSE; + return _reset_stable(vals, was_stable, EINA_FALSE); if (var->value && !_validate_expr(var->value, var->base_type, 0)) - return EINA_FALSE; + return _reset_stable(vals, was_stable, EINA_FALSE); if (!_validate_doc(var->doc)) - return EINA_FALSE; + return _reset_stable(vals, was_stable, EINA_FALSE); + _reset_stable(vals, was_stable, EINA_TRUE); return _validate(&var->base); } @@ -1218,21 +1406,30 @@ database_validate(const Eolian_Unit *src) Validate_State vals = { EINA_FALSE, - !!getenv("EOLIAN_EVENT_REDEF_WARN"), - !!getenv("EOLIAN_CLASS_UNIMPLEMENTED_WARN") + EINA_TRUE, + !!getenv("EOLIAN_CLASS_UNIMPLEMENTED_WARN"), }; /* do an initial pass to refill inherits */ Eina_Iterator *iter = eolian_unit_classes_get(src); Eina_Hash *fhash = eina_hash_pointer_new(NULL); + /* keeps track of impls we already errored on to reduce verbosity */ + Eina_Hash *errh = eina_hash_pointer_new(NULL); EINA_ITERATOR_FOREACH(iter, cl) { - if (!_db_fill_inherits(&vals, cl, fhash)) + /* clear, because otherwise if unrelated classes A and B both + * had interface C in extensions list without implementing it, + * it would only get printed for A + */ + eina_hash_free_buckets(errh); + if (!_db_fill_inherits(&vals, cl, fhash, errh)) { + eina_hash_free(errh); eina_hash_free(fhash); return EINA_FALSE; } } + eina_hash_free(errh); eina_hash_free(fhash); eina_iterator_free(iter); diff --git a/src/lib/eolian/eo_lexer.c b/src/lib/eolian/eo_lexer.c index 8e358164fd..6b2747a130 100644 --- a/src/lib/eolian/eo_lexer.c +++ b/src/lib/eolian/eo_lexer.c @@ -70,10 +70,12 @@ static const char * const ctypes[] = "Eina_Bool", + "Eina_Slice", "Eina_Rw_Slice", + "void", "Eina_Accessor *", "Eina_Array *", "Eina_Future *", "Eina_Iterator *", - "Eina_Hash *", "Eina_List *", "Eina_Inarray *", "Eina_Inlist *", + "Eina_Hash *", "Eina_List *", "Eina_Value", "Eina_Value *", "char *", "const char *", "Eina_Stringshare *", "Eina_Strbuf *", diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h index 522cc41271..9a510e1894 100644 --- a/src/lib/eolian/eo_lexer.h +++ b/src/lib/eolian/eo_lexer.h @@ -24,10 +24,10 @@ enum Tokens * they just fill in the "kw" field of the token */ #define KEYWORDS KW(class), KW(const), KW(enum), KW(return), KW(struct), \ \ - KW(abstract), KW(constructor), KW(constructors), KW(data), \ - KW(destructor), KW(eo), KW(eo_prefix), KW(event_prefix), KW(events), \ + KW(abstract), KW(composite), KW(constructor), KW(constructors), KW(data), \ + KW(destructor), KW(eo_prefix), KW(event_prefix), KW(events), \ KW(extends), KW(free), KW(get), KW(implements), KW(import), KW(interface), \ - KW(keys), KW(legacy), KW(legacy_prefix), KW(methods), KW(mixin), KW(params), \ + KW(keys), KW(legacy), KW(methods), KW(mixin), KW(params), \ KW(parse), KW(parts), KW(ptr), KW(set), KW(type), KW(values), KW(var), KW(requires), \ \ KWAT(auto), KWAT(beta), KWAT(class), KWAT(const), KWAT(cref), KWAT(empty), \ @@ -50,10 +50,12 @@ enum Tokens \ KW(bool), \ \ + KW(slice), KW(rw_slice), \ + \ KW(void), \ \ KW(accessor), KW(array), KW(future), KW(iterator), KW(hash), KW(list), \ - KW(inarray), KW(inlist), KW(any_value), KW(any_value_ptr), \ + KW(any_value), KW(any_value_ptr), \ KW(mstring), KW(string), KW(stringshare), KW(strbuf), \ \ KW(void_ptr), \ @@ -210,7 +212,7 @@ int eo_lexer_get (Eo_Lexer *ls); int eo_lexer_lookahead (Eo_Lexer *ls); /* "throws" an error, with a custom message and custom token */ void eo_lexer_lex_error (Eo_Lexer *ls, const char *msg, int token); -/* like above, but uses the lexstate->t.token, aka current token */ +/* like above, but uses the lexstate->t.token, a.k.a. current token */ void eo_lexer_syntax_error (Eo_Lexer *ls, const char *msg); /* turns the token into a string, writes into the given buffer */ void eo_lexer_token_to_str (int token, char *buf); diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index 356c4ab56a..9895f0eb4a 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -404,14 +404,14 @@ parse_expr(Eo_Lexer *ls) return parse_expr_bin(ls, 1); } -static Eolian_Type *parse_type_void(Eo_Lexer *ls); +static Eolian_Type *parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ptr); static Eolian_Type * -parse_type(Eo_Lexer *ls) +parse_type(Eo_Lexer *ls, Eina_Bool allow_ptr) { Eolian_Type *ret; eo_lexer_context_push(ls); - ret = parse_type_void(ls); + ret = parse_type_void(ls, allow_ptr); if (ret->type == EOLIAN_TYPE_VOID) { eo_lexer_context_restore(ls); @@ -433,11 +433,12 @@ _struct_field_free(Eolian_Struct_Type_Field *def) static Eolian_Typedecl * parse_struct(Eo_Lexer *ls, const char *name, Eina_Bool is_extern, - int line, int column, const char *freefunc) + Eina_Bool is_beta, int line, int column, const char *freefunc) { int bline = ls->line_number, bcolumn = ls->column; Eolian_Typedecl *def = eo_lexer_typedecl_new(ls); def->is_extern = is_extern; + def->base.is_beta = is_beta; def->base.name = name; def->type = EOLIAN_TYPEDECL_STRUCT; def->fields = eina_hash_string_small_new(EINA_FREE_CB(_struct_field_free)); @@ -464,7 +465,7 @@ parse_struct(Eo_Lexer *ls, const char *name, Eina_Bool is_extern, eolian_object_ref(&fdef->base); eo_lexer_get(ls); check_next(ls, ':'); - tp = parse_type(ls); + tp = parse_type(ls, EINA_TRUE); FILL_BASE(fdef->base, ls, fline, fcol, STRUCT_FIELD); fdef->type = eo_lexer_type_release(ls, tp); fdef->base.name = eina_stringshare_ref(fname); @@ -491,11 +492,12 @@ _enum_field_free(Eolian_Enum_Type_Field *def) static Eolian_Typedecl * parse_enum(Eo_Lexer *ls, const char *name, Eina_Bool is_extern, - int line, int column) + Eina_Bool is_beta, int line, int column) { int bline = ls->line_number, bcolumn = ls->column; Eolian_Typedecl *def = eo_lexer_typedecl_new(ls); def->is_extern = is_extern; + def->base.is_beta = is_beta; def->base.name = name; def->type = EOLIAN_TYPEDECL_ENUM; def->fields = eina_hash_string_small_new(EINA_FREE_CB(_enum_field_free)); @@ -593,42 +595,8 @@ parse_enum(Eo_Lexer *ls, const char *name, Eina_Bool is_extern, return def; } -static void -parse_struct_attrs(Eo_Lexer *ls, Eina_Bool is_enum, Eina_Bool *is_extern, - const char **freefunc) -{ - Eina_Bool has_extern = EINA_FALSE, has_free = EINA_FALSE; - *freefunc = NULL; - *is_extern = EINA_FALSE; - for (;;) switch (ls->t.kw) - { - case KW_at_extern: - CASE_LOCK(ls, extern, "@extern qualifier") - eo_lexer_get(ls); - *is_extern = EINA_TRUE; - break; - case KW_at_free: - { - CASE_LOCK(ls, free, "@free qualifier") - if (is_enum) - eo_lexer_syntax_error(ls, "enums cannot have @free"); - eo_lexer_get(ls); - int pline = ls->line_number, pcol = ls->column; - check_next(ls, '('); - check(ls, TOK_VALUE); - *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; - } - default: - return; - } -} - static Eolian_Type * -parse_type_void(Eo_Lexer *ls) +parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ptr) { Eolian_Type *def; Eina_Strbuf *buf; @@ -642,7 +610,7 @@ parse_type_void(Eo_Lexer *ls) pline = ls->line_number; pcol = ls->column; check_next(ls, '('); - def = parse_type_void(ls); + def = parse_type_void(ls, allow_ptr); FILL_BASE(def->base, ls, line, col, TYPE); def->is_const = EINA_TRUE; check_match(ls, ')', '(', pline, pcol); @@ -650,30 +618,19 @@ parse_type_void(Eo_Lexer *ls) } case KW_ptr: { + if (!allow_ptr) + break; int pline, pcol; eo_lexer_get(ls); pline = ls->line_number; pcol = ls->column; check_next(ls, '('); - def = parse_type_void(ls); + def = parse_type_void(ls, EINA_FALSE); FILL_BASE(def->base, ls, line, col, TYPE); def->is_ptr = EINA_TRUE; check_match(ls, ')', '(', pline, pcol); return def; } - case KW_legacy: - { - int pline, pcol; - eo_lexer_get(ls); - pline = ls->line_number; - pcol = ls->column; - check_next(ls, '('); - def = parse_type_void(ls); - FILL_BASE(def->base, ls, line, col, TYPE); - def->legacy = EINA_TRUE; - check_match(ls, ')', '(', pline, pcol); - return def; - } case KW_free: { int pline, pcolumn; @@ -681,7 +638,7 @@ parse_type_void(Eo_Lexer *ls) pline = ls->line_number; pcolumn = ls->column; check_next(ls, '('); - def = parse_type_void(ls); + def = parse_type_void(ls, allow_ptr); check_next(ls, ','); check(ls, TOK_VALUE); def->freefunc = eina_stringshare_ref(ls->t.value.s); @@ -716,21 +673,22 @@ parse_type_void(Eo_Lexer *ls) def->btype = ls->t.kw - KW_byte + 1; def->base.name = eina_stringshare_ref(ls->t.value.s); eo_lexer_get(ls); - if (tpid >= KW_accessor && tpid <= KW_inlist) + if ((tpid >= KW_accessor && tpid <= KW_list) || + (tpid >= KW_slice && tpid <= KW_rw_slice)) { int bline = ls->line_number, bcol = ls->column; check_next(ls, '<'); if (tpid == KW_future) - def->base_type = eo_lexer_type_release(ls, parse_type_void(ls)); + def->base_type = eo_lexer_type_release(ls, parse_type_void(ls, EINA_TRUE)); else - def->base_type = eo_lexer_type_release(ls, parse_type(ls)); + def->base_type = eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE)); 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 = - eo_lexer_type_release(ls, parse_type(ls)); + eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE)); if ((def->base_type->next_type->owned = (ls->t.kw == KW_at_owned))) eo_lexer_get(ls); } @@ -776,18 +734,26 @@ static Eolian_Typedecl * parse_typedef(Eo_Lexer *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); - if (freefunc) + Eina_Bool has_extern = EINA_FALSE, has_beta = EINA_FALSE; + for (;;) switch (ls->t.kw) { - def->freefunc = eina_stringshare_ref(freefunc); - eo_lexer_dtor_pop(ls); + case KW_at_extern: + CASE_LOCK(ls, extern, "extern qualifier"); + def->is_extern = EINA_TRUE; + eo_lexer_get(ls); + break; + case KW_at_beta: + CASE_LOCK(ls, beta, "beta qualifier"); + def->base.is_beta = EINA_TRUE; + eo_lexer_get(ls); + break; + default: + goto tags_done; } +tags_done: def->type = EOLIAN_TYPEDECL_ALIAS; - def->is_extern = has_extern; buf = eina_strbuf_new(); eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), buf); eo_lexer_context_push(ls); @@ -802,7 +768,7 @@ parse_typedef(Eo_Lexer *ls) } eo_lexer_context_pop(ls); check_next(ls, ':'); - def->base_type = eo_lexer_type_release(ls, parse_type(ls)); + def->base_type = eo_lexer_type_release(ls, parse_type(ls, EINA_FALSE)); check_next(ls, ';'); FILL_DOC(ls, def, doc); eo_lexer_dtor_pop(ls); @@ -815,11 +781,23 @@ parse_variable(Eo_Lexer *ls, Eina_Bool global) Eolian_Variable *def = eo_lexer_variable_new(ls); Eina_Strbuf *buf; eo_lexer_get(ls); - if (ls->t.kw == KW_at_extern) + Eina_Bool has_extern = EINA_FALSE, has_beta = EINA_FALSE; + for (;;) switch (ls->t.kw) { + case KW_at_extern: + CASE_LOCK(ls, extern, "extern qualifier"); def->is_extern = EINA_TRUE; eo_lexer_get(ls); + break; + case KW_at_beta: + CASE_LOCK(ls, beta, "beta qualifier"); + def->base.is_beta = EINA_TRUE; + eo_lexer_get(ls); + break; + default: + goto tags_done; } +tags_done: def->type = global ? EOLIAN_VAR_GLOBAL : EOLIAN_VAR_CONSTANT; buf = eina_strbuf_new(); eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), buf); @@ -835,7 +813,7 @@ parse_variable(Eo_Lexer *ls, Eina_Bool global) } eo_lexer_context_pop(ls); check_next(ls, ':'); - def->base_type = eo_lexer_type_release(ls, parse_type(ls)); + def->base_type = eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE)); /* constants are required to have a value */ if (!global) check(ls, '='); @@ -870,9 +848,9 @@ parse_return(Eo_Lexer *ls, Eo_Ret_Def *ret, Eina_Bool allow_void, eo_lexer_get(ls); check_next(ls, ':'); if (allow_void) - ret->type = parse_type_void(ls); + ret->type = parse_type_void(ls, EINA_TRUE); else - ret->type = parse_type(ls); + ret->type = parse_type(ls, EINA_TRUE); ret->doc = NULL; ret->default_ret_val = NULL; ret->warn_unused = EINA_FALSE; @@ -940,9 +918,9 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout, eo_lexer_get(ls); check_next(ls, ':'); if (par->param_dir == EOLIAN_OUT_PARAM || par->param_dir == EOLIAN_INOUT_PARAM) - par->type = eo_lexer_type_release(ls, parse_type_void(ls)); + par->type = eo_lexer_type_release(ls, parse_type_void(ls, EINA_TRUE)); else - par->type = eo_lexer_type_release(ls, parse_type(ls)); + par->type = eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE)); if ((is_vals || (par->param_dir == EOLIAN_OUT_PARAM)) && (ls->t.token == '(')) { int line = ls->line_number, col = ls->column; @@ -992,17 +970,6 @@ end: FILL_DOC(ls, par, doc); } -static void -parse_legacy(Eo_Lexer *ls, const char **out) -{ - eo_lexer_get(ls); - check_next(ls, ':'); - check(ls, TOK_VALUE); - *out = eina_stringshare_ref(ls->t.value.s); - eo_lexer_get(ls); - check_next(ls, ';'); -} - static void parse_params(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout, Eina_Bool is_vals) @@ -1027,8 +994,7 @@ static void parse_accessor(Eo_Lexer *ls, Eolian_Function *prop) { int line, col; - Eina_Bool has_return = EINA_FALSE, has_legacy = EINA_FALSE, - has_eo = EINA_FALSE, has_keys = EINA_FALSE, + Eina_Bool has_return = EINA_FALSE, has_keys = EINA_FALSE, has_values = EINA_FALSE, has_protected = EINA_FALSE, has_virtp = EINA_FALSE; Eina_Bool is_get = (ls->t.kw == KW_get); @@ -1122,24 +1088,6 @@ parse_accessor: prop->set_ret_type->owned = ret.owned; } break; - case KW_legacy: - CASE_LOCK(ls, legacy, "legacy name") - if (is_get) - parse_legacy(ls, &prop->get_legacy); - else - parse_legacy(ls, &prop->set_legacy); - break; - case KW_eo: - CASE_LOCK(ls, eo, "eo name") - eo_lexer_get(ls); - check_next(ls, ':'); - check_kw_next(ls, KW_null); - check_next(ls, ';'); - if (is_get) - prop->get_only_legacy = EINA_TRUE; - else - prop->set_only_legacy = EINA_TRUE; - break; case KW_keys: { Eina_List **stor; @@ -1224,7 +1172,7 @@ parse_property(Eo_Lexer *ls) break; case KW_at_beta: CASE_LOCK(ls, beta, "beta qualifier"); - prop->is_beta = EINA_TRUE; + prop->base.is_beta = EINA_TRUE; eo_lexer_get(ls); break; case KW_at_pure_virtual: @@ -1290,10 +1238,23 @@ parse_function_pointer(Eo_Lexer *ls) eo_lexer_get(ls); def->type = EOLIAN_TYPEDECL_FUNCTION_POINTER; - def->is_extern = (ls->t.kw == KW_at_extern); - if (def->is_extern) - eo_lexer_get(ls); - + Eina_Bool has_extern = EINA_FALSE, has_beta = EINA_FALSE; + for (;;) switch (ls->t.kw) + { + case KW_at_extern: + CASE_LOCK(ls, extern, "extern qualifier"); + def->is_extern = EINA_TRUE; + eo_lexer_get(ls); + break; + case KW_at_beta: + CASE_LOCK(ls, beta, "beta qualifier"); + def->base.is_beta = EINA_TRUE; + eo_lexer_get(ls); + break; + default: + goto tags_done; + } +tags_done: parse_name(ls, buf); def->base.name = eina_stringshare_add(eina_strbuf_string_get(buf)); eo_lexer_dtor_pop(ls); @@ -1307,8 +1268,8 @@ parse_function_pointer(Eo_Lexer *ls) def->function_pointer = meth; eolian_object_ref(&meth->base); - meth->is_beta = (ls->t.kw == KW_at_beta); - if (meth->is_beta) + meth->base.is_beta = (ls->t.kw == KW_at_beta); + if (meth->base.is_beta) eo_lexer_get(ls); bline = ls->line_number; @@ -1348,9 +1309,8 @@ parse_method(Eo_Lexer *ls) Eolian_Function *meth = NULL; Eolian_Implement *impl = NULL; Eina_Bool has_const = EINA_FALSE, has_params = EINA_FALSE, - has_return = EINA_FALSE, has_legacy = EINA_FALSE, - has_protected = EINA_FALSE, has_class = EINA_FALSE, - has_eo = EINA_FALSE, has_beta = EINA_FALSE, + has_return = EINA_FALSE, has_protected = EINA_FALSE, + has_class = EINA_FALSE, has_beta = EINA_FALSE, has_virtp = EINA_FALSE; meth = calloc(1, sizeof(Eolian_Function)); meth->klass = ls->klass; @@ -1394,7 +1354,7 @@ parse_method(Eo_Lexer *ls) break; case KW_at_beta: CASE_LOCK(ls, beta, "beta qualifier"); - meth->is_beta = EINA_TRUE; + meth->base.is_beta = EINA_TRUE; eo_lexer_get(ls); break; case KW_at_pure_virtual: @@ -1424,18 +1384,6 @@ body: meth->get_return_warn_unused = ret.warn_unused; meth->get_ret_type->owned = ret.owned; break; - case KW_legacy: - CASE_LOCK(ls, legacy, "legacy name") - parse_legacy(ls, &meth->get_legacy); - break; - case KW_eo: - CASE_LOCK(ls, eo, "eo name") - eo_lexer_get(ls); - check_next(ls, ':'); - check_kw_next(ls, KW_null); - check_next(ls, ';'); - meth->get_only_legacy = EINA_TRUE; - break; case KW_params: CASE_LOCK(ls, params, "params definition") parse_params(ls, &meth->params, EINA_TRUE, EINA_FALSE); @@ -1739,8 +1687,7 @@ parse_event(Eo_Lexer *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; + has_hot = EINA_FALSE, has_restart = EINA_FALSE; for (;;) switch (ls->t.kw) { case KW_at_private: @@ -1753,7 +1700,7 @@ parse_event(Eo_Lexer *ls) break; case KW_at_beta: CASE_LOCK(ls, beta, "beta qualifier") - ev->is_beta = EINA_TRUE; + ev->base.is_beta = EINA_TRUE; eo_lexer_get(ls); break; case KW_at_hot: @@ -1766,17 +1713,12 @@ parse_event(Eo_Lexer *ls) ev->is_restart = EINA_TRUE; eo_lexer_get(ls); break; - case KW_at_owned: - CASE_LOCK(ls, owned, "owned qualifier"); - eo_lexer_get(ls); - break; default: goto end; } end: check_next(ls, ':'); - ev->type = eo_lexer_type_release(ls, parse_type_void(ls)); - ev->type->owned = has_owned; + ev->type = eo_lexer_type_release(ls, parse_type_void(ls, EINA_TRUE)); check(ls, ';'); eo_lexer_get(ls); FILL_DOC(ls, ev, doc); @@ -1815,6 +1757,43 @@ parse_parts(Eo_Lexer *ls) check_match(ls, '}', '{', line, col); } +static void +parse_composite(Eo_Lexer *ls) +{ + int line, col; + if (ls->klass->type == EOLIAN_CLASS_INTERFACE) + eo_lexer_syntax_error(ls, "composite section not allowed in interfaces"); + eo_lexer_get(ls); + line = ls->line_number, col = ls->column; + check_next(ls, '{'); + while (ls->t.token != '}') + { + 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); + char *fnm = database_class_to_filename(nm); + if (!eina_hash_find(ls->state->filenames_eo, fnm)) + { + free(fnm); + char ebuf[PATH_MAX]; + eo_lexer_context_restore(ls); + snprintf(ebuf, sizeof(ebuf), "unknown interface '%s'", nm); + eo_lexer_syntax_error(ls, ebuf); + return; + } + /* do not introduce a dependency */ + database_defer(ls->state, fnm, EINA_FALSE); + free(fnm); + ls->klass->composite = eina_list_append(ls->klass->composite, + eina_stringshare_add(nm)); + eo_lexer_dtor_pop(ls); + check_next(ls, ';'); + } + check_match(ls, '}', '{', line, col); +} + static void parse_implements(Eo_Lexer *ls, Eina_Bool iface) { @@ -1880,12 +1859,12 @@ error: static void parse_class_body(Eo_Lexer *ls, Eolian_Class_Type type) { - Eina_Bool has_legacy_prefix = EINA_FALSE, - has_eo_prefix = EINA_FALSE, + Eina_Bool has_eo_prefix = EINA_FALSE, has_event_prefix = EINA_FALSE, has_data = EINA_FALSE, has_methods = EINA_FALSE, has_parts = EINA_FALSE, + has_composite = EINA_FALSE, has_implements = EINA_FALSE, has_constructors = EINA_FALSE, has_events = EINA_FALSE; @@ -1896,15 +1875,6 @@ parse_class_body(Eo_Lexer *ls, Eolian_Class_Type type) } for (;;) switch (ls->t.kw) { - case KW_legacy_prefix: - CASE_LOCK(ls, legacy_prefix, "legacy prefix definition") - eo_lexer_get(ls); - check_next(ls, ':'); - _validate_pfx(ls); - ls->klass->legacy_prefix = eina_stringshare_ref(ls->t.value.s); - eo_lexer_get(ls); - check_next(ls, ';'); - break; case KW_eo_prefix: CASE_LOCK(ls, eo_prefix, "eo prefix definition") eo_lexer_get(ls); @@ -1941,6 +1911,10 @@ parse_class_body(Eo_Lexer *ls, Eolian_Class_Type type) CASE_LOCK(ls, parts, "parts definition") parse_parts(ls); break; + case KW_composite: + CASE_LOCK(ls, composite, "composite definition") + parse_composite(ls); + break; case KW_implements: CASE_LOCK(ls, implements, "implements definition") parse_implements(ls, type == EOLIAN_CLASS_INTERFACE); @@ -2051,6 +2025,11 @@ parse_class(Eo_Lexer *ls, Eolian_Class_Type type) eo_lexer_get(ls); ls->klass->type = type; eo_lexer_context_push(ls); + if (ls->t.kw == KW_at_beta) + { + ls->klass->base.is_beta = EINA_TRUE; + eo_lexer_get(ls); + } parse_name(ls, buf); bnm = eina_stringshare_ref(ls->filename); fnm = database_class_to_filename(eina_strbuf_string_get(buf)); @@ -2197,11 +2176,41 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot) Eina_Bool is_enum = (ls->t.kw == KW_enum); const char *name; int line, col; - Eina_Bool has_extern; - const char *freefunc; + const char *freefunc = NULL; Eina_Strbuf *buf; eo_lexer_get(ls); - parse_struct_attrs(ls, is_enum, &has_extern, &freefunc); + Eina_Bool has_extern = EINA_FALSE, has_free = EINA_FALSE, has_beta = EINA_FALSE; + for (;;) switch (ls->t.kw) + { + case KW_at_extern: + CASE_LOCK(ls, extern, "@extern qualifier") + eo_lexer_get(ls); + break; + case KW_at_beta: + CASE_LOCK(ls, beta, "@beta qualifier") + eo_lexer_get(ls); + break; + case KW_at_free: + { + if (is_enum) + goto postparams; + CASE_LOCK(ls, free, "@free qualifier") + if (is_enum) + eo_lexer_syntax_error(ls, "enums cannot have @free"); + eo_lexer_get(ls); + int pline = ls->line_number, pcol = ls->column; + check_next(ls, '('); + check(ls, TOK_VALUE); + 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; + } + default: + goto postparams; + } +postparams: buf = eina_strbuf_new(); eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), buf); eo_lexer_context_push(ls); @@ -2216,7 +2225,8 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot) eo_lexer_context_restore(ls); Eolian_Typedecl tdecl; tdecl.base.type = EOLIAN_OBJECT_TYPEDECL; - tdecl.type = is_enum ? EOLIAN_TYPEDECL_ENUM : EOLIAN_TYPEDECL_STRUCT; + tdecl.type = + (is_enum ? EOLIAN_TYPEDECL_ENUM : EOLIAN_TYPEDECL_STRUCT); redef_error(ls, decl, &tdecl.base); } eo_lexer_context_pop(ls); @@ -2225,6 +2235,7 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot) { Eolian_Typedecl *def = eo_lexer_typedecl_new(ls); def->is_extern = has_extern; + def->base.is_beta = has_beta; def->type = EOLIAN_TYPEDECL_STRUCT_OPAQUE; if (freefunc) { @@ -2239,9 +2250,9 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot) break; } if (is_enum) - parse_enum(ls, name, has_extern, line, col); + parse_enum(ls, name, has_extern, has_beta, line, col); else - parse_struct(ls, name, has_extern, line, col, freefunc); + parse_struct(ls, name, has_extern, has_beta, line, col, freefunc); break; } def: diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c index eb6e896bab..4ce5b00f63 100644 --- a/src/lib/eolian/eolian_database.c +++ b/src/lib/eolian/eolian_database.c @@ -119,6 +119,13 @@ eolian_object_namespaces_get(const Eolian_Object *obj) return &it->itr; } +EAPI Eina_Bool +eolian_object_is_beta(const Eolian_Object *obj) +{ + if (!obj) return EINA_FALSE; + return obj->is_beta; +} + void database_doc_del(Eolian_Documentation *doc) { if (!doc) return; diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h index 805b547109..8c1b02bd2a 100644 --- a/src/lib/eolian/eolian_database.h +++ b/src/lib/eolian/eolian_database.h @@ -89,7 +89,8 @@ struct _Eolian_Object int column; int refcount; Eolian_Object_Type type; - Eina_Bool validated; + Eina_Bool validated: 1; + Eina_Bool is_beta: 1; }; static inline void @@ -176,7 +177,6 @@ struct _Eolian_Class Eolian_Object base; Eolian_Class_Type type; Eolian_Documentation *doc; - Eina_Stringshare *legacy_prefix; Eina_Stringshare *eo_prefix; Eina_Stringshare *ev_prefix; Eina_Stringshare *data_type; @@ -191,6 +191,7 @@ struct _Eolian_Class Eina_List *constructors; /* Eolian_Constructor */ Eina_List *events; /* Eolian_Event */ Eina_List *parts; /* Eolian_Part */ + Eina_List *composite; /* Eolian_Class */ Eina_List *requires; /* a list of required other classes only used internally */ Eina_List *callables; /* internal for now */ Eina_Bool class_ctor_enable:1; @@ -220,17 +221,12 @@ struct _Eolian_Function Eolian_Expression *get_ret_val; Eolian_Expression *set_ret_val; Eolian_Implement *impl; - Eina_Stringshare *get_legacy; - Eina_Stringshare *set_legacy; Eolian_Documentation *get_return_doc; Eolian_Documentation *set_return_doc; Eina_Bool obj_is_const :1; /* True if the object has to be const. Useful for a few methods. */ Eina_Bool get_return_warn_unused :1; /* also used for methods */ Eina_Bool set_return_warn_unused :1; - Eina_Bool get_only_legacy: 1; - Eina_Bool set_only_legacy: 1; Eina_Bool is_class :1; - Eina_Bool is_beta :1; Eina_List *ctor_of; Eolian_Class *klass; }; @@ -275,7 +271,6 @@ struct _Eolian_Type Eina_Bool is_const :1; Eina_Bool is_ptr :1; Eina_Bool owned :1; - Eina_Bool legacy :1; }; struct _Eolian_Typedecl @@ -326,7 +321,6 @@ struct _Eolian_Event Eolian_Type *type; Eolian_Class *klass; Eolian_Object_Scope scope; - Eina_Bool is_beta :1; Eina_Bool is_hot :1; Eina_Bool is_restart :1; }; diff --git a/src/lib/eolian_cxx/grammar/context.hpp b/src/lib/eolian_cxx/grammar/context.hpp index e4839200bc..6fb171ab66 100644 --- a/src/lib/eolian_cxx/grammar/context.hpp +++ b/src/lib/eolian_cxx/grammar/context.hpp @@ -5,33 +5,50 @@ namespace efl { namespace eolian { namespace grammar { struct context_null {}; -template +template struct context_cons { - Tag tag; - Tail const& tail; -}; - -template -struct context_cons -{ - Tag tag; - context_null tail; + typename std::remove_reference::type const tag; + typename std::remove_reference::type const tail; }; template -context_cons> -context_add_tag(NewTag tag, context_cons const& context) +constexpr context_cons> +context_add_tag(NewTag const& tag, context_cons const& context) { return context_cons>{tag, context}; } template -context_cons -context_add_tag(NewTag tag, context_null context) +constexpr context_cons +context_add_tag(NewTag const& tag, context_null context) { return context_cons{tag, context}; } +template +constexpr context_cons +context_replace_tag(Tag const& tag, context_cons const& context + , typename std::enable_if::value>::type* = nullptr) +{ + return {tag, context.tail}; +} + +template +constexpr context_cons +context_replace_tag(Tag const& tag, context_cons const& context + , typename std::enable_if::value>::type* = nullptr) +{ + return {context.tag, context_replace_tag(tag, context.tail)}; +} + +template +constexpr context_null +context_replace_tag(Tag const& tag, context_null const&) +{ + static_assert(std::is_same::value, "Tag type not available in this generation context"); + return tag; +} + template struct tag_check; template @@ -42,25 +59,26 @@ template struct tag_check> : tag_check {}; template -Tag const& context_find_tag(context_cons const& context +constexpr Tag const& context_find_tag(context_cons const& context , typename std::enable_if::value>::type* = nullptr) { return context.tag; } template -Tag const& context_find_tag(context_cons const& context +constexpr Tag const& context_find_tag(context_cons const& context , typename std::enable_if::value>::type* = nullptr) { return context_find_tag(context.tail); } -template -Tag const& context_find_tag(context_null const&) +template +constexpr Tag const& context_find_tag(context_null const& context) { - throw std::logic_error("Context for generation not available"); + static_assert(std::is_same::value, "Tag type not available in this generation context"); + return context; } - + } } } #endif diff --git a/src/lib/eolian_cxx/grammar/function_declaration.hpp b/src/lib/eolian_cxx/grammar/function_declaration.hpp index dc6a969a58..1ae63df857 100644 --- a/src/lib/eolian_cxx/grammar/function_declaration.hpp +++ b/src/lib/eolian_cxx/grammar/function_declaration.hpp @@ -44,8 +44,8 @@ struct function_declaration_generator } if(f.is_beta && - !as_generator("#ifdef " << *(string << "_") << string << "_BETA\n") - .generate(sink, std::make_tuple(_klass_name.namespaces, _klass_name.eolian_name), add_upper_case_context(ctx))) + !as_generator(lit("#ifdef EFL_BETA_API_SUPPORT\n")) + .generate(sink, attributes::unused, ctx)) return false; if(f.is_protected && !as_generator("#ifdef " << *(string << "_") << string << "_PROTECTED\n") diff --git a/src/lib/eolian_cxx/grammar/function_definition.hpp b/src/lib/eolian_cxx/grammar/function_definition.hpp index b3080e4c67..c5de8ce531 100644 --- a/src/lib/eolian_cxx/grammar/function_definition.hpp +++ b/src/lib/eolian_cxx/grammar/function_definition.hpp @@ -50,8 +50,8 @@ struct function_definition_generator } if(f.is_beta && - !as_generator("#ifdef " << *(string << "_") << string << "_BETA\n") - .generate(sink, std::make_tuple(_klass_name.namespaces, _klass_name.eolian_name), add_upper_case_context(ctx))) + !as_generator(lit("#ifdef EFL_BETA_API_SUPPORT\n")) + .generate(sink, attributes::unused, ctx)) return false; if(f.is_protected && !as_generator("#ifdef " << *(string << "_") << string << "_PROTECTED\n") @@ -121,24 +121,27 @@ struct function_definition_generator << " __return_value = " ).generate(sink, attributes::unused, ctx)) return false; - std::string object_flag; - if (f.is_static) object_flag = "_eo_class()"; - else object_flag = "_eo_ptr()"; + std::tuple > params; + if (f.is_static) + params = std::make_tuple(f.c_name, "", f.parameters); + else + params = std::make_tuple(f.c_name, "_eo_ptr()", f.parameters); if(!as_generator - (" ::" << string << "(" << string << - *( - "\n" << scope_tab << scope_tab << ", " + (" ::" << string << "(" << string << ((!f.is_static && (f.parameters.size() > 0)) ? "," : "") + << + ( + ("\n" << scope_tab << scope_tab << ( attribute_conditional([] (attributes::parameter_def const& p) { return p.direction == attributes::parameter_direction::in; }) [converting_argument] | ("& __out_param_" << attribute_reorder<2>(string)) - ) + )) % "," ) << ");\n" - ).generate(sink, std::make_tuple(f.c_name, object_flag, f.parameters), ctx)) + ).generate(sink, params, ctx)) return false; auto out_assignments = diff --git a/src/lib/eolian_cxx/grammar/indentation.hpp b/src/lib/eolian_cxx/grammar/indentation.hpp index 897be03c3b..347974fa01 100644 --- a/src/lib/eolian_cxx/grammar/indentation.hpp +++ b/src/lib/eolian_cxx/grammar/indentation.hpp @@ -8,22 +8,36 @@ namespace efl { namespace eolian { namespace grammar { struct scope_tab_generator { - scope_tab_generator(int n) - : n(n) {} - + constexpr scope_tab_generator(int n, int m = 4) + : n(n) + , m(m) + {} + constexpr scope_tab_generator(scope_tab_generator const&) = default; + scope_tab_generator& operator=(scope_tab_generator const&) = default; + template bool generate(OutputIterator sink, attributes::unused_type, Context const&) const { for(int i = 0; i != n; ++i) { - *sink++ = ' '; - *sink++ = ' '; - *sink++ = ' '; + for(int j = 0; j != m; ++j) + *sink++ = ' '; } return true; } + constexpr scope_tab_generator inc(int nplus = 1) const + { + return {n+nplus, m}; + } + + constexpr scope_tab_generator dec(int nminus = 1) const + { + return {n-nminus, m}; + } + int n; + int m; }; template <> @@ -33,9 +47,14 @@ struct is_generator : std::true_type {}; struct scope_tab_terminal { - scope_tab_generator operator()(int n) const + scope_tab_generator operator()(int n, int m = 4) const { - return scope_tab_generator(n); + return {n, m}; + } + + operator scope_tab_generator() const + { + return {1}; } } const scope_tab = {}; diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp index fc9d09519a..fa32dfbe93 100644 --- a/src/lib/eolian_cxx/grammar/klass_def.hpp +++ b/src/lib/eolian_cxx/grammar/klass_def.hpp @@ -16,6 +16,8 @@ #include #include #include +#include +#include namespace efl { namespace eolian { namespace grammar { @@ -73,6 +75,26 @@ enum class typedecl_type function_ptr, }; +inline std::ostream& operator<<(std::ostream& s, typedecl_type dec) +{ + switch(dec) + { + case typedecl_type::unknown: + return s << "unknown"; + case typedecl_type::struct_: + return s << "struct_"; + case typedecl_type::struct_opaque: + return s << "struct_opaque"; + case typedecl_type::enum_: + return s << "enum_"; + case typedecl_type::alias: + return s << "alias"; + case typedecl_type::function_ptr: + return s << "function_ptr"; + }; + return s; +} + inline typedecl_type typedecl_type_get(Eolian_Typedecl const* decl) { if (!decl) @@ -91,6 +113,14 @@ inline typedecl_type typedecl_type_get(Eolian_Typedecl const* decl) } } +enum class variable_type +{ + unknown, + constant, + global +}; + + struct type_def; bool operator==(type_def const& rhs, type_def const& lhs); bool operator!=(type_def const& rhs, type_def const& lhs); @@ -100,6 +130,22 @@ enum class class_type regular, abstract_, mixin, interface_ }; +inline std::ostream& operator<<(std::ostream& s, class_type t) +{ + switch(t) + { + case class_type::regular: + return s << "regular"; + case class_type::abstract_: + return s << "abstract_"; + case class_type::mixin: + return s << "mixin"; + case class_type::interface_: + return s << "interface_"; + }; + return s; +} + struct klass_name { std::vector namespaces; @@ -107,19 +153,29 @@ struct klass_name qualifier_def base_qualifier; class_type type; std::string klass_get_name; + bool is_beta; + + friend inline std::ostream& operator<<(std::ostream& s, klass_name const& name) + { + s << "[ namespaces: {"; + std::copy(name.namespaces.begin(), name.namespaces.end(), std::ostream_iterator(s, ",")); + return s << "}, eolian_name: " << name.eolian_name << " base_qualifier: " << name.base_qualifier + << " type: " << name.type << " klass_get_name: " << name.klass_get_name << "]"; + } klass_name() { } klass_name(std::vector namespaces , std::string eolian_name, qualifier_def base_qualifier - , class_type type, std::string klass_get_name) + , class_type type, std::string klass_get_name, bool is_beta) : namespaces(namespaces), eolian_name(eolian_name), base_qualifier(base_qualifier) - , type(type), klass_get_name(klass_get_name) {} + , type(type), klass_get_name(klass_get_name), is_beta(is_beta) {} klass_name(Eolian_Class const* klass, qualifier_def base_qualifier) : eolian_name( ::eolian_class_short_name_get(klass)) , base_qualifier(base_qualifier) , klass_get_name( ::eolian_class_c_get_function_name_get(klass)) + , is_beta(::eolian_object_is_beta(EOLIAN_OBJECT(klass))) { for(efl::eina::iterator namespace_iterator ( ::eolian_class_namespaces_get(klass)) , namespace_last; namespace_iterator != namespace_last; ++namespace_iterator) @@ -202,7 +258,6 @@ struct documentation_def str = eolian_documentation_since_get(eolian_doc); if (str) { since = str; - full_text += "\n" + since; } efl::eina::ptr_list l(eolian_documentation_string_split(description.c_str())); @@ -264,6 +319,14 @@ struct regular_type_def bool is_alias() const { return is_type(typedecl_type::alias); } bool is_function_ptr() const { return is_type(typedecl_type::function_ptr); } + friend inline std::ostream& operator<<(std::ostream& s, regular_type_def const& def) + { + s << "[ base_type: " << def.base_type << " base_qualifier: " << def.base_qualifier + << " namespaces: "; + std::copy(def.namespaces.begin(), def.namespaces.end(), std::ostream_iterator(s, ", ")); + return s << " type_type: " << def.type_type << " is_undefined " << def.is_undefined << "]"; + } + std::string base_type; qualifier_def base_qualifier; std::vector namespaces; @@ -284,6 +347,13 @@ struct complex_type_def { regular_type_def outer; std::vector subtypes; + + friend inline std::ostream& operator<<(std::ostream& s, complex_type_def const& def) + { + s << "[ outer " << def.outer << " subtypes: {"; + std::copy(def.subtypes.begin(), def.subtypes.end(), std::ostream_iterator(s, ", ")); + return s << "}]"; + } }; inline bool operator==(complex_type_def const& lhs, complex_type_def const& rhs) @@ -295,6 +365,8 @@ inline bool operator!=(complex_type_def const& lhs, complex_type_def const& rhs) return !(lhs == rhs); } +// type_def represents a type where it is used, like a method parameter or a struc field, in contrast to more +// specifict types like struct_def, class_def, function_def, which represents a declaration of a type. struct type_def { typedef eina::variant variant_type; @@ -302,6 +374,7 @@ struct type_def std::string c_type; bool has_own; bool is_ptr; + bool is_beta; type_def() = default; type_def(variant_type original_type, std::string c_type, bool has_own) @@ -318,6 +391,12 @@ struct type_def { return lhs.c_type < rhs.c_type; } + friend inline std::ostream& operator<<(std::ostream& s, type_def const& rhs) + { + return s << "[ original: " << rhs.original_type << " c_type " + << rhs.c_type << " has_own " << rhs.has_own << " is_ptr " + << rhs.is_ptr << "]"; + } }; struct get_qualifier_visitor @@ -352,6 +431,9 @@ inline void type_def::set(Eolian_Type const* eolian_type, Eolian_Unit const* uni Eolian_Type const* stp = eolian_type_base_type_get(eolian_type); has_own = !!::eolian_type_is_owned(eolian_type); is_ptr = !!::eolian_type_is_ptr(eolian_type); + + Eolian_Typedecl const* decl = eolian_type_typedecl_get(eolian_type); + is_beta = decl && eolian_object_is_beta(EOLIAN_OBJECT(decl)); switch( ::eolian_type_type_get(eolian_type)) { case EOLIAN_TYPE_VOID: @@ -682,16 +764,18 @@ struct function_def else parameters.insert(parameters.end(), values.begin(), values.end()); } - c_name = eolian_function_full_c_name_get(function, type, EINA_FALSE); + c_name = eolian_function_full_c_name_get(function, type); if (type != EOLIAN_FUNCTION_POINTER) { 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()}); + is_beta = eolian_function_is_beta(function) || klass.is_beta; } else { + is_beta = tp && eolian_object_is_beta(EOLIAN_OBJECT(tp)); filename = ""; if (tp) @@ -702,7 +786,6 @@ struct function_def namespaces.push_back(&*ns_iterator); } } - is_beta = eolian_function_is_beta(function); is_protected = eolian_function_scope_get(function, type) == EOLIAN_SCOPE_PROTECTED; is_static = eolian_function_is_class(function); @@ -857,6 +940,62 @@ struct property_def } }; +struct variable_def +{ + std::string name; + std::string full_name; + type_def base_type; + documentation_def documentation; + variable_type type; + std::vector namespaces; + Eolian_Value expression_value; + bool is_extern : 1; + + friend inline bool operator==(variable_def const& lhs, variable_def const& rhs) + { + return lhs.name == rhs.name + && lhs.full_name == rhs.full_name + && lhs.base_type == rhs.base_type + && lhs.documentation == rhs.documentation + && lhs.type == rhs.type + && lhs.namespaces == rhs.namespaces + && lhs.expression_value.type == rhs.expression_value.type + && lhs.expression_value.value.ll == rhs.expression_value.value.ll + && lhs.is_extern == rhs.is_extern; + } + + friend inline bool operator!=(variable_def const& lhs, variable_def const& rhs) + { + return !(lhs == rhs); + } + + variable_def() = default; + variable_def(Eolian_Variable const* variable, Eolian_Unit const* unit) + : name(::eolian_variable_short_name_get(variable)) + , full_name(::eolian_variable_name_get(variable)) + , base_type(::eolian_variable_base_type_get(variable), unit, ::EOLIAN_C_TYPE_DEFAULT) + , documentation(::eolian_variable_documentation_get(variable)) + , type(static_cast(::eolian_variable_type_get(variable))) + , expression_value() + , is_extern(::eolian_variable_is_extern(variable)) + { + for(efl::eina::iterator namespace_iterator( ::eolian_variable_namespaces_get(variable)) + , namespace_last; namespace_iterator != namespace_last; ++namespace_iterator) + { + this->namespaces.push_back((&*namespace_iterator)); + } + + if (this->type == variable_type::constant) + { + auto expr = ::eolian_variable_value_get(variable); + if (!expr) + throw std::runtime_error("Could not get constant variable value expression"); + + this->expression_value = ::eolian_expression_eval_type(expr, ::eolian_variable_base_type_get(variable)); + } + } +}; + // template // struct tuple_element : tuple_element {}; @@ -988,6 +1127,42 @@ struct part_def , documentation(::eolian_part_documentation_get(part)) {} }; +struct constructor_def +{ + std::string name; + klass_name klass; + function_def function; + bool is_optional; + bool is_ctor_param; + + friend inline bool operator==(constructor_def const& lhs, constructor_def const& rhs) + { + return lhs.name == rhs.name + && lhs.klass == rhs.klass + && lhs.function == rhs.function + && lhs.is_optional == rhs.is_optional + && lhs.is_ctor_param == rhs.is_ctor_param; + } + + friend inline bool operator!=(constructor_def const& lhs, constructor_def const& rhs) + { + return !(lhs == rhs); + } + + constructor_def(Eolian_Constructor const* constructor, Eolian_Unit const* unit) + : name(::eolian_constructor_name_get(constructor)) + , klass(::eolian_constructor_class_get(constructor), {}) + , is_optional(::eolian_constructor_is_optional(constructor)) + , is_ctor_param(::eolian_constructor_is_ctor_param(constructor)) + { + Eolian_Function const* eo_function = ::eolian_constructor_function_get(constructor); + Eolian_Function_Type eo_func_type = ::eolian_function_type_get(eo_function); + if (eo_func_type == ::EOLIAN_PROPERTY) + eo_func_type = ::EOLIAN_PROP_SET; + function = function_def(eo_function, eo_func_type, NULL, unit); + } +}; + inline Eolian_Class const* get_klass(klass_name const& klass_name_, Eolian_Unit const* unit); struct klass_def @@ -999,6 +1174,7 @@ struct klass_def std::vector namespaces; std::vector functions; std::vector properties; + std::vector constructors; std::set inherits; class_type type; std::vector events; @@ -1006,6 +1182,7 @@ struct klass_def eina::optional parent; std::set extensions; std::string klass_get_name; + bool is_beta; std::set parts; Eolian_Unit const* unit; @@ -1022,7 +1199,8 @@ struct klass_def && lhs.type == rhs.type && lhs.events == rhs.events && lhs.parts == rhs.parts - && lhs.klass_get_name == rhs.klass_get_name; + && lhs.klass_get_name == rhs.klass_get_name + && lhs.is_beta == rhs.is_beta; } friend inline bool operator!=(klass_def const& lhs, klass_def const& rhs) { @@ -1044,13 +1222,15 @@ struct klass_def , std::set inherits , class_type type , std::set immediate_inherits - , std::string klass_get_name) + , std::string klass_get_name + , bool is_beta) : eolian_name(eolian_name), cxx_name(cxx_name), filename(filename) , documentation(documentation) , namespaces(namespaces) , functions(functions), properties(properties), inherits(inherits), type(type) , immediate_inherits(immediate_inherits) , klass_get_name(klass_get_name) + , is_beta(is_beta) {} klass_def(std::string _eolian_name, std::string _cxx_name , std::vector _namespaces @@ -1058,14 +1238,16 @@ struct klass_def , std::vector _properties , std::set _inherits , class_type _type, Eolian_Unit const* unit - , std::string klass_get_name) + , std::string klass_get_name + , bool is_beta) : eolian_name(_eolian_name), cxx_name(_cxx_name) , namespaces(_namespaces) , functions(_functions), properties(_properties), inherits(_inherits), type(_type) - , klass_get_name(klass_get_name), unit(unit) + , klass_get_name(klass_get_name), is_beta(is_beta), unit(unit) {} klass_def(Eolian_Class const* klass, Eolian_Unit const* unit) : klass_get_name( ::eolian_class_c_get_function_name_get(klass)) + , is_beta(::eolian_class_is_beta(klass)) , unit(unit) { for(efl::eina::iterator namespace_iterator( ::eolian_class_namespaces_get(klass)) @@ -1085,8 +1267,7 @@ struct klass_def efl::eina::optional getter(nullptr); efl::eina::optional setter(nullptr); try { - if(! ::eolian_function_is_legacy_only(function, EOLIAN_PROP_GET) - && ::eolian_function_scope_get(function, EOLIAN_PROP_GET) != EOLIAN_SCOPE_PRIVATE) + if(::eolian_function_scope_get(function, EOLIAN_PROP_GET) != EOLIAN_SCOPE_PRIVATE) { function_def f(function, EOLIAN_PROP_GET, NULL, unit); functions.push_back(f); @@ -1094,8 +1275,7 @@ struct klass_def } } 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) + if(::eolian_function_scope_get(function, EOLIAN_PROP_SET) != EOLIAN_SCOPE_PRIVATE) { function_def f(function, EOLIAN_PROP_SET, NULL, unit); functions.push_back(f); @@ -1107,8 +1287,7 @@ struct klass_def } else try { - if(! ::eolian_function_is_legacy_only(function, func_type) - && ::eolian_function_scope_get(function, func_type) != EOLIAN_SCOPE_PRIVATE) + if(::eolian_function_scope_get(function, func_type) != EOLIAN_SCOPE_PRIVATE) { efl::eina::optional getter(nullptr); efl::eina::optional setter(nullptr); @@ -1129,8 +1308,7 @@ struct klass_def try { Eolian_Function const* function = &*eolian_functions; 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) + if(::eolian_function_scope_get(function, func_type) != EOLIAN_SCOPE_PRIVATE) functions.push_back({function, EOLIAN_METHOD, NULL, unit}); } catch(std::exception const&) {} } @@ -1197,6 +1375,10 @@ struct klass_def } catch(std::exception const&) {} } + for(efl::eina::iterator constructor_iterator(::eolian_class_constructors_get(klass)) + , constructor_last; constructor_iterator != constructor_last; ++constructor_iterator) + constructors.push_back({&*constructor_iterator, unit}); + documentation = eolian_class_documentation_get(klass); } @@ -1248,6 +1430,22 @@ struct klass_def return ret; } + + std::vector get_all_constructors() const + { + std::vector ret; + + std::copy(constructors.cbegin(), constructors.cend(), std::back_inserter(ret)); + + for (auto inherit : inherits) + { + klass_def klass(get_klass(inherit, unit), unit); + std::copy(klass.constructors.cbegin(), klass.constructors.cend(), + std::back_inserter(ret)); + } + + return ret; + } }; struct value_def @@ -1335,6 +1533,7 @@ struct struct_def std::string cxx_name; std::vector namespaces; std::vector fields; + bool is_beta; documentation_def documentation; struct_def(Eolian_Typedecl const* struct_obj, Eolian_Unit const* unit) @@ -1353,13 +1552,15 @@ struct struct_def this->fields.push_back(field_def); } + is_beta = eolian_object_is_beta(EOLIAN_OBJECT(struct_obj)); + documentation = ::eolian_typedecl_documentation_get(struct_obj); } }; inline klass_name get_klass_name(klass_def const& klass) { - return {klass.namespaces, klass.eolian_name, {qualifier_info::is_none, {}}, klass.type, klass.klass_get_name}; + return {klass.namespaces, klass.eolian_name, {qualifier_info::is_none, {}}, klass.type, klass.klass_get_name, klass.is_beta}; } inline Eolian_Class const* get_klass(klass_name const& klass_name_, Eolian_Unit const* unit) diff --git a/src/lib/ephysics/EPhysics.h b/src/lib/ephysics/EPhysics.h index 2311975aab..cc5d221156 100644 --- a/src/lib/ephysics/EPhysics.h +++ b/src/lib/ephysics/EPhysics.h @@ -446,7 +446,7 @@ EAPI double ephysics_quaternion_angle_get(const EPhysics_Quaternion *quat1, cons * Return the length of the quaternion. * * @param quat Quaternion to get length of. - * @return The lenght of @p quat or @c 0 on error. + * @return The length of @p quat or @c 0 on error. * * @ingroup EPhysics_Quaternion */ @@ -457,7 +457,7 @@ EAPI double ephysics_quaternion_length_get(const EPhysics_Quaternion *quat); * Return the length squared of the quaternion. * * @param quat Quaternion to get length of. - * @return The lenght of @p quat or @c 0 on error. + * @return The length of @p quat or @c 0 on error. * * @ingroup EPhysics_Quaternion */ @@ -489,7 +489,7 @@ EAPI double ephysics_quaternion_length2_get(const EPhysics_Quaternion *quat); * @ref ephysics_shape_save(). With that shapes can be done or visualized * on design applications. * - * @note Using primitive shapes has better perfomance than generic shapes. + * @note Using primitive shapes has better performance than generic shapes. * @note For now, only convex shapes are supported. * */ @@ -2435,11 +2435,11 @@ EAPI double ephysics_body_soft_body_drag_coefficient_get(const EPhysics_Body *bo * * While dragging a soft body the user may want to freeze a specific trimesh * face, after calling this function EPhysics will do freeze the @p triangle - * untill it gets a call to unset it with + * until it gets a call to unset it with * ephysics_body_soft_body_dragging_unset(). * * @note Freezing a specific trimesh face means no forces are applied to it, no - * gravity enforced, that's @p triangle will have no mass untill it dragging + * gravity enforced, that's @p triangle will have no mass until it dragging * gets unset. * * @param body The body of interest. diff --git a/src/lib/escape/sys/mman.h b/src/lib/escape/sys/mman.h index aebbbc98db..6c328c4add 100644 --- a/src/lib/escape/sys/mman.h +++ b/src/lib/escape/sys/mman.h @@ -122,7 +122,7 @@ EAPI void *mmap(void *addr, * Unmaps a mapped view of a file from the calling process's * address space. @p addr is the pointer to the base address. * This value must be identical to the value returned by a - * previous call to mmap(). The parameter @p len is unsed. + * previous call to mmap(). The parameter @p len is unused. * * Conformity: None. * diff --git a/src/lib/ethumb_client/Ethumb_Client.h b/src/lib/ethumb_client/Ethumb_Client.h index c8d90b230d..ecf8f07c01 100644 --- a/src/lib/ethumb_client/Ethumb_Client.h +++ b/src/lib/ethumb_client/Ethumb_Client.h @@ -112,7 +112,7 @@ typedef void (*Ethumb_Client_Generate_Cb)(void *data, Ethumb_Client *client, int * @param data extra context given to ethumb_client_thumb_exists(). * * During the execution of the callback the state of the @p client is - * temporarily realy restored to what it was when the call to + * temporarily really restored to what it was when the call to * ethumb_client_thumb_exists() was done. */ typedef void (*Ethumb_Client_Thumb_Exists_Cb)(void *data, Ethumb_Client *client, Ethumb_Exists *thread, Eina_Bool exists); diff --git a/src/lib/evas/Evas.h b/src/lib/evas/Evas.h index ad3f16fe4a..9044398971 100644 --- a/src/lib/evas/Evas.h +++ b/src/lib/evas/Evas.h @@ -168,11 +168,10 @@ #include -/* This include has been added to support Eo in Evas */ #include +/* This include has been added to support Eo in Evas */ #include - #include #ifdef EAPI @@ -205,11 +204,19 @@ extern "C" { #endif +#include +#include +#include +#include #include + + #ifndef EFL_NOLEGACY_API_SUPPORT #include #endif +#ifdef EFL_BETA_API_SUPPORT #include +#endif #ifdef __cplusplus } diff --git a/src/lib/evas/Evas.hh b/src/lib/evas/Evas.hh index 064d8c184e..ac9b6509ed 100644 --- a/src/lib/evas/Evas.hh +++ b/src/lib/evas/Evas.hh @@ -8,9 +8,6 @@ #ifndef EFL_BETA_API_SUPPORT #define EFL_BETA_API_SUPPORT #endif -#ifndef EFL_EO_API_SUPPORT -#define EFL_EO_API_SUPPORT -#endif #include diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h index 9a25131fdb..9eb765f330 100644 --- a/src/lib/evas/Evas_Common.h +++ b/src/lib/evas/Evas_Common.h @@ -89,7 +89,7 @@ EAPI extern Evas_Version * evas_version; * @since 1.1 */ // Support not having eo available -#if defined (EFL_BETA_API_SUPPORT) && defined(EFL_EO_API_SUPPORT) +#ifdef EFL_BETA_API_SUPPORT typedef Efl_Callback_Priority Evas_Callback_Priority; #else typedef short Evas_Callback_Priority; @@ -246,10 +246,12 @@ 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_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_Image_Content_Hint +{ + EVAS_IMAGE_CONTENT_HINT_NONE = 0, /**< No hint at all */ + EVAS_IMAGE_CONTENT_HINT_DYNAMIC = 1, /**< The contents will change over time */ + EVAS_IMAGE_CONTENT_HINT_STATIC = 2 /**< The contents won't change over time */ +} Evas_Image_Content_Hint; /**< How an image's data is to be treated by Evas, for optimization */ typedef enum _Evas_Alloc_Error { @@ -295,17 +297,18 @@ typedef enum _Evas_Engine_Render_Mode typedef Efl_Gfx_Event_Render_Post Evas_Event_Render_Post; /**< Event info sent after a frame was rendered. @since 1.18 */ -typedef Efl_Input_Device_Type Evas_Device_Class; - -#define EVAS_DEVICE_CLASS_NONE EFL_INPUT_DEVICE_TYPE_NONE /**< Not a device @since 1.8 */ -#define EVAS_DEVICE_CLASS_SEAT EFL_INPUT_DEVICE_TYPE_SEAT /**< The user/seat (the user themselves) @since 1.8 */ -#define EVAS_DEVICE_CLASS_KEYBOARD EFL_INPUT_DEVICE_TYPE_KEYBOARD /**< A regular keyboard, numberpad or attached buttons @since 1.8 */ -#define EVAS_DEVICE_CLASS_MOUSE EFL_INPUT_DEVICE_TYPE_MOUSE /**< A mouse, trackball or touchpad relative motion device @since 1.8 */ -#define EVAS_DEVICE_CLASS_TOUCH EFL_INPUT_DEVICE_TYPE_TOUCH /**< A touchscreen with fingers or stylus @since 1.8 */ -#define EVAS_DEVICE_CLASS_PEN EFL_INPUT_DEVICE_TYPE_PEN /**< A special pen device @since 1.8 */ -#define EVAS_DEVICE_CLASS_POINTER EFL_INPUT_DEVICE_TYPE_WAND /**< A laser pointer, wii-style or "minority report" pointing device @since 1.8 */ -#define EVAS_DEVICE_CLASS_WAND EFL_INPUT_DEVICE_TYPE_WAND /**< A synonym for EVAS_DEVICE_CLASS_POINTER @since 1.18 */ -#define EVAS_DEVICE_CLASS_GAMEPAD EFL_INPUT_DEVICE_TYPE_GAMEPAD /**< A gamepad controller or joystick @since 1.8 */ +typedef enum _Evas_Device_Class +{ + EVAS_DEVICE_CLASS_NONE, /**< Not a device @since 1.8 */ + EVAS_DEVICE_CLASS_SEAT, /**< The user/seat (the user themselves) @since 1.8 */ + EVAS_DEVICE_CLASS_KEYBOARD, /**< A regular keyboard, numberpad or attached buttons @since 1.8 */ + EVAS_DEVICE_CLASS_MOUSE, /**< A mouse, trackball or touchpad relative motion device @since 1.8 */ + EVAS_DEVICE_CLASS_TOUCH, /**< A touchscreen with fingers or stylus @since 1.8 */ + EVAS_DEVICE_CLASS_PEN, /**< A special pen device @since 1.8 */ +#define EVAS_DEVICE_CLASS_WAND EVAS_DEVICE_CLASS_POINTER + EVAS_DEVICE_CLASS_POINTER, /**< A laser pointer, wii-style or "minority report" pointing device @since 1.8 */ + EVAS_DEVICE_CLASS_GAMEPAD /**< A gamepad controller or joystick @since 1.8 */ +} Evas_Device_Class; /**< A general class of device @since 1.8 */ /** * @brief Specific type of input device. @@ -329,39 +332,65 @@ typedef enum EVAS_DEVICE_SUBCLASS_TRACKBALL /**< A trackball style mouse. */ } Evas_Device_Subclass; -typedef Efl_Pointer_Flags Evas_Button_Flags; +/** + * Flags for Mouse Button events + */ +typedef enum _Evas_Button_Flags +{ + EVAS_BUTTON_NONE = 0, /**< No extra mouse button data */ + EVAS_BUTTON_DOUBLE_CLICK = (1 << 0), /**< This mouse button press was the 2nd press of a double click */ + EVAS_BUTTON_TRIPLE_CLICK = (1 << 1) /**< This mouse button press was the 3rd press of a triple click */ +} Evas_Button_Flags; /**< Flags for Mouse Button events */ -#define EVAS_BUTTON_NONE EFL_POINTER_FLAGS_NONE -#define EVAS_BUTTON_DOUBLE_CLICK EFL_POINTER_FLAGS_DOUBLE_CLICK -#define EVAS_BUTTON_TRIPLE_CLICK EFL_POINTER_FLAGS_TRIPLE_CLICK +/** + * Flags for Events + */ +typedef enum _Evas_Event_Flags +{ + EVAS_EVENT_FLAG_NONE = 0, /**< No fancy flags set */ + EVAS_EVENT_FLAG_ON_HOLD = (1 << 0), /**< This event is being delivered but should be put "on hold" until the on hold flag is unset. The event should be used for informational purposes and maybe some indications visually, but not actually perform anything */ + EVAS_EVENT_FLAG_ON_SCROLL = (1 << 1) /**< This event flag indicates the event occurs while scrolling; for example, DOWN event occurs during scrolling; the event should be used for informational purposes and maybe some indications visually, but not actually perform anything */ +} Evas_Event_Flags; /**< Flags for Events */ -typedef Efl_Input_Flags Evas_Event_Flags; +typedef enum _Evas_Aspect_Control +{ + EVAS_ASPECT_CONTROL_NONE = 0, /**< Preference on scaling unset */ + EVAS_ASPECT_CONTROL_NEITHER = 1, /**< Same effect as unset preference on scaling */ + EVAS_ASPECT_CONTROL_HORIZONTAL = 2, /**< Use all horizontal container space to place an object, using the given aspect */ + EVAS_ASPECT_CONTROL_VERTICAL = 3, /**< Use all vertical container space to place an object, using the given aspect */ + EVAS_ASPECT_CONTROL_BOTH = 4 /**< Use all horizontal @b and vertical container spaces to place an object (never growing it out of those bounds), using the given aspect */ +} Evas_Aspect_Control; /**< Aspect types/policies for scaling size hints, used for evas_object_size_hint_aspect_set() */ -#define EVAS_EVENT_FLAG_NONE EFL_INPUT_FLAGS_NONE -#define EVAS_EVENT_FLAG_ON_HOLD EFL_INPUT_FLAGS_PROCESSED -#define EVAS_EVENT_FLAG_ON_SCROLL EFL_INPUT_FLAGS_SCROLLING +typedef enum _Evas_BiDi_Direction +{ + EVAS_BIDI_DIRECTION_NATURAL, + EVAS_BIDI_DIRECTION_NEUTRAL = EVAS_BIDI_DIRECTION_NATURAL, + EVAS_BIDI_DIRECTION_LTR, + EVAS_BIDI_DIRECTION_RTL, + EVAS_BIDI_DIRECTION_INHERIT +} Evas_BiDi_Direction; -typedef Efl_Gfx_Size_Hint_Aspect Evas_Aspect_Control; /**< Aspect types/policies for scaling size hints, used for evas_object_size_hint_aspect_set */ - -#define EVAS_ASPECT_CONTROL_NONE EFL_GFX_SIZE_HINT_ASPECT_NONE -#define EVAS_ASPECT_CONTROL_NEITHER EFL_GFX_SIZE_HINT_ASPECT_NEITHER -#define EVAS_ASPECT_CONTROL_HORIZONTAL EFL_GFX_SIZE_HINT_ASPECT_HORIZONTAL -#define EVAS_ASPECT_CONTROL_VERTICAL EFL_GFX_SIZE_HINT_ASPECT_VERTICAL -#define EVAS_ASPECT_CONTROL_BOTH EFL_GFX_SIZE_HINT_ASPECT_BOTH - -typedef Efl_Text_Bidirectional_Type Evas_BiDi_Direction; - -#define EVAS_BIDI_DIRECTION_NATURAL EFL_TEXT_BIDIRECTIONAL_TYPE_NATURAL -#define EVAS_BIDI_DIRECTION_NEUTRAL EFL_TEXT_BIDIRECTIONAL_TYPE_NEUTRAL -#define EVAS_BIDI_DIRECTION_LTR EFL_TEXT_BIDIRECTIONAL_TYPE_LTR -#define EVAS_BIDI_DIRECTION_RTL EFL_TEXT_BIDIRECTIONAL_TYPE_RTL -#define EVAS_BIDI_DIRECTION_INHERIT EFL_TEXT_BIDIRECTIONAL_TYPE_INHERIT - -typedef Efl_Input_Object_Pointer_Mode Evas_Object_Pointer_Mode; - -#define EVAS_OBJECT_POINTER_MODE_AUTOGRAB EFL_INPUT_OBJECT_POINTER_MODE_AUTO_GRAB -#define EVAS_OBJECT_POINTER_MODE_NOGRAB EFL_INPUT_OBJECT_POINTER_MODE_NO_GRAB -#define EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN EFL_INPUT_OBJECT_POINTER_MODE_NO_GRAB_NO_REPEAT_UPDOWN +/** + * How the mouse pointer should be handled by Evas. + * + * In the mode #EVAS_OBJECT_POINTER_MODE_AUTOGRAB, when a mouse button + * is pressed down over an object and held, with the mouse pointer + * being moved outside of it, the pointer still behaves as being bound + * to that object, albeit out of its drawing region. When the button + * is released, the event will be fed to the object, that may check if + * the final position is over it or not and do something about it. + * + * In the mode #EVAS_OBJECT_POINTER_MODE_NOGRAB, the pointer will + * always be bound to the object right below it. + * + * @ingroup Evas_Object_Group_Extras + */ +typedef enum _Evas_Object_Pointer_Mode +{ + EVAS_OBJECT_POINTER_MODE_AUTOGRAB, /**< default, X11-like */ + EVAS_OBJECT_POINTER_MODE_NOGRAB, /**< pointer always bound to the object right below it */ + EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN /**< useful on object with "repeat events" enabled, where mouse/touch up and down events WONT be repeated to objects and these objects wont be auto-grabbed. @since 1.2 */ +} Evas_Object_Pointer_Mode; /**< How the mouse pointer should be handled by Evas. */ // FIXME: Move to Evas_Legacy.h /** Identifier of callbacks to be set for Evas canvases or Evas objects. */ @@ -1003,7 +1032,7 @@ EAPI const Eina_List *evas_device_list(Evas *e, const Evas_Device *dev); * @param e The canvas to find the device on * @param name The name of the device. * - * Gets the first ocurrence of a device named as @p name + * Gets the first occurrence of a device named as @p name * on Evas @p e list of devices. * * @return the device or NULL if an error occurred, no name was provided, @@ -3454,6 +3483,28 @@ typedef Eo Efl_Animation_Group_Sequential; #define EFL_ANIMATION_REPEAT_INFINITE -1 #define EFL_ANIMATION_PLAYER_REPEAT_INFINITE -1 +#ifndef _EFL_INPUT_DEVICE_EO_H_ +#define _EFL_INPUT_DEVICE_EO_H_ +typedef Eo Efl_Input_Device; +typedef unsigned int Efl_Input_Device_Type; + +#endif + +#ifndef _EFL_TEXT_CURSOR_EO_H_ +#define _EFL_TEXT_CURSOR_EO_H_ + +#endif +#ifndef _EFL_GFX_ENTITY_EO_H_ +#define _EFL_GFX_ENTITY_EO_H_ + +#ifndef _EFL_GFX_ENTITY_EO_CLASS_TYPE +#define _EFL_GFX_ENTITY_EO_CLASS_TYPE + +typedef Eo Efl_Gfx_Entity; + +#endif +#endif + /** * @} */ diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h index 9cea6ddc77..a4f611e201 100644 --- a/src/lib/evas/Evas_Eo.h +++ b/src/lib/evas/Evas_Eo.h @@ -2,8 +2,6 @@ # error You shall not include this header directly #endif -#ifdef EFL_EO_API_SUPPORT - #ifndef _EFL_CANVAS_VG_NODE_EO_CLASS_TYPE #define _EFL_CANVAS_VG_NODE_EO_CLASS_TYPE @@ -200,11 +198,6 @@ struct _Efl_Canvas_Object_Animation_Event #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_event_grabber.eo.h" /** @@ -418,17 +411,13 @@ typedef void (Evas_Canvas3D_Surface_Func)(Evas_Real *out_x, #include "canvas/evas_canvas3d_scene.eo.h" #include "canvas/efl_canvas_scene3d.eo.h" -#endif /* EFL_BETA_API_SUPPORT */ -#ifdef EFL_EO_API_SUPPORT #include "canvas/efl_canvas_image_internal.eo.h" #include "canvas/efl_canvas_image.eo.h" #include "canvas/efl_canvas_snapshot.eo.h" #include "canvas/efl_canvas_proxy.eo.h" -#include "canvas/efl_gfx_map.eo.h" -#endif /* EFL_EO_API_SUPPORT */ +#include "canvas/efl_gfx_mapping.eo.h" -#if defined(EFL_BETA_API_SUPPORT) && defined(EFL_EO_API_SUPPORT) /** * @ingroup Evas_Object_VG * @@ -445,9 +434,7 @@ typedef void (Evas_Canvas3D_Surface_Func)(Evas_Real *out_x, #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 #include "canvas/efl_input_state.eo.h" #include "canvas/efl_input_event.eo.h" #include "canvas/efl_input_pointer.eo.h" @@ -455,9 +442,7 @@ typedef void (Evas_Canvas3D_Surface_Func)(Evas_Real *out_x, #include "canvas/efl_input_hold.eo.h" #include "canvas/efl_input_interface.eo.h" #include "canvas/efl_input_focus.eo.h" -#endif /* EFL_EO_API_SUPPORT */ -#ifdef EFL_EO_API_SUPPORT # include "gesture/efl_canvas_gesture_types.eot.h" # include "gesture/efl_canvas_gesture_touch.eo.h" # include "gesture/efl_canvas_gesture.eo.h" @@ -465,4 +450,3 @@ typedef void (Evas_Canvas3D_Surface_Func)(Evas_Real *out_x, # 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_Internal.h b/src/lib/evas/Evas_Internal.h index b65277ed2d..48b7928014 100644 --- a/src/lib/evas/Evas_Internal.h +++ b/src/lib/evas/Evas_Internal.h @@ -56,7 +56,7 @@ static inline void evas_object_size_hint_combined_min_get(const Eo *obj, int *w, int *h) { Eina_Size2D sz; - sz = efl_gfx_size_hint_combined_min_get(obj); + sz = efl_gfx_hint_size_combined_min_get(obj); if (w) *w = sz.w; if (h) *h = sz.h; } @@ -74,7 +74,49 @@ EOAPI void evas_canvas_seat_focus_out(Eo *obj, Efl_Input_Device *seat); EOAPI Eo* evas_canvas_seat_focus_get(const Eo *obj, Efl_Input_Device *seat); EOAPI void *efl_input_legacy_info_get(const Eo *obj); -EOAPI Eo *efl_input_instance_get(const Eo *obj, Efl_Object *owner, void **priv); + +EOAPI Eo *efl_input_focus_instance_get(Efl_Object *owner, void **priv); +EOAPI Eo *efl_input_hold_instance_get(Efl_Object *owner, void **priv); +EOAPI Eo *efl_input_key_instance_get(Efl_Object *owner, void **priv); +EOAPI Eo *efl_input_pointer_instance_get(Efl_Object *owner, void **priv); +/** + * @brief If @c true the object belongs to the window border decorations. + * + * This will be @c false by default, and should be @c false for all objects + * created by the application, unless swallowed in some very specific parts of + * the window. + * + * It is very unlikely that an application needs to call this manually, as the + * window will handle this feature automatically. + * + * @param[in] obj The object. + * @param[in] is_frame @c true if the object is a frame, @c false otherwise + * + * @since 1.2 + * + * @ingroup Efl_Canvas_Object + */ +EOAPI void efl_canvas_object_is_frame_object_set(Eo *obj, Eina_Bool is_frame); + +/** + * @brief If @c true the object belongs to the window border decorations. + * + * This will be @c false by default, and should be @c false for all objects + * created by the application, unless swallowed in some very specific parts of + * the window. + * + * It is very unlikely that an application needs to call this manually, as the + * window will handle this feature automatically. + * + * @param[in] obj The object. + * + * @return @c true if the object is a frame, @c false otherwise + * + * @since 1.2 + * + * @ingroup Efl_Canvas_Object + */ +EOAPI Eina_Bool efl_canvas_object_is_frame_object_get(const Eo *obj); EWAPI extern const Efl_Event_Description _EVAS_CANVAS_EVENT_RENDER_FLUSH_PRE; #define EVAS_CANVAS_EVENT_RENDER_FLUSH_PRE (&(_EVAS_CANVAS_EVENT_RENDER_FLUSH_PRE)) diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index 28ca5a4d1a..da04d40c62 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -102,7 +102,7 @@ EAPI Evas_Engine_Info *evas_engine_info_get(const Evas *obj); EAPI Eina_Bool evas_image_max_size_get(Eo *eo_e, int *w, int *h); -#include "canvas/evas_canvas.eo.legacy.h" +#include "canvas/evas_canvas_eo.legacy.h" /** * @} @@ -684,7 +684,7 @@ EAPI void evas_event_thaw_eval(Evas *e) EINA_ARG_NONNULL(1); /** * @brief Mouse move event feed. * - * This function will set some evas properties that is necessary when the mouse + * This function will set some evas properties that are necessary when the mouse * is moved from its last position. It prepares information to be treated by * the callback function. * @@ -715,7 +715,7 @@ EAPI void evas_event_input_mouse_move(Evas *obj, int x, int y, unsig /** * @brief Mouse up event feed. * - * This function will set some evas properties that is necessary when the mouse + * This function will set some evas properties that are necessary when the mouse * button is released. It prepares information to be treated by the callback * function. * @@ -728,7 +728,7 @@ EAPI void evas_event_feed_mouse_up(Evas *obj, int b, Evas_Button_Fla /** * @brief Mouse down event feed. * - * This function will set some evas properties that is necessary when the mouse + * This function will set some evas properties that are necessary when the mouse * button is pressed. It prepares information to be treated by the callback * function. * @@ -741,7 +741,7 @@ EAPI void evas_event_feed_mouse_down(Evas *obj, int b, Evas_Button_F /** * @brief Mouse wheel event feed. * - * This function will set some evas properties that is necessary when the mouse + * This function will set some evas properties that are necessary when the mouse * wheel is scrolled up or down. It prepares information to be treated by the * callback function. * @@ -754,7 +754,7 @@ EAPI void evas_event_feed_mouse_wheel(Evas *obj, int direction, int /** * @brief Mouse in event feed. * - * This function will set some evas properties that is necessary when the mouse + * This function will set some evas properties that are necessary when the mouse * in event happens. It prepares information to be treated by the callback * function. * @@ -765,7 +765,7 @@ EAPI void evas_event_feed_mouse_in(Evas *obj, unsigned int timestamp /** * @brief Mouse out event feed. * - * This function will set some evas properties that is necessar when the mouse + * This function will set some evas properties that are necessary when the mouse * out event happens. It prepares information to be treated by the callback * function. * @@ -793,7 +793,7 @@ EAPI void evas_event_feed_multi_up(Evas *obj, int d, int x, int y, d /** * @brief Key down event feed. * - * This function will set some evas properties that is necessary when a key is + * This function will set some evas properties that are necessary when a key is * pressed. It prepares information to be treated by the callback function. * * @param[in] key The key pressed. @@ -807,7 +807,7 @@ EAPI void evas_event_feed_key_down(Evas *obj, const char *keyname, c /** * @brief Key up event feed. * - * This function will set some evas properties that is necessary when a key is + * This function will set some evas properties that are necessary when a key is * released. It prepares information to be treated by the callback function. * * @param[in] key The key released. @@ -821,7 +821,7 @@ EAPI void evas_event_feed_key_up(Evas *obj, const char *keyname, con /** * @brief Key down event feed with keycode. * - * This function will set some evas properties that is necessary when a key is + * This function will set some evas properties that are necessary when a key is * pressed. It prepares information to be treated by the callback function. * * @param[in] key The key released. @@ -838,7 +838,7 @@ EAPI void evas_event_feed_key_down_with_keycode(Evas *obj, const cha /** * @brief Key up event feed with keycode. * - * This function will set some evas properties that is necessary when a key is + * This function will set some evas properties that are necessary when a key is * released. It prepares information to be treated by the callback function. * * @param[in] key The key released. @@ -855,7 +855,7 @@ EAPI void evas_event_feed_key_up_with_keycode(Evas *obj, const char /** * @brief Input device axis update event feed. * - * This function will set some evas properties that is necessary when an e.g. + * This function will set some evas properties that are necessary when an e.g. * stylus axis is updated. It prepares information to be treated by the * callback function. * @@ -1628,7 +1628,7 @@ EAPI void evas_object_size_hint_max_get(const Evas_Object *obj, Evas_Coord *w, E /** * @brief Sets the hints for an object's optimum size. * - * This is not a size enforcement in any way, it's just a hint that hould be + * This is not a size enforcement in any way, it's just a hint that should be * used whenever appropriate. * * Values 0 will be treated as unset hint components, when queried by managers. @@ -1895,21 +1895,21 @@ EAPI void evas_object_size_hint_aspect_get(const Evas_Object *obj, Evas_Aspect_C /** Display mode size hint. */ typedef enum { - EFL_GFX_SIZE_HINT_MODE_NONE = 0, /**< Default mode */ - EFL_GFX_SIZE_HINT_MODE_COMPRESS = 1, /**< Use this mode when you want to give + EFL_GFX_HINT_MODE_NONE = 0, /**< Default mode */ + EFL_GFX_HINT_MODE_COMPRESS = 1, /**< Use this mode when you want to give * compress display mode hint to an object */ - EFL_GFX_SIZE_HINT_MODE_EXPAND = 2, /**< Use this mode when you want to give + EFL_GFX_HINT_MODE_EXPAND = 2, /**< Use this mode when you want to give * expand display mode hint to an object */ - EFL_GFX_SIZE_HINT_MODE_DONT_CHANGE = 3 /**< Use this mode when an object + EFL_GFX_HINT_MODE_DONT_CHANGE = 3 /**< Use this mode when an object * should not change its display mode */ -} Efl_Gfx_Size_Hint_Mode; +} Efl_Gfx_Hint_Mode; -typedef Efl_Gfx_Size_Hint_Mode Evas_Display_Mode; +typedef Efl_Gfx_Hint_Mode Evas_Display_Mode; -#define EVAS_DISPLAY_MODE_NONE EFL_GFX_SIZE_HINT_MODE_NONE -#define EVAS_DISPLAY_MODE_COMPRESS EFL_GFX_SIZE_HINT_MODE_COMPRESS -#define EVAS_DISPLAY_MODE_EXPAND EFL_GFX_SIZE_HINT_MODE_EXPAND -#define EVAS_DISPLAY_MODE_DONT_CHANGE EFL_GFX_SIZE_HINT_MODE_DONT_CHANGE +#define EVAS_DISPLAY_MODE_NONE EFL_GFX_HINT_MODE_NONE +#define EVAS_DISPLAY_MODE_COMPRESS EFL_GFX_HINT_MODE_COMPRESS +#define EVAS_DISPLAY_MODE_EXPAND EFL_GFX_HINT_MODE_EXPAND +#define EVAS_DISPLAY_MODE_DONT_CHANGE EFL_GFX_HINT_MODE_DONT_CHANGE /** * @brief Sets the hints for an object's disply mode, @@ -2130,6 +2130,19 @@ EAPI void evas_object_static_clip_set(Evas_Object *obj, Eina_Bool is_static_clip */ EAPI const Eina_List *evas_object_clipees_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT; +/** + * @brief Test if any object is clipped by @c obj. + * + * @param[in] obj The object. + * + * @return @c true if any object is clipped by @c obj, @c false otherwise + * + * @since 1.8 + * + * @ingroup Evas_Object + */ +EAPI Eina_Bool evas_object_clipees_has(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT; + /** How the object should be rendered to output. * * @ingroup Evas @@ -2282,7 +2295,7 @@ EAPI Eina_Bool evas_object_pointer_inside_get(const Evas_Object *obj) EINA_WARN_ EAPI Eina_Bool evas_object_pointer_coords_inside_get(const Evas_Object *eo_obj, int x, int y) EINA_WARN_UNUSED_RESULT; -#include "canvas/efl_canvas_object.eo.legacy.h" +#include "canvas/efl_canvas_object_eo.legacy.h" /** * @brief Get the Evas to which this object belongs to @@ -2786,7 +2799,7 @@ EAPI void evas_object_data_set(Evas_Object *obj, const char * will be returned. If this is not the case, @c NULL will be * returned, signifying an invalid object or a non-existent key. It is * possible that a @c NULL pointer was stored given that key, but this - * situation is non-sensical and thus can be considered an error as + * situation is nonsensical and thus can be considered an error as * well. @c NULL pointers are never stored as this is the return value * if an error occurs. * @@ -3602,9 +3615,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_node.eo.legacy.h" -#include "canvas/efl_canvas_vg_object.eo.legacy.h" -#include "canvas/efl_canvas_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. * @@ -3797,7 +3810,7 @@ EAPI void evas_vg_node_raise(Eo *obj); */ EAPI void evas_vg_node_lower(Eo *obj); -#include "canvas/efl_canvas_vg_node.eo.legacy.h" +#include "canvas/efl_canvas_vg_node_eo.legacy.h" /** * @@ -4240,7 +4253,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_canvas_vg_shape.eo.legacy.h" +#include "canvas/efl_canvas_vg_shape_eo.legacy.h" /** * @@ -5094,7 +5107,7 @@ EAPI int evas_object_image_load_scale_down_get(const Evas_Object *obj); EAPI void evas_object_image_load_head_skip_set(Evas_Object *obj, Eina_Bool skip); /** - * @breif Get the load option to skip header loads before preload + * @brief Get the load option to skip header loads before preload * * This gets the heade skip value set by evas_object_image_load_head_skip_set() * @@ -5925,7 +5938,7 @@ EAPI void evas_object_image_reload(Evas_Object *obj) EINA_DEPRECATED; */ EAPI void evas_object_image_alpha_mask_set(Evas_Object *obj, Eina_Bool ismask) EINA_ARG_NONNULL(1) EINA_DEPRECATED; -#include "canvas/evas_image.eo.legacy.h" +#include "canvas/evas_image_eo.legacy.h" /** * @} @@ -6009,7 +6022,7 @@ typedef enum EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT = 112 /* 7 >> 4 */ /**< shadow growing to the right */ } Evas_Text_Style_Type; -#include "canvas/evas_text.eo.legacy.h" +#include "canvas/evas_text_eo.legacy.h" /** * @@ -6095,7 +6108,7 @@ EAPI void evas_object_text_font_get(const Eo *obj, const char **font, Evas_Font_ */ EAPI Evas_Object *evas_object_textgrid_add(Evas *e); -#include "canvas/evas_textgrid.eo.legacy.h" +#include "canvas/evas_textgrid_eo.legacy.h" /** * @@ -6199,7 +6212,7 @@ EAPI void evas_object_textgrid_font_get(const Eo *obj, const char **font_name, E */ EAPI Evas_Object *evas_object_line_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC; -#include "canvas/evas_line.eo.legacy.h" +#include "canvas/evas_line_eo.legacy.h" /** * @} @@ -6641,7 +6654,7 @@ EAPI Evas_Object *evas_object_smart_clipped_clipper_get(const Evas_Object *obj) * This function will return @c null when a non-smart object is passed. * * See also @ref Efl.Canvas.Group.group_member_add, - * @ref Efl.Canvas.Group.group_member_del and @ref evas_object_smart_iterator_new. + * @ref Efl.Canvas.Group.group_member_remove and @ref evas_object_smart_iterator_new. * * @return Returns the list of the member objects of @c obj. * @@ -6698,7 +6711,7 @@ EAPI Eina_Bool evas_object_smart_need_recalculate_get(const Evas_Object *obj); * object. * * See also @ref Efl.Canvas.Group.group_member_add and - * @ref Efl.Canvas.Group.group_member_del + * @ref Efl.Canvas.Group.group_member_remove * * @return Returns the iterator of the member objects of @c obj. * @@ -6755,7 +6768,7 @@ EAPI void evas_object_smart_changed(Evas_Object *obj); */ EAPI void evas_object_smart_move_children_relative(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy); -#include "canvas/efl_canvas_group.eo.legacy.h" +#include "canvas/efl_canvas_group_eo.legacy.h" /** * @} @@ -6891,7 +6904,7 @@ EAPI Eina_Bool evas_object_box_option_property_get(const Evas_O */ EAPI Eina_List *evas_object_box_children_get(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC; -#include "canvas/evas_box.eo.legacy.h" +#include "canvas/evas_box_eo.legacy.h" /** * @} @@ -6938,7 +6951,7 @@ EAPI void evas_object_table_mirrored_set(Eo *obj, Eina_Bool mirrored); */ EAPI Eina_Bool evas_object_table_mirrored_get(const Eo *obj); -#include "canvas/evas_table.eo.legacy.h" +#include "canvas/evas_table_eo.legacy.h" /** * @} @@ -6988,7 +7001,7 @@ EAPI void evas_object_grid_mirrored_set(Eo *obj, Eina_Bool mirrored); */ EAPI Eina_Bool evas_object_grid_mirrored_get(const Eo *obj); -#include "canvas/evas_grid.eo.legacy.h" +#include "canvas/evas_grid_eo.legacy.h" /** * @} @@ -7524,7 +7537,7 @@ EAPI void evas_map_util_points_populate_from_geometry(Evas_Map *m, Ev /** * Set color of all points to given color. * - * This call is useful to reuse maps after they had 3d lightning or + * This call is useful to reuse maps after they had 3d lighting or * any other colorization applied before. * * @param m map to change the color of. @@ -8037,7 +8050,7 @@ EAPI void evas_object_map_enable_set(Evas_Object *obj, Eina_Bool enabled); */ EAPI Eina_Bool evas_object_map_enable_get(const Evas_Object *obj); -#include "canvas/efl_gfx_map.eo.legacy.h" +#include "canvas/efl_gfx_mapping.eo.legacy.h" /** * @brief Apply an evas filter program on this text object. @@ -8081,7 +8094,83 @@ 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_event_grabber.eo.legacy.h" + +/** + * @brief If @c true the object belongs to the window border decorations. + * + * This will be @c false by default, and should be @c false for all objects + * created by the application, unless swallowed in some very specific parts of + * the window. + * + * It is very unlikely that an application needs to call this manually, as the + * window will handle this feature automatically. + * + * @param[in] obj The object. + * @param[in] is_frame @c true if the object is a frame, @c false otherwise + * + * @since 1.2 + * + * @ingroup Evas_Object_Group + */ +EAPI void evas_object_is_frame_object_set(Efl_Canvas_Object *obj, Eina_Bool is_frame); + +/** + * @brief If @c true the object belongs to the window border decorations. + * + * This will be @c false by default, and should be @c false for all objects + * created by the application, unless swallowed in some very specific parts of + * the window. + * + * It is very unlikely that an application needs to call this manually, as the + * window will handle this feature automatically. + * + * @param[in] obj The object. + * + * @return @c true if the object is a frame, @c false otherwise + * + * @since 1.2 + * + * @ingroup Evas_Object_Group + */ +EAPI Eina_Bool evas_object_is_frame_object_get(const Efl_Canvas_Object *obj); + +/** + * @brief Set whether an Evas object is to freeze (discard) events. + * + * If @c freeze is @c true, it will force events on @c obj to be discarded. + * Unlike @ref evas_object_pass_events_set, events will not be passed to next + * lower object. This API can be used for blocking events while @c obj is in + * transition. + * + * If @c freeze is @c false, events will be processed on that object as normal. + * + * @warning If you block only key/mouse up events with this API, you can't be + * sure of the state of any objects that have only key/mouse down events. + * + * @param[in] obj The object. + * @param[in] freeze Pass when @c obj is to freeze events ($true) or not + * ($false). + * + * @since 1.1 + * + * @ingroup Evas_Object_Group + */ +EAPI void evas_object_freeze_events_set(Efl_Canvas_Object *obj, Eina_Bool freeze); + +/** + * @brief Determine whether an object is set to freeze (discard) events. + * + * @param[in] obj The object. + * + * @return Pass when @c obj is to freeze events ($true) or not ($false). + * + * @since 1.1 + * + * @ingroup Evas_Object_Group + */ +EAPI Eina_Bool evas_object_freeze_events_get(const Efl_Canvas_Object *obj); + +#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" diff --git a/src/lib/evas/Evas_Loader.h b/src/lib/evas/Evas_Loader.h index 5dbbab99df..787df4e81f 100644 --- a/src/lib/evas/Evas_Loader.h +++ b/src/lib/evas/Evas_Loader.h @@ -134,16 +134,17 @@ typedef Emile_Image_Property Evas_Image_Property; typedef struct _Evas_Image_Load_Func Evas_Image_Load_Func; -typedef Efl_Gfx_Image_Load_Error Evas_Load_Error; - -#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 enum +{ + EVAS_LOAD_ERROR_NONE = 0, + EVAS_LOAD_ERROR_GENERIC, + EVAS_LOAD_ERROR_DOES_NOT_EXIST, + EVAS_LOAD_ERROR_PERMISSION_DENIED, + EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED, + EVAS_LOAD_ERROR_CORRUPT_FILE, + EVAS_LOAD_ERROR_UNKNOWN_FORMAT, + EVAS_LOAD_ERROR_CANCELLED, +} Evas_Load_Error; typedef Emile_Image_Animated_Loop_Hint Evas_Image_Animated_Loop_Hint; @@ -161,29 +162,29 @@ typedef Emile_Image_Scale_Hint Evas_Image_Scale_Hint; /**< How an image's data i * Colorspaces for pixel data supported by Evas * @ingroup Evas_Object_Image */ -typedef Efl_Gfx_Colorspace Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */ +typedef Emile_Colorspace Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */ -#define EVAS_COLORSPACE_ARGB8888 EFL_GFX_COLORSPACE_ARGB8888 -#define EVAS_COLORSPACE_YCBCR422P601_PL EFL_GFX_COLORSPACE_YCBCR422P601_PL -#define EVAS_COLORSPACE_YCBCR422P709_PL EFL_GFX_COLORSPACE_YCBCR422P709_PL -#define EVAS_COLORSPACE_RGB565_A5P EFL_GFX_COLORSPACE_RGB565_A5P -#define EVAS_COLORSPACE_GRY8 EFL_GFX_COLORSPACE_GRY8 -#define EVAS_COLORSPACE_YCBCR422601_PL EFL_GFX_COLORSPACE_YCBCR422601_PL -#define EVAS_COLORSPACE_YCBCR420NV12601_PL EFL_GFX_COLORSPACE_YCBCR420NV12601_PL -#define EVAS_COLORSPACE_YCBCR420TM12601_PL EFL_GFX_COLORSPACE_YCBCR420TM12601_PL -#define EVAS_COLORSPACE_AGRY88 EFL_GFX_COLORSPACE_AGRY88 +#define EVAS_COLORSPACE_ARGB8888 EMILE_COLORSPACE_ARGB8888 +#define EVAS_COLORSPACE_YCBCR422P601_PL EMILE_COLORSPACE_YCBCR422P601_PL +#define EVAS_COLORSPACE_YCBCR422P709_PL EMILE_COLORSPACE_YCBCR422P709_PL +#define EVAS_COLORSPACE_RGB565_A5P EMILE_COLORSPACE_RGB565_A5P +#define EVAS_COLORSPACE_GRY8 EMILE_COLORSPACE_GRY8 +#define EVAS_COLORSPACE_YCBCR422601_PL EMILE_COLORSPACE_YCBCR422601_PL +#define EVAS_COLORSPACE_YCBCR420NV12601_PL EMILE_COLORSPACE_YCBCR420NV12601_PL +#define EVAS_COLORSPACE_YCBCR420TM12601_PL EMILE_COLORSPACE_YCBCR420TM12601_PL +#define EVAS_COLORSPACE_AGRY88 EMILE_COLORSPACE_AGRY88 // ETC1/2 support -#define EVAS_COLORSPACE_ETC1 EFL_GFX_COLORSPACE_ETC1 -#define EVAS_COLORSPACE_RGB8_ETC2 EFL_GFX_COLORSPACE_RGB8_ETC2 -#define EVAS_COLORSPACE_RGBA8_ETC2_EAC EFL_GFX_COLORSPACE_RGBA8_ETC2_EAC -#define EVAS_COLORSPACE_ETC1_ALPHA EFL_GFX_COLORSPACE_ETC1_ALPHA +#define EVAS_COLORSPACE_ETC1 EMILE_COLORSPACE_ETC1 +#define EVAS_COLORSPACE_RGB8_ETC2 EMILE_COLORSPACE_RGB8_ETC2 +#define EVAS_COLORSPACE_RGBA8_ETC2_EAC EMILE_COLORSPACE_RGBA8_ETC2_EAC +#define EVAS_COLORSPACE_ETC1_ALPHA EMILE_COLORSPACE_ETC1_ALPHA // S3TC support -#define EVAS_COLORSPACE_RGB_S3TC_DXT1 EFL_GFX_COLORSPACE_RGB_S3TC_DXT1 -#define EVAS_COLORSPACE_RGBA_S3TC_DXT1 EFL_GFX_COLORSPACE_RGBA_S3TC_DXT1 -#define EVAS_COLORSPACE_RGBA_S3TC_DXT2 EFL_GFX_COLORSPACE_RGBA_S3TC_DXT2 -#define EVAS_COLORSPACE_RGBA_S3TC_DXT3 EFL_GFX_COLORSPACE_RGBA_S3TC_DXT3 -#define EVAS_COLORSPACE_RGBA_S3TC_DXT4 EFL_GFX_COLORSPACE_RGBA_S3TC_DXT4 -#define EVAS_COLORSPACE_RGBA_S3TC_DXT5 EFL_GFX_COLORSPACE_RGBA_S3TC_DXT5 +#define EVAS_COLORSPACE_RGB_S3TC_DXT1 EMILE_COLORSPACE_RGB_S3TC_DXT1 +#define EVAS_COLORSPACE_RGBA_S3TC_DXT1 EMILE_COLORSPACE_RGBA_S3TC_DXT1 +#define EVAS_COLORSPACE_RGBA_S3TC_DXT2 EMILE_COLORSPACE_RGBA_S3TC_DXT2 +#define EVAS_COLORSPACE_RGBA_S3TC_DXT3 EMILE_COLORSPACE_RGBA_S3TC_DXT3 +#define EVAS_COLORSPACE_RGBA_S3TC_DXT4 EMILE_COLORSPACE_RGBA_S3TC_DXT4 +#define EVAS_COLORSPACE_RGBA_S3TC_DXT5 EMILE_COLORSPACE_RGBA_S3TC_DXT5 struct _Evas_Image_Load_Func { @@ -219,7 +220,7 @@ EAPI Eina_Bool evas_module_task_cancelled (void); /**< @since 1.19 */ Count = 0; \ if (evas_module_task_cancelled()) \ { \ - *Error = EFL_GFX_IMAGE_LOAD_ERROR_CANCELLED; \ + *Error = EVAS_LOAD_ERROR_CANCELLED; \ goto Error_Handler; \ } \ } \ diff --git a/src/lib/evas/canvas/efl_canvas_animation.eo b/src/lib/evas/canvas/efl_canvas_animation.eo index eb12ef8536..4198ccf592 100644 --- a/src/lib/evas/canvas/efl_canvas_animation.eo +++ b/src/lib/evas/canvas/efl_canvas_animation.eo @@ -1,6 +1,6 @@ import efl_canvas_animation_types; -abstract Efl.Canvas.Animation extends Efl.Object implements Efl.Playable +class @beta Efl.Canvas.Animation extends Efl.Object implements Efl.Playable { [[Efl animation class]] eo_prefix: efl_animation; @@ -62,7 +62,7 @@ abstract Efl.Canvas.Animation extends Efl.Object implements Efl.Playable get { } values { - interpolator: Efl.Interpolator; [[Interpolator which indicates interpolation fucntion. Efl_Interpolator is required.]] + interpolator: Efl.Interpolator; [[Interpolator which indicates interpolation function. Efl_Interpolator is required.]] } } animation_apply { diff --git a/src/lib/evas/canvas/efl_canvas_animation_alpha.c b/src/lib/evas/canvas/efl_canvas_animation_alpha.c index 8723aee184..c0bca11101 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_alpha.c +++ b/src/lib/evas/canvas/efl_canvas_animation_alpha.c @@ -43,7 +43,7 @@ _efl_canvas_animation_alpha_efl_canvas_animation_animation_apply(Eo *eo_obj, for (i = 0; i < 4; i++) { - efl_gfx_map_color_set(target, i, cur_alpha, cur_alpha, cur_alpha, cur_alpha); + efl_gfx_mapping_color_set(target, i, cur_alpha, cur_alpha, cur_alpha, cur_alpha); } return progress; diff --git a/src/lib/evas/canvas/efl_canvas_animation_alpha.eo b/src/lib/evas/canvas/efl_canvas_animation_alpha.eo index 1a4acfa73d..667e3c3f55 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_alpha.eo +++ b/src/lib/evas/canvas/efl_canvas_animation_alpha.eo @@ -1,4 +1,4 @@ -class Efl.Canvas.Animation_Alpha extends Efl.Canvas.Animation +class @beta Efl.Canvas.Animation_Alpha extends Efl.Canvas.Animation { [[Efl alpha animation class]] eo_prefix: efl_animation_alpha; diff --git a/src/lib/evas/canvas/efl_canvas_animation_group.eo b/src/lib/evas/canvas/efl_canvas_animation_group.eo index 091fc45e6c..6f8f77613b 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_group.eo +++ b/src/lib/evas/canvas/efl_canvas_animation_group.eo @@ -1,4 +1,4 @@ -abstract Efl.Canvas.Animation_Group extends Efl.Canvas.Animation +abstract @beta Efl.Canvas.Animation_Group extends Efl.Canvas.Animation { [[Efl group animation abstract class]] eo_prefix: efl_animation_group; diff --git a/src/lib/evas/canvas/efl_canvas_animation_group_parallel.eo b/src/lib/evas/canvas/efl_canvas_animation_group_parallel.eo index 833c85f960..c404323c18 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_group_parallel.eo +++ b/src/lib/evas/canvas/efl_canvas_animation_group_parallel.eo @@ -1,4 +1,4 @@ -class Efl.Canvas.Animation_Group_Parallel extends Efl.Canvas.Animation_Group +class @beta Efl.Canvas.Animation_Group_Parallel extends Efl.Canvas.Animation_Group { [[Efl group parallel animation class]] eo_prefix: efl_animation_group_parallel; diff --git a/src/lib/evas/canvas/efl_canvas_animation_group_sequential.eo b/src/lib/evas/canvas/efl_canvas_animation_group_sequential.eo index 81144e327f..415a87f999 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_group_sequential.eo +++ b/src/lib/evas/canvas/efl_canvas_animation_group_sequential.eo @@ -1,4 +1,4 @@ -class Efl.Canvas.Animation_Group_Sequential extends Efl.Canvas.Animation_Group +class @beta Efl.Canvas.Animation_Group_Sequential extends Efl.Canvas.Animation_Group { [[Efl group sequential animation class]] data: null; diff --git a/src/lib/evas/canvas/efl_canvas_animation_player.c b/src/lib/evas/canvas/efl_canvas_animation_player.c index 63abfc3719..677443a5f5 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_player.c +++ b/src/lib/evas/canvas/efl_canvas_animation_player.c @@ -219,14 +219,14 @@ _efl_canvas_animation_player_efl_player_stop(Eo *eo_obj, else { pd->progress = 0.0; - efl_gfx_map_reset(efl_animation_player_target_get(eo_obj)); + efl_gfx_mapping_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)); + efl_gfx_mapping_reset(efl_animation_player_target_get(eo_obj)); } if (pd->auto_del) efl_del(eo_obj); diff --git a/src/lib/evas/canvas/efl_canvas_animation_player.eo b/src/lib/evas/canvas/efl_canvas_animation_player.eo index fe4fb90d4d..7e1ce30fc2 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_player.eo +++ b/src/lib/evas/canvas/efl_canvas_animation_player.eo @@ -1,4 +1,4 @@ -class Efl.Canvas.Animation_Player extends Efl.Object implements Efl.Player +class @beta Efl.Canvas.Animation_Player extends Efl.Object implements Efl.Player { [[Efl animation object class]] eo_prefix: efl_animation_player; diff --git a/src/lib/evas/canvas/efl_canvas_animation_rotate.c b/src/lib/evas/canvas/efl_canvas_animation_rotate.c index d75f3475c6..c57f7e1ac2 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_rotate.c +++ b/src/lib/evas/canvas/efl_canvas_animation_rotate.c @@ -8,8 +8,8 @@ _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); + efl_gfx_mapping_coord_absolute_get(target, 0, &x1, &y1, NULL); + efl_gfx_mapping_coord_absolute_get(target, 1, &x2, &y2, NULL); theta = atan((y2 - y1) / (x2 - x1)); return theta * 180 / M_PI; @@ -125,14 +125,14 @@ _efl_canvas_animation_rotate_efl_canvas_animation_animation_apply(Eo *eo_obj, if (pd->use_rel_pivot) { - efl_gfx_map_rotate(target, + efl_gfx_mapping_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, + efl_gfx_mapping_rotate_absolute(target, new_degree - prev_degree, pd->abs_pivot.cx, pd->abs_pivot.cy); } diff --git a/src/lib/evas/canvas/efl_canvas_animation_rotate.eo b/src/lib/evas/canvas/efl_canvas_animation_rotate.eo index e37720f03f..0dabb21b7b 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_rotate.eo +++ b/src/lib/evas/canvas/efl_canvas_animation_rotate.eo @@ -1,4 +1,4 @@ -class Efl.Canvas.Animation_Rotate extends Efl.Canvas.Animation +class @beta Efl.Canvas.Animation_Rotate extends Efl.Canvas.Animation { [[Efl rotate animation class]] eo_prefix: efl_animation_rotate; diff --git a/src/lib/evas/canvas/efl_canvas_animation_scale.c b/src/lib/evas/canvas/efl_canvas_animation_scale.c index b09d7a794b..90304defc3 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_scale.c +++ b/src/lib/evas/canvas/efl_canvas_animation_scale.c @@ -10,9 +10,9 @@ _scale_get(Eo *target) 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); + efl_gfx_mapping_coord_absolute_get(target, 0, &x1, &y1, NULL); + efl_gfx_mapping_coord_absolute_get(target, 1, &x2, &y2, NULL); + efl_gfx_mapping_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))); @@ -161,7 +161,7 @@ _efl_canvas_animation_scale_efl_canvas_animation_animation_apply(Eo *eo_obj, if (pd->use_rel_pivot) { - efl_gfx_map_zoom(target, + efl_gfx_mapping_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, @@ -169,7 +169,7 @@ _efl_canvas_animation_scale_efl_canvas_animation_animation_apply(Eo *eo_obj, } else { - efl_gfx_map_zoom_absolute(target, + efl_gfx_mapping_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); diff --git a/src/lib/evas/canvas/efl_canvas_animation_scale.eo b/src/lib/evas/canvas/efl_canvas_animation_scale.eo index 7ffe2cb39f..5276371990 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_scale.eo +++ b/src/lib/evas/canvas/efl_canvas_animation_scale.eo @@ -1,4 +1,4 @@ -class Efl.Canvas.Animation_Scale extends Efl.Canvas.Animation +class @beta Efl.Canvas.Animation_Scale extends Efl.Canvas.Animation { [[Efl scale animation class]] eo_prefix: efl_animation_scale; diff --git a/src/lib/evas/canvas/efl_canvas_animation_translate.c b/src/lib/evas/canvas/efl_canvas_animation_translate.c index e0c9ef7424..42748eac99 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_translate.c +++ b/src/lib/evas/canvas/efl_canvas_animation_translate.c @@ -17,8 +17,8 @@ _translation_get(Eo *target) 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); + efl_gfx_mapping_coord_absolute_get(target, 0, &x1, &y1, NULL); + efl_gfx_mapping_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)); @@ -133,7 +133,7 @@ _efl_canvas_animation_translate_efl_canvas_animation_animation_apply(Eo *eo_obj, 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); + efl_gfx_mapping_translate(target, new.x - prev.x, new.y - prev.y, 0.0); return progress; } diff --git a/src/lib/evas/canvas/efl_canvas_animation_translate.eo b/src/lib/evas/canvas/efl_canvas_animation_translate.eo index 822fbd4f85..09204a8c52 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_translate.eo +++ b/src/lib/evas/canvas/efl_canvas_animation_translate.eo @@ -1,4 +1,4 @@ -class Efl.Canvas.Animation_Translate extends Efl.Canvas.Animation +class @beta Efl.Canvas.Animation_Translate extends Efl.Canvas.Animation { [[Efl translate animation class]] eo_prefix: efl_animation_translate; diff --git a/src/lib/evas/canvas/efl_canvas_animation_types.eot b/src/lib/evas/canvas/efl_canvas_animation_types.eot index ad3aecc637..23e89aef0d 100644 --- a/src/lib/evas/canvas/efl_canvas_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.Canvas.Animation_Player_Event_Running; [[Information of event running]] +struct @beta Efl.Canvas.Animation_Player_Event_Running; [[Information of event running]] -enum Efl.Canvas.Animation_Repeat_Mode +enum @beta Efl.Canvas.Animation_Repeat_Mode { [[Animation repeat mode]] diff --git a/src/lib/evas/canvas/efl_canvas_event_grabber.c b/src/lib/evas/canvas/efl_canvas_event_grabber.c index 1cfde42693..cea6d86a13 100644 --- a/src/lib/evas/canvas/efl_canvas_event_grabber.c +++ b/src/lib/evas/canvas/efl_canvas_event_grabber.c @@ -193,7 +193,7 @@ _efl_canvas_object_event_grabber_child_invalidate(void *data, const Efl_Event *e { Efl_Object_Event_Grabber_Data *pd = data; - efl_canvas_group_member_del(efl_parent_get(pd->rect), event->object); + efl_canvas_group_member_remove(efl_parent_get(pd->rect), event->object); } EOLIAN static void @@ -246,16 +246,16 @@ _efl_canvas_event_grabber_efl_canvas_group_group_member_add(Eo *eo_obj, Efl_Obje _child_insert(pd, sub); 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_ENTITY_EVENT_RESTACK, _efl_canvas_object_event_grabber_child_restack, pd); + efl_event_callback_add(eo_sub, EFL_GFX_ENTITY_EVENT_STACKING_CHANGED, _efl_canvas_object_event_grabber_child_restack, pd); } EOLIAN static void -_efl_canvas_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_remove(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_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); + efl_event_callback_del(member, EFL_GFX_ENTITY_EVENT_STACKING_CHANGED, _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) @@ -350,7 +350,7 @@ _efl_canvas_event_grabber_efl_object_constructor(Eo *eo_obj, Efl_Object_Event_Gr obj->is_event_parent = 1; obj->is_smart = 0; - efl_event_callback_add(eo_obj, EFL_GFX_ENTITY_EVENT_RESTACK, _efl_canvas_object_event_grabber_restack, pd); + efl_event_callback_add(eo_obj, EFL_GFX_ENTITY_EVENT_STACKING_CHANGED, _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); @@ -366,7 +366,7 @@ _efl_canvas_event_grabber_efl_object_destructor(Eo *eo_obj, Efl_Object_Event_Gra Eina_List *l, *ln; EINA_LIST_FOREACH_SAFE(pd->contained, l, ln, obj) - efl_canvas_group_member_del(eo_obj, obj->object); + efl_canvas_group_member_remove(eo_obj, obj->object); efl_canvas_group_del(eo_obj); efl_destructor(efl_super(eo_obj, MY_CLASS)); } @@ -409,3 +409,4 @@ evas_object_event_grabber_add(Evas *eo_e) } #include "efl_canvas_event_grabber.eo.c" +#include "efl_canvas_event_grabber_eo.legacy.c" diff --git a/src/lib/evas/canvas/efl_canvas_event_grabber.eo b/src/lib/evas/canvas/efl_canvas_event_grabber.eo index 24a2a8ff3b..205f5fb573 100644 --- a/src/lib/evas/canvas/efl_canvas_event_grabber.eo +++ b/src/lib/evas/canvas/efl_canvas_event_grabber.eo @@ -1,4 +1,4 @@ -class Efl.Canvas.Event_Grabber extends Efl.Canvas.Group +class @beta Efl.Canvas.Event_Grabber extends Efl.Canvas.Group { [[Low-level rectangle object. @@ -15,11 +15,8 @@ class Efl.Canvas.Event_Grabber extends Efl.Canvas.Group No child objects should be stacked above the event grabber parent while the grabber is visible. A critical error will be raised if this is detected. - - @since 1.20 ]] data: Efl_Object_Event_Grabber_Data; - legacy_prefix: evas_object_event_grabber; methods { @property freeze_when_visible { [[Stops the grabber from updating its internal stacking order while visible]] @@ -35,7 +32,7 @@ class Efl.Canvas.Event_Grabber extends Efl.Canvas.Group Efl.Object.constructor; Efl.Object.destructor; Efl.Canvas.Group.group_member_add; - Efl.Canvas.Group.group_member_del; + Efl.Canvas.Group.group_member_remove; Efl.Canvas.Group.group_member_is; Efl.Canvas.Group.group_members_iterate; Efl.Canvas.Group.group_calculate; diff --git a/src/lib/evas/canvas/efl_canvas_event_grabber_eo.legacy.c b/src/lib/evas/canvas/efl_canvas_event_grabber_eo.legacy.c new file mode 100644 index 0000000000..ff954ebf02 --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_event_grabber_eo.legacy.c @@ -0,0 +1,12 @@ + +EAPI void +evas_object_event_grabber_freeze_when_visible_set(Efl_Canvas_Event_Grabber *obj, Eina_Bool set) +{ + efl_canvas_event_grabber_freeze_when_visible_set(obj, set); +} + +EAPI Eina_Bool +evas_object_event_grabber_freeze_when_visible_get(const Efl_Canvas_Event_Grabber *obj) +{ + return efl_canvas_event_grabber_freeze_when_visible_get(obj); +} diff --git a/src/lib/evas/canvas/efl_canvas_event_grabber_eo.legacy.h b/src/lib/evas/canvas/efl_canvas_event_grabber_eo.legacy.h new file mode 100644 index 0000000000..3f1b146196 --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_event_grabber_eo.legacy.h @@ -0,0 +1,44 @@ +#ifndef _EFL_CANVAS_EVENT_GRABBER_EO_LEGACY_H_ +#define _EFL_CANVAS_EVENT_GRABBER_EO_LEGACY_H_ + +#ifndef _EFL_CANVAS_EVENT_GRABBER_EO_CLASS_TYPE +#define _EFL_CANVAS_EVENT_GRABBER_EO_CLASS_TYPE + +typedef Eo Efl_Canvas_Event_Grabber; + +#endif + +#ifndef _EFL_CANVAS_EVENT_GRABBER_EO_TYPES +#define _EFL_CANVAS_EVENT_GRABBER_EO_TYPES + + +#endif + +/** + * @brief Stops the grabber from updating its internal stacking order while + * visible + * + * @param[in] obj The object. + * @param[in] set If @c true, stop updating + * + * @since 1.20 + * + * @ingroup Evas_Object_Event_Grabber_Group + */ +EAPI void evas_object_event_grabber_freeze_when_visible_set(Efl_Canvas_Event_Grabber *obj, Eina_Bool set); + +/** + * @brief Stops the grabber from updating its internal stacking order while + * visible + * + * @param[in] obj The object. + * + * @return If @c true, stop updating + * + * @since 1.20 + * + * @ingroup Evas_Object_Event_Grabber_Group + */ +EAPI Eina_Bool evas_object_event_grabber_freeze_when_visible_get(const Efl_Canvas_Event_Grabber *obj); + +#endif diff --git a/src/lib/evas/canvas/efl_canvas_filter_internal.eo b/src/lib/evas/canvas/efl_canvas_filter_internal.eo index c13d8bd5b3..052c327d9c 100644 --- a/src/lib/evas/canvas/efl_canvas_filter_internal.eo +++ b/src/lib/evas/canvas/efl_canvas_filter_internal.eo @@ -3,7 +3,7 @@ /* Everything in this file is internal to Evas. It is not meant to be used from outside EFL itself! */ -struct Efl.Gfx.Color32 +struct @beta Efl.Gfx.Color32 { [[32 bit color data structure]] r: uint8; [[Red component of the color]] @@ -12,14 +12,14 @@ struct Efl.Gfx.Color32 a: uint8; [[Translucent component of the color]] } -struct Efl.Canvas.Filter.State_Name +struct @beta Efl.Canvas.Filter.State_Name { [[Filter state name structure]] name: string; [[Filter state name]] value: double; [[Filter state value]] } -struct Efl.Canvas.Filter.State_Text +struct @beta Efl.Canvas.Filter.State_Text { [[Filter state text structure]] outline: Efl.Gfx.Color32; [[Text outline color]] @@ -28,7 +28,7 @@ struct Efl.Canvas.Filter.State_Text glow2: Efl.Gfx.Color32; [[Text glow2 color]] } -struct Efl.Canvas.Filter.State +struct @beta Efl.Canvas.Filter.State { [[Internal structure representing the state of a Gfx Filter]] text: Efl.Canvas.Filter.State_Text; [[Text state]] @@ -41,7 +41,7 @@ struct Efl.Canvas.Filter.State pos: double; [[Position]] } -mixin Efl.Canvas.Filter.Internal requires Efl.Object extends Efl.Gfx.Filter +mixin @beta Efl.Canvas.Filter.Internal requires Efl.Object extends Efl.Gfx.Filter { [[Evas internal implementation of filters.]] diff --git a/src/lib/evas/canvas/efl_canvas_group.eo b/src/lib/evas/canvas/efl_canvas_group.eo index 2823f7e71d..503b2177f8 100644 --- a/src/lib/evas/canvas/efl_canvas_group.eo +++ b/src/lib/evas/canvas/efl_canvas_group.eo @@ -8,8 +8,9 @@ class Efl.Canvas.Group extends Efl.Canvas.Object sense that a standard widget may not have any empty slots for content. However it's still a group of low-level canvas objects (clipper, raw objects, etc.). + + @since 1.22 ]] - legacy_prefix: evas_object_smart; data: Evas_Smart_Data; methods { @property group_need_recalculate { @@ -27,10 +28,8 @@ class Efl.Canvas.Group extends Efl.Canvas.Object See also @.group_calculate. ]] set { - legacy: evas_object_smart_need_recalculate_set; } get { - legacy: evas_object_smart_need_recalculate_get; } values { value: bool; [[$true if the group layout needs to be recalculated, $false otherwise]] @@ -43,14 +42,12 @@ class Efl.Canvas.Group extends Efl.Canvas.Object recalculation. As an effect, on the next rendering cycle its @.group_calculate method will be called. ]] - legacy: evas_object_smart_changed; } group_calculate { [[Triggers an immediate recalculation of this object's geometry. This will also reset the flag @.group_need_recalculate. ]] - legacy: evas_object_smart_calculate; } group_members_iterate @const { [[Returns an iterator over the children of this object, which are @@ -62,7 +59,6 @@ class Efl.Canvas.Group extends Efl.Canvas.Object ]] return: iterator @owned; [[Iterator to object children]] - legacy: evas_object_smart_iterator_new; } group_member_add { [[Set a canvas object as a member of a given group (or smart object). @@ -77,15 +73,14 @@ class Efl.Canvas.Group extends Efl.Canvas.Object to ensure the proper stacking of special objects, such as clippers, event rectangles, etc... - See also @.group_member_del. + See also @.group_member_remove. See also @.group_member_is. ]] params { @in sub_obj: Efl.Canvas.Object @nonull; [[The member object.]] } - legacy: null; } - group_member_del { + group_member_remove { [[Removes a member object from a given smart object. This removes a member object from a smart object, if it was added @@ -98,7 +93,6 @@ class Efl.Canvas.Group extends Efl.Canvas.Object params { @in sub_obj: Efl.Canvas.Object; [[The member object to remove.]] } - legacy: null; } group_member_is @const { [[Finds out if a given object is a member of this group.]] @@ -106,7 +100,6 @@ class Efl.Canvas.Group extends Efl.Canvas.Object @in sub_obj: const(Efl.Canvas.Object); [[A potential sub object.]] } return: bool; [[$true if $sub_obj is a member of this group.]] - legacy: null; } @property group_clipper @protected { [[The internal clipper object used by this group. @@ -119,10 +112,13 @@ class Efl.Canvas.Group extends Efl.Canvas.Object } get { [[Get the internal clipper.]] - legacy: null; } } } + events { + member,added: Efl.Gfx.Entity; [[Called when a member is added to the group.]] + member,removed: Efl.Gfx.Entity; [[Called when a member is removed from the group.]] + } implements { class.constructor; class.destructor; @@ -132,7 +128,7 @@ class Efl.Canvas.Group extends Efl.Canvas.Object Efl.Gfx.Color.color { set; } Efl.Gfx.Entity.visible { set; } Efl.Gfx.Entity.position { set; } - Efl.Canvas.Object.clip { set; } + Efl.Canvas.Object.clipper { set; } Efl.Canvas.Object.no_render { set; } Efl.Canvas.Object.paragraph_direction { get; set; } } diff --git a/src/lib/evas/canvas/efl_canvas_group_eo.legacy.c b/src/lib/evas/canvas/efl_canvas_group_eo.legacy.c new file mode 100644 index 0000000000..1144c0a22b --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_group_eo.legacy.c @@ -0,0 +1,30 @@ + +EAPI void +evas_object_smart_need_recalculate_set(Efl_Canvas_Group *obj, Eina_Bool value) +{ + efl_canvas_group_need_recalculate_set(obj, value); +} + +EAPI Eina_Bool +evas_object_smart_need_recalculate_get(const Efl_Canvas_Group *obj) +{ + return efl_canvas_group_need_recalculate_get(obj); +} + +EAPI void +evas_object_smart_changed(Efl_Canvas_Group *obj) +{ + efl_canvas_group_change(obj); +} + +EAPI void +evas_object_smart_calculate(Efl_Canvas_Group *obj) +{ + efl_canvas_group_calculate(obj); +} + +EAPI Eina_Iterator * +evas_object_smart_iterator_new(const Efl_Canvas_Group *obj) +{ + return efl_canvas_group_members_iterate(obj); +} diff --git a/src/lib/evas/canvas/efl_canvas_group_eo.legacy.h b/src/lib/evas/canvas/efl_canvas_group_eo.legacy.h new file mode 100644 index 0000000000..f8f45ed286 --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_group_eo.legacy.h @@ -0,0 +1,104 @@ +#ifndef _EFL_CANVAS_GROUP_EO_LEGACY_H_ +#define _EFL_CANVAS_GROUP_EO_LEGACY_H_ + +#ifndef _EFL_CANVAS_GROUP_EO_CLASS_TYPE +#define _EFL_CANVAS_GROUP_EO_CLASS_TYPE + +typedef Eo Efl_Canvas_Group; + +#endif + +#ifndef _EFL_CANVAS_GROUP_EO_TYPES +#define _EFL_CANVAS_GROUP_EO_TYPES + + +#endif + +/** + * @brief Indicates that the group's layout needs to be recalculated. + * + * If this flag is set, then the @ref evas_object_smart_calculate function will + * be called, during rendering phase of the canvas. After that, this flag will + * be automatically unset. + * + * @note setting this flag alone will not make the canvas' whole scene dirty. + * Using evas_render() will have no effect. To force this, use + * @ref evas_object_smart_changed, which will also call this function + * automatically, with the parameter set to @c true. + * + * See also @ref evas_object_smart_calculate. + * + * @param[in] obj The object. + * @param[in] value @c true if the group layout needs to be recalculated, + * @c false otherwise + * + * @ingroup Evas_Object_Smart_Group + */ +EAPI void evas_object_smart_need_recalculate_set(Efl_Canvas_Group *obj, Eina_Bool value); + +/** + * @brief Indicates that the group's layout needs to be recalculated. + * + * If this flag is set, then the @ref evas_object_smart_calculate function will + * be called, during rendering phase of the canvas. After that, this flag will + * be automatically unset. + * + * @note setting this flag alone will not make the canvas' whole scene dirty. + * Using evas_render() will have no effect. To force this, use + * @ref evas_object_smart_changed, which will also call this function + * automatically, with the parameter set to @c true. + * + * See also @ref evas_object_smart_calculate. + * + * @param[in] obj The object. + * + * @return @c true if the group layout needs to be recalculated, @c false + * otherwise + * + * @ingroup Evas_Object_Smart_Group + */ +EAPI Eina_Bool evas_object_smart_need_recalculate_get(const Efl_Canvas_Group *obj); + +/** + * @brief Marks the object as dirty. + * + * This also forcefully marks the given object as needing recalculation. As an + * effect, on the next rendering cycle its @ref evas_object_smart_calculate + * method will be called. + * @param[in] obj The object. + * + * @ingroup Evas_Object_Smart_Group + */ +EAPI void evas_object_smart_changed(Efl_Canvas_Group *obj); + +/** + * @brief Triggers an immediate recalculation of this object's geometry. + * + * This will also reset the flag @ref evas_object_smart_need_recalculate_get. + * @param[in] obj The object. + * + * @ingroup Evas_Object_Smart_Group + */ +EAPI void evas_object_smart_calculate(Efl_Canvas_Group *obj); + +/** + * @brief Returns an iterator over the children of this object, which are + * canvas objects. + * + * This returns the list of "smart" children. This might be different from both + * the @ref Efl_Object children list as well as the @ref Efl_Container content + * list. + * + * @param[in] obj The object. + * + * @return Iterator to object children + * + * @ingroup Evas_Object_Smart_Group + */ +EAPI Eina_Iterator *evas_object_smart_iterator_new(const Efl_Canvas_Group *obj); + + + + + +#endif diff --git a/src/lib/evas/canvas/efl_canvas_image.c b/src/lib/evas/canvas/efl_canvas_image.c index 0339741c04..434c427bb0 100644 --- a/src/lib/evas/canvas/efl_canvas_image.c +++ b/src/lib/evas/canvas/efl_canvas_image.c @@ -5,22 +5,30 @@ #define MY_CLASS_NAME efl_class_name_get(MY_CLASS) Eina_Bool -_evas_image_mmap_set(Eo *eo_obj, const Eina_File *f, const char *key) +_evas_image_file_load(Eo *eo_obj) { - Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); + Evas_Object_Protected_Data *obj; Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS); Evas_Image_Load_Opts lo; + const Eina_File *f = efl_file_mmap_get(eo_obj); + const char *key = efl_file_key_get(eo_obj); + int load_error; + + EINA_SAFETY_ON_NULL_RETURN_VAL(f, EINA_FALSE); if (o->cur->f == f) { if ((!o->cur->key) && (!key)) - return EINA_FALSE; + return EINA_TRUE; if ((o->cur->key) && (key) && (!strcmp(o->cur->key, key))) - return EINA_FALSE; + return EINA_TRUE; } + + obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); evas_object_async_block(obj); _evas_image_init_set(f, key, eo_obj, obj, o, &lo); - o->engine_data = ENFN->image_mmap(ENC, o->cur->f, o->cur->key, &o->load_error, &lo); + o->engine_data = ENFN->image_mmap(ENC, o->cur->f, o->cur->key, &load_error, &lo); + o->load_error = _evas_load_error_to_efl_gfx_image_load_error(load_error); o->buffer_data_set = EINA_FALSE; _evas_image_done_set(eo_obj, obj, o); o->file_size.w = o->cur->image.w; @@ -29,45 +37,38 @@ _evas_image_mmap_set(Eo *eo_obj, const Eina_File *f, const char *key) return EINA_TRUE; } -EOLIAN static Eina_Bool -_efl_canvas_image_efl_file_mmap_set(Eo *eo_obj, void *_pd EINA_UNUSED, - const Eina_File *f, const char *key) +EOLIAN static Eina_Error +_efl_canvas_image_efl_file_load(Eo *eo_obj, void *_pd EINA_UNUSED) { - return _evas_image_mmap_set(eo_obj, f, key); + if (efl_file_loaded_get(eo_obj)) return 0; + Eina_Error err = efl_file_load(efl_super(eo_obj, MY_CLASS)); + if (err) return err; + if (_evas_image_file_load(eo_obj)) + return 0; + return EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST; +} + +const Eina_File * +_evas_image_mmap_get(const Eo *eo_obj) +{ + Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS); + + return o->cur->f; +} + +const char * +_evas_image_key_get(const Eo *eo_obj) +{ + Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS); + + return o->cur->key; } void -_evas_image_mmap_get(const Eo *eo_obj, const Eina_File **f, const char **key) +_efl_canvas_image_load_error_set(Eo *eo_obj EINA_UNUSED, Eina_Error err) { Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS); - - if (f) - *f = o->cur->f; - if (key) - *key = o->cur->key; -} - -EOLIAN static void -_efl_canvas_image_efl_file_mmap_get(const Eo *eo_obj, void *_pd EINA_UNUSED, - const Eina_File **f, const char **key) -{ - _evas_image_mmap_get(eo_obj, f, key); -} - -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_Gfx_Image_Load_Error r = efl_file_load_error_get(efl_cast(eo_obj, EFL_FILE_MIXIN)); - - if (r != EFL_GFX_IMAGE_LOAD_ERROR_NONE) return r; - return o->load_error; -} - -EOLIAN static Efl_Gfx_Image_Load_Error -_efl_canvas_image_efl_file_load_error_get(const Eo *eo_obj, void *_pd EINA_UNUSED) -{ - return _evas_image_load_error_get(eo_obj); + o->load_error = err; } static void @@ -407,7 +408,7 @@ _evas_image_animated_get(const Eo *eo_obj) } EOLIAN static Eina_Bool -_efl_canvas_image_efl_gfx_image_animation_controller_animated_get(const Eo *eo_obj, void *_pd EINA_UNUSED) +_efl_canvas_image_efl_gfx_frame_controller_animated_get(const Eo *eo_obj, void *_pd EINA_UNUSED) { return _evas_image_animated_get(eo_obj); } @@ -427,12 +428,12 @@ _evas_image_animated_frame_count_get(const Eo *eo_obj) } EOLIAN static int -_efl_canvas_image_efl_gfx_image_animation_controller_animated_frame_count_get(const Eo *eo_obj, void *_pd EINA_UNUSED) +_efl_canvas_image_efl_gfx_frame_controller_frame_count_get(const Eo *eo_obj, void *_pd EINA_UNUSED) { return _evas_image_animated_frame_count_get(eo_obj); } -Efl_Gfx_Image_Animation_Controller_Loop_Hint +Efl_Gfx_Frame_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 +441,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_GFX_IMAGE_ANIMATION_CONTROLLER_LOOP_HINT_NONE; + return EFL_GFX_FRAME_CONTROLLER_LOOP_HINT_NONE; - return (Efl_Gfx_Image_Animation_Controller_Loop_Hint) ENFN->image_animated_loop_type_get(ENC, o->engine_data); + return (Efl_Gfx_Frame_Controller_Loop_Hint) ENFN->image_animated_loop_type_get(ENC, o->engine_data); } -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) +EOLIAN static Efl_Gfx_Frame_Controller_Loop_Hint +_efl_canvas_image_efl_gfx_frame_controller_loop_type_get(const Eo *eo_obj, void *_pd EINA_UNUSED) { return _evas_image_animated_loop_type_get(eo_obj); } @@ -465,7 +466,7 @@ _evas_image_animated_loop_count_get(const Eo *eo_obj) } EOLIAN static int -_efl_canvas_image_efl_gfx_image_animation_controller_animated_loop_count_get(const Eo *eo_obj, void *_pd EINA_UNUSED) +_efl_canvas_image_efl_gfx_frame_controller_loop_count_get(const Eo *eo_obj, void *_pd EINA_UNUSED) { return _evas_image_animated_loop_count_get(eo_obj); } @@ -489,7 +490,7 @@ _evas_image_animated_frame_duration_get(const Eo *eo_obj, int start_frame, int f } EOLIAN static double -_efl_canvas_image_efl_gfx_image_animation_controller_animated_frame_duration_get(const Eo *eo_obj, void *_pd EINA_UNUSED, int start_frame, int frame_num) +_efl_canvas_image_efl_gfx_frame_controller_frame_duration_get(const Eo *eo_obj, void *_pd EINA_UNUSED, int start_frame, int frame_num) { return _evas_image_animated_frame_duration_get(eo_obj, start_frame, frame_num); } @@ -531,7 +532,7 @@ _evas_image_animated_frame_set(Eo *eo_obj, int frame_index) } EOLIAN static Eina_Bool -_efl_canvas_image_efl_gfx_image_animation_controller_animated_frame_set(Eo *eo_obj, void *_pd EINA_UNUSED, int frame_index) +_efl_canvas_image_efl_gfx_frame_controller_frame_set(Eo *eo_obj, void *_pd EINA_UNUSED, int frame_index) { return _evas_image_animated_frame_set(eo_obj, frame_index); } @@ -547,7 +548,7 @@ _evas_image_animated_frame_get(const Eo *eo_obj) } EOLIAN static int -_efl_canvas_image_efl_gfx_image_animation_controller_animated_frame_get(const Eo *eo_obj, void *_pd EINA_UNUSED) +_efl_canvas_image_efl_gfx_frame_controller_frame_get(const Eo *eo_obj, void *_pd EINA_UNUSED) { return _evas_image_animated_frame_get(eo_obj); } @@ -597,7 +598,7 @@ _image_pixels_set(Evas_Object_Protected_Data *obj, ENFN->image_size_get(ENC, o->engine_data, &iw, &ih); ics = ENFN->image_colorspace_get(ENC, o->engine_data); alpha = ENFN->image_alpha_get(ENC, o->engine_data); - if ((w != iw) || (h != ih) || (ics != cspace) || (alpha != o->cur->has_alpha)) + if ((w != iw) || (h != ih) || (ics != (Evas_Colorspace)cspace) || (alpha != o->cur->has_alpha)) { ENFN->image_free(ENC, o->engine_data); o->engine_data = NULL; @@ -638,7 +639,7 @@ _image_pixels_set(Evas_Object_Protected_Data *obj, ENFN->image_stride_get(ENC, o->engine_data, &int_stride); if (resized || o->cur->f || o->cur->key || - (o->cur->image.stride != int_stride) || (cspace != o->cur->cspace)) + (o->cur->image.stride != int_stride) || (cspace != (Efl_Gfx_Colorspace)o->cur->cspace)) { EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, cur) { @@ -784,15 +785,15 @@ _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_GFX_IMAGE_LOAD_ERROR_NONE) && + if ((efl_gfx_image_load_error_get(obj) != EFL_GFX_IMAGE_LOAD_ERROR_NONE) && (root)) { Efl_Dbg_Info *group = EFL_DBG_INFO_LIST_APPEND(root, MY_CLASS_NAME); - Evas_Load_Error error = EVAS_LOAD_ERROR_GENERIC; + Eina_Error error = EFL_GFX_IMAGE_LOAD_ERROR_GENERIC; - error = (Evas_Load_Error) _evas_image_load_error_get(obj); + error = efl_gfx_image_load_error_get(obj); EFL_DBG_INFO_APPEND(group, "Load Error", EINA_VALUE_TYPE_STRING, - evas_load_error_str(error)); + eina_error_msg_get(error)); } } diff --git a/src/lib/evas/canvas/efl_canvas_image.eo b/src/lib/evas/canvas/efl_canvas_image.eo index 21cdd85876..2dbad42f60 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 extends Efl.Canvas.Image_Internal implements - Efl.Gfx.Image_Load_Controller, Efl.Gfx.Image_Animation_Controller, +class @beta Efl.Canvas.Image extends Efl.Canvas.Image_Internal implements + Efl.Gfx.Image_Load_Controller, Efl.Gfx.Frame_Controller, Efl.File { [[Low-level Image object. @@ -16,14 +16,13 @@ class Efl.Canvas.Image extends Efl.Canvas.Image_Internal implements Efl.Gfx.Buffer.buffer_size { get; } Efl.Gfx.Buffer.buffer_map; Efl.Gfx.Buffer.buffer_unmap; - Efl.File.mmap { get; set; } - Efl.File.load_error { 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.File.load; + Efl.Gfx.Frame_Controller.animated { get; } + Efl.Gfx.Frame_Controller.frame { get; set; } + Efl.Gfx.Frame_Controller.frame_count { get; } + Efl.Gfx.Frame_Controller.loop_type { get; } + Efl.Gfx.Frame_Controller.loop_count { get; } + Efl.Gfx.Frame_Controller.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; } diff --git a/src/lib/evas/canvas/efl_canvas_image_internal.eo b/src/lib/evas/canvas/efl_canvas_image_internal.eo index fc7df3c497..c0b9093557 100644 --- a/src/lib/evas/canvas/efl_canvas_image_internal.eo +++ b/src/lib/evas/canvas/efl_canvas_image_internal.eo @@ -1,7 +1,7 @@ -abstract Efl.Canvas.Image_Internal extends Efl.Canvas.Object implements Efl.Canvas.Filter.Internal, +abstract @beta Efl.Canvas.Image_Internal extends Efl.Canvas.Object implements Efl.Canvas.Filter.Internal, Efl.Gfx.Image, Efl.Gfx.Buffer, Efl.Gfx.Fill, Efl.Gfx.View, - Efl.Orientation, Efl.File + Efl.Orientation, Efl.File_Save { [[Efl canvas internal image class]] data: Evas_Image_Data; @@ -10,7 +10,7 @@ abstract Efl.Canvas.Image_Internal extends Efl.Canvas.Object implements Efl.Canv Efl.Object.destructor; Efl.Object.finalize; Efl.Object.debug_name_override; - Efl.File.save; + Efl.File_Save.save; Efl.Orientation.orientation { get; set; } Efl.Orientation.flip { get; set; } Efl.Gfx.Image.smooth_scale { get; set; } @@ -21,6 +21,7 @@ abstract Efl.Canvas.Image_Internal extends Efl.Canvas.Object implements Efl.Canv Efl.Gfx.Image.scale_hint { get; set; } Efl.Gfx.Image.content_hint { get; set; } Efl.Gfx.Image.image_size { get; } + Efl.Gfx.Image.image_load_error { 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 6bcae5d1ee..9a5f89dbe8 100644 --- a/src/lib/evas/canvas/efl_canvas_object.eo +++ b/src/lib/evas/canvas/efl_canvas_object.eo @@ -1,19 +1,24 @@ import efl_text_types; -struct Efl.Canvas.Object_Animation_Event; [[Information of animation events]] +struct @beta Efl.Canvas.Object_Animation_Event; [[Information of animation events]] +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.]] +} -abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, Efl.Gfx.Color, Efl.Gfx.Stack, Efl.Animator, - Efl.Input.Interface, Efl.Gfx.Size_Hint, - Efl.Gfx.Map, Efl.Ui.I18n, Efl.Canvas.Pointer +abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, Efl.Gfx.Color, Efl.Gfx.Stack, + Efl.Input.Interface, Efl.Gfx.Hint, + Efl.Gfx.Mapping, Efl.Ui.I18n, Efl.Canvas.Pointer { - [[Efl canvas object abstract class]] - legacy_prefix: evas_object; + [[Efl canvas object abstract class + + @since 1.22 + ]] data: Evas_Object_Protected_Data; methods { - @property pointer_mode_by_device { + @property pointer_mode_by_device @beta { [[Low-level pointer behaviour by device. See @.pointer_mode.get and @.pointer_mode.set for more explanation. - @since 1.19 ]] keys { dev: Efl.Input.Device; [[The pointer device to set/get the mode. Use $null for the default pointer.]] @@ -23,13 +28,11 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, } set { return: bool; [[$true if pointer mode was set, $false otherwise]] - legacy: null; } get { - legacy: null; } } - @property pointer_mode { + @property pointer_mode @beta { [[Low-level pointer behaviour. This function has a direct effect on event callbacks related to @@ -73,46 +76,14 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, transparent background inside a buffer canvas). ]] set { - legacy: null; } get { - legacy: null; } values { render_op: Efl.Gfx.Render_Op; [[Blend or copy.]] } } - @property freeze_events { - set { - [[Set whether an Evas object is to freeze (discard) events. - - If $freeze is $true, it will force events on $obj to be - discarded. Unlike @.pass_events.set, events will not be - passed to next lower object. This API can be used for - blocking events while $obj is in transition. - - If $freeze is $false, events will be processed on that - object as normal. - - Warning: If you block only key/mouse up events with this API, - you can't be sure of the state of any objects that have only - key/mouse down events. - - @since 1.1 - ]] - } - get { - [[Determine whether an object is set to freeze (discard) events. - - @since 1.1 - ]] - } - values { - freeze: bool; [[Pass when $obj is to freeze events ($true) - or not ($false).]] - } - } - @property clip { + @property clipper { set { [[Clip one object to another. @@ -164,7 +135,7 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, ]] } values { - clip: Efl.Canvas.Object @nonull; [[The object to clip $obj by.]] + clipper: Efl.Canvas.Object @nonull; [[The object to clip $obj by.]] } } @property repeat_events { @@ -208,10 +179,8 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, @.seat_focus_add, @.seat_focus_del. ]] set { - legacy: evas_object_focus_set; } get { - legacy: evas_object_focus_get; } values { focus: bool; [[$true when set as focused or $false otherwise.]] @@ -220,24 +189,23 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, @property seat_focus { [[ Check if this object is focused. - @since 1.19 ]] get { - legacy: null; } values { focus: bool; [[$true if focused by at least one seat or $false otherwise.]] } } - seat_focus_check { - [[ Check if this object is focused by a given seat @since 1.19 ]] + /* FIXME Efl.Input.Device is not stable yet*/ + seat_focus_check @beta { + [[ Check if this object is focused by a given seat ]] params { @in seat: Efl.Input.Device; [[The seat to check if the object is focused. Use $null for the default seat.]] } - legacy: null; return: bool; [[$true if focused or $false otherwise.]] } - seat_focus_add { + /* FIXME Efl.Input.Device is not stable yet*/ + seat_focus_add @beta { [[ Add a seat to the focus list. Evas allows the Efl.Canvas.Object to be focused by multiple seats @@ -245,42 +213,21 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, after the seat is added to the list this object will now be also focused by this new seat. Note: The old focus APIs still work, however they will only act on the default seat. - - @since 1.19 ]] params { @in seat: Efl.Input.Device; [[The seat that should be added to the focus list. Use $null for the default seat.]] } - legacy: null; return: bool; [[$true if the focus has been set or $false otherwise.]] } - seat_focus_del { + /* FIXME Efl.Input.Device is not stable yet*/ + seat_focus_del @beta { [[ Remove a seat from the focus list. - - @since 1.19 ]] params { @in seat: Efl.Input.Device; [[The seat that should be removed from the focus list. Use $null for the default seat.]] } - legacy: null; return: bool; [[$true if the seat was removed from the focus list or $false otherwise.]] } - @property is_frame_object { - [[If $true the object belongs to the window border decorations. - - This will be $false by default, and should be $false for all objects - created by the application, unless swallowed in some very specific - parts of the window. - - It is very unlikely that an application needs to call this manually, - as the window will handle this feature automatically. - - @since 1.2 - ]] - values { - is_frame: bool; [[$true if the object is a frame, $false otherwise]] - } - } @property precise_is_inside { set { [[Set whether to use precise (usually expensive) point collision @@ -327,15 +274,13 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, be propagated on to the smart object of which $obj is a member. The default value is $true. - See also @.repeat_events.set, @.pass_events.set, - @.freeze_events.set. + See also @.repeat_events.set, @.pass_events.set. ]] } get { [[Retrieve whether an Evas object is set to propagate events. - See also @.repeat_events.get, @.pass_events.get, - @.freeze_events.get. + See also @.repeat_events.get, @.pass_events.get. ]] } values { @@ -354,15 +299,13 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, If $pass is $false events will be processed on that object as normal. - See also @.repeat_events.set, @.propagate_events.set, - @.freeze_events.set. + See also @.repeat_events.set, @.propagate_events.set ]] } get { [[Determine whether an object is set to pass (ignore) events. - See also @.repeat_events.get, @.propagate_events.get, - @.freeze_events.get. + See also @.repeat_events.get, @.propagate_events.get. ]] /* FIXME-doc Example: @@ -394,7 +337,7 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, $false otherwise.]] } } - @property clipees { + @property clipped_objects { get { [[Return a list of objects currently clipped by $obj. @@ -409,9 +352,8 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, anymore after that point. Any use of the list after this may have undefined results, possibly leading to crashes. - See also @.clip. + See also @.clipper. ]] - legacy: null; return: iterator @warn_unused; [[An iterator over the list of objects clipped by $obj.]] } @@ -422,11 +364,8 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, This can be different from @Efl.Object.parent because this one is used internally for rendering and the normal parent is what the user expects to be the parent. - - @since 1.18 ]] get { - legacy: evas_object_smart_parent_get; } values { parent: Efl.Canvas.Object; [[The parent smart object of $obj or $null.]] @@ -442,12 +381,10 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, dir: Efl.Text_Bidirectional_Type; [[Paragraph direction for the given object.]] } } - clipees_has @const { - [[Test if any object is clipped by $obj. - - @since 1.8 + clipped_objects_count @const { + [[Returns the number of objects clipped by $obj ]] - return: bool @warn_unused; [[$true if any object is clipped by $obj, $false otherwise]] + return: uint @warn_unused; [[The number of objects clipped by $obj]] } key_grab { /* FIXME: can't reference Eolian object, .eo file not being installed */ @@ -484,7 +421,6 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, @in exclusive: bool; [[Request that the $obj is the only object receiving the $keyname events.]] } - legacy: null; } key_ungrab { [[Removes the grab on $keyname key events by $obj. @@ -503,7 +439,6 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, not not be present to trigger the event.]] } - legacy: null; } @property no_render { get { @@ -512,10 +447,7 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, This flag can be used to avoid rendering visible clippers on the canvas, even if they currently don't clip any object. - - @since 1.15 ]] - legacy: null; } set { [[Disable all rendering on the canvas. @@ -533,10 +465,7 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, clippers. When hidden, all "no-render" objects will completely disappear from the canvas, and hide their clippees or be invisible when used as proxy sources. - - @since 1.15 ]] - legacy: null; } values { enable: bool; [[Enable "no-render" mode.]] @@ -557,7 +486,6 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, If $e is not a valid object, the return value is undefined. ]] - legacy: null; } keys { pos: Eina.Position2D; [[The position in pixels.]] @@ -566,20 +494,6 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, return: bool; [[$true if the coords are inside the object, $false otherwise]] } } - @property event_animation { - [[Set the $animation which starts when the given $desc happens to the object.]] - get { legacy: null; } - set { legacy: null; } - keys { - @cref desc: Efl.Event_Description; - [[The event description for which the given $animation is set.]] - } - values { - animation: Efl.Canvas.Animation; - [[The animation which starts when the given $desc - happens to the object.]] - } - } } implements { Efl.Object.constructor; @@ -587,6 +501,8 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, Efl.Object.invalidate; Efl.Object.destructor; Efl.Object.provider_find; + Efl.Object.event_freeze; + Efl.Object.event_thaw; Efl.Object.debug_name_override; Efl.Gfx.Entity.visible { get; set; } Efl.Gfx.Color.color { get; set; } @@ -598,25 +514,23 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, 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.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.Size_Hint.hint_fill { get; set; } + Efl.Gfx.Stack.raise_to_top; + Efl.Gfx.Stack.lower_to_bottom; + Efl.Gfx.Hint.hint_aspect { get; set; } + Efl.Gfx.Hint.hint_align { get; set; } + Efl.Gfx.Hint.hint_size_combined_min { get; } + Efl.Gfx.Hint.hint_size_restricted_min { get; set; } + Efl.Gfx.Hint.hint_size_min { get; set; } + Efl.Gfx.Hint.hint_size_max { get; set; } + Efl.Gfx.Hint.hint_margin { get; set; } + Efl.Gfx.Hint.hint_weight { get; set; } + Efl.Gfx.Hint.hint_fill { get; set; } Efl.Gfx.Entity.scale { set; get; } Efl.Input.Interface.seat_event_filter { get; set; } 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.]] + animator,tick: Efl.Event_Animator_Tick; [[Animator tick synchronized with screen vsync if possible.]] } } diff --git a/src/lib/evas/canvas/efl_canvas_object_eo.legacy.c b/src/lib/evas/canvas/efl_canvas_object_eo.legacy.c new file mode 100644 index 0000000000..034d8c1ece --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_object_eo.legacy.c @@ -0,0 +1,146 @@ + +EAPI Eina_Bool +evas_object_pointer_mode_set(Efl_Canvas_Object *obj, Evas_Object_Pointer_Mode pointer_mode) +{ + return efl_canvas_object_pointer_mode_set(obj, (Efl_Input_Object_Pointer_Mode)pointer_mode); +} + +EAPI Evas_Object_Pointer_Mode +evas_object_pointer_mode_get(const Efl_Canvas_Object *obj) +{ + return (Evas_Object_Pointer_Mode)efl_canvas_object_pointer_mode_get(obj); +} + +EAPI void +evas_object_clip_set(Efl_Canvas_Object *obj, Efl_Canvas_Object *clipper) +{ + efl_canvas_object_clipper_set(obj, clipper); +} + +EAPI Efl_Canvas_Object * +evas_object_clip_get(const Efl_Canvas_Object *obj) +{ + return efl_canvas_object_clipper_get(obj); +} + +EAPI void +evas_object_repeat_events_set(Efl_Canvas_Object *obj, Eina_Bool repeat) +{ + efl_canvas_object_repeat_events_set(obj, repeat); +} + +EAPI Eina_Bool +evas_object_repeat_events_get(const Efl_Canvas_Object *obj) +{ + return efl_canvas_object_repeat_events_get(obj); +} + +EAPI void +evas_object_focus_set(Efl_Canvas_Object *obj, Eina_Bool focus) +{ + efl_canvas_object_key_focus_set(obj, focus); +} + +EAPI Eina_Bool +evas_object_focus_get(const Efl_Canvas_Object *obj) +{ + return efl_canvas_object_key_focus_get(obj); +} + +EAPI void +evas_object_precise_is_inside_set(Efl_Canvas_Object *obj, Eina_Bool precise) +{ + efl_canvas_object_precise_is_inside_set(obj, precise); +} + +EAPI Eina_Bool +evas_object_precise_is_inside_get(const Efl_Canvas_Object *obj) +{ + return efl_canvas_object_precise_is_inside_get(obj); +} + +EAPI void +evas_object_propagate_events_set(Efl_Canvas_Object *obj, Eina_Bool propagate) +{ + efl_canvas_object_propagate_events_set(obj, propagate); +} + +EAPI Eina_Bool +evas_object_propagate_events_get(const Efl_Canvas_Object *obj) +{ + return efl_canvas_object_propagate_events_get(obj); +} + +EAPI void +evas_object_pass_events_set(Efl_Canvas_Object *obj, Eina_Bool pass) +{ + efl_canvas_object_pass_events_set(obj, pass); +} + +EAPI Eina_Bool +evas_object_pass_events_get(const Efl_Canvas_Object *obj) +{ + return efl_canvas_object_pass_events_get(obj); +} + +EAPI void +evas_object_anti_alias_set(Efl_Canvas_Object *obj, Eina_Bool anti_alias) +{ + efl_canvas_object_anti_alias_set(obj, anti_alias); +} + +EAPI Eina_Bool +evas_object_anti_alias_get(const Efl_Canvas_Object *obj) +{ + return efl_canvas_object_anti_alias_get(obj); +} + +EAPI Efl_Canvas_Object * +evas_object_smart_parent_get(const Efl_Canvas_Object *obj) +{ + return efl_canvas_object_render_parent_get(obj); +} + +static inline Efl_Text_Bidirectional_Type +_evas_bidi_direction_type_to_efl_text_bidirectional_type(Evas_BiDi_Direction type) +{ + switch (type) + { +#define CONVERT_TYPE(TYPE) case EVAS_BIDI_DIRECTION_##TYPE: return EFL_TEXT_BIDIRECTIONAL_TYPE_##TYPE + CONVERT_TYPE(NATURAL); //Neutral text type, same as natural + CONVERT_TYPE(LTR); + CONVERT_TYPE(RTL); + CONVERT_TYPE(INHERIT); + default: break; + } + return EFL_TEXT_BIDIRECTIONAL_TYPE_NATURAL; +#undef CONVERT_TYPE +} + +static inline Evas_BiDi_Direction +_efl_text_bidirectional_type_to_evas_bidi_direction_type(Efl_Text_Bidirectional_Type type) +{ + switch (type) + { +#define CONVERT_TYPE(TYPE) case EFL_TEXT_BIDIRECTIONAL_TYPE_##TYPE: return EVAS_BIDI_DIRECTION_##TYPE + CONVERT_TYPE(NATURAL); //Neutral text type, same as natural + CONVERT_TYPE(LTR); + CONVERT_TYPE(RTL); + CONVERT_TYPE(INHERIT); + default: break; + } + return EVAS_BIDI_DIRECTION_NATURAL; +#undef CONVERT_TYPE +} + +EAPI void +evas_object_paragraph_direction_set(Efl_Canvas_Object *obj, Evas_BiDi_Direction dir) +{ + efl_canvas_object_paragraph_direction_set(obj, _evas_bidi_direction_type_to_efl_text_bidirectional_type(dir)); +} + +EAPI Evas_BiDi_Direction +evas_object_paragraph_direction_get(const Efl_Canvas_Object *obj) +{ + return _efl_text_bidirectional_type_to_evas_bidi_direction_type(efl_canvas_object_paragraph_direction_get(obj)); +} diff --git a/src/lib/evas/canvas/efl_canvas_object_eo.legacy.h b/src/lib/evas/canvas/efl_canvas_object_eo.legacy.h new file mode 100644 index 0000000000..b8cd72787f --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_object_eo.legacy.h @@ -0,0 +1,410 @@ +#ifndef _EFL_CANVAS_OBJECT_EO_LEGACY_H_ +#define _EFL_CANVAS_OBJECT_EO_LEGACY_H_ + +#ifndef _EFL_CANVAS_OBJECT_EO_CLASS_TYPE +#define _EFL_CANVAS_OBJECT_EO_CLASS_TYPE + +typedef Eo Efl_Canvas_Object; + +#endif + +#ifndef _EFL_CANVAS_OBJECT_EO_TYPES +#define _EFL_CANVAS_OBJECT_EO_TYPES + +/** Information of animation events + * + * @ingroup Efl_Canvas + */ +typedef struct _Efl_Canvas_Object_Animation_Event Efl_Canvas_Object_Animation_Event; + +/** EFL event animator tick data structure + * + * @ingroup Efl + */ +typedef struct _Efl_Event_Animator_Tick +{ + Eina_Rect update_area; /**< Area of the canvas that will be pushed to screen. + */ +} Efl_Event_Animator_Tick; + + +#endif + + + +/** + * @brief Low-level pointer behaviour. + * + * This function has a direct effect on event callbacks related to pointers + * (mouse, ...). + * + * If the value is @ref EVAS_OBJECT_POINTER_MODE_AUTO_GRAB (default), then + * when mouse is pressed down over this object, events will be restricted to it + * as source, mouse moves, for example, will be emitted even when the pointer + * goes outside this objects geometry. + * + * If the value is @ref EVAS_OBJECT_POINTER_MODE_NO_GRAB, then events will + * be emitted just when inside this object area. + * + * The default value is @ref EVAS_OBJECT_POINTER_MODE_AUTO_GRAB. See also: + * @ref Efl.Canvas.Object.pointer_mode_by_device.get and + * @ref Efl.Canvas.Object.pointer_mode_by_device.set Note: This function will + * only set/get the mode for the default pointer. + * + * @param[in] obj The object. + * @param[in] pointer_mode Input pointer mode + * + * @return @c true if pointer behaviour was set, @c false otherwise + * + * @ingroup Evas_Object_Group + */ +EAPI Eina_Bool evas_object_pointer_mode_set(Efl_Canvas_Object *obj, Evas_Object_Pointer_Mode pointer_mode); + +/** + * @brief Low-level pointer behaviour. + * + * This function has a direct effect on event callbacks related to pointers + * (mouse, ...). + * + * If the value is @ref EVAS_OBJECT_POINTER_MODE_AUTO_GRAB (default), then + * when mouse is pressed down over this object, events will be restricted to it + * as source, mouse moves, for example, will be emitted even when the pointer + * goes outside this objects geometry. + * + * If the value is @ref EVAS_OBJECT_POINTER_MODE_NO_GRAB, then events will + * be emitted just when inside this object area. + * + * The default value is @ref EVAS_OBJECT_POINTER_MODE_AUTO_GRAB. See also: + * @ref Efl.Canvas.Object.pointer_mode_by_device.get and + * @ref Efl.Canvas.Object.pointer_mode_by_device.set Note: This function will + * only set/get the mode for the default pointer. + * + * @param[in] obj The object. + * + * @return Input pointer mode + * + * @ingroup Evas_Object_Group + */ +EAPI Evas_Object_Pointer_Mode evas_object_pointer_mode_get(const Efl_Canvas_Object *obj); + + + +/** + * @brief Clip one object to another. + * + * This function will clip the object @c obj to the area occupied by the object + * @c clip. This means the object @c obj will only be visible within the area + * occupied by the clipping object ($clip). + * + * The color of the object being clipped will be multiplied by the color of the + * clipping one, so the resulting color for the former will be "RESULT = (OBJ * + * CLIP) / (255 * 255)", per color element (red, green, blue and alpha). + * + * Clipping is recursive, so clipping objects may be clipped by others, and + * their color will in term be multiplied. You may not set up circular clipping + * lists (i.e. object 1 clips object 2, which clips object 1): the behavior of + * Evas is undefined in this case. + * + * Objects which do not clip others are visible in the canvas as normal; those + * that clip one or more objects become invisible themselves, only affecting + * what they clip. If an object ceases to have other objects being clipped by + * it, it will become visible again. + * + * The visibility of an object affects the objects that are clipped by it, so + * if the object clipping others is not shown (as in + * @ref Efl.Gfx.Entity.visible), the objects clipped by it will not be shown + * either. + * + * If @c obj was being clipped by another object when this function is called, + * it gets implicitly removed from the old clipper's domain and is made now to + * be clipped by its new clipper. + * + * If @c clip is @c null, this call will disable clipping for the object i.e. + * its visibility and color get detached from the previous clipper. If it + * wasn't, this has no effect. + * + * @note Only rectangle and image (masks) objects can be used as clippers. + * Anything else will result in undefined behaviour. + * + * @param[in] obj The object. + * @param[in] clip The object to clip @c obj by. + * + * @ingroup Evas_Object_Group + */ +EAPI void evas_object_clip_set(Efl_Canvas_Object *obj, Efl_Canvas_Object *clip) EINA_ARG_NONNULL(2); + +/** + * @brief Get the object clipping @c obj (if any). + * + * This function returns the object clipping @c obj. If @c obj is not being + * clipped at all, @c null is returned. The object @c obj must be a valid + * Evas_Object. + * + * @param[in] obj The object. + * + * @return The object to clip @c obj by. + * + * @ingroup Evas_Object_Group + */ +EAPI Efl_Canvas_Object *evas_object_clip_get(const Efl_Canvas_Object *obj); + +/** + * @brief Set whether an Evas object is to repeat events. + * + * If @c repeat is @c true, it will make events on @c obj to also be repeated + * for the next lower object in the objects' stack (see see + * @ref Efl.Gfx.Stack.below). + * + * If @c repeat is @c false, events occurring on @c obj will be processed only + * on it. + * + * @param[in] obj The object. + * @param[in] repeat Whether @c obj is to repeat events ($true) or not + * ($false). + * + * @ingroup Evas_Object_Group + */ +EAPI void evas_object_repeat_events_set(Efl_Canvas_Object *obj, Eina_Bool repeat); + +/** + * @brief Determine whether an object is set to repeat events. + * + * @param[in] obj The object. + * + * @return Whether @c obj is to repeat events ($true) or not ($false). + * + * @ingroup Evas_Object_Group + */ +EAPI Eina_Bool evas_object_repeat_events_get(const Efl_Canvas_Object *obj); + +/** + * @brief Indicates that this object is the keyboard event receiver on its + * canvas. + * + * Changing focus only affects where (key) input events go. There can be only + * one object focused at any time. If @c focus is @c true, @c obj will be set + * as the currently focused object and it will receive all keyboard events that + * are not exclusive key grabs on other objects. See also + * @ref Efl.Canvas.Object.seat_focus_check, + * @ref Efl.Canvas.Object.seat_focus_add, + * @ref Efl.Canvas.Object.seat_focus_del. + * + * @param[in] obj The object. + * @param[in] focus @c true when set as focused or @c false otherwise. + * + * @ingroup Evas_Object_Group + */ +EAPI void evas_object_focus_set(Efl_Canvas_Object *obj, Eina_Bool focus); + +/** + * @brief Indicates that this object is the keyboard event receiver on its + * canvas. + * + * Changing focus only affects where (key) input events go. There can be only + * one object focused at any time. If @c focus is @c true, @c obj will be set + * as the currently focused object and it will receive all keyboard events that + * are not exclusive key grabs on other objects. See also + * @ref Efl.Canvas.Object.seat_focus_check, + * @ref Efl.Canvas.Object.seat_focus_add, + * @ref Efl.Canvas.Object.seat_focus_del. + * + * @param[in] obj The object. + * + * @return @c true when set as focused or @c false otherwise. + * + * @ingroup Evas_Object_Group + */ +EAPI Eina_Bool evas_object_focus_get(const Efl_Canvas_Object *obj); + + + + + +/** + * @brief Set whether to use precise (usually expensive) point collision + * detection for a given Evas object. + * + * Use this function to make Evas treat objects' transparent areas as not + * belonging to it with regard to mouse pointer events. By default, all of the + * object's boundary rectangle will be taken in account for them. + * + * @warning By using precise point collision detection you'll be making Evas + * more resource intensive. + * + * @param[in] obj The object. + * @param[in] precise Whether to use precise point collision detection or not. + * The default value is false. + * + * @ingroup Evas_Object_Group + */ +EAPI void evas_object_precise_is_inside_set(Efl_Canvas_Object *obj, Eina_Bool precise); + +/** + * @brief Determine whether an object is set to use precise point collision + * detection. + * + * @param[in] obj The object. + * + * @return Whether to use precise point collision detection or not. The default + * value is false. + * + * @ingroup Evas_Object_Group + */ +EAPI Eina_Bool evas_object_precise_is_inside_get(const Efl_Canvas_Object *obj); + +/** + * @brief Set whether events on a smart object's member should be propagated up + * to its parent. + * + * This function has no effect if @c obj is not a member of a smart object. + * + * If @c prop is @c true, events occurring on this object will be propagated on + * to the smart object of which @c obj is a member. If @c prop is @c false, + * events occurring on this object will not be propagated on to the smart + * object of which @c obj is a member. The default value is @c true. + * + * See also @ref evas_object_repeat_events_set, + * @ref evas_object_pass_events_set. + * + * @param[in] obj The object. + * @param[in] propagate Whether to propagate events ($true) or not ($false). + * + * @ingroup Evas_Object_Group + */ +EAPI void evas_object_propagate_events_set(Efl_Canvas_Object *obj, Eina_Bool propagate); + +/** + * @brief Retrieve whether an Evas object is set to propagate events. + * + * See also @ref evas_object_repeat_events_get, + * @ref evas_object_pass_events_get. + * + * @param[in] obj The object. + * + * @return Whether to propagate events ($true) or not ($false). + * + * @ingroup Evas_Object_Group + */ +EAPI Eina_Bool evas_object_propagate_events_get(const Efl_Canvas_Object *obj); + +/** + * @brief Set whether an Evas object is to pass (ignore) events. + * + * If @c pass is @c true, it will make events on @c obj to be ignored. They + * will be triggered on the next lower object (that is not set to pass events), + * instead (see @ref Efl.Gfx.Stack.below). + * + * If @c pass is @c false events will be processed on that object as normal. + * + * See also @ref evas_object_repeat_events_set, + * @ref evas_object_propagate_events_set + * + * @param[in] obj The object. + * @param[in] pass Whether @c obj is to pass events ($true) or not ($false). + * + * @ingroup Evas_Object_Group + */ +EAPI void evas_object_pass_events_set(Efl_Canvas_Object *obj, Eina_Bool pass); + +/** + * @brief Determine whether an object is set to pass (ignore) events. + * + * See also @ref evas_object_repeat_events_get, + * @ref evas_object_propagate_events_get. + * + * @param[in] obj The object. + * + * @return Whether @c obj is to pass events ($true) or not ($false). + * + * @ingroup Evas_Object_Group + */ +EAPI Eina_Bool evas_object_pass_events_get(const Efl_Canvas_Object *obj); + +/** + * @brief Sets whether or not the given Evas object is to be drawn + * anti-aliased. + * + * @param[in] obj The object. + * @param[in] anti_alias @c true if the object is to be anti_aliased, @c false + * otherwise. + * + * @ingroup Evas_Object_Group + */ +EAPI void evas_object_anti_alias_set(Efl_Canvas_Object *obj, Eina_Bool anti_alias); + +/** + * @brief Retrieves whether or not the given Evas object is to be drawn + * anti_aliased. + * + * @param[in] obj The object. + * + * @return @c true if the object is to be anti_aliased, @c false otherwise. + * + * @ingroup Evas_Object_Group + */ +EAPI Eina_Bool evas_object_anti_alias_get(const Efl_Canvas_Object *obj); + + +/** + * @brief Gets the parent smart object of a given Evas object, if it has one. + * + * This can be different from @ref Efl.Object.parent because this one is used + * internally for rendering and the normal parent is what the user expects to + * be the parent. + * + * @param[in] obj The object. + * + * @return The parent smart object of @c obj or @c null. + * + * @since 1.18 + * + * @ingroup Evas_Object_Group + */ +EAPI Efl_Canvas_Object *evas_object_smart_parent_get(const Efl_Canvas_Object *obj); + +/** + * @brief This handles text paragraph direction of the given object. Even if + * the given object is not textblock or text, its smart child objects can + * inherit the paragraph direction from the given object. The default paragraph + * direction is @c inherit. + * + * @param[in] obj The object. + * @param[in] dir Paragraph direction for the given object. + * + * @ingroup Evas_Object_Group + */ +EAPI void evas_object_paragraph_direction_set(Efl_Canvas_Object *obj, Evas_BiDi_Direction dir); + +/** + * @brief This handles text paragraph direction of the given object. Even if + * the given object is not textblock or text, its smart child objects can + * inherit the paragraph direction from the given object. The default paragraph + * direction is @c inherit. + * + * @param[in] obj The object. + * + * @return Paragraph direction for the given object. + * + * @ingroup Evas_Object_Group + */ +EAPI Evas_BiDi_Direction evas_object_paragraph_direction_get(const Efl_Canvas_Object *obj); + +/** + * @brief Test if any object is clipped by @c obj. + * + * @param[in] obj The object. + * + * @return @c true if any object is clipped by @c obj, @c false otherwise + * + * @since 1.8 + * + * @ingroup Evas_Object_Group + */ +EAPI Eina_Bool evas_object_clipees_has(const Efl_Canvas_Object *obj) EINA_WARN_UNUSED_RESULT; + + + + + + +#endif diff --git a/src/lib/evas/canvas/efl_canvas_polygon.eo b/src/lib/evas/canvas/efl_canvas_polygon.eo index 668ac95090..1806389723 100644 --- a/src/lib/evas/canvas/efl_canvas_polygon.eo +++ b/src/lib/evas/canvas/efl_canvas_polygon.eo @@ -1,4 +1,4 @@ -class Efl.Canvas.Polygon extends Efl.Canvas.Object +class @beta Efl.Canvas.Polygon extends Efl.Canvas.Object { [[Low-level polygon object]] diff --git a/src/lib/evas/canvas/efl_canvas_proxy.c b/src/lib/evas/canvas/efl_canvas_proxy.c index b057400808..c8368eaed6 100644 --- a/src/lib/evas/canvas/efl_canvas_proxy.c +++ b/src/lib/evas/canvas/efl_canvas_proxy.c @@ -220,7 +220,7 @@ _evas_image_proxy_set(Evas_Object *eo_proxy, Evas_Object *eo_src) Evas_Image_Data *o = efl_data_scope_get(eo_proxy, EFL_CANVAS_IMAGE_INTERNAL_CLASS); if (o->legacy_type) - efl_file_set(eo_proxy, NULL, NULL); + efl_file_simple_load(eo_proxy, NULL, NULL); EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, proxy->proxy, Evas_Object_Proxy_Data, proxy_write) proxy_write->is_proxy = EINA_TRUE; @@ -229,7 +229,7 @@ _evas_image_proxy_set(Evas_Object *eo_proxy, Evas_Object *eo_src) EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) state_write->source = eo_src; EINA_COW_IMAGE_STATE_WRITE_END(o, state_write); - o->load_error = EVAS_LOAD_ERROR_NONE; + o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_NONE;; o->proxyerror = 0; EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, src->proxy, Evas_Object_Proxy_Data, proxy_src_write) diff --git a/src/lib/evas/canvas/efl_canvas_proxy.eo b/src/lib/evas/canvas/efl_canvas_proxy.eo index 9c3f9a3f0e..f13b07a5c0 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 extends Efl.Canvas.Image_Internal +class @beta Efl.Canvas.Proxy extends Efl.Canvas.Image_Internal { [[Low-level proxy image object. @@ -15,7 +15,7 @@ class Efl.Canvas.Proxy extends Efl.Canvas.Image_Internal source object in its drawing region, without affecting that source in any way. The source must be another valid @Efl.Canvas.Object. Other effects may be applied to the proxy, such as a map (see - @Efl.Gfx.Map) to create a reflection of the original object + @Efl.Gfx.Mapping) to create a reflection of the original object (for example). Any existing source object will be removed after this call. @@ -40,8 +40,6 @@ class Efl.Canvas.Proxy extends Efl.Canvas.Image_Internal and apply some sort of transformation on it. $true means both objects will share the same clip. - - @since 1.8 ]] set {} get {} @@ -60,8 +58,6 @@ class Efl.Canvas.Proxy extends Efl.Canvas.Image_Internal If $source is $false, events occurring on $obj will be processed only on it. - - @since 1.8 ]] set {} get {} diff --git a/src/lib/evas/canvas/efl_canvas_rectangle.eo b/src/lib/evas/canvas/efl_canvas_rectangle.eo index 181481d688..1c93c7c4fe 100644 --- a/src/lib/evas/canvas/efl_canvas_rectangle.eo +++ b/src/lib/evas/canvas/efl_canvas_rectangle.eo @@ -1,4 +1,4 @@ -class Efl.Canvas.Rectangle extends Efl.Canvas.Object +class @beta Efl.Canvas.Rectangle extends Efl.Canvas.Object { [[Evas canvas rectangle class]] implements { diff --git a/src/lib/evas/canvas/efl_canvas_scene3d.c b/src/lib/evas/canvas/efl_canvas_scene3d.c index 3dff89783a..513a68ba94 100644 --- a/src/lib/evas/canvas/efl_canvas_scene3d.c +++ b/src/lib/evas/canvas/efl_canvas_scene3d.c @@ -9,12 +9,14 @@ _efl_canvas_scene3d_scene3d_set(Eo *eo_obj, void *pd EINA_UNUSED, Evas_Canvas3D_ Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS); Evas_Image_Load_Opts lo; + int load_error; if (o->cur->scene == scene) return; evas_object_async_block(obj); _evas_image_init_set(NULL, NULL, eo_obj, obj, o, &lo); - o->engine_data = ENFN->image_mmap(ENC, o->cur->f, o->cur->key, &o->load_error, &lo); + o->engine_data = ENFN->image_mmap(ENC, o->cur->f, o->cur->key, &load_error, &lo); + o->load_error = _evas_load_error_to_efl_gfx_image_load_error(load_error); _evas_image_done_set(eo_obj, obj, o); if (scene) _evas_image_3d_set(eo_obj, scene); diff --git a/src/lib/evas/canvas/efl_canvas_scene3d.eo b/src/lib/evas/canvas/efl_canvas_scene3d.eo index 4fb08435d9..8d506be64c 100644 --- a/src/lib/evas/canvas/efl_canvas_scene3d.eo +++ b/src/lib/evas/canvas/efl_canvas_scene3d.eo @@ -1,12 +1,10 @@ -class Efl.Canvas.Scene3d extends Efl.Canvas.Image_Internal +class @beta Efl.Canvas.Scene3d extends Efl.Canvas.Image_Internal { [[A UI view for EFL Canvas 3D.]] data: null; methods { @property scene3d { [[The 3d scene to display in this view. - - @since 1.10 ]] set {} get {} diff --git a/src/lib/evas/canvas/efl_canvas_snapshot.eo b/src/lib/evas/canvas/efl_canvas_snapshot.eo index 147f58ed77..82a913fc15 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 extends Efl.Canvas.Image_Internal +class @beta Efl.Canvas.Snapshot extends Efl.Canvas.Image_Internal { [[Low-level snapshot image object. diff --git a/src/lib/evas/canvas/efl_canvas_surface.eo b/src/lib/evas/canvas/efl_canvas_surface.eo index 729fb1a37f..cf42a58c0d 100644 --- a/src/lib/evas/canvas/efl_canvas_surface.eo +++ b/src/lib/evas/canvas/efl_canvas_surface.eo @@ -1,4 +1,4 @@ -abstract Efl.Canvas.Surface extends Efl.Canvas.Image_Internal +abstract @beta Efl.Canvas.Surface extends 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 6171c1ec88..89a00d2472 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 extends Efl.Canvas.Surface +class @beta Efl.Canvas.Surface_Tbm extends 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 882d4c8e27..517c56b9a1 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 extends Efl.Canvas.Surface +class @beta Efl.Canvas.Surface_Wayland extends Efl.Canvas.Surface { [[Native Wayland surface for Efl canvas]] diff --git a/src/lib/evas/canvas/efl_canvas_surface_x11.eo b/src/lib/evas/canvas/efl_canvas_surface_x11.eo index 64fe4efdf9..129429c06e 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 @beta 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 extends Efl.Canvas.Surface +class @beta Efl.Canvas.Surface_X11 extends 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 9e569a67bf..8e334cefb5 100644 --- a/src/lib/evas/canvas/efl_canvas_text.eo +++ b/src/lib/evas/canvas/efl_canvas_text.eo @@ -1,22 +1,18 @@ import efl_text_types; -struct Efl.Canvas.Text_Style; [[EFL text style data structure]] +struct @beta Efl.Canvas.Text_Style; [[EFL text style data structure]] -class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, +class @beta Efl.Canvas.Text extends Efl.Canvas.Object implements 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.I18n + Efl.Text_Annotate, Efl.Text_Markup, Efl.Text_Markup_Interactive, Efl.Ui.I18n { [[Efl canvas text class]] - legacy_prefix: evas_object_textblock; methods { @property is_empty { [[Whether the object is empty (no text) or not - - @since 1.18 ]] get { - legacy: null; } values { is_empty: bool; [[$true if empty, $false otherwise]] @@ -28,8 +24,6 @@ class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, The given $start and $end cursor act like out-variables here, as they are set to the positions of the start and the end of the visible range in the text, respectively. - - @since 1.18 ]] return: bool; [[$true on success, $false otherwise]] params { @@ -41,8 +35,6 @@ class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, [[Gets the left, right, top and bottom insets of the text. The inset is any applied padding on the text. - - @since 1.18 ]] get {} values { @@ -57,8 +49,6 @@ class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, segments. This is useful, for example, in the recipient fields of e-mail clients where bidi oddities can occur when mixing RTL and LTR. - - @since 1.18 ]] set {} get {} @@ -68,8 +58,6 @@ class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, } @property legacy_newline { [[When $true, newline character will behave as a paragraph separator. - - @since 1.18 ]] set {} get {} @@ -87,14 +75,10 @@ class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, first. Set $style to $NULL to delete it. - - @since 1.18 ]] set { - legacy: null; } get { - legacy: null; } keys { key: string; [[The name to the style. $NULL is the default style]] @@ -120,8 +104,6 @@ class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, "You shall not pass!" with no margins or padding and assuming a monospace font and a size of 7x10 char widths (for simplicity) has a native size of 19x1 and a formatted size of 5x4. - - @since 1.18 ]] get {} values { @@ -146,8 +128,6 @@ class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, "You shall not pass!" with no margins or padding and assuming a monospace font and a size of 7x10 char widths (for simplicity) has a native size of 19x1 and a formatted size of 5x4. - - @since 1.18 ]] get {} values { @@ -157,10 +137,7 @@ class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, } range_text_get @const { [[Returns the text in the range between $cur1 and $cur2. - - @since 1.18 ]] - legacy: null; return: mstring @owned; [[The text in the given range]] params { @cref cur1: Efl.Text_Cursor_Cursor; [[Start of range]] @@ -172,10 +149,7 @@ class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, The geometry is represented as rectangles for each of the line segments in the given range [$cur1, $cur2]. - - @since 1.19 ]] - legacy: null; params { @cref cur1: Efl.Text_Cursor_Cursor; [[Start of range]] @cref cur2: Efl.Text_Cursor_Cursor; [[End of range]] @@ -190,10 +164,7 @@ class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, The geometry is the geometry in which rectangles in middle lines of range are merged into one big rectangle. This is an optimized version of @.range_geometry_get. - - @since 1.19 ]] - legacy: null; params { @cref cur1: Efl.Text_Cursor_Cursor; [[Start of range]] @cref cur2: Efl.Text_Cursor_Cursor; [[End of range]] @@ -207,7 +178,6 @@ class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, This removes all the text in given range [$start,$end]. ]] - legacy: null; params { @in cur1: ptr(Efl.Text_Cursor_Cursor); [[Range start position]] @in cur2: ptr(Efl.Text_Cursor_Cursor); [[Range end position]] @@ -220,8 +190,6 @@ class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, The textblock does the layout of the text according to the position of the obstacle. - - @since 1.18 ]] params { @in eo_obs: Efl.Canvas.Object; [[Obstacle object]] @@ -230,8 +198,6 @@ class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, } obstacle_del { [[Removes $eo_obs from observation during text layout. - - @since 1.18 ]] params { @in eo_obs: Efl.Canvas.Object; [[Obstacle object]] @@ -250,8 +216,6 @@ class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, differrent coordinates relative to the textblock, you need to call this so it will consider this new state and will relayout the text. - - @since 1.18 ]] } async_layout { @@ -259,10 +223,7 @@ class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, Once layout is complete, the result is returned as @Eina.Rect, with w, h fields set. - - @since 1.21 ]] - legacy: null; return: future @owned; [[Future for layout result]] } } @@ -353,8 +314,8 @@ class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, 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.Text_Markup.markup_range { get;} + Efl.Text_Markup_Interactive.cursor_markup_insert; + Efl.Text_Markup_Interactive.markup_range { get;} Efl.Gfx.Entity.scale { set; } } events { diff --git a/src/lib/evas/canvas/efl_canvas_text_eo.legacy.c b/src/lib/evas/canvas/efl_canvas_text_eo.legacy.c new file mode 100644 index 0000000000..326707b30c --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_text_eo.legacy.c @@ -0,0 +1,66 @@ + +EAPI Eina_Bool +evas_object_textblock_visible_range_get(Efl_Canvas_Text *obj, Efl_Text_Cursor_Cursor *start, Efl_Text_Cursor_Cursor *end) +{ + return efl_canvas_text_visible_range_get(obj, start, end); +} + +EAPI void +evas_object_textblock_style_insets_get(const Efl_Canvas_Text *obj, int *l, int *r, int *t, int *b) +{ + efl_canvas_text_style_insets_get(obj, l, r, t, b); +} + +EAPI void +evas_object_textblock_bidi_delimiters_set(Efl_Canvas_Text *obj, const char *delim) +{ + efl_canvas_text_bidi_delimiters_set(obj, delim); +} + +EAPI const char * +evas_object_textblock_bidi_delimiters_get(const Efl_Canvas_Text *obj) +{ + return efl_canvas_text_bidi_delimiters_get(obj); +} + +EAPI void +evas_object_textblock_legacy_newline_set(Efl_Canvas_Text *obj, Eina_Bool mode) +{ + efl_canvas_text_legacy_newline_set(obj, mode); +} + +EAPI Eina_Bool +evas_object_textblock_legacy_newline_get(const Efl_Canvas_Text *obj) +{ + return efl_canvas_text_legacy_newline_get(obj); +} + +EAPI void +evas_object_textblock_size_formatted_get(const Efl_Canvas_Text *obj, int *w, int *h) +{ + efl_canvas_text_size_formatted_get(obj, w, h); +} + +EAPI void +evas_object_textblock_size_native_get(const Efl_Canvas_Text *obj, int *w, int *h) +{ + efl_canvas_text_size_native_get(obj, w, h); +} + +EAPI Eina_Bool +evas_object_textblock_obstacle_add(Efl_Canvas_Text *obj, Efl_Canvas_Object *eo_obs) +{ + return efl_canvas_text_obstacle_add(obj, eo_obs); +} + +EAPI Eina_Bool +evas_object_textblock_obstacle_del(Efl_Canvas_Text *obj, Efl_Canvas_Object *eo_obs) +{ + return efl_canvas_text_obstacle_del(obj, eo_obs); +} + +EAPI void +evas_object_textblock_obstacles_update(Efl_Canvas_Text *obj) +{ + efl_canvas_text_obstacles_update(obj); +} diff --git a/src/lib/evas/canvas/efl_canvas_text_eo.legacy.h b/src/lib/evas/canvas/efl_canvas_text_eo.legacy.h new file mode 100644 index 0000000000..900c6daa90 --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_text_eo.legacy.h @@ -0,0 +1,228 @@ +#ifndef _EFL_CANVAS_TEXT_EO_LEGACY_H_ +#define _EFL_CANVAS_TEXT_EO_LEGACY_H_ + +#ifndef _EFL_CANVAS_TEXT_EO_CLASS_TYPE +#define _EFL_CANVAS_TEXT_EO_CLASS_TYPE + +typedef Eo Efl_Canvas_Text; + +#endif + +#ifndef _EFL_CANVAS_TEXT_EO_TYPES +#define _EFL_CANVAS_TEXT_EO_TYPES + +/** EFL text style data structure + * + * @ingroup Efl_Canvas + */ +typedef struct _Efl_Canvas_Text_Style Efl_Canvas_Text_Style; + + +#endif + + +/** + * @brief Returns the currently visible range. + * + * The given @c start and @c end cursor act like out-variables here, as they + * are set to the positions of the start and the end of the visible range in + * the text, respectively. + * + * @param[in] obj The object. + * @param[in] start Range start position + * @param[in] end Range end position + * + * @return @c true on success, @c false otherwise + * + * @since 1.18 + * + * @ingroup Evas_Object_Textblock_Group + */ +EAPI Eina_Bool evas_object_textblock_visible_range_get(Efl_Canvas_Text *obj, Efl_Text_Cursor_Cursor *start, Efl_Text_Cursor_Cursor *end); + +/** + * @brief Gets the left, right, top and bottom insets of the text. + * + * The inset is any applied padding on the text. + * + * @param[in] obj The object. + * @param[out] l Left padding + * @param[out] r Right padding + * @param[out] t Top padding + * @param[out] b Bottom padding + * + * @since 1.18 + * + * @ingroup Evas_Object_Textblock_Group + */ +EAPI void evas_object_textblock_style_insets_get(const Efl_Canvas_Text *obj, int *l, int *r, int *t, int *b); + +/** + * @brief BiDi delimiters are used for in-paragraph separation of bidi + * segments. This is useful, for example, in the recipient fields of e-mail + * clients where bidi oddities can occur when mixing RTL and LTR. + * + * @param[in] obj The object. + * @param[in] delim A null terminated string of delimiters, e.g ",|" or @c null + * if empty + * + * @since 1.18 + * + * @ingroup Evas_Object_Textblock_Group + */ +EAPI void evas_object_textblock_bidi_delimiters_set(Efl_Canvas_Text *obj, const char *delim); + +/** + * @brief BiDi delimiters are used for in-paragraph separation of bidi + * segments. This is useful, for example, in the recipient fields of e-mail + * clients where bidi oddities can occur when mixing RTL and LTR. + * + * @param[in] obj The object. + * + * @return A null terminated string of delimiters, e.g ",|" or @c null if empty + * + * @since 1.18 + * + * @ingroup Evas_Object_Textblock_Group + */ +EAPI const char *evas_object_textblock_bidi_delimiters_get(const Efl_Canvas_Text *obj); + +/** + * @brief When @c true, newline character will behave as a paragraph separator. + * + * @param[in] obj The object. + * @param[in] mode @c true for legacy mode, @c false otherwise + * + * @since 1.18 + * + * @ingroup Evas_Object_Textblock_Group + */ +EAPI void evas_object_textblock_legacy_newline_set(Efl_Canvas_Text *obj, Eina_Bool mode); + +/** + * @brief When @c true, newline character will behave as a paragraph separator. + * + * @param[in] obj The object. + * + * @return @c true for legacy mode, @c false otherwise + * + * @since 1.18 + * + * @ingroup Evas_Object_Textblock_Group + */ +EAPI Eina_Bool evas_object_textblock_legacy_newline_get(const Efl_Canvas_Text *obj); + + + +/** + * @brief The formatted width and height. + * + * This calculates the actual size after restricting the textblock to the + * current size of the object. + * + * The main difference between this and + * @ref evas_object_textblock_size_native_get is that the "native" function + * does not wrapping into account it just calculates the real width of the + * object if it was placed on an infinite canvas, while this function gives the + * size after wrapping according to the size restrictions of the object. + * + * For example for a textblock containing the text: "You shall not pass!" with + * no margins or padding and assuming a monospace font and a size of 7x10 char + * widths (for simplicity) has a native size of 19x1 and a formatted size of + * 5x4. + * + * @param[in] obj The object. + * @param[out] w The width of the object. + * @param[out] h The height of the object. + * + * @since 1.18 + * + * @ingroup Evas_Object_Textblock_Group + */ +EAPI void evas_object_textblock_size_formatted_get(const Efl_Canvas_Text *obj, int *w, int *h); + +/** + * @brief The native width and height. + * + * This calculates the actual size without taking account the current size of + * the object. + * + * The main difference between this and + * @ref evas_object_textblock_size_formatted_get is that the "native" function + * does not take wrapping into account it just calculates the real width of the + * object if it was placed on an infinite canvas, while the "formatted" + * function gives the size after wrapping text according to the size + * restrictions of the object. + * + * For example for a textblock containing the text: "You shall not pass!" with + * no margins or padding and assuming a monospace font and a size of 7x10 char + * widths (for simplicity) has a native size of 19x1 and a formatted size of + * 5x4. + * + * @param[in] obj The object. + * @param[out] w The width returned. + * @param[out] h The height returned. + * + * @since 1.18 + * + * @ingroup Evas_Object_Textblock_Group + */ +EAPI void evas_object_textblock_size_native_get(const Efl_Canvas_Text *obj, int *w, int *h); + + + + + +/** + * @brief Add obstacle evas object @c eo_obs to be observed during layout of + * text. + * + * The textblock does the layout of the text according to the position of the + * obstacle. + * + * @param[in] obj The object. + * @param[in] eo_obs Obstacle object + * + * @return @c true on success, @c false otherwise. + * + * @since 1.18 + * + * @ingroup Evas_Object_Textblock_Group + */ +EAPI Eina_Bool evas_object_textblock_obstacle_add(Efl_Canvas_Text *obj, Efl_Canvas_Object *eo_obs); + +/** + * @brief Removes @c eo_obs from observation during text layout. + * + * @param[in] obj The object. + * @param[in] eo_obs Obstacle object + * + * @return @c true on success, @c false otherwise. + * + * @since 1.18 + * + * @ingroup Evas_Object_Textblock_Group + */ +EAPI Eina_Bool evas_object_textblock_obstacle_del(Efl_Canvas_Text *obj, Efl_Canvas_Object *eo_obs); + +/** + * @brief Triggers for relayout due to obstacles' state change. + * + * The obstacles alone don't affect the layout, until this is called. Use this + * after doing changes (moving, positioning etc.) in the obstacles that you + * would like to be considered in the layout. + * + * For example: if you have just repositioned the obstacles to differrent + * coordinates relative to the textblock, you need to call this so it will + * consider this new state and will relayout the text. + * + * @param[in] obj The object. + * + * @since 1.18 + * + * @ingroup Evas_Object_Textblock_Group + */ +EAPI void evas_object_textblock_obstacles_update(Efl_Canvas_Text *obj); + + +#endif diff --git a/src/lib/evas/canvas/efl_canvas_text_factory.eo b/src/lib/evas/canvas/efl_canvas_text_factory.eo index 6f55935015..51ca68b92b 100644 --- a/src/lib/evas/canvas/efl_canvas_text_factory.eo +++ b/src/lib/evas/canvas/efl_canvas_text_factory.eo @@ -1,4 +1,4 @@ -interface Efl.Canvas.Text_Factory +interface @beta Efl.Canvas.Text_Factory { [[Object factory that creates Efl.Canvas.Object objects. @@ -7,8 +7,6 @@ interface Efl.Canvas.Text_Factory 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 { diff --git a/src/lib/evas/canvas/efl_canvas_vg_container.c b/src/lib/evas/canvas/efl_canvas_vg_container.c index f82f18a9f2..7623401896 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_container.c +++ b/src/lib/evas/canvas/efl_canvas_vg_container.c @@ -5,6 +5,23 @@ #define MY_CLASS EFL_CANVAS_VG_CONTAINER_CLASS + +//FIXME: This enum add temporarily to help understanding of additional code +//related to masking in prepare_mask. +//This needs to be formally declared through the eo class. +//This is a list of blending supported via efl_canvas_vg_node_mask_set(). +typedef enum _EFL_CANVAS_VG_NODE_BLEND_TYPE +{ + EFL_CANVAS_VG_NODE_BLEND_TYPE_NONE = 0, + EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA, + EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA_INV, + EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_ADD, + EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_SUBSTRACT, + EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_INTERSECT, + EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_DIFFERENCE +}EFL_CANVAS_VG_NODE_BLEND_TYPE; +// + static void _invalidate_cb(void *data EINA_UNUSED, const Efl_Event *event) { @@ -22,11 +39,38 @@ _invalidate_cb(void *data EINA_UNUSED, const Efl_Event *event) efl_unref(child); } +static void +_draw_mask(Evas_Object_Protected_Data *obj, Efl_VG *node, + Ector_Surface *ector, void *engine, void *output, + void *context) +{ + if (!efl_gfx_entity_visible_get(node)) return; + + if (efl_isa(node, EFL_CANVAS_VG_CONTAINER_CLASS)) + { + Efl_Canvas_Vg_Container_Data *cd = + efl_data_scope_get(node, EFL_CANVAS_VG_CONTAINER_CLASS); + + //Draw Mask Image. + Efl_VG *child; + Eina_List *l; + EINA_LIST_FOREACH(cd->children, l, child) + _draw_mask(obj, child, ector, engine, output, context); + } + else + { + Efl_Canvas_Vg_Node_Data *nd = efl_data_scope_get(node, EFL_CANVAS_VG_NODE_CLASS); + ENFN->ector_renderer_draw(engine, output, context, nd->renderer, NULL, EINA_FALSE); + } +} + static Ector_Buffer * _prepare_mask(Evas_Object_Protected_Data *obj, //vector object Efl_Canvas_Vg_Node* mask_obj, + void *engine, void *output, void *context, Ector_Surface *surface, Eina_Matrix3 *ptransform, + Eina_Matrix3 *ctransform, Ector_Buffer *mask, int mask_op) { @@ -34,6 +78,7 @@ _prepare_mask(Evas_Object_Protected_Data *obj, //vector object Efl_Canvas_Vg_Node_Data *nd = efl_data_scope_get(mask_obj, EFL_CANVAS_VG_NODE_CLASS); if (nd->flags == EFL_GFX_CHANGE_FLAG_NONE) return pd->mask.buffer; + uint32_t init_buffer = 0x0; //1. Mask Size Eina_Rect mbound; @@ -42,7 +87,9 @@ _prepare_mask(Evas_Object_Protected_Data *obj, //vector object mbound.w = obj->cur->geometry.w; mbound.h = obj->cur->geometry.h; -// efl_gfx_path_bounds_get(mask, &mbound); + //FIXME: If mask typs is SUBSTRACT or INTERSECT, buffer fills in white color(Full alpha color). + if (pd->mask.option == EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_SUBSTRACT || pd->mask.option == EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_INTERSECT) + init_buffer = 0xFFFFFFFF; //2. Reusable ector buffer? if (!pd->mask.buffer || (pd->mask.bound.w != mbound.w) || @@ -50,7 +97,8 @@ _prepare_mask(Evas_Object_Protected_Data *obj, //vector object { if (pd->mask.pixels) free(pd->mask.pixels); if (pd->mask.buffer) efl_unref(pd->mask.buffer); - pd->mask.pixels = calloc(sizeof(uint32_t), mbound.w * mbound.h); + pd->mask.pixels = malloc(sizeof(uint32_t) * (mbound.w * mbound.h)); + memset(pd->mask.pixels, init_buffer, sizeof(uint32_t) * (mbound.w * mbound.h)); pd->mask.buffer = ENFN->ector_buffer_new(ENC, obj->layer->evas->evas, mbound.w, mbound.h, EFL_GFX_COLORSPACE_ARGB8888, @@ -67,7 +115,7 @@ _prepare_mask(Evas_Object_Protected_Data *obj, //vector object else { if (pd->mask.pixels) - memset(pd->mask.pixels, 0x0, sizeof(uint32_t) * mbound.w * mbound.h); + memset(pd->mask.pixels, init_buffer, sizeof(uint32_t) * mbound.w * mbound.h); } pd->mask.bound.x = mbound.x; @@ -75,10 +123,33 @@ _prepare_mask(Evas_Object_Protected_Data *obj, //vector object if (!pd->mask.buffer) ERR("Mask Buffer is invalid"); - pd->mask.dirty = EINA_TRUE; + //FIXME: This code means that there is another masking container. + if (pd->mask.option != EFL_CANVAS_VG_NODE_BLEND_TYPE_NONE) + { + Efl_Canvas_Vg_Container_Data *src_pd = pd; + mask = pd->mask.buffer; + for (Efl_VG *mask_src = pd->mask_src; mask_src; mask_src = src_pd->mask_src) + { + Efl_Canvas_Vg_Container_Data *target_pd = NULL; + src_pd = efl_data_scope_get(mask_src, MY_CLASS); + target_pd = efl_data_scope_get(eina_list_nth(src_pd->mask.target, 0), MY_CLASS); + _evas_vg_render_pre(obj, mask_src, + engine, output, context, surface, + ctransform, mask, target_pd->mask.option); + } + } - //3. Prepare Drawing shapes... - _evas_vg_render_pre(obj, mask_obj, surface, ptransform, mask, mask_op); + //3. Prepare Drawing shapes. + _evas_vg_render_pre(obj, mask_obj, + engine, output, context, + surface, + ptransform, mask, mask_op); + + //4. Generating Mask Image. + ector_buffer_pixels_set(surface, pd->mask.pixels, mbound.w, mbound.h, 0, + EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE); + ector_surface_reference_point_set(surface, -mbound.x, -mbound.y); + _draw_mask(obj, mask_obj, surface, engine, output, context); return pd->mask.buffer; } @@ -87,6 +158,7 @@ static void _efl_canvas_vg_container_render_pre(Evas_Object_Protected_Data *vg_pd, Efl_VG *obj EINA_UNUSED, Efl_Canvas_Vg_Node_Data *nd, + void *engine, void *output, void *context, Ector_Surface *surface, Eina_Matrix3 *ptransform, Ector_Buffer *mask, @@ -106,11 +178,12 @@ _efl_canvas_vg_container_render_pre(Evas_Object_Protected_Data *vg_pd, EFL_CANVAS_VG_COMPUTE_MATRIX(ctransform, ptransform, nd); //Container may have mask source. - if (pd->mask_src) + if (pd->mask_src && !pd->mask.target) { - mask = _prepare_mask(vg_pd, pd->mask_src, surface, ptransform, mask, - mask_op); mask_op = pd->mask.option; + mask = _prepare_mask(vg_pd, pd->mask_src, + engine, output, context, surface, + ptransform, ctransform, mask, mask_op); } EINA_LIST_FOREACH(pd->children, l, child) @@ -133,7 +206,9 @@ _efl_canvas_vg_container_render_pre(Evas_Object_Protected_Data *vg_pd, if (flag & EFL_GFX_CHANGE_FLAG_MATRIX) child_nd->flags |= EFL_GFX_CHANGE_FLAG_MATRIX; - _evas_vg_render_pre(vg_pd, child, surface, ctransform, mask, mask_op); + _evas_vg_render_pre(vg_pd, child, + engine, output, context, surface, + ctransform, mask, mask_op); } } @@ -371,3 +446,4 @@ evas_vg_container_add(Efl_VG *parent) } #include "efl_canvas_vg_container.eo.c" +#include "efl_canvas_vg_container_eo.legacy.c" diff --git a/src/lib/evas/canvas/efl_canvas_vg_container.eo b/src/lib/evas/canvas/efl_canvas_vg_container.eo index 3c24c03a2b..43317b900a 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_container.eo +++ b/src/lib/evas/canvas/efl_canvas_vg_container.eo @@ -1,7 +1,6 @@ -class Efl.Canvas.Vg.Container extends Efl.Canvas.Vg.Node +class @beta Efl.Canvas.Vg.Container extends Efl.Canvas.Vg.Node { [[Efl vector graphics container class]] - legacy_prefix: evas_vg_container; methods { child_get { [[Get child of container]] diff --git a/src/lib/evas/canvas/efl_canvas_vg_container_eo.legacy.c b/src/lib/evas/canvas/efl_canvas_vg_container_eo.legacy.c new file mode 100644 index 0000000000..a31fc33d44 --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_vg_container_eo.legacy.c @@ -0,0 +1,12 @@ + +EAPI Efl_Canvas_Vg_Node * +evas_vg_container_child_get(Efl_Canvas_Vg_Container *obj, const char *name) +{ + return efl_canvas_vg_container_child_get(obj, name); +} + +EAPI Eina_Iterator * +evas_vg_container_children_get(Efl_Canvas_Vg_Container *obj) +{ + return efl_canvas_vg_container_children_get(obj); +} diff --git a/src/lib/evas/canvas/efl_canvas_vg_container_eo.legacy.h b/src/lib/evas/canvas/efl_canvas_vg_container_eo.legacy.h new file mode 100644 index 0000000000..691a93b3c4 --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_vg_container_eo.legacy.h @@ -0,0 +1,40 @@ +#ifndef _EFL_CANVAS_VG_CONTAINER_EO_LEGACY_H_ +#define _EFL_CANVAS_VG_CONTAINER_EO_LEGACY_H_ + +#ifndef _EFL_CANVAS_VG_CONTAINER_EO_CLASS_TYPE +#define _EFL_CANVAS_VG_CONTAINER_EO_CLASS_TYPE + +typedef Eo Efl_Canvas_Vg_Container; + +#endif + +#ifndef _EFL_CANVAS_VG_CONTAINER_EO_TYPES +#define _EFL_CANVAS_VG_CONTAINER_EO_TYPES + + +#endif + +/** + * @brief Get child of container + * + * @param[in] obj The object. + * @param[in] name Child node name + * + * @return Child object + * + * @ingroup Evas_Vg_Container_Group + */ +EAPI Efl_Canvas_Vg_Node *evas_vg_container_child_get(Efl_Canvas_Vg_Container *obj, const char *name); + +/** + * @brief Get all children of container + * + * @param[in] obj The object. + * + * @return Iterator to children + * + * @ingroup Evas_Vg_Container_Group + */ +EAPI Eina_Iterator *evas_vg_container_children_get(Efl_Canvas_Vg_Container *obj) EINA_WARN_UNUSED_RESULT; + +#endif diff --git a/src/lib/evas/canvas/efl_canvas_vg_gradient.eo b/src/lib/evas/canvas/efl_canvas_vg_gradient.eo index 409b24633d..08731dcc04 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_gradient.eo +++ b/src/lib/evas/canvas/efl_canvas_vg_gradient.eo @@ -1,7 +1,6 @@ -abstract Efl.Canvas.Vg.Gradient extends Efl.Canvas.Vg.Node implements Efl.Gfx.Gradient +abstract @beta Efl.Canvas.Vg.Gradient extends Efl.Canvas.Vg.Node implements 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; } diff --git a/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.c b/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.c index ad3118f23e..0b1435202b 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.c +++ b/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.c @@ -59,6 +59,9 @@ static void _efl_canvas_vg_gradient_linear_render_pre(Evas_Object_Protected_Data *vg_pd EINA_UNUSED, Efl_VG *obj, Efl_Canvas_Vg_Node_Data *nd, + void *engine EINA_UNUSED, + void *output EINA_UNUSED, + void *context EINA_UNUSED, Ector_Surface *surface, Eina_Matrix3 *ptransform, Ector_Buffer *mask, diff --git a/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.eo b/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.eo index 2fa9a7122c..21d3be7d5e 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.eo +++ b/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.eo @@ -1,7 +1,6 @@ -class Efl.Canvas.Vg.Gradient_Linear extends Efl.Canvas.Vg.Gradient implements Efl.Gfx.Gradient_Linear +class @beta Efl.Canvas.Vg.Gradient_Linear extends Efl.Canvas.Vg.Gradient implements 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; } diff --git a/src/lib/evas/canvas/efl_canvas_vg_gradient_radial.c b/src/lib/evas/canvas/efl_canvas_vg_gradient_radial.c index 4146cddf04..691dc5dec8 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_gradient_radial.c +++ b/src/lib/evas/canvas/efl_canvas_vg_gradient_radial.c @@ -75,6 +75,9 @@ static void _efl_canvas_vg_gradient_radial_render_pre(Evas_Object_Protected_Data *vg_pd EINA_UNUSED, Efl_VG *obj, Efl_Canvas_Vg_Node_Data *nd, + void *engine EINA_UNUSED, + void *output EINA_UNUSED, + void *context EINA_UNUSED, Ector_Surface *surface, Eina_Matrix3 *ptransform, Ector_Buffer *mask, diff --git a/src/lib/evas/canvas/efl_canvas_vg_gradient_radial.eo b/src/lib/evas/canvas/efl_canvas_vg_gradient_radial.eo index 07df740238..3119d6359c 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_gradient_radial.eo +++ b/src/lib/evas/canvas/efl_canvas_vg_gradient_radial.eo @@ -1,7 +1,6 @@ -class Efl.Canvas.Vg.Gradient_Radial extends Efl.Canvas.Vg.Gradient implements Efl.Gfx.Gradient_Radial +class @beta Efl.Canvas.Vg.Gradient_Radial extends Efl.Canvas.Vg.Gradient implements 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; } diff --git a/src/lib/evas/canvas/efl_canvas_vg_node.c b/src/lib/evas/canvas/efl_canvas_vg_node.c index fba95e7924..77e4eaffa8 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_node.c +++ b/src/lib/evas/canvas/efl_canvas_vg_node.c @@ -384,7 +384,7 @@ _efl_canvas_vg_node_efl_object_parent_set(Eo *obj, } static void -_efl_canvas_vg_node_efl_gfx_stack_raise(Eo *obj, Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED) +_efl_canvas_vg_node_efl_gfx_stack_raise_to_top(Eo *obj, Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED) { Efl_Canvas_Vg_Container_Data *cd; Eina_List *lookup, *next; @@ -472,7 +472,7 @@ _efl_canvas_vg_node_efl_gfx_stack_stack_below(Eo *obj, } static void -_efl_canvas_vg_node_efl_gfx_stack_lower(Eo *obj, Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED) +_efl_canvas_vg_node_efl_gfx_stack_lower_to_bottom(Eo *obj, Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED) { Efl_Canvas_Vg_Container_Data *cd; Eina_List *lookup, *prev; @@ -833,13 +833,14 @@ evas_vg_node_stack_above(Eo *obj, Eo *above) EAPI void evas_vg_node_raise(Eo *obj) { - efl_gfx_stack_raise(obj); + efl_gfx_stack_raise_to_top(obj); } EAPI void evas_vg_node_lower(Eo *obj) { - efl_gfx_stack_lower(obj); + efl_gfx_stack_lower_to_bottom(obj); } #include "efl_canvas_vg_node.eo.c" +#include "efl_canvas_vg_node_eo.legacy.c" diff --git a/src/lib/evas/canvas/efl_canvas_vg_node.eo b/src/lib/evas/canvas/efl_canvas_vg_node.eo index b20ec58f9d..641cda1c11 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_node.eo +++ b/src/lib/evas/canvas/efl_canvas_vg_node.eo @@ -1,23 +1,19 @@ import eina_types; -abstract Efl.Canvas.Vg.Node extends Efl.Object implements Efl.Gfx.Entity, Efl.Gfx.Color, Efl.Gfx.Stack, Efl.Duplicate, Efl.Gfx.Path +abstract @beta Efl.Canvas.Vg.Node extends Efl.Object implements Efl.Gfx.Entity, Efl.Gfx.Color, Efl.Gfx.Stack, Efl.Duplicate, Efl.Gfx.Path { [[Efl vector graphics abstract class]] - eo_prefix: efl_canvas_vg_node; - legacy_prefix: evas_vg_node; methods { @property transformation { set { [[Sets the transformation matrix to be used for this node object. Note: Pass $null to cancel the applied transformation. - - @since 1.14]] + ]] } get { [[Gets the transformation matrix used for this node object. - - @since 1.14]] + ]] } values { @cref m: Eina.Matrix3; [[Transformation matrix.]] @@ -28,13 +24,11 @@ abstract Efl.Canvas.Vg.Node extends Efl.Object implements Efl.Gfx.Entity, Efl.Gf [[Sets the origin position of the node object. This origin position affects node transformation. - - @since 1.14]] + ]] } get { [[Gets the origin position of the node object. - - @since 1.14]] + ]] } values { x: double; [[$origin x position.]] @@ -66,8 +60,8 @@ abstract Efl.Canvas.Vg.Node extends Efl.Object implements Efl.Gfx.Entity, Efl.Gf 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.Stack.raise_to_top; + Efl.Gfx.Stack.lower_to_bottom; Efl.Gfx.Path.interpolate; Efl.Duplicate.duplicate; } diff --git a/src/lib/evas/canvas/efl_canvas_vg_node_eo.legacy.c b/src/lib/evas/canvas/efl_canvas_vg_node_eo.legacy.c new file mode 100644 index 0000000000..eda76165cb --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_vg_node_eo.legacy.c @@ -0,0 +1,30 @@ + +EAPI void +evas_vg_node_transformation_set(Efl_Canvas_Vg_Node *obj, const Eina_Matrix3 *m) +{ + efl_canvas_vg_node_transformation_set(obj, m); +} + +EAPI const Eina_Matrix3 * +evas_vg_node_transformation_get(const Efl_Canvas_Vg_Node *obj) +{ + return efl_canvas_vg_node_transformation_get(obj); +} + +EAPI void +evas_vg_node_origin_set(Efl_Canvas_Vg_Node *obj, double x, double y) +{ + efl_canvas_vg_node_origin_set(obj, x, y); +} + +EAPI void +evas_vg_node_origin_get(const Efl_Canvas_Vg_Node *obj, double *x, double *y) +{ + efl_canvas_vg_node_origin_get(obj, x, y); +} + +EAPI void +evas_vg_node_mask_set(Efl_Canvas_Vg_Node *obj, Efl_Canvas_Vg_Node *mask, int op) +{ + efl_canvas_vg_node_mask_set(obj, mask, op); +} diff --git a/src/lib/evas/canvas/efl_canvas_vg_node_eo.legacy.h b/src/lib/evas/canvas/efl_canvas_vg_node_eo.legacy.h new file mode 100644 index 0000000000..ee3b407331 --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_vg_node_eo.legacy.h @@ -0,0 +1,83 @@ +#ifndef _EFL_CANVAS_VG_NODE_EO_LEGACY_H_ +#define _EFL_CANVAS_VG_NODE_EO_LEGACY_H_ + +#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_VG_NODE_EO_TYPES +#define _EFL_CANVAS_VG_NODE_EO_TYPES + + +#endif + +/** + * @brief Sets the transformation matrix to be used for this node object. + * + * @note Pass @c null to cancel the applied transformation. + * + * @param[in] obj The object. + * @param[in] m Transformation matrix. + * + * @since 1.14 + * + * @ingroup Evas_Vg_Node_Group + */ +EAPI void evas_vg_node_transformation_set(Efl_Canvas_Vg_Node *obj, const Eina_Matrix3 *m); + +/** + * @brief Gets the transformation matrix used for this node object. + * + * @param[in] obj The object. + * + * @return Transformation matrix. + * + * @since 1.14 + * + * @ingroup Evas_Vg_Node_Group + */ +EAPI const Eina_Matrix3 *evas_vg_node_transformation_get(const Efl_Canvas_Vg_Node *obj); + +/** + * @brief Sets the origin position of the node object. + * + * This origin position affects node transformation. + * + * @param[in] obj The object. + * @param[in] x @c origin x position. + * @param[in] y @c origin y position. + * + * @since 1.14 + * + * @ingroup Evas_Vg_Node_Group + */ +EAPI void evas_vg_node_origin_set(Efl_Canvas_Vg_Node *obj, double x, double y); + +/** + * @brief Gets the origin position of the node object. + * + * @param[in] obj The object. + * @param[out] x @c origin x position. + * @param[out] y @c origin y position. + * + * @since 1.14 + * + * @ingroup Evas_Vg_Node_Group + */ +EAPI void evas_vg_node_origin_get(const Efl_Canvas_Vg_Node *obj, double *x, double *y); + +/** + * @brief Set Mask Node to this renderer + * + * @param[in] obj The object. + * @param[in] mask Mask object + * @param[in] op Masking Option. Reserved + * + * @ingroup Evas_Vg_Node_Group + */ +EAPI void evas_vg_node_mask_set(Efl_Canvas_Vg_Node *obj, Efl_Canvas_Vg_Node *mask, int op); + +#endif diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c index 4ebf00d875..de21469c5c 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object.c +++ b/src/lib/evas/canvas/efl_canvas_vg_object.c @@ -206,13 +206,13 @@ _efl_canvas_vg_object_viewbox_set(Eo *obj, Efl_Canvas_Vg_Object_Data *pd, Eina_R eina_matrix3_identity(&m); efl_canvas_vg_node_transformation_set(pd->root, &m); // unregister the resize callback - efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_RESIZE, _evas_vg_resize, pd); + efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _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_ENTITY_EVENT_RESIZE, _evas_vg_resize, pd); + efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _evas_vg_resize, pd); pd->viewbox = viewbox; _update_vgtree_viewport(obj, pd); @@ -244,53 +244,80 @@ _efl_canvas_vg_object_viewbox_align_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vg if (align_y) *align_y = pd->align_y; } -EOLIAN static Eina_Bool -_efl_canvas_vg_object_efl_file_file_set(Eo *eo_obj, Efl_Canvas_Vg_Object_Data *pd, const char *file, const char *key) +EOLIAN static Eina_Error +_efl_canvas_vg_object_efl_file_file_set(Eo *eo_obj, Efl_Canvas_Vg_Object_Data *pd EINA_UNUSED, const char *file) { - Vg_Cache_Entry *old_entry; + /* Careful: delete previous vg entry. + When a new efl file is set, ex-file will be invalid. + Since vg cache hashes all file entries, + we must remove it from vg cache before we lost file handle. */ + if (efl_file_loaded_get(eo_obj)) + { + const char *pname = efl_file_get(eo_obj); + int pl = pname ? strlen(pname) : 0; + int cl = file ? strlen(file) : 0; - if (!file) return EINA_FALSE; + if ((pl != cl) || (pname && file && strcmp(pname, file))) + { + Evas_Object_Protected_Data *obj; + obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); + evas_cache_vg_entry_del(pd->vg_entry); + evas_object_change(eo_obj, obj); + pd->vg_entry = NULL; + evas_object_change(eo_obj, obj); + } + } - old_entry = pd->vg_entry; + Eina_Error err; + err = efl_file_set(efl_super(eo_obj, MY_CLASS), file); + if (err) return err; + return 0; +} + +EOLIAN static Eina_Error +_efl_canvas_vg_object_efl_file_load(Eo *eo_obj, Efl_Canvas_Vg_Object_Data *pd) +{ + Eina_Error err; + if (efl_file_loaded_get(eo_obj)) return 0; + + err = efl_file_load(efl_super(eo_obj, MY_CLASS)); + if (err) return err; + + const Eina_File *file = efl_file_mmap_get(eo_obj); + const char *key = efl_file_key_get(eo_obj); Evas_Object_Protected_Data *obj; + obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); - - if (file) - pd->vg_entry = evas_cache_vg_entry_create(file, key, - obj->cur->geometry.w, - obj->cur->geometry.h); - else - pd->vg_entry = NULL; - + pd->vg_entry = evas_cache_vg_entry_create(file, key, + obj->cur->geometry.w, + obj->cur->geometry.h); evas_object_change(eo_obj, obj); - evas_cache_vg_entry_del(old_entry); - return EINA_TRUE; + return 0; } EOLIAN static void -_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) +_efl_canvas_vg_object_efl_file_unload(Eo *eo_obj, Efl_Canvas_Vg_Object_Data *pd) { - if (file) *file = NULL; - if (key) *key = NULL; + if (!efl_file_loaded_get(eo_obj)) return; - if (pd->vg_entry) - { - if (file) *file = pd->vg_entry->file; - if (key) *key = pd->vg_entry->key; - } + Evas_Object_Protected_Data *obj; + obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); + evas_cache_vg_entry_del(pd->vg_entry); + evas_object_change(eo_obj, obj); + pd->vg_entry = NULL; } EOLIAN static Eina_Bool -_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) +_efl_canvas_vg_object_efl_file_save_save(const Eo *obj, Efl_Canvas_Vg_Object_Data *pd, const char *file, const char *key, const Efl_File_Save_Info *info) { if (pd->vg_entry) - return evas_cache_vg_entry_file_save(pd->vg_entry, file, key, flags); + return evas_cache_vg_entry_file_save(pd->vg_entry, file, key, info); Evas_Coord w, h; evas_object_geometry_get(obj, NULL, NULL, &w, &h); - return evas_cache_vg_file_save(pd->root, w, h, file, key, flags); + return evas_cache_vg_file_save(pd->root, w, h, file, key, info); } static void @@ -368,43 +395,6 @@ _evas_vg_render(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Object_Data *pd, Efl_Canvas_Vg_Container_Data *cd = efl_data_scope_get(node, EFL_CANVAS_VG_CONTAINER_CLASS); - //Update Mask Image - if (cd->mask_src) - { - Efl_Canvas_Vg_Container_Data *cd2 = - efl_data_scope_get(cd->mask_src, EFL_CANVAS_VG_CONTAINER_CLASS); - - if (cd2->mask.buffer && cd2->mask.dirty) - { - Ector_Surface *ector = evas_ector_get(obj->layer->evas); - if (!ector) return; - - ENFN->ector_end(engine, output, context, ector, EINA_FALSE); - - //Need a better approach. - ector_buffer_pixels_set(ector, cd2->mask.pixels, cd2->mask.bound.w, cd2->mask.bound.h, 0, - EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE); - ector_surface_reference_point_set(ector, -cd2->mask.bound.x, -cd2->mask.bound.y); - - //Draw Mask Image. - Efl_VG *child; - Eina_List *l; - EINA_LIST_FOREACH(cd2->children, l, child) - _evas_vg_render(obj, pd, engine, output, context, child, - clips, EINA_FALSE); - - cd2->mask.dirty = EINA_FALSE; -#if 0 - FILE *fp = fopen("./test.raw", "w+"); - fwrite(cd2->mask.pixels, cd2->mask.bound.w * cd2->mask.bound.h, sizeof(uint32_t), fp); - fclose(fp); - ERR("size = %d x %d", cd2->mask.bound.w, cd2->mask.bound.h); -#endif - //Restore previous ector context - ENFN->ector_begin(engine, output, context, ector, 0, 0, EINA_FALSE, do_async); - } - } - if (cd->mask.target) return; //Don't draw mask itself. Efl_VG *child; @@ -424,8 +414,8 @@ _evas_vg_render(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Object_Data *pd, //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_Object_Data *pd, - void *engine, Efl_VG *root, int w, int h, void *key, - void *buffer, Eina_Bool do_async) + void *engine, Efl_VG *root, int w, int h, void *buffer, + Eina_Bool do_async) { Ector_Surface *ector; RGBA_Draw_Context *context; @@ -443,13 +433,17 @@ _render_to_buffer(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Object_Data *pd buffer_created = EINA_TRUE; } - _evas_vg_render_pre(obj, root, ector, NULL, NULL, 0); - //initialize buffer context = evas_common_draw_context_new(); evas_common_draw_context_set_render_op(context, _EVAS_RENDER_COPY); evas_common_draw_context_set_color(context, 255, 255, 255, 255); + //ector begin - end for drawing mask images. + //ENFN->ector_begin(engine, buffer, context, ector, 0, 0, EINA_FALSE, EINA_FALSE); + _evas_vg_render_pre(obj, root, engine, buffer, context, ector, NULL, NULL, 0); + //ENFN->ector_end(engine, buffer, context, ector, EINA_FALSE); + + //Actual content drawing ENFN->ector_begin(engine, buffer, context, ector, 0, 0, EINA_TRUE, do_async); //draw on buffer @@ -464,7 +458,10 @@ _render_to_buffer(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Object_Data *pd evas_common_draw_context_free(context); if (buffer_created) - ENFN->ector_surface_cache_set(engine, key, buffer); + { + //Use root as a cache key. + ENFN->ector_surface_cache_set(engine, root, buffer); + } return buffer; } @@ -516,8 +513,7 @@ _cache_vg_entry_render(Evas_Object_Protected_Data *obj, void *buffer = ENFN->ector_surface_cache_get(engine, root); if (!buffer) - buffer = _render_to_buffer(obj, pd, engine, root, w, h, root, NULL, - do_async); + buffer = _render_to_buffer(obj, pd, engine, root, w, h, NULL, do_async); else //cache reference was increased when we get the cache. ENFN->ector_surface_cache_drop(engine, root); @@ -553,8 +549,7 @@ _user_vg_entry_render(Evas_Object_Protected_Data *obj, { // render to the buffer buffer = _render_to_buffer(obj, pd, engine, user_entry->root, - w, h, user_entry, buffer, - do_async); + w, h, buffer, do_async); } else { @@ -563,7 +558,6 @@ _user_vg_entry_render(Evas_Object_Protected_Data *obj, buffer = _render_to_buffer(obj, pd, engine, user_entry->root, w, h, - user_entry, buffer, do_async); //cache reference was increased when we get the cache. @@ -641,9 +635,10 @@ _efl_canvas_vg_object_render_pre(Evas_Object *eo_obj, } // FIXME: handle damage only on changed renderer. + // FIXME: Move this render_pre to efl_canvas_vg_render() s = evas_ector_get(obj->layer->evas); if (pd->root && s) - _evas_vg_render_pre(obj, pd->root, s, NULL, NULL, 0); + _evas_vg_render_pre(obj, pd->root, NULL, NULL, NULL, s, NULL, NULL, 0); /* now figure what changed and add draw rects */ /* if it just became visible or invisible */ @@ -775,3 +770,4 @@ evas_object_vg_add(Evas *e) } #include "efl_canvas_vg_object.eo.c" +#include "efl_canvas_vg_object_eo.legacy.c" diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.eo b/src/lib/evas/canvas/efl_canvas_vg_object.eo index a1038efd8c..53bc6de0ea 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object.eo +++ b/src/lib/evas/canvas/efl_canvas_vg_object.eo @@ -1,4 +1,4 @@ -enum Efl.Canvas.Vg.Fill_Mode +enum @beta Efl.Canvas.Vg.Fill_Mode { [[Enumeration that defines how viewbox will be filled int the vg canvs's viewport. default Fill_Mode is $none]] @@ -21,10 +21,9 @@ enum Efl.Canvas.Vg.Fill_Mode dimension of the viewport.]] } -class Efl.Canvas.Vg.Object extends Efl.Canvas.Object implements Efl.File +class @beta Efl.Canvas.Vg.Object extends Efl.Canvas.Object implements Efl.File, Efl.File_Save { [[Efl vector graphics class]] - legacy_prefix: evas_object_vg; methods { @property fill_mode { [[Control how the viewbox is mapped to the vg canvas's viewport.]] @@ -54,7 +53,7 @@ class Efl.Canvas.Vg.Object extends Efl.Canvas.Object implements Efl.File @property root_node { get { [[Get the root node of the evas_object_vg. - @since 1.14]] + ]] } set { [[Set the root node of the evas_object_vg. @@ -73,8 +72,9 @@ class Efl.Canvas.Vg.Object extends Efl.Canvas.Object implements Efl.File Efl.Object.constructor; Efl.Object.finalize; Efl.Object.destructor; - // FIXME: Implement mmap only (also fix cache keys) - Efl.File.file { get; set; } - Efl.File.save; + Efl.File.load; + Efl.File.unload; + Efl.File.file { set; } + Efl.File_Save.save; } } diff --git a/src/lib/evas/canvas/efl_canvas_vg_object_eo.legacy.c b/src/lib/evas/canvas/efl_canvas_vg_object_eo.legacy.c new file mode 100644 index 0000000000..095fb3a2b9 --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_vg_object_eo.legacy.c @@ -0,0 +1,48 @@ + +EAPI void +evas_object_vg_fill_mode_set(Efl_Canvas_Vg_Object *obj, Efl_Canvas_Vg_Fill_Mode fill_mode) +{ + efl_canvas_vg_object_fill_mode_set(obj, fill_mode); +} + +EAPI Efl_Canvas_Vg_Fill_Mode +evas_object_vg_fill_mode_get(const Efl_Canvas_Vg_Object *obj) +{ + return efl_canvas_vg_object_fill_mode_get(obj); +} + +EAPI void +evas_object_vg_viewbox_set(Efl_Canvas_Vg_Object *obj, Eina_Rect viewbox) +{ + efl_canvas_vg_object_viewbox_set(obj, viewbox); +} + +EAPI Eina_Rect +evas_object_vg_viewbox_get(const Efl_Canvas_Vg_Object *obj) +{ + return efl_canvas_vg_object_viewbox_get(obj); +} + +EAPI void +evas_object_vg_viewbox_align_set(Efl_Canvas_Vg_Object *obj, double align_x, double align_y) +{ + efl_canvas_vg_object_viewbox_align_set(obj, align_x, align_y); +} + +EAPI void +evas_object_vg_viewbox_align_get(const Efl_Canvas_Vg_Object *obj, double *align_x, double *align_y) +{ + efl_canvas_vg_object_viewbox_align_get(obj, align_x, align_y); +} + +EAPI void +evas_object_vg_root_node_set(Efl_Canvas_Vg_Object *obj, Efl_Canvas_Vg_Node *root) +{ + efl_canvas_vg_object_root_node_set(obj, root); +} + +EAPI Efl_Canvas_Vg_Node * +evas_object_vg_root_node_get(const Efl_Canvas_Vg_Object *obj) +{ + return efl_canvas_vg_object_root_node_get(obj); +} diff --git a/src/lib/evas/canvas/efl_canvas_vg_object_eo.legacy.h b/src/lib/evas/canvas/efl_canvas_vg_object_eo.legacy.h new file mode 100644 index 0000000000..2b7e96b52d --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_vg_object_eo.legacy.h @@ -0,0 +1,135 @@ +#ifndef _EFL_CANVAS_VG_OBJECT_EO_LEGACY_H_ +#define _EFL_CANVAS_VG_OBJECT_EO_LEGACY_H_ + +#ifndef _EFL_CANVAS_VG_OBJECT_EO_CLASS_TYPE +#define _EFL_CANVAS_VG_OBJECT_EO_CLASS_TYPE + +typedef Eo Efl_Canvas_Vg_Object; + +#endif + +#ifndef _EFL_CANVAS_VG_OBJECT_EO_TYPES +#define _EFL_CANVAS_VG_OBJECT_EO_TYPES + +/** Enumeration that defines how viewbox will be filled int the vg canvs's + * viewport. default Fill_Mode is @c none + * + * @ingroup Efl_Canvas_Vg + */ +typedef enum +{ + EFL_CANVAS_VG_FILL_MODE_NONE = 0, /**< Don't scale the viewbox. Placed it + * inside viewport taking align property + * into account */ + EFL_CANVAS_VG_FILL_MODE_STRETCH, /**< Scale the viewbox so that it matches the + * canvas viewport. Aaspect ratio might be + * changed. */ + EFL_CANVAS_VG_FILL_MODE_MEET, /**< Scale the viewbox so that it fits inside + * canvas viewport while maintaining the aspect + * ratio. At least one of the dimensions of the + * viewbox should be equal to the corresponding + * dimension of the viewport. */ + EFL_CANVAS_VG_FILL_MODE_SLICE /**< Scale the viewbox so that it covers the + * entire canvas viewport while maintaining the + * aspect ratio. At least one of the dimensions + * of the viewbox should be equal to the + * corresponding dimension of the viewport. */ +} Efl_Canvas_Vg_Fill_Mode; + + +#endif + +/** + * @brief Control how the viewbox is mapped to the vg canvas's viewport. + * + * @param[in] obj The object. + * @param[in] fill_mode Fill mode type + * + * @ingroup Evas_Object_Vg_Group + */ +EAPI void evas_object_vg_fill_mode_set(Efl_Canvas_Vg_Object *obj, Efl_Canvas_Vg_Fill_Mode fill_mode); + +/** + * @brief Control how the viewbox is mapped to the vg canvas's viewport. + * + * @param[in] obj The object. + * + * @return Fill mode type + * + * @ingroup Evas_Object_Vg_Group + */ +EAPI Efl_Canvas_Vg_Fill_Mode evas_object_vg_fill_mode_get(const Efl_Canvas_Vg_Object *obj); + +/** + * @brief Sets the viewbox for the evas vg canvas. viewbox if set should be + * mapped to the canvas geometry when rendering the vg tree. + * + * @param[in] obj The object. + * @param[in] viewbox viewbox for the vg canvas + * + * @ingroup Evas_Object_Vg_Group + */ +EAPI void evas_object_vg_viewbox_set(Efl_Canvas_Vg_Object *obj, Eina_Rect viewbox); + +/** + * @brief Get the current viewbox from the evas_object_vg + * + * @param[in] obj The object. + * + * @return viewbox for the vg canvas + * + * @ingroup Evas_Object_Vg_Group + */ +EAPI Eina_Rect evas_object_vg_viewbox_get(const Efl_Canvas_Vg_Object *obj); + +/** + * @brief Control how the viewbox is positioned inside the viewport. + * + * @param[in] obj The object. + * @param[in] align_x Alignment in the horizontal axis (0 <= align_x <= 1). + * @param[in] align_y Alignment in the vertical axis (0 <= align_y <= 1). + * + * @ingroup Evas_Object_Vg_Group + */ +EAPI void evas_object_vg_viewbox_align_set(Efl_Canvas_Vg_Object *obj, double align_x, double align_y); + +/** + * @brief Control how the viewbox is positioned inside the viewport. + * + * @param[in] obj The object. + * @param[out] align_x Alignment in the horizontal axis (0 <= align_x <= 1). + * @param[out] align_y Alignment in the vertical axis (0 <= align_y <= 1). + * + * @ingroup Evas_Object_Vg_Group + */ +EAPI void evas_object_vg_viewbox_align_get(const Efl_Canvas_Vg_Object *obj, double *align_x, double *align_y); + +/** + * @brief Set the root node of the evas_object_vg. + * + * @note To manually create the shape object and show in the Vg object canvas + * you must create the hierarchy and set as root node. + * + * It takes the ownership of the root node. + * + * @param[in] obj The object. + * @param[in] root Root node of the VG canvas. + * + * @ingroup Evas_Object_Vg_Group + */ +EAPI void evas_object_vg_root_node_set(Efl_Canvas_Vg_Object *obj, Efl_Canvas_Vg_Node *root); + +/** + * @brief Get the root node of the evas_object_vg. + * + * @param[in] obj The object. + * + * @return Root node of the VG canvas. + * + * @since 1.14 + * + * @ingroup Evas_Object_Vg_Group + */ +EAPI Efl_Canvas_Vg_Node *evas_object_vg_root_node_get(const Efl_Canvas_Vg_Object *obj); + +#endif diff --git a/src/lib/evas/canvas/efl_canvas_vg_shape.c b/src/lib/evas/canvas/efl_canvas_vg_shape.c index dc671f918b..ac398ebd7a 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_shape.c +++ b/src/lib/evas/canvas/efl_canvas_vg_shape.c @@ -75,6 +75,7 @@ static void _efl_canvas_vg_shape_render_pre(Evas_Object_Protected_Data *vg_pd, Efl_VG *obj, Efl_Canvas_Vg_Node_Data *nd, + void *engine, void *output, void *context, Ector_Surface *surface, Eina_Matrix3 *ptransform, Ector_Buffer *mask, @@ -90,9 +91,15 @@ _efl_canvas_vg_shape_render_pre(Evas_Object_Protected_Data *vg_pd, EFL_CANVAS_VG_COMPUTE_MATRIX(ctransform, ptransform, nd); - fill = _evas_vg_render_pre(vg_pd, pd->fill, surface, ctransform, mask, mask_op); - stroke_fill = _evas_vg_render_pre(vg_pd, pd->stroke.fill, surface, ctransform, mask, mask_op); - stroke_marker = _evas_vg_render_pre(vg_pd, pd->stroke.marker, surface, ctransform, mask, mask_op); + fill = _evas_vg_render_pre(vg_pd, pd->fill, + engine, output, context, + surface, ctransform, mask, mask_op); + stroke_fill = _evas_vg_render_pre(vg_pd, pd->stroke.fill, + engine, output, context, + surface, ctransform, mask, mask_op); + stroke_marker = _evas_vg_render_pre(vg_pd, pd->stroke.marker, + engine, output, context, + surface, ctransform, mask, mask_op); if (!nd->renderer) { @@ -464,3 +471,4 @@ evas_vg_shape_add(Efl_Canvas_Vg_Node *parent) } #include "efl_canvas_vg_shape.eo.c" +#include "efl_canvas_vg_shape_eo.legacy.c" diff --git a/src/lib/evas/canvas/efl_canvas_vg_shape.eo b/src/lib/evas/canvas/efl_canvas_vg_shape.eo index 0d95a6eb0b..35991e6d8e 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_shape.eo +++ b/src/lib/evas/canvas/efl_canvas_vg_shape.eo @@ -1,7 +1,6 @@ -class Efl.Canvas.Vg.Shape extends Efl.Canvas.Vg.Node implements Efl.Gfx.Shape +class @beta Efl.Canvas.Vg.Shape extends Efl.Canvas.Vg.Node implements Efl.Gfx.Shape { [[Efl vector graphics shape class]] - legacy_prefix: evas_vg_shape; methods { @property fill { [[Fill of the shape object]] diff --git a/src/lib/evas/canvas/efl_canvas_vg_shape_eo.legacy.c b/src/lib/evas/canvas/efl_canvas_vg_shape_eo.legacy.c new file mode 100644 index 0000000000..5630fe5f63 --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_vg_shape_eo.legacy.c @@ -0,0 +1,36 @@ + +EAPI void +evas_vg_shape_fill_set(Efl_Canvas_Vg_Shape *obj, Efl_Canvas_Vg_Node *f) +{ + efl_canvas_vg_shape_fill_set(obj, f); +} + +EAPI Efl_Canvas_Vg_Node * +evas_vg_shape_fill_get(const Efl_Canvas_Vg_Shape *obj) +{ + return efl_canvas_vg_shape_fill_get(obj); +} + +EAPI void +evas_vg_shape_stroke_fill_set(Efl_Canvas_Vg_Shape *obj, Efl_Canvas_Vg_Node *f) +{ + efl_canvas_vg_shape_stroke_fill_set(obj, f); +} + +EAPI Efl_Canvas_Vg_Node * +evas_vg_shape_stroke_fill_get(const Efl_Canvas_Vg_Shape *obj) +{ + return efl_canvas_vg_shape_stroke_fill_get(obj); +} + +EAPI void +evas_vg_shape_stroke_marker_set(Efl_Canvas_Vg_Shape *obj, Efl_Canvas_Vg_Node *m) +{ + efl_canvas_vg_shape_stroke_marker_set(obj, m); +} + +EAPI Efl_Canvas_Vg_Node * +evas_vg_shape_stroke_marker_get(const Efl_Canvas_Vg_Shape *obj) +{ + return efl_canvas_vg_shape_stroke_marker_get(obj); +} diff --git a/src/lib/evas/canvas/efl_canvas_vg_shape_eo.legacy.h b/src/lib/evas/canvas/efl_canvas_vg_shape_eo.legacy.h new file mode 100644 index 0000000000..444acd2334 --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_vg_shape_eo.legacy.h @@ -0,0 +1,80 @@ +#ifndef _EFL_CANVAS_VG_SHAPE_EO_LEGACY_H_ +#define _EFL_CANVAS_VG_SHAPE_EO_LEGACY_H_ + +#ifndef _EFL_CANVAS_VG_SHAPE_EO_CLASS_TYPE +#define _EFL_CANVAS_VG_SHAPE_EO_CLASS_TYPE + +typedef Eo Efl_Canvas_Vg_Shape; + +#endif + +#ifndef _EFL_CANVAS_VG_SHAPE_EO_TYPES +#define _EFL_CANVAS_VG_SHAPE_EO_TYPES + + +#endif + +/** + * @brief Fill of the shape object + * + * @param[in] obj The object. + * @param[in] f Fill object + * + * @ingroup Evas_Vg_Shape_Group + */ +EAPI void evas_vg_shape_fill_set(Efl_Canvas_Vg_Shape *obj, Efl_Canvas_Vg_Node *f); + +/** + * @brief Fill of the shape object + * + * @param[in] obj The object. + * + * @return Fill object + * + * @ingroup Evas_Vg_Shape_Group + */ +EAPI Efl_Canvas_Vg_Node *evas_vg_shape_fill_get(const Efl_Canvas_Vg_Shape *obj); + +/** + * @brief Stroke fill of the shape object + * + * @param[in] obj The object. + * @param[in] f Stroke fill object + * + * @ingroup Evas_Vg_Shape_Group + */ +EAPI void evas_vg_shape_stroke_fill_set(Efl_Canvas_Vg_Shape *obj, Efl_Canvas_Vg_Node *f); + +/** + * @brief Stroke fill of the shape object + * + * @param[in] obj The object. + * + * @return Stroke fill object + * + * @ingroup Evas_Vg_Shape_Group + */ +EAPI Efl_Canvas_Vg_Node *evas_vg_shape_stroke_fill_get(const Efl_Canvas_Vg_Shape *obj); + +/** + * @brief Stroke marker of the shape object + * + * @param[in] obj The object. + * @param[in] m Stroke marker object + * + * @ingroup Evas_Vg_Shape_Group + */ +EAPI void evas_vg_shape_stroke_marker_set(Efl_Canvas_Vg_Shape *obj, Efl_Canvas_Vg_Node *m); + +/** + * @brief Stroke marker of the shape object + * + * @param[in] obj The object. + * + * @return Stroke marker object + * + * @ingroup Evas_Vg_Shape_Group + */ +EAPI Efl_Canvas_Vg_Node *evas_vg_shape_stroke_marker_get(const Efl_Canvas_Vg_Shape *obj); + +#endif diff --git a/src/lib/evas/canvas/efl_gfx_map.c b/src/lib/evas/canvas/efl_gfx_mapping.c similarity index 74% rename from src/lib/evas/canvas/efl_gfx_map.c rename to src/lib/evas/canvas/efl_gfx_mapping.c index c4a2cea395..cebab06fb2 100644 --- a/src/lib/evas/canvas/efl_gfx_map.c +++ b/src/lib/evas/canvas/efl_gfx_mapping.c @@ -8,25 +8,25 @@ #define EINA_INLIST_PREPEND(l,i) do { l = (__typeof__(l)) eina_inlist_prepend(EINA_INLIST_GET(l), EINA_INLIST_GET(i)); } while (0) #define EINA_INLIST_NEXT(l) (typeof(l)) EINA_INLIST_CONTAINER_GET(EINA_INLIST_GET(l)->next, typeof(*l)) -#define MY_CLASS EFL_GFX_MAP_MIXIN +#define MY_CLASS EFL_GFX_MAPPING_MIXIN typedef struct _Gfx_Map Gfx_Map; typedef struct _Gfx_Map_Op Gfx_Map_Op; typedef struct _Gfx_Map_Pivot Gfx_Map_Pivot; -typedef struct _Efl_Gfx_Map_Data Efl_Gfx_Map_Data; +typedef struct _Efl_Gfx_Mapping_Data Efl_Gfx_Mapping_Data; typedef struct _Gfx_Map_Point Gfx_Map_Point; typedef enum _Gfx_Map_Op_Type Gfx_Map_Op_Type; enum _Gfx_Map_Op_Type { - GFX_MAP_RAW_COORD, - GFX_MAP_COLOR, - GFX_MAP_ROTATE_2D, - GFX_MAP_ROTATE_3D, - GFX_MAP_ROTATE_QUAT, - GFX_MAP_ZOOM, - GFX_MAP_TRANSLATE, - GFX_MAP_LIGHTNING_3D, - GFX_MAP_PERSPECTIVE_3D, + GFX_MAPPING_RAW_COORD, + GFX_MAPPING_COLOR, + GFX_MAPPING_ROTATE_2D, + GFX_MAPPING_ROTATE_3D, + GFX_MAPPING_ROTATE_QUAT, + GFX_MAPPING_ZOOM, + GFX_MAPPING_TRANSLATE, + GFX_MAPPING_LIGHTING_3D, + GFX_MAPPING_PERSPECTIVE_3D, }; struct _Gfx_Map_Op { @@ -59,7 +59,7 @@ struct _Gfx_Map_Op { } translate; struct { uint8_t lr, lg, lb, ar, ag, ab; - } lightning_3d; + } lighting_3d; struct { double z0, foc; } perspective_3d; @@ -105,15 +105,15 @@ struct _Gfx_Map { Eina_Bool event_cbs; }; -struct _Efl_Gfx_Map_Data { +struct _Efl_Gfx_Mapping_Data { const Gfx_Map *cow; }; // ---------------------------------------------------------------------------- -static Eo *gfx_map_absolute = NULL; -static Eina_Cow *gfx_map_cow = NULL; -static const Gfx_Map gfx_map_cow_default = { +static Eo *gfx_mapping_absolute = NULL; +static Eina_Cow *gfx_mapping_cow = NULL; +static const Gfx_Map gfx_mapping_cow_default = { NULL, NULL, NULL, @@ -126,8 +126,8 @@ static const Gfx_Map gfx_map_cow_default = { EINA_FALSE }; -#define MAPCOW_BEGIN(_pd) eina_cow_write(gfx_map_cow, (const Eina_Cow_Data**)&(_pd->cow)) -#define MAPCOW_END(_mapcow, _pd) eina_cow_done(gfx_map_cow, (const Eina_Cow_Data**)&(_pd->cow), _mapcow, EINA_FALSE) +#define MAPCOW_BEGIN(_pd) eina_cow_write(gfx_mapping_cow, (const Eina_Cow_Data**)&(_pd->cow)) +#define MAPCOW_END(_mapcow, _pd) eina_cow_done(gfx_mapping_cow, (const Eina_Cow_Data**)&(_pd->cow), _mapcow, EINA_FALSE) #define MAPCOW_WRITE(pd, name, value) do { \ if (pd->cow->name != (value)) { \ Gfx_Map *_cow = MAPCOW_BEGIN(pd); \ @@ -138,45 +138,45 @@ static const Gfx_Map gfx_map_cow_default = { #define PIVOT_REF(_pivot) (_pivot ? efl_xref((Eo *) _pivot, eo_obj) : NULL) #define PIVOT_UNREF(_pivot) (_pivot ? efl_xunref(_pivot, eo_obj) : NULL) -static inline void _map_ops_clean(Eo *eo_obj, Efl_Gfx_Map_Data *pd); +static inline void _map_ops_clean(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd); // ---------------------------------------------------------------------------- void -_efl_gfx_map_init(void) +_efl_gfx_mapping_init(void) { - gfx_map_cow = eina_cow_add("Efl.Gfx.Map", sizeof(Gfx_Map), 8, - &gfx_map_cow_default, EINA_FALSE); + gfx_mapping_cow = eina_cow_add("Efl.Gfx.Mapping", sizeof(Gfx_Map), 8, + &gfx_mapping_cow_default, EINA_FALSE); } void -_efl_gfx_map_shutdown(void) +_efl_gfx_mapping_shutdown(void) { - eina_cow_del(gfx_map_cow); - gfx_map_cow = NULL; + eina_cow_del(gfx_mapping_cow); + gfx_mapping_cow = NULL; - efl_unref(gfx_map_absolute); - gfx_map_absolute = NULL; + efl_unref(gfx_mapping_absolute); + gfx_mapping_absolute = NULL; } // ---------------------------------------------------------------------------- EOLIAN static Efl_Object * -_efl_gfx_map_efl_object_constructor(Eo *eo_obj, Efl_Gfx_Map_Data *pd) +_efl_gfx_mapping_efl_object_constructor(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd) { eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS)); - pd->cow = eina_cow_alloc(gfx_map_cow); + pd->cow = eina_cow_alloc(gfx_mapping_cow); return eo_obj; } EOLIAN static void -_efl_gfx_map_efl_object_destructor(Eo *eo_obj, Efl_Gfx_Map_Data *pd) +_efl_gfx_mapping_efl_object_destructor(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd) { if (pd->cow) { _map_ops_clean(eo_obj, pd); free(pd->cow->points); - eina_cow_free(gfx_map_cow, (const Eina_Cow_Data **) &pd->cow); + eina_cow_free(gfx_mapping_cow, (const Eina_Cow_Data **) &pd->cow); } efl_destructor(efl_super(eo_obj, MY_CLASS)); } @@ -187,15 +187,15 @@ static void _geometry_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED) { Evas_Object_Protected_Data *obj = data; - Efl_Gfx_Map_Data *pd = efl_data_scope_get(obj->object, MY_CLASS); + Efl_Gfx_Mapping_Data *pd = efl_data_scope_get(obj->object, MY_CLASS); MAPCOW_WRITE(pd, last_calc_op, NULL); - obj->gfx_map_update = EINA_TRUE; + obj->gfx_mapping_update = EINA_TRUE; } EFL_CALLBACKS_ARRAY_DEFINE(_geometry_changes, - { EFL_GFX_ENTITY_EVENT_MOVE, _geometry_changed_cb }, - { EFL_GFX_ENTITY_EVENT_RESIZE, _geometry_changed_cb }); + { EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _geometry_changed_cb }, + { EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _geometry_changed_cb }); static void _pivot_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED) @@ -203,22 +203,22 @@ _pivot_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED) Gfx_Map_Pivot *pivot = data; Evas_Object_Protected_Data *obj = pivot->map_obj; - obj->gfx_map_update = EINA_TRUE; + obj->gfx_mapping_update = EINA_TRUE; pivot->changed = EINA_TRUE; } EFL_CALLBACKS_ARRAY_DEFINE(_pivot_changes, - { EFL_GFX_ENTITY_EVENT_MOVE, _pivot_changed_cb }, - { EFL_GFX_ENTITY_EVENT_RESIZE, _pivot_changed_cb }); + { EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _pivot_changed_cb }, + { EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _pivot_changed_cb }); static inline void -_map_dirty(Eo *eo_obj, Efl_Gfx_Map_Data *pd, Eina_Bool reset) +_map_dirty(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, Eina_Bool reset) { Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj); Gfx_Map_Pivot *pivot; - obj->gfx_map_has = EINA_TRUE; - obj->gfx_map_update |= !reset; + obj->gfx_mapping_has = EINA_TRUE; + obj->gfx_mapping_update |= !reset; obj->changed_map = EINA_TRUE; evas_object_change(eo_obj, obj); @@ -244,7 +244,7 @@ _map_dirty(Eo *eo_obj, Efl_Gfx_Map_Data *pd, Eina_Bool reset) } static Evas_Map * -_map_calc(const 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_Mapping_Data *pd) { Gfx_Map_Op *op, *first_op = pd->cow->ops, *last_op; Gfx_Map_Pivot *pivot; @@ -252,12 +252,13 @@ _map_calc(const Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Map_Data *p Evas_Map *m; int imw, imh; int count; + Eina_Bool map_alloc = EINA_FALSE; - if (pd->cow == &gfx_map_cow_default) + if (pd->cow == &gfx_mapping_cow_default) return NULL; m = pd->cow->map; - if (!obj->gfx_map_update) return m; + if (!obj->gfx_mapping_update) return m; last_op = pd->cow->last_calc_op; count = pd->cow->count < 4 ? 4 : pd->cow->count; @@ -302,7 +303,11 @@ _map_calc(const Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Map_Data *p } else { - if (!m) m = evas_map_new(count); + if (!m) + { + m = evas_map_new(count); + map_alloc = EINA_TRUE; + } else _evas_map_reset(m); m->alpha = pd->cow->alpha; m->smooth = pd->cow->smooth; @@ -357,7 +362,13 @@ _map_calc(const Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Map_Data *p } else { - EINA_SAFETY_ON_NULL_RETURN_VAL(op->pivot.pivot, NULL); + if (!op->pivot.pivot) + { + EINA_SAFETY_ERROR("safety check failed: op->pivot.pivot == NULL"); + if (map_alloc) free(m); + return NULL; + } + pivot = op->pivot.pivot; px = pivot->geometry.x; py = pivot->geometry.y; @@ -378,7 +389,7 @@ _map_calc(const Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Map_Data *p switch (op->op) { - case GFX_MAP_RAW_COORD: + case GFX_MAPPING_RAW_COORD: if (op->raw_coord.idx != -1) kmin = kmax = op->raw_coord.idx; for (k = kmin; k <= kmax; k++) @@ -389,7 +400,7 @@ _map_calc(const Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Map_Data *p p->z = op->raw_coord.z; } break; - case GFX_MAP_COLOR: + case GFX_MAPPING_COLOR: if (op->raw_coord.idx != -1) kmin = kmax = op->raw_coord.idx; for (k = kmin; k <= kmax; k++) @@ -401,32 +412,32 @@ _map_calc(const Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Map_Data *p p->a = op->color.a; } break; - case GFX_MAP_ROTATE_2D: + case GFX_MAPPING_ROTATE_2D: _map_util_rotate(m, op->rotate_2d.degrees, cx, cy); break; - case GFX_MAP_ROTATE_3D: + case GFX_MAPPING_ROTATE_3D: _map_util_3d_rotate(m, op->rotate_3d.dx, op->rotate_3d.dy, op->rotate_3d.dz, cx, cy, cz); break; - case GFX_MAP_ROTATE_QUAT: + case GFX_MAPPING_ROTATE_QUAT: _map_util_quat_rotate(m, op->rotate_quat.qx, op->rotate_quat.qy, op->rotate_quat.qz, op->rotate_quat.qw, cx, cy, cz); break; - case GFX_MAP_ZOOM: + case GFX_MAPPING_ZOOM: _map_util_zoom(m, op->zoom.zx, op->zoom.zy, cx, cy); break; - case GFX_MAP_TRANSLATE: + case GFX_MAPPING_TRANSLATE: _map_util_translate(m, op->translate.dx, op->translate.dy, op->translate.dz); break; - case GFX_MAP_LIGHTNING_3D: - _map_util_3d_lighting(m, cx, cy, cz, op->lightning_3d.lr, - op->lightning_3d.lg, op->lightning_3d.lb, - op->lightning_3d.ar, op->lightning_3d.ag, - op->lightning_3d.ab); + case GFX_MAPPING_LIGHTING_3D: + _map_util_3d_lighting(m, cx, cy, cz, op->lighting_3d.lr, + op->lighting_3d.lg, op->lighting_3d.lb, + op->lighting_3d.ar, op->lighting_3d.ag, + op->lighting_3d.ab); break; - case GFX_MAP_PERSPECTIVE_3D: + case GFX_MAPPING_PERSPECTIVE_3D: _map_util_3d_perspective(m, cx, cy, op->perspective_3d.z0, op->perspective_3d.foc); break; @@ -441,26 +452,26 @@ _map_calc(const Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Map_Data *p mcow->imw = imw; mcow->imh = imh; MAPCOW_END(mcow, pd); - obj->gfx_map_update = EINA_FALSE; + obj->gfx_mapping_update = EINA_FALSE; return m; } void -_efl_gfx_map_update(Eo *eo_obj) +_efl_gfx_mapping_update(Eo *eo_obj) { Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj); - Efl_Gfx_Map_Data *pd = efl_data_scope_get(eo_obj, MY_CLASS); + Efl_Gfx_Mapping_Data *pd = efl_data_scope_get(eo_obj, MY_CLASS); Evas_Map *m; m = _map_calc(eo_obj, obj, pd); evas_object_map_set(eo_obj, m); _evas_object_map_enable_set(eo_obj, obj, m != NULL); - obj->gfx_map_has = (m != NULL); + obj->gfx_mapping_has = (m != NULL); } static inline void -_map_ops_clean(Eo *eo_obj, Efl_Gfx_Map_Data *pd) +_map_ops_clean(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd) { if (pd->cow->ops) { @@ -487,16 +498,16 @@ _map_ops_clean(Eo *eo_obj, Efl_Gfx_Map_Data *pd) } EOLIAN Eina_Bool -_efl_gfx_map_map_has(Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd EINA_UNUSED) +_efl_gfx_mapping_mapping_has(Eo *eo_obj EINA_UNUSED, Efl_Gfx_Mapping_Data *pd EINA_UNUSED) { - if (pd->cow == &gfx_map_cow_default) return EINA_FALSE; + if (pd->cow == &gfx_mapping_cow_default) return EINA_FALSE; if (pd->cow->ops) return EINA_TRUE; if (pd->cow->map) return EINA_TRUE; return EINA_FALSE; } EOLIAN static void -_efl_gfx_map_map_reset(Eo *eo_obj, Efl_Gfx_Map_Data *pd) +_efl_gfx_mapping_mapping_reset(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd) { Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj); Eina_Bool alpha, smooth; @@ -507,21 +518,21 @@ _efl_gfx_map_map_reset(Eo *eo_obj, Efl_Gfx_Map_Data *pd) if (pd->cow->event_cbs) efl_event_callback_array_del(eo_obj, _geometry_changes(), obj); - eina_cow_memcpy(gfx_map_cow, (const Eina_Cow_Data * const *) &pd->cow, - (const Eina_Cow_Data *) &gfx_map_cow_default); + eina_cow_memcpy(gfx_mapping_cow, (const Eina_Cow_Data * const *) &pd->cow, + (const Eina_Cow_Data *) &gfx_mapping_cow_default); _map_dirty(eo_obj, pd, EINA_TRUE); MAPCOW_WRITE(pd, alpha, alpha); MAPCOW_WRITE(pd, smooth, smooth); } EOLIAN static int -_efl_gfx_map_map_point_count_get(const Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd) +_efl_gfx_mapping_mapping_point_count_get(const Eo *eo_obj EINA_UNUSED, Efl_Gfx_Mapping_Data *pd) { return pd->cow->count; } EOLIAN static void -_efl_gfx_map_map_point_count_set(Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd, int count) +_efl_gfx_mapping_mapping_point_count_set(Eo *eo_obj EINA_UNUSED, Efl_Gfx_Mapping_Data *pd, int count) { Gfx_Map *mcow; @@ -557,7 +568,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(const Eo *eo_obj, Efl_Gfx_Map_Data *pd) +_efl_gfx_mapping_mapping_clockwise_get(const Eo *eo_obj, Efl_Gfx_Mapping_Data *pd) { Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj, EINA_TRUE); Evas_Map *m; @@ -568,7 +579,7 @@ _efl_gfx_map_map_clockwise_get(const Eo *eo_obj, Efl_Gfx_Map_Data *pd) } EOLIAN static void -_efl_gfx_map_map_smooth_set(Eo *eo_obj, Efl_Gfx_Map_Data *pd, Eina_Bool smooth) +_efl_gfx_mapping_mapping_smooth_set(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, Eina_Bool smooth) { if (pd->cow->smooth == smooth) return; @@ -578,13 +589,13 @@ _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(const Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd) +_efl_gfx_mapping_mapping_smooth_get(const Eo *eo_obj EINA_UNUSED, Efl_Gfx_Mapping_Data *pd) { return pd->cow->smooth; } EOLIAN static void -_efl_gfx_map_map_alpha_set(Eo *eo_obj, Efl_Gfx_Map_Data *pd, Eina_Bool alpha) +_efl_gfx_mapping_mapping_alpha_set(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, Eina_Bool alpha) { if (pd->cow->alpha == alpha) return; @@ -594,13 +605,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(const Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd) +_efl_gfx_mapping_mapping_alpha_get(const Eo *eo_obj EINA_UNUSED, Efl_Gfx_Mapping_Data *pd) { return pd->cow->alpha; } EOLIAN static void -_efl_gfx_map_map_coord_absolute_get(const Eo *eo_obj, Efl_Gfx_Map_Data *pd, +_efl_gfx_mapping_mapping_coord_absolute_get(const Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, int idx, double *x, double *y, double *z) { Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj); @@ -636,7 +647,7 @@ _efl_gfx_map_map_coord_absolute_get(const Eo *eo_obj, Efl_Gfx_Map_Data *pd, } EOLIAN static void -_efl_gfx_map_map_uv_set(Eo *eo_obj, Efl_Gfx_Map_Data *pd, +_efl_gfx_mapping_mapping_uv_set(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, int idx, double u, double v) { Gfx_Map *mcow; @@ -662,7 +673,7 @@ _efl_gfx_map_map_uv_set(Eo *eo_obj, Efl_Gfx_Map_Data *pd, } EOLIAN static void -_efl_gfx_map_map_uv_get(const Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd, +_efl_gfx_mapping_mapping_uv_get(const Eo *eo_obj EINA_UNUSED, Efl_Gfx_Mapping_Data *pd, int idx, double *u, double *v) { EINA_SAFETY_ON_FALSE_RETURN((idx >= 0) && (idx < pd->cow->count) @@ -673,7 +684,7 @@ _efl_gfx_map_map_uv_get(const Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd, } EOLIAN static void -_efl_gfx_map_map_color_get(const Eo *eo_obj EINA_UNUSED, Efl_Gfx_Map_Data *pd, +_efl_gfx_mapping_mapping_color_get(const Eo *eo_obj EINA_UNUSED, Efl_Gfx_Mapping_Data *pd, int idx, int *r, int *g, int *b, int *a) { Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj); @@ -702,7 +713,7 @@ _efl_gfx_map_map_color_get(const 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, +_gfx_mapping_op_add(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, Gfx_Map_Op_Type type, const Efl_Gfx_Entity *eo_pivot, double cx, double cy, double cz, Eina_Bool is_absolute) { @@ -764,14 +775,14 @@ _gfx_map_op_add(Eo *eo_obj, Efl_Gfx_Map_Data *pd, Gfx_Map_Op_Type type, } EOLIAN static void -_efl_gfx_map_map_coord_absolute_set(Eo *eo_obj, Efl_Gfx_Map_Data *pd, +_efl_gfx_mapping_mapping_coord_absolute_set(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, int idx, double x, double y, double z) { Gfx_Map_Op *op; EINA_SAFETY_ON_FALSE_RETURN((idx >= 0) && (idx < pd->cow->count)); - op = _gfx_map_op_add(eo_obj, pd, GFX_MAP_RAW_COORD, NULL, 0, 0, 0, EINA_FALSE); + op = _gfx_mapping_op_add(eo_obj, pd, GFX_MAPPING_RAW_COORD, NULL, 0, 0, 0, EINA_FALSE); if (!op) return; op->raw_coord.idx = idx; @@ -781,14 +792,14 @@ _efl_gfx_map_map_coord_absolute_set(Eo *eo_obj, Efl_Gfx_Map_Data *pd, } EOLIAN static void -_efl_gfx_map_map_color_set(Eo *eo_obj, Efl_Gfx_Map_Data *pd, +_efl_gfx_mapping_mapping_color_set(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, int idx, int r, int g, int b, int a) { Gfx_Map_Op *op; EINA_SAFETY_ON_FALSE_RETURN((idx >= -1) && (idx < pd->cow->count)); - op = _gfx_map_op_add(eo_obj, pd, GFX_MAP_COLOR, NULL, 0, 0, 0, EINA_FALSE); + op = _gfx_mapping_op_add(eo_obj, pd, GFX_MAPPING_COLOR, NULL, 0, 0, 0, EINA_FALSE); if (!op) return; op->color.idx = idx; @@ -799,12 +810,12 @@ _efl_gfx_map_map_color_set(Eo *eo_obj, Efl_Gfx_Map_Data *pd, } EOLIAN static void -_efl_gfx_map_translate(Eo *eo_obj, Efl_Gfx_Map_Data *pd, +_efl_gfx_mapping_translate(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, double dx, double dy, double dz) { Gfx_Map_Op *op; - op = _gfx_map_op_add(eo_obj, pd, GFX_MAP_TRANSLATE, NULL, 0, 0, 0, EINA_FALSE); + op = _gfx_mapping_op_add(eo_obj, pd, GFX_MAPPING_TRANSLATE, NULL, 0, 0, 0, EINA_FALSE); if (!op) return; op->translate.dx = dx; @@ -813,40 +824,40 @@ _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, +_map_rotate(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, double degrees, const Efl_Gfx_Entity *pivot, double cx, double cy, Eina_Bool absolute) { Gfx_Map_Op *op; - op = _gfx_map_op_add(eo_obj, pd, GFX_MAP_ROTATE_2D, pivot, cx, cy, 0, absolute); + op = _gfx_mapping_op_add(eo_obj, pd, GFX_MAPPING_ROTATE_2D, pivot, cx, cy, 0, absolute); if (!op) return; op->rotate_2d.degrees = degrees; } EOLIAN static void -_efl_gfx_map_rotate(Eo *eo_obj, Efl_Gfx_Map_Data *pd, +_efl_gfx_mapping_rotate(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, double degrees, const Efl_Gfx_Entity *pivot, double cx, double cy) { _map_rotate(eo_obj, pd, degrees, pivot, cx, cy, EINA_FALSE); } EOLIAN static void -_efl_gfx_map_rotate_absolute(Eo *eo_obj, Efl_Gfx_Map_Data *pd, double degrees, double cx, double cy) +_efl_gfx_mapping_rotate_absolute(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, double degrees, double cx, double cy) { _map_rotate(eo_obj, pd, degrees, NULL, cx, cy, EINA_TRUE); } static inline void -_map_rotate_3d(Eo *eo_obj, Efl_Gfx_Map_Data *pd, +_map_rotate_3d(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, double dx, double dy, double dz, const Efl_Gfx_Entity *pivot, double cx, double cy, double cz, Eina_Bool absolute) { Gfx_Map_Op *op; - op = _gfx_map_op_add(eo_obj, pd, GFX_MAP_ROTATE_3D, pivot, cx, cy, cz, absolute); + op = _gfx_mapping_op_add(eo_obj, pd, GFX_MAPPING_ROTATE_3D, pivot, cx, cy, cz, absolute); if (!op) return; op->rotate_3d.dx = dx; @@ -855,7 +866,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, +_efl_gfx_mapping_rotate_3d(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, double dx, double dy, double dz, const Efl_Gfx_Entity *pivot, double cx, double cy, double cz) { @@ -863,21 +874,21 @@ _efl_gfx_map_rotate_3d(Eo *eo_obj, Efl_Gfx_Map_Data *pd, } EOLIAN static void -_efl_gfx_map_rotate_3d_absolute(Eo *eo_obj, Efl_Gfx_Map_Data *pd, +_efl_gfx_mapping_rotate_3d_absolute(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, double dx, double dy, double dz, double cx, double cy, double cz) { _map_rotate_3d(eo_obj, pd, dx, dy, dz, NULL, cx, cy, cz, EINA_TRUE); } static inline void -_map_rotate_quat(Eo *eo_obj, Efl_Gfx_Map_Data *pd, +_map_rotate_quat(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, double qx, double qy, double qz, double qw, const Efl_Gfx_Entity *pivot, double cx, double cy, double cz, Eina_Bool absolute) { Gfx_Map_Op *op; - op = _gfx_map_op_add(eo_obj, pd, GFX_MAP_ROTATE_QUAT, pivot, cx, cy, cz, absolute); + op = _gfx_mapping_op_add(eo_obj, pd, GFX_MAPPING_ROTATE_QUAT, pivot, cx, cy, cz, absolute); if (!op) return; op->rotate_quat.qx = qx; @@ -887,7 +898,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, +_efl_gfx_mapping_rotate_quat(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, double qx, double qy, double qz, double qw, const Efl_Gfx_Entity *pivot, double cx, double cy, double cz) { @@ -895,7 +906,7 @@ _efl_gfx_map_rotate_quat(Eo *eo_obj, Efl_Gfx_Map_Data *pd, } EOLIAN static void -_efl_gfx_map_rotate_quat_absolute(Eo *eo_obj, Efl_Gfx_Map_Data *pd, +_efl_gfx_mapping_rotate_quat_absolute(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, double qx, double qy, double qz, double qw, double cx, double cy, double cz) { @@ -903,14 +914,14 @@ _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, +_map_zoom(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, double zoomx, double zoomy, const Efl_Gfx_Entity *pivot, double cx, double cy, Eina_Bool absolute) { Gfx_Map_Op *op; - op = _gfx_map_op_add(eo_obj, pd, GFX_MAP_ZOOM, pivot, cx, cy, 0, absolute); + op = _gfx_mapping_op_add(eo_obj, pd, GFX_MAPPING_ZOOM, pivot, cx, cy, 0, absolute); if (!op) return; op->zoom.zx = zoomx; @@ -918,7 +929,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, +_efl_gfx_mapping_zoom(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, double zoomx, double zoomy, const Efl_Gfx_Entity *pivot, double cx, double cy) { @@ -926,49 +937,49 @@ _efl_gfx_map_zoom(Eo *eo_obj, Efl_Gfx_Map_Data *pd, } EOLIAN static void -_efl_gfx_map_zoom_absolute(Eo *eo_obj, Efl_Gfx_Map_Data *pd, +_efl_gfx_mapping_zoom_absolute(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, double zoomx, double zoomy, double cx, double cy) { _map_zoom(eo_obj, pd, zoomx, zoomy, NULL, cx, cy, EINA_TRUE); } static inline void -_map_lightning_3d(Eo *eo_obj, Efl_Gfx_Map_Data *pd, +_map_lighting_3d(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, 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) { Gfx_Map_Op *op; - op = _gfx_map_op_add(eo_obj, pd, GFX_MAP_LIGHTNING_3D, pivot, lx, ly, lz, absolute); + op = _gfx_mapping_op_add(eo_obj, pd, GFX_MAPPING_LIGHTING_3D, pivot, lx, ly, lz, absolute); if (!op) return; - op->lightning_3d.lr = lr; - op->lightning_3d.lg = lg; - op->lightning_3d.lb = lb; - op->lightning_3d.ar = ar; - op->lightning_3d.ag = ag; - op->lightning_3d.ab = ab; + op->lighting_3d.lr = lr; + op->lighting_3d.lg = lg; + op->lighting_3d.lb = lb; + op->lighting_3d.ar = ar; + op->lighting_3d.ag = ag; + op->lighting_3d.ab = ab; } EOLIAN static void -_efl_gfx_map_lightning_3d(Eo *eo_obj, Efl_Gfx_Map_Data *pd, +_efl_gfx_mapping_lighting_3d(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, 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); + _map_lighting_3d(eo_obj, pd, pivot, lx, ly, lz, lr, lg, lb, ar, ag, ab, EINA_FALSE); } EOLIAN static void -_efl_gfx_map_lightning_3d_absolute(Eo *eo_obj, Efl_Gfx_Map_Data *pd, +_efl_gfx_mapping_lighting_3d_absolute(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, double lx, double ly, double lz, int lr, int lg, int lb, int ar, int ag, int ab) { - _map_lightning_3d(eo_obj, pd, NULL, lx, ly, lz, lr, lg, lb, ar, ag, ab, EINA_TRUE); + _map_lighting_3d(eo_obj, pd, NULL, lx, ly, lz, lr, lg, lb, ar, ag, ab, EINA_TRUE); } static inline void -_map_perspective_3d(Eo *eo_obj, Efl_Gfx_Map_Data *pd, +_map_perspective_3d(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, const Efl_Gfx_Entity *pivot, double px, double py, double z0, double foc, Eina_Bool absolute) @@ -981,7 +992,7 @@ _map_perspective_3d(Eo *eo_obj, Efl_Gfx_Map_Data *pd, return; } - op = _gfx_map_op_add(eo_obj, pd, GFX_MAP_PERSPECTIVE_3D, pivot, px, py, 0, absolute); + op = _gfx_mapping_op_add(eo_obj, pd, GFX_MAPPING_PERSPECTIVE_3D, pivot, px, py, 0, absolute); if (!op) return; op->perspective_3d.z0 = z0; @@ -989,7 +1000,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, +_efl_gfx_mapping_perspective_3d(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, const Efl_Gfx_Entity *pivot, double px, double py, double z0, double foc) { @@ -997,10 +1008,10 @@ _efl_gfx_map_perspective_3d(Eo *eo_obj, Efl_Gfx_Map_Data *pd, } EOLIAN static void -_efl_gfx_map_perspective_3d_absolute(Eo *eo_obj, Efl_Gfx_Map_Data *pd, +_efl_gfx_mapping_perspective_3d_absolute(Eo *eo_obj, Efl_Gfx_Mapping_Data *pd, double px, double py, double z0, double foc) { _map_perspective_3d(eo_obj, pd, NULL, px, py, z0, foc, EINA_TRUE); } -#include "canvas/efl_gfx_map.eo.c" +#include "canvas/efl_gfx_mapping.eo.c" diff --git a/src/lib/evas/canvas/efl_gfx_map.eo b/src/lib/evas/canvas/efl_gfx_mapping.eo similarity index 96% rename from src/lib/evas/canvas/efl_gfx_map.eo rename to src/lib/evas/canvas/efl_gfx_mapping.eo index 9dc5b3246a..f3ac8c3843 100644 --- a/src/lib/evas/canvas/efl_gfx_map.eo +++ b/src/lib/evas/canvas/efl_gfx_mapping.eo @@ -1,4 +1,4 @@ -mixin Efl.Gfx.Map requires Efl.Object +mixin Efl.Gfx.Mapping requires Efl.Object { [[Texture UV mapping for all objects (rotation, perspective, 3d, ...). @@ -14,26 +14,26 @@ mixin Efl.Gfx.Map requires Efl.Object At the moment of writing, maps can only have 4 points (no more, no less). - @since 1.20 + @since 1.22 ]] methods { - map_has { + mapping_has { [[Read-only property indicating whether an object is mapped. This will be $true if any transformation is applied to this object. ]] return: bool; [[$true if the object is mapped.]] } - map_reset { + mapping_reset { [[Resets the map transformation to its default state. This will reset all transformations to identity, meaning the points' colors, positions and UV coordinates will be reset to their default - values. @.map_has will then return $false. This function will - not modify the values of @.map_smooth or @.map_alpha. + values. @.mapping_has will then return $false. This function will + not modify the values of @.mapping_smooth or @.mapping_alpha. ]] } - @property map_point_count { + @property mapping_point_count { [[Number of points of a map. This sets the number of points of map. @@ -43,7 +43,7 @@ mixin Efl.Gfx.Map requires Efl.Object count: int; [[The number of points of map]] } } - @property map_clockwise { + @property mapping_clockwise { [[Clockwise state of a map (read-only). This determines if the output points (X and Y. Z is not used) are @@ -63,7 +63,7 @@ mixin Efl.Gfx.Map requires Efl.Object // Same remark for alpha - it's only for performance // Same remark for (MISSING) anti-aliasing - @property map_smooth { + @property mapping_smooth { [[Smoothing state for map rendering. This sets smoothing for map rendering. If the object is a type that has @@ -74,7 +74,7 @@ mixin Efl.Gfx.Map requires Efl.Object smooth: bool; [[$true by default.]] } } - @property map_alpha { + @property mapping_alpha { [[Alpha flag for map rendering. This sets alpha flag for map rendering. If the object is a type that @@ -84,14 +84,14 @@ mixin Efl.Gfx.Map requires Efl.Object and is useful if you know the object and/or all sub-objects is 100% solid. - Note that this may conflict with @.map_smooth depending on which + Note that this may conflict with @.mapping_smooth depending on which algorithm is used for anti-aliasing. ]] values { alpha: bool; [[$true by default.]] } } - @property map_coord_absolute { + @property mapping_coord_absolute { [[A point's absolute coordinate on the canvas. This sets/gets the fixed point's coordinate in the map. Note that points @@ -121,7 +121,7 @@ mixin Efl.Gfx.Map requires Efl.Object z: double; [[Point Z coordinate hint (pre-perspective transform).]] } } - @property map_uv { + @property mapping_uv { [[Map point's U and V texture source point. This sets/gets the U and V coordinates for the point. This determines @@ -142,7 +142,7 @@ mixin Efl.Gfx.Map requires Efl.Object v: double; [[Relative Y coordinate within the image, from 0 to 1.]] } } - @property map_color { + @property mapping_color { [[Color of a vertex in the map. This sets the color of the vertex in the map. Colors will be linearly @@ -270,7 +270,7 @@ mixin Efl.Gfx.Map requires Efl.Object cy: double; [[y relative coordinate of the center point.]] } } - lightning_3d { + lighting_3d { [[Apply a lighting effect on the object. This is used to apply lighting calculations (from a single light @@ -410,7 +410,7 @@ mixin Efl.Gfx.Map requires Efl.Object cy: double; [[y absolute coordinate in pixels of the center point.]] } } - lightning_3d_absolute { + lighting_3d_absolute { [[Apply a lighting effect to the object. This is used to apply lighting calculations (from a single light @@ -423,7 +423,7 @@ mixin Efl.Gfx.Map requires Efl.Object "logical" side for lighting. The coordinates of the center point are given in absolute canvas - coordinates. See also @.lightning_3d for a pivot-based lightning + coordinates. See also @.lighting_3d for a pivot-based lighting effect. ]] params { diff --git a/src/lib/evas/canvas/efl_input_event.c b/src/lib/evas/canvas/efl_input_event.c index 1a172166b1..3274b31a8e 100644 --- a/src/lib/evas/canvas/efl_input_event.c +++ b/src/lib/evas/canvas/efl_input_event.c @@ -6,7 +6,7 @@ #include #include -#include "canvas/evas_canvas.eo.h" +#include "canvas/evas_canvas_eo.h" #define EFL_INTERNAL_UNSTABLE #include "interfaces/efl_common_internal.h" @@ -95,7 +95,7 @@ _noref_death(void *data EINA_UNUSED, const Efl_Event *event) } Efl_Input_Event * -efl_input_event_instance_get(Eo *klass, Eo *owner) +efl_input_event_instance_get(const Eo *klass, Eo *owner) { Efl_Input_Event *evt; @@ -136,14 +136,10 @@ efl_input_event_instance_clean(Eo *klass) /* Internal EO APIs */ EOAPI EFL_FUNC_BODY_CONST(efl_input_legacy_info_get, void *, NULL) -EOAPI EFL_FUNC_BODYV_CONST(efl_input_instance_get, Efl_Input_Event *, NULL, EFL_FUNC_CALL(owner, priv), Efl_Object *owner, void **priv) #define EFL_INPUT_EVENT_EXTRA_OPS \ EFL_OBJECT_OP_FUNC(efl_input_legacy_info_get, NULL) -#define EFL_INPUT_EVENT_EXTRA_CLASS_OPS \ - EFL_OBJECT_OP_FUNC(efl_input_instance_get, NULL) - #include "efl_input_event.eo.c" #include "efl_input_state.eo.c" #include "efl_input_interface.eo.c" diff --git a/src/lib/evas/canvas/efl_input_event.eo b/src/lib/evas/canvas/efl_input_event.eo index 14b9b38e31..95f2db6575 100644 --- a/src/lib/evas/canvas/efl_input_event.eo +++ b/src/lib/evas/canvas/efl_input_event.eo @@ -1,14 +1,12 @@ import efl_input_types; -mixin Efl.Input.Event requires Efl.Object extends Efl.Duplicate +mixin @beta Efl.Input.Event requires Efl.Object extends Efl.Duplicate { [[Represents a generic event data. Note: Most Efl Events do not carry Efl Objects, rather simple data structures. This class is intended to carry more complex event data, such as pointer events. - - @since 1.19 ]] eo_prefix: efl_input; data: null; diff --git a/src/lib/evas/canvas/efl_input_focus.c b/src/lib/evas/canvas/efl_input_focus.c index 599cf4e37c..d7b18dec53 100644 --- a/src/lib/evas/canvas/efl_input_focus.c +++ b/src/lib/evas/canvas/efl_input_focus.c @@ -101,14 +101,14 @@ _efl_input_focus_efl_duplicate_duplicate(const Eo *obj, Efl_Input_Focus_Data *pd return evt; } -EOLIAN static Efl_Input_Focus * -_efl_input_focus_efl_input_event_instance_get(Eo *klass, void *_pd EINA_UNUSED, - Eo *owner, void **priv) + +EOAPI Eo* +efl_input_focus_instance_get(Efl_Object *owner, void **priv) { Efl_Input_Focus_Data *ev; Efl_Input_Focus *evt; - evt = efl_input_event_instance_get(klass, owner); + evt = efl_input_event_instance_get(EFL_INPUT_FOCUS_CLASS, owner); if (!evt) return NULL; ev = efl_data_scope_get(evt, MY_CLASS); @@ -130,9 +130,22 @@ _efl_input_focus_efl_input_event_reset(Eo *obj, Efl_Input_Focus_Data *pd) pd->eo = obj; } +EOLIAN static void +_efl_input_focus_efl_input_event_event_flags_set(Eo *obj EINA_UNUSED, Efl_Input_Focus_Data *pd, Efl_Input_Flags flags) +{ + if (flags == EFL_INPUT_FLAGS_SCROLLING) + ERR("A focus event cannot be created based on scrolling"); + else + pd->event_flags |= flags; +} + +EOLIAN static Efl_Input_Flags +_efl_input_focus_efl_input_event_event_flags_get(const Eo *obj EINA_UNUSED, Efl_Input_Focus_Data *pd) +{ + return pd->event_flags; +} + + /* Internal EO APIs */ -#define EFL_INPUT_FOCUS_EXTRA_CLASS_OPS \ - EFL_OBJECT_OP_FUNC(efl_input_instance_get, _efl_input_focus_efl_input_event_instance_get) - #include "efl_input_focus.eo.c" diff --git a/src/lib/evas/canvas/efl_input_focus.eo b/src/lib/evas/canvas/efl_input_focus.eo index 28bf5d391c..eacc99fc79 100644 --- a/src/lib/evas/canvas/efl_input_focus.eo +++ b/src/lib/evas/canvas/efl_input_focus.eo @@ -1,6 +1,9 @@ class Efl.Input.Focus extends Efl.Object implements Efl.Input.Event { - [[Represents a focus event. @since 1.19]] + [[Represents a focus event. + + @since 1.22 + ]] methods { @property object { [[The focused object]] @@ -17,6 +20,7 @@ class Efl.Input.Focus extends Efl.Object implements Efl.Input.Event Efl.Object.destructor; Efl.Input.Event.device { get; set; } Efl.Input.Event.reset; + Efl.Input.Event.event_flags { get; set;} Efl.Duplicate.duplicate; [[Creates a copy of this event. @Efl.Input.Event.fake is $true. diff --git a/src/lib/evas/canvas/efl_input_hold.c b/src/lib/evas/canvas/efl_input_hold.c index e034e4ab6e..0713ca6e2a 100644 --- a/src/lib/evas/canvas/efl_input_hold.c +++ b/src/lib/evas/canvas/efl_input_hold.c @@ -82,11 +82,11 @@ _efl_input_hold_efl_object_destructor(Eo *obj, Efl_Input_Hold_Data *pd) efl_destructor(efl_super(obj, MY_CLASS)); } -EOLIAN static Efl_Input_Event * -_efl_input_hold_efl_input_event_instance_get(Eo *klass, void *_pd EINA_UNUSED, - Efl_Object *owner, void **priv) + +EOAPI Eo* +efl_input_hold_instance_get(Efl_Object *owner, void **priv) { - Efl_Input_Event *evt = efl_input_event_instance_get(klass, owner);; + Efl_Input_Event *evt = efl_input_event_instance_get(EFL_INPUT_HOLD_CLASS, owner);; if (!evt) return NULL; if (priv) *priv = efl_data_scope_get(evt, MY_CLASS); @@ -139,7 +139,4 @@ _efl_input_hold_efl_input_event_legacy_info_get(Eo *obj, Efl_Input_Hold_Data *pd #define EFL_INPUT_HOLD_EXTRA_OPS \ EFL_OBJECT_OP_FUNC(efl_input_legacy_info_get, _efl_input_hold_efl_input_event_legacy_info_get) -#define EFL_INPUT_HOLD_EXTRA_CLASS_OPS \ - EFL_OBJECT_OP_FUNC(efl_input_instance_get, _efl_input_hold_efl_input_event_instance_get) - #include "efl_input_hold.eo.c" diff --git a/src/lib/evas/canvas/efl_input_hold.eo b/src/lib/evas/canvas/efl_input_hold.eo index 9649d75cb6..d5f939f341 100644 --- a/src/lib/evas/canvas/efl_input_hold.eo +++ b/src/lib/evas/canvas/efl_input_hold.eo @@ -1,4 +1,4 @@ -class Efl.Input.Hold extends Efl.Object implements Efl.Input.Event +class @beta Efl.Input.Hold extends Efl.Object implements Efl.Input.Event { [[Event data sent when inputs are put on hold or resumed.]] methods { diff --git a/src/lib/evas/canvas/efl_input_interface.eo b/src/lib/evas/canvas/efl_input_interface.eo index 48bf1bb81e..8d64f406f7 100644 --- a/src/lib/evas/canvas/efl_input_interface.eo +++ b/src/lib/evas/canvas/efl_input_interface.eo @@ -1,4 +1,4 @@ -interface Efl.Input.Interface +interface @beta Efl.Input.Interface { [[An object implementing this interface can send pointer events. @@ -18,13 +18,11 @@ interface Efl.Input.Interface A "key" is a key press from a keyboard or equivalent type of input device. Long, repeated, key presses will always happen like this: down...up,down...up,down...up (not down...up or down...down...down...up). - - @since 1.19 ]] eo_prefix: efl_input; event_prefix: efl; methods { - @property seat_event_filter { + @property seat_event_filter @beta { set { [[Add or remove a given seat to the filter list. If the filter list is empty this object will report mouse, keyboard and focus events from any seat, otherwise those events will diff --git a/src/lib/evas/canvas/efl_input_key.c b/src/lib/evas/canvas/efl_input_key.c index ce1acd6b26..11af16b0a2 100644 --- a/src/lib/evas/canvas/efl_input_key.c +++ b/src/lib/evas/canvas/efl_input_key.c @@ -12,18 +12,17 @@ #define MY_CLASS EFL_INPUT_KEY_CLASS -EOLIAN static Efl_Input_Key * -_efl_input_key_efl_input_event_instance_get(Eo *klass, void *_pd EINA_UNUSED, - Eo *owner, void **priv) +EOAPI Eo* +efl_input_key_instance_get(Efl_Object *owner, void **priv) { Efl_Input_Key_Data *ev; Efl_Input_Key *evt; Evas *evas; - evt = efl_input_event_instance_get(klass, owner); + evt = efl_input_event_instance_get(EFL_INPUT_KEY_CLASS, owner); if (!evt) return NULL; - ev = efl_data_scope_get(evt, klass); + ev = efl_data_scope_get(evt, EFL_INPUT_KEY_CLASS); ev->fake = EINA_FALSE; if (priv) *priv = ev; @@ -267,7 +266,4 @@ _efl_input_key_efl_input_event_legacy_info_get(Eo *obj, Efl_Input_Key_Data *pd) #define EFL_INPUT_KEY_EXTRA_OPS \ EFL_OBJECT_OP_FUNC(efl_input_legacy_info_get, _efl_input_key_efl_input_event_legacy_info_get) -#define EFL_INPUT_KEY_EXTRA_CLASS_OPS \ - EFL_OBJECT_OP_FUNC(efl_input_instance_get, _efl_input_key_efl_input_event_instance_get) - #include "efl_input_key.eo.c" diff --git a/src/lib/evas/canvas/efl_input_key.eo b/src/lib/evas/canvas/efl_input_key.eo index 29b7d85dd3..2f549f79af 100644 --- a/src/lib/evas/canvas/efl_input_key.eo +++ b/src/lib/evas/canvas/efl_input_key.eo @@ -1,8 +1,6 @@ -class Efl.Input.Key extends Efl.Object implements Efl.Input.Event, Efl.Input.State +class @beta Efl.Input.Key extends Efl.Object implements Efl.Input.Event, Efl.Input.State { [[Represents a single key event from a keyboard or similar device. - - @since 1.18 ]] methods { @property pressed { diff --git a/src/lib/evas/canvas/efl_input_pointer.c b/src/lib/evas/canvas/efl_input_pointer.c index 4dfa3bc2c6..6c24f88c2c 100644 --- a/src/lib/evas/canvas/efl_input_pointer.c +++ b/src/lib/evas/canvas/efl_input_pointer.c @@ -24,17 +24,16 @@ */ /* internal eo */ -static Efl_Input_Pointer * -_efl_input_pointer_efl_input_event_instance_get(Eo *klass, void *_pd EINA_UNUSED, - Eo *owner, void **priv) +EOAPI Eo* +efl_input_pointer_instance_get(Efl_Object *owner, void **priv) { Efl_Input_Pointer_Data *ev; Efl_Input_Pointer *evt; - evt = efl_input_event_instance_get(klass, owner); + evt = efl_input_event_instance_get(EFL_INPUT_POINTER_CLASS, owner); if (!evt) return NULL; - ev = efl_data_scope_get(evt, klass); + ev = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS); ev->fake = EINA_FALSE; if (priv) *priv = ev; @@ -623,7 +622,4 @@ _efl_input_pointer_efl_input_event_legacy_info_get(Eo *obj, Efl_Input_Pointer_Da #define EFL_INPUT_POINTER_EXTRA_OPS \ EFL_OBJECT_OP_FUNC(efl_input_legacy_info_get, _efl_input_pointer_efl_input_event_legacy_info_get) -#define EFL_INPUT_POINTER_EXTRA_CLASS_OPS \ - EFL_OBJECT_OP_FUNC(efl_input_instance_get, _efl_input_pointer_efl_input_event_instance_get) - #include "efl_input_pointer.eo.c" diff --git a/src/lib/evas/canvas/efl_input_pointer.eo b/src/lib/evas/canvas/efl_input_pointer.eo index cda511b6bc..852c3b143c 100644 --- a/src/lib/evas/canvas/efl_input_pointer.eo +++ b/src/lib/evas/canvas/efl_input_pointer.eo @@ -1,10 +1,8 @@ import efl_input_types; -class Efl.Input.Pointer extends Efl.Object implements Efl.Input.Event, Efl.Input.State +class @beta Efl.Input.Pointer extends Efl.Object implements Efl.Input.Event, Efl.Input.State { [[Event data carried over with any pointer event (mouse, touch, pen, ...) - - @since 1.18 ]] methods { @property action { diff --git a/src/lib/evas/canvas/efl_input_state.eo b/src/lib/evas/canvas/efl_input_state.eo index f3dc8354b8..08f0623608 100644 --- a/src/lib/evas/canvas/efl_input_state.eo +++ b/src/lib/evas/canvas/efl_input_state.eo @@ -2,10 +2,14 @@ import efl_input_types; interface Efl.Input.State { - [[Efl input state interface]] + [[Efl input state interface. + + @since 1.22 + ]] eo_prefix: efl_input; methods { - @property modifier_enabled { + /* FIXME Efl.Input.Device is not stable yet*/ + @property modifier_enabled @beta { [[Indicates whether a key modifier is on, such as Ctrl, Shift, ...]] get {} keys { @@ -16,7 +20,8 @@ interface Efl.Input.State is_set: bool; [[$true if the key modifier is pressed.]] } } - @property lock_enabled { + /* FIXME Efl.Input.Device is not stable yet*/ + @property lock_enabled @beta { [[Indicates whether a key lock is on, such as NumLock, CapsLock, ...]] get {} keys { diff --git a/src/lib/evas/canvas/evas_box.eo b/src/lib/evas/canvas/evas_box.eo deleted file mode 100644 index 427bd4b57f..0000000000 --- a/src/lib/evas/canvas/evas_box.eo +++ /dev/null @@ -1,669 +0,0 @@ -type @extern Evas_Object_Box_Data: __undefined_type; [[Evas object box data type]] /* FIXME: Not implemented because annonymous structs are not supported */ -type @extern Evas_Object_Box_Option: __undefined_type; [[Evas object box option type]] /* FIXME: Not implemented because bitfields are not supported. */ -type @extern Evas_Object_Box_Layout: __undefined_type; [[Evas object box layout type]] /* FIXME: Function pointers are not supported */ -type @extern Eina_Free_Cb: __undefined_type; [[Eina free callback type]] /* FIXME: Function pointers are not supported */ -type @extern va_list: __undefined_type; [[va_list type]] /* FIXME: va_list is not supported */ - -class Evas.Box extends Efl.Canvas.Group -{ - [[Evas box class]] - legacy_prefix: evas_object_box; - eo_prefix: evas_obj_box; - event_prefix: evas_box; - data: Evas_Object_Box_Data; - methods { - @property align { - set { - [[Set the alignment of the whole bounding box of contents, for a - given box object. - - This will influence how a box object is to align its bounding box - of contents within its own area. The values must be in the range - $0.0 - $1.0, or undefined behavior is expected. For horizontal - alignment, $0.0 means to the left, with $1.0 meaning to the - right. For vertical alignment, $0.0 means to the top, with $1.0 - meaning to the bottom. - - Note: The default values for both alignments is $0.5. - - See also @.align.get.]] - } - get { - [[Get the alignment of the whole bounding box of contents, for a - given box object. - - See also @.align.set for more information.]] - } - values { - horizontal: double; [[The horizontal alignment, in pixels.]] - vertical: double; [[The vertical alignment, in pixels.]] - } - } - @property padding { - set { - [[Set the (space) padding between cells set for a given box object. - - Note: The default values for both padding components is $0. - - See also @.padding.get.]] - } - get { - [[Get the (space) padding between cells set for a given box object. - - See also @.padding.set.]] - } - values { - horizontal: int; [[The horizontal padding, in pixels.]] - vertical: int; [[The vertical padding, in pixels.]] - } - } - @property layout { - set { - [[Set a new layouting function to a given box object - - A box layout function affects how a box object displays child - elements within its area. The list of pre-defined box layouts - available in Evas are @.layout_horizontal, @.layout_vertical, - @.layout_homogeneous_horizontal, @.layout_homogeneous_vertical, - @.layout_homogeneous_max_size_horizontal, @.layout_homogeneous_max_size_vertical, - @.layout_flow_horizontal, @.layout_flow_vertical and @.layout_stack - - Refer to each of their documentation texts for details on them. - - Note: A box layouting function will be triggered by the - $'calculate' smart callback of the box's smart class.]] - } - values { - cb: Evas_Object_Box_Layout @nonull; [[The new layout function to set on $o.]] - data: const(void_ptr); [[Data pointer to be passed to $cb.]] - free_data: Eina_Free_Cb; [[Function to free $data, if need be.]] - } - } - layout_horizontal { - [[Layout function which sets the box o to a (basic) horizontal box - - In this layout, the box object's overall behavior is controlled by - its padding/alignment properties, which are set by the - evas_object_box_{h,v}_{align,padding}_set family of - functions. The size hints of the elements in the box -- set by the - evas_object_size_hint_{align,padding,weight}_set functions - -- also control the way this function works. - - Box's properties: - $align_h controls the horizontal alignment of the child objects - relative to the containing box. When set to $0.0, children are - aligned to the left. A value of $1.0 makes them aligned to the - right border. Values in between align them proportionally. Note - that if the size required by the children, which is given by their - widths and the $padding_h property of the box, is bigger than the - their container's width, the children will be displayed out of the - box's bounds. A negative value of $align_h makes the box to - justify its children. The padding between them, in this case, is - corrected so that the leftmost one touches the left border and the - rightmost one touches the right border (even if they must - overlap). The $align_v and $padding_v properties of the box - don't contribute to its behaviour when this layout is chosen. - - Child element's properties: - $align_x does not influence the box's behavior. $padding_l - and $padding_r sum up to the container's horizontal padding - between elements. The child's $padding_t, $padding_b and - $align_y properties apply for padding/alignment relative to the - overall height of the box. Finally, there is the $weight_x - property, which, if set to a non-zero value, tells the container - that the child width is not pre-defined. If the container can't - accommodate all its children, it sets the widths of the ones - with weights to sizes as small as they can all fit into - it. If the size required by the children is less than the - available, the box increases its childrens' (which have weights) - widths as to fit the remaining space. The $weight_x property, - besides telling the element is resizable, gives a weight for the - resizing process. The parent box will try to distribute (or take - off) widths accordingly to the normalized list of weights: most - weighted children remain/get larger in this process than the least - ones. $weight_y does not influence the layout. - - If one desires that, besides having weights, child elements must be - resized bounded to a minimum or maximum size, those size hints must - be set, by the evas_object_size_hint_{min,max}_set - functions.]] - params { - priv: ptr(Evas_Object_Box_Data); [[Private data pointer]] - data: void_ptr; [[Data pointer]] - } - } - layout_vertical { - [[Layout function which sets the box o to a (basic) vertical box - - This function behaves analogously to - evas_object_box_layout_horizontal. The description of its - behaviour can be derived from that function's documentation.]] - params { - priv: ptr(Evas_Object_Box_Data); [[Private data pointer]] - data: void_ptr; [[Data pointer]] - } - } - layout_homogeneous_max_size_horizontal { - [[Layout function which sets the box o to a maximum size, - homogeneous horizontal box - - In a maximum size, homogeneous horizontal box, besides having cells - of equal size reserved for the child objects, this size will - be defined by the size of the largest child in the box (in - width). The box's overall behavior is controlled by its properties, - which are set by the - evas_object_box_{h,v}_{align,padding}_set family of - functions. The size hints of the elements in the box -- set by the - evas_object_size_hint_{align,padding,weight}_set functions - -- also control the way this function works. - - Box's properties: - $padding_h tells the box to draw empty spaces of that size, in - pixels, between the child objects' cells. $align_h controls the - horizontal alignment of the child objects, relative to the - containing box. When set to $0.0, children are aligned to the - left. A value of $1.0 lets them aligned to the right - border. Values in between align them proportionally. A negative - value of $align_h makes the box to justify its children - cells. The padding between them, in this case, is corrected so that - the leftmost one touches the left border and the rightmost one - touches the right border (even if they must overlap). The - $align_v and $padding_v properties of the box don't contribute to - its behaviour when this layout is chosen. - - Child element's properties: - $padding_l and $padding_r sum up to the required width of the - child element. The $align_x property tells the relative position - of this overall child width in its allocated cell ($0.0 to - extreme left, $1.0 to extreme right). A value of $-1.0 to - $align_x makes the box try to resize this child element to the exact - width of its cell (respecting the minimum and maximum size hints on - the child's width and accounting for its horizontal padding - hints). The child's $padding_t, $padding_b and $align_y - properties apply for padding/alignment relative to the overall - height of the box. A value of $-1.0 to $align_y makes the box - try to resize this child element to the exact height of its parent - (respecting the max hint on the child's height).]] - params { - priv: ptr(Evas_Object_Box_Data); [[Private data pointer]] - data: void_ptr; [[Data pointer]] - } - - } - internal_remove { - [[No description supplied by the EAPI.]] - return: Efl.Canvas.Object; [[New object with child removed]] - legacy: null; - params { - @in child: Efl.Canvas.Object; [[Child object to be removed]] - } - } - layout_flow_vertical { - [[Layout function which sets the box o to a flow vertical box. - - This function behaves analogously to - evas_object_box_layout_flow_horizontal. The description of its - behaviour can be derived from that function's documentation.]] - params { - priv: ptr(Evas_Object_Box_Data); [[Private data pointer]] - data: void_ptr; [[Data pointer]] - } - } - internal_option_free { - [[No description supplied by the EAPI.]] - legacy: null; - params { - @in opt: ptr(Evas_Object_Box_Option); [[Box option to be freed]] - } - } - insert_after { - [[Insert a new child object after another existing one, in - a given box object o. - - On success, the $"child,added" smart event will take place. - - Note: This function will fail if $reference is not a member of $o. - - Note: The actual placing of the item relative to $o's area will - depend on the layout set to it. - - Note: This call will trigger the box's - _Evas_Object_Box_Api.insert_after smart function.]] - - return: ptr(Evas_Object_Box_Option); [[A box option bound to the recently added box item or - $null, on errors]] - params { - @in child: Efl.Canvas.Object @nonull; [[A child Evas object to be made a member of $o.]] - @in reference: const(Efl.Canvas.Object) @nonull; [[The child object to place this new one after.]] - } - } - remove_all { - [[Remove all child objects from a box object, unparenting them again. - - This has the same effect of calling evas_object_box_remove on - each of $o's child objects, in sequence. If, and only if, all - those calls succeed, so does this one.]] - - return: bool; [[$true on success, $false otherwise.]] - params { - @in clear: bool; [[If $true, it will delete just removed children.]] - } - } - iterator_new @const { - [[Get an iterator to walk the list of children of a given box object. - - Note: Do not remove or delete objects while walking the list.]] - return: iterator @owned - @warn_unused; [[An iterator on $o's child objects, on success, or $null, on errors.]] - } - add_to { - [[Add a new box as a child of a given smart object. - - This is a helper function that has the same effect of putting a new - box object into $parent by use of evas_object_smart_member_add.]] - - return: Efl.Canvas.Object @warn_unused; [[$null on error, a pointer to a new box object on - success.]] - } - append { - [[Append a new child object to the given box object o. - - On success, the $"child,added" smart event will take place. - - Note: The actual placing of the item relative to $o's area will - depend on the layout set to it. For example, on horizontal layouts - an item in the end of the box's list of children will appear on its - right. - - Note: This call will trigger the box's _Evas_Object_Box_Api.append - smart function.]] - - return: ptr(Evas_Object_Box_Option); [[A box option bound to the recently added box item or - $null, on errors.]] - params { - @in child: Efl.Canvas.Object @nonull; [[A child Evas object to be made a member of $o.]] - } - } - option_property_id_get @const { - [[Get the numerical identifier of the property of the child elements - of the box o which have name as name string - - Note: This call won't do anything for a canonical Evas box. Only - users which have subclassed it, setting custom box items options - (see #Evas_Object_Box_Option) on it, would benefit from this - function. They'd have to implement it and set it to be the - _Evas_Object_Box_Api.property_id_get smart class function of the - box, which is originally set to $null.]] - return: int @warn_unused; [[The numerical ID of the given property or $-1, on - errors.]] - params { - @in name: string @nonull; [[The name string of the option being searched, for - its ID.]] - } - } - prepend { - [[Prepend a new child object to the given box object o. - - On success, the $"child,added" smart event will take place. - - Note: The actual placing of the item relative to $o's area will - depend on the layout set to it. For example, on horizontal layouts - an item in the beginning of the box's list of children will appear - on its left. - - Note: This call will trigger the box's - _Evas_Object_Box_Api.prepend smart function.]] - - return: ptr(Evas_Object_Box_Option); [[A box option bound to the recently added box item or - $null, on errors.]] - params { - @in child: Efl.Canvas.Object @nonull; [[A child Evas object to be made a member of $o.]] - } - } - accessor_new @const { - [[Get an accessor (a structure providing random items access) to the - list of children of a given box object. - - Note: Do not remove or delete objects while walking the list.]] - return: accessor @owned - @warn_unused; [[An accessor on $o's child objects, on success, or $null, - on errors.]] - } - internal_append { - [[No description supplied by the EAPI.]] - legacy: null; - return: ptr(Evas_Object_Box_Option); [[Box option]] - params { - @in child: Efl.Canvas.Object; [[Child object to be appended]] - } - } - option_property_vset { - [[Set a property value (by its given numerical identifier), on a - given box child element -- by a variable argument list - - This is a variable argument list variant of the - evas_object_box_option_property_set. See its documentation for - more details.]] - - return: bool; [[$true on success, $false on failure.]] - params { - @in opt: ptr(Evas_Object_Box_Option) @nonull; [[The box option structure bound to the child box element - to set a property on.]] - @in property: int; [[The numerical ID of the given property.]] - @in args: ptr(va_list); [[The variable argument list implementing the value to - be set for this property. It must be of the same type the user has - defined for it.]] - } - legacy: null; - } - internal_remove_at { - [[No description supplied by the EAPI.]] - legacy: null; - return: Efl.Canvas.Object; [[Canvas object]] - params { - @in pos: uint; [[Position of object to be removed]] - } - } - remove_at { - [[Remove an object, bound to a given position in a box object, - unparenting it again. - - On removal, you'll get an unparented object again, just as it was - before you inserted it in the box. The $option_free box smart - callback will be called automatically for you and, also, the - $"child,removed" smart event will take place. - - Note: This function will fail if the given position is invalid, - given $o's internal list of elements. - - Note: This call will trigger the box's - _Evas_Object_Box_Api.remove_at smart function.]] - - return: bool; [[$true on success, $false on failure.]] - params { - @in pos: uint; [[The numeric position (starting from $0) of the child - object to be removed.]] - } - } - option_property_vget @const { - [[Get a property's value (by its given numerical identifier), on a - given box child element -- by a variable argument list - - This is a variable argument list variant of the - evas_object_box_option_property_get. See its documentation for - more details.]] - return: bool; [[$true on success, $false on failure.]] - params { - @in opt: ptr(Evas_Object_Box_Option) @nonull; [[The box option structure bound to the child box element - to get a property from.]] - @in property: int; [[The numerical ID of the given property.]] - @in args: ptr(va_list); [[The variable argument list with pointers to where to - store the values of this property. They must point to variables - of the same type the user has defined for them.]] - } - legacy: null; - } - internal_insert_at { - [[No description supplied by the EAPI.]] - legacy: null; - return: ptr(Evas_Object_Box_Option); [[Box option]] - params { - @in child: Efl.Canvas.Object; [[Child object to be inserted]] - @in pos: uint; [[Position where the object will be inserted]] - } - } - insert_before { - [[Insert a new child object before another existing one, in - a given box object o. - - On success, the $"child,added" smart event will take place. - - Note: This function will fail if $reference is not a member of $o. - - Note: The actual placing of the item relative to $o's area will - depend on the layout set to it. - - Note: This call will trigger the box's - _Evas_Object_Box_Api.insert_before smart function.]] - - return: ptr(Evas_Object_Box_Option); [[A box option bound to the recently added box item or - $null, on errors.]] - params { - @in child: Efl.Canvas.Object @nonull; [[A child Evas object to be made a member of $o.]] - @in reference: const(Efl.Canvas.Object) @nonull; [[The child object to place this new one before.]] - } - } - option_property_name_get @const { - [[Get the name of the property of the child elements of the box o - which have id as identifier - - Note: This call won't do anything for a canonical Evas box. Only - users which have subclassed it, setting custom box items options - (see #Evas_Object_Box_Option) on it, would benefit from this - function. They'd have to implement it and set it to be the - _Evas_Object_Box_Api.property_name_get smart class function of the - box, which is originally set to $null.]] - return: string @warn_unused; [[The name of the given property or $null, on errors.]] - params { - @in property: int; [[The numerical identifier of the option being searched, - for its name.]] - } - } - internal_insert_before { - [[No description supplied by the EAPI.]] - legacy: null; - return: ptr(Evas_Object_Box_Option); [[Box option]] - params { - @in child: Efl.Canvas.Object; [[Object to be inserted]] - @in reference: const(Efl.Canvas.Object); [[Reference where the object will be inserted]] - } - } - layout_homogeneous_horizontal { - [[Layout function which sets the box o to a homogeneous - horizontal box - - In a homogeneous horizontal box, its width is divided equally - between the contained objects. The box's overall behavior is - controlled by its padding/alignment properties, which are set by - the evas_object_box_{h,v}_{align,padding}_set family of - functions. The size hints the elements in the box -- set by the - evas_object_size_hint_{align,padding,weight}_set functions - -- also control the way this function works. - - Box's properties: - $align_h has no influence on the box for this layout. - $padding_h tells the box to draw empty spaces of that size, in - pixels, between the (equal) child objects' cells. The $align_v - and $padding_v properties of the box don't contribute to its - behaviour when this layout is chosen. - - Child element's properties: - $padding_l and $padding_r sum up to the required width of the - child element. The $align_x property tells the relative position - of this overall child width in its allocated cell ($0.0 to - extreme left, $1.0 to extreme right). A value of $-1.0 to - $align_x makes the box try to resize this child element to the exact - width of its cell (respecting the minimum and maximum size hints on - the child's width and accounting for its horizontal padding - hints). The child's $padding_t, $padding_b and $align_y - properties apply for padding/alignment relative to the overall - height of the box. A value of $-1.0 to $align_y makes the box - try to resize this child element to the exact height of its parent - (respecting the maximum size hint on the child's height).]] - params { - @in priv: ptr(Evas_Object_Box_Data); [[Private data pointer]] - @in data: void_ptr; [[Data pointer]] - } - } - internal_option_new { - [[No description supplied by the EAPI.]] - legacy: null; - return: ptr(Evas_Object_Box_Option); [[Box option]] - params { - @in child: Efl.Canvas.Object; [[New box object]] - } - } - layout_homogeneous_max_size_vertical { - [[Layout function which sets the box o to a maximum size, - homogeneous vertical box - - This function behaves analogously to - evas_object_box_layout_homogeneous_max_size_horizontal. The - description of its behaviour can be derived from that function's - documentation.]] - params { - @in priv: ptr(Evas_Object_Box_Data); [[Private data pointer]] - @in data: void_ptr; [[Data pointer]] - } - } - internal_insert_after { - [[No description supplied by the EAPI.]] - legacy: null; - return: ptr(Evas_Object_Box_Option); [[Box option]] - params { - @in child: Efl.Canvas.Object; [[Object to be inserted]] - @in reference: const(Efl.Canvas.Object); [[Reference where the object will be inserted]] - } - } - insert_at { - [[Insert a new child object at a given position, in a given - box object $o. - - On success, the $"child,added" smart event will take place. - - Note: This function will fail if the given position is invalid, - given $o's internal list of elements. - - Note: The actual placing of the item relative to $o's area will - depend on the layout set to it. - - Note: This call will trigger the box's - _Evas_Object_Box_Api.insert_at smart function.]] - - return: ptr(Evas_Object_Box_Option); [[A box option bound to the recently added box item or - $null, on errors.]] - params { - @in child: Efl.Canvas.Object @nonull; [[A child Evas object to be made a member of $o.]] - @in pos: uint; [[The numeric position (starting from $0) to place the - new child object at.]] - } - } - internal_prepend { - [[No description supplied by the EAPI.]] - legacy: null; - return: ptr(Evas_Object_Box_Option); [[Box option]] - params { - @in child: Efl.Canvas.Object; [[Object to be prepended]] - } - } - remove { - [[Remove a given object from a box object, unparenting it again. - - On removal, you'll get an unparented object again, just as it was - before you inserted it in the box. The - _Evas_Object_Box_Api.option_free box smart callback will be called - automatically for you and, also, the $"child,removed" smart event - will take place. - - Note: This call will trigger the box's _Evas_Object_Box_Api.remove - smart function.]] - - return: bool; [[$true on success, $false otherwise.]] - params { - @in child: Efl.Canvas.Object @nonull; [[The handle to the child object to be removed.]] - } - } - layout_stack { - [[Layout function which sets the box o to a stacking box - - In a stacking box, all children will be given the same size -- the - box's own size -- and they will be stacked one above the other, so - that the first object in $o's internal list of child elements - will be the bottommost in the stack. - - Box's properties: - No box properties are used. - - Child element's properties: - $padding_l and $padding_r sum up to the required width of the - child element. The $align_x property tells the relative position - of this overall child width in its allocated cell ($0.0 to - extreme left, $1.0 to extreme right). A value of $-1.0 to - $align_x makes the box try to resize this child element to the exact - width of its cell (respecting the min and max hints on the child's - width and accounting for its horizontal padding properties). The - same applies to the vertical axis.]] - params { - @in priv: ptr(Evas_Object_Box_Data); [[Private data pointer]] - @in data: void_ptr; [[Data pointer]] - } - } - layout_homogeneous_vertical { - [[Layout function which sets the box o to a homogeneous - vertical box. - - This function behaves analogously to - evas_object_box_layout_homogeneous_horizontal. The description - of its behaviour can be derived from that function's documentation.]] - params { - priv: ptr(Evas_Object_Box_Data); [[Private data pointer]] - data: void_ptr; [[Data pointer]] - } - } - layout_flow_horizontal { - [[Layout function which sets the box o to a flow horizontal - box. - - In a flow horizontal box, the box's child elements are placed in - rows (think of text as an analogy). A row has as many elements as - can fit into the box's width. The box's overall behavior is - controlled by its properties, which are set by the - evas_object_box_{h,v}_{align,padding}_set family of - functions. The size hints of the elements in the box -- set by the - evas_object_size_hint_{align,padding,weight}_set functions - -- also control the way this function works. - - Box's properties: - $padding_h tells the box to draw empty spaces of that size, in - pixels, between the child objects' cells. $align_h dictates the - horizontal alignment of the rows ($0.0 to left align them, $1.0 - to right align). A value of $-1.0 to $align_h lets the rows - justified horizontally. $align_v controls the vertical alignment - of the entire set of rows ($0.0 to top, $1.0 to bottom). A - value of $-1.0 to $align_v makes the box to justify the rows - vertically. The padding between them in this case is corrected so - that the first row touches the top border and the last one touches - the bottom border (even if they must overlap). $padding_v has no - influence on the layout. - - Child element's properties: - $padding_l and $padding_r sum up to the required width of the - child element. The $align_x property has no influence on the - layout. The child's $padding_t and $padding_b sum up to the - required height of the child element and is the only means (besides - row justifying) of setting space between rows. Note, however, that - $align_y dictates positioning relative to the largest - height required by a child object in the actual row.]] - params { - priv: ptr(Evas_Object_Box_Data); [[Private data pointer]] - data: void_ptr; [[Data pointer]] - } - } - count { - [[Returns the number of items in the box.]] - legacy: null; - return: int; [[Number of items in the box]] - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Gfx.Entity.size { set; } - Efl.Gfx.Entity.position { set; } - Efl.Canvas.Group.group_calculate; - } - events { - 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_box_eo.c b/src/lib/evas/canvas/evas_box_eo.c new file mode 100644 index 0000000000..80bcd33f89 --- /dev/null +++ b/src/lib/evas/canvas/evas_box_eo.c @@ -0,0 +1,248 @@ +EWAPI const Efl_Event_Description _EVAS_BOX_EVENT_CHILD_ADDED = + EFL_EVENT_DESCRIPTION("child,added"); +EWAPI const Efl_Event_Description _EVAS_BOX_EVENT_CHILD_REMOVED = + EFL_EVENT_DESCRIPTION("child,removed"); + +void _evas_box_align_set(Eo *obj, Evas_Object_Box_Data *pd, double horizontal, double vertical); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_box_align_set, EFL_FUNC_CALL(horizontal, vertical), double horizontal, double vertical); + +void _evas_box_align_get(const Eo *obj, Evas_Object_Box_Data *pd, double *horizontal, double *vertical); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_obj_box_align_get, EFL_FUNC_CALL(horizontal, vertical), double *horizontal, double *vertical); + +void _evas_box_padding_set(Eo *obj, Evas_Object_Box_Data *pd, int horizontal, int vertical); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_box_padding_set, EFL_FUNC_CALL(horizontal, vertical), int horizontal, int vertical); + +void _evas_box_padding_get(const Eo *obj, Evas_Object_Box_Data *pd, int *horizontal, int *vertical); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_obj_box_padding_get, EFL_FUNC_CALL(horizontal, vertical), int *horizontal, int *vertical); + +void _evas_box_layout_set(Eo *obj, Evas_Object_Box_Data *pd, Evas_Object_Box_Layout cb, const void *data, Eina_Free_Cb free_data); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_box_layout_set, EFL_FUNC_CALL(cb, data, free_data), Evas_Object_Box_Layout cb, const void *data, Eina_Free_Cb free_data); + +void _evas_box_layout_horizontal(Eo *obj, Evas_Object_Box_Data *pd, Evas_Object_Box_Data *priv, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_box_layout_horizontal, EFL_FUNC_CALL(priv, data), Evas_Object_Box_Data *priv, void *data); + +void _evas_box_layout_vertical(Eo *obj, Evas_Object_Box_Data *pd, Evas_Object_Box_Data *priv, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_box_layout_vertical, EFL_FUNC_CALL(priv, data), Evas_Object_Box_Data *priv, void *data); + +void _evas_box_layout_homogeneous_max_size_horizontal(Eo *obj, Evas_Object_Box_Data *pd, Evas_Object_Box_Data *priv, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_box_layout_homogeneous_max_size_horizontal, EFL_FUNC_CALL(priv, data), Evas_Object_Box_Data *priv, void *data); + +Efl_Canvas_Object *_evas_box_internal_remove(Eo *obj, Evas_Object_Box_Data *pd, Efl_Canvas_Object *child); + +EOAPI EFL_FUNC_BODYV(evas_obj_box_internal_remove, Efl_Canvas_Object *, NULL, EFL_FUNC_CALL(child), Efl_Canvas_Object *child); + +void _evas_box_layout_flow_vertical(Eo *obj, Evas_Object_Box_Data *pd, Evas_Object_Box_Data *priv, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_box_layout_flow_vertical, EFL_FUNC_CALL(priv, data), Evas_Object_Box_Data *priv, void *data); + +void _evas_box_internal_option_free(Eo *obj, Evas_Object_Box_Data *pd, Evas_Object_Box_Option *opt); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_box_internal_option_free, EFL_FUNC_CALL(opt), Evas_Object_Box_Option *opt); + +Evas_Object_Box_Option *_evas_box_insert_after(Eo *obj, Evas_Object_Box_Data *pd, Efl_Canvas_Object *child, const Efl_Canvas_Object *reference); + +EOAPI EFL_FUNC_BODYV(evas_obj_box_insert_after, Evas_Object_Box_Option *, NULL, EFL_FUNC_CALL(child, reference), Efl_Canvas_Object *child, const Efl_Canvas_Object *reference); + +Eina_Bool _evas_box_remove_all(Eo *obj, Evas_Object_Box_Data *pd, Eina_Bool clear); + +EOAPI EFL_FUNC_BODYV(evas_obj_box_remove_all, Eina_Bool, 0, EFL_FUNC_CALL(clear), Eina_Bool clear); + +Eina_Iterator *_evas_box_iterator_new(const Eo *obj, Evas_Object_Box_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_box_iterator_new, Eina_Iterator *, NULL); + +Efl_Canvas_Object *_evas_box_add_to(Eo *obj, Evas_Object_Box_Data *pd); + +EOAPI EFL_FUNC_BODY(evas_obj_box_add_to, Efl_Canvas_Object *, NULL); + +Evas_Object_Box_Option *_evas_box_append(Eo *obj, Evas_Object_Box_Data *pd, Efl_Canvas_Object *child); + +EOAPI EFL_FUNC_BODYV(evas_obj_box_append, Evas_Object_Box_Option *, NULL, EFL_FUNC_CALL(child), Efl_Canvas_Object *child); + +int _evas_box_option_property_id_get(const Eo *obj, Evas_Object_Box_Data *pd, const char *name); + +EOAPI EFL_FUNC_BODYV_CONST(evas_obj_box_option_property_id_get, int, 0, EFL_FUNC_CALL(name), const char *name); + +Evas_Object_Box_Option *_evas_box_prepend(Eo *obj, Evas_Object_Box_Data *pd, Efl_Canvas_Object *child); + +EOAPI EFL_FUNC_BODYV(evas_obj_box_prepend, Evas_Object_Box_Option *, NULL, EFL_FUNC_CALL(child), Efl_Canvas_Object *child); + +Eina_Accessor *_evas_box_accessor_new(const Eo *obj, Evas_Object_Box_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_box_accessor_new, Eina_Accessor *, NULL); + +Evas_Object_Box_Option *_evas_box_internal_append(Eo *obj, Evas_Object_Box_Data *pd, Efl_Canvas_Object *child); + +EOAPI EFL_FUNC_BODYV(evas_obj_box_internal_append, Evas_Object_Box_Option *, NULL, EFL_FUNC_CALL(child), Efl_Canvas_Object *child); + +Eina_Bool _evas_box_option_property_vset(Eo *obj, Evas_Object_Box_Data *pd, Evas_Object_Box_Option *opt, int property, va_list *args); + +EOAPI EFL_FUNC_BODYV(evas_obj_box_option_property_vset, Eina_Bool, 0, EFL_FUNC_CALL(opt, property, args), Evas_Object_Box_Option *opt, int property, va_list *args); + +Efl_Canvas_Object *_evas_box_internal_remove_at(Eo *obj, Evas_Object_Box_Data *pd, unsigned int pos); + +EOAPI EFL_FUNC_BODYV(evas_obj_box_internal_remove_at, Efl_Canvas_Object *, NULL, EFL_FUNC_CALL(pos), unsigned int pos); + +Eina_Bool _evas_box_remove_at(Eo *obj, Evas_Object_Box_Data *pd, unsigned int pos); + +EOAPI EFL_FUNC_BODYV(evas_obj_box_remove_at, Eina_Bool, 0, EFL_FUNC_CALL(pos), unsigned int pos); + +Eina_Bool _evas_box_option_property_vget(const Eo *obj, Evas_Object_Box_Data *pd, Evas_Object_Box_Option *opt, int property, va_list *args); + +EOAPI EFL_FUNC_BODYV_CONST(evas_obj_box_option_property_vget, Eina_Bool, 0, EFL_FUNC_CALL(opt, property, args), Evas_Object_Box_Option *opt, int property, va_list *args); + +Evas_Object_Box_Option *_evas_box_internal_insert_at(Eo *obj, Evas_Object_Box_Data *pd, Efl_Canvas_Object *child, unsigned int pos); + +EOAPI EFL_FUNC_BODYV(evas_obj_box_internal_insert_at, Evas_Object_Box_Option *, NULL, EFL_FUNC_CALL(child, pos), Efl_Canvas_Object *child, unsigned int pos); + +Evas_Object_Box_Option *_evas_box_insert_before(Eo *obj, Evas_Object_Box_Data *pd, Efl_Canvas_Object *child, const Efl_Canvas_Object *reference); + +EOAPI EFL_FUNC_BODYV(evas_obj_box_insert_before, Evas_Object_Box_Option *, NULL, EFL_FUNC_CALL(child, reference), Efl_Canvas_Object *child, const Efl_Canvas_Object *reference); + +const char *_evas_box_option_property_name_get(const Eo *obj, Evas_Object_Box_Data *pd, int property); + +EOAPI EFL_FUNC_BODYV_CONST(evas_obj_box_option_property_name_get, const char *, NULL, EFL_FUNC_CALL(property), int property); + +Evas_Object_Box_Option *_evas_box_internal_insert_before(Eo *obj, Evas_Object_Box_Data *pd, Efl_Canvas_Object *child, const Efl_Canvas_Object *reference); + +EOAPI EFL_FUNC_BODYV(evas_obj_box_internal_insert_before, Evas_Object_Box_Option *, NULL, EFL_FUNC_CALL(child, reference), Efl_Canvas_Object *child, const Efl_Canvas_Object *reference); + +void _evas_box_layout_homogeneous_horizontal(Eo *obj, Evas_Object_Box_Data *pd, Evas_Object_Box_Data *priv, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_box_layout_homogeneous_horizontal, EFL_FUNC_CALL(priv, data), Evas_Object_Box_Data *priv, void *data); + +Evas_Object_Box_Option *_evas_box_internal_option_new(Eo *obj, Evas_Object_Box_Data *pd, Efl_Canvas_Object *child); + +EOAPI EFL_FUNC_BODYV(evas_obj_box_internal_option_new, Evas_Object_Box_Option *, NULL, EFL_FUNC_CALL(child), Efl_Canvas_Object *child); + +void _evas_box_layout_homogeneous_max_size_vertical(Eo *obj, Evas_Object_Box_Data *pd, Evas_Object_Box_Data *priv, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_box_layout_homogeneous_max_size_vertical, EFL_FUNC_CALL(priv, data), Evas_Object_Box_Data *priv, void *data); + +Evas_Object_Box_Option *_evas_box_internal_insert_after(Eo *obj, Evas_Object_Box_Data *pd, Efl_Canvas_Object *child, const Efl_Canvas_Object *reference); + +EOAPI EFL_FUNC_BODYV(evas_obj_box_internal_insert_after, Evas_Object_Box_Option *, NULL, EFL_FUNC_CALL(child, reference), Efl_Canvas_Object *child, const Efl_Canvas_Object *reference); + +Evas_Object_Box_Option *_evas_box_insert_at(Eo *obj, Evas_Object_Box_Data *pd, Efl_Canvas_Object *child, unsigned int pos); + +EOAPI EFL_FUNC_BODYV(evas_obj_box_insert_at, Evas_Object_Box_Option *, NULL, EFL_FUNC_CALL(child, pos), Efl_Canvas_Object *child, unsigned int pos); + +Evas_Object_Box_Option *_evas_box_internal_prepend(Eo *obj, Evas_Object_Box_Data *pd, Efl_Canvas_Object *child); + +EOAPI EFL_FUNC_BODYV(evas_obj_box_internal_prepend, Evas_Object_Box_Option *, NULL, EFL_FUNC_CALL(child), Efl_Canvas_Object *child); + +Eina_Bool _evas_box_remove(Eo *obj, Evas_Object_Box_Data *pd, Efl_Canvas_Object *child); + +EOAPI EFL_FUNC_BODYV(evas_obj_box_remove, Eina_Bool, 0, EFL_FUNC_CALL(child), Efl_Canvas_Object *child); + +void _evas_box_layout_stack(Eo *obj, Evas_Object_Box_Data *pd, Evas_Object_Box_Data *priv, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_box_layout_stack, EFL_FUNC_CALL(priv, data), Evas_Object_Box_Data *priv, void *data); + +void _evas_box_layout_homogeneous_vertical(Eo *obj, Evas_Object_Box_Data *pd, Evas_Object_Box_Data *priv, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_box_layout_homogeneous_vertical, EFL_FUNC_CALL(priv, data), Evas_Object_Box_Data *priv, void *data); + +void _evas_box_layout_flow_horizontal(Eo *obj, Evas_Object_Box_Data *pd, Evas_Object_Box_Data *priv, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_box_layout_flow_horizontal, EFL_FUNC_CALL(priv, data), Evas_Object_Box_Data *priv, void *data); + +int _evas_box_count(Eo *obj, Evas_Object_Box_Data *pd); + +EOAPI EFL_FUNC_BODY(evas_obj_box_count, int, 0); + +Efl_Object *_evas_box_efl_object_constructor(Eo *obj, Evas_Object_Box_Data *pd); + + +void _evas_box_efl_gfx_entity_size_set(Eo *obj, Evas_Object_Box_Data *pd, Eina_Size2D size); + + +void _evas_box_efl_gfx_entity_position_set(Eo *obj, Evas_Object_Box_Data *pd, Eina_Position2D pos); + + +void _evas_box_efl_canvas_group_group_calculate(Eo *obj, Evas_Object_Box_Data *pd); + + +static Eina_Bool +_evas_box_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EVAS_BOX_EXTRA_OPS +#define EVAS_BOX_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(evas_obj_box_align_set, _evas_box_align_set), + EFL_OBJECT_OP_FUNC(evas_obj_box_align_get, _evas_box_align_get), + EFL_OBJECT_OP_FUNC(evas_obj_box_padding_set, _evas_box_padding_set), + EFL_OBJECT_OP_FUNC(evas_obj_box_padding_get, _evas_box_padding_get), + EFL_OBJECT_OP_FUNC(evas_obj_box_layout_set, _evas_box_layout_set), + EFL_OBJECT_OP_FUNC(evas_obj_box_layout_horizontal, _evas_box_layout_horizontal), + EFL_OBJECT_OP_FUNC(evas_obj_box_layout_vertical, _evas_box_layout_vertical), + EFL_OBJECT_OP_FUNC(evas_obj_box_layout_homogeneous_max_size_horizontal, _evas_box_layout_homogeneous_max_size_horizontal), + EFL_OBJECT_OP_FUNC(evas_obj_box_internal_remove, _evas_box_internal_remove), + EFL_OBJECT_OP_FUNC(evas_obj_box_layout_flow_vertical, _evas_box_layout_flow_vertical), + EFL_OBJECT_OP_FUNC(evas_obj_box_internal_option_free, _evas_box_internal_option_free), + EFL_OBJECT_OP_FUNC(evas_obj_box_insert_after, _evas_box_insert_after), + EFL_OBJECT_OP_FUNC(evas_obj_box_remove_all, _evas_box_remove_all), + EFL_OBJECT_OP_FUNC(evas_obj_box_iterator_new, _evas_box_iterator_new), + EFL_OBJECT_OP_FUNC(evas_obj_box_add_to, _evas_box_add_to), + EFL_OBJECT_OP_FUNC(evas_obj_box_append, _evas_box_append), + EFL_OBJECT_OP_FUNC(evas_obj_box_option_property_id_get, _evas_box_option_property_id_get), + EFL_OBJECT_OP_FUNC(evas_obj_box_prepend, _evas_box_prepend), + EFL_OBJECT_OP_FUNC(evas_obj_box_accessor_new, _evas_box_accessor_new), + EFL_OBJECT_OP_FUNC(evas_obj_box_internal_append, _evas_box_internal_append), + EFL_OBJECT_OP_FUNC(evas_obj_box_option_property_vset, _evas_box_option_property_vset), + EFL_OBJECT_OP_FUNC(evas_obj_box_internal_remove_at, _evas_box_internal_remove_at), + EFL_OBJECT_OP_FUNC(evas_obj_box_remove_at, _evas_box_remove_at), + EFL_OBJECT_OP_FUNC(evas_obj_box_option_property_vget, _evas_box_option_property_vget), + EFL_OBJECT_OP_FUNC(evas_obj_box_internal_insert_at, _evas_box_internal_insert_at), + EFL_OBJECT_OP_FUNC(evas_obj_box_insert_before, _evas_box_insert_before), + EFL_OBJECT_OP_FUNC(evas_obj_box_option_property_name_get, _evas_box_option_property_name_get), + EFL_OBJECT_OP_FUNC(evas_obj_box_internal_insert_before, _evas_box_internal_insert_before), + EFL_OBJECT_OP_FUNC(evas_obj_box_layout_homogeneous_horizontal, _evas_box_layout_homogeneous_horizontal), + EFL_OBJECT_OP_FUNC(evas_obj_box_internal_option_new, _evas_box_internal_option_new), + EFL_OBJECT_OP_FUNC(evas_obj_box_layout_homogeneous_max_size_vertical, _evas_box_layout_homogeneous_max_size_vertical), + EFL_OBJECT_OP_FUNC(evas_obj_box_internal_insert_after, _evas_box_internal_insert_after), + EFL_OBJECT_OP_FUNC(evas_obj_box_insert_at, _evas_box_insert_at), + EFL_OBJECT_OP_FUNC(evas_obj_box_internal_prepend, _evas_box_internal_prepend), + EFL_OBJECT_OP_FUNC(evas_obj_box_remove, _evas_box_remove), + EFL_OBJECT_OP_FUNC(evas_obj_box_layout_stack, _evas_box_layout_stack), + EFL_OBJECT_OP_FUNC(evas_obj_box_layout_homogeneous_vertical, _evas_box_layout_homogeneous_vertical), + EFL_OBJECT_OP_FUNC(evas_obj_box_layout_flow_horizontal, _evas_box_layout_flow_horizontal), + EFL_OBJECT_OP_FUNC(evas_obj_box_count, _evas_box_count), + EFL_OBJECT_OP_FUNC(efl_constructor, _evas_box_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _evas_box_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _evas_box_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _evas_box_efl_canvas_group_group_calculate), + EVAS_BOX_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _evas_box_class_desc = { + EO_VERSION, + "Evas.Box", + EFL_CLASS_TYPE_REGULAR, + sizeof(Evas_Object_Box_Data), + _evas_box_class_initializer, + _evas_box_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(evas_box_class_get, &_evas_box_class_desc, EFL_CANVAS_GROUP_CLASS, NULL); + +#include "evas_box_eo.legacy.c" diff --git a/src/lib/evas/canvas/evas_box_eo.h b/src/lib/evas/canvas/evas_box_eo.h new file mode 100644 index 0000000000..2f36d7c490 --- /dev/null +++ b/src/lib/evas/canvas/evas_box_eo.h @@ -0,0 +1,818 @@ +#ifndef _EVAS_BOX_EO_H_ +#define _EVAS_BOX_EO_H_ + +#ifndef _EVAS_BOX_EO_CLASS_TYPE +#define _EVAS_BOX_EO_CLASS_TYPE + +typedef Eo Evas_Box; + +#endif + +#ifndef _EVAS_BOX_EO_TYPES +#define _EVAS_BOX_EO_TYPES + + +#endif +/** Evas box class + * + * @ingroup Evas_Box + */ +#define EVAS_BOX_CLASS evas_box_class_get() + +EWAPI const Efl_Class *evas_box_class_get(void); + +/** + * @brief Set the alignment of the whole bounding box of contents, for a given + * box object. + * + * This will influence how a box object is to align its bounding box of + * contents within its own area. The values must be in the range $0.0 - $1.0, + * or undefined behavior is expected. For horizontal alignment, $0.0 means to + * the left, with $1.0 meaning to the right. For vertical alignment, $0.0 means + * to the top, with $1.0 meaning to the bottom. + * + * @note The default values for both alignments is $0.5. + * + * See also @ref evas_obj_box_align_get. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal alignment, in pixels. + * @param[in] vertical The vertical alignment, in pixels. + * + * @ingroup Evas_Box + */ +EOAPI void evas_obj_box_align_set(Eo *obj, double horizontal, double vertical); + +/** + * @brief Get the alignment of the whole bounding box of contents, for a given + * box object. + * + * See also @ref evas_obj_box_align_set for more information. + * + * @param[in] obj The object. + * @param[out] horizontal The horizontal alignment, in pixels. + * @param[out] vertical The vertical alignment, in pixels. + * + * @ingroup Evas_Box + */ +EOAPI void evas_obj_box_align_get(const Eo *obj, double *horizontal, double *vertical); + +/** + * @brief Set the (space) padding between cells set for a given box object. + * + * @note The default values for both padding components is $0. + * + * See also @ref evas_obj_box_padding_get. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal padding, in pixels. + * @param[in] vertical The vertical padding, in pixels. + * + * @ingroup Evas_Box + */ +EOAPI void evas_obj_box_padding_set(Eo *obj, int horizontal, int vertical); + +/** + * @brief Get the (space) padding between cells set for a given box object. + * + * See also @ref evas_obj_box_padding_set. + * + * @param[in] obj The object. + * @param[out] horizontal The horizontal padding, in pixels. + * @param[out] vertical The vertical padding, in pixels. + * + * @ingroup Evas_Box + */ +EOAPI void evas_obj_box_padding_get(const Eo *obj, int *horizontal, int *vertical); + +/** + * @brief Set a new layouting function to a given box object + * + * A box layout function affects how a box object displays child elements + * within its area. The list of pre-defined box layouts available in Evas are + * @ref evas_obj_box_layout_horizontal, @ref evas_obj_box_layout_vertical, + * @ref evas_obj_box_layout_homogeneous_horizontal, + * @ref evas_obj_box_layout_homogeneous_vertical, + * @ref evas_obj_box_layout_homogeneous_max_size_horizontal, + * @ref evas_obj_box_layout_homogeneous_max_size_vertical, + * @ref evas_obj_box_layout_flow_horizontal, + * @ref evas_obj_box_layout_flow_vertical and @ref evas_obj_box_layout_stack + * + * Refer to each of their documentation texts for details on them. + * + * @note A box layouting function will be triggered by the $'calculate' smart + * callback of the box's smart class. + * + * @param[in] obj The object. + * @param[in] cb The new layout function to set on @c o. + * @param[in] data Data pointer to be passed to @c cb. + * @param[in] free_data Function to free @c data, if need be. + * + * @ingroup Evas_Box + */ +EOAPI void evas_obj_box_layout_set(Eo *obj, Evas_Object_Box_Layout cb, const void *data, Eina_Free_Cb free_data) EINA_ARG_NONNULL(2); + +/** + * @brief Layout function which sets the box o to a (basic) horizontal box + * + * In this layout, the box object's overall behavior is controlled by its + * padding/alignment properties, which are set by the + * evas_object_box_{h,v}_{align,padding}_set family of functions. The size + * hints of the elements in the box -- set by the + * evas_object_size_hint_{align,padding,weight}_set functions -- also control + * the way this function works. + * + * Box's properties: @c align_h controls the horizontal alignment of the child + * objects relative to the containing box. When set to $0.0, children are + * aligned to the left. A value of $1.0 makes them aligned to the right border. + * Values in between align them proportionally. Note that if the size required + * by the children, which is given by their widths and the @c padding_h + * property of the box, is bigger than the their container's width, the + * children will be displayed out of the box's bounds. A negative value of + * @c align_h makes the box to justify its children. The padding between them, + * in this case, is corrected so that the leftmost one touches the left border + * and the rightmost one touches the right border (even if they must overlap). + * The @c align_v and @c padding_v properties of the box don't contribute to + * its behaviour when this layout is chosen. + * + * Child element's properties: @c align_x does not influence the box's + * behavior. @c padding_l and @c padding_r sum up to the container's horizontal + * padding between elements. The child's @c padding_t, @c padding_b and + * @c align_y properties apply for padding/alignment relative to the overall + * height of the box. Finally, there is the @c weight_x property, which, if set + * to a non-zero value, tells the container that the child width is not + * pre-defined. If the container can't accommodate all its children, it sets + * the widths of the ones with weights to sizes as small as they can all fit + * into it. If the size required by the children is less than the available, + * the box increases its childrens' (which have weights) widths as to fit the + * remaining space. The @c weight_x property, besides telling the element is + * resizable, gives a weight for the resizing process. The parent box will try + * to distribute (or take off) widths accordingly to the normalized list of + * weights: most weighted children remain/get larger in this process than the + * least ones. @c weight_y does not influence the layout. + * + * If one desires that, besides having weights, child elements must be resized + * bounded to a minimum or maximum size, those size hints must be set, by the + * evas_object_size_hint_{min,max}_set functions. + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Box + */ +EOAPI void evas_obj_box_layout_horizontal(Eo *obj, Evas_Object_Box_Data *priv, void *data); + +/** + * @brief Layout function which sets the box o to a (basic) vertical box + * + * This function behaves analogously to evas_object_box_layout_horizontal. The + * description of its behaviour can be derived from that function's + * documentation. + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Box + */ +EOAPI void evas_obj_box_layout_vertical(Eo *obj, Evas_Object_Box_Data *priv, void *data); + +/** + * @brief Layout function which sets the box o to a maximum size, homogeneous + * horizontal box + * + * In a maximum size, homogeneous horizontal box, besides having cells of equal + * size reserved for the child objects, this size will be defined by the size + * of the largest child in the box (in width). The box's overall behavior is + * controlled by its properties, which are set by the + * evas_object_box_{h,v}_{align,padding}_set family of functions. The size + * hints of the elements in the box -- set by the + * evas_object_size_hint_{align,padding,weight}_set functions -- also control + * the way this function works. + * + * Box's properties: @c padding_h tells the box to draw empty spaces of that + * size, in pixels, between the child objects' cells. @c align_h controls the + * horizontal alignment of the child objects, relative to the containing box. + * When set to $0.0, children are aligned to the left. A value of $1.0 lets + * them aligned to the right border. Values in between align them + * proportionally. A negative value of @c align_h makes the box to justify its + * children cells. The padding between them, in this case, is corrected so that + * the leftmost one touches the left border and the rightmost one touches the + * right border (even if they must overlap). The @c align_v and @c padding_v + * properties of the box don't contribute to its behaviour when this layout is + * chosen. + * + * Child element's properties: @c padding_l and @c padding_r sum up to the + * required width of the child element. The @c align_x property tells the + * relative position of this overall child width in its allocated cell ($0.0 to + * extreme left, $1.0 to extreme right). A value of $-1.0 to @c align_x makes + * the box try to resize this child element to the exact width of its cell + * (respecting the minimum and maximum size hints on the child's width and + * accounting for its horizontal padding hints). The child's @c padding_t, + * @c padding_b and @c align_y properties apply for padding/alignment relative + * to the overall height of the box. A value of $-1.0 to @c align_y makes the + * box try to resize this child element to the exact height of its parent + * (respecting the max hint on the child's height). + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Box + */ +EOAPI void evas_obj_box_layout_homogeneous_max_size_horizontal(Eo *obj, Evas_Object_Box_Data *priv, void *data); + +/** + * @brief No description supplied by the EAPI. + * + * @param[in] obj The object. + * @param[in] child Child object to be removed + * + * @return New object with child removed + * + * @ingroup Evas_Box + */ +EOAPI Efl_Canvas_Object *evas_obj_box_internal_remove(Eo *obj, Efl_Canvas_Object *child); + +/** + * @brief Layout function which sets the box o to a flow vertical box. + * + * This function behaves analogously to evas_object_box_layout_flow_horizontal. + * The description of its behaviour can be derived from that function's + * documentation. + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Box + */ +EOAPI void evas_obj_box_layout_flow_vertical(Eo *obj, Evas_Object_Box_Data *priv, void *data); + +/** + * @brief No description supplied by the EAPI. + * + * @param[in] obj The object. + * @param[in] opt Box option to be freed + * + * @ingroup Evas_Box + */ +EOAPI void evas_obj_box_internal_option_free(Eo *obj, Evas_Object_Box_Option *opt); + +/** + * @brief Insert a new child object after another existing one, in a given box + * object o. + * + * On success, the $"child,added" smart event will take place. + * + * @note This function will fail if @c reference is not a member of @c o. + * + * @note The actual placing of the item relative to @c o's area will depend on + * the layout set to it. + * + * @note This call will trigger the box's _Evas_Object_Box_Api.insert_after + * smart function. + * + * @param[in] obj The object. + * @param[in] child A child Evas object to be made a member of @c o. + * @param[in] reference The child object to place this new one after. + * + * @return A box option bound to the recently added box item or @c null, on + * errors + * + * @ingroup Evas_Box + */ +EOAPI Evas_Object_Box_Option *evas_obj_box_insert_after(Eo *obj, Efl_Canvas_Object *child, const Efl_Canvas_Object *reference) EINA_ARG_NONNULL(2, 3); + +/** + * @brief Remove all child objects from a box object, unparenting them again. + * + * This has the same effect of calling evas_object_box_remove on each of @c o's + * child objects, in sequence. If, and only if, all those calls succeed, so + * does this one. + * + * @param[in] obj The object. + * @param[in] clear If @c true, it will delete just removed children. + * + * @return @c true on success, @c false otherwise. + * + * @ingroup Evas_Box + */ +EOAPI Eina_Bool evas_obj_box_remove_all(Eo *obj, Eina_Bool clear); + +/** + * @brief Get an iterator to walk the list of children of a given box object. + * + * @note Do not remove or delete objects while walking the list. + * + * @param[in] obj The object. + * + * @return An iterator on @c o's child objects, on success, or @c null, on + * errors. + * + * @ingroup Evas_Box + */ +EOAPI Eina_Iterator *evas_obj_box_iterator_new(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Add a new box as a child of a given smart object. + * + * This is a helper function that has the same effect of putting a new box + * object into @c parent by use of evas_object_smart_member_add. + * + * @param[in] obj The object. + * + * @return @c null on error, a pointer to a new box object on success. + * + * @ingroup Evas_Box + */ +EOAPI Efl_Canvas_Object *evas_obj_box_add_to(Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Append a new child object to the given box object o. + * + * On success, the $"child,added" smart event will take place. + * + * @note The actual placing of the item relative to @c o's area will depend on + * the layout set to it. For example, on horizontal layouts an item in the end + * of the box's list of children will appear on its right. + * + * @note This call will trigger the box's _Evas_Object_Box_Api.append smart + * function. + * + * @param[in] obj The object. + * @param[in] child A child Evas object to be made a member of @c o. + * + * @return A box option bound to the recently added box item or @c null, on + * errors. + * + * @ingroup Evas_Box + */ +EOAPI Evas_Object_Box_Option *evas_obj_box_append(Eo *obj, Efl_Canvas_Object *child) EINA_ARG_NONNULL(2); + +/** + * @brief Get the numerical identifier of the property of the child elements of + * the box o which have name as name string + * + * @note This call won't do anything for a canonical Evas box. Only users which + * have subclassed it, setting custom box items options (see + * #Evas_Object_Box_Option) on it, would benefit from this function. They'd + * have to implement it and set it to be the + * _Evas_Object_Box_Api.property_id_get smart class function of the box, which + * is originally set to @c null. + * + * @param[in] obj The object. + * @param[in] name The name string of the option being searched, for its ID. + * + * @return The numerical ID of the given property or $-1, on errors. + * + * @ingroup Evas_Box + */ +EOAPI int evas_obj_box_option_property_id_get(const Eo *obj, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(2); + +/** + * @brief Prepend a new child object to the given box object o. + * + * On success, the $"child,added" smart event will take place. + * + * @note The actual placing of the item relative to @c o's area will depend on + * the layout set to it. For example, on horizontal layouts an item in the + * beginning of the box's list of children will appear on its left. + * + * @note This call will trigger the box's _Evas_Object_Box_Api.prepend smart + * function. + * + * @param[in] obj The object. + * @param[in] child A child Evas object to be made a member of @c o. + * + * @return A box option bound to the recently added box item or @c null, on + * errors. + * + * @ingroup Evas_Box + */ +EOAPI Evas_Object_Box_Option *evas_obj_box_prepend(Eo *obj, Efl_Canvas_Object *child) EINA_ARG_NONNULL(2); + +/** + * @brief Get an accessor (a structure providing random items access) to the + * list of children of a given box object. + * + * @note Do not remove or delete objects while walking the list. + * + * @param[in] obj The object. + * + * @return An accessor on @c o's child objects, on success, or @c null, on + * errors. + * + * @ingroup Evas_Box + */ +EOAPI Eina_Accessor *evas_obj_box_accessor_new(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief No description supplied by the EAPI. + * + * @param[in] obj The object. + * @param[in] child Child object to be appended + * + * @return Box option + * + * @ingroup Evas_Box + */ +EOAPI Evas_Object_Box_Option *evas_obj_box_internal_append(Eo *obj, Efl_Canvas_Object *child); + +/** + * @brief Set a property value (by its given numerical identifier), on a given + * box child element -- by a variable argument list + * + * This is a variable argument list variant of the + * evas_object_box_option_property_set. See its documentation for more details. + * + * @param[in] obj The object. + * @param[in] opt The box option structure bound to the child box element to + * set a property on. + * @param[in] property The numerical ID of the given property. + * @param[in] args The variable argument list implementing the value to be set + * for this property. It must be of the same type the user has defined for it. + * + * @return @c true on success, @c false on failure. + * + * @ingroup Evas_Box + */ +EOAPI Eina_Bool evas_obj_box_option_property_vset(Eo *obj, Evas_Object_Box_Option *opt, int property, va_list *args) EINA_ARG_NONNULL(2); + +/** + * @brief No description supplied by the EAPI. + * + * @param[in] obj The object. + * @param[in] pos Position of object to be removed + * + * @return Canvas object + * + * @ingroup Evas_Box + */ +EOAPI Efl_Canvas_Object *evas_obj_box_internal_remove_at(Eo *obj, unsigned int pos); + +/** + * @brief Remove an object, bound to a given position in a box object, + * unparenting it again. + * + * On removal, you'll get an unparented object again, just as it was before you + * inserted it in the box. The @c option_free box smart callback will be called + * automatically for you and, also, the $"child,removed" smart event will take + * place. + * + * @note This function will fail if the given position is invalid, given @c o's + * internal list of elements. + * + * @note This call will trigger the box's _Evas_Object_Box_Api.remove_at smart + * function. + * + * @param[in] obj The object. + * @param[in] pos The numeric position (starting from $0) of the child object + * to be removed. + * + * @return @c true on success, @c false on failure. + * + * @ingroup Evas_Box + */ +EOAPI Eina_Bool evas_obj_box_remove_at(Eo *obj, unsigned int pos); + +/** + * @brief Get a property's value (by its given numerical identifier), on a + * given box child element -- by a variable argument list + * + * This is a variable argument list variant of the + * evas_object_box_option_property_get. See its documentation for more details. + * + * @param[in] obj The object. + * @param[in] opt The box option structure bound to the child box element to + * get a property from. + * @param[in] property The numerical ID of the given property. + * @param[in] args The variable argument list with pointers to where to store + * the values of this property. They must point to variables of the same type + * the user has defined for them. + * + * @return @c true on success, @c false on failure. + * + * @ingroup Evas_Box + */ +EOAPI Eina_Bool evas_obj_box_option_property_vget(const Eo *obj, Evas_Object_Box_Option *opt, int property, va_list *args) EINA_ARG_NONNULL(2); + +/** + * @brief No description supplied by the EAPI. + * + * @param[in] obj The object. + * @param[in] child Child object to be inserted + * @param[in] pos Position where the object will be inserted + * + * @return Box option + * + * @ingroup Evas_Box + */ +EOAPI Evas_Object_Box_Option *evas_obj_box_internal_insert_at(Eo *obj, Efl_Canvas_Object *child, unsigned int pos); + +/** + * @brief Insert a new child object before another existing one, in a given box + * object o. + * + * On success, the $"child,added" smart event will take place. + * + * @note This function will fail if @c reference is not a member of @c o. + * + * @note The actual placing of the item relative to @c o's area will depend on + * the layout set to it. + * + * @note This call will trigger the box's _Evas_Object_Box_Api.insert_before + * smart function. + * + * @param[in] obj The object. + * @param[in] child A child Evas object to be made a member of @c o. + * @param[in] reference The child object to place this new one before. + * + * @return A box option bound to the recently added box item or @c null, on + * errors. + * + * @ingroup Evas_Box + */ +EOAPI Evas_Object_Box_Option *evas_obj_box_insert_before(Eo *obj, Efl_Canvas_Object *child, const Efl_Canvas_Object *reference) EINA_ARG_NONNULL(2, 3); + +/** + * @brief Get the name of the property of the child elements of the box o which + * have id as identifier + * + * @note This call won't do anything for a canonical Evas box. Only users which + * have subclassed it, setting custom box items options (see + * #Evas_Object_Box_Option) on it, would benefit from this function. They'd + * have to implement it and set it to be the + * _Evas_Object_Box_Api.property_name_get smart class function of the box, + * which is originally set to @c null. + * + * @param[in] obj The object. + * @param[in] property The numerical identifier of the option being searched, + * for its name. + * + * @return The name of the given property or @c null, on errors. + * + * @ingroup Evas_Box + */ +EOAPI const char *evas_obj_box_option_property_name_get(const Eo *obj, int property) EINA_WARN_UNUSED_RESULT; + +/** + * @brief No description supplied by the EAPI. + * + * @param[in] obj The object. + * @param[in] child Object to be inserted + * @param[in] reference Reference where the object will be inserted + * + * @return Box option + * + * @ingroup Evas_Box + */ +EOAPI Evas_Object_Box_Option *evas_obj_box_internal_insert_before(Eo *obj, Efl_Canvas_Object *child, const Efl_Canvas_Object *reference); + +/** + * @brief Layout function which sets the box o to a homogeneous horizontal box + * + * In a homogeneous horizontal box, its width is divided equally between the + * contained objects. The box's overall behavior is controlled by its + * padding/alignment properties, which are set by the + * evas_object_box_{h,v}_{align,padding}_set family of functions. The size + * hints the elements in the box -- set by the + * evas_object_size_hint_{align,padding,weight}_set functions -- also control + * the way this function works. + * + * Box's properties: @c align_h has no influence on the box for this layout. + * @c padding_h tells the box to draw empty spaces of that size, in pixels, + * between the (equal) child objects' cells. The @c align_v and @c padding_v + * properties of the box don't contribute to its behaviour when this layout is + * chosen. + * + * Child element's properties: @c padding_l and @c padding_r sum up to the + * required width of the child element. The @c align_x property tells the + * relative position of this overall child width in its allocated cell ($0.0 to + * extreme left, $1.0 to extreme right). A value of $-1.0 to @c align_x makes + * the box try to resize this child element to the exact width of its cell + * (respecting the minimum and maximum size hints on the child's width and + * accounting for its horizontal padding hints). The child's @c padding_t, + * @c padding_b and @c align_y properties apply for padding/alignment relative + * to the overall height of the box. A value of $-1.0 to @c align_y makes the + * box try to resize this child element to the exact height of its parent + * (respecting the maximum size hint on the child's height). + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Box + */ +EOAPI void evas_obj_box_layout_homogeneous_horizontal(Eo *obj, Evas_Object_Box_Data *priv, void *data); + +/** + * @brief No description supplied by the EAPI. + * + * @param[in] obj The object. + * @param[in] child New box object + * + * @return Box option + * + * @ingroup Evas_Box + */ +EOAPI Evas_Object_Box_Option *evas_obj_box_internal_option_new(Eo *obj, Efl_Canvas_Object *child); + +/** + * @brief Layout function which sets the box o to a maximum size, homogeneous + * vertical box + * + * This function behaves analogously to + * evas_object_box_layout_homogeneous_max_size_horizontal. The description of + * its behaviour can be derived from that function's documentation. + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Box + */ +EOAPI void evas_obj_box_layout_homogeneous_max_size_vertical(Eo *obj, Evas_Object_Box_Data *priv, void *data); + +/** + * @brief No description supplied by the EAPI. + * + * @param[in] obj The object. + * @param[in] child Object to be inserted + * @param[in] reference Reference where the object will be inserted + * + * @return Box option + * + * @ingroup Evas_Box + */ +EOAPI Evas_Object_Box_Option *evas_obj_box_internal_insert_after(Eo *obj, Efl_Canvas_Object *child, const Efl_Canvas_Object *reference); + +/** + * @brief Insert a new child object at a given position, in a given box object + * @c o. + * + * On success, the $"child,added" smart event will take place. + * + * @note This function will fail if the given position is invalid, given @c o's + * internal list of elements. + * + * @note The actual placing of the item relative to @c o's area will depend on + * the layout set to it. + * + * @note This call will trigger the box's _Evas_Object_Box_Api.insert_at smart + * function. + * + * @param[in] obj The object. + * @param[in] child A child Evas object to be made a member of @c o. + * @param[in] pos The numeric position (starting from $0) to place the new + * child object at. + * + * @return A box option bound to the recently added box item or @c null, on + * errors. + * + * @ingroup Evas_Box + */ +EOAPI Evas_Object_Box_Option *evas_obj_box_insert_at(Eo *obj, Efl_Canvas_Object *child, unsigned int pos) EINA_ARG_NONNULL(2); + +/** + * @brief No description supplied by the EAPI. + * + * @param[in] obj The object. + * @param[in] child Object to be prepended + * + * @return Box option + * + * @ingroup Evas_Box + */ +EOAPI Evas_Object_Box_Option *evas_obj_box_internal_prepend(Eo *obj, Efl_Canvas_Object *child); + +/** + * @brief Remove a given object from a box object, unparenting it again. + * + * On removal, you'll get an unparented object again, just as it was before you + * inserted it in the box. The _Evas_Object_Box_Api.option_free box smart + * callback will be called automatically for you and, also, the + * $"child,removed" smart event will take place. + * + * @note This call will trigger the box's _Evas_Object_Box_Api.remove smart + * function. + * + * @param[in] obj The object. + * @param[in] child The handle to the child object to be removed. + * + * @return @c true on success, @c false otherwise. + * + * @ingroup Evas_Box + */ +EOAPI Eina_Bool evas_obj_box_remove(Eo *obj, Efl_Canvas_Object *child) EINA_ARG_NONNULL(2); + +/** + * @brief Layout function which sets the box o to a stacking box + * + * In a stacking box, all children will be given the same size -- the box's own + * size -- and they will be stacked one above the other, so that the first + * object in @c o's internal list of child elements will be the bottommost in + * the stack. + * + * Box's properties: No box properties are used. + * + * Child element's properties: @c padding_l and @c padding_r sum up to the + * required width of the child element. The @c align_x property tells the + * relative position of this overall child width in its allocated cell ($0.0 to + * extreme left, $1.0 to extreme right). A value of $-1.0 to @c align_x makes + * the box try to resize this child element to the exact width of its cell + * (respecting the min and max hints on the child's width and accounting for + * its horizontal padding properties). The same applies to the vertical axis. + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Box + */ +EOAPI void evas_obj_box_layout_stack(Eo *obj, Evas_Object_Box_Data *priv, void *data); + +/** + * @brief Layout function which sets the box o to a homogeneous vertical box. + * + * This function behaves analogously to + * evas_object_box_layout_homogeneous_horizontal. The description of its + * behaviour can be derived from that function's documentation. + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Box + */ +EOAPI void evas_obj_box_layout_homogeneous_vertical(Eo *obj, Evas_Object_Box_Data *priv, void *data); + +/** + * @brief Layout function which sets the box o to a flow horizontal box. + * + * In a flow horizontal box, the box's child elements are placed in rows (think + * of text as an analogy). A row has as many elements as can fit into the box's + * width. The box's overall behavior is controlled by its properties, which are + * set by the evas_object_box_{h,v}_{align,padding}_set family of functions. + * The size hints of the elements in the box -- set by the + * evas_object_size_hint_{align,padding,weight}_set functions -- also control + * the way this function works. + * + * Box's properties: @c padding_h tells the box to draw empty spaces of that + * size, in pixels, between the child objects' cells. @c align_h dictates the + * horizontal alignment of the rows ($0.0 to left align them, $1.0 to right + * align). A value of $-1.0 to @c align_h lets the rows justified horizontally. + * @c align_v controls the vertical alignment of the entire set of rows ($0.0 + * to top, $1.0 to bottom). A value of $-1.0 to @c align_v makes the box to + * justify the rows vertically. The padding between them in this case is + * corrected so that the first row touches the top border and the last one + * touches the bottom border (even if they must overlap). @c padding_v has no + * influence on the layout. + * + * Child element's properties: @c padding_l and @c padding_r sum up to the + * required width of the child element. The @c align_x property has no + * influence on the layout. The child's @c padding_t and @c padding_b sum up to + * the required height of the child element and is the only means (besides row + * justifying) of setting space between rows. Note, however, that @c align_y + * dictates positioning relative to the largest height required by a child + * object in the actual row. + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Box + */ +EOAPI void evas_obj_box_layout_flow_horizontal(Eo *obj, Evas_Object_Box_Data *priv, void *data); + +/** + * @brief Returns the number of items in the box. + * + * @param[in] obj The object. + * + * @return Number of items in the box + * + * @ingroup Evas_Box + */ +EOAPI int evas_obj_box_count(Eo *obj); + +EWAPI extern const Efl_Event_Description _EVAS_BOX_EVENT_CHILD_ADDED; + +/** Called when a child object was added to the box + * @return Evas_Object_Box_Option * + * + * @ingroup Evas_Box + */ +#define EVAS_BOX_EVENT_CHILD_ADDED (&(_EVAS_BOX_EVENT_CHILD_ADDED)) + +EWAPI extern const Efl_Event_Description _EVAS_BOX_EVENT_CHILD_REMOVED; + +/** Called when a child object was removed from the box + * @return Efl_Canvas_Object * + * + * @ingroup Evas_Box + */ +#define EVAS_BOX_EVENT_CHILD_REMOVED (&(_EVAS_BOX_EVENT_CHILD_REMOVED)) + +#endif diff --git a/src/lib/evas/canvas/evas_box_eo.hh b/src/lib/evas/canvas/evas_box_eo.hh new file mode 100644 index 0000000000..4109e091bd --- /dev/null +++ b/src/lib/evas/canvas/evas_box_eo.hh @@ -0,0 +1,460 @@ +#ifndef EVAS_BOX_EO_HH +#define EVAS_BOX_EO_HH +#include + +extern "C" { +#include "efl_canvas_group.eo.h" +#include "efl_canvas_object.eo.h" +#include "efl_canvas_pointer.eo.h" +#include "efl_class.eo.h" +#include "efl_gfx_color.eo.h" +#include "efl_gfx_entity.eo.h" +#include "efl_gfx_hint.eo.h" +#include "efl_gfx_mapping.eo.h" +#include "efl_gfx_stack.eo.h" +#include "efl_input_device.eo.h" +#include "efl_input_focus.eo.h" +#include "efl_input_hold.eo.h" +#include "efl_input_interface.eo.h" +#include "efl_input_key.eo.h" +#include "efl_input_pointer.eo.h" +#include "efl_loop.eo.h" +#include "efl_loop_consumer.eo.h" +#include "efl_object.eo.h" +#include "efl_ui_i18n.eo.h" +#include "evas_box_eo.h" +} +#include +#include +#include "efl_canvas_group.eo.hh" +#include "efl_canvas_object.eo.hh" +#include "efl_canvas_pointer.eo.hh" +#include "efl_class.eo.hh" +#include "efl_gfx_color.eo.hh" +#include "efl_gfx_entity.eo.hh" +#include "efl_gfx_hint.eo.hh" +#include "efl_gfx_mapping.eo.hh" +#include "efl_gfx_stack.eo.hh" +#include "efl_input_device.eo.hh" +#include "efl_input_focus.eo.hh" +#include "efl_input_hold.eo.hh" +#include "efl_input_interface.eo.hh" +#include "efl_input_key.eo.hh" +#include "efl_input_pointer.eo.hh" +#include "efl_loop.eo.hh" +#include "efl_loop_consumer.eo.hh" +#include "efl_object.eo.hh" +#include "efl_ui_i18n.eo.hh" +#ifndef EVAS_BOX_FWD_GUARD +#define EVAS_BOX_FWD_GUARD +namespace evas { +struct Box; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Box> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Box&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Box const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Box const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CLASS_FWD_GUARD +#define EFL_CLASS_FWD_GUARD +namespace efl { +struct Class; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_COLOR_FWD_GUARD +#define EFL_GFX_COLOR_FWD_GUARD +namespace efl { namespace gfx { +struct Color; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_DEVICE_FWD_GUARD +#define EFL_INPUT_DEVICE_FWD_GUARD +namespace efl { namespace input { +struct Device; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_ENTITY_FWD_GUARD +#define EFL_GFX_ENTITY_FWD_GUARD +namespace efl { namespace gfx { +struct Entity; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_HINT_FWD_GUARD +#define EFL_GFX_HINT_FWD_GUARD +namespace efl { namespace gfx { +struct Hint; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_FOCUS_FWD_GUARD +#define EFL_INPUT_FOCUS_FWD_GUARD +namespace efl { namespace input { +struct Focus; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_HOLD_FWD_GUARD +#define EFL_INPUT_HOLD_FWD_GUARD +namespace efl { namespace input { +struct Hold; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_UI_I18N_FWD_GUARD +#define EFL_UI_I18N_FWD_GUARD +namespace efl { namespace ui { +struct I18n; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_INTERFACE_FWD_GUARD +#define EFL_INPUT_INTERFACE_FWD_GUARD +namespace efl { namespace input { +struct Interface; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_KEY_FWD_GUARD +#define EFL_INPUT_KEY_FWD_GUARD +namespace efl { namespace input { +struct Key; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_LOOP_FWD_GUARD +#define EFL_LOOP_FWD_GUARD +namespace efl { +struct Loop; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_LOOP_CONSUMER_FWD_GUARD +#define EFL_LOOP_CONSUMER_FWD_GUARD +namespace efl { +struct Loop_Consumer; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_OBJECT_FWD_GUARD +#define EFL_OBJECT_FWD_GUARD +namespace efl { +struct Object; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_GROUP_FWD_GUARD +#define EFL_CANVAS_GROUP_FWD_GUARD +namespace efl { namespace canvas { +struct Group; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Group> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Group&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Group const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Group const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_MAPPING_FWD_GUARD +#define EFL_GFX_MAPPING_FWD_GUARD +namespace efl { namespace gfx { +struct Mapping; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_OBJECT_FWD_GUARD +#define EFL_CANVAS_OBJECT_FWD_GUARD +namespace efl { namespace canvas { +struct Object; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_POINTER_FWD_GUARD +#define EFL_CANVAS_POINTER_FWD_GUARD +namespace efl { namespace canvas { +struct Pointer; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_POINTER_FWD_GUARD +#define EFL_INPUT_POINTER_FWD_GUARD +namespace efl { namespace input { +struct Pointer; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_STACK_FWD_GUARD +#define EFL_GFX_STACK_FWD_GUARD +namespace efl { namespace gfx { +struct Stack; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack const&> : ::std::true_type {}; } } +#endif + +namespace eo_cxx { +namespace evas { +struct Box { + ::efl::eolian::return_traits::type align_get( ::efl::eolian::out_traits::type horizontal, ::efl::eolian::out_traits::type vertical) const; + ::efl::eolian::return_traits::type align_set( ::efl::eolian::in_traits::type horizontal, ::efl::eolian::in_traits::type vertical) const; + ::efl::eolian::return_traits::type padding_get( ::efl::eolian::out_traits::type horizontal, ::efl::eolian::out_traits::type vertical) const; + ::efl::eolian::return_traits::type padding_set( ::efl::eolian::in_traits::type horizontal, ::efl::eolian::in_traits::type vertical) const; + ::efl::eolian::return_traits::type layout_set( ::efl::eolian::in_traits::type cb, ::efl::eolian::in_traits::type data, ::efl::eolian::in_traits::type free_data) const; + ::efl::eolian::return_traits::type layout_horizontal( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits::type layout_vertical( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits::type layout_homogeneous_max_size_horizontal( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type internal_remove( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits::type layout_flow_vertical( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits::type internal_option_free( ::efl::eolian::in_traits::type opt) const; + ::efl::eolian::return_traits::type insert_after( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< ::efl::canvas::Object>::type reference) const; + ::efl::eolian::return_traits::type remove_all( ::efl::eolian::in_traits::type clear) const; + ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type iterator_new() const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type add_to() const; + ::efl::eolian::return_traits::type append( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits::type option_property_id_get( ::efl::eolian::in_traits< ::efl::eina::string_view>::type name) const; + ::efl::eolian::return_traits::type prepend( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type accessor_new() const; + ::efl::eolian::return_traits::type internal_append( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type internal_remove_at( ::efl::eolian::in_traits< unsigned int>::type pos) const; + ::efl::eolian::return_traits::type remove_at( ::efl::eolian::in_traits< unsigned int>::type pos) const; + ::efl::eolian::return_traits::type internal_insert_at( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< unsigned int>::type pos) const; + ::efl::eolian::return_traits::type insert_before( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< ::efl::canvas::Object>::type reference) const; + ::efl::eolian::return_traits< ::efl::eina::string_view>::type option_property_name_get( ::efl::eolian::in_traits::type property) const; + ::efl::eolian::return_traits::type internal_insert_before( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< ::efl::canvas::Object>::type reference) const; + ::efl::eolian::return_traits::type layout_homogeneous_horizontal( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits::type internal_option_new( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits::type layout_homogeneous_max_size_vertical( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits::type internal_insert_after( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< ::efl::canvas::Object>::type reference) const; + ::efl::eolian::return_traits::type insert_at( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< unsigned int>::type pos) const; + ::efl::eolian::return_traits::type internal_prepend( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits::type remove( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits::type layout_stack( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits::type layout_homogeneous_vertical( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits::type layout_flow_horizontal( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits::type count() const; + static Efl_Class const* _eo_class() + { + return EVAS_BOX_CLASS; + } + Eo* _eo_ptr() const { return *(reinterpret_cast(const_cast(this))); } + operator ::evas::Box() const; + operator ::evas::Box&(); + operator ::evas::Box const&() const; + /// @cond LOCAL + ::efl::eolian::address_of_operator operator&() { return {this}; } + ::efl::eolian::address_of_operator operator&() const { return {this}; } + /// @endcond +}; +} +} +namespace evas { +struct Box : private ::efl::eo::concrete + , EO_CXX_INHERIT(::efl::Loop_Consumer) + , EO_CXX_INHERIT(::efl::Object) + , EO_CXX_INHERIT(::efl::canvas::Group) + , EO_CXX_INHERIT(::efl::canvas::Object) + , EO_CXX_INHERIT(::efl::canvas::Pointer) + , EO_CXX_INHERIT(::efl::gfx::Color) + , EO_CXX_INHERIT(::efl::gfx::Entity) + , EO_CXX_INHERIT(::efl::gfx::Hint) + , EO_CXX_INHERIT(::efl::gfx::Mapping) + , EO_CXX_INHERIT(::efl::gfx::Stack) + , EO_CXX_INHERIT(::efl::input::Interface) + , EO_CXX_INHERIT(::efl::ui::I18n) +{ + explicit Box( ::Eo* eo) + : ::efl::eo::concrete(eo) {} + Box(std::nullptr_t) + : ::efl::eo::concrete(nullptr) {} + explicit Box() = default; + Box(Box const&) = default; + Box(Box&&) = default; + Box& operator=(Box const&) = default; + Box& operator=(Box&&) = default; + template + Box(Derived&& derived + , typename std::enable_if< + ::efl::eo::is_eolian_object::value + && std::is_base_of< Box, Derived>::value>::type* = 0) + : ::efl::eo::concrete(derived._eo_ptr()) {} + + Box( ::efl::eo::instantiate_t) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, ::efl::eo::concrete{nullptr}, _eo_class()); + } + template + explicit Box( ::efl::eo::instantiate_t, T&& parent, typename std::enable_if< ::efl::eo::is_eolian_object::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, parent, _eo_class()); + } + template Box( ::efl::eo::instantiate_t, F&& f, typename ::std::enable_if< ::efl::eolian::is_constructor_lambda::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, ::efl::eo::concrete{nullptr}, _eo_class(), *this, std::forward(f)); + } + template Box( ::efl::eo::instantiate_t, T&& parent, F&& f, typename ::std::enable_if< ::efl::eolian::is_constructor_lambda::value && ::efl::eo::is_eolian_object::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, parent, _eo_class(), *this, std::forward(f)); + } + + ::efl::eolian::return_traits::type align_get( ::efl::eolian::out_traits::type horizontal, ::efl::eolian::out_traits::type vertical) const; + ::efl::eolian::return_traits::type align_set( ::efl::eolian::in_traits::type horizontal, ::efl::eolian::in_traits::type vertical) const; + ::efl::eolian::return_traits::type padding_get( ::efl::eolian::out_traits::type horizontal, ::efl::eolian::out_traits::type vertical) const; + ::efl::eolian::return_traits::type padding_set( ::efl::eolian::in_traits::type horizontal, ::efl::eolian::in_traits::type vertical) const; + ::efl::eolian::return_traits::type layout_set( ::efl::eolian::in_traits::type cb, ::efl::eolian::in_traits::type data, ::efl::eolian::in_traits::type free_data) const; + ::efl::eolian::return_traits::type layout_horizontal( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits::type layout_vertical( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits::type layout_homogeneous_max_size_horizontal( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type internal_remove( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits::type layout_flow_vertical( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits::type internal_option_free( ::efl::eolian::in_traits::type opt) const; + ::efl::eolian::return_traits::type insert_after( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< ::efl::canvas::Object>::type reference) const; + ::efl::eolian::return_traits::type remove_all( ::efl::eolian::in_traits::type clear) const; + ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type iterator_new() const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type add_to() const; + ::efl::eolian::return_traits::type append( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits::type option_property_id_get( ::efl::eolian::in_traits< ::efl::eina::string_view>::type name) const; + ::efl::eolian::return_traits::type prepend( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type accessor_new() const; + ::efl::eolian::return_traits::type internal_append( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type internal_remove_at( ::efl::eolian::in_traits< unsigned int>::type pos) const; + ::efl::eolian::return_traits::type remove_at( ::efl::eolian::in_traits< unsigned int>::type pos) const; + ::efl::eolian::return_traits::type internal_insert_at( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< unsigned int>::type pos) const; + ::efl::eolian::return_traits::type insert_before( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< ::efl::canvas::Object>::type reference) const; + ::efl::eolian::return_traits< ::efl::eina::string_view>::type option_property_name_get( ::efl::eolian::in_traits::type property) const; + ::efl::eolian::return_traits::type internal_insert_before( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< ::efl::canvas::Object>::type reference) const; + ::efl::eolian::return_traits::type layout_homogeneous_horizontal( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits::type internal_option_new( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits::type layout_homogeneous_max_size_vertical( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits::type internal_insert_after( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< ::efl::canvas::Object>::type reference) const; + ::efl::eolian::return_traits::type insert_at( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< unsigned int>::type pos) const; + ::efl::eolian::return_traits::type internal_prepend( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits::type remove( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits::type layout_stack( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits::type layout_homogeneous_vertical( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits::type layout_flow_horizontal( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits::type count() const; + static Efl_Class const* _eo_class() + { + return EVAS_BOX_CLASS; + } + Eo* _eo_ptr() const { return *(reinterpret_cast(const_cast(this))); } + static struct child_added_event + { + static Efl_Event_Description const* description() + { return EVAS_BOX_EVENT_CHILD_ADDED; } + typedef Evas_Object_Box_Option const* parameter_type; + } const child_added_event; +#ifdef EFL_CXXPERIMENTAL + template + typename std::enable_if::value, ::efl::eolian::signal_connection>::type + child_added_event_cb_add(F function) + { + return ::efl::eolian::event_add(child_added_event, *this, function); + } + template + typename std::enable_if::value, ::efl::eolian::signal_connection>::type + child_added_event_cb_add(F function) + { + return ::efl::eolian::event_add(child_added_event, *this, std::bind(function)); + } +#endif + static struct child_removed_event + { + static Efl_Event_Description const* description() + { return EVAS_BOX_EVENT_CHILD_REMOVED; } + typedef ::efl::canvas::Object parameter_type; + } const child_removed_event; +#ifdef EFL_CXXPERIMENTAL + template + typename std::enable_if::value, ::efl::eolian::signal_connection>::type + child_removed_event_cb_add(F function) + { + return ::efl::eolian::event_add(child_removed_event, *this, function); + } + template + typename std::enable_if::value, ::efl::eolian::signal_connection>::type + child_removed_event_cb_add(F function) + { + return ::efl::eolian::event_add(child_removed_event, *this, std::bind(function)); + } +#endif + /// @cond LOCAL + ::efl::eolian::address_of_operator operator&() { return {this}; } + ::efl::eolian::address_of_operator operator&() const { return {this}; } + /// @endcond + ::efl::eo::wref _get_wref() const { return ::efl::eo::wref(*this); } + ::efl::eo::concrete const& _get_concrete() const { return *this; } + ::efl::eo::concrete& _get_concrete() { return *this; } + using ::efl::eo::concrete::_eo_ptr; + using ::efl::eo::concrete::_release; + using ::efl::eo::concrete::_reset; + using ::efl::eo::concrete::_delete; + using ::efl::eo::concrete::operator bool; +#ifdef EFL_CXXPERIMENTAL + const Box* operator->() const { return this; } + Box* operator->() { return this; } + operator Eo*() const { return _eo_ptr(); } +#endif + friend bool operator==(Box const& lhs, Box const& rhs) + { return lhs._get_concrete() == rhs._get_concrete(); } + friend bool operator!=(Box const& lhs, Box const& rhs) + { return !(lhs == rhs); } +}; +static_assert(sizeof(Box) == sizeof(Eo*), ""); +static_assert(std::is_standard_layout::value, ""); +} +#endif diff --git a/src/lib/evas/canvas/evas_box_eo.impl.hh b/src/lib/evas/canvas/evas_box_eo.impl.hh new file mode 100644 index 0000000000..d31154f3c1 --- /dev/null +++ b/src/lib/evas/canvas/evas_box_eo.impl.hh @@ -0,0 +1,478 @@ +#ifndef EVAS_BOX_IMPL_HH +#define EVAS_BOX_IMPL_HH + +#include "evas_box_eo.hh" + +namespace evas { +inline ::efl::eolian::return_traits::type Box::align_get( ::efl::eolian::out_traits::type horizontal, ::efl::eolian::out_traits::type vertical) const +{ + double __out_param_horizontal = {}; + double __out_param_vertical = {}; + ::evas_obj_box_align_get(_eo_ptr(), + & __out_param_horizontal, + & __out_param_vertical); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, double>(horizontal, __out_param_horizontal); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, double>(vertical, __out_param_vertical); +} +inline ::efl::eolian::return_traits::type Box::align_set( ::efl::eolian::in_traits::type horizontal, ::efl::eolian::in_traits::type vertical) const +{ + ::evas_obj_box_align_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(horizontal), + ::efl::eolian::convert_to_c::type>(vertical)); +} +inline ::efl::eolian::return_traits::type Box::padding_get( ::efl::eolian::out_traits::type horizontal, ::efl::eolian::out_traits::type vertical) const +{ + int __out_param_horizontal = {}; + int __out_param_vertical = {}; + ::evas_obj_box_padding_get(_eo_ptr(), + & __out_param_horizontal, + & __out_param_vertical); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(horizontal, __out_param_horizontal); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(vertical, __out_param_vertical); +} +inline ::efl::eolian::return_traits::type Box::padding_set( ::efl::eolian::in_traits::type horizontal, ::efl::eolian::in_traits::type vertical) const +{ + ::evas_obj_box_padding_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(horizontal), + ::efl::eolian::convert_to_c::type>(vertical)); +} +inline ::efl::eolian::return_traits::type Box::layout_set( ::efl::eolian::in_traits::type cb, ::efl::eolian::in_traits::type data, ::efl::eolian::in_traits::type free_data) const +{ + ::evas_obj_box_layout_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(cb), + ::efl::eolian::convert_to_c::type>(data), + ::efl::eolian::convert_to_c::type>(free_data)); +} +inline ::efl::eolian::return_traits::type Box::layout_horizontal( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_horizontal(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits::type Box::layout_vertical( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_vertical(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits::type Box::layout_homogeneous_max_size_horizontal( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_homogeneous_max_size_horizontal(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Box::internal_remove( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + ::Efl_Canvas_Object* __return_value = ::evas_obj_box_internal_remove(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::layout_flow_vertical( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_flow_vertical(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits::type Box::internal_option_free( ::efl::eolian::in_traits::type opt) const +{ + ::evas_obj_box_internal_option_free(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(opt)); +} +inline ::efl::eolian::return_traits::type Box::insert_after( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< ::efl::canvas::Object>::type reference) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_insert_after(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object const*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(reference)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::remove_all( ::efl::eolian::in_traits::type clear) const +{ + Eina_Bool __return_value = ::evas_obj_box_remove_all(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(clear)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type Box::iterator_new() const +{ + Eina_Iterator * __return_value = ::evas_obj_box_iterator_new(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Box::add_to() const +{ + ::Efl_Canvas_Object* __return_value = ::evas_obj_box_add_to(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::append( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_append(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::option_property_id_get( ::efl::eolian::in_traits< ::efl::eina::string_view>::type name) const +{ + int __return_value = ::evas_obj_box_option_property_id_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(name)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::prepend( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_prepend(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type Box::accessor_new() const +{ + Eina_Accessor * __return_value = ::evas_obj_box_accessor_new(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::internal_append( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_internal_append(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Box::internal_remove_at( ::efl::eolian::in_traits< unsigned int>::type pos) const +{ + ::Efl_Canvas_Object* __return_value = ::evas_obj_box_internal_remove_at(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(pos)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::remove_at( ::efl::eolian::in_traits< unsigned int>::type pos) const +{ + Eina_Bool __return_value = ::evas_obj_box_remove_at(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(pos)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::internal_insert_at( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< unsigned int>::type pos) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_internal_insert_at(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + ::efl::eolian::convert_to_c::type>(pos)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::insert_before( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< ::efl::canvas::Object>::type reference) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_insert_before(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object const*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(reference)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::eina::string_view>::type Box::option_property_name_get( ::efl::eolian::in_traits::type property) const +{ + const char * __return_value = ::evas_obj_box_option_property_name_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(property)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::string_view>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::internal_insert_before( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< ::efl::canvas::Object>::type reference) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_internal_insert_before(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object const*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(reference)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::layout_homogeneous_horizontal( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_homogeneous_horizontal(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits::type Box::internal_option_new( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_internal_option_new(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::layout_homogeneous_max_size_vertical( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_homogeneous_max_size_vertical(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits::type Box::internal_insert_after( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< ::efl::canvas::Object>::type reference) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_internal_insert_after(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object const*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(reference)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::insert_at( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< unsigned int>::type pos) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_insert_at(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + ::efl::eolian::convert_to_c::type>(pos)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::internal_prepend( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_internal_prepend(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::remove( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + Eina_Bool __return_value = ::evas_obj_box_remove(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::layout_stack( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_stack(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits::type Box::layout_homogeneous_vertical( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_homogeneous_vertical(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits::type Box::layout_flow_horizontal( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_flow_horizontal(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits::type Box::count() const +{ + int __return_value = ::evas_obj_box_count(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +} +namespace eo_cxx { +namespace evas { +inline ::efl::eolian::return_traits::type Box::align_get( ::efl::eolian::out_traits::type horizontal, ::efl::eolian::out_traits::type vertical) const +{ + double __out_param_horizontal = {}; + double __out_param_vertical = {}; + ::evas_obj_box_align_get(_eo_ptr(), + & __out_param_horizontal, + & __out_param_vertical); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, double>(horizontal, __out_param_horizontal); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, double>(vertical, __out_param_vertical); +} +inline ::efl::eolian::return_traits::type Box::align_set( ::efl::eolian::in_traits::type horizontal, ::efl::eolian::in_traits::type vertical) const +{ + ::evas_obj_box_align_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(horizontal), + ::efl::eolian::convert_to_c::type>(vertical)); +} +inline ::efl::eolian::return_traits::type Box::padding_get( ::efl::eolian::out_traits::type horizontal, ::efl::eolian::out_traits::type vertical) const +{ + int __out_param_horizontal = {}; + int __out_param_vertical = {}; + ::evas_obj_box_padding_get(_eo_ptr(), + & __out_param_horizontal, + & __out_param_vertical); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(horizontal, __out_param_horizontal); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(vertical, __out_param_vertical); +} +inline ::efl::eolian::return_traits::type Box::padding_set( ::efl::eolian::in_traits::type horizontal, ::efl::eolian::in_traits::type vertical) const +{ + ::evas_obj_box_padding_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(horizontal), + ::efl::eolian::convert_to_c::type>(vertical)); +} +inline ::efl::eolian::return_traits::type Box::layout_set( ::efl::eolian::in_traits::type cb, ::efl::eolian::in_traits::type data, ::efl::eolian::in_traits::type free_data) const +{ + ::evas_obj_box_layout_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(cb), + ::efl::eolian::convert_to_c::type>(data), + ::efl::eolian::convert_to_c::type>(free_data)); +} +inline ::efl::eolian::return_traits::type Box::layout_horizontal( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_horizontal(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits::type Box::layout_vertical( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_vertical(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits::type Box::layout_homogeneous_max_size_horizontal( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_homogeneous_max_size_horizontal(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Box::internal_remove( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + ::Efl_Canvas_Object* __return_value = ::evas_obj_box_internal_remove(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::layout_flow_vertical( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_flow_vertical(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits::type Box::internal_option_free( ::efl::eolian::in_traits::type opt) const +{ + ::evas_obj_box_internal_option_free(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(opt)); +} +inline ::efl::eolian::return_traits::type Box::insert_after( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< ::efl::canvas::Object>::type reference) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_insert_after(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object const*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(reference)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::remove_all( ::efl::eolian::in_traits::type clear) const +{ + Eina_Bool __return_value = ::evas_obj_box_remove_all(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(clear)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type Box::iterator_new() const +{ + Eina_Iterator * __return_value = ::evas_obj_box_iterator_new(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Box::add_to() const +{ + ::Efl_Canvas_Object* __return_value = ::evas_obj_box_add_to(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::append( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_append(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::option_property_id_get( ::efl::eolian::in_traits< ::efl::eina::string_view>::type name) const +{ + int __return_value = ::evas_obj_box_option_property_id_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(name)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::prepend( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_prepend(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type Box::accessor_new() const +{ + Eina_Accessor * __return_value = ::evas_obj_box_accessor_new(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::internal_append( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_internal_append(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Box::internal_remove_at( ::efl::eolian::in_traits< unsigned int>::type pos) const +{ + ::Efl_Canvas_Object* __return_value = ::evas_obj_box_internal_remove_at(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(pos)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::remove_at( ::efl::eolian::in_traits< unsigned int>::type pos) const +{ + Eina_Bool __return_value = ::evas_obj_box_remove_at(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(pos)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::internal_insert_at( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< unsigned int>::type pos) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_internal_insert_at(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + ::efl::eolian::convert_to_c::type>(pos)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::insert_before( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< ::efl::canvas::Object>::type reference) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_insert_before(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object const*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(reference)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::eina::string_view>::type Box::option_property_name_get( ::efl::eolian::in_traits::type property) const +{ + const char * __return_value = ::evas_obj_box_option_property_name_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(property)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::string_view>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::internal_insert_before( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< ::efl::canvas::Object>::type reference) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_internal_insert_before(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object const*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(reference)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::layout_homogeneous_horizontal( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_homogeneous_horizontal(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits::type Box::internal_option_new( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_internal_option_new(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::layout_homogeneous_max_size_vertical( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_homogeneous_max_size_vertical(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits::type Box::internal_insert_after( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< ::efl::canvas::Object>::type reference) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_internal_insert_after(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object const*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(reference)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::insert_at( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< unsigned int>::type pos) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_insert_at(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + ::efl::eolian::convert_to_c::type>(pos)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::internal_prepend( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + Evas_Object_Box_Option * __return_value = ::evas_obj_box_internal_prepend(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::remove( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + Eina_Bool __return_value = ::evas_obj_box_remove(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Box::layout_stack( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_stack(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits::type Box::layout_homogeneous_vertical( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_homogeneous_vertical(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits::type Box::layout_flow_horizontal( ::efl::eolian::in_traits::type priv, ::efl::eolian::in_traits::type data) const +{ + ::evas_obj_box_layout_flow_horizontal(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(priv), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits::type Box::count() const +{ + int __return_value = ::evas_obj_box_count(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline evas::Box::operator ::evas::Box() const { return *static_cast< ::evas::Box const*>(static_cast(this)); } +inline evas::Box::operator ::evas::Box&() { return *static_cast< ::evas::Box*>(static_cast(this)); } +inline evas::Box::operator ::evas::Box const&() const { return *static_cast< ::evas::Box const*>(static_cast(this)); } +} } +#endif diff --git a/src/lib/evas/canvas/evas_box_eo.legacy.c b/src/lib/evas/canvas/evas_box_eo.legacy.c new file mode 100644 index 0000000000..c2ac6b840c --- /dev/null +++ b/src/lib/evas/canvas/evas_box_eo.legacy.c @@ -0,0 +1,162 @@ + +EAPI void +evas_object_box_align_set(Evas_Box *obj, double horizontal, double vertical) +{ + evas_obj_box_align_set(obj, horizontal, vertical); +} + +EAPI void +evas_object_box_align_get(const Evas_Box *obj, double *horizontal, double *vertical) +{ + evas_obj_box_align_get(obj, horizontal, vertical); +} + +EAPI void +evas_object_box_padding_set(Evas_Box *obj, int horizontal, int vertical) +{ + evas_obj_box_padding_set(obj, horizontal, vertical); +} + +EAPI void +evas_object_box_padding_get(const Evas_Box *obj, int *horizontal, int *vertical) +{ + evas_obj_box_padding_get(obj, horizontal, vertical); +} + +EAPI void +evas_object_box_layout_set(Evas_Box *obj, Evas_Object_Box_Layout cb, const void *data, Eina_Free_Cb free_data) +{ + evas_obj_box_layout_set(obj, cb, data, free_data); +} + +EAPI void +evas_object_box_layout_horizontal(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data) +{ + evas_obj_box_layout_horizontal(obj, priv, data); +} + +EAPI void +evas_object_box_layout_vertical(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data) +{ + evas_obj_box_layout_vertical(obj, priv, data); +} + +EAPI void +evas_object_box_layout_homogeneous_max_size_horizontal(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data) +{ + evas_obj_box_layout_homogeneous_max_size_horizontal(obj, priv, data); +} + +EAPI void +evas_object_box_layout_flow_vertical(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data) +{ + evas_obj_box_layout_flow_vertical(obj, priv, data); +} + +EAPI Evas_Object_Box_Option * +evas_object_box_insert_after(Evas_Box *obj, Efl_Canvas_Object *child, const Efl_Canvas_Object *reference) +{ + return evas_obj_box_insert_after(obj, child, reference); +} + +EAPI Eina_Bool +evas_object_box_remove_all(Evas_Box *obj, Eina_Bool clear) +{ + return evas_obj_box_remove_all(obj, clear); +} + +EAPI Eina_Iterator * +evas_object_box_iterator_new(const Evas_Box *obj) +{ + return evas_obj_box_iterator_new(obj); +} + +EAPI Efl_Canvas_Object * +evas_object_box_add_to(Evas_Box *obj) +{ + return evas_obj_box_add_to(obj); +} + +EAPI Evas_Object_Box_Option * +evas_object_box_append(Evas_Box *obj, Efl_Canvas_Object *child) +{ + return evas_obj_box_append(obj, child); +} + +EAPI int +evas_object_box_option_property_id_get(const Evas_Box *obj, const char *name) +{ + return evas_obj_box_option_property_id_get(obj, name); +} + +EAPI Evas_Object_Box_Option * +evas_object_box_prepend(Evas_Box *obj, Efl_Canvas_Object *child) +{ + return evas_obj_box_prepend(obj, child); +} + +EAPI Eina_Accessor * +evas_object_box_accessor_new(const Evas_Box *obj) +{ + return evas_obj_box_accessor_new(obj); +} + +EAPI Eina_Bool +evas_object_box_remove_at(Evas_Box *obj, unsigned int pos) +{ + return evas_obj_box_remove_at(obj, pos); +} + +EAPI Evas_Object_Box_Option * +evas_object_box_insert_before(Evas_Box *obj, Efl_Canvas_Object *child, const Efl_Canvas_Object *reference) +{ + return evas_obj_box_insert_before(obj, child, reference); +} + +EAPI const char * +evas_object_box_option_property_name_get(const Evas_Box *obj, int property) +{ + return evas_obj_box_option_property_name_get(obj, property); +} + +EAPI void +evas_object_box_layout_homogeneous_horizontal(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data) +{ + evas_obj_box_layout_homogeneous_horizontal(obj, priv, data); +} + +EAPI void +evas_object_box_layout_homogeneous_max_size_vertical(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data) +{ + evas_obj_box_layout_homogeneous_max_size_vertical(obj, priv, data); +} + +EAPI Evas_Object_Box_Option * +evas_object_box_insert_at(Evas_Box *obj, Efl_Canvas_Object *child, unsigned int pos) +{ + return evas_obj_box_insert_at(obj, child, pos); +} + +EAPI Eina_Bool +evas_object_box_remove(Evas_Box *obj, Efl_Canvas_Object *child) +{ + return evas_obj_box_remove(obj, child); +} + +EAPI void +evas_object_box_layout_stack(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data) +{ + evas_obj_box_layout_stack(obj, priv, data); +} + +EAPI void +evas_object_box_layout_homogeneous_vertical(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data) +{ + evas_obj_box_layout_homogeneous_vertical(obj, priv, data); +} + +EAPI void +evas_object_box_layout_flow_horizontal(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data) +{ + evas_obj_box_layout_flow_horizontal(obj, priv, data); +} diff --git a/src/lib/evas/canvas/evas_box_eo.legacy.h b/src/lib/evas/canvas/evas_box_eo.legacy.h new file mode 100644 index 0000000000..ba67589525 --- /dev/null +++ b/src/lib/evas/canvas/evas_box_eo.legacy.h @@ -0,0 +1,646 @@ +#ifndef _EVAS_BOX_EO_LEGACY_H_ +#define _EVAS_BOX_EO_LEGACY_H_ + +#ifndef _EVAS_BOX_EO_CLASS_TYPE +#define _EVAS_BOX_EO_CLASS_TYPE + +typedef Eo Evas_Box; + +#endif + +#ifndef _EVAS_BOX_EO_TYPES +#define _EVAS_BOX_EO_TYPES + + +#endif + +/** + * @brief Set the alignment of the whole bounding box of contents, for a given + * box object. + * + * This will influence how a box object is to align its bounding box of + * contents within its own area. The values must be in the range $0.0 - $1.0, + * or undefined behavior is expected. For horizontal alignment, $0.0 means to + * the left, with $1.0 meaning to the right. For vertical alignment, $0.0 means + * to the top, with $1.0 meaning to the bottom. + * + * @note The default values for both alignments is $0.5. + * + * See also @ref evas_object_box_align_get. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal alignment, in pixels. + * @param[in] vertical The vertical alignment, in pixels. + * + * @ingroup Evas_Object_Box_Group + */ +EAPI void evas_object_box_align_set(Evas_Box *obj, double horizontal, double vertical); + +/** + * @brief Get the alignment of the whole bounding box of contents, for a given + * box object. + * + * See also @ref evas_object_box_align_set for more information. + * + * @param[in] obj The object. + * @param[out] horizontal The horizontal alignment, in pixels. + * @param[out] vertical The vertical alignment, in pixels. + * + * @ingroup Evas_Object_Box_Group + */ +EAPI void evas_object_box_align_get(const Evas_Box *obj, double *horizontal, double *vertical); + +/** + * @brief Set the (space) padding between cells set for a given box object. + * + * @note The default values for both padding components is $0. + * + * See also @ref evas_object_box_padding_get. + * + * @param[in] obj The object. + * @param[in] horizontal The horizontal padding, in pixels. + * @param[in] vertical The vertical padding, in pixels. + * + * @ingroup Evas_Object_Box_Group + */ +EAPI void evas_object_box_padding_set(Evas_Box *obj, int horizontal, int vertical); + +/** + * @brief Get the (space) padding between cells set for a given box object. + * + * See also @ref evas_object_box_padding_set. + * + * @param[in] obj The object. + * @param[out] horizontal The horizontal padding, in pixels. + * @param[out] vertical The vertical padding, in pixels. + * + * @ingroup Evas_Object_Box_Group + */ +EAPI void evas_object_box_padding_get(const Evas_Box *obj, int *horizontal, int *vertical); + +/** + * @brief Set a new layouting function to a given box object + * + * A box layout function affects how a box object displays child elements + * within its area. The list of pre-defined box layouts available in Evas are + * @ref evas_object_box_layout_horizontal, + * @ref evas_object_box_layout_vertical, + * @ref evas_object_box_layout_homogeneous_horizontal, + * @ref evas_object_box_layout_homogeneous_vertical, + * @ref evas_object_box_layout_homogeneous_max_size_horizontal, + * @ref evas_object_box_layout_homogeneous_max_size_vertical, + * @ref evas_object_box_layout_flow_horizontal, + * @ref evas_object_box_layout_flow_vertical and + * @ref evas_object_box_layout_stack + * + * Refer to each of their documentation texts for details on them. + * + * @note A box layouting function will be triggered by the $'calculate' smart + * callback of the box's smart class. + * + * @param[in] obj The object. + * @param[in] cb The new layout function to set on @c o. + * @param[in] data Data pointer to be passed to @c cb. + * @param[in] free_data Function to free @c data, if need be. + * + * @ingroup Evas_Object_Box_Group + */ +EAPI void evas_object_box_layout_set(Evas_Box *obj, Evas_Object_Box_Layout cb, const void *data, Eina_Free_Cb free_data) EINA_ARG_NONNULL(2); + +/** + * @brief Layout function which sets the box o to a (basic) horizontal box + * + * In this layout, the box object's overall behavior is controlled by its + * padding/alignment properties, which are set by the + * evas_object_box_{h,v}_{align,padding}_set family of functions. The size + * hints of the elements in the box -- set by the + * evas_object_size_hint_{align,padding,weight}_set functions -- also control + * the way this function works. + * + * Box's properties: @c align_h controls the horizontal alignment of the child + * objects relative to the containing box. When set to $0.0, children are + * aligned to the left. A value of $1.0 makes them aligned to the right border. + * Values in between align them proportionally. Note that if the size required + * by the children, which is given by their widths and the @c padding_h + * property of the box, is bigger than the their container's width, the + * children will be displayed out of the box's bounds. A negative value of + * @c align_h makes the box to justify its children. The padding between them, + * in this case, is corrected so that the leftmost one touches the left border + * and the rightmost one touches the right border (even if they must overlap). + * The @c align_v and @c padding_v properties of the box don't contribute to + * its behaviour when this layout is chosen. + * + * Child element's properties: @c align_x does not influence the box's + * behavior. @c padding_l and @c padding_r sum up to the container's horizontal + * padding between elements. The child's @c padding_t, @c padding_b and + * @c align_y properties apply for padding/alignment relative to the overall + * height of the box. Finally, there is the @c weight_x property, which, if set + * to a non-zero value, tells the container that the child width is not + * pre-defined. If the container can't accommodate all its children, it sets + * the widths of the ones with weights to sizes as small as they can all fit + * into it. If the size required by the children is less than the available, + * the box increases its childrens' (which have weights) widths as to fit the + * remaining space. The @c weight_x property, besides telling the element is + * resizable, gives a weight for the resizing process. The parent box will try + * to distribute (or take off) widths accordingly to the normalized list of + * weights: most weighted children remain/get larger in this process than the + * least ones. @c weight_y does not influence the layout. + * + * If one desires that, besides having weights, child elements must be resized + * bounded to a minimum or maximum size, those size hints must be set, by the + * evas_object_size_hint_{min,max}_set functions. + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Object_Box_Group + */ +EAPI void evas_object_box_layout_horizontal(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data); + +/** + * @brief Layout function which sets the box o to a (basic) vertical box + * + * This function behaves analogously to evas_object_box_layout_horizontal. The + * description of its behaviour can be derived from that function's + * documentation. + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Object_Box_Group + */ +EAPI void evas_object_box_layout_vertical(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data); + +/** + * @brief Layout function which sets the box o to a maximum size, homogeneous + * horizontal box + * + * In a maximum size, homogeneous horizontal box, besides having cells of equal + * size reserved for the child objects, this size will be defined by the size + * of the largest child in the box (in width). The box's overall behavior is + * controlled by its properties, which are set by the + * evas_object_box_{h,v}_{align,padding}_set family of functions. The size + * hints of the elements in the box -- set by the + * evas_object_size_hint_{align,padding,weight}_set functions -- also control + * the way this function works. + * + * Box's properties: @c padding_h tells the box to draw empty spaces of that + * size, in pixels, between the child objects' cells. @c align_h controls the + * horizontal alignment of the child objects, relative to the containing box. + * When set to $0.0, children are aligned to the left. A value of $1.0 lets + * them aligned to the right border. Values in between align them + * proportionally. A negative value of @c align_h makes the box to justify its + * children cells. The padding between them, in this case, is corrected so that + * the leftmost one touches the left border and the rightmost one touches the + * right border (even if they must overlap). The @c align_v and @c padding_v + * properties of the box don't contribute to its behaviour when this layout is + * chosen. + * + * Child element's properties: @c padding_l and @c padding_r sum up to the + * required width of the child element. The @c align_x property tells the + * relative position of this overall child width in its allocated cell ($0.0 to + * extreme left, $1.0 to extreme right). A value of $-1.0 to @c align_x makes + * the box try to resize this child element to the exact width of its cell + * (respecting the minimum and maximum size hints on the child's width and + * accounting for its horizontal padding hints). The child's @c padding_t, + * @c padding_b and @c align_y properties apply for padding/alignment relative + * to the overall height of the box. A value of $-1.0 to @c align_y makes the + * box try to resize this child element to the exact height of its parent + * (respecting the max hint on the child's height). + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Object_Box_Group + */ +EAPI void evas_object_box_layout_homogeneous_max_size_horizontal(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data); + + +/** + * @brief Layout function which sets the box o to a flow vertical box. + * + * This function behaves analogously to evas_object_box_layout_flow_horizontal. + * The description of its behaviour can be derived from that function's + * documentation. + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Object_Box_Group + */ +EAPI void evas_object_box_layout_flow_vertical(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data); + + +/** + * @brief Insert a new child object after another existing one, in a given box + * object o. + * + * On success, the $"child,added" smart event will take place. + * + * @note This function will fail if @c reference is not a member of @c o. + * + * @note The actual placing of the item relative to @c o's area will depend on + * the layout set to it. + * + * @note This call will trigger the box's _Evas_Object_Box_Api.insert_after + * smart function. + * + * @param[in] obj The object. + * @param[in] child A child Evas object to be made a member of @c o. + * @param[in] reference The child object to place this new one after. + * + * @return A box option bound to the recently added box item or @c null, on + * errors + * + * @ingroup Evas_Object_Box_Group + */ +EAPI Evas_Object_Box_Option *evas_object_box_insert_after(Evas_Box *obj, Efl_Canvas_Object *child, const Efl_Canvas_Object *reference) EINA_ARG_NONNULL(2, 3); + +/** + * @brief Remove all child objects from a box object, unparenting them again. + * + * This has the same effect of calling evas_object_box_remove on each of @c o's + * child objects, in sequence. If, and only if, all those calls succeed, so + * does this one. + * + * @param[in] obj The object. + * @param[in] clear If @c true, it will delete just removed children. + * + * @return @c true on success, @c false otherwise. + * + * @ingroup Evas_Object_Box_Group + */ +EAPI Eina_Bool evas_object_box_remove_all(Evas_Box *obj, Eina_Bool clear); + +/** + * @brief Get an iterator to walk the list of children of a given box object. + * + * @note Do not remove or delete objects while walking the list. + * + * @param[in] obj The object. + * + * @return An iterator on @c o's child objects, on success, or @c null, on + * errors. + * + * @ingroup Evas_Object_Box_Group + */ +EAPI Eina_Iterator *evas_object_box_iterator_new(const Evas_Box *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Add a new box as a child of a given smart object. + * + * This is a helper function that has the same effect of putting a new box + * object into @c parent by use of evas_object_smart_member_add. + * + * @param[in] obj The object. + * + * @return @c null on error, a pointer to a new box object on success. + * + * @ingroup Evas_Object_Box_Group + */ +EAPI Efl_Canvas_Object *evas_object_box_add_to(Evas_Box *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Append a new child object to the given box object o. + * + * On success, the $"child,added" smart event will take place. + * + * @note The actual placing of the item relative to @c o's area will depend on + * the layout set to it. For example, on horizontal layouts an item in the end + * of the box's list of children will appear on its right. + * + * @note This call will trigger the box's _Evas_Object_Box_Api.append smart + * function. + * + * @param[in] obj The object. + * @param[in] child A child Evas object to be made a member of @c o. + * + * @return A box option bound to the recently added box item or @c null, on + * errors. + * + * @ingroup Evas_Object_Box_Group + */ +EAPI Evas_Object_Box_Option *evas_object_box_append(Evas_Box *obj, Efl_Canvas_Object *child) EINA_ARG_NONNULL(2); + +/** + * @brief Get the numerical identifier of the property of the child elements of + * the box o which have name as name string + * + * @note This call won't do anything for a canonical Evas box. Only users which + * have subclassed it, setting custom box items options (see + * #Evas_Object_Box_Option) on it, would benefit from this function. They'd + * have to implement it and set it to be the + * _Evas_Object_Box_Api.property_id_get smart class function of the box, which + * is originally set to @c null. + * + * @param[in] obj The object. + * @param[in] name The name string of the option being searched, for its ID. + * + * @return The numerical ID of the given property or $-1, on errors. + * + * @ingroup Evas_Object_Box_Group + */ +EAPI int evas_object_box_option_property_id_get(const Evas_Box *obj, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(2); + +/** + * @brief Prepend a new child object to the given box object o. + * + * On success, the $"child,added" smart event will take place. + * + * @note The actual placing of the item relative to @c o's area will depend on + * the layout set to it. For example, on horizontal layouts an item in the + * beginning of the box's list of children will appear on its left. + * + * @note This call will trigger the box's _Evas_Object_Box_Api.prepend smart + * function. + * + * @param[in] obj The object. + * @param[in] child A child Evas object to be made a member of @c o. + * + * @return A box option bound to the recently added box item or @c null, on + * errors. + * + * @ingroup Evas_Object_Box_Group + */ +EAPI Evas_Object_Box_Option *evas_object_box_prepend(Evas_Box *obj, Efl_Canvas_Object *child) EINA_ARG_NONNULL(2); + +/** + * @brief Get an accessor (a structure providing random items access) to the + * list of children of a given box object. + * + * @note Do not remove or delete objects while walking the list. + * + * @param[in] obj The object. + * + * @return An accessor on @c o's child objects, on success, or @c null, on + * errors. + * + * @ingroup Evas_Object_Box_Group + */ +EAPI Eina_Accessor *evas_object_box_accessor_new(const Evas_Box *obj) EINA_WARN_UNUSED_RESULT; + + + + +/** + * @brief Remove an object, bound to a given position in a box object, + * unparenting it again. + * + * On removal, you'll get an unparented object again, just as it was before you + * inserted it in the box. The @c option_free box smart callback will be called + * automatically for you and, also, the $"child,removed" smart event will take + * place. + * + * @note This function will fail if the given position is invalid, given @c o's + * internal list of elements. + * + * @note This call will trigger the box's _Evas_Object_Box_Api.remove_at smart + * function. + * + * @param[in] obj The object. + * @param[in] pos The numeric position (starting from $0) of the child object + * to be removed. + * + * @return @c true on success, @c false on failure. + * + * @ingroup Evas_Object_Box_Group + */ +EAPI Eina_Bool evas_object_box_remove_at(Evas_Box *obj, unsigned int pos); + + + +/** + * @brief Insert a new child object before another existing one, in a given box + * object o. + * + * On success, the $"child,added" smart event will take place. + * + * @note This function will fail if @c reference is not a member of @c o. + * + * @note The actual placing of the item relative to @c o's area will depend on + * the layout set to it. + * + * @note This call will trigger the box's _Evas_Object_Box_Api.insert_before + * smart function. + * + * @param[in] obj The object. + * @param[in] child A child Evas object to be made a member of @c o. + * @param[in] reference The child object to place this new one before. + * + * @return A box option bound to the recently added box item or @c null, on + * errors. + * + * @ingroup Evas_Object_Box_Group + */ +EAPI Evas_Object_Box_Option *evas_object_box_insert_before(Evas_Box *obj, Efl_Canvas_Object *child, const Efl_Canvas_Object *reference) EINA_ARG_NONNULL(2, 3); + +/** + * @brief Get the name of the property of the child elements of the box o which + * have id as identifier + * + * @note This call won't do anything for a canonical Evas box. Only users which + * have subclassed it, setting custom box items options (see + * #Evas_Object_Box_Option) on it, would benefit from this function. They'd + * have to implement it and set it to be the + * _Evas_Object_Box_Api.property_name_get smart class function of the box, + * which is originally set to @c null. + * + * @param[in] obj The object. + * @param[in] property The numerical identifier of the option being searched, + * for its name. + * + * @return The name of the given property or @c null, on errors. + * + * @ingroup Evas_Object_Box_Group + */ +EAPI const char *evas_object_box_option_property_name_get(const Evas_Box *obj, int property) EINA_WARN_UNUSED_RESULT; + + +/** + * @brief Layout function which sets the box o to a homogeneous horizontal box + * + * In a homogeneous horizontal box, its width is divided equally between the + * contained objects. The box's overall behavior is controlled by its + * padding/alignment properties, which are set by the + * evas_object_box_{h,v}_{align,padding}_set family of functions. The size + * hints the elements in the box -- set by the + * evas_object_size_hint_{align,padding,weight}_set functions -- also control + * the way this function works. + * + * Box's properties: @c align_h has no influence on the box for this layout. + * @c padding_h tells the box to draw empty spaces of that size, in pixels, + * between the (equal) child objects' cells. The @c align_v and @c padding_v + * properties of the box don't contribute to its behaviour when this layout is + * chosen. + * + * Child element's properties: @c padding_l and @c padding_r sum up to the + * required width of the child element. The @c align_x property tells the + * relative position of this overall child width in its allocated cell ($0.0 to + * extreme left, $1.0 to extreme right). A value of $-1.0 to @c align_x makes + * the box try to resize this child element to the exact width of its cell + * (respecting the minimum and maximum size hints on the child's width and + * accounting for its horizontal padding hints). The child's @c padding_t, + * @c padding_b and @c align_y properties apply for padding/alignment relative + * to the overall height of the box. A value of $-1.0 to @c align_y makes the + * box try to resize this child element to the exact height of its parent + * (respecting the maximum size hint on the child's height). + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Object_Box_Group + */ +EAPI void evas_object_box_layout_homogeneous_horizontal(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data); + + +/** + * @brief Layout function which sets the box o to a maximum size, homogeneous + * vertical box + * + * This function behaves analogously to + * evas_object_box_layout_homogeneous_max_size_horizontal. The description of + * its behaviour can be derived from that function's documentation. + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Object_Box_Group + */ +EAPI void evas_object_box_layout_homogeneous_max_size_vertical(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data); + + +/** + * @brief Insert a new child object at a given position, in a given box object + * @c o. + * + * On success, the $"child,added" smart event will take place. + * + * @note This function will fail if the given position is invalid, given @c o's + * internal list of elements. + * + * @note The actual placing of the item relative to @c o's area will depend on + * the layout set to it. + * + * @note This call will trigger the box's _Evas_Object_Box_Api.insert_at smart + * function. + * + * @param[in] obj The object. + * @param[in] child A child Evas object to be made a member of @c o. + * @param[in] pos The numeric position (starting from $0) to place the new + * child object at. + * + * @return A box option bound to the recently added box item or @c null, on + * errors. + * + * @ingroup Evas_Object_Box_Group + */ +EAPI Evas_Object_Box_Option *evas_object_box_insert_at(Evas_Box *obj, Efl_Canvas_Object *child, unsigned int pos) EINA_ARG_NONNULL(2); + + +/** + * @brief Remove a given object from a box object, unparenting it again. + * + * On removal, you'll get an unparented object again, just as it was before you + * inserted it in the box. The _Evas_Object_Box_Api.option_free box smart + * callback will be called automatically for you and, also, the + * $"child,removed" smart event will take place. + * + * @note This call will trigger the box's _Evas_Object_Box_Api.remove smart + * function. + * + * @param[in] obj The object. + * @param[in] child The handle to the child object to be removed. + * + * @return @c true on success, @c false otherwise. + * + * @ingroup Evas_Object_Box_Group + */ +EAPI Eina_Bool evas_object_box_remove(Evas_Box *obj, Efl_Canvas_Object *child) EINA_ARG_NONNULL(2); + +/** + * @brief Layout function which sets the box o to a stacking box + * + * In a stacking box, all children will be given the same size -- the box's own + * size -- and they will be stacked one above the other, so that the first + * object in @c o's internal list of child elements will be the bottommost in + * the stack. + * + * Box's properties: No box properties are used. + * + * Child element's properties: @c padding_l and @c padding_r sum up to the + * required width of the child element. The @c align_x property tells the + * relative position of this overall child width in its allocated cell ($0.0 to + * extreme left, $1.0 to extreme right). A value of $-1.0 to @c align_x makes + * the box try to resize this child element to the exact width of its cell + * (respecting the min and max hints on the child's width and accounting for + * its horizontal padding properties). The same applies to the vertical axis. + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Object_Box_Group + */ +EAPI void evas_object_box_layout_stack(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data); + +/** + * @brief Layout function which sets the box o to a homogeneous vertical box. + * + * This function behaves analogously to + * evas_object_box_layout_homogeneous_horizontal. The description of its + * behaviour can be derived from that function's documentation. + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Object_Box_Group + */ +EAPI void evas_object_box_layout_homogeneous_vertical(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data); + +/** + * @brief Layout function which sets the box o to a flow horizontal box. + * + * In a flow horizontal box, the box's child elements are placed in rows (think + * of text as an analogy). A row has as many elements as can fit into the box's + * width. The box's overall behavior is controlled by its properties, which are + * set by the evas_object_box_{h,v}_{align,padding}_set family of functions. + * The size hints of the elements in the box -- set by the + * evas_object_size_hint_{align,padding,weight}_set functions -- also control + * the way this function works. + * + * Box's properties: @c padding_h tells the box to draw empty spaces of that + * size, in pixels, between the child objects' cells. @c align_h dictates the + * horizontal alignment of the rows ($0.0 to left align them, $1.0 to right + * align). A value of $-1.0 to @c align_h lets the rows justified horizontally. + * @c align_v controls the vertical alignment of the entire set of rows ($0.0 + * to top, $1.0 to bottom). A value of $-1.0 to @c align_v makes the box to + * justify the rows vertically. The padding between them in this case is + * corrected so that the first row touches the top border and the last one + * touches the bottom border (even if they must overlap). @c padding_v has no + * influence on the layout. + * + * Child element's properties: @c padding_l and @c padding_r sum up to the + * required width of the child element. The @c align_x property has no + * influence on the layout. The child's @c padding_t and @c padding_b sum up to + * the required height of the child element and is the only means (besides row + * justifying) of setting space between rows. Note, however, that @c align_y + * dictates positioning relative to the largest height required by a child + * object in the actual row. + * + * @param[in] obj The object. + * @param[in] priv Private data pointer + * @param[in] data Data pointer + * + * @ingroup Evas_Object_Box_Group + */ +EAPI void evas_object_box_layout_flow_horizontal(Evas_Box *obj, Evas_Object_Box_Data *priv, void *data); + + +#endif diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c index 6db38e81f4..dcd3338dd6 100644 --- a/src/lib/evas/canvas/evas_callbacks.c +++ b/src/lib/evas/canvas/evas_callbacks.c @@ -1,5 +1,3 @@ -#define EFL_CANVAS_OBJECT_BETA -#define EVAS_CANVAS_BETA #include "evas_common_private.h" #include "evas_private.h" @@ -52,23 +50,23 @@ DEFINE_EVAS_CALLBACKS(_legacy_evas_callback_table, EVAS_CALLBACK_LAST, EFL_EVENT_FOCUS_OUT, 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, + EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, + EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, + EFL_GFX_ENTITY_EVENT_STACKING_CHANGED, EVAS_OBJECT_EVENT_DEL, EFL_EVENT_HOLD, - EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS, - EFL_GFX_IMAGE_EVENT_PRELOAD, - EFL_CANVAS_SCENE_EVENT_FOCUS_IN, - EFL_CANVAS_SCENE_EVENT_FOCUS_OUT, + EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, + EFL_GFX_IMAGE_EVENT_IMAGE_PRELOAD, + EFL_CANVAS_SCENE_EVENT_SCENE_FOCUS_IN, + EFL_CANVAS_SCENE_EVENT_SCENE_FOCUS_OUT, EVAS_CANVAS_EVENT_RENDER_FLUSH_PRE, EVAS_CANVAS_EVENT_RENDER_FLUSH_POST, EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_IN, EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_OUT, - EFL_GFX_IMAGE_EVENT_UNLOAD, + EFL_GFX_IMAGE_EVENT_IMAGE_UNLOAD, EFL_CANVAS_SCENE_EVENT_RENDER_PRE, EFL_CANVAS_SCENE_EVENT_RENDER_POST, - EFL_GFX_IMAGE_EVENT_RESIZE, + EFL_GFX_IMAGE_EVENT_IMAGE_RESIZE, EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED, EFL_EVENT_POINTER_AXIS, EVAS_CANVAS_EVENT_VIEWPORT_RESIZE ); @@ -349,6 +347,21 @@ evas_event_callback_call(Evas *eo_e, Evas_Callback_Type type, void *event_info) efl_event_callback_legacy_call(eo_e, _legacy_evas_callback_table(type), event_info); } +static void +_evas_callback_legacy_smart_compatibility_do_it(Evas_Object *eo_obj, const Efl_Event_Description *efl_event_desc, void *event_info) +{ + if (efl_event_desc == EFL_GFX_ENTITY_EVENT_POSITION_CHANGED) + evas_object_smart_callback_call(eo_obj, "move", NULL); + else if (efl_event_desc == EFL_GFX_ENTITY_EVENT_SIZE_CHANGED) + evas_object_smart_callback_call(eo_obj, "resize", NULL); + else if (efl_event_desc == EFL_GFX_ENTITY_EVENT_STACKING_CHANGED) + evas_object_smart_callback_call(eo_obj, "restack", NULL); + /* this is inverted: the base call is the legacy compat and this is the new event */ + else if ((efl_event_desc == EFL_GFX_ENTITY_EVENT_SHOW) || (efl_event_desc == EFL_GFX_ENTITY_EVENT_HIDE)) + efl_event_callback_call(eo_obj, EFL_GFX_ENTITY_EVENT_VISIBILITY_CHANGED, event_info); +} + + void evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Callback_Type type, void *event_info, int event_id, @@ -412,6 +425,7 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data e->current_event = type; efl_event_callback_legacy_call(eo_obj, efl_event_desc, event_info); + _evas_callback_legacy_smart_compatibility_do_it(eo_obj, efl_event_desc, event_info); /* multi events with finger 0 - only for eo callbacks */ if (type == EVAS_CALLBACK_MOUSE_DOWN) @@ -782,7 +796,7 @@ _animator_repeater(void *data, const Efl_Event *event) { Evas_Object_Protected_Data *obj = data; - efl_event_callback_legacy_call(obj->object, EFL_EVENT_ANIMATOR_TICK, event->info); + efl_event_callback_legacy_call(obj->object, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, event->info); DBG("Emitting animator tick on %p.", obj->object); } @@ -792,18 +806,24 @@ _check_event_catcher_add(void *data, const Efl_Event *event) const Efl_Callback_Array_Item_Full *array = event->info; Evas_Object_Protected_Data *obj = data; Evas_Callback_Type type = EVAS_CALLBACK_LAST; + void *gd = NULL; int i; for (i = 0; array[i].desc != NULL; i++) { - if (obj->layer->evas->gesture_manager) - _efl_canvas_gesture_manager_callback_add_hook(obj->layer->evas->gesture_manager, obj->object, array[i].desc); + if (obj->layer->evas->gesture_manager && + _efl_canvas_gesture_manager_watches(array[i].desc)) + { + if (!gd) gd = _efl_canvas_gesture_manager_private_data_get(obj->layer->evas->gesture_manager); - if (array[i].desc == EFL_EVENT_ANIMATOR_TICK) + _efl_canvas_gesture_manager_callback_add_hook(gd, obj->object, array[i].desc); + } + + if (array[i].desc == EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK) { if (obj->animator_ref++ > 0) break; - efl_event_callback_add(obj->layer->evas->evas, EFL_EVENT_ANIMATOR_TICK, _animator_repeater, obj); + efl_event_callback_add(obj->layer->evas->evas, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _animator_repeater, obj); DBG("Registering an animator tick on canvas %p for object %p.", obj->layer->evas->evas, obj->object); } @@ -811,6 +831,11 @@ _check_event_catcher_add(void *data, const Efl_Event *event) { obj->callback_mask |= (((uint64_t)1) << type); } + else if (array[i].desc == EFL_GFX_ENTITY_EVENT_VISIBILITY_CHANGED) + { + obj->callback_mask |= (((uint64_t)1) << EVAS_CALLBACK_SHOW); + obj->callback_mask |= (((uint64_t)1) << EVAS_CALLBACK_HIDE); + } } } @@ -819,6 +844,7 @@ _check_event_catcher_del(void *data, const Efl_Event *event) { const Efl_Callback_Array_Item_Full *array = event->info; Evas_Object_Protected_Data *obj = data; + void *gd = NULL; int i; if (!obj->layer || @@ -827,14 +853,19 @@ _check_event_catcher_del(void *data, const Efl_Event *event) for (i = 0; array[i].desc != NULL; i++) { - if (obj->layer->evas->gesture_manager) - _efl_canvas_gesture_manager_callback_del_hook(obj->layer->evas->gesture_manager, obj->object, array[i].desc); + if (obj->layer->evas->gesture_manager && + _efl_canvas_gesture_manager_watches(array[i].desc)) + { + if (!gd) gd = _efl_canvas_gesture_manager_private_data_get(obj->layer->evas->gesture_manager); - if (array[i].desc == EFL_EVENT_ANIMATOR_TICK) + _efl_canvas_gesture_manager_callback_del_hook(gd, obj->object, array[i].desc); + } + + if (array[i].desc == EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK) { if ((--obj->animator_ref) > 0) break; - efl_event_callback_del(obj->layer->evas->evas, EFL_EVENT_ANIMATOR_TICK, _animator_repeater, obj); + efl_event_callback_del(obj->layer->evas->evas, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _animator_repeater, obj); DBG("Unregistering an animator tick on canvas %p for object %p.", obj->layer->evas->evas, obj->object); } diff --git a/src/lib/evas/canvas/evas_canvas.eo b/src/lib/evas/canvas/evas_canvas.eo deleted file mode 100644 index 32e7347504..0000000000 --- a/src/lib/evas/canvas/evas_canvas.eo +++ /dev/null @@ -1,976 +0,0 @@ -import efl_input_types; - -class Evas.Canvas extends Efl.Loop_Consumer implements Efl.Canvas.Scene, Efl.Animator, Efl.Input.Interface, - Efl.Canvas.Pointer -{ - [[Evas canvas class]] - legacy_prefix: evas; - data: Evas_Public_Data; - methods { - @property image_cache { - set { - [[Set the image cache. - - This function sets the image cache of canvas in bytes. - ]] - } - get { - [[Get the image cache. - - This function returns the image cache size of canvas in bytes. - ]] - } - values { - size: int; [[The cache size.]] - } - } - @property event_default_flags { - set { - [[Set the default set of flags an event begins with - - Events in evas can have an event_flags member. This starts - out with an initial value (no flags). This lets you set - the default flags that an event begins with to $flags. - - @since 1.2 - ]] - } - get { - [[Get the default set of flags an event begins with - - This gets the default event flags events are produced with - when fed in. - - @since 1.2 - ]] - } - values { - flags: Efl.Input.Flags; [[The default flags to use.]] - } - } - @property font_cache { - set { - [[Changes the size of font cache of the given evas.]] - } - get { - [[Get the size of font cache of the given evas in bytes.]] - } - values { - size: int; [[The size in bytes.]] - } - } - @property data_attach { - set { - [[Attaches a specific pointer to the evas for fetching later.]] - } - get { - [[Returns the pointer attached by @.data_attach.set.]] - } - values { - data: void_ptr; [[The attached pointer.]] - } - } - @property focus { - get { - [[Retrieve the object focused by the default seat. - - Focused objects will be the ones having key events delivered - to, which the programmer can act upon by means of - \@ref evas_object_event_callback_add usage. - - Note: Most users wouldn't be dealing directly with Evas' - focused objects. Instead, they would be using a higher level - library for that (like a toolkit, as Elementary) to handle - focus and who's receiving input for them. - - This call returns the object that currently has focus on the - canvas $e or $null, if none. - - See also \@ref evas_object_focus_set, - \@ref evas_object_focus_get, \@ref evas_object_key_grab, - \@ref evas_object_key_ungrab, @.seat_focus.get, - @Efl.Canvas.Object.seat_focus_check, - @Efl.Canvas.Object.seat_focus_add, - @Efl.Canvas.Object.seat_focus_del. - ]] - /* FIXME-doc - Example: - @dontinclude evas-events.c - @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, - @until evas_object_focus_set(d.bg, EINA_TRUE); - @dontinclude evas-events.c - @skip called when our rectangle gets focus - @until } - - In this example the $event_info is a pointer to that - focused rectangle. See the full @ref Example_Evas_Events "example". - */ - return: Efl.Canvas.Object @warn_unused; [[The object that has focus - or $null if there is not one.]] - } - } - @property seat_focus { - [[Return the focused object by a given seat. @since 1.19]] - get {} - keys { - seat: Efl.Input.Device;[[The seat to fetch the focused - object or $null for the default seat.]] - } - values { - return: Efl.Canvas.Object; [[The object that has the focus or $null if - the seat has no focused object.]] - } - } - @property object_top { - get { - [[Get the highest (stacked) Evas object on the canvas $e. - - This function will take all populated layers in the canvas - into account, getting the highest object for the highest - layer, naturally. - - Warning: This function will skip objects parented by smart - objects, acting only on the ones at the "top level", with - regard to object parenting. - - See also \@ref evas_object_layer_get, - \@ref evas_object_layer_set, \@ref evas_object_below_get, - \@ref evas_object_above_get. - ]] - return: Efl.Canvas.Object @warn_unused; [[A pointer to the highest object - on it (if any) or $null otherwise.]] - } - } - @property pointer_canvas_xy_by_device { - [[This function returns the current known default pointer coordinates. @since 1.19]] - get {} - keys { - dev: Efl.Input.Device; [[The pointer device.]] - } - values { - x: int; [[The pointer to a Evas_Coord to be filled in.]] - y: int; [[The pointer to a Evas_Coord to be filled in.]] - } - } - @property pointer_canvas_xy { - get { - [[This function returns the current known default pointer coordinates - - This function returns the current known canvas unit - coordinates of the mouse pointer and sets the contents of - the Evas_Coords pointed to by $x and $y to contain these - coordinates. If $e is not a valid canvas the results of - this function are undefined. - ]] - /* FIXME-doc - Example: - @code - extern Evas *evas; - Evas_Coord mouse_x, mouse_y; - - evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y); - printf("Mouse is at canvas position %d, %d\n", mouse_x, mouse_y); - @endcode - */ - } - values { - x: int; [[The pointer to a Evas_Coord to be filled in.]] - y: int; [[The pointer to a Evas_Coord to be filled in.]] - } - } - @property event_down_count { - get { - [[Get the number of mouse or multi presses currently active. - - @since 1.2 - ]] - return: int; [[Mouse or multi presses currently active]] - } - } - @property smart_objects_calculate_count { - get { - [[This gets the internal counter that counts the number of - smart calculations. - - Whenever evas performs smart object calculations on the whole - canvas it increments a counter by 1. This function returns - the value of the smart object calculate counter. - It starts with a value of 0 and will increase (and eventually - wrap around to negative values and so on) by 1 every time - objects are calculated. You can use this counter to ensure - you don't re-do calculations withint the same calculation - generation/run if the calculations maybe cause self-feeding - effects. - - @since 1.1 - ]] - return: int; [[Number of smart calculations]] - } - } - @property focus_state { - get { - [[Get the focus state for the default seat.]] - return: bool; [[$true if focused, $false otherwise]] - } - } - @property seat_focus_state { - [[Get the focus state by a given seat.]] - get {} - keys { - seat: Efl.Input.Device; [[The seat to check the focus state. Use $null for the default seat.]] - } - values { - return: bool; [[$true if the seat has the canvas focus, $false otherwise.]] - } - } - @property changed { - get { - [[Get the changed marker for the canvas. - - @since 1.11 - ]] - return: bool; [[$true if changed, $false otherwise]] - } - } - @property pointer_output_xy_by_device { - [[This function returns the current known pointer coordinates. @since 1.19]] - get {} - keys { - dev: Efl.Input.Device; [[The mouse device.]] - } - values { - x: int; [[The pointer to an integer to be filled in.]] - y: int; [[The pointer to an integer to be filled in.]] - } - } - @property pointer_output_xy { - get { - [[This function returns the current known default pointer coordinates. - - This function returns the current known screen/output - coordinates of the mouse pointer and sets the contents of - the integers pointed to by $x and $y to contain these - coordinates. If $e is not a valid canvas the results of - this function are undefined. - ]] - /* FIXME-doc - Example: - @code - extern Evas *evas; - int mouse_x, mouse_y; - - evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y); - printf("Mouse is at screen position %i, %i\n", mouse_x, mouse_y); - @endcode - */ - } - values { - x: int; [[The pointer to an integer to be filled in.]] - y: int; [[The pointer to an integer to be filled in.]] - } - } - @property object_bottom { - get { - [[Get the lowest (stacked) Evas object on the canvas $e. - - This function will take all populated layers in the canvas - into account, getting the lowest object for the lowest layer, - naturally. - - Warning: This function will skip objects parented by smart - objects, acting only on the ones at the "top level", with - regard to object parenting. - - See also \@ref evas_object_layer_get, \@ref evas_object_layer_set, - \@ref evas_object_below_get, \@ref evas_object_below_set. - ]] - return: Efl.Canvas.Object @warn_unused; [[ - A pointer to the lowest object on it, if any, or $null - otherwise. - ]] - } - } - @property pointer_button_down_mask_by_device { - [[Returns a bitmask with the mouse buttons currently pressed, - set to 1.]] - keys { - dev: Efl.Input.Device; [[The mouse device.]] - } - get {} - values { - mask: uint; [[A bitmask of the currently depressed buttons on the canvas.]] - } - } - @property pointer_button_down_mask { - get { - [[Returns a bitmask with the default mouse buttons currently pressed, - set to 1. - - Calling this function will return a 32-bit integer with the - appropriate bits set to 1, which correspond to a mouse button - being depressed. This limits Evas to a mouse devices with a - maximum of 32 buttons, but that is generally in excess of - any host system's pointing device abilities. - - A canvas by default begins with no mouse buttons being - pressed and only pointer move events can alter that. - - The least significant bit corresponds to the first mouse - button (button 1) and the most significant bit corresponds - to the last mouse button (button 32). - - If $e is not a valid canvas, the return value is undefined. - ]] - /* FIXME-doc - Example: - @code - extern Evas *evas; - unsigned int button_mask; - int i; - - button_mask = evas_pointer_button_down_mask_get(evas); - printf("Buttons currently pressed:\n"); - for (i = 0; i < 32; i++) - { - if ((button_mask & (1u << i)) != 0) printf("Button %i\n", i + 1); - } - @endcode - */ - return: uint @warn_unused; [[A bitmask of the currently depressed buttons on the canvas.]] - } - } - - tree_objects_at_xy_get { - [[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. It will enter the smart objects. - It will not append to the list pass events as hidden objects. - Call eina_list_free on the returned list after usage. - ]] - return: list @warn_unused; [[List of objects]] - params { - @in stop: Efl.Canvas.Object; [[An Evas Object where to stop searching.]] - @in x: int; [[The horizontal coordinate of the position.]] - @in y: int; [[The vertical coordinate of the position.]] - } - } - key_lock_on { - [[Enables or turns on programmatically the lock key with name - $keyname for the default seat. - - The effect will be as if the key was put on its active state - after this call. - - See also @.key_lock_add, @.key_lock_del, @.key_lock_del, - @.key_lock_off, @.seat_key_lock_on, @.seat_key_lock_off. - ]] - params { - @in keyname: string @nonull; [[The name of the lock to enable.]] - } - } - seat_key_lock_on { - [[Enables or turns on programmatically the lock key with name - $keyname for a give seat. - - The effect will be as if the key was put on its active state - after this call. - - See also @.key_lock_add, @.key_lock_del, @.key_lock_del, - @.key_lock_off, @.key_lock_on, @.seat_key_lock_off. - @since 1.19 - ]] - params { - @in keyname: string @nonull; [[The name of the lock to enable.]] - @in seat: Efl.Input.Device; [[The seat to enable the keylock. A $null seat repesents the default seat.]] - } - } - seat_key_lock_off { - [[Disables or turns off programmatically the lock key with name - $keyname for a given seat. - - The effect will be as if the key was put on its inactive state - after this call. - - See also @.key_lock_on, @.seat_key_lock_on, @.key_lock_off. - @since 1.19 - ]] - params { - @in keyname: string @nonull; [[The name of the lock to enable.]] - @in seat: Efl.Input.Device; [[The seat to disable the keylock. A $null seat repesents the default seat.]] - } - } - key_modifier_add { - [[Adds the $keyname key to the current list of modifier keys. - - Modifiers are keys like shift, alt and ctrl, i.e. keys which - are meant to be pressed together with others, altering the - behavior of the second keys pressed. Evas is so that - these keys can be user defined. - - This call allows custom modifiers to be added to the Evas system - at run time. It is then possible to set and unset modifier keys - programmatically for other parts of the program to check and act - on. Programmers using Evas would check for modifier keys on key - event callbacks using \@ref evas_key_modifier_is_set. - - Note: If the programmer instantiates the canvas by means of the - \@ref ecore_evas_new family of helper functions, Ecore will take - care of registering on it all standard modifiers: "Shift", - "Control", "Alt", "Meta", "Hyper", "Super". - ]] - params { - @in keyname: string @nonull; [[ - The name of the modifier key to add to the list of - Evas modifiers. - ]] - } - } - key_modifier_off { - [[Disables or turns off programmatically the modifier key with - name $keyname for the default seat. - - See also @.key_modifier_add, \@ref evas_key_modifier_get, - @.key_modifier_on, @.seat_key_modifier_off, - @.seat_key_modifier_off, \@ref evas_key_modifier_is_set, \@ref evas_seat_key_modifier_is_set. - ]] - params { - @in keyname: string @nonull; [[The name of the modifier to disable.]] - } - } - render_async { - [[Render the given Evas canvas asynchronously. - - This function only returns $true when a frame will be rendered. - If the previous frame is still rendering, $false will be - returned so the users know not to wait for the updates - callback and just return to their main loop. - - If a $func callback is given, a list of updated areas will be - generated and the function will be called from the main thread - after the rendered frame is flushed to the screen. The resulting - list should be freed with \@ref evas_render_updates_free. - - The list is given in the $event_info parameter of the callback - function. - - @since 1.8 - ]] - return: bool; [[$true if the canvas will render, $false otherwise.]] - } - focus_out { - [[Inform the evas that it lost the focus from the default seat.]] - } - norender { - [[Update the canvas internal objects but not triggering immediate - renderization. - - This function updates the canvas internal objects not triggering - renderization. To force renderization function @.render - should be used. - ]] - } - nochange_pop { - [[Pop the nochange flag down 1. - - This tells evas, that while the nochange flag is greater than 0, - do not mark objects as "changed" when making changes. - - Warning: Do not use this function unless you know what Evas - exactly works with "changed" state. - ]] - } - key_lock_off { - [[Disables or turns off programmatically the lock key with name - $keyname for the default seat. - - The effect will be as if the key was put on its inactive state - after this call. - - See also @.key_lock_on, @.seat_key_lock_on, @.seat_key_lock_off. - ]] - params { - @in keyname: string @nonull; [[The name of the lock to disable.]] - } - } - nochange_push { - [[Push the nochange flag up 1 - - This tells evas, that while the nochange flag is greater than 0, - do not mark objects as "changed" when making changes. - - Warning: Do not use this function unless you know what Evas - exactly works with "changed" state. - ]] - } - font_cache_flush { - [[Force the given evas and associated engine to flush its font cache.]] - - } - key_modifier_on { - [[Enables or turns on programmatically the modifier key with name - $keyname for the default seat. - - The effect will be as if the key was pressed for the whole time - between this call and a matching evas_key_modifier_off(). - - See also @.key_modifier_off, @.seat_key_modifier_on, - @.seat_key_modifier_off. - ]] - params { - @in keyname: string @nonull; [[The name of the modifier to enable.]] - } - } - seat_key_modifier_on { - [[Enables or turns on programmatically the modifier key with name - $keyname for a given seat. - - The effect will be as if the key was pressed for the whole time - between this call and a matching @.seat_key_modifier_off. - - See also @.key_modifier_off, @.seat_key_modifier_on, - @.seat_key_modifier_off. - @since 1.19 - ]] - params { - @in keyname: string @nonull; [[The name of the lock to enable.]] - @in seat: Efl.Input.Device; [[The seat to enable the modifier. A $null seat repesents the default seat.]] - } - } - seat_key_modifier_off { - [[Disables or turns off programmatically the modifier key with - name $keyname for a given seat. - - See also @.key_modifier_add, \@ref evas_key_modifier_get, - @.key_modifier_on, @.seat_key_modifier_off, - @.seat_key_modifier_off, \@ref evas_key_modifier_is_set, \@ref evas_seat_key_modifier_is_set. - @since 1.19 - ]] - params { - @in keyname: string @nonull; [[The name of the lock to enable.]] - @in seat: Efl.Input.Device; [[The seat to disable the modifier. A $null seat repesents the default seat.]] - } - } - font_available_list @const { - [[List of available font descriptions known or found by this evas. - - The list depends on Evas compile time configuration, such as - fontconfig support, and the paths provided at runtime as - explained in \@ref Evas_Font_Path_Group. - ]] - return: list @warn_unused; [[ - A newly allocated list of strings. Do not change the - strings. Be sure to call \@ref evas_font_available_list_free - after you're done. - ]] - } - object_name_find @const { - [[Retrieves the object on the given evas with the given name. - - This looks for the evas object given a name by - \@ref evas_object_name_set. If the name is not unique - canvas-wide, then which one of the many objects with that - name is returned is undefined, so only use this if you can - ensure the object name is unique. - ]] - return: Efl.Canvas.Object @warn_unused; [[ - If successful, the Evas object with the given name. Otherwise, - $null. - ]] - params { - @in name: string; [[The given name.]] - } - } - font_path_append { - [[Appends a font path to the list of font paths used by the - given evas. - ]] - params { - @in path: string @nonull; [[The new font path.]] - } - } - font_path_clear { - [[Removes all font paths loaded into memory for the given evas.]] - } - /* 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. - - Touch point's coordinates is updated whenever moving that point - on the canvas. - ]] - params { - @in n: uint; [[The number of the touched point (0 being the first).]] - @out x: double; [[Last known X position in window coordinates]] - @out y: double; [[Last known Y position in window coordinates]] - } - /* Legacy uses int. */ - legacy: null; - } - key_lock_del { - [[Removes the $keyname key from the current list of lock keys on - canvas $e. - ]] - params { - @in keyname: string @nonull; [[The name of the key to remove from the locks list.]] - } - } - damage_rectangle_add { - [[Add a damage rectangle. - - This is the function by which one tells evas that a part of the - canvas has to be repainted. - - Note: All newly created Evas rectangles get the default color - values of 255 255 255 255 (opaque white). - ]] - params { - @in x: int; [[The rectangle's left position.]] - @in y: int; [[The rectangle's top position.]] - @in w: int; [[The rectangle's width.]] - @in h: int; [[The rectangle's height.]] - } - } - sync { - [[Sync evas canvas]] - } - font_path_list @const { - [[Retrieves the list of font paths used by the given evas.]] - return: const(list) @warn_unused; [[The list of font paths used.]] - } - image_cache_reload { - [[Reload the image cache. - - This function reloads the image cache of canvas. - ]] - - } - coord_world_x_to_screen @const { - [[Convert/scale a canvas coordinate into output screen - coordinates. - - This function takes in a horizontal coordinate as the $x - parameter and converts it into output units, accounting for - output size, viewport size and location, returning it as the - function return value. If $e is invalid, the results are - undefined. - ]] - /* FIXME-doc - Example: - @code - extern Evas *evas; - int screen_x; - extern Evas_Coord canvas_x; - - screen_x = evas_coord_world_x_to_screen(evas, canvas_x); - @endcode - */ - return: int @warn_unused; [[The output/screen coordinate translated to output coordinates.]] - params { - @in x: int; [[The canvas X coordinate.]] - } - } - render_updates { - [[Force immediate renderization of the given Evas canvas. - - This function forces an immediate renderization update of - the given canvas $e. - - Note: This is a very low level function, which most of Evas' - users wouldn't care about. You might use it, for instance, to - grab an Evas' canvas update regions and paint them back, using - the canvas' pixmap, on a displaying system working below Evas. - - Note: Evas is a stateful canvas. If no operations changing its - state took place since the last rendering action, you won't see - any changes and this call will be a no-op. - ]] - /* FIXME-doc - Example code follows. - @dontinclude evas-events.c - @skip add an obscured - @until d.obscured = !d.obscured; - - See the full @ref Example_Evas_Events "example". - */ - return: list @owned @warn_unused; [[ - A newly allocated list of updated rectangles of the canvas - (@Eina.Rect structs). Free this list with - \@ref evas_render_updates_free. - ]] - } - image_cache_flush { - [[Flush the image cache of the canvas. - - This function flushes image cache of canvas. - ]] - } - coord_screen_y_to_world @const { - [[Convert/scale an output screen coordinate into canvas - coordinates. - - This function takes in a vertical coordinate as the $y parameter - and converts it into canvas units, accounting for output size, - viewport size and location, returning it as the function return - value. If $e is invalid, the results are undefined. - ]] - /* FIXME-doc - Example: - @code - extern Evas *evas; - extern int screen_y; - Evas_Coord canvas_y; - - canvas_y = evas_coord_screen_y_to_world(evas, screen_y); - @endcode - */ - return: int @warn_unused; [[The screen coordinate translated to canvas unit coordinates.]] - params { - @in y: int; [[The screen/output y coordinate.]] - } - } - key_modifier_del { - [[Removes the $keyname key from the current list of modifier keys - on canvas $e. - - See also @.key_modifier_add. - ]] - params { - @in keyname: string @nonull; [[The name of the key to remove from the modifiers list.]] - } - } - focus_in { - [[Inform to the evas that it got the focus from the default seat.]] - } - seat_focus_in { - [[Inform to the evas that it got the focus from a given seat. @since 1.19]] - legacy: null; - params { - @in seat: Efl.Input.Device; [[The seat or $null for the default seat.]] - } - } - seat_focus_out { - [[Inform to the evas that it lost the focus from a given seat. @since 1.19]] - legacy: null; - params { - @in seat: Efl.Input.Device; [[The seat or $null for the default seat.]] - } - } - obscured_rectangle_add { - [[Add an "obscured region" to an Evas canvas. - - This is the function by which one tells an Evas canvas that a - part of it must not be repainted. The region must be rectangular - and its coordinates inside the canvas viewport are passed in the - call. After this call, the region specified won't participate - in any form in Evas' calculations and actions during its - rendering updates, having its displaying content frozen as - it was just after this function took place. - - We call it "obscured region" because the most common use case - for this rendering (partial) freeze is something else (most - probably other canvas) being on top of the specified rectangular - region, thus shading it completely from the user's final scene - in a display. To avoid unnecessary processing, one should - indicate to the obscured canvas not to bother about the - non-important area. - - The majority of users won't have to worry about this function, - as they'll be using just one canvas in their applications, with - nothing inset or on top of it in any form. - - To make this region one that has to be repainted again, call the - function \@ref evas_obscured_clear. - - Note: This is a very low level function, which most of - Evas' users wouldn't care about. - - Note: This function does not flag the canvas as having its state - changed. If you want to re-render it afterwards expecting new - contents, you have to add "damage" regions yourself (see - \@ref evas_damage_rectangle_add). - ]] - /* FIXME-doc - Example code follows. - @dontinclude evas-events.c - @skip add an obscured - @until evas_obscured_clear(evas); - - In that example, pressing the "Ctrl" and "o" keys will impose or - remove an obscured region in the middle of the canvas. You'll get - the same contents at the time the key was pressed, if toggling it - on, until you toggle it off again (make sure the animation is - running on to get the idea better). See the full @ref - Example_Evas_Events "example". - */ - params { - @in x: int; [[The rectangle's top left corner's horizontal coordinate.]] - @in y: int; [[The rectangle's top left corner's vertical coordinate.]] - @in w: int; [[The rectangle's width.]] - @in h: int; [[The rectangle's height.]] - } - } - render_dump { - [[Make the canvas discard as much data as possible used by the - engine at runtime. - - This function will unload images, delete textures and much more - where possible. You may also want to call @.render_idle_flush - immediately prior to this to perhaps discard a little more, - though this function should implicitly delete most of what - @.render_idle_flush might discard too. - ]] - } - render { - [[Force renderization of the given canvas.]] - - } - font_path_prepend { - [[Prepends a font path to the list of font paths used by the - given evas. - ]] - params { - @in path: string @nonull; [[The new font path.]] - } - } - obscured_clear { - [[Remove all "obscured regions" from an Evas canvas. - - This function removes all the rectangles from the obscured - regions list of the canvas $e. It takes obscured areas added - with @.obscured_rectangle_add and make them again a regions - that have to be repainted on rendering updates. - - Note: This is a very low level function, which most of - Evas' users wouldn't care about. - - Note: This function does not flag the canvas as having its state - changed. If you want to re-render it afterwards expecting new - contents, you have to add "damage" regions yourself (see - @.damage_rectangle_add). - ]] - } - coord_screen_x_to_world @const { - [[Convert/scale an output screen coordinate into canvas - coordinates. - - This function takes in a horizontal coordinate as the $x - parameter and converts it into canvas units, accounting for - output size, viewport size and location, returning it as the - function return value. If $e is invalid, the results are - undefined. - ]] - /* FIXME-doc - Example: - @code - extern Evas *evas; - extern int screen_x; - Evas_Coord canvas_x; - - canvas_x = evas_coord_screen_x_to_world(evas, screen_x); - @endcode - */ - return: int @warn_unused; [[ - The screen coordinate translated to canvas unit coordinates. - ]] - params { - @in x: int; [[The screen/output x coordinate.]] - } - } - key_lock_add { - [[Adds the $keyname key to the current list of lock keys. - - Locks are keys like caps lock, num lock or scroll lock, i.e., - keys which are meant to be pressed once -- toggling a binary - state which is bound to it -- and thus altering the behavior - of all subsequently pressed keys somehow, depending on its - state. Evas is so that these keys can be defined by the user. - - This allows custom locks to be added to the evas system at run - time. It is then possible to set and unset lock keys - programmatically for other parts of the program to check and act - on. Programmers using Evas would check for lock keys on key - event callbacks using \@ref evas_key_lock_is_set. - - Note: If the programmer instantiates the canvas by means of the - ecore_evas_new() family of helper functions, Ecore will take - care of registering on it all standard lock keys: "Caps_Lock", - "Num_Lock", "Scroll_Lock". - ]] - params { - @in keyname: string @nonull; [[The name of the key to add to the locks list.]] - } - } - render_idle_flush { - [[Make the canvas discard internally cached data used for - rendering. - - This function flushes the arrays of delete, active and render - objects. Other things it may also discard are: shared memory - segments, temporary scratch buffers, cached data to avoid - re-compute of that data etc. - ]] - } - @property default_device { - [[Return the default device of a given type. - - Note: Currently EFL only creates a seat, mouse and keyboard. - @since 1.19 - ]] - get {} - keys { - 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.]] - } - } - coord_world_y_to_screen @const { - [[Convert/scale a canvas coordinate into output screen - coordinates. - - This function takes in a vertical coordinate as the $x - parameter and converts it into output units, accounting for - output size, viewport size and location, returning it as the - function return value. If $e is invalid, the results are - undefined. - ]] - /* FIXME-doc - Example: - @code - extern Evas *evas; - int screen_y; - extern Evas_Coord canvas_y; - - screen_y = evas_coord_world_y_to_screen(evas, canvas_y); - @endcode - */ - return: int @warn_unused; [[The output/screen coordinate translated to output coordinates.]] - params { - @in y: int; [[The canvas y coordinate.]] - } - } - } - 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.Canvas.seats; - Efl.Canvas.Pointer.pointer_inside { 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_camera.eo b/src/lib/evas/canvas/evas_canvas3d_camera.eo index 6ad777b0a6..9cd98007f2 100644 --- a/src/lib/evas/canvas/evas_canvas3d_camera.eo +++ b/src/lib/evas/canvas/evas_canvas3d_camera.eo @@ -1,6 +1,6 @@ import evas_canvas3d_types; -class Evas.Canvas3D.Camera extends Evas.Canvas3D.Object +class @beta Evas.Canvas3D.Camera extends Evas.Canvas3D.Object { [[Evas 3D canvas camera class]] data: Evas_Canvas3D_Camera_Data; @@ -82,6 +82,8 @@ class Evas.Canvas3D.Camera extends Evas.Canvas3D.Object Efl.Object.destructor; Evas.Canvas3D.Object.update_notify; Evas.Canvas3D.Object.change_notify; + @empty Evas.Canvas3D.Object.callback_register; + @empty Evas.Canvas3D.Object.callback_unregister; } } diff --git a/src/lib/evas/canvas/evas_canvas3d_light.eo b/src/lib/evas/canvas/evas_canvas3d_light.eo index 23525fdc84..daadf8fea5 100644 --- a/src/lib/evas/canvas/evas_canvas3d_light.eo +++ b/src/lib/evas/canvas/evas_canvas3d_light.eo @@ -1,6 +1,6 @@ import evas_canvas3d_types; -class Evas.Canvas3D.Light extends Evas.Canvas3D.Object +class @beta Evas.Canvas3D.Light extends Evas.Canvas3D.Object { [[Evas 3D canvas light class]] @@ -254,6 +254,8 @@ class Evas.Canvas3D.Light extends Evas.Canvas3D.Object Efl.Object.destructor; Evas.Canvas3D.Object.update_notify; Evas.Canvas3D.Object.change_notify; + @empty Evas.Canvas3D.Object.callback_register; + @empty Evas.Canvas3D.Object.callback_unregister; } } diff --git a/src/lib/evas/canvas/evas_canvas3d_material.eo b/src/lib/evas/canvas/evas_canvas3d_material.eo index 9d377f324b..864d5a58db 100644 --- a/src/lib/evas/canvas/evas_canvas3d_material.eo +++ b/src/lib/evas/canvas/evas_canvas3d_material.eo @@ -1,4 +1,4 @@ -class Evas.Canvas3D.Material extends Evas.Canvas3D.Object +class @beta Evas.Canvas3D.Material extends Evas.Canvas3D.Object { [[Evas 3D canvas material class]] data: Evas_Canvas3D_Material_Data; @@ -121,6 +121,8 @@ class Evas.Canvas3D.Material extends Evas.Canvas3D.Object Efl.Object.destructor; Evas.Canvas3D.Object.update_notify; Evas.Canvas3D.Object.change_notify; + @empty Evas.Canvas3D.Object.callback_register; + @empty Evas.Canvas3D.Object.callback_unregister; } } diff --git a/src/lib/evas/canvas/evas_canvas3d_mesh.c b/src/lib/evas/canvas/evas_canvas3d_mesh.c index 5f3d6a0d9a..bdf50e0d89 100644 --- a/src/lib/evas/canvas/evas_canvas3d_mesh.c +++ b/src/lib/evas/canvas/evas_canvas3d_mesh.c @@ -861,42 +861,33 @@ _evas_canvas3d_mesh_alpha_test_enable_get(const Eo *obj EINA_UNUSED, Evas_Canvas return pd->alpha_test_enabled; } -EOLIAN static Eina_Bool -_evas_canvas3d_mesh_efl_file_mmap_set(Eo *obj, - Evas_Canvas3D_Mesh_Data *pd, - const Eina_File *f, const char *key EINA_UNUSED) +EOLIAN static Eina_Error +_evas_canvas3d_mesh_efl_file_load(Eo *obj, Evas_Canvas3D_Mesh_Data *pd) { + const Eina_File *f; + Eina_Error err; + + if (efl_file_loaded_get(obj)) return 0; + + err = efl_file_load(efl_super(obj, MY_CLASS)); + if (err) return err; + _mesh_fini(pd); _mesh_init(pd); - if (f == NULL) return EINA_FALSE; + f = efl_file_mmap_get(obj); + if (f == NULL) return EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST; evas_common_load_model_from_eina_file(obj, f); - return EINA_TRUE; -} - -/* FIXME: Imelemnt mmap_get and file_get. */ - -EOLIAN static Eina_Bool -_evas_canvas3d_mesh_efl_file_file_set(Eo *obj, Evas_Canvas3D_Mesh_Data *pd, - const char *file, - const char *key EINA_UNUSED) -{ - _mesh_fini(pd); - _mesh_init(pd); - - if (file == NULL) return EINA_FALSE; - - evas_common_load_model_from_file(obj, file); - return EINA_TRUE; + return 0; } EOLIAN static Eina_Bool -_evas_canvas3d_mesh_efl_file_save(const Eo *obj, Evas_Canvas3D_Mesh_Data *pd, +_evas_canvas3d_mesh_efl_file_save_save(const Eo *obj, Evas_Canvas3D_Mesh_Data *pd, const char *file, const char *key EINA_UNUSED, - const char *flags EINA_UNUSED) + const Efl_File_Save_Info *info EINA_UNUSED) { if ((file == NULL) || (obj == NULL) || (pd == NULL)) return EINA_FALSE; diff --git a/src/lib/evas/canvas/evas_canvas3d_mesh.eo b/src/lib/evas/canvas/evas_canvas3d_mesh.eo index c1b02b2f9c..f30037db91 100644 --- a/src/lib/evas/canvas/evas_canvas3d_mesh.eo +++ b/src/lib/evas/canvas/evas_canvas3d_mesh.eo @@ -2,7 +2,7 @@ import evas_canvas3d_types; struct @extern Eina.Inarray; [[Eina inarray data structure]] -class Evas.Canvas3D.Mesh extends Evas.Canvas3D.Object implements Efl.File +class @beta Evas.Canvas3D.Mesh extends Evas.Canvas3D.Object implements Efl.File, Efl.File_Save { [[Evas 3D canvas mesh class]] data: Evas_Canvas3D_Mesh_Data; @@ -426,9 +426,10 @@ class Evas.Canvas3D.Mesh extends Evas.Canvas3D.Object implements Efl.File Efl.Object.destructor; Evas.Canvas3D.Object.update_notify; Evas.Canvas3D.Object.change_notify; - Efl.File.file { set; } - Efl.File.mmap { set; } - Efl.File.save; + Efl.File.load; + Efl.File_Save.save; + @empty Evas.Canvas3D.Object.callback_register; + @empty Evas.Canvas3D.Object.callback_unregister; } } diff --git a/src/lib/evas/canvas/evas_canvas3d_node.c b/src/lib/evas/canvas/evas_canvas3d_node.c index f80395f362..98492fa502 100644 --- a/src/lib/evas/canvas/evas_canvas3d_node.c +++ b/src/lib/evas/canvas/evas_canvas3d_node.c @@ -1,3 +1,4 @@ +#include "eo_internal.h" #include "evas_common_private.h" #include "evas_private.h" #include "evas_canvas3d_node_callback.h" @@ -1047,6 +1048,7 @@ _evas_canvas3d_node_efl_object_finalize(Eo *obj, Evas_Canvas3D_Node_Data *pd) EOLIAN static Efl_Object * _evas_canvas3d_node_efl_object_constructor(Eo *obj, Evas_Canvas3D_Node_Data *pd) { + efl_constructor(efl_super(obj, MY_CLASS)); evas_canvas3d_object_type_set(obj, EVAS_CANVAS3D_OBJECT_TYPE_NODE); eina_vector3_set(&pd->position, 0.0, 0.0, 0.0); diff --git a/src/lib/evas/canvas/evas_canvas3d_node.eo b/src/lib/evas/canvas/evas_canvas3d_node.eo index 31400b9bad..ec9891cdb6 100644 --- a/src/lib/evas/canvas/evas_canvas3d_node.eo +++ b/src/lib/evas/canvas/evas_canvas3d_node.eo @@ -1,6 +1,6 @@ import evas_canvas3d_types; -class Evas.Canvas3D.Node extends Evas.Canvas3D.Object +class @beta Evas.Canvas3D.Node extends Evas.Canvas3D.Object { [[Evas 3D canvas node class]] data: Evas_Canvas3D_Node_Data; diff --git a/src/lib/evas/canvas/evas_canvas3d_object.eo b/src/lib/evas/canvas/evas_canvas3d_object.eo index 987b8405d5..c058cda77f 100644 --- a/src/lib/evas/canvas/evas_canvas3d_object.eo +++ b/src/lib/evas/canvas/evas_canvas3d_object.eo @@ -1,6 +1,6 @@ import evas_canvas3d_types; -abstract Evas.Canvas3D.Object extends Efl.Object +abstract @beta Evas.Canvas3D.Object extends Efl.Object { [[Evas 3D canvas object class]] data: Evas_Canvas3D_Object_Data; diff --git a/src/lib/evas/canvas/evas_canvas3d_primitive.eo b/src/lib/evas/canvas/evas_canvas3d_primitive.eo index b3c4c5a24b..c1e3fd703e 100644 --- a/src/lib/evas/canvas/evas_canvas3d_primitive.eo +++ b/src/lib/evas/canvas/evas_canvas3d_primitive.eo @@ -1,6 +1,6 @@ import evas_canvas3d_types; -class Evas.Canvas3D.Primitive extends Evas.Canvas3D.Object +class @beta Evas.Canvas3D.Primitive extends Evas.Canvas3D.Object { [[Evas 3D canvas primitive class]] data: Evas_Canvas3D_Primitive_Data; @@ -137,5 +137,9 @@ class Evas.Canvas3D.Primitive extends Evas.Canvas3D.Object implements { Efl.Object.constructor; Efl.Object.destructor; + @empty Evas.Canvas3D.Object.update_notify; + @empty Evas.Canvas3D.Object.change_notify; + @empty Evas.Canvas3D.Object.callback_register; + @empty Evas.Canvas3D.Object.callback_unregister; } } diff --git a/src/lib/evas/canvas/evas_canvas3d_scene.c b/src/lib/evas/canvas/evas_canvas3d_scene.c index a11848326b..725996ee96 100644 --- a/src/lib/evas/canvas/evas_canvas3d_scene.c +++ b/src/lib/evas/canvas/evas_canvas3d_scene.c @@ -1,3 +1,4 @@ +#include "eo_internal.h" #include "evas_common_private.h" #include "evas_private.h" diff --git a/src/lib/evas/canvas/evas_canvas3d_scene.eo b/src/lib/evas/canvas/evas_canvas3d_scene.eo index 0ded4aa830..6187228157 100644 --- a/src/lib/evas/canvas/evas_canvas3d_scene.eo +++ b/src/lib/evas/canvas/evas_canvas3d_scene.eo @@ -1,6 +1,6 @@ import evas_canvas3d_types; -class Evas.Canvas3D.Scene extends Evas.Canvas3D.Object +class @beta Evas.Canvas3D.Scene extends Evas.Canvas3D.Object { [[Efl 3D canvas scene class]] data: Evas_Canvas3D_Scene_Data; @@ -165,5 +165,7 @@ class Evas.Canvas3D.Scene extends Evas.Canvas3D.Object Efl.Object.constructor; Evas.Canvas3D.Object.update_notify; Evas.Canvas3D.Object.change_notify; + @empty Evas.Canvas3D.Object.callback_register; + @empty Evas.Canvas3D.Object.callback_unregister; } } diff --git a/src/lib/evas/canvas/evas_canvas3d_texture.c b/src/lib/evas/canvas/evas_canvas3d_texture.c index 540f6c6b39..5533e18373 100644 --- a/src/lib/evas/canvas/evas_canvas3d_texture.c +++ b/src/lib/evas/canvas/evas_canvas3d_texture.c @@ -372,25 +372,27 @@ _evas_canvas3d_texture_data_set(Eo *obj, Evas_Canvas3D_Texture_Data *pd, evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_TEXTURE_DATA, NULL); } -EOLIAN static void -_evas_canvas3d_texture_efl_file_mmap_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Texture_Data *pd, const Eina_File **f, const char **key) +EOLIAN static Eina_Error +_evas_canvas3d_texture_efl_file_load(Eo *obj, Evas_Canvas3D_Texture_Data *pd) { - if (f) *f = pd->f; - if (key) *key = pd->key; -} - -EOLIAN static Eina_Bool -_evas_canvas3d_texture_efl_file_mmap_set(Eo *obj, Evas_Canvas3D_Texture_Data *pd, const Eina_File *f, const char *key) -{ - Evas_Image_Load_Opts lo; int load_error; Eo *evas = NULL; void *image; + const Eina_File *f; + const char *key; + + if (efl_file_loaded_get(obj)) return 0; evas = evas_object_evas_get(obj); Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS); + Eina_Error err = efl_file_load(efl_super(obj, MY_CLASS)); + if (err) return err; + + f = efl_file_mmap_get(obj); + key = efl_file_key_get(obj); + if (!pd->engine_data && e->engine.func->texture_new) pd->engine_data = e->engine.func->texture_new(_evas_engine_context(e), pd->atlas_enable); diff --git a/src/lib/evas/canvas/evas_canvas3d_texture.eo b/src/lib/evas/canvas/evas_canvas3d_texture.eo index 0b22e86d1e..8aed88670b 100644 --- a/src/lib/evas/canvas/evas_canvas3d_texture.eo +++ b/src/lib/evas/canvas/evas_canvas3d_texture.eo @@ -1,6 +1,6 @@ type @extern Evas_Colorspace: int; [[Evas colorspace type]] /* FIXME: Need to get emile migrated. */ -class Evas.Canvas3D.Texture extends Evas.Canvas3D.Object implements Efl.File +class @beta Evas.Canvas3D.Texture extends Evas.Canvas3D.Object implements Efl.File { [[Evas 3d canvas texture class]] data : Evas_Canvas3D_Texture_Data; @@ -155,6 +155,8 @@ class Evas.Canvas3D.Texture extends Evas.Canvas3D.Object implements Efl.File Efl.Object.destructor; Evas.Canvas3D.Object.update_notify; Evas.Canvas3D.Object.change_notify; - Efl.File.mmap { set; get; } + Efl.File.load; + @empty Evas.Canvas3D.Object.callback_register; + @empty Evas.Canvas3D.Object.callback_unregister; } } diff --git a/src/lib/evas/canvas/evas_canvas3d_types.eot b/src/lib/evas/canvas/evas_canvas3d_types.eot index a050af3be9..81e3030e19 100644 --- a/src/lib/evas/canvas/evas_canvas3d_types.eot +++ b/src/lib/evas/canvas/evas_canvas3d_types.eot @@ -1,9 +1,9 @@ // ---------------------------------------------------------------------------- // All the below types are for Evas 3D -type Evas.Real: double; [[A type for floating value]] +type @beta Evas.Real: double; [[A type for floating value]] -enum Evas.Canvas3D.Object_Type +enum @beta Evas.Canvas3D.Object_Type { [[Type of 3D Object @@ -21,7 +21,7 @@ enum Evas.Canvas3D.Object_Type @since 1.15]] } -enum Evas.Canvas3D.State +enum @beta Evas.Canvas3D.State { [[State of the Evas 3D @@ -94,7 +94,7 @@ enum Evas.Canvas3D.State @since 1.18]] } -enum Evas.Canvas3D.Space +enum @beta Evas.Canvas3D.Space { [[Transform space @@ -104,7 +104,7 @@ enum Evas.Canvas3D.Space world [[World coordinate space]] } -enum Evas.Canvas3D.Node_Type +enum @beta Evas.Canvas3D.Node_Type { [[Types of a node @@ -116,7 +116,7 @@ enum Evas.Canvas3D.Node_Type mesh [[Node which can contain mesh objects]] } -enum Evas.Canvas3D.Node_Orientation_Type +enum @beta Evas.Canvas3D.Node_Orientation_Type { [[Types of node orientation @@ -128,7 +128,7 @@ enum Evas.Canvas3D.Node_Orientation_Type quaternion [[Node orientation is given as a quaternion]] } -enum Evas.Canvas3D.Index_Format +enum @beta Evas.Canvas3D.Index_Format { [[Index formats @@ -138,7 +138,7 @@ enum Evas.Canvas3D.Index_Format unsigned_short [[Index is of type unsigned short]] } -enum Evas.Canvas3D.Frustum_Mode +enum @beta Evas.Canvas3D.Frustum_Mode { [[Frustum modes @@ -148,7 +148,7 @@ enum Evas.Canvas3D.Frustum_Mode central_point [[Central point]] } -enum Evas.Canvas3D.Vertex_Assembly +enum @beta Evas.Canvas3D.Vertex_Assembly { [[Vertex assembly modes. Vertex assembly represents how the vertices are organized into geometric primitives. @@ -162,7 +162,7 @@ enum Evas.Canvas3D.Vertex_Assembly triangle_fan [[Vertices are organized as a triangle fan]] } -enum Evas.Canvas3D.Comparison +enum @beta Evas.Canvas3D.Comparison { [[Comparsion functions for testing(alpha, depth, stencil) in fragment shader @@ -177,7 +177,7 @@ enum Evas.Canvas3D.Comparison always [[Always passes (initial value)]] } -enum Evas.Canvas3D.Wrap_Mode +enum @beta Evas.Canvas3D.Wrap_Mode { [[Wrap modes for texture units @@ -187,7 +187,7 @@ enum Evas.Canvas3D.Wrap_Mode reflect [[Values will be repeated in a reflected manner]] } -enum Evas.Canvas3D.Texture_Filter +enum @beta Evas.Canvas3D.Texture_Filter { [[Filters for texture units @@ -200,7 +200,7 @@ enum Evas.Canvas3D.Texture_Filter linear_mipmap_linear [[Linear sampling in mipmap and interpolate]] } -enum Evas.Canvas3D.Mesh_Primitive +enum @beta Evas.Canvas3D.Mesh_Primitive { [[Mesh primitive @@ -217,7 +217,7 @@ enum Evas.Canvas3D.Mesh_Primitive count [[Sentinel value to indicate last enum field during iteration]] } -enum Evas.Canvas3D.Primitive_Mode +enum @beta Evas.Canvas3D.Primitive_Mode { [[Mode of mesh primitive @@ -227,7 +227,7 @@ enum Evas.Canvas3D.Primitive_Mode alternative_uv [[Ptimitive with alternative uv (supported for sphere)]] } -enum Evas.Canvas3D.Shader_Mode +enum @beta Evas.Canvas3D.Shader_Mode { [[Shader shade modes @@ -243,7 +243,7 @@ enum Evas.Canvas3D.Shader_Mode post_processing_FXAA [[Render full screen quard]] } -enum Evas.Canvas3D.Vertex_Attrib +enum @beta Evas.Canvas3D.Vertex_Attrib { [[Vertex attribute IDs @@ -255,7 +255,7 @@ enum Evas.Canvas3D.Vertex_Attrib texcoord [[vertex texture coordinate]] } -enum Evas.Canvas3D.Blend_Func +enum @beta Evas.Canvas3D.Blend_Func { [[Blending function @@ -278,7 +278,7 @@ enum Evas.Canvas3D.Blend_Func src_alpha_saturate [[The scale factors for color components is (i, i, i, 1) where i = min(as, ka, ad)/ka]] } -enum Evas.Canvas3D.Material_Attrib +enum @beta Evas.Canvas3D.Material_Attrib { [[Material attributes @@ -290,4 +290,4 @@ enum Evas.Canvas3D.Material_Attrib normal [[Normal map term]] } -type Evas.Canvas3D.Surface_Func: __undefined_type; [[Evas 3D canvas surface function type]] +type @beta Evas.Canvas3D.Surface_Func: __undefined_type; [[Evas 3D canvas surface function type]] diff --git a/src/lib/evas/canvas/evas_canvas_eo.c b/src/lib/evas/canvas/evas_canvas_eo.c new file mode 100644 index 0000000000..2f618ce37c --- /dev/null +++ b/src/lib/evas/canvas/evas_canvas_eo.c @@ -0,0 +1,501 @@ + +void _evas_canvas_image_cache_set(Eo *obj, Evas_Public_Data *pd, int size); + + +static Eina_Error +__eolian_evas_canvas_image_cache_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + evas_canvas_image_cache_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_image_cache_set, EFL_FUNC_CALL(size), int size); + +int _evas_canvas_image_cache_get(const Eo *obj, Evas_Public_Data *pd); + + +static Eina_Value +__eolian_evas_canvas_image_cache_get_reflect(const Eo *obj) +{ + int val = evas_canvas_image_cache_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(evas_canvas_image_cache_get, int, 0); + +void _evas_canvas_event_default_flags_set(Eo *obj, Evas_Public_Data *pd, Evas_Event_Flags flags); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_event_default_flags_set, EFL_FUNC_CALL(flags), Evas_Event_Flags flags); + +Evas_Event_Flags _evas_canvas_event_default_flags_get(const Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_canvas_event_default_flags_get, Evas_Event_Flags, 0); + +void _evas_canvas_font_cache_set(Eo *obj, Evas_Public_Data *pd, int size); + + +static Eina_Error +__eolian_evas_canvas_font_cache_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + evas_canvas_font_cache_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_font_cache_set, EFL_FUNC_CALL(size), int size); + +int _evas_canvas_font_cache_get(const Eo *obj, Evas_Public_Data *pd); + + +static Eina_Value +__eolian_evas_canvas_font_cache_get_reflect(const Eo *obj) +{ + int val = evas_canvas_font_cache_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(evas_canvas_font_cache_get, int, 0); + +void _evas_canvas_data_attach_set(Eo *obj, Evas_Public_Data *pd, void *data); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_data_attach_set, EFL_FUNC_CALL(data), void *data); + +void *_evas_canvas_data_attach_get(const Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_canvas_data_attach_get, void *, NULL); + +Efl_Canvas_Object *_evas_canvas_focus_get(const Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_canvas_focus_get, Efl_Canvas_Object *, NULL); + +Efl_Canvas_Object *_evas_canvas_seat_focus_get(const Eo *obj, Evas_Public_Data *pd, Evas_Device *seat); + +EOAPI EFL_FUNC_BODYV_CONST(evas_canvas_seat_focus_get, Efl_Canvas_Object *, NULL, EFL_FUNC_CALL(seat), Evas_Device *seat); + +Efl_Canvas_Object *_evas_canvas_object_top_get(const Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_canvas_object_top_get, Efl_Canvas_Object *, NULL); + +void _evas_canvas_pointer_canvas_xy_by_device_get(const Eo *obj, Evas_Public_Data *pd, Evas_Device *dev, int *x, int *y); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_canvas_pointer_canvas_xy_by_device_get, EFL_FUNC_CALL(dev, x, y), Evas_Device *dev, int *x, int *y); + +void _evas_canvas_pointer_canvas_xy_get(const Eo *obj, Evas_Public_Data *pd, int *x, int *y); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_canvas_pointer_canvas_xy_get, EFL_FUNC_CALL(x, y), int *x, int *y); + +int _evas_canvas_event_down_count_get(const Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_canvas_event_down_count_get, int, 0); + +int _evas_canvas_smart_objects_calculate_count_get(const Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_canvas_smart_objects_calculate_count_get, int, 0); + +Eina_Bool _evas_canvas_focus_state_get(const Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_canvas_focus_state_get, Eina_Bool, 0); + +Eina_Bool _evas_canvas_seat_focus_state_get(const Eo *obj, Evas_Public_Data *pd, Evas_Device *seat); + +EOAPI EFL_FUNC_BODYV_CONST(evas_canvas_seat_focus_state_get, Eina_Bool, 0, EFL_FUNC_CALL(seat), Evas_Device *seat); + +Eina_Bool _evas_canvas_changed_get(const Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_canvas_changed_get, Eina_Bool, 0); + +void _evas_canvas_pointer_output_xy_by_device_get(const Eo *obj, Evas_Public_Data *pd, Evas_Device *dev, int *x, int *y); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_canvas_pointer_output_xy_by_device_get, EFL_FUNC_CALL(dev, x, y), Evas_Device *dev, int *x, int *y); + +void _evas_canvas_pointer_output_xy_get(const Eo *obj, Evas_Public_Data *pd, int *x, int *y); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_canvas_pointer_output_xy_get, EFL_FUNC_CALL(x, y), int *x, int *y); + +Efl_Canvas_Object *_evas_canvas_object_bottom_get(const Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_canvas_object_bottom_get, Efl_Canvas_Object *, NULL); + +unsigned int _evas_canvas_pointer_button_down_mask_by_device_get(const Eo *obj, Evas_Public_Data *pd, Evas_Device *dev); + +EOAPI EFL_FUNC_BODYV_CONST(evas_canvas_pointer_button_down_mask_by_device_get, unsigned int, 0, EFL_FUNC_CALL(dev), Evas_Device *dev); + +unsigned int _evas_canvas_pointer_button_down_mask_get(const Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_canvas_pointer_button_down_mask_get, unsigned int, 0); + +Eina_List *_evas_canvas_tree_objects_at_xy_get(Eo *obj, Evas_Public_Data *pd, Efl_Canvas_Object *stop, int x, int y); + +EOAPI EFL_FUNC_BODYV(evas_canvas_tree_objects_at_xy_get, Eina_List *, NULL, EFL_FUNC_CALL(stop, x, y), Efl_Canvas_Object *stop, int x, int y); + +void _evas_canvas_key_lock_on(Eo *obj, Evas_Public_Data *pd, const char *keyname); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_key_lock_on, EFL_FUNC_CALL(keyname), const char *keyname); + +void _evas_canvas_seat_key_lock_on(Eo *obj, Evas_Public_Data *pd, const char *keyname, Evas_Device *seat); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_seat_key_lock_on, EFL_FUNC_CALL(keyname, seat), const char *keyname, Evas_Device *seat); + +void _evas_canvas_seat_key_lock_off(Eo *obj, Evas_Public_Data *pd, const char *keyname, Evas_Device *seat); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_seat_key_lock_off, EFL_FUNC_CALL(keyname, seat), const char *keyname, Evas_Device *seat); + +void _evas_canvas_key_modifier_add(Eo *obj, Evas_Public_Data *pd, const char *keyname); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_key_modifier_add, EFL_FUNC_CALL(keyname), const char *keyname); + +void _evas_canvas_key_modifier_off(Eo *obj, Evas_Public_Data *pd, const char *keyname); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_key_modifier_off, EFL_FUNC_CALL(keyname), const char *keyname); + +Eina_Bool _evas_canvas_render_async(Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_FUNC_BODY(evas_canvas_render_async, Eina_Bool, 0); + +void _evas_canvas_focus_out(Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(evas_canvas_focus_out); + +void _evas_canvas_norender(Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(evas_canvas_norender); + +void _evas_canvas_nochange_pop(Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(evas_canvas_nochange_pop); + +void _evas_canvas_key_lock_off(Eo *obj, Evas_Public_Data *pd, const char *keyname); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_key_lock_off, EFL_FUNC_CALL(keyname), const char *keyname); + +void _evas_canvas_nochange_push(Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(evas_canvas_nochange_push); + +void _evas_canvas_font_cache_flush(Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(evas_canvas_font_cache_flush); + +void _evas_canvas_key_modifier_on(Eo *obj, Evas_Public_Data *pd, const char *keyname); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_key_modifier_on, EFL_FUNC_CALL(keyname), const char *keyname); + +void _evas_canvas_seat_key_modifier_on(Eo *obj, Evas_Public_Data *pd, const char *keyname, Evas_Device *seat); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_seat_key_modifier_on, EFL_FUNC_CALL(keyname, seat), const char *keyname, Evas_Device *seat); + +void _evas_canvas_seat_key_modifier_off(Eo *obj, Evas_Public_Data *pd, const char *keyname, Evas_Device *seat); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_seat_key_modifier_off, EFL_FUNC_CALL(keyname, seat), const char *keyname, Evas_Device *seat); + +Eina_List *_evas_canvas_font_available_list(const Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_canvas_font_available_list, Eina_List *, NULL); + +Efl_Canvas_Object *_evas_canvas_object_name_find(const Eo *obj, Evas_Public_Data *pd, const char *name); + +EOAPI EFL_FUNC_BODYV_CONST(evas_canvas_object_name_find, Efl_Canvas_Object *, NULL, EFL_FUNC_CALL(name), const char *name); + +void _evas_canvas_font_path_append(Eo *obj, Evas_Public_Data *pd, const char *path); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_font_path_append, EFL_FUNC_CALL(path), const char *path); + +void _evas_canvas_font_path_clear(Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(evas_canvas_font_path_clear); + +void _evas_canvas_touch_point_list_nth_xy_get(Eo *obj, Evas_Public_Data *pd, unsigned int n, double *x, double *y); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_touch_point_list_nth_xy_get, EFL_FUNC_CALL(n, x, y), unsigned int n, double *x, double *y); + +void _evas_canvas_key_lock_del(Eo *obj, Evas_Public_Data *pd, const char *keyname); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_key_lock_del, EFL_FUNC_CALL(keyname), const char *keyname); + +void _evas_canvas_damage_rectangle_add(Eo *obj, Evas_Public_Data *pd, int x, int y, int w, int h); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_damage_rectangle_add, EFL_FUNC_CALL(x, y, w, h), int x, int y, int w, int h); + +void _evas_canvas_sync(Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(evas_canvas_sync); + +const Eina_List *_evas_canvas_font_path_list(const Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_canvas_font_path_list, const Eina_List *, NULL); + +void _evas_canvas_image_cache_reload(Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(evas_canvas_image_cache_reload); + +int _evas_canvas_coord_world_x_to_screen(const Eo *obj, Evas_Public_Data *pd, int x); + +EOAPI EFL_FUNC_BODYV_CONST(evas_canvas_coord_world_x_to_screen, int, 0, EFL_FUNC_CALL(x), int x); + +Eina_List *_evas_canvas_render_updates(Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_FUNC_BODY(evas_canvas_render_updates, Eina_List *, NULL); + +void _evas_canvas_image_cache_flush(Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(evas_canvas_image_cache_flush); + +int _evas_canvas_coord_screen_y_to_world(const Eo *obj, Evas_Public_Data *pd, int y); + +EOAPI EFL_FUNC_BODYV_CONST(evas_canvas_coord_screen_y_to_world, int, 0, EFL_FUNC_CALL(y), int y); + +void _evas_canvas_key_modifier_del(Eo *obj, Evas_Public_Data *pd, const char *keyname); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_key_modifier_del, EFL_FUNC_CALL(keyname), const char *keyname); + +void _evas_canvas_focus_in(Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(evas_canvas_focus_in); + +void _evas_canvas_seat_focus_in(Eo *obj, Evas_Public_Data *pd, Evas_Device *seat); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_seat_focus_in, EFL_FUNC_CALL(seat), Evas_Device *seat); + +void _evas_canvas_seat_focus_out(Eo *obj, Evas_Public_Data *pd, Evas_Device *seat); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_seat_focus_out, EFL_FUNC_CALL(seat), Evas_Device *seat); + +void _evas_canvas_obscured_rectangle_add(Eo *obj, Evas_Public_Data *pd, int x, int y, int w, int h); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_obscured_rectangle_add, EFL_FUNC_CALL(x, y, w, h), int x, int y, int w, int h); + +void _evas_canvas_render_dump(Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(evas_canvas_render_dump); + +void _evas_canvas_render(Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(evas_canvas_render); + +void _evas_canvas_font_path_prepend(Eo *obj, Evas_Public_Data *pd, const char *path); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_font_path_prepend, EFL_FUNC_CALL(path), const char *path); + +void _evas_canvas_obscured_clear(Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(evas_canvas_obscured_clear); + +int _evas_canvas_coord_screen_x_to_world(const Eo *obj, Evas_Public_Data *pd, int x); + +EOAPI EFL_FUNC_BODYV_CONST(evas_canvas_coord_screen_x_to_world, int, 0, EFL_FUNC_CALL(x), int x); + +void _evas_canvas_key_lock_add(Eo *obj, Evas_Public_Data *pd, const char *keyname); + +EOAPI EFL_VOID_FUNC_BODYV(evas_canvas_key_lock_add, EFL_FUNC_CALL(keyname), const char *keyname); + +void _evas_canvas_render_idle_flush(Eo *obj, Evas_Public_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(evas_canvas_render_idle_flush); + +Evas_Device *_evas_canvas_default_device_get(const Eo *obj, Evas_Public_Data *pd, Evas_Device_Class type); + +EOAPI EFL_FUNC_BODYV_CONST(evas_canvas_default_device_get, Evas_Device *, NULL, EFL_FUNC_CALL(type), Evas_Device_Class type); + +int _evas_canvas_coord_world_y_to_screen(const Eo *obj, Evas_Public_Data *pd, int y); + +EOAPI EFL_FUNC_BODYV_CONST(evas_canvas_coord_world_y_to_screen, int, 0, EFL_FUNC_CALL(y), int y); + +Efl_Object *_evas_canvas_efl_object_constructor(Eo *obj, Evas_Public_Data *pd); + + +void _evas_canvas_efl_object_destructor(Eo *obj, Evas_Public_Data *pd); + + +void _evas_canvas_efl_object_invalidate(Eo *obj, Evas_Public_Data *pd); + + +void _evas_canvas_efl_object_event_thaw(Eo *obj, Evas_Public_Data *pd); + + +void _evas_canvas_efl_object_event_freeze(Eo *obj, Evas_Public_Data *pd); + + +Efl_Object *_evas_canvas_efl_object_provider_find(const Eo *obj, Evas_Public_Data *pd, const Efl_Class *klass); + + +Efl_Loop *_evas_canvas_efl_loop_consumer_loop_get(const Eo *obj, Evas_Public_Data *pd); + + +Eina_Bool _evas_canvas_efl_canvas_pointer_pointer_inside_get(const Eo *obj, Evas_Public_Data *pd, Evas_Device *seat); + + +Evas_Device *_evas_canvas_efl_canvas_scene_device_get(const Eo *obj, Evas_Public_Data *pd, const char *name); + + +Evas_Device *_evas_canvas_efl_canvas_scene_seat_get(const Eo *obj, Evas_Public_Data *pd, int id); + + +Evas_Device *_evas_canvas_efl_canvas_scene_seat_default_get(const Eo *obj, Evas_Public_Data *pd); + + +Eina_Bool _evas_canvas_efl_canvas_scene_pointer_position_get(const Eo *obj, Evas_Public_Data *pd, Evas_Device *seat, Eina_Position2D *pos); + + +Eina_Bool _evas_canvas_efl_canvas_scene_image_max_size_get(const Eo *obj, Evas_Public_Data *pd, Eina_Size2D *max); + + +Eina_Iterator *_evas_canvas_efl_canvas_scene_objects_at_xy_get(Eo *obj, Evas_Public_Data *pd, Eina_Position2D pos, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects); + + +Efl_Gfx_Entity *_evas_canvas_efl_canvas_scene_object_top_at_xy_get(const Eo *obj, Evas_Public_Data *pd, Eina_Position2D pos, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects); + + +Eina_Iterator *_evas_canvas_efl_canvas_scene_objects_in_rectangle_get(Eo *obj, Evas_Public_Data *pd, Eina_Rect rect, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects); + + +Efl_Gfx_Entity *_evas_canvas_efl_canvas_scene_object_top_in_rectangle_get(const Eo *obj, Evas_Public_Data *pd, Eina_Rect rect, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects); + + +void _evas_canvas_efl_canvas_scene_group_objects_calculate(Eo *obj, Evas_Public_Data *pd); + + +Eina_Bool _evas_canvas_efl_canvas_scene_group_objects_calculating_get(const Eo *obj, Evas_Public_Data *pd); + + +static Eina_Bool +_evas_canvas_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EVAS_CANVAS_EXTRA_OPS +#define EVAS_CANVAS_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(evas_canvas_image_cache_set, _evas_canvas_image_cache_set), + EFL_OBJECT_OP_FUNC(evas_canvas_image_cache_get, _evas_canvas_image_cache_get), + EFL_OBJECT_OP_FUNC(evas_canvas_event_default_flags_set, _evas_canvas_event_default_flags_set), + EFL_OBJECT_OP_FUNC(evas_canvas_event_default_flags_get, _evas_canvas_event_default_flags_get), + EFL_OBJECT_OP_FUNC(evas_canvas_font_cache_set, _evas_canvas_font_cache_set), + EFL_OBJECT_OP_FUNC(evas_canvas_font_cache_get, _evas_canvas_font_cache_get), + EFL_OBJECT_OP_FUNC(evas_canvas_data_attach_set, _evas_canvas_data_attach_set), + EFL_OBJECT_OP_FUNC(evas_canvas_data_attach_get, _evas_canvas_data_attach_get), + EFL_OBJECT_OP_FUNC(evas_canvas_focus_get, _evas_canvas_focus_get), + EFL_OBJECT_OP_FUNC(evas_canvas_seat_focus_get, _evas_canvas_seat_focus_get), + EFL_OBJECT_OP_FUNC(evas_canvas_object_top_get, _evas_canvas_object_top_get), + EFL_OBJECT_OP_FUNC(evas_canvas_pointer_canvas_xy_by_device_get, _evas_canvas_pointer_canvas_xy_by_device_get), + EFL_OBJECT_OP_FUNC(evas_canvas_pointer_canvas_xy_get, _evas_canvas_pointer_canvas_xy_get), + EFL_OBJECT_OP_FUNC(evas_canvas_event_down_count_get, _evas_canvas_event_down_count_get), + EFL_OBJECT_OP_FUNC(evas_canvas_smart_objects_calculate_count_get, _evas_canvas_smart_objects_calculate_count_get), + EFL_OBJECT_OP_FUNC(evas_canvas_focus_state_get, _evas_canvas_focus_state_get), + EFL_OBJECT_OP_FUNC(evas_canvas_seat_focus_state_get, _evas_canvas_seat_focus_state_get), + EFL_OBJECT_OP_FUNC(evas_canvas_changed_get, _evas_canvas_changed_get), + EFL_OBJECT_OP_FUNC(evas_canvas_pointer_output_xy_by_device_get, _evas_canvas_pointer_output_xy_by_device_get), + EFL_OBJECT_OP_FUNC(evas_canvas_pointer_output_xy_get, _evas_canvas_pointer_output_xy_get), + EFL_OBJECT_OP_FUNC(evas_canvas_object_bottom_get, _evas_canvas_object_bottom_get), + EFL_OBJECT_OP_FUNC(evas_canvas_pointer_button_down_mask_by_device_get, _evas_canvas_pointer_button_down_mask_by_device_get), + EFL_OBJECT_OP_FUNC(evas_canvas_pointer_button_down_mask_get, _evas_canvas_pointer_button_down_mask_get), + EFL_OBJECT_OP_FUNC(evas_canvas_tree_objects_at_xy_get, _evas_canvas_tree_objects_at_xy_get), + EFL_OBJECT_OP_FUNC(evas_canvas_key_lock_on, _evas_canvas_key_lock_on), + EFL_OBJECT_OP_FUNC(evas_canvas_seat_key_lock_on, _evas_canvas_seat_key_lock_on), + EFL_OBJECT_OP_FUNC(evas_canvas_seat_key_lock_off, _evas_canvas_seat_key_lock_off), + EFL_OBJECT_OP_FUNC(evas_canvas_key_modifier_add, _evas_canvas_key_modifier_add), + EFL_OBJECT_OP_FUNC(evas_canvas_key_modifier_off, _evas_canvas_key_modifier_off), + EFL_OBJECT_OP_FUNC(evas_canvas_render_async, _evas_canvas_render_async), + EFL_OBJECT_OP_FUNC(evas_canvas_focus_out, _evas_canvas_focus_out), + EFL_OBJECT_OP_FUNC(evas_canvas_norender, _evas_canvas_norender), + EFL_OBJECT_OP_FUNC(evas_canvas_nochange_pop, _evas_canvas_nochange_pop), + EFL_OBJECT_OP_FUNC(evas_canvas_key_lock_off, _evas_canvas_key_lock_off), + EFL_OBJECT_OP_FUNC(evas_canvas_nochange_push, _evas_canvas_nochange_push), + EFL_OBJECT_OP_FUNC(evas_canvas_font_cache_flush, _evas_canvas_font_cache_flush), + EFL_OBJECT_OP_FUNC(evas_canvas_key_modifier_on, _evas_canvas_key_modifier_on), + EFL_OBJECT_OP_FUNC(evas_canvas_seat_key_modifier_on, _evas_canvas_seat_key_modifier_on), + EFL_OBJECT_OP_FUNC(evas_canvas_seat_key_modifier_off, _evas_canvas_seat_key_modifier_off), + EFL_OBJECT_OP_FUNC(evas_canvas_font_available_list, _evas_canvas_font_available_list), + EFL_OBJECT_OP_FUNC(evas_canvas_object_name_find, _evas_canvas_object_name_find), + EFL_OBJECT_OP_FUNC(evas_canvas_font_path_append, _evas_canvas_font_path_append), + EFL_OBJECT_OP_FUNC(evas_canvas_font_path_clear, _evas_canvas_font_path_clear), + EFL_OBJECT_OP_FUNC(evas_canvas_touch_point_list_nth_xy_get, _evas_canvas_touch_point_list_nth_xy_get), + EFL_OBJECT_OP_FUNC(evas_canvas_key_lock_del, _evas_canvas_key_lock_del), + EFL_OBJECT_OP_FUNC(evas_canvas_damage_rectangle_add, _evas_canvas_damage_rectangle_add), + EFL_OBJECT_OP_FUNC(evas_canvas_sync, _evas_canvas_sync), + EFL_OBJECT_OP_FUNC(evas_canvas_font_path_list, _evas_canvas_font_path_list), + EFL_OBJECT_OP_FUNC(evas_canvas_image_cache_reload, _evas_canvas_image_cache_reload), + EFL_OBJECT_OP_FUNC(evas_canvas_coord_world_x_to_screen, _evas_canvas_coord_world_x_to_screen), + EFL_OBJECT_OP_FUNC(evas_canvas_render_updates, _evas_canvas_render_updates), + EFL_OBJECT_OP_FUNC(evas_canvas_image_cache_flush, _evas_canvas_image_cache_flush), + EFL_OBJECT_OP_FUNC(evas_canvas_coord_screen_y_to_world, _evas_canvas_coord_screen_y_to_world), + EFL_OBJECT_OP_FUNC(evas_canvas_key_modifier_del, _evas_canvas_key_modifier_del), + EFL_OBJECT_OP_FUNC(evas_canvas_focus_in, _evas_canvas_focus_in), + EFL_OBJECT_OP_FUNC(evas_canvas_seat_focus_in, _evas_canvas_seat_focus_in), + EFL_OBJECT_OP_FUNC(evas_canvas_seat_focus_out, _evas_canvas_seat_focus_out), + EFL_OBJECT_OP_FUNC(evas_canvas_obscured_rectangle_add, _evas_canvas_obscured_rectangle_add), + EFL_OBJECT_OP_FUNC(evas_canvas_render_dump, _evas_canvas_render_dump), + EFL_OBJECT_OP_FUNC(evas_canvas_render, _evas_canvas_render), + EFL_OBJECT_OP_FUNC(evas_canvas_font_path_prepend, _evas_canvas_font_path_prepend), + EFL_OBJECT_OP_FUNC(evas_canvas_obscured_clear, _evas_canvas_obscured_clear), + EFL_OBJECT_OP_FUNC(evas_canvas_coord_screen_x_to_world, _evas_canvas_coord_screen_x_to_world), + EFL_OBJECT_OP_FUNC(evas_canvas_key_lock_add, _evas_canvas_key_lock_add), + EFL_OBJECT_OP_FUNC(evas_canvas_render_idle_flush, _evas_canvas_render_idle_flush), + EFL_OBJECT_OP_FUNC(evas_canvas_default_device_get, _evas_canvas_default_device_get), + EFL_OBJECT_OP_FUNC(evas_canvas_coord_world_y_to_screen, _evas_canvas_coord_world_y_to_screen), + EFL_OBJECT_OP_FUNC(efl_constructor, _evas_canvas_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _evas_canvas_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_invalidate, _evas_canvas_efl_object_invalidate), + EFL_OBJECT_OP_FUNC(efl_event_thaw, _evas_canvas_efl_object_event_thaw), + EFL_OBJECT_OP_FUNC(efl_event_freeze, _evas_canvas_efl_object_event_freeze), + EFL_OBJECT_OP_FUNC(efl_provider_find, _evas_canvas_efl_object_provider_find), + EFL_OBJECT_OP_FUNC(efl_loop_get, _evas_canvas_efl_loop_consumer_loop_get), + EFL_OBJECT_OP_FUNC(efl_canvas_pointer_inside_get, _evas_canvas_efl_canvas_pointer_pointer_inside_get), + EFL_OBJECT_OP_FUNC(efl_canvas_scene_device_get, _evas_canvas_efl_canvas_scene_device_get), + EFL_OBJECT_OP_FUNC(efl_canvas_scene_seat_get, _evas_canvas_efl_canvas_scene_seat_get), + EFL_OBJECT_OP_FUNC(efl_canvas_scene_seat_default_get, _evas_canvas_efl_canvas_scene_seat_default_get), + EFL_OBJECT_OP_FUNC(efl_canvas_scene_pointer_position_get, _evas_canvas_efl_canvas_scene_pointer_position_get), + EFL_OBJECT_OP_FUNC(efl_canvas_scene_image_max_size_get, _evas_canvas_efl_canvas_scene_image_max_size_get), + EFL_OBJECT_OP_FUNC(efl_canvas_scene_objects_at_xy_get, _evas_canvas_efl_canvas_scene_objects_at_xy_get), + EFL_OBJECT_OP_FUNC(efl_canvas_scene_object_top_at_xy_get, _evas_canvas_efl_canvas_scene_object_top_at_xy_get), + EFL_OBJECT_OP_FUNC(efl_canvas_scene_objects_in_rectangle_get, _evas_canvas_efl_canvas_scene_objects_in_rectangle_get), + EFL_OBJECT_OP_FUNC(efl_canvas_scene_object_top_in_rectangle_get, _evas_canvas_efl_canvas_scene_object_top_in_rectangle_get), + EFL_OBJECT_OP_FUNC(efl_canvas_scene_group_objects_calculate, _evas_canvas_efl_canvas_scene_group_objects_calculate), + EFL_OBJECT_OP_FUNC(efl_canvas_scene_group_objects_calculating_get, _evas_canvas_efl_canvas_scene_group_objects_calculating_get), + EVAS_CANVAS_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"image_cache", __eolian_evas_canvas_image_cache_set_reflect, __eolian_evas_canvas_image_cache_get_reflect}, + {"font_cache", __eolian_evas_canvas_font_cache_set_reflect, __eolian_evas_canvas_font_cache_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _evas_canvas_class_desc = { + EO_VERSION, + "Evas.Canvas", + EFL_CLASS_TYPE_REGULAR, + sizeof(Evas_Public_Data), + _evas_canvas_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(evas_canvas_class_get, &_evas_canvas_class_desc, EFL_LOOP_CONSUMER_CLASS, EFL_CANVAS_SCENE_INTERFACE, EFL_INPUT_INTERFACE_INTERFACE, EFL_CANVAS_POINTER_INTERFACE, NULL); + +#include "evas_canvas_eo.legacy.c" diff --git a/src/lib/evas/canvas/evas_canvas_eo.h b/src/lib/evas/canvas/evas_canvas_eo.h new file mode 100644 index 0000000000..938d59fcee --- /dev/null +++ b/src/lib/evas/canvas/evas_canvas_eo.h @@ -0,0 +1,1068 @@ +#ifndef _EVAS_CANVAS_EO_H_ +#define _EVAS_CANVAS_EO_H_ + +#ifndef _EVAS_CANVAS_EO_CLASS_TYPE +#define _EVAS_CANVAS_EO_CLASS_TYPE + +typedef Eo Evas_Canvas; + +#endif + +#ifndef _EVAS_CANVAS_EO_TYPES +#define _EVAS_CANVAS_EO_TYPES + + +#endif +/** Evas canvas class + * + * @ingroup Evas_Canvas + */ +#define EVAS_CANVAS_CLASS evas_canvas_class_get() + +EWAPI const Efl_Class *evas_canvas_class_get(void); + +/** + * @brief Set the image cache. + * + * This function sets the image cache of canvas in bytes. + * + * @param[in] obj The object. + * @param[in] size The cache size. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_image_cache_set(Eo *obj, int size); + +/** + * @brief Get the image cache. + * + * This function returns the image cache size of canvas in bytes. + * + * @param[in] obj The object. + * + * @return The cache size. + * + * @ingroup Evas_Canvas + */ +EOAPI int evas_canvas_image_cache_get(const Eo *obj); + +/** + * @brief Set the default set of flags an event begins with + * + * Events in evas can have an event_flags member. This starts out with an + * initial value (no flags). This lets you set the default flags that an event + * begins with to @c flags. + * + * @param[in] obj The object. + * @param[in] flags The default flags to use. + * + * @since 1.2 + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_event_default_flags_set(Eo *obj, Evas_Event_Flags flags); + +/** + * @brief Get the default set of flags an event begins with + * + * This gets the default event flags events are produced with when fed in. + * + * @param[in] obj The object. + * + * @return The default flags to use. + * + * @since 1.2 + * + * @ingroup Evas_Canvas + */ +EOAPI Evas_Event_Flags evas_canvas_event_default_flags_get(const Eo *obj); + +/** + * @brief Changes the size of font cache of the given evas. + * + * @param[in] obj The object. + * @param[in] size The size in bytes. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_font_cache_set(Eo *obj, int size); + +/** + * @brief Get the size of font cache of the given evas in bytes. + * + * @param[in] obj The object. + * + * @return The size in bytes. + * + * @ingroup Evas_Canvas + */ +EOAPI int evas_canvas_font_cache_get(const Eo *obj); + +/** + * @brief Attaches a specific pointer to the evas for fetching later. + * + * @param[in] obj The object. + * @param[in] data The attached pointer. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_data_attach_set(Eo *obj, void *data); + +/** + * @brief Returns the pointer attached by @ref evas_canvas_data_attach_set. + * + * @param[in] obj The object. + * + * @return The attached pointer. + * + * @ingroup Evas_Canvas + */ +EOAPI void *evas_canvas_data_attach_get(const Eo *obj); + +/** + * @brief Retrieve the object focused by the default seat. + * + * Focused objects will be the ones having key events delivered to, which the + * programmer can act upon by means of @ref evas_object_event_callback_add + * usage. + * + * @note Most users wouldn't be dealing directly with Evas' focused objects. + * Instead, they would be using a higher level library for that (like a + * toolkit, as Elementary) to handle focus and who's receiving input for them. + * + * This call returns the object that currently has focus on the canvas @c e or + * @c null, if none. + * + * See also @ref evas_object_focus_set, @ref evas_object_focus_get, @ref + * evas_object_key_grab, @ref evas_object_key_ungrab, + * @ref evas_canvas_seat_focus_get, @ref efl_canvas_object_seat_focus_check, + * @ref efl_canvas_object_seat_focus_add, + * @ref efl_canvas_object_seat_focus_del. + * + * @param[in] obj The object. + * + * @return The object that has focus or @c null if there is not one. + * + * @ingroup Evas_Canvas + */ +EOAPI Efl_Canvas_Object *evas_canvas_focus_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Return the focused object by a given seat. + * + * @param[in] obj The object. + * @param[in] seat The seat to fetch the focused object or @c null for the + * default seat. + * + * @return The object that has the focus or @c null if the seat has no focused + * object. + * + * @since 1.19 + * + * @ingroup Evas_Canvas + */ +EOAPI Efl_Canvas_Object *evas_canvas_seat_focus_get(const Eo *obj, Evas_Device *seat); + +/** + * @brief Get the highest (stacked) Evas object on the canvas @c e. + * + * This function will take all populated layers in the canvas into account, + * getting the highest object for the highest layer, naturally. + * + * @warning This function will skip objects parented by smart objects, acting + * only on the ones at the "top level", with regard to object parenting. + * + * See also @ref evas_object_layer_get, @ref evas_object_layer_set, @ref + * evas_object_below_get, @ref evas_object_above_get. + * + * @param[in] obj The object. + * + * @return A pointer to the highest object on it (if any) or @c null otherwise. + * + * @ingroup Evas_Canvas + */ +EOAPI Efl_Canvas_Object *evas_canvas_object_top_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief This function returns the current known default pointer coordinates. + * + * @param[in] obj The object. + * @param[in] dev The pointer device. + * @param[out] x The pointer to a Evas_Coord to be filled in. + * @param[out] y The pointer to a Evas_Coord to be filled in. + * + * @since 1.19 + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_pointer_canvas_xy_by_device_get(const Eo *obj, Evas_Device *dev, int *x, int *y); + +/** + * @brief This function returns the current known default pointer coordinates + * + * This function returns the current known canvas unit coordinates of the mouse + * pointer and sets the contents of the Evas_Coords pointed to by @c x and @c y + * to contain these coordinates. If @c e is not a valid canvas the results of + * this function are undefined. + * + * @param[in] obj The object. + * @param[out] x The pointer to a Evas_Coord to be filled in. + * @param[out] y The pointer to a Evas_Coord to be filled in. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_pointer_canvas_xy_get(const Eo *obj, int *x, int *y); + +/** + * @brief Get the number of mouse or multi presses currently active. + * + * @param[in] obj The object. + * + * @return Mouse or multi presses currently active + * + * @since 1.2 + * + * @ingroup Evas_Canvas + */ +EOAPI int evas_canvas_event_down_count_get(const Eo *obj); + +/** + * @brief This gets the internal counter that counts the number of smart + * calculations. + * + * Whenever evas performs smart object calculations on the whole canvas it + * increments a counter by 1. This function returns the value of the smart + * object calculate counter. It starts with a value of 0 and will increase (and + * eventually wrap around to negative values and so on) by 1 every time objects + * are calculated. You can use this counter to ensure you don't re-do + * calculations withint the same calculation generation/run if the calculations + * maybe cause self-feeding effects. + * + * @param[in] obj The object. + * + * @return Number of smart calculations + * + * @since 1.1 + * + * @ingroup Evas_Canvas + */ +EOAPI int evas_canvas_smart_objects_calculate_count_get(const Eo *obj); + +/** + * @brief Get the focus state for the default seat. + * + * @param[in] obj The object. + * + * @return @c true if focused, @c false otherwise + * + * @ingroup Evas_Canvas + */ +EOAPI Eina_Bool evas_canvas_focus_state_get(const Eo *obj); + +/** + * @brief Get the focus state by a given seat. + * + * @param[in] obj The object. + * @param[in] seat The seat to check the focus state. Use @c null for the + * default seat. + * + * @return @c true if the seat has the canvas focus, @c false otherwise. + * + * @ingroup Evas_Canvas + */ +EOAPI Eina_Bool evas_canvas_seat_focus_state_get(const Eo *obj, Evas_Device *seat); + +/** + * @brief Get the changed marker for the canvas. + * + * @param[in] obj The object. + * + * @return @c true if changed, @c false otherwise + * + * @since 1.11 + * + * @ingroup Evas_Canvas + */ +EOAPI Eina_Bool evas_canvas_changed_get(const Eo *obj); + +/** + * @brief This function returns the current known pointer coordinates. + * + * @param[in] obj The object. + * @param[in] dev The mouse device. + * @param[out] x The pointer to an integer to be filled in. + * @param[out] y The pointer to an integer to be filled in. + * + * @since 1.19 + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_pointer_output_xy_by_device_get(const Eo *obj, Evas_Device *dev, int *x, int *y); + +/** + * @brief This function returns the current known default pointer coordinates. + * + * This function returns the current known screen/output coordinates of the + * mouse pointer and sets the contents of the integers pointed to by @c x and + * @c y to contain these coordinates. If @c e is not a valid canvas the results + * of this function are undefined. + * + * @param[in] obj The object. + * @param[out] x The pointer to an integer to be filled in. + * @param[out] y The pointer to an integer to be filled in. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_pointer_output_xy_get(const Eo *obj, int *x, int *y); + +/** + * @brief Get the lowest (stacked) Evas object on the canvas @c e. + * + * This function will take all populated layers in the canvas into account, + * getting the lowest object for the lowest layer, naturally. + * + * @warning This function will skip objects parented by smart objects, acting + * only on the ones at the "top level", with regard to object parenting. + * + * See also @ref evas_object_layer_get, @ref evas_object_layer_set, @ref + * evas_object_below_get, @ref evas_object_below_set. + * + * @param[in] obj The object. + * + * @return A pointer to the lowest object on it, if any, or @c null otherwise. + * + * @ingroup Evas_Canvas + */ +EOAPI Efl_Canvas_Object *evas_canvas_object_bottom_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Returns a bitmask with the mouse buttons currently pressed, set to 1. + * + * @param[in] obj The object. + * @param[in] dev The mouse device. + * + * @return A bitmask of the currently depressed buttons on the canvas. + * + * @ingroup Evas_Canvas + */ +EOAPI unsigned int evas_canvas_pointer_button_down_mask_by_device_get(const Eo *obj, Evas_Device *dev); + +/** + * @brief Returns a bitmask with the default mouse buttons currently pressed, + * set to 1. + * + * Calling this function will return a 32-bit integer with the appropriate bits + * set to 1, which correspond to a mouse button being depressed. This limits + * Evas to a mouse devices with a maximum of 32 buttons, but that is generally + * in excess of any host system's pointing device abilities. + * + * A canvas by default begins with no mouse buttons being pressed and only + * pointer move events can alter that. + * + * The least significant bit corresponds to the first mouse button (button 1) + * and the most significant bit corresponds to the last mouse button (button + * 32). + * + * If @c e is not a valid canvas, the return value is undefined. + * + * @param[in] obj The object. + * + * @return A bitmask of the currently depressed buttons on the canvas. + * + * @ingroup Evas_Canvas + */ +EOAPI unsigned int evas_canvas_pointer_button_down_mask_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief 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. It will + * enter the smart objects. It will not append to the list pass events as + * hidden objects. Call eina_list_free on the returned list after usage. + * + * @param[in] obj The object. + * @param[in] stop An Evas Object where to stop searching. + * @param[in] x The horizontal coordinate of the position. + * @param[in] y The vertical coordinate of the position. + * + * @return List of objects + * + * @ingroup Evas_Canvas + */ +EOAPI Eina_List *evas_canvas_tree_objects_at_xy_get(Eo *obj, Efl_Canvas_Object *stop, int x, int y) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Enables or turns on programmatically the lock key with name + * @c keyname for the default seat. + * + * The effect will be as if the key was put on its active state after this + * call. + * + * See also @ref evas_canvas_key_lock_add, @ref evas_canvas_key_lock_del, + * @ref evas_canvas_key_lock_del, @ref evas_canvas_key_lock_off, + * @ref evas_canvas_seat_key_lock_on, @ref evas_canvas_seat_key_lock_off. + * + * @param[in] obj The object. + * @param[in] keyname The name of the lock to enable. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_key_lock_on(Eo *obj, const char *keyname) EINA_ARG_NONNULL(2); + +/** + * @brief Enables or turns on programmatically the lock key with name + * @c keyname for a give seat. + * + * The effect will be as if the key was put on its active state after this + * call. + * + * See also @ref evas_canvas_key_lock_add, @ref evas_canvas_key_lock_del, + * @ref evas_canvas_key_lock_del, @ref evas_canvas_key_lock_off, + * @ref evas_canvas_key_lock_on, @ref evas_canvas_seat_key_lock_off. + * + * @param[in] obj The object. + * @param[in] keyname The name of the lock to enable. + * @param[in] seat The seat to enable the keylock. A @c null seat repesents the + * default seat. + * + * @since 1.19 + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_seat_key_lock_on(Eo *obj, const char *keyname, Evas_Device *seat) EINA_ARG_NONNULL(2); + +/** + * @brief Disables or turns off programmatically the lock key with name + * @c keyname for a given seat. + * + * The effect will be as if the key was put on its inactive state after this + * call. + * + * See also @ref evas_canvas_key_lock_on, @ref evas_canvas_seat_key_lock_on, + * @ref evas_canvas_key_lock_off. + * + * @param[in] obj The object. + * @param[in] keyname The name of the lock to enable. + * @param[in] seat The seat to disable the keylock. A @c null seat repesents + * the default seat. + * + * @since 1.19 + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_seat_key_lock_off(Eo *obj, const char *keyname, Evas_Device *seat) EINA_ARG_NONNULL(2); + +/** + * @brief Adds the @c keyname key to the current list of modifier keys. + * + * Modifiers are keys like shift, alt and ctrl, i.e. keys which are meant to be + * pressed together with others, altering the behavior of the second keys + * pressed. Evas is so that these keys can be user defined. + * + * This call allows custom modifiers to be added to the Evas system at run + * time. It is then possible to set and unset modifier keys programmatically + * for other parts of the program to check and act on. Programmers using Evas + * would check for modifier keys on key event callbacks using @ref + * evas_key_modifier_is_set. + * + * @note If the programmer instantiates the canvas by means of the @ref + * ecore_evas_new family of helper functions, Ecore will take care of + * registering on it all standard modifiers: "Shift", "Control", "Alt", "Meta", + * "Hyper", "Super". + * + * @param[in] obj The object. + * @param[in] keyname The name of the modifier key to add to the list of Evas + * modifiers. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_key_modifier_add(Eo *obj, const char *keyname) EINA_ARG_NONNULL(2); + +/** + * @brief Disables or turns off programmatically the modifier key with name + * @c keyname for the default seat. + * + * See also @ref evas_canvas_key_modifier_add, @ref evas_key_modifier_get, + * @ref evas_canvas_key_modifier_on, @ref evas_canvas_seat_key_modifier_off, + * @ref evas_canvas_seat_key_modifier_off, @ref evas_key_modifier_is_set, @ref + * evas_seat_key_modifier_is_set. + * + * @param[in] obj The object. + * @param[in] keyname The name of the modifier to disable. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_key_modifier_off(Eo *obj, const char *keyname) EINA_ARG_NONNULL(2); + +/** + * @brief Render the given Evas canvas asynchronously. + * + * This function only returns @c true when a frame will be rendered. If the + * previous frame is still rendering, @c false will be returned so the users + * know not to wait for the updates callback and just return to their main + * loop. + * + * If a @c func callback is given, a list of updated areas will be generated + * and the function will be called from the main thread after the rendered + * frame is flushed to the screen. The resulting list should be freed with @ref + * evas_render_updates_free. + * + * The list is given in the @c event_info parameter of the callback function. + * + * @param[in] obj The object. + * + * @return @c true if the canvas will render, @c false otherwise. + * + * @since 1.8 + * + * @ingroup Evas_Canvas + */ +EOAPI Eina_Bool evas_canvas_render_async(Eo *obj); + +/** Inform the evas that it lost the focus from the default seat. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_focus_out(Eo *obj); + +/** + * @brief Update the canvas internal objects but not triggering immediate + * renderization. + * + * This function updates the canvas internal objects not triggering + * renderization. To force renderization function @ref evas_canvas_render + * should be used. + * @param[in] obj The object. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_norender(Eo *obj); + +/** + * @brief Pop the nochange flag down 1. + * + * This tells evas, that while the nochange flag is greater than 0, do not mark + * objects as "changed" when making changes. + * + * @warning Do not use this function unless you know what Evas exactly works + * with "changed" state. + * @param[in] obj The object. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_nochange_pop(Eo *obj); + +/** + * @brief Disables or turns off programmatically the lock key with name + * @c keyname for the default seat. + * + * The effect will be as if the key was put on its inactive state after this + * call. + * + * See also @ref evas_canvas_key_lock_on, @ref evas_canvas_seat_key_lock_on, + * @ref evas_canvas_seat_key_lock_off. + * + * @param[in] obj The object. + * @param[in] keyname The name of the lock to disable. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_key_lock_off(Eo *obj, const char *keyname) EINA_ARG_NONNULL(2); + +/** + * @brief Push the nochange flag up 1 + * + * This tells evas, that while the nochange flag is greater than 0, do not mark + * objects as "changed" when making changes. + * + * @warning Do not use this function unless you know what Evas exactly works + * with "changed" state. + * @param[in] obj The object. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_nochange_push(Eo *obj); + +/** Force the given evas and associated engine to flush its font cache. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_font_cache_flush(Eo *obj); + +/** + * @brief Enables or turns on programmatically the modifier key with name + * @c keyname for the default seat. + * + * The effect will be as if the key was pressed for the whole time between this + * call and a matching evas_key_modifier_off(). + * + * See also @ref evas_canvas_key_modifier_off, + * @ref evas_canvas_seat_key_modifier_on, + * @ref evas_canvas_seat_key_modifier_off. + * + * @param[in] obj The object. + * @param[in] keyname The name of the modifier to enable. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_key_modifier_on(Eo *obj, const char *keyname) EINA_ARG_NONNULL(2); + +/** + * @brief Enables or turns on programmatically the modifier key with name + * @c keyname for a given seat. + * + * The effect will be as if the key was pressed for the whole time between this + * call and a matching @ref evas_canvas_seat_key_modifier_off. + * + * See also @ref evas_canvas_key_modifier_off, + * @ref evas_canvas_seat_key_modifier_on, + * @ref evas_canvas_seat_key_modifier_off. + * + * @param[in] obj The object. + * @param[in] keyname The name of the lock to enable. + * @param[in] seat The seat to enable the modifier. A @c null seat repesents + * the default seat. + * + * @since 1.19 + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_seat_key_modifier_on(Eo *obj, const char *keyname, Evas_Device *seat) EINA_ARG_NONNULL(2); + +/** + * @brief Disables or turns off programmatically the modifier key with name + * @c keyname for a given seat. + * + * See also @ref evas_canvas_key_modifier_add, @ref evas_key_modifier_get, + * @ref evas_canvas_key_modifier_on, @ref evas_canvas_seat_key_modifier_off, + * @ref evas_canvas_seat_key_modifier_off, @ref evas_key_modifier_is_set, @ref + * evas_seat_key_modifier_is_set. + * + * @param[in] obj The object. + * @param[in] keyname The name of the lock to enable. + * @param[in] seat The seat to disable the modifier. A @c null seat repesents + * the default seat. + * + * @since 1.19 + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_seat_key_modifier_off(Eo *obj, const char *keyname, Evas_Device *seat) EINA_ARG_NONNULL(2); + +/** + * @brief List of available font descriptions known or found by this evas. + * + * The list depends on Evas compile time configuration, such as fontconfig + * support, and the paths provided at runtime as explained in @ref + * Evas_Font_Path_Group. + * + * @param[in] obj The object. + * + * @return A newly allocated list of strings. Do not change the strings. Be + * sure to call @ref evas_font_available_list_free after you're done. + * + * @ingroup Evas_Canvas + */ +EOAPI Eina_List *evas_canvas_font_available_list(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Retrieves the object on the given evas with the given name. + * + * This looks for the evas object given a name by @ref evas_object_name_set. If + * the name is not unique canvas-wide, then which one of the many objects with + * that name is returned is undefined, so only use this if you can ensure the + * object name is unique. + * + * @param[in] obj The object. + * @param[in] name The given name. + * + * @return If successful, the Evas object with the given name. Otherwise, + * @c null. + * + * @ingroup Evas_Canvas + */ +EOAPI Efl_Canvas_Object *evas_canvas_object_name_find(const Eo *obj, const char *name) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Appends a font path to the list of font paths used by the given evas. + * + * @param[in] obj The object. + * @param[in] path The new font path. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_font_path_append(Eo *obj, const char *path) EINA_ARG_NONNULL(2); + +/** Removes all font paths loaded into memory for the given evas. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_font_path_clear(Eo *obj); + +/** + * @brief This function returns the nth touch point's coordinates. + * + * Touch point's coordinates is updated whenever moving that point on the + * canvas. + * + * @param[in] obj The object. + * @param[in] n The number of the touched point (0 being the first). + * @param[out] x Last known X position in window coordinates + * @param[out] y Last known Y position in window coordinates + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_touch_point_list_nth_xy_get(Eo *obj, unsigned int n, double *x, double *y); + +/** + * @brief Removes the @c keyname key from the current list of lock keys on + * canvas @c e. + * + * @param[in] obj The object. + * @param[in] keyname The name of the key to remove from the locks list. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_key_lock_del(Eo *obj, const char *keyname) EINA_ARG_NONNULL(2); + +/** + * @brief Add a damage rectangle. + * + * This is the function by which one tells evas that a part of the canvas has + * to be repainted. + * + * @note All newly created Evas rectangles get the default color values of 255 + * 255 255 255 (opaque white). + * + * @param[in] obj The object. + * @param[in] x The rectangle's left position. + * @param[in] y The rectangle's top position. + * @param[in] w The rectangle's width. + * @param[in] h The rectangle's height. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_damage_rectangle_add(Eo *obj, int x, int y, int w, int h); + +/** Sync evas canvas + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_sync(Eo *obj); + +/** + * @brief Retrieves the list of font paths used by the given evas. + * + * @param[in] obj The object. + * + * @return The list of font paths used. + * + * @ingroup Evas_Canvas + */ +EOAPI const Eina_List *evas_canvas_font_path_list(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Reload the image cache. + * + * This function reloads the image cache of canvas. + * @param[in] obj The object. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_image_cache_reload(Eo *obj); + +/** + * @brief Convert/scale a canvas coordinate into output screen coordinates. + * + * This function takes in a horizontal coordinate as the @c x parameter and + * converts it into output units, accounting for output size, viewport size and + * location, returning it as the function return value. If @c e is invalid, + * the results are undefined. + * + * @param[in] obj The object. + * @param[in] x The canvas X coordinate. + * + * @return The output/screen coordinate translated to output coordinates. + * + * @ingroup Evas_Canvas + */ +EOAPI int evas_canvas_coord_world_x_to_screen(const Eo *obj, int x) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Force immediate renderization of the given Evas canvas. + * + * This function forces an immediate renderization update of the given canvas + * @c e. + * + * @note This is a very low level function, which most of Evas' users wouldn't + * care about. You might use it, for instance, to grab an Evas' canvas update + * regions and paint them back, using the canvas' pixmap, on a displaying + * system working below Evas. + * + * @note Evas is a stateful canvas. If no operations changing its state took + * place since the last rendering action, you won't see any changes and this + * call will be a no-op. + * + * @param[in] obj The object. + * + * @return A newly allocated list of updated rectangles of the canvas + * (@Eina.Rect structs). Free this list with @ref evas_render_updates_free. + * + * @ingroup Evas_Canvas + */ +EOAPI Eina_List *evas_canvas_render_updates(Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Flush the image cache of the canvas. + * + * This function flushes image cache of canvas. + * @param[in] obj The object. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_image_cache_flush(Eo *obj); + +/** + * @brief Convert/scale an output screen coordinate into canvas coordinates. + * + * This function takes in a vertical coordinate as the @c y parameter and + * converts it into canvas units, accounting for output size, viewport size and + * location, returning it as the function return value. If @c e is invalid, the + * results are undefined. + * + * @param[in] obj The object. + * @param[in] y The screen/output y coordinate. + * + * @return The screen coordinate translated to canvas unit coordinates. + * + * @ingroup Evas_Canvas + */ +EOAPI int evas_canvas_coord_screen_y_to_world(const Eo *obj, int y) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Removes the @c keyname key from the current list of modifier keys on + * canvas @c e. + * + * See also @ref evas_canvas_key_modifier_add. + * + * @param[in] obj The object. + * @param[in] keyname The name of the key to remove from the modifiers list. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_key_modifier_del(Eo *obj, const char *keyname) EINA_ARG_NONNULL(2); + +/** Inform to the evas that it got the focus from the default seat. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_focus_in(Eo *obj); + +/** + * @brief Inform to the evas that it got the focus from a given seat. + * + * @param[in] obj The object. + * @param[in] seat The seat or @c null for the default seat. + * + * @since 1.19 + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_seat_focus_in(Eo *obj, Evas_Device *seat); + +/** + * @brief Inform to the evas that it lost the focus from a given seat. + * + * @param[in] obj The object. + * @param[in] seat The seat or @c null for the default seat. + * + * @since 1.19 + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_seat_focus_out(Eo *obj, Evas_Device *seat); + +/** + * @brief Add an "obscured region" to an Evas canvas. + * + * This is the function by which one tells an Evas canvas that a part of it + * must not be repainted. The region must be rectangular and its coordinates + * inside the canvas viewport are passed in the call. After this call, the + * region specified won't participate in any form in Evas' calculations and + * actions during its rendering updates, having its displaying content frozen + * as it was just after this function took place. + * + * We call it "obscured region" because the most common use case for this + * rendering (partial) freeze is something else (most probably other canvas) + * being on top of the specified rectangular region, thus shading it completely + * from the user's final scene in a display. To avoid unnecessary processing, + * one should indicate to the obscured canvas not to bother about the + * non-important area. + * + * The majority of users won't have to worry about this function, as they'll be + * using just one canvas in their applications, with nothing inset or on top of + * it in any form. + * + * To make this region one that has to be repainted again, call the function + * @ref evas_obscured_clear. + * + * @note This is a very low level function, which most of Evas' users wouldn't + * care about. + * + * @note This function does not flag the canvas as having its state changed. If + * you want to re-render it afterwards expecting new contents, you have to add + * "damage" regions yourself (see @ref evas_damage_rectangle_add). + * + * @param[in] obj The object. + * @param[in] x The rectangle's top left corner's horizontal coordinate. + * @param[in] y The rectangle's top left corner's vertical coordinate. + * @param[in] w The rectangle's width. + * @param[in] h The rectangle's height. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_obscured_rectangle_add(Eo *obj, int x, int y, int w, int h); + +/** + * @brief Make the canvas discard as much data as possible used by the engine + * at runtime. + * + * This function will unload images, delete textures and much more where + * possible. You may also want to call @ref evas_canvas_render_idle_flush + * immediately prior to this to perhaps discard a little more, though this + * function should implicitly delete most of what + * @ref evas_canvas_render_idle_flush might discard too. + * @param[in] obj The object. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_render_dump(Eo *obj); + +/** Force renderization of the given canvas. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_render(Eo *obj); + +/** + * @brief Prepends a font path to the list of font paths used by the given + * evas. + * + * @param[in] obj The object. + * @param[in] path The new font path. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_font_path_prepend(Eo *obj, const char *path) EINA_ARG_NONNULL(2); + +/** + * @brief Remove all "obscured regions" from an Evas canvas. + * + * This function removes all the rectangles from the obscured regions list of + * the canvas @c e. It takes obscured areas added with + * @ref evas_canvas_obscured_rectangle_add and make them again a regions that + * have to be repainted on rendering updates. + * + * @note This is a very low level function, which most of Evas' users wouldn't + * care about. + * + * @note This function does not flag the canvas as having its state changed. If + * you want to re-render it afterwards expecting new contents, you have to add + * "damage" regions yourself (see @ref evas_canvas_damage_rectangle_add). + * @param[in] obj The object. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_obscured_clear(Eo *obj); + +/** + * @brief Convert/scale an output screen coordinate into canvas coordinates. + * + * This function takes in a horizontal coordinate as the @c x parameter and + * converts it into canvas units, accounting for output size, viewport size and + * location, returning it as the function return value. If @c e is invalid, the + * results are undefined. + * + * @param[in] obj The object. + * @param[in] x The screen/output x coordinate. + * + * @return The screen coordinate translated to canvas unit coordinates. + * + * @ingroup Evas_Canvas + */ +EOAPI int evas_canvas_coord_screen_x_to_world(const Eo *obj, int x) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Adds the @c keyname key to the current list of lock keys. + * + * Locks are keys like caps lock, num lock or scroll lock, i.e., keys which are + * meant to be pressed once -- toggling a binary state which is bound to it -- + * and thus altering the behavior of all subsequently pressed keys somehow, + * depending on its state. Evas is so that these keys can be defined by the + * user. + * + * This allows custom locks to be added to the evas system at run time. It is + * then possible to set and unset lock keys programmatically for other parts of + * the program to check and act on. Programmers using Evas would check for lock + * keys on key event callbacks using @ref evas_key_lock_is_set. + * + * @note If the programmer instantiates the canvas by means of the + * ecore_evas_new() family of helper functions, Ecore will take care of + * registering on it all standard lock keys: "Caps_Lock", "Num_Lock", + * "Scroll_Lock". + * + * @param[in] obj The object. + * @param[in] keyname The name of the key to add to the locks list. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_key_lock_add(Eo *obj, const char *keyname) EINA_ARG_NONNULL(2); + +/** + * @brief Make the canvas discard internally cached data used for rendering. + * + * This function flushes the arrays of delete, active and render objects. Other + * things it may also discard are: shared memory segments, temporary scratch + * buffers, cached data to avoid re-compute of that data etc. + * @param[in] obj The object. + * + * @ingroup Evas_Canvas + */ +EOAPI void evas_canvas_render_idle_flush(Eo *obj); + +/** + * @brief Return the default device of a given type. + * + * @note Currently EFL only creates a seat, mouse and keyboard. + * + * @param[in] obj The object. + * @param[in] type The class of the default device to fetch. + * + * @return The default device or @c null on error. + * + * @since 1.19 + * + * @ingroup Evas_Canvas + */ +EOAPI Evas_Device *evas_canvas_default_device_get(const Eo *obj, Evas_Device_Class type); + +/** + * @brief Convert/scale a canvas coordinate into output screen coordinates. + * + * This function takes in a vertical coordinate as the @c x parameter and + * converts it into output units, accounting for output size, viewport size and + * location, returning it as the function return value. If @c e is invalid, the + * results are undefined. + * + * @param[in] obj The object. + * @param[in] y The canvas y coordinate. + * + * @return The output/screen coordinate translated to output coordinates. + * + * @ingroup Evas_Canvas + */ +EOAPI int evas_canvas_coord_world_y_to_screen(const Eo *obj, int y) EINA_WARN_UNUSED_RESULT; + +#endif diff --git a/src/lib/evas/canvas/evas_canvas_eo.hh b/src/lib/evas/canvas/evas_canvas_eo.hh new file mode 100644 index 0000000000..f08e6cad68 --- /dev/null +++ b/src/lib/evas/canvas/evas_canvas_eo.hh @@ -0,0 +1,413 @@ +#ifndef EVAS_CANVAS_EO_HH +#define EVAS_CANVAS_EO_HH +#include + +extern "C" { +#include "efl_canvas_object.eo.h" +#include "efl_canvas_pointer.eo.h" +#include "efl_canvas_scene.eo.h" +#include "efl_class.eo.h" +#include "efl_gfx_entity.eo.h" +#include "efl_input_device.eo.h" +#include "efl_input_focus.eo.h" +#include "efl_input_hold.eo.h" +#include "efl_input_interface.eo.h" +#include "efl_input_key.eo.h" +#include "efl_input_pointer.eo.h" +#include "efl_loop.eo.h" +#include "efl_loop_consumer.eo.h" +#include "efl_object.eo.h" +#include "evas_canvas_eo.h" +} +#include +#include +#include "efl_canvas_object.eo.hh" +#include "efl_canvas_pointer.eo.hh" +#include "efl_canvas_scene.eo.hh" +#include "efl_class.eo.hh" +#include "efl_gfx_entity.eo.hh" +#include "efl_input_device.eo.hh" +#include "efl_input_focus.eo.hh" +#include "efl_input_hold.eo.hh" +#include "efl_input_interface.eo.hh" +#include "efl_input_key.eo.hh" +#include "efl_input_pointer.eo.hh" +#include "efl_loop.eo.hh" +#include "efl_loop_consumer.eo.hh" +#include "efl_object.eo.hh" +#ifndef EVAS_CANVAS_FWD_GUARD +#define EVAS_CANVAS_FWD_GUARD +namespace evas { +struct Canvas; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Canvas> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Canvas&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Canvas const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Canvas const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CLASS_FWD_GUARD +#define EFL_CLASS_FWD_GUARD +namespace efl { +struct Class; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_OBJECT_FWD_GUARD +#define EFL_CANVAS_OBJECT_FWD_GUARD +namespace efl { namespace canvas { +struct Object; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_POINTER_FWD_GUARD +#define EFL_CANVAS_POINTER_FWD_GUARD +namespace efl { namespace canvas { +struct Pointer; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_ENTITY_FWD_GUARD +#define EFL_GFX_ENTITY_FWD_GUARD +namespace efl { namespace gfx { +struct Entity; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_DEVICE_FWD_GUARD +#define EFL_INPUT_DEVICE_FWD_GUARD +namespace efl { namespace input { +struct Device; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_FOCUS_FWD_GUARD +#define EFL_INPUT_FOCUS_FWD_GUARD +namespace efl { namespace input { +struct Focus; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_HOLD_FWD_GUARD +#define EFL_INPUT_HOLD_FWD_GUARD +namespace efl { namespace input { +struct Hold; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_INTERFACE_FWD_GUARD +#define EFL_INPUT_INTERFACE_FWD_GUARD +namespace efl { namespace input { +struct Interface; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_KEY_FWD_GUARD +#define EFL_INPUT_KEY_FWD_GUARD +namespace efl { namespace input { +struct Key; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_LOOP_FWD_GUARD +#define EFL_LOOP_FWD_GUARD +namespace efl { +struct Loop; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_LOOP_CONSUMER_FWD_GUARD +#define EFL_LOOP_CONSUMER_FWD_GUARD +namespace efl { +struct Loop_Consumer; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_OBJECT_FWD_GUARD +#define EFL_OBJECT_FWD_GUARD +namespace efl { +struct Object; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_POINTER_FWD_GUARD +#define EFL_INPUT_POINTER_FWD_GUARD +namespace efl { namespace input { +struct Pointer; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_SCENE_FWD_GUARD +#define EFL_CANVAS_SCENE_FWD_GUARD +namespace efl { namespace canvas { +struct Scene; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Scene> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Scene&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Scene const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Scene const&> : ::std::true_type {}; } } +#endif + +namespace eo_cxx { +namespace evas { +struct Canvas { + ::efl::eolian::return_traits::type image_cache_get() const; + ::efl::eolian::return_traits::type image_cache_set( ::efl::eolian::in_traits::type size) const; + ::efl::eolian::return_traits::type event_default_flags_get() const; + ::efl::eolian::return_traits::type event_default_flags_set( ::efl::eolian::in_traits::type flags) const; + ::efl::eolian::return_traits::type font_cache_get() const; + ::efl::eolian::return_traits::type font_cache_set( ::efl::eolian::in_traits::type size) const; + ::efl::eolian::return_traits::type data_attach_get() const; + ::efl::eolian::return_traits::type data_attach_set( ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type focus_get() const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type seat_focus_get( ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type object_top_get() const; + ::efl::eolian::return_traits::type pointer_canvas_xy_by_device_get( ::efl::eolian::in_traits< ::efl::input::Device>::type dev, ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const; + ::efl::eolian::return_traits::type pointer_canvas_xy_get( ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const; + ::efl::eolian::return_traits::type event_down_count_get() const; + ::efl::eolian::return_traits::type smart_objects_calculate_count_get() const; + ::efl::eolian::return_traits::type focus_state_get() const; + ::efl::eolian::return_traits::type seat_focus_state_get( ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const; + ::efl::eolian::return_traits::type changed_get() const; + ::efl::eolian::return_traits::type pointer_output_xy_by_device_get( ::efl::eolian::in_traits< ::efl::input::Device>::type dev, ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const; + ::efl::eolian::return_traits::type pointer_output_xy_get( ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type object_bottom_get() const; + ::efl::eolian::return_traits< unsigned int>::type pointer_button_down_mask_by_device_get( ::efl::eolian::in_traits< ::efl::input::Device>::type dev) const; + ::efl::eolian::return_traits< unsigned int>::type pointer_button_down_mask_get() const; + ::efl::eolian::return_traits< ::efl::input::Device>::type default_device_get( ::efl::eolian::in_traits::type type) const; + ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::canvas::Object>>::type tree_objects_at_xy_get( ::efl::eolian::in_traits< ::efl::canvas::Object>::type stop, ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y) const; + ::efl::eolian::return_traits::type key_lock_on( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const; + ::efl::eolian::return_traits::type seat_key_lock_on( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname, ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const; + ::efl::eolian::return_traits::type seat_key_lock_off( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname, ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const; + ::efl::eolian::return_traits::type key_modifier_add( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const; + ::efl::eolian::return_traits::type key_modifier_off( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const; + ::efl::eolian::return_traits::type render_async() const; + ::efl::eolian::return_traits::type focus_out() const; + ::efl::eolian::return_traits::type norender() const; + ::efl::eolian::return_traits::type nochange_pop() const; + ::efl::eolian::return_traits::type key_lock_off( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const; + ::efl::eolian::return_traits::type nochange_push() const; + ::efl::eolian::return_traits::type font_cache_flush() const; + ::efl::eolian::return_traits::type key_modifier_on( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const; + ::efl::eolian::return_traits::type seat_key_modifier_on( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname, ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const; + ::efl::eolian::return_traits::type seat_key_modifier_off( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname, ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const; + ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::eina::string_view>>::type font_available_list() const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type object_name_find( ::efl::eolian::in_traits< ::efl::eina::string_view>::type name) const; + ::efl::eolian::return_traits::type font_path_append( ::efl::eolian::in_traits< ::efl::eina::string_view>::type path) const; + ::efl::eolian::return_traits::type font_path_clear() const; + ::efl::eolian::return_traits::type touch_point_list_nth_xy_get( ::efl::eolian::in_traits< unsigned int>::type n, ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const; + ::efl::eolian::return_traits::type key_lock_del( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const; + ::efl::eolian::return_traits::type damage_rectangle_add( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const; + ::efl::eolian::return_traits::type sync() const; + ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::eina::string_view>>::type font_path_list() const; + ::efl::eolian::return_traits::type image_cache_reload() const; + ::efl::eolian::return_traits::type coord_world_x_to_screen( ::efl::eolian::in_traits::type x) const; + ::efl::eolian::return_traits< ::efl::eina::list>::type render_updates() const; + ::efl::eolian::return_traits::type image_cache_flush() const; + ::efl::eolian::return_traits::type coord_screen_y_to_world( ::efl::eolian::in_traits::type y) const; + ::efl::eolian::return_traits::type key_modifier_del( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const; + ::efl::eolian::return_traits::type focus_in() const; + ::efl::eolian::return_traits::type seat_focus_in( ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const; + ::efl::eolian::return_traits::type seat_focus_out( ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const; + ::efl::eolian::return_traits::type obscured_rectangle_add( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const; + ::efl::eolian::return_traits::type render_dump() const; + ::efl::eolian::return_traits::type render() const; + ::efl::eolian::return_traits::type font_path_prepend( ::efl::eolian::in_traits< ::efl::eina::string_view>::type path) const; + ::efl::eolian::return_traits::type obscured_clear() const; + ::efl::eolian::return_traits::type coord_screen_x_to_world( ::efl::eolian::in_traits::type x) const; + ::efl::eolian::return_traits::type key_lock_add( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const; + ::efl::eolian::return_traits::type render_idle_flush() const; + ::efl::eolian::return_traits::type coord_world_y_to_screen( ::efl::eolian::in_traits::type y) const; + static Efl_Class const* _eo_class() + { + return EVAS_CANVAS_CLASS; + } + Eo* _eo_ptr() const { return *(reinterpret_cast(const_cast(this))); } + operator ::evas::Canvas() const; + operator ::evas::Canvas&(); + operator ::evas::Canvas const&() const; + /// @cond LOCAL + ::efl::eolian::address_of_operator operator&() { return {this}; } + ::efl::eolian::address_of_operator operator&() const { return {this}; } + /// @endcond +}; +} +} +namespace evas { +struct Canvas : private ::efl::eo::concrete + , EO_CXX_INHERIT(::efl::Loop_Consumer) + , EO_CXX_INHERIT(::efl::Object) + , EO_CXX_INHERIT(::efl::canvas::Pointer) + , EO_CXX_INHERIT(::efl::canvas::Scene) + , EO_CXX_INHERIT(::efl::input::Interface) +{ + explicit Canvas( ::Eo* eo) + : ::efl::eo::concrete(eo) {} + Canvas(std::nullptr_t) + : ::efl::eo::concrete(nullptr) {} + explicit Canvas() = default; + Canvas(Canvas const&) = default; + Canvas(Canvas&&) = default; + Canvas& operator=(Canvas const&) = default; + Canvas& operator=(Canvas&&) = default; + template + Canvas(Derived&& derived + , typename std::enable_if< + ::efl::eo::is_eolian_object::value + && std::is_base_of< Canvas, Derived>::value>::type* = 0) + : ::efl::eo::concrete(derived._eo_ptr()) {} + + Canvas( ::efl::eo::instantiate_t) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, ::efl::eo::concrete{nullptr}, _eo_class()); + } + template + explicit Canvas( ::efl::eo::instantiate_t, T&& parent, typename std::enable_if< ::efl::eo::is_eolian_object::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, parent, _eo_class()); + } + template Canvas( ::efl::eo::instantiate_t, F&& f, typename ::std::enable_if< ::efl::eolian::is_constructor_lambda::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, ::efl::eo::concrete{nullptr}, _eo_class(), *this, std::forward(f)); + } + template Canvas( ::efl::eo::instantiate_t, T&& parent, F&& f, typename ::std::enable_if< ::efl::eolian::is_constructor_lambda::value && ::efl::eo::is_eolian_object::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, parent, _eo_class(), *this, std::forward(f)); + } + + ::efl::eolian::return_traits::type image_cache_get() const; + ::efl::eolian::return_traits::type image_cache_set( ::efl::eolian::in_traits::type size) const; + ::efl::eolian::return_traits::type event_default_flags_get() const; + ::efl::eolian::return_traits::type event_default_flags_set( ::efl::eolian::in_traits::type flags) const; + ::efl::eolian::return_traits::type font_cache_get() const; + ::efl::eolian::return_traits::type font_cache_set( ::efl::eolian::in_traits::type size) const; + ::efl::eolian::return_traits::type data_attach_get() const; + ::efl::eolian::return_traits::type data_attach_set( ::efl::eolian::in_traits::type data) const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type focus_get() const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type seat_focus_get( ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type object_top_get() const; + ::efl::eolian::return_traits::type pointer_canvas_xy_by_device_get( ::efl::eolian::in_traits< ::efl::input::Device>::type dev, ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const; + ::efl::eolian::return_traits::type pointer_canvas_xy_get( ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const; + ::efl::eolian::return_traits::type event_down_count_get() const; + ::efl::eolian::return_traits::type smart_objects_calculate_count_get() const; + ::efl::eolian::return_traits::type focus_state_get() const; + ::efl::eolian::return_traits::type seat_focus_state_get( ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const; + ::efl::eolian::return_traits::type changed_get() const; + ::efl::eolian::return_traits::type pointer_output_xy_by_device_get( ::efl::eolian::in_traits< ::efl::input::Device>::type dev, ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const; + ::efl::eolian::return_traits::type pointer_output_xy_get( ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type object_bottom_get() const; + ::efl::eolian::return_traits< unsigned int>::type pointer_button_down_mask_by_device_get( ::efl::eolian::in_traits< ::efl::input::Device>::type dev) const; + ::efl::eolian::return_traits< unsigned int>::type pointer_button_down_mask_get() const; + ::efl::eolian::return_traits< ::efl::input::Device>::type default_device_get( ::efl::eolian::in_traits::type type) const; + ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::canvas::Object>>::type tree_objects_at_xy_get( ::efl::eolian::in_traits< ::efl::canvas::Object>::type stop, ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y) const; + ::efl::eolian::return_traits::type key_lock_on( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const; + ::efl::eolian::return_traits::type seat_key_lock_on( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname, ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const; + ::efl::eolian::return_traits::type seat_key_lock_off( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname, ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const; + ::efl::eolian::return_traits::type key_modifier_add( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const; + ::efl::eolian::return_traits::type key_modifier_off( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const; + ::efl::eolian::return_traits::type render_async() const; + ::efl::eolian::return_traits::type focus_out() const; + ::efl::eolian::return_traits::type norender() const; + ::efl::eolian::return_traits::type nochange_pop() const; + ::efl::eolian::return_traits::type key_lock_off( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const; + ::efl::eolian::return_traits::type nochange_push() const; + ::efl::eolian::return_traits::type font_cache_flush() const; + ::efl::eolian::return_traits::type key_modifier_on( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const; + ::efl::eolian::return_traits::type seat_key_modifier_on( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname, ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const; + ::efl::eolian::return_traits::type seat_key_modifier_off( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname, ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const; + ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::eina::string_view>>::type font_available_list() const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type object_name_find( ::efl::eolian::in_traits< ::efl::eina::string_view>::type name) const; + ::efl::eolian::return_traits::type font_path_append( ::efl::eolian::in_traits< ::efl::eina::string_view>::type path) const; + ::efl::eolian::return_traits::type font_path_clear() const; + ::efl::eolian::return_traits::type touch_point_list_nth_xy_get( ::efl::eolian::in_traits< unsigned int>::type n, ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const; + ::efl::eolian::return_traits::type key_lock_del( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const; + ::efl::eolian::return_traits::type damage_rectangle_add( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const; + ::efl::eolian::return_traits::type sync() const; + ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::eina::string_view>>::type font_path_list() const; + ::efl::eolian::return_traits::type image_cache_reload() const; + ::efl::eolian::return_traits::type coord_world_x_to_screen( ::efl::eolian::in_traits::type x) const; + ::efl::eolian::return_traits< ::efl::eina::list>::type render_updates() const; + ::efl::eolian::return_traits::type image_cache_flush() const; + ::efl::eolian::return_traits::type coord_screen_y_to_world( ::efl::eolian::in_traits::type y) const; + ::efl::eolian::return_traits::type key_modifier_del( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const; + ::efl::eolian::return_traits::type focus_in() const; + ::efl::eolian::return_traits::type seat_focus_in( ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const; + ::efl::eolian::return_traits::type seat_focus_out( ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const; + ::efl::eolian::return_traits::type obscured_rectangle_add( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const; + ::efl::eolian::return_traits::type render_dump() const; + ::efl::eolian::return_traits::type render() const; + ::efl::eolian::return_traits::type font_path_prepend( ::efl::eolian::in_traits< ::efl::eina::string_view>::type path) const; + ::efl::eolian::return_traits::type obscured_clear() const; + ::efl::eolian::return_traits::type coord_screen_x_to_world( ::efl::eolian::in_traits::type x) const; + ::efl::eolian::return_traits::type key_lock_add( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const; + ::efl::eolian::return_traits::type render_idle_flush() const; + ::efl::eolian::return_traits::type coord_world_y_to_screen( ::efl::eolian::in_traits::type y) const; + static Efl_Class const* _eo_class() + { + return EVAS_CANVAS_CLASS; + } + Eo* _eo_ptr() const { return *(reinterpret_cast(const_cast(this))); } + /// @cond LOCAL + ::efl::eolian::address_of_operator operator&() { return {this}; } + ::efl::eolian::address_of_operator operator&() const { return {this}; } + /// @endcond + ::efl::eo::wref _get_wref() const { return ::efl::eo::wref(*this); } + ::efl::eo::concrete const& _get_concrete() const { return *this; } + ::efl::eo::concrete& _get_concrete() { return *this; } + using ::efl::eo::concrete::_eo_ptr; + using ::efl::eo::concrete::_release; + using ::efl::eo::concrete::_reset; + using ::efl::eo::concrete::_delete; + using ::efl::eo::concrete::operator bool; +#ifdef EFL_CXXPERIMENTAL + const Canvas* operator->() const { return this; } + Canvas* operator->() { return this; } + operator Eo*() const { return _eo_ptr(); } +#endif + friend bool operator==(Canvas const& lhs, Canvas const& rhs) + { return lhs._get_concrete() == rhs._get_concrete(); } + friend bool operator!=(Canvas const& lhs, Canvas const& rhs) + { return !(lhs == rhs); } +}; +static_assert(sizeof(Canvas) == sizeof(Eo*), ""); +static_assert(std::is_standard_layout::value, ""); +} +#endif diff --git a/src/lib/evas/canvas/evas_canvas_eo.impl.hh b/src/lib/evas/canvas/evas_canvas_eo.impl.hh new file mode 100644 index 0000000000..2d496d947c --- /dev/null +++ b/src/lib/evas/canvas/evas_canvas_eo.impl.hh @@ -0,0 +1,756 @@ +#ifndef EVAS_CANVAS_IMPL_HH +#define EVAS_CANVAS_IMPL_HH + +#include "evas_canvas_eo.hh" + +namespace evas { +inline ::efl::eolian::return_traits::type Canvas::image_cache_get() const +{ + int __return_value = ::evas_canvas_image_cache_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::image_cache_set( ::efl::eolian::in_traits::type size) const +{ + ::evas_canvas_image_cache_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(size)); +} +inline ::efl::eolian::return_traits::type Canvas::event_default_flags_get() const +{ + Efl_Input_Flags __return_value = ::evas_canvas_event_default_flags_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::event_default_flags_set( ::efl::eolian::in_traits::type flags) const +{ + ::evas_canvas_event_default_flags_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(flags)); +} +inline ::efl::eolian::return_traits::type Canvas::font_cache_get() const +{ + int __return_value = ::evas_canvas_font_cache_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::font_cache_set( ::efl::eolian::in_traits::type size) const +{ + ::evas_canvas_font_cache_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(size)); +} +inline ::efl::eolian::return_traits::type Canvas::data_attach_get() const +{ + void * __return_value = ::evas_canvas_data_attach_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::data_attach_set( ::efl::eolian::in_traits::type data) const +{ + ::evas_canvas_data_attach_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Canvas::focus_get() const +{ + ::Efl_Canvas_Object* __return_value = ::evas_canvas_focus_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Canvas::seat_focus_get( ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const +{ + ::Efl_Canvas_Object* __return_value = ::evas_canvas_seat_focus_get(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(seat)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Canvas::object_top_get() const +{ + ::Efl_Canvas_Object* __return_value = ::evas_canvas_object_top_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::pointer_canvas_xy_by_device_get( ::efl::eolian::in_traits< ::efl::input::Device>::type dev, ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const +{ + int __out_param_x = {}; + int __out_param_y = {}; + ::evas_canvas_pointer_canvas_xy_by_device_get(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(dev), + & __out_param_x, + & __out_param_y); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(x, __out_param_x); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(y, __out_param_y); +} +inline ::efl::eolian::return_traits::type Canvas::pointer_canvas_xy_get( ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const +{ + int __out_param_x = {}; + int __out_param_y = {}; + ::evas_canvas_pointer_canvas_xy_get(_eo_ptr(), + & __out_param_x, + & __out_param_y); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(x, __out_param_x); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(y, __out_param_y); +} +inline ::efl::eolian::return_traits::type Canvas::event_down_count_get() const +{ + int __return_value = ::evas_canvas_event_down_count_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::smart_objects_calculate_count_get() const +{ + int __return_value = ::evas_canvas_smart_objects_calculate_count_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::focus_state_get() const +{ + Eina_Bool __return_value = ::evas_canvas_focus_state_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::seat_focus_state_get( ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const +{ + Eina_Bool __return_value = ::evas_canvas_seat_focus_state_get(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(seat)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::changed_get() const +{ + Eina_Bool __return_value = ::evas_canvas_changed_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::pointer_output_xy_by_device_get( ::efl::eolian::in_traits< ::efl::input::Device>::type dev, ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const +{ + int __out_param_x = {}; + int __out_param_y = {}; + ::evas_canvas_pointer_output_xy_by_device_get(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(dev), + & __out_param_x, + & __out_param_y); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(x, __out_param_x); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(y, __out_param_y); +} +inline ::efl::eolian::return_traits::type Canvas::pointer_output_xy_get( ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const +{ + int __out_param_x = {}; + int __out_param_y = {}; + ::evas_canvas_pointer_output_xy_get(_eo_ptr(), + & __out_param_x, + & __out_param_y); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(x, __out_param_x); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(y, __out_param_y); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Canvas::object_bottom_get() const +{ + ::Efl_Canvas_Object* __return_value = ::evas_canvas_object_bottom_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits< unsigned int>::type Canvas::pointer_button_down_mask_by_device_get( ::efl::eolian::in_traits< ::efl::input::Device>::type dev) const +{ + unsigned int __return_value = ::evas_canvas_pointer_button_down_mask_by_device_get(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(dev)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< unsigned int>::type>(__return_value); +} +inline ::efl::eolian::return_traits< unsigned int>::type Canvas::pointer_button_down_mask_get() const +{ + unsigned int __return_value = ::evas_canvas_pointer_button_down_mask_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< unsigned int>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::input::Device>::type Canvas::default_device_get( ::efl::eolian::in_traits::type type) const +{ + ::Efl_Input_Device* __return_value = ::evas_canvas_default_device_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(type)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::input::Device>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::canvas::Object>>::type Canvas::tree_objects_at_xy_get( ::efl::eolian::in_traits< ::efl::canvas::Object>::type stop, ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y) const +{ + Eina_List * __return_value = ::evas_canvas_tree_objects_at_xy_get(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(stop), + ::efl::eolian::convert_to_c::type>(x), + ::efl::eolian::convert_to_c::type>(y)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::key_lock_on( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const +{ + ::evas_canvas_key_lock_on(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname)); +} +inline ::efl::eolian::return_traits::type Canvas::seat_key_lock_on( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname, ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const +{ + ::evas_canvas_seat_key_lock_on(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(seat)); +} +inline ::efl::eolian::return_traits::type Canvas::seat_key_lock_off( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname, ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const +{ + ::evas_canvas_seat_key_lock_off(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(seat)); +} +inline ::efl::eolian::return_traits::type Canvas::key_modifier_add( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const +{ + ::evas_canvas_key_modifier_add(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname)); +} +inline ::efl::eolian::return_traits::type Canvas::key_modifier_off( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const +{ + ::evas_canvas_key_modifier_off(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname)); +} +inline ::efl::eolian::return_traits::type Canvas::render_async() const +{ + Eina_Bool __return_value = ::evas_canvas_render_async(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::focus_out() const +{ + ::evas_canvas_focus_out(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::norender() const +{ + ::evas_canvas_norender(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::nochange_pop() const +{ + ::evas_canvas_nochange_pop(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::key_lock_off( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const +{ + ::evas_canvas_key_lock_off(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname)); +} +inline ::efl::eolian::return_traits::type Canvas::nochange_push() const +{ + ::evas_canvas_nochange_push(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::font_cache_flush() const +{ + ::evas_canvas_font_cache_flush(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::key_modifier_on( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const +{ + ::evas_canvas_key_modifier_on(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname)); +} +inline ::efl::eolian::return_traits::type Canvas::seat_key_modifier_on( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname, ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const +{ + ::evas_canvas_seat_key_modifier_on(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(seat)); +} +inline ::efl::eolian::return_traits::type Canvas::seat_key_modifier_off( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname, ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const +{ + ::evas_canvas_seat_key_modifier_off(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(seat)); +} +inline ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::eina::string_view>>::type Canvas::font_available_list() const +{ + Eina_List * __return_value = ::evas_canvas_font_available_list(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::eina::string_view>>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Canvas::object_name_find( ::efl::eolian::in_traits< ::efl::eina::string_view>::type name) const +{ + ::Efl_Canvas_Object* __return_value = ::evas_canvas_object_name_find(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(name)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::font_path_append( ::efl::eolian::in_traits< ::efl::eina::string_view>::type path) const +{ + ::evas_canvas_font_path_append(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(path)); +} +inline ::efl::eolian::return_traits::type Canvas::font_path_clear() const +{ + ::evas_canvas_font_path_clear(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::touch_point_list_nth_xy_get( ::efl::eolian::in_traits< unsigned int>::type n, ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const +{ + double __out_param_x = {}; + double __out_param_y = {}; + ::evas_canvas_touch_point_list_nth_xy_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(n), + & __out_param_x, + & __out_param_y); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, double>(x, __out_param_x); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, double>(y, __out_param_y); +} +inline ::efl::eolian::return_traits::type Canvas::key_lock_del( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const +{ + ::evas_canvas_key_lock_del(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname)); +} +inline ::efl::eolian::return_traits::type Canvas::damage_rectangle_add( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const +{ + ::evas_canvas_damage_rectangle_add(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(x), + ::efl::eolian::convert_to_c::type>(y), + ::efl::eolian::convert_to_c::type>(w), + ::efl::eolian::convert_to_c::type>(h)); +} +inline ::efl::eolian::return_traits::type Canvas::sync() const +{ + ::evas_canvas_sync(_eo_ptr()); +} +inline ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::eina::string_view>>::type Canvas::font_path_list() const +{ + const Eina_List * __return_value = ::evas_canvas_font_path_list(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::eina::string_view>>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::image_cache_reload() const +{ + ::evas_canvas_image_cache_reload(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::coord_world_x_to_screen( ::efl::eolian::in_traits::type x) const +{ + int __return_value = ::evas_canvas_coord_world_x_to_screen(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(x)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::eina::list>::type Canvas::render_updates() const +{ + Eina_List * __return_value = ::evas_canvas_render_updates(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::list>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::image_cache_flush() const +{ + ::evas_canvas_image_cache_flush(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::coord_screen_y_to_world( ::efl::eolian::in_traits::type y) const +{ + int __return_value = ::evas_canvas_coord_screen_y_to_world(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(y)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::key_modifier_del( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const +{ + ::evas_canvas_key_modifier_del(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname)); +} +inline ::efl::eolian::return_traits::type Canvas::focus_in() const +{ + ::evas_canvas_focus_in(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::seat_focus_in( ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const +{ + ::evas_canvas_seat_focus_in(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(seat)); +} +inline ::efl::eolian::return_traits::type Canvas::seat_focus_out( ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const +{ + ::evas_canvas_seat_focus_out(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(seat)); +} +inline ::efl::eolian::return_traits::type Canvas::obscured_rectangle_add( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const +{ + ::evas_canvas_obscured_rectangle_add(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(x), + ::efl::eolian::convert_to_c::type>(y), + ::efl::eolian::convert_to_c::type>(w), + ::efl::eolian::convert_to_c::type>(h)); +} +inline ::efl::eolian::return_traits::type Canvas::render_dump() const +{ + ::evas_canvas_render_dump(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::render() const +{ + ::evas_canvas_render(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::font_path_prepend( ::efl::eolian::in_traits< ::efl::eina::string_view>::type path) const +{ + ::evas_canvas_font_path_prepend(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(path)); +} +inline ::efl::eolian::return_traits::type Canvas::obscured_clear() const +{ + ::evas_canvas_obscured_clear(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::coord_screen_x_to_world( ::efl::eolian::in_traits::type x) const +{ + int __return_value = ::evas_canvas_coord_screen_x_to_world(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(x)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::key_lock_add( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const +{ + ::evas_canvas_key_lock_add(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname)); +} +inline ::efl::eolian::return_traits::type Canvas::render_idle_flush() const +{ + ::evas_canvas_render_idle_flush(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::coord_world_y_to_screen( ::efl::eolian::in_traits::type y) const +{ + int __return_value = ::evas_canvas_coord_world_y_to_screen(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(y)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +} +namespace eo_cxx { +namespace evas { +inline ::efl::eolian::return_traits::type Canvas::image_cache_get() const +{ + int __return_value = ::evas_canvas_image_cache_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::image_cache_set( ::efl::eolian::in_traits::type size) const +{ + ::evas_canvas_image_cache_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(size)); +} +inline ::efl::eolian::return_traits::type Canvas::event_default_flags_get() const +{ + Efl_Input_Flags __return_value = ::evas_canvas_event_default_flags_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::event_default_flags_set( ::efl::eolian::in_traits::type flags) const +{ + ::evas_canvas_event_default_flags_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(flags)); +} +inline ::efl::eolian::return_traits::type Canvas::font_cache_get() const +{ + int __return_value = ::evas_canvas_font_cache_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::font_cache_set( ::efl::eolian::in_traits::type size) const +{ + ::evas_canvas_font_cache_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(size)); +} +inline ::efl::eolian::return_traits::type Canvas::data_attach_get() const +{ + void * __return_value = ::evas_canvas_data_attach_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::data_attach_set( ::efl::eolian::in_traits::type data) const +{ + ::evas_canvas_data_attach_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(data)); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Canvas::focus_get() const +{ + ::Efl_Canvas_Object* __return_value = ::evas_canvas_focus_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Canvas::seat_focus_get( ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const +{ + ::Efl_Canvas_Object* __return_value = ::evas_canvas_seat_focus_get(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(seat)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Canvas::object_top_get() const +{ + ::Efl_Canvas_Object* __return_value = ::evas_canvas_object_top_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::pointer_canvas_xy_by_device_get( ::efl::eolian::in_traits< ::efl::input::Device>::type dev, ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const +{ + int __out_param_x = {}; + int __out_param_y = {}; + ::evas_canvas_pointer_canvas_xy_by_device_get(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(dev), + & __out_param_x, + & __out_param_y); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(x, __out_param_x); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(y, __out_param_y); +} +inline ::efl::eolian::return_traits::type Canvas::pointer_canvas_xy_get( ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const +{ + int __out_param_x = {}; + int __out_param_y = {}; + ::evas_canvas_pointer_canvas_xy_get(_eo_ptr(), + & __out_param_x, + & __out_param_y); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(x, __out_param_x); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(y, __out_param_y); +} +inline ::efl::eolian::return_traits::type Canvas::event_down_count_get() const +{ + int __return_value = ::evas_canvas_event_down_count_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::smart_objects_calculate_count_get() const +{ + int __return_value = ::evas_canvas_smart_objects_calculate_count_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::focus_state_get() const +{ + Eina_Bool __return_value = ::evas_canvas_focus_state_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::seat_focus_state_get( ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const +{ + Eina_Bool __return_value = ::evas_canvas_seat_focus_state_get(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(seat)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::changed_get() const +{ + Eina_Bool __return_value = ::evas_canvas_changed_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::pointer_output_xy_by_device_get( ::efl::eolian::in_traits< ::efl::input::Device>::type dev, ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const +{ + int __out_param_x = {}; + int __out_param_y = {}; + ::evas_canvas_pointer_output_xy_by_device_get(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(dev), + & __out_param_x, + & __out_param_y); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(x, __out_param_x); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(y, __out_param_y); +} +inline ::efl::eolian::return_traits::type Canvas::pointer_output_xy_get( ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const +{ + int __out_param_x = {}; + int __out_param_y = {}; + ::evas_canvas_pointer_output_xy_get(_eo_ptr(), + & __out_param_x, + & __out_param_y); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(x, __out_param_x); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(y, __out_param_y); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Canvas::object_bottom_get() const +{ + ::Efl_Canvas_Object* __return_value = ::evas_canvas_object_bottom_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits< unsigned int>::type Canvas::pointer_button_down_mask_by_device_get( ::efl::eolian::in_traits< ::efl::input::Device>::type dev) const +{ + unsigned int __return_value = ::evas_canvas_pointer_button_down_mask_by_device_get(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(dev)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< unsigned int>::type>(__return_value); +} +inline ::efl::eolian::return_traits< unsigned int>::type Canvas::pointer_button_down_mask_get() const +{ + unsigned int __return_value = ::evas_canvas_pointer_button_down_mask_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< unsigned int>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::input::Device>::type Canvas::default_device_get( ::efl::eolian::in_traits::type type) const +{ + ::Efl_Input_Device* __return_value = ::evas_canvas_default_device_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(type)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::input::Device>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::canvas::Object>>::type Canvas::tree_objects_at_xy_get( ::efl::eolian::in_traits< ::efl::canvas::Object>::type stop, ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y) const +{ + Eina_List * __return_value = ::evas_canvas_tree_objects_at_xy_get(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(stop), + ::efl::eolian::convert_to_c::type>(x), + ::efl::eolian::convert_to_c::type>(y)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::key_lock_on( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const +{ + ::evas_canvas_key_lock_on(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname)); +} +inline ::efl::eolian::return_traits::type Canvas::seat_key_lock_on( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname, ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const +{ + ::evas_canvas_seat_key_lock_on(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(seat)); +} +inline ::efl::eolian::return_traits::type Canvas::seat_key_lock_off( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname, ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const +{ + ::evas_canvas_seat_key_lock_off(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(seat)); +} +inline ::efl::eolian::return_traits::type Canvas::key_modifier_add( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const +{ + ::evas_canvas_key_modifier_add(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname)); +} +inline ::efl::eolian::return_traits::type Canvas::key_modifier_off( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const +{ + ::evas_canvas_key_modifier_off(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname)); +} +inline ::efl::eolian::return_traits::type Canvas::render_async() const +{ + Eina_Bool __return_value = ::evas_canvas_render_async(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::focus_out() const +{ + ::evas_canvas_focus_out(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::norender() const +{ + ::evas_canvas_norender(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::nochange_pop() const +{ + ::evas_canvas_nochange_pop(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::key_lock_off( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const +{ + ::evas_canvas_key_lock_off(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname)); +} +inline ::efl::eolian::return_traits::type Canvas::nochange_push() const +{ + ::evas_canvas_nochange_push(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::font_cache_flush() const +{ + ::evas_canvas_font_cache_flush(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::key_modifier_on( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const +{ + ::evas_canvas_key_modifier_on(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname)); +} +inline ::efl::eolian::return_traits::type Canvas::seat_key_modifier_on( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname, ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const +{ + ::evas_canvas_seat_key_modifier_on(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(seat)); +} +inline ::efl::eolian::return_traits::type Canvas::seat_key_modifier_off( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname, ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const +{ + ::evas_canvas_seat_key_modifier_off(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(seat)); +} +inline ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::eina::string_view>>::type Canvas::font_available_list() const +{ + Eina_List * __return_value = ::evas_canvas_font_available_list(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::eina::string_view>>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Canvas::object_name_find( ::efl::eolian::in_traits< ::efl::eina::string_view>::type name) const +{ + ::Efl_Canvas_Object* __return_value = ::evas_canvas_object_name_find(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(name)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::font_path_append( ::efl::eolian::in_traits< ::efl::eina::string_view>::type path) const +{ + ::evas_canvas_font_path_append(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(path)); +} +inline ::efl::eolian::return_traits::type Canvas::font_path_clear() const +{ + ::evas_canvas_font_path_clear(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::touch_point_list_nth_xy_get( ::efl::eolian::in_traits< unsigned int>::type n, ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y) const +{ + double __out_param_x = {}; + double __out_param_y = {}; + ::evas_canvas_touch_point_list_nth_xy_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(n), + & __out_param_x, + & __out_param_y); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, double>(x, __out_param_x); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, double>(y, __out_param_y); +} +inline ::efl::eolian::return_traits::type Canvas::key_lock_del( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const +{ + ::evas_canvas_key_lock_del(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname)); +} +inline ::efl::eolian::return_traits::type Canvas::damage_rectangle_add( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const +{ + ::evas_canvas_damage_rectangle_add(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(x), + ::efl::eolian::convert_to_c::type>(y), + ::efl::eolian::convert_to_c::type>(w), + ::efl::eolian::convert_to_c::type>(h)); +} +inline ::efl::eolian::return_traits::type Canvas::sync() const +{ + ::evas_canvas_sync(_eo_ptr()); +} +inline ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::eina::string_view>>::type Canvas::font_path_list() const +{ + const Eina_List * __return_value = ::evas_canvas_font_path_list(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::range_list< ::efl::eina::string_view>>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::image_cache_reload() const +{ + ::evas_canvas_image_cache_reload(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::coord_world_x_to_screen( ::efl::eolian::in_traits::type x) const +{ + int __return_value = ::evas_canvas_coord_world_x_to_screen(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(x)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::eina::list>::type Canvas::render_updates() const +{ + Eina_List * __return_value = ::evas_canvas_render_updates(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::list>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::image_cache_flush() const +{ + ::evas_canvas_image_cache_flush(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::coord_screen_y_to_world( ::efl::eolian::in_traits::type y) const +{ + int __return_value = ::evas_canvas_coord_screen_y_to_world(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(y)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::key_modifier_del( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const +{ + ::evas_canvas_key_modifier_del(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname)); +} +inline ::efl::eolian::return_traits::type Canvas::focus_in() const +{ + ::evas_canvas_focus_in(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::seat_focus_in( ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const +{ + ::evas_canvas_seat_focus_in(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(seat)); +} +inline ::efl::eolian::return_traits::type Canvas::seat_focus_out( ::efl::eolian::in_traits< ::efl::input::Device>::type seat) const +{ + ::evas_canvas_seat_focus_out(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Input_Device*, ::efl::eolian::in_traits< ::efl::input::Device>::type>(seat)); +} +inline ::efl::eolian::return_traits::type Canvas::obscured_rectangle_add( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const +{ + ::evas_canvas_obscured_rectangle_add(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(x), + ::efl::eolian::convert_to_c::type>(y), + ::efl::eolian::convert_to_c::type>(w), + ::efl::eolian::convert_to_c::type>(h)); +} +inline ::efl::eolian::return_traits::type Canvas::render_dump() const +{ + ::evas_canvas_render_dump(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::render() const +{ + ::evas_canvas_render(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::font_path_prepend( ::efl::eolian::in_traits< ::efl::eina::string_view>::type path) const +{ + ::evas_canvas_font_path_prepend(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(path)); +} +inline ::efl::eolian::return_traits::type Canvas::obscured_clear() const +{ + ::evas_canvas_obscured_clear(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::coord_screen_x_to_world( ::efl::eolian::in_traits::type x) const +{ + int __return_value = ::evas_canvas_coord_screen_x_to_world(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(x)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Canvas::key_lock_add( ::efl::eolian::in_traits< ::efl::eina::string_view>::type keyname) const +{ + ::evas_canvas_key_lock_add(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(keyname)); +} +inline ::efl::eolian::return_traits::type Canvas::render_idle_flush() const +{ + ::evas_canvas_render_idle_flush(_eo_ptr()); +} +inline ::efl::eolian::return_traits::type Canvas::coord_world_y_to_screen( ::efl::eolian::in_traits::type y) const +{ + int __return_value = ::evas_canvas_coord_world_y_to_screen(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(y)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline evas::Canvas::operator ::evas::Canvas() const { return *static_cast< ::evas::Canvas const*>(static_cast(this)); } +inline evas::Canvas::operator ::evas::Canvas&() { return *static_cast< ::evas::Canvas*>(static_cast(this)); } +inline evas::Canvas::operator ::evas::Canvas const&() const { return *static_cast< ::evas::Canvas const*>(static_cast(this)); } +} } +#endif diff --git a/src/lib/evas/canvas/evas_canvas_eo.legacy.c b/src/lib/evas/canvas/evas_canvas_eo.legacy.c new file mode 100644 index 0000000000..b864c2f6d4 --- /dev/null +++ b/src/lib/evas/canvas/evas_canvas_eo.legacy.c @@ -0,0 +1,384 @@ + +EAPI void +evas_image_cache_set(Evas_Canvas *obj, int size) +{ + evas_canvas_image_cache_set(obj, size); +} + +EAPI int +evas_image_cache_get(const Evas_Canvas *obj) +{ + return evas_canvas_image_cache_get(obj); +} + +EAPI void +evas_event_default_flags_set(Evas_Canvas *obj, Evas_Event_Flags flags) +{ + evas_canvas_event_default_flags_set(obj, (Efl_Input_Flags)flags); +} + +EAPI Evas_Event_Flags +evas_event_default_flags_get(const Evas_Canvas *obj) +{ + return (Evas_Event_Flags)evas_canvas_event_default_flags_get(obj); +} + +EAPI void +evas_font_cache_set(Evas_Canvas *obj, int size) +{ + evas_canvas_font_cache_set(obj, size); +} + +EAPI int +evas_font_cache_get(const Evas_Canvas *obj) +{ + return evas_canvas_font_cache_get(obj); +} + +EAPI void +evas_data_attach_set(Evas_Canvas *obj, void *data) +{ + evas_canvas_data_attach_set(obj, data); +} + +EAPI void * +evas_data_attach_get(const Evas_Canvas *obj) +{ + return evas_canvas_data_attach_get(obj); +} + +EAPI Efl_Canvas_Object * +evas_focus_get(const Evas_Canvas *obj) +{ + return evas_canvas_focus_get(obj); +} + +EAPI Efl_Canvas_Object * +evas_seat_focus_get(const Evas_Canvas *obj, Evas_Device *seat) +{ + return evas_canvas_seat_focus_get(obj, seat); +} + +EAPI Efl_Canvas_Object * +evas_object_top_get(const Evas_Canvas *obj) +{ + return evas_canvas_object_top_get(obj); +} + +EAPI void +evas_pointer_canvas_xy_by_device_get(const Evas_Canvas *obj, Evas_Device *dev, int *x, int *y) +{ + evas_canvas_pointer_canvas_xy_by_device_get(obj, dev, x, y); +} + +EAPI void +evas_pointer_canvas_xy_get(const Evas_Canvas *obj, int *x, int *y) +{ + evas_canvas_pointer_canvas_xy_get(obj, x, y); +} + +EAPI int +evas_event_down_count_get(const Evas_Canvas *obj) +{ + return evas_canvas_event_down_count_get(obj); +} + +EAPI int +evas_smart_objects_calculate_count_get(const Evas_Canvas *obj) +{ + return evas_canvas_smart_objects_calculate_count_get(obj); +} + +EAPI Eina_Bool +evas_focus_state_get(const Evas_Canvas *obj) +{ + return evas_canvas_focus_state_get(obj); +} + +EAPI Eina_Bool +evas_seat_focus_state_get(const Evas_Canvas *obj, Evas_Device *seat) +{ + return evas_canvas_seat_focus_state_get(obj, seat); +} + +EAPI Eina_Bool +evas_changed_get(const Evas_Canvas *obj) +{ + return evas_canvas_changed_get(obj); +} + +EAPI void +evas_pointer_output_xy_by_device_get(const Evas_Canvas *obj, Evas_Device *dev, int *x, int *y) +{ + evas_canvas_pointer_output_xy_by_device_get(obj, dev, x, y); +} + +EAPI void +evas_pointer_output_xy_get(const Evas_Canvas *obj, int *x, int *y) +{ + evas_canvas_pointer_output_xy_get(obj, x, y); +} + +EAPI Efl_Canvas_Object * +evas_object_bottom_get(const Evas_Canvas *obj) +{ + return evas_canvas_object_bottom_get(obj); +} + +EAPI unsigned int +evas_pointer_button_down_mask_by_device_get(const Evas_Canvas *obj, Evas_Device *dev) +{ + return evas_canvas_pointer_button_down_mask_by_device_get(obj, dev); +} + +EAPI unsigned int +evas_pointer_button_down_mask_get(const Evas_Canvas *obj) +{ + return evas_canvas_pointer_button_down_mask_get(obj); +} + +EAPI Eina_List * +evas_tree_objects_at_xy_get(Evas_Canvas *obj, Efl_Canvas_Object *stop, int x, int y) +{ + return evas_canvas_tree_objects_at_xy_get(obj, stop, x, y); +} + +EAPI void +evas_key_lock_on(Evas_Canvas *obj, const char *keyname) +{ + evas_canvas_key_lock_on(obj, keyname); +} + +EAPI void +evas_seat_key_lock_on(Evas_Canvas *obj, const char *keyname, Evas_Device *seat) +{ + evas_canvas_seat_key_lock_on(obj, keyname, seat); +} + +EAPI void +evas_seat_key_lock_off(Evas_Canvas *obj, const char *keyname, Evas_Device *seat) +{ + evas_canvas_seat_key_lock_off(obj, keyname, seat); +} + +EAPI void +evas_key_modifier_add(Evas_Canvas *obj, const char *keyname) +{ + evas_canvas_key_modifier_add(obj, keyname); +} + +EAPI void +evas_key_modifier_off(Evas_Canvas *obj, const char *keyname) +{ + evas_canvas_key_modifier_off(obj, keyname); +} + +EAPI Eina_Bool +evas_render_async(Evas_Canvas *obj) +{ + return evas_canvas_render_async(obj); +} + +EAPI void +evas_focus_out(Evas_Canvas *obj) +{ + evas_canvas_focus_out(obj); +} + +EAPI void +evas_norender(Evas_Canvas *obj) +{ + evas_canvas_norender(obj); +} + +EAPI void +evas_nochange_pop(Evas_Canvas *obj) +{ + evas_canvas_nochange_pop(obj); +} + +EAPI void +evas_key_lock_off(Evas_Canvas *obj, const char *keyname) +{ + evas_canvas_key_lock_off(obj, keyname); +} + +EAPI void +evas_nochange_push(Evas_Canvas *obj) +{ + evas_canvas_nochange_push(obj); +} + +EAPI void +evas_font_cache_flush(Evas_Canvas *obj) +{ + evas_canvas_font_cache_flush(obj); +} + +EAPI void +evas_key_modifier_on(Evas_Canvas *obj, const char *keyname) +{ + evas_canvas_key_modifier_on(obj, keyname); +} + +EAPI void +evas_seat_key_modifier_on(Evas_Canvas *obj, const char *keyname, Evas_Device *seat) +{ + evas_canvas_seat_key_modifier_on(obj, keyname, seat); +} + +EAPI void +evas_seat_key_modifier_off(Evas_Canvas *obj, const char *keyname, Evas_Device *seat) +{ + evas_canvas_seat_key_modifier_off(obj, keyname, seat); +} + +EAPI Eina_List * +evas_font_available_list(const Evas_Canvas *obj) +{ + return evas_canvas_font_available_list(obj); +} + +EAPI Efl_Canvas_Object * +evas_object_name_find(const Evas_Canvas *obj, const char *name) +{ + return evas_canvas_object_name_find(obj, name); +} + +EAPI void +evas_font_path_append(Evas_Canvas *obj, const char *path) +{ + evas_canvas_font_path_append(obj, path); +} + +EAPI void +evas_font_path_clear(Evas_Canvas *obj) +{ + evas_canvas_font_path_clear(obj); +} + +EAPI void +evas_key_lock_del(Evas_Canvas *obj, const char *keyname) +{ + evas_canvas_key_lock_del(obj, keyname); +} + +EAPI void +evas_damage_rectangle_add(Evas_Canvas *obj, int x, int y, int w, int h) +{ + evas_canvas_damage_rectangle_add(obj, x, y, w, h); +} + +EAPI void +evas_sync(Evas_Canvas *obj) +{ + evas_canvas_sync(obj); +} + +EAPI const Eina_List * +evas_font_path_list(const Evas_Canvas *obj) +{ + return evas_canvas_font_path_list(obj); +} + +EAPI void +evas_image_cache_reload(Evas_Canvas *obj) +{ + evas_canvas_image_cache_reload(obj); +} + +EAPI int +evas_coord_world_x_to_screen(const Evas_Canvas *obj, int x) +{ + return evas_canvas_coord_world_x_to_screen(obj, x); +} + +EAPI Eina_List * +evas_render_updates(Evas_Canvas *obj) +{ + return evas_canvas_render_updates(obj); +} + +EAPI void +evas_image_cache_flush(Evas_Canvas *obj) +{ + evas_canvas_image_cache_flush(obj); +} + +EAPI int +evas_coord_screen_y_to_world(const Evas_Canvas *obj, int y) +{ + return evas_canvas_coord_screen_y_to_world(obj, y); +} + +EAPI void +evas_key_modifier_del(Evas_Canvas *obj, const char *keyname) +{ + evas_canvas_key_modifier_del(obj, keyname); +} + +EAPI void +evas_focus_in(Evas_Canvas *obj) +{ + evas_canvas_focus_in(obj); +} + +EAPI void +evas_obscured_rectangle_add(Evas_Canvas *obj, int x, int y, int w, int h) +{ + evas_canvas_obscured_rectangle_add(obj, x, y, w, h); +} + +EAPI void +evas_render_dump(Evas_Canvas *obj) +{ + evas_canvas_render_dump(obj); +} + +EAPI void +evas_render(Evas_Canvas *obj) +{ + evas_canvas_render(obj); +} + +EAPI void +evas_font_path_prepend(Evas_Canvas *obj, const char *path) +{ + evas_canvas_font_path_prepend(obj, path); +} + +EAPI void +evas_obscured_clear(Evas_Canvas *obj) +{ + evas_canvas_obscured_clear(obj); +} + +EAPI int +evas_coord_screen_x_to_world(const Evas_Canvas *obj, int x) +{ + return evas_canvas_coord_screen_x_to_world(obj, x); +} + +EAPI void +evas_key_lock_add(Evas_Canvas *obj, const char *keyname) +{ + evas_canvas_key_lock_add(obj, keyname); +} + +EAPI void +evas_render_idle_flush(Evas_Canvas *obj) +{ + evas_canvas_render_idle_flush(obj); +} + +EAPI Evas_Device * +evas_default_device_get(const Evas_Canvas *obj, Evas_Device_Class type) +{ + return evas_canvas_default_device_get(obj, type); +} + +EAPI int +evas_coord_world_y_to_screen(const Evas_Canvas *obj, int y) +{ + return evas_canvas_coord_world_y_to_screen(obj, y); +} diff --git a/src/lib/evas/canvas/evas_canvas_eo.legacy.h b/src/lib/evas/canvas/evas_canvas_eo.legacy.h new file mode 100644 index 0000000000..88a6591168 --- /dev/null +++ b/src/lib/evas/canvas/evas_canvas_eo.legacy.h @@ -0,0 +1,1023 @@ +#ifndef _EVAS_CANVAS_EO_LEGACY_H_ +#define _EVAS_CANVAS_EO_LEGACY_H_ + +#ifndef _EVAS_CANVAS_EO_CLASS_TYPE +#define _EVAS_CANVAS_EO_CLASS_TYPE + +typedef Eo Evas_Canvas; + +#endif + +#ifndef _EVAS_CANVAS_EO_TYPES +#define _EVAS_CANVAS_EO_TYPES + + +#endif + +/** + * @brief Set the image cache. + * + * This function sets the image cache of canvas in bytes. + * + * @param[in] obj The object. + * @param[in] size The cache size. + * + * @ingroup Evas_Group + */ +EAPI void evas_image_cache_set(Evas_Canvas *obj, int size); + +/** + * @brief Get the image cache. + * + * This function returns the image cache size of canvas in bytes. + * + * @param[in] obj The object. + * + * @return The cache size. + * + * @ingroup Evas_Group + */ +EAPI int evas_image_cache_get(const Evas_Canvas *obj); + +/** + * @brief Set the default set of flags an event begins with + * + * Events in evas can have an event_flags member. This starts out with an + * initial value (no flags). This lets you set the default flags that an event + * begins with to @c flags. + * + * @param[in] obj The object. + * @param[in] flags The default flags to use. + * + * @since 1.2 + * + * @ingroup Evas_Group + */ +EAPI void evas_event_default_flags_set(Evas_Canvas *obj, Evas_Event_Flags flags); + +/** + * @brief Get the default set of flags an event begins with + * + * This gets the default event flags events are produced with when fed in. + * + * @param[in] obj The object. + * + * @return The default flags to use. + * + * @since 1.2 + * + * @ingroup Evas_Group + */ +EAPI Evas_Event_Flags evas_event_default_flags_get(const Evas_Canvas *obj); + +/** + * @brief Changes the size of font cache of the given evas. + * + * @param[in] obj The object. + * @param[in] size The size in bytes. + * + * @ingroup Evas_Group + */ +EAPI void evas_font_cache_set(Evas_Canvas *obj, int size); + +/** + * @brief Get the size of font cache of the given evas in bytes. + * + * @param[in] obj The object. + * + * @return The size in bytes. + * + * @ingroup Evas_Group + */ +EAPI int evas_font_cache_get(const Evas_Canvas *obj); + +/** + * @brief Attaches a specific pointer to the evas for fetching later. + * + * @param[in] obj The object. + * @param[in] data The attached pointer. + * + * @ingroup Evas_Group + */ +EAPI void evas_data_attach_set(Evas_Canvas *obj, void *data); + +/** + * @brief Returns the pointer attached by @ref evas_data_attach_set. + * + * @param[in] obj The object. + * + * @return The attached pointer. + * + * @ingroup Evas_Group + */ +EAPI void *evas_data_attach_get(const Evas_Canvas *obj); + +/** + * @brief Retrieve the object focused by the default seat. + * + * Focused objects will be the ones having key events delivered to, which the + * programmer can act upon by means of @ref evas_object_event_callback_add + * usage. + * + * @note Most users wouldn't be dealing directly with Evas' focused objects. + * Instead, they would be using a higher level library for that (like a + * toolkit, as Elementary) to handle focus and who's receiving input for them. + * + * This call returns the object that currently has focus on the canvas @c e or + * @c null, if none. + * + * See also @ref evas_object_focus_set, @ref evas_object_focus_get, @ref + * evas_object_key_grab, @ref evas_object_key_ungrab, @ref evas_seat_focus_get, + * @ref Efl.Canvas.Object.seat_focus_check, + * @ref Efl.Canvas.Object.seat_focus_add, + * @ref Efl.Canvas.Object.seat_focus_del. + * + * @param[in] obj The object. + * + * @return The object that has focus or @c null if there is not one. + * + * @ingroup Evas_Group + */ +EAPI Efl_Canvas_Object *evas_focus_get(const Evas_Canvas *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Return the focused object by a given seat. + * + * @param[in] obj The object. + * @param[in] seat The seat to fetch the focused object or @c null for the + * default seat. + * + * @return The object that has the focus or @c null if the seat has no focused + * object. + * + * @since 1.19 + * + * @ingroup Evas_Group + */ +EAPI Efl_Canvas_Object *evas_seat_focus_get(const Evas_Canvas *obj, Evas_Device *seat); + +/** + * @brief Get the highest (stacked) Evas object on the canvas @c e. + * + * This function will take all populated layers in the canvas into account, + * getting the highest object for the highest layer, naturally. + * + * @warning This function will skip objects parented by smart objects, acting + * only on the ones at the "top level", with regard to object parenting. + * + * See also @ref evas_object_layer_get, @ref evas_object_layer_set, @ref + * evas_object_below_get, @ref evas_object_above_get. + * + * @param[in] obj The object. + * + * @return A pointer to the highest object on it (if any) or @c null otherwise. + * + * @ingroup Evas_Group + */ +EAPI Efl_Canvas_Object *evas_object_top_get(const Evas_Canvas *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief This function returns the current known default pointer coordinates. + * + * @param[in] obj The object. + * @param[in] dev The pointer device. + * @param[out] x The pointer to a Evas_Coord to be filled in. + * @param[out] y The pointer to a Evas_Coord to be filled in. + * + * @since 1.19 + * + * @ingroup Evas_Group + */ +EAPI void evas_pointer_canvas_xy_by_device_get(const Evas_Canvas *obj, Evas_Device *dev, int *x, int *y); + +/** + * @brief This function returns the current known default pointer coordinates + * + * This function returns the current known canvas unit coordinates of the mouse + * pointer and sets the contents of the Evas_Coords pointed to by @c x and @c y + * to contain these coordinates. If @c e is not a valid canvas the results of + * this function are undefined. + * + * @param[in] obj The object. + * @param[out] x The pointer to a Evas_Coord to be filled in. + * @param[out] y The pointer to a Evas_Coord to be filled in. + * + * @ingroup Evas_Group + */ +EAPI void evas_pointer_canvas_xy_get(const Evas_Canvas *obj, int *x, int *y); + +/** + * @brief Get the number of mouse or multi presses currently active. + * + * @param[in] obj The object. + * + * @return Mouse or multi presses currently active + * + * @since 1.2 + * + * @ingroup Evas_Group + */ +EAPI int evas_event_down_count_get(const Evas_Canvas *obj); + +/** + * @brief This gets the internal counter that counts the number of smart + * calculations. + * + * Whenever evas performs smart object calculations on the whole canvas it + * increments a counter by 1. This function returns the value of the smart + * object calculate counter. It starts with a value of 0 and will increase (and + * eventually wrap around to negative values and so on) by 1 every time objects + * are calculated. You can use this counter to ensure you don't re-do + * calculations withint the same calculation generation/run if the calculations + * maybe cause self-feeding effects. + * + * @param[in] obj The object. + * + * @return Number of smart calculations + * + * @since 1.1 + * + * @ingroup Evas_Group + */ +EAPI int evas_smart_objects_calculate_count_get(const Evas_Canvas *obj); + +/** + * @brief Get the focus state for the default seat. + * + * @param[in] obj The object. + * + * @return @c true if focused, @c false otherwise + * + * @ingroup Evas_Group + */ +EAPI Eina_Bool evas_focus_state_get(const Evas_Canvas *obj); + +/** + * @brief Get the focus state by a given seat. + * + * @param[in] obj The object. + * @param[in] seat The seat to check the focus state. Use @c null for the + * default seat. + * + * @return @c true if the seat has the canvas focus, @c false otherwise. + * + * @ingroup Evas_Group + */ +EAPI Eina_Bool evas_seat_focus_state_get(const Evas_Canvas *obj, Evas_Device *seat); + +/** + * @brief Get the changed marker for the canvas. + * + * @param[in] obj The object. + * + * @return @c true if changed, @c false otherwise + * + * @since 1.11 + * + * @ingroup Evas_Group + */ +EAPI Eina_Bool evas_changed_get(const Evas_Canvas *obj); + +/** + * @brief This function returns the current known pointer coordinates. + * + * @param[in] obj The object. + * @param[in] dev The mouse device. + * @param[out] x The pointer to an integer to be filled in. + * @param[out] y The pointer to an integer to be filled in. + * + * @since 1.19 + * + * @ingroup Evas_Group + */ +EAPI void evas_pointer_output_xy_by_device_get(const Evas_Canvas *obj, Evas_Device *dev, int *x, int *y); + +/** + * @brief This function returns the current known default pointer coordinates. + * + * This function returns the current known screen/output coordinates of the + * mouse pointer and sets the contents of the integers pointed to by @c x and + * @c y to contain these coordinates. If @c e is not a valid canvas the results + * of this function are undefined. + * + * @param[in] obj The object. + * @param[out] x The pointer to an integer to be filled in. + * @param[out] y The pointer to an integer to be filled in. + * + * @ingroup Evas_Group + */ +EAPI void evas_pointer_output_xy_get(const Evas_Canvas *obj, int *x, int *y); + +/** + * @brief Get the lowest (stacked) Evas object on the canvas @c e. + * + * This function will take all populated layers in the canvas into account, + * getting the lowest object for the lowest layer, naturally. + * + * @warning This function will skip objects parented by smart objects, acting + * only on the ones at the "top level", with regard to object parenting. + * + * See also @ref evas_object_layer_get, @ref evas_object_layer_set, @ref + * evas_object_below_get, @ref evas_object_below_set. + * + * @param[in] obj The object. + * + * @return A pointer to the lowest object on it, if any, or @c null otherwise. + * + * @ingroup Evas_Group + */ +EAPI Efl_Canvas_Object *evas_object_bottom_get(const Evas_Canvas *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Returns a bitmask with the mouse buttons currently pressed, set to 1. + * + * @param[in] obj The object. + * @param[in] dev The mouse device. + * + * @return A bitmask of the currently depressed buttons on the canvas. + * + * @ingroup Evas_Group + */ +EAPI unsigned int evas_pointer_button_down_mask_by_device_get(const Evas_Canvas *obj, Evas_Device *dev); + +/** + * @brief Returns a bitmask with the default mouse buttons currently pressed, + * set to 1. + * + * Calling this function will return a 32-bit integer with the appropriate bits + * set to 1, which correspond to a mouse button being depressed. This limits + * Evas to a mouse devices with a maximum of 32 buttons, but that is generally + * in excess of any host system's pointing device abilities. + * + * A canvas by default begins with no mouse buttons being pressed and only + * pointer move events can alter that. + * + * The least significant bit corresponds to the first mouse button (button 1) + * and the most significant bit corresponds to the last mouse button (button + * 32). + * + * If @c e is not a valid canvas, the return value is undefined. + * + * @param[in] obj The object. + * + * @return A bitmask of the currently depressed buttons on the canvas. + * + * @ingroup Evas_Group + */ +EAPI unsigned int evas_pointer_button_down_mask_get(const Evas_Canvas *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief 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. It will + * enter the smart objects. It will not append to the list pass events as + * hidden objects. Call eina_list_free on the returned list after usage. + * + * @param[in] obj The object. + * @param[in] stop An Evas Object where to stop searching. + * @param[in] x The horizontal coordinate of the position. + * @param[in] y The vertical coordinate of the position. + * + * @return List of objects + * + * @ingroup Evas_Group + */ +EAPI Eina_List *evas_tree_objects_at_xy_get(Evas_Canvas *obj, Efl_Canvas_Object *stop, int x, int y) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Enables or turns on programmatically the lock key with name + * @c keyname for the default seat. + * + * The effect will be as if the key was put on its active state after this + * call. + * + * See also @ref evas_key_lock_add, @ref evas_key_lock_del, + * @ref evas_key_lock_del, @ref evas_key_lock_off, @ref evas_seat_key_lock_on, + * @ref evas_seat_key_lock_off. + * + * @param[in] obj The object. + * @param[in] keyname The name of the lock to enable. + * + * @ingroup Evas_Group + */ +EAPI void evas_key_lock_on(Evas_Canvas *obj, const char *keyname) EINA_ARG_NONNULL(2); + +/** + * @brief Enables or turns on programmatically the lock key with name + * @c keyname for a give seat. + * + * The effect will be as if the key was put on its active state after this + * call. + * + * See also @ref evas_key_lock_add, @ref evas_key_lock_del, + * @ref evas_key_lock_del, @ref evas_key_lock_off, @ref evas_key_lock_on, + * @ref evas_seat_key_lock_off. + * + * @param[in] obj The object. + * @param[in] keyname The name of the lock to enable. + * @param[in] seat The seat to enable the keylock. A @c null seat repesents the + * default seat. + * + * @since 1.19 + * + * @ingroup Evas_Group + */ +EAPI void evas_seat_key_lock_on(Evas_Canvas *obj, const char *keyname, Evas_Device *seat) EINA_ARG_NONNULL(2); + +/** + * @brief Disables or turns off programmatically the lock key with name + * @c keyname for a given seat. + * + * The effect will be as if the key was put on its inactive state after this + * call. + * + * See also @ref evas_key_lock_on, @ref evas_seat_key_lock_on, + * @ref evas_key_lock_off. + * + * @param[in] obj The object. + * @param[in] keyname The name of the lock to enable. + * @param[in] seat The seat to disable the keylock. A @c null seat repesents + * the default seat. + * + * @since 1.19 + * + * @ingroup Evas_Group + */ +EAPI void evas_seat_key_lock_off(Evas_Canvas *obj, const char *keyname, Evas_Device *seat) EINA_ARG_NONNULL(2); + +/** + * @brief Adds the @c keyname key to the current list of modifier keys. + * + * Modifiers are keys like shift, alt and ctrl, i.e. keys which are meant to be + * pressed together with others, altering the behavior of the second keys + * pressed. Evas is so that these keys can be user defined. + * + * This call allows custom modifiers to be added to the Evas system at run + * time. It is then possible to set and unset modifier keys programmatically + * for other parts of the program to check and act on. Programmers using Evas + * would check for modifier keys on key event callbacks using @ref + * evas_key_modifier_is_set. + * + * @note If the programmer instantiates the canvas by means of the @ref + * ecore_evas_new family of helper functions, Ecore will take care of + * registering on it all standard modifiers: "Shift", "Control", "Alt", "Meta", + * "Hyper", "Super". + * + * @param[in] obj The object. + * @param[in] keyname The name of the modifier key to add to the list of Evas + * modifiers. + * + * @ingroup Evas_Group + */ +EAPI void evas_key_modifier_add(Evas_Canvas *obj, const char *keyname) EINA_ARG_NONNULL(2); + +/** + * @brief Disables or turns off programmatically the modifier key with name + * @c keyname for the default seat. + * + * See also @ref evas_key_modifier_add, @ref evas_key_modifier_get, + * @ref evas_key_modifier_on, @ref evas_seat_key_modifier_off, + * @ref evas_seat_key_modifier_off, @ref evas_key_modifier_is_set, @ref + * evas_seat_key_modifier_is_set. + * + * @param[in] obj The object. + * @param[in] keyname The name of the modifier to disable. + * + * @ingroup Evas_Group + */ +EAPI void evas_key_modifier_off(Evas_Canvas *obj, const char *keyname) EINA_ARG_NONNULL(2); + +/** + * @brief Render the given Evas canvas asynchronously. + * + * This function only returns @c true when a frame will be rendered. If the + * previous frame is still rendering, @c false will be returned so the users + * know not to wait for the updates callback and just return to their main + * loop. + * + * If a @c func callback is given, a list of updated areas will be generated + * and the function will be called from the main thread after the rendered + * frame is flushed to the screen. The resulting list should be freed with @ref + * evas_render_updates_free. + * + * The list is given in the @c event_info parameter of the callback function. + * + * @param[in] obj The object. + * + * @return @c true if the canvas will render, @c false otherwise. + * + * @since 1.8 + * + * @ingroup Evas_Group + */ +EAPI Eina_Bool evas_render_async(Evas_Canvas *obj); + +/** Inform the evas that it lost the focus from the default seat. + * + * @ingroup Evas_Group + */ +EAPI void evas_focus_out(Evas_Canvas *obj); + +/** + * @brief Update the canvas internal objects but not triggering immediate + * renderization. + * + * This function updates the canvas internal objects not triggering + * renderization. To force renderization function @ref evas_render should be + * used. + * @param[in] obj The object. + * + * @ingroup Evas_Group + */ +EAPI void evas_norender(Evas_Canvas *obj); + +/** + * @brief Pop the nochange flag down 1. + * + * This tells evas, that while the nochange flag is greater than 0, do not mark + * objects as "changed" when making changes. + * + * @warning Do not use this function unless you know what Evas exactly works + * with "changed" state. + * @param[in] obj The object. + * + * @ingroup Evas_Group + */ +EAPI void evas_nochange_pop(Evas_Canvas *obj); + +/** + * @brief Disables or turns off programmatically the lock key with name + * @c keyname for the default seat. + * + * The effect will be as if the key was put on its inactive state after this + * call. + * + * See also @ref evas_key_lock_on, @ref evas_seat_key_lock_on, + * @ref evas_seat_key_lock_off. + * + * @param[in] obj The object. + * @param[in] keyname The name of the lock to disable. + * + * @ingroup Evas_Group + */ +EAPI void evas_key_lock_off(Evas_Canvas *obj, const char *keyname) EINA_ARG_NONNULL(2); + +/** + * @brief Push the nochange flag up 1 + * + * This tells evas, that while the nochange flag is greater than 0, do not mark + * objects as "changed" when making changes. + * + * @warning Do not use this function unless you know what Evas exactly works + * with "changed" state. + * @param[in] obj The object. + * + * @ingroup Evas_Group + */ +EAPI void evas_nochange_push(Evas_Canvas *obj); + +/** Force the given evas and associated engine to flush its font cache. + * + * @ingroup Evas_Group + */ +EAPI void evas_font_cache_flush(Evas_Canvas *obj); + +/** + * @brief Enables or turns on programmatically the modifier key with name + * @c keyname for the default seat. + * + * The effect will be as if the key was pressed for the whole time between this + * call and a matching evas_key_modifier_off(). + * + * See also @ref evas_key_modifier_off, @ref evas_seat_key_modifier_on, + * @ref evas_seat_key_modifier_off. + * + * @param[in] obj The object. + * @param[in] keyname The name of the modifier to enable. + * + * @ingroup Evas_Group + */ +EAPI void evas_key_modifier_on(Evas_Canvas *obj, const char *keyname) EINA_ARG_NONNULL(2); + +/** + * @brief Enables or turns on programmatically the modifier key with name + * @c keyname for a given seat. + * + * The effect will be as if the key was pressed for the whole time between this + * call and a matching @ref evas_seat_key_modifier_off. + * + * See also @ref evas_key_modifier_off, @ref evas_seat_key_modifier_on, + * @ref evas_seat_key_modifier_off. + * + * @param[in] obj The object. + * @param[in] keyname The name of the lock to enable. + * @param[in] seat The seat to enable the modifier. A @c null seat repesents + * the default seat. + * + * @since 1.19 + * + * @ingroup Evas_Group + */ +EAPI void evas_seat_key_modifier_on(Evas_Canvas *obj, const char *keyname, Evas_Device *seat) EINA_ARG_NONNULL(2); + +/** + * @brief Disables or turns off programmatically the modifier key with name + * @c keyname for a given seat. + * + * See also @ref evas_key_modifier_add, @ref evas_key_modifier_get, + * @ref evas_key_modifier_on, @ref evas_seat_key_modifier_off, + * @ref evas_seat_key_modifier_off, @ref evas_key_modifier_is_set, @ref + * evas_seat_key_modifier_is_set. + * + * @param[in] obj The object. + * @param[in] keyname The name of the lock to enable. + * @param[in] seat The seat to disable the modifier. A @c null seat repesents + * the default seat. + * + * @since 1.19 + * + * @ingroup Evas_Group + */ +EAPI void evas_seat_key_modifier_off(Evas_Canvas *obj, const char *keyname, Evas_Device *seat) EINA_ARG_NONNULL(2); + +/** + * @brief List of available font descriptions known or found by this evas. + * + * The list depends on Evas compile time configuration, such as fontconfig + * support, and the paths provided at runtime as explained in @ref + * Evas_Font_Path_Group. + * + * @param[in] obj The object. + * + * @return A newly allocated list of strings. Do not change the strings. Be + * sure to call @ref evas_font_available_list_free after you're done. + * + * @ingroup Evas_Group + */ +EAPI Eina_List *evas_font_available_list(const Evas_Canvas *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Retrieves the object on the given evas with the given name. + * + * This looks for the evas object given a name by @ref evas_object_name_set. If + * the name is not unique canvas-wide, then which one of the many objects with + * that name is returned is undefined, so only use this if you can ensure the + * object name is unique. + * + * @param[in] obj The object. + * @param[in] name The given name. + * + * @return If successful, the Evas object with the given name. Otherwise, + * @c null. + * + * @ingroup Evas_Group + */ +EAPI Efl_Canvas_Object *evas_object_name_find(const Evas_Canvas *obj, const char *name) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Appends a font path to the list of font paths used by the given evas. + * + * @param[in] obj The object. + * @param[in] path The new font path. + * + * @ingroup Evas_Group + */ +EAPI void evas_font_path_append(Evas_Canvas *obj, const char *path) EINA_ARG_NONNULL(2); + +/** Removes all font paths loaded into memory for the given evas. + * + * @ingroup Evas_Group + */ +EAPI void evas_font_path_clear(Evas_Canvas *obj); + + +/** + * @brief Removes the @c keyname key from the current list of lock keys on + * canvas @c e. + * + * @param[in] obj The object. + * @param[in] keyname The name of the key to remove from the locks list. + * + * @ingroup Evas_Group + */ +EAPI void evas_key_lock_del(Evas_Canvas *obj, const char *keyname) EINA_ARG_NONNULL(2); + +/** + * @brief Add a damage rectangle. + * + * This is the function by which one tells evas that a part of the canvas has + * to be repainted. + * + * @note All newly created Evas rectangles get the default color values of 255 + * 255 255 255 (opaque white). + * + * @param[in] obj The object. + * @param[in] x The rectangle's left position. + * @param[in] y The rectangle's top position. + * @param[in] w The rectangle's width. + * @param[in] h The rectangle's height. + * + * @ingroup Evas_Group + */ +EAPI void evas_damage_rectangle_add(Evas_Canvas *obj, int x, int y, int w, int h); + +/** Sync evas canvas + * + * @ingroup Evas_Group + */ +EAPI void evas_sync(Evas_Canvas *obj); + +/** + * @brief Retrieves the list of font paths used by the given evas. + * + * @param[in] obj The object. + * + * @return The list of font paths used. + * + * @ingroup Evas_Group + */ +EAPI const Eina_List *evas_font_path_list(const Evas_Canvas *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Reload the image cache. + * + * This function reloads the image cache of canvas. + * @param[in] obj The object. + * + * @ingroup Evas_Group + */ +EAPI void evas_image_cache_reload(Evas_Canvas *obj); + +/** + * @brief Convert/scale a canvas coordinate into output screen coordinates. + * + * This function takes in a horizontal coordinate as the @c x parameter and + * converts it into output units, accounting for output size, viewport size and + * location, returning it as the function return value. If @c e is invalid, + * the results are undefined. + * + * @param[in] obj The object. + * @param[in] x The canvas X coordinate. + * + * @return The output/screen coordinate translated to output coordinates. + * + * @ingroup Evas_Group + */ +EAPI int evas_coord_world_x_to_screen(const Evas_Canvas *obj, int x) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Force immediate renderization of the given Evas canvas. + * + * This function forces an immediate renderization update of the given canvas + * @c e. + * + * @note This is a very low level function, which most of Evas' users wouldn't + * care about. You might use it, for instance, to grab an Evas' canvas update + * regions and paint them back, using the canvas' pixmap, on a displaying + * system working below Evas. + * + * @note Evas is a stateful canvas. If no operations changing its state took + * place since the last rendering action, you won't see any changes and this + * call will be a no-op. + * + * @param[in] obj The object. + * + * @return A newly allocated list of updated rectangles of the canvas + * (@Eina.Rect structs). Free this list with @ref evas_render_updates_free. + * + * @ingroup Evas_Group + */ +EAPI Eina_List *evas_render_updates(Evas_Canvas *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Flush the image cache of the canvas. + * + * This function flushes image cache of canvas. + * @param[in] obj The object. + * + * @ingroup Evas_Group + */ +EAPI void evas_image_cache_flush(Evas_Canvas *obj); + +/** + * @brief Convert/scale an output screen coordinate into canvas coordinates. + * + * This function takes in a vertical coordinate as the @c y parameter and + * converts it into canvas units, accounting for output size, viewport size and + * location, returning it as the function return value. If @c e is invalid, the + * results are undefined. + * + * @param[in] obj The object. + * @param[in] y The screen/output y coordinate. + * + * @return The screen coordinate translated to canvas unit coordinates. + * + * @ingroup Evas_Group + */ +EAPI int evas_coord_screen_y_to_world(const Evas_Canvas *obj, int y) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Removes the @c keyname key from the current list of modifier keys on + * canvas @c e. + * + * See also @ref evas_key_modifier_add. + * + * @param[in] obj The object. + * @param[in] keyname The name of the key to remove from the modifiers list. + * + * @ingroup Evas_Group + */ +EAPI void evas_key_modifier_del(Evas_Canvas *obj, const char *keyname) EINA_ARG_NONNULL(2); + +/** Inform to the evas that it got the focus from the default seat. + * + * @ingroup Evas_Group + */ +EAPI void evas_focus_in(Evas_Canvas *obj); + + + +/** + * @brief Add an "obscured region" to an Evas canvas. + * + * This is the function by which one tells an Evas canvas that a part of it + * must not be repainted. The region must be rectangular and its coordinates + * inside the canvas viewport are passed in the call. After this call, the + * region specified won't participate in any form in Evas' calculations and + * actions during its rendering updates, having its displaying content frozen + * as it was just after this function took place. + * + * We call it "obscured region" because the most common use case for this + * rendering (partial) freeze is something else (most probably other canvas) + * being on top of the specified rectangular region, thus shading it completely + * from the user's final scene in a display. To avoid unnecessary processing, + * one should indicate to the obscured canvas not to bother about the + * non-important area. + * + * The majority of users won't have to worry about this function, as they'll be + * using just one canvas in their applications, with nothing inset or on top of + * it in any form. + * + * To make this region one that has to be repainted again, call the function + * @ref evas_obscured_clear. + * + * @note This is a very low level function, which most of Evas' users wouldn't + * care about. + * + * @note This function does not flag the canvas as having its state changed. If + * you want to re-render it afterwards expecting new contents, you have to add + * "damage" regions yourself (see @ref evas_damage_rectangle_add). + * + * @param[in] obj The object. + * @param[in] x The rectangle's top left corner's horizontal coordinate. + * @param[in] y The rectangle's top left corner's vertical coordinate. + * @param[in] w The rectangle's width. + * @param[in] h The rectangle's height. + * + * @ingroup Evas_Group + */ +EAPI void evas_obscured_rectangle_add(Evas_Canvas *obj, int x, int y, int w, int h); + +/** + * @brief Make the canvas discard as much data as possible used by the engine + * at runtime. + * + * This function will unload images, delete textures and much more where + * possible. You may also want to call @ref evas_render_idle_flush immediately + * prior to this to perhaps discard a little more, though this function should + * implicitly delete most of what @ref evas_render_idle_flush might discard + * too. + * @param[in] obj The object. + * + * @ingroup Evas_Group + */ +EAPI void evas_render_dump(Evas_Canvas *obj); + +/** Force renderization of the given canvas. + * + * @ingroup Evas_Group + */ +EAPI void evas_render(Evas_Canvas *obj); + +/** + * @brief Prepends a font path to the list of font paths used by the given + * evas. + * + * @param[in] obj The object. + * @param[in] path The new font path. + * + * @ingroup Evas_Group + */ +EAPI void evas_font_path_prepend(Evas_Canvas *obj, const char *path) EINA_ARG_NONNULL(2); + +/** + * @brief Remove all "obscured regions" from an Evas canvas. + * + * This function removes all the rectangles from the obscured regions list of + * the canvas @c e. It takes obscured areas added with + * @ref evas_obscured_rectangle_add and make them again a regions that have to + * be repainted on rendering updates. + * + * @note This is a very low level function, which most of Evas' users wouldn't + * care about. + * + * @note This function does not flag the canvas as having its state changed. If + * you want to re-render it afterwards expecting new contents, you have to add + * "damage" regions yourself (see @ref evas_damage_rectangle_add). + * @param[in] obj The object. + * + * @ingroup Evas_Group + */ +EAPI void evas_obscured_clear(Evas_Canvas *obj); + +/** + * @brief Convert/scale an output screen coordinate into canvas coordinates. + * + * This function takes in a horizontal coordinate as the @c x parameter and + * converts it into canvas units, accounting for output size, viewport size and + * location, returning it as the function return value. If @c e is invalid, the + * results are undefined. + * + * @param[in] obj The object. + * @param[in] x The screen/output x coordinate. + * + * @return The screen coordinate translated to canvas unit coordinates. + * + * @ingroup Evas_Group + */ +EAPI int evas_coord_screen_x_to_world(const Evas_Canvas *obj, int x) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Adds the @c keyname key to the current list of lock keys. + * + * Locks are keys like caps lock, num lock or scroll lock, i.e., keys which are + * meant to be pressed once -- toggling a binary state which is bound to it -- + * and thus altering the behavior of all subsequently pressed keys somehow, + * depending on its state. Evas is so that these keys can be defined by the + * user. + * + * This allows custom locks to be added to the evas system at run time. It is + * then possible to set and unset lock keys programmatically for other parts of + * the program to check and act on. Programmers using Evas would check for lock + * keys on key event callbacks using @ref evas_key_lock_is_set. + * + * @note If the programmer instantiates the canvas by means of the + * ecore_evas_new() family of helper functions, Ecore will take care of + * registering on it all standard lock keys: "Caps_Lock", "Num_Lock", + * "Scroll_Lock". + * + * @param[in] obj The object. + * @param[in] keyname The name of the key to add to the locks list. + * + * @ingroup Evas_Group + */ +EAPI void evas_key_lock_add(Evas_Canvas *obj, const char *keyname) EINA_ARG_NONNULL(2); + +/** + * @brief Make the canvas discard internally cached data used for rendering. + * + * This function flushes the arrays of delete, active and render objects. Other + * things it may also discard are: shared memory segments, temporary scratch + * buffers, cached data to avoid re-compute of that data etc. + * @param[in] obj The object. + * + * @ingroup Evas_Group + */ +EAPI void evas_render_idle_flush(Evas_Canvas *obj); + +/** + * @brief Return the default device of a given type. + * + * @note Currently EFL only creates a seat, mouse and keyboard. + * + * @param[in] obj The object. + * @param[in] type The class of the default device to fetch. + * + * @return The default device or @c null on error. + * + * @since 1.19 + * + * @ingroup Evas_Group + */ +EAPI Evas_Device *evas_default_device_get(const Evas_Canvas *obj, Evas_Device_Class type); + +/** + * @brief Convert/scale a canvas coordinate into output screen coordinates. + * + * This function takes in a vertical coordinate as the @c x parameter and + * converts it into output units, accounting for output size, viewport size and + * location, returning it as the function return value. If @c e is invalid, the + * results are undefined. + * + * @param[in] obj The object. + * @param[in] y The canvas y coordinate. + * + * @return The output/screen coordinate translated to output coordinates. + * + * @ingroup Evas_Group + */ +EAPI int evas_coord_world_y_to_screen(const Evas_Canvas *obj, int y) EINA_WARN_UNUSED_RESULT; + +#endif diff --git a/src/lib/evas/canvas/evas_clip.c b/src/lib/evas/canvas/evas_clip.c index 54c021f1b2..809c24f72a 100644 --- a/src/lib/evas/canvas/evas_clip.c +++ b/src/lib/evas/canvas/evas_clip.c @@ -190,7 +190,7 @@ evas_object_mapped_clip_across_mark(Evas_Object *eo_obj, Evas_Object_Protected_D } static void -_efl_canvas_object_clip_mask_unset(Evas_Object_Protected_Data *obj) +_efl_canvas_object_clipper_mask_unset(Evas_Object_Protected_Data *obj) { EVAS_OBJECT_DATA_VALID_CHECK(obj); if (!obj->mask->is_mask) return; @@ -218,7 +218,7 @@ extern const char *o_image_type; 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, +_efl_canvas_object_clipper_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *eo_clip, Evas_Object_Protected_Data *clip) { if (!obj) obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); @@ -259,7 +259,7 @@ err_type: } static inline void -_efl_canvas_object_clip_unset_common(Evas_Object_Protected_Data *obj, Eina_Bool warn) +_efl_canvas_object_clipper_unset_common(Evas_Object_Protected_Data *obj, Eina_Bool warn) { Evas_Object_Protected_Data *clip = obj->cur->clipper; @@ -289,7 +289,8 @@ _efl_canvas_object_clip_unset_common(Evas_Object_Protected_Data *obj, Eina_Bool if (((clip->cur) && (clip->cur->visible)) && (((clip->cur->color.r != 255) || (clip->cur->color.g != 255) || (clip->cur->color.b != 255) || (clip->cur->color.a != 255)) || - (clip->mask->is_mask))) + (clip->mask->is_mask)) && + efl_alive_get(clip->object)) { if (clip->layer) { @@ -302,7 +303,7 @@ _efl_canvas_object_clip_unset_common(Evas_Object_Protected_Data *obj, Eina_Bool } } - _efl_canvas_object_clip_mask_unset(clip); + _efl_canvas_object_clipper_mask_unset(clip); } evas_object_change(clip->object, clip); if (obj->prev->clipper != clip) @@ -315,10 +316,9 @@ _efl_canvas_object_clip_unset_common(Evas_Object_Protected_Data *obj, Eina_Bool } EOLIAN void -_efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *eo_clip) +_efl_canvas_object_clipper_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *eo_clip) { Evas_Object_Protected_Data *clip; - Evas_Public_Data *e; EVAS_OBJECT_DATA_ALIVE_CHECK(obj); @@ -332,7 +332,7 @@ _efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Ob return; } - if (_efl_canvas_object_clip_set_block(eo_obj, obj, eo_clip, clip)) return; + if (_efl_canvas_object_clipper_set_block(eo_obj, obj, eo_clip, clip)) return; if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 1, eo_clip)) return; if (obj->is_smart && obj->smart.smart && obj->smart.smart->smart_class && @@ -342,7 +342,7 @@ _efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Ob } /* unset cur clipper */ - _efl_canvas_object_clip_unset_common(obj, EINA_TRUE); + _efl_canvas_object_clipper_unset_common(obj, EINA_TRUE); /* image object clipper */ if (clip->type == o_image_type) @@ -353,22 +353,6 @@ _efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Ob } /* clip me */ - if ((!clip->clip.clipees) && (clip->cur->visible)) - { - /* Basically it just went invisible */ - clip->changed = 1; - e = clip->layer->evas; - e->changed = 1; -/* i know this was to handle a case where a clip starts having children and - * stops being a solid colored box - no one ever does that... they hide the clp - * so dont add damages - evas_damage_rectangle_add(e->evas, - clip->cur->geometry.x + e->framespace.x, - clip->cur->geometry.y + e->framespace.y, - clip->cur->geometry.w, clip->cur->geometry.h); - */ - } - EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur) state_write->clipper = clip; EINA_COW_STATE_WRITE_END(obj, state_write, cur); @@ -408,7 +392,7 @@ _efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Ob } EOLIAN Evas_Object * -_efl_canvas_object_clip_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) +_efl_canvas_object_clipper_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) { EVAS_OBJECT_DATA_ALIVE_CHECK(obj, NULL); if (obj->cur->clipper) @@ -417,7 +401,7 @@ _efl_canvas_object_clip_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_ } Eina_Bool -_efl_canvas_object_clip_unset_block(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) +_efl_canvas_object_clipper_unset_block(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) { if (!obj->cur->clipper) return EINA_TRUE; @@ -431,14 +415,14 @@ _efl_canvas_object_clip_unset_block(Eo *eo_obj EINA_UNUSED, Evas_Object_Protecte static void _clip_unset(Eo *eo_obj, Evas_Object_Protected_Data *obj) { - if (_efl_canvas_object_clip_unset_block(eo_obj, obj)) return; + if (_efl_canvas_object_clipper_unset_block(eo_obj, obj)) return; if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 1, NULL)) return; if (obj->is_smart && obj->smart.smart && obj->smart.smart->smart_class && obj->smart.smart->smart_class->clip_unset) { obj->smart.smart->smart_class->clip_unset(eo_obj); } - _efl_canvas_object_clip_unset_common(obj, EINA_FALSE); + _efl_canvas_object_clipper_unset_common(obj, EINA_FALSE); evas_object_update_bounding_box(eo_obj, obj, NULL); evas_object_change(eo_obj, obj); evas_object_clip_dirty(eo_obj, obj); @@ -486,7 +470,7 @@ _clipper_invalidated_cb(void *data, const Efl_Event *event) } void -_efl_canvas_object_clip_prev_reset(Evas_Object_Protected_Data *obj, Eina_Bool cur_prev) +_efl_canvas_object_clipper_prev_reset(Evas_Object_Protected_Data *obj, Eina_Bool cur_prev) { if (obj->prev->clipper) { @@ -519,6 +503,13 @@ evas_object_clipees_get(const Evas_Object *eo_obj) return answer; } +EAPI Eina_Bool +evas_object_clipees_has(const Evas_Object *eo_obj) +{ + Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj, EINA_FALSE); + return !!obj->clip.clipees; +} + typedef struct { Eina_Iterator iterator; @@ -553,7 +544,7 @@ _clipee_iterator_free(Clipee_Iterator *it) } EOLIAN Eina_Iterator * -_efl_canvas_object_clipees_get(const Eo *eo_obj, Evas_Object_Protected_Data *obj) +_efl_canvas_object_clipped_objects_get(const Eo *eo_obj, Evas_Object_Protected_Data *obj) { Clipee_Iterator *it; @@ -573,10 +564,10 @@ _efl_canvas_object_clipees_get(const Eo *eo_obj, Evas_Object_Protected_Data *obj return &it->iterator; } -EOLIAN Eina_Bool -_efl_canvas_object_clipees_has(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) +EOLIAN unsigned int +_efl_canvas_object_clipped_objects_count(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) { - return (obj->clip.clipees ? EINA_TRUE : EINA_FALSE); + return eina_list_count(obj->clip.clipees); } EOLIAN void diff --git a/src/lib/evas/canvas/evas_device.c b/src/lib/evas/canvas/evas_device.c index 3f52d59635..660f657158 100644 --- a/src/lib/evas/canvas/evas_device.c +++ b/src/lib/evas/canvas/evas_device.c @@ -50,7 +50,7 @@ _new_default_device_find(Evas_Public_Data *e, Evas_Device *old_dev) EINA_LIST_FOREACH(e->devices, l, dev) { - if (efl_input_device_type_get(dev) != old_class) + if ((Evas_Device_Class)efl_input_device_type_get(dev) != old_class) continue; def = dev; @@ -144,6 +144,12 @@ evas_device_get(Evas *eo_e, const char *name) return efl_canvas_scene_device_get(eo_e, name); } +EOLIAN Efl_Input_Device * +_evas_canvas_efl_canvas_scene_seat_default_get(Evas *eo_e EINA_UNUSED, Evas_Public_Data *e) +{ + return e->default_seat; +} + EOLIAN Efl_Input_Device * _evas_canvas_efl_canvas_scene_seat_get(Evas *eo_e EINA_UNUSED, Evas_Public_Data *e, unsigned int id) { @@ -394,7 +400,7 @@ evas_device_class_set(Evas_Device *dev, Evas_Device_Class clas) Efl_Input_Device_Data *d = efl_data_scope_get(dev, EFL_INPUT_DEVICE_CLASS); Evas_Public_Data *edata = efl_data_scope_get(d->evas, EVAS_CANVAS_CLASS); - if (d->klass == clas) + if ((Evas_Device_Class)d->klass == clas) return; if (_is_pointer(d->klass)) @@ -520,3 +526,31 @@ _evas_device_top_get(const Evas *eo_e) if (num < 1) return NULL; return eina_array_data_get(e->cur_device, num - 1); } + +EOLIAN Eina_Bool +_evas_canvas_efl_canvas_scene_pointer_position_get(const Eo *eo_e, Evas_Public_Data *e, Efl_Input_Device *seat, Eina_Position2D *pos) +{ + Eina_Iterator *it; + Eo *child; + + if (!pos) return EINA_FALSE; + + *pos = EINA_POSITION2D(0, 0); + if (!e->default_seat) return EINA_FALSE; + if (!seat) + { + evas_pointer_canvas_xy_get(eo_e, &pos->x, &pos->y); + return EINA_TRUE; + } + it = efl_input_device_children_iterate(seat); + EINA_SAFETY_ON_NULL_RETURN_VAL(it, EINA_FALSE); + + EINA_ITERATOR_FOREACH(it, child) + if (_is_pointer(efl_input_device_type_get(child))) + break; + if (child) + *pos = efl_input_pointer_position_get(child); + + eina_iterator_free(it); + return !!child; +} diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c index 7a2d4cc67b..bff66c81d9 100644 --- a/src/lib/evas/canvas/evas_events.c +++ b/src/lib/evas/canvas/evas_events.c @@ -1843,7 +1843,7 @@ _canvas_event_feed_mouse_updown(Eo *eo_e, int b, Evas_Button_Flags flags, if (!e) return; EVAS_EVENT_FEED_SAFETY_CHECK(e); - evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, eo_e, (void **) &ev); + evt = efl_input_pointer_instance_get( eo_e, (void **) &ev); if (!ev) return; ev->data = (void *) data; @@ -1957,7 +1957,7 @@ evas_event_feed_mouse_cancel(Eo *eo_e, unsigned int timestamp, const void *data) Efl_Input_Pointer_Data *ev = NULL; Efl_Input_Pointer *evt; - evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, eo_e, (void **) &ev); + evt = efl_input_pointer_instance_get( eo_e, (void **) &ev); if (!ev) return; EVAS_EVENT_FEED_SAFETY_CHECK(e); @@ -2048,7 +2048,7 @@ evas_event_feed_mouse_wheel(Eo *eo_e, int direction, int z, unsigned int timesta { EINA_SAFETY_ON_FALSE_RETURN(efl_isa(eo_e, EVAS_CANVAS_CLASS)); Efl_Input_Pointer_Data *ev = NULL; - Efl_Input_Pointer *evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, eo_e, (void **) &ev); + Efl_Input_Pointer *evt = efl_input_pointer_instance_get( eo_e, (void **) &ev); if (!ev) return; @@ -2489,7 +2489,7 @@ _canvas_event_feed_mouse_move_legacy(Evas *eo_e, Evas_Public_Data *e, int x, int Efl_Input_Pointer_Data *ev = NULL; Efl_Input_Pointer *evt; - evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, eo_e, (void **) &ev); + evt = efl_input_pointer_instance_get( eo_e, (void **) &ev); if (!ev) return; ev->data = (void *) data; @@ -2716,7 +2716,7 @@ _canvas_event_feed_mouse_inout_legacy(Eo *eo_e, unsigned int timestamp, Efl_Input_Pointer_Data *ev = NULL; Efl_Input_Pointer *evt; - evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, eo_e, (void **) &ev); + evt = efl_input_pointer_instance_get( eo_e, (void **) &ev); if (!ev) return; ev->timestamp = timestamp; @@ -2938,7 +2938,7 @@ _canvas_event_feed_multi_internal(Evas *eo_e, Evas_Public_Data *e, Efl_Input_Pointer_Data *ev = NULL; Efl_Input_Pointer *evt; - evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, eo_e, (void **) &ev); + evt = efl_input_pointer_instance_get( eo_e, (void **) &ev); if (!e || !ev) return; EVAS_EVENT_FEED_SAFETY_CHECK(e); @@ -3417,7 +3417,7 @@ _canvas_event_feed_key_legacy(Eo *eo_e, Evas_Public_Data *e, if (!keyname) return; - evt = efl_input_instance_get(EFL_INPUT_KEY_CLASS, eo_e, (void **) &ev); + evt = efl_input_key_instance_get( eo_e, (void **) &ev); if (!ev) return; ev->keyname = (char *) keyname; @@ -3491,7 +3491,7 @@ evas_event_feed_hold(Eo *eo_e, int hold, unsigned int timestamp, const void *dat event_id = _evas_object_event_new(); - evt = efl_input_instance_get(EFL_INPUT_HOLD_CLASS, eo_e, (void **) &ev); + evt = efl_input_hold_instance_get(eo_e, (void **) &ev); if (!ev) return; ev->hold = !!hold; @@ -3590,7 +3590,7 @@ evas_event_feed_axis_update(Evas *eo_e, unsigned int timestamp, int device, int if (!e) return; EVAS_EVENT_FEED_SAFETY_CHECK(e); - evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, eo_e, (void **) &ev); + evt = efl_input_pointer_instance_get( eo_e, (void **) &ev); if (!ev) return; ev->data = (void *) data; @@ -3715,23 +3715,53 @@ _feed_mouse_move_eval_internal(Eo *eo_obj, Evas_Object_Protected_Data *obj) evas->last_timestamp, NULL); } } - EOLIAN void -_efl_canvas_object_freeze_events_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bool freeze) +_efl_canvas_object_efl_object_event_freeze(Eo *obj, Evas_Object_Protected_Data *pd) { - freeze = !!freeze; - if (obj->freeze_events == freeze) return; - obj->freeze_events = freeze; - evas_object_smart_member_cache_invalidate(eo_obj, EINA_FALSE, EINA_TRUE, - EINA_FALSE); - if (obj->freeze_events) return; - _feed_mouse_move_eval_internal(eo_obj, obj); + efl_event_freeze(efl_super(obj, EFL_CANVAS_OBJECT_CLASS)); + if (efl_event_freeze_count_get(obj) == 1) + { + pd->freeze_events = EINA_TRUE; + evas_object_smart_member_cache_invalidate(obj, EINA_FALSE, EINA_TRUE, + EINA_FALSE); + } } -EOLIAN Eina_Bool -_efl_canvas_object_freeze_events_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) +EOLIAN void +_efl_canvas_object_efl_object_event_thaw(Eo *obj, Evas_Object_Protected_Data *pd) { - return obj->freeze_events; + if (efl_event_freeze_count_get(obj) == 1) + { + pd->freeze_events = EINA_FALSE; + evas_object_smart_member_cache_invalidate(obj, EINA_FALSE, EINA_TRUE, + EINA_FALSE); + _feed_mouse_move_eval_internal(obj, pd); + } + efl_event_thaw(efl_super(obj, EFL_CANVAS_OBJECT_CLASS)); +} + +EAPI void +evas_object_freeze_events_set(Eo *eo_obj, Eina_Bool freeze) +{ + Evas_Object_Protected_Data *pd = EVAS_OBJECT_DATA_SAFE_GET(eo_obj); + EINA_SAFETY_ON_NULL_RETURN(pd); + + freeze = !!freeze; + if (pd->freeze_events == freeze) return; + + if (freeze) + efl_event_freeze(eo_obj); + else + // The following check is needed, as eo does not accept more thaw calls than freeze calls. + // However, evas legacy stuff accepted multiple flase sets + if (efl_event_freeze_count_get(eo_obj) > 0) + efl_event_thaw(eo_obj); +} + +EAPI Eina_Bool +evas_object_freeze_events_get(const Eo *eo_obj EINA_UNUSED) +{ + return (efl_event_freeze_count_get(eo_obj) > 0); } EOLIAN void @@ -4203,7 +4233,7 @@ _evas_canvas_event_pointer_move_event_dispatch(Evas_Public_Data *edata, Efl_Input_Pointer_Data *ev = NULL; Efl_Input_Pointer *evt; - evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, edata->evas, + evt = efl_input_pointer_instance_get( edata->evas, (void **) &ev); if (!evt) return; diff --git a/src/lib/evas/canvas/evas_focus.c b/src/lib/evas/canvas/evas_focus.c index 52ad4fe033..d76c1042dc 100644 --- a/src/lib/evas/canvas/evas_focus.c +++ b/src/lib/evas/canvas/evas_focus.c @@ -107,7 +107,7 @@ _evas_focus_dispatch_event(Evas_Object_Protected_Data *obj, Efl_Input_Device *se const Efl_Event_Description *efl_object_focus_event; EVAS_OBJECT_DATA_VALID_CHECK(obj); - evt = efl_input_instance_get(EFL_INPUT_FOCUS_CLASS, + evt = efl_input_focus_instance_get( efl_provider_find(obj->object, EVAS_CANVAS_CLASS), (void **) &ev_data); if (!evt) return; diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c index e4006ab611..bee08dd143 100644 --- a/src/lib/evas/canvas/evas_font_dir.c +++ b/src/lib/evas/canvas/evas_font_dir.c @@ -223,8 +223,8 @@ evas_fonts_zero_free() if (fd->source) eina_stringshare_del(fd->source); evas_common_font_free((RGBA_Font *)fd->font); #ifdef HAVE_FONTCONFIG - if (fd->set) FcFontSetDestroy(fd->set); - if (fd->p_nm) FcPatternDestroy(fd->p_nm); + if (fd->set) FcFontSetDestroy(fd->set); + if (fd->p_nm) FcPatternDestroy(fd->p_nm); #endif free(fd); } @@ -559,9 +559,9 @@ evas_font_name_parse(Evas_Font_Description *fdesc, const char *name) end = strchr(name, ':'); if (!end) - eina_stringshare_replace(&(fdesc->name), name); + eina_stringshare_replace(&(fdesc->name), name); else - eina_stringshare_replace_length(&(fdesc->name), name, end - name); + eina_stringshare_replace_length(&(fdesc->name), name, end - name); while (end) { @@ -569,9 +569,9 @@ evas_font_name_parse(Evas_Font_Description *fdesc, const char *name) name = end; end = strchr(end + 1, ':'); if (!end) - tend = name + strlen(name); + tend = name + strlen(name); else - tend = end; + tend = end; if (!strncmp(name, ":style=", 7)) { @@ -636,9 +636,9 @@ evas_font_load(const Eina_List *font_paths, int hinting, Evas_Font_Description * fdesc->is_new = EINA_FALSE; if (fdesc->slant != EVAS_FONT_SLANT_NORMAL) - wanted_rend |= FONT_REND_SLANT; + wanted_rend |= FONT_REND_SLANT; if (fdesc->weight == EVAS_FONT_WEIGHT_BOLD) - wanted_rend |= FONT_REND_WEIGHT; + wanted_rend |= FONT_REND_WEIGHT; evas_font_init(); @@ -693,7 +693,7 @@ evas_font_load(const Eina_List *font_paths, int hinting, Evas_Font_Description * #ifdef HAVE_FONTCONFIG else if (fd->set && fd->p_nm && !fd->file_font) { - found_fd = fd; + found_fd = fd; } #endif } @@ -969,7 +969,7 @@ evas_font_load(const Eina_List *font_paths, int hinting, Evas_Font_Description * } if (font) - evas_common_font_hinting_set((RGBA_Font *)font, hinting); + evas_common_font_hinting_set((RGBA_Font *)font, hinting); return font; } diff --git a/src/lib/evas/canvas/evas_grid.eo b/src/lib/evas/canvas/evas_grid.eo deleted file mode 100644 index 74ea3316a3..0000000000 --- a/src/lib/evas/canvas/evas_grid.eo +++ /dev/null @@ -1,123 +0,0 @@ -class Evas.Grid extends Efl.Canvas.Group -{ - [[Evas grid class]] - legacy_prefix: evas_object_grid; - eo_prefix: evas_obj_grid; - methods { - @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 @.grid_size.set - - @since 1.1]] - legacy: evas_object_grid_size_get; - } - values { - w: int; [[The virtual horizontal size (resolution) in integer units.]] - h: int; [[The virtual vertical size (resolution) in integer units.]] - } - } - @property children { - get { - [[Get the list of children for the grid. - - Note: This is a duplicate of the list kept by the grid internally. - It's up to the user to destroy it when it no longer needs it. - It's possible to remove objects from the grid when walking this - list, but these removals won't be reflected on it. - - @since 1.1]] - return: list @owned @warn_unused; [[Iterator to grid children]] - } - } - accessor_new @const { - [[Get an accessor to get random access to the list of children for the grid. - - Note: Do not remove or delete objects while walking the list. - - @since 1.1]] - return: accessor @owned @warn_unused; [[Accessor to children list]] - } - clear { - [[Faster way to remove all child objects from a grid object. - - @since 1.1]] - - params { - @in clear: bool; [[If $true, it will delete just removed children.]] - } - } - iterator_new @const { - [[Get an iterator to walk the list of children for the grid. - - Note: Do not remove or delete objects while walking the list. - - @since 1.1]] - return: iterator @owned @warn_unused; [[Iterator]] - } - add_to { - [[Create a grid that is child of a given element parent. - - \@ref evas_object_grid_add() - - @since 1.1]] - - return: Efl.Canvas.Object @warn_unused; [[New child object]] - } - unpack { - [[Remove child from grid. - - Note: removing a child will immediately call a walk over children in order - to recalculate numbers of columns and rows. If you plan to remove - all children, use evas_object_grid_clear() instead. - - @since 1.1]] - - return: bool; [[1 on success, 0 on failure.]] - params { - @in child: Efl.Canvas.Object @nonull; [[Child to be removed]] - } - } - pack_get @const { - [[Get the pack options for a grid child - - Get the pack x, y, width and height in virtual coordinates set by - @.pack. - - @since 1.1]] - return: bool; [[1 on success, 0 on failure.]] - params { - @in child: Efl.Canvas.Object; [[The grid child to query for coordinates.]] - @out x: int; [[The pointer to where the x coordinate will be returned.]] - @out y: int; [[The pointer to where the y coordinate will be returned.]] - @out w: int; [[The pointer to where the width will be returned.]] - @out h: int; [[The pointer to where the height will be returned.]] - } - } - pack { - [[Add a new child to a grid object. - - @since 1.1]] - - return: bool; [[1 on success, 0 on failure.]] - params { - @in child: Efl.Canvas.Object @nonull; [[The child object to add.]] - @in x: int; [[The virtual x coordinate of the child.]] - @in y: int; [[The virtual y coordinate of the child.]] - @in w: int; [[The virtual width of the child.]] - @in h: int; [[The virtual height of the child.]] - } - } - } - implements { - Efl.Object.constructor; - Efl.Ui.I18n.mirrored {get; set;} - } -} diff --git a/src/lib/evas/canvas/evas_grid_eo.c b/src/lib/evas/canvas/evas_grid_eo.c new file mode 100644 index 0000000000..331cd0f9ef --- /dev/null +++ b/src/lib/evas/canvas/evas_grid_eo.c @@ -0,0 +1,95 @@ + +void _evas_grid_grid_size_set(Eo *obj, Evas_Grid_Data *pd, int w, int h); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_grid_size_set, EFL_FUNC_CALL(w, h), int w, int h); + +void _evas_grid_grid_size_get(const Eo *obj, Evas_Grid_Data *pd, int *w, int *h); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_obj_grid_size_get, EFL_FUNC_CALL(w, h), int *w, int *h); + +Eina_List *_evas_grid_children_get(const Eo *obj, Evas_Grid_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_grid_children_get, Eina_List *, NULL); + +Eina_Accessor *_evas_grid_accessor_new(const Eo *obj, Evas_Grid_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_grid_accessor_new, Eina_Accessor *, NULL); + +void _evas_grid_clear(Eo *obj, Evas_Grid_Data *pd, Eina_Bool clear); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_grid_clear, EFL_FUNC_CALL(clear), Eina_Bool clear); + +Eina_Iterator *_evas_grid_iterator_new(const Eo *obj, Evas_Grid_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_grid_iterator_new, Eina_Iterator *, NULL); + +Efl_Canvas_Object *_evas_grid_add_to(Eo *obj, Evas_Grid_Data *pd); + +EOAPI EFL_FUNC_BODY(evas_obj_grid_add_to, Efl_Canvas_Object *, NULL); + +Eina_Bool _evas_grid_unpack(Eo *obj, Evas_Grid_Data *pd, Efl_Canvas_Object *child); + +EOAPI EFL_FUNC_BODYV(evas_obj_grid_unpack, Eina_Bool, 0, EFL_FUNC_CALL(child), Efl_Canvas_Object *child); + +Eina_Bool _evas_grid_pack_get(const Eo *obj, Evas_Grid_Data *pd, Efl_Canvas_Object *child, int *x, int *y, int *w, int *h); + +EOAPI EFL_FUNC_BODYV_CONST(evas_obj_grid_pack_get, Eina_Bool, 0, EFL_FUNC_CALL(child, x, y, w, h), Efl_Canvas_Object *child, int *x, int *y, int *w, int *h); + +Eina_Bool _evas_grid_pack(Eo *obj, Evas_Grid_Data *pd, Efl_Canvas_Object *child, int x, int y, int w, int h); + +EOAPI EFL_FUNC_BODYV(evas_obj_grid_pack, Eina_Bool, 0, EFL_FUNC_CALL(child, x, y, w, h), Efl_Canvas_Object *child, int x, int y, int w, int h); + +Efl_Object *_evas_grid_efl_object_constructor(Eo *obj, Evas_Grid_Data *pd); + + +void _evas_grid_efl_ui_i18n_mirrored_set(Eo *obj, Evas_Grid_Data *pd, Eina_Bool rtl); + + +Eina_Bool _evas_grid_efl_ui_i18n_mirrored_get(const Eo *obj, Evas_Grid_Data *pd); + + +static Eina_Bool +_evas_grid_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EVAS_GRID_EXTRA_OPS +#define EVAS_GRID_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(evas_obj_grid_size_set, _evas_grid_grid_size_set), + EFL_OBJECT_OP_FUNC(evas_obj_grid_size_get, _evas_grid_grid_size_get), + EFL_OBJECT_OP_FUNC(evas_obj_grid_children_get, _evas_grid_children_get), + EFL_OBJECT_OP_FUNC(evas_obj_grid_accessor_new, _evas_grid_accessor_new), + EFL_OBJECT_OP_FUNC(evas_obj_grid_clear, _evas_grid_clear), + EFL_OBJECT_OP_FUNC(evas_obj_grid_iterator_new, _evas_grid_iterator_new), + EFL_OBJECT_OP_FUNC(evas_obj_grid_add_to, _evas_grid_add_to), + EFL_OBJECT_OP_FUNC(evas_obj_grid_unpack, _evas_grid_unpack), + EFL_OBJECT_OP_FUNC(evas_obj_grid_pack_get, _evas_grid_pack_get), + EFL_OBJECT_OP_FUNC(evas_obj_grid_pack, _evas_grid_pack), + EFL_OBJECT_OP_FUNC(efl_constructor, _evas_grid_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_mirrored_set, _evas_grid_efl_ui_i18n_mirrored_set), + EFL_OBJECT_OP_FUNC(efl_ui_mirrored_get, _evas_grid_efl_ui_i18n_mirrored_get), + EVAS_GRID_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _evas_grid_class_desc = { + EO_VERSION, + "Evas.Grid", + EFL_CLASS_TYPE_REGULAR, + sizeof(Evas_Grid_Data), + _evas_grid_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(evas_grid_class_get, &_evas_grid_class_desc, EFL_CANVAS_GROUP_CLASS, NULL); + +#include "evas_grid_eo.legacy.c" diff --git a/src/lib/evas/canvas/evas_grid_eo.h b/src/lib/evas/canvas/evas_grid_eo.h new file mode 100644 index 0000000000..4064c62e1d --- /dev/null +++ b/src/lib/evas/canvas/evas_grid_eo.h @@ -0,0 +1,185 @@ +#ifndef _EVAS_GRID_EO_H_ +#define _EVAS_GRID_EO_H_ + +#ifndef _EVAS_GRID_EO_CLASS_TYPE +#define _EVAS_GRID_EO_CLASS_TYPE + +typedef Eo Evas_Grid; + +#endif + +#ifndef _EVAS_GRID_EO_TYPES +#define _EVAS_GRID_EO_TYPES + + +#endif +/** Evas grid class + * + * @ingroup Evas_Grid + */ +#define EVAS_GRID_CLASS evas_grid_class_get() + +EWAPI const Efl_Class *evas_grid_class_get(void); + +/** + * @brief Set the virtual resolution for the grid + * + * @param[in] obj The object. + * @param[in] w The virtual horizontal size (resolution) in integer units. + * @param[in] h The virtual vertical size (resolution) in integer units. + * + * @since 1.1 + * + * @ingroup Evas_Grid + */ +EOAPI void evas_obj_grid_size_set(Eo *obj, int w, int h); + +/** + * @brief Get the current virtual resolution + * + * See also @ref evas_obj_grid_size_set + * + * @param[in] obj The object. + * @param[out] w The virtual horizontal size (resolution) in integer units. + * @param[out] h The virtual vertical size (resolution) in integer units. + * + * @since 1.1 + * + * @ingroup Evas_Grid + */ +EOAPI void evas_obj_grid_size_get(const Eo *obj, int *w, int *h); + +/** + * @brief Get the list of children for the grid. + * + * @note This is a duplicate of the list kept by the grid internally. It's up + * to the user to destroy it when it no longer needs it. It's possible to + * remove objects from the grid when walking this list, but these removals + * won't be reflected on it. + * + * @param[in] obj The object. + * + * @return Iterator to grid children + * + * @since 1.1 + * + * @ingroup Evas_Grid + */ +EOAPI Eina_List *evas_obj_grid_children_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get an accessor to get random access to the list of children for the + * grid. + * + * @note Do not remove or delete objects while walking the list. + * + * @param[in] obj The object. + * + * @return Accessor to children list + * + * @since 1.1 + * + * @ingroup Evas_Grid + */ +EOAPI Eina_Accessor *evas_obj_grid_accessor_new(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Faster way to remove all child objects from a grid object. + * + * @param[in] obj The object. + * @param[in] clear If @c true, it will delete just removed children. + * + * @since 1.1 + * + * @ingroup Evas_Grid + */ +EOAPI void evas_obj_grid_clear(Eo *obj, Eina_Bool clear); + +/** + * @brief Get an iterator to walk the list of children for the grid. + * + * @note Do not remove or delete objects while walking the list. + * + * @param[in] obj The object. + * + * @return Iterator + * + * @since 1.1 + * + * @ingroup Evas_Grid + */ +EOAPI Eina_Iterator *evas_obj_grid_iterator_new(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Create a grid that is child of a given element parent. + * + * @ref evas_object_grid_add() + * + * @param[in] obj The object. + * + * @return New child object + * + * @since 1.1 + * + * @ingroup Evas_Grid + */ +EOAPI Efl_Canvas_Object *evas_obj_grid_add_to(Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Remove child from grid. + * + * @note removing a child will immediately call a walk over children in order + * to recalculate numbers of columns and rows. If you plan to remove all + * children, use evas_object_grid_clear() instead. + * + * @param[in] obj The object. + * @param[in] child Child to be removed + * + * @return 1 on success, 0 on failure. + * + * @since 1.1 + * + * @ingroup Evas_Grid + */ +EOAPI Eina_Bool evas_obj_grid_unpack(Eo *obj, Efl_Canvas_Object *child) EINA_ARG_NONNULL(2); + +/** + * @brief Get the pack options for a grid child + * + * Get the pack x, y, width and height in virtual coordinates set by + * @ref evas_obj_grid_pack. + * + * @param[in] obj The object. + * @param[in] child The grid child to query for coordinates. + * @param[out] x The pointer to where the x coordinate will be returned. + * @param[out] y The pointer to where the y coordinate will be returned. + * @param[out] w The pointer to where the width will be returned. + * @param[out] h The pointer to where the height will be returned. + * + * @return 1 on success, 0 on failure. + * + * @since 1.1 + * + * @ingroup Evas_Grid + */ +EOAPI Eina_Bool evas_obj_grid_pack_get(const Eo *obj, Efl_Canvas_Object *child, int *x, int *y, int *w, int *h); + +/** + * @brief Add a new child to a grid object. + * + * @param[in] obj The object. + * @param[in] child The child object to add. + * @param[in] x The virtual x coordinate of the child. + * @param[in] y The virtual y coordinate of the child. + * @param[in] w The virtual width of the child. + * @param[in] h The virtual height of the child. + * + * @return 1 on success, 0 on failure. + * + * @since 1.1 + * + * @ingroup Evas_Grid + */ +EOAPI Eina_Bool evas_obj_grid_pack(Eo *obj, Efl_Canvas_Object *child, int x, int y, int w, int h) EINA_ARG_NONNULL(2); + +#endif diff --git a/src/lib/evas/canvas/evas_grid_eo.hh b/src/lib/evas/canvas/evas_grid_eo.hh new file mode 100644 index 0000000000..51b00edd86 --- /dev/null +++ b/src/lib/evas/canvas/evas_grid_eo.hh @@ -0,0 +1,366 @@ +#ifndef EVAS_GRID_EO_HH +#define EVAS_GRID_EO_HH +#include + +extern "C" { +#include "efl_canvas_group.eo.h" +#include "efl_canvas_object.eo.h" +#include "efl_canvas_pointer.eo.h" +#include "efl_class.eo.h" +#include "efl_gfx_color.eo.h" +#include "efl_gfx_entity.eo.h" +#include "efl_gfx_hint.eo.h" +#include "efl_gfx_mapping.eo.h" +#include "efl_gfx_stack.eo.h" +#include "efl_input_device.eo.h" +#include "efl_input_focus.eo.h" +#include "efl_input_hold.eo.h" +#include "efl_input_interface.eo.h" +#include "efl_input_key.eo.h" +#include "efl_input_pointer.eo.h" +#include "efl_loop.eo.h" +#include "efl_loop_consumer.eo.h" +#include "efl_object.eo.h" +#include "efl_ui_i18n.eo.h" +#include "evas_grid_eo.h" +} +#include +#include +#include "efl_canvas_group.eo.hh" +#include "efl_canvas_object.eo.hh" +#include "efl_canvas_pointer.eo.hh" +#include "efl_class.eo.hh" +#include "efl_gfx_color.eo.hh" +#include "efl_gfx_entity.eo.hh" +#include "efl_gfx_hint.eo.hh" +#include "efl_gfx_mapping.eo.hh" +#include "efl_gfx_stack.eo.hh" +#include "efl_input_device.eo.hh" +#include "efl_input_focus.eo.hh" +#include "efl_input_hold.eo.hh" +#include "efl_input_interface.eo.hh" +#include "efl_input_key.eo.hh" +#include "efl_input_pointer.eo.hh" +#include "efl_loop.eo.hh" +#include "efl_loop_consumer.eo.hh" +#include "efl_object.eo.hh" +#include "efl_ui_i18n.eo.hh" +#ifndef EVAS_GRID_FWD_GUARD +#define EVAS_GRID_FWD_GUARD +namespace evas { +struct Grid; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Grid> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Grid&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Grid const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Grid const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CLASS_FWD_GUARD +#define EFL_CLASS_FWD_GUARD +namespace efl { +struct Class; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_COLOR_FWD_GUARD +#define EFL_GFX_COLOR_FWD_GUARD +namespace efl { namespace gfx { +struct Color; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_DEVICE_FWD_GUARD +#define EFL_INPUT_DEVICE_FWD_GUARD +namespace efl { namespace input { +struct Device; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_ENTITY_FWD_GUARD +#define EFL_GFX_ENTITY_FWD_GUARD +namespace efl { namespace gfx { +struct Entity; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_HINT_FWD_GUARD +#define EFL_GFX_HINT_FWD_GUARD +namespace efl { namespace gfx { +struct Hint; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_FOCUS_FWD_GUARD +#define EFL_INPUT_FOCUS_FWD_GUARD +namespace efl { namespace input { +struct Focus; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_HOLD_FWD_GUARD +#define EFL_INPUT_HOLD_FWD_GUARD +namespace efl { namespace input { +struct Hold; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_UI_I18N_FWD_GUARD +#define EFL_UI_I18N_FWD_GUARD +namespace efl { namespace ui { +struct I18n; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_INTERFACE_FWD_GUARD +#define EFL_INPUT_INTERFACE_FWD_GUARD +namespace efl { namespace input { +struct Interface; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_KEY_FWD_GUARD +#define EFL_INPUT_KEY_FWD_GUARD +namespace efl { namespace input { +struct Key; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_LOOP_FWD_GUARD +#define EFL_LOOP_FWD_GUARD +namespace efl { +struct Loop; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_LOOP_CONSUMER_FWD_GUARD +#define EFL_LOOP_CONSUMER_FWD_GUARD +namespace efl { +struct Loop_Consumer; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_OBJECT_FWD_GUARD +#define EFL_OBJECT_FWD_GUARD +namespace efl { +struct Object; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_GROUP_FWD_GUARD +#define EFL_CANVAS_GROUP_FWD_GUARD +namespace efl { namespace canvas { +struct Group; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Group> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Group&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Group const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Group const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_MAPPING_FWD_GUARD +#define EFL_GFX_MAPPING_FWD_GUARD +namespace efl { namespace gfx { +struct Mapping; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_OBJECT_FWD_GUARD +#define EFL_CANVAS_OBJECT_FWD_GUARD +namespace efl { namespace canvas { +struct Object; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_POINTER_FWD_GUARD +#define EFL_CANVAS_POINTER_FWD_GUARD +namespace efl { namespace canvas { +struct Pointer; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_POINTER_FWD_GUARD +#define EFL_INPUT_POINTER_FWD_GUARD +namespace efl { namespace input { +struct Pointer; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_STACK_FWD_GUARD +#define EFL_GFX_STACK_FWD_GUARD +namespace efl { namespace gfx { +struct Stack; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack const&> : ::std::true_type {}; } } +#endif + +namespace eo_cxx { +namespace evas { +struct Grid { + ::efl::eolian::return_traits::type grid_size_get( ::efl::eolian::out_traits::type w, ::efl::eolian::out_traits::type h) const; + ::efl::eolian::return_traits::type grid_size_set( ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const; + ::efl::eolian::return_traits< ::efl::eina::list< ::efl::canvas::Object>>::type children_get() const; + ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type accessor_new() const; + ::efl::eolian::return_traits::type clear( ::efl::eolian::in_traits::type clear) const; + ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type iterator_new() const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type add_to() const; + ::efl::eolian::return_traits::type unpack( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits::type pack_get( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y, ::efl::eolian::out_traits::type w, ::efl::eolian::out_traits::type h) const; + ::efl::eolian::return_traits::type pack( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const; + static Efl_Class const* _eo_class() + { + return EVAS_GRID_CLASS; + } + Eo* _eo_ptr() const { return *(reinterpret_cast(const_cast(this))); } + operator ::evas::Grid() const; + operator ::evas::Grid&(); + operator ::evas::Grid const&() const; + /// @cond LOCAL + ::efl::eolian::address_of_operator operator&() { return {this}; } + ::efl::eolian::address_of_operator operator&() const { return {this}; } + /// @endcond +}; +} +} +namespace evas { +struct Grid : private ::efl::eo::concrete + , EO_CXX_INHERIT(::efl::Loop_Consumer) + , EO_CXX_INHERIT(::efl::Object) + , EO_CXX_INHERIT(::efl::canvas::Group) + , EO_CXX_INHERIT(::efl::canvas::Object) + , EO_CXX_INHERIT(::efl::canvas::Pointer) + , EO_CXX_INHERIT(::efl::gfx::Color) + , EO_CXX_INHERIT(::efl::gfx::Entity) + , EO_CXX_INHERIT(::efl::gfx::Hint) + , EO_CXX_INHERIT(::efl::gfx::Mapping) + , EO_CXX_INHERIT(::efl::gfx::Stack) + , EO_CXX_INHERIT(::efl::input::Interface) + , EO_CXX_INHERIT(::efl::ui::I18n) +{ + explicit Grid( ::Eo* eo) + : ::efl::eo::concrete(eo) {} + Grid(std::nullptr_t) + : ::efl::eo::concrete(nullptr) {} + explicit Grid() = default; + Grid(Grid const&) = default; + Grid(Grid&&) = default; + Grid& operator=(Grid const&) = default; + Grid& operator=(Grid&&) = default; + template + Grid(Derived&& derived + , typename std::enable_if< + ::efl::eo::is_eolian_object::value + && std::is_base_of< Grid, Derived>::value>::type* = 0) + : ::efl::eo::concrete(derived._eo_ptr()) {} + + Grid( ::efl::eo::instantiate_t) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, ::efl::eo::concrete{nullptr}, _eo_class()); + } + template + explicit Grid( ::efl::eo::instantiate_t, T&& parent, typename std::enable_if< ::efl::eo::is_eolian_object::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, parent, _eo_class()); + } + template Grid( ::efl::eo::instantiate_t, F&& f, typename ::std::enable_if< ::efl::eolian::is_constructor_lambda::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, ::efl::eo::concrete{nullptr}, _eo_class(), *this, std::forward(f)); + } + template Grid( ::efl::eo::instantiate_t, T&& parent, F&& f, typename ::std::enable_if< ::efl::eolian::is_constructor_lambda::value && ::efl::eo::is_eolian_object::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, parent, _eo_class(), *this, std::forward(f)); + } + + ::efl::eolian::return_traits::type grid_size_get( ::efl::eolian::out_traits::type w, ::efl::eolian::out_traits::type h) const; + ::efl::eolian::return_traits::type grid_size_set( ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const; + ::efl::eolian::return_traits< ::efl::eina::list< ::efl::canvas::Object>>::type children_get() const; + ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type accessor_new() const; + ::efl::eolian::return_traits::type clear( ::efl::eolian::in_traits::type clear) const; + ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type iterator_new() const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type add_to() const; + ::efl::eolian::return_traits::type unpack( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits::type pack_get( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y, ::efl::eolian::out_traits::type w, ::efl::eolian::out_traits::type h) const; + ::efl::eolian::return_traits::type pack( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const; + static Efl_Class const* _eo_class() + { + return EVAS_GRID_CLASS; + } + Eo* _eo_ptr() const { return *(reinterpret_cast(const_cast(this))); } + /// @cond LOCAL + ::efl::eolian::address_of_operator operator&() { return {this}; } + ::efl::eolian::address_of_operator operator&() const { return {this}; } + /// @endcond + ::efl::eo::wref _get_wref() const { return ::efl::eo::wref(*this); } + ::efl::eo::concrete const& _get_concrete() const { return *this; } + ::efl::eo::concrete& _get_concrete() { return *this; } + using ::efl::eo::concrete::_eo_ptr; + using ::efl::eo::concrete::_release; + using ::efl::eo::concrete::_reset; + using ::efl::eo::concrete::_delete; + using ::efl::eo::concrete::operator bool; +#ifdef EFL_CXXPERIMENTAL + const Grid* operator->() const { return this; } + Grid* operator->() { return this; } + operator Eo*() const { return _eo_ptr(); } +#endif + friend bool operator==(Grid const& lhs, Grid const& rhs) + { return lhs._get_concrete() == rhs._get_concrete(); } + friend bool operator!=(Grid const& lhs, Grid const& rhs) + { return !(lhs == rhs); } +}; +static_assert(sizeof(Grid) == sizeof(Eo*), ""); +static_assert(std::is_standard_layout::value, ""); +} +#endif diff --git a/src/lib/evas/canvas/evas_grid_eo.impl.hh b/src/lib/evas/canvas/evas_grid_eo.impl.hh new file mode 100644 index 0000000000..2fdc784650 --- /dev/null +++ b/src/lib/evas/canvas/evas_grid_eo.impl.hh @@ -0,0 +1,164 @@ +#ifndef EVAS_GRID_IMPL_HH +#define EVAS_GRID_IMPL_HH + +#include "evas_grid_eo.hh" + +namespace evas { +inline ::efl::eolian::return_traits::type Grid::grid_size_get( ::efl::eolian::out_traits::type w, ::efl::eolian::out_traits::type h) const +{ + int __out_param_w = {}; + int __out_param_h = {}; + ::evas_obj_grid_size_get(_eo_ptr(), + & __out_param_w, + & __out_param_h); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(w, __out_param_w); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(h, __out_param_h); +} +inline ::efl::eolian::return_traits::type Grid::grid_size_set( ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const +{ + ::evas_obj_grid_size_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(w), + ::efl::eolian::convert_to_c::type>(h)); +} +inline ::efl::eolian::return_traits< ::efl::eina::list< ::efl::canvas::Object>>::type Grid::children_get() const +{ + Eina_List * __return_value = ::evas_obj_grid_children_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::list< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type Grid::accessor_new() const +{ + Eina_Accessor * __return_value = ::evas_obj_grid_accessor_new(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Grid::clear( ::efl::eolian::in_traits::type clear) const +{ + ::evas_obj_grid_clear(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(clear)); +} +inline ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type Grid::iterator_new() const +{ + Eina_Iterator * __return_value = ::evas_obj_grid_iterator_new(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Grid::add_to() const +{ + ::Efl_Canvas_Object* __return_value = ::evas_obj_grid_add_to(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Grid::unpack( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + Eina_Bool __return_value = ::evas_obj_grid_unpack(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Grid::pack_get( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y, ::efl::eolian::out_traits::type w, ::efl::eolian::out_traits::type h) const +{ + int __out_param_x = {}; + int __out_param_y = {}; + int __out_param_w = {}; + int __out_param_h = {}; + Eina_Bool __return_value = ::evas_obj_grid_pack_get(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + & __out_param_x, + & __out_param_y, + & __out_param_w, + & __out_param_h); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(x, __out_param_x); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(y, __out_param_y); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(w, __out_param_w); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(h, __out_param_h); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Grid::pack( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const +{ + Eina_Bool __return_value = ::evas_obj_grid_pack(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + ::efl::eolian::convert_to_c::type>(x), + ::efl::eolian::convert_to_c::type>(y), + ::efl::eolian::convert_to_c::type>(w), + ::efl::eolian::convert_to_c::type>(h)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +} +namespace eo_cxx { +namespace evas { +inline ::efl::eolian::return_traits::type Grid::grid_size_get( ::efl::eolian::out_traits::type w, ::efl::eolian::out_traits::type h) const +{ + int __out_param_w = {}; + int __out_param_h = {}; + ::evas_obj_grid_size_get(_eo_ptr(), + & __out_param_w, + & __out_param_h); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(w, __out_param_w); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(h, __out_param_h); +} +inline ::efl::eolian::return_traits::type Grid::grid_size_set( ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const +{ + ::evas_obj_grid_size_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(w), + ::efl::eolian::convert_to_c::type>(h)); +} +inline ::efl::eolian::return_traits< ::efl::eina::list< ::efl::canvas::Object>>::type Grid::children_get() const +{ + Eina_List * __return_value = ::evas_obj_grid_children_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::list< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type Grid::accessor_new() const +{ + Eina_Accessor * __return_value = ::evas_obj_grid_accessor_new(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Grid::clear( ::efl::eolian::in_traits::type clear) const +{ + ::evas_obj_grid_clear(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(clear)); +} +inline ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type Grid::iterator_new() const +{ + Eina_Iterator * __return_value = ::evas_obj_grid_iterator_new(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Grid::add_to() const +{ + ::Efl_Canvas_Object* __return_value = ::evas_obj_grid_add_to(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Grid::unpack( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + Eina_Bool __return_value = ::evas_obj_grid_unpack(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Grid::pack_get( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::out_traits::type x, ::efl::eolian::out_traits::type y, ::efl::eolian::out_traits::type w, ::efl::eolian::out_traits::type h) const +{ + int __out_param_x = {}; + int __out_param_y = {}; + int __out_param_w = {}; + int __out_param_h = {}; + Eina_Bool __return_value = ::evas_obj_grid_pack_get(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + & __out_param_x, + & __out_param_y, + & __out_param_w, + & __out_param_h); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(x, __out_param_x); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(y, __out_param_y); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(w, __out_param_w); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(h, __out_param_h); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Grid::pack( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const +{ + Eina_Bool __return_value = ::evas_obj_grid_pack(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + ::efl::eolian::convert_to_c::type>(x), + ::efl::eolian::convert_to_c::type>(y), + ::efl::eolian::convert_to_c::type>(w), + ::efl::eolian::convert_to_c::type>(h)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline evas::Grid::operator ::evas::Grid() const { return *static_cast< ::evas::Grid const*>(static_cast(this)); } +inline evas::Grid::operator ::evas::Grid&() { return *static_cast< ::evas::Grid*>(static_cast(this)); } +inline evas::Grid::operator ::evas::Grid const&() const { return *static_cast< ::evas::Grid const*>(static_cast(this)); } +} } +#endif diff --git a/src/lib/evas/canvas/evas_grid_eo.legacy.c b/src/lib/evas/canvas/evas_grid_eo.legacy.c new file mode 100644 index 0000000000..5447f1c390 --- /dev/null +++ b/src/lib/evas/canvas/evas_grid_eo.legacy.c @@ -0,0 +1,60 @@ + +EAPI void +evas_object_grid_size_set(Evas_Grid *obj, int w, int h) +{ + evas_obj_grid_size_set(obj, w, h); +} + +EAPI void +evas_object_grid_size_get(const Evas_Grid *obj, int *w, int *h) +{ + evas_obj_grid_size_get(obj, w, h); +} + +EAPI Eina_List * +evas_object_grid_children_get(const Evas_Grid *obj) +{ + return evas_obj_grid_children_get(obj); +} + +EAPI Eina_Accessor * +evas_object_grid_accessor_new(const Evas_Grid *obj) +{ + return evas_obj_grid_accessor_new(obj); +} + +EAPI void +evas_object_grid_clear(Evas_Grid *obj, Eina_Bool clear) +{ + evas_obj_grid_clear(obj, clear); +} + +EAPI Eina_Iterator * +evas_object_grid_iterator_new(const Evas_Grid *obj) +{ + return evas_obj_grid_iterator_new(obj); +} + +EAPI Efl_Canvas_Object * +evas_object_grid_add_to(Evas_Grid *obj) +{ + return evas_obj_grid_add_to(obj); +} + +EAPI Eina_Bool +evas_object_grid_unpack(Evas_Grid *obj, Efl_Canvas_Object *child) +{ + return evas_obj_grid_unpack(obj, child); +} + +EAPI Eina_Bool +evas_object_grid_pack_get(const Evas_Grid *obj, Efl_Canvas_Object *child, int *x, int *y, int *w, int *h) +{ + return evas_obj_grid_pack_get(obj, child, x, y, w, h); +} + +EAPI Eina_Bool +evas_object_grid_pack(Evas_Grid *obj, Efl_Canvas_Object *child, int x, int y, int w, int h) +{ + return evas_obj_grid_pack(obj, child, x, y, w, h); +} diff --git a/src/lib/evas/canvas/evas_grid_eo.legacy.h b/src/lib/evas/canvas/evas_grid_eo.legacy.h new file mode 100644 index 0000000000..9b48bf9b18 --- /dev/null +++ b/src/lib/evas/canvas/evas_grid_eo.legacy.h @@ -0,0 +1,178 @@ +#ifndef _EVAS_GRID_EO_LEGACY_H_ +#define _EVAS_GRID_EO_LEGACY_H_ + +#ifndef _EVAS_GRID_EO_CLASS_TYPE +#define _EVAS_GRID_EO_CLASS_TYPE + +typedef Eo Evas_Grid; + +#endif + +#ifndef _EVAS_GRID_EO_TYPES +#define _EVAS_GRID_EO_TYPES + + +#endif + +/** + * @brief Set the virtual resolution for the grid + * + * @param[in] obj The object. + * @param[in] w The virtual horizontal size (resolution) in integer units. + * @param[in] h The virtual vertical size (resolution) in integer units. + * + * @since 1.1 + * + * @ingroup Evas_Object_Grid_Group + */ +EAPI void evas_object_grid_size_set(Evas_Grid *obj, int w, int h); + +/** + * @brief Get the current virtual resolution + * + * See also @ref evas_object_grid_size_set + * + * @param[in] obj The object. + * @param[out] w The virtual horizontal size (resolution) in integer units. + * @param[out] h The virtual vertical size (resolution) in integer units. + * + * @since 1.1 + * + * @ingroup Evas_Object_Grid_Group + */ +EAPI void evas_object_grid_size_get(const Evas_Grid *obj, int *w, int *h); + +/** + * @brief Get the list of children for the grid. + * + * @note This is a duplicate of the list kept by the grid internally. It's up + * to the user to destroy it when it no longer needs it. It's possible to + * remove objects from the grid when walking this list, but these removals + * won't be reflected on it. + * + * @param[in] obj The object. + * + * @return Iterator to grid children + * + * @since 1.1 + * + * @ingroup Evas_Object_Grid_Group + */ +EAPI Eina_List *evas_object_grid_children_get(const Evas_Grid *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get an accessor to get random access to the list of children for the + * grid. + * + * @note Do not remove or delete objects while walking the list. + * + * @param[in] obj The object. + * + * @return Accessor to children list + * + * @since 1.1 + * + * @ingroup Evas_Object_Grid_Group + */ +EAPI Eina_Accessor *evas_object_grid_accessor_new(const Evas_Grid *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Faster way to remove all child objects from a grid object. + * + * @param[in] obj The object. + * @param[in] clear If @c true, it will delete just removed children. + * + * @since 1.1 + * + * @ingroup Evas_Object_Grid_Group + */ +EAPI void evas_object_grid_clear(Evas_Grid *obj, Eina_Bool clear); + +/** + * @brief Get an iterator to walk the list of children for the grid. + * + * @note Do not remove or delete objects while walking the list. + * + * @param[in] obj The object. + * + * @return Iterator + * + * @since 1.1 + * + * @ingroup Evas_Object_Grid_Group + */ +EAPI Eina_Iterator *evas_object_grid_iterator_new(const Evas_Grid *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Create a grid that is child of a given element parent. + * + * @ref evas_object_grid_add() + * + * @param[in] obj The object. + * + * @return New child object + * + * @since 1.1 + * + * @ingroup Evas_Object_Grid_Group + */ +EAPI Efl_Canvas_Object *evas_object_grid_add_to(Evas_Grid *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Remove child from grid. + * + * @note removing a child will immediately call a walk over children in order + * to recalculate numbers of columns and rows. If you plan to remove all + * children, use evas_object_grid_clear() instead. + * + * @param[in] obj The object. + * @param[in] child Child to be removed + * + * @return 1 on success, 0 on failure. + * + * @since 1.1 + * + * @ingroup Evas_Object_Grid_Group + */ +EAPI Eina_Bool evas_object_grid_unpack(Evas_Grid *obj, Efl_Canvas_Object *child) EINA_ARG_NONNULL(2); + +/** + * @brief Get the pack options for a grid child + * + * Get the pack x, y, width and height in virtual coordinates set by + * @ref evas_object_grid_pack. + * + * @param[in] obj The object. + * @param[in] child The grid child to query for coordinates. + * @param[out] x The pointer to where the x coordinate will be returned. + * @param[out] y The pointer to where the y coordinate will be returned. + * @param[out] w The pointer to where the width will be returned. + * @param[out] h The pointer to where the height will be returned. + * + * @return 1 on success, 0 on failure. + * + * @since 1.1 + * + * @ingroup Evas_Object_Grid_Group + */ +EAPI Eina_Bool evas_object_grid_pack_get(const Evas_Grid *obj, Efl_Canvas_Object *child, int *x, int *y, int *w, int *h); + +/** + * @brief Add a new child to a grid object. + * + * @param[in] obj The object. + * @param[in] child The child object to add. + * @param[in] x The virtual x coordinate of the child. + * @param[in] y The virtual y coordinate of the child. + * @param[in] w The virtual width of the child. + * @param[in] h The virtual height of the child. + * + * @return 1 on success, 0 on failure. + * + * @since 1.1 + * + * @ingroup Evas_Object_Grid_Group + */ +EAPI Eina_Bool evas_object_grid_pack(Evas_Grid *obj, Efl_Canvas_Object *child, int x, int y, int w, int h) EINA_ARG_NONNULL(2); + +#endif diff --git a/src/lib/evas/canvas/evas_image.eo b/src/lib/evas/canvas/evas_image.eo deleted file mode 100644 index f7163b7e50..0000000000 --- a/src/lib/evas/canvas/evas_image.eo +++ /dev/null @@ -1,8 +0,0 @@ -class Evas.Image extends Efl.Canvas.Image_Internal implements Efl.File -{ - [[Internal class for legacy support of Evas Image.]] - data: null; - implements { - Efl.File.mmap { get; set; } - } -} diff --git a/src/lib/evas/canvas/evas_image_eo.c b/src/lib/evas/canvas/evas_image_eo.c new file mode 100644 index 0000000000..6c67d08c27 --- /dev/null +++ b/src/lib/evas/canvas/evas_image_eo.c @@ -0,0 +1,35 @@ + +Eina_Error _evas_image_efl_file_load(Eo *obj, void *pd); + + +static Eina_Bool +_evas_image_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EVAS_IMAGE_EXTRA_OPS +#define EVAS_IMAGE_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_file_load, _evas_image_efl_file_load), + EVAS_IMAGE_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _evas_image_class_desc = { + EO_VERSION, + "Evas.Image", + EFL_CLASS_TYPE_REGULAR, + 0, + _evas_image_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(evas_image_class_get, &_evas_image_class_desc, EFL_CANVAS_IMAGE_INTERNAL_CLASS, EFL_FILE_MIXIN, NULL); diff --git a/src/lib/evas/canvas/evas_image_eo.h b/src/lib/evas/canvas/evas_image_eo.h new file mode 100644 index 0000000000..af9f1a038a --- /dev/null +++ b/src/lib/evas/canvas/evas_image_eo.h @@ -0,0 +1,24 @@ +#ifndef _EVAS_IMAGE_EO_H_ +#define _EVAS_IMAGE_EO_H_ + +#ifndef _EVAS_IMAGE_EO_CLASS_TYPE +#define _EVAS_IMAGE_EO_CLASS_TYPE + +typedef Eo Evas_Image; + +#endif + +#ifndef _EVAS_IMAGE_EO_TYPES +#define _EVAS_IMAGE_EO_TYPES + + +#endif +/** Internal class for legacy support of Evas Image. + * + * @ingroup Evas_Image + */ +#define EVAS_IMAGE_CLASS evas_image_class_get() + +EWAPI const Efl_Class *evas_image_class_get(void); + +#endif diff --git a/src/lib/evas/canvas/evas_image_eo.hh b/src/lib/evas/canvas/evas_image_eo.hh new file mode 100644 index 0000000000..bccd96ce23 --- /dev/null +++ b/src/lib/evas/canvas/evas_image_eo.hh @@ -0,0 +1,463 @@ +#ifndef EVAS_IMAGE_EO_HH +#define EVAS_IMAGE_EO_HH +#include + +extern "C" { +#include "efl_canvas_filter_internal.eo.h" +#include "efl_canvas_image_internal.eo.h" +#include "efl_canvas_object.eo.h" +#include "efl_canvas_pointer.eo.h" +#include "efl_class.eo.h" +#include "efl_file.eo.h" +#include "efl_file_save.eo.h" +#include "efl_gfx_buffer.eo.h" +#include "efl_gfx_color.eo.h" +#include "efl_gfx_entity.eo.h" +#include "efl_gfx_fill.eo.h" +#include "efl_gfx_filter.eo.h" +#include "efl_gfx_hint.eo.h" +#include "efl_gfx_image.eo.h" +#include "efl_gfx_mapping.eo.h" +#include "efl_gfx_stack.eo.h" +#include "efl_gfx_view.eo.h" +#include "efl_input_device.eo.h" +#include "efl_input_focus.eo.h" +#include "efl_input_hold.eo.h" +#include "efl_input_interface.eo.h" +#include "efl_input_key.eo.h" +#include "efl_input_pointer.eo.h" +#include "efl_loop.eo.h" +#include "efl_loop_consumer.eo.h" +#include "efl_object.eo.h" +#include "efl_orientation.eo.h" +#include "efl_ui_i18n.eo.h" +#include "evas_image_eo.h" +} +#include +#include +#include "efl_canvas_filter_internal.eo.hh" +#include "efl_canvas_image_internal.eo.hh" +#include "efl_canvas_object.eo.hh" +#include "efl_canvas_pointer.eo.hh" +#include "efl_class.eo.hh" +#include "efl_file.eo.hh" +#include "efl_file_save.eo.hh" +#include "efl_gfx_buffer.eo.hh" +#include "efl_gfx_color.eo.hh" +#include "efl_gfx_entity.eo.hh" +#include "efl_gfx_fill.eo.hh" +#include "efl_gfx_filter.eo.hh" +#include "efl_gfx_hint.eo.hh" +#include "efl_gfx_image.eo.hh" +#include "efl_gfx_mapping.eo.hh" +#include "efl_gfx_stack.eo.hh" +#include "efl_gfx_view.eo.hh" +#include "efl_input_device.eo.hh" +#include "efl_input_focus.eo.hh" +#include "efl_input_hold.eo.hh" +#include "efl_input_interface.eo.hh" +#include "efl_input_key.eo.hh" +#include "efl_input_pointer.eo.hh" +#include "efl_loop.eo.hh" +#include "efl_loop_consumer.eo.hh" +#include "efl_object.eo.hh" +#include "efl_orientation.eo.hh" +#include "efl_ui_i18n.eo.hh" +#ifndef EVAS_IMAGE_FWD_GUARD +#define EVAS_IMAGE_FWD_GUARD +namespace evas { +struct Image; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Image> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Image&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Image const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Image const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_BUFFER_FWD_GUARD +#define EFL_GFX_BUFFER_FWD_GUARD +namespace efl { namespace gfx { +struct Buffer; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Buffer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Buffer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Buffer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Buffer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CLASS_FWD_GUARD +#define EFL_CLASS_FWD_GUARD +namespace efl { +struct Class; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_FILE_FWD_GUARD +#define EFL_FILE_FWD_GUARD +namespace efl { +struct File; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::File> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::File&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::File const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::File const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_FILE_SAVE_FWD_GUARD +#define EFL_FILE_SAVE_FWD_GUARD +namespace efl { +struct File_Save; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::File_Save> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::File_Save&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::File_Save const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::File_Save const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_FILTER_INTERNAL_FWD_GUARD +#define EFL_CANVAS_FILTER_INTERNAL_FWD_GUARD +namespace efl { namespace canvas { namespace filter { +struct Internal; +} } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::filter::Internal> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::filter::Internal&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::filter::Internal const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::filter::Internal const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_COLOR_FWD_GUARD +#define EFL_GFX_COLOR_FWD_GUARD +namespace efl { namespace gfx { +struct Color; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_DEVICE_FWD_GUARD +#define EFL_INPUT_DEVICE_FWD_GUARD +namespace efl { namespace input { +struct Device; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_ENTITY_FWD_GUARD +#define EFL_GFX_ENTITY_FWD_GUARD +namespace efl { namespace gfx { +struct Entity; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_FILL_FWD_GUARD +#define EFL_GFX_FILL_FWD_GUARD +namespace efl { namespace gfx { +struct Fill; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Fill> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Fill&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Fill const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Fill const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_FILTER_FWD_GUARD +#define EFL_GFX_FILTER_FWD_GUARD +namespace efl { namespace gfx { +struct Filter; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Filter> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Filter&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Filter const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Filter const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_HINT_FWD_GUARD +#define EFL_GFX_HINT_FWD_GUARD +namespace efl { namespace gfx { +struct Hint; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_IMAGE_FWD_GUARD +#define EFL_GFX_IMAGE_FWD_GUARD +namespace efl { namespace gfx { +struct Image; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Image> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Image&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Image const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Image const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_FOCUS_FWD_GUARD +#define EFL_INPUT_FOCUS_FWD_GUARD +namespace efl { namespace input { +struct Focus; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_HOLD_FWD_GUARD +#define EFL_INPUT_HOLD_FWD_GUARD +namespace efl { namespace input { +struct Hold; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_UI_I18N_FWD_GUARD +#define EFL_UI_I18N_FWD_GUARD +namespace efl { namespace ui { +struct I18n; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_INTERFACE_FWD_GUARD +#define EFL_INPUT_INTERFACE_FWD_GUARD +namespace efl { namespace input { +struct Interface; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_KEY_FWD_GUARD +#define EFL_INPUT_KEY_FWD_GUARD +namespace efl { namespace input { +struct Key; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_LOOP_FWD_GUARD +#define EFL_LOOP_FWD_GUARD +namespace efl { +struct Loop; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_LOOP_CONSUMER_FWD_GUARD +#define EFL_LOOP_CONSUMER_FWD_GUARD +namespace efl { +struct Loop_Consumer; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_OBJECT_FWD_GUARD +#define EFL_OBJECT_FWD_GUARD +namespace efl { +struct Object; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_ORIENTATION_FWD_GUARD +#define EFL_ORIENTATION_FWD_GUARD +namespace efl { +struct Orientation; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Orientation> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Orientation&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Orientation const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Orientation const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_IMAGE_INTERNAL_FWD_GUARD +#define EFL_CANVAS_IMAGE_INTERNAL_FWD_GUARD +namespace efl { namespace canvas { +struct Image_Internal; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Image_Internal> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Image_Internal&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Image_Internal const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Image_Internal const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_MAPPING_FWD_GUARD +#define EFL_GFX_MAPPING_FWD_GUARD +namespace efl { namespace gfx { +struct Mapping; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_OBJECT_FWD_GUARD +#define EFL_CANVAS_OBJECT_FWD_GUARD +namespace efl { namespace canvas { +struct Object; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_POINTER_FWD_GUARD +#define EFL_CANVAS_POINTER_FWD_GUARD +namespace efl { namespace canvas { +struct Pointer; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_VIEW_FWD_GUARD +#define EFL_GFX_VIEW_FWD_GUARD +namespace efl { namespace gfx { +struct View; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::View> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::View&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::View const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::View const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_POINTER_FWD_GUARD +#define EFL_INPUT_POINTER_FWD_GUARD +namespace efl { namespace input { +struct Pointer; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_STACK_FWD_GUARD +#define EFL_GFX_STACK_FWD_GUARD +namespace efl { namespace gfx { +struct Stack; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack const&> : ::std::true_type {}; } } +#endif + +namespace eo_cxx { +namespace evas { +struct Image { + static Efl_Class const* _eo_class() + { + return EVAS_IMAGE_CLASS; + } + Eo* _eo_ptr() const { return *(reinterpret_cast(const_cast(this))); } + operator ::evas::Image() const; + operator ::evas::Image&(); + operator ::evas::Image const&() const; + /// @cond LOCAL + ::efl::eolian::address_of_operator operator&() { return {this}; } + ::efl::eolian::address_of_operator operator&() const { return {this}; } + /// @endcond +}; +} +} +namespace evas { +struct Image : private ::efl::eo::concrete + , EO_CXX_INHERIT(::efl::File) + , EO_CXX_INHERIT(::efl::File_Save) + , EO_CXX_INHERIT(::efl::Loop_Consumer) + , EO_CXX_INHERIT(::efl::Object) + , EO_CXX_INHERIT(::efl::Orientation) + , EO_CXX_INHERIT(::efl::canvas::Image_Internal) + , EO_CXX_INHERIT(::efl::canvas::Object) + , EO_CXX_INHERIT(::efl::canvas::Pointer) + , EO_CXX_INHERIT(::efl::canvas::filter::Internal) + , EO_CXX_INHERIT(::efl::gfx::Buffer) + , EO_CXX_INHERIT(::efl::gfx::Color) + , EO_CXX_INHERIT(::efl::gfx::Entity) + , EO_CXX_INHERIT(::efl::gfx::Fill) + , EO_CXX_INHERIT(::efl::gfx::Filter) + , EO_CXX_INHERIT(::efl::gfx::Hint) + , EO_CXX_INHERIT(::efl::gfx::Image) + , EO_CXX_INHERIT(::efl::gfx::Mapping) + , EO_CXX_INHERIT(::efl::gfx::Stack) + , EO_CXX_INHERIT(::efl::gfx::View) + , EO_CXX_INHERIT(::efl::input::Interface) + , EO_CXX_INHERIT(::efl::ui::I18n) +{ + explicit Image( ::Eo* eo) + : ::efl::eo::concrete(eo) {} + Image(std::nullptr_t) + : ::efl::eo::concrete(nullptr) {} + explicit Image() = default; + Image(Image const&) = default; + Image(Image&&) = default; + Image& operator=(Image const&) = default; + Image& operator=(Image&&) = default; + template + Image(Derived&& derived + , typename std::enable_if< + ::efl::eo::is_eolian_object::value + && std::is_base_of< Image, Derived>::value>::type* = 0) + : ::efl::eo::concrete(derived._eo_ptr()) {} + + Image( ::efl::eo::instantiate_t) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, ::efl::eo::concrete{nullptr}, _eo_class()); + } + template + explicit Image( ::efl::eo::instantiate_t, T&& parent, typename std::enable_if< ::efl::eo::is_eolian_object::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, parent, _eo_class()); + } + template Image( ::efl::eo::instantiate_t, F&& f, typename ::std::enable_if< ::efl::eolian::is_constructor_lambda::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, ::efl::eo::concrete{nullptr}, _eo_class(), *this, std::forward(f)); + } + template Image( ::efl::eo::instantiate_t, T&& parent, F&& f, typename ::std::enable_if< ::efl::eolian::is_constructor_lambda::value && ::efl::eo::is_eolian_object::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, parent, _eo_class(), *this, std::forward(f)); + } + + static Efl_Class const* _eo_class() + { + return EVAS_IMAGE_CLASS; + } + Eo* _eo_ptr() const { return *(reinterpret_cast(const_cast(this))); } + /// @cond LOCAL + ::efl::eolian::address_of_operator operator&() { return {this}; } + ::efl::eolian::address_of_operator operator&() const { return {this}; } + /// @endcond + ::efl::eo::wref _get_wref() const { return ::efl::eo::wref(*this); } + ::efl::eo::concrete const& _get_concrete() const { return *this; } + ::efl::eo::concrete& _get_concrete() { return *this; } + using ::efl::eo::concrete::_eo_ptr; + using ::efl::eo::concrete::_release; + using ::efl::eo::concrete::_reset; + using ::efl::eo::concrete::_delete; + using ::efl::eo::concrete::operator bool; +#ifdef EFL_CXXPERIMENTAL + const Image* operator->() const { return this; } + Image* operator->() { return this; } + operator Eo*() const { return _eo_ptr(); } +#endif + friend bool operator==(Image const& lhs, Image const& rhs) + { return lhs._get_concrete() == rhs._get_concrete(); } + friend bool operator!=(Image const& lhs, Image const& rhs) + { return !(lhs == rhs); } +}; +static_assert(sizeof(Image) == sizeof(Eo*), ""); +static_assert(std::is_standard_layout::value, ""); +} +#endif diff --git a/src/lib/evas/canvas/evas_image_eo.impl.hh b/src/lib/evas/canvas/evas_image_eo.impl.hh new file mode 100644 index 0000000000..89c0a7c54f --- /dev/null +++ b/src/lib/evas/canvas/evas_image_eo.impl.hh @@ -0,0 +1,14 @@ +#ifndef EVAS_IMAGE_IMPL_HH +#define EVAS_IMAGE_IMPL_HH + +#include "evas_image_eo.hh" + +namespace evas { +} +namespace eo_cxx { +namespace evas { +inline evas::Image::operator ::evas::Image() const { return *static_cast< ::evas::Image const*>(static_cast(this)); } +inline evas::Image::operator ::evas::Image&() { return *static_cast< ::evas::Image*>(static_cast(this)); } +inline evas::Image::operator ::evas::Image const&() const { return *static_cast< ::evas::Image const*>(static_cast(this)); } +} } +#endif diff --git a/src/lib/evas/canvas/evas_image_eo.legacy.h b/src/lib/evas/canvas/evas_image_eo.legacy.h new file mode 100644 index 0000000000..8f1f62556a --- /dev/null +++ b/src/lib/evas/canvas/evas_image_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _EVAS_IMAGE_EO_LEGACY_H_ +#define _EVAS_IMAGE_EO_LEGACY_H_ + +#ifndef _EVAS_IMAGE_EO_CLASS_TYPE +#define _EVAS_IMAGE_EO_CLASS_TYPE + +typedef Eo Evas_Image; + +#endif + +#ifndef _EVAS_IMAGE_EO_TYPES +#define _EVAS_IMAGE_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/evas/canvas/evas_image_legacy.c b/src/lib/evas/canvas/evas_image_legacy.c index 6fa92672d3..fc8172719c 100644 --- a/src/lib/evas/canvas/evas_image_legacy.c +++ b/src/lib/evas/canvas/evas_image_legacy.c @@ -1,7 +1,6 @@ -#define EFL_CANVAS_OBJECT_BETA #include "evas_image_private.h" -#include "evas_image.eo.h" +#include "evas_image_eo.h" #define EVAS_IMAGE_API(_o, ...) do { \ if (EINA_UNLIKELY(!efl_isa(_o, EFL_CANVAS_IMAGE_INTERNAL_CLASS))) { \ @@ -50,7 +49,7 @@ evas_object_image_memfile_set(Evas_Object *eo_obj, void *data, int size, char *f f = eina_file_virtualize(NULL, data, size, EINA_TRUE); if (!f) return ; - efl_file_mmap_set(eo_obj, f, key); + efl_file_simple_mmap_load(eo_obj, f, key); eina_file_close(f); } @@ -195,35 +194,66 @@ EAPI void evas_object_image_file_set(Evas_Object *obj, const char *file, const char *key) { EVAS_IMAGE_API(obj); - efl_file_set(obj, file, key); + efl_file_simple_load(obj, file, key); } EAPI void evas_object_image_file_get(const Evas_Object *obj, const char **file, const char **key) { EVAS_IMAGE_API(obj); - efl_file_get(obj, file, key); + efl_file_simple_get(obj, file, key); } EAPI void evas_object_image_mmap_set(Evas_Object *obj, const Eina_File *f, const char *key) { EVAS_IMAGE_API(obj); - _evas_image_mmap_set(obj, f, key); + efl_file_simple_mmap_load(obj, f, key); } EAPI void evas_object_image_mmap_get(const Evas_Object *obj, const Eina_File **f, const char **key) { EVAS_IMAGE_API(obj); - _evas_image_mmap_get(obj, f, key); + efl_file_simple_mmap_get(obj, f, key); } EAPI Eina_Bool evas_object_image_save(const Evas_Object *obj, const char *file, const char *key, const char *flags) { + char *encoding = NULL; + Efl_File_Save_Info info; + Eina_Error ret; + EVAS_IMAGE_API(obj, EINA_FALSE); - return efl_file_save(obj, file, key, flags); + + if (flags) + { + char *p, *pp; + char *tflags; + int quality = 80, compress = 9; + + tflags = alloca(strlen(flags) + 1); + strcpy(tflags, flags); + p = tflags; + while (p) + { + pp = strchr(p, ' '); + if (pp) *pp = 0; + sscanf(p, "quality=%4i", &quality); + sscanf(p, "compress=%4i", &compress); + sscanf(p, "encoding=%ms", &encoding); + if (pp) p = pp + 1; + else break; + } + info.quality = quality; + info.compression = compress; + info.encoding = encoding; + + } + ret = efl_file_save(obj, file, key, flags ? &info : NULL); + free(encoding); + return ret; } EAPI Eina_Bool @@ -363,7 +393,7 @@ EAPI Evas_Load_Error evas_object_image_load_error_get(const Evas_Object *obj) { EVAS_IMAGE_API(obj, EVAS_LOAD_ERROR_GENERIC); - return _evas_image_load_error_get(obj); + return _efl_gfx_image_load_error_to_evas_load_error(efl_gfx_image_load_error_get(obj)); } EAPI void @@ -512,7 +542,7 @@ evas_object_image_native_surface_set(Evas_Object *eo_obj, Evas_Native_Surface *s { Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS); - o->load_error = EVAS_LOAD_ERROR_GENERIC; + o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_GENERIC; } } @@ -549,9 +579,13 @@ evas_object_image_pixels_dirty_set(Eo *eo_obj, Eina_Bool dirty) Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS); evas_object_async_block(obj); - if (dirty) o->dirty_pixels = EINA_TRUE; + if (dirty) + { + o->dirty_pixels = EINA_TRUE; + o->changed = EINA_TRUE; + } else o->dirty_pixels = EINA_FALSE; - o->changed = EINA_TRUE; + evas_object_change(eo_obj, obj); } @@ -635,7 +669,7 @@ evas_object_image_data_set(Eo *eo_obj, void *data) o->changed = EINA_TRUE; evas_object_change(eo_obj, obj); } - o->load_error = EVAS_LOAD_ERROR_NONE; + o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_NONE; if ((o->cur->image.w != 0) || (o->cur->image.h != 0)) resize_call = EINA_TRUE; @@ -684,6 +718,7 @@ evas_object_image_data_get(const Eo *eo_obj, Eina_Bool for_writing) void *pixels = NULL; int stride = 0; DATA32 *data; + int load_error; if (!o->engine_data) return NULL; @@ -697,7 +732,8 @@ evas_object_image_data_get(const Eo *eo_obj, Eina_Bool for_writing) ENFN->image_scale_hint_set(ENC, o->engine_data, o->scale_hint); if (ENFN->image_content_hint_set) ENFN->image_content_hint_set(ENC, o->engine_data, o->content_hint); - pixels = ENFN->image_data_get(ENC, o->engine_data, for_writing, &data, &o->load_error, &tofree); + pixels = ENFN->image_data_get(ENC, o->engine_data, for_writing, &data, &load_error, &tofree); + o->load_error = _evas_load_error_to_efl_gfx_image_load_error(load_error); /* if we fail to get engine_data, we have to return NULL */ if (!pixels || !data) goto error; @@ -1076,6 +1112,7 @@ evas_object_image_data_convert(Evas_Object *eo_obj, Evas_Colorspace to_cspace) void *engine_data; DATA32 *data; void* result = NULL; + int load_error; static int warned = 0; if (!warned) @@ -1096,7 +1133,8 @@ evas_object_image_data_convert(Evas_Object *eo_obj, Evas_Colorspace to_cspace) ENFN->image_data_preload_cancel(ENC, o->engine_data, eo_obj, EINA_TRUE); } data = NULL; - engine_data = ENFN->image_data_get(ENC, o->engine_data, 0, &data, &o->load_error, NULL); + engine_data = ENFN->image_data_get(ENC, o->engine_data, 0, &data, &load_error, NULL); + o->load_error = _evas_load_error_to_efl_gfx_image_load_error(load_error); result = _evas_image_data_convert_internal(o, data, to_cspace); if (engine_data) o->engine_data = ENFN->image_data_put(ENC, engine_data, data); @@ -1150,6 +1188,7 @@ evas_object_image_pixels_import(Evas_Object *eo_obj, Evas_Pixel_Import_Source *p Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); Evas_Image_Data *o; + int load_error; static int warned = 0; if (!warned) @@ -1177,7 +1216,8 @@ evas_object_image_pixels_import(Evas_Object *eo_obj, Evas_Pixel_Import_Source *p o->engine_data, 1, &image_pixels, - &o->load_error); + &load_error); + o->load_error = _evas_load_error_to_efl_gfx_image_load_error(load_error); /* FIXME: need to actualyl support this */ /* memcpy(image_pixels, pixels->rows, o->cur->image.w * o->cur->image.h * 4);*/ if (o->engine_data) @@ -1198,7 +1238,8 @@ evas_object_image_pixels_import(Evas_Object *eo_obj, Evas_Pixel_Import_Source *p { DATA32 *image_pixels = NULL; - o->engine_data = ENFN->image_data_get(ENC, o->engine_data, 1, &image_pixels,&o->load_error, NULL); + o->engine_data = ENFN->image_data_get(ENC, o->engine_data, 1, &image_pixels, &load_error, NULL); + o->load_error = _evas_load_error_to_efl_gfx_image_load_error(load_error); if (image_pixels) evas_common_convert_yuv_422p_601_rgba((DATA8 **) pixels->rows, (DATA8 *) image_pixels, o->cur->image.w, o->cur->image.h); if (o->engine_data) @@ -1240,20 +1281,27 @@ evas_object_image_alpha_mask_set(Evas_Object *eo_obj EINA_UNUSED, Eina_Bool isma EVAS_IMAGE_LEGACY_API(eo_obj); } -EOLIAN static Eina_Bool -_evas_image_efl_file_mmap_set(Eo *obj, void *pd EINA_UNUSED, const Eina_File *f, const char *key) +EOLIAN static Eina_Error +_evas_image_efl_file_load(Eo *obj, void *pd EINA_UNUSED) { EVAS_IMAGE_API(obj, EINA_FALSE); - return _evas_image_mmap_set(obj, f, key); + if (efl_file_loaded_get(obj)) return 0; + Eina_Error err = efl_file_load(efl_super(obj, EVAS_IMAGE_CLASS)); + if (err) + { + if (err == ENOENT) + _efl_canvas_image_load_error_set(obj, EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST); + else if (err == ENOMEM) + _efl_canvas_image_load_error_set(obj, EFL_GFX_IMAGE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED); + else if ((err == EPERM) || (err == EACCES)) + _efl_canvas_image_load_error_set(obj, EFL_GFX_IMAGE_LOAD_ERROR_PERMISSION_DENIED); + else + _efl_canvas_image_load_error_set(obj, EFL_GFX_IMAGE_LOAD_ERROR_GENERIC); + return err; + } + if (_evas_image_file_load(obj)) + return 0; + return EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST; } -EOLIAN static void -_evas_image_efl_file_mmap_get(const Eo *obj, void *pd EINA_UNUSED, const Eina_File **f, const char **key) -{ - if (f) *f = NULL; - if (key) *key = NULL; - EVAS_IMAGE_API(obj); - _evas_image_mmap_get(obj, f, key); -} - -#include "canvas/evas_image.eo.c" +#include "canvas/evas_image_eo.c" diff --git a/src/lib/evas/canvas/evas_image_private.h b/src/lib/evas/canvas/evas_image_private.h index ac7b29c574..79114b4f99 100644 --- a/src/lib/evas/canvas/evas_image_private.h +++ b/src/lib/evas/canvas/evas_image_private.h @@ -22,7 +22,7 @@ #include "../common/evas_convert_colorspace.h" #include "../common/evas_convert_yuv.h" -#include "canvas/evas_image.eo.h" +#include "canvas/evas_image_eo.h" #include "canvas/efl_canvas_filter_internal.eo.h" #include "evas_filter.h" @@ -111,7 +111,7 @@ struct _Evas_Image_Data void *plane; int pixels_checked_out; - int load_error; + Eina_Error load_error; /* Efl.Gfx.Image.Load_Error */ Efl_Gfx_Image_Scale_Hint scale_hint; Efl_Gfx_Image_Content_Hint content_hint; @@ -161,11 +161,12 @@ void *_evas_image_pixels_get(Eo *eo_obj, Evas_Object_Protected_Data *obj, void * void _evas_image_fill_set(Eo *eo_obj, Evas_Image_Data *o, int x, int y, int w, int h); /* Efl.File */ -Eina_Bool _evas_image_mmap_set(Eo *eo_obj, const Eina_File *f, const char *key); -void _evas_image_mmap_get(const Eo *eo_obj, const Eina_File **f, const char **key); +Eina_Bool _evas_image_file_load(Eo *eo_obj); +const Eina_File *_evas_image_mmap_get(const Eo *eo_obj); +const char *_evas_image_key_get(const Eo *eo_obj); +void _efl_canvas_image_load_error_set(Eo *eo_obj EINA_UNUSED, Eina_Error err); /* Efl.Image.Load */ -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); @@ -187,7 +188,7 @@ void _evas_image_orientation_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Image_Orie /* 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_Gfx_Image_Animation_Controller_Loop_Hint _evas_image_animated_loop_type_get(const Eo *eo_obj); +Efl_Gfx_Frame_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_line.eo b/src/lib/evas/canvas/evas_line.eo deleted file mode 100644 index 6274969509..0000000000 --- a/src/lib/evas/canvas/evas_line.eo +++ /dev/null @@ -1,31 +0,0 @@ -class Evas.Line extends Efl.Canvas.Object -{ - [[Evas line class]] - legacy_prefix: evas_object_line; - eo_prefix: evas_obj_line; - methods { - @property xy { - set { - [[Sets the coordinates of the end points of the given evas line - object. - - @since 1.8 - ]] - } - get { - [[Retrieves the coordinates of the end points of the given evas - line object. - ]] - } - values { - x1: int; [[The X coordinate of the first point.]] - y1: int; [[The Y coordinate of the first point.]] - x2: int; [[The X coordinate of the second point.]] - y2: int; [[The Y coordinate of the second point.]] - } - } - } - implements { - Efl.Object.constructor; - } -} diff --git a/src/lib/evas/canvas/evas_line_eo.c b/src/lib/evas/canvas/evas_line_eo.c new file mode 100644 index 0000000000..3199d53e2d --- /dev/null +++ b/src/lib/evas/canvas/evas_line_eo.c @@ -0,0 +1,47 @@ + +void _evas_line_xy_set(Eo *obj, Evas_Line_Data *pd, int x1, int y1, int x2, int y2); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_line_xy_set, EFL_FUNC_CALL(x1, y1, x2, y2), int x1, int y1, int x2, int y2); + +void _evas_line_xy_get(const Eo *obj, Evas_Line_Data *pd, int *x1, int *y1, int *x2, int *y2); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_obj_line_xy_get, EFL_FUNC_CALL(x1, y1, x2, y2), int *x1, int *y1, int *x2, int *y2); + +Efl_Object *_evas_line_efl_object_constructor(Eo *obj, Evas_Line_Data *pd); + + +static Eina_Bool +_evas_line_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EVAS_LINE_EXTRA_OPS +#define EVAS_LINE_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(evas_obj_line_xy_set, _evas_line_xy_set), + EFL_OBJECT_OP_FUNC(evas_obj_line_xy_get, _evas_line_xy_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _evas_line_efl_object_constructor), + EVAS_LINE_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _evas_line_class_desc = { + EO_VERSION, + "Evas.Line", + EFL_CLASS_TYPE_REGULAR, + sizeof(Evas_Line_Data), + _evas_line_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(evas_line_class_get, &_evas_line_class_desc, EFL_CANVAS_OBJECT_CLASS, NULL); + +#include "evas_line_eo.legacy.c" diff --git a/src/lib/evas/canvas/evas_line_eo.h b/src/lib/evas/canvas/evas_line_eo.h new file mode 100644 index 0000000000..bcdebcddef --- /dev/null +++ b/src/lib/evas/canvas/evas_line_eo.h @@ -0,0 +1,53 @@ +#ifndef _EVAS_LINE_EO_H_ +#define _EVAS_LINE_EO_H_ + +#ifndef _EVAS_LINE_EO_CLASS_TYPE +#define _EVAS_LINE_EO_CLASS_TYPE + +typedef Eo Evas_Line; + +#endif + +#ifndef _EVAS_LINE_EO_TYPES +#define _EVAS_LINE_EO_TYPES + + +#endif +/** Evas line class + * + * @ingroup Evas_Line + */ +#define EVAS_LINE_CLASS evas_line_class_get() + +EWAPI const Efl_Class *evas_line_class_get(void); + +/** + * @brief Sets the coordinates of the end points of the given evas line object. + * + * @param[in] obj The object. + * @param[in] x1 The X coordinate of the first point. + * @param[in] y1 The Y coordinate of the first point. + * @param[in] x2 The X coordinate of the second point. + * @param[in] y2 The Y coordinate of the second point. + * + * @since 1.8 + * + * @ingroup Evas_Line + */ +EOAPI void evas_obj_line_xy_set(Eo *obj, int x1, int y1, int x2, int y2); + +/** + * @brief Retrieves the coordinates of the end points of the given evas line + * object. + * + * @param[in] obj The object. + * @param[out] x1 The X coordinate of the first point. + * @param[out] y1 The Y coordinate of the first point. + * @param[out] x2 The X coordinate of the second point. + * @param[out] y2 The Y coordinate of the second point. + * + * @ingroup Evas_Line + */ +EOAPI void evas_obj_line_xy_get(const Eo *obj, int *x1, int *y1, int *x2, int *y2); + +#endif diff --git a/src/lib/evas/canvas/evas_line_eo.hh b/src/lib/evas/canvas/evas_line_eo.hh new file mode 100644 index 0000000000..63ca84ff2c --- /dev/null +++ b/src/lib/evas/canvas/evas_line_eo.hh @@ -0,0 +1,337 @@ +#ifndef EVAS_LINE_EO_HH +#define EVAS_LINE_EO_HH +#include + +extern "C" { +#include "efl_canvas_object.eo.h" +#include "efl_canvas_pointer.eo.h" +#include "efl_class.eo.h" +#include "efl_gfx_color.eo.h" +#include "efl_gfx_entity.eo.h" +#include "efl_gfx_hint.eo.h" +#include "efl_gfx_mapping.eo.h" +#include "efl_gfx_stack.eo.h" +#include "efl_input_device.eo.h" +#include "efl_input_focus.eo.h" +#include "efl_input_hold.eo.h" +#include "efl_input_interface.eo.h" +#include "efl_input_key.eo.h" +#include "efl_input_pointer.eo.h" +#include "efl_loop.eo.h" +#include "efl_loop_consumer.eo.h" +#include "efl_object.eo.h" +#include "efl_ui_i18n.eo.h" +#include "evas_line_eo.h" +} +#include +#include +#include "efl_canvas_object.eo.hh" +#include "efl_canvas_pointer.eo.hh" +#include "efl_class.eo.hh" +#include "efl_gfx_color.eo.hh" +#include "efl_gfx_entity.eo.hh" +#include "efl_gfx_hint.eo.hh" +#include "efl_gfx_mapping.eo.hh" +#include "efl_gfx_stack.eo.hh" +#include "efl_input_device.eo.hh" +#include "efl_input_focus.eo.hh" +#include "efl_input_hold.eo.hh" +#include "efl_input_interface.eo.hh" +#include "efl_input_key.eo.hh" +#include "efl_input_pointer.eo.hh" +#include "efl_loop.eo.hh" +#include "efl_loop_consumer.eo.hh" +#include "efl_object.eo.hh" +#include "efl_ui_i18n.eo.hh" +#ifndef EVAS_LINE_FWD_GUARD +#define EVAS_LINE_FWD_GUARD +namespace evas { +struct Line; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Line> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Line&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Line const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Line const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CLASS_FWD_GUARD +#define EFL_CLASS_FWD_GUARD +namespace efl { +struct Class; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_COLOR_FWD_GUARD +#define EFL_GFX_COLOR_FWD_GUARD +namespace efl { namespace gfx { +struct Color; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_DEVICE_FWD_GUARD +#define EFL_INPUT_DEVICE_FWD_GUARD +namespace efl { namespace input { +struct Device; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_ENTITY_FWD_GUARD +#define EFL_GFX_ENTITY_FWD_GUARD +namespace efl { namespace gfx { +struct Entity; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_HINT_FWD_GUARD +#define EFL_GFX_HINT_FWD_GUARD +namespace efl { namespace gfx { +struct Hint; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_FOCUS_FWD_GUARD +#define EFL_INPUT_FOCUS_FWD_GUARD +namespace efl { namespace input { +struct Focus; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_HOLD_FWD_GUARD +#define EFL_INPUT_HOLD_FWD_GUARD +namespace efl { namespace input { +struct Hold; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_UI_I18N_FWD_GUARD +#define EFL_UI_I18N_FWD_GUARD +namespace efl { namespace ui { +struct I18n; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_INTERFACE_FWD_GUARD +#define EFL_INPUT_INTERFACE_FWD_GUARD +namespace efl { namespace input { +struct Interface; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_KEY_FWD_GUARD +#define EFL_INPUT_KEY_FWD_GUARD +namespace efl { namespace input { +struct Key; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_LOOP_FWD_GUARD +#define EFL_LOOP_FWD_GUARD +namespace efl { +struct Loop; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_LOOP_CONSUMER_FWD_GUARD +#define EFL_LOOP_CONSUMER_FWD_GUARD +namespace efl { +struct Loop_Consumer; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_MAPPING_FWD_GUARD +#define EFL_GFX_MAPPING_FWD_GUARD +namespace efl { namespace gfx { +struct Mapping; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_OBJECT_FWD_GUARD +#define EFL_OBJECT_FWD_GUARD +namespace efl { +struct Object; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_OBJECT_FWD_GUARD +#define EFL_CANVAS_OBJECT_FWD_GUARD +namespace efl { namespace canvas { +struct Object; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_POINTER_FWD_GUARD +#define EFL_CANVAS_POINTER_FWD_GUARD +namespace efl { namespace canvas { +struct Pointer; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_POINTER_FWD_GUARD +#define EFL_INPUT_POINTER_FWD_GUARD +namespace efl { namespace input { +struct Pointer; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_STACK_FWD_GUARD +#define EFL_GFX_STACK_FWD_GUARD +namespace efl { namespace gfx { +struct Stack; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack const&> : ::std::true_type {}; } } +#endif + +namespace eo_cxx { +namespace evas { +struct Line { + ::efl::eolian::return_traits::type xy_get( ::efl::eolian::out_traits::type x1, ::efl::eolian::out_traits::type y1, ::efl::eolian::out_traits::type x2, ::efl::eolian::out_traits::type y2) const; + ::efl::eolian::return_traits::type xy_set( ::efl::eolian::in_traits::type x1, ::efl::eolian::in_traits::type y1, ::efl::eolian::in_traits::type x2, ::efl::eolian::in_traits::type y2) const; + static Efl_Class const* _eo_class() + { + return EVAS_LINE_CLASS; + } + Eo* _eo_ptr() const { return *(reinterpret_cast(const_cast(this))); } + operator ::evas::Line() const; + operator ::evas::Line&(); + operator ::evas::Line const&() const; + /// @cond LOCAL + ::efl::eolian::address_of_operator operator&() { return {this}; } + ::efl::eolian::address_of_operator operator&() const { return {this}; } + /// @endcond +}; +} +} +namespace evas { +struct Line : private ::efl::eo::concrete + , EO_CXX_INHERIT(::efl::Loop_Consumer) + , EO_CXX_INHERIT(::efl::Object) + , EO_CXX_INHERIT(::efl::canvas::Object) + , EO_CXX_INHERIT(::efl::canvas::Pointer) + , EO_CXX_INHERIT(::efl::gfx::Color) + , EO_CXX_INHERIT(::efl::gfx::Entity) + , EO_CXX_INHERIT(::efl::gfx::Hint) + , EO_CXX_INHERIT(::efl::gfx::Mapping) + , EO_CXX_INHERIT(::efl::gfx::Stack) + , EO_CXX_INHERIT(::efl::input::Interface) + , EO_CXX_INHERIT(::efl::ui::I18n) +{ + explicit Line( ::Eo* eo) + : ::efl::eo::concrete(eo) {} + Line(std::nullptr_t) + : ::efl::eo::concrete(nullptr) {} + explicit Line() = default; + Line(Line const&) = default; + Line(Line&&) = default; + Line& operator=(Line const&) = default; + Line& operator=(Line&&) = default; + template + Line(Derived&& derived + , typename std::enable_if< + ::efl::eo::is_eolian_object::value + && std::is_base_of< Line, Derived>::value>::type* = 0) + : ::efl::eo::concrete(derived._eo_ptr()) {} + + Line( ::efl::eo::instantiate_t) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, ::efl::eo::concrete{nullptr}, _eo_class()); + } + template + explicit Line( ::efl::eo::instantiate_t, T&& parent, typename std::enable_if< ::efl::eo::is_eolian_object::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, parent, _eo_class()); + } + template Line( ::efl::eo::instantiate_t, F&& f, typename ::std::enable_if< ::efl::eolian::is_constructor_lambda::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, ::efl::eo::concrete{nullptr}, _eo_class(), *this, std::forward(f)); + } + template Line( ::efl::eo::instantiate_t, T&& parent, F&& f, typename ::std::enable_if< ::efl::eolian::is_constructor_lambda::value && ::efl::eo::is_eolian_object::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, parent, _eo_class(), *this, std::forward(f)); + } + + ::efl::eolian::return_traits::type xy_get( ::efl::eolian::out_traits::type x1, ::efl::eolian::out_traits::type y1, ::efl::eolian::out_traits::type x2, ::efl::eolian::out_traits::type y2) const; + ::efl::eolian::return_traits::type xy_set( ::efl::eolian::in_traits::type x1, ::efl::eolian::in_traits::type y1, ::efl::eolian::in_traits::type x2, ::efl::eolian::in_traits::type y2) const; + static Efl_Class const* _eo_class() + { + return EVAS_LINE_CLASS; + } + Eo* _eo_ptr() const { return *(reinterpret_cast(const_cast(this))); } + /// @cond LOCAL + ::efl::eolian::address_of_operator operator&() { return {this}; } + ::efl::eolian::address_of_operator operator&() const { return {this}; } + /// @endcond + ::efl::eo::wref _get_wref() const { return ::efl::eo::wref(*this); } + ::efl::eo::concrete const& _get_concrete() const { return *this; } + ::efl::eo::concrete& _get_concrete() { return *this; } + using ::efl::eo::concrete::_eo_ptr; + using ::efl::eo::concrete::_release; + using ::efl::eo::concrete::_reset; + using ::efl::eo::concrete::_delete; + using ::efl::eo::concrete::operator bool; +#ifdef EFL_CXXPERIMENTAL + const Line* operator->() const { return this; } + Line* operator->() { return this; } + operator Eo*() const { return _eo_ptr(); } +#endif + friend bool operator==(Line const& lhs, Line const& rhs) + { return lhs._get_concrete() == rhs._get_concrete(); } + friend bool operator!=(Line const& lhs, Line const& rhs) + { return !(lhs == rhs); } +}; +static_assert(sizeof(Line) == sizeof(Eo*), ""); +static_assert(std::is_standard_layout::value, ""); +} +#endif diff --git a/src/lib/evas/canvas/evas_line_eo.impl.hh b/src/lib/evas/canvas/evas_line_eo.impl.hh new file mode 100644 index 0000000000..3b9b981924 --- /dev/null +++ b/src/lib/evas/canvas/evas_line_eo.impl.hh @@ -0,0 +1,62 @@ +#ifndef EVAS_LINE_IMPL_HH +#define EVAS_LINE_IMPL_HH + +#include "evas_line_eo.hh" + +namespace evas { +inline ::efl::eolian::return_traits::type Line::xy_get( ::efl::eolian::out_traits::type x1, ::efl::eolian::out_traits::type y1, ::efl::eolian::out_traits::type x2, ::efl::eolian::out_traits::type y2) const +{ + int __out_param_x1 = {}; + int __out_param_y1 = {}; + int __out_param_x2 = {}; + int __out_param_y2 = {}; + ::evas_obj_line_xy_get(_eo_ptr(), + & __out_param_x1, + & __out_param_y1, + & __out_param_x2, + & __out_param_y2); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(x1, __out_param_x1); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(y1, __out_param_y1); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(x2, __out_param_x2); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(y2, __out_param_y2); +} +inline ::efl::eolian::return_traits::type Line::xy_set( ::efl::eolian::in_traits::type x1, ::efl::eolian::in_traits::type y1, ::efl::eolian::in_traits::type x2, ::efl::eolian::in_traits::type y2) const +{ + ::evas_obj_line_xy_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(x1), + ::efl::eolian::convert_to_c::type>(y1), + ::efl::eolian::convert_to_c::type>(x2), + ::efl::eolian::convert_to_c::type>(y2)); +} +} +namespace eo_cxx { +namespace evas { +inline ::efl::eolian::return_traits::type Line::xy_get( ::efl::eolian::out_traits::type x1, ::efl::eolian::out_traits::type y1, ::efl::eolian::out_traits::type x2, ::efl::eolian::out_traits::type y2) const +{ + int __out_param_x1 = {}; + int __out_param_y1 = {}; + int __out_param_x2 = {}; + int __out_param_y2 = {}; + ::evas_obj_line_xy_get(_eo_ptr(), + & __out_param_x1, + & __out_param_y1, + & __out_param_x2, + & __out_param_y2); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(x1, __out_param_x1); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(y1, __out_param_y1); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(x2, __out_param_x2); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(y2, __out_param_y2); +} +inline ::efl::eolian::return_traits::type Line::xy_set( ::efl::eolian::in_traits::type x1, ::efl::eolian::in_traits::type y1, ::efl::eolian::in_traits::type x2, ::efl::eolian::in_traits::type y2) const +{ + ::evas_obj_line_xy_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(x1), + ::efl::eolian::convert_to_c::type>(y1), + ::efl::eolian::convert_to_c::type>(x2), + ::efl::eolian::convert_to_c::type>(y2)); +} +inline evas::Line::operator ::evas::Line() const { return *static_cast< ::evas::Line const*>(static_cast(this)); } +inline evas::Line::operator ::evas::Line&() { return *static_cast< ::evas::Line*>(static_cast(this)); } +inline evas::Line::operator ::evas::Line const&() const { return *static_cast< ::evas::Line const*>(static_cast(this)); } +} } +#endif diff --git a/src/lib/evas/canvas/evas_line_eo.legacy.c b/src/lib/evas/canvas/evas_line_eo.legacy.c new file mode 100644 index 0000000000..5c879056ed --- /dev/null +++ b/src/lib/evas/canvas/evas_line_eo.legacy.c @@ -0,0 +1,12 @@ + +EAPI void +evas_object_line_xy_set(Evas_Line *obj, int x1, int y1, int x2, int y2) +{ + evas_obj_line_xy_set(obj, x1, y1, x2, y2); +} + +EAPI void +evas_object_line_xy_get(const Evas_Line *obj, int *x1, int *y1, int *x2, int *y2) +{ + evas_obj_line_xy_get(obj, x1, y1, x2, y2); +} diff --git a/src/lib/evas/canvas/evas_line_eo.legacy.h b/src/lib/evas/canvas/evas_line_eo.legacy.h new file mode 100644 index 0000000000..556174c8b2 --- /dev/null +++ b/src/lib/evas/canvas/evas_line_eo.legacy.h @@ -0,0 +1,46 @@ +#ifndef _EVAS_LINE_EO_LEGACY_H_ +#define _EVAS_LINE_EO_LEGACY_H_ + +#ifndef _EVAS_LINE_EO_CLASS_TYPE +#define _EVAS_LINE_EO_CLASS_TYPE + +typedef Eo Evas_Line; + +#endif + +#ifndef _EVAS_LINE_EO_TYPES +#define _EVAS_LINE_EO_TYPES + + +#endif + +/** + * @brief Sets the coordinates of the end points of the given evas line object. + * + * @param[in] obj The object. + * @param[in] x1 The X coordinate of the first point. + * @param[in] y1 The Y coordinate of the first point. + * @param[in] x2 The X coordinate of the second point. + * @param[in] y2 The Y coordinate of the second point. + * + * @since 1.8 + * + * @ingroup Evas_Object_Line_Group + */ +EAPI void evas_object_line_xy_set(Evas_Line *obj, int x1, int y1, int x2, int y2); + +/** + * @brief Retrieves the coordinates of the end points of the given evas line + * object. + * + * @param[in] obj The object. + * @param[out] x1 The X coordinate of the first point. + * @param[out] y1 The Y coordinate of the first point. + * @param[out] x2 The X coordinate of the second point. + * @param[out] y2 The Y coordinate of the second point. + * + * @ingroup Evas_Object_Line_Group + */ +EAPI void evas_object_line_xy_get(const Evas_Line *obj, int *x1, int *y1, int *x2, int *y2); + +#endif diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c index c9baf74bca..029e8ee0d3 100644 --- a/src/lib/evas/canvas/evas_main.c +++ b/src/lib/evas/canvas/evas_main.c @@ -1,4 +1,3 @@ -#define EVAS_CANVAS_BETA #define EFL_INPUT_EVENT_PROTECTED #include "evas_common_private.h" @@ -26,6 +25,101 @@ EAPI int lockmax = 0; static int _evas_init_count = 0; int _evas_log_dom_global = -1; +EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_NONE = 0; +EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_GENERIC = 0; +EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST = 0; +EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_PERMISSION_DENIED = 0; +EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 0; +EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_CORRUPT_FILE = 0; +EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_UNKNOWN_FORMAT = 0; +EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_CANCELLED = 0; +EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_INCOMPATIBLE_FILE = 0; +EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_UNKNOWN_COLLECTION = 0; +EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_RECURSIVE_REFERENCE = 0; + +#define NUM_ERRORS 11 + +const char *efl_gfx_image_load_error_msgs[] = { + "No error on load" , + "A non-specific error occurred" , + "File (or file path) does not exist" , + "Permission denied to an existing file (or path)" , + "Allocation of resources failure prevented load" , + "File corrupt (but was detected as a known format)" , + "File is not a known format" , + "Reading operation has been cancelled during decoding" , + "(Edje only) The file pointed to is incompatible, i.e., it doesn't match the library's current version's format." , + "(Edje only) The group/collection set to load from was not found in the file" , + "(Edje only) The group/collection set to load from had recursive references on its components" +}; + +static void +_efl_gfx_image_load_error_init(void) +{ + Eina_Error *table[] = { + &EFL_GFX_IMAGE_LOAD_ERROR_NONE, + &EFL_GFX_IMAGE_LOAD_ERROR_GENERIC, + &EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST, + &EFL_GFX_IMAGE_LOAD_ERROR_PERMISSION_DENIED, + &EFL_GFX_IMAGE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED, + &EFL_GFX_IMAGE_LOAD_ERROR_CORRUPT_FILE, + &EFL_GFX_IMAGE_LOAD_ERROR_UNKNOWN_FORMAT, + &EFL_GFX_IMAGE_LOAD_ERROR_CANCELLED, + &EFL_GFX_IMAGE_LOAD_ERROR_INCOMPATIBLE_FILE, + &EFL_GFX_IMAGE_LOAD_ERROR_UNKNOWN_COLLECTION, + &EFL_GFX_IMAGE_LOAD_ERROR_RECURSIVE_REFERENCE + }; + unsigned int i; + + if (EFL_GFX_IMAGE_LOAD_ERROR_GENERIC) return; + /* skip EFL_GFX_IMAGE_LOAD_ERROR_NONE: this should always be 0 */ + for (i = 1; i < NUM_ERRORS; i++) + *(table[i]) = eina_error_msg_static_register(efl_gfx_image_load_error_msgs[i]); +#undef TABLE_ENTRY +} + +Eina_Error +_evas_load_error_to_efl_gfx_image_load_error(Evas_Load_Error err) +{ +#define TABLE_ENTRY(NAME) [EVAS_LOAD_ERROR_##NAME] = &EFL_GFX_IMAGE_LOAD_ERROR_##NAME + Eina_Error *table[] = { + TABLE_ENTRY(NONE), + TABLE_ENTRY(GENERIC), + TABLE_ENTRY(DOES_NOT_EXIST), + TABLE_ENTRY(PERMISSION_DENIED), + TABLE_ENTRY(RESOURCE_ALLOCATION_FAILED), + TABLE_ENTRY(CORRUPT_FILE), + TABLE_ENTRY(UNKNOWN_FORMAT), + TABLE_ENTRY(CANCELLED), + //TABLE_ENTRY(INCOMPATIBLE_FILE), + //TABLE_ENTRY(UNKNOWN_COLLECTION), + //TABLE_ENTRY(RECURSIVE_REFERENCE) + }; + if (err > EVAS_LOAD_ERROR_CANCELLED) return err; + return *table[err]; +#undef TABLE_ENTRY +} + +Evas_Load_Error +_efl_gfx_image_load_error_to_evas_load_error(Eina_Error err) +{ + if (err && (err < EFL_GFX_IMAGE_LOAD_ERROR_GENERIC)) return EVAS_LOAD_ERROR_GENERIC; +#define CONVERT_ERR(NAME) if (err == EFL_GFX_IMAGE_LOAD_ERROR_##NAME) return EVAS_LOAD_ERROR_##NAME + CONVERT_ERR(NONE); + CONVERT_ERR(GENERIC); + CONVERT_ERR(DOES_NOT_EXIST); + CONVERT_ERR(PERMISSION_DENIED); + CONVERT_ERR(RESOURCE_ALLOCATION_FAILED); + CONVERT_ERR(CORRUPT_FILE); + CONVERT_ERR(UNKNOWN_FORMAT); + CONVERT_ERR(CANCELLED); + //CONVERT_ERR(INCOMPATIBLE_FILE); + //CONVERT_ERR(UNKNOWN_COLLECTION); + //CONVERT_ERR(RECURSIVE_REFERENCE); + return EVAS_LOAD_ERROR_GENERIC; +} + + EAPI int evas_init(void) { @@ -79,9 +173,11 @@ evas_init(void) EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT); - _efl_gfx_map_init(); + _efl_gfx_mapping_init(); evas_focus_init(); + _efl_gfx_image_load_error_init(); + return _evas_init_count; shutdown_filter: @@ -139,7 +235,7 @@ evas_shutdown(void) evas_filter_shutdown(); evas_module_shutdown(); - _efl_gfx_map_shutdown(); + _efl_gfx_mapping_shutdown(); eina_cow_del(evas_object_proxy_cow); eina_cow_del(evas_object_map_cow); @@ -602,16 +698,16 @@ _evas_canvas_coord_world_y_to_screen(const Eo *eo_e EINA_UNUSED, Evas_Public_Dat else return (int)((((long long)y - (long long)e->viewport.y) * (long long)e->output.h) / (long long)e->viewport.h); } -EOLIAN static Efl_Input_Device * +EOLIAN static Evas_Device * _evas_canvas_default_device_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, - Efl_Input_Device_Type klass) + Evas_Device_Class klass) { - if (klass == EFL_INPUT_DEVICE_TYPE_SEAT) + if (klass == (Evas_Device_Class)EFL_INPUT_DEVICE_TYPE_SEAT) return e->default_seat; - if (klass == EFL_INPUT_DEVICE_TYPE_MOUSE) + if (klass == (Evas_Device_Class)EFL_INPUT_DEVICE_TYPE_MOUSE) return e->default_mouse; - if (klass == EFL_INPUT_DEVICE_TYPE_KEYBOARD) + if (klass == (Evas_Device_Class)EFL_INPUT_DEVICE_TYPE_KEYBOARD) return e->default_keyboard; return NULL; } @@ -665,7 +761,7 @@ evas_object_image_extension_can_load_fast_get(const char *file) EOLIAN static void _evas_canvas_pointer_output_xy_by_device_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, - Efl_Input_Device *dev, + Evas_Device *dev, int *x, int *y) { Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, dev); @@ -686,7 +782,7 @@ _evas_canvas_pointer_output_xy_by_device_get(const Eo *eo_e EINA_UNUSED, EOLIAN static void _evas_canvas_pointer_canvas_xy_by_device_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, - Efl_Input_Device *dev, + Evas_Device *dev, int *x, int *y) { Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, dev); @@ -706,7 +802,7 @@ _evas_canvas_pointer_canvas_xy_by_device_get(const Eo *eo_e EINA_UNUSED, EOLIAN static unsigned int _evas_canvas_pointer_button_down_mask_by_device_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, - Efl_Input_Device *dev) + Evas_Device *dev) { Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, dev); if (!pdata) return 0; @@ -716,7 +812,7 @@ _evas_canvas_pointer_button_down_mask_by_device_get(const Eo *eo_e EINA_UNUSED, EOLIAN static Eina_Bool _evas_canvas_efl_canvas_pointer_pointer_inside_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, - Efl_Input_Device *dev) + Evas_Device *dev) { Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, dev); if (!pdata) return EINA_FALSE; @@ -754,13 +850,13 @@ _evas_canvas_data_attach_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e) } static void -_evas_canvas_focus_inout_dispatch(Eo *eo_e, Efl_Input_Device *seat, +_evas_canvas_focus_inout_dispatch(Eo *eo_e, Evas_Device *seat, Eina_Bool in) { Efl_Input_Focus_Data *ev_data; Efl_Input_Focus *evt; - evt = efl_input_instance_get(EFL_INPUT_FOCUS_CLASS, eo_e, (void **) &ev_data); + evt = efl_input_focus_instance_get(eo_e, (void **) &ev_data); if (!evt) return; ev_data->device = efl_ref(seat); @@ -773,7 +869,7 @@ _evas_canvas_focus_inout_dispatch(Eo *eo_e, Efl_Input_Device *seat, EOLIAN static void _evas_canvas_seat_focus_in(Eo *eo_e, Evas_Public_Data *e, - Efl_Input_Device *seat) + Evas_Device *seat) { if (!seat) seat = e->default_seat; if (!seat || efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_TYPE_SEAT) return; @@ -782,7 +878,7 @@ _evas_canvas_seat_focus_in(Eo *eo_e, Evas_Public_Data *e, EOLIAN static void _evas_canvas_seat_focus_out(Eo *eo_e, Evas_Public_Data *e, - Efl_Input_Device *seat) + Evas_Device *seat) { if (!seat) seat = e->default_seat; if (!seat || efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_TYPE_SEAT) return; @@ -803,7 +899,7 @@ _evas_canvas_focus_out(Eo *eo_e, Evas_Public_Data *e) EOLIAN static Eina_Bool _evas_canvas_seat_focus_state_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, - Efl_Input_Device *seat) + Evas_Device *seat) { if (!seat) seat = e->default_seat; return eina_list_data_find(e->focused_by, seat) ? EINA_TRUE : EINA_FALSE; @@ -1347,7 +1443,7 @@ evas_output_viewport_get(const Evas *eo_e, Evas_Coord *x, Evas_Coord *y, Evas_Co } Evas_Pointer_Data * -_evas_pointer_data_by_device_get(Evas_Public_Data *edata, Efl_Input_Device *pointer) +_evas_pointer_data_by_device_get(Evas_Public_Data *edata, Evas_Device *pointer) { Evas_Pointer_Data *pdata; Evas_Pointer_Seat *pseat; @@ -1372,7 +1468,7 @@ _evas_pointer_data_by_device_get(Evas_Public_Data *edata, Efl_Input_Device *poin } Evas_Pointer_Data * -_evas_pointer_data_add(Evas_Public_Data *edata, Efl_Input_Device *pointer) +_evas_pointer_data_add(Evas_Public_Data *edata, Evas_Device *pointer) { Evas_Pointer_Data *pdata; Evas_Pointer_Seat *pseat = NULL; @@ -1408,7 +1504,7 @@ _evas_pointer_data_add(Evas_Public_Data *edata, Efl_Input_Device *pointer) } void -_evas_pointer_data_remove(Evas_Public_Data *edata, Efl_Input_Device *pointer) +_evas_pointer_data_remove(Evas_Public_Data *edata, Evas_Device *pointer) { Evas_Pointer_Data *pdata; Evas_Pointer_Seat *pseat; @@ -1879,7 +1975,7 @@ 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_canvas_efl_canvas_scene_group_objects_calculate(Eo *eo_e, Evas_Public_Data *o EINA_UNUSED) { evas_call_smarts_calculate(eo_e); } @@ -1892,7 +1988,7 @@ evas_smart_objects_calculate(Eo *eo_e) } EOLIAN Eina_Bool -_evas_canvas_efl_canvas_scene_smart_objects_calculating_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e) +_evas_canvas_efl_canvas_scene_group_objects_calculating_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e) { return !!e->in_smart_calc; } @@ -1900,7 +1996,7 @@ _evas_canvas_efl_canvas_scene_smart_objects_calculating_get(const Eo *eo_e EINA_ EAPI Eina_Bool evas_smart_objects_calculating_get(const Eo *obj) { - return efl_canvas_scene_smart_objects_calculating_get(obj); + return efl_canvas_scene_group_objects_calculating_get(obj); } EOLIAN int @@ -1939,4 +2035,4 @@ 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" +#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 e633ccd883..1f576fcf84 100644 --- a/src/lib/evas/canvas/evas_map.c +++ b/src/lib/evas/canvas/evas_map.c @@ -1381,12 +1381,8 @@ evas_object_map_update(Evas_Object *eo_obj, pt->x = (lround(p->x) + x) * FP1; pt->y = (lround(p->y) + y) * FP1; pt->z = (lround(p->z) ) * FP1; - /* FIXME: Adding the framespace is a workaround for a bug on the EGL - * wayland backend, which does not affect other ports. Remove this when - * it is correctly handled inside the GL rendering code, which handles - * maps with perspective set. */ - pt->fx = p->px + obj->layer->evas->framespace.x; - pt->fy = p->py + obj->layer->evas->framespace.y; + pt->fx = p->x + (float) x; + pt->fy = p->y + (float) y; pt->fz = p->z; if ((uvw == 0) || (imagew == 0)) pt->u = 0; else pt->u = ((lround(p->u) * imagew) / uvw) * FP1; diff --git a/src/lib/evas/canvas/evas_map.h b/src/lib/evas/canvas/evas_map.h index f76f65af4f..06a18f9e31 100644 --- a/src/lib/evas/canvas/evas_map.h +++ b/src/lib/evas/canvas/evas_map.h @@ -1,4 +1,4 @@ -/* Common header for maps: legacy Evas_Map API and Efl.Gfx.Map */ +/* Common header for maps: legacy Evas_Map API and Efl.Gfx.Mapping */ #ifndef EVAS_MAP_H #define EVAS_MAP_H diff --git a/src/lib/evas/canvas/evas_object_box.c b/src/lib/evas/canvas/evas_object_box.c index fb8177639f..2981c20eaa 100644 --- a/src/lib/evas/canvas/evas_object_box.c +++ b/src/lib/evas/canvas/evas_object_box.c @@ -1,5 +1,4 @@ #define EFL_CANVAS_GROUP_PROTECTED -#define EFL_CANVAS_GROUP_BETA #include "evas_common_private.h" #include "evas_private.h" @@ -165,9 +164,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_ENTITY_EVENT_RESIZE, _on_child_resize }, + { EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _on_child_resize }, { EFL_EVENT_INVALIDATE, _on_child_invalidate }, - { EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS, _on_child_hints_changed } + { EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _on_child_hints_changed } ); static void @@ -2010,4 +2009,4 @@ _evas_box_class_constructor(Efl_Class *klass) #define EVAS_BOX_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(evas_box) -#include "canvas/evas_box.eo.c" +#include "canvas/evas_box_eo.c" diff --git a/src/lib/evas/canvas/evas_object_grid.c b/src/lib/evas/canvas/evas_object_grid.c index 9fb909afc0..5dd69e10a9 100644 --- a/src/lib/evas/canvas/evas_object_grid.c +++ b/src/lib/evas/canvas/evas_object_grid.c @@ -507,4 +507,4 @@ evas_object_grid_mirrored_get(const Evas_Grid *obj) return efl_ui_mirrored_get(obj); } -#include "canvas/evas_grid.eo.c" +#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 7834ce087e..5beeb4b0ce 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -283,7 +283,7 @@ _evas_image_init_set(const Eina_File *f, const char *key, } ENFN->image_free(ENC, o->engine_data); } - o->load_error = EVAS_LOAD_ERROR_NONE; + o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_NONE; lo->emile.scale_down_by = o->load_opts->scale_down_by; lo->emile.dpi = o->load_opts->dpi; lo->emile.w = o->load_opts->w; @@ -340,8 +340,8 @@ _evas_image_done_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Dat } else { - if (o->load_error == EVAS_LOAD_ERROR_NONE) - o->load_error = EVAS_LOAD_ERROR_GENERIC; + if (o->load_error == EFL_GFX_IMAGE_LOAD_ERROR_NONE) + o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_GENERIC; EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) { @@ -709,6 +709,8 @@ _efl_canvas_image_internal_efl_gfx_buffer_buffer_update_add(Eo *eo_obj, Evas_Ima { Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); Eina_Rectangle *r; + Eo *eo_obj2; + Eina_List *l; int x, y, w, h; int cnt; @@ -767,6 +769,12 @@ _efl_canvas_image_internal_efl_gfx_buffer_buffer_update_add(Eo *eo_obj, Evas_Ima o->changed = EINA_TRUE; evas_object_change(eo_obj, obj); + + EINA_LIST_FOREACH(obj->proxy->proxies, l, eo_obj2) + { + Evas_Object_Protected_Data *obj2 = efl_data_scope_get(eo_obj2, EFL_CANVAS_OBJECT_CLASS); + evas_object_change(eo_obj2, obj2); + } } EOLIAN static void @@ -854,11 +862,17 @@ _efl_canvas_image_internal_efl_gfx_image_ratio_get(const Eo *eo_obj EINA_UNUSED, return (double)o->cur->image.w / (double)o->cur->image.h; } +EOLIAN static Eina_Error +_efl_canvas_image_internal_efl_gfx_image_image_load_error_get(const Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) +{ + return o->load_error; +} + EOLIAN static Eina_Bool -_efl_canvas_image_internal_efl_file_save(const Eo *eo_obj, Evas_Image_Data *o, const char *file, const char *key, const char *flags) +_efl_canvas_image_internal_efl_file_save_save(const Eo *eo_obj, Evas_Image_Data *o, const char *file, const char *key, const Efl_File_Save_Info *info) { int quality = 80, compress = 9, ok = 0; - char *encoding = NULL; + const char *encoding = NULL; Image_Entry *ie; Evas_Colorspace cspace = EVAS_COLORSPACE_ARGB8888; Evas_Colorspace want_cspace = EVAS_COLORSPACE_ARGB8888; @@ -883,46 +897,31 @@ _efl_canvas_image_internal_efl_file_save(const Eo *eo_obj, Evas_Image_Data *o, c cspace = ENFN->image_file_colorspace_get(ENC, pixels); want_cspace = cspace; - - if (flags) + if (info) { - const char *ext; - char *p, *pp; - char *tflags; + encoding = info->encoding; + quality = info->quality; + compress = info->compression; + } - tflags = alloca(strlen(flags) + 1); - strcpy(tflags, flags); - p = tflags; - while (p) + if (encoding) + { + const char *ext = strrchr(file, '.'); + if (ext && !strcasecmp(ext, ".tgv")) { - pp = strchr(p, ' '); - if (pp) *pp = 0; - sscanf(p, "quality=%4i", &quality); - sscanf(p, "compress=%4i", &compress); - sscanf(p, "encoding=%ms", &encoding); - if (pp) p = pp + 1; - else break; - } - - if (encoding) - { - ext = strrchr(file, '.'); - if (ext && !strcasecmp(ext, ".tgv")) + if (!strcmp(encoding, "auto")) + want_cspace = cspace; + else if (!strcmp(encoding, "etc1")) + want_cspace = EVAS_COLORSPACE_ETC1; + else if (!strcmp(encoding, "etc2")) { - if (!strcmp(encoding, "auto")) - want_cspace = cspace; - else if (!strcmp(encoding, "etc1")) - want_cspace = EVAS_COLORSPACE_ETC1; - else if (!strcmp(encoding, "etc2")) - { - if (!ENFN->image_alpha_get(ENC, pixels)) - want_cspace = EVAS_COLORSPACE_RGB8_ETC2; - else - want_cspace = EVAS_COLORSPACE_RGBA8_ETC2_EAC; - } - else if (!strcmp(encoding, "etc1+alpha")) - want_cspace = EVAS_COLORSPACE_ETC1_ALPHA; + if (!ENFN->image_alpha_get(ENC, pixels)) + want_cspace = EVAS_COLORSPACE_RGB8_ETC2; + else + want_cspace = EVAS_COLORSPACE_RGBA8_ETC2_EAC; } + else if (!strcmp(encoding, "etc1+alpha")) + want_cspace = EVAS_COLORSPACE_ETC1_ALPHA; } } @@ -965,12 +964,10 @@ _efl_canvas_image_internal_efl_file_save(const Eo *eo_obj, Evas_Image_Data *o, c if (unmap_it) ENFN->image_data_unmap(ENC, pixels, &slice); - free(encoding); if (!ok) ERR("Image save failed."); return ok; no_pixels: - free(encoding); ERR("Could not get image pixels for saving."); return EINA_FALSE; } @@ -1132,7 +1129,7 @@ _evas_image_unload(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bo ENFN->image_free(ENC, o->engine_data); } o->engine_data = NULL; - o->load_error = EVAS_LOAD_ERROR_NONE; + o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_NONE; EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) { @@ -1151,6 +1148,7 @@ void _evas_image_load(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o) { Evas_Image_Load_Opts lo; + int load_error = 0; if (o->engine_data) return; @@ -1173,7 +1171,8 @@ _evas_image_load(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Imag lo.emile.orientation = o->load_opts->orientation; lo.emile.degree = 0; lo.skip_head = o->skip_head; - o->engine_data = ENFN->image_mmap(ENC, o->cur->f, o->cur->key, &o->load_error, &lo); + o->engine_data = ENFN->image_mmap(ENC, o->cur->f, o->cur->key, &load_error, &lo); + o->load_error = _evas_load_error_to_efl_gfx_image_load_error(load_error); if (o->engine_data) { @@ -1202,7 +1201,7 @@ _evas_image_load(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Imag } else { - o->load_error = EVAS_LOAD_ERROR_GENERIC; + o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_GENERIC; } } @@ -1241,12 +1240,12 @@ _evas_image_load_post_update(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob //preloading error check if (ENFN->image_load_error_get) - o->load_error = ENFN->image_load_error_get(ENC, o->engine_data); + o->load_error = _evas_load_error_to_efl_gfx_image_load_error(ENFN->image_load_error_get(ENC, o->engine_data)); } else { o->preload = EVAS_IMAGE_PRELOAD_NONE; - o->load_error = EVAS_LOAD_ERROR_GENERIC; + o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_GENERIC; } } @@ -2703,6 +2702,9 @@ evas_object_image_render_post(Evas_Object *eo_obj EINA_UNUSED, Evas_Image_Data *o = type_private_data; Eina_Rectangle *r; + /* image is not ready yet, skip rendering. Leave it to next frame */ + if (o->preload & EVAS_IMAGE_PRELOADING) return; + /* this moves the current data to the previous state parts of the object */ /* in whatever way is safest for the object. also if we don't need object */ /* data anymore we can free it if the object deems this is a good idea */ diff --git a/src/lib/evas/canvas/evas_object_inform.c b/src/lib/evas/canvas/evas_object_inform.c index 8fb780e66c..7422d3634e 100644 --- a/src/lib/evas/canvas/evas_object_inform.c +++ b/src/lib/evas/canvas/evas_object_inform.c @@ -2,14 +2,22 @@ #include "evas_image_private.h" #include "evas_private.h" +/* BEGIN: events to maintain compatibility with legacy */ +EWAPI const Efl_Event_Description _EFL_GFX_ENTITY_EVENT_SHOW = + EFL_EVENT_DESCRIPTION("show"); +EWAPI const Efl_Event_Description _EFL_GFX_ENTITY_EVENT_HIDE = + EFL_EVENT_DESCRIPTION("hide"); +/* END: events to maintain compatibility with legacy */ + /* local calls */ void evas_object_inform_call_show(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) { int event_id = _evas_object_event_new(); + Eina_Bool vis = EINA_TRUE; - evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_SHOW, NULL, event_id, EFL_GFX_ENTITY_EVENT_SHOW); + evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_SHOW, &vis, event_id, EFL_GFX_ENTITY_EVENT_SHOW); _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id); } @@ -17,26 +25,33 @@ void evas_object_inform_call_hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) { int event_id = _evas_object_event_new(); + Eina_Bool vis = EINA_FALSE; - evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_HIDE, NULL, event_id, EFL_GFX_ENTITY_EVENT_HIDE); + evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_HIDE, &vis, event_id, EFL_GFX_ENTITY_EVENT_HIDE); _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id); } void evas_object_inform_call_move(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) { + Eina_Position2D pos; int event_id = _evas_object_event_new(); - evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOVE, NULL, event_id, EFL_GFX_ENTITY_EVENT_MOVE); + pos = ((Eina_Rect) obj->cur->geometry).pos; + + evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOVE, &pos, event_id, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED); _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id); } void evas_object_inform_call_resize(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) { + Eina_Size2D size; int event_id = _evas_object_event_new(); - evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_RESIZE, NULL, event_id, EFL_GFX_ENTITY_EVENT_RESIZE); + size = ((Eina_Rect) obj->cur->geometry).size; + + evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_RESIZE, &size, event_id, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED); _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id); } @@ -45,7 +60,7 @@ 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_ENTITY_EVENT_RESTACK); + evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_RESTACK, NULL, event_id, EFL_GFX_ENTITY_EVENT_STACKING_CHANGED); if (obj->layer) _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id); } @@ -55,7 +70,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_ENTITY_EVENT_CHANGE_SIZE_HINTS); + evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, NULL, event_id, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED); _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id); } @@ -80,7 +95,7 @@ evas_object_inform_call_image_preloaded(Evas_Object *eo_obj) (preload & EVAS_IMAGE_PRELOAD_CANCEL)) { event_id = _evas_object_event_new(); - evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_PRELOADED, NULL, event_id, EFL_GFX_IMAGE_EVENT_PRELOAD); + evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_PRELOADED, NULL, event_id, EFL_GFX_IMAGE_EVENT_IMAGE_PRELOAD); _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id); } } @@ -91,7 +106,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_GFX_IMAGE_EVENT_UNLOAD); + evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_UNLOADED, NULL, event_id, EFL_GFX_IMAGE_EVENT_IMAGE_UNLOAD); _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id); } @@ -101,6 +116,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_GFX_IMAGE_EVENT_RESIZE); + evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_RESIZE, NULL, event_id, EFL_GFX_IMAGE_EVENT_IMAGE_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 cc4232b3df..2f45448823 100644 --- a/src/lib/evas/canvas/evas_object_intercept.c +++ b/src/lib/evas/canvas/evas_object_intercept.c @@ -194,7 +194,7 @@ _evas_object_intercept_call_internal(Evas_Object *eo_obj, { if (!internal) { - if (_efl_canvas_object_clip_set_block(eo_obj, obj, eo_other, NULL)) + if (_efl_canvas_object_clipper_set_block(eo_obj, obj, eo_other, NULL)) return 1; } if (!obj->interceptors) return 0; @@ -204,7 +204,7 @@ _evas_object_intercept_call_internal(Evas_Object *eo_obj, { if (!internal) { - if (_efl_canvas_object_clip_unset_block(eo_obj, obj)) + if (_efl_canvas_object_clipper_unset_block(eo_obj, obj)) return 1; } if (!obj->interceptors) return 0; diff --git a/src/lib/evas/canvas/evas_object_line.c b/src/lib/evas/canvas/evas_object_line.c index 47adade454..62e9bc400b 100644 --- a/src/lib/evas/canvas/evas_object_line.c +++ b/src/lib/evas/canvas/evas_object_line.c @@ -416,4 +416,4 @@ evas_object_line_coords_recalc(Evas_Object *eo_obj EINA_UNUSED, o->cur.cache.object.h = obj->cur->geometry.h; } -#include "canvas/evas_line.eo.c" +#include "canvas/evas_line_eo.c" diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index 8f218fa8c2..ad0eaf82d6 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -1,6 +1,5 @@ #define EFL_CANVAS_OBJECT_PROTECTED -#define EFL_CANVAS_OBJECT_BETA -#define EFL_GFX_SIZE_HINT_PROTECTED +#define EFL_GFX_HINT_PROTECTED #include "evas_common_private.h" #include "evas_private.h" @@ -165,115 +164,6 @@ _evas_object_pointer_data_get(Evas_Pointer_Data *evas_pdata, return pdata; } -static void _hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); - -static void -_anim_started_cb(void *data, const Efl_Event *ev) -{ - 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); - - 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; - - 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_RUNNING, - &event); -} - -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 && obj->anim_player && - (event_anim->anim != efl_animation_player_animation_get(obj->anim_player))) - { - 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_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_player_start(obj->anim_player); - } -} - -static void -_event_anim_free(Event_Animation *event_anim, Evas_Object_Protected_Data *obj) -{ - if (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); - - if (efl_player_play_get(obj->anim_player)) - { - Efl_Animation *running_anim = - efl_animation_player_animation_get(obj->anim_player); - - if (running_anim == event_anim->anim) - efl_player_stop(obj->anim_player); - } - } - - free(event_anim); -} - EOLIAN static Eo * _efl_canvas_object_efl_object_constructor(Eo *eo_obj, Evas_Object_Protected_Data *obj) { @@ -302,7 +192,6 @@ _efl_canvas_object_efl_object_constructor(Eo *eo_obj, Evas_Object_Protected_Data obj->data_3d = eina_cow_alloc(evas_object_3d_cow); obj->mask = eina_cow_alloc(evas_object_mask_cow); obj->events = eina_cow_alloc(evas_object_events_cow); - obj->event_anims = NULL; evas_object_inject(eo_obj, obj, evas); evas_object_callback_init(eo_obj, obj); @@ -323,7 +212,7 @@ _efl_canvas_object_efl_object_finalize(Eo *eo_obj, Evas_Object_Protected_Data *o if (obj->legacy.ctor) goto end; if (!obj->legacy.weight_set) - efl_gfx_size_hint_weight_set(eo_obj, 1.0, 1.0); + efl_gfx_hint_weight_set(eo_obj, 1.0, 1.0); if (obj->legacy.visible_set /* && ... */) { @@ -533,7 +422,7 @@ evas_object_cur_prev(Evas_Object_Protected_Data *obj) map_write->prev = map_write->cur; EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write); } - _efl_canvas_object_clip_prev_reset(obj, EINA_TRUE); + _efl_canvas_object_clipper_prev_reset(obj, EINA_TRUE); eina_cow_memcpy(evas_object_state_cow, (const Eina_Cow_Data **) &obj->prev, obj->cur); } @@ -1123,124 +1012,6 @@ _efl_canvas_object_efl_input_interface_seat_event_filter_set(Eo *eo_obj, } } -static Eina_Bool -_is_event_blocked(Eo *eo_obj, const Efl_Event_Description *desc, - void *event_info) -{ - if ((desc == EFL_EVENT_FOCUS_IN) || - (desc == EFL_EVENT_FOCUS_OUT) || - (desc == EFL_EVENT_KEY_DOWN) || - (desc == EFL_EVENT_KEY_UP) || - (desc == EFL_EVENT_HOLD) || - (desc == EFL_EVENT_POINTER_IN) || - (desc == EFL_EVENT_POINTER_OUT) || - (desc == EFL_EVENT_POINTER_DOWN) || - (desc == EFL_EVENT_POINTER_UP) || - (desc == EFL_EVENT_POINTER_MOVE) || - (desc == EFL_EVENT_POINTER_WHEEL) || - (desc == EFL_EVENT_POINTER_CANCEL) || - (desc == EFL_EVENT_POINTER_AXIS) || - (desc == EFL_EVENT_FINGER_MOVE) || - (desc == EFL_EVENT_FINGER_DOWN) || - (desc == EFL_EVENT_FINGER_UP)) - { - Efl_Input_Device *seat = efl_input_device_seat_get(efl_input_device_get(event_info)); - return !efl_input_seat_event_filter_get(eo_obj, seat); - } - return EINA_FALSE; -} - -static Event_Animation * -_event_animation_find(Evas_Object_Protected_Data *obj, - const Efl_Event_Description *desc) -{ - Event_Animation *event_anim; - EINA_INLIST_FOREACH(obj->event_anims, event_anim) - { - if (event_anim->desc == desc) - return event_anim; - } - return NULL; -} - -EOLIAN static Eina_Bool -_efl_canvas_object_efl_object_event_callback_call(Eo *eo_obj, - Evas_Object_Protected_Data *obj, - const Efl_Event_Description *desc, - void *event_info) -{ - if (_is_event_blocked(eo_obj, desc, event_info)) return EINA_FALSE; - - //Start animation corresponding to the current event - if (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) - { - //Create animation object to start animation - 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_player_start(obj->anim_player); - } - } - } - - return efl_event_callback_call(efl_super(eo_obj, MY_CLASS), - desc, event_info); -} - -EOLIAN static Eina_Bool -_efl_canvas_object_efl_object_event_callback_legacy_call(Eo *eo_obj, - Evas_Object_Protected_Data *obj, - const Efl_Event_Description *desc, - void *event_info) -{ - if (_is_event_blocked(eo_obj, desc, event_info)) return EINA_FALSE; - - //Start animation corresponding to the current event - if (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) - { - //Create animation object to start animation - 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_player_start(obj->anim_player); - } - } - } - - return efl_event_callback_legacy_call(efl_super(eo_obj, MY_CLASS), - desc, event_info); -} - EOLIAN static void _efl_canvas_object_efl_object_invalidate(Eo *eo_obj, Evas_Object_Protected_Data *obj) { @@ -1252,10 +1023,6 @@ _efl_canvas_object_efl_object_invalidate(Eo *eo_obj, Evas_Object_Protected_Data 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; @@ -1328,19 +1095,7 @@ _efl_canvas_object_efl_object_invalidate(Eo *eo_obj, Evas_Object_Protected_Data } 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->prev) _efl_canvas_object_clipper_prev_reset(obj, EINA_FALSE); if (obj->map) evas_object_map_set(eo_obj, NULL); @@ -1637,7 +1392,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(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) +_efl_canvas_object_efl_gfx_hint_hint_size_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); @@ -1646,7 +1401,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_restricted_min_get(const Eo *eo_obj EI } EOLIAN static void -_efl_canvas_object_efl_gfx_size_hint_hint_restricted_min_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Size2D sz) +_efl_canvas_object_efl_gfx_hint_hint_size_restricted_min_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Size2D sz) { if (obj->delete_me) return; @@ -1665,7 +1420,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(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) +_efl_canvas_object_efl_gfx_hint_hint_size_combined_min_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) { Eina_Size2D sz = { 0, 0 }; @@ -1678,7 +1433,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_combined_min_get(const Eo *eo_obj EINA } EOLIAN static Eina_Size2D -_efl_canvas_object_efl_gfx_size_hint_hint_max_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) +_efl_canvas_object_efl_gfx_hint_hint_size_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); @@ -1687,7 +1442,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_max_get(const Eo *eo_obj EINA_UNUSED, } EOLIAN static void -_efl_canvas_object_efl_gfx_size_hint_hint_max_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Size2D sz) +_efl_canvas_object_efl_gfx_hint_hint_size_max_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Size2D sz) { if (obj->delete_me) return; @@ -1742,7 +1497,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(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) +_efl_canvas_object_efl_gfx_hint_hint_size_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); @@ -1751,7 +1506,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_min_get(const Eo *eo_obj EINA_UNUSED, } EOLIAN static void -_efl_canvas_object_efl_gfx_size_hint_hint_min_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Size2D sz) +_efl_canvas_object_efl_gfx_hint_hint_size_min_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Size2D sz) { if (obj->delete_me) return; @@ -1770,7 +1525,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(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Efl_Gfx_Size_Hint_Aspect *aspect, Eina_Size2D *sz) +_efl_canvas_object_efl_gfx_hint_hint_aspect_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Efl_Gfx_Hint_Aspect *aspect, Eina_Size2D *sz) { if ((!obj->size_hints) || obj->delete_me) { @@ -1787,7 +1542,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_aspect_get(const Eo *eo_obj EINA_UNUSE } EOLIAN static void -_efl_canvas_object_efl_gfx_size_hint_hint_aspect_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Size_Hint_Aspect aspect, Eina_Size2D sz) +_efl_canvas_object_efl_gfx_hint_hint_aspect_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Hint_Aspect aspect, Eina_Size2D sz) { if (obj->delete_me) return; @@ -1799,7 +1554,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_aspect_set(Eo *eo_obj, Evas_Object_Pro if (!sz.w && !sz.h) return; _evas_object_size_hint_alloc(eo_obj, obj); } - if ((obj->size_hints->aspect.mode == aspect) && + if ((obj->size_hints->aspect.mode == (Evas_Aspect_Control)aspect) && (obj->size_hints->aspect.size.w == sz.w) && (obj->size_hints->aspect.size.h == sz.h)) return; obj->size_hints->aspect.mode = aspect; @@ -1809,7 +1564,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(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, double *x, double *y) +_efl_canvas_object_efl_gfx_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) { @@ -1822,7 +1577,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_align_get(const Eo *eo_obj EINA_UNUSED } EOLIAN static void -_efl_canvas_object_efl_gfx_size_hint_hint_align_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, double x, double y) +_efl_canvas_object_efl_gfx_hint_hint_align_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, double x, double y) { if (obj->delete_me) return; @@ -1844,7 +1599,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(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, double *x, double *y) +_efl_canvas_object_efl_gfx_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) { @@ -1857,7 +1612,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_weight_get(const Eo *eo_obj EINA_UNUSE } EOLIAN static void -_efl_canvas_object_efl_gfx_size_hint_hint_weight_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, double x, double y) +_efl_canvas_object_efl_gfx_hint_hint_weight_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, double x, double y) { if (obj->delete_me) return; @@ -1880,7 +1635,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(const 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_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) { @@ -1897,7 +1652,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_margin_get(const Eo *eo_obj EINA_UNUSE } EOLIAN static void -_efl_canvas_object_efl_gfx_size_hint_hint_margin_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord l, Evas_Coord r, Evas_Coord t, Evas_Coord b) +_efl_canvas_object_efl_gfx_hint_hint_margin_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord l, Evas_Coord r, Evas_Coord t, Evas_Coord b) { if (obj->delete_me) return; @@ -1919,7 +1674,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_margin_set(Eo *eo_obj, Evas_Object_Pro } EOLIAN static void -_efl_canvas_object_efl_gfx_size_hint_hint_fill_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Eina_Bool *x, Eina_Bool *y) +_efl_canvas_object_efl_gfx_hint_hint_fill_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Eina_Bool *x, Eina_Bool *y) { if ((!obj->size_hints) || obj->delete_me) { @@ -1932,7 +1687,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_fill_get(const Eo *eo_obj EINA_UNUSED, } EOLIAN static void -_efl_canvas_object_efl_gfx_size_hint_hint_fill_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bool x, Eina_Bool y) +_efl_canvas_object_efl_gfx_hint_hint_fill_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bool x, Eina_Bool y) { if (obj->delete_me) return; @@ -2020,26 +1775,6 @@ _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_ENTITY_EVENT_SHOW); - if (event_anim) - { - //Create animation object to start animation - 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_player_start(obj->anim_player); - } } static void @@ -2379,19 +2114,19 @@ _efl_canvas_object_efl_object_dbg_info_get(Eo *eo_obj, Evas_Object_Protected_Dat name = efl_name_get(eo_obj); // evas_object_name_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); - efl_gfx_size_hint_align_get(eo_obj, &dblx, &dbly); - efl_gfx_size_hint_weight_get(eo_obj, &dblw, &dblh); - efl_gfx_size_hint_fill_get(eo_obj, &fillx, &filly); + min = efl_gfx_hint_size_restricted_min_get(eo_obj); + max = efl_gfx_hint_size_max_get(eo_obj); + //efl_gfx_hint_request_get(eo_obj, &requestw, &requesth); + efl_gfx_hint_align_get(eo_obj, &dblx, &dbly); + efl_gfx_hint_weight_get(eo_obj, &dblw, &dblh); + efl_gfx_hint_fill_get(eo_obj, &fillx, &filly); efl_gfx_color_get(eo_obj, &r, &g, &b, &a); focus = evas_object_focus_get(eo_obj); m = efl_canvas_object_pointer_mode_get(eo_obj); pass_event = efl_canvas_object_pass_events_get(eo_obj); repeat_event = efl_canvas_object_repeat_events_get(eo_obj); propagate_event = efl_canvas_object_propagate_events_get(eo_obj); - clipees_has = efl_canvas_object_clipees_has(eo_obj); + clipees_has = evas_object_clipees_has(eo_obj); EFL_DBG_INFO_APPEND(group, "Visibility", EINA_VALUE_TYPE_CHAR, visible); @@ -2470,7 +2205,7 @@ _efl_canvas_object_efl_object_dbg_info_get(Eo *eo_obj, Evas_Object_Protected_Dat EFL_DBG_INFO_APPEND(group, "Has clipees", EINA_VALUE_TYPE_CHAR, clipees_has); Evas_Object *clipper = NULL; - clipper = efl_canvas_object_clip_get(eo_obj); + clipper = efl_canvas_object_clipper_get(eo_obj); EFL_DBG_INFO_APPEND(group, "Clipper", EINA_VALUE_TYPE_UINT64, (uintptr_t) clipper); const Evas_Map *map = evas_object_map_get(eo_obj); @@ -2619,15 +2354,15 @@ _efl_canvas_object_render_parent_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_P } EOLIAN static void -_efl_canvas_object_paragraph_direction_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED, Evas_BiDi_Direction dir EINA_UNUSED) +_efl_canvas_object_paragraph_direction_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED, Efl_Text_Bidirectional_Type dir EINA_UNUSED) { return; } -EOLIAN static Evas_BiDi_Direction +EOLIAN static Efl_Text_Bidirectional_Type _efl_canvas_object_paragraph_direction_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED) { - return EVAS_BIDI_DIRECTION_NEUTRAL; + return (Efl_Text_Bidirectional_Type)EVAS_BIDI_DIRECTION_NEUTRAL; } EOLIAN static void @@ -2647,62 +2382,6 @@ evas_find(const Eo *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_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) - return; - - pd->event_anims = - eina_inlist_remove(pd->event_anims, EINA_INLIST_GET(event_anim)); - - _event_anim_free(event_anim, pd); - } - - if (!animation) return; - - event_anim = calloc(1, sizeof(Event_Animation)); - - //Set callback for Hide event - if (desc == EFL_GFX_ENTITY_EVENT_HIDE) - { - evas_object_intercept_hide_callback_add(eo_obj, - _animation_intercept_hide, - event_anim); - } - - event_anim->desc = desc; - event_anim->anim = animation; - - pd->event_anims = - eina_inlist_append(pd->event_anims, EINA_INLIST_GET(event_anim)); -} - -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) - return event_anim->anim; - - return NULL; -} - void _efl_canvas_object_event_animation_cancel(Eo *eo_obj) { @@ -2740,14 +2419,14 @@ evas_object_static_clip_get(const Evas_Object *eo_obj) EAPI void evas_object_size_hint_aspect_set(Evas_Object *obj, Evas_Aspect_Control aspect, Evas_Coord w, Evas_Coord h) { - efl_gfx_size_hint_aspect_set(obj, aspect, EINA_SIZE2D(w, h)); + efl_gfx_hint_aspect_set(obj, aspect, EINA_SIZE2D(w, h)); } EAPI void evas_object_size_hint_aspect_get(const Evas_Object *obj, Evas_Aspect_Control *aspect, Evas_Coord *w, Evas_Coord *h) { Eina_Size2D sz = { 0, 0 }; - efl_gfx_size_hint_aspect_get(obj, aspect, &sz); + efl_gfx_hint_aspect_get(obj, (Efl_Gfx_Hint_Aspect*)aspect, &sz); if (w) *w = sz.w; if (h) *h = sz.h; } @@ -2755,14 +2434,14 @@ evas_object_size_hint_aspect_get(const Evas_Object *obj, Evas_Aspect_Control *as EAPI void evas_object_size_hint_max_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) { - efl_gfx_size_hint_max_set(obj, EINA_SIZE2D(w, h)); + efl_gfx_hint_size_max_set(obj, EINA_SIZE2D(w, h)); } EAPI void evas_object_size_hint_max_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) { Eina_Size2D sz; - sz = efl_gfx_size_hint_max_get(obj); + sz = efl_gfx_hint_size_max_get(obj); if (w) *w = sz.w; if (h) *h = sz.h; } @@ -2770,14 +2449,14 @@ evas_object_size_hint_max_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord EAPI void evas_object_size_hint_min_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) { - efl_gfx_size_hint_restricted_min_set(obj, EINA_SIZE2D(w, h)); + efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(w, h)); } EAPI void evas_object_size_hint_min_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) { Eina_Size2D sz; - sz = efl_gfx_size_hint_restricted_min_get(obj); + sz = efl_gfx_hint_size_restricted_min_get(obj); if (w) *w = sz.w; if (h) *h = sz.h; } @@ -2785,37 +2464,37 @@ evas_object_size_hint_min_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord EAPI void evas_object_size_hint_padding_set(Evas_Object *obj, Evas_Coord l, Evas_Coord r, Evas_Coord t, Evas_Coord b) { - efl_gfx_size_hint_margin_set(obj, l, r, t, b); + efl_gfx_hint_margin_set(obj, l, r, t, b); } EAPI void evas_object_size_hint_padding_get(const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b) { - efl_gfx_size_hint_margin_get(obj, l, r, t, b); + efl_gfx_hint_margin_get(obj, l, r, t, b); } EAPI void evas_object_size_hint_weight_set(Evas_Object *obj, double x, double y) { - efl_gfx_size_hint_weight_set(obj, x, y); + efl_gfx_hint_weight_set(obj, x, y); } EAPI void evas_object_size_hint_weight_get(const Evas_Object *obj, double *x, double *y) { - efl_gfx_size_hint_weight_get(obj, x, y); + efl_gfx_hint_weight_get(obj, x, y); } EAPI void evas_object_size_hint_align_set(Evas_Object *obj, double x, double y) { - efl_gfx_size_hint_align_set(obj, x, y); + efl_gfx_hint_align_set(obj, x, y); } EAPI void evas_object_size_hint_align_get(const Evas_Object *obj, double *x, double *y) { - efl_gfx_size_hint_align_get(obj, x, y); + efl_gfx_hint_align_get(obj, x, y); } EAPI Evas * @@ -2866,16 +2545,32 @@ evas_object_pointer_inside_get(const Evas_Object *eo_obj) return evas_object_pointer_inside_by_device_get(eo_obj, NULL); } +EAPI void +evas_object_is_frame_object_set(Efl_Canvas_Object *obj, Eina_Bool is_frame) +{ + efl_canvas_object_is_frame_object_set(obj, is_frame); +} + +EAPI Eina_Bool +evas_object_is_frame_object_get(const Efl_Canvas_Object *obj) +{ + return efl_canvas_object_is_frame_object_get(obj); +} + + /* Internal EO APIs and hidden overrides */ +EOAPI EFL_VOID_FUNC_BODYV(efl_canvas_object_is_frame_object_set, EFL_FUNC_CALL(is_frame), Eina_Bool is_frame); +EOAPI EFL_FUNC_BODY_CONST(efl_canvas_object_is_frame_object_get, Eina_Bool, 0); EOAPI EFL_VOID_FUNC_BODY(efl_canvas_object_legacy_ctor) EOAPI EFL_VOID_FUNC_BODYV(efl_canvas_object_type_set, EFL_FUNC_CALL(type), const char *type) #define EFL_CANVAS_OBJECT_EXTRA_OPS \ EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_canvas_object_efl_object_dbg_info_get), \ - EFL_OBJECT_OP_FUNC(efl_event_callback_legacy_call, _efl_canvas_object_efl_object_event_callback_legacy_call), \ - EFL_OBJECT_OP_FUNC(efl_event_callback_call, _efl_canvas_object_efl_object_event_callback_call), \ + EFL_OBJECT_OP_FUNC(efl_canvas_object_is_frame_object_set, _efl_canvas_object_is_frame_object_set), \ + EFL_OBJECT_OP_FUNC(efl_canvas_object_is_frame_object_get, _efl_canvas_object_is_frame_object_get), \ EFL_OBJECT_OP_FUNC(efl_canvas_object_legacy_ctor, _efl_canvas_object_legacy_ctor), \ EFL_OBJECT_OP_FUNC(efl_canvas_object_type_set, _efl_canvas_object_type_set) #include "canvas/efl_canvas_object.eo.c" +#include "canvas/efl_canvas_object_eo.legacy.c" diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c index 7f0daf7331..3e5cba9771 100644 --- a/src/lib/evas/canvas/evas_object_smart.c +++ b/src/lib/evas/canvas/evas_object_smart.c @@ -1,6 +1,6 @@ #define EFL_CANVAS_GROUP_PROTECTED -#define EFL_CANVAS_GROUP_BETA +#include "eo_internal.h" #include "evas_common_private.h" #include "evas_private.h" @@ -10,7 +10,7 @@ #define MY_CLASS_NAME_LEGACY "Evas_Object_Smart" #define EVAS_OBJECT_SMART_GET_OR_RETURN(eo_obj, ...) \ - Evas_Smart_Data *o = efl_data_scope_safe_get(eo_obj, EFL_CANVAS_GROUP_CLASS); \ + Evas_Smart_Data *o = efl_data_scope_safe_get(eo_obj, MY_CLASS); \ do { if (!o) { MAGIC_CHECK_FAILED(eo_obj,0,MAGIC_SMART) return __VA_ARGS__; } } while (0) extern Eina_Hash* signals_hash_table; @@ -206,6 +206,26 @@ evas_object_smart_member_add(Evas_Object *eo_obj, Evas_Object *smart_obj) efl_canvas_group_member_add(smart_obj, eo_obj); } +static void +_evas_object_smart_member_cache_invalidate(Evas_Object_Protected_Data *obj, Evas_Smart_Data *sd) +{ + Evas_Object_Protected_Data *member; + Evas_Smart_Data *msd; + + obj->parent_cache.pass_events_valid = EINA_FALSE; + obj->parent_cache.freeze_events_valid = EINA_FALSE; + obj->parent_cache.src_invisible_valid = EINA_FALSE; + if (!sd) return; + + EINA_INLIST_FOREACH(sd->contained, member) + { + if (member->is_smart) + msd = efl_data_scope_get(member->object, MY_CLASS); + else msd = NULL; + _evas_object_smart_member_cache_invalidate(member, msd); + } +} + EOLIAN static void _efl_canvas_group_group_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Object *eo_obj) { @@ -267,14 +287,13 @@ _efl_canvas_group_group_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Objec obj->smart.parent_data = o; obj->smart.parent_object_data = smart; o->contained = eina_inlist_append(o->contained, EINA_INLIST_GET(obj)); - evas_object_smart_member_cache_invalidate(eo_obj, EINA_TRUE, EINA_TRUE, - EINA_TRUE); + + if (obj->is_smart) member_o = efl_data_scope_get(eo_obj, MY_CLASS); + _evas_object_smart_member_cache_invalidate(obj, member_o); obj->restack = 1; if (obj->is_smart) { - member_o = efl_data_scope_get(eo_obj, EFL_CANVAS_GROUP_CLASS); - if ((member_o->inherit_paragraph_direction) && (member_o->paragraph_direction != o->paragraph_direction)) { @@ -289,7 +308,7 @@ _efl_canvas_group_group_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Objec if (o->clipped) { Evas_Object *clipper = _smart_clipper_get(o); - Eina_Bool had_clippees = efl_canvas_object_clipees_has(clipper); + Eina_Bool had_clippees = evas_object_clipees_has(clipper); if (EINA_UNLIKELY(!clipper && !o->constructed)) { @@ -300,7 +319,7 @@ _efl_canvas_group_group_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Objec if (clipper != eo_obj) { EINA_SAFETY_ON_NULL_RETURN(clipper); - efl_canvas_object_clip_set(eo_obj, clipper); + efl_canvas_object_clipper_set(eo_obj, clipper); if (!had_clippees && smart->cur->visible) efl_gfx_entity_visible_set(clipper, 1); } @@ -311,6 +330,7 @@ _efl_canvas_group_group_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Objec if (smart->smart.smart && smart->smart.smart->smart_class->member_add) smart->smart.smart->smart_class->member_add(smart_obj, eo_obj); evas_object_update_bounding_box(eo_obj, obj, member_o); + efl_event_callback_call(smart_obj, EFL_CANVAS_GROUP_EVENT_MEMBER_ADDED, eo_obj); } EAPI void @@ -323,20 +343,22 @@ evas_object_smart_member_del(Evas_Object *eo_obj) if (!obj) return; if (!obj->smart.parent) return; Evas_Object *smart_obj = obj->smart.parent; - efl_canvas_group_member_del(smart_obj, eo_obj); + efl_canvas_group_member_remove(smart_obj, eo_obj); } EOLIAN static void -_efl_canvas_group_group_member_del(Eo *smart_obj, Evas_Smart_Data *_pd EINA_UNUSED, Evas_Object *eo_obj) +_efl_canvas_group_group_member_remove(Eo *smart_obj, Evas_Smart_Data *_pd EINA_UNUSED, Evas_Object *eo_obj) { Evas_Object_Protected_Data *obj = efl_data_scope_safe_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); Evas_Object_Protected_Data *smart; - Evas_Smart_Data *member_o, *o; + Evas_Smart_Data *member_o = NULL, *o; if (!obj || !obj->smart.parent) return; evas_object_async_block(obj); + efl_event_callback_call(smart_obj, EFL_CANVAS_GROUP_EVENT_MEMBER_REMOVED, eo_obj); + smart = efl_data_scope_get(smart_obj, EFL_CANVAS_OBJECT_CLASS); if (smart->smart.smart && smart->smart.smart->smart_class->member_del) smart->smart.smart->smart_class->member_del(smart_obj, eo_obj); @@ -348,15 +370,17 @@ _efl_canvas_group_group_member_del(Eo *smart_obj, Evas_Smart_Data *_pd EINA_UNUS Evas_Object *clipper = _smart_clipper_get(o); EINA_SAFETY_ON_NULL_RETURN(clipper); - efl_canvas_object_clip_set(eo_obj, NULL); - if (!efl_canvas_object_clipees_has(clipper)) + efl_canvas_object_clipper_set(eo_obj, NULL); + if (!evas_object_clipees_has(clipper)) efl_gfx_entity_visible_set(clipper, 0); } o->contained = eina_inlist_remove(o->contained, EINA_INLIST_GET(obj)); o->member_count--; obj->smart.parent = NULL; - evas_object_smart_member_cache_invalidate(eo_obj, EINA_TRUE, EINA_TRUE, EINA_TRUE); + + if (obj->is_smart) member_o = efl_data_scope_get(eo_obj, MY_CLASS); + _evas_object_smart_member_cache_invalidate(obj, member_o); if (obj->layer->layer != obj->cur->layer) { @@ -367,8 +391,6 @@ _efl_canvas_group_group_member_del(Eo *smart_obj, Evas_Smart_Data *_pd EINA_UNUS if (obj->is_smart) { - member_o = efl_data_scope_get(eo_obj, EFL_CANVAS_GROUP_CLASS); - if ((member_o->inherit_paragraph_direction) && (member_o->paragraph_direction != EVAS_BIDI_DIRECTION_NEUTRAL)) { @@ -675,7 +697,7 @@ evas_object_smart_add(Evas *eo_e, Evas_Smart *s) eo_e = evas_find(eo_e); EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(eo_e, EVAS_CANVAS_CLASS), NULL); - eo_obj = efl_add(EFL_CANVAS_GROUP_CLASS, eo_e, efl_canvas_object_legacy_ctor(efl_added)); + eo_obj = efl_add(MY_CLASS, eo_e, efl_canvas_object_legacy_ctor(efl_added)); evas_object_smart_attach(eo_obj, s); return eo_obj; } @@ -768,7 +790,7 @@ evas_object_smart_move_children_relative(Eo *eo_obj, Evas_Coord dx, Evas_Coord d void _evas_object_smart_clipped_smart_move_internal(Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y) { - Evas_Smart_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_GROUP_CLASS); + Evas_Smart_Data *o = efl_data_scope_get(eo_obj, MY_CLASS); Evas_Coord orig_x, orig_y; orig_x = o->x; @@ -901,20 +923,20 @@ _efl_canvas_group_efl_gfx_entity_position_set(Eo *eo_obj, Evas_Smart_Data *o, Ei } EOLIAN static void -_efl_canvas_group_efl_canvas_object_clip_set(Eo *eo_obj, Evas_Smart_Data *o, Evas_Object *clip) +_efl_canvas_group_efl_canvas_object_clipper_set(Eo *eo_obj, Evas_Smart_Data *o, Evas_Object *clip) { EINA_SAFETY_ON_FALSE_RETURN(!clip || efl_isa(clip, EFL_CANVAS_OBJECT_CLASS)); if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 0, clip)) return; - efl_canvas_object_clip_set(efl_super(eo_obj, MY_CLASS), clip); + efl_canvas_object_clipper_set(efl_super(eo_obj, MY_CLASS), clip); if (o->clipped) { Evas_Object *clipper = _smart_clipper_get(o); EINA_SAFETY_ON_NULL_RETURN(clipper); - efl_canvas_object_clip_set(clipper, clip); + efl_canvas_object_clipper_set(clipper, clip); } } @@ -1763,7 +1785,7 @@ _efl_canvas_group_group_paragraph_direction_set_internal(Eo *eo_obj, if (o->is_smart) { - member_o = efl_data_scope_get(o->object, EFL_CANVAS_GROUP_CLASS); + member_o = efl_data_scope_get(o->object, MY_CLASS); if ((member_o->inherit_paragraph_direction) && (member_o->paragraph_direction != dir)) @@ -1777,23 +1799,23 @@ _efl_canvas_group_group_paragraph_direction_set_internal(Eo *eo_obj, EOLIAN static void _efl_canvas_group_efl_canvas_object_paragraph_direction_set(Eo *eo_obj, Evas_Smart_Data *o, - Evas_BiDi_Direction dir) + Efl_Text_Bidirectional_Type dir) { Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); Evas_Smart_Data *parent; - if ((!(o->inherit_paragraph_direction) && (o->paragraph_direction == dir)) || - (o->inherit_paragraph_direction && (dir == EVAS_BIDI_DIRECTION_INHERIT))) + if ((!(o->inherit_paragraph_direction) && (o->paragraph_direction == (Evas_BiDi_Direction)dir)) || + (o->inherit_paragraph_direction && ((Evas_BiDi_Direction)dir == EVAS_BIDI_DIRECTION_INHERIT))) return; - if (dir == EVAS_BIDI_DIRECTION_INHERIT) + if (dir == (Efl_Text_Bidirectional_Type)EVAS_BIDI_DIRECTION_INHERIT) { o->inherit_paragraph_direction = EINA_TRUE; Evas_BiDi_Direction parent_dir = EVAS_BIDI_DIRECTION_NEUTRAL; if (obj->smart.parent) { - parent = efl_data_scope_get(obj->smart.parent, EFL_CANVAS_GROUP_CLASS); + parent = efl_data_scope_get(obj->smart.parent, MY_CLASS); if (parent) parent_dir = parent->paragraph_direction; @@ -1815,10 +1837,10 @@ _efl_canvas_group_efl_canvas_object_paragraph_direction_set(Eo *eo_obj, Evas_Sma _efl_canvas_group_group_paragraph_direction_set_internal(eo_obj, o->paragraph_direction); } -EOLIAN static Evas_BiDi_Direction +EOLIAN static Efl_Text_Bidirectional_Type _efl_canvas_group_efl_canvas_object_paragraph_direction_get(const Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o) { - return o->paragraph_direction; + return (Efl_Text_Bidirectional_Type)o->paragraph_direction; } EOLIAN static const Eo * @@ -1849,3 +1871,4 @@ EOAPI EFL_VOID_FUNC_BODYV(efl_canvas_group_clipped_set, EFL_FUNC_CALL(enable), E EFL_OBJECT_OP_FUNC(efl_canvas_group_clipped_set, _efl_canvas_group_group_clipped_set) #include "canvas/efl_canvas_group.eo.c" +#include "canvas/efl_canvas_group_eo.legacy.c" diff --git a/src/lib/evas/canvas/evas_object_table.c b/src/lib/evas/canvas/evas_object_table.c index bc18487e95..9ece2f6aa6 100644 --- a/src/lib/evas/canvas/evas_object_table.c +++ b/src/lib/evas/canvas/evas_object_table.c @@ -1,6 +1,4 @@ -#define EFL_CANVAS_OBJECT_BETA #define EFL_CANVAS_GROUP_PROTECTED -#define EFL_CANVAS_GROUP_BETA #include "evas_common_private.h" #include "evas_private.h" @@ -268,7 +266,7 @@ _on_child_hints_changed(void *data, const Efl_Event *event EINA_UNUSED) EFL_CALLBACKS_ARRAY_DEFINE(evas_object_table_callbacks, { EFL_EVENT_INVALIDATE, _on_child_invalidate }, - { EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS, _on_child_hints_changed } + { EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _on_child_hints_changed } ); static void @@ -352,7 +350,7 @@ _evas_object_table_calculate_hints_homogeneous(Evas_Object *o, Evas_Table_Data * evas_object_size_hint_align_get(child, &opt->align.h, &opt->align.v); evas_object_size_hint_weight_get(child, &weightw, &weighth); //only for Efl.Ui.Table - efl_gfx_size_hint_fill_get(child, &fill_h, &fill_v); + efl_gfx_hint_fill_get(child, &fill_h, &fill_v); child_minw = opt->min.w + opt->pad.l + opt->pad.r; child_minh = opt->min.h + opt->pad.t + opt->pad.b; @@ -1458,4 +1456,4 @@ _evas_table_class_constructor(Efl_Class *klass) #define EVAS_TABLE_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(evas_table) -#include "canvas/evas_table.eo.c" +#include "canvas/evas_table_eo.c" diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 07b8202fd3..cac8602100 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -11,10 +11,6 @@ #define MY_CLASS_NAME "Evas_Text" -#ifdef EVAS_CSERVE2 -# include "evas_cs2_private.h" -#endif - /* save typing */ #define COL_OBJECT(obj, sub) ARGB_JOIN(obj->sub->color.a, obj->sub->color.r, obj->sub->color.g, obj->sub->color.b) #define COL_JOIN(o, sub, color) ARGB_JOIN(o->sub.color.a, o->sub.color.r, o->sub.color.g, o->sub.color.b) @@ -1112,7 +1108,7 @@ _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 +EOLIAN static Efl_Text_Bidirectional_Type _evas_text_direction_get(const Eo *eo_obj, Evas_Text_Data *o) { #ifdef BIDI_SUPPORT @@ -1141,7 +1137,7 @@ _evas_text_direction_get(const Eo *eo_obj, Evas_Text_Data *o) } #endif - return o->bidi_dir; + return (Efl_Text_Bidirectional_Type)o->bidi_dir; } EOLIAN static Evas_Coord @@ -2380,16 +2376,16 @@ evas_object_text_filter_source_set(Evas_Object *obj, const char *name, Evas_Obje EOLIAN static void _evas_text_efl_canvas_object_paragraph_direction_set(Eo *eo_obj, Evas_Text_Data *o, - Evas_BiDi_Direction dir) + Efl_Text_Bidirectional_Type dir) { #ifdef BIDI_SUPPORT Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); - if ((!(o->inherit_paragraph_direction) && (o->paragraph_direction == dir)) || - (o->inherit_paragraph_direction && (dir == EVAS_BIDI_DIRECTION_INHERIT))) + if ((!(o->inherit_paragraph_direction) && (o->paragraph_direction == (Evas_BiDi_Direction)dir)) || + (o->inherit_paragraph_direction && ((Evas_BiDi_Direction)dir == EVAS_BIDI_DIRECTION_INHERIT))) return; - if (dir == EVAS_BIDI_DIRECTION_INHERIT) + if (dir == (Efl_Text_Bidirectional_Type)EVAS_BIDI_DIRECTION_INHERIT) { o->inherit_paragraph_direction = EINA_TRUE; Evas_BiDi_Direction parent_dir = EVAS_BIDI_DIRECTION_NEUTRAL; @@ -2418,11 +2414,11 @@ _evas_text_efl_canvas_object_paragraph_direction_set(Eo *eo_obj, Evas_Text_Data #endif } -EOLIAN static Evas_BiDi_Direction +EOLIAN static Efl_Text_Bidirectional_Type _evas_text_efl_canvas_object_paragraph_direction_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o) { - return o->paragraph_direction; + return (Efl_Text_Bidirectional_Type)o->paragraph_direction; } EOLIAN static void @@ -2443,4 +2439,4 @@ _evas_text_efl_text_font_font_bitmap_scalable_get(const Eo *eo_obj EINA_UNUSED, #define EVAS_TEXT_EXTRA_OPS \ EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _evas_text_efl_object_dbg_info_get) -#include "canvas/evas_text.eo.c" +#include "canvas/evas_text_eo.c" diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 37932a1d62..da73c03eb7 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -62,7 +62,6 @@ * @todo write @ref textblock_layout */ -#define EFL_CANVAS_OBJECT_BETA #define EFL_CANVAS_FILTER_INTERNAL_PROTECTED #include "evas_common_private.h" @@ -7890,7 +7889,7 @@ evas_object_textblock_text_markup_prepend(Efl_Text_Cursor_Cursor *cur, const cha } EOLIAN static void -_efl_canvas_text_efl_text_markup_cursor_markup_insert(Eo *eo_obj, +_efl_canvas_text_efl_text_markup_interactive_cursor_markup_insert(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur, const char *markup) { @@ -11422,7 +11421,7 @@ _evas_textblock_cursor_range_text_markup_get(const Efl_Text_Cursor_Cursor *cur1, } EOLIAN char * -_efl_canvas_text_efl_text_markup_markup_range_get(const Eo *eo_obj, +_efl_canvas_text_efl_text_markup_interactive_markup_range_get(const Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *start, Efl_Text_Cursor_Cursor *end) { @@ -13572,6 +13571,7 @@ evas_object_textblock_free(Evas_Object *eo_obj) ts->objects = eina_list_remove(ts->objects, eo_obj); if (!ts->objects && (ts->delete_me || o->auto_styles)) { + _style_cache = eina_list_remove(_style_cache, ts); evas_textblock_style_free(ts); } free(use); @@ -14988,16 +14988,16 @@ _evas_object_textblock_rehint(Evas_Object *eo_obj) EOLIAN static void _efl_canvas_text_efl_canvas_object_paragraph_direction_set(Eo *eo_obj, Efl_Canvas_Text_Data *o, - Evas_BiDi_Direction dir) + Efl_Text_Bidirectional_Type dir) { #ifdef BIDI_SUPPORT Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); - if ((!(o->inherit_paragraph_direction) && (o->paragraph_direction == dir)) || - (o->inherit_paragraph_direction && (dir == EVAS_BIDI_DIRECTION_INHERIT))) + if ((!(o->inherit_paragraph_direction) && (o->paragraph_direction == (Evas_BiDi_Direction)dir)) || + (o->inherit_paragraph_direction && ((Evas_BiDi_Direction)dir == EVAS_BIDI_DIRECTION_INHERIT))) return; - if (dir == EVAS_BIDI_DIRECTION_INHERIT) + if (dir == (Efl_Text_Bidirectional_Type)EVAS_BIDI_DIRECTION_INHERIT) { o->inherit_paragraph_direction = EINA_TRUE; Evas_BiDi_Direction parent_dir = EVAS_BIDI_DIRECTION_NEUTRAL; @@ -15028,11 +15028,11 @@ _efl_canvas_text_efl_canvas_object_paragraph_direction_set(Eo *eo_obj, #endif } -EOLIAN static Evas_BiDi_Direction +EOLIAN static Efl_Text_Bidirectional_Type _efl_canvas_text_efl_canvas_object_paragraph_direction_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o) { - return o->paragraph_direction; + return (Efl_Text_Bidirectional_Type)o->paragraph_direction; } static int @@ -16170,19 +16170,19 @@ static void _efl_canvas_text_efl_text_format_halign_auto_type_set(Eo *obj, Efl_Canvas_Text_Data *o, Efl_Text_Format_Horizontal_Alignment_Auto_Type type) { ASYNC_BLOCK; - if (type == EFL_TEXT_HORIZONTAL_ALIGNMENT_AUTO_NONE) + if (type == EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_NONE) { _FMT_SET(halign_auto, EVAS_TEXTBLOCK_ALIGN_AUTO_NONE); } - else if (type == EFL_TEXT_HORIZONTAL_ALIGNMENT_AUTO_NORMAL) + else if (type == EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_NORMAL) { _FMT_SET(halign_auto, EVAS_TEXTBLOCK_ALIGN_AUTO_NORMAL); } - else if (type == EFL_TEXT_HORIZONTAL_ALIGNMENT_AUTO_LOCALE) + else if (type == EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_LOCALE) { _FMT_SET(halign_auto, EVAS_TEXTBLOCK_ALIGN_AUTO_LOCALE); } - else if (type == EFL_TEXT_HORIZONTAL_ALIGNMENT_AUTO_END) + else if (type == EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_END) { _FMT_SET(halign_auto, EVAS_TEXTBLOCK_ALIGN_AUTO_END); } @@ -16192,19 +16192,19 @@ static Efl_Text_Format_Horizontal_Alignment_Auto_Type _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; + EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_NONE; if (_FMT(halign_auto) == EVAS_TEXTBLOCK_ALIGN_AUTO_NORMAL) { - ret = EFL_TEXT_HORIZONTAL_ALIGNMENT_AUTO_NORMAL; + ret = EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_NORMAL; } else if (_FMT(halign_auto) == EVAS_TEXTBLOCK_ALIGN_AUTO_END) { - ret = EFL_TEXT_HORIZONTAL_ALIGNMENT_AUTO_END; + ret = EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_END; } else if (_FMT(halign_auto) == EVAS_TEXTBLOCK_ALIGN_AUTO_LOCALE) { - ret = EFL_TEXT_HORIZONTAL_ALIGNMENT_AUTO_LOCALE; + ret = EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_LOCALE; } return ret; } @@ -16457,7 +16457,7 @@ ppar(Evas_Object_Textblock_Paragraph *par) EOLIAN static Efl_Text_Cursor_Cursor * _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) + if (get_type > EFL_TEXT_CURSOR_GET_TYPE_MAIN) { ERR("Unsupported cursor types other than main!"); } @@ -16467,7 +16467,7 @@ _efl_canvas_text_efl_text_cursor_text_cursor_get(const Eo *eo_obj EINA_UNUSED, E EAPI Efl_Text_Cursor_Cursor * evas_object_textblock_cursor_get(const Evas_Object *eo_obj EINA_UNUSED) { - return efl_text_cursor_get(eo_obj, EFL_TEXT_CURSOR_GET_MAIN); + return efl_text_cursor_get(eo_obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); } EOLIAN static Efl_Text_Cursor_Cursor * @@ -16627,4 +16627,5 @@ _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_eo.legacy.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 52cfe66175..68dce30d69 100644 --- a/src/lib/evas/canvas/evas_object_textgrid.c +++ b/src/lib/evas/canvas/evas_object_textgrid.c @@ -1502,4 +1502,4 @@ _evas_textgrid_efl_text_font_font_bitmap_scalable_get(const Eo *eo_obj EINA_UNUS #define EVAS_TEXTGRID_EXTRA_OPS \ EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _evas_textgrid_efl_object_dbg_info_get) -#include "canvas/evas_textgrid.eo.c" +#include "canvas/evas_textgrid_eo.c" diff --git a/src/lib/evas/canvas/evas_out.c b/src/lib/evas/canvas/evas_out.c index 40cce4ce04..35ea97d579 100644 --- a/src/lib/evas/canvas/evas_out.c +++ b/src/lib/evas/canvas/evas_out.c @@ -1,9 +1,6 @@ #include "evas_common_private.h" #include "evas_private.h" //#include "evas_cs.h" -#ifdef EVAS_CSERVE2 -#include "evas_cs2_private.h" -#endif static Evas_Public_Data * _efl_canvas_output_async_block(Efl_Canvas_Output *output) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index 80c960bda9..e1891fc890 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -487,7 +487,7 @@ _evas_render_phase1_direct(Evas_Public_Data *e, _evas_mask_redraw_set(e, obj); } - _evas_object_gfx_map_update(obj); + _evas_object_gfx_mapping_update(obj); Eina_Bool has_map = _evas_render_has_map(obj); @@ -1141,7 +1141,7 @@ _evas_render_phase1_object_process(Phase1_Context *p1ctx, } #endif - _evas_object_gfx_map_update(obj); + _evas_object_gfx_mapping_update(obj); map = _evas_render_has_map(obj); hmap = _evas_render_had_map(obj); can_map = _evas_render_can_map(obj); @@ -1265,7 +1265,7 @@ _evas_render_check_pending_objects(Eina_Array *pending_objects, Evas *eo_e EINA_ if (!obj->layer) goto clean_stuff; - _evas_object_gfx_map_update(obj); + _evas_object_gfx_mapping_update(obj); EINA_PREFETCH(&(obj->cur->clipper)); EINA_PREFETCH(&(obj->cur->cache.clip)); //If the children are in active objects, They should be cleaned up. @@ -1388,12 +1388,12 @@ _evas_render_can_use_overlay(Evas_Public_Data *e, Evas_Object *eo_obj, Efl_Canva /* Check if any one is the stack make this object mapped */ eo_tmp = eo_obj; tmp = efl_data_scope_get(eo_tmp, EFL_CANVAS_OBJECT_CLASS); - _evas_object_gfx_map_update(tmp); + _evas_object_gfx_mapping_update(tmp); while (tmp && !(_evas_render_has_map(tmp) && !_evas_render_can_map(tmp))) { eo_tmp = tmp->smart.parent; tmp = efl_data_scope_get(eo_tmp, EFL_CANVAS_OBJECT_CLASS); - if (tmp) _evas_object_gfx_map_update(tmp); + if (tmp) _evas_object_gfx_mapping_update(tmp); } if (tmp && _evas_render_has_map(tmp) && !_evas_render_can_map(tmp)) @@ -1756,7 +1756,7 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, proxy_src_clip = proxy_render_data->source_clip; evas_object_clip_recalc(obj); - _evas_object_gfx_map_update(obj); + _evas_object_gfx_mapping_update(obj); /* leave early if clipper is not visible */ if ((obj->cur->clipper) && (!obj->cur->clipper->cur->visible)) @@ -2897,7 +2897,7 @@ evas_render_pre(Evas *eo_e, Evas_Public_Data *evas) // weight should be set during finalize() if (EINA_UNLIKELY(!obj->legacy.weight_set)) - efl_gfx_size_hint_weight_set(eo_obj, 1.0, 1.0); + efl_gfx_hint_weight_set(eo_obj, 1.0, 1.0); } eina_evlog("-render_pre_objects_finalize", eo_e, 0.0, NULL); @@ -3600,6 +3600,7 @@ evas_render_updates_internal(Evas *eo_e, if (out->output) ENFN->output_flush(ENC, out->output, EVAS_RENDER_MODE_SYNC); _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_POST, NULL); + _deferred_callbacks_process(eo_e, evas); eina_evlog("-render_output_flush", eo_e, 0.0, NULL); } } diff --git a/src/lib/evas/canvas/evas_stack.x b/src/lib/evas/canvas/evas_stack.x index 4b73c22999..914d04731e 100644 --- a/src/lib/evas/canvas/evas_stack.x +++ b/src/lib/evas/canvas/evas_stack.x @@ -37,11 +37,11 @@ evas_object_below_get_internal(const Evas_Object_Protected_Data *obj) EAPI void evas_object_raise(Evas_Object *obj) { - efl_gfx_stack_raise((Evas_Object *)obj); + efl_gfx_stack_raise_to_top((Evas_Object *)obj); } EOLIAN void -_efl_canvas_object_efl_gfx_stack_raise(Eo *eo_obj, Evas_Object_Protected_Data *obj) +_efl_canvas_object_efl_gfx_stack_raise_to_top(Eo *eo_obj, Evas_Object_Protected_Data *obj) { if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_RAISE, 1)) return; @@ -86,11 +86,11 @@ _efl_canvas_object_efl_gfx_stack_raise(Eo *eo_obj, Evas_Object_Protected_Data *o EAPI void evas_object_lower(Evas_Object *obj) { - efl_gfx_stack_lower((Evas_Object *)obj); + efl_gfx_stack_lower_to_bottom((Evas_Object *)obj); } EOLIAN void -_efl_canvas_object_efl_gfx_stack_lower(Eo *eo_obj, Evas_Object_Protected_Data *obj) +_efl_canvas_object_efl_gfx_stack_lower_to_bottom(Eo *eo_obj, Evas_Object_Protected_Data *obj) { if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_LOWER, 1)) return; diff --git a/src/lib/evas/canvas/evas_table.eo b/src/lib/evas/canvas/evas_table.eo deleted file mode 100644 index fe33a00907..0000000000 --- a/src/lib/evas/canvas/evas_table.eo +++ /dev/null @@ -1,211 +0,0 @@ -/* XXX: Remove the Object_ part once the relevant Eolian bugs are fixed. */ -enum Evas.Object_Table.Homogeneous_Mode { - [[How to pack items into cells in a table. - - See @Evas.Table.homogeneous for an explanation of the function of each one.]] - legacy: Evas_Object_Table_Homogeneous; - none = 0, [[No mode specified]] - table = 1, [[Table mode]] - item = 2 [[Item mode]] -} - -class Evas.Table extends Efl.Canvas.Group -{ - [[Evas table class]] - legacy_prefix: evas_object_table; - eo_prefix: evas_obj_table; - methods { - @property homogeneous { - [[Set how this table should layout children. - - Todo: consider aspect hint and respect it. - - @Evas.Object_Table.Homogeneous_Mode.none - If table does not use homogeneous mode then columns and rows will - be calculated based on hints of individual cells. This operation - mode is more flexible, but more complex and heavy to calculate as - well. Weight properties are handled as a boolean expand. Negative - alignment will be considered as 0.5. This is the default. - - Todo: @Evas.Object_Table.Homogeneous_Mode.none should balance weight. - - @Evas.Object_Table.Homogeneous_Mode.table - When homogeneous is relative to table the own table size is divided - equally among children, filling the whole table area. That is, if - table has $WIDTH and $COLUMNS, each cell will get _WIDTH / - COLUMNS_ pixels. If children have minimum size that is larger - than this amount (including padding), then it will overflow and be - aligned respecting the alignment hint, possible overlapping sibling - cells. Weight hint is used as a boolean, if greater than zero it - will make the child expand in that axis, taking as much space as - possible (bounded to maximum size hint). Negative alignment will be - considered as 0.5. - - @Evas.Object_Table.Homogeneous_Mode.item - When homogeneous is relative to item it means the greatest minimum - cell size will be used. That is, if no element is set to expand, - the table will have its contents to a minimum size, the bounding - box of all these children will be aligned relatively to the table - object using evas_object_table_align_get(). If the table area is - too small to hold this minimum bounding box, then the objects will - keep their size and the bounding box will overflow the box area, - still respecting the alignment. Weight hint is used as a - boolean, if greater than zero it will make that cell expand in that - axis, toggling the *expand mode*, which makes the table behave - much like @Evas.Object_Table.Homogeneous_Mode.table, except that the - bounding box will overflow and items will not overlap siblings. If - no minimum size is provided at all then the table will fallback to - expand mode as well.]] - set { - } - get { - } - values { - homogeneous: Evas.Object_Table.Homogeneous_Mode; [[Table homogeneous mode]] - } - } - @property align { - [[Control the alignment of the whole bounding box of contents.]] - set { - } - get { - } - values { - horizontal: double; [[Horizontal alignment]] - vertical: double; [[Vertical alignment]] - } - } - @property padding { - [[Control the padding between cells.]] - set { - } - get { - } - values { - horizontal: int; [[Horizontal padding]] - vertical: int; [[Vertical padding]] - } - } - @property col_row_size { - get { - [[Get the number of columns and rows this table takes. - - Note: columns and rows are virtual entities, one can specify a table - with a single object that takes 4 columns and 5 rows. The only - difference for a single cell table is that paddings will be - accounted proportionally.]] - } - values { - cols: int; [[Columns in table]] - rows: int; [[Rows in table]] - } - } - @property children { - get { - [[Get the list of children for the table. - - Note: This is a duplicate of the list kept by the table internally. - It's up to the user to destroy it when it no longer needs it. - It's possible to remove objects from the table when walking this - list, but these removals won't be reflected on it.]] - return: list @owned @warn_unused; [[Children list]] - } - } - @property child { - get { - [[Get the child of the table at the given coordinates - - Note: This does not take into account col/row spanning]] - } - keys { - col: ushort; [[Child column]] - row: ushort; [[Child row]] - } - values { - child: Efl.Canvas.Object; [[Child object]] - } - } - clear { - [[Faster way to remove all child objects from a table object.]] - - params { - @in clear: bool; [[If $true, it will delete just removed children.]] - } - } - accessor_new @const { - [[Get an accessor to get random access to the list of children for the table. - - Note: Do not remove or delete objects while walking the list.]] - return: accessor @owned - @warn_unused; [[Accessor to children list]] - } - iterator_new @const { - [[Get an iterator to walk the list of children for the table. - - Note: Do not remove or delete objects while walking the list.]] - return: iterator @owned - @warn_unused; [[Iterator to children]] - } - add_to { - [[Create a table that is child of a given element $parent.]] - - return: Efl.Canvas.Object @warn_unused; [[Children table]] - } - pack_get @const { - [[Get packing location of a child of table - - @since 1.1]] - return: bool; [[$true on success, $false on failure.]] - params { - @in child: Efl.Canvas.Object; [[The child object to add.]] - @out col: ushort; [[Pointer to store relative-horizontal position to place child.]] - @out row: ushort; [[Pointer to store relative-vertical position to place child.]] - @out colspan: ushort; [[Pointer to store how many relative-horizontal positions to use for this child.]] - @out rowspan: ushort; [[Pointer to store how many relative-vertical positions to use for this child.]] - } - } - pack { - [[Add a new child to a table object or set its current packing. - - Note that columns and rows only guarantee 16bit unsigned values at best. - That means that col + colspan AND row + rowspan must fit inside 16bit - unsigned values cleanly. You will be warned once values exceed 15bit - storage, and attempting to use values not able to fit in 16bits will - result in failure.]] - - return: bool; [[$true on success, $false on failure.]] - params { - @in child: Efl.Canvas.Object @nonull; [[The child object to add.]] - @in col: ushort; [[Relative-horizontal position to place child.]] - @in row: ushort; [[Relative-vertical position to place child.]] - @in colspan: ushort; [[How many relative-horizontal positions to use for this child.]] - @in rowspan: ushort; [[How many relative-vertical positions to use for this child.]] - } - } - unpack { - [[Remove child from table. - - Note: removing a child will immediately call a walk over children in order - to recalculate numbers of columns and rows. If you plan to remove - all children, use @Evas.Table.clear instead.]] - - return: bool; [[$true on success, $false on failure.]] - params { - @in child: Efl.Canvas.Object @nonull; [[Child to be removed]] - } - } - count { - [[Returns the number of items in the table]] - legacy: null; - return: int; [[Number of items in table]] - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Gfx.Entity.size { set; } - Efl.Gfx.Entity.position { set; } - Efl.Canvas.Group.group_calculate; - Efl.Ui.I18n.mirrored { get; set; } - } -} diff --git a/src/lib/evas/canvas/evas_table_eo.c b/src/lib/evas/canvas/evas_table_eo.c new file mode 100644 index 0000000000..0369d7ced1 --- /dev/null +++ b/src/lib/evas/canvas/evas_table_eo.c @@ -0,0 +1,142 @@ + +void _evas_table_homogeneous_set(Eo *obj, Evas_Table_Data *pd, Evas_Object_Table_Homogeneous_Mode homogeneous); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_table_homogeneous_set, EFL_FUNC_CALL(homogeneous), Evas_Object_Table_Homogeneous_Mode homogeneous); + +Evas_Object_Table_Homogeneous_Mode _evas_table_homogeneous_get(const Eo *obj, Evas_Table_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_table_homogeneous_get, Evas_Object_Table_Homogeneous_Mode, 0); + +void _evas_table_align_set(Eo *obj, Evas_Table_Data *pd, double horizontal, double vertical); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_table_align_set, EFL_FUNC_CALL(horizontal, vertical), double horizontal, double vertical); + +void _evas_table_align_get(const Eo *obj, Evas_Table_Data *pd, double *horizontal, double *vertical); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_obj_table_align_get, EFL_FUNC_CALL(horizontal, vertical), double *horizontal, double *vertical); + +void _evas_table_padding_set(Eo *obj, Evas_Table_Data *pd, int horizontal, int vertical); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_table_padding_set, EFL_FUNC_CALL(horizontal, vertical), int horizontal, int vertical); + +void _evas_table_padding_get(const Eo *obj, Evas_Table_Data *pd, int *horizontal, int *vertical); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_obj_table_padding_get, EFL_FUNC_CALL(horizontal, vertical), int *horizontal, int *vertical); + +void _evas_table_col_row_size_get(const Eo *obj, Evas_Table_Data *pd, int *cols, int *rows); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_obj_table_col_row_size_get, EFL_FUNC_CALL(cols, rows), int *cols, int *rows); + +Eina_List *_evas_table_children_get(const Eo *obj, Evas_Table_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_table_children_get, Eina_List *, NULL); + +Efl_Canvas_Object *_evas_table_child_get(const Eo *obj, Evas_Table_Data *pd, unsigned short col, unsigned short row); + +EOAPI EFL_FUNC_BODYV_CONST(evas_obj_table_child_get, Efl_Canvas_Object *, NULL, EFL_FUNC_CALL(col, row), unsigned short col, unsigned short row); + +void _evas_table_clear(Eo *obj, Evas_Table_Data *pd, Eina_Bool clear); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_table_clear, EFL_FUNC_CALL(clear), Eina_Bool clear); + +Eina_Accessor *_evas_table_accessor_new(const Eo *obj, Evas_Table_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_table_accessor_new, Eina_Accessor *, NULL); + +Eina_Iterator *_evas_table_iterator_new(const Eo *obj, Evas_Table_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_table_iterator_new, Eina_Iterator *, NULL); + +Efl_Canvas_Object *_evas_table_add_to(Eo *obj, Evas_Table_Data *pd); + +EOAPI EFL_FUNC_BODY(evas_obj_table_add_to, Efl_Canvas_Object *, NULL); + +Eina_Bool _evas_table_pack_get(const Eo *obj, Evas_Table_Data *pd, Efl_Canvas_Object *child, unsigned short *col, unsigned short *row, unsigned short *colspan, unsigned short *rowspan); + +EOAPI EFL_FUNC_BODYV_CONST(evas_obj_table_pack_get, Eina_Bool, 0, EFL_FUNC_CALL(child, col, row, colspan, rowspan), Efl_Canvas_Object *child, unsigned short *col, unsigned short *row, unsigned short *colspan, unsigned short *rowspan); + +Eina_Bool _evas_table_pack(Eo *obj, Evas_Table_Data *pd, Efl_Canvas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan); + +EOAPI EFL_FUNC_BODYV(evas_obj_table_pack, Eina_Bool, 0, EFL_FUNC_CALL(child, col, row, colspan, rowspan), Efl_Canvas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan); + +Eina_Bool _evas_table_unpack(Eo *obj, Evas_Table_Data *pd, Efl_Canvas_Object *child); + +EOAPI EFL_FUNC_BODYV(evas_obj_table_unpack, Eina_Bool, 0, EFL_FUNC_CALL(child), Efl_Canvas_Object *child); + +int _evas_table_count(Eo *obj, Evas_Table_Data *pd); + +EOAPI EFL_FUNC_BODY(evas_obj_table_count, int, 0); + +Efl_Object *_evas_table_efl_object_constructor(Eo *obj, Evas_Table_Data *pd); + + +void _evas_table_efl_gfx_entity_size_set(Eo *obj, Evas_Table_Data *pd, Eina_Size2D size); + + +void _evas_table_efl_gfx_entity_position_set(Eo *obj, Evas_Table_Data *pd, Eina_Position2D pos); + + +void _evas_table_efl_canvas_group_group_calculate(Eo *obj, Evas_Table_Data *pd); + + +void _evas_table_efl_ui_i18n_mirrored_set(Eo *obj, Evas_Table_Data *pd, Eina_Bool rtl); + + +Eina_Bool _evas_table_efl_ui_i18n_mirrored_get(const Eo *obj, Evas_Table_Data *pd); + + +static Eina_Bool +_evas_table_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EVAS_TABLE_EXTRA_OPS +#define EVAS_TABLE_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(evas_obj_table_homogeneous_set, _evas_table_homogeneous_set), + EFL_OBJECT_OP_FUNC(evas_obj_table_homogeneous_get, _evas_table_homogeneous_get), + EFL_OBJECT_OP_FUNC(evas_obj_table_align_set, _evas_table_align_set), + EFL_OBJECT_OP_FUNC(evas_obj_table_align_get, _evas_table_align_get), + EFL_OBJECT_OP_FUNC(evas_obj_table_padding_set, _evas_table_padding_set), + EFL_OBJECT_OP_FUNC(evas_obj_table_padding_get, _evas_table_padding_get), + EFL_OBJECT_OP_FUNC(evas_obj_table_col_row_size_get, _evas_table_col_row_size_get), + EFL_OBJECT_OP_FUNC(evas_obj_table_children_get, _evas_table_children_get), + EFL_OBJECT_OP_FUNC(evas_obj_table_child_get, _evas_table_child_get), + EFL_OBJECT_OP_FUNC(evas_obj_table_clear, _evas_table_clear), + EFL_OBJECT_OP_FUNC(evas_obj_table_accessor_new, _evas_table_accessor_new), + EFL_OBJECT_OP_FUNC(evas_obj_table_iterator_new, _evas_table_iterator_new), + EFL_OBJECT_OP_FUNC(evas_obj_table_add_to, _evas_table_add_to), + EFL_OBJECT_OP_FUNC(evas_obj_table_pack_get, _evas_table_pack_get), + EFL_OBJECT_OP_FUNC(evas_obj_table_pack, _evas_table_pack), + EFL_OBJECT_OP_FUNC(evas_obj_table_unpack, _evas_table_unpack), + EFL_OBJECT_OP_FUNC(evas_obj_table_count, _evas_table_count), + EFL_OBJECT_OP_FUNC(efl_constructor, _evas_table_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _evas_table_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _evas_table_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _evas_table_efl_canvas_group_group_calculate), + EFL_OBJECT_OP_FUNC(efl_ui_mirrored_set, _evas_table_efl_ui_i18n_mirrored_set), + EFL_OBJECT_OP_FUNC(efl_ui_mirrored_get, _evas_table_efl_ui_i18n_mirrored_get), + EVAS_TABLE_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _evas_table_class_desc = { + EO_VERSION, + "Evas.Table", + EFL_CLASS_TYPE_REGULAR, + sizeof(Evas_Table_Data), + _evas_table_class_initializer, + _evas_table_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(evas_table_class_get, &_evas_table_class_desc, EFL_CANVAS_GROUP_CLASS, NULL); + +#include "evas_table_eo.legacy.c" diff --git a/src/lib/evas/canvas/evas_table_eo.h b/src/lib/evas/canvas/evas_table_eo.h new file mode 100644 index 0000000000..576e109320 --- /dev/null +++ b/src/lib/evas/canvas/evas_table_eo.h @@ -0,0 +1,338 @@ +#ifndef _EVAS_TABLE_EO_H_ +#define _EVAS_TABLE_EO_H_ + +#ifndef _EVAS_TABLE_EO_CLASS_TYPE +#define _EVAS_TABLE_EO_CLASS_TYPE + +typedef Eo Evas_Table; + +#endif + +#ifndef _EVAS_TABLE_EO_TYPES +#define _EVAS_TABLE_EO_TYPES + +/** + * @brief How to pack items into cells in a table. + * + * See @ref evas_obj_table_homogeneous_get for an explanation of the function + * of each one. + * + * @ingroup Evas_Object_Table + */ +typedef enum +{ + EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE = 0, /**< No mode specified */ + EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE = 1, /**< Table mode */ + EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM = 2 /**< Item mode */ +} Evas_Object_Table_Homogeneous_Mode; + + +#endif +/** Evas table class + * + * @ingroup Evas_Table + */ +#define EVAS_TABLE_CLASS evas_table_class_get() + +EWAPI const Efl_Class *evas_table_class_get(void); + +/** + * @brief Set how this table should layout children. + * + * Todo: consider aspect hint and respect it. + * + * @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE If table does not use homogeneous + * mode then columns and rows will be calculated based on hints of individual + * cells. This operation mode is more flexible, but more complex and heavy to + * calculate as well. Weight properties are handled as a boolean expand. + * Negative alignment will be considered as 0.5. This is the default. + * + * Todo: @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight. + * + * @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE When homogeneous is relative to + * table the own table size is divided equally among children, filling the + * whole table area. That is, if table has @c WIDTH and @c COLUMNS, each cell + * will get _WIDTH / COLUMNS_ pixels. If children have minimum size that is + * larger than this amount (including padding), then it will overflow and be + * aligned respecting the alignment hint, possible overlapping sibling cells. + * Weight hint is used as a boolean, if greater than zero it will make the + * child expand in that axis, taking as much space as possible (bounded to + * maximum size hint). Negative alignment will be considered as 0.5. + * + * @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM When homogeneous is relative to item + * it means the greatest minimum cell size will be used. That is, if no element + * is set to expand, the table will have its contents to a minimum size, the + * bounding box of all these children will be aligned relatively to the table + * object using evas_object_table_align_get(). If the table area is too small + * to hold this minimum bounding box, then the objects will keep their size and + * the bounding box will overflow the box area, still respecting the alignment. + * Weight hint is used as a boolean, if greater than zero it will make that + * cell expand in that axis, toggling the *expand mode*, which makes the table + * behave much like @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the + * bounding box will overflow and items will not overlap siblings. If no + * minimum size is provided at all then the table will fallback to expand mode + * as well. + * + * @param[in] obj The object. + * @param[in] homogeneous Table homogeneous mode + * + * @ingroup Evas_Table + */ +EOAPI void evas_obj_table_homogeneous_set(Eo *obj, Evas_Object_Table_Homogeneous_Mode homogeneous); + +/** + * @brief Set how this table should layout children. + * + * Todo: consider aspect hint and respect it. + * + * @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE If table does not use homogeneous + * mode then columns and rows will be calculated based on hints of individual + * cells. This operation mode is more flexible, but more complex and heavy to + * calculate as well. Weight properties are handled as a boolean expand. + * Negative alignment will be considered as 0.5. This is the default. + * + * Todo: @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight. + * + * @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE When homogeneous is relative to + * table the own table size is divided equally among children, filling the + * whole table area. That is, if table has @c WIDTH and @c COLUMNS, each cell + * will get _WIDTH / COLUMNS_ pixels. If children have minimum size that is + * larger than this amount (including padding), then it will overflow and be + * aligned respecting the alignment hint, possible overlapping sibling cells. + * Weight hint is used as a boolean, if greater than zero it will make the + * child expand in that axis, taking as much space as possible (bounded to + * maximum size hint). Negative alignment will be considered as 0.5. + * + * @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM When homogeneous is relative to item + * it means the greatest minimum cell size will be used. That is, if no element + * is set to expand, the table will have its contents to a minimum size, the + * bounding box of all these children will be aligned relatively to the table + * object using evas_object_table_align_get(). If the table area is too small + * to hold this minimum bounding box, then the objects will keep their size and + * the bounding box will overflow the box area, still respecting the alignment. + * Weight hint is used as a boolean, if greater than zero it will make that + * cell expand in that axis, toggling the *expand mode*, which makes the table + * behave much like @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the + * bounding box will overflow and items will not overlap siblings. If no + * minimum size is provided at all then the table will fallback to expand mode + * as well. + * + * @param[in] obj The object. + * + * @return Table homogeneous mode + * + * @ingroup Evas_Table + */ +EOAPI Evas_Object_Table_Homogeneous_Mode evas_obj_table_homogeneous_get(const Eo *obj); + +/** + * @brief Control the alignment of the whole bounding box of contents. + * + * @param[in] obj The object. + * @param[in] horizontal Horizontal alignment + * @param[in] vertical Vertical alignment + * + * @ingroup Evas_Table + */ +EOAPI void evas_obj_table_align_set(Eo *obj, double horizontal, double vertical); + +/** + * @brief Control the alignment of the whole bounding box of contents. + * + * @param[in] obj The object. + * @param[out] horizontal Horizontal alignment + * @param[out] vertical Vertical alignment + * + * @ingroup Evas_Table + */ +EOAPI void evas_obj_table_align_get(const Eo *obj, double *horizontal, double *vertical); + +/** + * @brief Control the padding between cells. + * + * @param[in] obj The object. + * @param[in] horizontal Horizontal padding + * @param[in] vertical Vertical padding + * + * @ingroup Evas_Table + */ +EOAPI void evas_obj_table_padding_set(Eo *obj, int horizontal, int vertical); + +/** + * @brief Control the padding between cells. + * + * @param[in] obj The object. + * @param[out] horizontal Horizontal padding + * @param[out] vertical Vertical padding + * + * @ingroup Evas_Table + */ +EOAPI void evas_obj_table_padding_get(const Eo *obj, int *horizontal, int *vertical); + +/** + * @brief Get the number of columns and rows this table takes. + * + * @note columns and rows are virtual entities, one can specify a table with a + * single object that takes 4 columns and 5 rows. The only difference for a + * single cell table is that paddings will be accounted proportionally. + * + * @param[in] obj The object. + * @param[out] cols Columns in table + * @param[out] rows Rows in table + * + * @ingroup Evas_Table + */ +EOAPI void evas_obj_table_col_row_size_get(const Eo *obj, int *cols, int *rows); + +/** + * @brief Get the list of children for the table. + * + * @note This is a duplicate of the list kept by the table internally. It's up + * to the user to destroy it when it no longer needs it. It's possible to + * remove objects from the table when walking this list, but these removals + * won't be reflected on it. + * + * @param[in] obj The object. + * + * @return Children list + * + * @ingroup Evas_Table + */ +EOAPI Eina_List *evas_obj_table_children_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get the child of the table at the given coordinates + * + * @note This does not take into account col/row spanning + * + * @param[in] obj The object. + * @param[in] col Child column + * @param[in] row Child row + * + * @return Child object + * + * @ingroup Evas_Table + */ +EOAPI Efl_Canvas_Object *evas_obj_table_child_get(const Eo *obj, unsigned short col, unsigned short row); + +/** + * @brief Faster way to remove all child objects from a table object. + * + * @param[in] obj The object. + * @param[in] clear If @c true, it will delete just removed children. + * + * @ingroup Evas_Table + */ +EOAPI void evas_obj_table_clear(Eo *obj, Eina_Bool clear); + +/** + * @brief Get an accessor to get random access to the list of children for the + * table. + * + * @note Do not remove or delete objects while walking the list. + * + * @param[in] obj The object. + * + * @return Accessor to children list + * + * @ingroup Evas_Table + */ +EOAPI Eina_Accessor *evas_obj_table_accessor_new(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get an iterator to walk the list of children for the table. + * + * @note Do not remove or delete objects while walking the list. + * + * @param[in] obj The object. + * + * @return Iterator to children + * + * @ingroup Evas_Table + */ +EOAPI Eina_Iterator *evas_obj_table_iterator_new(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Create a table that is child of a given element @c parent. + * + * @param[in] obj The object. + * + * @return Children table + * + * @ingroup Evas_Table + */ +EOAPI Efl_Canvas_Object *evas_obj_table_add_to(Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get packing location of a child of table + * + * @param[in] obj The object. + * @param[in] child The child object to add. + * @param[out] col Pointer to store relative-horizontal position to place + * child. + * @param[out] row Pointer to store relative-vertical position to place child. + * @param[out] colspan Pointer to store how many relative-horizontal positions + * to use for this child. + * @param[out] rowspan Pointer to store how many relative-vertical positions to + * use for this child. + * + * @return @c true on success, @c false on failure. + * + * @since 1.1 + * + * @ingroup Evas_Table + */ +EOAPI Eina_Bool evas_obj_table_pack_get(const Eo *obj, Efl_Canvas_Object *child, unsigned short *col, unsigned short *row, unsigned short *colspan, unsigned short *rowspan); + +/** + * @brief Add a new child to a table object or set its current packing. + * + * Note that columns and rows only guarantee 16bit unsigned values at best. + * That means that col + colspan AND row + rowspan must fit inside 16bit + * unsigned values cleanly. You will be warned once values exceed 15bit + * storage, and attempting to use values not able to fit in 16bits will result + * in failure. + * + * @param[in] obj The object. + * @param[in] child The child object to add. + * @param[in] col Relative-horizontal position to place child. + * @param[in] row Relative-vertical position to place child. + * @param[in] colspan How many relative-horizontal positions to use for this + * child. + * @param[in] rowspan How many relative-vertical positions to use for this + * child. + * + * @return @c true on success, @c false on failure. + * + * @ingroup Evas_Table + */ +EOAPI Eina_Bool evas_obj_table_pack(Eo *obj, Efl_Canvas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan) EINA_ARG_NONNULL(2); + +/** + * @brief Remove child from table. + * + * @note removing a child will immediately call a walk over children in order + * to recalculate numbers of columns and rows. If you plan to remove all + * children, use @ref evas_obj_table_clear instead. + * + * @param[in] obj The object. + * @param[in] child Child to be removed + * + * @return @c true on success, @c false on failure. + * + * @ingroup Evas_Table + */ +EOAPI Eina_Bool evas_obj_table_unpack(Eo *obj, Efl_Canvas_Object *child) EINA_ARG_NONNULL(2); + +/** + * @brief Returns the number of items in the table + * + * @param[in] obj The object. + * + * @return Number of items in table + * + * @ingroup Evas_Table + */ +EOAPI int evas_obj_table_count(Eo *obj); + +#endif diff --git a/src/lib/evas/canvas/evas_table_eo.hh b/src/lib/evas/canvas/evas_table_eo.hh new file mode 100644 index 0000000000..d2bfc62e99 --- /dev/null +++ b/src/lib/evas/canvas/evas_table_eo.hh @@ -0,0 +1,380 @@ +#ifndef EVAS_TABLE_EO_HH +#define EVAS_TABLE_EO_HH +#include + +extern "C" { +#include "efl_canvas_group.eo.h" +#include "efl_canvas_object.eo.h" +#include "efl_canvas_pointer.eo.h" +#include "efl_class.eo.h" +#include "efl_gfx_color.eo.h" +#include "efl_gfx_entity.eo.h" +#include "efl_gfx_hint.eo.h" +#include "efl_gfx_mapping.eo.h" +#include "efl_gfx_stack.eo.h" +#include "efl_input_device.eo.h" +#include "efl_input_focus.eo.h" +#include "efl_input_hold.eo.h" +#include "efl_input_interface.eo.h" +#include "efl_input_key.eo.h" +#include "efl_input_pointer.eo.h" +#include "efl_loop.eo.h" +#include "efl_loop_consumer.eo.h" +#include "efl_object.eo.h" +#include "efl_ui_i18n.eo.h" +#include "evas_table_eo.h" +} +#include +#include +#include "efl_canvas_group.eo.hh" +#include "efl_canvas_object.eo.hh" +#include "efl_canvas_pointer.eo.hh" +#include "efl_class.eo.hh" +#include "efl_gfx_color.eo.hh" +#include "efl_gfx_entity.eo.hh" +#include "efl_gfx_hint.eo.hh" +#include "efl_gfx_mapping.eo.hh" +#include "efl_gfx_stack.eo.hh" +#include "efl_input_device.eo.hh" +#include "efl_input_focus.eo.hh" +#include "efl_input_hold.eo.hh" +#include "efl_input_interface.eo.hh" +#include "efl_input_key.eo.hh" +#include "efl_input_pointer.eo.hh" +#include "efl_loop.eo.hh" +#include "efl_loop_consumer.eo.hh" +#include "efl_object.eo.hh" +#include "efl_ui_i18n.eo.hh" +#ifndef EVAS_TABLE_FWD_GUARD +#define EVAS_TABLE_FWD_GUARD +namespace evas { +struct Table; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Table> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Table&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Table const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Table const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CLASS_FWD_GUARD +#define EFL_CLASS_FWD_GUARD +namespace efl { +struct Class; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_COLOR_FWD_GUARD +#define EFL_GFX_COLOR_FWD_GUARD +namespace efl { namespace gfx { +struct Color; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_DEVICE_FWD_GUARD +#define EFL_INPUT_DEVICE_FWD_GUARD +namespace efl { namespace input { +struct Device; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_ENTITY_FWD_GUARD +#define EFL_GFX_ENTITY_FWD_GUARD +namespace efl { namespace gfx { +struct Entity; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_HINT_FWD_GUARD +#define EFL_GFX_HINT_FWD_GUARD +namespace efl { namespace gfx { +struct Hint; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_FOCUS_FWD_GUARD +#define EFL_INPUT_FOCUS_FWD_GUARD +namespace efl { namespace input { +struct Focus; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_HOLD_FWD_GUARD +#define EFL_INPUT_HOLD_FWD_GUARD +namespace efl { namespace input { +struct Hold; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_UI_I18N_FWD_GUARD +#define EFL_UI_I18N_FWD_GUARD +namespace efl { namespace ui { +struct I18n; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_INTERFACE_FWD_GUARD +#define EFL_INPUT_INTERFACE_FWD_GUARD +namespace efl { namespace input { +struct Interface; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_KEY_FWD_GUARD +#define EFL_INPUT_KEY_FWD_GUARD +namespace efl { namespace input { +struct Key; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_LOOP_FWD_GUARD +#define EFL_LOOP_FWD_GUARD +namespace efl { +struct Loop; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_LOOP_CONSUMER_FWD_GUARD +#define EFL_LOOP_CONSUMER_FWD_GUARD +namespace efl { +struct Loop_Consumer; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_OBJECT_FWD_GUARD +#define EFL_OBJECT_FWD_GUARD +namespace efl { +struct Object; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_GROUP_FWD_GUARD +#define EFL_CANVAS_GROUP_FWD_GUARD +namespace efl { namespace canvas { +struct Group; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Group> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Group&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Group const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Group const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_MAPPING_FWD_GUARD +#define EFL_GFX_MAPPING_FWD_GUARD +namespace efl { namespace gfx { +struct Mapping; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_OBJECT_FWD_GUARD +#define EFL_CANVAS_OBJECT_FWD_GUARD +namespace efl { namespace canvas { +struct Object; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_POINTER_FWD_GUARD +#define EFL_CANVAS_POINTER_FWD_GUARD +namespace efl { namespace canvas { +struct Pointer; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_POINTER_FWD_GUARD +#define EFL_INPUT_POINTER_FWD_GUARD +namespace efl { namespace input { +struct Pointer; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_STACK_FWD_GUARD +#define EFL_GFX_STACK_FWD_GUARD +namespace efl { namespace gfx { +struct Stack; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack const&> : ::std::true_type {}; } } +#endif + +namespace eo_cxx { +namespace evas { +struct Table { + ::efl::eolian::return_traits::type homogeneous_get() const; + ::efl::eolian::return_traits::type homogeneous_set( ::efl::eolian::in_traits::type homogeneous) const; + ::efl::eolian::return_traits::type align_get( ::efl::eolian::out_traits::type horizontal, ::efl::eolian::out_traits::type vertical) const; + ::efl::eolian::return_traits::type align_set( ::efl::eolian::in_traits::type horizontal, ::efl::eolian::in_traits::type vertical) const; + ::efl::eolian::return_traits::type padding_get( ::efl::eolian::out_traits::type horizontal, ::efl::eolian::out_traits::type vertical) const; + ::efl::eolian::return_traits::type padding_set( ::efl::eolian::in_traits::type horizontal, ::efl::eolian::in_traits::type vertical) const; + ::efl::eolian::return_traits::type col_row_size_get( ::efl::eolian::out_traits::type cols, ::efl::eolian::out_traits::type rows) const; + ::efl::eolian::return_traits< ::efl::eina::list< ::efl::canvas::Object>>::type children_get() const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type child_get( ::efl::eolian::in_traits< unsigned short>::type col, ::efl::eolian::in_traits< unsigned short>::type row) const; + ::efl::eolian::return_traits::type clear( ::efl::eolian::in_traits::type clear) const; + ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type accessor_new() const; + ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type iterator_new() const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type add_to() const; + ::efl::eolian::return_traits::type pack_get( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::out_traits< unsigned short>::type col, ::efl::eolian::out_traits< unsigned short>::type row, ::efl::eolian::out_traits< unsigned short>::type colspan, ::efl::eolian::out_traits< unsigned short>::type rowspan) const; + ::efl::eolian::return_traits::type pack( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< unsigned short>::type col, ::efl::eolian::in_traits< unsigned short>::type row, ::efl::eolian::in_traits< unsigned short>::type colspan, ::efl::eolian::in_traits< unsigned short>::type rowspan) const; + ::efl::eolian::return_traits::type unpack( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits::type count() const; + static Efl_Class const* _eo_class() + { + return EVAS_TABLE_CLASS; + } + Eo* _eo_ptr() const { return *(reinterpret_cast(const_cast(this))); } + operator ::evas::Table() const; + operator ::evas::Table&(); + operator ::evas::Table const&() const; + /// @cond LOCAL + ::efl::eolian::address_of_operator operator&() { return {this}; } + ::efl::eolian::address_of_operator
operator&() const { return {this}; } + /// @endcond +}; +} +} +namespace evas { +struct Table : private ::efl::eo::concrete + , EO_CXX_INHERIT(::efl::Loop_Consumer) + , EO_CXX_INHERIT(::efl::Object) + , EO_CXX_INHERIT(::efl::canvas::Group) + , EO_CXX_INHERIT(::efl::canvas::Object) + , EO_CXX_INHERIT(::efl::canvas::Pointer) + , EO_CXX_INHERIT(::efl::gfx::Color) + , EO_CXX_INHERIT(::efl::gfx::Entity) + , EO_CXX_INHERIT(::efl::gfx::Hint) + , EO_CXX_INHERIT(::efl::gfx::Mapping) + , EO_CXX_INHERIT(::efl::gfx::Stack) + , EO_CXX_INHERIT(::efl::input::Interface) + , EO_CXX_INHERIT(::efl::ui::I18n) +{ + explicit Table( ::Eo* eo) + : ::efl::eo::concrete(eo) {} + Table(std::nullptr_t) + : ::efl::eo::concrete(nullptr) {} + explicit Table() = default; + Table(Table const&) = default; + Table(Table&&) = default; + Table& operator=(Table const&) = default; + Table& operator=(Table&&) = default; + template + Table(Derived&& derived + , typename std::enable_if< + ::efl::eo::is_eolian_object::value + && std::is_base_of< Table, Derived>::value>::type* = 0) + : ::efl::eo::concrete(derived._eo_ptr()) {} + + Table( ::efl::eo::instantiate_t) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, ::efl::eo::concrete{nullptr}, _eo_class()); + } + template + explicit Table( ::efl::eo::instantiate_t, T&& parent, typename std::enable_if< ::efl::eo::is_eolian_object::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, parent, _eo_class()); + } + template Table( ::efl::eo::instantiate_t, F&& f, typename ::std::enable_if< ::efl::eolian::is_constructor_lambda::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, ::efl::eo::concrete{nullptr}, _eo_class(), *this, std::forward(f)); + } + template Table( ::efl::eo::instantiate_t, T&& parent, F&& f, typename ::std::enable_if< ::efl::eolian::is_constructor_lambda::value && ::efl::eo::is_eolian_object::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, parent, _eo_class(), *this, std::forward(f)); + } + + ::efl::eolian::return_traits::type homogeneous_get() const; + ::efl::eolian::return_traits::type homogeneous_set( ::efl::eolian::in_traits::type homogeneous) const; + ::efl::eolian::return_traits::type align_get( ::efl::eolian::out_traits::type horizontal, ::efl::eolian::out_traits::type vertical) const; + ::efl::eolian::return_traits::type align_set( ::efl::eolian::in_traits::type horizontal, ::efl::eolian::in_traits::type vertical) const; + ::efl::eolian::return_traits::type padding_get( ::efl::eolian::out_traits::type horizontal, ::efl::eolian::out_traits::type vertical) const; + ::efl::eolian::return_traits::type padding_set( ::efl::eolian::in_traits::type horizontal, ::efl::eolian::in_traits::type vertical) const; + ::efl::eolian::return_traits::type col_row_size_get( ::efl::eolian::out_traits::type cols, ::efl::eolian::out_traits::type rows) const; + ::efl::eolian::return_traits< ::efl::eina::list< ::efl::canvas::Object>>::type children_get() const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type child_get( ::efl::eolian::in_traits< unsigned short>::type col, ::efl::eolian::in_traits< unsigned short>::type row) const; + ::efl::eolian::return_traits::type clear( ::efl::eolian::in_traits::type clear) const; + ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type accessor_new() const; + ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type iterator_new() const; + ::efl::eolian::return_traits< ::efl::canvas::Object>::type add_to() const; + ::efl::eolian::return_traits::type pack_get( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::out_traits< unsigned short>::type col, ::efl::eolian::out_traits< unsigned short>::type row, ::efl::eolian::out_traits< unsigned short>::type colspan, ::efl::eolian::out_traits< unsigned short>::type rowspan) const; + ::efl::eolian::return_traits::type pack( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< unsigned short>::type col, ::efl::eolian::in_traits< unsigned short>::type row, ::efl::eolian::in_traits< unsigned short>::type colspan, ::efl::eolian::in_traits< unsigned short>::type rowspan) const; + ::efl::eolian::return_traits::type unpack( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const; + ::efl::eolian::return_traits::type count() const; + static Efl_Class const* _eo_class() + { + return EVAS_TABLE_CLASS; + } + Eo* _eo_ptr() const { return *(reinterpret_cast(const_cast
(this))); } + /// @cond LOCAL + ::efl::eolian::address_of_operator operator&() { return {this}; } + ::efl::eolian::address_of_operator
operator&() const { return {this}; } + /// @endcond + ::efl::eo::wref
_get_wref() const { return ::efl::eo::wref
(*this); } + ::efl::eo::concrete const& _get_concrete() const { return *this; } + ::efl::eo::concrete& _get_concrete() { return *this; } + using ::efl::eo::concrete::_eo_ptr; + using ::efl::eo::concrete::_release; + using ::efl::eo::concrete::_reset; + using ::efl::eo::concrete::_delete; + using ::efl::eo::concrete::operator bool; +#ifdef EFL_CXXPERIMENTAL + const Table* operator->() const { return this; } + Table* operator->() { return this; } + operator Eo*() const { return _eo_ptr(); } +#endif + friend bool operator==(Table const& lhs, Table const& rhs) + { return lhs._get_concrete() == rhs._get_concrete(); } + friend bool operator!=(Table const& lhs, Table const& rhs) + { return !(lhs == rhs); } +}; +static_assert(sizeof(Table) == sizeof(Eo*), ""); +static_assert(std::is_standard_layout
::value, ""); +} +#endif diff --git a/src/lib/evas/canvas/evas_table_eo.impl.hh b/src/lib/evas/canvas/evas_table_eo.impl.hh new file mode 100644 index 0000000000..4cfca3ea62 --- /dev/null +++ b/src/lib/evas/canvas/evas_table_eo.impl.hh @@ -0,0 +1,260 @@ +#ifndef EVAS_TABLE_IMPL_HH +#define EVAS_TABLE_IMPL_HH + +#include "evas_table_eo.hh" + +namespace evas { +inline ::efl::eolian::return_traits::type Table::homogeneous_get() const +{ + Evas_Object_Table_Homogeneous_Mode __return_value = ::evas_obj_table_homogeneous_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Table::homogeneous_set( ::efl::eolian::in_traits::type homogeneous) const +{ + ::evas_obj_table_homogeneous_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(homogeneous)); +} +inline ::efl::eolian::return_traits::type Table::align_get( ::efl::eolian::out_traits::type horizontal, ::efl::eolian::out_traits::type vertical) const +{ + double __out_param_horizontal = {}; + double __out_param_vertical = {}; + ::evas_obj_table_align_get(_eo_ptr(), + & __out_param_horizontal, + & __out_param_vertical); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, double>(horizontal, __out_param_horizontal); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, double>(vertical, __out_param_vertical); +} +inline ::efl::eolian::return_traits::type Table::align_set( ::efl::eolian::in_traits::type horizontal, ::efl::eolian::in_traits::type vertical) const +{ + ::evas_obj_table_align_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(horizontal), + ::efl::eolian::convert_to_c::type>(vertical)); +} +inline ::efl::eolian::return_traits::type Table::padding_get( ::efl::eolian::out_traits::type horizontal, ::efl::eolian::out_traits::type vertical) const +{ + int __out_param_horizontal = {}; + int __out_param_vertical = {}; + ::evas_obj_table_padding_get(_eo_ptr(), + & __out_param_horizontal, + & __out_param_vertical); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(horizontal, __out_param_horizontal); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(vertical, __out_param_vertical); +} +inline ::efl::eolian::return_traits::type Table::padding_set( ::efl::eolian::in_traits::type horizontal, ::efl::eolian::in_traits::type vertical) const +{ + ::evas_obj_table_padding_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(horizontal), + ::efl::eolian::convert_to_c::type>(vertical)); +} +inline ::efl::eolian::return_traits::type Table::col_row_size_get( ::efl::eolian::out_traits::type cols, ::efl::eolian::out_traits::type rows) const +{ + int __out_param_cols = {}; + int __out_param_rows = {}; + ::evas_obj_table_col_row_size_get(_eo_ptr(), + & __out_param_cols, + & __out_param_rows); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(cols, __out_param_cols); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(rows, __out_param_rows); +} +inline ::efl::eolian::return_traits< ::efl::eina::list< ::efl::canvas::Object>>::type Table::children_get() const +{ + Eina_List * __return_value = ::evas_obj_table_children_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::list< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Table::child_get( ::efl::eolian::in_traits< unsigned short>::type col, ::efl::eolian::in_traits< unsigned short>::type row) const +{ + ::Efl_Canvas_Object* __return_value = ::evas_obj_table_child_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(col), + ::efl::eolian::convert_to_c::type>(row)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Table::clear( ::efl::eolian::in_traits::type clear) const +{ + ::evas_obj_table_clear(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(clear)); +} +inline ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type Table::accessor_new() const +{ + Eina_Accessor * __return_value = ::evas_obj_table_accessor_new(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type Table::iterator_new() const +{ + Eina_Iterator * __return_value = ::evas_obj_table_iterator_new(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Table::add_to() const +{ + ::Efl_Canvas_Object* __return_value = ::evas_obj_table_add_to(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Table::pack_get( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::out_traits< unsigned short>::type col, ::efl::eolian::out_traits< unsigned short>::type row, ::efl::eolian::out_traits< unsigned short>::type colspan, ::efl::eolian::out_traits< unsigned short>::type rowspan) const +{ + unsigned short __out_param_col = {}; + unsigned short __out_param_row = {}; + unsigned short __out_param_colspan = {}; + unsigned short __out_param_rowspan = {}; + Eina_Bool __return_value = ::evas_obj_table_pack_get(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + & __out_param_col, + & __out_param_row, + & __out_param_colspan, + & __out_param_rowspan); + ::efl::eolian::assign_out< ::efl::eolian::out_traits< unsigned short>::type, unsigned short>(col, __out_param_col); + ::efl::eolian::assign_out< ::efl::eolian::out_traits< unsigned short>::type, unsigned short>(row, __out_param_row); + ::efl::eolian::assign_out< ::efl::eolian::out_traits< unsigned short>::type, unsigned short>(colspan, __out_param_colspan); + ::efl::eolian::assign_out< ::efl::eolian::out_traits< unsigned short>::type, unsigned short>(rowspan, __out_param_rowspan); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Table::pack( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< unsigned short>::type col, ::efl::eolian::in_traits< unsigned short>::type row, ::efl::eolian::in_traits< unsigned short>::type colspan, ::efl::eolian::in_traits< unsigned short>::type rowspan) const +{ + Eina_Bool __return_value = ::evas_obj_table_pack(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + ::efl::eolian::convert_to_c::type>(col), + ::efl::eolian::convert_to_c::type>(row), + ::efl::eolian::convert_to_c::type>(colspan), + ::efl::eolian::convert_to_c::type>(rowspan)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Table::unpack( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + Eina_Bool __return_value = ::evas_obj_table_unpack(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Table::count() const +{ + int __return_value = ::evas_obj_table_count(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +} +namespace eo_cxx { +namespace evas { +inline ::efl::eolian::return_traits::type Table::homogeneous_get() const +{ + Evas_Object_Table_Homogeneous_Mode __return_value = ::evas_obj_table_homogeneous_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Table::homogeneous_set( ::efl::eolian::in_traits::type homogeneous) const +{ + ::evas_obj_table_homogeneous_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(homogeneous)); +} +inline ::efl::eolian::return_traits::type Table::align_get( ::efl::eolian::out_traits::type horizontal, ::efl::eolian::out_traits::type vertical) const +{ + double __out_param_horizontal = {}; + double __out_param_vertical = {}; + ::evas_obj_table_align_get(_eo_ptr(), + & __out_param_horizontal, + & __out_param_vertical); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, double>(horizontal, __out_param_horizontal); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, double>(vertical, __out_param_vertical); +} +inline ::efl::eolian::return_traits::type Table::align_set( ::efl::eolian::in_traits::type horizontal, ::efl::eolian::in_traits::type vertical) const +{ + ::evas_obj_table_align_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(horizontal), + ::efl::eolian::convert_to_c::type>(vertical)); +} +inline ::efl::eolian::return_traits::type Table::padding_get( ::efl::eolian::out_traits::type horizontal, ::efl::eolian::out_traits::type vertical) const +{ + int __out_param_horizontal = {}; + int __out_param_vertical = {}; + ::evas_obj_table_padding_get(_eo_ptr(), + & __out_param_horizontal, + & __out_param_vertical); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(horizontal, __out_param_horizontal); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(vertical, __out_param_vertical); +} +inline ::efl::eolian::return_traits::type Table::padding_set( ::efl::eolian::in_traits::type horizontal, ::efl::eolian::in_traits::type vertical) const +{ + ::evas_obj_table_padding_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(horizontal), + ::efl::eolian::convert_to_c::type>(vertical)); +} +inline ::efl::eolian::return_traits::type Table::col_row_size_get( ::efl::eolian::out_traits::type cols, ::efl::eolian::out_traits::type rows) const +{ + int __out_param_cols = {}; + int __out_param_rows = {}; + ::evas_obj_table_col_row_size_get(_eo_ptr(), + & __out_param_cols, + & __out_param_rows); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(cols, __out_param_cols); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(rows, __out_param_rows); +} +inline ::efl::eolian::return_traits< ::efl::eina::list< ::efl::canvas::Object>>::type Table::children_get() const +{ + Eina_List * __return_value = ::evas_obj_table_children_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::list< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Table::child_get( ::efl::eolian::in_traits< unsigned short>::type col, ::efl::eolian::in_traits< unsigned short>::type row) const +{ + ::Efl_Canvas_Object* __return_value = ::evas_obj_table_child_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(col), + ::efl::eolian::convert_to_c::type>(row)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Table::clear( ::efl::eolian::in_traits::type clear) const +{ + ::evas_obj_table_clear(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(clear)); +} +inline ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type Table::accessor_new() const +{ + Eina_Accessor * __return_value = ::evas_obj_table_accessor_new(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::accessor< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type Table::iterator_new() const +{ + Eina_Iterator * __return_value = ::evas_obj_table_iterator_new(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::iterator< ::efl::canvas::Object>>::type>(__return_value); +} +inline ::efl::eolian::return_traits< ::efl::canvas::Object>::type Table::add_to() const +{ + ::Efl_Canvas_Object* __return_value = ::evas_obj_table_add_to(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::canvas::Object>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Table::pack_get( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::out_traits< unsigned short>::type col, ::efl::eolian::out_traits< unsigned short>::type row, ::efl::eolian::out_traits< unsigned short>::type colspan, ::efl::eolian::out_traits< unsigned short>::type rowspan) const +{ + unsigned short __out_param_col = {}; + unsigned short __out_param_row = {}; + unsigned short __out_param_colspan = {}; + unsigned short __out_param_rowspan = {}; + Eina_Bool __return_value = ::evas_obj_table_pack_get(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + & __out_param_col, + & __out_param_row, + & __out_param_colspan, + & __out_param_rowspan); + ::efl::eolian::assign_out< ::efl::eolian::out_traits< unsigned short>::type, unsigned short>(col, __out_param_col); + ::efl::eolian::assign_out< ::efl::eolian::out_traits< unsigned short>::type, unsigned short>(row, __out_param_row); + ::efl::eolian::assign_out< ::efl::eolian::out_traits< unsigned short>::type, unsigned short>(colspan, __out_param_colspan); + ::efl::eolian::assign_out< ::efl::eolian::out_traits< unsigned short>::type, unsigned short>(rowspan, __out_param_rowspan); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Table::pack( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child, ::efl::eolian::in_traits< unsigned short>::type col, ::efl::eolian::in_traits< unsigned short>::type row, ::efl::eolian::in_traits< unsigned short>::type colspan, ::efl::eolian::in_traits< unsigned short>::type rowspan) const +{ + Eina_Bool __return_value = ::evas_obj_table_pack(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child), + ::efl::eolian::convert_to_c::type>(col), + ::efl::eolian::convert_to_c::type>(row), + ::efl::eolian::convert_to_c::type>(colspan), + ::efl::eolian::convert_to_c::type>(rowspan)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Table::unpack( ::efl::eolian::in_traits< ::efl::canvas::Object>::type child) const +{ + Eina_Bool __return_value = ::evas_obj_table_unpack(_eo_ptr(), + ::efl::eolian::convert_to_c< ::Efl_Canvas_Object*, ::efl::eolian::in_traits< ::efl::canvas::Object>::type>(child)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Table::count() const +{ + int __return_value = ::evas_obj_table_count(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline evas::Table::operator ::evas::Table() const { return *static_cast< ::evas::Table const*>(static_cast(this)); } +inline evas::Table::operator ::evas::Table&() { return *static_cast< ::evas::Table*>(static_cast(this)); } +inline evas::Table::operator ::evas::Table const&() const { return *static_cast< ::evas::Table const*>(static_cast(this)); } +} } +#endif diff --git a/src/lib/evas/canvas/evas_table_eo.legacy.c b/src/lib/evas/canvas/evas_table_eo.legacy.c new file mode 100644 index 0000000000..9e449a38d9 --- /dev/null +++ b/src/lib/evas/canvas/evas_table_eo.legacy.c @@ -0,0 +1,96 @@ + +EAPI void +evas_object_table_homogeneous_set(Evas_Table *obj, Evas_Object_Table_Homogeneous_Mode homogeneous) +{ + evas_obj_table_homogeneous_set(obj, homogeneous); +} + +EAPI Evas_Object_Table_Homogeneous_Mode +evas_object_table_homogeneous_get(const Evas_Table *obj) +{ + return evas_obj_table_homogeneous_get(obj); +} + +EAPI void +evas_object_table_align_set(Evas_Table *obj, double horizontal, double vertical) +{ + evas_obj_table_align_set(obj, horizontal, vertical); +} + +EAPI void +evas_object_table_align_get(const Evas_Table *obj, double *horizontal, double *vertical) +{ + evas_obj_table_align_get(obj, horizontal, vertical); +} + +EAPI void +evas_object_table_padding_set(Evas_Table *obj, int horizontal, int vertical) +{ + evas_obj_table_padding_set(obj, horizontal, vertical); +} + +EAPI void +evas_object_table_padding_get(const Evas_Table *obj, int *horizontal, int *vertical) +{ + evas_obj_table_padding_get(obj, horizontal, vertical); +} + +EAPI void +evas_object_table_col_row_size_get(const Evas_Table *obj, int *cols, int *rows) +{ + evas_obj_table_col_row_size_get(obj, cols, rows); +} + +EAPI Eina_List * +evas_object_table_children_get(const Evas_Table *obj) +{ + return evas_obj_table_children_get(obj); +} + +EAPI Efl_Canvas_Object * +evas_object_table_child_get(const Evas_Table *obj, unsigned short col, unsigned short row) +{ + return evas_obj_table_child_get(obj, col, row); +} + +EAPI void +evas_object_table_clear(Evas_Table *obj, Eina_Bool clear) +{ + evas_obj_table_clear(obj, clear); +} + +EAPI Eina_Accessor * +evas_object_table_accessor_new(const Evas_Table *obj) +{ + return evas_obj_table_accessor_new(obj); +} + +EAPI Eina_Iterator * +evas_object_table_iterator_new(const Evas_Table *obj) +{ + return evas_obj_table_iterator_new(obj); +} + +EAPI Efl_Canvas_Object * +evas_object_table_add_to(Evas_Table *obj) +{ + return evas_obj_table_add_to(obj); +} + +EAPI Eina_Bool +evas_object_table_pack_get(const Evas_Table *obj, Efl_Canvas_Object *child, unsigned short *col, unsigned short *row, unsigned short *colspan, unsigned short *rowspan) +{ + return evas_obj_table_pack_get(obj, child, col, row, colspan, rowspan); +} + +EAPI Eina_Bool +evas_object_table_pack(Evas_Table *obj, Efl_Canvas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan) +{ + return evas_obj_table_pack(obj, child, col, row, colspan, rowspan); +} + +EAPI Eina_Bool +evas_object_table_unpack(Evas_Table *obj, Efl_Canvas_Object *child) +{ + return evas_obj_table_unpack(obj, child); +} diff --git a/src/lib/evas/canvas/evas_table_eo.legacy.h b/src/lib/evas/canvas/evas_table_eo.legacy.h new file mode 100644 index 0000000000..d7fc5d1b1b --- /dev/null +++ b/src/lib/evas/canvas/evas_table_eo.legacy.h @@ -0,0 +1,321 @@ +#ifndef _EVAS_TABLE_EO_LEGACY_H_ +#define _EVAS_TABLE_EO_LEGACY_H_ + +#ifndef _EVAS_TABLE_EO_CLASS_TYPE +#define _EVAS_TABLE_EO_CLASS_TYPE + +typedef Eo Evas_Table; + +#endif + +#ifndef _EVAS_TABLE_EO_TYPES +#define _EVAS_TABLE_EO_TYPES + +/** + * @brief How to pack items into cells in a table. + * + * See @ref evas_object_table_homogeneous_get for an explanation of the + * function of each one. + * + * @ingroup Evas_Object_Table + */ +typedef enum +{ + EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE = 0, /**< No mode specified */ + EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE = 1, /**< Table mode */ + EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM = 2 /**< Item mode */ +} Evas_Object_Table_Homogeneous_Mode; + + +#endif + +/** + * @brief Set how this table should layout children. + * + * Todo: consider aspect hint and respect it. + * + * @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE If table does not use homogeneous + * mode then columns and rows will be calculated based on hints of individual + * cells. This operation mode is more flexible, but more complex and heavy to + * calculate as well. Weight properties are handled as a boolean expand. + * Negative alignment will be considered as 0.5. This is the default. + * + * Todo: @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight. + * + * @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE When homogeneous is relative to + * table the own table size is divided equally among children, filling the + * whole table area. That is, if table has @c WIDTH and @c COLUMNS, each cell + * will get _WIDTH / COLUMNS_ pixels. If children have minimum size that is + * larger than this amount (including padding), then it will overflow and be + * aligned respecting the alignment hint, possible overlapping sibling cells. + * Weight hint is used as a boolean, if greater than zero it will make the + * child expand in that axis, taking as much space as possible (bounded to + * maximum size hint). Negative alignment will be considered as 0.5. + * + * @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM When homogeneous is relative to item + * it means the greatest minimum cell size will be used. That is, if no element + * is set to expand, the table will have its contents to a minimum size, the + * bounding box of all these children will be aligned relatively to the table + * object using evas_object_table_align_get(). If the table area is too small + * to hold this minimum bounding box, then the objects will keep their size and + * the bounding box will overflow the box area, still respecting the alignment. + * Weight hint is used as a boolean, if greater than zero it will make that + * cell expand in that axis, toggling the *expand mode*, which makes the table + * behave much like @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the + * bounding box will overflow and items will not overlap siblings. If no + * minimum size is provided at all then the table will fallback to expand mode + * as well. + * + * @param[in] obj The object. + * @param[in] homogeneous Table homogeneous mode + * + * @ingroup Evas_Object_Table_Group + */ +EAPI void evas_object_table_homogeneous_set(Evas_Table *obj, Evas_Object_Table_Homogeneous_Mode homogeneous); + +/** + * @brief Set how this table should layout children. + * + * Todo: consider aspect hint and respect it. + * + * @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE If table does not use homogeneous + * mode then columns and rows will be calculated based on hints of individual + * cells. This operation mode is more flexible, but more complex and heavy to + * calculate as well. Weight properties are handled as a boolean expand. + * Negative alignment will be considered as 0.5. This is the default. + * + * Todo: @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight. + * + * @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE When homogeneous is relative to + * table the own table size is divided equally among children, filling the + * whole table area. That is, if table has @c WIDTH and @c COLUMNS, each cell + * will get _WIDTH / COLUMNS_ pixels. If children have minimum size that is + * larger than this amount (including padding), then it will overflow and be + * aligned respecting the alignment hint, possible overlapping sibling cells. + * Weight hint is used as a boolean, if greater than zero it will make the + * child expand in that axis, taking as much space as possible (bounded to + * maximum size hint). Negative alignment will be considered as 0.5. + * + * @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM When homogeneous is relative to item + * it means the greatest minimum cell size will be used. That is, if no element + * is set to expand, the table will have its contents to a minimum size, the + * bounding box of all these children will be aligned relatively to the table + * object using evas_object_table_align_get(). If the table area is too small + * to hold this minimum bounding box, then the objects will keep their size and + * the bounding box will overflow the box area, still respecting the alignment. + * Weight hint is used as a boolean, if greater than zero it will make that + * cell expand in that axis, toggling the *expand mode*, which makes the table + * behave much like @ref EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the + * bounding box will overflow and items will not overlap siblings. If no + * minimum size is provided at all then the table will fallback to expand mode + * as well. + * + * @param[in] obj The object. + * + * @return Table homogeneous mode + * + * @ingroup Evas_Object_Table_Group + */ +EAPI Evas_Object_Table_Homogeneous_Mode evas_object_table_homogeneous_get(const Evas_Table *obj); + +/** + * @brief Control the alignment of the whole bounding box of contents. + * + * @param[in] obj The object. + * @param[in] horizontal Horizontal alignment + * @param[in] vertical Vertical alignment + * + * @ingroup Evas_Object_Table_Group + */ +EAPI void evas_object_table_align_set(Evas_Table *obj, double horizontal, double vertical); + +/** + * @brief Control the alignment of the whole bounding box of contents. + * + * @param[in] obj The object. + * @param[out] horizontal Horizontal alignment + * @param[out] vertical Vertical alignment + * + * @ingroup Evas_Object_Table_Group + */ +EAPI void evas_object_table_align_get(const Evas_Table *obj, double *horizontal, double *vertical); + +/** + * @brief Control the padding between cells. + * + * @param[in] obj The object. + * @param[in] horizontal Horizontal padding + * @param[in] vertical Vertical padding + * + * @ingroup Evas_Object_Table_Group + */ +EAPI void evas_object_table_padding_set(Evas_Table *obj, int horizontal, int vertical); + +/** + * @brief Control the padding between cells. + * + * @param[in] obj The object. + * @param[out] horizontal Horizontal padding + * @param[out] vertical Vertical padding + * + * @ingroup Evas_Object_Table_Group + */ +EAPI void evas_object_table_padding_get(const Evas_Table *obj, int *horizontal, int *vertical); + +/** + * @brief Get the number of columns and rows this table takes. + * + * @note columns and rows are virtual entities, one can specify a table with a + * single object that takes 4 columns and 5 rows. The only difference for a + * single cell table is that paddings will be accounted proportionally. + * + * @param[in] obj The object. + * @param[out] cols Columns in table + * @param[out] rows Rows in table + * + * @ingroup Evas_Object_Table_Group + */ +EAPI void evas_object_table_col_row_size_get(const Evas_Table *obj, int *cols, int *rows); + +/** + * @brief Get the list of children for the table. + * + * @note This is a duplicate of the list kept by the table internally. It's up + * to the user to destroy it when it no longer needs it. It's possible to + * remove objects from the table when walking this list, but these removals + * won't be reflected on it. + * + * @param[in] obj The object. + * + * @return Children list + * + * @ingroup Evas_Object_Table_Group + */ +EAPI Eina_List *evas_object_table_children_get(const Evas_Table *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get the child of the table at the given coordinates + * + * @note This does not take into account col/row spanning + * + * @param[in] obj The object. + * @param[in] col Child column + * @param[in] row Child row + * + * @return Child object + * + * @ingroup Evas_Object_Table_Group + */ +EAPI Efl_Canvas_Object *evas_object_table_child_get(const Evas_Table *obj, unsigned short col, unsigned short row); + +/** + * @brief Faster way to remove all child objects from a table object. + * + * @param[in] obj The object. + * @param[in] clear If @c true, it will delete just removed children. + * + * @ingroup Evas_Object_Table_Group + */ +EAPI void evas_object_table_clear(Evas_Table *obj, Eina_Bool clear); + +/** + * @brief Get an accessor to get random access to the list of children for the + * table. + * + * @note Do not remove or delete objects while walking the list. + * + * @param[in] obj The object. + * + * @return Accessor to children list + * + * @ingroup Evas_Object_Table_Group + */ +EAPI Eina_Accessor *evas_object_table_accessor_new(const Evas_Table *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get an iterator to walk the list of children for the table. + * + * @note Do not remove or delete objects while walking the list. + * + * @param[in] obj The object. + * + * @return Iterator to children + * + * @ingroup Evas_Object_Table_Group + */ +EAPI Eina_Iterator *evas_object_table_iterator_new(const Evas_Table *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Create a table that is child of a given element @c parent. + * + * @param[in] obj The object. + * + * @return Children table + * + * @ingroup Evas_Object_Table_Group + */ +EAPI Efl_Canvas_Object *evas_object_table_add_to(Evas_Table *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Get packing location of a child of table + * + * @param[in] obj The object. + * @param[in] child The child object to add. + * @param[out] col Pointer to store relative-horizontal position to place + * child. + * @param[out] row Pointer to store relative-vertical position to place child. + * @param[out] colspan Pointer to store how many relative-horizontal positions + * to use for this child. + * @param[out] rowspan Pointer to store how many relative-vertical positions to + * use for this child. + * + * @return @c true on success, @c false on failure. + * + * @since 1.1 + * + * @ingroup Evas_Object_Table_Group + */ +EAPI Eina_Bool evas_object_table_pack_get(const Evas_Table *obj, Efl_Canvas_Object *child, unsigned short *col, unsigned short *row, unsigned short *colspan, unsigned short *rowspan); + +/** + * @brief Add a new child to a table object or set its current packing. + * + * Note that columns and rows only guarantee 16bit unsigned values at best. + * That means that col + colspan AND row + rowspan must fit inside 16bit + * unsigned values cleanly. You will be warned once values exceed 15bit + * storage, and attempting to use values not able to fit in 16bits will result + * in failure. + * + * @param[in] obj The object. + * @param[in] child The child object to add. + * @param[in] col Relative-horizontal position to place child. + * @param[in] row Relative-vertical position to place child. + * @param[in] colspan How many relative-horizontal positions to use for this + * child. + * @param[in] rowspan How many relative-vertical positions to use for this + * child. + * + * @return @c true on success, @c false on failure. + * + * @ingroup Evas_Object_Table_Group + */ +EAPI Eina_Bool evas_object_table_pack(Evas_Table *obj, Efl_Canvas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan) EINA_ARG_NONNULL(2); + +/** + * @brief Remove child from table. + * + * @note removing a child will immediately call a walk over children in order + * to recalculate numbers of columns and rows. If you plan to remove all + * children, use @ref evas_object_table_clear instead. + * + * @param[in] obj The object. + * @param[in] child Child to be removed + * + * @return @c true on success, @c false on failure. + * + * @ingroup Evas_Object_Table_Group + */ +EAPI Eina_Bool evas_object_table_unpack(Evas_Table *obj, Efl_Canvas_Object *child) EINA_ARG_NONNULL(2); + + +#endif diff --git a/src/lib/evas/canvas/evas_text.eo b/src/lib/evas/canvas/evas_text.eo deleted file mode 100644 index 9d9b7cca7d..0000000000 --- a/src/lib/evas/canvas/evas_text.eo +++ /dev/null @@ -1,287 +0,0 @@ -type @extern Evas.Text_Style_Type : __undefined_type; [[External text style type]] - -class Evas.Text extends Efl.Canvas.Object implements Efl.Text, - Efl.Text_Font, Efl.Canvas.Filter.Internal -{ - [[Evas text class]] - legacy_prefix: evas_object_text; - eo_prefix: evas_obj_text; - methods { - @property shadow_color { - [[Controls the shadow color for the given text object. - - Shadow effects are fading colors decorating the text - underneath it. They will be shown if the object is set to - one of the following styles: - - - $EVAS_TEXT_STYLE_TYPE_SHADOW - - $EVAS_TEXT_STYLE_TYPE_OUTLINE_SHADOW - - $EVAS_TEXT_STYLE_TYPE_FAR_SHADOW - - $EVAS_TEXT_STYLE_TYPE_OUTLINE_SOFT_SHADOW - - $EVAS_TEXT_STYLE_TYPE_SOFT_SHADOW - - $EVAS_TEXT_STYLE_TYPE_FAR_SOFT_SHADOW - - One can also change the direction where the shadow grows to, with - @.style - - See @.shadow_color]] - set { - } - get { - [[Note: Use $NULL pointers on the color components you're not - interested in: they'll be ignored by the function.]] - } - 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 ellipsis { - [[Controls the ellipsis that should be used for the text object. - - This is a value between 0.0 and 1.0 indicating the position of the text - to be shown. 0.0 means the start will be shown and the end trimmed, 1.0 - means the beginning will be trimmed and the end will be shown, and any value - in between will cause ellipsis to be added in both end of the text and the - requested part to be shown. - -1.0 means ellipsis is turned off. - - @since 1.8]] - set { - } - get { - } - values { - ellipsis: double(-1.0); [[The ellipsis. Allowed values: -1.0 or 0.0-1.0]] - } - } - @property bidi_delimiters { - [[Sets the BiDi delimiters used in the textblock. - - BiDi delimiters are use for in-paragraph separation of bidi segments. This - is useful for example in recipients fields of e-mail clients where bidi - oddities can occur when mixing RTL and LTR. - - @since 1.1]] - set { - } - get { - } - values { - delim: string; [[A null terminated string of delimiters, e.g ",|".]] - } - } - @property outline_color { - [[Controls the outline color for the given text object. - - Outline effects (colored lines around text glyphs) will be - shown if the object is set to one of the following styles: - - $EVAS_TEXT_STYLE_TYPE_OUTLINE - - $EVAS_TEXT_STYLE_TYPE_SOFT_OUTLINE - - $EVAS_TEXT_STYLE_TYPE_OUTLINE_SHADOW - - $EVAS_TEXT_STYLE_TYPE_OUTLINE_SOFT_SHADOW - ]] - set { - } - get { - } - 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 glow2_color { - [[Sets the 'glow 2' color for the given text object. - - 'Glow 2' effects are glowing colors decorating the text's - (immediate) surroundings. They will be shown if the object - is set to the $EVAS_TEXT_STYLE_TYPE_GLOW style. See also - @.glow_color. - ]] - set { - } - get { - } - 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 style { - [[Controls the style to apply on the given text object. - - Text object styles are one of the values in @Evas.Text_Style_Type - Some of those values are combinations of more than one style, - and some account for the direction of the rendering of shadow effects. - - Note: One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and - #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value.]] - - /* FIXME-doc: - The following figure illustrates the text styles: - - @image html text-styles.png - @image rtf text-styles.png - @image latex text-styles.eps - - @see evas_object_text_style_get() - @see evas_object_text_shadow_color_set() - @see evas_object_text_outline_color_set() - @see evas_object_text_glow_color_set() - @see evas_object_text_glow2_color_set() */ - set { - } - get { - } - values { - style: Evas.Text_Style_Type; [[Style type]] - } - } - @property glow_color { - [[Sets the glow color for the given text object. - - Glow effects are glowing colors decorating the text's - surroundings. They will be shown if the object is set to the - $EVAS_TEXT_STYLE_TYPE_GLOW style. - - Note: Glow effects are placed from a short distance of the text - itself, but not touching it. For glowing effects right on the - borders of the glyphs, see 'glow 2' effects.]] - set { - } - get { - } - 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 max_descent { - [[Maximal descent property]] - get { - return: int; [[Evas coordinate]] - } - } - @property style_pad { - get { - [[Gets the text style pad of a text object.]] - } - values { - l: int; [[The left pad (or $NULL).]] - r: int; [[The right pad (or $NULL).]] - t: int; [[The top pad (or $NULL).]] - b: int; [[The bottom pad (or $NULL).]] - } - } - @property direction { - get { - [[Retrieves the direction of the text currently being displayed in the - text object.]] - - return: Efl.Text_Bidirectional_Type; [[Bidirectional type]] - } - } - @property ascent { - [[Ascent property]] - get { - return: int; [[Evas coordinate]] - } - } - @property horiz_advance { - [[Horizontal advance property]] - get { - return: int; [[Evas coordinate]] - } - } - @property inset { - [[Inset property]] - get { - return: int; [[Evas coordinate]] - } - } - @property max_ascent { - [[Maximal ascent property]] - get { - return: int; [[Evas coordinate]] - } - } - @property vert_advance { - [[Vertical advance property]] - get { - return: int; [[Evas coordinate]] - } - } - @property descent { - [[descent property]] - get { - return: int; [[Evas coordinate]] - } - } - last_up_to_pos @const { - [[Returns the logical position of the last char in the text up to - the pos given. - - This is NOT the position of the last char because of the possibility - of RTL in the text. - ]] - return: int(-1); [[Logical position of the last char]] - params { - @in x: int; [[X coordinate]] - @in y: int; [[Y coordinate]] - } - } - char_coords_get @const { - [[Get character coordinates]] - return: int; [[Logical position of char]] - params { - @in x: int; [[X coordinate]] - @in y: int; [[Y coordinate]] - @out cx: int; [[X coordinate]] - @out cy: int; [[Y coordinate]] - @out cw: int; [[Width]] - @out ch: int; [[Height]] - } - } - char_pos_get @const { - [[Retrieve position and dimension information of a character within a text @Efl.Canvas.Object - - This function is used to obtain the X, Y, width and height of the character - located at $pos within the @Efl.Canvas.Object $obj. $obj must be a text object - Any of the $Evas_Coord parameters ($cx, $cy, $cw, $ch) may be $NULL in which case no value will be assigned to that - parameter.]] - - return: bool; [[$false on success, $true otherwise]] - params { - @in pos: int; [[The character position to request co-ordinates for.]] - @out cx: int; [[A pointer to an int to store the X value in (can be NULL).]] - @out cy: int; [[A pointer to an int to store the Y value in (can be NULL).]] - @out cw: int; [[A pointer to an int to store the Width value in (can be NULL).]] - @out ch: int; [[A pointer to an int to store the Height value in (can be NULL).]] - } - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Efl.Gfx.Entity.size { set; } - Efl.Gfx.Entity.scale { set; } - Efl.Text.text { 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; - Efl.Canvas.Filter.Internal.filter_input_render; - Efl.Canvas.Filter.Internal.filter_state_prepare; - Efl.Canvas.Object.paragraph_direction { set; get; } - } -} diff --git a/src/lib/evas/canvas/evas_text_eo.c b/src/lib/evas/canvas/evas_text_eo.c new file mode 100644 index 0000000000..9285d46114 --- /dev/null +++ b/src/lib/evas/canvas/evas_text_eo.c @@ -0,0 +1,296 @@ + +void _evas_text_shadow_color_set(Eo *obj, Evas_Text_Data *pd, int r, int g, int b, int a); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_text_shadow_color_set, EFL_FUNC_CALL(r, g, b, a), int r, int g, int b, int a); + +void _evas_text_shadow_color_get(const Eo *obj, Evas_Text_Data *pd, int *r, int *g, int *b, int *a); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_obj_text_shadow_color_get, EFL_FUNC_CALL(r, g, b, a), int *r, int *g, int *b, int *a); + +void _evas_text_ellipsis_set(Eo *obj, Evas_Text_Data *pd, double ellipsis); + + +static Eina_Error +__eolian_evas_text_ellipsis_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + evas_obj_text_ellipsis_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_text_ellipsis_set, EFL_FUNC_CALL(ellipsis), double ellipsis); + +double _evas_text_ellipsis_get(const Eo *obj, Evas_Text_Data *pd); + + +static Eina_Value +__eolian_evas_text_ellipsis_get_reflect(const Eo *obj) +{ + double val = evas_obj_text_ellipsis_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_text_ellipsis_get, double, -1.000000 /* +1.000000 */); + +void _evas_text_bidi_delimiters_set(Eo *obj, Evas_Text_Data *pd, const char *delim); + + +static Eina_Error +__eolian_evas_text_bidi_delimiters_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + evas_obj_text_bidi_delimiters_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_text_bidi_delimiters_set, EFL_FUNC_CALL(delim), const char *delim); + +const char *_evas_text_bidi_delimiters_get(const Eo *obj, Evas_Text_Data *pd); + + +static Eina_Value +__eolian_evas_text_bidi_delimiters_get_reflect(const Eo *obj) +{ + const char *val = evas_obj_text_bidi_delimiters_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_text_bidi_delimiters_get, const char *, NULL); + +void _evas_text_outline_color_set(Eo *obj, Evas_Text_Data *pd, int r, int g, int b, int a); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_text_outline_color_set, EFL_FUNC_CALL(r, g, b, a), int r, int g, int b, int a); + +void _evas_text_outline_color_get(const Eo *obj, Evas_Text_Data *pd, int *r, int *g, int *b, int *a); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_obj_text_outline_color_get, EFL_FUNC_CALL(r, g, b, a), int *r, int *g, int *b, int *a); + +void _evas_text_glow2_color_set(Eo *obj, Evas_Text_Data *pd, int r, int g, int b, int a); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_text_glow2_color_set, EFL_FUNC_CALL(r, g, b, a), int r, int g, int b, int a); + +void _evas_text_glow2_color_get(const Eo *obj, Evas_Text_Data *pd, int *r, int *g, int *b, int *a); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_obj_text_glow2_color_get, EFL_FUNC_CALL(r, g, b, a), int *r, int *g, int *b, int *a); + +void _evas_text_style_set(Eo *obj, Evas_Text_Data *pd, Evas_Text_Style_Type style); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_text_style_set, EFL_FUNC_CALL(style), Evas_Text_Style_Type style); + +Evas_Text_Style_Type _evas_text_style_get(const Eo *obj, Evas_Text_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_text_style_get, Evas_Text_Style_Type, 0); + +void _evas_text_glow_color_set(Eo *obj, Evas_Text_Data *pd, int r, int g, int b, int a); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_text_glow_color_set, EFL_FUNC_CALL(r, g, b, a), int r, int g, int b, int a); + +void _evas_text_glow_color_get(const Eo *obj, Evas_Text_Data *pd, int *r, int *g, int *b, int *a); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_obj_text_glow_color_get, EFL_FUNC_CALL(r, g, b, a), int *r, int *g, int *b, int *a); + +int _evas_text_max_descent_get(const Eo *obj, Evas_Text_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_text_max_descent_get, int, 0); + +void _evas_text_style_pad_get(const Eo *obj, Evas_Text_Data *pd, int *l, int *r, int *t, int *b); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_obj_text_style_pad_get, EFL_FUNC_CALL(l, r, t, b), int *l, int *r, int *t, int *b); + +Efl_Text_Bidirectional_Type _evas_text_direction_get(const Eo *obj, Evas_Text_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_text_direction_get, Efl_Text_Bidirectional_Type, 0); + +int _evas_text_ascent_get(const Eo *obj, Evas_Text_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_text_ascent_get, int, 0); + +int _evas_text_horiz_advance_get(const Eo *obj, Evas_Text_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_text_horiz_advance_get, int, 0); + +int _evas_text_inset_get(const Eo *obj, Evas_Text_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_text_inset_get, int, 0); + +int _evas_text_max_ascent_get(const Eo *obj, Evas_Text_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_text_max_ascent_get, int, 0); + +int _evas_text_vert_advance_get(const Eo *obj, Evas_Text_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_text_vert_advance_get, int, 0); + +int _evas_text_descent_get(const Eo *obj, Evas_Text_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_text_descent_get, int, 0); + +int _evas_text_last_up_to_pos(const Eo *obj, Evas_Text_Data *pd, int x, int y); + +EOAPI EFL_FUNC_BODYV_CONST(evas_obj_text_last_up_to_pos, int, -1 /* +1 */, EFL_FUNC_CALL(x, y), int x, int y); + +int _evas_text_char_coords_get(const Eo *obj, Evas_Text_Data *pd, int x, int y, int *cx, int *cy, int *cw, int *ch); + +EOAPI EFL_FUNC_BODYV_CONST(evas_obj_text_char_coords_get, int, 0, EFL_FUNC_CALL(x, y, cx, cy, cw, ch), int x, int y, int *cx, int *cy, int *cw, int *ch); + +Eina_Bool _evas_text_char_pos_get(const Eo *obj, Evas_Text_Data *pd, int pos, int *cx, int *cy, int *cw, int *ch); + +EOAPI EFL_FUNC_BODYV_CONST(evas_obj_text_char_pos_get, Eina_Bool, 0, EFL_FUNC_CALL(pos, cx, cy, cw, ch), int pos, int *cx, int *cy, int *cw, int *ch); + +Efl_Object *_evas_text_efl_object_constructor(Eo *obj, Evas_Text_Data *pd); + + +void _evas_text_efl_object_destructor(Eo *obj, Evas_Text_Data *pd); + + +void _evas_text_efl_gfx_entity_size_set(Eo *obj, Evas_Text_Data *pd, Eina_Size2D size); + + +void _evas_text_efl_gfx_entity_scale_set(Eo *obj, Evas_Text_Data *pd, double scale); + + +void _evas_text_efl_text_text_set(Eo *obj, Evas_Text_Data *pd, const char *text); + + +const char *_evas_text_efl_text_text_get(const Eo *obj, Evas_Text_Data *pd); + + +void _evas_text_efl_text_font_font_set(Eo *obj, Evas_Text_Data *pd, const char *font, Efl_Font_Size size); + + +void _evas_text_efl_text_font_font_get(const Eo *obj, Evas_Text_Data *pd, const char **font, Efl_Font_Size *size); + + +void _evas_text_efl_text_font_font_source_set(Eo *obj, Evas_Text_Data *pd, const char *font_source); + + +const char *_evas_text_efl_text_font_font_source_get(const Eo *obj, Evas_Text_Data *pd); + + +void _evas_text_efl_text_font_font_bitmap_scalable_set(Eo *obj, Evas_Text_Data *pd, Efl_Text_Font_Bitmap_Scalable scalable); + + +Efl_Text_Font_Bitmap_Scalable _evas_text_efl_text_font_font_bitmap_scalable_get(const Eo *obj, Evas_Text_Data *pd); + + +void _evas_text_efl_gfx_filter_filter_program_set(Eo *obj, Evas_Text_Data *pd, const char *code, const char *name); + + +void _evas_text_efl_canvas_filter_internal_filter_dirty(Eo *obj, Evas_Text_Data *pd); + + +Eina_Bool _evas_text_efl_canvas_filter_internal_filter_input_alpha(Eo *obj, Evas_Text_Data *pd); + + +Eina_Bool _evas_text_efl_canvas_filter_internal_filter_input_render(Eo *obj, Evas_Text_Data *pd, void *filter, void *engine, void *output, void *drawctx, void *data, int l, int r, int t, int b, int x, int y, Eina_Bool do_async); + + +void _evas_text_efl_canvas_filter_internal_filter_state_prepare(Eo *obj, Evas_Text_Data *pd, Efl_Canvas_Filter_State *state, void *data); + + +void _evas_text_efl_canvas_object_paragraph_direction_set(Eo *obj, Evas_Text_Data *pd, Efl_Text_Bidirectional_Type dir); + + +Efl_Text_Bidirectional_Type _evas_text_efl_canvas_object_paragraph_direction_get(const Eo *obj, Evas_Text_Data *pd); + + +static Eina_Bool +_evas_text_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EVAS_TEXT_EXTRA_OPS +#define EVAS_TEXT_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(evas_obj_text_shadow_color_set, _evas_text_shadow_color_set), + EFL_OBJECT_OP_FUNC(evas_obj_text_shadow_color_get, _evas_text_shadow_color_get), + EFL_OBJECT_OP_FUNC(evas_obj_text_ellipsis_set, _evas_text_ellipsis_set), + EFL_OBJECT_OP_FUNC(evas_obj_text_ellipsis_get, _evas_text_ellipsis_get), + EFL_OBJECT_OP_FUNC(evas_obj_text_bidi_delimiters_set, _evas_text_bidi_delimiters_set), + EFL_OBJECT_OP_FUNC(evas_obj_text_bidi_delimiters_get, _evas_text_bidi_delimiters_get), + EFL_OBJECT_OP_FUNC(evas_obj_text_outline_color_set, _evas_text_outline_color_set), + EFL_OBJECT_OP_FUNC(evas_obj_text_outline_color_get, _evas_text_outline_color_get), + EFL_OBJECT_OP_FUNC(evas_obj_text_glow2_color_set, _evas_text_glow2_color_set), + EFL_OBJECT_OP_FUNC(evas_obj_text_glow2_color_get, _evas_text_glow2_color_get), + EFL_OBJECT_OP_FUNC(evas_obj_text_style_set, _evas_text_style_set), + EFL_OBJECT_OP_FUNC(evas_obj_text_style_get, _evas_text_style_get), + EFL_OBJECT_OP_FUNC(evas_obj_text_glow_color_set, _evas_text_glow_color_set), + EFL_OBJECT_OP_FUNC(evas_obj_text_glow_color_get, _evas_text_glow_color_get), + EFL_OBJECT_OP_FUNC(evas_obj_text_max_descent_get, _evas_text_max_descent_get), + EFL_OBJECT_OP_FUNC(evas_obj_text_style_pad_get, _evas_text_style_pad_get), + EFL_OBJECT_OP_FUNC(evas_obj_text_direction_get, _evas_text_direction_get), + EFL_OBJECT_OP_FUNC(evas_obj_text_ascent_get, _evas_text_ascent_get), + EFL_OBJECT_OP_FUNC(evas_obj_text_horiz_advance_get, _evas_text_horiz_advance_get), + EFL_OBJECT_OP_FUNC(evas_obj_text_inset_get, _evas_text_inset_get), + EFL_OBJECT_OP_FUNC(evas_obj_text_max_ascent_get, _evas_text_max_ascent_get), + EFL_OBJECT_OP_FUNC(evas_obj_text_vert_advance_get, _evas_text_vert_advance_get), + EFL_OBJECT_OP_FUNC(evas_obj_text_descent_get, _evas_text_descent_get), + EFL_OBJECT_OP_FUNC(evas_obj_text_last_up_to_pos, _evas_text_last_up_to_pos), + EFL_OBJECT_OP_FUNC(evas_obj_text_char_coords_get, _evas_text_char_coords_get), + EFL_OBJECT_OP_FUNC(evas_obj_text_char_pos_get, _evas_text_char_pos_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _evas_text_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _evas_text_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _evas_text_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_scale_set, _evas_text_efl_gfx_entity_scale_set), + EFL_OBJECT_OP_FUNC(efl_text_set, _evas_text_efl_text_text_set), + EFL_OBJECT_OP_FUNC(efl_text_get, _evas_text_efl_text_text_get), + EFL_OBJECT_OP_FUNC(efl_text_font_set, _evas_text_efl_text_font_font_set), + EFL_OBJECT_OP_FUNC(efl_text_font_get, _evas_text_efl_text_font_font_get), + EFL_OBJECT_OP_FUNC(efl_text_font_source_set, _evas_text_efl_text_font_font_source_set), + EFL_OBJECT_OP_FUNC(efl_text_font_source_get, _evas_text_efl_text_font_font_source_get), + EFL_OBJECT_OP_FUNC(efl_text_font_bitmap_scalable_set, _evas_text_efl_text_font_font_bitmap_scalable_set), + EFL_OBJECT_OP_FUNC(efl_text_font_bitmap_scalable_get, _evas_text_efl_text_font_font_bitmap_scalable_get), + EFL_OBJECT_OP_FUNC(efl_gfx_filter_program_set, _evas_text_efl_gfx_filter_filter_program_set), + EFL_OBJECT_OP_FUNC(evas_filter_dirty, _evas_text_efl_canvas_filter_internal_filter_dirty), + EFL_OBJECT_OP_FUNC(evas_filter_input_alpha, _evas_text_efl_canvas_filter_internal_filter_input_alpha), + EFL_OBJECT_OP_FUNC(evas_filter_input_render, _evas_text_efl_canvas_filter_internal_filter_input_render), + EFL_OBJECT_OP_FUNC(evas_filter_state_prepare, _evas_text_efl_canvas_filter_internal_filter_state_prepare), + EFL_OBJECT_OP_FUNC(efl_canvas_object_paragraph_direction_set, _evas_text_efl_canvas_object_paragraph_direction_set), + EFL_OBJECT_OP_FUNC(efl_canvas_object_paragraph_direction_get, _evas_text_efl_canvas_object_paragraph_direction_get), + EVAS_TEXT_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"ellipsis", __eolian_evas_text_ellipsis_set_reflect, __eolian_evas_text_ellipsis_get_reflect}, + {"bidi_delimiters", __eolian_evas_text_bidi_delimiters_set_reflect, __eolian_evas_text_bidi_delimiters_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _evas_text_class_desc = { + EO_VERSION, + "Evas.Text", + EFL_CLASS_TYPE_REGULAR, + sizeof(Evas_Text_Data), + _evas_text_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(evas_text_class_get, &_evas_text_class_desc, EFL_CANVAS_OBJECT_CLASS, EFL_TEXT_INTERFACE, EFL_TEXT_FONT_INTERFACE, EFL_CANVAS_FILTER_INTERNAL_MIXIN, NULL); + +#include "evas_text_eo.legacy.c" diff --git a/src/lib/evas/canvas/evas_text_eo.h b/src/lib/evas/canvas/evas_text_eo.h new file mode 100644 index 0000000000..93ce36e834 --- /dev/null +++ b/src/lib/evas/canvas/evas_text_eo.h @@ -0,0 +1,462 @@ +#ifndef _EVAS_TEXT_EO_H_ +#define _EVAS_TEXT_EO_H_ + +#ifndef _EVAS_TEXT_EO_CLASS_TYPE +#define _EVAS_TEXT_EO_CLASS_TYPE + +typedef Eo Evas_Text; + +#endif + +#ifndef _EVAS_TEXT_EO_TYPES +#define _EVAS_TEXT_EO_TYPES + + +#endif +/** Evas text class + * + * @ingroup Evas_Text + */ +#define EVAS_TEXT_CLASS evas_text_class_get() + +EWAPI const Efl_Class *evas_text_class_get(void); + +/** + * @brief Controls the shadow color for the given text object. + * + * Shadow effects are fading colors decorating the text underneath it. They + * will be shown if the object is set to one of the following styles: + * + * - @c EVAS_TEXT_STYLE_TYPE_SHADOW - @c EVAS_TEXT_STYLE_TYPE_OUTLINE_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_FAR_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_OUTLINE_SOFT_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_SOFT_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_FAR_SOFT_SHADOW + * + * One can also change the direction where the shadow grows to, with + * @ref evas_obj_text_style_get + * + * See @ref evas_obj_text_shadow_color_get + * + * @param[in] obj The object. + * @param[in] r The red component of the given color. + * @param[in] g The green component of the given color. + * @param[in] b The blue component of the given color. + * @param[in] a The alpha component of the given color. + * + * @ingroup Evas_Text + */ +EOAPI void evas_obj_text_shadow_color_set(Eo *obj, int r, int g, int b, int a); + +/** + * @brief Controls the shadow color for the given text object. + * + * Shadow effects are fading colors decorating the text underneath it. They + * will be shown if the object is set to one of the following styles: + * + * - @c EVAS_TEXT_STYLE_TYPE_SHADOW - @c EVAS_TEXT_STYLE_TYPE_OUTLINE_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_FAR_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_OUTLINE_SOFT_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_SOFT_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_FAR_SOFT_SHADOW + * + * One can also change the direction where the shadow grows to, with + * @ref evas_obj_text_style_get + * + * See @ref evas_obj_text_shadow_color_get + * + * @note Use @c NULL pointers on the color components you're not interested in: + * they'll be ignored by the function. + * + * @param[in] obj The object. + * @param[out] r The red component of the given color. + * @param[out] g The green component of the given color. + * @param[out] b The blue component of the given color. + * @param[out] a The alpha component of the given color. + * + * @ingroup Evas_Text + */ +EOAPI void evas_obj_text_shadow_color_get(const Eo *obj, int *r, int *g, int *b, int *a); + +/** + * @brief Controls the ellipsis that should be used for the text object. + * + * This is a value between 0.0 and 1.0 indicating the position of the text to + * be shown. 0.0 means the start will be shown and the end trimmed, 1.0 means + * the beginning will be trimmed and the end will be shown, and any value in + * between will cause ellipsis to be added in both end of the text and the + * requested part to be shown. -1.0 means ellipsis is turned off. + * + * @param[in] obj The object. + * @param[in] ellipsis The ellipsis. Allowed values: -1.0 or 0.0-1.0 + * + * @since 1.8 + * + * @ingroup Evas_Text + */ +EOAPI void evas_obj_text_ellipsis_set(Eo *obj, double ellipsis); + +/** + * @brief Controls the ellipsis that should be used for the text object. + * + * This is a value between 0.0 and 1.0 indicating the position of the text to + * be shown. 0.0 means the start will be shown and the end trimmed, 1.0 means + * the beginning will be trimmed and the end will be shown, and any value in + * between will cause ellipsis to be added in both end of the text and the + * requested part to be shown. -1.0 means ellipsis is turned off. + * + * @param[in] obj The object. + * + * @return The ellipsis. Allowed values: -1.0 or 0.0-1.0 + * + * @since 1.8 + * + * @ingroup Evas_Text + */ +EOAPI double evas_obj_text_ellipsis_get(const Eo *obj); + +/** + * @brief Sets the BiDi delimiters used in the textblock. + * + * BiDi delimiters are use for in-paragraph separation of bidi segments. This + * is useful for example in recipients fields of e-mail clients where bidi + * oddities can occur when mixing RTL and LTR. + * + * @param[in] obj The object. + * @param[in] delim A null terminated string of delimiters, e.g ",|". + * + * @since 1.1 + * + * @ingroup Evas_Text + */ +EOAPI void evas_obj_text_bidi_delimiters_set(Eo *obj, const char *delim); + +/** + * @brief Sets the BiDi delimiters used in the textblock. + * + * BiDi delimiters are use for in-paragraph separation of bidi segments. This + * is useful for example in recipients fields of e-mail clients where bidi + * oddities can occur when mixing RTL and LTR. + * + * @param[in] obj The object. + * + * @return A null terminated string of delimiters, e.g ",|". + * + * @since 1.1 + * + * @ingroup Evas_Text + */ +EOAPI const char *evas_obj_text_bidi_delimiters_get(const Eo *obj); + +/** + * @brief Controls the outline color for the given text object. + * + * Outline effects (colored lines around text glyphs) will be shown if the + * object is set to one of the following styles: - + * @c EVAS_TEXT_STYLE_TYPE_OUTLINE - @c EVAS_TEXT_STYLE_TYPE_SOFT_OUTLINE - + * @c EVAS_TEXT_STYLE_TYPE_OUTLINE_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_OUTLINE_SOFT_SHADOW + * + * @param[in] obj The object. + * @param[in] r The red component of the given color. + * @param[in] g The green component of the given color. + * @param[in] b The blue component of the given color. + * @param[in] a The alpha component of the given color. + * + * @ingroup Evas_Text + */ +EOAPI void evas_obj_text_outline_color_set(Eo *obj, int r, int g, int b, int a); + +/** + * @brief Controls the outline color for the given text object. + * + * Outline effects (colored lines around text glyphs) will be shown if the + * object is set to one of the following styles: - + * @c EVAS_TEXT_STYLE_TYPE_OUTLINE - @c EVAS_TEXT_STYLE_TYPE_SOFT_OUTLINE - + * @c EVAS_TEXT_STYLE_TYPE_OUTLINE_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_OUTLINE_SOFT_SHADOW + * + * @param[in] obj The object. + * @param[out] r The red component of the given color. + * @param[out] g The green component of the given color. + * @param[out] b The blue component of the given color. + * @param[out] a The alpha component of the given color. + * + * @ingroup Evas_Text + */ +EOAPI void evas_obj_text_outline_color_get(const Eo *obj, int *r, int *g, int *b, int *a); + +/** + * @brief Sets the 'glow 2' color for the given text object. + * + * 'Glow 2' effects are glowing colors decorating the text's (immediate) + * surroundings. They will be shown if the object is set to the + * @c EVAS_TEXT_STYLE_TYPE_GLOW style. See also + * @ref evas_obj_text_glow_color_get. + * + * @param[in] obj The object. + * @param[in] r The red component of the given color. + * @param[in] g The green component of the given color. + * @param[in] b The blue component of the given color. + * @param[in] a The alpha component of the given color. + * + * @ingroup Evas_Text + */ +EOAPI void evas_obj_text_glow2_color_set(Eo *obj, int r, int g, int b, int a); + +/** + * @brief Sets the 'glow 2' color for the given text object. + * + * 'Glow 2' effects are glowing colors decorating the text's (immediate) + * surroundings. They will be shown if the object is set to the + * @c EVAS_TEXT_STYLE_TYPE_GLOW style. See also + * @ref evas_obj_text_glow_color_get. + * + * @param[in] obj The object. + * @param[out] r The red component of the given color. + * @param[out] g The green component of the given color. + * @param[out] b The blue component of the given color. + * @param[out] a The alpha component of the given color. + * + * @ingroup Evas_Text + */ +EOAPI void evas_obj_text_glow2_color_get(const Eo *obj, int *r, int *g, int *b, int *a); + +/** + * @brief Controls the style to apply on the given text object. + * + * Text object styles are one of the values in @ref Evas_Text_Style_Type Some + * of those values are combinations of more than one style, and some account + * for the direction of the rendering of shadow effects. + * + * @note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and + * #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value. + * + * @param[in] obj The object. + * @param[in] style Style type + * + * @ingroup Evas_Text + */ +EOAPI void evas_obj_text_style_set(Eo *obj, Evas_Text_Style_Type style); + +/** + * @brief Controls the style to apply on the given text object. + * + * Text object styles are one of the values in @ref Evas_Text_Style_Type Some + * of those values are combinations of more than one style, and some account + * for the direction of the rendering of shadow effects. + * + * @note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and + * #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value. + * + * @param[in] obj The object. + * + * @return Style type + * + * @ingroup Evas_Text + */ +EOAPI Evas_Text_Style_Type evas_obj_text_style_get(const Eo *obj); + +/** + * @brief Sets the glow color for the given text object. + * + * Glow effects are glowing colors decorating the text's surroundings. They + * will be shown if the object is set to the @c EVAS_TEXT_STYLE_TYPE_GLOW + * style. + * + * @note Glow effects are placed from a short distance of the text itself, but + * not touching it. For glowing effects right on the borders of the glyphs, see + * 'glow 2' effects. + * + * @param[in] obj The object. + * @param[in] r The red component of the given color. + * @param[in] g The green component of the given color. + * @param[in] b The blue component of the given color. + * @param[in] a The alpha component of the given color. + * + * @ingroup Evas_Text + */ +EOAPI void evas_obj_text_glow_color_set(Eo *obj, int r, int g, int b, int a); + +/** + * @brief Sets the glow color for the given text object. + * + * Glow effects are glowing colors decorating the text's surroundings. They + * will be shown if the object is set to the @c EVAS_TEXT_STYLE_TYPE_GLOW + * style. + * + * @note Glow effects are placed from a short distance of the text itself, but + * not touching it. For glowing effects right on the borders of the glyphs, see + * 'glow 2' effects. + * + * @param[in] obj The object. + * @param[out] r The red component of the given color. + * @param[out] g The green component of the given color. + * @param[out] b The blue component of the given color. + * @param[out] a The alpha component of the given color. + * + * @ingroup Evas_Text + */ +EOAPI void evas_obj_text_glow_color_get(const Eo *obj, int *r, int *g, int *b, int *a); + +/** + * @brief Maximal descent property + * + * @param[in] obj The object. + * + * @return Evas coordinate + * + * @ingroup Evas_Text + */ +EOAPI int evas_obj_text_max_descent_get(const Eo *obj); + +/** + * @brief Gets the text style pad of a text object. + * + * @param[in] obj The object. + * @param[out] l The left pad (or @c NULL). + * @param[out] r The right pad (or @c NULL). + * @param[out] t The top pad (or @c NULL). + * @param[out] b The bottom pad (or @c NULL). + * + * @ingroup Evas_Text + */ +EOAPI void evas_obj_text_style_pad_get(const Eo *obj, int *l, int *r, int *t, int *b); + +/** + * @brief Retrieves the direction of the text currently being displayed in the + * text object. + * + * @param[in] obj The object. + * + * @return Bidirectional type + * + * @ingroup Evas_Text + */ +EOAPI Efl_Text_Bidirectional_Type evas_obj_text_direction_get(const Eo *obj); + +/** + * @brief Ascent property + * + * @param[in] obj The object. + * + * @return Evas coordinate + * + * @ingroup Evas_Text + */ +EOAPI int evas_obj_text_ascent_get(const Eo *obj); + +/** + * @brief Horizontal advance property + * + * @param[in] obj The object. + * + * @return Evas coordinate + * + * @ingroup Evas_Text + */ +EOAPI int evas_obj_text_horiz_advance_get(const Eo *obj); + +/** + * @brief Inset property + * + * @param[in] obj The object. + * + * @return Evas coordinate + * + * @ingroup Evas_Text + */ +EOAPI int evas_obj_text_inset_get(const Eo *obj); + +/** + * @brief Maximal ascent property + * + * @param[in] obj The object. + * + * @return Evas coordinate + * + * @ingroup Evas_Text + */ +EOAPI int evas_obj_text_max_ascent_get(const Eo *obj); + +/** + * @brief Vertical advance property + * + * @param[in] obj The object. + * + * @return Evas coordinate + * + * @ingroup Evas_Text + */ +EOAPI int evas_obj_text_vert_advance_get(const Eo *obj); + +/** + * @brief descent property + * + * @param[in] obj The object. + * + * @return Evas coordinate + * + * @ingroup Evas_Text + */ +EOAPI int evas_obj_text_descent_get(const Eo *obj); + +/** + * @brief Returns the logical position of the last char in the text up to the + * pos given. + * + * This is NOT the position of the last char because of the possibility of RTL + * in the text. + * + * @param[in] obj The object. + * @param[in] x X coordinate + * @param[in] y Y coordinate + * + * @return Logical position of the last char + * + * @ingroup Evas_Text + */ +EOAPI int evas_obj_text_last_up_to_pos(const Eo *obj, int x, int y); + +/** + * @brief Get character coordinates + * + * @param[in] obj The object. + * @param[in] x X coordinate + * @param[in] y Y coordinate + * @param[out] cx X coordinate + * @param[out] cy Y coordinate + * @param[out] cw Width + * @param[out] ch Height + * + * @return Logical position of char + * + * @ingroup Evas_Text + */ +EOAPI int evas_obj_text_char_coords_get(const Eo *obj, int x, int y, int *cx, int *cy, int *cw, int *ch); + +/** + * @brief Retrieve position and dimension information of a character within a + * text @ref Efl_Canvas_Object + * + * This function is used to obtain the X, Y, width and height of the character + * located at @c pos within the @ref Efl_Canvas_Object @c obj. @c obj must be a + * text object Any of the @c Evas_Coord parameters ($cx, @c cy, @c cw, @c ch) + * may be @c NULL in which case no value will be assigned to that parameter. + * + * @param[in] obj The object. + * @param[in] pos The character position to request co-ordinates for. + * @param[out] cx A pointer to an int to store the X value in (can be NULL). + * @param[out] cy A pointer to an int to store the Y value in (can be NULL). + * @param[out] cw A pointer to an int to store the Width value in (can be + * NULL). + * @param[out] ch A pointer to an int to store the Height value in (can be + * NULL). + * + * @return @c false on success, @c true otherwise + * + * @ingroup Evas_Text + */ +EOAPI Eina_Bool evas_obj_text_char_pos_get(const Eo *obj, int pos, int *cx, int *cy, int *cw, int *ch); + +#endif diff --git a/src/lib/evas/canvas/evas_text_eo.hh b/src/lib/evas/canvas/evas_text_eo.hh new file mode 100644 index 0000000000..8d04c94fbe --- /dev/null +++ b/src/lib/evas/canvas/evas_text_eo.hh @@ -0,0 +1,437 @@ +#ifndef EVAS_TEXT_EO_HH +#define EVAS_TEXT_EO_HH +#include + +extern "C" { +#include "efl_canvas_filter_internal.eo.h" +#include "efl_canvas_object.eo.h" +#include "efl_canvas_pointer.eo.h" +#include "efl_class.eo.h" +#include "efl_gfx_color.eo.h" +#include "efl_gfx_entity.eo.h" +#include "efl_gfx_filter.eo.h" +#include "efl_gfx_hint.eo.h" +#include "efl_gfx_mapping.eo.h" +#include "efl_gfx_stack.eo.h" +#include "efl_input_device.eo.h" +#include "efl_input_focus.eo.h" +#include "efl_input_hold.eo.h" +#include "efl_input_interface.eo.h" +#include "efl_input_key.eo.h" +#include "efl_input_pointer.eo.h" +#include "efl_loop.eo.h" +#include "efl_loop_consumer.eo.h" +#include "efl_object.eo.h" +#include "efl_text.eo.h" +#include "efl_text_font.eo.h" +#include "efl_ui_i18n.eo.h" +#include "evas_text_eo.h" +} +#include +#include +#include "efl_canvas_filter_internal.eo.hh" +#include "efl_canvas_object.eo.hh" +#include "efl_canvas_pointer.eo.hh" +#include "efl_class.eo.hh" +#include "efl_gfx_color.eo.hh" +#include "efl_gfx_entity.eo.hh" +#include "efl_gfx_filter.eo.hh" +#include "efl_gfx_hint.eo.hh" +#include "efl_gfx_mapping.eo.hh" +#include "efl_gfx_stack.eo.hh" +#include "efl_input_device.eo.hh" +#include "efl_input_focus.eo.hh" +#include "efl_input_hold.eo.hh" +#include "efl_input_interface.eo.hh" +#include "efl_input_key.eo.hh" +#include "efl_input_pointer.eo.hh" +#include "efl_loop.eo.hh" +#include "efl_loop_consumer.eo.hh" +#include "efl_object.eo.hh" +#include "efl_text.eo.hh" +#include "efl_text_font.eo.hh" +#include "efl_ui_i18n.eo.hh" +#ifndef EVAS_TEXT_FWD_GUARD +#define EVAS_TEXT_FWD_GUARD +namespace evas { +struct Text; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Text> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Text&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Text const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Text const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CLASS_FWD_GUARD +#define EFL_CLASS_FWD_GUARD +namespace efl { +struct Class; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_FILTER_INTERNAL_FWD_GUARD +#define EFL_CANVAS_FILTER_INTERNAL_FWD_GUARD +namespace efl { namespace canvas { namespace filter { +struct Internal; +} } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::filter::Internal> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::filter::Internal&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::filter::Internal const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::filter::Internal const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_COLOR_FWD_GUARD +#define EFL_GFX_COLOR_FWD_GUARD +namespace efl { namespace gfx { +struct Color; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_DEVICE_FWD_GUARD +#define EFL_INPUT_DEVICE_FWD_GUARD +namespace efl { namespace input { +struct Device; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_ENTITY_FWD_GUARD +#define EFL_GFX_ENTITY_FWD_GUARD +namespace efl { namespace gfx { +struct Entity; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_FILTER_FWD_GUARD +#define EFL_GFX_FILTER_FWD_GUARD +namespace efl { namespace gfx { +struct Filter; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Filter> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Filter&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Filter const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Filter const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_HINT_FWD_GUARD +#define EFL_GFX_HINT_FWD_GUARD +namespace efl { namespace gfx { +struct Hint; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_FOCUS_FWD_GUARD +#define EFL_INPUT_FOCUS_FWD_GUARD +namespace efl { namespace input { +struct Focus; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_HOLD_FWD_GUARD +#define EFL_INPUT_HOLD_FWD_GUARD +namespace efl { namespace input { +struct Hold; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_UI_I18N_FWD_GUARD +#define EFL_UI_I18N_FWD_GUARD +namespace efl { namespace ui { +struct I18n; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_INTERFACE_FWD_GUARD +#define EFL_INPUT_INTERFACE_FWD_GUARD +namespace efl { namespace input { +struct Interface; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_KEY_FWD_GUARD +#define EFL_INPUT_KEY_FWD_GUARD +namespace efl { namespace input { +struct Key; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_LOOP_FWD_GUARD +#define EFL_LOOP_FWD_GUARD +namespace efl { +struct Loop; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_LOOP_CONSUMER_FWD_GUARD +#define EFL_LOOP_CONSUMER_FWD_GUARD +namespace efl { +struct Loop_Consumer; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_MAPPING_FWD_GUARD +#define EFL_GFX_MAPPING_FWD_GUARD +namespace efl { namespace gfx { +struct Mapping; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_OBJECT_FWD_GUARD +#define EFL_OBJECT_FWD_GUARD +namespace efl { +struct Object; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_TEXT_FWD_GUARD +#define EFL_TEXT_FWD_GUARD +namespace efl { +struct Text; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Text> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Text&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Text const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Text const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_TEXT_FONT_FWD_GUARD +#define EFL_TEXT_FONT_FWD_GUARD +namespace efl { +struct Text_Font; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Text_Font> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Text_Font&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Text_Font const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Text_Font const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_OBJECT_FWD_GUARD +#define EFL_CANVAS_OBJECT_FWD_GUARD +namespace efl { namespace canvas { +struct Object; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_POINTER_FWD_GUARD +#define EFL_CANVAS_POINTER_FWD_GUARD +namespace efl { namespace canvas { +struct Pointer; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_POINTER_FWD_GUARD +#define EFL_INPUT_POINTER_FWD_GUARD +namespace efl { namespace input { +struct Pointer; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_STACK_FWD_GUARD +#define EFL_GFX_STACK_FWD_GUARD +namespace efl { namespace gfx { +struct Stack; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack const&> : ::std::true_type {}; } } +#endif + +namespace eo_cxx { +namespace evas { +struct Text { + ::efl::eolian::return_traits::type shadow_color_get( ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const; + ::efl::eolian::return_traits::type shadow_color_set( ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const; + ::efl::eolian::return_traits::type ellipsis_get() const; + ::efl::eolian::return_traits::type ellipsis_set( ::efl::eolian::in_traits::type ellipsis) const; + ::efl::eolian::return_traits< ::efl::eina::string_view>::type bidi_delimiters_get() const; + ::efl::eolian::return_traits::type bidi_delimiters_set( ::efl::eolian::in_traits< ::efl::eina::string_view>::type delim) const; + ::efl::eolian::return_traits::type outline_color_get( ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const; + ::efl::eolian::return_traits::type outline_color_set( ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const; + ::efl::eolian::return_traits::type glow2_color_get( ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const; + ::efl::eolian::return_traits::type glow2_color_set( ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const; + ::efl::eolian::return_traits::type style_get() const; + ::efl::eolian::return_traits::type style_set( ::efl::eolian::in_traits::type style) const; + ::efl::eolian::return_traits::type glow_color_get( ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const; + ::efl::eolian::return_traits::type glow_color_set( ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const; + ::efl::eolian::return_traits::type max_descent_get() const; + ::efl::eolian::return_traits::type style_pad_get( ::efl::eolian::out_traits::type l, ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type t, ::efl::eolian::out_traits::type b) const; + ::efl::eolian::return_traits::type direction_get() const; + ::efl::eolian::return_traits::type ascent_get() const; + ::efl::eolian::return_traits::type horiz_advance_get() const; + ::efl::eolian::return_traits::type inset_get() const; + ::efl::eolian::return_traits::type max_ascent_get() const; + ::efl::eolian::return_traits::type vert_advance_get() const; + ::efl::eolian::return_traits::type descent_get() const; + ::efl::eolian::return_traits::type last_up_to_pos( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y) const; + ::efl::eolian::return_traits::type char_coords_get( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::out_traits::type cx, ::efl::eolian::out_traits::type cy, ::efl::eolian::out_traits::type cw, ::efl::eolian::out_traits::type ch) const; + ::efl::eolian::return_traits::type char_pos_get( ::efl::eolian::in_traits::type pos, ::efl::eolian::out_traits::type cx, ::efl::eolian::out_traits::type cy, ::efl::eolian::out_traits::type cw, ::efl::eolian::out_traits::type ch) const; + static Efl_Class const* _eo_class() + { + return EVAS_TEXT_CLASS; + } + Eo* _eo_ptr() const { return *(reinterpret_cast(const_cast(this))); } + operator ::evas::Text() const; + operator ::evas::Text&(); + operator ::evas::Text const&() const; + /// @cond LOCAL + ::efl::eolian::address_of_operator operator&() { return {this}; } + ::efl::eolian::address_of_operator operator&() const { return {this}; } + /// @endcond +}; +} +} +namespace evas { +struct Text : private ::efl::eo::concrete + , EO_CXX_INHERIT(::efl::Loop_Consumer) + , EO_CXX_INHERIT(::efl::Object) + , EO_CXX_INHERIT(::efl::Text) + , EO_CXX_INHERIT(::efl::Text_Font) + , EO_CXX_INHERIT(::efl::canvas::Object) + , EO_CXX_INHERIT(::efl::canvas::Pointer) + , EO_CXX_INHERIT(::efl::canvas::filter::Internal) + , EO_CXX_INHERIT(::efl::gfx::Color) + , EO_CXX_INHERIT(::efl::gfx::Entity) + , EO_CXX_INHERIT(::efl::gfx::Filter) + , EO_CXX_INHERIT(::efl::gfx::Hint) + , EO_CXX_INHERIT(::efl::gfx::Mapping) + , EO_CXX_INHERIT(::efl::gfx::Stack) + , EO_CXX_INHERIT(::efl::input::Interface) + , EO_CXX_INHERIT(::efl::ui::I18n) +{ + explicit Text( ::Eo* eo) + : ::efl::eo::concrete(eo) {} + Text(std::nullptr_t) + : ::efl::eo::concrete(nullptr) {} + explicit Text() = default; + Text(Text const&) = default; + Text(Text&&) = default; + Text& operator=(Text const&) = default; + Text& operator=(Text&&) = default; + template + Text(Derived&& derived + , typename std::enable_if< + ::efl::eo::is_eolian_object::value + && std::is_base_of< Text, Derived>::value>::type* = 0) + : ::efl::eo::concrete(derived._eo_ptr()) {} + + Text( ::efl::eo::instantiate_t) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, ::efl::eo::concrete{nullptr}, _eo_class()); + } + template + explicit Text( ::efl::eo::instantiate_t, T&& parent, typename std::enable_if< ::efl::eo::is_eolian_object::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, parent, _eo_class()); + } + template Text( ::efl::eo::instantiate_t, F&& f, typename ::std::enable_if< ::efl::eolian::is_constructor_lambda::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, ::efl::eo::concrete{nullptr}, _eo_class(), *this, std::forward(f)); + } + template Text( ::efl::eo::instantiate_t, T&& parent, F&& f, typename ::std::enable_if< ::efl::eolian::is_constructor_lambda::value && ::efl::eo::is_eolian_object::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, parent, _eo_class(), *this, std::forward(f)); + } + + ::efl::eolian::return_traits::type shadow_color_get( ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const; + ::efl::eolian::return_traits::type shadow_color_set( ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const; + ::efl::eolian::return_traits::type ellipsis_get() const; + ::efl::eolian::return_traits::type ellipsis_set( ::efl::eolian::in_traits::type ellipsis) const; + ::efl::eolian::return_traits< ::efl::eina::string_view>::type bidi_delimiters_get() const; + ::efl::eolian::return_traits::type bidi_delimiters_set( ::efl::eolian::in_traits< ::efl::eina::string_view>::type delim) const; + ::efl::eolian::return_traits::type outline_color_get( ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const; + ::efl::eolian::return_traits::type outline_color_set( ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const; + ::efl::eolian::return_traits::type glow2_color_get( ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const; + ::efl::eolian::return_traits::type glow2_color_set( ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const; + ::efl::eolian::return_traits::type style_get() const; + ::efl::eolian::return_traits::type style_set( ::efl::eolian::in_traits::type style) const; + ::efl::eolian::return_traits::type glow_color_get( ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const; + ::efl::eolian::return_traits::type glow_color_set( ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const; + ::efl::eolian::return_traits::type max_descent_get() const; + ::efl::eolian::return_traits::type style_pad_get( ::efl::eolian::out_traits::type l, ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type t, ::efl::eolian::out_traits::type b) const; + ::efl::eolian::return_traits::type direction_get() const; + ::efl::eolian::return_traits::type ascent_get() const; + ::efl::eolian::return_traits::type horiz_advance_get() const; + ::efl::eolian::return_traits::type inset_get() const; + ::efl::eolian::return_traits::type max_ascent_get() const; + ::efl::eolian::return_traits::type vert_advance_get() const; + ::efl::eolian::return_traits::type descent_get() const; + ::efl::eolian::return_traits::type last_up_to_pos( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y) const; + ::efl::eolian::return_traits::type char_coords_get( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::out_traits::type cx, ::efl::eolian::out_traits::type cy, ::efl::eolian::out_traits::type cw, ::efl::eolian::out_traits::type ch) const; + ::efl::eolian::return_traits::type char_pos_get( ::efl::eolian::in_traits::type pos, ::efl::eolian::out_traits::type cx, ::efl::eolian::out_traits::type cy, ::efl::eolian::out_traits::type cw, ::efl::eolian::out_traits::type ch) const; + static Efl_Class const* _eo_class() + { + return EVAS_TEXT_CLASS; + } + Eo* _eo_ptr() const { return *(reinterpret_cast(const_cast(this))); } + /// @cond LOCAL + ::efl::eolian::address_of_operator operator&() { return {this}; } + ::efl::eolian::address_of_operator operator&() const { return {this}; } + /// @endcond + ::efl::eo::wref _get_wref() const { return ::efl::eo::wref(*this); } + ::efl::eo::concrete const& _get_concrete() const { return *this; } + ::efl::eo::concrete& _get_concrete() { return *this; } + using ::efl::eo::concrete::_eo_ptr; + using ::efl::eo::concrete::_release; + using ::efl::eo::concrete::_reset; + using ::efl::eo::concrete::_delete; + using ::efl::eo::concrete::operator bool; +#ifdef EFL_CXXPERIMENTAL + const Text* operator->() const { return this; } + Text* operator->() { return this; } + operator Eo*() const { return _eo_ptr(); } +#endif + friend bool operator==(Text const& lhs, Text const& rhs) + { return lhs._get_concrete() == rhs._get_concrete(); } + friend bool operator!=(Text const& lhs, Text const& rhs) + { return !(lhs == rhs); } +}; +static_assert(sizeof(Text) == sizeof(Eo*), ""); +static_assert(std::is_standard_layout::value, ""); +} +#endif diff --git a/src/lib/evas/canvas/evas_text_eo.impl.hh b/src/lib/evas/canvas/evas_text_eo.impl.hh new file mode 100644 index 0000000000..9c975a1d09 --- /dev/null +++ b/src/lib/evas/canvas/evas_text_eo.impl.hh @@ -0,0 +1,466 @@ +#ifndef EVAS_TEXT_IMPL_HH +#define EVAS_TEXT_IMPL_HH + +#include "evas_text_eo.hh" + +namespace evas { +inline ::efl::eolian::return_traits::type Text::shadow_color_get( ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const +{ + int __out_param_r = {}; + int __out_param_g = {}; + int __out_param_b = {}; + int __out_param_a = {}; + ::evas_obj_text_shadow_color_get(_eo_ptr(), + & __out_param_r, + & __out_param_g, + & __out_param_b, + & __out_param_a); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(r, __out_param_r); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(g, __out_param_g); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(b, __out_param_b); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(a, __out_param_a); +} +inline ::efl::eolian::return_traits::type Text::shadow_color_set( ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const +{ + ::evas_obj_text_shadow_color_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(r), + ::efl::eolian::convert_to_c::type>(g), + ::efl::eolian::convert_to_c::type>(b), + ::efl::eolian::convert_to_c::type>(a)); +} +inline ::efl::eolian::return_traits::type Text::ellipsis_get() const +{ + double __return_value = ::evas_obj_text_ellipsis_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::ellipsis_set( ::efl::eolian::in_traits::type ellipsis) const +{ + ::evas_obj_text_ellipsis_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(ellipsis)); +} +inline ::efl::eolian::return_traits< ::efl::eina::string_view>::type Text::bidi_delimiters_get() const +{ + const char * __return_value = ::evas_obj_text_bidi_delimiters_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::string_view>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::bidi_delimiters_set( ::efl::eolian::in_traits< ::efl::eina::string_view>::type delim) const +{ + ::evas_obj_text_bidi_delimiters_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(delim)); +} +inline ::efl::eolian::return_traits::type Text::outline_color_get( ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const +{ + int __out_param_r = {}; + int __out_param_g = {}; + int __out_param_b = {}; + int __out_param_a = {}; + ::evas_obj_text_outline_color_get(_eo_ptr(), + & __out_param_r, + & __out_param_g, + & __out_param_b, + & __out_param_a); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(r, __out_param_r); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(g, __out_param_g); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(b, __out_param_b); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(a, __out_param_a); +} +inline ::efl::eolian::return_traits::type Text::outline_color_set( ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const +{ + ::evas_obj_text_outline_color_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(r), + ::efl::eolian::convert_to_c::type>(g), + ::efl::eolian::convert_to_c::type>(b), + ::efl::eolian::convert_to_c::type>(a)); +} +inline ::efl::eolian::return_traits::type Text::glow2_color_get( ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const +{ + int __out_param_r = {}; + int __out_param_g = {}; + int __out_param_b = {}; + int __out_param_a = {}; + ::evas_obj_text_glow2_color_get(_eo_ptr(), + & __out_param_r, + & __out_param_g, + & __out_param_b, + & __out_param_a); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(r, __out_param_r); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(g, __out_param_g); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(b, __out_param_b); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(a, __out_param_a); +} +inline ::efl::eolian::return_traits::type Text::glow2_color_set( ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const +{ + ::evas_obj_text_glow2_color_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(r), + ::efl::eolian::convert_to_c::type>(g), + ::efl::eolian::convert_to_c::type>(b), + ::efl::eolian::convert_to_c::type>(a)); +} +inline ::efl::eolian::return_traits::type Text::style_get() const +{ + Evas_Text_Style_Type __return_value = ::evas_obj_text_style_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::style_set( ::efl::eolian::in_traits::type style) const +{ + ::evas_obj_text_style_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(style)); +} +inline ::efl::eolian::return_traits::type Text::glow_color_get( ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const +{ + int __out_param_r = {}; + int __out_param_g = {}; + int __out_param_b = {}; + int __out_param_a = {}; + ::evas_obj_text_glow_color_get(_eo_ptr(), + & __out_param_r, + & __out_param_g, + & __out_param_b, + & __out_param_a); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(r, __out_param_r); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(g, __out_param_g); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(b, __out_param_b); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(a, __out_param_a); +} +inline ::efl::eolian::return_traits::type Text::glow_color_set( ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const +{ + ::evas_obj_text_glow_color_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(r), + ::efl::eolian::convert_to_c::type>(g), + ::efl::eolian::convert_to_c::type>(b), + ::efl::eolian::convert_to_c::type>(a)); +} +inline ::efl::eolian::return_traits::type Text::max_descent_get() const +{ + int __return_value = ::evas_obj_text_max_descent_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::style_pad_get( ::efl::eolian::out_traits::type l, ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type t, ::efl::eolian::out_traits::type b) const +{ + int __out_param_l = {}; + int __out_param_r = {}; + int __out_param_t = {}; + int __out_param_b = {}; + ::evas_obj_text_style_pad_get(_eo_ptr(), + & __out_param_l, + & __out_param_r, + & __out_param_t, + & __out_param_b); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(l, __out_param_l); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(r, __out_param_r); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(t, __out_param_t); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(b, __out_param_b); +} +inline ::efl::eolian::return_traits::type Text::direction_get() const +{ + Efl_Text_Bidirectional_Type __return_value = ::evas_obj_text_direction_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::ascent_get() const +{ + int __return_value = ::evas_obj_text_ascent_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::horiz_advance_get() const +{ + int __return_value = ::evas_obj_text_horiz_advance_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::inset_get() const +{ + int __return_value = ::evas_obj_text_inset_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::max_ascent_get() const +{ + int __return_value = ::evas_obj_text_max_ascent_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::vert_advance_get() const +{ + int __return_value = ::evas_obj_text_vert_advance_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::descent_get() const +{ + int __return_value = ::evas_obj_text_descent_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::last_up_to_pos( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y) const +{ + int __return_value = ::evas_obj_text_last_up_to_pos(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(x), + ::efl::eolian::convert_to_c::type>(y)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::char_coords_get( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::out_traits::type cx, ::efl::eolian::out_traits::type cy, ::efl::eolian::out_traits::type cw, ::efl::eolian::out_traits::type ch) const +{ + int __out_param_cx = {}; + int __out_param_cy = {}; + int __out_param_cw = {}; + int __out_param_ch = {}; + int __return_value = ::evas_obj_text_char_coords_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(x), + ::efl::eolian::convert_to_c::type>(y), + & __out_param_cx, + & __out_param_cy, + & __out_param_cw, + & __out_param_ch); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(cx, __out_param_cx); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(cy, __out_param_cy); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(cw, __out_param_cw); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(ch, __out_param_ch); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::char_pos_get( ::efl::eolian::in_traits::type pos, ::efl::eolian::out_traits::type cx, ::efl::eolian::out_traits::type cy, ::efl::eolian::out_traits::type cw, ::efl::eolian::out_traits::type ch) const +{ + int __out_param_cx = {}; + int __out_param_cy = {}; + int __out_param_cw = {}; + int __out_param_ch = {}; + Eina_Bool __return_value = ::evas_obj_text_char_pos_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(pos), + & __out_param_cx, + & __out_param_cy, + & __out_param_cw, + & __out_param_ch); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(cx, __out_param_cx); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(cy, __out_param_cy); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(cw, __out_param_cw); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(ch, __out_param_ch); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +} +namespace eo_cxx { +namespace evas { +inline ::efl::eolian::return_traits::type Text::shadow_color_get( ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const +{ + int __out_param_r = {}; + int __out_param_g = {}; + int __out_param_b = {}; + int __out_param_a = {}; + ::evas_obj_text_shadow_color_get(_eo_ptr(), + & __out_param_r, + & __out_param_g, + & __out_param_b, + & __out_param_a); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(r, __out_param_r); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(g, __out_param_g); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(b, __out_param_b); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(a, __out_param_a); +} +inline ::efl::eolian::return_traits::type Text::shadow_color_set( ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const +{ + ::evas_obj_text_shadow_color_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(r), + ::efl::eolian::convert_to_c::type>(g), + ::efl::eolian::convert_to_c::type>(b), + ::efl::eolian::convert_to_c::type>(a)); +} +inline ::efl::eolian::return_traits::type Text::ellipsis_get() const +{ + double __return_value = ::evas_obj_text_ellipsis_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::ellipsis_set( ::efl::eolian::in_traits::type ellipsis) const +{ + ::evas_obj_text_ellipsis_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(ellipsis)); +} +inline ::efl::eolian::return_traits< ::efl::eina::string_view>::type Text::bidi_delimiters_get() const +{ + const char * __return_value = ::evas_obj_text_bidi_delimiters_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits< ::efl::eina::string_view>::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::bidi_delimiters_set( ::efl::eolian::in_traits< ::efl::eina::string_view>::type delim) const +{ + ::evas_obj_text_bidi_delimiters_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(delim)); +} +inline ::efl::eolian::return_traits::type Text::outline_color_get( ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const +{ + int __out_param_r = {}; + int __out_param_g = {}; + int __out_param_b = {}; + int __out_param_a = {}; + ::evas_obj_text_outline_color_get(_eo_ptr(), + & __out_param_r, + & __out_param_g, + & __out_param_b, + & __out_param_a); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(r, __out_param_r); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(g, __out_param_g); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(b, __out_param_b); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(a, __out_param_a); +} +inline ::efl::eolian::return_traits::type Text::outline_color_set( ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const +{ + ::evas_obj_text_outline_color_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(r), + ::efl::eolian::convert_to_c::type>(g), + ::efl::eolian::convert_to_c::type>(b), + ::efl::eolian::convert_to_c::type>(a)); +} +inline ::efl::eolian::return_traits::type Text::glow2_color_get( ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const +{ + int __out_param_r = {}; + int __out_param_g = {}; + int __out_param_b = {}; + int __out_param_a = {}; + ::evas_obj_text_glow2_color_get(_eo_ptr(), + & __out_param_r, + & __out_param_g, + & __out_param_b, + & __out_param_a); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(r, __out_param_r); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(g, __out_param_g); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(b, __out_param_b); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(a, __out_param_a); +} +inline ::efl::eolian::return_traits::type Text::glow2_color_set( ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const +{ + ::evas_obj_text_glow2_color_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(r), + ::efl::eolian::convert_to_c::type>(g), + ::efl::eolian::convert_to_c::type>(b), + ::efl::eolian::convert_to_c::type>(a)); +} +inline ::efl::eolian::return_traits::type Text::style_get() const +{ + Evas_Text_Style_Type __return_value = ::evas_obj_text_style_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::style_set( ::efl::eolian::in_traits::type style) const +{ + ::evas_obj_text_style_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(style)); +} +inline ::efl::eolian::return_traits::type Text::glow_color_get( ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const +{ + int __out_param_r = {}; + int __out_param_g = {}; + int __out_param_b = {}; + int __out_param_a = {}; + ::evas_obj_text_glow_color_get(_eo_ptr(), + & __out_param_r, + & __out_param_g, + & __out_param_b, + & __out_param_a); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(r, __out_param_r); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(g, __out_param_g); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(b, __out_param_b); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(a, __out_param_a); +} +inline ::efl::eolian::return_traits::type Text::glow_color_set( ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const +{ + ::evas_obj_text_glow_color_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(r), + ::efl::eolian::convert_to_c::type>(g), + ::efl::eolian::convert_to_c::type>(b), + ::efl::eolian::convert_to_c::type>(a)); +} +inline ::efl::eolian::return_traits::type Text::max_descent_get() const +{ + int __return_value = ::evas_obj_text_max_descent_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::style_pad_get( ::efl::eolian::out_traits::type l, ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type t, ::efl::eolian::out_traits::type b) const +{ + int __out_param_l = {}; + int __out_param_r = {}; + int __out_param_t = {}; + int __out_param_b = {}; + ::evas_obj_text_style_pad_get(_eo_ptr(), + & __out_param_l, + & __out_param_r, + & __out_param_t, + & __out_param_b); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(l, __out_param_l); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(r, __out_param_r); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(t, __out_param_t); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(b, __out_param_b); +} +inline ::efl::eolian::return_traits::type Text::direction_get() const +{ + Efl_Text_Bidirectional_Type __return_value = ::evas_obj_text_direction_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::ascent_get() const +{ + int __return_value = ::evas_obj_text_ascent_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::horiz_advance_get() const +{ + int __return_value = ::evas_obj_text_horiz_advance_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::inset_get() const +{ + int __return_value = ::evas_obj_text_inset_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::max_ascent_get() const +{ + int __return_value = ::evas_obj_text_max_ascent_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::vert_advance_get() const +{ + int __return_value = ::evas_obj_text_vert_advance_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::descent_get() const +{ + int __return_value = ::evas_obj_text_descent_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::last_up_to_pos( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y) const +{ + int __return_value = ::evas_obj_text_last_up_to_pos(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(x), + ::efl::eolian::convert_to_c::type>(y)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::char_coords_get( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::out_traits::type cx, ::efl::eolian::out_traits::type cy, ::efl::eolian::out_traits::type cw, ::efl::eolian::out_traits::type ch) const +{ + int __out_param_cx = {}; + int __out_param_cy = {}; + int __out_param_cw = {}; + int __out_param_ch = {}; + int __return_value = ::evas_obj_text_char_coords_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(x), + ::efl::eolian::convert_to_c::type>(y), + & __out_param_cx, + & __out_param_cy, + & __out_param_cw, + & __out_param_ch); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(cx, __out_param_cx); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(cy, __out_param_cy); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(cw, __out_param_cw); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(ch, __out_param_ch); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Text::char_pos_get( ::efl::eolian::in_traits::type pos, ::efl::eolian::out_traits::type cx, ::efl::eolian::out_traits::type cy, ::efl::eolian::out_traits::type cw, ::efl::eolian::out_traits::type ch) const +{ + int __out_param_cx = {}; + int __out_param_cy = {}; + int __out_param_cw = {}; + int __out_param_ch = {}; + Eina_Bool __return_value = ::evas_obj_text_char_pos_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(pos), + & __out_param_cx, + & __out_param_cy, + & __out_param_cw, + & __out_param_ch); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(cx, __out_param_cx); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(cy, __out_param_cy); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(cw, __out_param_cw); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(ch, __out_param_ch); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline evas::Text::operator ::evas::Text() const { return *static_cast< ::evas::Text const*>(static_cast(this)); } +inline evas::Text::operator ::evas::Text&() { return *static_cast< ::evas::Text*>(static_cast(this)); } +inline evas::Text::operator ::evas::Text const&() const { return *static_cast< ::evas::Text const*>(static_cast(this)); } +} } +#endif diff --git a/src/lib/evas/canvas/evas_text_eo.legacy.c b/src/lib/evas/canvas/evas_text_eo.legacy.c new file mode 100644 index 0000000000..dca5395e10 --- /dev/null +++ b/src/lib/evas/canvas/evas_text_eo.legacy.c @@ -0,0 +1,156 @@ + +EAPI void +evas_object_text_shadow_color_set(Evas_Text *obj, int r, int g, int b, int a) +{ + evas_obj_text_shadow_color_set(obj, r, g, b, a); +} + +EAPI void +evas_object_text_shadow_color_get(const Evas_Text *obj, int *r, int *g, int *b, int *a) +{ + evas_obj_text_shadow_color_get(obj, r, g, b, a); +} + +EAPI void +evas_object_text_ellipsis_set(Evas_Text *obj, double ellipsis) +{ + evas_obj_text_ellipsis_set(obj, ellipsis); +} + +EAPI double +evas_object_text_ellipsis_get(const Evas_Text *obj) +{ + return evas_obj_text_ellipsis_get(obj); +} + +EAPI void +evas_object_text_bidi_delimiters_set(Evas_Text *obj, const char *delim) +{ + evas_obj_text_bidi_delimiters_set(obj, delim); +} + +EAPI const char * +evas_object_text_bidi_delimiters_get(const Evas_Text *obj) +{ + return evas_obj_text_bidi_delimiters_get(obj); +} + +EAPI void +evas_object_text_outline_color_set(Evas_Text *obj, int r, int g, int b, int a) +{ + evas_obj_text_outline_color_set(obj, r, g, b, a); +} + +EAPI void +evas_object_text_outline_color_get(const Evas_Text *obj, int *r, int *g, int *b, int *a) +{ + evas_obj_text_outline_color_get(obj, r, g, b, a); +} + +EAPI void +evas_object_text_glow2_color_set(Evas_Text *obj, int r, int g, int b, int a) +{ + evas_obj_text_glow2_color_set(obj, r, g, b, a); +} + +EAPI void +evas_object_text_glow2_color_get(const Evas_Text *obj, int *r, int *g, int *b, int *a) +{ + evas_obj_text_glow2_color_get(obj, r, g, b, a); +} + +EAPI void +evas_object_text_style_set(Evas_Text *obj, Evas_Text_Style_Type style) +{ + evas_obj_text_style_set(obj, style); +} + +EAPI Evas_Text_Style_Type +evas_object_text_style_get(const Evas_Text *obj) +{ + return evas_obj_text_style_get(obj); +} + +EAPI void +evas_object_text_glow_color_set(Evas_Text *obj, int r, int g, int b, int a) +{ + evas_obj_text_glow_color_set(obj, r, g, b, a); +} + +EAPI void +evas_object_text_glow_color_get(const Evas_Text *obj, int *r, int *g, int *b, int *a) +{ + evas_obj_text_glow_color_get(obj, r, g, b, a); +} + +EAPI int +evas_object_text_max_descent_get(const Evas_Text *obj) +{ + return evas_obj_text_max_descent_get(obj); +} + +EAPI void +evas_object_text_style_pad_get(const Evas_Text *obj, int *l, int *r, int *t, int *b) +{ + evas_obj_text_style_pad_get(obj, l, r, t, b); +} + +EAPI Efl_Text_Bidirectional_Type +evas_object_text_direction_get(const Evas_Text *obj) +{ + return evas_obj_text_direction_get(obj); +} + +EAPI int +evas_object_text_ascent_get(const Evas_Text *obj) +{ + return evas_obj_text_ascent_get(obj); +} + +EAPI int +evas_object_text_horiz_advance_get(const Evas_Text *obj) +{ + return evas_obj_text_horiz_advance_get(obj); +} + +EAPI int +evas_object_text_inset_get(const Evas_Text *obj) +{ + return evas_obj_text_inset_get(obj); +} + +EAPI int +evas_object_text_max_ascent_get(const Evas_Text *obj) +{ + return evas_obj_text_max_ascent_get(obj); +} + +EAPI int +evas_object_text_vert_advance_get(const Evas_Text *obj) +{ + return evas_obj_text_vert_advance_get(obj); +} + +EAPI int +evas_object_text_descent_get(const Evas_Text *obj) +{ + return evas_obj_text_descent_get(obj); +} + +EAPI int +evas_object_text_last_up_to_pos(const Evas_Text *obj, int x, int y) +{ + return evas_obj_text_last_up_to_pos(obj, x, y); +} + +EAPI int +evas_object_text_char_coords_get(const Evas_Text *obj, int x, int y, int *cx, int *cy, int *cw, int *ch) +{ + return evas_obj_text_char_coords_get(obj, x, y, cx, cy, cw, ch); +} + +EAPI Eina_Bool +evas_object_text_char_pos_get(const Evas_Text *obj, int pos, int *cx, int *cy, int *cw, int *ch) +{ + return evas_obj_text_char_pos_get(obj, pos, cx, cy, cw, ch); +} diff --git a/src/lib/evas/canvas/evas_text_eo.legacy.h b/src/lib/evas/canvas/evas_text_eo.legacy.h new file mode 100644 index 0000000000..9d43f65ee0 --- /dev/null +++ b/src/lib/evas/canvas/evas_text_eo.legacy.h @@ -0,0 +1,455 @@ +#ifndef _EVAS_TEXT_EO_LEGACY_H_ +#define _EVAS_TEXT_EO_LEGACY_H_ + +#ifndef _EVAS_TEXT_EO_CLASS_TYPE +#define _EVAS_TEXT_EO_CLASS_TYPE + +typedef Eo Evas_Text; + +#endif + +#ifndef _EVAS_TEXT_EO_TYPES +#define _EVAS_TEXT_EO_TYPES + + +#endif + +/** + * @brief Controls the shadow color for the given text object. + * + * Shadow effects are fading colors decorating the text underneath it. They + * will be shown if the object is set to one of the following styles: + * + * - @c EVAS_TEXT_STYLE_TYPE_SHADOW - @c EVAS_TEXT_STYLE_TYPE_OUTLINE_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_FAR_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_OUTLINE_SOFT_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_SOFT_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_FAR_SOFT_SHADOW + * + * One can also change the direction where the shadow grows to, with + * @ref evas_object_text_style_get + * + * See @ref evas_object_text_shadow_color_get + * + * @param[in] obj The object. + * @param[in] r The red component of the given color. + * @param[in] g The green component of the given color. + * @param[in] b The blue component of the given color. + * @param[in] a The alpha component of the given color. + * + * @ingroup Evas_Object_Text_Group + */ +EAPI void evas_object_text_shadow_color_set(Evas_Text *obj, int r, int g, int b, int a); + +/** + * @brief Controls the shadow color for the given text object. + * + * Shadow effects are fading colors decorating the text underneath it. They + * will be shown if the object is set to one of the following styles: + * + * - @c EVAS_TEXT_STYLE_TYPE_SHADOW - @c EVAS_TEXT_STYLE_TYPE_OUTLINE_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_FAR_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_OUTLINE_SOFT_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_SOFT_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_FAR_SOFT_SHADOW + * + * One can also change the direction where the shadow grows to, with + * @ref evas_object_text_style_get + * + * See @ref evas_object_text_shadow_color_get + * + * @note Use @c NULL pointers on the color components you're not interested in: + * they'll be ignored by the function. + * + * @param[in] obj The object. + * @param[out] r The red component of the given color. + * @param[out] g The green component of the given color. + * @param[out] b The blue component of the given color. + * @param[out] a The alpha component of the given color. + * + * @ingroup Evas_Object_Text_Group + */ +EAPI void evas_object_text_shadow_color_get(const Evas_Text *obj, int *r, int *g, int *b, int *a); + +/** + * @brief Controls the ellipsis that should be used for the text object. + * + * This is a value between 0.0 and 1.0 indicating the position of the text to + * be shown. 0.0 means the start will be shown and the end trimmed, 1.0 means + * the beginning will be trimmed and the end will be shown, and any value in + * between will cause ellipsis to be added in both end of the text and the + * requested part to be shown. -1.0 means ellipsis is turned off. + * + * @param[in] obj The object. + * @param[in] ellipsis The ellipsis. Allowed values: -1.0 or 0.0-1.0 + * + * @since 1.8 + * + * @ingroup Evas_Object_Text_Group + */ +EAPI void evas_object_text_ellipsis_set(Evas_Text *obj, double ellipsis); + +/** + * @brief Controls the ellipsis that should be used for the text object. + * + * This is a value between 0.0 and 1.0 indicating the position of the text to + * be shown. 0.0 means the start will be shown and the end trimmed, 1.0 means + * the beginning will be trimmed and the end will be shown, and any value in + * between will cause ellipsis to be added in both end of the text and the + * requested part to be shown. -1.0 means ellipsis is turned off. + * + * @param[in] obj The object. + * + * @return The ellipsis. Allowed values: -1.0 or 0.0-1.0 + * + * @since 1.8 + * + * @ingroup Evas_Object_Text_Group + */ +EAPI double evas_object_text_ellipsis_get(const Evas_Text *obj); + +/** + * @brief Sets the BiDi delimiters used in the textblock. + * + * BiDi delimiters are use for in-paragraph separation of bidi segments. This + * is useful for example in recipients fields of e-mail clients where bidi + * oddities can occur when mixing RTL and LTR. + * + * @param[in] obj The object. + * @param[in] delim A null terminated string of delimiters, e.g ",|". + * + * @since 1.1 + * + * @ingroup Evas_Object_Text_Group + */ +EAPI void evas_object_text_bidi_delimiters_set(Evas_Text *obj, const char *delim); + +/** + * @brief Sets the BiDi delimiters used in the textblock. + * + * BiDi delimiters are use for in-paragraph separation of bidi segments. This + * is useful for example in recipients fields of e-mail clients where bidi + * oddities can occur when mixing RTL and LTR. + * + * @param[in] obj The object. + * + * @return A null terminated string of delimiters, e.g ",|". + * + * @since 1.1 + * + * @ingroup Evas_Object_Text_Group + */ +EAPI const char *evas_object_text_bidi_delimiters_get(const Evas_Text *obj); + +/** + * @brief Controls the outline color for the given text object. + * + * Outline effects (colored lines around text glyphs) will be shown if the + * object is set to one of the following styles: - + * @c EVAS_TEXT_STYLE_TYPE_OUTLINE - @c EVAS_TEXT_STYLE_TYPE_SOFT_OUTLINE - + * @c EVAS_TEXT_STYLE_TYPE_OUTLINE_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_OUTLINE_SOFT_SHADOW + * + * @param[in] obj The object. + * @param[in] r The red component of the given color. + * @param[in] g The green component of the given color. + * @param[in] b The blue component of the given color. + * @param[in] a The alpha component of the given color. + * + * @ingroup Evas_Object_Text_Group + */ +EAPI void evas_object_text_outline_color_set(Evas_Text *obj, int r, int g, int b, int a); + +/** + * @brief Controls the outline color for the given text object. + * + * Outline effects (colored lines around text glyphs) will be shown if the + * object is set to one of the following styles: - + * @c EVAS_TEXT_STYLE_TYPE_OUTLINE - @c EVAS_TEXT_STYLE_TYPE_SOFT_OUTLINE - + * @c EVAS_TEXT_STYLE_TYPE_OUTLINE_SHADOW - + * @c EVAS_TEXT_STYLE_TYPE_OUTLINE_SOFT_SHADOW + * + * @param[in] obj The object. + * @param[out] r The red component of the given color. + * @param[out] g The green component of the given color. + * @param[out] b The blue component of the given color. + * @param[out] a The alpha component of the given color. + * + * @ingroup Evas_Object_Text_Group + */ +EAPI void evas_object_text_outline_color_get(const Evas_Text *obj, int *r, int *g, int *b, int *a); + +/** + * @brief Sets the 'glow 2' color for the given text object. + * + * 'Glow 2' effects are glowing colors decorating the text's (immediate) + * surroundings. They will be shown if the object is set to the + * @c EVAS_TEXT_STYLE_TYPE_GLOW style. See also + * @ref evas_object_text_glow_color_get. + * + * @param[in] obj The object. + * @param[in] r The red component of the given color. + * @param[in] g The green component of the given color. + * @param[in] b The blue component of the given color. + * @param[in] a The alpha component of the given color. + * + * @ingroup Evas_Object_Text_Group + */ +EAPI void evas_object_text_glow2_color_set(Evas_Text *obj, int r, int g, int b, int a); + +/** + * @brief Sets the 'glow 2' color for the given text object. + * + * 'Glow 2' effects are glowing colors decorating the text's (immediate) + * surroundings. They will be shown if the object is set to the + * @c EVAS_TEXT_STYLE_TYPE_GLOW style. See also + * @ref evas_object_text_glow_color_get. + * + * @param[in] obj The object. + * @param[out] r The red component of the given color. + * @param[out] g The green component of the given color. + * @param[out] b The blue component of the given color. + * @param[out] a The alpha component of the given color. + * + * @ingroup Evas_Object_Text_Group + */ +EAPI void evas_object_text_glow2_color_get(const Evas_Text *obj, int *r, int *g, int *b, int *a); + +/** + * @brief Controls the style to apply on the given text object. + * + * Text object styles are one of the values in @ref Evas_Text_Style_Type Some + * of those values are combinations of more than one style, and some account + * for the direction of the rendering of shadow effects. + * + * @note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and + * #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value. + * + * @param[in] obj The object. + * @param[in] style Style type + * + * @ingroup Evas_Object_Text_Group + */ +EAPI void evas_object_text_style_set(Evas_Text *obj, Evas_Text_Style_Type style); + +/** + * @brief Controls the style to apply on the given text object. + * + * Text object styles are one of the values in @ref Evas_Text_Style_Type Some + * of those values are combinations of more than one style, and some account + * for the direction of the rendering of shadow effects. + * + * @note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and + * #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value. + * + * @param[in] obj The object. + * + * @return Style type + * + * @ingroup Evas_Object_Text_Group + */ +EAPI Evas_Text_Style_Type evas_object_text_style_get(const Evas_Text *obj); + +/** + * @brief Sets the glow color for the given text object. + * + * Glow effects are glowing colors decorating the text's surroundings. They + * will be shown if the object is set to the @c EVAS_TEXT_STYLE_TYPE_GLOW + * style. + * + * @note Glow effects are placed from a short distance of the text itself, but + * not touching it. For glowing effects right on the borders of the glyphs, see + * 'glow 2' effects. + * + * @param[in] obj The object. + * @param[in] r The red component of the given color. + * @param[in] g The green component of the given color. + * @param[in] b The blue component of the given color. + * @param[in] a The alpha component of the given color. + * + * @ingroup Evas_Object_Text_Group + */ +EAPI void evas_object_text_glow_color_set(Evas_Text *obj, int r, int g, int b, int a); + +/** + * @brief Sets the glow color for the given text object. + * + * Glow effects are glowing colors decorating the text's surroundings. They + * will be shown if the object is set to the @c EVAS_TEXT_STYLE_TYPE_GLOW + * style. + * + * @note Glow effects are placed from a short distance of the text itself, but + * not touching it. For glowing effects right on the borders of the glyphs, see + * 'glow 2' effects. + * + * @param[in] obj The object. + * @param[out] r The red component of the given color. + * @param[out] g The green component of the given color. + * @param[out] b The blue component of the given color. + * @param[out] a The alpha component of the given color. + * + * @ingroup Evas_Object_Text_Group + */ +EAPI void evas_object_text_glow_color_get(const Evas_Text *obj, int *r, int *g, int *b, int *a); + +/** + * @brief Maximal descent property + * + * @param[in] obj The object. + * + * @return Evas coordinate + * + * @ingroup Evas_Object_Text_Group + */ +EAPI int evas_object_text_max_descent_get(const Evas_Text *obj); + +/** + * @brief Gets the text style pad of a text object. + * + * @param[in] obj The object. + * @param[out] l The left pad (or @c NULL). + * @param[out] r The right pad (or @c NULL). + * @param[out] t The top pad (or @c NULL). + * @param[out] b The bottom pad (or @c NULL). + * + * @ingroup Evas_Object_Text_Group + */ +EAPI void evas_object_text_style_pad_get(const Evas_Text *obj, int *l, int *r, int *t, int *b); + +/** + * @brief Retrieves the direction of the text currently being displayed in the + * text object. + * + * @param[in] obj The object. + * + * @return Bidirectional type + * + * @ingroup Evas_Object_Text_Group + */ +EAPI Efl_Text_Bidirectional_Type evas_object_text_direction_get(const Evas_Text *obj); + +/** + * @brief Ascent property + * + * @param[in] obj The object. + * + * @return Evas coordinate + * + * @ingroup Evas_Object_Text_Group + */ +EAPI int evas_object_text_ascent_get(const Evas_Text *obj); + +/** + * @brief Horizontal advance property + * + * @param[in] obj The object. + * + * @return Evas coordinate + * + * @ingroup Evas_Object_Text_Group + */ +EAPI int evas_object_text_horiz_advance_get(const Evas_Text *obj); + +/** + * @brief Inset property + * + * @param[in] obj The object. + * + * @return Evas coordinate + * + * @ingroup Evas_Object_Text_Group + */ +EAPI int evas_object_text_inset_get(const Evas_Text *obj); + +/** + * @brief Maximal ascent property + * + * @param[in] obj The object. + * + * @return Evas coordinate + * + * @ingroup Evas_Object_Text_Group + */ +EAPI int evas_object_text_max_ascent_get(const Evas_Text *obj); + +/** + * @brief Vertical advance property + * + * @param[in] obj The object. + * + * @return Evas coordinate + * + * @ingroup Evas_Object_Text_Group + */ +EAPI int evas_object_text_vert_advance_get(const Evas_Text *obj); + +/** + * @brief descent property + * + * @param[in] obj The object. + * + * @return Evas coordinate + * + * @ingroup Evas_Object_Text_Group + */ +EAPI int evas_object_text_descent_get(const Evas_Text *obj); + +/** + * @brief Returns the logical position of the last char in the text up to the + * pos given. + * + * This is NOT the position of the last char because of the possibility of RTL + * in the text. + * + * @param[in] obj The object. + * @param[in] x X coordinate + * @param[in] y Y coordinate + * + * @return Logical position of the last char + * + * @ingroup Evas_Object_Text_Group + */ +EAPI int evas_object_text_last_up_to_pos(const Evas_Text *obj, int x, int y); + +/** + * @brief Get character coordinates + * + * @param[in] obj The object. + * @param[in] x X coordinate + * @param[in] y Y coordinate + * @param[out] cx X coordinate + * @param[out] cy Y coordinate + * @param[out] cw Width + * @param[out] ch Height + * + * @return Logical position of char + * + * @ingroup Evas_Object_Text_Group + */ +EAPI int evas_object_text_char_coords_get(const Evas_Text *obj, int x, int y, int *cx, int *cy, int *cw, int *ch); + +/** + * @brief Retrieve position and dimension information of a character within a + * text @ref Efl_Canvas_Object + * + * This function is used to obtain the X, Y, width and height of the character + * located at @c pos within the @ref Efl_Canvas_Object @c obj. @c obj must be a + * text object Any of the @c Evas_Coord parameters ($cx, @c cy, @c cw, @c ch) + * may be @c NULL in which case no value will be assigned to that parameter. + * + * @param[in] obj The object. + * @param[in] pos The character position to request co-ordinates for. + * @param[out] cx A pointer to an int to store the X value in (can be NULL). + * @param[out] cy A pointer to an int to store the Y value in (can be NULL). + * @param[out] cw A pointer to an int to store the Width value in (can be + * NULL). + * @param[out] ch A pointer to an int to store the Height value in (can be + * NULL). + * + * @return @c false on success, @c true otherwise + * + * @ingroup Evas_Object_Text_Group + */ +EAPI Eina_Bool evas_object_text_char_pos_get(const Evas_Text *obj, int pos, int *cx, int *cy, int *cw, int *ch); + +#endif diff --git a/src/lib/evas/canvas/evas_textblock_legacy.h b/src/lib/evas/canvas/evas_textblock_legacy.h index 2c8ee05f57..ae537680c0 100644 --- a/src/lib/evas/canvas/evas_textblock_legacy.h +++ b/src/lib/evas/canvas/evas_textblock_legacy.h @@ -343,7 +343,7 @@ EAPI int evas_textblock_cursor_pos_get(cons * Go to the start of the line passed * * @param cur cursor to update. - * @param line numer to set. + * @param line number to set. * @return @c EINA_TRUE on success, @c EINA_FALSE on error. */ EAPI Eina_Bool evas_textblock_cursor_line_set(Evas_Textblock_Cursor *cur, int line) EINA_ARG_NONNULL(1); @@ -1056,7 +1056,7 @@ EAPI void evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur); * @ingroup Evas_Textblock */ EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_get(const Evas_Object *obj); -#include "canvas/efl_canvas_text.eo.legacy.h" +#include "canvas/efl_canvas_text_eo.legacy.h" /** * @} */ diff --git a/src/lib/evas/canvas/evas_textgrid.eo b/src/lib/evas/canvas/evas_textgrid.eo deleted file mode 100644 index 5d4ea33ede..0000000000 --- a/src/lib/evas/canvas/evas_textgrid.eo +++ /dev/null @@ -1,208 +0,0 @@ -enum Evas.Textgrid.Palette { - [[The palette to use for the foreground and background colors. - - @since 1.7]] - none, [[No palette is used]] - standard, [[Standard palette (around 16 colors)]] - extended, [[Extended palette (at max 256 colors)]] - last [[Sentinel value to indicate last enum field during iteration]] -} - -enum Evas.Textgrid.Font_Style { - [[The style to give to each character of the grid. - - @since 1.7]] - normal = (1 << 0), [[Normal style]] - bold = (1 << 1), [[Bold style]] - italic = (1 << 2) [[Oblique style]] -} - -/* XXX: Actual definition is in C. */ -struct Evas.Textgrid.Cell; [[Evas textgrid cell data structure]] - -class Evas.Textgrid extends Efl.Canvas.Object implements Efl.Text_Font -{ - [[Evas textgrid class]] - legacy_prefix: evas_object_textgrid; - eo_prefix: evas_obj_textgrid; - methods { - @property supported_font_styles { - set { - [[This function is not implemented yet, do not use.]] - } - get { - [[This function is not implemented yet, do not use.]] - } - values { - styles: Evas.Textgrid.Font_Style; [[EVAS_TEXTGRID_FONT_STYLE_NORMAL]] - } - } - @property grid_size { - set { - [[Set the size of the textgrid object. - - This function sets the number of lines $h and the number - of columns $w for the textgrid object $obj. If - $w or $h are less than or equal to 0, this - function does nothing. - - @since 1.7]] - legacy: evas_object_textgrid_size_set; - } - get { - [[Get the size of the textgrid object. - - This function retrieves the number of lines in the buffer - $h and the number of columns in the buffer $w of - the textgrid object $obj. $w or $h can be - $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.]] - h: int; [[The number of rows (height in cells) of the grid.]] - } - } - @property cell_size { - get { - [[Retrieve the size of a cell of the given textgrid object in pixels. - - This functions retrieves the width and height, in pixels, of a cell - of the textgrid object $obj and stores them respectively in the - buffers $width and $height. Their values depend on the - monospace font and style used for the textgrid object. - $width and $height can be $null. On error, they are - set to 0. - - See also @Efl.Text_Font.font.set and @.supported_font_styles.set - - @since 1.7]] - } - values { - width: int; [[A pointer to the location to store the cell's width in pixels.]] - height: int; [[A pointer to the location to store the cell's height in pixels.]] - } - } - update_add { - [[Indicate for evas that part of a textgrid region (cells) has been updated. - - This function declares to evas that a region of cells was updated by - code and needs refreshing. - - See also @.cellrow_set, @.cellrow_get and @.grid_size.set. - - @since 1.7]] - /* FIXME-doc - * An application should modify cells like this - * as an example: - * @code - * Evas_Textgrid_Cell *cells; - * int i; - * cells = evas_object_textgrid_cellrow_get(obj, row); - * for (i = 0; i < width; i++) cells[i].codepoint = 'E'; - * evas_object_textgrid_cellrow_set(obj, row, cells); - * evas_object_textgrid_update_add(obj, 0, row, width, 1); - * @endcode - */ - - params { - @in x: int; [[The rect region of cells top-left x (column).]] - @in y: int; [[The rect region of cells top-left y (row).]] - @in w: int; [[The rect region size in number of cells (columns).]] - @in h: int; [[The rect region size in number of cells (rows).]] - } - } - cellrow_set { - [[Set the string at the given row of the given textgrid object. - - This function returns cells to the textgrid taken by - evas_object_textgrid_cellrow_get. The row pointer $row should be the - same row pointer returned by evas_object_textgrid_cellrow_get for the - same row $y. - - See also @.cellrow_get, @.grid_size.set and @.update_add. - - @since 1.7]] - - params { - @in y: int; [[The row index of the grid.]] - @cref row: Evas.Textgrid.Cell; [[The string as a sequence of #Evas_Textgrid_Cell.]] - } - } - cellrow_get @const { - [[Get the string at the given row of the given textgrid object. - - This function returns a pointer to the first cell of the line $y - 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, @.grid_size.set and @.update_add. - - @since 1.7]] - return: ptr(Evas.Textgrid.Cell); [[A pointer to the first cell of the given row.]] - params { - @in y: int; [[The row index of the grid.]] - } - } - palette_set { - [[The set color to the given palette at the given index of the given textgrid object. - - This function sets the color for the palette of type $pal at the - index $idx of the textgrid object $obj. The ARGB components are - given by $r, $g, $b and $a. This color can be used when - setting the #Evas_Textgrid_Cell structure. The components must set - a pre-multiplied color. If pal is #EVAS_TEXTGRID_PALETTE_NONE or - #EVAS_TEXTGRID_PALETTE_LAST, or if $idx is not between 0 and 255, - or on error, this function does nothing. The color components are - clamped between 0 and 255. If $idx is greater than the latest set - color, the colors between this last index and $idx - 1 are set to - black (0, 0, 0, 0). - - See also @.palette_get. - - @since 1.7]] - - params { - @in pal: Evas.Textgrid.Palette; [[The type of the palette to set the color.]] - @in idx: int; [[The index of the palette to which the color is stored.]] - @in r: int; [[The red component of the color.]] - @in g: int; [[The green component of the color.]] - @in b: int; [[The blue component of the color.]] - @in a: int; [[The alpha component of the color.]] - } - } - palette_get @const { - [[The retrieve color to the given palette at the given index of the given textgrid object. - - This function retrieves the color for the palette of type $pal at the - index $idx of the textgrid object $obj. The ARGB components are - stored in the buffers $r, $g, $b and $a. If $idx is not - between 0 and the index of the latest set color, or if $pal is - #EVAS_TEXTGRID_PALETTE_NONE or #EVAS_TEXTGRID_PALETTE_LAST, the - values of the components are 0. $r, $g, $b and $a can be - $null. - - See also @.palette_set. - - @since 1.7]] - params { - @in pal: Evas.Textgrid.Palette; [[The type of the palette to set the color.]] - @in idx: int; [[The index of the palette to which the color is stored.]] - @out r: int; [[A pointer to the red component of the color.]] - @out g: int; [[A pointer to the green component of the color.]] - @out b: int; [[A pointer to the blue component of the color.]] - @out a: int; [[A pointer to the alpha component of the color.]] - } - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - 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_textgrid_eo.c b/src/lib/evas/canvas/evas_textgrid_eo.c new file mode 100644 index 0000000000..ae3d07e7cc --- /dev/null +++ b/src/lib/evas/canvas/evas_textgrid_eo.c @@ -0,0 +1,119 @@ + +void _evas_textgrid_supported_font_styles_set(Eo *obj, Evas_Textgrid_Data *pd, Evas_Textgrid_Font_Style styles); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_textgrid_supported_font_styles_set, EFL_FUNC_CALL(styles), Evas_Textgrid_Font_Style styles); + +Evas_Textgrid_Font_Style _evas_textgrid_supported_font_styles_get(const Eo *obj, Evas_Textgrid_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(evas_obj_textgrid_supported_font_styles_get, Evas_Textgrid_Font_Style, 0); + +void _evas_textgrid_grid_size_set(Eo *obj, Evas_Textgrid_Data *pd, int w, int h); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_textgrid_grid_size_set, EFL_FUNC_CALL(w, h), int w, int h); + +void _evas_textgrid_grid_size_get(const Eo *obj, Evas_Textgrid_Data *pd, int *w, int *h); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_obj_textgrid_grid_size_get, EFL_FUNC_CALL(w, h), int *w, int *h); + +void _evas_textgrid_cell_size_get(const Eo *obj, Evas_Textgrid_Data *pd, int *width, int *height); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_obj_textgrid_cell_size_get, EFL_FUNC_CALL(width, height), int *width, int *height); + +void _evas_textgrid_update_add(Eo *obj, Evas_Textgrid_Data *pd, int x, int y, int w, int h); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_textgrid_update_add, EFL_FUNC_CALL(x, y, w, h), int x, int y, int w, int h); + +void _evas_textgrid_cellrow_set(Eo *obj, Evas_Textgrid_Data *pd, int y, const Evas_Textgrid_Cell *row); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_textgrid_cellrow_set, EFL_FUNC_CALL(y, row), int y, const Evas_Textgrid_Cell *row); + +Evas_Textgrid_Cell *_evas_textgrid_cellrow_get(const Eo *obj, Evas_Textgrid_Data *pd, int y); + +EOAPI EFL_FUNC_BODYV_CONST(evas_obj_textgrid_cellrow_get, Evas_Textgrid_Cell *, NULL, EFL_FUNC_CALL(y), int y); + +void _evas_textgrid_palette_set(Eo *obj, Evas_Textgrid_Data *pd, Evas_Textgrid_Palette pal, int idx, int r, int g, int b, int a); + +EOAPI EFL_VOID_FUNC_BODYV(evas_obj_textgrid_palette_set, EFL_FUNC_CALL(pal, idx, r, g, b, a), Evas_Textgrid_Palette pal, int idx, int r, int g, int b, int a); + +void _evas_textgrid_palette_get(const Eo *obj, Evas_Textgrid_Data *pd, Evas_Textgrid_Palette pal, int idx, int *r, int *g, int *b, int *a); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(evas_obj_textgrid_palette_get, EFL_FUNC_CALL(pal, idx, r, g, b, a), Evas_Textgrid_Palette pal, int idx, int *r, int *g, int *b, int *a); + +Efl_Object *_evas_textgrid_efl_object_constructor(Eo *obj, Evas_Textgrid_Data *pd); + + +void _evas_textgrid_efl_object_destructor(Eo *obj, Evas_Textgrid_Data *pd); + + +void _evas_textgrid_efl_text_font_font_set(Eo *obj, Evas_Textgrid_Data *pd, const char *font, Efl_Font_Size size); + + +void _evas_textgrid_efl_text_font_font_get(const Eo *obj, Evas_Textgrid_Data *pd, const char **font, Efl_Font_Size *size); + + +void _evas_textgrid_efl_text_font_font_source_set(Eo *obj, Evas_Textgrid_Data *pd, const char *font_source); + + +const char *_evas_textgrid_efl_text_font_font_source_get(const Eo *obj, Evas_Textgrid_Data *pd); + + +void _evas_textgrid_efl_text_font_font_bitmap_scalable_set(Eo *obj, Evas_Textgrid_Data *pd, Efl_Text_Font_Bitmap_Scalable scalable); + + +Efl_Text_Font_Bitmap_Scalable _evas_textgrid_efl_text_font_font_bitmap_scalable_get(const Eo *obj, Evas_Textgrid_Data *pd); + + +void _evas_textgrid_efl_gfx_entity_scale_set(Eo *obj, Evas_Textgrid_Data *pd, double scale); + + +static Eina_Bool +_evas_textgrid_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef EVAS_TEXTGRID_EXTRA_OPS +#define EVAS_TEXTGRID_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(evas_obj_textgrid_supported_font_styles_set, _evas_textgrid_supported_font_styles_set), + EFL_OBJECT_OP_FUNC(evas_obj_textgrid_supported_font_styles_get, _evas_textgrid_supported_font_styles_get), + EFL_OBJECT_OP_FUNC(evas_obj_textgrid_grid_size_set, _evas_textgrid_grid_size_set), + EFL_OBJECT_OP_FUNC(evas_obj_textgrid_grid_size_get, _evas_textgrid_grid_size_get), + EFL_OBJECT_OP_FUNC(evas_obj_textgrid_cell_size_get, _evas_textgrid_cell_size_get), + EFL_OBJECT_OP_FUNC(evas_obj_textgrid_update_add, _evas_textgrid_update_add), + EFL_OBJECT_OP_FUNC(evas_obj_textgrid_cellrow_set, _evas_textgrid_cellrow_set), + EFL_OBJECT_OP_FUNC(evas_obj_textgrid_cellrow_get, _evas_textgrid_cellrow_get), + EFL_OBJECT_OP_FUNC(evas_obj_textgrid_palette_set, _evas_textgrid_palette_set), + EFL_OBJECT_OP_FUNC(evas_obj_textgrid_palette_get, _evas_textgrid_palette_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _evas_textgrid_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _evas_textgrid_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_text_font_set, _evas_textgrid_efl_text_font_font_set), + EFL_OBJECT_OP_FUNC(efl_text_font_get, _evas_textgrid_efl_text_font_font_get), + EFL_OBJECT_OP_FUNC(efl_text_font_source_set, _evas_textgrid_efl_text_font_font_source_set), + EFL_OBJECT_OP_FUNC(efl_text_font_source_get, _evas_textgrid_efl_text_font_font_source_get), + EFL_OBJECT_OP_FUNC(efl_text_font_bitmap_scalable_set, _evas_textgrid_efl_text_font_font_bitmap_scalable_set), + EFL_OBJECT_OP_FUNC(efl_text_font_bitmap_scalable_get, _evas_textgrid_efl_text_font_font_bitmap_scalable_get), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_scale_set, _evas_textgrid_efl_gfx_entity_scale_set), + EVAS_TEXTGRID_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _evas_textgrid_class_desc = { + EO_VERSION, + "Evas.Textgrid", + EFL_CLASS_TYPE_REGULAR, + sizeof(Evas_Textgrid_Data), + _evas_textgrid_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(evas_textgrid_class_get, &_evas_textgrid_class_desc, EFL_CANVAS_OBJECT_CLASS, EFL_TEXT_FONT_INTERFACE, NULL); + +#include "evas_textgrid_eo.legacy.c" diff --git a/src/lib/evas/canvas/evas_textgrid_eo.h b/src/lib/evas/canvas/evas_textgrid_eo.h new file mode 100644 index 0000000000..3eac6dc682 --- /dev/null +++ b/src/lib/evas/canvas/evas_textgrid_eo.h @@ -0,0 +1,259 @@ +#ifndef _EVAS_TEXTGRID_EO_H_ +#define _EVAS_TEXTGRID_EO_H_ + +#ifndef _EVAS_TEXTGRID_EO_CLASS_TYPE +#define _EVAS_TEXTGRID_EO_CLASS_TYPE + +typedef Eo Evas_Textgrid; + +#endif + +#ifndef _EVAS_TEXTGRID_EO_TYPES +#define _EVAS_TEXTGRID_EO_TYPES + +/** The palette to use for the foreground and background colors. + * + * @since 1.7 + * + * @ingroup Evas_Textgrid + */ +typedef enum +{ + EVAS_TEXTGRID_PALETTE_NONE = 0, /**< No palette is used */ + EVAS_TEXTGRID_PALETTE_STANDARD, /**< Standard palette (around 16 colors) */ + EVAS_TEXTGRID_PALETTE_EXTENDED, /**< Extended palette (at max 256 colors) */ + EVAS_TEXTGRID_PALETTE_LAST /**< Sentinel value to indicate last enum field + * during iteration */ +} Evas_Textgrid_Palette; + +/** The style to give to each character of the grid. + * + * @since 1.7 + * + * @ingroup Evas_Textgrid + */ +typedef enum +{ + EVAS_TEXTGRID_FONT_STYLE_NORMAL = 1 /* 1 >> 0 */, /**< Normal style */ + EVAS_TEXTGRID_FONT_STYLE_BOLD = 2 /* 1 >> 1 */, /**< Bold style */ + EVAS_TEXTGRID_FONT_STYLE_ITALIC = 4 /* 1 >> 2 */ /**< Oblique style */ +} Evas_Textgrid_Font_Style; + +/** Evas textgrid cell data structure + * + * @ingroup Evas_Textgrid + */ +typedef struct _Evas_Textgrid_Cell Evas_Textgrid_Cell; + + +#endif +/** Evas textgrid class + * + * @ingroup Evas_Textgrid + */ +#define EVAS_TEXTGRID_CLASS evas_textgrid_class_get() + +EWAPI const Efl_Class *evas_textgrid_class_get(void); + +/** + * @brief This function is not implemented yet, do not use. + * + * @param[in] obj The object. + * @param[in] styles EVAS_TEXTGRID_FONT_STYLE_NORMAL + * + * @ingroup Evas_Textgrid + */ +EOAPI void evas_obj_textgrid_supported_font_styles_set(Eo *obj, Evas_Textgrid_Font_Style styles); + +/** + * @brief This function is not implemented yet, do not use. + * + * @param[in] obj The object. + * + * @return EVAS_TEXTGRID_FONT_STYLE_NORMAL + * + * @ingroup Evas_Textgrid + */ +EOAPI Evas_Textgrid_Font_Style evas_obj_textgrid_supported_font_styles_get(const Eo *obj); + +/** + * @brief Set the size of the textgrid object. + * + * This function sets the number of lines @c h and the number of columns @c w + * for the textgrid object @c obj. If @c w or @c h are less than or equal to 0, + * this function does nothing. + * + * @param[in] obj The object. + * @param[in] w The number of columns (width in cells) of the grid. + * @param[in] h The number of rows (height in cells) of the grid. + * + * @since 1.7 + * + * @ingroup Evas_Textgrid + */ +EOAPI void evas_obj_textgrid_grid_size_set(Eo *obj, int w, int h); + +/** + * @brief Get the size of the textgrid object. + * + * This function retrieves the number of lines in the buffer @c h and the + * number of columns in the buffer @c w of the textgrid object @c obj. @c w or + * @c h can be @c null. On error, they are set to 0. + * + * @param[in] obj The object. + * @param[out] w The number of columns (width in cells) of the grid. + * @param[out] h The number of rows (height in cells) of the grid. + * + * @since 1.7 + * + * @ingroup Evas_Textgrid + */ +EOAPI void evas_obj_textgrid_grid_size_get(const Eo *obj, int *w, int *h); + +/** + * @brief Retrieve the size of a cell of the given textgrid object in pixels. + * + * This functions retrieves the width and height, in pixels, of a cell of the + * textgrid object @c obj and stores them respectively in the buffers @c width + * and @c height. Their values depend on the monospace font and style used for + * the textgrid object. @c width and @c height can be @c null. On error, they + * are set to 0. + * + * See also @ref efl_text_font_set and + * @ref evas_obj_textgrid_supported_font_styles_set + * + * @param[in] obj The object. + * @param[out] width A pointer to the location to store the cell's width in + * pixels. + * @param[out] height A pointer to the location to store the cell's height in + * pixels. + * + * @since 1.7 + * + * @ingroup Evas_Textgrid + */ +EOAPI void evas_obj_textgrid_cell_size_get(const Eo *obj, int *width, int *height); + +/** + * @brief Indicate for evas that part of a textgrid region (cells) has been + * updated. + * + * This function declares to evas that a region of cells was updated by code + * and needs refreshing. + * + * See also @ref evas_obj_textgrid_cellrow_set, + * @ref evas_obj_textgrid_cellrow_get and + * @ref evas_obj_textgrid_grid_size_set. + * + * @param[in] obj The object. + * @param[in] x The rect region of cells top-left x (column). + * @param[in] y The rect region of cells top-left y (row). + * @param[in] w The rect region size in number of cells (columns). + * @param[in] h The rect region size in number of cells (rows). + * + * @since 1.7 + * + * @ingroup Evas_Textgrid + */ +EOAPI void evas_obj_textgrid_update_add(Eo *obj, int x, int y, int w, int h); + +/** + * @brief Set the string at the given row of the given textgrid object. + * + * This function returns cells to the textgrid taken by + * evas_object_textgrid_cellrow_get. The row pointer @c row should be the same + * row pointer returned by evas_object_textgrid_cellrow_get for the same row + * @c y. + * + * See also @ref evas_obj_textgrid_cellrow_get, + * @ref evas_obj_textgrid_grid_size_set and @ref evas_obj_textgrid_update_add. + * + * @param[in] obj The object. + * @param[in] y The row index of the grid. + * @param[in] row The string as a sequence of #Evas_Textgrid_Cell. + * + * @since 1.7 + * + * @ingroup Evas_Textgrid + */ +EOAPI void evas_obj_textgrid_cellrow_set(Eo *obj, int y, const Evas_Textgrid_Cell *row); + +/** + * @brief Get the string at the given row of the given textgrid object. + * + * This function returns a pointer to the first cell of the line @c y of the + * textgrid object @c obj. If @c y is not between 0 and the number of lines of + * the grid - 1, or on error, this function return @c null. + * + * See also @ref evas_obj_textgrid_cellrow_set, + * @ref evas_obj_textgrid_grid_size_set and @ref evas_obj_textgrid_update_add. + * + * @param[in] obj The object. + * @param[in] y The row index of the grid. + * + * @return A pointer to the first cell of the given row. + * + * @since 1.7 + * + * @ingroup Evas_Textgrid + */ +EOAPI Evas_Textgrid_Cell *evas_obj_textgrid_cellrow_get(const Eo *obj, int y); + +/** + * @brief The set color to the given palette at the given index of the given + * textgrid object. + * + * This function sets the color for the palette of type @c pal at the index + * @c idx of the textgrid object @c obj. The ARGB components are given by @c r, + * @c g, @c b and @c a. This color can be used when setting the + * #Evas_Textgrid_Cell structure. The components must set a pre-multiplied + * color. If pal is #EVAS_TEXTGRID_PALETTE_NONE or #EVAS_TEXTGRID_PALETTE_LAST, + * or if @c idx is not between 0 and 255, or on error, this function does + * nothing. The color components are clamped between 0 and 255. If @c idx is + * greater than the latest set color, the colors between this last index and + * @c idx - 1 are set to black (0, 0, 0, 0). + * + * See also @ref evas_obj_textgrid_palette_get. + * + * @param[in] obj The object. + * @param[in] pal The type of the palette to set the color. + * @param[in] idx The index of the palette to which the color is stored. + * @param[in] r The red component of the color. + * @param[in] g The green component of the color. + * @param[in] b The blue component of the color. + * @param[in] a The alpha component of the color. + * + * @since 1.7 + * + * @ingroup Evas_Textgrid + */ +EOAPI void evas_obj_textgrid_palette_set(Eo *obj, Evas_Textgrid_Palette pal, int idx, int r, int g, int b, int a); + +/** + * @brief The retrieve color to the given palette at the given index of the + * given textgrid object. + * + * This function retrieves the color for the palette of type @c pal at the + * index @c idx of the textgrid object @c obj. The ARGB components are stored + * in the buffers @c r, @c g, @c b and @c a. If @c idx is not between 0 and the + * index of the latest set color, or if @c pal is #EVAS_TEXTGRID_PALETTE_NONE + * or #EVAS_TEXTGRID_PALETTE_LAST, the values of the components are 0. @c r, + * @c g, @c b and @c a can be @c null. + * + * See also @ref evas_obj_textgrid_palette_set. + * + * @param[in] obj The object. + * @param[in] pal The type of the palette to set the color. + * @param[in] idx The index of the palette to which the color is stored. + * @param[out] r A pointer to the red component of the color. + * @param[out] g A pointer to the green component of the color. + * @param[out] b A pointer to the blue component of the color. + * @param[out] a A pointer to the alpha component of the color. + * + * @since 1.7 + * + * @ingroup Evas_Textgrid + */ +EOAPI void evas_obj_textgrid_palette_get(const Eo *obj, Evas_Textgrid_Palette pal, int idx, int *r, int *g, int *b, int *a); + +#endif diff --git a/src/lib/evas/canvas/evas_textgrid_eo.hh b/src/lib/evas/canvas/evas_textgrid_eo.hh new file mode 100644 index 0000000000..4d7ef1ee9d --- /dev/null +++ b/src/lib/evas/canvas/evas_textgrid_eo.hh @@ -0,0 +1,366 @@ +#ifndef EVAS_TEXTGRID_EO_HH +#define EVAS_TEXTGRID_EO_HH +#include + +extern "C" { +#include "efl_canvas_object.eo.h" +#include "efl_canvas_pointer.eo.h" +#include "efl_class.eo.h" +#include "efl_gfx_color.eo.h" +#include "efl_gfx_entity.eo.h" +#include "efl_gfx_hint.eo.h" +#include "efl_gfx_mapping.eo.h" +#include "efl_gfx_stack.eo.h" +#include "efl_input_device.eo.h" +#include "efl_input_focus.eo.h" +#include "efl_input_hold.eo.h" +#include "efl_input_interface.eo.h" +#include "efl_input_key.eo.h" +#include "efl_input_pointer.eo.h" +#include "efl_loop.eo.h" +#include "efl_loop_consumer.eo.h" +#include "efl_object.eo.h" +#include "efl_text_font.eo.h" +#include "efl_ui_i18n.eo.h" +#include "evas_textgrid_eo.h" +} +#include +#include +#include "efl_canvas_object.eo.hh" +#include "efl_canvas_pointer.eo.hh" +#include "efl_class.eo.hh" +#include "efl_gfx_color.eo.hh" +#include "efl_gfx_entity.eo.hh" +#include "efl_gfx_hint.eo.hh" +#include "efl_gfx_mapping.eo.hh" +#include "efl_gfx_stack.eo.hh" +#include "efl_input_device.eo.hh" +#include "efl_input_focus.eo.hh" +#include "efl_input_hold.eo.hh" +#include "efl_input_interface.eo.hh" +#include "efl_input_key.eo.hh" +#include "efl_input_pointer.eo.hh" +#include "efl_loop.eo.hh" +#include "efl_loop_consumer.eo.hh" +#include "efl_object.eo.hh" +#include "efl_text_font.eo.hh" +#include "efl_ui_i18n.eo.hh" +#ifndef EVAS_TEXTGRID_FWD_GUARD +#define EVAS_TEXTGRID_FWD_GUARD +namespace evas { +struct Textgrid; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Textgrid> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Textgrid&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Textgrid const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::evas::Textgrid const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CLASS_FWD_GUARD +#define EFL_CLASS_FWD_GUARD +namespace efl { +struct Class; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Class const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_COLOR_FWD_GUARD +#define EFL_GFX_COLOR_FWD_GUARD +namespace efl { namespace gfx { +struct Color; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Color const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_DEVICE_FWD_GUARD +#define EFL_INPUT_DEVICE_FWD_GUARD +namespace efl { namespace input { +struct Device; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Device const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_ENTITY_FWD_GUARD +#define EFL_GFX_ENTITY_FWD_GUARD +namespace efl { namespace gfx { +struct Entity; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Entity const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_HINT_FWD_GUARD +#define EFL_GFX_HINT_FWD_GUARD +namespace efl { namespace gfx { +struct Hint; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Hint const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_FOCUS_FWD_GUARD +#define EFL_INPUT_FOCUS_FWD_GUARD +namespace efl { namespace input { +struct Focus; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Focus const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_HOLD_FWD_GUARD +#define EFL_INPUT_HOLD_FWD_GUARD +namespace efl { namespace input { +struct Hold; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Hold const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_UI_I18N_FWD_GUARD +#define EFL_UI_I18N_FWD_GUARD +namespace efl { namespace ui { +struct I18n; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::ui::I18n const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_INTERFACE_FWD_GUARD +#define EFL_INPUT_INTERFACE_FWD_GUARD +namespace efl { namespace input { +struct Interface; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Interface const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_KEY_FWD_GUARD +#define EFL_INPUT_KEY_FWD_GUARD +namespace efl { namespace input { +struct Key; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Key const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_LOOP_FWD_GUARD +#define EFL_LOOP_FWD_GUARD +namespace efl { +struct Loop; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_LOOP_CONSUMER_FWD_GUARD +#define EFL_LOOP_CONSUMER_FWD_GUARD +namespace efl { +struct Loop_Consumer; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Loop_Consumer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_MAPPING_FWD_GUARD +#define EFL_GFX_MAPPING_FWD_GUARD +namespace efl { namespace gfx { +struct Mapping; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Mapping const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_OBJECT_FWD_GUARD +#define EFL_OBJECT_FWD_GUARD +namespace efl { +struct Object; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Object const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_TEXT_FONT_FWD_GUARD +#define EFL_TEXT_FONT_FWD_GUARD +namespace efl { +struct Text_Font; +} +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Text_Font> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Text_Font&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Text_Font const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::Text_Font const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_OBJECT_FWD_GUARD +#define EFL_CANVAS_OBJECT_FWD_GUARD +namespace efl { namespace canvas { +struct Object; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Object const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_CANVAS_POINTER_FWD_GUARD +#define EFL_CANVAS_POINTER_FWD_GUARD +namespace efl { namespace canvas { +struct Pointer; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::canvas::Pointer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_INPUT_POINTER_FWD_GUARD +#define EFL_INPUT_POINTER_FWD_GUARD +namespace efl { namespace input { +struct Pointer; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::input::Pointer const&> : ::std::true_type {}; } } +#endif +#ifndef EFL_GFX_STACK_FWD_GUARD +#define EFL_GFX_STACK_FWD_GUARD +namespace efl { namespace gfx { +struct Stack; +} } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack&> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack const> : ::std::true_type {}; } } +namespace efl { namespace eo { template<> struct is_eolian_object< ::efl::gfx::Stack const&> : ::std::true_type {}; } } +#endif + +namespace eo_cxx { +namespace evas { +struct Textgrid { + ::efl::eolian::return_traits::type supported_font_styles_get() const; + ::efl::eolian::return_traits::type supported_font_styles_set( ::efl::eolian::in_traits::type styles) const; + ::efl::eolian::return_traits::type grid_size_get( ::efl::eolian::out_traits::type w, ::efl::eolian::out_traits::type h) const; + ::efl::eolian::return_traits::type grid_size_set( ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const; + ::efl::eolian::return_traits::type cell_size_get( ::efl::eolian::out_traits::type width, ::efl::eolian::out_traits::type height) const; + ::efl::eolian::return_traits::type update_add( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const; + ::efl::eolian::return_traits::type cellrow_set( ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type row) const; + ::efl::eolian::return_traits::type cellrow_get( ::efl::eolian::in_traits::type y) const; + ::efl::eolian::return_traits::type palette_set( ::efl::eolian::in_traits::type pal, ::efl::eolian::in_traits::type idx, ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const; + ::efl::eolian::return_traits::type palette_get( ::efl::eolian::in_traits::type pal, ::efl::eolian::in_traits::type idx, ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const; + static Efl_Class const* _eo_class() + { + return EVAS_TEXTGRID_CLASS; + } + Eo* _eo_ptr() const { return *(reinterpret_cast(const_cast(this))); } + operator ::evas::Textgrid() const; + operator ::evas::Textgrid&(); + operator ::evas::Textgrid const&() const; + /// @cond LOCAL + ::efl::eolian::address_of_operator operator&() { return {this}; } + ::efl::eolian::address_of_operator operator&() const { return {this}; } + /// @endcond +}; +} +} +namespace evas { +struct Textgrid : private ::efl::eo::concrete + , EO_CXX_INHERIT(::efl::Loop_Consumer) + , EO_CXX_INHERIT(::efl::Object) + , EO_CXX_INHERIT(::efl::Text_Font) + , EO_CXX_INHERIT(::efl::canvas::Object) + , EO_CXX_INHERIT(::efl::canvas::Pointer) + , EO_CXX_INHERIT(::efl::gfx::Color) + , EO_CXX_INHERIT(::efl::gfx::Entity) + , EO_CXX_INHERIT(::efl::gfx::Hint) + , EO_CXX_INHERIT(::efl::gfx::Mapping) + , EO_CXX_INHERIT(::efl::gfx::Stack) + , EO_CXX_INHERIT(::efl::input::Interface) + , EO_CXX_INHERIT(::efl::ui::I18n) +{ + explicit Textgrid( ::Eo* eo) + : ::efl::eo::concrete(eo) {} + Textgrid(std::nullptr_t) + : ::efl::eo::concrete(nullptr) {} + explicit Textgrid() = default; + Textgrid(Textgrid const&) = default; + Textgrid(Textgrid&&) = default; + Textgrid& operator=(Textgrid const&) = default; + Textgrid& operator=(Textgrid&&) = default; + template + Textgrid(Derived&& derived + , typename std::enable_if< + ::efl::eo::is_eolian_object::value + && std::is_base_of< Textgrid, Derived>::value>::type* = 0) + : ::efl::eo::concrete(derived._eo_ptr()) {} + + Textgrid( ::efl::eo::instantiate_t) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, ::efl::eo::concrete{nullptr}, _eo_class()); + } + template + explicit Textgrid( ::efl::eo::instantiate_t, T&& parent, typename std::enable_if< ::efl::eo::is_eolian_object::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, parent, _eo_class()); + } + template Textgrid( ::efl::eo::instantiate_t, F&& f, typename ::std::enable_if< ::efl::eolian::is_constructor_lambda::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, ::efl::eo::concrete{nullptr}, _eo_class(), *this, std::forward(f)); + } + template Textgrid( ::efl::eo::instantiate_t, T&& parent, F&& f, typename ::std::enable_if< ::efl::eolian::is_constructor_lambda::value && ::efl::eo::is_eolian_object::value>::type* = 0) + { + ::efl::eolian::do_eo_add( ::efl::eo::concrete::_eo_raw, parent, _eo_class(), *this, std::forward(f)); + } + + ::efl::eolian::return_traits::type supported_font_styles_get() const; + ::efl::eolian::return_traits::type supported_font_styles_set( ::efl::eolian::in_traits::type styles) const; + ::efl::eolian::return_traits::type grid_size_get( ::efl::eolian::out_traits::type w, ::efl::eolian::out_traits::type h) const; + ::efl::eolian::return_traits::type grid_size_set( ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const; + ::efl::eolian::return_traits::type cell_size_get( ::efl::eolian::out_traits::type width, ::efl::eolian::out_traits::type height) const; + ::efl::eolian::return_traits::type update_add( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const; + ::efl::eolian::return_traits::type cellrow_set( ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type row) const; + ::efl::eolian::return_traits::type cellrow_get( ::efl::eolian::in_traits::type y) const; + ::efl::eolian::return_traits::type palette_set( ::efl::eolian::in_traits::type pal, ::efl::eolian::in_traits::type idx, ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const; + ::efl::eolian::return_traits::type palette_get( ::efl::eolian::in_traits::type pal, ::efl::eolian::in_traits::type idx, ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const; + static Efl_Class const* _eo_class() + { + return EVAS_TEXTGRID_CLASS; + } + Eo* _eo_ptr() const { return *(reinterpret_cast(const_cast(this))); } + /// @cond LOCAL + ::efl::eolian::address_of_operator operator&() { return {this}; } + ::efl::eolian::address_of_operator operator&() const { return {this}; } + /// @endcond + ::efl::eo::wref _get_wref() const { return ::efl::eo::wref(*this); } + ::efl::eo::concrete const& _get_concrete() const { return *this; } + ::efl::eo::concrete& _get_concrete() { return *this; } + using ::efl::eo::concrete::_eo_ptr; + using ::efl::eo::concrete::_release; + using ::efl::eo::concrete::_reset; + using ::efl::eo::concrete::_delete; + using ::efl::eo::concrete::operator bool; +#ifdef EFL_CXXPERIMENTAL + const Textgrid* operator->() const { return this; } + Textgrid* operator->() { return this; } + operator Eo*() const { return _eo_ptr(); } +#endif + friend bool operator==(Textgrid const& lhs, Textgrid const& rhs) + { return lhs._get_concrete() == rhs._get_concrete(); } + friend bool operator!=(Textgrid const& lhs, Textgrid const& rhs) + { return !(lhs == rhs); } +}; +static_assert(sizeof(Textgrid) == sizeof(Eo*), ""); +static_assert(std::is_standard_layout::value, ""); +} +#endif diff --git a/src/lib/evas/canvas/evas_textgrid_eo.impl.hh b/src/lib/evas/canvas/evas_textgrid_eo.impl.hh new file mode 100644 index 0000000000..438e440f5c --- /dev/null +++ b/src/lib/evas/canvas/evas_textgrid_eo.impl.hh @@ -0,0 +1,182 @@ +#ifndef EVAS_TEXTGRID_IMPL_HH +#define EVAS_TEXTGRID_IMPL_HH + +#include "evas_textgrid_eo.hh" + +namespace evas { +inline ::efl::eolian::return_traits::type Textgrid::supported_font_styles_get() const +{ + Evas_Textgrid_Font_Style __return_value = ::evas_obj_textgrid_supported_font_styles_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Textgrid::supported_font_styles_set( ::efl::eolian::in_traits::type styles) const +{ + ::evas_obj_textgrid_supported_font_styles_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(styles)); +} +inline ::efl::eolian::return_traits::type Textgrid::grid_size_get( ::efl::eolian::out_traits::type w, ::efl::eolian::out_traits::type h) const +{ + int __out_param_w = {}; + int __out_param_h = {}; + ::evas_obj_textgrid_grid_size_get(_eo_ptr(), + & __out_param_w, + & __out_param_h); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(w, __out_param_w); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(h, __out_param_h); +} +inline ::efl::eolian::return_traits::type Textgrid::grid_size_set( ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const +{ + ::evas_obj_textgrid_grid_size_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(w), + ::efl::eolian::convert_to_c::type>(h)); +} +inline ::efl::eolian::return_traits::type Textgrid::cell_size_get( ::efl::eolian::out_traits::type width, ::efl::eolian::out_traits::type height) const +{ + int __out_param_width = {}; + int __out_param_height = {}; + ::evas_obj_textgrid_cell_size_get(_eo_ptr(), + & __out_param_width, + & __out_param_height); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(width, __out_param_width); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(height, __out_param_height); +} +inline ::efl::eolian::return_traits::type Textgrid::update_add( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const +{ + ::evas_obj_textgrid_update_add(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(x), + ::efl::eolian::convert_to_c::type>(y), + ::efl::eolian::convert_to_c::type>(w), + ::efl::eolian::convert_to_c::type>(h)); +} +inline ::efl::eolian::return_traits::type Textgrid::cellrow_set( ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type row) const +{ + ::evas_obj_textgrid_cellrow_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(y), + ::efl::eolian::convert_to_c::type>(row)); +} +inline ::efl::eolian::return_traits::type Textgrid::cellrow_get( ::efl::eolian::in_traits::type y) const +{ + Evas_Textgrid_Cell * __return_value = ::evas_obj_textgrid_cellrow_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(y)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Textgrid::palette_set( ::efl::eolian::in_traits::type pal, ::efl::eolian::in_traits::type idx, ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const +{ + ::evas_obj_textgrid_palette_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(pal), + ::efl::eolian::convert_to_c::type>(idx), + ::efl::eolian::convert_to_c::type>(r), + ::efl::eolian::convert_to_c::type>(g), + ::efl::eolian::convert_to_c::type>(b), + ::efl::eolian::convert_to_c::type>(a)); +} +inline ::efl::eolian::return_traits::type Textgrid::palette_get( ::efl::eolian::in_traits::type pal, ::efl::eolian::in_traits::type idx, ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const +{ + int __out_param_r = {}; + int __out_param_g = {}; + int __out_param_b = {}; + int __out_param_a = {}; + ::evas_obj_textgrid_palette_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(pal), + ::efl::eolian::convert_to_c::type>(idx), + & __out_param_r, + & __out_param_g, + & __out_param_b, + & __out_param_a); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(r, __out_param_r); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(g, __out_param_g); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(b, __out_param_b); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(a, __out_param_a); +} +} +namespace eo_cxx { +namespace evas { +inline ::efl::eolian::return_traits::type Textgrid::supported_font_styles_get() const +{ + Evas_Textgrid_Font_Style __return_value = ::evas_obj_textgrid_supported_font_styles_get(_eo_ptr()); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Textgrid::supported_font_styles_set( ::efl::eolian::in_traits::type styles) const +{ + ::evas_obj_textgrid_supported_font_styles_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(styles)); +} +inline ::efl::eolian::return_traits::type Textgrid::grid_size_get( ::efl::eolian::out_traits::type w, ::efl::eolian::out_traits::type h) const +{ + int __out_param_w = {}; + int __out_param_h = {}; + ::evas_obj_textgrid_grid_size_get(_eo_ptr(), + & __out_param_w, + & __out_param_h); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(w, __out_param_w); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(h, __out_param_h); +} +inline ::efl::eolian::return_traits::type Textgrid::grid_size_set( ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const +{ + ::evas_obj_textgrid_grid_size_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(w), + ::efl::eolian::convert_to_c::type>(h)); +} +inline ::efl::eolian::return_traits::type Textgrid::cell_size_get( ::efl::eolian::out_traits::type width, ::efl::eolian::out_traits::type height) const +{ + int __out_param_width = {}; + int __out_param_height = {}; + ::evas_obj_textgrid_cell_size_get(_eo_ptr(), + & __out_param_width, + & __out_param_height); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(width, __out_param_width); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(height, __out_param_height); +} +inline ::efl::eolian::return_traits::type Textgrid::update_add( ::efl::eolian::in_traits::type x, ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type w, ::efl::eolian::in_traits::type h) const +{ + ::evas_obj_textgrid_update_add(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(x), + ::efl::eolian::convert_to_c::type>(y), + ::efl::eolian::convert_to_c::type>(w), + ::efl::eolian::convert_to_c::type>(h)); +} +inline ::efl::eolian::return_traits::type Textgrid::cellrow_set( ::efl::eolian::in_traits::type y, ::efl::eolian::in_traits::type row) const +{ + ::evas_obj_textgrid_cellrow_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(y), + ::efl::eolian::convert_to_c::type>(row)); +} +inline ::efl::eolian::return_traits::type Textgrid::cellrow_get( ::efl::eolian::in_traits::type y) const +{ + Evas_Textgrid_Cell * __return_value = ::evas_obj_textgrid_cellrow_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(y)); + return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits::type>(__return_value); +} +inline ::efl::eolian::return_traits::type Textgrid::palette_set( ::efl::eolian::in_traits::type pal, ::efl::eolian::in_traits::type idx, ::efl::eolian::in_traits::type r, ::efl::eolian::in_traits::type g, ::efl::eolian::in_traits::type b, ::efl::eolian::in_traits::type a) const +{ + ::evas_obj_textgrid_palette_set(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(pal), + ::efl::eolian::convert_to_c::type>(idx), + ::efl::eolian::convert_to_c::type>(r), + ::efl::eolian::convert_to_c::type>(g), + ::efl::eolian::convert_to_c::type>(b), + ::efl::eolian::convert_to_c::type>(a)); +} +inline ::efl::eolian::return_traits::type Textgrid::palette_get( ::efl::eolian::in_traits::type pal, ::efl::eolian::in_traits::type idx, ::efl::eolian::out_traits::type r, ::efl::eolian::out_traits::type g, ::efl::eolian::out_traits::type b, ::efl::eolian::out_traits::type a) const +{ + int __out_param_r = {}; + int __out_param_g = {}; + int __out_param_b = {}; + int __out_param_a = {}; + ::evas_obj_textgrid_palette_get(_eo_ptr(), + ::efl::eolian::convert_to_c::type>(pal), + ::efl::eolian::convert_to_c::type>(idx), + & __out_param_r, + & __out_param_g, + & __out_param_b, + & __out_param_a); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(r, __out_param_r); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(g, __out_param_g); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(b, __out_param_b); + ::efl::eolian::assign_out< ::efl::eolian::out_traits::type, int>(a, __out_param_a); +} +inline evas::Textgrid::operator ::evas::Textgrid() const { return *static_cast< ::evas::Textgrid const*>(static_cast(this)); } +inline evas::Textgrid::operator ::evas::Textgrid&() { return *static_cast< ::evas::Textgrid*>(static_cast(this)); } +inline evas::Textgrid::operator ::evas::Textgrid const&() const { return *static_cast< ::evas::Textgrid const*>(static_cast(this)); } +} } +#endif diff --git a/src/lib/evas/canvas/evas_textgrid_eo.legacy.c b/src/lib/evas/canvas/evas_textgrid_eo.legacy.c new file mode 100644 index 0000000000..8110d09e65 --- /dev/null +++ b/src/lib/evas/canvas/evas_textgrid_eo.legacy.c @@ -0,0 +1,60 @@ + +EAPI void +evas_object_textgrid_supported_font_styles_set(Evas_Textgrid *obj, Evas_Textgrid_Font_Style styles) +{ + evas_obj_textgrid_supported_font_styles_set(obj, styles); +} + +EAPI Evas_Textgrid_Font_Style +evas_object_textgrid_supported_font_styles_get(const Evas_Textgrid *obj) +{ + return evas_obj_textgrid_supported_font_styles_get(obj); +} + +EAPI void +evas_object_textgrid_size_set(Evas_Textgrid *obj, int w, int h) +{ + evas_obj_textgrid_grid_size_set(obj, w, h); +} + +EAPI void +evas_object_textgrid_size_get(const Evas_Textgrid *obj, int *w, int *h) +{ + evas_obj_textgrid_grid_size_get(obj, w, h); +} + +EAPI void +evas_object_textgrid_cell_size_get(const Evas_Textgrid *obj, int *width, int *height) +{ + evas_obj_textgrid_cell_size_get(obj, width, height); +} + +EAPI void +evas_object_textgrid_update_add(Evas_Textgrid *obj, int x, int y, int w, int h) +{ + evas_obj_textgrid_update_add(obj, x, y, w, h); +} + +EAPI void +evas_object_textgrid_cellrow_set(Evas_Textgrid *obj, int y, const Evas_Textgrid_Cell *row) +{ + evas_obj_textgrid_cellrow_set(obj, y, row); +} + +EAPI Evas_Textgrid_Cell * +evas_object_textgrid_cellrow_get(const Evas_Textgrid *obj, int y) +{ + return evas_obj_textgrid_cellrow_get(obj, y); +} + +EAPI void +evas_object_textgrid_palette_set(Evas_Textgrid *obj, Evas_Textgrid_Palette pal, int idx, int r, int g, int b, int a) +{ + evas_obj_textgrid_palette_set(obj, pal, idx, r, g, b, a); +} + +EAPI void +evas_object_textgrid_palette_get(const Evas_Textgrid *obj, Evas_Textgrid_Palette pal, int idx, int *r, int *g, int *b, int *a) +{ + evas_obj_textgrid_palette_get(obj, pal, idx, r, g, b, a); +} diff --git a/src/lib/evas/canvas/evas_textgrid_eo.legacy.h b/src/lib/evas/canvas/evas_textgrid_eo.legacy.h new file mode 100644 index 0000000000..9a99ce2bd3 --- /dev/null +++ b/src/lib/evas/canvas/evas_textgrid_eo.legacy.h @@ -0,0 +1,252 @@ +#ifndef _EVAS_TEXTGRID_EO_LEGACY_H_ +#define _EVAS_TEXTGRID_EO_LEGACY_H_ + +#ifndef _EVAS_TEXTGRID_EO_CLASS_TYPE +#define _EVAS_TEXTGRID_EO_CLASS_TYPE + +typedef Eo Evas_Textgrid; + +#endif + +#ifndef _EVAS_TEXTGRID_EO_TYPES +#define _EVAS_TEXTGRID_EO_TYPES + +/** The palette to use for the foreground and background colors. + * + * @since 1.7 + * + * @ingroup Evas_Textgrid + */ +typedef enum +{ + EVAS_TEXTGRID_PALETTE_NONE = 0, /**< No palette is used */ + EVAS_TEXTGRID_PALETTE_STANDARD, /**< Standard palette (around 16 colors) */ + EVAS_TEXTGRID_PALETTE_EXTENDED, /**< Extended palette (at max 256 colors) */ + EVAS_TEXTGRID_PALETTE_LAST /**< Sentinel value to indicate last enum field + * during iteration */ +} Evas_Textgrid_Palette; + +/** The style to give to each character of the grid. + * + * @since 1.7 + * + * @ingroup Evas_Textgrid + */ +typedef enum +{ + EVAS_TEXTGRID_FONT_STYLE_NORMAL = 1 /* 1 >> 0 */, /**< Normal style */ + EVAS_TEXTGRID_FONT_STYLE_BOLD = 2 /* 1 >> 1 */, /**< Bold style */ + EVAS_TEXTGRID_FONT_STYLE_ITALIC = 4 /* 1 >> 2 */ /**< Oblique style */ +} Evas_Textgrid_Font_Style; + +/** Evas textgrid cell data structure + * + * @ingroup Evas_Textgrid + */ +typedef struct _Evas_Textgrid_Cell Evas_Textgrid_Cell; + + +#endif + +/** + * @brief This function is not implemented yet, do not use. + * + * @param[in] obj The object. + * @param[in] styles EVAS_TEXTGRID_FONT_STYLE_NORMAL + * + * @ingroup Evas_Object_Textgrid_Group + */ +EAPI void evas_object_textgrid_supported_font_styles_set(Evas_Textgrid *obj, Evas_Textgrid_Font_Style styles); + +/** + * @brief This function is not implemented yet, do not use. + * + * @param[in] obj The object. + * + * @return EVAS_TEXTGRID_FONT_STYLE_NORMAL + * + * @ingroup Evas_Object_Textgrid_Group + */ +EAPI Evas_Textgrid_Font_Style evas_object_textgrid_supported_font_styles_get(const Evas_Textgrid *obj); + +/** + * @brief Set the size of the textgrid object. + * + * This function sets the number of lines @c h and the number of columns @c w + * for the textgrid object @c obj. If @c w or @c h are less than or equal to 0, + * this function does nothing. + * + * @param[in] obj The object. + * @param[in] w The number of columns (width in cells) of the grid. + * @param[in] h The number of rows (height in cells) of the grid. + * + * @since 1.7 + * + * @ingroup Evas_Object_Textgrid_Group + */ +EAPI void evas_object_textgrid_size_set(Evas_Textgrid *obj, int w, int h); + +/** + * @brief Get the size of the textgrid object. + * + * This function retrieves the number of lines in the buffer @c h and the + * number of columns in the buffer @c w of the textgrid object @c obj. @c w or + * @c h can be @c null. On error, they are set to 0. + * + * @param[in] obj The object. + * @param[out] w The number of columns (width in cells) of the grid. + * @param[out] h The number of rows (height in cells) of the grid. + * + * @since 1.7 + * + * @ingroup Evas_Object_Textgrid_Group + */ +EAPI void evas_object_textgrid_size_get(const Evas_Textgrid *obj, int *w, int *h); + +/** + * @brief Retrieve the size of a cell of the given textgrid object in pixels. + * + * This functions retrieves the width and height, in pixels, of a cell of the + * textgrid object @c obj and stores them respectively in the buffers @c width + * and @c height. Their values depend on the monospace font and style used for + * the textgrid object. @c width and @c height can be @c null. On error, they + * are set to 0. + * + * See also @ref Efl.Text_Font.font.set and + * @ref evas_object_textgrid_supported_font_styles_set + * + * @param[in] obj The object. + * @param[out] width A pointer to the location to store the cell's width in + * pixels. + * @param[out] height A pointer to the location to store the cell's height in + * pixels. + * + * @since 1.7 + * + * @ingroup Evas_Object_Textgrid_Group + */ +EAPI void evas_object_textgrid_cell_size_get(const Evas_Textgrid *obj, int *width, int *height); + +/** + * @brief Indicate for evas that part of a textgrid region (cells) has been + * updated. + * + * This function declares to evas that a region of cells was updated by code + * and needs refreshing. + * + * See also @ref evas_object_textgrid_cellrow_set, + * @ref evas_object_textgrid_cellrow_get and + * @ref evas_object_textgrid_size_set. + * + * @param[in] obj The object. + * @param[in] x The rect region of cells top-left x (column). + * @param[in] y The rect region of cells top-left y (row). + * @param[in] w The rect region size in number of cells (columns). + * @param[in] h The rect region size in number of cells (rows). + * + * @since 1.7 + * + * @ingroup Evas_Object_Textgrid_Group + */ +EAPI void evas_object_textgrid_update_add(Evas_Textgrid *obj, int x, int y, int w, int h); + +/** + * @brief Set the string at the given row of the given textgrid object. + * + * This function returns cells to the textgrid taken by + * evas_object_textgrid_cellrow_get. The row pointer @c row should be the same + * row pointer returned by evas_object_textgrid_cellrow_get for the same row + * @c y. + * + * See also @ref evas_object_textgrid_cellrow_get, + * @ref evas_object_textgrid_size_set and @ref evas_object_textgrid_update_add. + * + * @param[in] obj The object. + * @param[in] y The row index of the grid. + * @param[in] row The string as a sequence of #Evas_Textgrid_Cell. + * + * @since 1.7 + * + * @ingroup Evas_Object_Textgrid_Group + */ +EAPI void evas_object_textgrid_cellrow_set(Evas_Textgrid *obj, int y, const Evas_Textgrid_Cell *row); + +/** + * @brief Get the string at the given row of the given textgrid object. + * + * This function returns a pointer to the first cell of the line @c y of the + * textgrid object @c obj. If @c y is not between 0 and the number of lines of + * the grid - 1, or on error, this function return @c null. + * + * See also @ref evas_object_textgrid_cellrow_set, + * @ref evas_object_textgrid_size_set and @ref evas_object_textgrid_update_add. + * + * @param[in] obj The object. + * @param[in] y The row index of the grid. + * + * @return A pointer to the first cell of the given row. + * + * @since 1.7 + * + * @ingroup Evas_Object_Textgrid_Group + */ +EAPI Evas_Textgrid_Cell *evas_object_textgrid_cellrow_get(const Evas_Textgrid *obj, int y); + +/** + * @brief The set color to the given palette at the given index of the given + * textgrid object. + * + * This function sets the color for the palette of type @c pal at the index + * @c idx of the textgrid object @c obj. The ARGB components are given by @c r, + * @c g, @c b and @c a. This color can be used when setting the + * #Evas_Textgrid_Cell structure. The components must set a pre-multiplied + * color. If pal is #EVAS_TEXTGRID_PALETTE_NONE or #EVAS_TEXTGRID_PALETTE_LAST, + * or if @c idx is not between 0 and 255, or on error, this function does + * nothing. The color components are clamped between 0 and 255. If @c idx is + * greater than the latest set color, the colors between this last index and + * @c idx - 1 are set to black (0, 0, 0, 0). + * + * See also @ref evas_object_textgrid_palette_get. + * + * @param[in] obj The object. + * @param[in] pal The type of the palette to set the color. + * @param[in] idx The index of the palette to which the color is stored. + * @param[in] r The red component of the color. + * @param[in] g The green component of the color. + * @param[in] b The blue component of the color. + * @param[in] a The alpha component of the color. + * + * @since 1.7 + * + * @ingroup Evas_Object_Textgrid_Group + */ +EAPI void evas_object_textgrid_palette_set(Evas_Textgrid *obj, Evas_Textgrid_Palette pal, int idx, int r, int g, int b, int a); + +/** + * @brief The retrieve color to the given palette at the given index of the + * given textgrid object. + * + * This function retrieves the color for the palette of type @c pal at the + * index @c idx of the textgrid object @c obj. The ARGB components are stored + * in the buffers @c r, @c g, @c b and @c a. If @c idx is not between 0 and the + * index of the latest set color, or if @c pal is #EVAS_TEXTGRID_PALETTE_NONE + * or #EVAS_TEXTGRID_PALETTE_LAST, the values of the components are 0. @c r, + * @c g, @c b and @c a can be @c null. + * + * See also @ref evas_object_textgrid_palette_set. + * + * @param[in] obj The object. + * @param[in] pal The type of the palette to set the color. + * @param[in] idx The index of the palette to which the color is stored. + * @param[out] r A pointer to the red component of the color. + * @param[out] g A pointer to the green component of the color. + * @param[out] b A pointer to the blue component of the color. + * @param[out] a A pointer to the alpha component of the color. + * + * @since 1.7 + * + * @ingroup Evas_Object_Textgrid_Group + */ +EAPI void evas_object_textgrid_palette_get(const Evas_Textgrid *obj, Evas_Textgrid_Palette pal, int idx, int *r, int *g, int *b, int *a); + +#endif diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h index fa122fa587..f4c47de4bb 100644 --- a/src/lib/evas/canvas/evas_vg_private.h +++ b/src/lib/evas/canvas/evas_vg_private.h @@ -19,14 +19,13 @@ typedef struct _Vg_Cache typedef struct _Vg_Cache_Entry { char *hash_key; - Eina_Stringshare *file; + const Eina_File *file; Eina_Stringshare *key; int w; int h; Efl_VG *root; int ref; Vg_File_Data *vfd; - } Vg_Cache_Entry; // holds the vg tree info set by the user @@ -64,7 +63,8 @@ struct _Efl_Canvas_Vg_Node_Data Efl_Canvas_Vg_Object_Data *vd; void (*render_pre)(Evas_Object_Protected_Data *vg_pd, Efl_VG *node, - Efl_Canvas_Vg_Node_Data *nd, Ector_Surface *surface, + Efl_Canvas_Vg_Node_Data *nd, + void *engine, void *output, void *contenxt, Ector_Surface *surface, Eina_Matrix3 *ptransform, Ector_Buffer *mask, int mask_op, void *data); void *data; @@ -84,7 +84,6 @@ typedef struct _Vg_Mask Eina_Rect bound; //Mask boundary Eina_List *target; //Mask target int option; //Mask option - Eina_Bool dirty : 1; //Need to update mask image. } Vg_Mask; struct _Efl_Canvas_Vg_Container_Data @@ -119,12 +118,12 @@ struct _Efl_Canvas_Vg_Interpolation void evas_cache_vg_init(void); void evas_cache_vg_shutdown(void); Vg_Cache_Entry* evas_cache_vg_entry_resize(Vg_Cache_Entry *entry, int w, int h); -Vg_Cache_Entry* evas_cache_vg_entry_create(const char *file, const char *key, int w, int h); +Vg_Cache_Entry* evas_cache_vg_entry_create(const Eina_File *file, const char *key, int w, int h); Efl_VG* evas_cache_vg_tree_get(Vg_Cache_Entry *vg_entry); void evas_cache_vg_entry_del(Vg_Cache_Entry *vg_entry); -Vg_File_Data * evas_cache_vg_file_open(const char *file, const char *key); -Eina_Bool evas_cache_vg_file_save(Efl_VG *root, int w, int h, const char *file, const char *key, const char *flags); -Eina_Bool evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const char *flags); +Vg_File_Data * evas_cache_vg_file_open(const Eina_File *file, const char *key); +Eina_Bool evas_cache_vg_file_save(Efl_VG *root, int w, int h, const char *file, const char *key, const Efl_File_Save_Info *info); +Eina_Bool evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const Efl_File_Save_Info *info); void efl_canvas_vg_node_vg_obj_set(Efl_VG *node, Efl_VG *vg_obj, Efl_Canvas_Vg_Object_Data *vd); void efl_canvas_vg_node_change(Efl_VG *node); void efl_canvas_vg_container_vg_obj_update(Efl_VG *obj, Efl_Canvas_Vg_Node_Data *nd); @@ -138,11 +137,17 @@ efl_canvas_vg_object_change(Efl_Canvas_Vg_Object_Data *vd) } static inline Efl_Canvas_Vg_Node_Data * -_evas_vg_render_pre(Evas_Object_Protected_Data *vg_pd, Efl_VG *child, Ector_Surface *surface, Eina_Matrix3 *transform, Ector_Buffer *mask, int mask_op) +_evas_vg_render_pre(Evas_Object_Protected_Data *vg_pd, Efl_VG *child, + void *engine, void *output, void *context, + Ector_Surface *surface, + Eina_Matrix3 *transform, + Ector_Buffer *mask, int mask_op) { if (!child) return NULL; Efl_Canvas_Vg_Node_Data *nd = efl_data_scope_get(child, EFL_CANVAS_VG_NODE_CLASS); - if (nd) nd->render_pre(vg_pd, child, nd, surface, transform, mask, mask_op, nd->data); + if (nd) nd->render_pre(vg_pd, child, nd, + engine, output, context, surface, + transform, mask, mask_op, nd->data); return nd; } diff --git a/src/lib/evas/canvas/meson.build b/src/lib/evas/canvas/meson.build index c7e8810f63..e0e6b3364a 100644 --- a/src/lib/evas/canvas/meson.build +++ b/src/lib/evas/canvas/meson.build @@ -1,31 +1,4 @@ -pub_legacy_eo_files = [ - 'evas_canvas.eo', - 'evas_line.eo', - 'evas_table.eo', - 'evas_grid.eo', - 'evas_box.eo', - 'evas_text.eo', - 'evas_textgrid.eo', - 'evas_image.eo', -] - -foreach eo_file : pub_legacy_eo_files - pub_eo_file_target += custom_target('eolian_gen_' + eo_file, - input : eo_file, - output : [eo_file + '.legacy.h',], - depfile : eo_file + '.d', - install : true, - install_dir : join_paths(dir_package_include, 'canvas'), - command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories, - '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'), - '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'), - '-o', 'l:' + join_paths(meson.current_build_dir(), eo_file + '.legacy.h'), - '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'), - '-gchld', '@INPUT@']) - -endforeach - pub_eo_files = [ 'efl_canvas_polygon.eo', 'efl_canvas_image_internal.eo', @@ -74,7 +47,7 @@ pub_eo_files = [ 'efl_canvas_vg_gradient_radial.eo', 'efl_canvas_vg_gradient_linear.eo', 'efl_canvas_group.eo', - 'efl_gfx_map.eo', + 'efl_gfx_mapping.eo', 'efl_canvas_event_grabber.eo', 'efl_canvas_text.eo' ] @@ -130,6 +103,25 @@ endforeach pub_evas_eot_files += files(pub_eo_types_files) +evas_legacy_h = files([ + 'efl_canvas_event_grabber_eo.legacy.h', + 'efl_canvas_group_eo.legacy.h', + 'efl_canvas_object_eo.legacy.h', + 'efl_canvas_text_eo.legacy.h', + 'efl_canvas_vg_container_eo.legacy.h', + 'efl_canvas_vg_node_eo.legacy.h', + 'efl_canvas_vg_object_eo.legacy.h', + 'efl_canvas_vg_shape_eo.legacy.h', + 'evas_box_eo.legacy.h', + 'evas_canvas_eo.legacy.h', + 'evas_grid_eo.legacy.h', + 'evas_image_eo.legacy.h', + 'evas_line_eo.legacy.h', + 'evas_table_eo.legacy.h', + 'evas_text_eo.legacy.h', + 'evas_textgrid_eo.legacy.h', +]) + evas_src += files([ 'evas_callbacks.c', 'evas_clip.c', @@ -179,7 +171,7 @@ evas_src += files([ 'efl_canvas_surface_tbm.c', 'efl_canvas_surface_x11.c', 'efl_canvas_surface_wayland.c', - 'efl_gfx_map.c', + 'efl_gfx_mapping.c', 'efl_input_event.c', 'efl_input_key.c', 'efl_input_pointer.c', @@ -218,7 +210,7 @@ evas_src += files([ evas_include_directories += include_directories('.') -install_headers('evas_textblock_legacy.h', +install_headers(['evas_textblock_legacy.h', evas_legacy_h], install_dir : join_paths(dir_package_include, 'canvas'), ) diff --git a/src/lib/evas/common/evas_convert_rgb_32.c b/src/lib/evas/common/evas_convert_rgb_32.c index 89789b2ac5..68d3a95b22 100644 --- a/src/lib/evas/common/evas_convert_rgb_32.c +++ b/src/lib/evas/common/evas_convert_rgb_32.c @@ -1,9 +1,13 @@ #include "evas_common_private.h" #include "evas_convert_rgb_32.h" #ifdef BUILD_NEON -#include +# include #endif +// tiled rotate is faster in every case i've tested, so just use this +// by default. +#define TILE_ROTATE 1 + void evas_common_convert_rgba_to_32bpp_rgb_8888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x EINA_UNUSED, int dith_y EINA_UNUSED, DATA8 *pal EINA_UNUSED) { @@ -19,9 +23,9 @@ evas_common_convert_rgba_to_32bpp_rgb_8888 (DATA32 *src, DATA8 *dst, int src_jum for (y = 0; y < h; y++) { - func(src_ptr, dst_ptr, w); - src_ptr += w + src_jump; - dst_ptr += w + dst_jump; + func(src_ptr, dst_ptr, w); + src_ptr += w + src_jump; + dst_ptr += w + dst_jump; } return; } @@ -44,234 +48,205 @@ evas_common_convert_rgba_to_32bpp_rgb_8888_rot_180 (DATA32 *src, DATA8 *dst, int } #ifdef TILE_ROTATE -#ifdef BUILD_NEON -#define ROT90_QUAD_COPY_LOOP(pix_type) \ - if (evas_common_cpu_has_feature(CPU_FEATURE_NEON)) \ - { \ - if((w%4) == 0) \ - { \ - int klght = 4 * src_stride; \ - for(y = 0; y < h; y++) \ - { \ - const pix_type *s = &(src[(h - y - 1)]); \ - pix_type *d = &(dst[(dst_stride * y)]); \ - pix_type *ptr1 = s; \ - pix_type *ptr2 = ptr1 + src_stride; \ - pix_type *ptr3 = ptr2 + src_stride; \ - pix_type *ptr4 = ptr3 + src_stride; \ - for(x = 0; x < w; x+=4) \ - { \ - pix_type s_array[4] = {*ptr1, *ptr2, *ptr3, *ptr4}; \ - vst1q_s32(d, vld1q_s32(s_array)); \ - d += 4; \ - ptr1 += klght; \ - ptr2 += klght; \ - ptr3 += klght; \ - ptr4 += klght; \ - } \ - } \ +# ifdef BUILD_NEON +# define ROT90_QUAD_COPY_LOOP(pix_type) \ + if (evas_common_cpu_has_feature(CPU_FEATURE_NEON)) { \ + if ((w % 4) == 0) { \ + int klght = 4 * src_stride; \ + for (y = 0; y < h; y++) { \ + const pix_type *s = &(src[h - y - 1]); \ + pix_type *d = &(dst[dst_stride * y]); \ + const pix_type *ptr1 = s; \ + const pix_type *ptr2 = ptr1 + src_stride; \ + const pix_type *ptr3 = ptr2 + src_stride; \ + const pix_type *ptr4 = ptr3 + src_stride; \ + for(x = 0; x < w; x += 4) { \ + pix_type s_array[4] = { *ptr1, *ptr2, *ptr3, *ptr4 }; \ + vst1q_u32(d, vld1q_u32(s_array)); \ + d += 4; \ + ptr1 += klght; \ + ptr2 += klght; \ + ptr3 += klght; \ + ptr4 += klght; \ + } \ + } \ } \ - else \ - { \ - for (y = 0; y < h; y++) \ - { \ - const pix_type *s = &(src[(h - y - 1)]); \ - pix_type *d = &(dst[(dst_stride * y)]); \ - for (x = 0; x < w; x++) \ - { \ - *d++ = *s; \ - s += src_stride; \ - } \ - } \ + else { \ + for (y = 0; y < h; y++) { \ + const pix_type *s = &(src[h - y - 1]); \ + pix_type *d = &(dst[dst_stride * y]); \ + for (x = 0; x < w; x++) { \ + *d++ = *s; \ + s += src_stride; \ + } \ + } \ } \ } \ else -#define ROT270_QUAD_COPY_LOOP(pix_type) \ - if (evas_common_cpu_has_feature(CPU_FEATURE_NEON)) \ - { \ - if((w%4) == 0) \ - { \ - int klght = 4 * src_stride; \ - for(y = 0; y < h; y++) \ - { \ - const pix_type *s = &(src[(src_stride * (w - 1)) + y]); \ - pix_type *d = &(dst[(dst_stride * y)]); \ - pix_type *ptr1 = s; \ - pix_type *ptr2 = ptr1 + src_stride; \ - pix_type *ptr3 = ptr2 + src_stride; \ - pix_type *ptr4 = ptr3 + src_stride; \ - for(x = 0; x < w; x+=4) \ - { \ - pix_type s_array[4] = {*ptr1, *ptr2, *ptr3, *ptr4}; \ - vst1q_s32(d, vld1q_s32(s_array)); \ - d += 4; \ - ptr1 += klght; \ - ptr2 += klght; \ - ptr3 += klght; \ - ptr4 += klght; \ - } \ - } \ +# define ROT270_QUAD_COPY_LOOP(pix_type) \ + if (evas_common_cpu_has_feature(CPU_FEATURE_NEON)) { \ + if ((w % 4) == 0) { \ + int klght = 4 * src_stride; \ + for (y = 0; y < h; y++) { \ + const pix_type *s = &(src[(src_stride * (w - 1)) + y]); \ + pix_type *d = &(dst[dst_stride * y]); \ + const pix_type *ptr1 = s; \ + const pix_type *ptr2 = ptr1 - src_stride; \ + const pix_type *ptr3 = ptr2 - src_stride; \ + const pix_type *ptr4 = ptr3 - src_stride; \ + for(x = 0; x < w; x += 4) { \ + pix_type s_array[4] = { *ptr1, *ptr2, *ptr3, *ptr4 }; \ + vst1q_u32(d, vld1q_u32(s_array)); \ + d += 4; \ + ptr1 -= klght; \ + ptr2 -= klght; \ + ptr3 -= klght; \ + ptr4 -= klght; \ + } \ + } \ } \ - else \ - { \ - for (y = 0; y < h; y++) \ - { \ - const pix_type *s = &(src[(src_stride * (w - 1)) + y]); \ - pix_type *d = &(dst[(dst_stride * y)]); \ - for (x = 0; x < w; x++) \ - { \ - *d++ = *s; \ - s += src_stride; \ - } \ - } \ - } \ - } \ - else -#else -#define ROT90_QUAD_COPY_LOOP(pix_type) -#define ROT270_QUAD_COPY_LOOP(pix_type) -#endif -#define FAST_SIMPLE_ROTATE(suffix, pix_type) \ - static void \ - blt_rotated_90_trivial_##suffix(pix_type * restrict dst, \ - int dst_stride, \ - const pix_type * restrict src, \ - int src_stride, \ - int w, \ - int h) \ - { \ - int x, y; \ - ROT90_QUAD_COPY_LOOP(pix_type) \ - { \ - for (y = 0; y < h; y++) \ - { \ - const pix_type *s = &(src[(h - y - 1)]); \ - pix_type *d = &(dst[(dst_stride * y)]); \ - for (x = 0; x < w; x++) \ - { \ - *d++ = *s; \ - s += src_stride; \ - } \ - } \ - } \ - } \ - static void \ - blt_rotated_270_trivial_##suffix(pix_type * restrict dst, \ - int dst_stride, \ - const pix_type * restrict src, \ - int src_stride, \ - int w, \ - int h) \ - { \ - int x, y; \ - ROT270_QUAD_COPY_LOOP(pix_type) \ - { \ - for(y = 0; y < h; y++) \ - { \ + else { \ + for (y = 0; y < h; y++) { \ const pix_type *s = &(src[(src_stride * (w - 1)) + y]); \ - pix_type *d = &(dst[(dst_stride * y)]); \ - for (x = 0; x < w; x++) \ - { \ + pix_type *d = &(dst[dst_stride * y]); \ + for (x = 0; x < w; x++) { \ *d++ = *s; \ s -= src_stride; \ } \ } \ } \ } \ + else +# else +# define ROT90_QUAD_COPY_LOOP(pix_type) +# define ROT270_QUAD_COPY_LOOP(pix_type) +# endif + +# define FAST_SIMPLE_ROTATE(suffix, pix_type) \ static void \ - blt_rotated_90_##suffix(pix_type * restrict dst, \ - int dst_stride, \ + blt_rotated_90_trivial_##suffix(pix_type * restrict dst, \ + int dst_stride, \ + const pix_type * restrict src, \ + int src_stride, \ + int w, \ + int h) \ + { \ + int x, y; \ + ROT90_QUAD_COPY_LOOP(pix_type) { \ + for (y = 0; y < h; y++) { \ + const pix_type *s = &(src[h - y - 1]); \ + pix_type *d = &(dst[dst_stride * y]); \ + for (x = 0; x < w; x++) { \ + *d++ = *s; \ + s += src_stride; \ + } \ + } \ + } \ + } \ + static void \ + blt_rotated_270_trivial_##suffix(pix_type * restrict dst, \ + int dst_stride, \ + const pix_type * restrict src, \ + int src_stride, \ + int w, \ + int h) \ + { \ + int x, y; \ + ROT270_QUAD_COPY_LOOP(pix_type) { \ + for (y = 0; y < h; y++) { \ + const pix_type *s = &(src[(src_stride * (w - 1)) + y]); \ + pix_type *d = &(dst[dst_stride * y]); \ + for (x = 0; x < w; x++) { \ + *d++ = *s; \ + s -= src_stride; \ + } \ + } \ + } \ + } \ + static void \ + blt_rotated_90_##suffix(pix_type * restrict dst, \ + int dst_stride, \ const pix_type * restrict src, \ - int src_stride, \ - int w, \ - int h) \ + int src_stride, \ + int w, \ + int h) \ { \ int x, leading_pixels = 0, trailing_pixels = 0; \ const int TILE_SIZE = TILE_CACHE_LINE_SIZE / sizeof(pix_type); \ - if ((uintptr_t)dst & (TILE_CACHE_LINE_SIZE - 1)) \ - { \ - leading_pixels = TILE_SIZE - \ - (((uintptr_t)dst & (TILE_CACHE_LINE_SIZE - 1)) / sizeof(pix_type)); \ - if (leading_pixels > w) \ - leading_pixels = w; \ - blt_rotated_90_trivial_##suffix(dst, \ - dst_stride, \ - src, \ - src_stride, \ - leading_pixels, \ - h); \ - dst += leading_pixels; \ - src += leading_pixels * src_stride; \ - w -= leading_pixels; \ - } \ - if ((uintptr_t)(dst + w) & (TILE_CACHE_LINE_SIZE - 1)) \ - { \ - trailing_pixels = (((uintptr_t)(dst + w) & \ - (TILE_CACHE_LINE_SIZE - 1)) / sizeof(pix_type)); \ - if (trailing_pixels > w) \ - trailing_pixels = w; \ - w -= trailing_pixels; \ - } \ - for (x = 0; x < w; x += TILE_SIZE) \ - { \ - blt_rotated_90_trivial_##suffix(dst + x, \ - dst_stride, \ - &(src[(src_stride * x)]), \ - src_stride, \ - TILE_SIZE, \ - h); \ - } \ + if ((uintptr_t)dst & (TILE_CACHE_LINE_SIZE - 1)) { \ + leading_pixels = TILE_SIZE - \ + (((uintptr_t)dst & (TILE_CACHE_LINE_SIZE - 1)) / sizeof(pix_type)); \ + if (leading_pixels > w) leading_pixels = w; \ + blt_rotated_90_trivial_##suffix(dst, \ + dst_stride, \ + src, \ + src_stride, \ + leading_pixels, \ + h); \ + dst += leading_pixels; \ + src += leading_pixels * src_stride; \ + w -= leading_pixels; \ + } \ + if ((uintptr_t)(dst + w) & (TILE_CACHE_LINE_SIZE - 1)) { \ + trailing_pixels = (((uintptr_t)(dst + w) & \ + (TILE_CACHE_LINE_SIZE - 1)) / sizeof(pix_type)); \ + if (trailing_pixels > w) trailing_pixels = w; \ + w -= trailing_pixels; \ + } \ + for (x = 0; x < w; x += TILE_SIZE) { \ + blt_rotated_90_trivial_##suffix(dst + x, \ + dst_stride, \ + &(src[src_stride * x]), \ + src_stride, \ + TILE_SIZE, \ + h); \ + } \ if (trailing_pixels) \ blt_rotated_90_trivial_##suffix(dst + w, \ dst_stride, \ - &(src[(w * src_stride)]), \ + &(src[src_stride * w]), \ src_stride, \ trailing_pixels, \ h); \ } \ static void \ - blt_rotated_270_##suffix(pix_type * restrict dst, \ - int dst_stride, \ + blt_rotated_270_##suffix(pix_type * restrict dst, \ + int dst_stride, \ const pix_type * restrict src, \ - int src_stride, \ - int w, \ - int h) \ + int src_stride, \ + int w, \ + int h) \ { \ int x, leading_pixels = 0, trailing_pixels = 0; \ const int TILE_SIZE = TILE_CACHE_LINE_SIZE / sizeof(pix_type); \ - if ((uintptr_t)dst & (TILE_CACHE_LINE_SIZE - 1)) \ - { \ - leading_pixels = TILE_SIZE - \ - (((uintptr_t)dst & (TILE_CACHE_LINE_SIZE - 1)) / sizeof(pix_type)); \ - if (leading_pixels > w) \ - leading_pixels = w; \ - blt_rotated_270_trivial_##suffix(dst, \ - dst_stride, \ - &(src[(src_stride * (w - leading_pixels))]), \ - src_stride, \ - leading_pixels, \ - h); \ - dst += leading_pixels; \ - w -= leading_pixels; \ - } \ - if ((uintptr_t)(dst + w) & (TILE_CACHE_LINE_SIZE - 1)) \ - { \ - trailing_pixels = (((uintptr_t)(dst + w) & \ - (TILE_CACHE_LINE_SIZE - 1)) / sizeof(pix_type)); \ - if (trailing_pixels > w) \ - trailing_pixels = w; \ - w -= trailing_pixels; \ - src += trailing_pixels * src_stride; \ - } \ - for (x = 0; x < w; x += TILE_SIZE) \ - { \ - blt_rotated_270_trivial_##suffix(dst + x, \ - dst_stride, \ - &(src[(src_stride * (w - x - TILE_SIZE))]), \ - src_stride, \ - TILE_SIZE, \ - h); \ - } \ + if ((uintptr_t)dst & (TILE_CACHE_LINE_SIZE - 1)) { \ + leading_pixels = TILE_SIZE - \ + (((uintptr_t)dst & (TILE_CACHE_LINE_SIZE - 1)) / sizeof(pix_type)); \ + if (leading_pixels > w) leading_pixels = w; \ + blt_rotated_270_trivial_##suffix(dst, \ + dst_stride, \ + &(src[src_stride * (w - leading_pixels)]), \ + src_stride, \ + leading_pixels, \ + h); \ + dst += leading_pixels; \ + w -= leading_pixels; \ + } \ + if ((uintptr_t)(dst + w) & (TILE_CACHE_LINE_SIZE - 1)) { \ + trailing_pixels = (((uintptr_t)(dst + w) & \ + (TILE_CACHE_LINE_SIZE - 1)) / sizeof(pix_type)); \ + if (trailing_pixels > w) trailing_pixels = w; \ + w -= trailing_pixels; \ + src += trailing_pixels * src_stride; \ + } \ + for (x = 0; x < w; x += TILE_SIZE) { \ + blt_rotated_270_trivial_##suffix(dst + x, \ + dst_stride, \ + &(src[src_stride * (w - x - TILE_SIZE)]), \ + src_stride, \ + TILE_SIZE, \ + h); \ + } \ if (trailing_pixels) \ blt_rotated_270_trivial_##suffix(dst + w, \ dst_stride, \ @@ -288,12 +263,13 @@ void evas_common_convert_rgba_to_32bpp_rgb_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x EINA_UNUSED, int dith_y EINA_UNUSED, DATA8 *pal EINA_UNUSED) { #ifdef TILE_ROTATE - blt_rotated_270_8888((DATA8 *)dst, dst_jump+w, (const DATA8 *)src, src_jump+h, w, h) ; + blt_rotated_270_8888((DATA32 *)dst, dst_jump + w, + src, src_jump + h, + w, h); #else - DATA32 *src_ptr; - DATA32 *dst_ptr; + DATA32 *src_ptr *dst_ptr; int x, y; - + dst_ptr = (DATA32 *)dst; CONVERT_LOOP_START_ROT_270(); @@ -305,15 +281,32 @@ evas_common_convert_rgba_to_32bpp_rgb_8888_rot_270 (DATA32 *src, DATA8 *dst, int return; } +/* speed measuring code - enable when optimizing to compare +#include +static double +get_time(void) +{ + struct timespec t; + + clock_gettime(CLOCK_MONOTONIC, &t); + return (double)t.tv_sec + (((double)t.tv_nsec) / 1000000000.0); +} +*/ + void evas_common_convert_rgba_to_32bpp_rgb_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x EINA_UNUSED, int dith_y EINA_UNUSED, DATA8 *pal EINA_UNUSED) { +/* + static double tt = 0.0; + static unsigned long long pt = 0; + double t0 = get_time(); + */ #ifdef TILE_ROTATE - blt_rotated_90_8888((DATA8 *)dst, dst_jump+w, (const DATA8 *)src, src_jump+h, w, h) ; + blt_rotated_90_8888((DATA32 *)dst, dst_jump + w, + src, src_jump + h, + w, h); #else -# ifndef BUILD_NEON - DATA32 *src_ptr; - DATA32 *dst_ptr; + DATA32 *src_ptr, *dst_ptr; int x, y; dst_ptr = (DATA32 *)dst; @@ -322,117 +315,19 @@ evas_common_convert_rgba_to_32bpp_rgb_8888_rot_90 (DATA32 *src, DATA8 *dst, int *dst_ptr = *src_ptr; CONVERT_LOOP_END_ROT_90(); -# elif defined BUILD_NEON_INTRINSICS - DATA32 *src_ptr; - DATA32 *dst_ptr; - int x, y; - - dst_ptr = (DATA32 *)dst; - CONVERT_LOOP_START_ROT_90(); - - *dst_ptr = *src_ptr; - - CONVERT_LOOP_END_ROT_90(); -# else - if ((w & 1) || (h & 1)) - { - /* Rarely (if ever) if ever: so slow path is fine */ - DATA32 *src_ptr; - DATA32 *dst_ptr; - int x, y; - - dst_ptr = (DATA32 *)dst; - CONVERT_LOOP_START_ROT_90(); - - *dst_ptr = *src_ptr; - - CONVERT_LOOP_END_ROT_90(); - } - else - { -# define AP "convert_rgba32_rot_90_" - asm volatile ( - ".fpu neon \n\t" - " mov %[s1], %[src] \n\t" - " add %[s1], %[s1], %[h],lsl #2 \n\t" - " sub %[s1], #8 \n\t" - - " mov %[s2], %[src] \n\t" - " add %[s2], %[s2], %[h], lsl #3 \n\t" - " add %[s2], %[s2], %[sjmp], lsr #1 \n\t" - " sub %[s2], #8 \n\t" - - " mov %[d1], %[dst] \n\t" - - " add %[d2], %[d1], %[djmp] \n\t" - " add %[d2], %[d2], %[w], lsl #2 \n\t" - - " mov %[sadv], %[h], lsl #3 \n\t" - " add %[sadv], %[sadv], %[sjmp], lsl #1\n\t" - - " mov %[y], #0 \n\t" - " mov %[x], #0 \n\t" - AP"loop: \n\t" - " vld1.u32 d0, [%[s1]] \n\t" - " vld1.u32 d1, [%[s2]] \n\t" - " add %[x], #2 \n\t" - " add %[s1], %[sadv] \n\t" - " add %[s2], %[sadv] \n\t" - " vtrn.u32 d0, d1 \n\t" - " cmp %[x], %[w] \n\t" - " vst1.u32 d1, [%[d1]]! \n\t" - " vst1.u32 d0, [%[d2]]! \n\t" - " blt "AP"loop \n\t" - - " mov %[x], #0 \n\t" - " add %[d1], %[djmp] \n\t" - " add %[d1], %[d1], %[w], lsl #2 \n\t" - " add %[d2], %[djmp] \n\t" - " add %[d2], %[d2], %[w], lsl #2 \n\t" - - " mov %[s1], %[src] \n\t" - " add %[s1], %[s1], %[h], lsl #2 \n\t" - " sub %[s1], %[s1], %[y], lsl #2 \n\t" - " sub %[s1], #16 \n\t" - - " add %[s2], %[s1], %[h], lsl #2 \n\t" - " add %[s2], %[s2], %[sjmp], lsl #2 \n\t" - - " add %[y], #2 \n\t" - - " cmp %[y], %[h] \n\t" - " blt "AP"loop \n\t" - - : // Out - : [s1] "r" (1), - [s2] "r" (11), - [d1] "r" (2), - [d2] "r" (12), - [src] "r" (src), - [dst] "r" (dst), - [x] "r" (3), - [y] "r" (4), - [w] "r" (w), - [h] "r" (h), - [sadv] "r" (5), - [sjmp] "r" (src_jump * 4), - [djmp] "r" (dst_jump * 4 * 2) - : "d0", "d1", "memory", "cc"// Clober - - - ); - } -# undef AP -# endif #endif - return; +/* + double t1 = get_time(); + tt += t1 - t0; + pt += (w * h); + printf("%1.2f mpix/sec (%1.9f @ %1.9f)\n", (double)pt / (tt * 1000000), tt, t1); +*/ } void evas_common_convert_rgba_to_32bpp_rgbx_8888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x EINA_UNUSED, int dith_y EINA_UNUSED, DATA8 *pal EINA_UNUSED) { - DATA32 *src_ptr; - DATA32 *dst_ptr; + DATA32 *src_ptr, *dst_ptr; int x, y; dst_ptr = (DATA32 *)dst; @@ -449,8 +344,7 @@ evas_common_convert_rgba_to_32bpp_rgbx_8888 (DATA32 *src, DATA8 *dst, int src_ju void evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x EINA_UNUSED, int dith_y EINA_UNUSED, DATA8 *pal EINA_UNUSED) { - DATA32 *src_ptr; - DATA32 *dst_ptr; + DATA32 *src_ptr, *dst_ptr; int x, y; dst_ptr = (DATA32 *)dst; @@ -467,8 +361,7 @@ evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_180 (DATA32 *src, DATA8 *dst, in void evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x EINA_UNUSED, int dith_y EINA_UNUSED, DATA8 *pal EINA_UNUSED) { - DATA32 *src_ptr; - DATA32 *dst_ptr; + DATA32 *src_ptr, *dst_ptr; int x, y; dst_ptr = (DATA32 *)dst; @@ -485,8 +378,7 @@ evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_270 (DATA32 *src, DATA8 *dst, in void evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x EINA_UNUSED, int dith_y EINA_UNUSED, DATA8 *pal EINA_UNUSED) { - DATA32 *src_ptr; - DATA32 *dst_ptr; + DATA32 *src_ptr, *dst_ptr; int x, y; dst_ptr = (DATA32 *)dst; @@ -503,8 +395,7 @@ evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_90 (DATA32 *src, DATA8 *dst, int void evas_common_convert_rgba_to_32bpp_bgr_8888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x EINA_UNUSED, int dith_y EINA_UNUSED, DATA8 *pal EINA_UNUSED) { - DATA32 *src_ptr; - DATA32 *dst_ptr; + DATA32 *src_ptr, *dst_ptr; int x, y; dst_ptr = (DATA32 *)dst; @@ -520,8 +411,7 @@ evas_common_convert_rgba_to_32bpp_bgr_8888 (DATA32 *src, DATA8 *dst, int src_jum void evas_common_convert_rgba_to_32bpp_bgr_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x EINA_UNUSED, int dith_y EINA_UNUSED, DATA8 *pal EINA_UNUSED) { - DATA32 *src_ptr; - DATA32 *dst_ptr; + DATA32 *src_ptr, *dst_ptr; int x, y; dst_ptr = (DATA32 *)dst; @@ -537,8 +427,7 @@ evas_common_convert_rgba_to_32bpp_bgr_8888_rot_180 (DATA32 *src, DATA8 *dst, int void evas_common_convert_rgba_to_32bpp_bgr_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x EINA_UNUSED, int dith_y EINA_UNUSED, DATA8 *pal EINA_UNUSED) { - DATA32 *src_ptr; - DATA32 *dst_ptr; + DATA32 *src_ptr, *dst_ptr; int x, y; dst_ptr = (DATA32 *)dst; @@ -554,8 +443,7 @@ evas_common_convert_rgba_to_32bpp_bgr_8888_rot_270 (DATA32 *src, DATA8 *dst, int void evas_common_convert_rgba_to_32bpp_bgr_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x EINA_UNUSED, int dith_y EINA_UNUSED, DATA8 *pal EINA_UNUSED) { - DATA32 *src_ptr; - DATA32 *dst_ptr; + DATA32 *src_ptr, *dst_ptr; int x, y; dst_ptr = (DATA32 *)dst; @@ -571,8 +459,7 @@ evas_common_convert_rgba_to_32bpp_bgr_8888_rot_90 (DATA32 *src, DATA8 *dst, int void evas_common_convert_rgba_to_32bpp_bgrx_8888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x EINA_UNUSED, int dith_y EINA_UNUSED, DATA8 *pal EINA_UNUSED) { - DATA32 *src_ptr; - DATA32 *dst_ptr; + DATA32 *src_ptr, *dst_ptr; int x, y; dst_ptr = (DATA32 *)dst; @@ -588,8 +475,7 @@ evas_common_convert_rgba_to_32bpp_bgrx_8888 (DATA32 *src, DATA8 *dst, int src_ju void evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x EINA_UNUSED, int dith_y EINA_UNUSED, DATA8 *pal EINA_UNUSED) { - DATA32 *src_ptr; - DATA32 *dst_ptr; + DATA32 *src_ptr, *dst_ptr; int x, y; dst_ptr = (DATA32 *)dst; @@ -605,8 +491,7 @@ evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_180 (DATA32 *src, DATA8 *dst, in void evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x EINA_UNUSED, int dith_y EINA_UNUSED, DATA8 *pal EINA_UNUSED) { - DATA32 *src_ptr; - DATA32 *dst_ptr; + DATA32 *src_ptr, *dst_ptr; int x, y; dst_ptr = (DATA32 *)dst; @@ -622,8 +507,7 @@ evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_270 (DATA32 *src, DATA8 *dst, in void evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x EINA_UNUSED, int dith_y EINA_UNUSED, DATA8 *pal EINA_UNUSED) { - DATA32 *src_ptr; - DATA32 *dst_ptr; + DATA32 *src_ptr, *dst_ptr; int x, y; dst_ptr = (DATA32 *)dst; @@ -639,8 +523,7 @@ evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_90 (DATA32 *src, DATA8 *dst, int void evas_common_convert_rgba_to_32bpp_rgb_666(DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x EINA_UNUSED, int dith_y EINA_UNUSED, DATA8 *pal EINA_UNUSED) { - DATA32 *src_ptr; - DATA32 *dst_ptr; + DATA32 *src_ptr, *dst_ptr; int x, y; dst_ptr = (DATA32 *)dst; diff --git a/src/lib/evas/common/evas_convert_yuv.c b/src/lib/evas/common/evas_convert_yuv.c index d199ec5aa5..ee753d1961 100644 --- a/src/lib/evas/common/evas_convert_yuv.c +++ b/src/lib/evas/common/evas_convert_yuv.c @@ -1622,9 +1622,10 @@ _evas_nv12torgb_raster(unsigned char **yuv, unsigned char *rgb, int w, int h) unsigned char *yp1, *yp2, *up, *vp; unsigned char *dp1; unsigned char *dp2; + int stride = sizeof(DATA32) * w; dp1 = rgb; - dp2 = dp1 + sizeof (int) * w; + dp2 = dp1 + stride; for (yy = 0; yy < h; yy++) { @@ -1646,8 +1647,8 @@ _evas_nv12torgb_raster(unsigned char **yuv, unsigned char *rgb, int w, int h) } /* jump one line */ - dp1 += sizeof (int) * w; - dp2 += sizeof (int) * w; + dp1 += stride; + dp2 += stride; } } diff --git a/src/lib/evas/common/evas_font.h b/src/lib/evas/common/evas_font.h index 246fe5a3cb..ab6e6fbd17 100644 --- a/src/lib/evas/common/evas_font.h +++ b/src/lib/evas/common/evas_font.h @@ -265,9 +265,6 @@ struct _RGBA_Font_Int in order to comply with the wanted_rend. */ Eina_List *task; -#ifdef EVAS_CSERVE2 - void *cs2_handler; -#endif int generation; diff --git a/src/lib/evas/common/evas_map_image.c b/src/lib/evas/common/evas_map_image.c index 05c8e600f2..115e77cafd 100644 --- a/src/lib/evas/common/evas_map_image.c +++ b/src/lib/evas/common/evas_map_image.c @@ -84,8 +84,6 @@ _interpolated_clip_span(Span *s, int c1, int c2, Eina_Bool interp_col) } } -#include "evas_map_image_aa.c" - // 12.63 % of time - this can improve static void _calc_spans(RGBA_Map_Point *p, Line *spans, int ystart, int yend, int cx, int cy EINA_UNUSED, int cw, int ch EINA_UNUSED) @@ -653,6 +651,7 @@ evas_common_map_rgba_prepare(RGBA_Image *src, RGBA_Image *dst, # undef SCALE_USING_NEON #endif +#include "evas_map_image_internal_high.c" #ifdef BUILD_MMX void evas_common_map_rgba_internal_mmx(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Map_Point *p, int smooth, int level) @@ -684,6 +683,34 @@ void evas_common_map_rgba_internal_mmx(RGBA_Image *src, RGBA_Image *dst, RGBA_Dr } #endif +void evas_common_map_rgba_internal_high(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Map_Point *p, int smooth, int level) +{ + int clip_x, clip_y, clip_w, clip_h; + DATA32 mul_col; + + if (dc->clip.use) + { + clip_x = dc->clip.x; + clip_y = dc->clip.y; + clip_w = dc->clip.w; + clip_h = dc->clip.h; + } + else + { + clip_x = clip_y = 0; + clip_w = dst->cache_entry.w; + clip_h = dst->cache_entry.h; + } + + mul_col = dc->mul.use ? dc->mul.col : 0xffffffff; + + _evas_common_map_rgba_internal_high(src, dst, + clip_x, clip_y, clip_w, clip_h, + mul_col, dc->render_op, + p, smooth, dc->anti_alias, level, + dc->clip.mask, dc->clip.mask_x, dc->clip.mask_y); +} + void evas_common_map_rgba_internal(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Map_Point *p, int smooth, int level) { int clip_x, clip_y, clip_w, clip_h; @@ -832,24 +859,32 @@ evas_common_map_thread_rgba_cb(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Conte EAPI void evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, - int npoints EINA_UNUSED, RGBA_Map_Point *p, + int npoints, RGBA_Map_Point *p, int smooth, int level) { Evas_Common_Map_RGBA_Cb cb; -#ifdef BUILD_MMX - int mmx, sse, sse2; - evas_common_cpu_can_do(&mmx, &sse, &sse2); - if (mmx) - cb = evas_common_map_rgba_internal_mmx; + if (dc->anti_alias && smooth) + { + cb = evas_common_map_rgba_internal_high; + } else + { +#ifdef BUILD_MMX + int mmx, sse, sse2; + + evas_common_cpu_can_do(&mmx, &sse, &sse2); + if (mmx) + cb = evas_common_map_rgba_internal_mmx; + else #endif #ifdef BUILD_NEON - if (evas_common_cpu_has_feature(CPU_FEATURE_NEON)) - cb = evas_common_map_rgba_internal_neon; - else + if (evas_common_cpu_has_feature(CPU_FEATURE_NEON)) + cb = evas_common_map_rgba_internal_neon; + else #endif - cb = evas_common_map_rgba_internal; + cb = evas_common_map_rgba_internal; + } evas_common_map_rgba_cb(src, dst, dc, npoints, p, smooth, level, cb); } @@ -857,6 +892,17 @@ evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst, EAPI void evas_common_map_rgba_draw(RGBA_Image *src, RGBA_Image *dst, int clip_x, int clip_y, int clip_w, int clip_h, DATA32 mul_col, int render_op, int npoints EINA_UNUSED, RGBA_Map_Point *p, int smooth, Eina_Bool anti_alias, int level, RGBA_Image *mask_ie, int mask_x, int mask_y) { + //The best quaility requsted. + if (anti_alias && smooth) + { + _evas_common_map_rgba_internal_high(src, dst, + clip_x, clip_y, clip_w, clip_h, + mul_col, render_op, + p, smooth, anti_alias, level, + mask_ie, mask_x, mask_y); + } + else + { #ifdef BUILD_MMX int mmx, sse, sse2; @@ -883,6 +929,7 @@ evas_common_map_rgba_draw(RGBA_Image *src, RGBA_Image *dst, int clip_x, int clip mul_col, render_op, p, smooth, anti_alias, level, mask_ie, mask_x, mask_y); + } } EAPI void diff --git a/src/lib/evas/common/evas_map_image_aa.c b/src/lib/evas/common/evas_map_image_aa.c deleted file mode 100644 index 3a99c1e6c5..0000000000 --- a/src/lib/evas/common/evas_map_image_aa.c +++ /dev/null @@ -1,245 +0,0 @@ -#define PUSH_EDGE_POINT() \ -do \ -{ \ - p_edge.x = spans[y].span[0].x[eidx]; \ - p_edge.y = y; \ - ptx[0] = tx[0]; \ - ptx[1] = tx[1]; \ -} while (0) - -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); - } -} - -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); - } -} - -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, Eina_Bool src_alpha) -{ - //Left Edge Anti Anliasing - if ((w - line->aa_len[0]) < ww) - { - return MUL_256((line->aa_cov[0] * (w - ww + 1)), val); - } - //Right Edge Anti Aliasing - if (line->aa_len[1] >= ww) - { - 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; -} - -/* - * To understand here AA main logic, - * Please refer this page: hermet.pe.kr/122?catgory=662934 -*/ -static void -_calc_aa_edges_internal(Line *spans, int eidx, int ystart, int yend) -{ - int y; - Evas_Coord_Point p_edge = {-1, -1}; //previous edge point - Evas_Coord_Point edge_diff = {0, 0}; //temporary used for point distance - - /* 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 - -//Previous edge direction: -#define DirOutHor 0x0011 -#define DirOutVer 0x0001 -#define DirInHor 0x0010 -#define DirInVer 0x0000 -#define DirNone 0x1000 - - int prev_dir = DirNone; - int cur_dir = DirNone; - - yend -= ystart; - - //Find Start Edge - for (y = 0; y < yend; y++) - { - if (spans[y].span[0].x[0] == -1) continue; - p_edge.x = spans[y].span[0].x[eidx]; - p_edge.y = y; - break; - } - - //Calculates AA Edges - for (y++; y < yend; y++) - { - //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; - } - - edge_diff.x = (tx[0] - tx[1]); - edge_diff.y = (y - p_edge.y); - - //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; - - //straight diagonal increase - if ((cur_dir == prev_dir) && (y < yend)) - { - if ((abs(edge_diff.x) == 1) && (edge_diff.y == 1)) - { - ++diagonal; - PUSH_EDGE_POINT(); - continue; - } - } - switch (cur_dir) - { - 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; - } - - //leftovers...? - if ((edge_diff.y == 1) && (edge_diff.x != 0)) - { - 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 -_calc_aa_edges(Line *spans, int ystart, int yend) -{ - //FIXME: support 2 span case. - - //left side - _calc_aa_edges_internal(spans, 0, ystart, yend); - //right side - _calc_aa_edges_internal(spans, 1, ystart, yend); -} diff --git a/src/lib/evas/common/evas_map_image_internal.c b/src/lib/evas/common/evas_map_image_internal.c index b458dff675..04eff08770 100644 --- a/src/lib/evas/common/evas_map_image_internal.c +++ b/src/lib/evas/common/evas_map_image_internal.c @@ -1,10 +1,11 @@ + // 66.74 % of time static void FUNC_NAME(RGBA_Image *src, RGBA_Image *dst, int clip_x, int clip_y, int clip_w, int clip_h, DATA32 mul_col, int render_op, RGBA_Map_Point *p, - int smooth, int anti_alias, int level EINA_UNUSED, // level unused for now - for future use + int smooth, int anti_alias EINA_UNUSED, int level EINA_UNUSED, // level unused for now - for future use RGBA_Image *mask_ie, int mask_x, int mask_y) { int i; @@ -83,9 +84,6 @@ FUNC_NAME(RGBA_Image *src, RGBA_Image *dst, // calculate the spans list _calc_spans(p, spans, ystart, yend, cx, cy, cw, ch); - // calculate anti alias edges - if (anti_alias) _calc_aa_edges(spans, ystart, yend); - // walk through spans and render // if operation is solid, bypass buf and draw func and draw direct to dst @@ -96,7 +94,7 @@ FUNC_NAME(RGBA_Image *src, RGBA_Image *dst, pixels composition. we can optimize it. */ if ((!sa) && (!da) && - (mul_col == 0xffffffff) && (!havea) && (!anti_alias) && (!mask_ie)) + (mul_col == 0xffffffff) && (!havea) && (!mask_ie)) { direct = 1; } @@ -105,7 +103,7 @@ FUNC_NAME(RGBA_Image *src, RGBA_Image *dst, buf = alloca(cw * sizeof(DATA32)); if (havea) sa = EINA_TRUE; - saa = (anti_alias | sa); + saa = sa; if (!mask_ie) { @@ -138,7 +136,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, int level EINA_UNUSED) // level unused for now - for future use + int smooth, int anti_alias EINA_UNUSED, int level EINA_UNUSED) // level unused for now - for future use { Line *spans; DATA32 *buf = NULL, *sp; @@ -191,7 +189,7 @@ FUNC_NAME_DO(RGBA_Image *src, RGBA_Image *dst, buf = alloca(cw * sizeof(DATA32)); if (ms->havea) sa = EINA_TRUE; - saa = (anti_alias | sa); + saa = sa; if (!mask_ie) { diff --git a/src/lib/evas/common/evas_map_image_internal_high.c b/src/lib/evas/common/evas_map_image_internal_high.c new file mode 100644 index 0000000000..0fd3ce40a7 --- /dev/null +++ b/src/lib/evas/common/evas_map_image_internal_high.c @@ -0,0 +1,904 @@ +typedef struct +{ + float x, y, u, v; + DATA32 c; +} Map_Vertex; + +typedef struct +{ + Map_Vertex v[3]; +} Map_Tripoly; + +typedef struct AALine +{ + int x[2]; + int aa_cov[2]; + int aa_len[2]; +} AALine; + +typedef struct AASpans +{ + AALine *lines; + int ystart; + int yend; +} AASpans; + +static float dudx, dvdx, dcdx[4]; +static float dxdya, dxdyb, dudya, dvdya, dcdya[4]; +static float xa, xb, ua, va, ca[4]; + +#define SWAP(a, b, tmp) \ + tmp = a; \ + a = b; \ + b = tmp + +/************************** ANTI-ALIASING CODE ********************************/ +static void +_map_irregular_coverage_calc(AALine* spans, int eidx, int y, int diagonal, + int edge_dist, Eina_Bool reverse) +{ + if (eidx == 1) reverse = !reverse; + int coverage = (255 / (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] = 255 - (coverage * ry); + else spans[tmp].aa_cov[eidx] = (coverage * ry); + } +} + +static void +_map_vert_coverage_calc(AALine *spans, int eidx, int y, int rewind, Eina_Bool reverse) +{ + if (eidx == 1) reverse = !reverse; + int coverage = (255 / (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] = (255 - (coverage * ry)); + else spans[tmp].aa_cov[eidx] = (coverage * ry); + } +} + +static void +_map_horiz_coverage_calc(AALine *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] = (255 / (spans[y].aa_len[eidx] + 1)); + } +} + +/* + * To understand here AA main logic, + * Please refer this page: www.hermet.pe.kr/122 +*/ +static void +_map_aa_edge_calc_internal(AALine *spans, int eidx, int ystart, int yend) +{ + int y; + Evas_Coord_Point p_edge = {-1, -1}; //previous edge point + Evas_Coord_Point edge_diff = {0, 0}; //temporary used for point distance + + /* 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 + +//Previous edge direction: +#define DirOutHor 0x0011 +#define DirOutVer 0x0001 +#define DirInHor 0x0010 +#define DirInVer 0x0000 +#define DirNone 0x1000 + +#define PUSH_VERTEX() \ +do \ +{ \ + p_edge.x = spans[y].x[eidx]; \ + p_edge.y = y; \ + ptx[0] = tx[0]; \ + ptx[1] = tx[1]; \ +} while (0) + + int prev_dir = DirNone; + int cur_dir = DirNone; + + yend -= ystart; + + //Find Start Edge + for (y = 0; y < yend; y++) + { + p_edge.x = spans[y].x[eidx]; + p_edge.y = y; + break; + } + + //Calculates AA Edges + for (y++; y < yend; y++) + { + //Ready tx + if (eidx == 0) + { + tx[0] = p_edge.x; + tx[1] = spans[y].x[0]; + } + else + { + tx[0] = spans[y].x[1]; + tx[1] = p_edge.x; + } + + edge_diff.x = (tx[0] - tx[1]); + edge_diff.y = (y - p_edge.y); + + //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; + + //straight diagonal increase + if ((cur_dir == prev_dir) && (y < yend)) + { + if ((abs(edge_diff.x) == 1) && (edge_diff.y == 1)) + { + ++diagonal; + PUSH_VERTEX(); + continue; + } + } + switch (cur_dir) + { + case DirOutHor: + { + _map_horiz_coverage_calc(spans, eidx, y, tx[0], tx[1]); + if (diagonal > 0) + { + _map_irregular_coverage_calc(spans, eidx, y, diagonal, 0, + EINA_TRUE); + diagonal = 0; + } + /* Increment direction is changed: + Outside Vertical -> Outside Horizontal */ + if (prev_dir == DirOutVer) + _map_horiz_coverage_calc(spans, eidx, p_edge.y, ptx[0], ptx[1]); + + //Trick, but fine-tunning! + if (y == 1) + _map_horiz_coverage_calc(spans, eidx, p_edge.y, tx[0], tx[1]); + + PUSH_VERTEX(); + } + break; + case DirOutVer: + { + _map_vert_coverage_calc(spans, eidx, y, edge_diff.y, EINA_TRUE); + if (diagonal > 0) + { + _map_irregular_coverage_calc(spans, eidx, y, diagonal, + edge_diff.y, EINA_FALSE); + diagonal = 0; + } + /* Increment direction is changed: + Outside Horizontal -> Outside Vertical */ + if (prev_dir == DirOutHor) + _map_horiz_coverage_calc(spans, eidx, p_edge.y, ptx[0], ptx[1]); + PUSH_VERTEX(); + } + break; + case DirInHor: + { + _map_horiz_coverage_calc(spans, eidx, (y - 1), tx[0], tx[1]); + if (diagonal > 0) + { + _map_irregular_coverage_calc(spans, eidx, y, diagonal, 0, + EINA_FALSE); + diagonal = 0; + } + /* Increment direction is changed: + Outside Horizontal -> Inside Horizontal */ + if (prev_dir == DirOutHor) + _map_horiz_coverage_calc(spans, eidx, p_edge.y, ptx[0], ptx[1]); + PUSH_VERTEX(); + } + break; + case DirInVer: + { + _map_vert_coverage_calc(spans, eidx, y, edge_diff.y, EINA_FALSE); + if (diagonal > 0) + { + _map_irregular_coverage_calc(spans, eidx, y, diagonal, + edge_diff.y, EINA_TRUE); + diagonal = 0; + } + /* Increment direction is changed: + Outside Horizontal -> Inside Vertical */ + if (prev_dir == DirOutHor) + _map_horiz_coverage_calc(spans, eidx, p_edge.y, ptx[0], ptx[1]); + PUSH_VERTEX(); + } + break; + } + if (cur_dir != DirNone) prev_dir = cur_dir; + } + + //leftovers...? + if ((edge_diff.y == 1) && (edge_diff.x != 0)) + { + if (y >= yend) y = (yend - 1); + _map_horiz_coverage_calc(spans, eidx, y - 1, ptx[0], ptx[1]); + _map_horiz_coverage_calc(spans, eidx, y, tx[0], tx[1]); + } + else + { + ++y; + if (y > yend) y = yend; + _map_vert_coverage_calc(spans, eidx, y, (edge_diff.y + 1), + (prev_dir & 0x00000001)); + } +} + +static void +_map_aa_edges_calc(AALine *spans, int ystart, int yend) +{ + //FIXME: support more than 2 span case. + + //left side + _map_aa_edge_calc_internal(spans, 0, ystart, yend); + //right side + _map_aa_edge_calc_internal(spans, 1, ystart, yend); +} + +static AASpans * +_map_aa_ready(int dw, int dh, int ystart, int yend) +{ + AASpans *aa_spans = (AASpans *) malloc(sizeof(AASpans)); + if (!aa_spans) return NULL; + + aa_spans->lines = (AALine*) calloc(sizeof(AALine), dh); + for (int i = 0; i < dh; i++) + { + aa_spans->lines[i].x[0] = dw + 1; + aa_spans->lines[i].x[1] = -1; + } + aa_spans->ystart = (int) ystart; + aa_spans->yend = (int) yend; + + return aa_spans; +} + +static void +_map_aa_apply(AASpans *aa_spans, DATA32 *dst, int dw) +{ + int y = aa_spans->ystart; + int yend = aa_spans->yend; + AALine *line; + DATA32 *buf; + DATA32 d; + int w, offset, pos; + + _map_aa_edges_calc(aa_spans->lines, y, yend); + + while (y < yend) + { + line = &aa_spans->lines[y - aa_spans->ystart]; + w = line->x[1] - line->x[0]; + if (w > 0) + { + offset = y * dw; + + //Left edge + buf = dst + (offset + line->x[0]); + if (line->x[0] > 1) d = *(dst + (offset + (line->x[0] - 1))); + else d = *buf; + pos = 1; + while (pos <= line->aa_len[0]) + { + *buf = INTERP_256((line->aa_cov[0] * pos), *buf, d); + ++buf; + ++pos; + } + + //Right edge + buf = dst + (offset + line->x[1] - 1); + if (line->x[1] < (dw - 1)) d = *(dst + (offset + (line->x[1] + 1))); + else d = *buf; + pos = w; + while (w - line->aa_len[1] < pos) + { + *buf = INTERP_256(255 - (line->aa_cov[1] * (line->aa_len[1] - (w - pos))), *buf, d); + buf--; + pos--; + } + } + y++; + } + + free(aa_spans->lines); + free(aa_spans); +} + +/************************** TEXTURE MAPPING CODE ******************************/ +static void +_map_triangle_draw_linear(RGBA_Image *src, RGBA_Image *dst, + int cx, int cy, int cw, int ch, + RGBA_Image *mask, int mx, int my, + int ystart, int yend, + DATA32 *tbuf, RGBA_Gfx_Func func, RGBA_Gfx_Func func2, + DATA32 mul_col, AASpans *aa_spans, + Eina_Bool col_blend) +{ + float _dudx = dudx, _dvdx = dvdx; + float _dxdya = dxdya, _dxdyb = dxdyb, _dudya = dudya, _dvdya = dvdya; + float _xa = xa, _xb = xb, _ua = ua, _va = va; + DATA32 *sbuf = src->image.data; + DATA32 *dbuf = dst->image.data; + int sw = src->cache_entry.w; + int sh = src->cache_entry.h; + int dw = dst->cache_entry.w; + int x1, x2, x, y, uu, vv, ar, ab, iru, irv, px, ay; + float dx, u, v, iptr; + float _dcdx[4], _dcdya[4], _ca[4]; + float c[4] = {0, 0, 0, 0}; + DATA32 *buf, *tmp; + DATA8 *mbuf; + + //Range exception handling + if (ystart >= (cy + ch)) return; + if (ystart < cy) ystart = cy; + if (yend > (cy + ch)) yend = (cy + ch); + + if (col_blend) + for (int i = 0; i < 4; i++) + { + _dcdx[i] = dcdx[i]; + _dcdya[i] = dcdya[i]; + _ca[i] = ca[i]; + } + + //Loop through all lines in the segment + y = ystart; + while (y < yend) + { + x1 = _xa; + x2 = _xb; + + //Range exception handling + if (x1 < cx) x1 = cx; + if (x2 > (cx + cw)) x2 = (cx + cw); + + if (aa_spans) + { + ay = y - aa_spans->ystart; + if (aa_spans->lines[ay].x[0] > x1) aa_spans->lines[ay].x[0] = x1; + if (aa_spans->lines[ay].x[1] < x2) aa_spans->lines[ay].x[1] = x2; + } + + if ((x2 - x1) < 1) goto next; + + //Perform subtexel pre-stepping on UV + dx = 1 - (_xa - x1); + u = _ua + dx * _dudx; + v = _va + dx * _dvdx; + + if (col_blend) + { + c[0] = _ca[0] + dx * _dcdx[0]; + c[1] = _ca[1] + dx * _dcdx[1]; + c[2] = _ca[2] + dx * _dcdx[2]; + c[3] = _ca[3] + dx * _dcdx[3]; + } + + //Direct draw or blending intervention? + if (tbuf) buf = tbuf; + else buf = dbuf + ((y * dw) + x1); + + x = x1; + + //Draw horizontal line + while (x++ < x2) + { + uu = (int) u; + vv = (int) v; + + //Range exception handling + //OPTIMIZE ME, handle in advance? + if (uu >= sw) uu = sw - 1; + if (vv >= sh) vv = sh - 1; + + ar = (int)(255 * (1 - modff(u, &iptr))); + ab = (int)(255 * (1 - modff(v, &iptr))); + iru = uu + 1; + irv = vv + 1; + px = *(sbuf + (vv * sw) + uu); + + //horizontal interpolate + if (iru < sw) + { + //right pixel + int px2 = *(sbuf + (vv * sw) + iru); + px = INTERP_256(ar, px, px2); + } + //vertical interpolate + if (irv < sh) + { + //bottom pixel + int px2 = *(sbuf + (irv * sw) + uu); + + //horizontal interpolate + if (iru < sw) + { + //bottom right pixel + int px3 = *(sbuf + (irv * sw) + iru); + px2 = INTERP_256(ar, px2, px3); + } + px = INTERP_256(ab, px, px2); + } + + if (!col_blend) + { + *(buf++) = px; + } + //Vertex Color Blending + else + { + DATA32 tmp = (((int) c[0]) << 24) | (((int) c[1]) << 16) | (((int) c[2]) << 8) | ((int) c[3]); + *(buf++) = MUL4_SYM(tmp, px); + c[0] += _dcdx[0]; + c[1] += _dcdx[1]; + c[2] += _dcdx[2]; + c[3] += _dcdx[3]; + } + + //Step UV horizontally + u += _dudx; + v += _dvdx; + } + + if (tbuf) + { + tmp = dbuf + ((y *dw) + x1); + int len = x2 - x1; + if (!mask) func(tbuf, NULL, mul_col, tmp, len); + else + { + mbuf = mask->image.data8 + + (y - my) * mask->cache_entry.w + (x1 - mx); + if (mul_col != 0xffffffff) + func2(tbuf, NULL, mul_col, tbuf, len); + func(tbuf, mbuf, 0, tmp, len); + } + } +next: + //Step along both edges + _xa += _dxdya; + _xb += _dxdyb; + _ua += _dudya; + _va += _dvdya; + + if (col_blend) + { + _ca[0] += _dcdya[0]; + _ca[1] += _dcdya[1]; + _ca[2] += _dcdya[2]; + _ca[3] += _dcdya[3]; + } + + y++; + } + xa = _xa; + xb = _xb; + ua = _ua; + va = _va; + + if (col_blend) + { + ca[0] = _ca[0]; + ca[1] = _ca[1]; + ca[2] = _ca[2]; + ca[3] = _ca[3]; + } +} + +/* This mapping algorithm is based on Mikael Kalms's. */ +static void +_map_triangle_draw(RGBA_Image *src, RGBA_Image *dst, + int cx, int cy, int cw, int ch, + RGBA_Image *mask, int mx, int my, + DATA32 *tbuf, RGBA_Gfx_Func func, RGBA_Gfx_Func func2, + Map_Tripoly *poly, DATA32 mul_col, + AASpans *aa_spans, Eina_Bool smooth EINA_UNUSED, + Eina_Bool col_blend) +{ + float x[3] = { poly->v[0].x, poly->v[1].x, poly->v[2].x }; + float y[3] = { poly->v[0].y, poly->v[1].y, poly->v[2].y }; + float u[3] = { poly->v[0].u, poly->v[1].u, poly->v[2].u }; + float v[3] = { poly->v[0].v, poly->v[1].v, poly->v[2].v }; + DATA32 c[3] = { poly->v[0].c, poly->v[1].c, poly->v[2].c }; + float off_y; + float denom; + float dxdy[3] = {0, 0, 0}; + float dudy, dvdy, dcdy[4]; + float tmp; + int mc[3][4]; //3 vertex, 4 color channels. + DATA32 tmpc; + Eina_Bool side; + Eina_Bool upper = EINA_FALSE; + + //Sort the vertices in ascending Y order + if (y[0] > y[1]) + { + SWAP(x[0], x[1], tmp); + SWAP(y[0], y[1], tmp); + SWAP(u[0], u[1], tmp); + SWAP(v[0], v[1], tmp); + SWAP(c[0], c[1], tmpc); + } + if (y[0] > y[2]) + { + SWAP(x[0], x[2], tmp); + SWAP(y[0], y[2], tmp); + SWAP(u[0], u[2], tmp); + SWAP(v[0], v[2], tmp); + SWAP(c[0], c[2], tmpc); + + } + if (y[1] > y[2]) + { + SWAP(x[1], x[2], tmp); + SWAP(y[1], y[2], tmp); + SWAP(u[1], u[2], tmp); + SWAP(v[1], v[2], tmp); + SWAP(c[1], c[2], tmpc); + } + + //Y indexes + int yi[3] = { y[0], y[1], y[2] }; + + //Skip drawing if it's too thin to cover any pixels at all. + if ((yi[0] == yi[1] && yi[0] == yi[2]) || + ((int) x[0] == (int) x[1] && (int) x[0] == (int) x[2])) + return; + + /* Calculate horizontal and vertical increments for UV axes (these + calcs are certainly not optimal, although they're stable + (handles any dy being 0) */ + denom = ((x[2] - x[0]) * (y[1] - y[0]) - (x[1] - x[0]) * (y[2] - y[0])); + + //Skip poly if it's an infinitely thin line + if (denom == 0) return; + + denom = 1 / denom; //Reciprocal for speeding up + dudx = ((u[2] - u[0]) * (y[1] - y[0]) - (u[1] - u[0]) * (y[2] - y[0])) * denom; + dvdx = ((v[2] - v[0]) * (y[1] - y[0]) - (v[1] - v[0]) * (y[2] - y[0])) * denom; + dudy = ((u[1] - u[0]) * (x[2] - x[0]) - (u[2] - u[0]) * (x[1] - x[0])) * denom; + dvdy = ((v[1] - v[0]) * (x[2] - x[0]) - (v[2] - v[0]) * (x[1] - x[0])) * denom; + + if (col_blend) + { + for (int i = 0; i < 3; ++i) + { + mc[i][0] = (c[i] & 0xff000000) >> 24; + mc[i][1] = (c[i] & 0x00ff0000) >> 16; + mc[i][2] = (c[i] & 0x0000ff00) >> 8; + mc[i][3] = (c[i] & 0x000000ff); + } + for (int i = 0; i < 4; ++i) + { + dcdx[i] = ((mc[2][i] - mc[0][i]) * (y[1] - y[0]) - (mc[1][i] - mc[0][i]) * (y[2] - y[0])) * denom; + dcdy[i] = ((mc[1][i] - mc[0][i]) * (x[2] - x[0]) - (mc[2][i] - mc[0][i]) * (x[1] - x[0])) * denom; + } + } + + //Calculate X-slopes along the edges + if (y[1] > y[0]) dxdy[0] = (x[1] - x[0]) / (y[1] - y[0]); + if (y[2] > y[0]) dxdy[1] = (x[2] - x[0]) / (y[2] - y[0]); + if (y[2] > y[1]) dxdy[2] = (x[2] - x[1]) / (y[2] - y[1]); + + //Determine which side of the polygon the longer edge is on + side = (dxdy[1] > dxdy[0]) ? EINA_TRUE:EINA_FALSE; + + if (y[0] == y[1]) side = x[0] > x[1]; + if (y[1] == y[2]) side = x[2] > x[1]; + + //Longer edge is on the left side + if (!side) + { + //Calculate slopes along left edge + dxdya = dxdy[1]; + dudya = dxdya * dudx + dudy; + dvdya = dxdya * dvdx + dvdy; + + if (col_blend) + for (int i = 0; i < 4; i++) + dcdya[i] = dxdya * dcdx[i] + dcdy[i]; + + //Perform subpixel pre-stepping along left edge + float dy = 1 - (y[0] - yi[0]); + xa = x[0] + dy * dxdya; + ua = u[0] + dy * dudya; + va = v[0] + dy * dvdya; + + if (col_blend) + for (int i = 0; i < 4; i++) + ca[i] = mc[0][i] + dy * dcdya[i]; + + //Draw upper segment if possibly visible + if (yi[0] < yi[1]) + { + off_y = y[0] < cy ? (cy - y[0]) : 0; + xa += (off_y * dxdya); + ua += (off_y * dudya); + va += (off_y * dvdya); + + if (col_blend) + for (int i = 0; i < 4; i++) + ca[i] += (off_y * dcdya[i]); + + // Set right edge X-slope and perform subpixel pre-stepping + dxdyb = dxdy[0]; + xb = x[0] + dy * dxdyb + (off_y * dxdyb); + _map_triangle_draw_linear(src, dst, cx, cy, cw, ch, mask, mx, my, + yi[0], yi[1], tbuf, func, + func2, mul_col, aa_spans, + col_blend); + upper = EINA_TRUE; + } + //Draw lower segment if possibly visible + if (yi[1] < yi[2]) + { + off_y = y[1] < cy ? (cy - y[1]) : 0; + if (!upper) + { + xa += (off_y * dxdya); + ua += (off_y * dudya); + va += (off_y * dvdya); + + if (col_blend) + for (int i = 0; i < 4; i++) + ca[i] += (off_y * dcdya[i]); + } + + // Set right edge X-slope and perform subpixel pre-stepping + dxdyb = dxdy[2]; + xb = x[1] + (1 - (y[1] - yi[1])) * dxdyb + (off_y * dxdyb); + _map_triangle_draw_linear(src, dst, cx, cy, cw, ch, mask, mx, my, + yi[1], yi[2], tbuf, func, func2, + mul_col, aa_spans, col_blend); + } + } + //Longer edge is on the right side + else + { + //Set right edge X-slope and perform subpixel pre-stepping + dxdyb = dxdy[1]; + float dy = 1 - (y[0] - yi[0]); + xb = x[0] + dy * dxdyb; + + //Draw upper segment if possibly visible + if (yi[0] < yi[1]) + { + off_y = y[0] < cy ? (cy - y[0]) : 0; + xb += (off_y *dxdyb); + + // Set slopes along left edge and perform subpixel pre-stepping + dxdya = dxdy[0]; + dudya = dxdya * dudx + dudy; + dvdya = dxdya * dvdx + dvdy; + + xa = x[0] + dy * dxdya + (off_y * dxdya); + ua = u[0] + dy * dudya + (off_y * dudya); + va = v[0] + dy * dvdya + (off_y * dvdya); + + if (col_blend) + for (int i = 0; i < 4; i++) + { + dcdya[i] = dxdya * dcdx[i] + dcdy[i]; + ca[i] = mc[0][i] + dy * dcdya[i] + (off_y * dcdya[i]); + } + _map_triangle_draw_linear(src, dst, cx, cy, cw, ch, mask, mx, my, + yi[0], yi[1], tbuf, func, func2, + mul_col, aa_spans, col_blend); + upper = EINA_TRUE; + } + //Draw lower segment if possibly visible + if (yi[1] < yi[2]) + { + off_y = y[1] < cy ? (cy - y[1]) : 0; + if (!upper) + xb += (off_y *dxdyb); + + // Set slopes along left edge and perform subpixel pre-stepping + dxdya = dxdy[2]; + dudya = dxdya * dudx + dudy; + dvdya = dxdya * dvdx + dvdy; + dy = 1 - (y[1] - yi[1]); + xa = x[1] + dy * dxdya + (off_y * dxdya); + ua = u[1] + dy * dudya + (off_y * dudya); + va = v[1] + dy * dvdya + (off_y * dvdya); + + if (col_blend) + for (int i = 0; i < 4; i++) + { + dcdya[i] = dxdya * dcdx[i] + dcdy[i]; + ca[i] = mc[1][i] + dy * dcdya[i] + (off_y * dcdya[i]); + } + _map_triangle_draw_linear(src, dst, cx, cy, cw, ch, mask, mx, my, + yi[1], yi[2], tbuf, func, func2, + mul_col, aa_spans, col_blend); + } + } +} + +static void +_evas_common_map_rgba_internal_high(RGBA_Image *src, RGBA_Image *dst, + int cx, int cy, int cw, int ch, //clip + DATA32 mul_col, int render_op, + RGBA_Map_Point *p, int smooth, + int anti_alias, int level EINA_UNUSED, + RGBA_Image *mask, int mask_x, int mask_y) +{ + float x[4], y[4], u[4], v[4]; + DATA32 c[4]; + RGBA_Gfx_Func func = NULL; + RGBA_Gfx_Func func2 = NULL; + DATA32 *tbuf = NULL; //Temporarily used span buffer + Eina_Bool have_alpha = EINA_FALSE; + Eina_Bool src_alpha = src->cache_entry.flags.alpha; + Eina_Bool ssrc_alpha = src->cache_entry.flags.alpha_sparse; + Eina_Bool dst_alpha = dst->cache_entry.flags.alpha; + Eina_Bool col_blend = EINA_FALSE; //Necessary blending vertex color? + + //FIXME: we cannot apply anti_aliasing per polygons. + anti_alias = EINA_FALSE; + + /* Prepare points data. + Convert to float, + shift XY coordinates to match the sub-pixeling technique. + Check alpha transparency. */ + for (int i = 0; i < 4; i++) + { + x[i] = p[i].fx + 0.5; + y[i] = p[i].fy + 0.5; + u[i] = (p[i].u >> FP); + v[i] = (p[i].v >> FP); + c[i] = p[i].col; + + /* Exceptions: + Limit u,v coords of points to be within the source image */ + if (u[i] < 0) u[i] = 0; + else if (u[i] >= (float) src->cache_entry.w) + u[i] = (float) (src->cache_entry.w - 1); + + if (v[i] < 0) v[i] = 0; + else if (v[i] >= (float) src->cache_entry.h) + v[i] = (float) (src->cache_entry.h - 1); + + if ((c[i] >> 24) < 0xff) have_alpha = EINA_TRUE; + if (c[i] < 0xffffffff) col_blend = EINA_TRUE; + } + + //Figure out alpha to choose a blend method. + //If operation is solid, bypass buf and draw func and draw direct to dst. + if (!(!src_alpha && !dst_alpha && (mul_col == 0xffffffff) && + !have_alpha && !anti_alias && !mask)) + { + if (have_alpha) src_alpha = EINA_TRUE; + ssrc_alpha = (anti_alias | src_alpha); + if (!mask) + { + if (mul_col != 0xffffffff) + func = evas_common_gfx_func_composite_pixel_color_span_get(ssrc_alpha, ssrc_alpha, mul_col, dst_alpha, cw, render_op); + else + func = evas_common_gfx_func_composite_pixel_span_get(ssrc_alpha, ssrc_alpha, dst_alpha, cw, render_op); + } + else + { + func = evas_common_gfx_func_composite_pixel_mask_span_get(ssrc_alpha, ssrc_alpha, dst_alpha, cw, render_op); + if (mul_col != 0xffffffff) + func2 = evas_common_gfx_func_composite_pixel_color_span_get(ssrc_alpha, ssrc_alpha, mul_col, dst_alpha, cw, EVAS_RENDER_COPY); + } + if (src_alpha) src->cache_entry.flags.alpha = EINA_TRUE; + tbuf = alloca(cw * sizeof(DATA32)); + } + + //Setup Anti-Aliasing? + AASpans *aa_spans = NULL; + if (anti_alias) + { + //Adjust AA Y range + float ystart = 9999999999, yend = -1; + for (int i = 0; i < 4; i++) + { + if (y[i] < ystart) ystart = y[i]; + if (y[i] > yend) yend = y[i]; + } + if (ystart < cy) ystart = cy; + if (yend > cy + ch) yend = cy + ch; + + aa_spans = + _map_aa_ready(dst->cache_entry.w, dst->cache_entry.h, ystart, yend); + } + + /* + 1 polygon is consisted of 2 triangles, 4 polygons constructs 1 mesh. + below figure illustrates vert[9] index info. + If you need better quality, please divide a mesh by more number of triangles. + + 0 -- 4 -- 1 + | / | / | + | / | / | + 6 -- 8 -- 7 + | / | / | + | / | / | + 3 -- 5 -- 2 + */ + + //Interpolated color info + DATA32 tmpc[5] = { + INTERP_256(128, c[0], c[1]), + INTERP_256(128, c[3], c[2]), + INTERP_256(128, c[0], c[3]), + INTERP_256(128, c[1], c[2]), + INTERP_256(128, tmpc[2], tmpc[3])}; + + //9 vertices (see above figure) + Map_Vertex vert[9] = { + {x[0], y[0], u[0], v[0], c[0]}, + {x[1], y[1], u[1], v[1], c[1]}, + {x[2], y[2], u[2], v[2], c[2]}, + {x[3], y[3], u[3], v[3], c[3]}, + {x[0] + (x[1] - x[0]) * 0.5, y[0] + (y[1] - y[0]) * 0.5, u[0] + (u[1] - u[0]) * 0.5, v[0] + (v[1] - v[0]) * 0.5, tmpc[0]}, + {x[3] + (x[2] - x[3]) * 0.5, y[3] + (y[2] - y[3]) * 0.5, u[3] + (u[2] - u[3]) * 0.5, v[3] + (v[2] - v[3]) * 0.5, tmpc[1]}, + {x[0] + (x[3] - x[0]) * 0.5, y[0] + (y[3] - y[0]) * 0.5, u[0] + (u[3] - u[0]) * 0.5, v[0] + (v[3] - v[0]) * 0.5, tmpc[2]}, + {x[1] + (x[2] - x[1]) * 0.5, y[1] + (y[2] - y[1]) * 0.5, u[1] + (u[2] - u[1]) * 0.5, v[1] + (v[2] - v[1]) * 0.5, tmpc[3]}, + {vert[6].x + (vert[7].x - vert[6].x) * 0.5, vert[4].y + (vert[5].y - vert[4].y) * 0.5, vert[6].u + (vert[7].u - vert[6].u) * 0.5, vert[4].v + (vert[5].v - vert[4].v) * 0.5, tmpc[4]}}; + + //Vertex Indices + int idx[4][4] = {{ 0, 4, 8, 6 }, {4, 1, 7, 8}, {6, 8, 5, 3}, {8, 7, 2, 5}}; + + Map_Tripoly poly; + + //Draw a pair of triangles + for (int i = 0; i < 4; ++i) + { + poly.v[0] = vert[idx[i][0]]; + poly.v[1] = vert[idx[i][1]]; + poly.v[2] = vert[idx[i][3]]; + + _map_triangle_draw(src, dst, cx, cy, cw, ch, + mask, mask_x, mask_y, + tbuf, func, func2, + &poly, mul_col, aa_spans, + smooth, col_blend); + + poly.v[0] = vert[idx[i][1]]; + poly.v[1] = vert[idx[i][3]]; + poly.v[2] = vert[idx[i][2]]; + + _map_triangle_draw(src, dst, cx, cy, cw, ch, + mask, mask_x, mask_y, + tbuf, func, func2, + &poly, mul_col, aa_spans, + smooth, col_blend); + } + + if (anti_alias) + _map_aa_apply(aa_spans, dst->image.data, dst->cache_entry.w); +} diff --git a/src/lib/evas/common/evas_map_image_loop.c b/src/lib/evas/common/evas_map_image_loop.c index 7cbb494c12..e44988ebf2 100644 --- a/src/lib/evas/common/evas_map_image_loop.c +++ b/src/lib/evas/common/evas_map_image_loop.c @@ -237,7 +237,6 @@ u += ud; v += vd; # endif //COLBLACK - if (anti_alias) *d = _aa_coverage_apply(line, ww, w, *d, sa); d++; ww--; } @@ -359,7 +358,6 @@ 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_text_utils.h b/src/lib/evas/common/evas_text_utils.h index 36039568fa..09c51e0c5e 100644 --- a/src/lib/evas/common/evas_text_utils.h +++ b/src/lib/evas/common/evas_text_utils.h @@ -68,7 +68,7 @@ struct _Evas_Text_Props #define EVAS_TP_SZLEN_ONE 1 // special case textprop for ONE char! should use this for textgrid but -// we have to modify every bit of code that usea a textprop to go thru a +// we have to modify every bit of code that usea a textprop to go through a // getter or setter etc. etc. struct _Evas_Text_Props_One { diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c index f67d7b06a5..39806843f2 100644 --- a/src/lib/evas/filters/evas_filter.c +++ b/src/lib/evas/filters/evas_filter.c @@ -16,10 +16,6 @@ #include "evas_filter.h" -#ifdef EVAS_CSERVE2 -# include "evas_cs2_private.h" -#endif - #include "evas_filter_private.h" #include #include diff --git a/src/lib/evas/filters/meson.build b/src/lib/evas/filters/meson.build index 019b1d123c..78c896d939 100644 --- a/src/lib/evas/filters/meson.build +++ b/src/lib/evas/filters/meson.build @@ -7,13 +7,34 @@ evas_src += files([ 'evas_filter_utils.c', ]) -luajit = dependency('luajit') -if sys_osx == true -# luajit on macos is broken, this means we need to generate our own dependency with our arguments, a library later still needs to link to luajit for the pagesize argument thingy - luajit = declare_dependency( - include_directories: include_directories(luajit.get_pkgconfig_variable('includedir')), - link_args: ['-L'+luajit.get_pkgconfig_variable('libdir'), '-l'+luajit.get_pkgconfig_variable('libname')] +luaold_interpreters = [ + ['lua', ['>=5.1.0','<5.3.0']], + ['lua51', ['>=5.1.0','<5.2.0']], + ['lua-5.1', ['>=5.1.0','<5.2.0']], + ['lua5.1', ['>=5.1.0','<5.2.0']], + ['lua52', ['>=5.2.0','<5.3.0']], + ['lua-5.2', ['>=5.2.0','<5.3.0']], + ['lua5.2', ['>=5.2.0','<5.3.0']], +] + +if get_option('lua-interpreter') == 'lua' + config_h.set('ENABLE_LUA_OLD', '1') + foreach l : luaold_interpreters + lua = dependency(l[0], version: l[1], required:false) + if lua.found() == true + break + endif + endforeach +else + lua = dependency(get_option('lua-interpreter')) +endif + +if sys_osx == true and get_option('lua-interpreter') == 'luajit' +# luajit on macro is broken, this means we need to generate our own dependency with our arguments, a library later still needs to link to luajit for the pagesize argument thingy + lua = declare_dependency( + include_directories: include_directories(lua.get_pkgconfig_variable('includedir')), + link_args: ['-L'+lua.get_pkgconfig_variable('libdir'), '-l'+lua.get_pkgconfig_variable('libname')] ) endif -evas_deps += luajit +evas_deps += lua diff --git a/src/lib/evas/gesture/efl_canvas_gesture.eo b/src/lib/evas/gesture/efl_canvas_gesture.eo index 731f02206a..86fa775770 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture.eo @@ -1,6 +1,6 @@ import efl_canvas_gesture_types; -abstract Efl.Canvas.Gesture extends Efl.Object +abstract @beta Efl.Canvas.Gesture extends Efl.Object { [[EFL Gesture abstract class]] eo_prefix: efl_gesture; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo index 944723508c..12473d6761 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo @@ -1,4 +1,4 @@ -class Efl.Canvas.Gesture_Long_Tap extends Efl.Canvas.Gesture +class @beta Efl.Canvas.Gesture_Long_Tap extends Efl.Canvas.Gesture { [[EFL Gesture Long Tap class]] eo_prefix: efl_gesture_long_tap; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.c b/src/lib/evas/gesture/efl_canvas_gesture_manager.c index c8ea0d2008..b174e49b7b 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_manager.c +++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.c @@ -97,10 +97,18 @@ _efl_canvas_gesture_manager_efl_object_destructor(Eo *obj, Efl_Canvas_Gesture_Ma efl_destructor(efl_super(obj, MY_CLASS)); } -void -_efl_canvas_gesture_manager_callback_add_hook(Eo *obj, Eo *target, const Efl_Event_Description *type) +void * +_efl_canvas_gesture_manager_private_data_get(Eo *obj) { Efl_Canvas_Gesture_Manager_Data *pd = efl_data_scope_get(obj, MY_CLASS); + + return pd; +} + +void +_efl_canvas_gesture_manager_callback_add_hook(void *data, Eo *target, const Efl_Event_Description *type) +{ + Efl_Canvas_Gesture_Manager_Data *pd = data; // if there is a recognizer registered for that event then add it to the gesture context Efl_Canvas_Gesture_Recognizer *recognizer = eina_hash_find (pd->m_recognizers, &type); if (recognizer) @@ -111,9 +119,9 @@ _efl_canvas_gesture_manager_callback_add_hook(Eo *obj, Eo *target, const Efl_Eve } void -_efl_canvas_gesture_manager_callback_del_hook(Eo *obj, Eo *target, const Efl_Event_Description *type) +_efl_canvas_gesture_manager_callback_del_hook(void *data, Eo *target, const Efl_Event_Description *type) { - Efl_Canvas_Gesture_Manager_Data *pd = efl_data_scope_get(obj, MY_CLASS); + Efl_Canvas_Gesture_Manager_Data *pd = data; // if there is a recognizer registered for that event then add it to the gesture context Efl_Canvas_Gesture_Recognizer *recognizer = eina_hash_find (pd->m_recognizers, &type); if (recognizer) @@ -344,5 +352,23 @@ _cleanup_cached_gestures(Efl_Canvas_Gesture_Manager_Data *pd, } } +Eina_Bool +_efl_canvas_gesture_manager_watches(const Efl_Event_Description *ev) +{ + /* These are a subset of _elm_win_evas_feed_fake_callbacks + * in efl_ui_win.c */ + if ((ev == EFL_EVENT_POINTER_MOVE) || + (ev == EFL_EVENT_POINTER_DOWN) || + (ev == EFL_EVENT_POINTER_UP) || + (ev == EFL_EVENT_POINTER_IN) || + (ev == EFL_EVENT_POINTER_OUT) || + (ev == EFL_EVENT_POINTER_CANCEL) || + (ev == EFL_EVENT_POINTER_WHEEL) || + (ev == EFL_EVENT_FINGER_MOVE) || + (ev == EFL_EVENT_FINGER_DOWN) || + (ev == EFL_EVENT_FINGER_UP)) + return EINA_TRUE; + return EINA_FALSE; +} #include "efl_canvas_gesture_manager.eo.c" diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.eo b/src/lib/evas/gesture/efl_canvas_gesture_manager.eo index 3804e228da..f42c2dccb3 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_manager.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.eo @@ -1,4 +1,4 @@ -class Efl.Canvas.Gesture_Manager extends Efl.Object +class @beta Efl.Canvas.Gesture_Manager extends Efl.Object { [[EFL Gesture Manager class]] eo_prefix: efl_gesture_manager; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo index 9b4bdb28d8..a3a11c3a1c 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo @@ -1,6 +1,6 @@ import efl_canvas_gesture_types; -abstract Efl.Canvas.Gesture_Recognizer extends Efl.Object +abstract @beta Efl.Canvas.Gesture_Recognizer extends Efl.Object { [[EFL Gesture Recognizer abstract class]] eo_prefix: efl_gesture_recognizer; 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 index 72cea52895..025cc4e19b 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo @@ -1,4 +1,4 @@ -class Efl.Canvas.Gesture_Recognizer_Long_Tap extends Efl.Canvas.Gesture_Recognizer +class @beta Efl.Canvas.Gesture_Recognizer_Long_Tap extends Efl.Canvas.Gesture_Recognizer { [[EFL Gesture Recognizer Long Tap class]] data: null; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo index 62e84ec9a9..43fe77a654 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo @@ -1,4 +1,4 @@ -class Efl.Canvas.Gesture_Recognizer_Tap extends Efl.Canvas.Gesture_Recognizer +class @beta Efl.Canvas.Gesture_Recognizer_Tap extends Efl.Canvas.Gesture_Recognizer { [[EFL Gesture Recognizer Tap class]] data: null; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_tap.eo index d22f075dd6..88e6e5c18e 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_tap.eo @@ -1,4 +1,4 @@ -class Efl.Canvas.Gesture_Tap extends Efl.Canvas.Gesture +class @beta Efl.Canvas.Gesture_Tap extends Efl.Canvas.Gesture { [[EFL Gesture Tap class]] eo_prefix: efl_gesture_tap; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_touch.eo b/src/lib/evas/gesture/efl_canvas_gesture_touch.eo index f606a60ede..7d773b56c5 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_touch.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_touch.eo @@ -3,7 +3,7 @@ import efl_input_types; /* FIXME: This class lacks a lot of useful helpers. */ -class Efl.Canvas.Gesture_Touch extends Efl.Object +class @beta Efl.Canvas.Gesture_Touch extends Efl.Object { [[EFL Gesture Touch class]] eo_prefix: efl_gesture_touch; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_types.eot b/src/lib/evas/gesture/efl_canvas_gesture_types.eot index 4dbf88c727..8be4528405 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_types.eot +++ b/src/lib/evas/gesture/efl_canvas_gesture_types.eot @@ -1,4 +1,4 @@ -enum Efl.Canvas.Gesture_Touch_State +enum @beta 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.Canvas.Gesture_Touch_State end, [[Last fingure touch up]] } -enum Efl.Canvas.Gesture_State +enum @beta Efl.Canvas.Gesture_State { [[ This enum type describes the state of a gesture. ]] legacy: efl_gesture; @@ -19,7 +19,7 @@ enum Efl.Canvas.Gesture_State canceled, [[A gesture was canceled.]] } -enum Efl.Canvas.Gesture_Recognizer_Result +enum @beta Efl.Canvas.Gesture_Recognizer_Result { [[ This enum type describes the state of a gesture recognizer. ]] legacy: efl_gesture; diff --git a/src/lib/evas/include/evas_common_private.h b/src/lib/evas/include/evas_common_private.h index 7fe19b7b9a..53c9fef2ec 100644 --- a/src/lib/evas/include/evas_common_private.h +++ b/src/lib/evas/include/evas_common_private.h @@ -636,7 +636,7 @@ struct _Image_Entry int server_id; int connect_num; int channel; - int load_error; + Evas_Load_Error load_error; }; struct _Engine_Image_Entry diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x index c83c1a0bc6..8c8f814fce 100644 --- a/src/lib/evas/include/evas_inline.x +++ b/src/lib/evas/include/evas_inline.x @@ -32,10 +32,10 @@ _evas_render_can_map(Evas_Object_Protected_Data *obj) } static inline void -_evas_object_gfx_map_update(Evas_Object_Protected_Data *obj) +_evas_object_gfx_mapping_update(Evas_Object_Protected_Data *obj) { - if (!obj->gfx_map_has) return; - _efl_gfx_map_update(obj->object); + if (!obj->gfx_mapping_has) return; + _efl_gfx_mapping_update(obj->object); } static inline int diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 7edce6296a..5a4bd9cc5e 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -48,13 +48,13 @@ #define ENFN obj->layer->evas->engine.func #define ENC _evas_engine_context(obj->layer->evas) -#include "canvas/evas_canvas.eo.h" -#include "canvas/evas_text.eo.h" -#include "canvas/evas_textgrid.eo.h" -#include "canvas/evas_line.eo.h" -#include "canvas/evas_box.eo.h" -#include "canvas/evas_table.eo.h" -#include "canvas/evas_grid.eo.h" +#include "canvas/evas_canvas_eo.h" +#include "canvas/evas_text_eo.h" +#include "canvas/evas_textgrid_eo.h" +#include "canvas/evas_line_eo.h" +#include "canvas/evas_box_eo.h" +#include "canvas/evas_table_eo.h" +#include "canvas/evas_grid_eo.h" #define RENDER_METHOD_INVALID 0x00000000 @@ -1147,8 +1147,6 @@ struct _Evas_Object_Protected_Data unsigned char no_change_render; unsigned char delete_me; - Eina_Inlist *event_anims; //List of Efl_Animation - Eina_Bool render_pre : 1; Eina_Bool rect_del : 1; @@ -1186,8 +1184,8 @@ struct _Evas_Object_Protected_Data Eina_Bool snapshot_needs_redraw : 1; Eina_Bool snapshot_no_obscure : 1; Eina_Bool is_image_object : 1; - Eina_Bool gfx_map_has : 1; - Eina_Bool gfx_map_update : 1; + Eina_Bool gfx_mapping_has : 1; + Eina_Bool gfx_mapping_update : 1; struct { Eina_Bool ctor : 1; // used legacy constructor @@ -1525,14 +1523,14 @@ struct _Vg_File_Data struct _Evas_Vg_Load_Func { - Vg_File_Data *(*file_open) (const char *file, const char *key, int *error); + Vg_File_Data *(*file_open) (Eina_File *file, const char *key, int *error); Eina_Bool (*file_close) (Vg_File_Data *vfd); Eina_Bool (*file_data) (Vg_File_Data *vfd); }; struct _Evas_Vg_Save_Func { - int (*file_save) (Vg_File_Data *vfd, const char *file, const char *key, int compress); + Evas_Load_Error (*file_save) (Vg_File_Data *vfd, const char *file, const char *key, int compress); }; #ifdef __cplusplus @@ -1647,7 +1645,7 @@ void evas_object_inform_call_image_resize(Evas_Object *obj); void evas_object_intercept_cleanup(Evas_Object *obj); void evas_object_grabs_cleanup(Evas_Object *obj, Evas_Object_Protected_Data *pd); void evas_key_grab_free(Evas_Object *obj, Evas_Object_Protected_Data *pd, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers); -void evas_object_smart_member_cache_invalidate(Evas_Object *obj, Eina_Bool pass_events, Eina_Bool freeze_events, Eina_Bool sourve_invisible); +void evas_object_smart_member_cache_invalidate(Evas_Object *obj, Eina_Bool pass_events, Eina_Bool freeze_events, Eina_Bool source_invisible); void evas_text_style_pad_get(Evas_Text_Style_Type style, int *l, int *r, int *t, int *b); void _evas_object_text_rehint(Evas_Object *obj); void _evas_object_textblock_rehint(Evas_Object *obj); @@ -1669,10 +1667,10 @@ void evas_font_draw_async_check(Evas_Object_Protected_Data *obj, int x, int y, int w, int h, int ow, int oh, Evas_Text_Props *intl_props, Eina_Bool do_async); -void _efl_canvas_object_clip_prev_reset(Evas_Object_Protected_Data *obj, Eina_Bool cur_prev); +void _efl_canvas_object_clipper_prev_reset(Evas_Object_Protected_Data *obj, Eina_Bool cur_prev); -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_clipper_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *eo_clip, Evas_Object_Protected_Data *clip); +Eina_Bool _efl_canvas_object_clipper_unset_block(Eo *eo_obj, Evas_Object_Protected_Data *obj); 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_invalidate_cb(void *data, const Efl_Event *ev); @@ -1736,10 +1734,10 @@ void _evas_canvas3d_eet_file_free(Evas_Canvas3D_File_Eet* eet_file); void evas_filter_init(void); void evas_filter_shutdown(void); -/* Efl.Gfx.Map */ -void _efl_gfx_map_init(void); -void _efl_gfx_map_shutdown(void); -void _efl_gfx_map_update(Eo *eo_obj); +/* Efl.Gfx.Mapping */ +void _efl_gfx_mapping_init(void); +void _efl_gfx_mapping_shutdown(void); +void _efl_gfx_mapping_update(Eo *eo_obj); /* Ector */ Ector_Surface *evas_ector_get(Evas_Public_Data *evas); @@ -1867,7 +1865,7 @@ void _evas_device_cleanup(Evas *e); Evas_Device *_evas_device_top_get(const Evas *e); /* legacy/eo events */ -Efl_Input_Event *efl_input_event_instance_get(Eo *klass, Eo *owner); +Efl_Input_Event *efl_input_event_instance_get(const 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); @@ -1896,9 +1894,11 @@ void efl_canvas_output_info_get(Evas_Public_Data *e, Efl_Canvas_Output *output); void evas_object_pixels_get_force(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); // Gesture Manager +void *_efl_canvas_gesture_manager_private_data_get(Eo *obj); 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); +void _efl_canvas_gesture_manager_callback_del_hook(void *data, Eo *target, const Efl_Event_Description *type); +void _efl_canvas_gesture_manager_callback_add_hook(void *data, Eo *target, const Efl_Event_Description *type); +Eina_Bool _efl_canvas_gesture_manager_watches(const Efl_Event_Description *ev); //evas focus functions void evas_focus_init(void); @@ -1918,6 +1918,9 @@ extern Eina_Cow *evas_object_image_state_cow; extern Eina_Cow *evas_object_mask_cow; extern Eina_Cow *evas_object_events_cow; +Eina_Error _evas_load_error_to_efl_gfx_image_load_error(Evas_Load_Error err); +Evas_Load_Error _efl_gfx_image_load_error_to_evas_load_error(Eina_Error err); + # define EINA_COW_STATE_WRITE_BEGIN(Obj, Write, State) \ EINA_COW_WRITE_BEGIN(evas_object_state_cow, Obj->State, \ Evas_Object_Protected_State, Write) @@ -1928,6 +1931,13 @@ extern Eina_Cow *evas_object_events_cow; } \ while (0); +/* BEGIN: events to maintain compatibility with legacy */ +EWAPI extern const Efl_Event_Description _EFL_GFX_ENTITY_EVENT_SHOW; +#define EFL_GFX_ENTITY_EVENT_SHOW (&(_EFL_GFX_ENTITY_EVENT_SHOW)) +EWAPI extern const Efl_Event_Description _EFL_GFX_ENTITY_EVENT_HIDE; +#define EFL_GFX_ENTITY_EVENT_HIDE (&(_EFL_GFX_ENTITY_EVENT_HIDE)) +/* END: events to maintain compatibility with legacy */ + /****************************************************************************/ /*****************************************/ /********************/ diff --git a/src/lib/evas/meson.build b/src/lib/evas/meson.build index 1b306c363e..d338d586cc 100644 --- a/src/lib/evas/meson.build +++ b/src/lib/evas/meson.build @@ -129,7 +129,7 @@ if (get_option('pixman')) foreach support : pixman_support config_h.set(support, '1') endforeach - evas_deps += dependency('pixman') + evas_deps += dependency('pixman-1') endif if (get_option('hyphen')) @@ -202,9 +202,11 @@ evas_pre_lib_dep = declare_dependency( dependencies: [evas_deps, m, draw, valgrind, libunibreak] ) -install_data(pub_evas_eo_files + pub_evas_eot_files, - install_dir: join_paths(eolian_include_dir, package_version_name) -) +if get_option('install-eo-files') + install_data(pub_evas_eo_files + pub_evas_eot_files, + install_dir: join_paths(eolian_include_dir, package_version_name) + ) +endif install_headers(evas_header_src, install_dir : dir_package_include, diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c index ec5fc6b0be..534dca2748 100644 --- a/src/lib/evas/vg/evas_vg_cache.c +++ b/src/lib/evas/vg/evas_vg_cache.c @@ -70,7 +70,7 @@ _find_loader_module(const char *file) } static Vg_File_Data * -_vg_load_from_file(const char *file, const char *key) +_vg_load_from_file(const Eina_File *file, const char *key) { Evas_Module *em; Evas_Vg_Load_Func *loader; @@ -78,11 +78,12 @@ _vg_load_from_file(const char *file, const char *key) Vg_File_Data *vfd; unsigned int i; - em = _find_loader_module(file); + const char *file_name = eina_file_filename_get(file); + em = _find_loader_module(file_name); if (em) { loader = em->functions; - vfd = loader->file_open(file, key, &error); + vfd = loader->file_open((Eina_File *) file, key, &error); if (vfd) { vfd->loader = loader; @@ -97,7 +98,8 @@ _vg_load_from_file(const char *file, const char *key) if (em) { loader = em->functions; - vfd = loader->file_open(file, key, &error); + vfd = loader->file_open((Eina_File *) file, key, &error); + if (vfd) { vfd->loader = loader; return vfd; @@ -105,7 +107,7 @@ _vg_load_from_file(const char *file, const char *key) } } } - WRN("Exhausted all means to load vector file = %s", file); + WRN("Exhausted all means to load vector file = %s", file_name); return NULL; } @@ -148,11 +150,12 @@ _evas_cache_vg_entry_free_cb(void *data) if (vg_entry->vfd) { vg_entry->vfd->ref--; + if (vg_entry->vfd->ref <= 0) { Eina_Strbuf *hash_key = eina_strbuf_new(); eina_strbuf_append_printf(hash_key, "%s/%s", - vg_entry->file, + eina_file_filename_get(vg_entry->file), vg_entry->key); if (!eina_hash_del(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key), vg_entry->vfd)) ERR("Failed to delete vfd = (%p) from hash", vg_entry->vfd); @@ -167,32 +170,16 @@ _evas_cache_vg_entry_free_cb(void *data) } static Eina_Bool -_vg_file_save(Vg_File_Data *vfd, const char *file, const char *key, const char *flags) +_vg_file_save(Vg_File_Data *vfd, const char *file, const char *key, const Efl_File_Save_Info *info) { Evas_Module *em; Evas_Vg_Save_Func *saver; - int error = EVAS_LOAD_ERROR_GENERIC; + Evas_Load_Error error = EVAS_LOAD_ERROR_GENERIC; int compress = 9; if (!file) return EINA_FALSE; - if (flags) - { - char *p, *pp; - char *tflags; - - tflags = alloca(strlen(flags) + 1); - strcpy(tflags, flags); - p = tflags; - while (p) - { - pp = strchr(p, ' '); - if (pp) *pp = 0; - sscanf(p, "compress=%i", &compress); - if (pp) p = pp + 1; - else break; - } - } + if (info) compress = info->compression; em = _find_saver_module(file); if (em) @@ -299,13 +286,13 @@ evas_cache_vg_shutdown(void) } Vg_File_Data * -evas_cache_vg_file_open(const char *file, const char *key) +evas_cache_vg_file_open(const Eina_File *file, const char *key) { Vg_File_Data *vfd; Eina_Strbuf *hash_key; hash_key = eina_strbuf_new(); - eina_strbuf_append_printf(hash_key, "%s/%s", file, key); + eina_strbuf_append_printf(hash_key, "%s/%s", eina_file_filename_get(file), key); vfd = eina_hash_find(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key)); if (!vfd) { @@ -324,7 +311,7 @@ evas_cache_vg_entry_resize(Vg_Cache_Entry *vg_entry, int w, int h) } Vg_Cache_Entry* -evas_cache_vg_entry_create(const char *file, +evas_cache_vg_entry_create(const Eina_File *file, const char *key, int w, int h) { @@ -336,7 +323,7 @@ evas_cache_vg_entry_create(const char *file, //TODO: zero-sized entry is useless. how to skip it? hash_key = eina_strbuf_new(); - eina_strbuf_append_printf(hash_key, "%s/%s/%d/%d", file, key, w, h); + eina_strbuf_append_printf(hash_key, "%p/%s/%d/%d", file, key, w, h); vg_entry = eina_hash_find(vg_cache->vg_entry_hash, eina_strbuf_string_get(hash_key)); if (!vg_entry) { @@ -347,7 +334,7 @@ evas_cache_vg_entry_create(const char *file, eina_strbuf_free(hash_key); return NULL; } - vg_entry->file = eina_stringshare_add(file); + vg_entry->file = file; vg_entry->key = eina_stringshare_add(key); vg_entry->w = w; vg_entry->h = h; @@ -407,20 +394,18 @@ evas_cache_vg_entry_del(Vg_Cache_Entry *vg_entry) } Eina_Bool -evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, - const char *flags) +evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const Efl_File_Save_Info *info) { Vg_File_Data *vfd = evas_cache_vg_file_open(vg_entry->file, vg_entry->key); if (!vfd) return EINA_FALSE; - return _vg_file_save(vfd, file, key, flags); + return _vg_file_save(vfd, file, key, info); } Eina_Bool -evas_cache_vg_file_save(Efl_VG *root, int w, int h, const char *file, const char *key, - const char *flags) +evas_cache_vg_file_save(Efl_VG *root, int w, int h, const char *file, const char *key, const Efl_File_Save_Info *info) { Vg_File_Data vfd = {}; @@ -431,5 +416,5 @@ evas_cache_vg_file_save(Efl_VG *root, int w, int h, const char *file, const char vfd.root = root; vfd.preserve_aspect = EINA_FALSE; - return _vg_file_save(&vfd, file, key, flags); + return _vg_file_save(&vfd, file, key, info); } diff --git a/src/lib/evas_goal/meson.build b/src/lib/evas_goal/meson.build index 60426ad526..5746006908 100644 --- a/src/lib/evas_goal/meson.build +++ b/src/lib/evas_goal/meson.build @@ -17,7 +17,7 @@ evas = declare_dependency( evas_bin = declare_dependency( link_with : [evas_lib], - dependencies : [eina, ecore, ector, emile, dependency('luajit')], + dependencies : [eina, ecore, ector, emile, lua], include_directories : evas_include_directories ) @@ -32,5 +32,5 @@ pkgconfig.generate(evas_lib, name : 'evas', subdirs : ['evas-'+version_major] + tmp_package_subdirs, version : version_major + '.' + version_minor + '.' + version_micro, - libraries : [eina, ecore, ector, emile, dependency('luajit')], + libraries : [eina, ecore, ector, emile, lua], ) diff --git a/src/lib/evil/evil_dlfcn.h b/src/lib/evil/evil_dlfcn.h index 1c05b1f235..af18ed1ff9 100644 --- a/src/lib/evil/evil_dlfcn.h +++ b/src/lib/evil/evil_dlfcn.h @@ -61,7 +61,7 @@ x * This header provides functions to load and unload dynamic-link /** * @typedef Dl_info - * @brief A structure that stores infomation of a calling process. + * @brief A structure that stores information of a calling process. * This typedef is defined only when _GNU_SOURCE was defined before * including dlfcn.h. */ @@ -69,7 +69,7 @@ typedef struct Dl_info Dl_info; /** * @struct Dl_info - * @brief A structure that stores infomation of a calling process. + * @brief A structure that stores information of a calling process. * This structure is defined only when _GNU_SOURCE was defined before * including dlfcn.h. */ @@ -148,7 +148,7 @@ EAPI void *dlopen(const char* path, int mode); * @brief Close a dynamic-link library. * * @param handle Handle that references a dynamic-link library. - * @return O on sucess, -1 otherwise. + * @return O on success, -1 otherwise. * * Release a reference to the dynamic-link library referenced * by @p handle. If the reference count drops to 0, the handle is @@ -173,7 +173,7 @@ EAPI int dlclose(void* handle); * * @param handle Handle that references a dynamic-link library. * @param symbol @c NULL-terminated string. - * @return O on sucess, NULL otherwise. + * @return O on success, NULL otherwise. * * Return the address of the code or data location specified by the * string @p symbol. @p handle references a library that contains diff --git a/src/lib/evil/evil_fcntl.c b/src/lib/evil/evil_fcntl.c index df79c3605f..26d596a030 100644 --- a/src/lib/evil/evil_fcntl.c +++ b/src/lib/evil/evil_fcntl.c @@ -18,8 +18,8 @@ _is_socket(SOCKET s) fd_set rfds; struct timeval tv; - tv.tv_sec = 0.00000001; - tv.tv_usec = 0; + tv.tv_sec = 0; + tv.tv_usec = 100; FD_ZERO(&rfds); FD_SET(s, &rfds); diff --git a/src/lib/evil/evil_stdlib.c b/src/lib/evil/evil_stdlib.c index dbb9779ee4..b03625a24d 100644 --- a/src/lib/evil/evil_stdlib.c +++ b/src/lib/evil/evil_stdlib.c @@ -192,12 +192,6 @@ mkstemps(char *__template, int suffixlen) return -1; } -int -mkstemp(char *__template) -{ - return mkstemps(__template, 0); -} - char * realpath(const char *file_name, char *resolved_name) { diff --git a/src/lib/evil/evil_stdlib.h b/src/lib/evil/evil_stdlib.h index 316347abdd..34c9f7c65f 100644 --- a/src/lib/evil/evil_stdlib.h +++ b/src/lib/evil/evil_stdlib.h @@ -67,38 +67,6 @@ EAPI int unsetenv(const char *name); * */ -/** - * @brief Create a unique temporary file name. - * - * @param __template Template of the file to create. - * @return A file descriptor on success, -1 otherwise. - * - * Take the given file name @p template and overwrite a portion of it - * to create a file name. This file is guaranted not to exist at the - * time invocation and is suitable for use by the function. - * - * The @p template parameter can be any file name with six X's at the end - * for example @em baseXXXXXX, where @em base is the part of the new file - * that you supply and each 'X' is a placeholder for a character supplied - * by mkstemp(). The trailing 'Xs' are replaced with a six-digit value; - * this value is a unique number. Each successful call to mkstemp() - * modifies @p template. - * - * When mkstemp() succeeds, it creates and opens the temporary file for - * reading and writing. - * - * On success, the function returns the file descriptor of the - * temporary file. Otherwise, it returns -1 and errno is set to the - * following values: - * - EINVAL: @p template has an invalid format. - * - EEXISTS: File name already exists. - * - * Conformity: Should follow BSD conformity. - * - * Supported OS: Windows XP. - */ -EAPI int mkstemp(char *__template); - /** * @brief create an unique temporary directory * @@ -129,7 +97,7 @@ EAPI int mkstemps(char *__template, int suffixlen); * by @p resolved_name. The buffer is at most @c PATH_MAX bytes long. * If @p resolved_name is @c NULL, malloc() is used to allocate a * buffer of sufficient length to hold the path name. In that case, it - * is the responsability of the caller to free this buffer with free(). + * is the responsibility of the caller to free this buffer with free(). * * That function can be used to obtain the absolute path name for * relative paths (relPath) that include "./" or "../" in their names. diff --git a/src/lib/evil/evil_util.c b/src/lib/evil/evil_util.c index e47475371a..7add78f888 100644 --- a/src/lib/evil/evil_util.c +++ b/src/lib/evil/evil_util.c @@ -168,19 +168,6 @@ _evil_last_error_display(const char *fct) fprintf(stderr, "[Evil] [%s] ERROR: %s\n", fct, evil_last_error_get()); } - -const char * -evil_tmpdir_get(void) -{ - return NULL; -} - -const char * -evil_homedir_get(void) -{ - return NULL; -} - int evil_path_is_absolute(const char *path) { diff --git a/src/lib/evil/evil_util.h b/src/lib/evil/evil_util.h index e1fdf26387..5709371f18 100644 --- a/src/lib/evil/evil_util.h +++ b/src/lib/evil/evil_util.h @@ -63,59 +63,6 @@ EAPI const char *evil_format_message(long err); EAPI const char *evil_last_error_get(void); -/** - * @brief Return a dir to store temporary files. - * - * @return The directory to store temporary files. - * - * Return a directory to store temporary files. The function gets - * the value of the following environment variables, and in that order: - * - TMP - * - TEMP - * - USERPROFILE - * - WINDIR - * and returns its value if it exists. If none exists, the function - * returns "C:\". - * - * Conformity: Non applicable. - * - * 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 - */ -EAPI const char *evil_tmpdir_get(void); - -/** - * @brief Return a dir to store personal files. - * - * @return The directory to store personal files. - * - * Return a directory to store personal files. The function gets - * the value of the following environment variables, and in that order: - * - HOME - * - USERPROFILE - * - WINDIR - * and returns its value if it exists. If none exists, the function - * returns "C:\". - * - * Conformity: Non applicable. - * - * 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 - */ -EAPI const char *evil_homedir_get(void); - /** * @brief check if the given path is absolute. * diff --git a/src/lib/evil/meson.build b/src/lib/evil/meson.build index ff9630aa2b..482e733637 100644 --- a/src/lib/evil/meson.build +++ b/src/lib/evil/meson.build @@ -51,16 +51,15 @@ if target_machine.system() == 'windows' ws2_32 = cc.find_library('ws2_32') secur32 = cc.find_library('secur32') uuid = cc.find_library('uuid') - msvcr100 = cc.find_library('msvcr100') evil_lib = library('evil', evil_src, - dependencies : [psapi, ole32, ws2_32, secur32, uuid, msvcr100], + dependencies : [psapi, ole32, ws2_32, secur32, uuid], include_directories : [config_dir, include_directories('regex')], ) evil = declare_dependency( include_directories: [config_dir, include_directories('regex'), include_directories('.')], - dependencies : [psapi, ole32, ws2_32, secur32, uuid, msvcr100], + dependencies : [psapi, ole32, ws2_32, secur32, uuid], link_with: evil_lib, ) else diff --git a/src/lib/evil/sys/mman.h b/src/lib/evil/sys/mman.h index 0a36ebf416..93b6bd4914 100644 --- a/src/lib/evil/sys/mman.h +++ b/src/lib/evil/sys/mman.h @@ -130,7 +130,7 @@ EAPI void *mmap(void *addr, * Unmaps a mapped view of a file from the calling process's * address space. @p addr is the pointer to the base address. * This value must be identical to the value returned by a - * previous call to mmap(). The parameter @p len is unsed. + * previous call to mmap(). The parameter @p len is unused. * * Conformity: None. * diff --git a/src/modules/ecore_buffer/shm/meson.build b/src/modules/ecore_buffer/shm/meson.build index 30da825227..baf9a0fc5a 100644 --- a/src/modules/ecore_buffer/shm/meson.build +++ b/src/modules/ecore_buffer/shm/meson.build @@ -1,5 +1,7 @@ -ecore_buffer_shm_mod = shared_module('ecore_buffer_shm_mod', +ecore_buffer_shm_mod = shared_module('module', 'ecore_buffer_shm.c', + name_prefix: '', dependencies: [ecore, ecore_buffer], - install: true -) \ No newline at end of file + install: true, + install_dir: join_paths(dir_lib, 'ecore_buffer', 'modules', 'shm', version_name) +) diff --git a/src/modules/ecore_buffer/x11_dri2/meson.build b/src/modules/ecore_buffer/x11_dri2/meson.build index 37ed534bd3..b63823b3bc 100644 --- a/src/modules/ecore_buffer/x11_dri2/meson.build +++ b/src/modules/ecore_buffer/x11_dri2/meson.build @@ -1,5 +1,7 @@ -ecore_buffer_x11_dri2_mod = shared_module('ecore_buffer_x11_dri2_mod', +ecore_buffer_x11_dri2_mod = shared_module('module', 'ecore_buffer_x11_dri2.c', + name_prefix: '', dependencies: [ecore, ecore_buffer, ecore_x], - install: true -) \ No newline at end of file + install: true, + install_dir: join_paths(dir_lib, 'ecore_buffer', 'modules', 'x11_dri2', version_name) +) diff --git a/src/modules/ecore_buffer/x11_dri3/meson.build b/src/modules/ecore_buffer/x11_dri3/meson.build index 5126fff6ca..e3a7dd18e4 100644 --- a/src/modules/ecore_buffer/x11_dri3/meson.build +++ b/src/modules/ecore_buffer/x11_dri3/meson.build @@ -1,7 +1,9 @@ if dependency('libtbm', required: false).found() == true and dependency('libdrm', required: false).found() - ecore_buffer_x11_dri3_mod = shared_module('ecore_buffer_x11_dri3_mod', + ecore_buffer_x11_dri3_mod = shared_module('module', 'ecore_buffer_x11_dri3.c', + name_prefix: '', dependencies: [ecore, ecore_buffer, ecore_x], - install: true + install: true, + install_dir: join_paths(dir_lib, 'ecore_buffer', 'modules', 'x11_dri3', version_name) ) -endif \ No newline at end of file +endif 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 5668b416d1..c60293cb40 100644 --- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c +++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c @@ -231,92 +231,52 @@ static void _drm_rotation_do(Ecore_Evas *ee, int rotation, int resize) { Evas_Engine_Info_Drm *einfo; - Ecore_Evas_Engine_Drm_Data *edata; - Eina_Bool use_hw = EINA_FALSE; - int diff, rotations = 0, orient = 0; - - if (ee->rotation == rotation) return; + int diff; einfo = (Evas_Engine_Info_Drm *)evas_engine_info_get(ee->evas); if (!einfo) return; - edata = ee->engine.data; - - rotations = ecore_drm2_output_supported_rotations_get(edata->output); - if (rotations >= 0) - { - if (rotations & ECORE_DRM2_ROTATION_NORMAL) - { - if (rotation == 0) - { - use_hw = EINA_TRUE; - orient = ECORE_DRM2_ROTATION_NORMAL; - } - } - - if (rotations & ECORE_DRM2_ROTATION_90) - { - if (rotation == 90) - { - use_hw = EINA_TRUE; - orient = ECORE_DRM2_ROTATION_90; - } - } - - if (rotations & ECORE_DRM2_ROTATION_180) - { - if (rotation == 180) - { - use_hw = EINA_TRUE; - orient = ECORE_DRM2_ROTATION_180; - } - } - - if (rotations & ECORE_DRM2_ROTATION_270) - { - if (rotation == 270) - { - use_hw = EINA_TRUE; - orient = ECORE_DRM2_ROTATION_270; - } - } - } - - if (use_hw) - { - ecore_drm2_output_rotation_set(edata->output, orient); - ee->rotation = rotation; - return; - } - - einfo->info.rotation = rotation; - if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) - ERR("evas_engine_info_set() for engine '%s' failed", ee->driver); - diff = ee->rotation - rotation; if (diff < 0) diff = -diff; + einfo->info.rotation = rotation; + if (diff != 180) { + if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) + ERR("evas_engine_info_set() for engine '%s' failed", ee->driver); + if (!resize) { - int ww, hh; - - if (ECORE_EVAS_PORTRAIT(ee)) + if (!ee->prop.fullscreen) + { + ee->expecting_resize.w = ee->h; + ee->expecting_resize.h = ee->w; + evas_output_size_set(ee->evas, ee->req.h, ee->req.w); + evas_output_viewport_set(ee->evas, 0, 0, ee->req.h, ee->req.w); + } + else + { + if (PORTRAIT_CHECK(rotation)) + { + evas_output_size_set(ee->evas, ee->req.w, ee->req.h); + evas_output_viewport_set(ee->evas, 0, 0, ee->req.w, ee->req.h); + } + else + { + evas_output_size_set(ee->evas, ee->req.h, ee->req.w); + evas_output_viewport_set(ee->evas, 0, 0, ee->req.h, ee->req.w); + } + if (ee->func.fn_resize) ee->func.fn_resize(ee); + } + if (PORTRAIT_CHECK(rotation)) evas_damage_rectangle_add(ee->evas, 0, 0, ee->req.w, ee->req.h); else evas_damage_rectangle_add(ee->evas, 0, 0, ee->req.h, ee->req.w); - - ww = ee->h; - hh = ee->w; - ee->w = ww; - ee->h = hh; - ee->req.w = ww; - ee->req.h = hh; } else { - if ((rotation == 0) || (rotation == 180)) + if (PORTRAIT_CHECK(rotation)) { evas_output_size_set(ee->evas, ee->w, ee->h); evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h); @@ -326,17 +286,25 @@ _drm_rotation_do(Ecore_Evas *ee, int rotation, int resize) evas_output_size_set(ee->evas, ee->h, ee->w); evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w); } + if (ee->func.fn_resize) ee->func.fn_resize(ee); + if (PORTRAIT_CHECK(rotation)) + evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); + else + evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w); } + ee->rotation = rotation; } - - ee->rotation = rotation; - - if (ee->func.fn_resize) ee->func.fn_resize(ee); - - if (ECORE_EVAS_PORTRAIT(ee)) - evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); else - evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w); + { + if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) + ERR("evas_engine_info_set() for engine '%s' failed", ee->driver); + ee->rotation = rotation; + if (ee->func.fn_resize) ee->func.fn_resize(ee); + if (PORTRAIT_CHECK(rotation)) + evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); + else + evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w); + } } static void 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 396069b0c0..28f743ae71 100644 --- a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c +++ b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c @@ -338,7 +338,7 @@ _ecore_evas_modifiers_locks_mask_set(Evas *e, int mask) } static void -_ecore_evas_extn_cb_mouse_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +_ecore_evas_extn_cb_mouse_in(void *data, Evas *e, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Ecore_Evas *ee = data; Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; @@ -353,14 +353,14 @@ _ecore_evas_extn_cb_mouse_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj E memset(&ipc, 0, sizeof(ipc)); ipc.timestamp = ev->timestamp; - ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas); + ipc.mask = _ecore_evas_modifiers_locks_mask_get(e); ipc.event_flags = ev->event_flags; ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MOUSE_IN, 0, 0, 0, &ipc, sizeof(ipc)); } } static void -_ecore_evas_extn_cb_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +_ecore_evas_extn_cb_mouse_out(void *data, Evas *e, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Ecore_Evas *ee = data; Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; @@ -375,14 +375,14 @@ _ecore_evas_extn_cb_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj memset(&ipc, 0, sizeof(ipc)); ipc.timestamp = ev->timestamp; - ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas); + ipc.mask = _ecore_evas_modifiers_locks_mask_get(e); ipc.event_flags = ev->event_flags; ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MOUSE_OUT, 0, 0, 0, &ipc, sizeof(ipc)); } } static void -_ecore_evas_extn_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +_ecore_evas_extn_cb_mouse_down(void *data, Evas *e, Evas_Object *obj EINA_UNUSED, void *event_info) { Ecore_Evas *ee = data; Evas_Event_Mouse_Down *ev = event_info; @@ -405,7 +405,7 @@ _ecore_evas_extn_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj ipc_move.x = x; ipc_move.y = y; ipc_move.timestamp = ev->timestamp; - ipc_move.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas); + ipc_move.mask = _ecore_evas_modifiers_locks_mask_get(e); ipc_move.event_flags = ev->event_flags; ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MOUSE_MOVE, 0, 0, 0, &ipc_move, sizeof(ipc_move)); } @@ -415,7 +415,7 @@ _ecore_evas_extn_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj ipc.b = ev->button; ipc.flags = ev->flags; ipc.timestamp = ev->timestamp; - ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas); + ipc.mask = _ecore_evas_modifiers_locks_mask_get(e); ipc.event_flags = ev->event_flags; ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MOUSE_DOWN, 0, 0, 0, &ipc, sizeof(ipc)); } @@ -423,7 +423,7 @@ _ecore_evas_extn_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj } static void -_ecore_evas_extn_cb_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +_ecore_evas_extn_cb_mouse_up(void *data, Evas *e, Evas_Object *obj EINA_UNUSED, void *event_info) { Ecore_Evas *ee = data; Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; @@ -440,14 +440,14 @@ _ecore_evas_extn_cb_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj E ipc.b = ev->button; ipc.flags = ev->flags; ipc.timestamp = ev->timestamp; - ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas); + ipc.mask = _ecore_evas_modifiers_locks_mask_get(e); ipc.event_flags = ev->event_flags; ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MOUSE_UP, 0, 0, 0, &ipc, sizeof(ipc)); } } static void -_ecore_evas_extn_cb_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +_ecore_evas_extn_cb_mouse_move(void *data, Evas *e, Evas_Object *obj EINA_UNUSED, void *event_info) { Ecore_Evas *ee = data; Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; @@ -468,14 +468,14 @@ _ecore_evas_extn_cb_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj ipc.x = x; ipc.y = y; ipc.timestamp = ev->timestamp; - ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas); + ipc.mask = _ecore_evas_modifiers_locks_mask_get(e); ipc.event_flags = ev->event_flags; ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MOUSE_MOVE, 0, 0, 0, &ipc, sizeof(ipc)); } } static void -_ecore_evas_extn_cb_mouse_wheel(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +_ecore_evas_extn_cb_mouse_wheel(void *data, Evas *e, Evas_Object *obj EINA_UNUSED, void *event_info) { Ecore_Evas *ee = data; Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; @@ -492,14 +492,14 @@ _ecore_evas_extn_cb_mouse_wheel(void *data, Evas *e EINA_UNUSED, Evas_Object *ob ipc.direction = ev->direction; ipc.z = ev->z; ipc.timestamp = ev->timestamp; - ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas); + ipc.mask = _ecore_evas_modifiers_locks_mask_get(e); ipc.event_flags = ev->event_flags; ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MOUSE_WHEEL, 0, 0, 0, &ipc, sizeof(ipc)); } } static void -_ecore_evas_extn_cb_multi_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +_ecore_evas_extn_cb_multi_down(void *data, Evas *e, Evas_Object *obj EINA_UNUSED, void *event_info) { Ecore_Evas *ee = data; Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; @@ -529,7 +529,7 @@ _ecore_evas_extn_cb_multi_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj ipc.fy = ev->canvas.ysub; ipc.flags = ev->flags; ipc.timestamp = ev->timestamp; - ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas); + ipc.mask = _ecore_evas_modifiers_locks_mask_get(e); ipc.event_flags = ev->event_flags; ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MULTI_DOWN, 0, 0, 0, &ipc, sizeof(ipc)); } @@ -537,7 +537,7 @@ _ecore_evas_extn_cb_multi_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj static void -_ecore_evas_extn_cb_multi_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +_ecore_evas_extn_cb_multi_up(void *data, Evas *e, Evas_Object *obj EINA_UNUSED, void *event_info) { Ecore_Evas *ee = data; Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; @@ -567,14 +567,14 @@ _ecore_evas_extn_cb_multi_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj E ipc.fy = ev->canvas.ysub; ipc.flags = ev->flags; ipc.timestamp = ev->timestamp; - ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas); + ipc.mask = _ecore_evas_modifiers_locks_mask_get(e); ipc.event_flags = ev->event_flags; ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MULTI_UP, 0, 0, 0, &ipc, sizeof(ipc)); } } static void -_ecore_evas_extn_cb_multi_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +_ecore_evas_extn_cb_multi_move(void *data, Evas *e, Evas_Object *obj EINA_UNUSED, void *event_info) { Ecore_Evas *ee = data; Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; @@ -603,14 +603,14 @@ _ecore_evas_extn_cb_multi_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj ipc.fx = ev->cur.canvas.xsub; ipc.fy = ev->cur.canvas.ysub; ipc.timestamp = ev->timestamp; - ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas); + ipc.mask = _ecore_evas_modifiers_locks_mask_get(e); ipc.event_flags = ev->event_flags; ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MULTI_MOVE, 0, 0, 0, &ipc, sizeof(ipc)); } } static void -_ecore_evas_extn_cb_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +_ecore_evas_extn_cb_key_down(void *data, Evas *e, Evas_Object *obj EINA_UNUSED, void *event_info) { Ecore_Evas *ee = data; Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; @@ -660,14 +660,14 @@ _ecore_evas_extn_cb_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj E p += strlen(p) + 1; } ipc->timestamp = ev->timestamp; - ipc->mask = _ecore_evas_modifiers_locks_mask_get(ee->evas); + ipc->mask = _ecore_evas_modifiers_locks_mask_get(e); ipc->event_flags = ev->event_flags; ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_KEY_DOWN, 0, 0, 0, ipc, len); } } static void -_ecore_evas_extn_cb_key_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +_ecore_evas_extn_cb_key_up(void *data, Evas *e, Evas_Object *obj EINA_UNUSED, void *event_info) { Ecore_Evas *ee = data; Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; @@ -717,7 +717,7 @@ _ecore_evas_extn_cb_key_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EIN p += strlen(p) + 1; } ipc->timestamp = ev->timestamp; - ipc->mask = _ecore_evas_modifiers_locks_mask_get(ee->evas); + ipc->mask = _ecore_evas_modifiers_locks_mask_get(e); ipc->event_flags = ev->event_flags; ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_KEY_UP, 0, 0, 0, ipc, len); } diff --git a/src/modules/ecore_imf/scim/scim_imcontext.cpp b/src/modules/ecore_imf/scim/scim_imcontext.cpp index 404f880d17..993a7d8f37 100644 --- a/src/modules/ecore_imf/scim/scim_imcontext.cpp +++ b/src/modules/ecore_imf/scim/scim_imcontext.cpp @@ -358,7 +358,7 @@ find_ic(int id) static void feed_key_event(Evas *evas, const char *str, Eina_Bool fake) { - char key_string[128] = {0}; + char key_string[128] = { 0 }; unsigned int timestamp = 0; if (!fake) @@ -366,15 +366,26 @@ feed_key_event(Evas *evas, const char *str, Eina_Bool fake) if (strncmp(str, "KeyRelease+", 11) == 0) { - strncpy(key_string, str + 11, strlen(str)-11); - evas_event_feed_key_up(evas, key_string, key_string, NULL, NULL, timestamp, NULL); + if ((strlen(str) - 11 + 1) > sizeof(key_string)) + { + fprintf(stderr, "Key string too long: '%s'", str); + return; + } + strcpy(key_string, str + 11); + evas_event_feed_key_up(evas, key_string, key_string, NULL, NULL, + timestamp, NULL); SCIM_DEBUG_FRONTEND(1) << " evas_event_feed_key_up()...\n"; } else { - if (strlen(str) + 1 > 128) return; - strncpy(key_string, str, strlen(str) + 1); - evas_event_feed_key_down(evas, key_string, key_string, NULL, NULL, timestamp, NULL); + if ((strlen(str) + 1) > sizeof(key_string)) + { + fprintf(stderr, "Key string too long: '%s'", str); + return; + } + strcpy(key_string, str); + evas_event_feed_key_down(evas, key_string, key_string, NULL, NULL, + timestamp, NULL); SCIM_DEBUG_FRONTEND(1) << " evas_event_feed_key_down()...\n"; } } diff --git a/src/modules/ecore_imf/xim/ecore_imf_xim.c b/src/modules/ecore_imf/xim/ecore_imf_xim.c index d50cea20d9..ba5dad58ab 100644 --- a/src/modules/ecore_imf/xim/ecore_imf_xim.c +++ b/src/modules/ecore_imf/xim/ecore_imf_xim.c @@ -795,7 +795,7 @@ _ecore_imf_xim_init(void) static void _ecore_imf_xim_shutdown(void) { - while (open_ims) + if (open_ims) { XIM_Im_Info *info = open_ims->data; Ecore_X_Display *display = ecore_x_display_get(); diff --git a/src/modules/elementary/access_output/mod.c b/src/modules/elementary/access_output/mod.c index f1c9dafd46..f51b512a47 100644 --- a/src/modules/elementary/access_output/mod.c +++ b/src/modules/elementary/access_output/mod.c @@ -4,7 +4,9 @@ #include "Elementary.h" -#define ELEMENTARY_BUILD +#ifndef EFL_BUILD +# define EFL_BUILD +#endif #undef ELM_MODULE_HELPER_H #include "elm_module_helper.h" 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 73b73e87e2..077bd7d14e 100644 --- a/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c +++ b/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c @@ -6,10 +6,12 @@ #include "elm_module_helper.h" #include "elm_widget.h" #include "efl_ui_clock_private.h" -#include "elm_ctxpopup_item.eo.h" -#include "elm_ctxpopup.eo.h" +#include "elm_ctxpopup_item_eo.h" +#include "elm_ctxpopup_eo.h" -#define ELEMENTARY_BUILD +#ifndef EFL_BUILD +# define EFL_BUILD +#endif #undef ELM_MODULE_HELPER_H #include "elm_module_helper.h" diff --git a/src/modules/elementary/prefs/elm_entry.c b/src/modules/elementary/prefs/elm_entry.c index b34102aa15..db0155335f 100644 --- a/src/modules/elementary/prefs/elm_entry.c +++ b/src/modules/elementary/prefs/elm_entry.c @@ -2,7 +2,7 @@ #include "elm_widget.h" #include #include -#include "elm_entry.eo.h" +#include "elm_entry_eo.h" #define BLINK_INTERVAL 0.1 diff --git a/src/modules/elementary/prefs/elm_spinner.c b/src/modules/elementary/prefs/elm_spinner.c index 6b169fca69..2463628e96 100644 --- a/src/modules/elementary/prefs/elm_spinner.c +++ b/src/modules/elementary/prefs/elm_spinner.c @@ -1,5 +1,5 @@ #include "private.h" -#include "elm_spinner.eo.h" +#include "elm_spinner_eo.h" static Elm_Prefs_Item_Type supported_types[] = { diff --git a/src/modules/elementary/prefs/prefs_iface.c b/src/modules/elementary/prefs/prefs_iface.c index 4943cd4566..d09658a052 100644 --- a/src/modules/elementary/prefs/prefs_iface.c +++ b/src/modules/elementary/prefs/prefs_iface.c @@ -4,7 +4,9 @@ #include "Elementary.h" -#define ELEMENTARY_BUILD +#ifndef EFL_BUILD +# define EFL_BUILD +#endif #undef ELM_MODULE_HELPER_H #include "private.h" diff --git a/src/modules/elementary/test_entry/mod.c b/src/modules/elementary/test_entry/mod.c index 0d16e22226..b80cb182ce 100644 --- a/src/modules/elementary/test_entry/mod.c +++ b/src/modules/elementary/test_entry/mod.c @@ -4,7 +4,9 @@ #include "Elementary.h" -#define ELEMENTARY_BUILD +#ifndef EFL_BUILD +# define EFL_BUILD +#endif #undef ELM_MODULE_HELPER_H #include "elm_module_helper.h" diff --git a/src/modules/elementary/test_map/mod.c b/src/modules/elementary/test_map/mod.c index 4d7db03284..15c4ff3344 100644 --- a/src/modules/elementary/test_map/mod.c +++ b/src/modules/elementary/test_map/mod.c @@ -6,7 +6,9 @@ #include "elm_module_helper.h" #include "elm_widget_map.h" -#define ELEMENTARY_BUILD +#ifndef EFL_BUILD +# define EFL_BUILD +#endif #undef ELM_MODULE_HELPER_H #include "elm_module_helper.h" diff --git a/src/modules/elementary/web/none/elm_web_none.c b/src/modules/elementary/web/none/elm_web_none.c index e06245a7b0..88218462dc 100644 --- a/src/modules/elementary/web/none/elm_web_none.c +++ b/src/modules/elementary/web/none/elm_web_none.c @@ -9,10 +9,12 @@ #include "elm_priv.h" #include "elm_widget_web.h" -#define ELEMENTARY_BUILD +#ifndef EFL_BUILD +# define EFL_BUILD +#endif #undef ELM_MODULE_HELPER_H #include "elm_module_helper.h" -#include "elm_web_none.eo.h" +#include "elm_web_none_eo.h" #define MY_CLASS ELM_WEB_CLASS @@ -57,7 +59,6 @@ _elm_web_none_efl_canvas_group_group_add(Eo *obj, Elm_Web_None_Data *_pd EINA_UN elm_widget_resize_object_set(obj, resize_obj); efl_canvas_group_add(efl_super(obj, MY_CLASS)); - elm_widget_sub_object_parent_add(obj); } EOLIAN static Evas_Object* @@ -147,7 +148,7 @@ _elm_web_none_elm_web_bg_color_get(const Eo *obj EINA_UNUSED, Elm_Web_None_Data if (a) *a = 0; } -EOLIAN static const char* +EOLIAN static char* _elm_web_none_elm_web_selection_get(const Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED) { return NULL; @@ -365,4 +366,4 @@ ewm_class_get(void) #define ELM_WEB_NONE_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_OPS(elm_web_none) -#include "elm_web_none.eo.c" +#include "elm_web_none_eo.c" diff --git a/src/modules/elementary/web/none/elm_web_none.eo b/src/modules/elementary/web/none/elm_web_none.eo deleted file mode 100644 index d00d2d68a0..0000000000 --- a/src/modules/elementary/web/none/elm_web_none.eo +++ /dev/null @@ -1,42 +0,0 @@ -class Elm.Web.None extends Elm.Web implements Efl.Ui.Legacy -{ - [[Elementary web module class]] - implements { - Elm.Web.tab_propagate { get; set; } - Elm.Web.webkit_view { get; } - Elm.Web.window_create_hook { set; } - Elm.Web.dialog_alert_hook { set; } - Elm.Web.dialog_confirm_hook { set; } - Elm.Web.dialog_prompt_hook { set; } - Elm.Web.dialog_file_selector_hook { set; } - Elm.Web.console_message_hook { set; } - Elm.Web.useragent { get; set; } - Elm.Web.url { get; set; } - Elm.Web.html_string_load; - Elm.Web.title { get; } - Elm.Web.bg_color { get; set; } - Elm.Web.selection { get; } - Elm.Web.popup_selected { set; } - Elm.Web.popup_destroy; - Elm.Web.text_search; - Elm.Web.text_matches_mark; - Elm.Web.text_matches_unmark_all; - Elm.Web.text_matches_highlight { get; set; } - Elm.Web.load_progress { get; } - Elm.Web.stop; - Elm.Web.reload; - Elm.Web.reload_full; - Elm.Web.back; - Elm.Web.forward; - Elm.Web.navigate; - Elm.Web.back_possible { get; } - Elm.Web.forward_possible { get; } - Elm.Web.navigate_possible_get; - Elm.Web.history_enabled { 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/elementary/web/none/elm_web_none_eo.c b/src/modules/elementary/web/none/elm_web_none_eo.c new file mode 100644 index 0000000000..8fd029ecfd --- /dev/null +++ b/src/modules/elementary/web/none/elm_web_none_eo.c @@ -0,0 +1,211 @@ + +void _elm_web_none_elm_web_tab_propagate_set(Eo *obj, Elm_Web_None_Data *pd, Eina_Bool propagate); + + +Eina_Bool _elm_web_none_elm_web_tab_propagate_get(const Eo *obj, Elm_Web_None_Data *pd); + + +Efl_Canvas_Object *_elm_web_none_elm_web_webkit_view_get(const Eo *obj, Elm_Web_None_Data *pd); + + +void _elm_web_none_elm_web_window_create_hook_set(Eo *obj, Elm_Web_None_Data *pd, Elm_Web_Window_Open func, void *data); + + +void _elm_web_none_elm_web_dialog_alert_hook_set(Eo *obj, Elm_Web_None_Data *pd, Elm_Web_Dialog_Alert func, void *data); + + +void _elm_web_none_elm_web_dialog_confirm_hook_set(Eo *obj, Elm_Web_None_Data *pd, Elm_Web_Dialog_Confirm func, void *data); + + +void _elm_web_none_elm_web_dialog_prompt_hook_set(Eo *obj, Elm_Web_None_Data *pd, Elm_Web_Dialog_Prompt func, void *data); + + +void _elm_web_none_elm_web_dialog_file_selector_hook_set(Eo *obj, Elm_Web_None_Data *pd, Elm_Web_Dialog_File_Selector func, void *data); + + +void _elm_web_none_elm_web_console_message_hook_set(Eo *obj, Elm_Web_None_Data *pd, Elm_Web_Console_Message func, void *data); + + +void _elm_web_none_elm_web_useragent_set(Eo *obj, Elm_Web_None_Data *pd, const char *user_agent); + + +const char *_elm_web_none_elm_web_useragent_get(const Eo *obj, Elm_Web_None_Data *pd); + + +Eina_Bool _elm_web_none_elm_web_url_set(Eo *obj, Elm_Web_None_Data *pd, const char *url); + + +const char *_elm_web_none_elm_web_url_get(const Eo *obj, Elm_Web_None_Data *pd); + + +Eina_Bool _elm_web_none_elm_web_html_string_load(Eo *obj, Elm_Web_None_Data *pd, const char *html, const char *base_url, const char *unreachable_url); + + +Eina_Stringshare *_elm_web_none_elm_web_title_get(const Eo *obj, Elm_Web_None_Data *pd); + + +void _elm_web_none_elm_web_bg_color_set(Eo *obj, Elm_Web_None_Data *pd, int r, int g, int b, int a); + + +void _elm_web_none_elm_web_bg_color_get(const Eo *obj, Elm_Web_None_Data *pd, int *r, int *g, int *b, int *a); + + +char *_elm_web_none_elm_web_selection_get(const Eo *obj, Elm_Web_None_Data *pd); + + +void _elm_web_none_elm_web_popup_selected_set(Eo *obj, Elm_Web_None_Data *pd, int idx); + + +Eina_Bool _elm_web_none_elm_web_popup_destroy(Eo *obj, Elm_Web_None_Data *pd); + + +Eina_Bool _elm_web_none_elm_web_text_search(const Eo *obj, Elm_Web_None_Data *pd, const char *string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap); + + +unsigned int _elm_web_none_elm_web_text_matches_mark(Eo *obj, Elm_Web_None_Data *pd, const char *string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit); + + +Eina_Bool _elm_web_none_elm_web_text_matches_unmark_all(Eo *obj, Elm_Web_None_Data *pd); + + +Eina_Bool _elm_web_none_elm_web_text_matches_highlight_set(Eo *obj, Elm_Web_None_Data *pd, Eina_Bool highlight); + + +Eina_Bool _elm_web_none_elm_web_text_matches_highlight_get(const Eo *obj, Elm_Web_None_Data *pd); + + +double _elm_web_none_elm_web_load_progress_get(const Eo *obj, Elm_Web_None_Data *pd); + + +Eina_Bool _elm_web_none_elm_web_stop(Eo *obj, Elm_Web_None_Data *pd); + + +Eina_Bool _elm_web_none_elm_web_reload(Eo *obj, Elm_Web_None_Data *pd); + + +Eina_Bool _elm_web_none_elm_web_reload_full(Eo *obj, Elm_Web_None_Data *pd); + + +Eina_Bool _elm_web_none_elm_web_back(Eo *obj, Elm_Web_None_Data *pd); + + +Eina_Bool _elm_web_none_elm_web_forward(Eo *obj, Elm_Web_None_Data *pd); + + +Eina_Bool _elm_web_none_elm_web_navigate(Eo *obj, Elm_Web_None_Data *pd, int steps); + + +Eina_Bool _elm_web_none_elm_web_back_possible_get(const Eo *obj, Elm_Web_None_Data *pd); + + +Eina_Bool _elm_web_none_elm_web_forward_possible_get(const Eo *obj, Elm_Web_None_Data *pd); + + +Eina_Bool _elm_web_none_elm_web_navigate_possible_get(Eo *obj, Elm_Web_None_Data *pd, int steps); + + +void _elm_web_none_elm_web_history_enabled_set(Eo *obj, Elm_Web_None_Data *pd, Eina_Bool enable); + + +Eina_Bool _elm_web_none_elm_web_history_enabled_get(const Eo *obj, Elm_Web_None_Data *pd); + + +void _elm_web_none_efl_ui_zoom_zoom_level_set(Eo *obj, Elm_Web_None_Data *pd, double zoom); + + +double _elm_web_none_efl_ui_zoom_zoom_level_get(const Eo *obj, Elm_Web_None_Data *pd); + + +void _elm_web_none_efl_ui_zoom_zoom_mode_set(Eo *obj, Elm_Web_None_Data *pd, Efl_Ui_Zoom_Mode mode); + + +Efl_Ui_Zoom_Mode _elm_web_none_efl_ui_zoom_zoom_mode_get(const Eo *obj, Elm_Web_None_Data *pd); + + +void _elm_web_none_elm_web_region_show(Eo *obj, Elm_Web_None_Data *pd, int x, int y, int w, int h); + + +void _elm_web_none_elm_web_region_bring_in(Eo *obj, Elm_Web_None_Data *pd, int x, int y, int w, int h); + + +void _elm_web_none_elm_web_inwin_mode_set(Eo *obj, Elm_Web_None_Data *pd, Eina_Bool value); + + +Eina_Bool _elm_web_none_elm_web_inwin_mode_get(const Eo *obj, Elm_Web_None_Data *pd); + + +static Eina_Bool +_elm_web_none_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_WEB_NONE_EXTRA_OPS +#define ELM_WEB_NONE_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_web_tab_propagate_set, _elm_web_none_elm_web_tab_propagate_set), + EFL_OBJECT_OP_FUNC(elm_obj_web_tab_propagate_get, _elm_web_none_elm_web_tab_propagate_get), + EFL_OBJECT_OP_FUNC(elm_obj_web_webkit_view_get, _elm_web_none_elm_web_webkit_view_get), + EFL_OBJECT_OP_FUNC(elm_obj_web_window_create_hook_set, _elm_web_none_elm_web_window_create_hook_set), + EFL_OBJECT_OP_FUNC(elm_obj_web_dialog_alert_hook_set, _elm_web_none_elm_web_dialog_alert_hook_set), + EFL_OBJECT_OP_FUNC(elm_obj_web_dialog_confirm_hook_set, _elm_web_none_elm_web_dialog_confirm_hook_set), + EFL_OBJECT_OP_FUNC(elm_obj_web_dialog_prompt_hook_set, _elm_web_none_elm_web_dialog_prompt_hook_set), + EFL_OBJECT_OP_FUNC(elm_obj_web_dialog_file_selector_hook_set, _elm_web_none_elm_web_dialog_file_selector_hook_set), + EFL_OBJECT_OP_FUNC(elm_obj_web_console_message_hook_set, _elm_web_none_elm_web_console_message_hook_set), + EFL_OBJECT_OP_FUNC(elm_obj_web_useragent_set, _elm_web_none_elm_web_useragent_set), + EFL_OBJECT_OP_FUNC(elm_obj_web_useragent_get, _elm_web_none_elm_web_useragent_get), + EFL_OBJECT_OP_FUNC(elm_obj_web_url_set, _elm_web_none_elm_web_url_set), + EFL_OBJECT_OP_FUNC(elm_obj_web_url_get, _elm_web_none_elm_web_url_get), + EFL_OBJECT_OP_FUNC(elm_obj_web_html_string_load, _elm_web_none_elm_web_html_string_load), + EFL_OBJECT_OP_FUNC(elm_obj_web_title_get, _elm_web_none_elm_web_title_get), + EFL_OBJECT_OP_FUNC(elm_obj_web_bg_color_set, _elm_web_none_elm_web_bg_color_set), + EFL_OBJECT_OP_FUNC(elm_obj_web_bg_color_get, _elm_web_none_elm_web_bg_color_get), + EFL_OBJECT_OP_FUNC(elm_obj_web_selection_get, _elm_web_none_elm_web_selection_get), + EFL_OBJECT_OP_FUNC(elm_obj_web_popup_selected_set, _elm_web_none_elm_web_popup_selected_set), + EFL_OBJECT_OP_FUNC(elm_obj_web_popup_destroy, _elm_web_none_elm_web_popup_destroy), + EFL_OBJECT_OP_FUNC(elm_obj_web_text_search, _elm_web_none_elm_web_text_search), + EFL_OBJECT_OP_FUNC(elm_obj_web_text_matches_mark, _elm_web_none_elm_web_text_matches_mark), + EFL_OBJECT_OP_FUNC(elm_obj_web_text_matches_unmark_all, _elm_web_none_elm_web_text_matches_unmark_all), + EFL_OBJECT_OP_FUNC(elm_obj_web_text_matches_highlight_set, _elm_web_none_elm_web_text_matches_highlight_set), + EFL_OBJECT_OP_FUNC(elm_obj_web_text_matches_highlight_get, _elm_web_none_elm_web_text_matches_highlight_get), + EFL_OBJECT_OP_FUNC(elm_obj_web_load_progress_get, _elm_web_none_elm_web_load_progress_get), + EFL_OBJECT_OP_FUNC(elm_obj_web_stop, _elm_web_none_elm_web_stop), + EFL_OBJECT_OP_FUNC(elm_obj_web_reload, _elm_web_none_elm_web_reload), + EFL_OBJECT_OP_FUNC(elm_obj_web_reload_full, _elm_web_none_elm_web_reload_full), + EFL_OBJECT_OP_FUNC(elm_obj_web_back, _elm_web_none_elm_web_back), + EFL_OBJECT_OP_FUNC(elm_obj_web_forward, _elm_web_none_elm_web_forward), + EFL_OBJECT_OP_FUNC(elm_obj_web_navigate, _elm_web_none_elm_web_navigate), + EFL_OBJECT_OP_FUNC(elm_obj_web_back_possible_get, _elm_web_none_elm_web_back_possible_get), + EFL_OBJECT_OP_FUNC(elm_obj_web_forward_possible_get, _elm_web_none_elm_web_forward_possible_get), + EFL_OBJECT_OP_FUNC(elm_obj_web_navigate_possible_get, _elm_web_none_elm_web_navigate_possible_get), + EFL_OBJECT_OP_FUNC(elm_obj_web_history_enabled_set, _elm_web_none_elm_web_history_enabled_set), + EFL_OBJECT_OP_FUNC(elm_obj_web_history_enabled_get, _elm_web_none_elm_web_history_enabled_get), + EFL_OBJECT_OP_FUNC(efl_ui_zoom_level_set, _elm_web_none_efl_ui_zoom_zoom_level_set), + EFL_OBJECT_OP_FUNC(efl_ui_zoom_level_get, _elm_web_none_efl_ui_zoom_zoom_level_get), + EFL_OBJECT_OP_FUNC(efl_ui_zoom_mode_set, _elm_web_none_efl_ui_zoom_zoom_mode_set), + EFL_OBJECT_OP_FUNC(efl_ui_zoom_mode_get, _elm_web_none_efl_ui_zoom_zoom_mode_get), + EFL_OBJECT_OP_FUNC(elm_obj_web_region_show, _elm_web_none_elm_web_region_show), + EFL_OBJECT_OP_FUNC(elm_obj_web_region_bring_in, _elm_web_none_elm_web_region_bring_in), + EFL_OBJECT_OP_FUNC(elm_obj_web_inwin_mode_set, _elm_web_none_elm_web_inwin_mode_set), + EFL_OBJECT_OP_FUNC(elm_obj_web_inwin_mode_get, _elm_web_none_elm_web_inwin_mode_get), + ELM_WEB_NONE_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_web_none_class_desc = { + EO_VERSION, + "Elm.Web.None", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Web_None_Data), + _elm_web_none_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_web_none_class_get, &_elm_web_none_class_desc, ELM_WEB_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/modules/elementary/web/none/elm_web_none_eo.h b/src/modules/elementary/web/none/elm_web_none_eo.h new file mode 100644 index 0000000000..8bf39b1461 --- /dev/null +++ b/src/modules/elementary/web/none/elm_web_none_eo.h @@ -0,0 +1,24 @@ +#ifndef _ELM_WEB_NONE_EO_H_ +#define _ELM_WEB_NONE_EO_H_ + +#ifndef _ELM_WEB_NONE_EO_CLASS_TYPE +#define _ELM_WEB_NONE_EO_CLASS_TYPE + +typedef Eo Elm_Web_None; + +#endif + +#ifndef _ELM_WEB_NONE_EO_TYPES +#define _ELM_WEB_NONE_EO_TYPES + + +#endif +/** Elementary web module class + * + * @ingroup Elm_Web_None + */ +#define ELM_WEB_NONE_CLASS elm_web_none_class_get() + +EWAPI const Efl_Class *elm_web_none_class_get(void); + +#endif diff --git a/src/modules/elementary/web/none/meson.build b/src/modules/elementary/web/none/meson.build index e71a16837d..632bca3bc4 100644 --- a/src/modules/elementary/web/none/meson.build +++ b/src/modules/elementary/web/none/meson.build @@ -1,26 +1,6 @@ -pub_eo_files = [ - 'elm_web_none.eo' -] - - -foreach eo_file : pub_eo_files - pub_eo_file_target += custom_target('eolian_gen_' + eo_file, - input : eo_file, - output : [eo_file + '.h'], - depfile : eo_file + '.d', - install : true, - install_dir : dir_package_include, - command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories, - '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'), - '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'), - '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'), - '-gchd', '@INPUT@']) -endforeach - - src = files([ 'elm_web_none.c' -]) + pub_eo_file_target +]) shared_module('none', src, diff --git a/src/modules/ethumb/emotion/emotion.c b/src/modules/ethumb/emotion/emotion.c index b80b33b8e5..bc343df802 100644 --- a/src/modules/ethumb/emotion/emotion.c +++ b/src/modules/ethumb/emotion/emotion.c @@ -1,7 +1,6 @@ #ifdef HAVE_CONFIG_H #include "config.h" #else -#define EFL_EO_API_SUPPORT #define EFL_BETA_API_SUPPORT #endif diff --git a/src/modules/ethumb/emotion/meson.build b/src/modules/ethumb/emotion/meson.build index 2acd578103..3ef9d4b12d 100644 --- a/src/modules/ethumb/emotion/meson.build +++ b/src/modules/ethumb/emotion/meson.build @@ -8,7 +8,7 @@ foreach edc_file : edc_files themes += custom_target('edje_cc_' + edc_file, input : edc_file, output : '@BASENAME@.edj', - command : edje_cc_exe + [ '-beta', + command : edje_cc_exe + [ '-beta', '-fastcomp', '-id', meson.current_source_dir(), '-fd', meson.current_source_dir(), '-sd', meson.current_source_dir(), @@ -17,7 +17,7 @@ foreach edc_file : edc_files '-md', meson.current_source_dir(), '-td', meson.current_source_dir(), '@INPUT@', '@OUTPUT@'], - depends : edje_cc) + depends : edje_depends) endforeach generic_src = [files(['emotion.c']) + themes] diff --git a/src/modules/evas/engines/drm/evas_engine.c b/src/modules/evas/engines/drm/evas_engine.c index 63719018ec..8e9eb67773 100644 --- a/src/modules/evas/engines/drm/evas_engine.c +++ b/src/modules/evas/engines/drm/evas_engine.c @@ -38,13 +38,13 @@ eng_output_setup(void *engine, void *einfo, unsigned int w, unsigned int h) _outbuf_rotation_get, _outbuf_reconfigure, NULL, - NULL, + _outbuf_damage_region_set, _outbuf_update_region_new, _outbuf_update_region_push, NULL, NULL, _outbuf_flush, - _outbuf_redraws_clear, + NULL, _outbuf_free, ob->w, ob->h)) goto init_err; @@ -70,33 +70,16 @@ eng_output_info_setup(void *info) einfo->render_mode = EVAS_RENDER_MODE_BLOCKING; } -static void -eng_output_resize(void *engine EINA_UNUSED, void *data, int w, int h) +static int +eng_output_update(void *engine EINA_UNUSED, void *data, void *einfo, unsigned int w, unsigned int h) { Render_Engine *re = data; Evas_Engine_Info_Drm *info; - info = re->generic.ob->info; - if (!info) return; - + info = (Evas_Engine_Info_Drm *)einfo; _outbuf_reconfigure(re->generic.ob, w, h, info->info.rotation, info->info.depth); - evas_common_tilebuf_free(re->generic.tb); - if ((re->generic.tb = evas_common_tilebuf_new(w, h))) - evas_common_tilebuf_set_tile_size(re->generic.tb, TILESIZE, TILESIZE); - - re->generic.w = w; - re->generic.h = h; -} - -static int -eng_output_update(void *engine, void *data, void *einfo EINA_UNUSED, unsigned int w, unsigned int h) -{ - Render_Engine *re = data; - - eng_output_resize(engine, data, w, h); - evas_render_engine_software_generic_update(&re->generic, re->generic.ob, w, h); @@ -251,7 +234,6 @@ module_open(Evas_Module *em) ORD(output_setup); ORD(output_update); ORD(output_free); - ORD(output_resize); ORD(image_plane_assign); ORD(image_plane_release); diff --git a/src/modules/evas/engines/drm/evas_engine.h b/src/modules/evas/engines/drm/evas_engine.h index ea8a6cec03..0afb1e3109 100644 --- a/src/modules/evas/engines/drm/evas_engine.h +++ b/src/modules/evas/engines/drm/evas_engine.h @@ -82,6 +82,7 @@ Render_Output_Swap_Mode _outbuf_state_get(Outbuf *ob); void *_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch); void _outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h); void _outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode); -void _outbuf_redraws_clear(Outbuf *ob); +void _outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage); +void _outbuf_idle_flush(Outbuf *ob); #endif diff --git a/src/modules/evas/engines/drm/evas_outbuf.c b/src/modules/evas/engines/drm/evas_outbuf.c index f53f9683db..1f22ae7faa 100644 --- a/src/modules/evas/engines/drm/evas_outbuf.c +++ b/src/modules/evas/engines/drm/evas_outbuf.c @@ -8,26 +8,6 @@ #define MAX_BUFFERS 10 #define QUEUE_TRIM_DURATION 100 -static void -_outbuf_buffer_swap(Outbuf *ob, Eina_Rectangle *rects, unsigned int count) -{ - /* Ecore_Drm2_Plane *plane; */ - Outbuf_Fb *ofb; - - ofb = ob->priv.draw; - if (!ofb) return; - - ecore_drm2_fb_dirty(ofb->fb, rects, count); - - if (!ob->priv.plane) - ob->priv.plane = ecore_drm2_plane_assign(ob->priv.output, ofb->fb, 0, 0); - else ecore_drm2_plane_fb_set(ob->priv.plane, ofb->fb); - - ecore_drm2_fb_flip(ofb->fb, ob->priv.output); - ofb->drawn = EINA_TRUE; - ofb->age = 0; -} - static Outbuf_Fb * _outbuf_fb_create(Outbuf *ob, int w, int h) { @@ -65,6 +45,126 @@ _outbuf_fb_destroy(Outbuf_Fb *ofb) free(ofb); } +static Outbuf_Fb * +_outbuf_fb_wait(Outbuf *ob) +{ + 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 + */ + EINA_LIST_FOREACH(ob->priv.fb_list, l, ofb) + { + num_allocated++; + if (ecore_drm2_fb_busy_get(ofb->fb)) + { + 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); + } + + return best; +} + +static Outbuf_Fb * +_outbuf_fb_assign(Outbuf *ob) +{ + 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, NULL); + + 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); + } + + EINA_LIST_FOREACH(ob->priv.fb_list, l, ofb) + { + if ((ofb->valid) && (ofb->drawn)) + { + ofb->age++; + if (ofb->age > 4) + { + ofb->age = 0; + ofb->drawn = EINA_FALSE; + } + } + } + + return ob->priv.draw; +} + +static void +_outbuf_buffer_swap(Outbuf *ob) +{ + Outbuf_Fb *ofb; + + ofb = ob->priv.draw; + if (!ofb) + { + ecore_drm2_fb_release(ob->priv.output, EINA_TRUE); + ofb = _outbuf_fb_assign(ob); + if (!ofb) + { + ERR("Could not assign front buffer"); + return; + } + } + + if (!ob->priv.plane) + ob->priv.plane = ecore_drm2_plane_assign(ob->priv.output, ofb->fb, 0, 0); + else ecore_drm2_plane_fb_set(ob->priv.plane, ofb->fb); + + ecore_drm2_fb_flip(ofb->fb, ob->priv.output); + ofb->drawn = EINA_TRUE; + ofb->age = 0; +} + Outbuf * _outbuf_setup(Evas_Engine_Info_Drm *info, int w, int h) { @@ -128,7 +228,6 @@ _outbuf_rotation_get(Outbuf *ob) void _outbuf_reconfigure(Outbuf *ob, int w, int h, int rotation, Outbuf_Depth depth) { - Outbuf_Fb *ofb; unsigned int format = DRM_FORMAT_ARGB8888; switch (depth) @@ -181,104 +280,7 @@ _outbuf_reconfigure(Outbuf *ob, int w, int h, int rotation, Outbuf_Depth depth) ob->rotation = rotation; ob->priv.unused_duration = 0; - EINA_LIST_FREE(ob->priv.fb_list, ofb) - _outbuf_fb_destroy(ofb); - - /* TODO: idle flush */ -} - -static Outbuf_Fb * -_outbuf_fb_wait(Outbuf *ob) -{ - 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 - */ - EINA_LIST_FOREACH(ob->priv.fb_list, l, ofb) - { - num_allocated++; - if (ecore_drm2_fb_busy_get(ofb->fb)) - { - 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); - } - - return best; -} - -static Eina_Bool -_outbuf_fb_assign(Outbuf *ob) -{ - 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); - } - - EINA_LIST_FOREACH(ob->priv.fb_list, l, ofb) - { - if ((ofb->valid) && (ofb->drawn)) - { - ofb->age++; - if (ofb->age > 4) - { - ofb->age = 0; - ofb->drawn = EINA_FALSE; - } - } - } - - return EINA_TRUE; + _outbuf_idle_flush(ob); } Render_Output_Swap_Mode @@ -286,7 +288,7 @@ _outbuf_state_get(Outbuf *ob) { int age; - if (!_outbuf_fb_assign(ob)) return MODE_FULL; + if (!ob->priv.draw) return MODE_FULL; age = ob->priv.draw->age; if (age > 4) return MODE_FULL; @@ -538,14 +540,55 @@ _outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage EINA_UNUSED, Tilebuf_Rect i++; } + + _outbuf_buffer_swap(ob); } void -_outbuf_redraws_clear(Outbuf *ob) +_outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage) { - if (!ob->priv.rect_count) return; + Tilebuf_Rect *tr; + Eina_Rectangle *rects; + Ecore_Drm2_Fb *fb; + int count, i = 0; - _outbuf_buffer_swap(ob, ob->priv.rects, ob->priv.rect_count); - free(ob->priv.rects); - ob->priv.rect_count = 0; + if (!ob->priv.draw) return; + + fb = ob->priv.draw->fb; + + count = eina_inlist_count(EINA_INLIST_GET(damage)); + rects = alloca(count * sizeof(Eina_Rectangle)); + + EINA_INLIST_FOREACH(damage, tr) + { + rects[i].x = tr->x; + rects[i].y = tr->y; + rects[i].w = tr->w; + rects[i].h = tr->h; + i++; + } + + ecore_drm2_fb_dirty(fb, rects, count); +} + +void +_outbuf_idle_flush(Outbuf *ob) +{ + while (ob->priv.pending) + { + RGBA_Image *img; + Eina_Rectangle *rect; + + img = ob->priv.pending->data; + ob->priv.pending = + eina_list_remove_list(ob->priv.pending, ob->priv.pending); + + rect = img->extended_info; + + evas_cache_image_drop(&img->cache_entry); + + eina_rectangle_free(rect); + } + + while (ecore_drm2_fb_release(ob->priv.output, EINA_TRUE)); } diff --git a/src/modules/evas/engines/eglfs/evas_engine.c b/src/modules/evas/engines/eglfs/evas_engine.c index 0574127a79..84d043b6cd 100644 --- a/src/modules/evas/engines/eglfs/evas_engine.c +++ b/src/modules/evas/engines/eglfs/evas_engine.c @@ -233,7 +233,8 @@ gl_extn_veto(Render_Engine *re) glsym_eglSwapBuffersWithDamage = NULL; } if (!strstr(str, "EGL_EXT_buffer_age")) _extn_have_buffer_age = 0; - if (!strstr(str, "EGL_EXT_swap_buffers_with_damage")) + if ((!strstr(str, "EGL_EXT_swap_buffers_with_damage")) && + (!strstr(str, "EGL_KHR_swap_buffers_with_damage"))) glsym_eglSwapBuffersWithDamage = NULL; } else diff --git a/src/modules/evas/engines/eglfs/evas_outbuf.c b/src/modules/evas/engines/eglfs/evas_outbuf.c index 9b65db242c..ba732861ab 100644 --- a/src/modules/evas/engines/eglfs/evas_outbuf.c +++ b/src/modules/evas/engines/eglfs/evas_outbuf.c @@ -8,7 +8,6 @@ static hwc_layer_1_t *fblayer; static hwc_composer_device_1_t *hwcDevicePtr; static hwc_display_contents_1_t **mList; -static unsigned char gl_context_valid = 0; void present(void *user_data, struct ANativeWindow *window, struct ANativeWindowBuffer *buffer) @@ -460,11 +459,10 @@ evas_outbuf_use(Outbuf *ob) glsym_evas_gl_preload_render_lock(_evas_outbuf_make_current, ob); - if ((_evas_eglfs_window) && (!gl_context_valid)) + if (_evas_eglfs_window) { if (eglGetCurrentContext() != _evas_eglfs_window->egl.context[0]) force = EINA_TRUE; - gl_context_valid = 1; } if ((_evas_eglfs_window != ob) || (force)) @@ -639,7 +637,6 @@ evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage EINA_UNUSED, Tilebuf_ end: glsym_evas_gl_preload_render_unlock(_evas_outbuf_make_current, ob); - gl_context_valid = 0; } Evas_Engine_GL_Context * diff --git a/src/modules/evas/engines/gl_common/evas_gl_font.c b/src/modules/evas/engines/gl_common/evas_gl_font.c index 3d5d436448..b7bd643756 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_font.c +++ b/src/modules/evas/engines/gl_common/evas_gl_font.c @@ -5,7 +5,7 @@ evas_gl_font_texture_new(void *context, RGBA_Font_Glyph *fg) { Evas_Engine_GL_Context *gc = context; Evas_GL_Texture *tex; - int w, h, j, nw, fh, y; + int w, h, nw, fh, y; DATA8 *ndata, *data, *p1, *p2; if (fg->ext_dat) return fg->ext_dat; // FIXME: one engine at a time can do this :( @@ -17,8 +17,6 @@ evas_gl_font_texture_new(void *context, RGBA_Font_Glyph *fg) if (!fg->glyph_out->rle) return NULL; data = evas_common_font_glyph_uncompress(fg, &w, &h); if (!data) return NULL; - j = w; - if (j < w) j = w; // expand to 32bit (4 byte) aligned rows for texture upload nw = ((w + 3) / 4) * 4; @@ -31,7 +29,7 @@ evas_gl_font_texture_new(void *context, RGBA_Font_Glyph *fg) // else copy row by row for (y = 0; y < h; y++) { - p1 = data + (j * y); + p1 = data + (w * y); p2 = ndata + (nw * y); memcpy(p2,p1,w); } 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 03f4f1f8c2..ffe29e39b2 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_image.c +++ b/src/modules/evas/engines/gl_common/evas_gl_image.c @@ -811,8 +811,8 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im) evas_cache_image_unload_data(ie); } else if (!im->tex && - ((ie->load_error == EFL_GFX_IMAGE_LOAD_ERROR_NONE) || - (ie->load_error == EFL_GFX_IMAGE_LOAD_ERROR_CANCELLED))) + ((ie->load_error == EVAS_LOAD_ERROR_NONE) || + (ie->load_error == EVAS_LOAD_ERROR_CANCELLED))) { ie->load_error = evas_cache_image_load_data(ie); im->tex = evas_gl_common_texture_new(gc, im->im, im->disable_atlas); @@ -829,8 +829,8 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im) evas_cache_image_unload_data(ie); } else if (!im->tex && - ((ie->load_error == EFL_GFX_IMAGE_LOAD_ERROR_NONE) || - (ie->load_error == EFL_GFX_IMAGE_LOAD_ERROR_CANCELLED))) + ((ie->load_error == EVAS_LOAD_ERROR_NONE) || + (ie->load_error == EVAS_LOAD_ERROR_CANCELLED))) { ie->load_error = evas_cache_image_load_data(ie); im->tex = evas_gl_common_texture_rgb_a_pair_new(gc, im->im); @@ -904,9 +904,9 @@ evas_gl_common_image_surface_update(Evas_GL_Image *im) if (!im || !im->gc || !im->im || !im->im->image.data) goto fail; - if (im->im->cache_entry.space == EFL_GFX_COLORSPACE_ARGB8888) + if (im->im->cache_entry.space == (Evas_Colorspace)EFL_GFX_COLORSPACE_ARGB8888) alpha = EINA_FALSE; - else if (im->im->cache_entry.space == EFL_GFX_COLORSPACE_GRY8) + else if (im->im->cache_entry.space == (Evas_Colorspace)EFL_GFX_COLORSPACE_GRY8) alpha = EINA_TRUE; else goto fail; diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c b/src/modules/evas/engines/gl_drm/evas_engine.c index 6333aaf10f..4f168df7f0 100644 --- a/src/modules/evas/engines/gl_drm/evas_engine.c +++ b/src/modules/evas/engines/gl_drm/evas_engine.c @@ -269,7 +269,8 @@ gl_extn_veto(Render_Engine *re) if (!_ckext(str, "EGL_KHR_partial_update")) glsym_eglSetDamageRegionKHR = NULL; - if (!_ckext(str, "EGL_EXT_swap_buffers_with_damage")) + if ((!_ckext(str, "EGL_EXT_swap_buffers_with_damage")) && + (!_ckext(str, "EGL_KHR_swap_buffers_with_damage"))) glsym_eglSwapBuffersWithDamage = NULL; if (_ckext(str, "EGL_EXT_image_dma_buf_import")) dmabuf_present = EINA_TRUE; diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c b/src/modules/evas/engines/gl_drm/evas_outbuf.c index 4f8aa10669..1bdf09afa8 100644 --- a/src/modules/evas/engines/gl_drm/evas_outbuf.c +++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c @@ -4,7 +4,6 @@ static Outbuf *_evas_gl_drm_window = NULL; static EGLContext context = EGL_NO_CONTEXT; static int win_count = 0; -static unsigned char gl_context_valid = 0; #ifdef EGL_MESA_platform_gbm static PFNEGLGETPLATFORMDISPLAYEXTPROC dlsym_eglGetPlatformDisplayEXT = NULL; @@ -464,11 +463,10 @@ evas_outbuf_use(Outbuf *ob) glsym_evas_gl_preload_render_lock(_evas_outbuf_make_current, ob); - if ((_evas_gl_drm_window) && (!gl_context_valid)) + if (_evas_gl_drm_window) { if (eglGetCurrentContext() != _evas_gl_drm_window->egl.context) force = EINA_TRUE; - gl_context_valid = 1; } if ((_evas_gl_drm_window != ob) || (force)) @@ -550,14 +548,18 @@ evas_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth) while (ecore_drm2_fb_release(ob->priv.output, EINA_TRUE)); + ob->w = w; + ob->h = h; + ob->rotation = rot; + _evas_outbuf_gbm_surface_destroy(ob); + if ((ob->rotation == 0) || (ob->rotation == 180)) _evas_outbuf_gbm_surface_create(ob, w, h); else if ((ob->rotation == 90) || (ob->rotation == 270)) _evas_outbuf_gbm_surface_create(ob, h, w); - _evas_outbuf_egl_setup(ob); - glsym_evas_gl_common_context_resize(ob->gl_context, w, h, rot); + _evas_outbuf_egl_setup(ob); } Render_Output_Swap_Mode @@ -622,7 +624,7 @@ evas_outbuf_update_region_first_rect(Outbuf *ob) if (!_re_wincheck(ob)) return EINA_TRUE; - /* glsym_evas_gl_common_context_resize(ob->gl_context, ob->w, ob->h, ob->rotation); */ + glsym_evas_gl_common_context_resize(ob->gl_context, ob->w, ob->h, ob->rotation); glsym_evas_gl_common_context_flush(ob->gl_context); glsym_evas_gl_common_context_newframe(ob->gl_context); @@ -767,7 +769,6 @@ evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer end: //TODO: Need render unlock after drm page flip? glsym_evas_gl_preload_render_unlock(_evas_outbuf_make_current, ob); - gl_context_valid = 0; } Evas_Engine_GL_Context * diff --git a/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h b/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h index a7effafde0..56a0cf3cad 100644 --- a/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h +++ b/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h @@ -165,4 +165,20 @@ gl_generic_any_output_get(Render_Engine_GL_Generic *engine) return NULL; } +static inline Render_Output_GL_Generic * +gl_generic_output_find(Render_Engine_GL_Generic *engine) +{ + Render_Output_GL_Generic *output; + Eina_List *l; + + EINA_LIST_FOREACH(engine->software.outputs, l, output) + { + if (!output->software.ob) continue; + return output; + } + + return NULL; +} + + #endif diff --git a/src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.eo b/src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.eo index 7830416db5..785a27f9c6 100644 --- a/src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.eo +++ b/src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.eo @@ -1,4 +1,4 @@ -class Evas.Ector.GL.Buffer extends Ector.GL.Buffer implements Evas.Ector.Buffer +class @beta Evas.Ector.GL.Buffer extends Ector.GL.Buffer implements Evas.Ector.Buffer { [[An Ector GL buffer capable of being mapped, drawn and rendered to. diff --git a/src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.eo b/src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.eo index 6944a3a446..f8107465ec 100644 --- a/src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.eo +++ b/src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.eo @@ -1,4 +1,4 @@ -class Evas.Ector.GL.Image.Buffer extends Ector.GL.Buffer implements Evas.Ector.Buffer +class @beta Evas.Ector.GL.Image.Buffer extends Ector.GL.Buffer implements Evas.Ector.Buffer { [[An Ector GL buffer wrapping an existing Evas_GL_Image.]] implements { diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c index 96b0e41a94..2659498611 100644 --- a/src/modules/evas/engines/gl_generic/evas_engine.c +++ b/src/modules/evas/engines/gl_generic/evas_engine.c @@ -627,6 +627,7 @@ eng_image_size_set(void *engine, void *image, int w, int h) Evas_GL_Image *im_old; if (!im) return NULL; + gl_context = gl_generic_context_find(engine, 1); if (im->native.data) { im->w = w; @@ -634,7 +635,6 @@ eng_image_size_set(void *engine, void *image, int w, int h) evas_gl_common_image_native_enable(im); return image; } - gl_context = gl_generic_context_find(engine, 1); if ((im->tex) && (im->tex->pt->dyn.img)) { evas_gl_common_texture_free(im->tex, EINA_TRUE); @@ -2306,7 +2306,7 @@ eng_renderer_3d_get(void *output) static void * eng_drawable_new(void *engine, int w, int h, int alpha) { - eng_context_3d_use(engine); + eng_context_3d_use(gl_generic_output_find(engine)); #ifdef GL_GLES return e3d_drawable_new(w, h, alpha, GL_DEPTH_STENCIL_OES, GL_NONE); #else @@ -2317,7 +2317,7 @@ eng_drawable_new(void *engine, int w, int h, int alpha) static void eng_drawable_free(void *engine, void *drawable) { - eng_context_3d_use(engine); + eng_context_3d_use(gl_generic_output_find(engine)); e3d_drawable_free(drawable); } @@ -2349,7 +2349,7 @@ eng_image_drawable_set(void *engine, void *image, void *drawable) } static void -eng_drawable_scene_render(void *engine EINA_UNUSED, void *data, void *drawable, void *scene_data) +eng_drawable_scene_render(void *engine, void *data, void *drawable, void *scene_data) { Evas_Engine_GL_Context *gl_context; E3D_Renderer *renderer = NULL; @@ -2357,7 +2357,7 @@ eng_drawable_scene_render(void *engine EINA_UNUSED, void *data, void *drawable, gl_context = gl_generic_context_get(data, 1); evas_gl_common_context_flush(gl_context); - eng_context_3d_use(data); + eng_context_3d_use(gl_generic_output_find(engine)); renderer = eng_renderer_3d_get(data); e3d_drawable_scene_render(drawable, renderer, scene_data); } @@ -2390,7 +2390,7 @@ eng_drawable_scene_render_to_texture(void *engine, void *drawable, void *scene_d gl_context = gl_generic_context_get(engine, 1); evas_gl_common_context_flush(gl_context); - eng_context_3d_use(engine); + eng_context_3d_use(gl_generic_output_find(engine)); renderer = eng_renderer_3d_get(engine); return e3d_drawable_scene_render_to_texture((E3D_Drawable *)drawable, renderer, scene_data); @@ -2453,7 +2453,7 @@ eng_texture_image_set(void *engine, void *texture, void *image) { Evas_Engine_GL_Context *gl_context; - gl_context = gl_generic_context_get(engine, 1); + gl_context = gl_generic_context_find(engine, 1); e3d_texture_set(gl_context, (E3D_Texture *)texture, (Evas_GL_Image *)image); } diff --git a/src/modules/evas/engines/gl_generic/meson.build b/src/modules/evas/engines/gl_generic/meson.build index 8926f24127..c9957d4923 100644 --- a/src/modules/evas/engines/gl_generic/meson.build +++ b/src/modules/evas/engines/gl_generic/meson.build @@ -39,7 +39,7 @@ engine_include_dir = include_directories(join_paths('..','software_generic')) if get_option('evas-modules') == 'shared' and not evas_force_static.contains(engine) shared_module(mod_full_name, engine_src, include_directories : config_dir + [engine_include_dir], - dependencies : [eina, evas_pre] + engine_deps, + dependencies : [eina, evas_pre] + engine_deps + [software_generic], install : true, install_dir : mod_install_dir, name_suffix : sys_mod_extension diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c index 82e2517ca0..1d63eaace6 100644 --- a/src/modules/evas/engines/gl_x11/evas_engine.c +++ b/src/modules/evas/engines/gl_x11/evas_engine.c @@ -1476,7 +1476,8 @@ gl_extn_veto(Render_Engine *re) ) extn_have_y_inverted = 0; } - if (!strstr(str, "EGL_EXT_swap_buffers_with_damage")) + if ((!strstr(str, "EGL_EXT_swap_buffers_with_damage")) && + (!strstr(str, "EGL_KHR_swap_buffers_with_damage"))) { glsym_eglSwapBuffersWithDamage = NULL; } 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 4882442245..3996f510d0 100644 --- a/src/modules/evas/engines/gl_x11/evas_x_main.c +++ b/src/modules/evas/engines/gl_x11/evas_x_main.c @@ -38,7 +38,6 @@ static Eina_Hash *_evas_gl_visuals = NULL; static int win_count = 0; static Eina_Bool initted = EINA_FALSE; -static unsigned char gl_context_valid = 0; #if 0 static double @@ -738,19 +737,17 @@ eng_window_use(Outbuf *gw) if ((gw) && (!gw->gl_context)) return; #ifdef GL_GLES - if ((xwin) && (!gl_context_valid)) + if (xwin) { if ((evas_eglGetCurrentDisplay() != xwin->egl_disp) || (evas_eglGetCurrentContext() != xwin->egl_context)) force_use = EINA_TRUE; - gl_context_valid = 1; } #else - if ((xwin) && (!gl_context_valid)) + if (xwin) { if (glXGetCurrentContext() != xwin->context) force_use = EINA_TRUE; - gl_context_valid = 1; } #endif if ((xwin != gw) || (force_use)) @@ -1714,7 +1711,6 @@ eng_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage EINA_UNUSED, Tilebuf_R end: glsym_evas_gl_preload_render_unlock(eng_preload_make_current, ob); - gl_context_valid = 0; } Evas_Engine_GL_Context * diff --git a/src/modules/evas/engines/software_generic/evas_ector_software_buffer.eo b/src/modules/evas/engines/software_generic/evas_ector_software_buffer.eo index b42aeaa9fa..b41b5a8438 100644 --- a/src/modules/evas/engines/software_generic/evas_ector_software_buffer.eo +++ b/src/modules/evas/engines/software_generic/evas_ector_software_buffer.eo @@ -1,4 +1,4 @@ -class Evas.Ector.Software.Buffer extends Ector.Software.Buffer implements Evas.Ector.Buffer +class @beta Evas.Ector.Software.Buffer extends Ector.Software.Buffer implements Evas.Ector.Buffer { [[A buffer object wrapping an existing Evas Image_Entry.]] implements { diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c index 7007f3a2fd..1b9aeed1c3 100644 --- a/src/modules/evas/engines/software_generic/evas_engine.c +++ b/src/modules/evas/engines/software_generic/evas_engine.c @@ -2494,7 +2494,8 @@ _draw_thread_map_draw(void *data) continue; } - if ((m->pts[0 + offset].x == m->pts[3 + offset].x) && + if (!(map->anti_alias && map->smooth) && //For sub-pixel rendering + (m->pts[0 + offset].x == m->pts[3 + offset].x) && (m->pts[1 + offset].x == m->pts[2 + offset].x) && (m->pts[0 + offset].y == m->pts[1 + offset].y) && (m->pts[3 + offset].y == m->pts[2 + offset].y) && diff --git a/src/modules/evas/engines/software_generic/meson.build b/src/modules/evas/engines/software_generic/meson.build index ef499821e8..4d52667838 100644 --- a/src/modules/evas/engines/software_generic/meson.build +++ b/src/modules/evas/engines/software_generic/meson.build @@ -9,6 +9,7 @@ engine_src = files([ 'evas_ector_software.h', ]) +gen_src = [] pub_eo_files = [ 'evas_ector_software_buffer.eo' @@ -17,7 +18,7 @@ pub_eo_files = [ subdir('filters') foreach eo_file : pub_eo_files - engine_src += custom_target('eolian_gen_' + eo_file, + gen_src += custom_target('eolian_gen_' + eo_file, input : eo_file, output : [eo_file + '.h'], depfile : eo_file + '.d', @@ -28,6 +29,8 @@ foreach eo_file : pub_eo_files '-gchd', '@INPUT@']) endforeach +engine_src += gen_src + engine_deps = [draw, dl] if get_option('evas-modules') == 'shared' and not evas_force_static.contains(engine) diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c index 9e8b6ea401..024e794ac4 100644 --- a/src/modules/evas/engines/wayland_egl/evas_engine.c +++ b/src/modules/evas/engines/wayland_egl/evas_engine.c @@ -223,7 +223,8 @@ gl_extn_veto(Render_Engine *re) ) extn_have_y_inverted = EINA_FALSE; } - if (!strstr(str, "EGL_EXT_swap_buffers_with_damage")) + if ((!strstr(str, "EGL_EXT_swap_buffers_with_damage")) && + (!strstr(str, "EGL_KHR_swap_buffers_with_damage"))) { glsym_eglSwapBuffersWithDamage = NULL; } 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 5e0648703d..c3f2001c58 100644 --- a/src/modules/evas/engines/wayland_egl/evas_wl_main.c +++ b/src/modules/evas/engines/wayland_egl/evas_wl_main.c @@ -7,7 +7,6 @@ static Outbuf *_evas_gl_wl_window = NULL; static EGLContext context = EGL_NO_CONTEXT; static struct wl_display *display = NULL; static int win_count = 0; -static unsigned char gl_context_valid = 0; Outbuf * eng_window_new(Evas_Engine_Info_Wayland *einfo, int w, int h, Render_Output_Swap_Mode swap_mode) @@ -215,11 +214,10 @@ eng_window_use(Outbuf *gw) glsym_evas_gl_preload_render_lock(eng_preload_make_current, gw); if ((gw) && (!gw->gl_context)) return; - if ((_evas_gl_wl_window) && (!gl_context_valid)) + if (_evas_gl_wl_window) { if (eglGetCurrentContext() != _evas_gl_wl_window->egl_context) force = EINA_TRUE; - gl_context_valid = 1; } if ((_evas_gl_wl_window != gw) || (force)) @@ -519,7 +517,6 @@ eng_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_ end: glsym_evas_gl_preload_render_unlock(eng_preload_make_current, ob); ecore_wl2_display_flush(ob->wl2_disp); - gl_context_valid = 0; } Evas_Engine_GL_Context * diff --git a/src/modules/evas/image_savers/png/evas_image_save_png.c b/src/modules/evas/image_savers/png/evas_image_save_png.c index a34b0b9c58..bd6b5c31a1 100644 --- a/src/modules/evas/image_savers/png/evas_image_save_png.c +++ b/src/modules/evas/image_savers/png/evas_image_save_png.c @@ -40,9 +40,9 @@ save_image_png(RGBA_Image *im, const char *file, int do_compress, int interlace) if (!im || !im->image.data || !file) return 0; - if ((im->cache_entry.space != EFL_GFX_COLORSPACE_ARGB8888) && - (im->cache_entry.space != EFL_GFX_COLORSPACE_AGRY88) && - (im->cache_entry.space != EFL_GFX_COLORSPACE_GRY8)) + if (((Efl_Gfx_Colorspace)im->cache_entry.space != EFL_GFX_COLORSPACE_ARGB8888) && + ((Efl_Gfx_Colorspace)im->cache_entry.space != EFL_GFX_COLORSPACE_AGRY88) && + ((Efl_Gfx_Colorspace)im->cache_entry.space != EFL_GFX_COLORSPACE_GRY8)) return 0; f = fopen(file, "wb"); @@ -76,7 +76,7 @@ save_image_png(RGBA_Image *im, const char *file, int do_compress, int interlace) else interlace = PNG_INTERLACE_NONE; - if (im->cache_entry.space == EFL_GFX_COLORSPACE_GRY8) + if ((Efl_Gfx_Colorspace)im->cache_entry.space == EFL_GFX_COLORSPACE_GRY8) { gry8 = EINA_TRUE; pixel_size = 1; @@ -86,7 +86,7 @@ save_image_png(RGBA_Image *im, const char *file, int do_compress, int interlace) PNG_COLOR_TYPE_GRAY, interlace, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); } - else if (im->cache_entry.space == EFL_GFX_COLORSPACE_AGRY88) + else if ((Efl_Gfx_Colorspace)im->cache_entry.space == EFL_GFX_COLORSPACE_AGRY88) { agry88 = EINA_TRUE; pixel_size = 2; diff --git a/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c b/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c index 9fee4de364..fe4d97ba21 100644 --- a/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c +++ b/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c @@ -1,14 +1,6 @@ #include "evas_common_private.h" #include "evas_private.h" -#ifdef HAVE_NETINET_IN_H -# include -#endif - -#ifdef _WIN32 -# include -#endif /* ifdef _WIN32 */ - #ifdef ENABLE_LIBLZ4 # include # include @@ -70,8 +62,8 @@ _save_direct_tgv(RGBA_Image *im, const char *file, int compress) image_width = im->cache_entry.w + im->cache_entry.borders.l + im->cache_entry.borders.r; image_height = im->cache_entry.h + im->cache_entry.borders.t + im->cache_entry.borders.b; data = im->image.data8; - width = htonl(image_width); - height = htonl(image_height); + width = eina_htonl(image_width); + height = eina_htonl(image_height); compress = !!compress; if ((image_width & 0x3) || (image_height & 0x3)) @@ -219,8 +211,8 @@ evas_image_save_file_tgv(RGBA_Image *im, image_stride = im->cache_entry.w; image_height = im->cache_entry.h; - nl_width = htonl(image_stride); - nl_height = htonl(image_height); + nl_width = eina_htonl(image_stride); + nl_height = eina_htonl(image_height); compress = !!compress; // Disable dithering, as it will deteriorate the quality of flat surfaces diff --git a/src/modules/evas/meson.build b/src/modules/evas/meson.build index e97ff1b2a0..e8cafcc9fa 100644 --- a/src/modules/evas/meson.build +++ b/src/modules/evas/meson.build @@ -67,6 +67,14 @@ foreach engine_conf : engines dependencies : [eina, evas_pre] + engine_deps, ) + if engine == 'software_generic' + software_generic = declare_dependency( + include_directories: engine_include_dir, + sources : gen_src, + dependencies : [eina, evas_pre] + engine_deps, + link_with : tmp + ) + endif if engine == 'gl_common' #gl_common will only be used by gl_generic, NOT by libevas.so, so we work arround the static list gl_common = declare_dependency( diff --git a/src/modules/evas/vg_loaders/eet/evas_vg_load_eet.c b/src/modules/evas/vg_loaders/eet/evas_vg_load_eet.c index 3b83b2f541..f0bde2e5ca 100644 --- a/src/modules/evas/vg_loaders/eet/evas_vg_load_eet.c +++ b/src/modules/evas/vg_loaders/eet/evas_vg_load_eet.c @@ -13,13 +13,11 @@ static int _evas_vg_loader_eet_log_dom = -1; #define INF(...) EINA_LOG_DOM_INFO(_evas_vg_loader_eet_log_dom, __VA_ARGS__) static Vg_File_Data* -evas_vg_load_file_open_eet(const char *file, const char *key, int *error EINA_UNUSED) +evas_vg_load_file_open_eet(Eina_File *file, const char *key, int *error EINA_UNUSED) { Eet_Data_Descriptor *svg_node_eet; Svg_Node *node; - Eet_File *ef; - - ef = eet_open(file, EET_FILE_MODE_READ); + Eet_File *ef = eet_mmap(file); if (!ef) { *error = EVAS_LOAD_ERROR_CORRUPT_FILE; 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 25e72feb87..950db2bea1 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 @@ -20,7 +20,6 @@ struct _Evas_SVG_Parser { int x, y, width, height; } global; struct { - Eina_Bool x1_percent, x2_percent, y1_percent, y2_percent; Eina_Bool fx_parsed; Eina_Bool fy_parsed; } gradient; @@ -144,13 +143,6 @@ _gradient_to_double(Evas_SVG_Parser *svg_parse, const char *str, SVG_Parser_Leng double parsed_value = strtod(str, &end); double max = 1; - /* unique case, if that is percentage, just return it */ - if (strstr(str, "%")) - { - parsed_value = parsed_value / 100.0; - return parsed_value; - } - /** * That is according to Units in here * @@ -164,7 +156,9 @@ _gradient_to_double(Evas_SVG_Parser *svg_parse, const char *str, SVG_Parser_Leng max = sqrt(pow(svg_parse->global.height, 2) + pow(svg_parse->global.width, 2)) / sqrt(2.0); - if (strstr(str, "cm")) + if (strstr(str, "%")) + parsed_value = parsed_value / 100.0; + else if (strstr(str, "cm")) parsed_value = parsed_value * 35.43307; else if (strstr(str, "mm")) parsed_value = parsed_value * 3.543307; @@ -1795,9 +1789,9 @@ _attr_parse_radial_gradient_node(void *data, const char *key, const char *value) { grad->ref = _id_from_href(value); } - else if (!strcmp(key, "gradientUnits") && !strcmp(value, "objectBoundingBox")) + else if (!strcmp(key, "gradientUnits") && !strcmp(value, "userSpaceOnUse")) { - grad->user_space = EINA_FALSE; + grad->user_space = EINA_TRUE; } return EINA_TRUE; @@ -1810,7 +1804,7 @@ _create_radialGradient(Evas_SVG_Loader *loader, const char *buf, unsigned buflen loader->svg_parse->style_grad = grad; grad->type = SVG_RADIAL_GRADIENT; - grad->user_space = EINA_TRUE; + grad->user_space = EINA_FALSE; grad->radial = calloc(1, sizeof(Svg_Radial_Gradient)); /** * Default values of gradient @@ -1860,95 +1854,35 @@ static void _handle_linear_x1_attr(Evas_SVG_Loader *loader, Svg_Linear_Gradient* linear, const char *value) { linear->x1 = _gradient_to_double(loader->svg_parse, value, SVG_PARSER_LENGTH_HORIZONTAL); - if (strstr(value, "%")) - loader->svg_parse->gradient.x1_percent = EINA_TRUE; } static void _handle_linear_y1_attr(Evas_SVG_Loader *loader, Svg_Linear_Gradient* linear, const char *value) { linear->y1 = _gradient_to_double(loader->svg_parse, value, SVG_PARSER_LENGTH_VERTICAL); - if (strstr(value, "%")) - loader->svg_parse->gradient.y1_percent = EINA_TRUE; } static void _handle_linear_x2_attr(Evas_SVG_Loader *loader, Svg_Linear_Gradient* linear, const char *value) { linear->x2 = _gradient_to_double(loader->svg_parse, value, SVG_PARSER_LENGTH_HORIZONTAL); - /* checking if there are no percentage because x2 have default value - * already set in percentages (100%) */ - if (!strstr(value, "%")) - loader->svg_parse->gradient.x2_percent = EINA_FALSE; } static void _handle_linear_y2_attr(Evas_SVG_Loader *loader, Svg_Linear_Gradient* linear, const char *value) { linear->y2 = _gradient_to_double(loader->svg_parse, value, SVG_PARSER_LENGTH_VERTICAL); - if (strstr(value, "%")) - loader->svg_parse->gradient.y2_percent = EINA_TRUE; -} - -static void -_recalc_linear_x1_attr(Evas_SVG_Loader *loader, Svg_Linear_Gradient* linear, Eina_Bool user_space) -{ - if (!loader->svg_parse->gradient.x1_percent && !user_space) - { - /* Since previous percentage is not required (it was already percent) - * so oops and make it all back */ - linear->x1 = linear->x1 * loader->svg_parse->global.width; - } - loader->svg_parse->gradient.x1_percent = EINA_FALSE; -} - -static void -_recalc_linear_y1_attr(Evas_SVG_Loader *loader, Svg_Linear_Gradient* linear, Eina_Bool user_space) -{ - if (!loader->svg_parse->gradient.y1_percent && !user_space) - { - /* Since previous percentage is not required (it was already percent) - * so oops and make it all back */ - linear->y1 = linear->y1 * loader->svg_parse->global.height; - } - loader->svg_parse->gradient.y1_percent = EINA_FALSE; -} - -static void -_recalc_linear_x2_attr(Evas_SVG_Loader *loader, Svg_Linear_Gradient* linear, Eina_Bool user_space) -{ - if (!loader->svg_parse->gradient.x2_percent && !user_space) - { - /* Since previous percentage is not required (it was already percent) - * so oops and make it all back */ - linear->x2 = linear->x2 * loader->svg_parse->global.width; - } - loader->svg_parse->gradient.x2_percent = EINA_FALSE; -} - -static void -_recalc_linear_y2_attr(Evas_SVG_Loader *loader, Svg_Linear_Gradient* linear, Eina_Bool user_space) -{ - if (!loader->svg_parse->gradient.y2_percent && !user_space) - { - /* Since previous percentage is not required (it was already percent) - * so oops and make it all back */ - linear->y2 = linear->y2 * loader->svg_parse->global.height; - } - loader->svg_parse->gradient.y2_percent = EINA_FALSE; } typedef void (*Linear_Method)(Evas_SVG_Loader *loader, Svg_Linear_Gradient *linear, const char *value); -typedef void (*Linear_Method_Recalc)(Evas_SVG_Loader *loader, Svg_Linear_Gradient *linear, Eina_Bool user_space); #define LINEAR_DEF(Name) \ - { #Name, sizeof (#Name), _handle_linear_##Name##_attr, _recalc_linear_##Name##_attr} + { #Name, sizeof (#Name), _handle_linear_##Name##_attr} static const struct { const char *tag; int sz; Linear_Method tag_handler;; - Linear_Method_Recalc tag_recalc;; } linear_tags[] = { LINEAR_DEF(x1), LINEAR_DEF(y1), @@ -1984,7 +1918,7 @@ _attr_parse_linear_gradient_node(void *data, const char *key, const char *value) { grad->ref = _id_from_href(value); } - else if (!strcmp(key, "gradientUnits") && !strcmp(value, "objectBoundingBox")) + else if (!strcmp(key, "gradientUnits") && !strcmp(value, "userSpaceOnUse")) { grad->user_space = EINA_TRUE; } @@ -1998,22 +1932,16 @@ _create_linearGradient(Evas_SVG_Loader *loader, const char *buf, unsigned buflen Svg_Style_Gradient *grad = calloc(1, sizeof(Svg_Style_Gradient)); loader->svg_parse->style_grad = grad; - unsigned int i; - grad->type = SVG_LINEAR_GRADIENT; - grad->user_space = EINA_TRUE; + grad->user_space = EINA_FALSE; grad->linear = calloc(1, sizeof(Svg_Linear_Gradient)); /** * Default value of x2 is 100% */ grad->linear->x2 = 1; - loader->svg_parse->gradient.x2_percent = EINA_TRUE; eina_simple_xml_attributes_parse(buf, buflen, _attr_parse_linear_gradient_node, loader); - for (i = 0; i < sizeof (linear_tags) / sizeof(linear_tags[0]); i++) - linear_tags[i].tag_recalc(loader, grad->linear, grad->user_space); - return loader->svg_parse->style_grad; } @@ -2339,7 +2267,9 @@ evas_vg_load_file_close_svg(Vg_File_Data *vfd) } static Vg_File_Data* -evas_vg_load_file_open_svg(const char *file, const char *key EINA_UNUSED, int *error EINA_UNUSED) +evas_vg_load_file_open_svg(Eina_File *file, + const char *key EINA_UNUSED, + int *error EINA_UNUSED) { Evas_SVG_Loader loader = { NULL, NULL, NULL, NULL, NULL, 0, EINA_FALSE @@ -2347,18 +2277,10 @@ evas_vg_load_file_open_svg(const char *file, const char *key EINA_UNUSED, int *e const char *content; unsigned int length; Svg_Node *defs; - Eina_File *f; - - f = eina_file_open(file, EINA_FALSE); - if (!f) - { - *error = EVAS_LOAD_ERROR_CORRUPT_FILE; - return NULL; - } loader.svg_parse = calloc(1, sizeof(Evas_SVG_Parser)); - length = eina_file_size_get(f); - content = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); + length = eina_file_size_get(file); + content = eina_file_map_all(file, EINA_FILE_SEQUENTIAL); if (content) { loader.stack = eina_array_new(8); @@ -2366,7 +2288,7 @@ evas_vg_load_file_open_svg(const char *file, const char *key EINA_UNUSED, int *e _evas_svg_loader_parser, &loader); eina_array_free(loader.stack); - eina_file_map_free(f, (void*) content); + eina_file_map_free(file, (void*) content); } if (loader.doc) @@ -2375,6 +2297,15 @@ evas_vg_load_file_open_svg(const char *file, const char *key EINA_UNUSED, int *e defs = loader.doc->node.doc.defs; if (defs) _update_gradient(loader.doc, defs->node.defs.gradients); + else + { + if (loader.gradient) + { + Eina_List* gradient_list = eina_list_append(NULL, loader.gradient); + _update_gradient(loader.doc, gradient_list); + eina_list_free(gradient_list); + } + } *error = EVAS_LOAD_ERROR_NONE; } @@ -2383,7 +2314,7 @@ evas_vg_load_file_open_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_svg_create_vg_node(loader.doc); } diff --git a/src/modules/evas/vg_savers/eet/evas_vg_save_eet.c b/src/modules/evas/vg_savers/eet/evas_vg_save_eet.c index 54f35e1127..a7a1bf36ae 100644 --- a/src/modules/evas/vg_savers/eet/evas_vg_save_eet.c +++ b/src/modules/evas/vg_savers/eet/evas_vg_save_eet.c @@ -12,7 +12,7 @@ static int _evas_vg_saver_eet_log_dom = -1; #endif #define INF(...) EINA_LOG_DOM_INFO(_evas_vg_saver_eet_log_dom, __VA_ARGS__) -int +Evas_Load_Error evas_vg_save_file_eet(Vg_File_Data *evg_data, const char *file, const char *key, int compress) { Eet_Data_Descriptor *svg_node_eet; 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 cf7854d80b..e900432d9a 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 @@ -129,7 +129,7 @@ _svg_node_printf(Svg_Node *parent, Eina_Strbuf *buf) } } -int +Evas_Load_Error evas_vg_save_file_svg(Vg_File_Data *evg_data, const char *file, const char *key EINA_UNUSED, int compress EINA_UNUSED) { Eina_Strbuf *buf = NULL; @@ -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_GFX_IMAGE_LOAD_ERROR_GENERIC; + return EVAS_LOAD_ERROR_GENERIC; } root = vg_common_svg_create_svg_node(evg_data); diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py index 0df4bc8f10..70ab733ce5 100644 --- a/src/scripts/pyolian/eolian.py +++ b/src/scripts/pyolian/eolian.py @@ -116,17 +116,18 @@ class Eolian_Type_Builtin_Type(IntEnum): DOUBLE = 29 BOOL = 30 - VOID = 31 - ACCESSOR = 32 - ARRAY = 33 - ITERATOR = 34 - HASH = 35 - LIST = 36 - INARRAY = 37 - INLIST = 38 + SLICE = 31 + RW_SLICE = 32 - FUTURE = 39 + VOID = 33 + + ACCESSOR = 34 + ARRAY = 35 + FUTURE = 36 + ITERATOR = 37 + HASH = 38 + LIST = 39 ANY_VALUE = 40 ANY_VALUE_PTR = 41 @@ -134,9 +135,10 @@ class Eolian_Type_Builtin_Type(IntEnum): MSTRING = 42 STRING = 43 STRINGSHARE = 44 + STRBUF = 45 - VOID_PTR = 45 - FREE_CB = 46 + VOID_PTR = 46 + FREE_CB = 47 class Eolian_C_Type_Type(IntEnum): DEFAULT = 0 @@ -620,6 +622,10 @@ class Object(EolianBaseObject): def column(self): return int(lib.eolian_object_column_get(self)) + @cached_property + def is_beta(self): + return bool(lib.eolian_object_is_beta(self)) + class Class(Object): def __repr__(self): @@ -654,10 +660,6 @@ class Class(Object): 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)) - @cached_property def eo_prefix(self): return _str_to_py(lib.eolian_class_eo_prefix_get(self)) @@ -808,10 +810,6 @@ class Event(Object): def scope(self): return Eolian_Object_Scope(lib.eolian_event_scope_get(self)) - @cached_property - def is_beta(self): - return bool(lib.eolian_event_is_beta(self)) - @cached_property def is_hot(self): return bool(lib.eolian_event_is_hot(self)) @@ -825,8 +823,8 @@ class Function(Object): def __repr__(self): return "".format(self) - def full_c_name_get(self, ftype, use_legacy=False): - s = lib.eolian_function_full_c_name_get(self, ftype, use_legacy) + def full_c_name_get(self, ftype): + s = lib.eolian_function_full_c_name_get(self, ftype) ret = _str_to_py(s) lib.eina_stringshare_del(c_void_p(s)) return ret @@ -843,18 +841,6 @@ class Function(Object): def full_c_setter_name(self): return self.full_c_name_get(Eolian_Function_Type.PROP_SET) - @cached_property - def full_c_method_name_legacy(self): - return self.full_c_name_get(Eolian_Function_Type.METHOD, True) - - @cached_property - def full_c_getter_name_legacy(self): - return self.full_c_name_get(Eolian_Function_Type.PROP_GET, True) - - @cached_property - def full_c_setter_name_legacy(self): - return self.full_c_name_get(Eolian_Function_Type.PROP_SET, True) - @cached_property def type(self): return Eolian_Function_Type(lib.eolian_function_type_get(self)) @@ -874,20 +860,10 @@ class Function(Object): def setter_scope(self): return self.scope_get(Eolian_Function_Type.PROP_SET) - def legacy_get(self, 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, ftype)) - @cached_property def is_class(self): return bool(lib.eolian_function_is_class(self)) - @cached_property - def is_beta(self): - return bool(lib.eolian_function_is_beta(self)) - @cached_property def object_is_const(self): return bool(lib.eolian_function_object_is_const(self)) diff --git a/src/scripts/pyolian/eolian_lib.py b/src/scripts/pyolian/eolian_lib.py index 1f6a2f3d71..9edebd0199 100644 --- a/src/scripts/pyolian/eolian_lib.py +++ b/src/scripts/pyolian/eolian_lib.py @@ -228,6 +228,10 @@ lib.eolian_object_short_name_get.restype = c_char_p lib.eolian_object_namespaces_get.argtypes = (c_void_p,) lib.eolian_object_namespaces_get.restype = c_void_p +# EAPI Eina_Bool eolian_object_is_beta(const Eolian_Object *obj); +lib.eolian_object_is_beta.argtypes = (c_void_p,) +lib.eolian_object_is_beta.restype = c_bool + ### Eolian_Class ############################################################ # EAPI Eolian_Class_Type eolian_class_type_get(const Eolian_Class *klass); @@ -238,10 +242,6 @@ lib.eolian_class_type_get.restype = c_int 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.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.restype = c_char_p @@ -320,30 +320,18 @@ lib.eolian_function_type_get.restype = 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_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) +# EAPI Eina_Stringshare *eolian_function_full_c_name_get(const Eolian_Function *function_id, Eolian_Function_Type ftype); +lib.eolian_function_full_c_name_get.argtypes = (c_void_p, c_int) lib.eolian_function_full_c_name_get.restype = c_void_p # Stringshare TO BE FREED -# 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.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.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.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.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.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.restype = c_bool @@ -485,10 +473,6 @@ lib.eolian_event_documentation_get.restype = 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.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.restype = c_bool diff --git a/src/scripts/pyolian/test_eolian.py b/src/scripts/pyolian/test_eolian.py index 23f172c4c3..990fcfc6c9 100755 --- a/src/scripts/pyolian/test_eolian.py +++ b/src/scripts/pyolian/test_eolian.py @@ -413,7 +413,7 @@ class TestEolianEvent(unittest.TestCase): 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') + self.assertEqual(ev.c_name, 'EFL_LOOP_TIMER_EVENT_TIMER_TICK') self.assertIsNone(ev.type) # TODO is this correct self.assertIsInstance(ev.documentation, eolian.Documentation) self.assertEqual(ev.scope, eolian.Eolian_Object_Scope.PUBLIC) @@ -477,12 +477,12 @@ class TestEolianVariable(unittest.TestCase): self.assertIsNone(var.value) # TODO is None correct here? no value? def test_variable_constant(self): - var = eolian_db.constant_by_name_get('Efl.Gfx.Size_Hint_Fill') + var = eolian_db.constant_by_name_get('Efl.Gfx.Hint_Fill') self.assertIsInstance(var, eolian.Variable) - self.assertEqual(var.name, 'Efl.Gfx.Size_Hint_Fill') + self.assertEqual(var.name, 'Efl.Gfx.Hint_Fill') self.assertEqual(var.short_name, 'Size_Hint_Fill') self.assertEqual(var.type, eolian.Eolian_Variable_Type.CONSTANT) - self.assertEqual(var.file, 'efl_gfx_size_hint.eo') + self.assertEqual(var.file, 'efl_gfx_hint.eo') self.assertFalse(var.is_extern) self.assertEqual(list(var.namespaces), ['Efl','Gfx']) self.assertIsInstance(var.documentation, eolian.Documentation) @@ -634,7 +634,7 @@ class TestEolianExpression(unittest.TestCase): self.assertEqual(exp.serialize, '100') def test_expression_unary(self): - var = eolian_db.constant_by_name_get('Efl.Gfx.Size_Hint_Fill') + var = eolian_db.constant_by_name_get('Efl.Gfx.Hint_Fill') exp = var.value self.assertIsInstance(exp, eolian.Expression) self.assertEqual(exp.type, eolian.Eolian_Expression_Type.UNARY) diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index eba876e160..1c33e6454e 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -158,6 +158,7 @@ _eet_for_style_gradient(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_eet_style_gradient_node, Svg_Style_Gradient, "type", type, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_eet_style_gradient_node, Svg_Style_Gradient, "id", id, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC(_eet_style_gradient_node, Svg_Style_Gradient, "spread", spread, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_eet_style_gradient_node, Svg_Style_Gradient, "user_space", user_space, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_LIST(_eet_style_gradient_node, Svg_Style_Gradient, "stops", stops, _eet_gradient_stops_node); EET_DATA_DESCRIPTOR_ADD_SUB(_eet_style_gradient_node, Svg_Style_Gradient, "radial", radial, _eet_radial_gradient_node); EET_DATA_DESCRIPTOR_ADD_SUB(_eet_style_gradient_node, Svg_Style_Gradient, "linear", linear, _eet_linear_gradient_node); @@ -566,9 +567,9 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Efl_VG *parent, Vg_F if (g->type == SVG_LINEAR_GRADIENT) { - 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); + grad_obj = efl_add(EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS, parent); + efl_gfx_gradient_linear_start_set(grad_obj, g->linear->x1 * r.w + r.x, g->linear->y1 * r.h + r.y); + efl_gfx_gradient_linear_end_set(grad_obj, g->linear->x2 * r.w + r.x, g->linear->y2 * r.h + r.y); } else if (g->type == SVG_RADIAL_GRADIENT) { @@ -583,10 +584,10 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Efl_VG *parent, Vg_F 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(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); + grad_obj = efl_add(EFL_CANVAS_VG_GRADIENT_RADIAL_CLASS, parent); + efl_gfx_gradient_radial_center_set(grad_obj, g->radial->cx * r.w + r.x, g->radial->cy * r.h + r.y); + efl_gfx_gradient_radial_radius_set(grad_obj, g->radial->r * radius); + efl_gfx_gradient_radial_focal_set(grad_obj, g->radial->fx * r.w + r.x, g->radial->fy * r.h + r.y); /* in case of objectBoundingBox it need proper scaling */ if (!g->user_space) @@ -608,10 +609,10 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Efl_VG *parent, Vg_F 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; - double cx = grad_geom.w / 2 + grad_geom.x; - double cx_scaled = (grad_geom.w / 2) * scale_reversed_X; + double cy = ((double) grad_geom.h) * 0.5 + grad_geom.y; + double cy_scaled = (((double) grad_geom.h) * 0.5) * scale_reversed_Y; + double cx = ((double) grad_geom.w) * 0.5 + grad_geom.x; + double cx_scaled = (((double) grad_geom.w) * 0.5) * scale_reversed_X; /* matrix tranformation of gradient figure: * 0. we remember size of gradient and it's center point @@ -635,7 +636,7 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Efl_VG *parent, Vg_F return NULL; } // apply common prperty - evas_vg_gradient_spread_set(grad_obj, g->spread); + efl_gfx_gradient_spread_set(grad_obj, g->spread); // update the stops stop_count = eina_list_count(g->stops); if (stop_count) @@ -651,7 +652,7 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Efl_VG *parent, Vg_F stops[i].offset = stop->offset; i++; } - evas_vg_gradient_stop_set(grad_obj, stops, stop_count); + efl_gfx_gradient_stop_set(grad_obj, stops, stop_count); free(stops); } return grad_obj; @@ -669,7 +670,7 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg, Efl_VG *parent, Vg_File_Data *vg_ // apply the transformation if (node->transform) - evas_vg_node_transformation_set(vg, node->transform); + efl_canvas_vg_node_transformation_set(vg, node->transform); if ((node->type == SVG_NODE_G) || (node->type == SVG_NODE_DOC)) return; @@ -683,25 +684,25 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg, Efl_VG *parent, Vg_File_Data *vg_ 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, parent, vg_data)); + efl_canvas_vg_shape_fill_set(vg, _apply_gradient_property(style->fill.paint.gradient, vg, parent, vg_data)); } else if (style->fill.paint.cur_color) { // apply the current style color - evas_vg_node_color_set(vg, style->r, style->g, - style->b, style->fill.opacity); + efl_gfx_color_set(vg, style->r, style->g, + style->b, style->fill.opacity); } else { // apply the fill color - evas_vg_node_color_set(vg, style->fill.paint.r, style->fill.paint.g, - style->fill.paint.b, style->fill.opacity); + efl_gfx_color_set(vg, style->fill.paint.r, style->fill.paint.g, + style->fill.paint.b, style->fill.opacity); } - evas_vg_shape_stroke_width_set(vg, style->stroke.width); - evas_vg_shape_stroke_cap_set(vg, style->stroke.cap); - evas_vg_shape_stroke_join_set(vg, style->stroke.join); - evas_vg_shape_stroke_scale_set(vg, style->stroke.scale); + efl_gfx_shape_stroke_width_set(vg, style->stroke.width); + efl_gfx_shape_stroke_cap_set(vg, style->stroke.cap); + efl_gfx_shape_stroke_join_set(vg, style->stroke.join); + efl_gfx_shape_stroke_scale_set(vg, style->stroke.scale); // if stroke property is NULL then do nothing if (style->stroke.paint.none) { @@ -710,7 +711,7 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg, Efl_VG *parent, Vg_File_Data *vg_ 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, parent, vg_data)); + efl_canvas_vg_shape_stroke_fill_set(vg, _apply_gradient_property(style->stroke.paint.gradient, vg, parent, vg_data)); } else if (style->stroke.paint.url) { @@ -720,13 +721,13 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg, Efl_VG *parent, Vg_File_Data *vg_ else if (style->stroke.paint.cur_color) { // apply the current style color - evas_vg_shape_stroke_color_set(vg, style->r, style->g, + efl_gfx_shape_stroke_color_set(vg, style->r, style->g, style->b, style->stroke.opacity); } else { // apply the stroke color - evas_vg_shape_stroke_color_set(vg, style->stroke.paint.r, style->stroke.paint.g, + efl_gfx_shape_stroke_color_set(vg, style->stroke.paint.r, style->stroke.paint.g, style->stroke.paint.b, style->stroke.opacity); } } @@ -738,12 +739,12 @@ _add_polyline(Efl_VG *vg, double *array, int size, Eina_Bool polygon) if (size < 2) return; - evas_vg_shape_append_move_to(vg, array[0], array[1]); + efl_gfx_path_append_move_to(vg, array[0], array[1]); for (i=2; i < size; i+=2) - evas_vg_shape_append_line_to(vg, array[i], array[i+1]); + efl_gfx_path_append_line_to(vg, array[i], array[i+1]); if (polygon) - evas_vg_shape_append_close(vg); + efl_gfx_path_append_close(vg); } static Efl_VG * @@ -764,48 +765,46 @@ vg_common_create_vg_node_helper(Svg_Node *node, Efl_VG *parent, Vg_File_Data *vg 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); - } + vg_common_create_vg_node_helper(child, vg, vg_data); return vg; } break; case SVG_NODE_PATH: - vg = evas_vg_shape_add(parent); - evas_vg_shape_append_svg_path(vg, node->node.path.path); + vg = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, parent); + efl_gfx_path_append_svg_path(vg, node->node.path.path); break; case SVG_NODE_POLYGON: - vg = evas_vg_shape_add(parent); + vg = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, parent); _add_polyline(vg, node->node.polygon.points, node->node.polygon.points_count, EINA_TRUE); break; case SVG_NODE_POLYLINE: - vg = evas_vg_shape_add(parent); + vg = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, parent); _add_polyline(vg, node->node.polygon.points, node->node.polygon.points_count, EINA_FALSE); break; case SVG_NODE_ELLIPSE: - vg = evas_vg_shape_add(parent); - evas_vg_shape_append_arc(vg, node->node.ellipse.cx - node->node.ellipse.rx, - node->node.ellipse.cy - node->node.ellipse.ry, - 2*node->node.ellipse.rx, 2*node->node.ellipse.ry, 0, 360); - evas_vg_shape_append_close(vg); + vg = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, parent); + efl_gfx_path_append_arc(vg, node->node.ellipse.cx - node->node.ellipse.rx, + node->node.ellipse.cy - node->node.ellipse.ry, + 2*node->node.ellipse.rx, 2*node->node.ellipse.ry, 0, 360); + efl_gfx_path_append_close(vg); break; case SVG_NODE_CIRCLE: - vg = evas_vg_shape_add(parent); - evas_vg_shape_append_circle(vg, node->node.circle.cx, node->node.circle.cy, node->node.circle.r); + vg = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, parent); + efl_gfx_path_append_circle(vg, node->node.circle.cx, node->node.circle.cy, node->node.circle.r); break; case SVG_NODE_RECT: - vg = evas_vg_shape_add(parent); - evas_vg_shape_append_rect(vg, node->node.rect.x, node->node.rect.y, node->node.rect.w, node->node.rect.h, - node->node.rect.rx, node->node.rect.ry); + vg = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, parent); + efl_gfx_path_append_rect(vg, node->node.rect.x, node->node.rect.y, node->node.rect.w, node->node.rect.h, + node->node.rect.rx, node->node.rect.ry); break; case SVG_NODE_LINE: - vg = evas_vg_shape_add(parent); - evas_vg_shape_append_move_to(vg, node->node.line.x1, node->node.line.y1); - evas_vg_shape_append_line_to(vg, node->node.line.x2, node->node.line.y2); + vg = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, parent); + efl_gfx_path_append_move_to(vg, node->node.line.x1, node->node.line.y1); + efl_gfx_path_append_line_to(vg, node->node.line.x2, node->node.line.y2); break; case SVG_NODE_CUSTOME_COMMAND: - vg = evas_vg_shape_add(parent); - evas_vg_shape_path_set(vg, node->node.command.commands, node->node.command.points); + vg = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, parent); + efl_gfx_path_set(vg, node->node.command.commands, node->node.command.points); break; default: break; @@ -823,6 +822,8 @@ vg_common_svg_create_vg_node(Svg_Node *node) if (!node || (node->type != SVG_NODE_DOC)) return NULL; vg_data = calloc(1, sizeof(Vg_File_Data)); + EINA_SAFETY_ON_NULL_RETURN_VAL(vg_data, NULL); + vg_data->view_box.x = node->node.doc.vx; vg_data->view_box.y = node->node.doc.vy; vg_data->view_box.w = node->node.doc.vw; @@ -838,9 +839,16 @@ static Svg_Node * _create_node(Svg_Node *parent, Svg_Node_Type type) { Svg_Node *node = calloc(1, sizeof(Svg_Node)); + EINA_SAFETY_ON_NULL_RETURN_VAL(node, NULL); // default fill property node->style = calloc(1, sizeof(Svg_Style_Property)); + if (!node->style) + { + free(node); + ERR("OOM: Failed calloc()"); + return NULL; + } // update the default value of stroke and fill //https://www.w3.org/TR/SVGTiny12/painting.html#SpecifyingPaint @@ -884,12 +892,14 @@ _create_gradient_node(Efl_VG *vg) unsigned int count = 0, i; Svg_Style_Gradient *grad = calloc(1, sizeof(Svg_Style_Gradient)); + EINA_SAFETY_ON_NULL_RETURN_VAL(grad, NULL); - grad->spread = evas_vg_gradient_spread_get(vg); - evas_vg_gradient_stop_get(vg, &stops, &count); + grad->spread = efl_gfx_gradient_spread_get(vg); + efl_gfx_gradient_stop_get(vg, &stops, &count); for (i = 0; i < count; i++) { new_stop = calloc(1, sizeof(Efl_Gfx_Gradient_Stop)); + if (!new_stop) goto oom_error; memcpy(new_stop, stops, sizeof(Efl_Gfx_Gradient_Stop)); grad->stops = eina_list_append(grad->stops, new_stop); stops++; @@ -898,19 +908,26 @@ _create_gradient_node(Efl_VG *vg) { grad->type = SVG_LINEAR_GRADIENT; grad->linear = calloc(1, sizeof(Svg_Linear_Gradient)); - evas_vg_gradient_linear_start_get(vg, &grad->linear->x1, &grad->linear->y1); - evas_vg_gradient_linear_end_get(vg, &grad->linear->x2, &grad->linear->y2); + if (!grad->linear) goto oom_error; + efl_gfx_gradient_linear_start_get(vg, &grad->linear->x1, &grad->linear->y1); + efl_gfx_gradient_linear_end_get(vg, &grad->linear->x2, &grad->linear->y2); } else { grad->type = SVG_RADIAL_GRADIENT; grad->radial = calloc(1, sizeof(Svg_Radial_Gradient)); - evas_vg_gradient_radial_center_get(vg, &grad->radial->cx, &grad->radial->cy); - evas_vg_gradient_radial_focal_get(vg, &grad->radial->fx, &grad->radial->fy); - grad->radial->r = evas_vg_gradient_radial_radius_get(vg); + if (!grad->radial) goto oom_error; + efl_gfx_gradient_radial_center_get(vg, &grad->radial->cx, &grad->radial->cy); + efl_gfx_gradient_radial_focal_get(vg, &grad->radial->fx, &grad->radial->fy); + grad->radial->r = efl_gfx_gradient_radial_radius_get(vg); } return grad; + +oom_error: + ERR("OOM: Failed calloc()"); + return grad; + } static void @@ -921,7 +938,7 @@ _apply_svg_property(Svg_Node *node, Efl_VG *vg) Svg_Style_Property *style = node->style; // transformation - if ((matrix = evas_vg_node_transformation_get(vg))) + if ((matrix = efl_canvas_vg_node_transformation_get(vg))) { node->transform = calloc(1, sizeof(Eina_Matrix3)); eina_matrix3_copy(node->transform, matrix); @@ -938,36 +955,36 @@ _apply_svg_property(Svg_Node *node, Efl_VG *vg) // apply the fill style property style->fill.fill_rule = efl_gfx_shape_fill_rule_get(vg); style->fill.paint.none = EINA_FALSE; - if (evas_vg_shape_fill_get(vg)) + if (efl_canvas_vg_shape_fill_get(vg)) { // if the fill has gradient then apply. - style->fill.paint.gradient = _create_gradient_node(evas_vg_shape_fill_get(vg)); + style->fill.paint.gradient = _create_gradient_node(efl_canvas_vg_shape_fill_get(vg)); } else { - evas_vg_node_color_get(vg, &style->fill.paint.r, &style->fill.paint.g, - &style->fill.paint.b, &style->fill.opacity); + efl_gfx_color_get(vg, &style->fill.paint.r, &style->fill.paint.g, + &style->fill.paint.b, &style->fill.opacity); } // apply stroke style property style->stroke.paint.none = EINA_FALSE; - if (evas_vg_shape_stroke_fill_get(vg)) + if (efl_canvas_vg_shape_stroke_fill_get(vg)) { // if the stroke has gradient then apply. - style->stroke.paint.gradient = _create_gradient_node(evas_vg_shape_stroke_fill_get(vg)); + style->stroke.paint.gradient = _create_gradient_node(efl_canvas_vg_shape_stroke_fill_get(vg)); } else { // apply the stroke color - evas_vg_shape_stroke_color_get(vg, &style->stroke.paint.r, &style->stroke.paint.g, + efl_gfx_shape_stroke_color_get(vg, &style->stroke.paint.r, &style->stroke.paint.g, &style->stroke.paint.b, &style->stroke.opacity); } - style->stroke.width = (evas_vg_shape_stroke_width_get(vg)); - style->stroke.cap = evas_vg_shape_stroke_cap_get(vg); - style->stroke.join = evas_vg_shape_stroke_join_get(vg); - style->stroke.scale = evas_vg_shape_stroke_scale_get(vg); + style->stroke.width = efl_gfx_shape_stroke_width_get(vg); + style->stroke.cap = efl_gfx_shape_stroke_cap_get(vg); + style->stroke.join = efl_gfx_shape_stroke_join_get(vg); + style->stroke.scale = efl_gfx_shape_stroke_scale_get(vg); } @@ -996,8 +1013,8 @@ vg_common_create_svg_node_helper(Efl_VG *vg, Svg_Node *parent) 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); - evas_vg_shape_path_length_get(vg, &commands_count, &points_count); + efl_gfx_path_get(vg, &commands, &points); + efl_gfx_path_length_get(vg, &commands_count, &points_count); svg_node->node.command.commands_count = commands_count; svg_node->node.command.points_count = points_count; svg_node->node.command.points = calloc(points_count, sizeof(double)); diff --git a/src/tests/ecore/ecore_audio_out_test.eo b/src/tests/ecore/ecore_audio_out_test.eo new file mode 100644 index 0000000000..72b86a0233 --- /dev/null +++ b/src/tests/ecore/ecore_audio_out_test.eo @@ -0,0 +1,8 @@ +class @beta Ecore.Audio.Out.Test extends Ecore.Audio.Out +{ + data: null; + implements { + @empty Ecore.Audio.source { set; get; } + @empty Ecore.Audio.format { set; get; } + } +} diff --git a/src/tests/ecore/ecore_test_ecore_audio.c b/src/tests/ecore/ecore_test_ecore_audio.c index 0537014631..9c8a890945 100644 --- a/src/tests/ecore/ecore_test_ecore_audio.c +++ b/src/tests/ecore/ecore_test_ecore_audio.c @@ -22,7 +22,7 @@ static void _looped_cb(void *data EINA_UNUSED, const Efl_Event *event) } #ifdef HAVE_PULSE -#if 0 + static void _failed_cb(void *data, const Efl_Event *event EINA_UNUSED) { Eina_Bool *pulse_context_failed = data; @@ -83,7 +83,6 @@ EFL_START_TEST(ecore_test_ecore_audio_obj_pulse) } EFL_END_TEST #endif -#endif static Eina_Bool _quit(void *data EINA_UNUSED) { @@ -312,6 +311,9 @@ EFL_START_TEST(ecore_test_ecore_audio_obj_sndfile) } EFL_END_TEST +#include "ecore_audio_out_test.eo.h" +#include "ecore_audio_out_test.eo.c" + EFL_START_TEST(ecore_test_ecore_audio_obj_in_out) { Eo *out2; @@ -320,7 +322,7 @@ EFL_START_TEST(ecore_test_ecore_audio_obj_in_out) 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); + Eo *out = efl_add_ref(ECORE_AUDIO_OUT_TEST_CLASS, NULL); fail_if(!in); fail_if(!in2); @@ -419,7 +421,7 @@ EFL_START_TEST(ecore_test_ecore_audio_obj_vio) in = efl_add_ref(ECORE_AUDIO_IN_CLASS, NULL); fail_if(!in); - out = efl_add_ref(ECORE_AUDIO_OUT_CLASS, NULL); + out = efl_add_ref(ECORE_AUDIO_OUT_TEST_CLASS, NULL); fail_if(!out); ecore_audio_obj_vio_set(in, &in_vio, NULL, NULL); @@ -544,7 +546,7 @@ EFL_START_TEST(ecore_test_ecore_audio_obj) objs[0] = efl_add_ref(ECORE_AUDIO_IN_CLASS, NULL); fail_if(!objs[0]); - objs[1] = efl_add_ref(ECORE_AUDIO_OUT_CLASS, NULL); + objs[1] = efl_add_ref(ECORE_AUDIO_OUT_TEST_CLASS, NULL); fail_if(!objs[1]); for (i=0; i<2; i++) { @@ -627,7 +629,7 @@ ecore_test_ecore_audio(TCase *tc) tcase_add_test(tc, ecore_test_ecore_audio_cleanup); #endif #ifdef HAVE_PULSE - //tcase_add_test(tc, ecore_test_ecore_audio_obj_pulse); + tcase_add_test(tc, ecore_test_ecore_audio_obj_pulse); #endif } diff --git a/src/tests/ecore/ecore_test_ecore_imf.c b/src/tests/ecore/ecore_test_ecore_imf.c index 9851c77fa1..67571c40f5 100644 --- a/src/tests/ecore/ecore_test_ecore_imf.c +++ b/src/tests/ecore/ecore_test_ecore_imf.c @@ -14,7 +14,7 @@ EFL_START_TEST(ecore_test_ecore_imf_init) EFL_END_TEST static const char *built_modules[] = { -#ifdef ENABLE_XIM +#ifdef BUILD_ECORE_IMF_XIM "xim", #endif #ifdef BUILD_ECORE_IMF_IBUS diff --git a/src/tests/ecore/efl_app_suite.c b/src/tests/ecore/efl_app_suite.c index b3be09915a..957cb3099e 100644 --- a/src/tests/ecore/efl_app_suite.c +++ b/src/tests/ecore/efl_app_suite.c @@ -9,7 +9,6 @@ #include "efl_app_suite.h" #include "../efl_check.h" - EFL_START_TEST(efl_app_test_efl_build_version) { const Efl_Version *ver; @@ -17,7 +16,7 @@ EFL_START_TEST(efl_app_test_efl_build_version) ecore_init(); - app = efl_app_main_get(EFL_APP_CLASS); + app = efl_app_main_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); @@ -53,6 +52,8 @@ static const Efl_Test_Case etc[] = { { "Promise", efl_app_test_promise_2 }, { "Promise", efl_app_test_promise_3 }, { "Promise", efl_app_test_promise_safety }, + { "Env", efl_test_efl_env }, + { "CML", efl_test_efl_cml }, { NULL, NULL } }; diff --git a/src/tests/ecore/efl_app_suite.h b/src/tests/ecore/efl_app_suite.h index 29ed8f031f..874d2bb503 100644 --- a/src/tests/ecore/efl_app_suite.h +++ b/src/tests/ecore/efl_app_suite.h @@ -11,5 +11,7 @@ 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); +void efl_test_efl_env(TCase *tc); +void efl_test_efl_cml(TCase *tc); #endif /* _EFL_APP_SUITE_H */ diff --git a/src/tests/ecore/efl_app_test_cml.c b/src/tests/ecore/efl_app_test_cml.c new file mode 100644 index 0000000000..33024dabb8 --- /dev/null +++ b/src/tests/ecore/efl_app_test_cml.c @@ -0,0 +1,85 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#define EFL_CORE_COMMAND_LINE_PROTECTED + +#include +#include +#define EFL_NOLEGACY_API_SUPPORT +#include +#include "efl_app_suite.h" +#include "../efl_check.h" + +typedef struct { + +} Efl_App_Test_CML_Data; + +#include "efl_app_test_cml.eo.h" +#include "efl_app_test_cml.eo.c" + +static Eina_Array* +_construct_array(void) +{ + Eina_Array *array = eina_array_new(16); + + eina_array_push(array, eina_stringshare_add("/bin/sh")); + eina_array_push(array, eina_stringshare_add("-C")); + eina_array_push(array, eina_stringshare_add("foo")); + eina_array_push(array, eina_stringshare_add("--test")); + eina_array_push(array, eina_stringshare_add("--option=done")); + eina_array_push(array, eina_stringshare_add("--")); + eina_array_push(array, eina_stringshare_add("asdf --test")); + return array; +} + +static const char* +_construct_string(void) +{ + return "/bin/sh -C foo --test --option=done -- \"asdf --test\""; +} + +EFL_START_TEST(efl_core_cml_string) +{ + Efl_App_Test_CML *cml = efl_add_ref(EFL_APP_TEST_CML_CLASS, NULL); + Eina_Array *content = _construct_array(); + Eina_Stringshare *str; + Eina_Bool b; + int i = 0; + + b = efl_core_command_line_command_string_set(cml, _construct_string()); + ck_assert_int_ne(b, 0); + + EINA_ACCESSOR_FOREACH(efl_core_command_line_command_access(cml), i, str) + { + ck_assert_str_eq(eina_array_data_get(content, i), str); + } + ck_assert_str_eq(efl_core_command_line_command_get(cml), _construct_string()); +} +EFL_END_TEST + +EFL_START_TEST(efl_core_cml_array) +{ + Efl_App_Test_CML *cml = efl_add_ref(EFL_APP_TEST_CML_CLASS, NULL); + Eina_Array *content1 = _construct_array(); + Eina_Array *content2 = _construct_array(); + Eina_Stringshare *str; + Eina_Bool b; + int i = 0; + + b = efl_core_command_line_command_array_set(cml, content1); + ck_assert_int_ne(b, 0); + + EINA_ACCESSOR_FOREACH(efl_core_command_line_command_access(cml), i, str) + { + ck_assert_str_eq(eina_array_data_get(content2, i), str); + } + ck_assert_str_eq(efl_core_command_line_command_get(cml), _construct_string()); +} +EFL_END_TEST + +void efl_test_efl_cml(TCase *tc) +{ + tcase_add_test(tc, efl_core_cml_string); + tcase_add_test(tc, efl_core_cml_array); +} diff --git a/src/tests/ecore/efl_app_test_cml.eo b/src/tests/ecore/efl_app_test_cml.eo new file mode 100644 index 0000000000..ade7426a89 --- /dev/null +++ b/src/tests/ecore/efl_app_test_cml.eo @@ -0,0 +1,4 @@ +class @beta Efl.App.Test.CML extends Efl.Object implements Efl.Core.Command_Line +{ + +} diff --git a/src/tests/ecore/efl_app_test_env.c b/src/tests/ecore/efl_app_test_env.c new file mode 100644 index 0000000000..e7e5a2e034 --- /dev/null +++ b/src/tests/ecore/efl_app_test_env.c @@ -0,0 +1,135 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#define EFL_NOLEGACY_API_SUPPORT +#include +#include "efl_app_suite.h" +#include "../efl_check.h" + +EFL_START_TEST(efl_core_env_test_set_get) +{ + Efl_Core_Env *env = efl_add_ref(EFL_CORE_ENV_CLASS, NULL); + + efl_core_env_set(env, "FOO", "bar"); + efl_core_env_set(env, "going", "home"); + efl_core_env_set(env, "Merry", "christmas"); + + ck_assert_str_eq(efl_core_env_get(env, "FOO"), "bar"); + ck_assert_str_eq(efl_core_env_get(env, "going"), "home"); + ck_assert_str_eq(efl_core_env_get(env, "Merry"), "christmas"); + + efl_core_env_unset(env, "Merry"); + + ck_assert_str_eq(efl_core_env_get(env, "FOO"), "bar"); + ck_assert_str_eq(efl_core_env_get(env, "going"), "home"); + ck_assert_ptr_eq(efl_core_env_get(env, "Merry"), NULL); + + efl_unref(env); +} +EFL_END_TEST + +EFL_START_TEST(efl_core_env_test_invalid_keys) +{ + Efl_Core_Env *env = efl_add_ref(EFL_CORE_ENV_CLASS, NULL); + +#define CHECK(val) \ + efl_core_env_set(env, val, "TEST"); \ + ck_assert_ptr_eq(efl_core_env_get(env, val), NULL); + + CHECK("0foo"); + CHECK("foo bar"); + CHECK("foo!bar"); + +#undef CHECK + + +#define CHECK(val) \ + efl_core_env_set(env, val, "TEST"); \ + ck_assert_str_eq(efl_core_env_get(env, val), "TEST"); + + CHECK("foo0"); + CHECK("foo_bar"); + +#undef CHECK + +} +EFL_END_TEST + +EFL_START_TEST(efl_core_env_test_clear) +{ + Efl_Core_Env *env = efl_add_ref(EFL_CORE_ENV_CLASS, NULL); + + efl_core_env_set(env, "FOO", "bar"); + efl_core_env_set(env, "going", "home"); + efl_core_env_set(env, "Merry", "christmas"); + + efl_core_env_clear(env); + + ck_assert_ptr_eq(efl_core_env_get(env, "FOO"), NULL); + ck_assert_ptr_eq(efl_core_env_get(env, "going"), NULL); + ck_assert_ptr_eq(efl_core_env_get(env, "Merry"), NULL); + + efl_unref(env); +} +EFL_END_TEST + +EFL_START_TEST(efl_core_env_test_fork) +{ + Efl_Core_Env *env_fork, *env = efl_add_ref(EFL_CORE_ENV_CLASS, NULL); + + efl_core_env_set(env, "FOO", "bar"); + efl_core_env_set(env, "going", "home"); + efl_core_env_set(env, "Merry", "christmas"); + + env_fork = efl_duplicate(env); + + ck_assert_str_eq(efl_core_env_get(env_fork, "FOO"), "bar"); + ck_assert_str_eq(efl_core_env_get(env_fork, "going"), "home"); + ck_assert_str_eq(efl_core_env_get(env_fork, "Merry"), "christmas"); + + efl_unref(env); +} +EFL_END_TEST + +EFL_START_TEST(efl_core_env_test_process) +{ + Efl_Core_Env *env_fork, *env = efl_env_self(); + + ck_assert(env); + + ck_assert_str_eq(efl_core_env_get(env, "PATH"), getenv("PATH")); + env_fork = efl_duplicate(env); + ck_assert_str_eq(efl_core_env_get(env_fork, "PATH"), getenv("PATH")); + + efl_unref(env); +} +EFL_END_TEST + +EFL_START_TEST(efl_core_env_test_undepend_fork) +{ + Efl_Core_Env *env_fork, *env = efl_env_self(); + + ck_assert(env); + + ck_assert_str_eq(efl_core_env_get(env, "PATH"), getenv("PATH")); + env_fork = efl_duplicate(env); + efl_core_env_set(env_fork, "PATH", "abc"); + ck_assert_str_eq(efl_core_env_get(env, "PATH"), getenv("PATH")); + + efl_unref(env); + efl_unref(env_fork); +} +EFL_END_TEST + +void efl_test_efl_env(TCase *tc) +{ + tcase_add_test(tc, efl_core_env_test_set_get); + tcase_add_test(tc, efl_core_env_test_invalid_keys); + tcase_add_test(tc, efl_core_env_test_clear); + tcase_add_test(tc, efl_core_env_test_fork); + tcase_add_test(tc, efl_core_env_test_process); + tcase_add_test(tc, efl_core_env_test_undepend_fork); +} diff --git a/src/tests/ecore/efl_app_test_loop.c b/src/tests/ecore/efl_app_test_loop.c index f8e0b5548f..7b8dafccf3 100644 --- a/src/tests/ecore/efl_app_test_loop.c +++ b/src/tests/ecore/efl_app_test_loop.c @@ -4,6 +4,7 @@ #include #include +#include "eo_internal.h" #define EFL_NOLEGACY_API_SUPPORT #include #include "efl_app_suite.h" @@ -15,31 +16,92 @@ EFL_START_TEST(efl_app_test_efl_loop_register) ecore_init(); - t = efl_provider_find(efl_app_main_get(EFL_APP_CLASS), EFL_LOOP_CLASS); + t = efl_provider_find(efl_app_main_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_main_get(EFL_APP_CLASS), EFL_LOOP_TIMER_CLASS); + t = efl_provider_find(efl_app_main_get(), EFL_LOOP_TIMER_CLASS); fail_if(t != NULL); - n = efl_add(EFL_LOOP_TIMER_CLASS, efl_app_main_get(EFL_APP_CLASS), + n = efl_add(EFL_LOOP_TIMER_CLASS, efl_app_main_get(), efl_loop_timer_interval_set(efl_added, 1.0)); - efl_loop_register(efl_app_main_get(EFL_APP_CLASS), EFL_LOOP_TIMER_CLASS, n); + efl_loop_register(efl_app_main_get(), EFL_LOOP_TIMER_CLASS, n); - t = efl_provider_find(efl_app_main_get(EFL_APP_CLASS), EFL_LOOP_TIMER_CLASS); + t = efl_provider_find(efl_app_main_get(), EFL_LOOP_TIMER_CLASS); fail_if(!efl_isa(t, EFL_LOOP_TIMER_CLASS)); fail_if(t != n); - efl_loop_unregister(efl_app_main_get(EFL_APP_CLASS), EFL_LOOP_TIMER_CLASS, n); + efl_loop_unregister(efl_app_main_get(), EFL_LOOP_TIMER_CLASS, n); - t = efl_provider_find(efl_app_main_get(EFL_APP_CLASS), EFL_LOOP_TIMER_CLASS); + t = efl_provider_find(efl_app_main_get(), EFL_LOOP_TIMER_CLASS); fail_if(t != NULL); ecore_shutdown(); } EFL_END_TEST +static void +efl_app_test_efl_loop_concentric_fail(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) +{ + ck_abort_msg("test timeout"); +} + +static void +loop_idle_enter(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) +{ + static int num = 0; + + if (num++ == 5) efl_loop_quit(efl_main_loop_get(), eina_value_int_init(0)); +} + +static void +loop_idle(void *data, const Efl_Event *ev EINA_UNUSED) +{ + efl_loop_iterate(data); +} + +static void +loop_timer_tick(void *data, const Efl_Event *ev EINA_UNUSED) +{ + efl_loop_iterate(data); +} + +EFL_CLASS_SIMPLE_CLASS(efl_loop, "Efl.Loop", EFL_LOOP_CLASS) + +EFL_START_TEST(efl_app_test_efl_loop_concentric) +{ + Eo *loop, *loop2, *timer, *timer2; + int exitcode; + + loop = efl_main_loop_get(); + loop2 = efl_add(efl_loop_realized_class_get(), loop); + efl_event_callback_add(loop, EFL_LOOP_EVENT_IDLE, loop_idle, loop2); + efl_event_callback_add(loop, EFL_LOOP_EVENT_IDLE_ENTER, loop_idle_enter, NULL); + timer = efl_add(EFL_LOOP_TIMER_CLASS, loop2, + efl_loop_timer_interval_set(efl_added, 0.01), + efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, loop_timer_tick, loop) + ); + timer2 = efl_add(EFL_LOOP_TIMER_CLASS, loop, + efl_loop_timer_interval_set(efl_added, 0.5), + efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, efl_app_test_efl_loop_concentric_fail, NULL) + ); + exitcode = efl_loop_exit_code_process(efl_loop_begin(loop)); + ck_assert_int_eq(exitcode, 0); + efl_del(timer2); + efl_del(timer); + efl_del(loop2); +} +EFL_END_TEST + +EFL_START_TEST(efl_loop_test_realized_name) +{ + ck_assert_str_eq(efl_class_name_get(efl_loop_realized_class_get()), "Efl.Loop_Realized"); +} +EFL_END_TEST + void efl_app_test_efl_loop(TCase *tc) { tcase_add_test(tc, efl_app_test_efl_loop_register); + tcase_add_test(tc, efl_app_test_efl_loop_concentric); + tcase_add_test(tc, efl_loop_test_realized_name); } diff --git a/src/tests/ecore/efl_app_test_loop_timer.c b/src/tests/ecore/efl_app_test_loop_timer.c index 999c5f1743..e866689012 100644 --- a/src/tests/ecore/efl_app_test_loop_timer.c +++ b/src/tests/ecore/efl_app_test_loop_timer.c @@ -47,7 +47,7 @@ EFL_START_TEST(ecore_test_timer_lifecycle) 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_LOOP_TIMER_EVENT_TIMER_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); @@ -66,7 +66,7 @@ EFL_END_TEST EFL_START_TEST(efl_app_test_loop_timer_invalid) { - Efl_Object *t = efl_add(EFL_LOOP_TIMER_CLASS, efl_app_main_get(EFL_APP_CLASS)); + Efl_Object *t = efl_add(EFL_LOOP_TIMER_CLASS, efl_app_main_get()); fail_if(t != NULL); } EFL_END_TEST diff --git a/src/tests/ecore/efl_app_test_promise.c b/src/tests/ecore/efl_app_test_promise.c index 610851045c..91d3f802d7 100644 --- a/src/tests/ecore/efl_app_test_promise.c +++ b/src/tests/ecore/efl_app_test_promise.c @@ -176,7 +176,7 @@ _future_get(PromiseCtx *ctx, double timeout) f = eina_future_new(ctx->p); fail_if(!f); 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_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, _simple_timeout, ctx), efl_loop_timer_interval_set(efl_added, timeout)); fail_if(!ctx->t); return f; @@ -1131,6 +1131,7 @@ EFL_START_TEST(efl_test_promise_null) fail_unless(ctx.did); ecore_shutdown(); + eina_log_print_cb_set(NULL, NULL); } EFL_END_TEST @@ -1152,6 +1153,7 @@ EFL_START_TEST(efl_test_promise_reject_resolve_null) eina_promise_reject(NULL, DEFAULT_ERROR); fail_unless(ctx.did); ecore_shutdown(); + eina_log_print_cb_set(NULL, NULL); } EFL_END_TEST @@ -1236,6 +1238,7 @@ EFL_START_TEST(efl_test_future_null) ck_assert_ptr_eq(f, NULL); ck_assert_int_eq(easy_cb_calls, 2); ecore_shutdown(); + eina_log_print_cb_set(NULL, NULL); } EFL_END_TEST @@ -1280,6 +1283,7 @@ EFL_START_TEST(efl_test_future_all_null) ck_assert_ptr_eq(f, NULL); ecore_shutdown(); ck_assert_int_eq(cb_called, len); + eina_log_print_cb_set(NULL, NULL); } EFL_END_TEST @@ -1311,6 +1315,7 @@ EFL_START_TEST(efl_test_future_race_null) ck_assert_ptr_eq(f, NULL); ecore_shutdown(); ck_assert_int_eq(cb_called, len); + eina_log_print_cb_set(NULL, NULL); } EFL_END_TEST diff --git a/src/tests/ecore/meson.build b/src/tests/ecore/meson.build index 98104146be..c49d941355 100644 --- a/src/tests/ecore/meson.build +++ b/src/tests/ecore/meson.build @@ -23,9 +23,28 @@ ecore_suite_deps += ecore_evas ecore_suite_deps += ecore_input ecore_suite_deps += ecore_imf +test_eo_files = [ + 'ecore_audio_out_test.eo', +] +test_eo_file_target = [] + +foreach eo_file : test_eo_files + test_eo_file_target += custom_target('eolian_gen_' + eo_file, + input : eo_file, + output : [eo_file + '.h'], + depfile : eo_file + '.d', + install : false, + command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories, + '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'), + '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'), + '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'), + '-gchd', '@INPUT@']) +endforeach + if get_option('audio') ecore_suite_deps += ecore_audio ecore_suite_src += 'ecore_test_ecore_audio.c' + ecore_suite_src += test_eo_file_target endif if get_option('fb') @@ -56,14 +75,33 @@ efl_app_suite_src = [ 'efl_app_test_loop.c', 'efl_app_test_loop_fd.c', 'efl_app_test_loop_timer.c', - 'efl_app_test_promise.c' + 'efl_app_test_promise.c', + 'efl_app_test_env.c', + 'efl_app_test_cml.c', ] +priv_eo_files = [ + 'efl_app_test_cml.eo', +] + +priv_eo_file_target = [] +foreach eo_file : priv_eo_files + priv_eo_file_target += custom_target('eolian_gen_' + eo_file, + input : eo_file, + output : [eo_file + '.h'], + depfile : eo_file + '.d', + command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories, + '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'), + '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'), + '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'), + '-gchd', '@INPUT@']) +endforeach + efl_app_suite_deps = [m] efl_app_suite_deps += ecore efl_app_suite = executable('efl_app_suite', - efl_app_suite_src, + efl_app_suite_src, priv_eo_file_target, dependencies: [efl_app_suite_deps, check], c_args : [ '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', 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 5551508288..cf83eaf402 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 @@ -5,7 +5,7 @@ #include #ifdef HAVE_SYS_SOCKET_H -#include +# include #endif #include @@ -236,7 +236,7 @@ _resolve_done(void *data, const Eina_Value v, const Eina_Future *dead_future EIN static void _resolve(struct resolve_ctx *ctx, const char *address, int family, int flags) { - ctx->future = efl_net_ip_address_resolve(EFL_NET_IP_ADDRESS_CLASS, + ctx->future = efl_net_ip_address_resolve( address, family, flags); ck_assert_ptr_ne(ctx->future, NULL); ctx->future = eina_future_then(ctx->future, _resolve_done, ctx, NULL); @@ -256,7 +256,7 @@ _ipv4_check(Eo *o, const struct sockaddr_in *addr) ck_assert_ptr_ne(o, NULL); ck_assert_int_eq(efl_net_ip_address_family_get(o), AF_INET); - ck_assert_int_eq(efl_net_ip_address_port_get(o), ntohs(addr->sin_port)); + ck_assert_int_eq(efl_net_ip_address_port_get(o), eina_ntohs(addr->sin_port)); rs = efl_net_ip_address_get(o); ck_assert_int_eq(eina_slice_compare(rs, slice), 0); @@ -266,7 +266,7 @@ _ipv4_check(Eo *o, const struct sockaddr_in *addr) if (addr->sin_port) { snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), - ":%hu", htons(addr->sin_port)); + ":%hu", eina_htons(addr->sin_port)); } ck_assert_ptr_ne(efl_net_ip_address_string_get(o), NULL); ck_assert_str_eq(efl_net_ip_address_string_get(o), buf); @@ -280,26 +280,26 @@ EFL_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; - addr.sin_port = htons(12345); - addr.sin_addr.s_addr = htonl(0xabcdefafU); + addr.sin_port = eina_htons(12345); + addr.sin_addr.s_addr = eina_htonl(0xabcdefafU); 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_port_set(efl_added, eina_ntohs(addr.sin_port)), efl_net_ip_address_set(efl_added, slice)); _ipv4_check(o, &addr); efl_unref(o); - addr.sin_port = htons(8081); - addr.sin_addr.s_addr = htonl(0); + addr.sin_port = eina_htons(8081); + addr.sin_addr.s_addr = eina_htonl(0); 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_port_set(efl_added, eina_ntohs(addr.sin_port)), efl_net_ip_address_set(efl_added, slice)); _ipv4_check(o, &addr); efl_unref(o); - addr.sin_port = htons(0); - addr.sin_addr.s_addr = htonl(0x12345678); + addr.sin_port = eina_htons(0); + addr.sin_addr.s_addr = eina_htonl(0x12345678); 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)); @@ -356,16 +356,16 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_fail) efl_unref(o); TRAP_ERRORS_FINISH(1); - addr.sin_port = htons(12345); - addr.sin_addr.s_addr = htonl(0xabcdefafU); + addr.sin_port = eina_htons(12345); + addr.sin_addr.s_addr = eina_htonl(0xabcdefafU); 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_port_set(efl_added, eina_ntohs(addr.sin_port)), efl_net_ip_address_set(efl_added, slice)); _ipv4_check(o, &addr); TRAP_ERRORS_BEGIN(ecore_con, ERR, "port already set to %hu, new %hu"); - efl_net_ip_address_port_set(o, ntohs(addr.sin_port)); + efl_net_ip_address_port_set(o, eina_ntohs(addr.sin_port)); TRAP_ERRORS_FINISH(0); TRAP_ERRORS_BEGIN(ecore_con, ERR, "port already set to %hu, new %hu"); @@ -383,7 +383,7 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_fail) TRAP_ERRORS_FINISH(0); TRAP_ERRORS_BEGIN(ecore_con, ERR, "address already set to %s, new %s"); - addr.sin_addr.s_addr = htonl(0x12345678); + addr.sin_addr.s_addr = eina_htonl(0x12345678); slice.len = sizeof(addr.sin_addr.s_addr); efl_net_ip_address_set(o, slice); TRAP_ERRORS_FINISH(1); @@ -400,26 +400,26 @@ EFL_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; - 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), + addr.sin_port = eina_htons(12345); + addr.sin_addr.s_addr = eina_htonl(0xabcdefafU); + o = efl_net_ip_address_create( + eina_ntohs(addr.sin_port), slice); _ipv4_check(o, &addr); efl_unref(o); - addr.sin_port = htons(8081); - addr.sin_addr.s_addr = htonl(0); - o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, - ntohs(addr.sin_port), + addr.sin_port = eina_htons(8081); + addr.sin_addr.s_addr = eina_htonl(0); + o = efl_net_ip_address_create( + eina_ntohs(addr.sin_port), slice); _ipv4_check(o, &addr); efl_unref(o); - addr.sin_port = htons(0); - addr.sin_addr.s_addr = htonl(0x12345678); - o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, - ntohs(addr.sin_port), + addr.sin_port = eina_htons(0); + addr.sin_addr.s_addr = eina_htonl(0x12345678); + o = efl_net_ip_address_create( + eina_ntohs(addr.sin_port), slice); _ipv4_check(o, &addr); efl_unref(o); @@ -434,7 +434,7 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_fail) Eo *o; 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, + o = efl_net_ip_address_create( 1234, wrong_slice); ck_assert_ptr_eq(o, NULL); @@ -450,16 +450,16 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_ok) }; Eo *o; - 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); + addr.sin_port = eina_htons(12345); + addr.sin_addr.s_addr = eina_htonl(0xabcdefafU); + o = efl_net_ip_address_create_sockaddr(&addr); ck_assert_ptr_ne(&addr, efl_net_ip_address_sockaddr_get(o)); _ipv4_check(o, &addr); 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); + addr.sin_port = eina_htons(0); + addr.sin_addr.s_addr = eina_htonl(0); + o = efl_net_ip_address_create_sockaddr(&addr); ck_assert_ptr_ne(&addr, efl_net_ip_address_sockaddr_get(o)); _ipv4_check(o, &addr); efl_unref(o); @@ -475,12 +475,12 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_fail) Eo *o; TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: sockaddr == NULL"); - o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, NULL); + o = efl_net_ip_address_create_sockaddr(NULL); ck_assert_ptr_eq(o, NULL); TRAP_ERRORS_FINISH(1); TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: (sockaddr->sa_family != AF_INET) && (sockaddr->sa_family != AF_INET6) is true"); - o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr); + o = efl_net_ip_address_create_sockaddr(&addr); ck_assert_ptr_eq(o, NULL); TRAP_ERRORS_FINISH(1); @@ -491,22 +491,22 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_ok) { Eo *o; - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0.1:12345"); + o = efl_net_ip_address_parse( "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_unref(o); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0.1:0"); + o = efl_net_ip_address_parse( "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_unref(o); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0.1"); + o = efl_net_ip_address_parse( "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_unref(o); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "192.168.0.123:80"); + o = efl_net_ip_address_parse( "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_unref(o); @@ -519,30 +519,30 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_fail) Eo *o; TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: numeric_address == NULL"); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, NULL); + o = efl_net_ip_address_parse( NULL); ck_assert_ptr_eq(o, NULL); TRAP_ERRORS_FINISH(1); /* incomplete numbers */ TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127."); + o = efl_net_ip_address_parse( "127."); ck_assert_ptr_eq(o, NULL); TRAP_ERRORS_FINISH(0); /* no error messages! */ TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0."); + o = efl_net_ip_address_parse( "127.0.0."); ck_assert_ptr_eq(o, NULL); TRAP_ERRORS_FINISH(0); /* no error messages! */ /* hostnames are not numeric, shouldn't return an object */ TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "google.com"); + o = efl_net_ip_address_parse( "google.com"); ck_assert_ptr_eq(o, NULL); TRAP_ERRORS_FINISH(0); /* no error messages! */ /* port names are not numeric, shouldn't return an object */ TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0.1:http"); + o = efl_net_ip_address_parse( "127.0.0.1:http"); ck_assert_ptr_eq(o, NULL); TRAP_ERRORS_FINISH(0); /* no error messages! */ @@ -589,13 +589,13 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_fail) struct resolve_ctx ctx = { }; TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address == NULL"); - ctx.future = efl_net_ip_address_resolve(EFL_NET_IP_ADDRESS_CLASS, + ctx.future = efl_net_ip_address_resolve( NULL, 0, 0); ck_assert_ptr_eq(ctx.future, NULL); TRAP_ERRORS_FINISH(1); TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: (family != AF_UNSPEC) && (family != AF_INET) && (family != AF_INET6) is true"); - ctx.future = efl_net_ip_address_resolve(EFL_NET_IP_ADDRESS_CLASS, + ctx.future = efl_net_ip_address_resolve( "localhost", 1234, 0); ck_assert_ptr_eq(ctx.future, NULL); TRAP_ERRORS_FINISH(1); @@ -641,9 +641,9 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_checks) struct sockaddr_in a = { .sin_family = AF_INET, .sin_port = 0, - .sin_addr.s_addr = htonl(itr->addr), + .sin_addr.s_addr = eina_htonl(itr->addr), }; - Eo *o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &a); + Eo *o = efl_net_ip_address_create_sockaddr(&a); ck_assert_ptr_ne(o, NULL); ck_assert_int_eq(efl_net_ip_address_ipv4_class_a_check(o), itr->is_a); @@ -677,7 +677,7 @@ _ipv6_check(Eo *o, const struct sockaddr_in6 *addr) ck_assert_ptr_ne(o, NULL); ck_assert_int_eq(efl_net_ip_address_family_get(o), AF_INET6); - ck_assert_int_eq(efl_net_ip_address_port_get(o), ntohs(addr->sin6_port)); + ck_assert_int_eq(efl_net_ip_address_port_get(o), eina_ntohs(addr->sin6_port)); rs = efl_net_ip_address_get(o); ck_assert_int_eq(eina_slice_compare(rs, slice), 0); @@ -689,7 +689,7 @@ _ipv6_check(Eo *o, const struct sockaddr_in6 *addr) if (addr->sin6_port) { snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), - ":%hu", htons(addr->sin6_port)); + ":%hu", eina_htons(addr->sin6_port)); } ck_assert_ptr_ne(efl_net_ip_address_string_get(o), NULL); @@ -711,20 +711,20 @@ EFL_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; - addr.sin6_port = htons(12345); + addr.sin6_port = eina_htons(12345); _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8); 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_port_set(efl_added, eina_ntohs(addr.sin6_port)), efl_net_ip_address_set(efl_added, slice)); _ipv6_check(o, &addr); efl_unref(o); - addr.sin6_port = htons(8081); + addr.sin6_port = eina_htons(8081); _ipv6_set(&addr, 0, 0, 0, 0, 0, 0, 0, 0); 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_port_set(efl_added, eina_ntohs(addr.sin6_port)), efl_net_ip_address_set(efl_added, slice)); _ipv6_check(o, &addr); efl_unref(o); @@ -752,16 +752,16 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_fail) efl_unref(o); TRAP_ERRORS_FINISH(1); - addr.sin6_port = htons(12345); + addr.sin6_port = eina_htons(12345); _ipv6_set(&addr, 0, 0, 0, 0, 0, 0, 0, 1); 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_port_set(efl_added, eina_ntohs(addr.sin6_port)), efl_net_ip_address_set(efl_added, slice)); _ipv6_check(o, &addr); TRAP_ERRORS_BEGIN(ecore_con, ERR, "port already set to %hu, new %hu"); - efl_net_ip_address_port_set(o, ntohs(addr.sin6_port)); + efl_net_ip_address_port_set(o, eina_ntohs(addr.sin6_port)); TRAP_ERRORS_FINISH(0); TRAP_ERRORS_BEGIN(ecore_con, ERR, "port already set to %hu, new %hu"); @@ -797,26 +797,26 @@ EFL_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; - addr.sin6_port = htons(12365); + addr.sin6_port = eina_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), + o = efl_net_ip_address_create( + eina_ntohs(addr.sin6_port), slice); _ipv6_check(o, &addr); efl_unref(o); - addr.sin6_port = htons(8081); + addr.sin6_port = eina_htons(8081); _ipv6_set(&addr, 0, 0, 0, 0, 0, 0, 0, 0); - o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, - ntohs(addr.sin6_port), + o = efl_net_ip_address_create( + eina_ntohs(addr.sin6_port), slice); _ipv6_check(o, &addr); efl_unref(o); - addr.sin6_port = htons(0); + addr.sin6_port = eina_htons(0); _ipv6_set(&addr, 0, 0, 0, 0, 0, 0, 0, 1); - o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, - ntohs(addr.sin6_port), + o = efl_net_ip_address_create( + eina_ntohs(addr.sin6_port), slice); _ipv6_check(o, &addr); efl_unref(o); @@ -831,16 +831,16 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_create_sockaddr_ok) }; Eo *o; - addr.sin6_port = htons(12345); + addr.sin6_port = eina_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); + o = efl_net_ip_address_create_sockaddr(&addr); ck_assert_ptr_ne(&addr, efl_net_ip_address_sockaddr_get(o)); _ipv6_check(o, &addr); efl_unref(o); - addr.sin6_port = htons(0); + addr.sin6_port = eina_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); + o = efl_net_ip_address_create_sockaddr(&addr); ck_assert_ptr_ne(&addr, efl_net_ip_address_sockaddr_get(o)); _ipv6_check(o, &addr); efl_unref(o); @@ -852,86 +852,86 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_ok) { Eo *o; - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::1]:12345"); + o = efl_net_ip_address_parse( "[::1]:12345"); ck_assert_ptr_ne(o, NULL); ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]:12345"); efl_unref(o); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::1]:0"); + o = efl_net_ip_address_parse( "[::1]:0"); ck_assert_ptr_ne(o, NULL); ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]"); efl_unref(o); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::1]"); + o = efl_net_ip_address_parse( "[::1]"); ck_assert_ptr_ne(o, NULL); ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]"); efl_unref(o); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "::1"); + o = efl_net_ip_address_parse( "::1"); ck_assert_ptr_ne(o, NULL); ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]"); efl_unref(o); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::]:12345"); + o = efl_net_ip_address_parse( "[::]:12345"); ck_assert_ptr_ne(o, NULL); ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::]:12345"); efl_unref(o); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::]:0"); + o = efl_net_ip_address_parse( "[::]:0"); ck_assert_ptr_ne(o, NULL); ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::]"); efl_unref(o); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::]"); + o = efl_net_ip_address_parse( "[::]"); ck_assert_ptr_ne(o, NULL); ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::]"); efl_unref(o); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "::"); + o = efl_net_ip_address_parse( "::"); ck_assert_ptr_ne(o, NULL); ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::]"); efl_unref(o); /* IPv4 Mapped */ - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::ffff:192.168.0.1]:12345"); + o = efl_net_ip_address_parse( "[::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_unref(o); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::ffff:192.168.0.1]"); + o = efl_net_ip_address_parse( "[::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_unref(o); /* IPv4 Compatible */ - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::192.168.0.1]:12345"); + o = efl_net_ip_address_parse( "[::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_unref(o); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::192.168.0.1]"); + o = efl_net_ip_address_parse( "[::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_unref(o); /* Link Local */ - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[fe80::1]:12345"); + o = efl_net_ip_address_parse( "[fe80::1]:12345"); ck_assert_ptr_ne(o, NULL); ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fe80::1]:12345"); efl_unref(o); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[fe80::1]"); + o = efl_net_ip_address_parse( "[fe80::1]"); ck_assert_ptr_ne(o, NULL); ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fe80::1]"); efl_unref(o); /* Site Local */ - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[fc00::1]:12345"); + o = efl_net_ip_address_parse( "[fc00::1]:12345"); ck_assert_ptr_ne(o, NULL); ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fc00::1]:12345"); efl_unref(o); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[fc00::1]"); + o = efl_net_ip_address_parse( "[fc00::1]"); ck_assert_ptr_ne(o, NULL); ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fc00::1]"); efl_unref(o); @@ -947,18 +947,18 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_fail) /* incomplete numbers */ TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "::9999999"); + o = efl_net_ip_address_parse( "::9999999"); ck_assert_ptr_eq(o, NULL); TRAP_ERRORS_FINISH(0); /* no error messages! */ TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "ab:cd:ef:gh"); + o = efl_net_ip_address_parse( "ab:cd:ef:gh"); ck_assert_ptr_eq(o, NULL); TRAP_ERRORS_FINISH(0); /* no error messages! */ /* port names are not numeric, shouldn't return an object */ TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL); - o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::1]:http"); + o = efl_net_ip_address_parse( "[::1]:http"); ck_assert_ptr_eq(o, NULL); TRAP_ERRORS_FINISH(0); /* no error messages! */ @@ -1152,7 +1152,7 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_checks) r = inet_pton(AF_INET6, itr->str, ia); ck_assert_int_eq(r, 1); - Eo *o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &a); + Eo *o = efl_net_ip_address_create_sockaddr(&a); ck_assert_ptr_ne(o, NULL); ck_assert_int_eq(efl_net_ip_address_ipv4_class_a_check(o), EINA_FALSE); diff --git a/src/tests/edje/data/meson.build b/src/tests/edje/data/meson.build index cf10bd9355..2148b861dc 100644 --- a/src/tests/edje/data/meson.build +++ b/src/tests/edje/data/meson.build @@ -25,7 +25,7 @@ foreach edc_file : edc_files themes += custom_target('edje_cc_' + edc_file, input : edc_file, output : '@BASENAME@.edj', - command : edje_cc_exe + [ '-beta', + command : edje_cc_exe + [ '-beta', '-fastcomp', '-id', join_paths(meson.source_root(), 'src', 'tests', 'emotion', 'data'), '-fd', meson.current_source_dir(), '-sd', meson.current_source_dir(), @@ -34,5 +34,5 @@ foreach edc_file : edc_files '-md', meson.current_source_dir(), '-td', meson.current_source_dir(), '@INPUT@', '@OUTPUT@'], - depends : edje_cc) + depends : edje_depends) endforeach diff --git a/src/tests/edje/edje_test_container.c b/src/tests/edje/edje_test_container.c index 018de4d3a0..11fc195e09 100644 --- a/src/tests/edje/edje_test_container.c +++ b/src/tests/edje/edje_test_container.c @@ -102,7 +102,7 @@ EFL_START_TEST(edje_test_box_eoapi) fail_if(i != 3); eina_iterator_free(it); - fail_if(!efl_content_remove(efl_part(obj, "box"), sobjs[0])); + fail_if(!efl_pack_unpack(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); diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c index efe17e522f..fb1e8e224d 100644 --- a/src/tests/edje/edje_test_edje.c +++ b/src/tests/edje/edje_test_edje.c @@ -211,7 +211,8 @@ EFL_START_TEST(edje_test_part_caching) Evas_Object *ly, *o1, *global_p = NULL; ly = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, - efl_file_set(efl_added, test_layout_get("test_swallows.edj"), "test_group") + efl_file_set(efl_added, test_layout_get("test_swallows.edj")), + efl_file_key_set(efl_added, "test_group") ); for (int i = 0; i < 10; ++i) diff --git a/src/tests/edje/edje_test_features.c b/src/tests/edje/edje_test_features.c index 1cff283835..449e97e587 100644 --- a/src/tests/edje/edje_test_features.c +++ b/src/tests/edje/edje_test_features.c @@ -42,13 +42,13 @@ EFL_START_TEST(edje_test_masking) edje_object_freeze(obj); sub = edje_object_part_object_get(obj, "text"); edje_object_thaw(obj); - fail_if(!efl_canvas_object_clip_get(sub)); + fail_if(!efl_canvas_object_clipper_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); + clip2 = efl_canvas_object_clipper_get(sub); fail_if(clip != clip2); evas_free(evas); diff --git a/src/tests/edje/edje_test_signal.c b/src/tests/edje/edje_test_signal.c index 2dc42b0ae7..20240a421f 100644 --- a/src/tests/edje/edje_test_signal.c +++ b/src/tests/edje/edje_test_signal.c @@ -106,7 +106,8 @@ EFL_START_TEST(edje_test_message_send_eo) evas = _setup_evas(); obj = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, - efl_file_set(efl_added, test_layout_get("test_messages.edj"), "test_group")); + efl_file_set(efl_added, test_layout_get("test_messages.edj")), + efl_file_key_set(efl_added, "test_group")); // FIXME: EO API HERE edje_object_signal_callback_add(obj, "*", "edc", _message_signal_reply_cb, &id); @@ -163,7 +164,8 @@ EFL_START_TEST(edje_test_signals) evas = _setup_evas(); obj = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, - efl_file_set(efl_added, test_layout_get("test_signals.edj"), "level1"), + efl_file_set(efl_added, test_layout_get("test_signals.edj")), + efl_file_key_set(efl_added, "level1"), efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(320, 240)), efl_gfx_entity_visible_set(efl_added, 1)); @@ -207,7 +209,8 @@ EFL_START_TEST(edje_test_signal_callback_del_full) obj = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, efl_file_set(efl_added, - test_layout_get("test_signal_callback_del_full.edj"), "test"), + test_layout_get("test_signal_callback_del_full.edj")), + efl_file_key_set(efl_added, "test"), efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(320, 240)), efl_gfx_entity_visible_set(efl_added, 1)); diff --git a/src/tests/edje/edje_test_swallow.c b/src/tests/edje/edje_test_swallow.c index bce0989399..b8f13cf7ec 100644 --- a/src/tests/edje/edje_test_swallow.c +++ b/src/tests/edje/edje_test_swallow.c @@ -107,7 +107,7 @@ EFL_START_TEST(edje_test_swallows_eoapi) fail_if(!efl_content_set(efl_part(ly, "swallow"), o1)); ck_assert_ptr_eq(efl_parent_get(o1), ly); - efl_content_remove(ly, o1); + efl_canvas_layout_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)); @@ -123,6 +123,39 @@ EFL_START_TEST(edje_test_swallows_eoapi) } EFL_END_TEST +EFL_START_TEST(edje_test_swallows_container_api) +{ + Evas *evas = _setup_evas(); + Evas_Object *ly, *o1; + + 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_int_eq(efl_content_count(ly), 1); + + { + Eina_Array *arr = eina_array_new(1); + Eina_Iterator *iter = efl_content_iterate(ly); + Eo *content; + + EINA_ITERATOR_FOREACH(iter, content) + { + eina_array_push(arr, content); + } + + ck_assert_int_eq(eina_array_count(arr), 1); + ck_assert_ptr_eq(eina_array_data_get(arr, 0), o1); + eina_array_free(arr); + } + + evas_free(evas); +} +EFL_END_TEST void edje_test_swallow(TCase *tc) { @@ -130,4 +163,5 @@ void edje_test_swallow(TCase *tc) tcase_add_test(tc, edje_test_swallows_lifetime); tcase_add_test(tc, edje_test_swallows_invalidate); tcase_add_test(tc, edje_test_swallows_eoapi); + tcase_add_test(tc, edje_test_swallows_container_api); } diff --git a/src/tests/edje/edje_test_text.c b/src/tests/edje/edje_test_text.c index c4ac3c8758..86e1aaf06d 100644 --- a/src/tests/edje/edje_test_text.c +++ b/src/tests/edje/edje_test_text.c @@ -122,9 +122,10 @@ START_TEST(edje_test_text_ellipsis) evas = _setup_evas(); layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(160, 40))); - efl_file_set(layout, test_layout_get("test_text.edj"), "test"); - fail_if(efl_file_load_error_get(layout)); + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40))); + ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj"))); + efl_file_key_set(layout, "test"); + ck_assert(!efl_file_load(layout)); efl_text_ellipsis_set(efl_part(layout, "text"), 1.0); @@ -140,9 +141,10 @@ START_TEST(edje_test_text_wrap) evas = _setup_evas(); layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(160, 40))); - efl_file_set(layout, test_layout_get("test_text.edj"), "test"); - fail_if(efl_file_load_error_get(layout)); + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40))); + ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj"))); + efl_file_key_set(layout, "test"); + ck_assert(!efl_file_load(layout)); efl_text_wrap_set(efl_part(layout, "text"), EFL_TEXT_FORMAT_WRAP_WORD); @@ -158,9 +160,10 @@ START_TEST(edje_test_text_font) evas = _setup_evas(); layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(160, 40))); - efl_file_set(layout, test_layout_get("test_text.edj"), "test"); - fail_if(efl_file_load_error_get(layout)); + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40))); + ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj"))); + efl_file_key_set(layout, "test"); + ck_assert(!efl_file_load(layout)); efl_text_font_set(efl_part(layout, "text"), "Sans", 14); @@ -176,9 +179,10 @@ START_TEST(edje_test_text_color) evas = _setup_evas(); layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(160, 40))); - efl_file_set(layout, test_layout_get("test_text.edj"), "test"); - fail_if(efl_file_load_error_get(layout)); + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40))); + ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj"))); + efl_file_key_set(layout, "test"); + ck_assert(!efl_file_load(layout)); efl_text_normal_color_set(efl_part(layout, "text"), 255, 255, 255, 255); @@ -313,15 +317,17 @@ START_TEST(edje_test_text_part) evas = _setup_evas(); layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, - efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(160, 40))); + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40))); - efl_file_set(layout, test_layout_get("test_text.edj"), "test"); - fail_if(efl_file_load_error_get(layout)); + ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj"))); + efl_file_key_set(layout, "test"); + ck_assert(!efl_file_load(layout)); _basic_check(layout, EINA_TRUE); // Load again and check persistance - efl_file_set(layout, test_layout_get("test_text.edj"), "test2"); - fail_if(efl_file_load_error_get(layout)); + ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj"))); + efl_file_key_set(layout, "test2"); + ck_assert(!efl_file_load(layout)); _basic_check(layout, EINA_FALSE); evas_free(evas); diff --git a/src/tests/edje/tests/meson.build b/src/tests/edje/tests/meson.build index 6b1e43eb58..3d3f4313ad 100644 --- a/src/tests/edje/tests/meson.build +++ b/src/tests/edje/tests/meson.build @@ -6,7 +6,7 @@ foreach edc_file : edc_files themes += custom_target('edje_cc_' + edc_file, input : edc_file, output : '@BASENAME@.edj', - command : edje_cc_exe + [ '-beta', + command : edje_cc_exe + [ '-beta', '-fastcomp', '-id', join_paths(meson.source_root(), 'src', 'tests', 'emotion', 'data'), '-fd', meson.current_source_dir(), '-sd', meson.current_source_dir(), @@ -15,5 +15,5 @@ foreach edc_file : edc_files '-md', meson.current_source_dir(), '-td', meson.current_source_dir(), '@INPUT@', '@OUTPUT@'], - depends : edje_cc) + depends : edje_depends) endforeach diff --git a/src/tests/efl/efl_suite.c b/src/tests/efl/efl_suite.c index 97b17d7b2d..4385b82f72 100644 --- a/src/tests/efl/efl_suite.c +++ b/src/tests/efl/efl_suite.c @@ -26,9 +26,9 @@ #include "../efl_check.h" static const Efl_Test_Case etc[] = { - { "Efl_Model_Container", efl_test_case_model_container }, - { "Efl_Model_View", efl_test_case_model_view }, - { "Efl_Model_Composite_Boolean", efl_test_case_model_composite_boolean }, + { "Efl_Container_Model", efl_test_case_container_model }, + { "Efl_View_Model", efl_test_case_view_model }, + { "Efl_Boolean_Model", efl_test_case_boolean_model }, { NULL, NULL } }; diff --git a/src/tests/efl/efl_suite.h b/src/tests/efl/efl_suite.h index e353395ffb..4a670deab9 100644 --- a/src/tests/efl/efl_suite.h +++ b/src/tests/efl/efl_suite.h @@ -21,8 +21,8 @@ #include #include "../efl_check.h" -void efl_test_case_model_container(TCase *tc); -void efl_test_case_model_view(TCase *tc); -void efl_test_case_model_composite_boolean(TCase *tc); +void efl_test_case_container_model(TCase *tc); +void efl_test_case_view_model(TCase *tc); +void efl_test_case_boolean_model(TCase *tc); #endif /* EFL_SUITE_H_ */ diff --git a/src/tests/efl/efl_test_model_composite.c b/src/tests/efl/efl_test_composite_model.c similarity index 80% rename from src/tests/efl/efl_test_model_composite.c rename to src/tests/efl/efl_test_composite_model.c index 315c34ac5f..cfe56c135f 100644 --- a/src/tests/efl/efl_test_model_composite.c +++ b/src/tests/efl/efl_test_composite_model.c @@ -80,17 +80,22 @@ _selection_children_slice_get_then(void *data EINA_UNUSED, { Eina_Value *p_int = NULL; Eina_Value *p_bool = NULL; + Eina_Value *p_index = NULL; int v_int = 0; + unsigned int index = 0; Eina_Bool v_bool = EINA_FALSE; p_bool = efl_model_property_get(child, "selected"); p_int = efl_model_property_get(child, "test_p_int"); + p_index = efl_model_property_get(child, "child.index"); eina_value_get(p_bool, &v_bool); eina_value_get(p_int, &v_int); + fail_if(!eina_value_uint_convert(p_index, &index)); fail_if(v_bool != base_selections[i]); fail_if(v_int != base_ints[i]); + ck_assert_int_eq(i, index); } ecore_main_loop_quit(); @@ -98,17 +103,17 @@ _selection_children_slice_get_then(void *data EINA_UNUSED, return v; } -EFL_START_TEST(efl_test_model_composite_boolean) +EFL_START_TEST(efl_test_boolean_model) { - Efl_Model_Item *base_model, *child; + Efl_Generic_Model *base_model, *child; int i; Eina_Value v; - Efl_Model_Composite_Boolean *model; + Efl_Boolean_Model *model; Eina_Future *future; eina_value_setup(&v, EINA_VALUE_TYPE_INT); - base_model = efl_add_ref(EFL_MODEL_ITEM_CLASS, efl_main_loop_get()); + base_model = efl_add_ref(EFL_GENERIC_MODEL_CLASS, efl_main_loop_get()); ck_assert(!!base_model); for (i = 0; i < child_number; ++i) @@ -119,10 +124,10 @@ EFL_START_TEST(efl_test_model_composite_boolean) efl_model_property_set(child, "test_p_int", &v); } - model = efl_add_ref(EFL_MODEL_COMPOSITE_BOOLEAN_CLASS, efl_main_loop_get(), + model = efl_add_ref(EFL_BOOLEAN_MODEL_CLASS, efl_main_loop_get(), efl_ui_view_model_set(efl_added, base_model), - efl_model_composite_boolean_add(efl_added, "test_p_true", EINA_TRUE), - efl_model_composite_boolean_add(efl_added, "test_p_false", EINA_FALSE)); + efl_boolean_model_boolean_add(efl_added, "test_p_true", EINA_TRUE), + efl_boolean_model_boolean_add(efl_added, "test_p_false", EINA_FALSE)); ck_assert(!!model); future = efl_model_children_slice_get(model, 0, efl_model_children_count_get(model)); @@ -141,17 +146,17 @@ _wait_propagate(void *data EINA_UNUSED, return v; } -EFL_START_TEST(efl_test_model_composite_selection) +EFL_START_TEST(efl_test_select_model) { - Efl_Model_Item *base_model, *child; + Efl_Generic_Model *base_model, *child; int i; Eina_Value v; - Efl_Model_Composite_Selection *model; + Efl_Select_Model *model; Eina_Future *future; eina_value_setup(&v, EINA_VALUE_TYPE_INT); - base_model = efl_add_ref(EFL_MODEL_ITEM_CLASS, efl_main_loop_get()); + base_model = efl_add_ref(EFL_GENERIC_MODEL_CLASS, efl_main_loop_get()); ck_assert(!!base_model); for (i = 0; i < child_number; ++i) @@ -162,10 +167,10 @@ EFL_START_TEST(efl_test_model_composite_selection) efl_model_property_set(child, "test_p_int", &v); } - model = efl_add_ref(EFL_MODEL_COMPOSITE_SELECTION_CLASS, efl_main_loop_get(), + model = efl_add_ref(EFL_SELECT_MODEL_CLASS, efl_main_loop_get(), efl_ui_view_model_set(efl_added, base_model)); ck_assert(!!model); - future = efl_model_property_set(model, "selected", eina_value_int_new(2)); + future = efl_model_property_set(model, "child.selected", eina_value_int_new(2)); eina_future_then(future, _wait_propagate, NULL, NULL); ecore_main_loop_begin(); @@ -177,8 +182,8 @@ EFL_START_TEST(efl_test_model_composite_selection) EFL_END_TEST void -efl_test_case_model_composite_boolean(TCase *tc) +efl_test_case_boolean_model(TCase *tc) { - tcase_add_test(tc, efl_test_model_composite_boolean); - tcase_add_test(tc, efl_test_model_composite_selection); + tcase_add_test(tc, efl_test_boolean_model); + tcase_add_test(tc, efl_test_select_model); } diff --git a/src/tests/efl/efl_test_model_container.c b/src/tests/efl/efl_test_container_model.c similarity index 88% rename from src/tests/efl/efl_test_model_container.c rename to src/tests/efl/efl_test_container_model.c index dbe76d8e4f..e311ea20aa 100644 --- a/src/tests/efl/efl_test_model_container.c +++ b/src/tests/efl/efl_test_container_model.c @@ -72,9 +72,9 @@ _children_slice_future_then(void *data EINA_UNUSED, return v; } -EFL_START_TEST(efl_test_model_container_values) +EFL_START_TEST(efl_test_container_model_values) { - Efl_Model_Container* model; + Efl_Container_Model* model; Eina_Future *future; int **cmp_int; const char **cmp_str; @@ -89,12 +89,12 @@ EFL_START_TEST(efl_test_model_container_values) cmp_str[i] = strdup(base_str[i]); } - model = efl_add_ref(EFL_MODEL_CONTAINER_CLASS, NULL); + model = efl_add(EFL_CONTAINER_MODEL_CLASS, efl_main_loop_get()); - efl_model_container_child_property_add(model, "test_p_int", EINA_VALUE_TYPE_INT, + efl_container_model_child_property_add(model, "test_p_int", EINA_VALUE_TYPE_INT, eina_carray_iterator_new((void**)cmp_int)); - efl_model_container_child_property_add(model, "test_p_str", EINA_VALUE_TYPE_STRING, + efl_container_model_child_property_add(model, "test_p_str", EINA_VALUE_TYPE_STRING, eina_carray_iterator_new((void**)cmp_str)); for (i = 0; i < 7; ++i) @@ -110,12 +110,14 @@ EFL_START_TEST(efl_test_model_container_values) eina_future_then(future, _children_slice_future_then, NULL, NULL); ecore_main_loop_begin(); + + efl_del(model); } EFL_END_TEST void -efl_test_case_model_container(TCase *tc) +efl_test_case_container_model(TCase *tc) { - tcase_add_test(tc, efl_test_model_container_values); + tcase_add_test(tc, efl_test_container_model_values); } diff --git a/src/tests/efl/efl_test_model_view.c b/src/tests/efl/efl_test_view_model.c similarity index 79% rename from src/tests/efl/efl_test_model_view.c rename to src/tests/efl/efl_test_view_model.c index fead57cae7..3153d62343 100644 --- a/src/tests/efl/efl_test_model_view.c +++ b/src/tests/efl/efl_test_view_model.c @@ -27,11 +27,11 @@ static const int child_number = 3; static const int base_ints[] = { 41, 42, 43 }; -static const char *_efl_test_model_view_label_format = "Index %i."; +static const char *_efl_test_view_model_label_format = "Index %i."; static const char *dependences[] = { "test_p_int" }; static Eina_Value * -_efl_test_model_view_label_get(void *data, const Efl_Model_View *mv, Eina_Stringshare *property) +_efl_test_view_model_label_get(void *data, const Efl_View_Model *mv, Eina_Stringshare *property) { Eina_Strbuf *buf; Eina_Value *r; @@ -54,19 +54,19 @@ _efl_test_model_view_label_get(void *data, const Efl_Model_View *mv, Eina_String } static Eina_Future * -_efl_test_model_view_label_set(void *data EINA_UNUSED, Efl_Model_View *mv, Eina_Stringshare *property EINA_UNUSED, Eina_Value *value EINA_UNUSED) +_efl_test_view_model_label_set(void *data EINA_UNUSED, Efl_View_Model *mv, Eina_Stringshare *property EINA_UNUSED, Eina_Value *value EINA_UNUSED) { return efl_loop_future_rejected(mv, EFL_MODEL_ERROR_READ_ONLY); } static void -_efl_test_model_view_label_clean(void *data) +_efl_test_view_model_label_clean(void *data) { - ck_assert_ptr_eq(data, _efl_test_model_view_label_format); + ck_assert_ptr_eq(data, _efl_test_view_model_label_format); } static Eina_Value * -_efl_test_model_view_color_get(void *data EINA_UNUSED, const Efl_Model_View *mv, Eina_Stringshare *property) +_efl_test_view_model_color_get(void *data EINA_UNUSED, const Efl_View_Model *mv, Eina_Stringshare *property) { Eina_Strbuf *buf; Eina_Value *r; @@ -88,13 +88,13 @@ _efl_test_model_view_color_get(void *data EINA_UNUSED, const Efl_Model_View *mv, } static Eina_Future * -_efl_test_model_view_color_set(void *data EINA_UNUSED, Efl_Model_View *mv, Eina_Stringshare *property EINA_UNUSED, Eina_Value *value EINA_UNUSED) +_efl_test_view_model_color_set(void *data EINA_UNUSED, Efl_View_Model *mv, Eina_Stringshare *property EINA_UNUSED, Eina_Value *value EINA_UNUSED) { return efl_loop_future_rejected(mv, EFL_MODEL_ERROR_READ_ONLY); } static void -_efl_test_model_view_color_clean(void *data EINA_UNUSED) +_efl_test_view_model_color_clean(void *data EINA_UNUSED) { } @@ -156,7 +156,7 @@ _properties_changed(void *data, const Efl_Event *event) } static Eina_Value -_efl_test_model_view_child_get(Eo *obj EINA_UNUSED, +_efl_test_view_model_child_get(Eo *obj EINA_UNUSED, void *data EINA_UNUSED, const Eina_Value v) { @@ -212,7 +212,7 @@ _efl_test_model_view_child_get(Eo *obj EINA_UNUSED, } static Eina_Value -_efl_test_model_view_child_fetch(Eo *mv, +_efl_test_view_model_child_fetch(Eo *mv, void *data EINA_UNUSED, const Eina_Value v EINA_UNUSED) { @@ -223,7 +223,7 @@ _efl_test_model_view_child_fetch(Eo *mv, } static Eina_Value -_efl_test_model_view_child_updated_get(Eo *obj EINA_UNUSED, +_efl_test_view_model_child_updated_get(Eo *obj EINA_UNUSED, void *data EINA_UNUSED, const Eina_Value v) { @@ -258,7 +258,7 @@ _efl_test_model_view_child_updated_get(Eo *obj EINA_UNUSED, } static Eina_Value -_efl_test_model_view_tests_end(Eo *obj, +_efl_test_view_model_tests_end(Eo *obj, void *data EINA_UNUSED, const Eina_Value v) { @@ -266,14 +266,14 @@ _efl_test_model_view_tests_end(Eo *obj, return v; } -EFL_START_TEST(efl_test_model_view) +EFL_START_TEST(efl_test_view_model) { - Efl_Model_Item *base_model, *child, *mv; + Efl_Generic_Model *base_model, *child, *mv; Eina_Future *f; int i; Eina_Value v; - base_model = efl_add_ref(EFL_MODEL_ITEM_CLASS, efl_main_loop_get()); + base_model = efl_add_ref(EFL_GENERIC_MODEL_CLASS, efl_main_loop_get()); ck_assert(!!base_model); for (i = 0; i < child_number; ++i) @@ -284,33 +284,33 @@ EFL_START_TEST(efl_test_model_view) efl_model_property_set(child, "test_p_int", &v); } - mv = efl_add_ref(EFL_MODEL_VIEW_CLASS, efl_main_loop_get(), + mv = efl_add_ref(EFL_VIEW_MODEL_CLASS, efl_main_loop_get(), efl_ui_view_model_set(efl_added, base_model)); ck_assert(!!mv); - efl_model_view_property_logic_add(mv, "label", - (void*) _efl_test_model_view_label_format, _efl_test_model_view_label_get, _efl_test_model_view_label_clean, - (void*) _efl_test_model_view_label_format, _efl_test_model_view_label_set, _efl_test_model_view_label_clean, + efl_view_model_property_logic_add(mv, "label", + (void*) _efl_test_view_model_label_format, _efl_test_view_model_label_get, _efl_test_view_model_label_clean, + (void*) _efl_test_view_model_label_format, _efl_test_view_model_label_set, _efl_test_view_model_label_clean, EINA_C_ARRAY_ITERATOR_NEW(dependences)); - efl_model_view_property_logic_add(mv, "color", - NULL, _efl_test_model_view_color_get, _efl_test_model_view_color_clean, - NULL, _efl_test_model_view_color_set, _efl_test_model_view_color_clean, + efl_view_model_property_logic_add(mv, "color", + NULL, _efl_test_view_model_color_get, _efl_test_view_model_color_clean, + NULL, _efl_test_view_model_color_set, _efl_test_view_model_color_clean, EINA_C_ARRAY_ITERATOR_NEW(dependences)); - efl_model_view_property_logic_add(mv, "deadend", + efl_view_model_property_logic_add(mv, "deadend", NULL, NULL, NULL, NULL, NULL, NULL, NULL); f = efl_model_children_slice_get(mv, 0, efl_model_children_count_get(mv)); f = efl_future_then(mv, f, .success_type = EINA_VALUE_TYPE_ARRAY, - .success = _efl_test_model_view_child_get); - f = efl_future_then(mv, f, .success = _efl_test_model_view_child_fetch); + .success = _efl_test_view_model_child_get); + f = efl_future_then(mv, f, .success = _efl_test_view_model_child_fetch); f = efl_future_then(mv, f, .success_type = EINA_VALUE_TYPE_ARRAY, - .success = _efl_test_model_view_child_updated_get); + .success = _efl_test_view_model_child_updated_get); f = efl_future_then(mv, f, .success_type = EINA_VALUE_TYPE_INT, - .success = _efl_test_model_view_tests_end); + .success = _efl_test_view_model_tests_end); // And run ! ecore_main_loop_begin(); @@ -321,7 +321,7 @@ EFL_START_TEST(efl_test_model_view) EFL_END_TEST void -efl_test_case_model_view(TCase *tc) +efl_test_case_view_model(TCase *tc) { - tcase_add_test(tc, efl_test_model_view); + tcase_add_test(tc, efl_test_view_model); } diff --git a/src/tests/efl/meson.build b/src/tests/efl/meson.build index d036b9af8d..6bd1353804 100644 --- a/src/tests/efl/meson.build +++ b/src/tests/efl/meson.build @@ -1,9 +1,9 @@ efl_suite_src = [ 'efl_suite.c', 'efl_suite.h', - 'efl_test_model_composite.c', - 'efl_test_model_container.c', - 'efl_test_model_view.c' + 'efl_test_composite_model.c', + 'efl_test_container_model.c', + 'efl_test_view_model.c' ] efl_suite_bin = executable('efl_suite', diff --git a/src/tests/efl_check.h b/src/tests/efl_check.h index 81fa1844e8..aa2627cbd8 100644 --- a/src/tests/efl_check.h +++ b/src/tests/efl_check.h @@ -13,28 +13,29 @@ #include #ifdef HAVE_FORK -#ifdef HAVE_SYS_TYPES_H -# include +# ifdef HAVE_SYS_TYPES_H +# include +# endif +# ifdef HAVE_SYS_WAIT_H +# include +# endif +# include #endif -#ifdef HAVE_SYS_WAIT_H -# include -#endif -#include + #include -#endif #ifndef EINA_UNUSED -#ifdef __GNUC__ +# ifdef __GNUC__ -# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) -# define EINA_UNUSED __attribute__ ((__unused__)) +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) +# define EINA_UNUSED __attribute__ ((__unused__)) +# else +# define EINA_UNUSED +# endif # else # define EINA_UNUSED # endif -#else -# define EINA_UNUSED -#endif #endif @@ -53,6 +54,20 @@ eina_log_abort_on_critical_set(___val); \ } while (0) +#define EXPECT_ERROR_START \ + do { \ + DISABLE_ABORT_ON_CRITICAL_START; \ + Eina_Bool expect_error_start = EINA_FALSE; \ + do { \ + eina_log_print_cb_set(_efl_test_expect_error, &expect_error_start); \ + } while(0) + + +#define EXPECT_ERROR_END \ + ck_assert_int_eq(expect_error_start, EINA_TRUE); \ + DISABLE_ABORT_ON_CRITICAL_END; \ + } while(0) + typedef struct _Efl_Test_Case Efl_Test_Case; struct _Efl_Test_Case { @@ -60,7 +75,18 @@ struct _Efl_Test_Case void (*build)(TCase *tc); }; +#ifdef HAVE_FORK static int timeout_pid = 0; +#endif + +EINA_UNUSED static void +_efl_test_expect_error(const Eina_Log_Domain *d EINA_UNUSED, Eina_Log_Level level, const char *file EINA_UNUSED, const char *fnc, int line EINA_UNUSED, const char *fmt EINA_UNUSED, void *data, va_list args EINA_UNUSED) +{ + Eina_Bool *error = (Eina_Bool*) data; + if (level == EINA_LOG_LEVEL_ERR) *error = EINA_TRUE; + + printf("EXPECTED ERROR %s\n", fnc); +} static void _efl_tests_list(const Efl_Test_Case *etc) @@ -129,6 +155,7 @@ _efl_test_use(int argc, const char **argv, const char *test_case) return 0; } +#ifdef HAVE_FORK static int _efl_test_fork_has(SRunner *sr) { @@ -150,6 +177,7 @@ _efl_test_fork_has(SRunner *sr) /* should never get there */ return 0; } +#endif #ifdef ENABLE_TIMING_INFO EINA_UNUSED static double _timing_start_time; @@ -284,27 +312,47 @@ _efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, co SRunner *sr; TCase *tc; int i, failed_count = 0; +#ifdef HAVE_FORK int do_fork; int num_forks = 0; int can_fork = 0; Eina_Bool timeout_reached = EINA_FALSE; -#ifdef ENABLE_TIMING_INFO - double tstart = 0.0, tcstart = 0.0; - int timing = _timing_enabled(); - - if (timing) - tcstart = tstart = _timing_time_get(); +# ifdef ENABLE_TIMING_INFO + double tcstart = 0.0; +# endif #endif +#ifdef ENABLE_TIMING_INFO + double tstart = 0.0; + int timing; +#endif + +#ifdef ENABLE_TIMING_INFO + timing = _timing_enabled(); + if (timing) + tstart = _timing_time_get(); +#endif + +#ifdef HAVE_FORK +# ifdef ENABLE_TIMING_INFO + if (timing) + tcstart = tstart; +# endif +#endif + fflush(stdout); s = suite_create(suite_name); sr = srunner_create(s); +#ifdef HAVE_FORK do_fork = _efl_test_fork_has(sr); if (do_fork) can_fork = !!etc[1].test_case /* can't parallelize 1 test */; +#endif for (i = 0; etc[i].test_case; ++i) { +#ifdef HAVE_FORK int pid = 0; +#endif if (!_efl_test_use(argc, argv, etc[i].test_case)) continue; @@ -326,10 +374,10 @@ _efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, co if (!fork_map) fork_map = eina_hash_int32_new(NULL); eina_hash_add(fork_map, &pid, etc[i].test_case); num_forks++; -#ifdef ENABLE_TIMING_INFO +# ifdef ENABLE_TIMING_INFO if (timing) tcstart = _timing_time_get(); -#endif +# endif continue; } } @@ -339,8 +387,10 @@ _efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, co if (init || shutdown) tcase_add_checked_fixture(tc, init, shutdown); +#ifdef HAVE_FORK if (do_fork) tcase_set_timeout(tc, 0); +#endif etc[i].build(tc); suite_add_tcase(s, tc); @@ -350,10 +400,10 @@ _efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, co failed_count = _efl_suite_run_end(sr, etc[i].test_case); if (failed_count > 255) failed_count = 255; -#ifdef ENABLE_TIMING_INFO +# ifdef ENABLE_TIMING_INFO if (timing) printf("TC TIME %s: %.5g\n", etc[i].test_case, _timing_time_get() - tcstart); -#endif +# endif exit(failed_count); } #endif diff --git a/src/tests/efl_mono/Eina.cs b/src/tests/efl_mono/Eina.cs index 1009252c73..1705c7ab83 100644 --- a/src/tests/efl_mono/Eina.cs +++ b/src/tests/efl_mono/Eina.cs @@ -454,12 +454,28 @@ class TestEinaSlice class TestEinaArray { + public static void SetUp() + { + Dummy.TestObject.CreateCmpArrayObjects(); + } + + public static void TearDown() + { + Dummy.TestObject.DestroyCmpArrayObjects(); + } + public static void eina_array_default() { var a = new Eina.Array(); Test.Assert(a.Handle != IntPtr.Zero); } + public static void create_array_from_null() + { + Test.AssertRaises(() => new Eina.Array(IntPtr.Zero, false)); + Test.AssertRaises(() => new Eina.Array(IntPtr.Zero, false, false)); + } + public static void push_int() { var a = new Eina.Array(); @@ -1263,255 +1279,20 @@ class TestEinaInarray arr.Dispose(); } - // // - // Code Generation - // - - // Integer // - - public static void test_eina_inarray_int_in() - { - var t = new Dummy.TestObject(); - var arr = new Eina.Inarray(); - arr.Append(base_seq_int); - Test.Assert(t.EinaInarrayIntIn(arr)); - Test.Assert(arr.Own); - Test.Assert(arr.ToArray().SequenceEqual(modified_seq_int)); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - } - - public static void test_eina_inarray_int_in_own() - { - var t = new Dummy.TestObject(); - var arr = new Eina.Inarray(); - arr.Append(base_seq_int); - Test.Assert(t.EinaInarrayIntInOwn(arr)); - Test.Assert(!arr.Own); - Test.Assert(arr.ToArray().SequenceEqual(modified_seq_int)); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInarrayIntInOwn()); - } - - public static void test_eina_inarray_int_out() - { - var t = new Dummy.TestObject(); - Eina.Inarray arr; - Test.Assert(t.EinaInarrayIntOut(out arr)); - Test.Assert(!arr.Own); - Test.Assert(arr.ToArray().SequenceEqual(base_seq_int)); - Test.Assert(arr.Append(append_seq_int)); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInarrayIntOut()); - } - - public static void test_eina_inarray_int_out_own() - { - var t = new Dummy.TestObject(); - Eina.Inarray arr; - Test.Assert(t.EinaInarrayIntOutOwn(out arr)); - Test.Assert(arr.Own); - Test.Assert(arr.ToArray().SequenceEqual(base_seq_int)); - Test.Assert(arr.Append(append_seq_int)); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - } - - public static void test_eina_inarray_int_return() - { - var t = new Dummy.TestObject(); - var arr = t.EinaInarrayIntReturn(); - Test.Assert(!arr.Own); - Test.Assert(arr.ToArray().SequenceEqual(base_seq_int)); - Test.Assert(arr.Append(append_seq_int)); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInarrayIntReturn()); - } - - public static void test_eina_inarray_int_return_own() - { - var t = new Dummy.TestObject(); - var arr = t.EinaInarrayIntReturnOwn(); - Test.Assert(arr.Own); - Test.Assert(arr.ToArray().SequenceEqual(base_seq_int)); - Test.Assert(arr.Append(append_seq_int)); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - } - - // String // - public static void test_eina_inarray_str_in() - { - var t = new Dummy.TestObject(); - var arr = new Eina.Inarray(); - arr.Append(base_seq_str); - Test.Assert(t.EinaInarrayStrIn(arr)); - Test.Assert(arr.Own); - Test.Assert(arr.ToArray().SequenceEqual(modified_seq_str)); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - } - - public static void test_eina_inarray_str_in_own() - { - var t = new Dummy.TestObject(); - var arr = new Eina.Inarray(); - arr.Append(base_seq_str); - Test.Assert(t.EinaInarrayStrInOwn(arr)); - Test.Assert(!arr.Own); - Test.Assert(arr.ToArray().SequenceEqual(modified_seq_str)); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInarrayStrInOwn()); - } - - public static void test_eina_inarray_str_out() - { - var t = new Dummy.TestObject(); - Eina.Inarray arr; - Test.Assert(t.EinaInarrayStrOut(out arr)); - Test.Assert(!arr.Own); - Test.Assert(arr.ToArray().SequenceEqual(base_seq_str)); - Test.Assert(arr.Append(append_seq_str)); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInarrayStrOut()); - } - - public static void test_eina_inarray_str_out_own() - { - var t = new Dummy.TestObject(); - Eina.Inarray arr; - Test.Assert(t.EinaInarrayStrOutOwn(out arr)); - Test.Assert(arr.Own); - Test.Assert(arr.ToArray().SequenceEqual(base_seq_str)); - Test.Assert(arr.Append(append_seq_str)); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - } - - public static void test_eina_inarray_str_return() - { - var t = new Dummy.TestObject(); - var arr = t.EinaInarrayStrReturn(); - Test.Assert(!arr.Own); - Test.Assert(arr.ToArray().SequenceEqual(base_seq_str)); - Test.Assert(arr.Append(append_seq_str)); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInarrayStrReturn()); - } - - public static void test_eina_inarray_str_return_own() - { - var t = new Dummy.TestObject(); - var arr = t.EinaInarrayStrReturnOwn(); - Test.Assert(arr.Own); - Test.Assert(arr.ToArray().SequenceEqual(base_seq_str)); - Test.Assert(arr.Append(append_seq_str)); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - } - - // Object // - - public static void test_eina_inarray_obj_in() - { - var t = new Dummy.TestObject(); - var arr = new Eina.Inarray(); - arr.Append(BaseSeqObj()); - Test.Assert(t.EinaInarrayObjIn(arr)); - Test.Assert(arr.Own); - NumberwrapperSequenceAssertEqual(arr.ToArray(), ModifiedSeqObj()); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - } - - public static void test_eina_inarray_obj_in_own() - { - var t = new Dummy.TestObject(); - var arr = new Eina.Inarray(); - arr.Append(BaseSeqObj()); - Test.Assert(t.EinaInarrayObjInOwn(arr)); - Test.Assert(!arr.Own); - NumberwrapperSequenceAssertEqual(arr.ToArray(), ModifiedSeqObj()); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInarrayObjInOwn()); - } - - public static void test_eina_inarray_obj_out() - { - var t = new Dummy.TestObject(); - Eina.Inarray arr; - Test.Assert(t.EinaInarrayObjOut(out arr)); - Test.Assert(!arr.Own); - NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj()); - Test.Assert(arr.Append(AppendSeqObj())); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInarrayObjOut()); - } - - public static void test_eina_inarray_obj_out_own() - { - var t = new Dummy.TestObject(); - Eina.Inarray arr; - Test.Assert(t.EinaInarrayObjOutOwn(out arr)); - Test.Assert(arr.Own); - NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj()); - Test.Assert(arr.Append(AppendSeqObj())); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - } - - public static void test_eina_inarray_obj_return() - { - var t = new Dummy.TestObject(); - var arr = t.EinaInarrayObjReturn(); - Test.Assert(!arr.Own); - NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj()); - Test.Assert(arr.Append(AppendSeqObj())); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInarrayObjReturn()); - } - - public static void test_eina_inarray_obj_return_own() - { - var t = new Dummy.TestObject(); - var arr = t.EinaInarrayObjReturnOwn(); - Test.Assert(arr.Own); - NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj()); - Test.Assert(arr.Append(AppendSeqObj())); - arr.Dispose(); - Test.Assert(arr.Handle == IntPtr.Zero); - } - - public static void test_eina_inarray_obj_return_in_same_id() - { - var t = new Dummy.TestObject(); - var cmp = BaseSeqObj(); - var a = new Eina.Inarray(); - a.Append(cmp); - var b = t.EinaInarrayObjReturnIn(a); - NumberwrapperSequenceAssertEqual(a.ToArray(), b.ToArray()); - NumberwrapperSequenceAssertEqual(a.ToArray(), BaseSeqObj()); - int len = a.Length; - for (int i=0; i < len; ++i) - { - Test.Assert(a[i].NativeHandle == b[i].NativeHandle); - Test.Assert(a[i].NativeHandle == cmp[i].NativeHandle); - } - a.Dispose(); - } } class TestEinaList { + public static void SetUp() + { + Dummy.TestObject.CreateCmpArrayObjects(); + } + + public static void TearDown() + { + Dummy.TestObject.DestroyCmpArrayObjects(); + } + public static void data_set_int() { var lst = new Eina.List(); @@ -2323,241 +2104,6 @@ class TestEinaInlist } } - // // - // Code Generation - // - - // Integer // - - public static void test_eina_inlist_int_in() - { - var t = new Dummy.TestObject(); - var lst = new Eina.Inlist(); - lst.AppendArray(base_seq_int); - Test.Assert(t.EinaInlistIntIn(lst)); - Test.Assert(lst.Own); - Test.Assert(lst.ToArray().SequenceEqual(base_seq_int)); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - } - - public static void test_eina_inlist_int_in_own() - { - var t = new Dummy.TestObject(); - var lst = new Eina.Inlist(); - lst.AppendArray(base_seq_int); - Test.Assert(t.EinaInlistIntInOwn(lst)); - Test.Assert(!lst.Own); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInlistIntInOwn()); - } - - public static void test_eina_inlist_int_out() - { - var t = new Dummy.TestObject(); - Eina.Inlist lst; - Test.Assert(t.EinaInlistIntOut(out lst)); - Test.Assert(!lst.Own); - Test.Assert(lst.ToArray().SequenceEqual(base_seq_int)); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInlistIntOut()); - } - - public static void test_eina_inlist_int_out_own() - { - var t = new Dummy.TestObject(); - Eina.Inlist lst; - Test.Assert(t.EinaInlistIntOutOwn(out lst)); - Test.Assert(lst.Own); - Test.Assert(lst.ToArray().SequenceEqual(base_seq_int)); - lst.AppendArray(append_seq_int); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - } - - public static void test_eina_inlist_int_return() - { - var t = new Dummy.TestObject(); - var lst = t.EinaInlistIntReturn(); - Test.Assert(!lst.Own); - Test.Assert(lst.ToArray().SequenceEqual(base_seq_int)); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInlistIntReturn()); - } - - public static void test_eina_inlist_int_return_own() - { - var t = new Dummy.TestObject(); - var lst = t.EinaInlistIntReturnOwn(); - Test.Assert(lst.Own); - Test.Assert(lst.ToArray().SequenceEqual(base_seq_int)); - lst.AppendArray(append_seq_int); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - } - - // String // - public static void test_eina_inlist_str_in() - { - var t = new Dummy.TestObject(); - var lst = new Eina.Inlist(); - lst.AppendArray(base_seq_str); - Test.Assert(t.EinaInlistStrIn(lst)); - Test.Assert(lst.Own); - Test.Assert(lst.ToArray().SequenceEqual(base_seq_str)); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - } - - public static void test_eina_inlist_str_in_own() - { - var t = new Dummy.TestObject(); - var lst = new Eina.Inlist(); - lst.AppendArray(base_seq_str); - Test.Assert(t.EinaInlistStrInOwn(lst)); - Test.Assert(!lst.Own); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInlistStrInOwn()); - } - - public static void test_eina_inlist_str_out() - { - var t = new Dummy.TestObject(); - Eina.Inlist lst; - Test.Assert(t.EinaInlistStrOut(out lst)); - Test.Assert(!lst.Own); - Test.Assert(lst.ToArray().SequenceEqual(base_seq_str)); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInlistStrOut()); - } - - public static void test_eina_inlist_str_out_own() - { - var t = new Dummy.TestObject(); - Eina.Inlist lst; - Test.Assert(t.EinaInlistStrOutOwn(out lst)); - Test.Assert(lst.Own); - Test.Assert(lst.ToArray().SequenceEqual(base_seq_str)); - lst.AppendArray(append_seq_str); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - } - - public static void test_eina_inlist_str_return() - { - var t = new Dummy.TestObject(); - var lst = t.EinaInlistStrReturn(); - Test.Assert(!lst.Own); - Test.Assert(lst.ToArray().SequenceEqual(base_seq_str)); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInlistStrReturn()); - } - - public static void test_eina_inlist_str_return_own() - { - var t = new Dummy.TestObject(); - var lst = t.EinaInlistStrReturnOwn(); - Test.Assert(lst.Own); - Test.Assert(lst.ToArray().SequenceEqual(base_seq_str)); - lst.AppendArray(append_seq_str); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - } - - // Object // - - public static void test_eina_inlist_obj_in() - { - var t = new Dummy.TestObject(); - var lst = new Eina.Inlist(); - lst.AppendArray(BaseSeqObj()); - Test.Assert(t.EinaInlistObjIn(lst)); - Test.Assert(lst.Own); - NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj()); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - } - - public static void test_eina_inlist_obj_in_own() - { - var t = new Dummy.TestObject(); - var lst = new Eina.Inlist(); - lst.AppendArray(BaseSeqObj()); - Test.Assert(t.EinaInlistObjInOwn(lst)); - Test.Assert(!lst.Own); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInlistObjInOwn()); - } - - public static void test_eina_inlist_obj_out() - { - var t = new Dummy.TestObject(); - Eina.Inlist lst; - Test.Assert(t.EinaInlistObjOut(out lst)); - Test.Assert(!lst.Own); - NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj()); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInlistObjOut()); - } - - public static void test_eina_inlist_obj_out_own() - { - var t = new Dummy.TestObject(); - Eina.Inlist lst; - Test.Assert(t.EinaInlistObjOutOwn(out lst)); - Test.Assert(lst.Own); - NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj()); - lst.AppendArray(AppendSeqObj()); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - } - - public static void test_eina_inlist_obj_return() - { - var t = new Dummy.TestObject(); - var lst = t.EinaInlistObjReturn(); - Test.Assert(!lst.Own); - NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj()); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - Test.Assert(t.CheckEinaInlistObjReturn()); - } - - public static void test_eina_inlist_obj_return_own() - { - var t = new Dummy.TestObject(); - var lst = t.EinaInlistObjReturnOwn(); - Test.Assert(lst.Own); - NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj()); - lst.AppendArray(AppendSeqObj()); - lst.Dispose(); - Test.Assert(lst.Handle == IntPtr.Zero); - } - - public static void test_eina_inlist_obj_return_in_same_id() - { - var t = new Dummy.TestObject(); - var cmp = BaseSeqObj(); - var a = new Eina.Inlist(); - a.AppendArray(cmp); - var b = t.EinaInlistObjReturnIn(a); - NumberwrapperSequenceAssertEqual(a.ToArray(), b.ToArray()); - NumberwrapperSequenceAssertEqual(a.ToArray(), BaseSeqObj()); - int len = a.Length; - for (int i=0; i < len; ++i) - { - Test.Assert(a[i].NativeHandle == b[i].NativeHandle); - Test.Assert(a[i].NativeHandle == cmp[i].NativeHandle); - } - } } // < TestEinaInlist @@ -3021,6 +2567,16 @@ class TestEinaHash class TestEinaIterator { + public static void SetUp() + { + Dummy.TestObject.CreateCmpArrayObjects(); + } + + public static void TearDown() + { + Dummy.TestObject.DestroyCmpArrayObjects(); + } + // Array // public static void eina_array_int_empty_iterator() diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs index 5567f1ef33..e77fd7bbc7 100644 --- a/src/tests/efl_mono/Eo.cs +++ b/src/tests/efl_mono/Eo.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Collections.Generic; namespace TestSuite { @@ -10,6 +11,13 @@ class TestEo { } + public static void return_null_object() + { + var testing = new Dummy.TestObject(); + var o1 = testing.ReturnNullObject(); + Test.Assert(o1 == null); + } + // // Test cases: // @@ -41,6 +49,7 @@ class TestEo Test.Assert(delEventCalled, "DEL event not called"); } */ + /* Commented until we figure out a new way to test disposing public static void dispose_really_frees() { bool delEventCalled = false; @@ -54,6 +63,7 @@ class TestEo Test.Assert(delEventCalled, "DEL event not called"); } + */ /* Commented out as adding the event listener seems to prevent it from being GC'd. public static void derived_destructor_really_frees() @@ -88,16 +98,16 @@ class TestEo } -class MyLoop : Efl.Loop +class MyObject : Efl.Object { - public MyLoop() : base(null) { } + public MyObject() : base(null) { } } class TestEoInherit { public static void instantiate_inherited() { - Efl.Loop loop = new MyLoop(); + Efl.Object loop = new MyObject(); Test.Assert(loop.NativeHandle != System.IntPtr.Zero); } } @@ -114,43 +124,6 @@ class TestEoNames } } -class TestEoConstructingMethods -{ - public static void constructing_method() - { - bool called = false; - string name = "Test object"; - var obj = new Dummy.TestObject(null, (Dummy.TestObject a) => { - called = true; - Console.WriteLine("callback: obj NativeHandle: {0:x}", a.NativeHandle); - a.SetName(name); - }); - - Test.Assert(called); - Test.AssertEquals(name, obj.GetName()); - } - - private class Derived : Dummy.TestObject - { - public Derived(Dummy.TestObject parent = null, - Dummy.TestObject.ConstructingMethod cb = null) : base(parent, cb) { - } - } - - public static void constructing_method_inherit() - { - bool called = false; - string name = "Another test object"; - Derived obj = new Derived(null, (Dummy.TestObject a) => { - called = true; - a.SetComment(name); - }); - - Test.Assert(called); - Test.AssertEquals(name, obj.GetComment()); - } -} - class TestEoParent { public static void basic_parent() @@ -160,7 +133,7 @@ class TestEoParent Test.AssertEquals(parent, child.GetParent()); - var parent_retrieved = Dummy.TestObject.static_cast(child.GetParent()); + var parent_retrieved = child.GetParent() as Dummy.TestObject; Test.AssertEquals(parent, parent_retrieved); } @@ -171,7 +144,7 @@ class TestEoParent Test.AssertEquals(parent, child.GetParent()); - Dummy.Numberwrapper parent_retrieved = Dummy.Numberwrapper.static_cast(child.GetParent()); + Dummy.Numberwrapper parent_retrieved = child.GetParent() as Dummy.Numberwrapper; Test.AssertEquals(parent, parent_retrieved); } @@ -189,7 +162,7 @@ class TestEoParent Test.AssertEquals(parent, child.GetParent()); - var parent_from_cast = Dummy.TestObject.static_cast(child.GetParent()); + var parent_from_cast = child.GetParent() as Derived; Test.AssertEquals(parent, parent_from_cast); } } @@ -227,6 +200,24 @@ class TestTypedefs } } +class TestVariables +{ + public static void test_constant_variables() + { + Test.AssertEquals(Dummy.Constants.ConstvarBool, true); + Test.AssertEquals(Dummy.Constants.ConstvarInt, -32766); + Test.AssertEquals(Dummy.Constants.ConstvarUInt, 65533U); + Test.AssertEquals(Dummy.Constants.ConstvarLong, -2147483644L); + Test.AssertEquals(Dummy.Constants.ConstvarULong, 4294967288UL); + Test.AssertEquals(Dummy.Constants.ConstvarLLong, -9223372036854775800); + Test.AssertEquals(Dummy.Constants.ConstvarULLong, 18446744073709551615); + Test.AssertEquals(Dummy.Constants.ConstvarFloat, 16777211.0f); + Test.AssertEquals(Dummy.Constants.ConstvarDouble, 9007199254740988.0); + Test.AssertEquals(Dummy.Constants.ConstvarChar, '!'); + Test.AssertEquals(Dummy.Constants.ConstvarString, "test_str"); + } +} + class TestEoAccessors { public static void basic_eo_accessors() @@ -339,7 +330,7 @@ class TestCsharpProperties public static void test_iface_property() { int val = -33; - Dummy.TestIface iface = new Dummy.TestObject(); + Dummy.ITestIface iface = new Dummy.TestObject(); iface.IfaceProp = val; Test.AssertEquals(val, iface.IfaceProp); } @@ -365,6 +356,13 @@ class TestEoGrandChildrenFinalize public sealed class GrandChild : Dummy.Child { + +#if EFL_BETA + public GrandChild() : base(null, "", 0.0, 0) { } +#else + public GrandChild() : base(null, "", 0.0) { } +#endif + public int receivedValue = 0; public override Efl.Object FinalizeAdd() { @@ -380,4 +378,122 @@ class TestEoGrandChildrenFinalize } } +class TestConstructors +{ + public static void test_simple_constructor() + { + int iface_prop = 42; + string a = "LFE"; + double b = 3.14; +#if EFL_BETA + int beta = 1337; +#endif + +#if EFL_BETA + var obj = new Dummy.Child(null, a, b, beta, iface_prop, 0); +#else + var obj = new Dummy.Child(null, a, b, iface_prop); +#endif + Test.AssertEquals(iface_prop, obj.IfaceProp); + +#if EFL_BETA + obj = new Dummy.Child(parent: null, ifaceProp : iface_prop, doubleParamsA : a, doubleParamsB : b, + obligatoryBetaCtor : beta, + optionalBetaCtor : -beta); +#else + obj = new Dummy.Child(parent: null, ifaceProp : iface_prop, doubleParamsA : a, doubleParamsB : b); +#endif + Test.AssertEquals(iface_prop, obj.IfaceProp); + +#if EFL_BETA + Test.Assert(obj.ObligatoryBetaCtorWasCalled); + Test.Assert(obj.OptionalBetaCtorWasCalled); +#endif + } + + public static void test_optional_constructor() + { + string a = "LFE"; + double b = 3.14; +#if EFL_BETA + int beta = 2241; + var obj = new Dummy.Child(null, a, b, obligatoryBetaCtor : beta); + Test.Assert(!obj.OptionalBetaCtorWasCalled); +#else + var obj = new Dummy.Child(null, a, b); +#endif + Test.Assert(!obj.GetIfaceWasSet()); + } +} + +class TestInterfaceConcrete +{ + // For T7619 + public static void test_iface_concrete_methods() + { + var obj = new Dummy.TestObject(); + Dummy.ITestIface iface = obj.ReturnIface(); + + iface.IfaceProp = 1970; + Test.AssertEquals(iface.IfaceProp, 1970); + } +} + +class TestProvider +{ + public static void test_find_provider() + { + // Tests only the direction C# -> C + var obj = new Dummy.TestObject(); + Dummy.Numberwrapper provider = obj.FindProvider(typeof(Dummy.Numberwrapper)) as Dummy.Numberwrapper; + Test.AssertEquals(provider.GetType(), typeof(Dummy.Numberwrapper)); + Test.AssertEquals(provider.GetNumber(), 1999); + } + + private class ProviderHolder : Dummy.TestObject + { + private Dummy.TestObject provider; + public string ProviderName + { + get + { + return "MyProvider"; + } + } + + public ProviderHolder() : base(null) + { + this.provider = new Dummy.TestObject(this); + this.provider.Name = this.ProviderName; + this.provider.IfaceProp = 1997; + } + + public override Efl.Object FindProvider(System.Type type) + { + Console.WriteLine("Called FindProvider"); + if (type == typeof(Dummy.ITestIface)) + { + return this.provider; + } + else + { + return null; + } + } + } + + public static void test_find_provider_iface() + { + var obj = new ProviderHolder(); + + var provider = obj.CallFindProvider(typeof(Efl.Object)); + Test.AssertNull(provider, msg : "Unkonw provider must be null"); + + provider = obj.CallFindProviderForIface(); + Test.AssertNotNull(provider, msg : "Provider of ITestIFace must not be null"); + Test.AssertEquals(provider.Name, obj.ProviderName, "Provider name does not match expected"); + + } +} + } diff --git a/src/tests/efl_mono/Evas.cs b/src/tests/efl_mono/Evas.cs deleted file mode 100644 index 6d40412c3d..0000000000 --- a/src/tests/efl_mono/Evas.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Runtime.CompilerServices; - -public class MyBox : Evas.Box -{ - public MyBox(Efl.Object 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); - [DllImport("evas")] static extern void evas_object_box_layout_horizontal(IntPtr obj, IntPtr data, IntPtr privdata); - [DllImport("evas")] static extern IntPtr evas_object_evas_get(IntPtr obj); - [DllImport("evas")] static extern void evas_event_freeze(IntPtr obj); - [DllImport("evas")] static extern void evas_event_thaw(IntPtr obj); - - override public void CalculateGroup() - { - IntPtr evas = evas_object_evas_get(NativeHandle); - evas_event_freeze(evas); - Eina.Log.Debug("called group_calculate"); - // slayouting_set(true); - evas_obj_box_layout_vertical(NativeHandle, IntPtr.Zero, IntPtr.Zero); - // layouting_set(false); - // children_changed_set(false); - evas_event_thaw(evas); - } -} - -namespace TestSuite -{ - -class TestEvas -{ - /* private static string ImagePath([CallerFilePath] string folder="") */ - /* { */ - /* return System.IO.Path.GetDirectoryName(folder); */ - /* } */ - - /* public static void simple_layout() */ - /* { */ -/* // efl.Loop loop = new efl.LoopConcrete(); */ - - /* EcoreEvas ecore_evas = new EcoreEvas(); */ - - /* efl.canvas.Object canvas = ecore_evas.canvas; */ - /* canvas.visible_set(true); */ - - /* efl.Object parent = canvas.parent_get(); */ - /* Test.Assert(parent.NativeHandle != IntPtr.Zero); */ - - /* efl.canvas.Rectangle rect = new efl.canvas.RectangleConcrete(canvas); */ - /* rect.color_set(255, 255, 255, 255); */ - /* rect.size_set(640, 480); */ - /* rect.visible_set(true); */ - - /* evas.Box box = new MyBox(canvas); */ - /* rect.size_set(320, 240); */ - /* box.visible_set(true); */ - - /* efl.canvas.Image image1 = new efl.canvas.ImageConcrete(canvas); */ - /* image1.file_set(ImagePath() + "/../../examples/elementary/sphere_hunter/score.jpg", ""); */ - /* image1.hint_min_set(160, 240); */ - /* image1.visible_set(true); */ - - /* efl.canvas.Image image2 = new efl.canvas.ImageConcrete(canvas); */ - /* image2.file_set(ImagePath() + "/../../examples/evas/shooter/assets/images/bricks.jpg", ""); */ - /* image2.hint_min_set(160, 120); */ - /* image2.visible_set(true); */ - - /* box.append(image1); */ - /* box.append(image2); */ - -/* // loop.begin(); */ - /* } */ -} - -} diff --git a/src/tests/efl_mono/Events.cs b/src/tests/efl_mono/Events.cs index 84918b9ca8..32c87b2a75 100644 --- a/src/tests/efl_mono/Events.cs +++ b/src/tests/efl_mono/Events.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; namespace TestSuite { @@ -25,7 +26,7 @@ class TestEoEvents public static void idle_event() { - Efl.Loop loop = new Efl.Loop(); + Efl.Loop loop = Efl.App.AppMain; loop.SetName("loop"); TestEoEvents listener = new TestEoEvents(); listener.loop = loop; @@ -164,19 +165,26 @@ class TestEoEvents Test.AssertEquals(sent_struct.Fobj, received_struct.Fobj); } - public static void event_in_init_callback() + public static void event_with_array_payload() { - int received = 0; - int sent = 42; - var obj = new Dummy.TestObject(null, (Dummy.TestObject t) => { - t.EvtWithIntEvt += (object sender, Dummy.TestObjectEvtWithIntEvt_Args e) => { - received = e.arg; - }; - }); + var obj = new Dummy.TestObject(); + Eina.Array received = null; + Eina.Array sent = new Eina.Array(); - obj.EmitEventWithInt(sent); + sent.Append("Abc"); + sent.Append("Def"); + sent.Append("Ghi"); - Test.AssertEquals(sent, received); + obj.EvtWithArrayEvt += (object sender, Dummy.TestObjectEvtWithArrayEvt_Args e) => { + received = e.arg; + }; + + obj.EmitEventWithArray(sent); + + Test.AssertEquals(sent.Length, received.Length); + var pairs = sent.Zip(received, (string sentItem, string receivedItem) => new { Sent = sentItem, Received = receivedItem } ); + foreach (var pair in pairs) + Test.AssertEquals(pair.Sent, pair.Received); } } @@ -217,32 +225,26 @@ class TestInterfaceEvents obj.EmitNonconflicted(); Test.Assert(called); } +} - public static void test_conflicting_events() +class TestEventNaming +{ + // For events named line focus_geometry,changed + public static void test_event_naming() { var obj = new Dummy.TestObject(); var test_called = false; - var another_called = false; EventHandler cb = (object sender, EventArgs e) => { test_called = true; }; - EventHandler another_cb = (object sender, EventArgs e) => { - another_called = true; - }; + obj.EvtWithUnderEvt += cb; - ((Dummy.TestIface)obj).ConflictedEvt += cb; - ((Dummy.AnotherIface)obj).ConflictedEvt += another_cb; + obj.EmitEventWithUnder(); - obj.EmitTestConflicted(); Test.Assert(test_called); - Test.Assert(!another_called); - test_called = false; - obj.EmitAnotherConflicted(); - Test.Assert(!test_called); - Test.Assert(another_called); } } } diff --git a/src/tests/efl_mono/FunctionPointers.cs b/src/tests/efl_mono/FunctionPointers.cs index de363c86d6..4536704389 100644 --- a/src/tests/efl_mono/FunctionPointers.cs +++ b/src/tests/efl_mono/FunctionPointers.cs @@ -173,6 +173,7 @@ class TestFunctionPointers GC.Collect(); GC.WaitForPendingFinalizers(); + Efl.App.AppMain.Iterate(); Test.Assert(obj.set_called, "set_callback override must have been called"); Test.Assert(!obj.invoke_called, "invoke_callback must not have been called"); diff --git a/src/tests/efl_mono/Inheritance.cs b/src/tests/efl_mono/Inheritance.cs index 344c6da71f..befdd3a7b4 100644 --- a/src/tests/efl_mono/Inheritance.cs +++ b/src/tests/efl_mono/Inheritance.cs @@ -20,7 +20,7 @@ class TestInheritance } } - internal class Inherit2 : Dummy.TestObject, Dummy.InheritIface + internal class Inherit2 : Dummy.TestObject, Dummy.IInheritIface { override public void IntOut (int x, out int y) { diff --git a/src/tests/efl_mono/Main.cs b/src/tests/efl_mono/Main.cs index 3ae3584798..a5700ff180 100644 --- a/src/tests/efl_mono/Main.cs +++ b/src/tests/efl_mono/Main.cs @@ -92,6 +92,8 @@ class TestMain } Console.WriteLine("[ END SUITE ] " + ckRunSuite); + Efl.All.Shutdown(); + if (!pass) return -1; diff --git a/src/tests/efl_mono/Parts.cs b/src/tests/efl_mono/Parts.cs index 5afed1fdd6..50527c1c63 100644 --- a/src/tests/efl_mono/Parts.cs +++ b/src/tests/efl_mono/Parts.cs @@ -7,17 +7,18 @@ using System.Diagnostics.CodeAnalysis; namespace TestSuite { +#if EFL_BETA [SuppressMessage("Gendarme.Rules.Portability", "DoNotHardcodePathsRule")] public static class TestParts { public static void basic_part_test() { - var t = new Dummy.TestObject(); + var t = new Dummy.PartHolder(); do_part_test(t); } - private class Child : Dummy.TestObject + private class Child : Dummy.PartHolder { public Child() : base(null) {} } @@ -27,7 +28,7 @@ public static class TestParts do_part_test(t); } - private static void do_part_test(Dummy.TestObject t) + private static void do_part_test(Dummy.PartHolder t) { var p1 = t.PartOne; var p2 = t.PartTwo; @@ -38,4 +39,6 @@ public static class TestParts } } +#endif + } diff --git a/src/tests/efl_mono/StructHelpers.cs b/src/tests/efl_mono/StructHelpers.cs index 1b05a072fc..4debea53f1 100644 --- a/src/tests/efl_mono/StructHelpers.cs +++ b/src/tests/efl_mono/StructHelpers.cs @@ -129,22 +129,11 @@ internal class StructHelpers complex.Farray.Push(0x2A); complex.Farray.Push(0x42); - complex.Finarray = new Eina.Inarray(); - complex.Finarray.Push(0x0); - complex.Finarray.Push(0x2A); - complex.Finarray.Push(0x42); - - complex.Flist = new Eina.List(); complex.Flist.Append("0x0"); complex.Flist.Append("0x2A"); complex.Flist.Append("0x42"); - complex.Finlist = new Eina.Inlist(); - complex.Finlist.Append(0x0); - complex.Finlist.Append(0x2A); - complex.Finlist.Append(0x42); - complex.Fhash = new Eina.Hash(); complex.Fhash["aa"] = "aaa"; complex.Fhash["bb"] = "bbb"; @@ -175,12 +164,8 @@ internal class StructHelpers { Test.Assert(complex.Farray.ToArray().SequenceEqual(base_seq_int)); - Test.Assert(complex.Finarray.ToArray().SequenceEqual(base_seq_int)); - Test.Assert(complex.Flist.ToArray().SequenceEqual(base_seq_str)); - Test.Assert(complex.Finlist.ToArray().SequenceEqual(base_seq_int)); - Test.Assert(complex.Fhash["aa"] == "aaa"); Test.Assert(complex.Fhash["bb"] == "bbb"); Test.Assert(complex.Fhash["cc"] == "ccc"); @@ -214,9 +199,7 @@ internal class StructHelpers internal static void checkZeroedStructComplex(Dummy.StructComplex complex) { Test.Assert(complex.Farray == null); - Test.Assert(complex.Finarray == null); Test.Assert(complex.Flist == null); - Test.Assert(complex.Finlist == null); Test.Assert(complex.Fhash == null); Test.Assert(complex.Fiterator == null); Test.Assert(complex.Fany_value == null); diff --git a/src/tests/efl_mono/TestUtils.cs b/src/tests/efl_mono/TestUtils.cs index 615a8f3c6d..e7daf0559d 100644 --- a/src/tests/efl_mono/TestUtils.cs +++ b/src/tests/efl_mono/TestUtils.cs @@ -186,6 +186,16 @@ public static class Test if (reference != null) throw new AssertionException($"Assertion failed: {file}:{line} ({member}) {msg}"); } + + /// Asserts if the given reference is not null. + public static void AssertNotNull(object reference, String msg = "Reference is null", + [CallerLineNumber] int line = 0, + [CallerFilePath] string file = null, + [CallerMemberName] string member = null) + { + if (reference == null) + throw new AssertionException($"Assertion failed: {file}:{line} ({member}) {msg}"); + } } diff --git a/src/tests/efl_mono/Value.cs b/src/tests/efl_mono/Value.cs index 6f2c5799b5..2c5e3115f0 100644 --- a/src/tests/efl_mono/Value.cs +++ b/src/tests/efl_mono/Value.cs @@ -604,7 +604,74 @@ public static class TestEinaValue { } } - public static void TestValueArray() { + public static void TestValueArrayOfSByte() + { + using(Eina.Value array = new Eina.Value(Eina.ValueType.Array, Eina.ValueType.SByte)) { + Test.AssertEquals(0, array.Count()); + Test.Assert(array.Append(0)); + Test.AssertEquals(1, array.Count()); + Test.Assert(array.Append(1)); + Test.AssertEquals(2, array.Count()); + Test.Assert(array.Append(5)); + Test.AssertEquals(3, array.Count()); + Test.Assert(array.Append(42)); + Test.AssertEquals(4, array.Count()); + + + Test.AssertEquals((sbyte)array[0], 0); + Test.AssertEquals((sbyte)array[1], 1); + Test.AssertEquals((sbyte)array[2], 5); + Test.AssertEquals((sbyte)array[3], 42); + + array[0] = 120; + array[1] = -42; + Test.AssertEquals(4, array.Count()); + + Test.AssertEquals((sbyte)array[0], 120); + Test.AssertEquals((sbyte)array[1], -42); + Test.AssertEquals((sbyte)array[2], 5); + Test.AssertEquals((sbyte)array[3], 42); + + Test.AssertEquals("[120, -42, 5, 42]", array.ToString()); + } + } + + public static void TestValueArrayOfByte() + { + using(Eina.Value array = new Eina.Value(Eina.ValueType.Array, Eina.ValueType.Byte)) { + Test.AssertEquals(0, array.Count()); + Test.Assert(array.Append(0)); + Test.AssertEquals(1, array.Count()); + Test.Assert(array.Append(1)); + Test.AssertEquals(2, array.Count()); + Test.Assert(array.Append(5)); + Test.AssertEquals(3, array.Count()); + Test.Assert(array.Append(42)); + Test.AssertEquals(4, array.Count()); + + + Test.AssertEquals((byte)array[0], 0); + Test.AssertEquals((byte)array[1], 1); + Test.AssertEquals((byte)array[2], 5); + Test.AssertEquals((byte)array[3], 42); + + array[0] = 155; + array[1] = 42; + Test.AssertEquals(4, array.Count()); + + Test.AssertEquals((byte)array[0], 155); + Test.AssertEquals((byte)array[1], 42); + Test.AssertEquals((byte)array[2], 5); + Test.AssertEquals((byte)array[3], 42); + + Test.AssertEquals("[155, 42, 5, 42]", array.ToString()); + + Test.AssertRaises(() => array[0] = 123214); + } + } + + public static void TestValueArrayOfInts() + { using(Eina.Value array = new Eina.Value(Eina.ValueType.Array, Eina.ValueType.Int32)) { Test.AssertEquals(0, array.Count()); Test.Assert(array.Append(0)); @@ -633,12 +700,52 @@ public static class TestEinaValue { Test.AssertEquals("[1984, -42, 5, 42]", array.ToString()); } + } + + public static void TestValueArrayOfInt64s() + { + using(Eina.Value array = new Eina.Value(Eina.ValueType.Array, Eina.ValueType.Int64)) { + Test.AssertEquals(0, array.Count()); + Test.Assert(array.Append(0)); + Test.AssertEquals(1, array.Count()); + Test.Assert(array.Append(10000000000)); + Test.AssertEquals(2, array.Count()); + Test.Assert(array.Append(5)); + Test.AssertEquals(3, array.Count()); + Test.Assert(array.Append(42)); + Test.AssertEquals(4, array.Count()); + + + Test.AssertEquals((long)array[0], 0); + Test.AssertEquals((long)array[1], 10000000000); + Test.AssertEquals((long)array[2], 5); + Test.AssertEquals((long)array[3], 42); + + array[0] = 1984; + array[1] = -42; + Test.AssertEquals(4, array.Count()); + + Test.AssertEquals((long)array[0], 1984); + Test.AssertEquals((long)array[1], -42); + Test.AssertEquals((long)array[2], 5); + Test.AssertEquals((long)array[3], 42); + + Test.AssertEquals("[1984, -42, 5, 42]", array.ToString()); + } + } + + public static void TestValueArrayOfUInts() + { using(Eina.Value array = new Eina.Value(Eina.ValueType.Array, Eina.ValueType.UInt32)) { Test.Assert(array.Append(2)); Test.AssertEquals((uint)array[0], (uint)2); Test.AssertRaises(() => array[0] = -1); } + } + + public static void TestValueArrayOfStrings() + { using(Eina.Value array = new Eina.Value(Eina.ValueType.Array, Eina.ValueType.String)) { diff --git a/src/tests/efl_mono/dummy_another_iface.eo b/src/tests/efl_mono/dummy_another_iface.eo deleted file mode 100644 index 84c9187f05..0000000000 --- a/src/tests/efl_mono/dummy_another_iface.eo +++ /dev/null @@ -1,10 +0,0 @@ -interface Dummy.Another_Iface -{ - methods { - emit_another_conflicted { - } - } - events { - conflicted: void; - } -} diff --git a/src/tests/efl_mono/dummy_child.eo b/src/tests/efl_mono/dummy_child.eo index e3e1a7cd75..f6de361c45 100644 --- a/src/tests/efl_mono/dummy_child.eo +++ b/src/tests/efl_mono/dummy_child.eo @@ -2,8 +2,57 @@ import eina_types; class Dummy.Child extends Dummy.Test_Object { + methods { + double_params { + params { + @in a: string; + @in b: double; + } + } + + @property iface_was_set { + get {} + values { + data: bool; + } + } + + obligatory_beta_ctor @beta { + params { + @in a: int; + } + } + + optional_beta_ctor @beta { + params { + @in a: int; + } + } + + @property obligatory_beta_ctor_was_called { + get{} + values { + data: bool; + } + } + + @property optional_beta_ctor_was_called { + get{} + values { + data: bool; + } + } + } + constructors { + Dummy.Test_Iface.iface_prop @optional; + .double_params; + .obligatory_beta_ctor; + .optional_beta_ctor @optional; + } implements { + Dummy.Test_Iface.iface_prop { get; set; } class.constructor; class.destructor; + Efl.Object.constructor; } } diff --git a/src/tests/efl_mono/dummy_part_holder.eo b/src/tests/efl_mono/dummy_part_holder.eo new file mode 100644 index 0000000000..2dc5ad79f2 --- /dev/null +++ b/src/tests/efl_mono/dummy_part_holder.eo @@ -0,0 +1,13 @@ +import eina_types; + +class @beta Dummy.Part_Holder extends Dummy.Test_Object implements Efl.Part { + + parts { + part_one: Dummy.Test_Object; [[ Part number one. ]] + part_two: Dummy.Test_Object; [[ Part number two. ]] + } + implements { + Efl.Part.part_get; + Efl.Object.constructor; + } +} diff --git a/src/tests/efl_mono/dummy_test_iface.eo b/src/tests/efl_mono/dummy_test_iface.eo index d9d29ac749..3ab37f5407 100644 --- a/src/tests/efl_mono/dummy_test_iface.eo +++ b/src/tests/efl_mono/dummy_test_iface.eo @@ -1,8 +1,6 @@ interface Dummy.Test_Iface { methods { - emit_test_conflicted { - } emit_nonconflicted { } @property iface_prop { @@ -14,7 +12,6 @@ interface Dummy.Test_Iface } } events { - conflicted: void; nonconflicted: void; } } diff --git a/src/tests/efl_mono/dummy_test_object.eo b/src/tests/efl_mono/dummy_test_object.eo index e6c42f64c8..a50c70e2e6 100644 --- a/src/tests/efl_mono/dummy_test_object.eo +++ b/src/tests/efl_mono/dummy_test_object.eo @@ -2,6 +2,18 @@ import eina_types; type Dummy.MyInt: int; +const Dummy.Constvar_Bool : bool = true; +const Dummy.Constvar_Int : int = -32766; +const Dummy.Constvar_UInt : uint = 65533U; +const Dummy.Constvar_Long : long = -2147483644L; +const Dummy.Constvar_ULong : ulong = 4294967288UL; +const Dummy.Constvar_LLong : llong = -9223372036854775800LL; +const Dummy.Constvar_ULLong : ullong = 18446744073709551615ULL; +const Dummy.Constvar_Float : float = 16777211.0f; +const Dummy.Constvar_Double : double = 9007199254740988.0; +const Dummy.Constvar_Char : char = '!'; +const Dummy.Constvar_String : string = "test_str"; + enum Dummy.SampleEnum { v0, v1, @@ -10,7 +22,7 @@ enum Dummy.SampleEnum { v4, } -struct Dummy.StructSimple +struct @free(free) Dummy.StructSimple { fbyte: byte; fubyte: ubyte; @@ -62,11 +74,9 @@ struct Dummy.StructSimple fmyint: Dummy.MyInt; } -struct Dummy.StructComplex { +struct @free(free) Dummy.StructComplex { farray: array; - finarray: inarray; flist: list; - finlist: inlist; fhash: hash; fiterator: iterator; fany_value: any_value; @@ -91,17 +101,20 @@ function Dummy.FormatCb { } }; -class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface, Dummy.Another_Iface { - - parts { - part_one: Dummy.Test_Object; [[ Part number one. ]] - part_two: Dummy.Test_Object; [[ Part number two. ]] - } +class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { methods { return_object { return: Dummy.Test_Object; } + return_null_object { + return: Dummy.Test_Object; + } + + return_iface { + return: Dummy.Test_Iface; + } + int_out { params { @in x: int; @@ -151,7 +164,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface params { @in str: string; } - return: string @owned; + return: mstring @owned; } in_own_string { @@ -166,7 +179,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface } return_own_string { - return: string @owned; + return: mstring @owned; } out_string { @@ -177,7 +190,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface out_own_string { params { - @out str: string @owned; + @out str: mstring @owned; } } @@ -198,7 +211,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface } call_return_own_string { - return: string @owned; + return: mstring @owned; } call_out_string { @@ -206,7 +219,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface } call_out_own_string { - return: string @owned; + return: mstring @owned; } // Stringshare virtual helpers @@ -373,7 +386,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface eina_array_int_in_own { params { - @in arr: array @owned; + @in arr: array @owned; } return: bool; } @@ -393,7 +406,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface eina_array_int_out_own { params { - @out arr: array @owned; + @out arr: array @owned; } return: bool; } @@ -406,7 +419,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface } eina_array_int_return_own { - return: array @owned; + return: array @owned; } /* String */ @@ -419,7 +432,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface eina_array_str_in_own { params { - @in arr: array @owned; + @in arr: array @owned; } return: bool; } @@ -439,7 +452,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface eina_array_str_out_own { params { - @out arr: array @owned; + @out arr: array @owned; } return: bool; } @@ -452,7 +465,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface } eina_array_str_return_own { - return: array @owned; + return: array @owned; } /* Object */ @@ -508,153 +521,6 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface return: array; } - /* Eina Inarray */ - - /* Integer */ - eina_inarray_int_in { - params { - @in arr: inarray; - } - return: bool; - } - - eina_inarray_int_in_own { - params { - @in arr: inarray @owned; - } - return: bool; - } - check_eina_inarray_int_in_own { - return: bool; - } - - eina_inarray_int_out { - params { - @out arr: inarray; - } - return: bool; - } - check_eina_inarray_int_out { - return: bool; - } - - eina_inarray_int_out_own { - params { - @out arr: inarray @owned; - } - return: bool; - } - - eina_inarray_int_return { - return: inarray; - } - check_eina_inarray_int_return { - return: bool; - } - - eina_inarray_int_return_own { - return: inarray @owned; - } - - /* String */ - eina_inarray_str_in { - params { - @in arr: inarray; - } - return: bool; - } - - eina_inarray_str_in_own { - params { - @in arr: inarray @owned; - } - return: bool; - } - check_eina_inarray_str_in_own { - return: bool; - } - - eina_inarray_str_out { - params { - @out arr: inarray; - } - return: bool; - } - check_eina_inarray_str_out { - return: bool; - } - - eina_inarray_str_out_own { - params { - @out arr: inarray @owned; - } - return: bool; - } - - eina_inarray_str_return { - return: inarray; - } - check_eina_inarray_str_return { - return: bool; - } - - eina_inarray_str_return_own { - return: inarray @owned; - } - - /* Object */ - eina_inarray_obj_in { - params { - @in arr: inarray; - } - return: bool; - } - - eina_inarray_obj_in_own { - params { - @in arr: inarray @owned; - } - return: bool; - } - check_eina_inarray_obj_in_own { - return: bool; - } - - eina_inarray_obj_out { - params { - @out arr: inarray; - } - return: bool; - } - check_eina_inarray_obj_out { - return: bool; - } - - eina_inarray_obj_out_own { - params { - @out arr: inarray @owned; - } - return: bool; - } - - eina_inarray_obj_return { - return: inarray; - } - check_eina_inarray_obj_return { - return: bool; - } - - eina_inarray_obj_return_own { - return: inarray @owned; - } - - eina_inarray_obj_return_in { - params { - @in arr: inarray; - } - return: inarray; - } - /* Eina List */ /* Integer */ @@ -667,7 +533,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface eina_list_int_in_own { params { - @in lst: list @owned; + @in lst: list @owned; } return: bool; } @@ -687,7 +553,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface eina_list_int_out_own { params { - @out lst: list @owned; + @out lst: list @owned; } return: bool; } @@ -700,7 +566,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface } eina_list_int_return_own { - return: list @owned; + return: list @owned; } /* String */ @@ -713,7 +579,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface eina_list_str_in_own { params { - @in lst: list @owned; + @in lst: list @owned; } return: bool; } @@ -733,7 +599,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface eina_list_str_out_own { params { - @out lst: list @owned; + @out lst: list @owned; } return: bool; } @@ -746,7 +612,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface } eina_list_str_return_own { - return: list @owned; + return: list @owned; } /* Object */ @@ -802,154 +668,6 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface return: list; } - /* Eina Inlist */ - - /* Integer */ - eina_inlist_int_in { - params { - @in lst: inlist; - } - return: bool; - } - - eina_inlist_int_in_own { - params { - @in lst: inlist @owned; - } - return: bool; - } - check_eina_inlist_int_in_own { - return: bool; - } - - eina_inlist_int_out { - params { - @out lst: inlist; - } - return: bool; - } - check_eina_inlist_int_out { - return: bool; - } - - eina_inlist_int_out_own { - params { - @out lst: inlist @owned; - } - return: bool; - } - - eina_inlist_int_return { - return: inlist; - } - check_eina_inlist_int_return { - return: bool; - } - - eina_inlist_int_return_own { - return: inlist @owned; - } - - /* String */ - eina_inlist_str_in { - params { - @in lst: inlist; - } - return: bool; - } - - eina_inlist_str_in_own { - params { - @in lst: inlist @owned; - } - return: bool; - } - check_eina_inlist_str_in_own { - return: bool; - } - - eina_inlist_str_out { - params { - @out lst: inlist; - } - return: bool; - } - check_eina_inlist_str_out { - return: bool; - } - - eina_inlist_str_out_own { - params { - @out lst: inlist @owned; - } - return: bool; - } - - eina_inlist_str_return { - return: inlist; - } - check_eina_inlist_str_return { - return: bool; - } - - eina_inlist_str_return_own { - return: inlist @owned; - } - - /* Object */ - eina_inlist_obj_in { - params { - @in lst: inlist; - } - return: bool; - } - - eina_inlist_obj_in_own { - params { - @in lst: inlist @owned; - } - return: bool; - } - check_eina_inlist_obj_in_own { - return: bool; - } - - eina_inlist_obj_out { - params { - @out lst: inlist; - } - return: bool; - } - check_eina_inlist_obj_out { - return: bool; - } - - eina_inlist_obj_out_own { - params { - @out lst: inlist @owned; - } - return: bool; - } - - eina_inlist_obj_return { - return: inlist; - } - check_eina_inlist_obj_return { - return: bool; - } - - eina_inlist_obj_return_own { - return: inlist @owned; - } - - eina_inlist_obj_return_in { - params { - @in lst: inlist; - } - return: inlist; - } - - // Eina Hash // // Integer // @@ -962,7 +680,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface eina_hash_int_in_own { params { - @in hsh: hash @owned; + @in hsh: hash @owned; } return: bool; } @@ -982,7 +700,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface eina_hash_int_out_own { params { - @out hsh: hash @owned; + @out hsh: hash @owned; } return: bool; } @@ -998,7 +716,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface } eina_hash_int_return_own { - return: hash @owned; + return: hash @owned; } check_eina_hash_int_return_own { return: bool; @@ -1014,7 +732,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface eina_hash_str_in_own { params { - @in hsh: hash @owned; + @in hsh: hash @owned; } return: bool; } @@ -1034,7 +752,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface eina_hash_str_out_own { params { - @out hsh: hash @owned; + @out hsh: hash @owned; } return: bool; } @@ -1050,7 +768,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface } eina_hash_str_return_own { - return: hash @owned; + return: hash @owned; } check_eina_hash_str_return_own { return: bool; @@ -1158,7 +876,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface eina_iterator_int_in_own { params { - @in itr: iterator @owned; + @in itr: iterator @owned; } return: bool; } @@ -1178,7 +896,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface eina_iterator_int_out_own { params { - @out itr: iterator @owned; + @out itr: iterator @owned; } return: bool; } @@ -1191,7 +909,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface } eina_iterator_int_return_own { - return: iterator @owned; + return: iterator @owned; } /* String */ @@ -1204,7 +922,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface eina_iterator_str_in_own { params { - @in itr: iterator @owned; + @in itr: iterator @owned; } return: bool; } @@ -1224,7 +942,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface eina_iterator_str_out_own { params { - @out itr: iterator @owned; + @out itr: iterator @owned; } return: bool; } @@ -1237,7 +955,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface } eina_iterator_str_return_own { - return: iterator @owned; + return: iterator @owned; } /* Object */ @@ -1590,6 +1308,15 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface } } + emit_event_with_array { + params { + @in data: array; + } + } + + emit_event_with_under { + } + append_to_strbuf { params { @in buf: strbuf; @@ -1629,6 +1356,12 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface } } + create_cmp_array_objects @class { + } + + destroy_cmp_array_objects @class { + } + /* Futures */ get_future { @@ -1665,19 +1398,26 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface get_setter_only { return: int; } + + call_find_provider { + params { + @in type: const(Efl.Class); + } + return: Efl.Object; + } + + call_find_provider_for_iface { + return: Efl.Object; + } } implements { - class.constructor; - class.destructor; Efl.Object.constructor; - Efl.Part.part_get; - Dummy.Test_Iface.emit_test_conflicted; + Efl.Object.provider_find; Dummy.Test_Iface.emit_nonconflicted; Dummy.Test_Iface.iface_prop { get; set; } - Dummy.Another_Iface.emit_another_conflicted; } events { - evt,with,string @hot: string; + evt,with,string @hot: const(string); evt,with,bool: bool; evt,with,int @hot: int; evt,with,uint @hot: uint; @@ -1685,5 +1425,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface evt,with,error @hot: Eina.Error; evt,with,struct @hot: Dummy.StructSimple; evt,with,struct,complex @hot: Dummy.StructComplex; + evt,with,array @hot: const(array); + evt_with,under @hot: void; } } diff --git a/src/tests/efl_mono/efl-mono-suite.runtimeconfig.json b/src/tests/efl_mono/efl-mono-suite.runtimeconfig.json new file mode 100644 index 0000000000..0773dae0a0 --- /dev/null +++ b/src/tests/efl_mono/efl-mono-suite.runtimeconfig.json @@ -0,0 +1,10 @@ +{ + "runtimeOptions": { + "tfm": "netcoreapp2.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "2.0.0" + } + } +} + diff --git a/src/tests/efl_mono/libefl_mono_native_test.c b/src/tests/efl_mono/libefl_mono_native_test.c index 4c46e1e8dc..17ef5065b2 100644 --- a/src/tests/efl_mono/libefl_mono_native_test.c +++ b/src/tests/efl_mono/libefl_mono_native_test.c @@ -45,13 +45,13 @@ # endif #endif +#include "dummy_test_iface.eo.h" +#include "dummy_inherit_iface.eo.h" #include "dummy_numberwrapper.eo.h" #include "dummy_test_object.eo.h" #include "dummy_child.eo.h" -#include "dummy_test_iface.eo.h" -#include "dummy_another_iface.eo.h" -#include "dummy_inherit_iface.eo.h" #include "dummy_inherit_helper.eo.h" +#include "dummy_part_holder.eo.h" #include @@ -67,12 +67,12 @@ typedef struct Dummy_Test_Object_Data Eina_Value *stored_value; Dummy_StructSimple stored_struct; int stored_int; - Eo *part_one; - Eo *part_two; Eina_Promise *promise; Eina_List *list_for_accessor; int setter_only; int iface_prop; + Eo *provider; + Eo *iface_provider; } Dummy_Test_Object_Data; typedef struct Dummy_Numberwrapper_Data @@ -82,8 +82,20 @@ typedef struct Dummy_Numberwrapper_Data typedef struct Dummy_Child_Data { + int iface_prop; + const char* a; + double b; + Eina_Bool iface_was_set; + Eina_Bool obligatory_beta_ctor_was_called; + Eina_Bool optional_beta_ctor_was_called; } Dummy_Child_Data; +typedef struct Dummy_Part_Holder_Data +{ + Eo *part_one; + Eo *part_two; +} Dummy_Part_Holder_Data; + typedef struct Dummy_Inherit_Helper_Data { } Dummy_Inherit_Helper_Data; @@ -138,13 +150,14 @@ static Efl_Object* _dummy_test_object_efl_object_constructor(Eo *obj, Dummy_Test_Object_Data *pd) { efl_constructor(efl_super(obj, DUMMY_TEST_OBJECT_CLASS)); + pd->provider = efl_add(DUMMY_NUMBERWRAPPER_CLASS, obj); - // To avoid an infinite loop calling the same constructor - if (!efl_parent_get(obj)) - { - pd->part_one = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_one")); - pd->part_two = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_two")); - } + if (efl_parent_get(obj) == NULL) { // Avoid recursion + pd->iface_provider = efl_add(DUMMY_TEST_OBJECT_CLASS, obj); + dummy_test_iface_prop_set(pd->iface_provider, 1997); + } else + pd->iface_provider = NULL; + dummy_numberwrapper_number_set(pd->provider, 1999); return obj; } @@ -154,6 +167,16 @@ Efl_Object *_dummy_test_object_return_object(Eo *obj, EINA_UNUSED Dummy_Test_Obj return obj; } +Efl_Object *_dummy_test_object_return_null_object(Eo *obj EINA_UNUSED, EINA_UNUSED Dummy_Test_Object_Data *pd) +{ + return NULL; +} + +Dummy_Test_Iface *_dummy_test_object_return_iface(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd) +{ + return obj; +} + void _dummy_test_object_int_out(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, int x, int *y) { *y = -x; @@ -165,7 +188,7 @@ void _dummy_test_object_int_ptr_out(EINA_UNUSED Eo *obj, Dummy_Test_Object_Data *y = &pd->stored_int; } -const char *_dummy_test_object_in_string(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, const char *str) +char *_dummy_test_object_in_string(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, const char *str) { const char *ret = malloc(sizeof(char)*(strlen(str) + 1)); return strcpy((char*)ret, str); @@ -196,7 +219,7 @@ const char *_dummy_test_object_return_string(EINA_UNUSED Eo *obj, EINA_UNUSED Du return "string"; } -const char *_dummy_test_object_return_own_string(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd) +char *_dummy_test_object_return_own_string(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd) { static const char* reference = "own_string"; const char *ret = malloc(sizeof(char)*(strlen(reference) + 1)); @@ -208,7 +231,7 @@ void _dummy_test_object_out_string(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_O *str = "out_string"; } -void _dummy_test_object_out_own_string(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, const char**str) +void _dummy_test_object_out_own_string(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, char**str) { static const char* reference = "out_own_string"; *str = malloc(sizeof(char)*(strlen(reference) + 1)); @@ -230,7 +253,7 @@ const char *_dummy_test_object_call_return_string(Eo *obj, EINA_UNUSED Dummy_Tes return dummy_test_object_return_string(obj); } -const char *_dummy_test_object_call_return_own_string(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd) +char *_dummy_test_object_call_return_own_string(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd) { return dummy_test_object_return_own_string(obj); } @@ -242,9 +265,9 @@ const char *_dummy_test_object_call_out_string(Eo *obj, EINA_UNUSED Dummy_Test_O return ret; } -const char *_dummy_test_object_call_out_own_string(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd) +char *_dummy_test_object_call_out_own_string(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd) { - const char *ret = NULL; + char *ret = NULL; dummy_test_object_out_own_string(obj, &ret); return ret; } @@ -3328,19 +3351,10 @@ void struct_complex_with_values(Dummy_StructComplex *complex) eina_array_push(complex->farray, _new_int(0x2A)); eina_array_push(complex->farray, _new_int(0x42)); - complex->finarray = eina_inarray_new(sizeof(int), 0); - eina_inarray_push(complex->finarray, _int_ref(0x0)); - eina_inarray_push(complex->finarray, _int_ref(0x2A)); - eina_inarray_push(complex->finarray, _int_ref(0x42)); - complex->flist = eina_list_append(complex->flist, strdup("0x0")); complex->flist = eina_list_append(complex->flist, strdup("0x2A")); complex->flist = eina_list_append(complex->flist, strdup("0x42")); - complex->finlist = eina_inlist_append(complex->finlist, _new_inlist_int(0x0)); - complex->finlist = eina_inlist_append(complex->finlist, _new_inlist_int(0x2A)); - complex->finlist = eina_inlist_append(complex->finlist, _new_inlist_int(0x42)); - complex->fhash = eina_hash_string_superfast_new(NULL); eina_hash_add(complex->fhash, "aa", strdup("aaa")); eina_hash_add(complex->fhash, "bb", strdup("bbb")); @@ -3370,15 +3384,9 @@ Eina_Bool check_and_modify_struct_complex(Dummy_StructComplex *complex) if (!_array_int_equal(complex->farray, base_seq_int, base_seq_int_size)) return EINA_FALSE; - if (!_inarray_int_equal(complex->finarray, base_seq_int, base_seq_int_size)) - return EINA_FALSE; - if (!_list_str_equal(complex->flist, base_seq_str, base_seq_str_size)) return EINA_FALSE; - if (!_inlist_int_equal(complex->finlist, base_seq_int, base_seq_int_size)) - return EINA_FALSE; - if (!_hash_str_check(complex->fhash, "aa", "aaa") || !_hash_str_check(complex->fhash, "bb", "bbb") || !_hash_str_check(complex->fhash, "cc", "ccc")) @@ -3632,12 +3640,11 @@ Dummy_StructComplex* _dummy_test_object_struct_complex_ptr_return_own(EINA_UNUSE } // // -// Class constructor +// Class methods // // EOLIAN static void -_dummy_test_object_class_constructor(Efl_Class *klass) +_dummy_test_object_create_cmp_array_objects(void) { - (void)klass; modified_seq_obj[0] = base_seq_obj[0] = _new_obj(0x0); modified_seq_obj[1] = base_seq_obj[1] = _new_obj(0x2A); modified_seq_obj[2] = base_seq_obj[2] = _new_obj(0x42); @@ -3647,11 +3654,8 @@ _dummy_test_object_class_constructor(Efl_Class *klass) } EOLIAN static void -_dummy_test_object_class_destructor(Efl_Class *klass) +_dummy_test_object_destroy_cmp_array_objects(void) { - (void)klass; - for (unsigned i = 0; i < base_seq_obj_size; ++i) - efl_unref(base_seq_obj[i]); for (unsigned i = 0; i < modified_seq_obj_size; ++i) efl_unref(modified_seq_obj[i]); } @@ -3787,14 +3791,14 @@ void _dummy_test_object_emit_event_with_struct_complex(Eo *obj, EINA_UNUSED Dumm efl_event_callback_legacy_call(obj, DUMMY_TEST_OBJECT_EVENT_EVT_WITH_STRUCT_COMPLEX, &data); } -Efl_Object *_dummy_test_object_efl_part_part_get(EINA_UNUSED const Eo *obj, Dummy_Test_Object_Data *pd, const char *name) +void _dummy_test_object_emit_event_with_array(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, Eina_Array *data) { - if (!strcmp(name, "part_one")) - return pd->part_one; - else if (!strcmp(name, "part_two")) - return pd->part_two; - else - return NULL; + efl_event_callback_legacy_call(obj, DUMMY_TEST_OBJECT_EVENT_EVT_WITH_ARRAY, data); +} + +void _dummy_test_object_emit_event_with_under(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd) +{ + efl_event_callback_legacy_call(obj, DUMMY_TEST_OBJECT_EVENT_EVT_WITH_UNDER, NULL); } void _dummy_test_object_append_to_strbuf(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, Eina_Strbuf *buf, const char *str) @@ -3823,24 +3827,15 @@ Dummy_MyInt _dummy_test_object_bypass_typedef(EINA_UNUSED Eo *obj, EINA_UNUSED D /* Class Properties */ static int _dummy_test_object_klass_prop = 0; -int _dummy_test_object_klass_prop_get(const Eo *klass, EINA_UNUSED void *pd) +int _dummy_test_object_klass_prop_get(void) { - EINA_LOG_ERR("FAIL on GET"); - if (klass != dummy_test_object_class_get()) - { - eina_error_set(EINVAL); - return -1; - } + EINA_LOG_ERR("FAIL on GET"); return _dummy_test_object_klass_prop; } -void _dummy_test_object_klass_prop_set(Eo *klass, EINA_UNUSED void *pd, int value) +void _dummy_test_object_klass_prop_set(int value) { - EINA_LOG_ERR("FAIL on SET"); - if (klass != dummy_test_object_class_get()) - { - eina_error_set(EINVAL); - } + EINA_LOG_ERR("FAIL on SET"); _dummy_test_object_klass_prop = value; } @@ -3854,7 +3849,7 @@ Eina_Future* _dummy_test_object_get_future(EINA_UNUSED Eo *obj, Dummy_Test_Objec { if (pd->promise == NULL) { - Eo *loop = efl_app_main_get(EFL_APP_CLASS); + Eo *loop = efl_app_main_get(); Eina_Future_Scheduler *scheduler = efl_loop_future_scheduler_get(loop); pd->promise = eina_promise_new(scheduler, _promise_cancelled, pd); } @@ -3900,21 +3895,11 @@ Eina_Accessor *_dummy_test_object_clone_accessor(Eo *obj EINA_UNUSED, Dummy_Test return eina_list_accessor_new(pd->list_for_accessor); } -void _dummy_test_object_dummy_test_iface_emit_test_conflicted(Eo *obj, Dummy_Test_Object_Data *pd EINA_UNUSED) -{ - efl_event_callback_legacy_call(obj, DUMMY_TEST_IFACE_EVENT_CONFLICTED, NULL); -} - void _dummy_test_object_dummy_test_iface_emit_nonconflicted(Eo *obj, Dummy_Test_Object_Data *pd EINA_UNUSED) { efl_event_callback_legacy_call(obj, DUMMY_TEST_IFACE_EVENT_NONCONFLICTED, NULL); } -void _dummy_test_object_dummy_another_iface_emit_another_conflicted(Eo *obj, Dummy_Test_Object_Data *pd EINA_UNUSED) -{ - efl_event_callback_legacy_call(obj, DUMMY_ANOTHER_IFACE_EVENT_CONFLICTED, NULL); -} - void _dummy_test_object_setter_only_set(EINA_UNUSED Eo *obj, Dummy_Test_Object_Data *pd, int value) { pd->setter_only = value; @@ -3935,7 +3920,88 @@ int _dummy_test_object_dummy_test_iface_iface_prop_get(EINA_UNUSED const Eo *obj return pd->iface_prop; } +Eo * _dummy_test_object_efl_object_provider_find(EINA_UNUSED const Eo *obj, Dummy_Test_Object_Data *pd, const Efl_Class *klass) +{ + EINA_LOG_ERR("klass: %p, NUMBERWRAPPER: %p", klass, DUMMY_NUMBERWRAPPER_CLASS); + if (klass == DUMMY_NUMBERWRAPPER_CLASS) + return pd->provider; + else if (klass == DUMMY_TEST_IFACE_INTERFACE) + return pd->iface_provider; + return efl_provider_find(efl_super(obj, DUMMY_TEST_OBJECT_CLASS), klass); +} + +Efl_Object *_dummy_test_object_call_find_provider(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, const Efl_Class *type) +{ + printf("CALLING FIND PROVIDER FROM C"); + return efl_provider_find(obj, type); +} + +Efl_Object *_dummy_test_object_call_find_provider_for_iface(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd) +{ + printf("CALLING FIND PROVIDER FROM C"); + return efl_provider_find(obj, DUMMY_TEST_IFACE_INTERFACE); +} + /// Dummy.Child + +static Efl_Object * +_dummy_child_efl_object_constructor(Eo *obj, Dummy_Child_Data *pd) +{ + efl_constructor(efl_super(obj, DUMMY_CHILD_CLASS)); + + pd->iface_prop = 1984; + pd->iface_was_set = EINA_FALSE; + pd->obligatory_beta_ctor_was_called = EINA_FALSE; + pd->optional_beta_ctor_was_called = EINA_FALSE; + return obj; +} + +void _dummy_child_dummy_test_iface_iface_prop_set(EINA_UNUSED Eo *obj, Dummy_Child_Data *pd, int value) +{ + pd->iface_prop = value; + pd->iface_was_set = EINA_TRUE; +} + +int _dummy_child_dummy_test_iface_iface_prop_get(EINA_UNUSED const Eo *obj, Dummy_Child_Data *pd) +{ + return pd->iface_prop; +} + +void _dummy_child_double_params(EINA_UNUSED Eo* obj, Dummy_Child_Data *pd, const char* a, double b) +{ + if (pd->a) + free((void*)pd->a); + pd->a = malloc(sizeof(char)*(strlen(a) + 1)); + strcpy((char*)pd->a, a); + + pd->b = b; +} + +Eina_Bool _dummy_child_iface_was_set_get(EINA_UNUSED const Eo* obj, Dummy_Child_Data *pd) +{ + return pd->iface_was_set; +} + +void _dummy_child_obligatory_beta_ctor(EINA_UNUSED Eo* obj, Dummy_Child_Data *pd, EINA_UNUSED int a) +{ + pd->obligatory_beta_ctor_was_called = EINA_TRUE; +} + +void _dummy_child_optional_beta_ctor(EINA_UNUSED Eo* obj, Dummy_Child_Data *pd, EINA_UNUSED int a) +{ + pd->optional_beta_ctor_was_called = EINA_TRUE; +} + +Eina_Bool _dummy_child_obligatory_beta_ctor_was_called_get(EINA_UNUSED const Eo* obj, Dummy_Child_Data *pd) +{ + return pd->obligatory_beta_ctor_was_called; +} + +Eina_Bool _dummy_child_optional_beta_ctor_was_called_get(EINA_UNUSED const Eo* obj, Dummy_Child_Data *pd) +{ + return pd->optional_beta_ctor_was_called; +} + EOLIAN static void _dummy_child_class_constructor(Efl_Class *klass) { @@ -3949,23 +4015,51 @@ _dummy_child_class_destructor(Efl_Class *klass) } // Inherit -int _dummy_inherit_helper_receive_dummy_and_call_int_out(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Dummy_Test_Object *x) +int _dummy_inherit_helper_receive_dummy_and_call_int_out(Dummy_Test_Object *x) { int v = 8; dummy_test_object_int_out (x, 5, &v); return v; } -const char* _dummy_inherit_helper_receive_dummy_and_call_in_stringshare(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Dummy_Test_Object *x) +const char* _dummy_inherit_helper_receive_dummy_and_call_in_stringshare(Dummy_Test_Object *x) { return dummy_inherit_iface_stringshare_test (x, eina_stringshare_add("hello world")); } +// Part holder +static Efl_Object* +_dummy_part_holder_efl_object_constructor(Eo *obj, Dummy_Part_Holder_Data *pd) +{ + efl_constructor(efl_super(obj, DUMMY_PART_HOLDER_CLASS)); + + // To avoid an infinite loop calling the same constructor + if (!efl_parent_get(obj)) + { + pd->part_one = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_one")); + pd->part_two = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_two")); + } + + return obj; +} + +Efl_Object *_dummy_part_holder_efl_part_part_get(EINA_UNUSED const Eo *obj, Dummy_Part_Holder_Data *pd, const char *name) +{ + if (!strcmp(name, "part_one")) + return pd->part_one; + else if (!strcmp(name, "part_two")) + return pd->part_two; + else + return NULL; +} + + + #include "dummy_test_object.eo.c" #include "dummy_numberwrapper.eo.c" #include "dummy_child.eo.c" #include "dummy_test_iface.eo.c" -#include "dummy_another_iface.eo.c" #include "dummy_inherit_helper.eo.c" #include "dummy_inherit_iface.eo.c" +#include "dummy_part_holder.eo.c" diff --git a/src/tests/efl_mono/meson.build b/src/tests/efl_mono/meson.build index b01e2747af..f13b9a3b48 100644 --- a/src/tests/efl_mono/meson.build +++ b/src/tests/efl_mono/meson.build @@ -1,4 +1,4 @@ -eo_files = ['dummy_child.eo', 'dummy_numberwrapper.eo', 'dummy_test_object.eo', 'dummy_test_iface.eo', 'dummy_another_iface.eo', 'dummy_inherit_helper.eo', 'dummy_inherit_iface.eo'] +eo_files = ['dummy_child.eo', 'dummy_numberwrapper.eo', 'dummy_test_object.eo', 'dummy_test_iface.eo', 'dummy_inherit_helper.eo', 'dummy_inherit_iface.eo', 'dummy_part_holder.eo'] eo_file_targets = [] @@ -25,7 +25,7 @@ foreach mono_gen_file : eo_files eo_file_targets += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'', input : mono_gen_file, output : [mono_gen_file + '.cs'], - command : [eolian_mono_gen, '-I', meson.current_source_dir(), eolian_include_directories, + command : [eolian_mono_gen, beta_option, '-I', meson.current_source_dir(), eolian_include_directories, '--dllimport', 'efl_mono_native_test', '-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'), '@INPUT@']) @@ -34,6 +34,7 @@ endforeach efl_mono_test = library('efl_mono_test', eo_file_targets, link_with : [efl_mono], + cs_args : extra_cs_args ) efl_mono_src = [ @@ -47,7 +48,6 @@ efl_mono_src = [ 'Eo.cs', 'EoPromises.cs', 'Errors.cs', - 'Evas.cs', 'Events.cs', 'FunctionPointers.cs', 'FunctionPointerMarshalling.cs', @@ -64,11 +64,33 @@ efl_mono_src = [ efl_mono_suite = executable('efl-mono-suite', efl_mono_src, link_with : [efl_mono, efl_mono_test], + cs_args : extra_cs_args ) env = environment() env.set('MONO_PATH', efl_mono_test_suite_path ) +if (cs_is_dotnet) +env.set('LD_LIBRARY_PATH', efl_mono_test_suite_path ) +copy_prog = find_program(['cp', 'copy']) + +configure_file(input : 'efl-mono-suite.runtimeconfig.json', + output : 'efl-mono-suite.runtimeconfig.json', + copy : true) + +custom_target('copy_efl_mono_dll', + build_by_default : true, + input : efl_mono, + output : efl_mono.full_path().split('/')[-1], + command : [copy_prog, '@INPUT@', '@OUTPUT@']) + +custom_target('copy_efl_mono_lib_dll', + build_by_default : true, + input : efl_mono_lib, + output : efl_mono_lib.full_path().split('/')[-1], + command : [copy_prog, '@INPUT@', '@OUTPUT@']) +endif + config_libs = ['eina', 'ecore', 'eo', 'efl', 'evas', 'eldbus', 'elementary'] load_lib = '' diff --git a/src/tests/eina/eina_test_convert.c b/src/tests/eina/eina_test_convert.c index c8ccfcb772..0824d86656 100644 --- a/src/tests/eina/eina_test_convert.c +++ b/src/tests/eina/eina_test_convert.c @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -161,22 +162,105 @@ _eina_convert_fp_check(double d, Eina_F32p32 fp, int length) EFL_END_TEST static void -_eina_convert_strtod_c_check(const char *str, double expected_result) +_eina_convert_strtod_c_check(const char *str) { - double result = eina_convert_strtod_c(str, NULL); + double d1; + double d2; + char *e1; + char *e2; + + e1 = NULL; + d1 = eina_convert_strtod_c(str, &e1); + + e2 = NULL; + d2 = strtod(str, &e2); + + switch(fpclassify(d2)) + { + case FP_NAN: + fail_if(fpclassify(d1) != FP_NAN); + break; + case FP_INFINITE: + fail_if(fpclassify(d1) != FP_INFINITE); + break; + default: + fail_if((fpclassify(d1) != FP_ZERO) && + (fpclassify(d1) != FP_SUBNORMAL) && + (fpclassify(d1) != FP_NORMAL)); + if (!EINA_DBL_EQ(d1,d2) || (e1 != e2)) + { + fprintf(stderr, " FP_NORMAL\n"); + fprintf(stderr, " ERR: %s, %s\n", str, strerror(errno)); + fprintf(stderr, " E1 **%.6f**, **%g**, %s\n", d1, d1, e1 ? e1 : ""); + fprintf(stderr, " E2 **%.6f**, **%g**, %s\n", d2, d2, e2 ? e2 : ""); + if (!EINA_DBL_EQ(d1,d2)) printf("different value\n"); + if (e1 != e2) printf("different end position\n"); + } + + fail_if(!EINA_DBL_EQ(d1,d2) || (e1 != e2)); + break; + } - fail_if(result != expected_result); } EFL_START_TEST(eina_convert_strtod_c_simple) { - _eina_convert_strtod_c_check("0.0", 0.0); - _eina_convert_strtod_c_check("0.5", 0.5); - _eina_convert_strtod_c_check("1.0", 1.0); - _eina_convert_strtod_c_check("-0.5", -0.5); - _eina_convert_strtod_c_check("-1.0", -1.0); - _eina_convert_strtod_c_check("3.45e-2", 0.0345); - _eina_convert_strtod_c_check("3.45e+2", 345.0); + char *old; + + old = setlocale(LC_ALL, "C"); + _eina_convert_strtod_c_check("0"); + _eina_convert_strtod_c_check("-0"); + _eina_convert_strtod_c_check(".1"); + _eina_convert_strtod_c_check(" ."); + _eina_convert_strtod_c_check(" 1.2e3"); + _eina_convert_strtod_c_check(" +1.2e3"); + _eina_convert_strtod_c_check("1.2e3"); + _eina_convert_strtod_c_check("+1.2e3"); + _eina_convert_strtod_c_check("+1.e3"); + _eina_convert_strtod_c_check("-1.2e3"); + _eina_convert_strtod_c_check("-1.2e3.5"); + _eina_convert_strtod_c_check("-1.2e"); + _eina_convert_strtod_c_check("--1.2e3.5"); + _eina_convert_strtod_c_check("--1-.2e3.5"); + _eina_convert_strtod_c_check("-a"); + _eina_convert_strtod_c_check("a"); + _eina_convert_strtod_c_check(".1e"); + _eina_convert_strtod_c_check(".1e0"); + _eina_convert_strtod_c_check(".1e3"); + _eina_convert_strtod_c_check(".1e-3"); + _eina_convert_strtod_c_check(".1e-"); + _eina_convert_strtod_c_check(" .e-"); + _eina_convert_strtod_c_check(" .e"); + _eina_convert_strtod_c_check(" e"); + _eina_convert_strtod_c_check(" e0"); + _eina_convert_strtod_c_check(" ee"); + _eina_convert_strtod_c_check(" -e"); + _eina_convert_strtod_c_check(" .9"); + _eina_convert_strtod_c_check(" ..9"); + _eina_convert_strtod_c_check("009"); + _eina_convert_strtod_c_check("0.09e02"); + /* http://thread.gmane.org/gmane.editors.vim.devel/19268/ */ + _eina_convert_strtod_c_check("0.9999999999999999999999999999999999"); + _eina_convert_strtod_c_check("2.2250738585072010e-308"); // BUG + /* PHP (slashdot.jp): http://opensource.slashdot.jp/story/11/01/08/0527259/PHP%E3%81%AE%E6%B5%AE%E5%8B%95%E5%B0%8F%E6%95%B0%E7%82%B9%E5%87%A6%E7%90%86%E3%81%AB%E7%84%A1%E9%99%90%E3%83%AB%E3%83%BC%E3%83%97%E3%81%AE%E3%83%90%E3%82%B0 */ + _eina_convert_strtod_c_check("2.2250738585072011e-308"); + /* Gauche: http://blog.practical-scheme.net/gauche/20110203-bitten-by-floating-point-numbers-again */ + _eina_convert_strtod_c_check("2.2250738585072012e-308"); + _eina_convert_strtod_c_check("2.2250738585072013e-308"); + _eina_convert_strtod_c_check("2.2250738585072014e-308"); + _eina_convert_strtod_c_check(" NaNfoo"); + _eina_convert_strtod_c_check(" -INFfoo"); +// this test isn't viable because libc actually fails the conversion (testing +// glibc 2.28 on arch linux). either libc doesn't like the space at the start +// thus doesn't skip it but assumes END of numbver string thus not converting +// and returning NULL, or it doesn't like InFiNiTyfoo in some way, but either +// way this test shows eina to be more robust and do some kind of conversion +// and libc to fail and return NULL from strtod into the string pointer. it +// also doesnt return an infinite fp thus hitting the default: case and thus +// failing etc. ... so all in all remove the test as all it does it cause +// failures and if anything shows libc to be failing more than eina. +// _eina_convert_strtod_c_check(" InFiNiTyfoo"); + setlocale(LC_ALL, old); } EFL_END_TEST diff --git a/src/tests/eina/eina_test_value.c b/src/tests/eina/eina_test_value.c index caa47b7cee..a9e6e47de2 100644 --- a/src/tests/eina/eina_test_value.c +++ b/src/tests/eina/eina_test_value.c @@ -53,30 +53,55 @@ EFL_START_TEST(eina_value_test_simple) fail_unless(eina_value_set(value, 'x')); fail_unless(eina_value_get(value, &c)); fail_unless(c == 'x'); + fail_unless(eina_value_char_get(value, &c)); + fail_if(eina_value_double_get(value, &d)); + fail_unless(eina_value_int64_convert(value, &i64)); + fail_unless(i64 == 'x'); + fail_unless(c == 'x'); eina_value_flush(value); fail_unless(eina_value_setup(value, EINA_VALUE_TYPE_SHORT)); fail_unless(eina_value_set(value, 300)); fail_unless(eina_value_get(value, &s)); fail_unless(s == 300); + fail_unless(eina_value_short_get(value, &s)); + fail_if(eina_value_char_get(value, &c)); + fail_unless(eina_value_int_convert(value, &i)); + fail_unless(i == 300); + fail_unless(s == 300); eina_value_flush(value); fail_unless(eina_value_setup(value, EINA_VALUE_TYPE_INT)); fail_unless(eina_value_set(value, -12345)); fail_unless(eina_value_get(value, &i)); fail_unless(i == -12345); + fail_unless(eina_value_int_get(value, &i)); + fail_if(eina_value_short_get(value, &s)); + fail_unless(eina_value_long_convert(value, &l)); + fail_unless(l == -12345); + fail_unless(i == -12345); eina_value_flush(value); fail_unless(eina_value_setup(value, EINA_VALUE_TYPE_LONG)); fail_unless(eina_value_set(value, 0xb33f)); fail_unless(eina_value_get(value, &l)); fail_unless(l == 0xb33f); + fail_unless(eina_value_long_get(value, &l)); + fail_if(eina_value_int_get(value, &i)); + fail_unless(eina_value_int_convert(value, &i)); + fail_unless(i == 0xb33f); + fail_unless(l == 0xb33f); eina_value_flush(value); fail_unless(eina_value_setup(value, EINA_VALUE_TYPE_INT64)); fail_unless(eina_value_set(value, 0x0011223344556677)); fail_unless(eina_value_get(value, &i64)); fail_unless(i64 == 0x0011223344556677); + fail_unless(eina_value_int64_get(value, &i64)); + fail_if(eina_value_long_get(value, &l)); + fail_unless(eina_value_long_convert(value, &l)); + fail_unless(l == 0x0011223344556677); + fail_unless(i64 == 0x0011223344556677); eina_value_flush(value); /* unsigned: */ @@ -85,30 +110,55 @@ EFL_START_TEST(eina_value_test_simple) fail_unless(eina_value_set(value, 200)); fail_unless(eina_value_get(value, &uc)); fail_unless(uc == 200); + fail_unless(eina_value_uchar_get(value, &uc)); + fail_if(eina_value_int64_get(value, &i64)); + fail_unless(eina_value_uint64_convert(value, &u64)); + fail_unless(u64 == 200); + fail_unless(uc == 200); eina_value_flush(value); fail_unless(eina_value_setup(value, EINA_VALUE_TYPE_USHORT)); fail_unless(eina_value_set(value, 65535)); fail_unless(eina_value_get(value, &us)); fail_unless(us == 65535); + fail_unless(eina_value_ushort_get(value, &us)); + fail_if(eina_value_uchar_get(value, &uc)); + fail_unless(eina_value_uint_convert(value, &ui)); + fail_unless(ui == 65535); + fail_unless(us == 65535); eina_value_flush(value); fail_unless(eina_value_setup(value, EINA_VALUE_TYPE_UINT)); fail_unless(eina_value_set(value, 4000000000U)); fail_unless(eina_value_get(value, &ui)); fail_unless(ui == 4000000000U); + fail_unless(eina_value_uint_get(value, &ui)); + fail_if(eina_value_ushort_get(value, &us)); + fail_unless(eina_value_ulong_convert(value, &ul)); + fail_unless(ul == 4000000000U); + fail_unless(ui == 4000000000U); eina_value_flush(value); fail_unless(eina_value_setup(value, EINA_VALUE_TYPE_ULONG)); fail_unless(eina_value_set(value, 3000000001UL)); fail_unless(eina_value_get(value, &ul)); fail_unless(ul == 3000000001UL); + fail_unless(eina_value_ulong_get(value, &ul)); + fail_if(eina_value_uint_get(value, &ui)); + fail_unless(eina_value_uint64_convert(value, &u64)); + fail_unless(u64 == 3000000001UL); + fail_unless(ul == 3000000001UL); eina_value_flush(value); fail_unless(eina_value_setup(value, EINA_VALUE_TYPE_UINT64)); fail_unless(eina_value_set(value, 0x1122334455667788)); fail_unless(eina_value_get(value, &u64)); fail_unless(u64 == 0x1122334455667788); + fail_unless(eina_value_uint64_get(value, &u64)); + fail_if(eina_value_ulong_get(value, &ul)); + fail_unless(eina_value_ulong_convert(value, &ul)); + fail_unless(ul == 0x1122334455667788); + fail_unless(u64 == 0x1122334455667788); eina_value_flush(value); /* floating point */ @@ -116,12 +166,22 @@ EFL_START_TEST(eina_value_test_simple) fail_unless(eina_value_set(value, 0.1234)); fail_unless(eina_value_get(value, &f)); fail_unless(CHECK_FP(0.1234, f)); + fail_unless(eina_value_float_get(value, &f)); + fail_if(eina_value_uint64_get(value, &u64)); + fail_unless(eina_value_double_convert(value, &d)); + fail_unless(CHECK_FP(0.1234, d)); + fail_unless(CHECK_FP(0.1234, f)); eina_value_flush(value); fail_unless(eina_value_setup(value, EINA_VALUE_TYPE_DOUBLE)); fail_unless(eina_value_set(value, 34567.8)); fail_unless(eina_value_get(value, &d)); fail_unless(CHECK_FP(34567.8, d)); + fail_unless(eina_value_double_get(value, &d)); + fail_if(eina_value_float_get(value, &f)); + fail_unless(eina_value_float_convert(value, &f)); + fail_unless(CHECK_FP(34567.8, d)); + fail_unless(CHECK_FP(34567.8, f)); eina_value_flush(value); eina_value_free(value); diff --git a/src/tests/eina/eina_test_vpath.c b/src/tests/eina/eina_test_vpath.c index e5747b942f..851c47ee2b 100644 --- a/src/tests/eina/eina_test_vpath.c +++ b/src/tests/eina/eina_test_vpath.c @@ -50,24 +50,9 @@ EFL_START_TEST(eina_test_vpath_snprintf) } EFL_END_TEST -EFL_START_TEST(eina_test_vpath_user) -{ - char buf[PATH_MAX]; - char cmp[PATH_MAX]; - struct passwd *pwent; - - pwent = getpwuid(getuid()); - - eina_vpath_resolve_snprintf(buf, sizeof(buf), "~%s/foo/bar/king/kong/", pwent->pw_name); - snprintf(cmp, sizeof(cmp), "%s/foo/bar/king/kong/", pwent->pw_dir); - ck_assert_str_eq(buf, cmp); -} -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); tcase_add_test(tc, eina_test_vpath_snprintf); - tcase_add_test(tc, eina_test_vpath_user); } diff --git a/src/tests/eio/eio_model_test_file.c b/src/tests/eio/efl_io_model_test_file.c similarity index 87% rename from src/tests/eio/eio_model_test_file.c rename to src/tests/eio/efl_io_model_test_file.c index 53e941fe2c..e057f6bcc7 100644 --- a/src/tests/eio/eio_model_test_file.c +++ b/src/tests/eio/efl_io_model_test_file.c @@ -158,7 +158,7 @@ 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) +EFL_START_TEST(efl_io_model_test_test_file) { Eo *filemodel = NULL; Eina_Value *result; @@ -166,8 +166,8 @@ EFL_START_TEST(eio_model_test_test_file) memset(&reqs, 0, sizeof(struct reqs_t)); - filemodel = efl_add(EIO_MODEL_CLASS, efl_main_loop_get(), - eio_model_path_set(efl_added, EFL_MODEL_TEST_FILENAME_PATH)); + filemodel = efl_add(EFL_IO_MODEL_CLASS, efl_main_loop_get(), + efl_io_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); @@ -195,8 +195,25 @@ EFL_START_TEST(eio_model_test_test_file) } EFL_END_TEST -void -eio_model_test_file(TCase *tc) +EFL_START_TEST(efl_io_model_test_del) { - tcase_add_test(tc, eio_model_test_test_file); + Eo *model; + int i; + + DISABLE_ABORT_ON_CRITICAL_START; + for (i = 0; i < 10; i++) + { + model = efl_add(EFL_IO_MODEL_CLASS, efl_main_loop_get(), + efl_io_model_path_set(efl_added, EFL_MODEL_TEST_FILENAME_PATH)); + efl_del(model); + } + DISABLE_ABORT_ON_CRITICAL_END; +} +EFL_END_TEST + +void +efl_io_model_test_file(TCase *tc) +{ + tcase_add_test(tc, efl_io_model_test_test_file); + tcase_add_test(tc, efl_io_model_test_del); } diff --git a/src/tests/eio/eio_model_test_monitor_add.c b/src/tests/eio/efl_io_model_test_monitor_add.c similarity index 53% rename from src/tests/eio/eio_model_test_monitor_add.c rename to src/tests/eio/efl_io_model_test_monitor_add.c index fb1edbdd01..041a44a5a9 100644 --- a/src/tests/eio/eio_model_test_monitor_add.c +++ b/src/tests/eio/efl_io_model_test_monitor_add.c @@ -16,6 +16,52 @@ Eina_Tmpstr* temp_filename = NULL; const char* tmpdir = NULL; Eina_Bool children_deleted = EINA_FALSE; +// This will ensure that the child have the time to be automatically destroyed +static Eina_Value +_delayed_quit(Eo *o EINA_UNUSED, void *data EINA_UNUSED, const Eina_Value v) +{ + ecore_main_loop_quit(); + + return v; +} + +static Eina_Value +_children_got(Eo *o, void *data EINA_UNUSED, const Eina_Value v) +{ + Eo *child = NULL; + unsigned int i, len; + Eina_Value r = (Eina_Value) v; + + EINA_VALUE_ARRAY_FOREACH(&v, len, i, 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 (temp_filename && strcmp(str, temp_filename) == 0) + r = eina_future_as_value(efl_future_then(efl_loop_get(o), + efl_loop_job(efl_loop_get(o)), + .success = _delayed_quit)); + + + free(str); + eina_value_free(path); + } + + return r; +} + +static Eina_Value +_children_failed(Eo *o EINA_UNUSED, void *data EINA_UNUSED, const Eina_Error err) +{ + ck_abort_msg( "Failed to get the child with '%s'.\n", eina_error_msg_get(err)); + return eina_value_error_init(err); +} + static void _children_removed_cb(void *data EINA_UNUSED, const Efl_Event* event) { @@ -23,6 +69,20 @@ _children_removed_cb(void *data EINA_UNUSED, const Efl_Event* event) Eina_Value *path; char *str; + if (!evt->child) + { + Eina_Future *f; + + // Last time we can fetch the object + f = efl_future_then(event->object, + efl_model_children_slice_get(event->object, evt->index, 1), + .success = _children_got, + .error = _children_failed, + .success_type = EINA_VALUE_TYPE_ARRAY); + fail_if(f == NULL); + return; + } + fail_if(evt->child == NULL); path = efl_model_property_get(evt->child, "path"); fail_if(path == NULL); @@ -30,7 +90,9 @@ _children_removed_cb(void *data EINA_UNUSED, const Efl_Event* event) fail_if(str == NULL); if (temp_filename && strcmp(str, temp_filename) == 0) - ecore_main_loop_quit(); + efl_future_then(efl_loop_get(evt->child), + efl_loop_job(efl_loop_get(evt->child)), + .success = _delayed_quit); free(str); eina_value_free(path); @@ -47,6 +109,15 @@ _children_get(void *data, Eo *child = NULL; unsigned int i, len; + if (eina_value_type_get(&v) == EINA_VALUE_TYPE_ERROR) + { + Eina_Error err = 0; + + fail_if(!eina_value_error_get(&v, &err)); + fail_if(err != ECANCELED); + return v; + } + fail_if(eina_value_type_get(&v) != EINA_VALUE_TYPE_ARRAY); EINA_VALUE_ARRAY_FOREACH(&v, len, i, child) @@ -92,15 +163,15 @@ _children_added_cb(void *d EINA_UNUSED, const Efl_Event* event) eina_future_then(future, _children_get, event->object, NULL); } -EFL_START_TEST(eio_model_test_test_monitor_add) +EFL_START_TEST(efl_io_model_test_test_monitor_add) { Eo *filemodel = NULL; tmpdir = eina_environment_tmp_get(); - filemodel = efl_add(EIO_MODEL_CLASS, + filemodel = efl_add(EFL_IO_MODEL_CLASS, efl_main_loop_get(), - eio_model_path_set(efl_added, tmpdir)); + efl_io_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); @@ -115,7 +186,7 @@ EFL_START_TEST(eio_model_test_test_monitor_add) EFL_END_TEST void -eio_model_test_monitor_add(TCase *tc) +efl_io_model_test_monitor_add(TCase *tc) { - tcase_add_test(tc, eio_model_test_test_monitor_add); + tcase_add_test(tc, efl_io_model_test_test_monitor_add); } diff --git a/src/tests/eio/eio_suite.c b/src/tests/eio/eio_suite.c index 45ea556639..59579f06d8 100644 --- a/src/tests/eio/eio_suite.c +++ b/src/tests/eio/eio_suite.c @@ -24,8 +24,8 @@ 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}, - {"Eio Model Monitor", eio_model_test_monitor_add}, + {"Efl Io Model", efl_io_model_test_file}, + {"Efl Io Model Monitor", efl_io_model_test_monitor_add}, {"Eio File", eio_test_file}, {"Eio Job", eio_test_job}, #ifdef XATTR_TEST_DIR diff --git a/src/tests/eio/eio_suite.h b/src/tests/eio/eio_suite.h index 4f66cbc86b..46347823ba 100644 --- a/src/tests/eio/eio_suite.h +++ b/src/tests/eio/eio_suite.h @@ -5,8 +5,8 @@ #include "../efl_check.h" void eio_test_monitor(TCase *tc); void eio_test_sentry(TCase *tc); -void eio_model_test_file(TCase *tc); -void eio_model_test_monitor_add(TCase *tc); +void efl_io_model_test_file(TCase *tc); +void efl_io_model_test_monitor_add(TCase *tc); void eio_test_file(TCase *tc); void eio_test_job(TCase *tc); void eio_test_job_xattr(TCase *tc); diff --git a/src/tests/eio/eio_test_file.c b/src/tests/eio/eio_test_file.c index 5028215306..d7b84eaefb 100644 --- a/src/tests/eio/eio_test_file.c +++ b/src/tests/eio/eio_test_file.c @@ -41,11 +41,10 @@ _delete_filter_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, } static void -_main_cb(void *data, Eio_File *handler EINA_UNUSED, const char *file) +_main_cb(void *data, Eio_File *handler EINA_UNUSED, const char *file EINA_UNUSED) { int *number_of_listed_files = (int *)data; - fprintf(stderr, "Processing file:%s\n", file); (*number_of_listed_files)++; } @@ -63,11 +62,10 @@ _direct_filter_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, } static void -_direct_main_cb(void *data, Eio_File *handler EINA_UNUSED, const Eina_File_Direct_Info *info) +_direct_main_cb(void *data, Eio_File *handler EINA_UNUSED, const Eina_File_Direct_Info *info EINA_UNUSED) { int *number_of_listed_files = (int *)data; - fprintf(stderr, "Processing file:%s\n", info->path); (*number_of_listed_files)++; } diff --git a/src/tests/eio/meson.build b/src/tests/eio/meson.build index 09feb3769b..516ac2417d 100644 --- a/src/tests/eio/meson.build +++ b/src/tests/eio/meson.build @@ -1,7 +1,7 @@ eio_suite_src = [ 'eio_suite.c', - 'eio_model_test_file.c', - 'eio_model_test_monitor_add.c', + 'efl_io_model_test_file.c', + 'efl_io_model_test_monitor_add.c', 'eio_test_monitor.c', 'eio_test_sentry.c', 'eio_test_file.c', diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_method.c b/src/tests/eldbus/eldbus_test_eldbus_model_method.c index 1ac32f108e..24f9fbacca 100644 --- a/src/tests/eldbus/eldbus_test_eldbus_model_method.c +++ b/src/tests/eldbus/eldbus_test_eldbus_model_method.c @@ -3,6 +3,7 @@ #endif #include +#include /* basename() */ #include #include diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_signal.c b/src/tests/eldbus/eldbus_test_eldbus_model_signal.c index 7651e02687..d5dc19b62c 100644 --- a/src/tests/eldbus/eldbus_test_eldbus_model_signal.c +++ b/src/tests/eldbus/eldbus_test_eldbus_model_signal.c @@ -3,6 +3,7 @@ #endif #include +#include /* basename() */ #include #include 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 69cf8bafc9..3be2294529 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 @@ -3,6 +3,7 @@ #endif #include +#include /* basename() */ #include #include diff --git a/src/tests/elementary/efl_ui_build.c b/src/tests/elementary/efl_ui_build.c new file mode 100644 index 0000000000..923310fc66 --- /dev/null +++ b/src/tests/elementary/efl_ui_build.c @@ -0,0 +1,7 @@ +#ifndef EFL_BETA_API_SUPPORT +#define EFL_BETA_API_SUPPORT +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#define EFL_NOLEGACY_API_SUPPORT +#endif +#include diff --git a/src/tests/elementary/efl_ui_compile_test.c b/src/tests/elementary/efl_ui_compile_test.c new file mode 100644 index 0000000000..4234502659 --- /dev/null +++ b/src/tests/elementary/efl_ui_compile_test.c @@ -0,0 +1,12 @@ +#undef EFL_BETA_API_SUPPORT +#define EFL_NOLEGACY_API_SUPPORT + +#include + +EAPI_MAIN void +efl_main(void *data EINA_UNUSED, + const Efl_Event *ev EINA_UNUSED) +{ +} + +EFL_MAIN() diff --git a/src/tests/elementary/efl_ui_model.c b/src/tests/elementary/efl_ui_model.c new file mode 100644 index 0000000000..79056a726a --- /dev/null +++ b/src/tests/elementary/efl_ui_model.c @@ -0,0 +1,351 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include "efl_ui_suite.h" +#include "efl_ui_homogeneous_model.eo.h" +#include "efl_ui_exact_model.eo.h" +#include "efl_ui_average_model.eo.h" + +static const int child_number = 3; +static const int base_ints[] = { 41, 42, 43 }; +static int expected_average[] = { 0, 0, 0 }; + +static Efl_Model * +_generate_base_model(void) +{ + Efl_Generic_Model *base_model, *child; + Eina_Value v; + int i; + + eina_value_setup(&v, EINA_VALUE_TYPE_INT); + + base_model = efl_add_ref(EFL_GENERIC_MODEL_CLASS, efl_main_loop_get()); + ck_assert(!!base_model); + for (i = 0; i < child_number; ++i) + { + child = efl_model_child_add(base_model); + ck_assert(!!child); + ck_assert(eina_value_set(&v, base_ints[i])); + efl_model_property_set(child, "test_p_int", &v); + } + eina_value_flush(&v); + + return base_model; +} + +static Eina_Error +_property_error_expected(Efl_Model *model, const char *property) +{ + Eina_Value *v; + Eina_Error err = 0; + + v = efl_model_property_get(model, property); + ck_assert_ptr_eq(eina_value_type_get(v), EINA_VALUE_TYPE_ERROR); + ck_assert(eina_value_error_get(v, &err)); + eina_value_free(v); + + return err; +} + +static unsigned int +_property_uint_expected(Efl_Model *model, const char *property) +{ + Eina_Value *v; + unsigned int r = 0; + + v = efl_model_property_get(model, property); + ck_assert_ptr_eq(eina_value_type_get(v), EINA_VALUE_TYPE_UINT); + ck_assert(eina_value_uint_get(v, &r)); + eina_value_free(v); + + return r; +} + +static Eina_Value +_child_should_succeed(Efl_Model *model EINA_UNUSED, void *data EINA_UNUSED, const Eina_Value v) +{ + ck_assert_ptr_eq(eina_value_type_get(&v), EINA_VALUE_TYPE_ARRAY); + return v; +} + +static Eina_Value +_child_should_fail(Efl_Model *model EINA_UNUSED, void *data, const Eina_Value v) +{ + unsigned int i, len; + Eina_Value c = EINA_VALUE_EMPTY; + + EINA_VALUE_ARRAY_FOREACH(&v, len, i, c) + { + if (eina_value_type_get(&c) != EINA_VALUE_TYPE_ERROR) + { + fprintf(stderr, "Request on child %i should have failed but got '%s'\n", + (int)(uintptr_t) data, eina_value_to_string(&c)); + abort(); + } + } + return eina_value_int_init(0); +} + +static Eina_Value +_total_succeed(Efl_Model *model EINA_UNUSED, void *data EINA_UNUSED, const Eina_Value v) +{ + efl_loop_quit(efl_loop_get(model), eina_value_string_init("BOOM")); + return v; +} + +static Eina_Value +_total_failed(Efl_Model *model EINA_UNUSED, void *data EINA_UNUSED, Eina_Error err) +{ + fprintf(stderr, "Shouldn't have failed: '%s'\n", eina_error_msg_get(err)); + efl_loop_quit(efl_loop_get(model), eina_value_int_init(42)); + return eina_value_error_init(err); +} + +static Eina_Value +_children_homogeneous_slice_get_then(Efl_Model *model, void *data EINA_UNUSED, const Eina_Value v) +{ + unsigned int i, len; + Efl_Model *child = NULL; + Eina_Future *all[4] = { NULL, NULL, NULL, EINA_FUTURE_SENTINEL }; + Eina_Future *f; + + fail_if(eina_value_type_get(&v) != EINA_VALUE_TYPE_ARRAY); + + EINA_VALUE_ARRAY_FOREACH(&v, len, i, child) + { + ck_assert_int_eq(_property_error_expected(child, "self.width"), EAGAIN); + ck_assert_int_eq(_property_error_expected(child, "self.height"), EAGAIN); + } + + EINA_VALUE_ARRAY_FOREACH(&v, len, i, child) + { + Eina_Value *v; + unsigned int w, h; + + v = efl_model_property_get(child, "test_p_int"); + eina_value_uint_convert(v, &w); + eina_value_uint_convert(v, &h); + eina_value_free(v); + + w *= 2; + h *= 3; + + all[i] = eina_future_all(efl_model_property_set(child, "self.width", eina_value_uint_new(w)), + efl_model_property_set(child, "self.height", eina_value_uint_new(h))); + + if (i == 0) + all[i] = efl_future_then(model, all[i], .success = _child_should_succeed); + else + all[i] = efl_future_then(model, all[i], + .success = _child_should_fail, + .success_type = EINA_VALUE_TYPE_ARRAY, + .data = (void*)(uintptr_t) i); + } + + f = eina_future_all_array(all); + f = efl_future_then(model, f, .success = _total_succeed, .error = _total_failed); + return eina_future_as_value(f); +} + +EFL_START_TEST(efl_ui_homogeneous_model_test) +{ + Efl_Generic_Model *base_model, *model; + Eina_Value *ret__; + Eina_Future *future; + int real__; + + base_model = _generate_base_model(); + + model = efl_add_ref(EFL_UI_HOMOGENEOUS_MODEL_CLASS, efl_main_loop_get(), + efl_ui_view_model_set(efl_added, base_model)); + ck_assert(!!model); + + future = efl_model_children_slice_get(model, 0, efl_model_children_count_get(model)); + efl_future_then(model, future, .success = _children_homogeneous_slice_get_then); + + ck_assert_int_eq(_property_error_expected(model, "total.width"), EAGAIN); + ck_assert_int_eq(_property_error_expected(model, "total.height"), EAGAIN); + ck_assert_int_eq(_property_error_expected(model, "item.width"), EAGAIN); + ck_assert_int_eq(_property_error_expected(model, "item.height"), EAGAIN); + + ret__ = efl_loop_begin(efl_app_main_get()); + real__ = efl_loop_exit_code_process(ret__); + fail_if(real__ != 0); + + ck_assert_int_eq(_property_uint_expected(model, "total.width"), base_ints[0] * 2); + ck_assert_int_eq(_property_uint_expected(model, "total.height"), base_ints[0] * 3 * 3); + ck_assert_int_eq(_property_uint_expected(model, "item.width"), base_ints[0] * 2); + ck_assert_int_eq(_property_uint_expected(model, "item.height"), base_ints[0] * 3); +} +EFL_END_TEST + +static Eina_Value +_children_exact_slice_get_then(Efl_Model *model, void *data EINA_UNUSED, const Eina_Value v) +{ + unsigned int i, len; + Efl_Model *child = NULL; + Eina_Future *all[4] = { NULL, NULL, NULL, EINA_FUTURE_SENTINEL }; + Eina_Future *f; + + fail_if(eina_value_type_get(&v) != EINA_VALUE_TYPE_ARRAY); + + EINA_VALUE_ARRAY_FOREACH(&v, len, i, child) + { + ck_assert_int_eq(_property_uint_expected(child, "self.width"), 0); + ck_assert_int_eq(_property_uint_expected(child, "self.height"), 0); + } + + EINA_VALUE_ARRAY_FOREACH(&v, len, i, child) + { + Eina_Value *v; + unsigned int w, h; + + v = efl_model_property_get(child, "test_p_int"); + eina_value_uint_convert(v, &w); + eina_value_uint_convert(v, &h); + eina_value_free(v); + + w *= 2; + h *= 3; + + all[i] = eina_future_all(efl_model_property_set(child, "self.width", eina_value_uint_new(w)), + efl_model_property_set(child, "self.height", eina_value_uint_new(h))); + all[i] = efl_future_then(model, all[i], .success = _child_should_succeed); + } + + f = eina_future_all_array(all); + f = efl_future_then(model, f, .success = _total_succeed, .error = _total_failed); + return eina_future_as_value(f); +} + +EFL_START_TEST(efl_ui_exact_model_test) +{ + Efl_Generic_Model *base_model, *model; + Eina_Future *future; + Eina_Value *ret__; + int real__; + + base_model = _generate_base_model(); + + model = efl_add_ref(EFL_UI_EXACT_MODEL_CLASS, efl_main_loop_get(), + efl_ui_view_model_set(efl_added, base_model)); + ck_assert(!!model); + + future = efl_model_children_slice_get(model, 0, efl_model_children_count_get(model)); + efl_future_then(model, future, .success = _children_exact_slice_get_then); + + ck_assert_int_eq(_property_uint_expected(model, "total.width"), 0); + ck_assert_int_eq(_property_uint_expected(model, "total.height"), 0); + ck_assert_int_eq(_property_error_expected(model, "item.width"), EAGAIN); + ck_assert_int_eq(_property_error_expected(model, "item.height"), EAGAIN); + + ret__ = efl_loop_begin(efl_app_main_get()); + real__ = efl_loop_exit_code_process(ret__); + fail_if(real__ != 0); + + ck_assert_int_eq(_property_uint_expected(model, "total.width"), base_ints[2] * 2); + ck_assert_int_eq(_property_uint_expected(model, "total.height"), base_ints[0] * 3 + base_ints[1] * 3 + base_ints[2] * 3); +} +EFL_END_TEST + +static Eina_Value +_child_updated_average(Efl_Model *model, void *data, const Eina_Value v) +{ + Eina_Value *r; + int *ex = data; + int got = 0; + + r = efl_model_property_get(model, "total.height"); + ck_assert(eina_value_int_convert(r, &got)); + ck_assert_int_eq(got, *ex); + eina_value_free(r); + + return v; +} + +static Eina_Value +_children_average_slice_get_then(Efl_Model *model, void *data EINA_UNUSED, const Eina_Value v) +{ + unsigned int i, len; + Efl_Model *child = NULL; + Eina_Future *all[4] = { NULL, NULL, NULL, EINA_FUTURE_SENTINEL }; + Eina_Future *f; + + fail_if(eina_value_type_get(&v) != EINA_VALUE_TYPE_ARRAY); + + EINA_VALUE_ARRAY_FOREACH(&v, len, i, child) + { + ck_assert_int_eq(_property_uint_expected(child, "self.width"), 0); + ck_assert_int_eq(_property_uint_expected(child, "self.height"), 0); + } + + EINA_VALUE_ARRAY_FOREACH(&v, len, i, child) + { + Eina_Value *v; + unsigned int w, h; + + v = efl_model_property_get(child, "test_p_int"); + eina_value_uint_convert(v, &w); + eina_value_uint_convert(v, &h); + eina_value_free(v); + + w *= 2; + h *= 3; + + all[i] = eina_future_all(efl_model_property_set(child, "self.width", eina_value_uint_new(w)), + efl_model_property_set(child, "self.height", eina_value_uint_new(h))); + all[i] = efl_future_then(model, all[i], .success = _child_should_succeed); + + // The model average is not updated until the property have succeeded, so we have + // to wait before we can fetch the property. + all[i] = efl_future_then(model, all[i], .success = _child_updated_average, .data = &expected_average[i]); + } + + f = eina_future_all_array(all); + f = efl_future_then(model, f, .success = _total_succeed, .error = _total_failed); + return eina_future_as_value(f); +} + +EFL_START_TEST(efl_ui_average_model_test) +{ + Efl_Generic_Model *base_model, *model; + Eina_Future *future; + Eina_Value *ret__; + int real__; + + base_model = _generate_base_model(); + + model = efl_add_ref(EFL_UI_AVERAGE_MODEL_CLASS, efl_main_loop_get(), + efl_ui_view_model_set(efl_added, base_model)); + ck_assert(!!model); + + future = efl_model_children_slice_get(model, 0, efl_model_children_count_get(model)); + efl_future_then(model, future, .success = _children_average_slice_get_then); + + ck_assert_int_eq(_property_uint_expected(model, "total.width"), 0); + ck_assert_int_eq(_property_uint_expected(model, "total.height"), 0); + ck_assert_int_eq(_property_error_expected(model, "item.width"), EAGAIN); + ck_assert_int_eq(_property_error_expected(model, "item.height"), EAGAIN); + + ret__ = efl_loop_begin(efl_app_main_get()); + real__ = efl_loop_exit_code_process(ret__); + fail_if(real__ != 0); + + ck_assert_int_eq(_property_uint_expected(model, "total.width"), base_ints[2] * 2); + ck_assert_int_eq(_property_uint_expected(model, "total.height"), base_ints[0] * 3 + base_ints[1] * 3 + base_ints[2] * 3); +} +EFL_END_TEST + +void +efl_ui_model(TCase *tc) +{ + // This is done here as some system can not initialize computed value from another data at compile time. + expected_average[0] = base_ints[0] * 3 * 3; + expected_average[1] = ((base_ints[0] * 3 + base_ints[1] * 3) * 3) / 2; + expected_average[2] = base_ints[0] * 3 + base_ints[1] * 3 + base_ints[2] * 3; + + tcase_add_test(tc, efl_ui_homogeneous_model_test); + tcase_add_test(tc, efl_ui_average_model_test); + tcase_add_test(tc, efl_ui_exact_model_test); +} diff --git a/src/tests/elementary/efl_ui_suite.c b/src/tests/elementary/efl_ui_suite.c index 0ba2542c73..a1ba34f1f4 100644 --- a/src/tests/elementary/efl_ui_suite.c +++ b/src/tests/elementary/efl_ui_suite.c @@ -1,69 +1,32 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif -#include -#define EFL_NOLEGACY_API_SUPPORT -#include -#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_main_get(EFL_APP_CLASS), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL); - fail_if(!ecore_init_ex(argc, argv)); - __EFL_MAIN_CONSTRUCTOR; - ret__ = efl_loop_begin(efl_app_main_get(EFL_APP_CLASS)); - 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); -} +#include "efl_ui_suite.h" +#include "suite_helpers.h" static const Efl_Test_Case etc[] = { - { "Efl_Ui", efl_ui_test }, + //{ "elm_focus", elm_test_focus}, + //{ "elm_focus_sub", elm_test_focus_sub}, + //{ "elm_widget_focus", elm_test_widget_focus}, + { "efl_ui_atspi", efl_ui_test_atspi}, + { "efl_ui_callback", efl_ui_test_callback}, + { "efl_ui_focus", efl_ui_test_focus}, + { "efl_ui_focus_sub", efl_ui_test_focus_sub}, + { "efl_ui_box", efl_ui_test_box}, + { "efl_ui_box_flow", efl_ui_test_box_flow}, + { "efl_ui_box_stack", efl_ui_test_box_stack}, + { "efl_ui_table", efl_ui_test_table}, + { "efl_ui_grid", efl_ui_test_grid}, + { "efl_ui_relative_layout", efl_ui_test_relative_layout}, + { "efl_ui_image", efl_ui_test_image}, + { "efl_ui_image_zoomable", efl_ui_test_image_zoomable}, + { "efl_ui_layout", efl_ui_test_layout}, + { "Efl_Ui_Model", efl_ui_model }, + { "efl_ui_widget", efl_ui_test_widget }, { NULL, NULL } }; -SUITE_INIT(efl_ui) -{ - //??? -} - -SUITE_SHUTDOWN(efl_ui) -{ - -} - int main(int argc, char **argv) { @@ -72,12 +35,10 @@ main(int argc, char **argv) if (!_efl_test_option_disp(argc, argv, etc)) return 0; -#ifdef NEED_RUN_IN_TREE - putenv("EFL_RUN_IN_TREE=1"); -#endif + failed_count = suite_setup(EINA_FALSE); - 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)); + failed_count += _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, + "Efl_Ui", etc, SUITE_INIT_FN(elm2), SUITE_SHUTDOWN_FN(elm)); return (failed_count == 0) ? 0 : 255; } diff --git a/src/tests/elementary/efl_ui_suite.h b/src/tests/elementary/efl_ui_suite.h new file mode 100644 index 0000000000..5282949eb5 --- /dev/null +++ b/src/tests/elementary/efl_ui_suite.h @@ -0,0 +1,46 @@ +#ifndef EFL_UI_SUITE_H +#define EFL_UI_SUITE_H + +#include + +#define EFL_NOLEGACY_API_SUPPORT +#include +#include "../efl_check.h" + +#define ck_assert_strn_eq(s1, s2, len) \ + { \ + char expected[len+1], actual[len+1]; \ + \ + strncpy(expected, s1, len); \ + expected[len] = '\0'; \ + strncpy(actual, s2, len); \ + actual[len] = '\0'; \ + \ + ck_assert_str_eq(expected, actual); \ + } + +void efl_ui_test_box(TCase *tc); +void efl_ui_test_box_flow(TCase *tc); +void efl_ui_test_box_stack(TCase *tc); +void efl_ui_test_table(TCase *tc); +void efl_ui_test_grid(TCase *tc); +void efl_ui_test_relative_layout(TCase *tc); +void efl_ui_test_atspi(TCase *tc); +void efl_ui_test_image_zoomable(TCase *tc); +void efl_ui_test_layout(TCase *tc); +void efl_ui_test_image(TCase *tc); +void efl_ui_test_callback(TCase *tc); + +void efl_ui_test_focus(TCase *tc); +void efl_ui_test_focus_sub(TCase *tc); + +void efl_ui_model(TCase *tc); +void efl_ui_test_widget(TCase *tc); + +void loop_timer_interval_set(Eo *obj, double in); + +#define efl_loop_timer_interval_set loop_timer_interval_set + +Eo *win_add(); +Eo *win_add_focused(); +#endif diff --git a/src/tests/elementary/efl_ui_test_atspi.c b/src/tests/elementary/efl_ui_test_atspi.c new file mode 100644 index 0000000000..68a88ec6c3 --- /dev/null +++ b/src/tests/elementary/efl_ui_test_atspi.c @@ -0,0 +1,613 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + + +#define EFL_ACCESS_OBJECT_BETA +#define EFL_ACCESS_OBJECT_PROTECTED + +#include +#include +#include "elm_priv.h" +#include "efl_ui_suite.h" + +static Evas_Object *g_win, *g_btn, *g_bg; + +void generate_app(void) +{ + g_win = win_add(NULL, "Title", ELM_WIN_BASIC); + efl_gfx_entity_position_set(g_win, EINA_POSITION2D(100, 100)); + efl_gfx_entity_size_set(g_win, EINA_SIZE2D(100, 100)); + + g_bg = efl_add(EFL_UI_BG_CLASS, g_win); + + g_btn = efl_add(EFL_UI_BUTTON_CLASS, g_win); + + efl_gfx_entity_visible_set(g_btn, EINA_TRUE); + efl_gfx_entity_visible_set(g_bg, EINA_TRUE); + efl_gfx_entity_visible_set(g_win, EINA_TRUE); +} + +EFL_START_TEST(test_efl_access_app_obj_name_get) +{ + Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL); + + ck_assert(root != NULL); + + const char *ret = NULL; + + elm_app_name_set("Test name"); + + ret = efl_access_object_i18n_name_get(root); + + ck_assert_str_eq(ret, "Test name"); + + efl_unref(root); +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_object_i18n_name_get) +{ + generate_app(); + + const char *name; + + name = efl_access_object_i18n_name_get(g_btn); + + if (name && name[0]) { + ck_assert(0); + } + + // Set name with additional text tags + efl_text_set(g_btn, "Some
text"); + + 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"); + +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_object_i18n_name_set) +{ + generate_app(); + + const char *name; + + efl_text_set(g_btn, "Other text"); + efl_access_object_i18n_name_set(g_btn, "Test name"); + + name = efl_access_object_i18n_name_get(g_btn); + + ck_assert(name != NULL); + ck_assert_str_eq(name, "Test name"); + + 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"); + +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_object_role_get) +{ + Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL); + + Efl_Access_Role role; + + role = efl_access_object_role_get(root); + + ck_assert(role == EFL_ACCESS_ROLE_APPLICATION); + + efl_unref(root); +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_object_role_set) +{ + generate_app(); + Efl_Access_Role role; + + 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_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); + +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_object_role_name_get) +{ + Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL); + + const char *ret = NULL; + + ret = efl_access_object_role_name_get(root); + + ck_assert(ret != NULL); + + efl_unref(root); +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_object_localized_role_name_get) +{ + Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL); + + const char *ret = NULL; + + ret = efl_access_object_localized_role_name_get(root); + + ck_assert(ret != NULL); + + efl_unref(root); +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_object_description_set) +{ + Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL); + + const char *ret = NULL; + + const char *desc = "Test description"; + + ret = efl_access_object_description_get(root); + + ck_assert(ret == NULL); + + 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_object_description_set(root, NULL); + ret = efl_access_object_description_get(root); + + ck_assert(ret == NULL); + + efl_unref(root); +} +EFL_END_TEST + +/* Test if initial description value is NULL */ +EFL_START_TEST(test_efl_access_object_description_get) +{ + generate_app(); + + const char *descr; + descr = efl_access_object_description_get(g_bg); + + ck_assert(descr == NULL); + +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_children_and_parent) +{ + generate_app(); + Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL); + + Eina_List *child_list = NULL; + + child_list = efl_access_object_access_children_get(root); + + //bg_child_list = efl_access_object_access_children_get(eina_list_nth(child_list, 0)); + + ck_assert_int_eq(eina_list_count(child_list), 1); + + Eo *win = NULL; + + win = eina_list_nth(child_list, 0); + + ck_assert_ptr_ne(win, NULL); + ck_assert_ptr_eq(win, g_win); + + efl_unref(root); +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_children_and_parent2) +{ + generate_app(); + Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL); + + Eo *win = NULL; + + Eina_List *root_children; + root_children = efl_access_object_access_children_get(root); + win = eina_list_nth(root_children, 0); + + Eina_List *win_children; + win_children = efl_access_object_access_children_get(win); + + ck_assert(eina_list_count(win_children) == 1); + + Eo *btn = NULL; + + btn = eina_list_nth(win_children, 0); + ck_assert(btn != NULL); + ck_assert(btn == g_btn); + + efl_unref(root); +} +EFL_END_TEST + +/* Initial value of translation domain should be NULL */ +EFL_START_TEST(test_efl_access_object_translation_domain_get) +{ + generate_app(); + + const char *domain; + + domain = efl_access_object_translation_domain_get(g_btn); + + ck_assert(domain == NULL); + +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_object_translation_domain_set) +{ + generate_app(); + + const char *domain; + + 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_object_translation_domain_set(g_btn, NULL); + domain = efl_access_object_translation_domain_get(g_btn); + + ck_assert(domain == NULL); + +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_object_relationship_append) +{ + generate_app(); + + Efl_Access_Relation *rel, *rel_to, *rel_from; + Eina_Iterator *it; + unsigned int i = 0; + + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_win); + it = efl_access_object_relations_get(g_btn); + + ck_assert(it != NULL); + + rel_to = rel_from = NULL; + EINA_ITERATOR_FOREACH(it, rel) + { + i++; + + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) + rel_to = rel; + if (rel->type == EFL_ACCESS_RELATION_TYPE_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); + + eina_iterator_free(it); + + /* Check if append do not procude duplicated relations */ + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_win); + it = efl_access_object_relations_get(g_btn); i = 0; + + rel_to = rel_from = NULL; + EINA_ITERATOR_FOREACH(it, rel) + { + i++; + + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) + rel_to = rel; + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM) + rel_from = rel; + } + + ck_assert(rel_to != NULL); + ck_assert(rel_to->objects != NULL); + rel_to->objects = eina_list_remove(rel_to->objects, g_bg); + ck_assert(eina_list_data_find(rel_to->objects, g_bg) == NULL); + + ck_assert(rel_from != NULL); + ck_assert(rel_from->objects != NULL); + rel_from->objects = eina_list_remove(rel_from->objects, g_win); + ck_assert(eina_list_data_find(rel_from->objects, g_win) == NULL); + + eina_iterator_free(it); +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_object_relationship_remove) +{ + generate_app(); + + Efl_Access_Relation *rel, *rel_to, *rel_from; + Eina_Iterator *it; + unsigned int i = 0; + + /* Test if removal of single relationship works */ + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_win); + efl_access_object_relationship_remove(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg); + it = efl_access_object_relations_get(g_btn); + + ck_assert(it != NULL); + + rel_to = rel_from = NULL; + EINA_ITERATOR_FOREACH(it, rel) + { + i++; + + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) + rel_to = rel; + if (rel->type == EFL_ACCESS_RELATION_TYPE_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); + + eina_iterator_free(it); + + /* Test if removal of type relationship works */ + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_win); + efl_access_object_relationship_remove(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, NULL); + it = efl_access_object_relations_get(g_btn); i = 0; + + rel_to = rel_from = NULL; + EINA_ITERATOR_FOREACH(it, rel) + { + i++; + + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) + rel_to = rel; + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM) + rel_from = rel; + } + + ck_assert(rel_to == NULL); + ck_assert(rel_from != NULL); + ck_assert(eina_list_data_find(rel_from->objects, g_win) != NULL); + + eina_iterator_free(it); + + /* Test if relationship is implicity removed when object is deleted */ + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_bg); + efl_del(g_bg); + it = efl_access_object_relations_get(g_btn); i = 0; + + rel_to = rel_from = NULL; + EINA_ITERATOR_FOREACH(it, rel) + { + i++; + + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) + rel_to = rel; + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM) + rel_from = rel; + } + + 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); + + eina_iterator_free(it); +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_object_relationships_clear) +{ + Efl_Access_Relation *rel; + Eina_Iterator *it; + + generate_app(); + + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_bg); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_win); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_win); + + efl_access_object_relationships_clear(g_btn); + + it = efl_access_object_relations_get(g_btn); + EINA_ITERATOR_FOREACH(it, rel) + { + ck_assert(!((rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) && eina_list_data_find(rel->objects, g_bg))); + ck_assert(!((rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM) && eina_list_data_find(rel->objects, g_bg))); + ck_assert(!((rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) && eina_list_data_find(rel->objects, g_win))); + ck_assert(!((rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM) && eina_list_data_find(rel->objects, g_win))); + } + eina_iterator_free(it); +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_object_attribute_append) +{ + Eina_List *attr_list = NULL, *l = NULL; + Efl_Access_Attribute *attr = NULL; + generate_app(); + efl_access_object_attribute_append(g_btn, "color1", "red"); + efl_access_object_attribute_append(g_btn, "color2", "blue"); + efl_access_object_attribute_append(g_btn, "color3", "green"); + attr_list = efl_access_object_attributes_get(g_btn); + + ck_assert(attr_list != NULL); + EINA_LIST_FOREACH(attr_list, l, attr) + { + if (!strcmp(attr->key, "color1")) + ck_assert_str_eq(attr->value, "red"); + else if (!strcmp(attr->key, "color2")) + ck_assert_str_eq(attr->value, "blue"); + else if (!strcmp(attr->key, "color3")) + ck_assert_str_eq(attr->value, "green"); + } + EINA_LIST_FREE(attr_list, attr) + { + eina_stringshare_del(attr->key); + eina_stringshare_del(attr->value); + free(attr); + } +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_object_attributes_get) +{ + Eina_List *attr_list = NULL, *l = NULL; + Efl_Access_Attribute *attr = NULL; + generate_app(); + efl_access_object_attribute_append(g_btn, "color1", "red"); + efl_access_object_attribute_append(g_btn, "color2", "blue"); + efl_access_object_attribute_append(g_btn, "color3", "green"); + attr_list = efl_access_object_attributes_get(g_btn); + + ck_assert(attr_list != NULL); + EINA_LIST_FOREACH(attr_list, l, attr) + { + if (!strcmp(attr->key, "color1")) + ck_assert_str_eq(attr->value, "red"); + else if (!strcmp(attr->key, "color2")) + ck_assert_str_eq(attr->value, "blue"); + else if (!strcmp(attr->key, "color3")) + ck_assert_str_eq(attr->value, "green"); + } + EINA_LIST_FREE(attr_list, attr) + { + eina_stringshare_del(attr->key); + eina_stringshare_del(attr->value); + free(attr); + } +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_object_attribute_del) +{ + Eina_List *attr_list = NULL; + Efl_Access_Attribute *attr = NULL; + int count1 = 0; + int count2 = 0; + generate_app(); + efl_access_object_attribute_append(g_btn, "color1", "red"); + efl_access_object_attribute_append(g_btn, "color2", "blue"); + efl_access_object_attribute_append(g_btn, "color3", "green"); + attr_list = efl_access_object_attributes_get(g_btn);//default attributes are added again + ck_assert(attr_list != NULL); + count1 = eina_list_count(attr_list); + EINA_LIST_FREE(attr_list, attr) + { + eina_stringshare_del(attr->key); + eina_stringshare_del(attr->value); + free(attr); + } + attr_list = NULL; + efl_access_object_attribute_del(g_btn, "color4");//non existent key deletion + efl_access_object_attribute_del(g_btn, "color3");//existing key deletion + attr_list = efl_access_object_attributes_get(g_btn); + ck_assert(attr_list != NULL); + count2 = eina_list_count(attr_list); + ck_assert(count1 == (count2+1)); + EINA_LIST_FREE(attr_list, attr) + { + eina_stringshare_del(attr->key); + eina_stringshare_del(attr->value); + free(attr); + } +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_object_attributes_clear) +{ + Eina_List *attr_list = NULL; + Efl_Access_Attribute *attr = NULL; + generate_app(); + efl_access_object_attribute_append(g_btn, "color1", "red"); + efl_access_object_attribute_append(g_btn, "color2", "blue"); + efl_access_object_attribute_append(g_btn, "color3", "green"); + efl_access_object_attributes_clear(g_btn); + attr_list = efl_access_object_attributes_get(g_btn);//default attributes are added again + ck_assert(attr_list != NULL); + ck_assert(eina_list_count(attr_list) <= 2); + EINA_LIST_FREE(attr_list, attr) + { + eina_stringshare_del(attr->key); + eina_stringshare_del(attr->value); + free(attr); + } +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_object_reading_info_type_set) +{ + Efl_Access_Reading_Info_Type reading_info; + generate_app(); + efl_access_object_reading_info_type_set(g_btn, EFL_ACCESS_READING_INFO_TYPE_NAME| + EFL_ACCESS_READING_INFO_TYPE_ROLE); + reading_info = efl_access_object_reading_info_type_get(g_btn); + ck_assert(reading_info & EFL_ACCESS_READING_INFO_TYPE_NAME); + ck_assert(reading_info & EFL_ACCESS_READING_INFO_TYPE_ROLE); +} +EFL_END_TEST + +EFL_START_TEST(test_efl_access_object_reading_info_type_get) +{ + Efl_Access_Reading_Info_Type reading_info; + generate_app(); + reading_info = efl_access_object_reading_info_type_get(g_btn); + ck_assert(reading_info == 0); +} +EFL_END_TEST + +void efl_ui_test_atspi(TCase *tc) +{ + tcase_add_test(tc, test_efl_access_app_obj_name_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_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); + tcase_add_test(tc, test_efl_access_object_attribute_append); + tcase_add_test(tc, test_efl_access_object_attributes_get); + tcase_add_test(tc, test_efl_access_object_attribute_del); + tcase_add_test(tc, test_efl_access_object_attributes_clear); + tcase_add_test(tc, test_efl_access_object_reading_info_type_set); + tcase_add_test(tc, test_efl_access_object_reading_info_type_get); +} diff --git a/src/tests/elementary/efl_ui_test_box.c b/src/tests/elementary/efl_ui_test_box.c new file mode 100644 index 0000000000..ca9b0c134e --- /dev/null +++ b/src/tests/elementary/efl_ui_test_box.c @@ -0,0 +1,563 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include +#include +#include "elm_suite.h" + +#define COORD_EQ(a, b) (!!(abs(a - b) < 2)) +#define GEOMETRY_EQ(a, b) (COORD_EQ(a.x, b.x) && COORD_EQ(a.y, b.y) && \ + COORD_EQ(a.w, b.w) && COORD_EQ(a.h, b.h)) + +typedef struct { + Eina_Size2D max; + Eina_Size2D min; + double weightx; + double weighty; + double alignx; + double aligny; + int marginl; + int marginr; + int margint; + int marginb; + Efl_Gfx_Hint_Aspect mode; + Eina_Size2D aspect; + Eina_Bool fillx; + Eina_Bool filly; + Eina_Size2D layout_size; + Eina_Size2D layout_expected; + Eina_Rect expected; + char testname[1024]; +} Hint; + +static Hint hints[] = { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(0, 0), 1, 1, 0.5, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT(0, 0, 200, 200), "[0]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT(0, 0, 200, 200), "[1]" }, + { EINA_SIZE2D(50, 150), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 150) * 0.7, 70, 150), "[2]" }, + { EINA_SIZE2D(150, -1), EINA_SIZE2D(70, 70), 0, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 70) * 0.2, 70, 70), "[3]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 70) * 0.2, 70, 70), "[4]" }, + { EINA_SIZE2D(150, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 70) * 0.2, 70, 70), "[5]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210), + EINA_RECT((200 - 70) * 0.3, 0, 70, 70 * 3), "[6]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.7, 70, 70 * 3), "[7]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210), + EINA_RECT((200 - 70) * 0.3, 0, 70, 70 * 3), "[8]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.2, 70, 70 * 3), "[9]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210), + EINA_RECT((200 - 70) * 0.3, 0, 70, 70 * 3), "[10]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.7, 70, 70 * 3), "[11]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210), + EINA_RECT((200 - 70) * 0.3, 0, 70, 70 * 3), "[12]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.2, 70, 70 * 3), "[13]" }, +}; + +static Hint hints2[][2] = { + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.3, (150 - 70) * 0.7, 70, 70), "[1/1 weight btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.8, (150 - 70) * 0.2 + 150, 70, 70), "[1/1 weight btn2]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.3, 0, 70, 70), "[0/1 weight btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_VERTICAL, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - ((300 - 70) / 3)) * 0.8, 70, (300 - 70) / 3, (300 - 70)), "[0/1 weight btn2]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.3, (300 - 280) * 0.2, 70, 70), "[0/0 weight btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_HORIZONTAL, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.8, (300 - 280) * 0.2 + 70, 70, 70 * 3), "[0/0 weight btn2]" } + }, +}; + +static Hint hints3[][3] = { + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT(0, 0, 150, 100), "[1/1/1 weight_l btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 100), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT(0, 100, 150, 100), "[1/1/1 weight_l btn2]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT(0, 100 + 100, 150, 100), "[1/1/1 weight_l btn3]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 270), EINA_SIZE2D(150, 270), + EINA_RECT(0, 0, 150, 85), "[1/1/1 weight_m btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 100), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 270), EINA_SIZE2D(150, 270), + EINA_RECT(0, 85, 150, 100), "[1/1/1 weight_m btn2]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 270), EINA_SIZE2D(150, 270), + EINA_RECT(0, 100 + 85, 150, 85), "[1/1/1 weight_m btn3]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 200), EINA_SIZE2D(150, 240), + EINA_RECT(0, 0, 150, 70), "[1/1/1 weight_s btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 100), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 200), EINA_SIZE2D(150, 240), + EINA_RECT(0, 70, 150, 100), "[1/1/1 weight_s btn2]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 200), EINA_SIZE2D(150, 240), + EINA_RECT(0, 170, 150, 70), "[1/1/1 weight_s btn3]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(0, 0), 1, 1, 0.5, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(300, 900), EINA_SIZE2D(300, 900), + EINA_RECT(100, 0, 100, 300), "[aspect resize btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(0, 0), 1, 1, 0.5, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(300, 900), EINA_SIZE2D(300, 900), + EINA_RECT(100, 300, 100, 300), "[aspect resize btn2]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(0, 0), 1, 1, 0.5, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(300, 900), EINA_SIZE2D(300, 900), + EINA_RECT(100, 300 + 300, 100, 300), "[aspect resize btn3]" } + }, +}; + +static Eo *win, *layout; + +static void +btn_hint_set(Eo *btn, Hint *hint) +{ + efl_gfx_entity_size_set(layout, hint->layout_size); + efl_gfx_hint_size_min_set(layout, hint->layout_size); + efl_gfx_hint_size_max_set(btn, hint->max); + efl_gfx_hint_size_min_set(btn, hint->min); + efl_gfx_hint_weight_set(btn, hint->weightx, hint->weighty); + efl_gfx_hint_align_set(btn, hint->alignx, hint->aligny); + efl_gfx_hint_fill_set(btn, hint->fillx, hint->filly); + efl_gfx_hint_aspect_set(btn, hint->mode, hint->aspect); + efl_canvas_group_calculate(layout); +} + +static void +btn_geom_assert(Hint *hint, Eina_Rect btn_geom) +{ + Eina_Size2D layout_size, layout_min; + + layout_size = efl_gfx_entity_size_get(layout); + layout_min = efl_gfx_hint_size_combined_min_get(layout); + layout_size.w = layout_size.w > layout_min.w ? layout_size.w : layout_min.w; + layout_size.h = layout_size.h > layout_min.h ? layout_size.h : layout_min.h; + + ck_assert_msg(GEOMETRY_EQ(btn_geom, hint->expected), + "Case %s failed... button geometry: (%d, %d, %d, %d) expected geometry: (%d, %d, %d, %d)", + hint->testname, btn_geom.x, btn_geom.y, btn_geom.w, btn_geom.h, + hint->expected.x, hint->expected.y, hint->expected.w, hint->expected.h); + ck_assert_msg(COORD_EQ(layout_size.w, hint->layout_expected.w) && + COORD_EQ(layout_size.h, hint->layout_expected.h), + "Case %s failed... layout size: (%d, %d) expected size: (%d, %d)", + hint->testname, layout_size.w, layout_size.h, + hint->layout_expected.w, hint->layout_expected.h); +} + +static void +layout_setup() +{ + win = win_add(); + + layout = efl_add(EFL_UI_BOX_CLASS, win); +} + +static void +layout_teardown() +{ + if (win) + { + efl_del(win); + win = NULL; + } +} + +EFL_START_TEST (efl_ui_box_class_check) +{ + const char *class; + + class = efl_class_name_get(layout); + + ck_assert(class != NULL); + ck_assert(!strcmp(class, "Efl.Ui.Box")); +} +EFL_END_TEST + +EFL_START_TEST (efl_ui_box_layout_update) +{ + int i, max_index = (sizeof(hints) / sizeof(Hint)); + + efl_pack_align_set(layout, 0.8, 0.2); + efl_ui_direction_set(layout, EFL_UI_DIR_VERTICAL); + + Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_pack_end(layout, efl_added)); + + for (i = 0; i < max_index; i++) + { + btn_hint_set(btn, &hints[i]); + btn_geom_assert(&hints[i], efl_gfx_entity_geometry_get(btn)); + } +} +EFL_END_TEST + +EFL_START_TEST (efl_ui_box_layout_update_pack) +{ + int i, max_index2, max_index3; + Eo *btn, *btn2, *btn3; + + efl_pack_align_set(layout, 0.8, 0.2); + efl_ui_direction_set(layout, EFL_UI_DIR_VERTICAL); + + max_index2 = ((sizeof(hints2) / sizeof(Hint)) / 2); + max_index3 = ((sizeof(hints3) / sizeof(Hint)) / 3); + + btn = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_pack_end(layout, efl_added)); + btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_pack_end(layout, efl_added)); + + for (i = 0; i < max_index2; i++) + { + btn_hint_set(btn, &hints2[i][0]); + btn_hint_set(btn2, &hints2[i][1]); + btn_geom_assert(&hints2[i][0], efl_gfx_entity_geometry_get(btn)); + btn_geom_assert(&hints2[i][1], efl_gfx_entity_geometry_get(btn2)); + } + + btn3 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_pack_end(layout, efl_added)); + + for (i = 0; i < max_index3; i++) + { + btn_hint_set(btn, &hints3[i][0]); + btn_hint_set(btn2, &hints3[i][1]); + btn_hint_set(btn3, &hints3[i][2]); + btn_geom_assert(&hints3[i][0], efl_gfx_entity_geometry_get(btn)); + btn_geom_assert(&hints3[i][1], efl_gfx_entity_geometry_get(btn2)); + btn_geom_assert(&hints3[i][2], efl_gfx_entity_geometry_get(btn3)); + } + + // aspect resize test + hints3[3][0].layout_expected = hints3[3][0].layout_size = EINA_SIZE2D(150, 450); + hints3[3][1].layout_expected = hints3[3][1].layout_size = EINA_SIZE2D(150, 450); + hints3[3][2].layout_expected = hints3[3][2].layout_size = EINA_SIZE2D(150, 450); + hints3[3][0].expected = EINA_RECT(50, 0, 50, 150); + hints3[3][1].expected = EINA_RECT(50, 150, 50, 150); + hints3[3][2].expected = EINA_RECT(50, 300, 50, 150); + + btn_hint_set(btn, &hints3[3][0]); + btn_hint_set(btn2, &hints3[3][1]); + btn_hint_set(btn3, &hints3[3][2]); + btn_geom_assert(&hints3[3][0], efl_gfx_entity_geometry_get(btn)); + btn_geom_assert(&hints3[3][1], efl_gfx_entity_geometry_get(btn2)); + btn_geom_assert(&hints3[3][2], efl_gfx_entity_geometry_get(btn3)); + + efl_ui_direction_set(layout, EFL_UI_DIR_HORIZONTAL); + hints3[3][0].layout_expected = hints3[3][0].layout_size = EINA_SIZE2D(300, 900); + hints3[3][1].layout_expected = hints3[3][1].layout_size = EINA_SIZE2D(300, 900); + hints3[3][2].layout_expected = hints3[3][2].layout_size = EINA_SIZE2D(300, 900); + hints3[3][0].expected = EINA_RECT(0, 300, 100, 300); + hints3[3][1].expected = EINA_RECT(100, 300, 100, 300); + hints3[3][2].expected = EINA_RECT(200, 300, 100, 300); + + btn_hint_set(btn, &hints3[3][0]); + btn_hint_set(btn2, &hints3[3][1]); + btn_hint_set(btn3, &hints3[3][2]); + btn_geom_assert(&hints3[3][0], efl_gfx_entity_geometry_get(btn)); + btn_geom_assert(&hints3[3][1], efl_gfx_entity_geometry_get(btn2)); + btn_geom_assert(&hints3[3][2], efl_gfx_entity_geometry_get(btn3)); + + hints3[3][0].layout_expected = hints3[3][0].layout_size = EINA_SIZE2D(150, 450); + hints3[3][1].layout_expected = hints3[3][1].layout_size = EINA_SIZE2D(150, 450); + hints3[3][2].layout_expected = hints3[3][2].layout_size = EINA_SIZE2D(150, 450); + hints3[3][0].expected = EINA_RECT(0, 150, 50, 150); + hints3[3][1].expected = EINA_RECT(50, 150, 50, 150); + hints3[3][2].expected = EINA_RECT(100, 150, 50, 150); + + btn_hint_set(btn, &hints3[3][0]); + btn_hint_set(btn2, &hints3[3][1]); + btn_hint_set(btn3, &hints3[3][2]); + btn_geom_assert(&hints3[3][0], efl_gfx_entity_geometry_get(btn)); + btn_geom_assert(&hints3[3][1], efl_gfx_entity_geometry_get(btn2)); + btn_geom_assert(&hints3[3][2], efl_gfx_entity_geometry_get(btn3)); +} +EFL_END_TEST + +EFL_START_TEST (efl_ui_box_size) +{ +#define USERMIN_CHECK(a, b) \ + efl_canvas_group_calculate(layout); \ + user_min = efl_gfx_hint_size_min_get(layout); \ + ck_assert_msg(COORD_EQ(user_min.w, (a)) && COORD_EQ(user_min.h, (b)), \ + "Case box_size failed... user_min: (%d, %d) expected user_min: (%d, %d)", \ + user_min.w, user_min.h, (a), (b)); + +#define MIN_CHECK(a, b) \ + efl_canvas_group_calculate(layout); \ + min = efl_gfx_hint_size_combined_min_get(layout); \ + ck_assert_msg(COORD_EQ(min.w, (a)) && COORD_EQ(min.h, (b)), \ + "Case box_size failed... min: (%d, %d) expected min: (%d, %d)", \ + min.w, min.h, (a), (b)); + + Eo *btn, *btn2, *btn3; + Eina_Size2D min, user_min; + + efl_ui_direction_set(layout, EFL_UI_DIR_VERTICAL); + + btn = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)), + efl_pack_end(layout, efl_added)); + + USERMIN_CHECK(0, 0); + MIN_CHECK(100, 100); + + btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)), + efl_pack_end(layout, efl_added)); + btn3 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)), + efl_pack_end(layout, efl_added)); + USERMIN_CHECK(0, 0); + MIN_CHECK(100, 300); + + efl_pack_unpack(layout, btn2); + USERMIN_CHECK(0, 0); + MIN_CHECK(100, 200); + + efl_pack_unpack(layout, btn3); + USERMIN_CHECK(0, 0); + MIN_CHECK(100, 100); + + efl_pack_unpack(layout, btn); + USERMIN_CHECK(0, 0); + MIN_CHECK(0, 0); + + efl_pack_end(layout, btn); + efl_gfx_hint_size_min_set(layout, EINA_SIZE2D(200, 200)); + USERMIN_CHECK(200, 200); + MIN_CHECK(200, 200); + + efl_pack_end(layout, btn2); + efl_pack_end(layout, btn3); + USERMIN_CHECK(200, 200); + MIN_CHECK(200, 300); + +#undef USERMIN_ASSERT +#undef MIN_ASSERT +} +EFL_END_TEST + +EFL_START_TEST (efl_ui_box_pack_unpack) +{ +#define BTN_NUM 6 + Eo *o, *btn[BTN_NUM]; + Eina_Iterator *itr; + int i; + + for (i = 0; i < BTN_NUM; i++) + btn[i] = efl_add(EFL_UI_BUTTON_CLASS, layout); + + //pack test + ck_assert(efl_pack(layout, btn[1])); + ck_assert_ptr_eq(efl_pack_content_get(layout, 0), btn[1]); + ck_assert_int_eq(efl_pack_index_get(layout, btn[1]), 0); + ck_assert(!efl_pack_end(layout, btn[1])); + ck_assert(!efl_pack(layout, NULL)); + ck_assert(efl_pack_after(layout, btn[3], btn[1])); + ck_assert_ptr_eq(efl_pack_content_get(layout, 1), btn[3]); + ck_assert_int_eq(efl_pack_index_get(layout, btn[3]), 1); + ck_assert(efl_pack_after(layout, btn[5], NULL)); + ck_assert_ptr_eq(efl_pack_content_get(layout, 2), btn[5]); + ck_assert_int_eq(efl_pack_index_get(layout, btn[5]), 2); + ck_assert_ptr_eq(efl_pack_content_get(layout, -1), btn[5]); + ck_assert_int_eq(efl_pack_index_get(layout, btn[5]), 2); + ck_assert(!efl_pack_after(layout, btn[5], NULL)); + ck_assert(!efl_pack_after(layout, NULL, btn[5])); + ck_assert(efl_pack_before(layout, btn[4], btn[5])); + ck_assert(efl_pack_begin(layout, btn[0])); + ck_assert_ptr_eq(efl_pack_content_get(layout, 0), btn[0]); + ck_assert_int_eq(efl_pack_index_get(layout, btn[0]), 0); + ck_assert(efl_pack_at(layout, btn[2], 2)); + ck_assert_ptr_eq(efl_pack_content_get(layout, 2), btn[2]); + ck_assert_int_eq(efl_pack_index_get(layout, btn[2]), 2); + + ck_assert_int_eq(efl_content_count(layout), BTN_NUM); + + i = 0; + itr = efl_content_iterate(layout); + EINA_ITERATOR_FOREACH(itr, o) + { + ck_assert_ptr_eq(o, btn[i++]); + } + eina_iterator_free(itr); + + /* btn array index : 0 1 2 3 4 5 + * children index : 0 1 2 3 4 5 + * negative index : -6 -5 -4 -3 -2 -1 + */ + //negative index test + for (i = -1; i >= -BTN_NUM; i--) + { + o = efl_pack_content_get(layout, i); + ck_assert_ptr_eq(o, btn[BTN_NUM + i]); + ck_assert_int_eq(efl_pack_index_get(layout, o), BTN_NUM + i); + } + + //unpack test + ck_assert_ptr_eq(efl_pack_unpack_at(layout, 2), btn[2]); + ck_assert(!efl_pack_unpack(layout, btn[2])); + efl_pack_at(layout, btn[2], 2); + ck_assert(efl_pack_unpack(layout, efl_pack_content_get(layout, 2))); + ck_assert(!efl_pack_unpack(layout, btn[2])); + + efl_pack_at(layout, btn[2], 2); + ck_assert_ptr_eq(efl_pack_unpack_at(layout, efl_pack_index_get(layout, btn[2])), btn[2]); + + ck_assert(!efl_pack_unpack(layout, NULL)); + ck_assert_int_eq(efl_content_count(layout), BTN_NUM - 1); + + efl_pack_unpack_all(layout); + ck_assert_int_eq(efl_content_count(layout), 0); + ck_assert(!efl_invalidated_get(btn[0])); + + for (i = 0; i < BTN_NUM; i++) + efl_pack_end(layout, btn[i]); + + efl_pack_clear(layout); + ck_assert_int_eq(efl_content_count(layout), 0); + ck_assert(efl_invalidated_get(btn[0])); +#undef BTN_NUM +} +EFL_END_TEST + +EFL_START_TEST (efl_ui_box_properties) +{ + double h, v; + Eina_Bool b; + + //align test + efl_pack_align_get(layout, &h, &v); + ck_assert(EINA_DBL_EQ(h, 0.5)); + ck_assert(EINA_DBL_EQ(v, 0.5)); + + efl_pack_align_set(layout, 0.3, 0.8234); + efl_pack_align_get(layout, &h, &v); + ck_assert(EINA_DBL_EQ(h, 0.3)); + ck_assert(EINA_DBL_EQ(v, 0.8234)); + + efl_pack_align_set(layout, -0.23, 123); + efl_pack_align_get(layout, &h, &v); + ck_assert(EINA_DBL_EQ(h, -1)); + ck_assert(EINA_DBL_EQ(v, 1)); + + //padding test + efl_pack_padding_get(layout, &h, &v, &b); + ck_assert(EINA_DBL_EQ(h, 0.0)); + ck_assert(EINA_DBL_EQ(v, 0.0)); + ck_assert_int_eq(b, 0); + + efl_pack_padding_set(layout, 0.3, 0.8234, 1); + efl_pack_padding_get(layout, &h, &v, &b); + ck_assert(EINA_DBL_EQ(h, 0.3)); + ck_assert(EINA_DBL_EQ(v, 0.8234)); + ck_assert_int_eq(b, 1); + + efl_pack_padding_set(layout, -1.23, 123, 45); + efl_pack_padding_get(layout, &h, &v, &b); + ck_assert(EINA_DBL_EQ(h, 0)); + ck_assert(EINA_DBL_EQ(v, 123)); + ck_assert_int_eq(b, 1); + + //direction test + ck_assert_int_eq(efl_ui_direction_get(layout), EFL_UI_DIR_VERTICAL); + + efl_ui_direction_set(layout, EFL_UI_DIR_DEFAULT); + ck_assert_int_eq(efl_ui_direction_get(layout), EFL_UI_DIR_VERTICAL); + + efl_ui_direction_set(layout, EFL_UI_DIR_HORIZONTAL); + ck_assert_int_eq(efl_ui_direction_get(layout), EFL_UI_DIR_HORIZONTAL); + + //homogeneous test + ck_assert_int_eq(efl_ui_box_homogeneous_get(layout), 0); + + efl_ui_box_homogeneous_set(layout, 123); + ck_assert_int_eq(efl_ui_box_homogeneous_get(layout), 1); +} +EFL_END_TEST + +void efl_ui_test_box(TCase *tc) +{ + tcase_add_checked_fixture(tc, layout_setup, layout_teardown); + tcase_add_test(tc, efl_ui_box_class_check); + tcase_add_test(tc, efl_ui_box_layout_update); + tcase_add_test(tc, efl_ui_box_layout_update_pack); + tcase_add_test(tc, efl_ui_box_size); + tcase_add_test(tc, efl_ui_box_pack_unpack); + tcase_add_test(tc, efl_ui_box_properties); +} diff --git a/src/tests/elementary/efl_ui_test_box_flow.c b/src/tests/elementary/efl_ui_test_box_flow.c new file mode 100644 index 0000000000..4b4c7a0152 --- /dev/null +++ b/src/tests/elementary/efl_ui_test_box_flow.c @@ -0,0 +1,416 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include +#include "elm_suite.h" + +#define COORD_EQ(a, b) (!!(abs(a - b) < 2)) +#define GEOMETRY_EQ(a, b) (COORD_EQ(a.x, b.x) && COORD_EQ(a.y, b.y) && \ + COORD_EQ(a.w, b.w) && COORD_EQ(a.h, b.h)) + +typedef struct { + Eina_Size2D max; + Eina_Size2D min; + double weightx; + double weighty; + double alignx; + double aligny; + int marginl; + int marginr; + int margint; + int marginb; + Efl_Gfx_Hint_Aspect mode; + Eina_Size2D aspect; + Eina_Bool fillx; + Eina_Bool filly; + Eina_Size2D layout_size; + Eina_Size2D layout_expected; + Eina_Rect expected; + char testname[1024]; +} Hint; + +static Hint hints[] = { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(0, 0), 1, 1, 0.5, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT(0, 0, 200, 200), "[0]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT(0, 0, 200, 200), "[1]" }, + { EINA_SIZE2D(50, 150), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 150) * 0.7, 70, 150), "[2]" }, + { EINA_SIZE2D(150, -1), EINA_SIZE2D(70, 70), 0, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.8, (200 - 70) * 0.2, 70, 70), "[3]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 70) * 0.2, 70, 70), "[4]" }, + { EINA_SIZE2D(150, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 70) * 0.2, 70, 70), "[5]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210), + EINA_RECT((200 - 70) * 0.8, 0, 70, 70 * 3), "[6]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.8, (300 - 70 * 3) * 0.7, 70, 70 * 3), "[7]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210), + EINA_RECT((200 - 70) * 0.3, 0, 70, 70 * 3), "[8]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.2, 70, 70 * 3), "[9]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210), + EINA_RECT((200 - 70) * 0.8, 0, 70, 70 * 3), "[10]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.8, (300 - 70 * 3) * 0.7, 70, 70 * 3), "[11]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210), + EINA_RECT((200 - 70) * 0.3, 0, 70, 70 * 3), "[12]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.2, 70, 70 * 3), "[13]" }, +}; + +static Hint hints2[][2] = { + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.3, (150 - 70) * 0.7, 70, 70), "[1/1 weight btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.8, (150 - 70) * 0.2 + 150, 70, 70), "[1/1 weight btn2]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.3, 0, 70, 70), "[0/1 weight btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_VERTICAL, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - ((300 - 70) / 3)) * 0.8, 70, (300 - 70) / 3, (300 - 70)), "[0/1 weight btn2]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.3, (300 - 280) * 0.2, 70, 70), "[0/0 weight btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_HORIZONTAL, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.8, (300 - 280) * 0.2 + 70, 70, 70 * 3), "[0/0 weight btn2]" } + }, +}; + +static Hint hints3[][3] = { + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT(0, 0, 150, 100), "[1/1/1 weight_l btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 100), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT(0, 100, 150, 100), "[1/1/1 weight_l btn2]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT(0, 100 + 100, 150, 100), "[1/1/1 weight_l btn3]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 270), EINA_SIZE2D(150, 270), + EINA_RECT(0, 0, 150, 85), "[1/1/1 weight_m btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 100), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 270), EINA_SIZE2D(150, 270), + EINA_RECT(0, 85, 150, 100), "[1/1/1 weight_m btn2]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 270), EINA_SIZE2D(150, 270), + EINA_RECT(0, 100 + 85, 150, 85), "[1/1/1 weight_m btn3]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 200), EINA_SIZE2D(150, 200), + EINA_RECT(0, 0, 75, 100), "[1/1/1 weight_s btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 100), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 200), EINA_SIZE2D(150, 200), + EINA_RECT(0, 100, 75, 100), "[1/1/1 weight_s btn2]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 200), EINA_SIZE2D(150, 200), + EINA_RECT(75, 0, 75, 200), "[1/1/1 weight_s btn3]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(0, 0), 1, 1, 0.5, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(300, 900), EINA_SIZE2D(300, 900), + EINA_RECT(100, 0, 100, 300), "[aspect resize btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(0, 0), 1, 1, 0.5, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(300, 900), EINA_SIZE2D(300, 900), + EINA_RECT(100, 300, 100, 300), "[aspect resize btn2]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(0, 0), 1, 1, 0.5, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(300, 900), EINA_SIZE2D(300, 900), + EINA_RECT(100, 300 + 300, 100, 300), "[aspect resize btn3]" } + }, +}; + +static Eo *win, *layout; + +static void +btn_hint_set(Eo *btn, Hint *hint) +{ + efl_gfx_entity_size_set(layout, hint->layout_size); + efl_gfx_hint_size_min_set(layout, hint->layout_size); + efl_gfx_hint_size_max_set(btn, hint->max); + efl_gfx_hint_size_min_set(btn, hint->min); + efl_gfx_hint_weight_set(btn, hint->weightx, hint->weighty); + efl_gfx_hint_align_set(btn, hint->alignx, hint->aligny); + efl_gfx_hint_fill_set(btn, hint->fillx, hint->filly); + efl_gfx_hint_aspect_set(btn, hint->mode, hint->aspect); + efl_canvas_group_calculate(layout); +} + +static void +btn_geom_assert(Hint *hint, Eina_Rect btn_geom) +{ + Eina_Size2D layout_size, layout_min; + + layout_size = efl_gfx_entity_size_get(layout); + layout_min = efl_gfx_hint_size_combined_min_get(layout); + layout_size.w = layout_size.w > layout_min.w ? layout_size.w : layout_min.w; + layout_size.h = layout_size.h > layout_min.h ? layout_size.h : layout_min.h; + + ck_assert_msg(GEOMETRY_EQ(btn_geom, hint->expected), + "Case %s failed... button geometry: (%d, %d, %d, %d) expected geometry: (%d, %d, %d, %d)", + hint->testname, btn_geom.x, btn_geom.y, btn_geom.w, btn_geom.h, + hint->expected.x, hint->expected.y, hint->expected.w, hint->expected.h); + ck_assert_msg(COORD_EQ(layout_size.w, hint->layout_expected.w) && + COORD_EQ(layout_size.h, hint->layout_expected.h), + "Case %s failed... layout size: (%d, %d) expected size: (%d, %d)", + hint->testname, layout_size.w, layout_size.h, + hint->layout_expected.w, hint->layout_expected.h); +} + +static void +layout_setup() +{ + win = win_add(); + + layout = efl_add(EFL_UI_BOX_FLOW_CLASS, win, + efl_pack_align_set(efl_added, 0.8, 0.2), + efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL)); +} + +static void +layout_teardown() +{ + if (win) + { + efl_del(win); + win = NULL; + } +} + +EFL_START_TEST (efl_ui_box_flow_class_check) +{ + const char *class; + + class = efl_class_name_get(layout); + + ck_assert(class != NULL); + ck_assert(!strcmp(class, "Efl.Ui.Box_Flow")); +} +EFL_END_TEST + +EFL_START_TEST (efl_ui_box_flow_layout_update) +{ + int i, max_index = (sizeof(hints) / sizeof(Hint)); + + Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_pack_end(layout, efl_added)); + + for (i = 0; i < max_index; i++) + { + btn_hint_set(btn, &hints[i]); + btn_geom_assert(&hints[i], efl_gfx_entity_geometry_get(btn)); + } +} +EFL_END_TEST + +EFL_START_TEST (efl_ui_box_flow_layout_update_pack) +{ + int i, max_index2, max_index3; + Eo *btn, *btn2, *btn3; + + max_index2 = ((sizeof(hints2) / sizeof(Hint)) / 2); + max_index3 = ((sizeof(hints3) / sizeof(Hint)) / 3); + + btn = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_pack_end(layout, efl_added)); + btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_pack_end(layout, efl_added)); + + for (i = 0; i < max_index2; i++) + { + btn_hint_set(btn, &hints2[i][0]); + btn_hint_set(btn2, &hints2[i][1]); + btn_geom_assert(&hints2[i][0], efl_gfx_entity_geometry_get(btn)); + btn_geom_assert(&hints2[i][1], efl_gfx_entity_geometry_get(btn2)); + } + + btn3 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_pack_end(layout, efl_added)); + + for (i = 0; i < max_index3; i++) + { + btn_hint_set(btn, &hints3[i][0]); + btn_hint_set(btn2, &hints3[i][1]); + btn_hint_set(btn3, &hints3[i][2]); + btn_geom_assert(&hints3[i][0], efl_gfx_entity_geometry_get(btn)); + btn_geom_assert(&hints3[i][1], efl_gfx_entity_geometry_get(btn2)); + btn_geom_assert(&hints3[i][2], efl_gfx_entity_geometry_get(btn3)); + } + + // aspect resize test + hints3[3][0].layout_expected = hints3[3][0].layout_size = EINA_SIZE2D(150, 450); + hints3[3][1].layout_expected = hints3[3][1].layout_size = EINA_SIZE2D(150, 450); + hints3[3][2].layout_expected = hints3[3][2].layout_size = EINA_SIZE2D(150, 450); + hints3[3][0].expected = EINA_RECT(50, 0, 50, 150); + hints3[3][1].expected = EINA_RECT(50, 150, 50, 150); + hints3[3][2].expected = EINA_RECT(50, 300, 50, 150); + + btn_hint_set(btn, &hints3[3][0]); + btn_hint_set(btn2, &hints3[3][1]); + btn_hint_set(btn3, &hints3[3][2]); + btn_geom_assert(&hints3[3][0], efl_gfx_entity_geometry_get(btn)); + btn_geom_assert(&hints3[3][1], efl_gfx_entity_geometry_get(btn2)); + btn_geom_assert(&hints3[3][2], efl_gfx_entity_geometry_get(btn3)); + + efl_ui_direction_set(layout, EFL_UI_DIR_HORIZONTAL); + hints3[3][0].layout_expected = hints3[3][0].layout_size = EINA_SIZE2D(300, 900); + hints3[3][1].layout_expected = hints3[3][1].layout_size = EINA_SIZE2D(300, 900); + hints3[3][2].layout_expected = hints3[3][2].layout_size = EINA_SIZE2D(300, 900); + hints3[3][0].expected = EINA_RECT(0, 300, 100, 300); + hints3[3][1].expected = EINA_RECT(100, 300, 100, 300); + hints3[3][2].expected = EINA_RECT(200, 300, 100, 300); + + btn_hint_set(btn, &hints3[3][0]); + btn_hint_set(btn2, &hints3[3][1]); + btn_hint_set(btn3, &hints3[3][2]); + btn_geom_assert(&hints3[3][0], efl_gfx_entity_geometry_get(btn)); + btn_geom_assert(&hints3[3][1], efl_gfx_entity_geometry_get(btn2)); + btn_geom_assert(&hints3[3][2], efl_gfx_entity_geometry_get(btn3)); + + hints3[3][0].layout_expected = hints3[3][0].layout_size = EINA_SIZE2D(150, 450); + hints3[3][1].layout_expected = hints3[3][1].layout_size = EINA_SIZE2D(150, 450); + hints3[3][2].layout_expected = hints3[3][2].layout_size = EINA_SIZE2D(150, 450); + hints3[3][0].expected = EINA_RECT(0, 150, 50, 150); + hints3[3][1].expected = EINA_RECT(50, 150, 50, 150); + hints3[3][2].expected = EINA_RECT(100, 150, 50, 150); + + btn_hint_set(btn, &hints3[3][0]); + btn_hint_set(btn2, &hints3[3][1]); + btn_hint_set(btn3, &hints3[3][2]); + btn_geom_assert(&hints3[3][0], efl_gfx_entity_geometry_get(btn)); + btn_geom_assert(&hints3[3][1], efl_gfx_entity_geometry_get(btn2)); + btn_geom_assert(&hints3[3][2], efl_gfx_entity_geometry_get(btn3)); +} +EFL_END_TEST + +EFL_START_TEST (efl_ui_box_flow_size) +{ +#define USERMIN_CHECK(a, b) \ + efl_canvas_group_calculate(layout); \ + user_min = efl_gfx_hint_size_min_get(layout); \ + ck_assert_msg(COORD_EQ(user_min.w, (a)) && COORD_EQ(user_min.h, (b)), \ + "Case box_size failed... user_min: (%d, %d) expected user_min: (%d, %d)", \ + user_min.w, user_min.h, (a), (b)); + +#define MIN_CHECK(a, b) \ + efl_canvas_group_calculate(layout); \ + min = efl_gfx_hint_size_combined_min_get(layout); \ + ck_assert_msg(COORD_EQ(min.w, (a)) && COORD_EQ(min.h, (b)), \ + "Case box_size failed... min: (%d, %d) expected min: (%d, %d)", \ + min.w, min.h, (a), (b)); + + Eo *btn, *btn2, *btn3; + Eina_Size2D min, user_min; + + btn = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)), + efl_pack_end(layout, efl_added)); + + USERMIN_CHECK(0, 0); + MIN_CHECK(100, 100); + + btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)), + efl_pack_end(layout, efl_added)); + btn3 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)), + efl_pack_end(layout, efl_added)); + USERMIN_CHECK(0, 0); + MIN_CHECK(300, 100); + + efl_pack_unpack(layout, btn2); + USERMIN_CHECK(0, 0); + MIN_CHECK(200, 100); + + efl_pack_unpack(layout, btn3); + USERMIN_CHECK(0, 0); + MIN_CHECK(100, 100); + + efl_pack_unpack(layout, btn); + USERMIN_CHECK(0, 0); + MIN_CHECK(0, 0); + + efl_pack_end(layout, btn); + efl_gfx_hint_size_min_set(layout, EINA_SIZE2D(200, 200)); + USERMIN_CHECK(200, 200); + MIN_CHECK(200, 200); + + efl_pack_end(layout, btn2); + efl_pack_end(layout, btn3); + USERMIN_CHECK(200, 200); + MIN_CHECK(300, 200); + +#undef USERMIN_ASSERT +#undef MIN_ASSERT +} +EFL_END_TEST + +void efl_ui_test_box_flow(TCase *tc) +{ + tcase_add_checked_fixture(tc, layout_setup, layout_teardown); + tcase_add_test(tc, efl_ui_box_flow_class_check); + tcase_add_test(tc, efl_ui_box_flow_layout_update); + tcase_add_test(tc, efl_ui_box_flow_layout_update_pack); + tcase_add_test(tc, efl_ui_box_flow_size); +} diff --git a/src/tests/elementary/efl_ui_test_box_stack.c b/src/tests/elementary/efl_ui_test_box_stack.c new file mode 100644 index 0000000000..dccbe1fa2c --- /dev/null +++ b/src/tests/elementary/efl_ui_test_box_stack.c @@ -0,0 +1,244 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include +#include "elm_suite.h" + +#define COORD_EQ(a, b) (!!(abs(a - b) < 2)) +#define GEOMETRY_EQ(a, b) (COORD_EQ(a.x, b.x) && COORD_EQ(a.y, b.y) && \ + COORD_EQ(a.w, b.w) && COORD_EQ(a.h, b.h)) + +typedef struct { + Eina_Size2D max; + Eina_Size2D min; + double weightx; + double weighty; + double alignx; + double aligny; + int marginl; + int marginr; + int margint; + int marginb; + Efl_Gfx_Hint_Aspect mode; + Eina_Size2D aspect; + Eina_Bool fillx; + Eina_Bool filly; + Eina_Size2D layout_size; + Eina_Size2D layout_expected; + Eina_Rect expected; + char testname[1024]; +} Hint; + +static Hint hints[] = { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(0, 0), 1, 1, 0.5, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT(0, 0, 200, 200), "[0]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT(0, 0, 200, 200), "[1]" }, + { EINA_SIZE2D(50, 150), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 150) * 0.7, 70, 150), "[2]" }, + { EINA_SIZE2D(150, -1), EINA_SIZE2D(70, 70), 0, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 70) * 0.7, 70, 70), "[3]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 70) * 0.7, 70, 70), "[4]" }, + { EINA_SIZE2D(150, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 70) * 0.7, 70, 70), "[5]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210), + EINA_RECT((200 - 70) * 0.3, 0, 70, 70 * 3), "[6]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.7, 70, 70 * 3), "[7]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210), + EINA_RECT((200 - 70) * 0.3, 0, 70, 70 * 3), "[8]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.7, 70, 70 * 3), "[9]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210), + EINA_RECT((200 - 70) * 0.3, 0, 70, 70 * 3), "[10]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.7, 70, 70 * 3), "[11]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210), + EINA_RECT((200 - 70) * 0.3, 0, 70, 70 * 3), "[12]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.7, 70, 70 * 3), "[13]" }, +}; + +static Eo *win, *layout; + +static void +btn_hint_set(Eo *btn, Hint *hint) +{ + efl_gfx_entity_size_set(layout, hint->layout_size); + efl_gfx_hint_size_max_set(btn, hint->max); + efl_gfx_hint_size_min_set(btn, hint->min); + efl_gfx_hint_margin_set(btn, hint->marginl, hint->marginr, hint->margint, + hint->marginb); + efl_gfx_hint_weight_set(btn, hint->weightx, hint->weighty); + efl_gfx_hint_align_set(btn, hint->alignx, hint->aligny); + efl_gfx_hint_fill_set(btn, hint->fillx, hint->filly); + efl_gfx_hint_aspect_set(btn, hint->mode, hint->aspect); + efl_canvas_group_calculate(layout); +} + +static void +btn_geom_assert(Hint *hint, Eina_Rect btn_geom) +{ + Eina_Size2D layout_size, layout_min; + + layout_size = efl_gfx_entity_size_get(layout); + layout_min = efl_gfx_hint_size_combined_min_get(layout); + layout_size.w = layout_size.w > layout_min.w ? layout_size.w : layout_min.w; + layout_size.h = layout_size.h > layout_min.h ? layout_size.h : layout_min.h; + + ck_assert_msg(GEOMETRY_EQ(btn_geom, hint->expected), + "Case %s failed... button geometry: (%d, %d, %d, %d) expected geometry: (%d, %d, %d, %d)", + hint->testname, btn_geom.x, btn_geom.y, btn_geom.w, btn_geom.h, + hint->expected.x, hint->expected.y, hint->expected.w, hint->expected.h); + ck_assert_msg(COORD_EQ(layout_size.w, hint->layout_expected.w) && + COORD_EQ(layout_size.h, hint->layout_expected.h), + "Case %s failed... layout size: (%d, %d) expected size: (%d, %d)", + hint->testname, layout_size.w, layout_size.h, + hint->layout_expected.w, hint->layout_expected.h); +} + +static void +layout_setup() +{ + win = win_add(); + + layout = efl_add(EFL_UI_BOX_STACK_CLASS, win, + efl_pack_align_set(efl_added, 0.8, 0.2), + efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL)); +} + +static void +layout_teardown() +{ + if (win) + { + efl_del(win); + win = NULL; + } +} + +EFL_START_TEST (efl_ui_box_stack_class_check) +{ + const char *class; + + class = efl_class_name_get(layout); + + ck_assert(class != NULL); + ck_assert(!strcmp(class, "Efl.Ui.Box_Stack")); +} +EFL_END_TEST + +EFL_START_TEST (efl_ui_box_stack_layout_update) +{ + int i, max_index = (sizeof(hints) / sizeof(Hint)); + + Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_pack_end(layout, efl_added)); + + for (i = 0; i < max_index; i++) + { + btn_hint_set(btn, &hints[i]); + btn_geom_assert(&hints[i], efl_gfx_entity_geometry_get(btn)); + } +} +EFL_END_TEST + +EFL_START_TEST (efl_ui_box_stack_size) +{ +#define USERMIN_CHECK(a, b) \ + efl_canvas_group_calculate(layout); \ + user_min = efl_gfx_hint_size_min_get(layout); \ + ck_assert_msg(COORD_EQ(user_min.w, (a)) && COORD_EQ(user_min.h, (b)), \ + "Case box_size failed... user_min: (%d, %d) expected user_min: (%d, %d)", \ + user_min.w, user_min.h, (a), (b)); + +#define MIN_CHECK(a, b) \ + efl_canvas_group_calculate(layout); \ + min = efl_gfx_hint_size_combined_min_get(layout); \ + ck_assert_msg(COORD_EQ(min.w, (a)) && COORD_EQ(min.h, (b)), \ + "Case box_size failed... min: (%d, %d) expected min: (%d, %d)", \ + min.w, min.h, (a), (b)); + + Eo *btn, *btn2, *btn3; + Eina_Size2D min, user_min; + + btn = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)), + efl_pack_end(layout, efl_added)); + + USERMIN_CHECK(0, 0); + MIN_CHECK(100, 100); + + btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(300, 300)), + efl_pack_end(layout, efl_added)); + btn3 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(200, 200)), + efl_pack_end(layout, efl_added)); + USERMIN_CHECK(0, 0); + MIN_CHECK(300, 300); + + efl_pack_unpack(layout, btn2); + USERMIN_CHECK(0, 0); + MIN_CHECK(200, 200); + + efl_pack_unpack(layout, btn3); + USERMIN_CHECK(0, 0); + MIN_CHECK(100, 100); + + efl_pack_unpack(layout, btn); + USERMIN_CHECK(0, 0); + MIN_CHECK(0, 0); + + efl_pack_end(layout, btn); + efl_gfx_hint_size_min_set(layout, EINA_SIZE2D(200, 200)); + USERMIN_CHECK(200, 200); + MIN_CHECK(200, 200); + + efl_pack_end(layout, btn2); + efl_pack_end(layout, btn3); + USERMIN_CHECK(200, 200); + MIN_CHECK(300, 300); + +#undef USERMIN_ASSERT +#undef MIN_ASSERT +} +EFL_END_TEST + +void efl_ui_test_box_stack(TCase *tc) +{ + tcase_add_checked_fixture(tc, layout_setup, layout_teardown); + tcase_add_test(tc, efl_ui_box_stack_class_check); + tcase_add_test(tc, efl_ui_box_stack_layout_update); + tcase_add_test(tc, efl_ui_box_stack_size); +} diff --git a/src/tests/elementary/efl_ui_test_callback.c b/src/tests/elementary/efl_ui_test_callback.c new file mode 100644 index 0000000000..35f625455f --- /dev/null +++ b/src/tests/elementary/efl_ui_test_callback.c @@ -0,0 +1,45 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include +#include +#include "elm_suite.h" + +static Eo *win; + +static void +callback_setup() +{ + win = win_add(); + + efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 50)); +} + +static void +_btn_visibility_change(void *data EINA_UNUSED, const Efl_Event *ev) +{ + Eina_Bool *flag = data; + Eina_Bool *visible = ev->info; + + if (!(*visible)) + *flag = EINA_TRUE; +} + +EFL_START_TEST(efl_ui_callback_visibility) +{ + Eina_Bool check = EINA_FALSE; + Eo *box = efl_add(EFL_UI_BOX_CLASS, win, + efl_content_set(win, efl_added)); + efl_event_callback_add(box, EFL_GFX_ENTITY_EVENT_VISIBILITY_CHANGED, _btn_visibility_change, &check); + efl_gfx_entity_visible_set(box, EINA_FALSE); + + ck_assert_int_eq(check, EINA_TRUE); +} +EFL_END_TEST + +void efl_ui_test_callback(TCase *tc) +{ + tcase_add_checked_fixture(tc, callback_setup, NULL); + tcase_add_test(tc, efl_ui_callback_visibility); +} diff --git a/src/tests/elementary/elm_test_focus.c b/src/tests/elementary/efl_ui_test_focus.c similarity index 88% rename from src/tests/elementary/elm_test_focus.c rename to src/tests/elementary/efl_ui_test_focus.c index e9bc5a97c9..16fce9fb05 100644 --- a/src/tests/elementary/elm_test_focus.c +++ b/src/tests/elementary/efl_ui_test_focus.c @@ -1,4 +1,4 @@ -#include "elm_test_focus_common.h" +#include "efl_ui_test_focus_common.h" EFL_START_TEST(focus_unregister_twice) { @@ -24,8 +24,8 @@ EFL_END_TEST EFL_START_TEST(focus_register_twice) { - 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_Object *r1 = focus_test_object_new("r1", 0, 0, 10, 10); + Efl_Ui_Focus_Object *r2 = focus_test_object_new("r2", 0, 10, 10, 10); Efl_Ui_Focus_Manager *m = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL, efl_ui_focus_manager_root_set(efl_added, r1) @@ -48,9 +48,9 @@ EFL_START_TEST(pos_check) Efl_Ui_Focus_Manager *m; Efl_Ui_Focus_Object *middle, *east, *west, *north, *south, *root; - elm_focus_test_setup_cross(&middle, &south, &north, &east, &west); + focus_test_setup_cross(&middle, &south, &north, &east, &west); - m = elm_focus_test_manager_new(&root); + m = focus_test_manager_new(&root); efl_ui_focus_manager_calc_register(m, middle, root, NULL); efl_ui_focus_manager_calc_register(m, north, root, NULL); efl_ui_focus_manager_calc_register(m, south, root, NULL); @@ -115,14 +115,14 @@ EFL_START_TEST(pos_check2) Efl_Ui_Focus_Relations *rel; Efl_Ui_Focus_Object *root, *middle, *north_east, *north_west, *south_east, *south_west; - middle = elm_focus_test_object_new("middle", 40, 40, 5, 5); + middle = focus_test_object_new("middle", 40, 40, 5, 5); - north_east = elm_focus_test_object_new("north_east", 60, 20, 5, 5); - north_west = elm_focus_test_object_new("north_west", 20, 20, 5, 5); - south_east = elm_focus_test_object_new("south_east", 60, 60, 5, 5); - south_west = elm_focus_test_object_new("south_west", 20, 60, 5, 5); + north_east = focus_test_object_new("north_east", 60, 20, 5, 5); + north_west = focus_test_object_new("north_west", 20, 20, 5, 5); + south_east = focus_test_object_new("south_east", 60, 60, 5, 5); + south_west = focus_test_object_new("south_west", 20, 60, 5, 5); - m = elm_focus_test_manager_new(&root); + m = focus_test_manager_new(&root); efl_ui_focus_manager_calc_register(m, middle, root, NULL); efl_ui_focus_manager_calc_register(m, north_east, root, NULL); efl_ui_focus_manager_calc_register(m, north_west, root, NULL); @@ -144,6 +144,8 @@ EFL_START_TEST(pos_check2) #undef ck_assert_set_eq + efl_ui_focus_relation_free(rel); + efl_unref(middle); efl_unref(north_east); efl_unref(north_west); @@ -188,9 +190,9 @@ EFL_START_TEST(border_check) Eina_Iterator *iter; Efl_Ui_Focus_Object *obj; - elm_focus_test_setup_cross(&middle, &south, &north, &east, &west); + focus_test_setup_cross(&middle, &south, &north, &east, &west); - m = elm_focus_test_manager_new(&root); + m = focus_test_manager_new(&root); efl_ui_focus_manager_calc_register(m, middle, root, NULL); efl_ui_focus_manager_calc_register(m, south, root, NULL); efl_ui_focus_manager_calc_register(m, north, root, NULL); @@ -224,7 +226,7 @@ EFL_START_TEST(logical_chain) TEST_OBJ_NEW(root, 0, 0, 20, 20); - m = elm_focus_test_manager_new(&lroot); + m = focus_test_manager_new(&lroot); fail_if(!m); @@ -295,7 +297,7 @@ _check_chain(Efl_Ui_Focus_Manager *m, Efl_Ui_Focus_Object *objects[]) 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)); + next = efl_ui_focus_manager_focus_get(efl_ui_focus_util_active_manager(m)); ck_assert_ptr_eq(next, objects[i]); } @@ -315,7 +317,7 @@ _check_chain(Efl_Ui_Focus_Manager *m, Efl_Ui_Focus_Object *objects[]) 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)); + prev = efl_ui_focus_manager_focus_get(efl_ui_focus_util_active_manager(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); @@ -326,19 +328,19 @@ 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); + m = focus_test_manager_new(&root); + m2 = focus_test_manager_new(&root2); + m3 = focus_test_manager_new(&root3); + m4 = focus_test_manager_new(&root4); + c1_1 = focus_test_object_new("child1", 0, 0, 20, 20); + c1_2 = focus_test_object_new("child2", 0, 0, 20, 20); + c1_3 = 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); + c2 = focus_test_object_new("child1", 0, 0, 20, 20); + c3 = focus_test_object_new("child2", 0, 0, 20, 20); + c4 = focus_test_object_new("child3", 0, 0, 20, 20); Efl_Ui_Focus_Object *objects[] = {c2, c3, c4, NULL}; @@ -362,15 +364,15 @@ 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); + m = focus_test_manager_new(&root); + m2 = focus_test_manager_new(&root2); + c1_1 = focus_test_object_new("child1", 0, 0, 20, 20); + c1_2 = 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); + c1_3 = focus_test_object_new("child3", 0, 0, 20, 20); + c2_1 = focus_test_object_new("child1", 0, 0, 20, 20); + c2_2 = focus_test_object_new("child2", 0, 0, 20, 20); + c2_3 = 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}; @@ -699,7 +701,7 @@ EFL_START_TEST(test_request_subchild_empty) Efl_Ui_Focus_Manager *m; Efl_Ui_Focus_Object *root; - m = elm_focus_test_manager_new(&root); + m = focus_test_manager_new(&root); ck_assert_ptr_eq(efl_ui_focus_manager_request_subchild(m, root), NULL); @@ -712,8 +714,8 @@ 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); + m = focus_test_manager_new(&root); + c1 = 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); @@ -728,9 +730,9 @@ 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); + m = focus_test_manager_new(&root); + c1 = focus_test_object_new("child1", 0, 0, 20, 20); + c2 = 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); @@ -747,9 +749,9 @@ 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); + m = focus_test_manager_new(&root); + c1 = focus_test_object_new("child1", 0, 0, 20, 20); + c2 = 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); @@ -766,9 +768,9 @@ 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); + m = focus_test_manager_new(&root); + c1 = focus_test_object_new("child1", 0, 0, 20, 20); + c2 = 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); @@ -785,10 +787,10 @@ 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); + m = focus_test_manager_new(&root); + c1 = focus_test_object_new("child1", 0, 0, 20, 20); + c2 = focus_test_object_new("child2", 0, 0, 20, 20); + c3 = 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); @@ -808,10 +810,10 @@ 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); + m = focus_test_manager_new(&root); + c1 = focus_test_object_new("child1", 0, 0, 20, 20); + c2 = focus_test_object_new("child2", 0, 0, 20, 20); + c3 = 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); @@ -833,8 +835,8 @@ 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); + m = focus_test_manager_new(&root); + c1 = 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); @@ -851,10 +853,10 @@ 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); + m = focus_test_manager_new(&root); + c1 = focus_test_object_new("child1", 0, 0, 20, 20); + c2 = focus_test_object_new("child2", 0, 0, 20, 20); + c3 = 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); @@ -900,13 +902,13 @@ 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); + m = focus_test_manager_new(&root); + c1 = focus_test_object_new("child1", 0, 0, 20, 20); + c2 = focus_test_object_new("child2", 0, 0, 20, 20); + c3 = focus_test_object_new("child3", 0, 0, 20, 20); + c4 = focus_test_object_new("child4", 0, 0, 20, 20); + c5 = focus_test_object_new("child5", 0, 0, 20, 20); + c6 = 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); @@ -983,18 +985,18 @@ EFL_START_TEST(test_events_child_focus) Eina_Bool froot = EINA_FALSE, fc1 = EINA_FALSE, fc2 = EINA_FALSE, fc3 = EINA_FALSE, fc4 = EINA_FALSE, fc5 = EINA_FALSE, fc6 = EINA_FALSE; - m = elm_focus_test_manager_new(&root); - c1 = elm_focus_test_object_new("child1", 0, 0, 20, 20); + m = focus_test_manager_new(&root); + c1 = focus_test_object_new("child1", 0, 0, 20, 20); efl_parent_set(c1, root); - c2 = elm_focus_test_object_new("child2", 0, 0, 20, 20); + c2 = focus_test_object_new("child2", 0, 0, 20, 20); efl_parent_set(c2, root); - c3 = elm_focus_test_object_new("child3", 0, 0, 20, 20); + c3 = focus_test_object_new("child3", 0, 0, 20, 20); efl_parent_set(c3, c2); - c4 = elm_focus_test_object_new("child4", 0, 0, 20, 20); + c4 = focus_test_object_new("child4", 0, 0, 20, 20); efl_parent_set(c4, c2); - c5 = elm_focus_test_object_new("child5", 0, 0, 20, 20); + c5 = focus_test_object_new("child5", 0, 0, 20, 20); efl_parent_set(c5, root); - c6 = elm_focus_test_object_new("child6", 0, 0, 20, 20); + c6 = focus_test_object_new("child6", 0, 0, 20, 20); efl_parent_set(c6, c5); efl_ui_focus_manager_calc_register(m, c1, root, NULL); @@ -1083,9 +1085,9 @@ EFL_START_TEST(viewport_check) Eina_Iterator *iter; Efl_Ui_Focus_Object *obj; - elm_focus_test_setup_cross(&middle, &south, &north, &east, &west); + focus_test_setup_cross(&middle, &south, &north, &east, &west); - m = elm_focus_test_manager_new(&root); + m = focus_test_manager_new(&root); efl_ui_focus_manager_calc_register(m, middle, root, NULL); efl_ui_focus_manager_calc_register(m, south, root, NULL); efl_ui_focus_manager_calc_register(m, north, root, NULL); @@ -1106,7 +1108,7 @@ EFL_START_TEST(viewport_check) } EFL_END_TEST -void elm_test_focus(TCase *tc) +void efl_ui_test_focus(TCase *tc) { tcase_add_test(tc, focus_register_twice); tcase_add_test(tc, focus_unregister_twice); diff --git a/src/tests/elementary/elm_test_focus_common.c b/src/tests/elementary/efl_ui_test_focus_common.c similarity index 79% rename from src/tests/elementary/elm_test_focus_common.c rename to src/tests/elementary/efl_ui_test_focus_common.c index 63ee2dc454..c025d2833f 100644 --- a/src/tests/elementary/elm_test_focus_common.c +++ b/src/tests/elementary/efl_ui_test_focus_common.c @@ -1,6 +1,6 @@ #define EFL_UI_FOCUS_OBJECT_PROTECTED -#include "elm_test_focus_common.h" +#include "efl_ui_test_focus_common.h" #define Q(o,_x,_y,_w,_h) \ do {\ @@ -13,7 +13,7 @@ } while (0) Efl_Ui_Focus_Object* -elm_focus_test_object_new(const char *name, int x, int y, int w, int h) +focus_test_object_new(const char *name, int x, int y, int w, int h) { Efl_Ui_Focus_Object *ret; @@ -26,28 +26,28 @@ elm_focus_test_object_new(const char *name, int x, int y, int w, int h) } void -elm_focus_test_setup_cross(Efl_Ui_Focus_Object **middle, +focus_test_setup_cross(Efl_Ui_Focus_Object **middle, Efl_Ui_Focus_Object **south, Efl_Ui_Focus_Object **north, Efl_Ui_Focus_Object **east, Efl_Ui_Focus_Object **west) { - *middle = elm_focus_test_object_new("middle", 40, 40, 20, 20); - *south = elm_focus_test_object_new("south", 40, 80, 20, 20); - *north = elm_focus_test_object_new("north", 40, 0, 20, 20); - *east = elm_focus_test_object_new("east", 80, 40, 20, 20); - *west = elm_focus_test_object_new("west", 0, 40, 20, 20); + *middle = focus_test_object_new("middle", 40, 40, 20, 20); + *south = focus_test_object_new("south", 40, 80, 20, 20); + *north = focus_test_object_new("north", 40, 0, 20, 20); + *east = focus_test_object_new("east", 80, 40, 20, 20); + *west = focus_test_object_new("west", 0, 40, 20, 20); } Efl_Ui_Focus_Manager* -elm_focus_test_manager_new(Efl_Ui_Focus_Object **middle) +focus_test_manager_new(Efl_Ui_Focus_Object **middle) { Efl_Ui_Focus_Object *root; Efl_Ui_Focus_Manager *m; - root = elm_focus_test_object_new("middle", 40, 40, 20, 20); + root = focus_test_object_new("middle", 40, 40, 20, 20); m = efl_add_ref(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL, efl_ui_focus_manager_root_set(efl_added, root) ); diff --git a/src/tests/elementary/elm_test_focus_common.h b/src/tests/elementary/efl_ui_test_focus_common.h similarity index 58% rename from src/tests/elementary/elm_test_focus_common.h rename to src/tests/elementary/efl_ui_test_focus_common.h index 3e93bbfeed..fc17edbb94 100644 --- a/src/tests/elementary/elm_test_focus_common.h +++ b/src/tests/elementary/efl_ui_test_focus_common.h @@ -1,29 +1,28 @@ #ifndef ELM_TEST_FOCUS_COMMON_H #define ELM_TEST_FOCUS_COMMON_H - +#define EFL_NOLEGACY_API_SUPPORT #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif #define EFL_ACCESS_OBJECT_PROTECTED -#include -#include "elm_suite.h" -#include "elm_widget.h" +#include +#include "efl_ui_suite.h" #include "focus_test.eo.h" #define TEST_OBJ_NEW(name, x, y, w, h) \ Efl_Ui_Focus_Object* name; \ - name = elm_focus_test_object_new("" #name "",x, y, w, h); \ + name = focus_test_object_new("" #name "",x, y, w, h); \ -Efl_Ui_Focus_Object* elm_focus_test_object_new(const char *name, int x, int y, int w, int h); +Efl_Ui_Focus_Object* focus_test_object_new(const char *name, int x, int y, int w, int h); -void elm_focus_test_setup_cross(Efl_Ui_Focus_Object **middle, +void focus_test_setup_cross(Efl_Ui_Focus_Object **middle, Efl_Ui_Focus_Object **south, Efl_Ui_Focus_Object **north, Efl_Ui_Focus_Object **east, Efl_Ui_Focus_Object **west); -Efl_Ui_Focus_Manager *elm_focus_test_manager_new(Efl_Ui_Focus_Object **middle); +Efl_Ui_Focus_Manager *focus_test_manager_new(Efl_Ui_Focus_Object **middle); #endif diff --git a/src/tests/elementary/elm_test_focus_sub.c b/src/tests/elementary/efl_ui_test_focus_sub.c similarity index 98% rename from src/tests/elementary/elm_test_focus_sub.c rename to src/tests/elementary/efl_ui_test_focus_sub.c index 3c0d994aeb..b026307e3a 100644 --- a/src/tests/elementary/elm_test_focus_sub.c +++ b/src/tests/elementary/efl_ui_test_focus_sub.c @@ -1,4 +1,4 @@ -#include "elm_test_focus_common.h" +#include "efl_ui_test_focus_common.h" #include "focus_test_sub_main.eo.h" typedef struct { @@ -100,14 +100,14 @@ _setup(Efl_Ui_Focus_Manager **m, Efl_Ui_Focus_Manager_Sub **sub, Efl_Ui_Focus_Ob ); efl_event_callback_forwarder_add(subm, EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, focus_main); efl_event_callback_forwarder_add(subm, EFL_UI_FOCUS_MANAGER_EVENT_REDIRECT_CHANGED, focus_main); - efl_event_callback_forwarder_add(subm, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED , focus_main); + efl_event_callback_forwarder_add(subm, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED , focus_main); efl_event_callback_forwarder_add(subm, EFL_UI_FOCUS_MANAGER_EVENT_COORDS_DIRTY, focus_main); efl_event_callback_forwarder_add(subm, EFL_UI_FOCUS_MANAGER_EVENT_DIRTY_LOGIC_FREEZE_CHANGED, focus_main); efl_composite_attach(focus_main, subm); - efl_event_callback_call(focus_main, EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, NULL); + efl_event_callback_call(focus_main, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_MANAGER_CHANGED, NULL); efl_ui_focus_manager_calc_register_logical(manager, focus_main, root_manager, subm); @@ -231,7 +231,7 @@ EFL_START_TEST(correct_un_register) } EFL_END_TEST -void elm_test_focus_sub(TCase *tc) +void efl_ui_test_focus_sub(TCase *tc) { tcase_add_test(tc, correct_register); tcase_add_test(tc, correct_unregister); diff --git a/src/tests/elementary/efl_ui_test_grid.c b/src/tests/elementary/efl_ui_test_grid.c index 5fbadf90ed..07b8cd0aca 100644 --- a/src/tests/elementary/efl_ui_test_grid.c +++ b/src/tests/elementary/efl_ui_test_grid.c @@ -3,34 +3,24 @@ #endif #define EFL_ACCESS_OBJECT_BETA +#include #include -#include "elm_suite.h" +#include "efl_ui_suite.h" -static Eo *win, *box; +static Eo *win; static Efl_Ui_Grid *grid; static void grid_setup() { - //win = win_add(); - 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.Grid"), - efl_ui_win_autodel_set(efl_added, EINA_TRUE)); - box = efl_add(EFL_UI_BOX_CLASS, win, - efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL)); - efl_gfx_size_hint_weight_set(box, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); - efl_gfx_size_hint_fill_set(box, EINA_TRUE, EINA_TRUE); - elm_win_resize_object_add(win, box); + win = win_add(); - grid = efl_add(EFL_UI_GRID_CLASS, box); + grid = efl_add(EFL_UI_GRID_CLASS, win); efl_ui_grid_item_size_set(grid, EINA_SIZE2D(100, 100)); - efl_pack_padding_set(grid, 5.0, 5.0, EINA_TRUE); - efl_pack_align_set(grid, 0.5, 0.5); - efl_pack_end(box, grid); - - efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 500)); + efl_gfx_entity_size_set(grid, EINA_SIZE2D(500, 50)); + efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 50)); + efl_gfx_entity_visible_set(win, EINA_TRUE); } static void @@ -63,7 +53,7 @@ grid_item_pack(Eo *grid, int count, Eina_List **l) return EINA_TRUE; } -EFL_START_TEST (efl_ui_grid_class_check) +EFL_START_TEST(efl_ui_grid_class_check) { const char *class; @@ -74,7 +64,7 @@ EFL_START_TEST (efl_ui_grid_class_check) } EFL_END_TEST -EFL_START_TEST (efl_ui_grid_pack) +EFL_START_TEST(efl_ui_grid_pack) { Efl_Ui_Grid_Item *item; int count; @@ -88,7 +78,7 @@ EFL_START_TEST (efl_ui_grid_pack) } EFL_END_TEST -EFL_START_TEST (efl_ui_grid_unpack) +EFL_START_TEST(efl_ui_grid_unpack) { Efl_Ui_Grid_Item *item; int count; @@ -105,7 +95,7 @@ EFL_START_TEST (efl_ui_grid_unpack) } EFL_END_TEST -EFL_START_TEST (efl_ui_grid_unpack_all) +EFL_START_TEST(efl_ui_grid_unpack_all) { Efl_Ui_Grid_Item *item; int count_before = 10; @@ -127,7 +117,7 @@ EFL_START_TEST (efl_ui_grid_unpack_all) } EFL_END_TEST -EFL_START_TEST (efl_ui_grid_pack_clear) +EFL_START_TEST(efl_ui_grid_pack_clear) { int count_before = 10; int count; @@ -142,7 +132,7 @@ EFL_START_TEST (efl_ui_grid_pack_clear) EFL_END_TEST -EFL_START_TEST (efl_ui_grid_pack_end) +EFL_START_TEST(efl_ui_grid_pack_end) { Efl_Ui_Grid_Item *item, *compare; int count_before = 10; @@ -163,7 +153,7 @@ EFL_START_TEST (efl_ui_grid_pack_end) } EFL_END_TEST -EFL_START_TEST (efl_ui_grid_pack_begin) +EFL_START_TEST(efl_ui_grid_pack_begin) { Efl_Ui_Grid_Item *item, *compare; int count_before = 10; @@ -184,7 +174,7 @@ EFL_START_TEST (efl_ui_grid_pack_begin) } EFL_END_TEST -EFL_START_TEST (efl_ui_grid_pack_after) +EFL_START_TEST(efl_ui_grid_pack_after) { Efl_Ui_Grid_Item *item, *after, *compare; int count_before = 10; @@ -209,7 +199,7 @@ EFL_START_TEST (efl_ui_grid_pack_after) } EFL_END_TEST -EFL_START_TEST (efl_ui_grid_pack_before) +EFL_START_TEST(efl_ui_grid_pack_before) { Efl_Ui_Grid_Item *item, *before, *compare; int count_before = 10; @@ -234,7 +224,7 @@ EFL_START_TEST (efl_ui_grid_pack_before) } EFL_END_TEST -EFL_START_TEST (efl_ui_grid_content_count) +EFL_START_TEST(efl_ui_grid_content_count) { int count = 10, compare; @@ -246,7 +236,7 @@ EFL_START_TEST (efl_ui_grid_content_count) } EFL_END_TEST -EFL_START_TEST (efl_ui_grid_content_iterate) +EFL_START_TEST(efl_ui_grid_content_iterate) { int count = 10; Efl_Ui_Grid_Item *item; @@ -299,7 +289,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(grid_scroll_callbacks, { EFL_UI_EVENT_SCROLL_START, grid_scroll_start_cb }, { EFL_UI_EVENT_SCROLL_STOP, grid_scroll_stop_cb }); -EFL_START_TEST (efl_ui_grid_scroll) +EFL_START_TEST(efl_ui_grid_scroll) { Efl_Ui_Grid_Item *item; Efl_Loop_Timer *timer; @@ -308,7 +298,7 @@ EFL_START_TEST (efl_ui_grid_scroll) item = efl_pack_content_get(grid, 50); timer = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(), - efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, grid_timer_cb, NULL), + efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, grid_timer_cb, NULL), efl_loop_timer_loop_reset(efl_added), efl_loop_timer_interval_set(efl_added, 3.0)); diff --git a/src/tests/elementary/efl_ui_test_image.c b/src/tests/elementary/efl_ui_test_image.c new file mode 100644 index 0000000000..244f1047e4 --- /dev/null +++ b/src/tests/elementary/efl_ui_test_image.c @@ -0,0 +1,36 @@ +#define EFL_NOLEGACY_API_SUPPORT +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include +#include "efl_ui_suite.h" + + +EFL_START_TEST(efl_ui_image_test_icon) +{ + Eo *win, *image; + Eina_Bool ok; + const char *icon_name; + + win = win_add(NULL, "image", EFL_UI_WIN_TYPE_BASIC); + + image = efl_add(EFL_UI_IMAGE_CLASS, win); + efl_gfx_entity_visible_set(image, EINA_TRUE); + + ok = efl_ui_image_icon_set(image, "folder"); + ck_assert(ok); + icon_name = efl_ui_image_icon_get(image); + ck_assert_str_eq(icon_name, "folder"); + + ok = efl_ui_image_icon_set(image, "None"); + ck_assert(ok == 0); + icon_name = efl_ui_image_icon_get(image); + ck_assert(icon_name == NULL); +} +EFL_END_TEST + +void efl_ui_test_image(TCase *tc) +{ + tcase_add_test(tc, efl_ui_image_test_icon); +} diff --git a/src/tests/elementary/efl_ui_test_image_zoomable.c b/src/tests/elementary/efl_ui_test_image_zoomable.c new file mode 100644 index 0000000000..d9d9e1032c --- /dev/null +++ b/src/tests/elementary/efl_ui_test_image_zoomable.c @@ -0,0 +1,37 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif +#define EFL_NOLEGACY_API_SUPPORT + +#include +#include "efl_ui_suite.h" + + +EFL_START_TEST(efl_ui_test_image_zoomable_icon) +{ + Evas_Object *win, *img_zoomable; + Eina_Bool ok; + const char *icon_name; + + win = win_add(NULL, "photocam", EFL_UI_WIN_TYPE_BASIC); + + img_zoomable = efl_add(EFL_UI_IMAGE_ZOOMABLE_CLASS, win); + efl_gfx_entity_visible_set(img_zoomable, EINA_TRUE); + + ok = efl_ui_image_icon_set(img_zoomable, "folder"); + ck_assert(ok); + icon_name = efl_ui_image_icon_get(img_zoomable); + ck_assert_str_eq(icon_name, "folder"); + + ok = efl_ui_image_icon_set(img_zoomable, "None"); + ck_assert(ok == 0); + icon_name = efl_ui_image_icon_get(img_zoomable); + ck_assert(icon_name == NULL); + +} +EFL_END_TEST + +void efl_ui_test_image_zoomable(TCase *tc) +{ + tcase_add_test(tc, efl_ui_test_image_zoomable_icon); +} diff --git a/src/tests/elementary/efl_ui_test_layout.c b/src/tests/elementary/efl_ui_test_layout.c new file mode 100644 index 0000000000..8f52408cc4 --- /dev/null +++ b/src/tests/elementary/efl_ui_test_layout.c @@ -0,0 +1,116 @@ +#define EFL_NOLEGACY_API_SUPPORT +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif +#define EFL_LAYOUT_CALC_PROTECTED +#include +#include "efl_ui_suite.h" + +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; +} + +EFL_START_TEST(efl_ui_layout_test_property_bind) +{ + char buf[PATH_MAX]; + Evas_Object *win, *ly; + Efl_Generic_Model *model; + Eina_Value v; + Eina_Future *f; + const char *part_text; + const char text_value[] = "A random string for elm_layout_property_bind test"; + + win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC); + + ly = efl_add(EFL_UI_LAYOUT_CLASS, win); + snprintf(buf, sizeof(buf), "%s/objects/test.edj", ELM_TEST_DATA_DIR); + efl_file_simple_load(ly, buf, "layout"); + efl_gfx_entity_visible_set(ly, EINA_TRUE); + + model = efl_add(EFL_GENERIC_MODEL_CLASS, win); + ck_assert(!!eina_value_setup(&v, EINA_VALUE_TYPE_STRING)); + ck_assert(!!eina_value_set(&v, text_value)); + f = efl_model_property_set(model, "text_property", &v); + eina_future_then(f, _propagated_cb, NULL, NULL); + + efl_ui_property_bind(ly, "text", "text_property"); + efl_ui_view_model_set(ly, model); + + ecore_main_loop_begin(); + + part_text = efl_text_get(efl_part(ly, "text")); + + ck_assert_str_eq(part_text, text_value); + +} +EFL_END_TEST + +EFL_START_TEST(efl_ui_layout_test_layout_api_size_min) +{ + Evas_Object *win; + Eina_Size2D res; + + win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC); + /* this is just a test to not get segfaults in those calls */ + Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win); + res = efl_layout_calc_size_min(layout, EINA_SIZE2D(2, 2)); + ck_assert_int_eq(res.w, 2); + ck_assert_int_eq(res.h, 2); +} +EFL_END_TEST + +EFL_START_TEST(efl_ui_layout_test_layout_api_update_hints) +{ + Evas_Object *win; + + win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC); + /* this is just a test to not get segfaults in those calls */ + Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win); + efl_layout_calc_auto_update_hints_set(layout, EINA_TRUE); + ck_assert_int_eq(efl_layout_calc_auto_update_hints_get(layout), EINA_TRUE); +} +EFL_END_TEST + +EFL_START_TEST(efl_ui_layout_test_layout_force) +{ + Evas_Object *win; + + win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC); + /* this is just a test to not get segfaults in those calls */ + Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win); + efl_layout_calc_force(layout); +} +EFL_END_TEST + +EFL_START_TEST(efl_ui_layout_test_layout_theme) +{ + Evas_Object *win; + const char *klass, *group, *style; + + win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC); + Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win, + efl_ui_layout_theme_set(efl_added, "win", "background", NULL) + ); + efl_ui_layout_theme_get(layout, &klass, &group, &style); + ck_assert_str_eq(klass, "win"); + ck_assert_str_eq(group, "background"); + ck_assert(!style); +} +EFL_END_TEST + +void efl_ui_test_layout(TCase *tc) +{ + tcase_add_test(tc, efl_ui_layout_test_property_bind); + tcase_add_test(tc, efl_ui_layout_test_layout_api_size_min); + tcase_add_test(tc, efl_ui_layout_test_layout_api_update_hints); + tcase_add_test(tc, efl_ui_layout_test_layout_force); + tcase_add_test(tc, efl_ui_layout_test_layout_theme); +} diff --git a/src/tests/elementary/efl_ui_test_relative_layout.c b/src/tests/elementary/efl_ui_test_relative_layout.c new file mode 100644 index 0000000000..f769bf47ec --- /dev/null +++ b/src/tests/elementary/efl_ui_test_relative_layout.c @@ -0,0 +1,301 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include +#include +#include "elm_suite.h" + +#define COORD_EQ(a, b) (!!(abs(a - b) < 2)) +#define GEOMETRY_EQ(a, b) (COORD_EQ(a.x, b.x) && COORD_EQ(a.y, b.y) && \ + COORD_EQ(a.w, b.w) && COORD_EQ(a.h, b.h)) + +typedef struct { + Eina_Size2D max; + Eina_Size2D min; + double weightx; + double weighty; + double alignx; + double aligny; + int marginl; + int marginr; + int margint; + int marginb; + Efl_Gfx_Hint_Aspect mode; + Eina_Size2D aspect; + Eina_Bool fillx; + Eina_Bool filly; + Eina_Size2D layout_size; + Eina_Size2D layout_expected; + Eina_Rect expected; + char testname[1024]; +} Hint; + +static Hint hints[] = { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(0, 0), 1, 1, 0.5, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT(0, 0, 200, 200), "[0]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT(0, 0, 200, 200), "[1]" }, + { EINA_SIZE2D(50, 150), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 150) * 0.7, 70, 150), "[2]" }, + { EINA_SIZE2D(150, -1), EINA_SIZE2D(70, 70), 0, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 70) * 0.7, 70, 70), "[3]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 70) * 0.7, 70, 70), "[4]" }, + { EINA_SIZE2D(150, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 70) * 0.7, 70, 70), "[5]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, -7, 70, 70 * 3), "[6]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.7, 70, 70 * 3), "[7]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, -7, 70, 70 * 3), "[8]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.7, 70, 70 * 3), "[9]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, -7, 70, 70 * 3), "[10]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.7, 70, 70 * 3), "[11]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, -7, 70, 70 * 3), "[12]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.7, 70, 70 * 3), "[13]" }, +}; + +static Hint hints2[][2] = { + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.3, (150 - 70) * 0.7, 70, 70), "[1/1 weight btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.8, (150 - 70) * 0.2 + 150, 70, 70), "[1/1 weight btn2]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.3, 0, 70, 70), "[0/1 weight btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.8, (300 - 140) * 0.2 + 70, 70, 70), "[0/1 weight btn2]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.3, (300 - 140) * 0.7, 70, 70), "[0/0 weight btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.8, (300 - 140) * 0.7 + 70, 70, 70), "[0/0 weight btn2]" } + }, +}; + +static Hint hints3[][3] = { + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT(0, 0, 150, 100), "[1/1/1 weight_l btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 100), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT(0, 100, 150, 100), "[1/1/1 weight_l btn2]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT(0, 100 + 100, 150, 100), "[1/1/1 weight_l btn2]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 270), EINA_SIZE2D(150, 270), + EINA_RECT(0, 0, 150, 85), "[1/1/1 weight_m btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 100), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 270), EINA_SIZE2D(150, 270), + EINA_RECT(0, 85, 150, 100), "[1/1/1 weight_m btn2]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 270), EINA_SIZE2D(150, 270), + EINA_RECT(0, 100 + 85, 150, 85), "[1/1/1 weight_m btn2]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 200), EINA_SIZE2D(150, 200), + EINA_RECT(0, -28, 150, 70), "[1/1/1 weight_s btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 100), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 200), EINA_SIZE2D(150, 200), + EINA_RECT(0, 42, 150, 100), "[1/1/1 weight_s btn2]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 200), EINA_SIZE2D(150, 200), + EINA_RECT(0, 142, 150, 70), "[1/1/1 weight_s btn2]" } + }, +}; + +static Eo *win, *layout; + +static void +btn_hint_set(Eo *btn, Hint *hint) +{ + efl_gfx_entity_size_set(layout, hint->layout_size); + efl_gfx_hint_size_max_set(btn, hint->max); + efl_gfx_hint_size_min_set(btn, hint->min); + efl_gfx_hint_margin_set(btn, hint->marginl, hint->marginr, hint->margint, + hint->marginb); + efl_gfx_hint_weight_set(btn, hint->weightx, hint->weighty); + efl_gfx_hint_align_set(btn, hint->alignx, hint->aligny); + efl_gfx_hint_fill_set(btn, hint->fillx, hint->filly); + efl_gfx_hint_aspect_set(btn, hint->mode, hint->aspect); + efl_canvas_group_calculate(layout); +} + +static void +btn_geom_assert(Hint *hint, Eina_Rect btn_geom) +{ + Eina_Size2D layout_size, layout_min; + + layout_size = efl_gfx_entity_size_get(layout); + layout_min = efl_gfx_hint_size_min_get(layout); + layout_size.w = layout_size.w > layout_min.w ? layout_size.w : layout_min.w; + layout_size.h = layout_size.h > layout_min.h ? layout_size.h : layout_min.h; + + ck_assert_msg(GEOMETRY_EQ(btn_geom, hint->expected), + "Case %s failed... button geometry: (%d, %d, %d, %d) expected geometry: (%d, %d, %d, %d)", + hint->testname, btn_geom.x, btn_geom.y, btn_geom.w, btn_geom.h, + hint->expected.x, hint->expected.y, hint->expected.w, hint->expected.h); + ck_assert_msg(COORD_EQ(layout_size.w, hint->layout_expected.w) && + COORD_EQ(layout_size.h, hint->layout_expected.h), + "Case %s failed... layout size: (%d, %d) expected size: (%d, %d)", + hint->testname, layout_size.w, layout_size.h, + hint->layout_expected.w, hint->layout_expected.h); +} + +static void +layout_setup() +{ + win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC)); + + layout = efl_add(EFL_UI_RELATIVE_LAYOUT_CLASS, win, + efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(200, 200))); + + efl_gfx_entity_size_set(win, EINA_SIZE2D(200, 200)); +} + +static void +layout_teardown() +{ + if (win) + { + efl_del(win); + win = NULL; + } +} + +EFL_START_TEST (efl_ui_relative_layout_class_check) +{ + const char *class; + + class = efl_class_name_get(layout); + + ck_assert(class != NULL); + ck_assert(!strcmp(class, "Efl.Ui.Relative_Layout")); +} +EFL_END_TEST + +EFL_START_TEST (efl_ui_relative_layout_layout_update) +{ + int i, max_index = (sizeof(hints) / sizeof(Hint)); + + Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_ui_relative_layout_relation_left_set(layout, efl_added, NULL, 0.0)); + + for (i = 0; i < max_index; i++) + { + btn_hint_set(btn, &hints[i]); + btn_geom_assert(&hints[i], efl_gfx_entity_geometry_get(btn)); + } +} +EFL_END_TEST + +EFL_START_TEST (efl_ui_relative_layout_layout_update_chain) +{ + int i, max_index2, max_index3; + Eo *btn, *btn2, *btn3; + + btn = efl_add(EFL_UI_BUTTON_CLASS, layout); + btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout); + + max_index2 = ((sizeof(hints2) / sizeof(Hint)) / 2); + max_index3 = ((sizeof(hints3) / sizeof(Hint)) / 3); + + efl_ui_relative_layout_relation_bottom_set(layout, btn, btn2, 0.0); + efl_ui_relative_layout_relation_top_set(layout, btn2, btn, 1.0); + + for (i = 0; i < max_index2; i++) + { + btn_hint_set(btn, &hints2[i][0]); + btn_hint_set(btn2, &hints2[i][1]); + btn_geom_assert(&hints2[i][0], efl_gfx_entity_geometry_get(btn)); + btn_geom_assert(&hints2[i][1], efl_gfx_entity_geometry_get(btn2)); + } + + btn3 = efl_add(EFL_UI_BUTTON_CLASS, layout); + efl_ui_relative_layout_relation_bottom_set(layout, btn2, btn3, 0.0); + efl_ui_relative_layout_relation_top_set(layout, btn3, btn2, 1.0); + + for (i = 0; i < max_index3; i++) + { + btn_hint_set(btn, &hints3[i][0]); + btn_hint_set(btn2, &hints3[i][1]); + btn_hint_set(btn3, &hints3[i][2]); + btn_geom_assert(&hints3[i][0], efl_gfx_entity_geometry_get(btn)); + btn_geom_assert(&hints3[i][1], efl_gfx_entity_geometry_get(btn2)); + btn_geom_assert(&hints3[i][2], efl_gfx_entity_geometry_get(btn3)); + } +} +EFL_END_TEST + +void efl_ui_test_relative_layout(TCase *tc) +{ + tcase_add_checked_fixture(tc, layout_setup, layout_teardown); + tcase_add_test(tc, efl_ui_relative_layout_class_check); + tcase_add_test(tc, efl_ui_relative_layout_layout_update); + tcase_add_test(tc, efl_ui_relative_layout_layout_update_chain); +} diff --git a/src/tests/elementary/efl_ui_test_table.c b/src/tests/elementary/efl_ui_test_table.c new file mode 100644 index 0000000000..f299fdd9bc --- /dev/null +++ b/src/tests/elementary/efl_ui_test_table.c @@ -0,0 +1,430 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include +#include +#include "elm_suite.h" + +#define COORD_EQ(a, b) (!!(abs(a - b) < 2)) +#define GEOMETRY_EQ(a, b) (COORD_EQ(a.x, b.x) && COORD_EQ(a.y, b.y) && \ + COORD_EQ(a.w, b.w) && COORD_EQ(a.h, b.h)) + +typedef struct { + Eina_Size2D max; + Eina_Size2D min; + double weightx; + double weighty; + double alignx; + double aligny; + int marginl; + int marginr; + int margint; + int marginb; + Efl_Gfx_Hint_Aspect mode; + Eina_Size2D aspect; + Eina_Bool fillx; + Eina_Bool filly; + Eina_Size2D layout_size; + Eina_Size2D layout_expected; + Eina_Rect expected; + char testname[1024]; +} Hint; + +static Hint hints[] = { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(0, 0), 1, 1, 0.5, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT(0, 0, 200, 200), "[0]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT(0, 0, 200, 200), "[1]" }, + { EINA_SIZE2D(50, 150), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 150) * 0.7, 70, 150), "[2]" }, + { EINA_SIZE2D(150, -1), EINA_SIZE2D(70, 70), 0, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.8, (200 - 70) * 0.2, 70, 70), "[3]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 70) * 0.2, 70, 70), "[4]" }, + { EINA_SIZE2D(150, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_TRUE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200), + EINA_RECT((200 - 70) * 0.3, (200 - 70) * 0.2, 70, 70), "[5]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210), + EINA_RECT((200 - 70) * 0.8, 0, 70, 70 * 3), "[6]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.8, (300 - 70 * 3) * 0.7, 70, 70 * 3), "[7]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210), + EINA_RECT((200 - 70) * 0.3, 0, 70, 70 * 3), "[8]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.2, 70, 70 * 3), "[9]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210), + EINA_RECT((200 - 70) * 0.8, 0, 70, 70 * 3), "[10]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.8, (300 - 70 * 3) * 0.7, 70, 70 * 3), "[11]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210), + EINA_RECT((200 - 70) * 0.3, 0, 70, 70 * 3), "[12]" }, + { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.2, 70, 70 * 3), "[13]" }, +}; + +static Hint hints2[][2] = { + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.3, (150 - 70) * 0.7, 70, 70), "[1/1 weight btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.8, (150 - 70) * 0.2 + 150, 70, 70), "[1/1 weight btn2]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.3, 0, 70, 70), "[0/1 weight btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_VERTICAL, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - ((300 - 70) / 3)) * 0.8, 70, (300 - 70) / 3, (300 - 70)), "[0/1 weight btn2]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.3, (300 - 210) * 0.2, 70, 70), "[0/0 weight btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_HORIZONTAL, EINA_SIZE2D(1, 2), EINA_TRUE, EINA_FALSE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT((150 - 70) * 0.8, (300 - 210) * 0.2 + 70, 70, 70 * 2), "[0/0 weight btn2]" } + }, +}; + +static Hint hints3[][3] = { + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT(0, 0, 150, 100), "[1/1/1 weight_l btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 100), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT(0, 100, 150, 100), "[1/1/1 weight_l btn2]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300), + EINA_RECT(0, 100 + 100, 150, 100), "[1/1/1 weight_l btn3]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 270), EINA_SIZE2D(150, 270), + EINA_RECT(0, 0, 150, 85), "[1/1/1 weight_m btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 100), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 270), EINA_SIZE2D(150, 270), + EINA_RECT(0, 85, 150, 100), "[1/1/1 weight_m btn2]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 270), EINA_SIZE2D(150, 270), + EINA_RECT(0, 100 + 85, 150, 85), "[1/1/1 weight_m btn3]" } + }, + { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 200), EINA_SIZE2D(150, 240), + EINA_RECT(0, 0, 150, 70), "[1/1/1 weight_s btn]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 100), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 200), EINA_SIZE2D(150, 240), + EINA_RECT(0, 70, 150, 100), "[1/1/1 weight_s btn2]" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(150, 200), EINA_SIZE2D(150, 240), + EINA_RECT(0, 170, 150, 70), "[1/1/1 weight_s btn3]" } + }, +}; + +static Hint hints_matrix[] = { + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 50), 0, 0, 0.2, 0.8, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_TRUE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT(10 + (90 - 50) * 0.2, 20, 50, (300 - 50) / 3), "pack btn1" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 50), 0, 0, 0.5, 0.5, 20, 20, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT(10 + (90 - 50) * 0.5, 103 + 5, 50, (300 - 50) / 3), "pack btn2" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 50), 0, 1, -99, 100, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT(10, 191 + 5 + (83 - 50) * 1, 50, 50), "pack btn3" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 50), 0, 0, 0.5, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT(110, 20, 170 * 2 / 3, (300 - 50) / 3), "pack btn4" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 70), 2, 2, 0.5, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT(110, 103 + 5, 170 * 2 / 3, (300 - 50) / 3), "pack btn5" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 50), 1, 1, 0.5, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT(110, 191 + 5, 170 * 2 / 3, (300 - 50) / 3), "pack btn6" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 50), 1, 0, 0.5, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT(120 + 170 * 2 / 3, 20, 170 / 3, (300 - 50) / 3), "pack btn7" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 50), 1, 1, 0.5, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT(120 + 170 * 2 / 3, 103 + 5, 170 / 3, (300 - 50) * 2 / 3 + 5), "pack btn8" }, + { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 50), 1, 1, 0.5, 0.5, 0, 0, 0, 0, + EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE, + EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300), + EINA_RECT(120 + 170 * 2 / 3, 191 + 5, 170 / 3, (300 - 50) / 3), "pack btn9" }, +}; + +static Eo *win, *layout; + +static void +btn_hint_set(Eo *btn, Hint *hint) +{ + efl_gfx_entity_size_set(layout, hint->layout_size); + efl_gfx_hint_size_min_set(layout, hint->layout_size); + efl_gfx_hint_size_max_set(btn, hint->max); + efl_gfx_hint_size_min_set(btn, hint->min); + efl_gfx_hint_margin_set(btn, hint->marginl, hint->marginr, + hint->margint, hint->marginb); + efl_gfx_hint_weight_set(btn, hint->weightx, hint->weighty); + efl_gfx_hint_align_set(btn, hint->alignx, hint->aligny); + efl_gfx_hint_fill_set(btn, hint->fillx, hint->filly); + efl_gfx_hint_aspect_set(btn, hint->mode, hint->aspect); + efl_canvas_group_calculate(layout); +} + +static void +btn_geom_assert(Hint *hint, Eina_Rect btn_geom) +{ + Eina_Size2D layout_size, layout_min; + + layout_size = efl_gfx_entity_size_get(layout); + layout_min = efl_gfx_hint_size_combined_min_get(layout); + layout_size.w = layout_size.w > layout_min.w ? layout_size.w : layout_min.w; + layout_size.h = layout_size.h > layout_min.h ? layout_size.h : layout_min.h; + + ck_assert_msg(GEOMETRY_EQ(btn_geom, hint->expected), + "Case %s failed... button geometry: (%d, %d, %d, %d) expected geometry: (%d, %d, %d, %d)", + hint->testname, btn_geom.x, btn_geom.y, btn_geom.w, btn_geom.h, + hint->expected.x, hint->expected.y, hint->expected.w, hint->expected.h); + ck_assert_msg(COORD_EQ(layout_size.w, hint->layout_expected.w) && + COORD_EQ(layout_size.h, hint->layout_expected.h), + "Case %s failed... layout size: (%d, %d) expected size: (%d, %d)", + hint->testname, layout_size.w, layout_size.h, + hint->layout_expected.w, hint->layout_expected.h); +} + +static void +layout_setup() +{ + win = win_add(); + + layout = efl_add(EFL_UI_TABLE_CLASS, win, + efl_pack_align_set(efl_added, 0.8, 0.2), + efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL)); +} + +static void +layout_teardown() +{ + if (win) + { + efl_del(win); + win = NULL; + } +} + +EFL_START_TEST (efl_ui_table_class_check) +{ + const char *class; + + class = efl_class_name_get(layout); + + ck_assert(class != NULL); + ck_assert(!strcmp(class, "Efl.Ui.Table")); +} +EFL_END_TEST + +EFL_START_TEST (efl_ui_table_layout_update) +{ + int i, max_index = (sizeof(hints) / sizeof(Hint)); + + Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_pack_table(layout, efl_added, 0, 0, 1, 1)); + + for (i = 0; i < max_index; i++) + { + btn_hint_set(btn, &hints[i]); + btn_geom_assert(&hints[i], efl_gfx_entity_geometry_get(btn)); + } +} +EFL_END_TEST + +EFL_START_TEST (efl_ui_table_layout_update_pack) +{ + int i, max_index2, max_index3; + Eo *btn, *btn2, *btn3; + + max_index2 = ((sizeof(hints2) / sizeof(Hint)) / 2); + max_index3 = ((sizeof(hints3) / sizeof(Hint)) / 3); + + btn = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_pack_table(layout, efl_added, 0, 0, 1, 1)); + btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_pack_table(layout, efl_added, 0, 1, 1, 1)); + + for (i = 0; i < max_index2; i++) + { + btn_hint_set(btn, &hints2[i][0]); + btn_hint_set(btn2, &hints2[i][1]); + btn_geom_assert(&hints2[i][0], efl_gfx_entity_geometry_get(btn)); + btn_geom_assert(&hints2[i][1], efl_gfx_entity_geometry_get(btn2)); + } + + btn3 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_pack_table(layout, efl_added, 0, 2, 1, 1)); + + for (i = 0; i < max_index3; i++) + { + btn_hint_set(btn, &hints3[i][0]); + btn_hint_set(btn2, &hints3[i][1]); + btn_hint_set(btn3, &hints3[i][2]); + btn_geom_assert(&hints3[i][0], efl_gfx_entity_geometry_get(btn)); + btn_geom_assert(&hints3[i][1], efl_gfx_entity_geometry_get(btn2)); + btn_geom_assert(&hints3[i][2], efl_gfx_entity_geometry_get(btn3)); + } +} +EFL_END_TEST + +EFL_START_TEST (efl_ui_table_layout_update_matrix) +{ + int i, j, max_index = (sizeof(hints_matrix) / sizeof(Hint)); + Eo *btn[9]; + + efl_gfx_hint_margin_set(layout, 10, 10, 20, 20); + efl_ui_table_homogeneous_set(layout, 0, 1); + efl_pack_padding_set(layout, 10, 5, 0); + + for (i = 0; i < 3; i++) + { + for (j = 0; j < 3; j++) + { + btn[3 * i + j] = efl_add(EFL_UI_BUTTON_CLASS, layout); + + if ((i == 2) && (j == 1)) + efl_pack_table(layout, btn[3 * i + j], i, j, 1, 2); + else + efl_pack_table(layout, btn[3 * i + j], i, j, 1, 1); + } + } + for (i = 0; i < max_index; i++) + btn_hint_set(btn[i], &hints_matrix[i]); + + for (i = 0; i < max_index; i++) + btn_geom_assert(&hints_matrix[i], efl_gfx_entity_geometry_get(btn[i])); +} +EFL_END_TEST + +EFL_START_TEST (efl_ui_table_size) +{ +#define USERMIN_CHECK(a, b) \ + efl_canvas_group_calculate(layout); \ + user_min = efl_gfx_hint_size_min_get(layout); \ + ck_assert_msg(COORD_EQ(user_min.w, (a)) && COORD_EQ(user_min.h, (b)), \ + "Case table_size failed... user_min: (%d, %d) expected user_min: (%d, %d)", \ + user_min.w, user_min.h, (a), (b)); + +#define MIN_CHECK(a, b) \ + efl_canvas_group_calculate(layout); \ + min = efl_gfx_hint_size_combined_min_get(layout); \ + ck_assert_msg(COORD_EQ(min.w, (a)) && COORD_EQ(min.h, (b)), \ + "Case table_size failed... min: (%d, %d) expected min: (%d, %d)", \ + min.w, min.h, (a), (b)); + + Eo *btn, *btn2, *btn3; + Eina_Size2D min, user_min; + + btn = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)), + efl_pack_table(layout, efl_added, 0, 0, 1, 1)); + + USERMIN_CHECK(0, 0); + MIN_CHECK(100, 100); + + btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)), + efl_pack_table(layout, efl_added, 0, 1, 1, 1)); + btn3 = efl_add(EFL_UI_BUTTON_CLASS, layout, + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)), + efl_pack_table(layout, efl_added, 0, 2, 1, 1)); + USERMIN_CHECK(0, 0); + MIN_CHECK(100, 300); + + efl_pack_unpack(layout, btn); + USERMIN_CHECK(0, 0); + MIN_CHECK(100, 200); + + efl_pack_unpack(layout, btn2); + USERMIN_CHECK(0, 0); + MIN_CHECK(100, 100); + + efl_pack_unpack(layout, btn3); + USERMIN_CHECK(0, 0); + MIN_CHECK(0, 0); + + efl_pack_table(layout, btn, 0, 0, 1, 1); + efl_gfx_hint_size_min_set(layout, EINA_SIZE2D(200, 200)); + USERMIN_CHECK(200, 200); + MIN_CHECK(200, 200); + + efl_pack_table(layout, btn2, 0, 1, 1, 1); + efl_pack_table(layout, btn3, 0, 2, 1, 1); + USERMIN_CHECK(200, 200); + MIN_CHECK(200, 300); + +#undef USERMIN_ASSERT +#undef MIN_ASSERT +} +EFL_END_TEST + +void efl_ui_test_table(TCase *tc) +{ + tcase_add_checked_fixture(tc, layout_setup, layout_teardown); + tcase_add_test(tc, efl_ui_table_class_check); + tcase_add_test(tc, efl_ui_table_size); + tcase_add_test(tc, efl_ui_table_layout_update); + tcase_add_test(tc, efl_ui_table_layout_update_pack); + tcase_add_test(tc, efl_ui_table_layout_update_matrix); +} diff --git a/src/tests/elementary/efl_ui_test_widget.c b/src/tests/elementary/efl_ui_test_widget.c new file mode 100644 index 0000000000..a49eefe804 --- /dev/null +++ b/src/tests/elementary/efl_ui_test_widget.c @@ -0,0 +1,369 @@ +//#define EFL_NOLEGACY_API_SUPPORT +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif +#include +#include "elm_widget.h" +#include +#include "efl_ui_suite.h" +#include "eo_internal.h" + +EFL_CLASS_SIMPLE_CLASS(efl_ui_widget, "efl_ui_widget", EFL_UI_WIDGET_CLASS) + +typedef struct { + Efl_Ui_Widget *btn1, *btn2; + Efl_Ui_Widget *box; + Efl_Ui_Widget *win; + Efl_Ui_Widget *ic; +} State; + +static void +_small_ui(State *s) +{ + s->win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), + efl_text_set(efl_added, "Hello World")); + + s->ic = efl_add(EFL_UI_IMAGE_CLASS, s->win, + efl_ui_win_icon_object_set(s->win, efl_added)); + + s->box = efl_add(EFL_UI_BOX_CLASS, s->win, + efl_content_set(s->win, efl_added)); + + s->btn1 = efl_add(EFL_UI_BUTTON_CLASS, s->box, + efl_text_set(efl_added, "Quit1"), + efl_pack(s->box, efl_added)); + + s->btn2 = efl_add(EFL_UI_BUTTON_CLASS, s->box, + efl_text_set(efl_added, "Quit"), + efl_pack(s->box, efl_added)); + +} + +EFL_START_TEST(efl_ui_test_widget_parent_iterator) +{ + Eina_Iterator *it; + Efl_Ui_Widget *o; + Eina_Array *a; + State s; + + a = eina_array_new(10); + _small_ui(&s); + eina_array_push(a, s.win); + eina_array_push(a, s.box); + eina_array_push(a, s.btn1); + + it = efl_ui_widget_parent_iterator(s.btn1); + EINA_ITERATOR_FOREACH(it, o) + { + ck_assert_ptr_eq(eina_array_pop(a), o); + } + eina_iterator_free(it); + ck_assert_int_eq(eina_array_count(a), 0); +} +EFL_END_TEST + +EFL_START_TEST(efl_ui_test_widget_widget_iterator) +{ + Eina_Iterator *it; + Efl_Ui_Widget *o; + Eina_Array *a; + State s; + + a = eina_array_new(10); + _small_ui(&s); + eina_array_push(a, s.btn2); + eina_array_push(a, s.btn1); + eina_array_push(a, s.box); + eina_array_push(a, s.ic); //Hack arround the icon of the window + eina_array_push(a, s.win); + + it = efl_ui_widget_tree_widget_iterator(s.win); + EINA_ITERATOR_FOREACH(it, o) + { + Eo *c = eina_array_pop(a); + ck_assert_ptr_eq(c, o); + } + eina_iterator_free(it); + ck_assert_int_eq(eina_array_count(a), 0); +} +EFL_END_TEST + +static Evas_Object* +resize_object(Efl_Canvas_Object *o) +{ + Efl_Ui_Widget_Data *pd = efl_data_scope_safe_get(o, EFL_UI_WIDGET_CLASS); + + return eina_list_data_get(pd->subobjs); +} + +EFL_START_TEST(efl_ui_test_widget_widget_sub_iterator) +{ + Eina_Iterator *it; + Efl_Ui_Widget *o; + Eina_Array *a; + State s; + + a = eina_array_new(10); + _small_ui(&s); + eina_array_push(a, s.btn2); + eina_array_push(a, s.btn1); + eina_array_push(a, s.box); + + it = efl_ui_widget_tree_widget_iterator(s.box); + EINA_ITERATOR_FOREACH(it, o) + { + ck_assert_ptr_eq(eina_array_pop(a), o); + } + eina_iterator_free(it); + ck_assert_int_eq(eina_array_count(a), 0); +} +EFL_END_TEST + +EFL_START_TEST(efl_ui_test_widget_iterator) +{ + Eina_Iterator *it; + Efl_Ui_Widget *o; + Eina_Array *a; + State s; + + a = eina_array_new(10); + _small_ui(&s); + eina_array_push(a, resize_object(s.btn2)); + eina_array_push(a, s.btn2); + eina_array_push(a, resize_object(s.btn1)); + eina_array_push(a, s.btn1); + eina_array_push(a, resize_object(s.box)); + eina_array_push(a, s.box); + eina_array_push(a, resize_object(s.ic)); + eina_array_push(a, s.ic); + eina_array_push(a, s.win); + + it = efl_ui_widget_tree_iterator(s.win); + EINA_ITERATOR_FOREACH(it, o) + { + ck_assert_ptr_eq(eina_array_pop(a), o); + } + eina_iterator_free(it); + ck_assert_int_eq(eina_array_count(a), 0); +} +EFL_END_TEST + +EFL_START_TEST(efl_ui_test_widget_sub_iterator) +{ + Eina_Iterator *it; + Efl_Ui_Widget *o; + Eina_Array *a; + State s; + + a = eina_array_new(10); + _small_ui(&s); + eina_array_push(a, resize_object(s.btn2)); + eina_array_push(a, s.btn2); + eina_array_push(a, resize_object(s.btn1)); + eina_array_push(a, s.btn1); + eina_array_push(a, resize_object(s.box)); + eina_array_push(a, s.box); + + it = efl_ui_widget_tree_iterator(s.box); + EINA_ITERATOR_FOREACH(it, o) + { + ck_assert_ptr_eq(eina_array_pop(a), o); + } + eina_iterator_free(it); + ck_assert_int_eq(eina_array_count(a), 0); +} +EFL_END_TEST + +EFL_START_TEST(efl_ui_test_widget_sub_object_add_del) +{ + State s; + + _small_ui(&s); + DISABLE_ABORT_ON_CRITICAL_START; + ck_assert(!efl_ui_widget_sub_object_add(s.btn1, s.btn1)); + DISABLE_ABORT_ON_CRITICAL_END; + ck_assert(efl_ui_widget_sub_object_add(s.box, s.btn1)); + DISABLE_ABORT_ON_CRITICAL_START; + ck_assert(!efl_ui_widget_sub_object_add(s.box, NULL)); + ck_assert(!efl_ui_widget_sub_object_del(s.btn1, s.btn1)); + ck_assert(!efl_ui_widget_sub_object_del(s.box, NULL)); + ck_assert(!efl_ui_widget_sub_object_del(s.btn1, s.box)); + DISABLE_ABORT_ON_CRITICAL_END; + ck_assert(efl_ui_widget_sub_object_del(s.box, s.btn1)); +} +EFL_END_TEST + +EFL_START_TEST(efl_ui_test_widget_sub_object_theme_sync) +{ + State s; + Efl_Canvas_Layout *edje; + + _small_ui(&s); + edje = elm_widget_resize_object_get(s.btn1); + + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn1), 1.0)); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(edje), 1.0)); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn2), 1.0)); + + efl_gfx_entity_scale_set(s.win, 0.123); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn1), 0.123)); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(edje), 0.123)); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn2), 0.123)); + + efl_ui_widget_sub_object_del(s.box, s.btn1); + efl_gfx_entity_scale_set(s.win, 0.456); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn1), 1.0)); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(edje), 0.123)); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn2), 0.456)); + + efl_gfx_entity_scale_set(s.win, 0.789); + efl_ui_widget_sub_object_add(s.box, s.btn1); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn1), 0.789)); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(edje), 0.789)); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn2), 0.789)); +} +EFL_END_TEST + +EFL_START_TEST(efl_ui_test_widget_parent_relation) +{ + Efl_Ui_Win *win, *w1, *w2, *w3; + + win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), + efl_text_set(efl_added, "Hello World")); + //first check the initial state + w1 = efl_add(efl_ui_widget_realized_class_get(), win); + ck_assert_ptr_eq(efl_ui_widget_parent_get(w1), win); + w2 = efl_add(efl_ui_widget_realized_class_get(), w1); + ck_assert_ptr_eq(efl_ui_widget_parent_get(w2), w1); + w3 = efl_add(efl_ui_widget_realized_class_get(), w1); + ck_assert_ptr_eq(efl_ui_widget_parent_get(w3), w1); + + //check if widget_parent is working correctly + efl_ui_widget_sub_object_add(w2, w3); + ck_assert_ptr_eq(efl_ui_widget_parent_get(w3), w2); + + efl_del(win); +} +EFL_END_TEST + + +EFL_START_TEST(efl_ui_test_widget_disabled_parent) +{ + Efl_Ui_Win *win, *w1, *w2, *t; + + win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), + efl_text_set(efl_added, "Hello World")); + //first check the initial state + w1 = efl_add(efl_ui_widget_realized_class_get(), win); + efl_ui_widget_disabled_set(w1, EINA_TRUE); + w2 = efl_add(efl_ui_widget_realized_class_get(), win); + efl_ui_widget_disabled_set(w2, EINA_FALSE); + ck_assert_int_eq(efl_ui_widget_disabled_get(w1), EINA_TRUE); + ck_assert_int_eq(efl_ui_widget_disabled_get(w2), EINA_FALSE); + + //check if disalbed gets correctly setted on reparent + t = efl_add(efl_ui_widget_realized_class_get(), win); + efl_ui_widget_sub_object_add(w2, t); + ck_assert_int_eq(efl_ui_widget_disabled_get(t), EINA_FALSE); + efl_ui_widget_sub_object_add(w1, t); + ck_assert_int_eq(efl_ui_widget_disabled_get(t), EINA_TRUE); + efl_del(t); + + t = efl_add(efl_ui_widget_realized_class_get(), w2); + ck_assert_int_eq(efl_ui_widget_disabled_get(t), EINA_FALSE); + efl_del(t); + + t = efl_add(efl_ui_widget_realized_class_get(), w1); + ck_assert_int_eq(efl_ui_widget_disabled_get(t), EINA_TRUE); + efl_del(t); + + + efl_del(win); +} +EFL_END_TEST + +EFL_START_TEST(efl_ui_test_widget_disabled_behaviour) +{ + Efl_Ui_Win *win, *w1, *w2, *t; + + win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), + efl_text_set(efl_added, "Hello World")); + //first check the initial state + w1 = efl_add(efl_ui_widget_realized_class_get(), win); + efl_ui_widget_disabled_set(w1, EINA_TRUE); + w2 = efl_add(efl_ui_widget_realized_class_get(), win); + efl_ui_widget_disabled_set(w2, EINA_FALSE); + + + t = efl_add(efl_ui_widget_realized_class_get(), win); + efl_ui_widget_sub_object_add(w1, t); + //check that we never enable something under disabled parent + DISABLE_ABORT_ON_CRITICAL_START; + efl_ui_widget_disabled_set(t, EINA_FALSE); + DISABLE_ABORT_ON_CRITICAL_END; + ck_assert_int_eq(efl_ui_widget_disabled_get(t), EINA_TRUE); + efl_del(t); + + t = efl_add(efl_ui_widget_realized_class_get(), win); + efl_ui_widget_sub_object_add(w1, t); + //check that we can disable something with a disabled tree + efl_ui_widget_disabled_set(t, EINA_TRUE); + ck_assert_int_eq(efl_ui_widget_disabled_get(t), EINA_TRUE); + efl_ui_widget_sub_object_add(w2, t); + ck_assert_int_eq(efl_ui_widget_disabled_get(t), EINA_TRUE); + efl_del(t); + + efl_del(win); +} +EFL_END_TEST + +static int tree_abort; +static int tree_abort_level; + +static void +_shutdown(void) +{ + eina_log_abort_on_critical_set(tree_abort); + eina_log_abort_on_critical_level_set(tree_abort_level); +} + +static void +_setup(void) +{ + tree_abort = eina_log_abort_on_critical_get(); + tree_abort_level = eina_log_abort_on_critical_level_get(); + eina_log_abort_on_critical_level_set(2); + eina_log_abort_on_critical_set(1); +} + +EFL_START_TEST(efl_ui_test_widget_win_provider_find) +{ + State s; + + _small_ui(&s); + ck_assert_ptr_eq(efl_provider_find(s.btn1, EFL_UI_WIN_CLASS), s.win); + efl_ui_widget_sub_object_del(s.box, s.btn1); + ck_assert_ptr_eq(efl_ui_widget_parent_get(s.btn1), NULL); + ck_assert_ptr_eq(efl_provider_find(s.btn1, EFL_UI_WIN_CLASS), s.win); +} +EFL_END_TEST + +void efl_ui_test_widget(TCase *tc) +{ + tcase_add_checked_fixture(tc, _setup, _shutdown); + tcase_add_test(tc, efl_ui_test_widget_parent_iterator); + tcase_add_test(tc, efl_ui_test_widget_widget_iterator); + tcase_add_test(tc, efl_ui_test_widget_widget_sub_iterator); + tcase_add_test(tc, efl_ui_test_widget_iterator); + tcase_add_test(tc, efl_ui_test_widget_sub_iterator); + tcase_add_test(tc, efl_ui_test_widget_sub_object_add_del); + tcase_add_test(tc, efl_ui_test_widget_sub_object_theme_sync); + tcase_add_test(tc, efl_ui_test_widget_parent_relation); + tcase_add_test(tc, efl_ui_test_widget_disabled_parent); + tcase_add_test(tc, efl_ui_test_widget_disabled_behaviour); + tcase_add_test(tc, efl_ui_test_widget_win_provider_find); +} diff --git a/src/tests/elementary/elm_code_file_test_load.c b/src/tests/elementary/elm_code_file_test_load.c index 80bc941fdd..31539e9666 100644 --- a/src/tests/elementary/elm_code_file_test_load.c +++ b/src/tests/elementary/elm_code_file_test_load.c @@ -7,7 +7,7 @@ #include "elm_suite.h" #include "Elementary.h" -EFL_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]; @@ -28,7 +28,7 @@ EFL_START_TEST (elm_code_file_load) } EFL_END_TEST -EFL_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; @@ -46,7 +46,7 @@ EFL_START_TEST (elm_code_file_load_lines) } EFL_END_TEST -EFL_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; @@ -64,7 +64,7 @@ EFL_START_TEST (elm_code_file_load_blank_lines) } EFL_END_TEST -EFL_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; @@ -94,7 +94,7 @@ static void _assert_line_content_eq(const char *content, Elm_Code_Line *line) ck_assert_uint_eq(content[c], line->content[c]); } -EFL_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; @@ -113,7 +113,7 @@ EFL_START_TEST (elm_code_file_load_content) } EFL_END_TEST -EFL_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; @@ -135,7 +135,7 @@ EFL_START_TEST (elm_code_file_line_ending_unix) } EFL_END_TEST -EFL_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; diff --git a/src/tests/elementary/elm_code_file_test_memory.c b/src/tests/elementary/elm_code_file_test_memory.c index 142566d319..8cc2cecd42 100644 --- a/src/tests/elementary/elm_code_file_test_memory.c +++ b/src/tests/elementary/elm_code_file_test_memory.c @@ -5,7 +5,7 @@ #include "elm_suite.h" #include "Elementary.h" -EFL_START_TEST (elm_code_file_memory_lines) +EFL_START_TEST(elm_code_file_memory_lines) { Elm_Code *code; @@ -22,7 +22,7 @@ EFL_START_TEST (elm_code_file_memory_lines) } EFL_END_TEST -EFL_START_TEST (elm_code_file_memory_tokens) +EFL_START_TEST(elm_code_file_memory_tokens) { Elm_Code_File *file; Elm_Code_Line *line; diff --git a/src/tests/elementary/elm_code_test_basic.c b/src/tests/elementary/elm_code_test_basic.c index 8f2a035eb5..8d4012eef9 100644 --- a/src/tests/elementary/elm_code_test_basic.c +++ b/src/tests/elementary/elm_code_test_basic.c @@ -7,7 +7,7 @@ #include "elm_suite.h" #include "Elementary.h" -EFL_START_TEST (elm_code_create_test) +EFL_START_TEST(elm_code_create_test) { Elm_Code *code; @@ -22,7 +22,7 @@ EFL_START_TEST (elm_code_create_test) } EFL_END_TEST -EFL_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]; diff --git a/src/tests/elementary/elm_code_test_indent.c b/src/tests/elementary/elm_code_test_indent.c index a3a45612fe..119d19ec64 100644 --- a/src/tests/elementary/elm_code_test_indent.c +++ b/src/tests/elementary/elm_code_test_indent.c @@ -24,7 +24,7 @@ _indent_check(Elm_Code_File *file, const char *prev, const char *expected) free(str); } -EFL_START_TEST (elm_code_indent_whitespace_test) +EFL_START_TEST(elm_code_indent_whitespace_test) { Elm_Code *code; Elm_Code_File *file; @@ -43,7 +43,7 @@ EFL_START_TEST (elm_code_indent_whitespace_test) } EFL_END_TEST -EFL_START_TEST (elm_code_indent_comments_test) +EFL_START_TEST(elm_code_indent_comments_test) { Elm_Code *code; Elm_Code_File *file; @@ -66,7 +66,7 @@ EFL_START_TEST (elm_code_indent_comments_test) } EFL_END_TEST -EFL_START_TEST (elm_code_indent_simple_braces) +EFL_START_TEST(elm_code_indent_simple_braces) { Elm_Code *code; Elm_Code_File *file; @@ -87,7 +87,7 @@ EFL_START_TEST (elm_code_indent_simple_braces) } EFL_END_TEST -EFL_START_TEST (elm_code_indent_tab_simple_braces) +EFL_START_TEST(elm_code_indent_tab_simple_braces) { Elm_Code *code; Elm_Code_File *file; @@ -107,7 +107,7 @@ EFL_START_TEST (elm_code_indent_tab_simple_braces) } EFL_END_TEST -EFL_START_TEST (elm_code_indent_matching_braces) +EFL_START_TEST(elm_code_indent_matching_braces) { Elm_Code_File *file; Elm_Code_Line *line; @@ -151,7 +151,7 @@ EFL_START_TEST (elm_code_indent_matching_braces) } EFL_END_TEST -EFL_START_TEST (elm_code_indent_tab_matching_braces) +EFL_START_TEST(elm_code_indent_tab_matching_braces) { Elm_Code_File *file; Elm_Code_Line *line; @@ -184,7 +184,7 @@ EFL_START_TEST (elm_code_indent_tab_matching_braces) } EFL_END_TEST -EFL_START_TEST (elm_code_indent_startswith_keyword) +EFL_START_TEST(elm_code_indent_startswith_keyword) { Elm_Code_File *file; Elm_Code *code; diff --git a/src/tests/elementary/elm_code_test_line.c b/src/tests/elementary/elm_code_test_line.c index c1eec9db43..34667b7553 100644 --- a/src/tests/elementary/elm_code_test_line.c +++ b/src/tests/elementary/elm_code_test_line.c @@ -5,7 +5,7 @@ #include "elm_suite.h" #include "Elementary.h" -EFL_START_TEST (elm_code_line_create_test) +EFL_START_TEST(elm_code_line_create_test) { Elm_Code *code; Elm_Code_File *file; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_code_line_create_test) } EFL_END_TEST -EFL_START_TEST (elm_code_line_token_count_test) +EFL_START_TEST(elm_code_line_token_count_test) { Elm_Code *code; Elm_Code_File *file; @@ -51,7 +51,7 @@ EFL_START_TEST (elm_code_line_token_count_test) } EFL_END_TEST -EFL_START_TEST (elm_code_line_split_test) +EFL_START_TEST(elm_code_line_split_test) { Elm_Code *code; Elm_Code_File *file; diff --git a/src/tests/elementary/elm_code_test_parse.c b/src/tests/elementary/elm_code_test_parse.c index af06449ade..3858898e81 100644 --- a/src/tests/elementary/elm_code_test_parse.c +++ b/src/tests/elementary/elm_code_test_parse.c @@ -18,7 +18,7 @@ static void _parser_file_callback(Elm_Code_File *file EINA_UNUSED, void *data EI file_calls++; } -EFL_START_TEST (elm_code_parse_hook_memory_test) +EFL_START_TEST(elm_code_parse_hook_memory_test) { Elm_Code *code; Elm_Code_File *file; @@ -42,7 +42,7 @@ EFL_START_TEST (elm_code_parse_hook_memory_test) } EFL_END_TEST -EFL_START_TEST (elm_code_parse_hook_file_test) +EFL_START_TEST(elm_code_parse_hook_file_test) { Elm_Code *code; Elm_Code_File *file; @@ -67,7 +67,7 @@ EFL_START_TEST (elm_code_parse_hook_file_test) } EFL_END_TEST -EFL_START_TEST (elm_code_parse_todo_test) +EFL_START_TEST(elm_code_parse_todo_test) { Elm_Code *code; Elm_Code_File *file; diff --git a/src/tests/elementary/elm_code_test_syntax.c b/src/tests/elementary/elm_code_test_syntax.c index 2af474cbf5..8aa3dcbc59 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 } } -EFL_START_TEST (elm_code_syntax_lookup) +EFL_START_TEST(elm_code_syntax_lookup) { Elm_Code_Syntax *syntax; @@ -50,7 +50,7 @@ EFL_START_TEST (elm_code_syntax_lookup) } EFL_END_TEST -EFL_START_TEST (elm_code_syntax_c) +EFL_START_TEST(elm_code_syntax_c) { Elm_Code *code; Elm_Code_File *file; @@ -64,7 +64,7 @@ EFL_START_TEST (elm_code_syntax_c) 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"; + efl_ui_code_widget_code_get(widget)->file->mime = "text/x-csrc"; elm_code_widget_syntax_enabled_set(widget, EINA_TRUE); _append_line(file, "#include "); @@ -117,7 +117,7 @@ EFL_START_TEST (elm_code_syntax_c) } EFL_END_TEST -EFL_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; diff --git a/src/tests/elementary/elm_code_test_text.c b/src/tests/elementary/elm_code_test_text.c index c6f6d22d88..a8d3815027 100644 --- a/src/tests/elementary/elm_code_test_text.c +++ b/src/tests/elementary/elm_code_test_text.c @@ -6,7 +6,7 @@ #include "Elementary.h" #include "elm_code_text.h" -EFL_START_TEST (elm_code_text_get_test) +EFL_START_TEST(elm_code_text_get_test) { Elm_Code *code; Elm_Code_File *file; @@ -29,7 +29,7 @@ EFL_START_TEST (elm_code_text_get_test) } EFL_END_TEST -EFL_START_TEST (elm_code_text_insert_test) +EFL_START_TEST(elm_code_text_insert_test) { Elm_Code *code; Elm_Code_File *file; @@ -52,7 +52,7 @@ EFL_START_TEST (elm_code_text_insert_test) } EFL_END_TEST -EFL_START_TEST (elm_code_text_contains_test) +EFL_START_TEST(elm_code_text_contains_test) { Elm_Code *code; Elm_Code_File *file; @@ -75,7 +75,7 @@ EFL_START_TEST (elm_code_text_contains_test) } EFL_END_TEST -EFL_START_TEST (elm_code_text_strpos_test) +EFL_START_TEST(elm_code_text_strpos_test) { Elm_Code *code; Elm_Code_File *file; @@ -102,7 +102,7 @@ EFL_START_TEST (elm_code_text_strpos_test) } EFL_END_TEST -EFL_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"; @@ -118,7 +118,7 @@ EFL_START_TEST (elm_code_text_newline_position_test) } EFL_END_TEST -EFL_START_TEST (elm_code_text_is_whitespace_test) +EFL_START_TEST(elm_code_text_is_whitespace_test) { const char *text; diff --git a/src/tests/elementary/elm_code_test_widget.c b/src/tests/elementary/elm_code_test_widget.c index 7fbe2318c7..0f7177c486 100644 --- a/src/tests/elementary/elm_code_test_widget.c +++ b/src/tests/elementary/elm_code_test_widget.c @@ -22,7 +22,7 @@ #undef DBG #define DBG(...) do { } while (0); -EFL_START_TEST (elm_code_widget_construct) +EFL_START_TEST(elm_code_widget_construct) { Elm_Code *code; Elm_Code_Widget *widget; @@ -41,7 +41,7 @@ EFL_START_TEST (elm_code_widget_construct) } EFL_END_TEST -EFL_START_TEST (elm_code_widget_construct_nocode) +EFL_START_TEST(elm_code_widget_construct_nocode) { Elm_Code_Widget *widget; Evas_Object *win; @@ -57,7 +57,7 @@ EFL_START_TEST (elm_code_widget_construct_nocode) } EFL_END_TEST -EFL_START_TEST (elm_code_widget_position) +EFL_START_TEST(elm_code_widget_position) { Elm_Code *code; Elm_Code_Widget *widget; diff --git a/src/tests/elementary/elm_code_test_widget_selection.c b/src/tests/elementary/elm_code_test_widget_selection.c index ed762f8111..76ed16d6d9 100644 --- a/src/tests/elementary/elm_code_test_widget_selection.c +++ b/src/tests/elementary/elm_code_test_widget_selection.c @@ -7,7 +7,7 @@ #include "elm_code_widget_private.h" #include "elm_code_widget_selection.h" -EFL_START_TEST (elm_code_test_widget_selection_set) +EFL_START_TEST(elm_code_test_widget_selection_set) { Elm_Code *code; Elm_Code_File *file; @@ -32,7 +32,7 @@ EFL_START_TEST (elm_code_test_widget_selection_set) } EFL_END_TEST -EFL_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; @@ -75,7 +75,7 @@ EFL_START_TEST (elm_code_test_widget_selection_normalized_get) } EFL_END_TEST -EFL_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; @@ -109,7 +109,7 @@ EFL_START_TEST (elm_code_test_widget_selection_text_get) } EFL_END_TEST -EFL_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; @@ -143,7 +143,7 @@ EFL_START_TEST (elm_code_test_widget_selection_reverse_text_get) } EFL_END_TEST -EFL_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; @@ -173,7 +173,7 @@ EFL_START_TEST (elm_code_test_widget_selection_text_get_twoline) } EFL_END_TEST -EFL_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; @@ -203,7 +203,7 @@ EFL_START_TEST (elm_code_test_widget_selection_reverse_text_get_twoline) } EFL_END_TEST -EFL_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; @@ -234,7 +234,7 @@ EFL_START_TEST (elm_code_test_widget_selection_text_get_multiline) } EFL_END_TEST -EFL_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; @@ -265,7 +265,7 @@ EFL_START_TEST (elm_code_test_widget_selection_reverse_text_get_multiline) } EFL_END_TEST -EFL_START_TEST (elm_code_test_widget_selection_delete) +EFL_START_TEST(elm_code_test_widget_selection_delete) { Elm_Code *code; Elm_Code_File *file; @@ -302,7 +302,7 @@ EFL_START_TEST (elm_code_test_widget_selection_delete) } EFL_END_TEST -EFL_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; @@ -339,7 +339,7 @@ EFL_START_TEST (elm_code_test_widget_selection_reverse_delete) } EFL_END_TEST -EFL_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; @@ -387,7 +387,7 @@ EFL_START_TEST (elm_code_test_widget_selection_delete_twoline) } EFL_END_TEST -EFL_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; @@ -435,7 +435,7 @@ EFL_START_TEST (elm_code_test_widget_selection_reverse_delete_twoline) } EFL_END_TEST -EFL_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; @@ -485,7 +485,7 @@ EFL_START_TEST (elm_code_test_widget_selection_delete_multiline) } EFL_END_TEST -EFL_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; @@ -535,7 +535,7 @@ EFL_START_TEST (elm_code_test_widget_selection_reverse_delete_multiline) } EFL_END_TEST -EFL_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; @@ -573,7 +573,7 @@ EFL_START_TEST (elm_code_test_widget_selection_select_line) } EFL_END_TEST -EFL_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; @@ -615,7 +615,7 @@ EFL_START_TEST (elm_code_test_widget_selection_select_word) } EFL_END_TEST -EFL_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; @@ -655,7 +655,7 @@ EFL_START_TEST (elm_code_test_widget_selection_select_word_punctuation) } EFL_END_TEST -EFL_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; diff --git a/src/tests/elementary/elm_code_test_widget_text.c b/src/tests/elementary/elm_code_test_widget_text.c index c2794b9e4c..cf1e0796ac 100644 --- a/src/tests/elementary/elm_code_test_widget_text.c +++ b/src/tests/elementary/elm_code_test_widget_text.c @@ -5,7 +5,7 @@ #include "elm_suite.h" #include "Elementary.h" -EFL_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; @@ -27,7 +27,7 @@ EFL_START_TEST (elm_code_test_widget_text_tab_width) } EFL_END_TEST -EFL_START_TEST (elm_code_test_widget_text_position) +EFL_START_TEST(elm_code_test_widget_text_position) { Elm_Code *code; Elm_Code_File *file; diff --git a/src/tests/elementary/elm_code_test_widget_undo.c b/src/tests/elementary/elm_code_test_widget_undo.c index d65a196ddd..6ef9383037 100644 --- a/src/tests/elementary/elm_code_test_widget_undo.c +++ b/src/tests/elementary/elm_code_test_widget_undo.c @@ -6,7 +6,7 @@ #include "Elementary.h" #include "elm_code_widget_private.h" -EFL_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; @@ -57,7 +57,7 @@ EFL_START_TEST (elm_code_test_widget_undo_text_insert) } EFL_END_TEST -EFL_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; diff --git a/src/tests/elementary/elm_suite.c b/src/tests/elementary/elm_suite.c index a046e6c1b1..a1dc5de1b9 100644 --- a/src/tests/elementary/elm_suite.c +++ b/src/tests/elementary/elm_suite.c @@ -5,12 +5,7 @@ #include #include "elm_suite.h" #include "../efl_check.h" -#include "elm_widget.h" - -static int main_pid = -1; -static Eina_Bool did_shutdown; -static Evas_Object *global_win; -static Eina_Bool buffer = EINA_FALSE; +#include "suite_helpers.h" static const Efl_Test_Case etc[] = { { "elm_config", elm_test_config }, @@ -88,129 +83,10 @@ static const Efl_Test_Case etc[] = { { "elm_code_widget_text", elm_code_test_widget_text }, { "elm_code_widget_selection", elm_code_test_widget_selection }, { "elm_code_widget_undo", elm_code_test_widget_undo }, - { "elm_focus", elm_test_focus}, - { "elm_focus_sub", elm_test_focus_sub}, { "elm_widget_focus", elm_test_widget_focus}, -/* FIXME : This test must move efl_ui_suite when it ready * - * EFL_UI_TEST BEGIN */ - { "efl_ui_grid", efl_ui_test_grid}, -/* EFL_UI_TEST END */ { 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 } -}; - -#define BUFFER_RENDER_INTERVAL 0.002 - -static Eina_Bool -_win_manual_render(void *data) -{ - ecore_animator_custom_tick(); - evas_norender(evas_object_evas_get(data)); - return EINA_TRUE; -} - -static void -_win_show(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) -{ - evas_object_data_set(obj, "timer", ecore_timer_add(BUFFER_RENDER_INTERVAL, _win_manual_render, obj)); -} - -static void -_win_hide(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) -{ - ecore_timer_del(evas_object_data_del(obj, "timer")); -} - -static Evas_Object * -_elm_suite_win_create() -{ - Evas_Object *win = elm_win_add(NULL, "elm_suite", ELM_WIN_BASIC); - if (!buffer) return win; - ecore_evas_manual_render_set(ecore_evas_ecore_evas_get(evas_object_evas_get(win)), EINA_TRUE); - edje_frametime_set(BUFFER_RENDER_INTERVAL); - ecore_animator_source_set(ECORE_ANIMATOR_SOURCE_CUSTOM); - evas_object_event_callback_add(win, EVAS_CALLBACK_SHOW, _win_show, NULL); - evas_object_event_callback_add(win, EVAS_CALLBACK_HIDE, _win_hide, NULL); - return win; -} - -Evas_Object * -win_add() -{ - if (getpid() != main_pid) - { - if (global_win) return global_win; - } - return _elm_suite_win_create(); -} - -static void -force_focus_win(Evas_Object *win) -{ - Ecore_Evas *ee; - - ee = ecore_evas_ecore_evas_get(evas_object_evas_get(win)); - ecore_evas_focus_set(ee, EINA_TRUE); - ecore_evas_callback_focus_in_set(ee, NULL); - ecore_evas_callback_focus_out_set(ee, NULL); - Elm_Widget_Smart_Data *pd = efl_data_scope_safe_get(win, EFL_UI_WIDGET_CLASS); - pd->top_win_focused = EINA_TRUE; -} - -Evas_Object * -win_add_focused() -{ - Evas_Object *win; - - if (getpid() != main_pid) - { - if (global_win) return global_win; - } - - win = _elm_suite_win_create(); - force_focus_win(win); - return win; -} - int main(int argc, char **argv) { @@ -219,51 +95,7 @@ main(int argc, char **argv) if (!_efl_test_option_disp(argc, argv, etc)) return 0; -#ifdef NEED_RUN_IN_TREE - putenv("EFL_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_Init", etc_init, SUITE_INIT_FN(elm), SUITE_SHUTDOWN_FN(elm)); - failed_count += !elm_init(1, (char*[]){"exe"}); - if (buffer) - { - global_win = _elm_suite_win_create(); - force_focus_win(global_win); - } - 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 = suite_setup(EINA_TRUE); failed_count += _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, "Elementary", etc, SUITE_INIT_FN(elm2), SUITE_SHUTDOWN_FN(elm)); diff --git a/src/tests/elementary/elm_suite.h b/src/tests/elementary/elm_suite.h index b12dc5eb46..ba76b29615 100644 --- a/src/tests/elementary/elm_suite.h +++ b/src/tests/elementary/elm_suite.h @@ -16,7 +16,9 @@ } #include -void elm_test_init(TCase *tc); +#include +#include "suite_helpers.h" + void elm_test_config(TCase *tc); void elm_test_check(TCase *tc); void elm_test_colorselector(TCase *tc); @@ -81,13 +83,7 @@ void elm_test_panes(TCase *tc); void elm_test_slideshow(TCase *tc); void elm_test_spinner(TCase *tc); void elm_test_plug(TCase *tc); -void elm_test_focus(TCase *tc); -void elm_test_focus_sub(TCase *tc); void elm_test_widget_focus(TCase *tc); -/* FIXME : This test must move efl_ui_suite when it ready * - * EFL_UI_TEST BEGIN */ -void efl_ui_test_grid(TCase *tc); -/* EFL_UI_TEST END */ void elm_code_file_test_load(TCase *tc); void elm_code_file_test_memory(TCase *tc); @@ -105,4 +101,8 @@ void elm_code_test_widget_undo(TCase *tc); Evas_Object *win_add(); Evas_Object *win_add_focused(); +Eo *timer_add(double in, Ecore_Task_Cb cb, void *data); + +#define ecore_timer_add timer_add + #endif /* _ELM_SUITE_H */ diff --git a/src/tests/elementary/elm_suite_build.c b/src/tests/elementary/elm_suite_build.c new file mode 100644 index 0000000000..7ff098adec --- /dev/null +++ b/src/tests/elementary/elm_suite_build.c @@ -0,0 +1,2 @@ +#undef EFL_BETA_API_SUPPORT +#include diff --git a/src/tests/elementary/elm_test_actionslider.c b/src/tests/elementary/elm_test_actionslider.c index 5509cc79bb..b679b6017c 100644 --- a/src/tests/elementary/elm_test_actionslider.c +++ b/src/tests/elementary/elm_test_actionslider.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_actionslider_legacy_type_check) +EFL_START_TEST(elm_actionslider_legacy_type_check) { Evas_Object *win, *actionslider; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_actionslider_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *actionslider; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_atspi.c b/src/tests/elementary/elm_test_atspi.c index ff70c5bfe1..ebd121b1fc 100644 --- a/src/tests/elementary/elm_test_atspi.c +++ b/src/tests/elementary/elm_test_atspi.c @@ -26,7 +26,7 @@ void generate_app(void) evas_object_show(g_win); } -EFL_START_TEST (test_efl_access_app_obj_name_get) +EFL_START_TEST(test_efl_access_app_obj_name_get) { Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL); @@ -44,7 +44,7 @@ EFL_START_TEST (test_efl_access_app_obj_name_get) } EFL_END_TEST -EFL_START_TEST (test_efl_access_object_i18n_name_get) +EFL_START_TEST(test_efl_access_object_i18n_name_get) { generate_app(); @@ -68,7 +68,7 @@ EFL_START_TEST (test_efl_access_object_i18n_name_get) } EFL_END_TEST -EFL_START_TEST (test_efl_access_object_i18n_name_set) +EFL_START_TEST(test_efl_access_object_i18n_name_set) { generate_app(); @@ -91,7 +91,7 @@ EFL_START_TEST (test_efl_access_object_i18n_name_set) } EFL_END_TEST -EFL_START_TEST (test_efl_access_object_role_get) +EFL_START_TEST(test_efl_access_object_role_get) { Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL); @@ -105,7 +105,7 @@ EFL_START_TEST (test_efl_access_object_role_get) } EFL_END_TEST -EFL_START_TEST (test_efl_access_object_role_set) +EFL_START_TEST(test_efl_access_object_role_set) { generate_app(); Efl_Access_Role role; @@ -125,7 +125,7 @@ EFL_START_TEST (test_efl_access_object_role_set) } EFL_END_TEST -EFL_START_TEST (test_efl_access_object_role_name_get) +EFL_START_TEST(test_efl_access_object_role_name_get) { Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL); @@ -139,7 +139,7 @@ EFL_START_TEST (test_efl_access_object_role_name_get) } EFL_END_TEST -EFL_START_TEST (test_efl_access_object_localized_role_name_get) +EFL_START_TEST(test_efl_access_object_localized_role_name_get) { Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL); @@ -153,7 +153,7 @@ EFL_START_TEST (test_efl_access_object_localized_role_name_get) } EFL_END_TEST -EFL_START_TEST (test_efl_access_object_description_set) +EFL_START_TEST(test_efl_access_object_description_set) { Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL); @@ -181,7 +181,7 @@ EFL_START_TEST (test_efl_access_object_description_set) EFL_END_TEST /* Test if initial description value is NULL */ -EFL_START_TEST (test_efl_access_object_description_get) +EFL_START_TEST(test_efl_access_object_description_get) { generate_app(); @@ -193,7 +193,7 @@ EFL_START_TEST (test_efl_access_object_description_get) } EFL_END_TEST -EFL_START_TEST (test_efl_access_children_and_parent) +EFL_START_TEST(test_efl_access_children_and_parent) { generate_app(); Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL); @@ -217,7 +217,7 @@ EFL_START_TEST (test_efl_access_children_and_parent) } EFL_END_TEST -EFL_START_TEST (test_efl_access_children_and_parent2) +EFL_START_TEST(test_efl_access_children_and_parent2) { generate_app(); Eo* root = efl_add_ref(ELM_ATSPI_APP_OBJECT_CLASS, NULL); @@ -244,7 +244,7 @@ EFL_START_TEST (test_efl_access_children_and_parent2) EFL_END_TEST /* Initial value of translation domain should be NULL */ -EFL_START_TEST (test_efl_access_object_translation_domain_get) +EFL_START_TEST(test_efl_access_object_translation_domain_get) { generate_app(); @@ -257,7 +257,7 @@ EFL_START_TEST (test_efl_access_object_translation_domain_get) } EFL_END_TEST -EFL_START_TEST (test_efl_access_object_translation_domain_set) +EFL_START_TEST(test_efl_access_object_translation_domain_set) { generate_app(); @@ -277,7 +277,7 @@ EFL_START_TEST (test_efl_access_object_translation_domain_set) } EFL_END_TEST -EFL_START_TEST (test_efl_access_object_relationship_append) +EFL_START_TEST(test_efl_access_object_relationship_append) { generate_app(); @@ -285,8 +285,8 @@ EFL_START_TEST (test_efl_access_object_relationship_append) Eina_Iterator *it; unsigned int i = 0; - 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_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_win); it = efl_access_object_relations_get(g_btn); ck_assert(it != NULL); @@ -296,9 +296,9 @@ EFL_START_TEST (test_efl_access_object_relationship_append) { i++; - if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) rel_to = rel; - if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM) rel_from = rel; } @@ -312,8 +312,8 @@ EFL_START_TEST (test_efl_access_object_relationship_append) eina_iterator_free(it); /* Check if append do not procude duplicated relations */ - 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_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_win); it = efl_access_object_relations_get(g_btn); i = 0; rel_to = rel_from = NULL; @@ -321,9 +321,9 @@ EFL_START_TEST (test_efl_access_object_relationship_append) { i++; - if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) rel_to = rel; - if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM) rel_from = rel; } @@ -341,7 +341,7 @@ EFL_START_TEST (test_efl_access_object_relationship_append) } EFL_END_TEST -EFL_START_TEST (test_efl_access_object_relationship_remove) +EFL_START_TEST(test_efl_access_object_relationship_remove) { generate_app(); @@ -350,9 +350,9 @@ EFL_START_TEST (test_efl_access_object_relationship_remove) unsigned int i = 0; /* Test if removal of single relationship works */ - 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); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_win); + efl_access_object_relationship_remove(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg); it = efl_access_object_relations_get(g_btn); ck_assert(it != NULL); @@ -362,9 +362,9 @@ EFL_START_TEST (test_efl_access_object_relationship_remove) { i++; - if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) rel_to = rel; - if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM) rel_from = rel; } @@ -377,9 +377,9 @@ EFL_START_TEST (test_efl_access_object_relationship_remove) eina_iterator_free(it); /* Test if removal of type relationship works */ - 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); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_win); + efl_access_object_relationship_remove(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, NULL); it = efl_access_object_relations_get(g_btn); i = 0; rel_to = rel_from = NULL; @@ -387,9 +387,9 @@ EFL_START_TEST (test_efl_access_object_relationship_remove) { i++; - if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) rel_to = rel; - if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM) rel_from = rel; } @@ -400,8 +400,8 @@ EFL_START_TEST (test_efl_access_object_relationship_remove) eina_iterator_free(it); /* Test if relationship is implicity removed when object is deleted */ - 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_TYPE_FLOWS_TO, g_bg); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_bg); efl_del(g_bg); it = efl_access_object_relations_get(g_btn); i = 0; @@ -410,9 +410,9 @@ EFL_START_TEST (test_efl_access_object_relationship_remove) { i++; - if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) rel_to = rel; - if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) + if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM) rel_from = rel; } @@ -423,27 +423,27 @@ EFL_START_TEST (test_efl_access_object_relationship_remove) } EFL_END_TEST -EFL_START_TEST (test_efl_access_object_relationships_clear) +EFL_START_TEST(test_efl_access_object_relationships_clear) { Efl_Access_Relation *rel; Eina_Iterator *it; generate_app(); - 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_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_bg); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_win); + efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_win); efl_access_object_relationships_clear(g_btn); 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))); + ck_assert(!((rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) && eina_list_data_find(rel->objects, g_bg))); + ck_assert(!((rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM) && eina_list_data_find(rel->objects, g_bg))); + ck_assert(!((rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) && eina_list_data_find(rel->objects, g_win))); + ck_assert(!((rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM) && eina_list_data_find(rel->objects, g_win))); } eina_iterator_free(it); } diff --git a/src/tests/elementary/elm_test_bg.c b/src/tests/elementary/elm_test_bg.c index 979a3c2a7c..fb57bb0c26 100644 --- a/src/tests/elementary/elm_test_bg.c +++ b/src/tests/elementary/elm_test_bg.c @@ -5,7 +5,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_bg_legacy_type_check) +EFL_START_TEST(elm_bg_legacy_type_check) { Evas_Object *win, *bg; const char *type; @@ -25,7 +25,7 @@ EFL_START_TEST (elm_bg_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_bg_legacy_file_set_get_check) +EFL_START_TEST(elm_bg_legacy_file_set_get_check) { Evas_Object *win, *bg; const char *file = NULL, *key = NULL; diff --git a/src/tests/elementary/elm_test_box.c b/src/tests/elementary/elm_test_box.c index 56261ec7ac..8ec5111770 100644 --- a/src/tests/elementary/elm_test_box.c +++ b/src/tests/elementary/elm_test_box.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_box_legacy_type_check) +EFL_START_TEST(elm_box_legacy_type_check) { Evas_Object *win, *box; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_box_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *box; Efl_Access_Role role; @@ -41,8 +41,42 @@ EFL_START_TEST (elm_atspi_role_get) } EFL_END_TEST +EFL_START_TEST(elm_box_disabled_test) +{ + Evas_Object *win, *box, *o; + int i; + + win = win_add(NULL, "box", ELM_WIN_BASIC); + + box = elm_box_add(win); + elm_win_resize_object_add(win, box); + + for (i = 0; i < 3; ++i) + { + o = elm_button_add(box); + elm_box_pack_end(box, o); + } + + elm_object_disabled_set(box, EINA_TRUE); + elm_object_disabled_set(box, EINA_TRUE); + ck_assert_int_eq(elm_object_disabled_get(box), EINA_TRUE); + ck_assert_int_eq(elm_object_disabled_get(o), EINA_TRUE); + elm_object_disabled_set(box, EINA_FALSE); + ck_assert_int_eq(elm_object_disabled_get(box), EINA_FALSE); + ck_assert_int_eq(elm_object_disabled_get(o), EINA_FALSE); + elm_object_disabled_set(box, EINA_TRUE); + elm_object_disabled_set(o, EINA_TRUE); + ck_assert_int_eq(elm_object_disabled_get(box), EINA_TRUE); + ck_assert_int_eq(elm_object_disabled_get(o), EINA_TRUE); + elm_object_disabled_set(box, EINA_FALSE); + ck_assert_int_eq(elm_object_disabled_get(box), EINA_FALSE); + ck_assert_int_eq(elm_object_disabled_get(o), EINA_TRUE); +} +EFL_END_TEST + void elm_test_box(TCase *tc) { tcase_add_test(tc, elm_box_legacy_type_check); tcase_add_test(tc, elm_atspi_role_get); + tcase_add_test(tc, elm_box_disabled_test); } diff --git a/src/tests/elementary/elm_test_bubble.c b/src/tests/elementary/elm_test_bubble.c index 3d6d71c458..c7527551c9 100644 --- a/src/tests/elementary/elm_test_bubble.c +++ b/src/tests/elementary/elm_test_bubble.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_bubble_legacy_type_check) +EFL_START_TEST(elm_bubble_legacy_type_check) { Evas_Object *win, *bubble; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_bubble_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *bubble; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_button.c b/src/tests/elementary/elm_test_button.c index f5bf6f117a..6b43588a2b 100644 --- a/src/tests/elementary/elm_test_button.c +++ b/src/tests/elementary/elm_test_button.c @@ -8,7 +8,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_button_legacy_type_check) +EFL_START_TEST(elm_button_legacy_type_check) { Evas_Object *win, *button; const char *type; @@ -28,7 +28,7 @@ EFL_START_TEST (elm_button_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *button; Efl_Access_Role role; @@ -43,7 +43,7 @@ EFL_START_TEST (elm_atspi_role_get) } EFL_END_TEST -EFL_START_TEST (elm_atspi_interfaces_check) +EFL_START_TEST(elm_atspi_interfaces_check) { Evas_Object *win, *button; diff --git a/src/tests/elementary/elm_test_calendar.c b/src/tests/elementary/elm_test_calendar.c index cf30958297..e352d7ae2b 100644 --- a/src/tests/elementary/elm_test_calendar.c +++ b/src/tests/elementary/elm_test_calendar.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_calendar_legacy_type_check) +EFL_START_TEST(elm_calendar_legacy_type_check) { Evas_Object *win, *calendar; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_calendar_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *calendar; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_check.c b/src/tests/elementary/elm_test_check.c index af65407f00..e5f8273a69 100644 --- a/src/tests/elementary/elm_test_check.c +++ b/src/tests/elementary/elm_test_check.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_check_legacy_type_check) +EFL_START_TEST(elm_check_legacy_type_check) { Evas_Object *win, *check; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_check_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_check_onoff_text) +EFL_START_TEST(elm_check_onoff_text) { Evas_Object *win, *check; @@ -47,7 +47,7 @@ EFL_START_TEST (elm_check_onoff_text) } EFL_END_TEST -EFL_START_TEST (elm_check_state) +EFL_START_TEST(elm_check_state) { Evas_Object *win, *check; Eina_Bool state = EINA_TRUE; @@ -66,7 +66,7 @@ EFL_START_TEST (elm_check_state) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *check; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_clock.c b/src/tests/elementary/elm_test_clock.c index fde065ee4f..b2b469ef98 100644 --- a/src/tests/elementary/elm_test_clock.c +++ b/src/tests/elementary/elm_test_clock.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_clock_legacy_type_check) +EFL_START_TEST(elm_clock_legacy_type_check) { Evas_Object *win, *clock; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_clock_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *clk; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_colorselector.c b/src/tests/elementary/elm_test_colorselector.c index 194856f2b9..6de6b1c072 100644 --- a/src/tests/elementary/elm_test_colorselector.c +++ b/src/tests/elementary/elm_test_colorselector.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_colorselector_legacy_type_check) +EFL_START_TEST(elm_colorselector_legacy_type_check) { Evas_Object *win, *colorselector; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_colorselector_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_colorselector_palette) +EFL_START_TEST(elm_colorselector_palette) { Evas_Object *win, *c; unsigned int palette_cnt; @@ -51,7 +51,7 @@ EFL_START_TEST (elm_colorselector_palette) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *c; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_config.c b/src/tests/elementary/elm_test_config.c index 6546790f0d..c6745c16a8 100644 --- a/src/tests/elementary/elm_test_config.c +++ b/src/tests/elementary/elm_test_config.c @@ -3,13 +3,14 @@ #endif #define EFL_ACCESS_OBJECT_PROTECTED +#include #include #include "elm_suite.h" #include typedef unsigned int uint; -EFL_START_TEST (elm_config_eoapi) +EFL_START_TEST(elm_config_eoapi) { Eo *cfg = efl_provider_find(efl_main_loop_get(), EFL_CONFIG_INTERFACE); fail_if(!cfg); @@ -95,7 +96,7 @@ EFL_START_TEST (elm_config_eoapi) CONFIG_CHKB(focus_highlight_enabled, !old); CONFIG_CHKB(focus_highlight_animate, 0); CONFIG_CHKB(focus_highlight_clip_disabled, !old); - CONFIG_CHKE(focus_move_policy, EFL_UI_FOCUS_MOVE_POLICY_IN, "in"); + CONFIG_CHKE(focus_move_policy, EFL_UI_FOCUS_MOVE_POLICY_MOVE_IN, "in"); CONFIG_CHKB(item_select_on_focus_disabled, !old); CONFIG_CHKB(first_item_focus_on_first_focusin, 0); CONFIG_CHKB(mirrored, 0); @@ -144,7 +145,7 @@ EFL_START_TEST (elm_config_eoapi) } EFL_END_TEST -EFL_START_TEST (elm_config_win) +EFL_START_TEST(elm_config_win) { Eo *cfg = efl_provider_find(efl_main_loop_get(), EFL_CONFIG_INTERFACE); fail_if(!cfg); @@ -173,7 +174,7 @@ _eina_list_string_has(const Eina_List *list, const char *str) return EINA_FALSE; } -EFL_START_TEST (elm_config_profiles) +EFL_START_TEST(elm_config_profiles) { // this only tests some of the profile APIs. we're not going to mess with // the global config during make check :) diff --git a/src/tests/elementary/elm_test_conformant.c b/src/tests/elementary/elm_test_conformant.c index cdfbd0402b..368bdebeb8 100644 --- a/src/tests/elementary/elm_test_conformant.c +++ b/src/tests/elementary/elm_test_conformant.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_conformant_legacy_type_check) +EFL_START_TEST(elm_conformant_legacy_type_check) { Evas_Object *win, *conformant; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_conformant_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *conformant; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_ctxpopup.c b/src/tests/elementary/elm_test_ctxpopup.c index a9d066e1ed..fb462364aa 100644 --- a/src/tests/elementary/elm_test_ctxpopup.c +++ b/src/tests/elementary/elm_test_ctxpopup.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_ctxpopup_legacy_type_check) +EFL_START_TEST(elm_ctxpopup_legacy_type_check) { Evas_Object *win, *ctxpopup; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_ctxpopup_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *ctxpopup; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_datetime.c b/src/tests/elementary/elm_test_datetime.c index 7a874516ba..1d82c64554 100644 --- a/src/tests/elementary/elm_test_datetime.c +++ b/src/tests/elementary/elm_test_datetime.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_datetime_legacy_type_check) +EFL_START_TEST(elm_datetime_legacy_type_check) { Evas_Object *win, *datetime; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_datetime_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *datetime; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_dayselector.c b/src/tests/elementary/elm_test_dayselector.c index 776687a157..07990b46a0 100644 --- a/src/tests/elementary/elm_test_dayselector.c +++ b/src/tests/elementary/elm_test_dayselector.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_dayselector_legacy_type_check) +EFL_START_TEST(elm_dayselector_legacy_type_check) { Evas_Object *win, *dayselector; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_dayselector_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *dayselector; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_diskselector.c b/src/tests/elementary/elm_test_diskselector.c index 19bf3600ce..e7b210b63a 100644 --- a/src/tests/elementary/elm_test_diskselector.c +++ b/src/tests/elementary/elm_test_diskselector.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_diskselector_legacy_type_check) +EFL_START_TEST(elm_diskselector_legacy_type_check) { Evas_Object *win, *diskselector; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_diskselector_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *diskselector; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_entry.c b/src/tests/elementary/elm_test_entry.c index 8b8091120a..48e31d0b3c 100644 --- a/src/tests/elementary/elm_test_entry.c +++ b/src/tests/elementary/elm_test_entry.c @@ -8,7 +8,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_entry_legacy_type_check) +EFL_START_TEST(elm_entry_legacy_type_check) { Evas_Object *win, *entry; const char *type; @@ -28,7 +28,7 @@ EFL_START_TEST (elm_entry_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_entry_del) +EFL_START_TEST(elm_entry_del) { Evas_Object *win, *entry; @@ -46,7 +46,7 @@ _dummy_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, { } -EFL_START_TEST (elm_entry_signal_callback) +EFL_START_TEST(elm_entry_signal_callback) { Evas_Object *win, *entry; void *data; @@ -85,7 +85,7 @@ EFL_START_TEST (elm_entry_signal_callback) } EFL_END_TEST -EFL_START_TEST (elm_entry_atspi_text_char_get) +EFL_START_TEST(elm_entry_atspi_text_char_get) { Evas_Object *win, *entry; Eina_Unicode *expected; @@ -123,7 +123,7 @@ EFL_START_TEST (elm_entry_atspi_text_char_get) } EFL_END_TEST -EFL_START_TEST (elm_entry_atspi_text_char_count) +EFL_START_TEST(elm_entry_atspi_text_char_count) { Evas_Object *win, *entry; int val; @@ -141,7 +141,7 @@ EFL_START_TEST (elm_entry_atspi_text_char_count) } EFL_END_TEST -EFL_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; @@ -184,7 +184,7 @@ EFL_START_TEST (elm_entry_atspi_text_string_get_char) } EFL_END_TEST -EFL_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; @@ -228,7 +228,7 @@ EFL_START_TEST (elm_entry_atspi_text_string_get_word) } EFL_END_TEST -EFL_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; @@ -272,7 +272,7 @@ EFL_START_TEST (elm_entry_atspi_text_string_get_paragraph) } EFL_END_TEST -EFL_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; @@ -305,7 +305,7 @@ EFL_START_TEST (elm_entry_atspi_text_string_get_line) } EFL_END_TEST -EFL_START_TEST (elm_entry_atspi_text_text_get) +EFL_START_TEST(elm_entry_atspi_text_text_get) { Evas_Object *win, *entry; char *val; @@ -334,7 +334,7 @@ EFL_START_TEST (elm_entry_atspi_text_text_get) } EFL_END_TEST -EFL_START_TEST (elm_entry_atspi_text_selections) +EFL_START_TEST(elm_entry_atspi_text_selections) { Evas_Object *win, *entry; int val, start, end; @@ -378,7 +378,7 @@ EFL_START_TEST (elm_entry_atspi_text_selections) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *entry; Efl_Access_Role role; @@ -393,6 +393,142 @@ EFL_START_TEST (elm_atspi_role_get) } EFL_END_TEST +static Eina_Bool +end_test() +{ + ecore_main_loop_quit(); + return EINA_FALSE; +} + +static void +mag_job(void *e) +{ + evas_event_feed_mouse_out(e, 0, NULL); + evas_event_feed_mouse_in(e, 0, NULL); + evas_event_feed_mouse_move(e, 200, 100, 0, NULL); + evas_event_feed_mouse_down(e, 1, 0, 0, NULL); + real_timer_add(elm_config_longpress_timeout_get() + 0.1, end_test, NULL); +} + +static void +norendered(void *data EINA_UNUSED, Evas *e, void *event_info EINA_UNUSED) +{ + ecore_job_add(mag_job, e); + evas_event_callback_del(e, EVAS_CALLBACK_RENDER_POST, norendered); +} + +EFL_START_TEST(elm_entry_magnifier) +{ + Evas_Object *win, *entry; + char buf[4096]; + + win = win_add_focused(NULL, "entry", ELM_WIN_BASIC); + evas_object_size_hint_weight_set(win, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + entry = elm_entry_add(win); + elm_entry_line_wrap_set(entry, ELM_WRAP_NONE); + snprintf(buf, sizeof(buf), + "This is an entry widget in this window that
" + "uses markup like this for styling and
" + "formatting like this, as well as
" + "links in the text, so enter text
" + "in here to edit it. By the way, links are
" + "called Anchors so you will need
" + "to refer to them this way.
" + "
" + + "Also you can stick in items with (relsize + ascent): " + "" + " (full) " + "" + " (to the left)
" + + "Also (size + ascent): " + "" + " (full) " + "" + " (before this)
" + + "And as well (absize + ascent): " + "" + " (full) " + "" + " or even paths to image files on disk too like: " + "" + " ... end." + , elm_app_data_dir_get() + ); + elm_object_text_set(entry, buf); + evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(entry); + elm_win_resize_object_add(win, entry); + evas_object_show(win); + evas_object_resize(entry, 600, 400); + evas_object_resize(win, 600, 400); + evas_smart_objects_calculate(evas_object_evas_get(win)); + evas_event_callback_add(evas_object_evas_get(win), EVAS_CALLBACK_RENDER_POST, norendered, NULL); + ecore_main_loop_begin(); +} +EFL_END_TEST + +EFL_START_TEST(elm_entry_text_set) +{ + Evas_Object *win, *entry; + const char *entry_text = "hello world"; + const char *entry_text2 = "scrollable"; + + win = win_add(NULL, "entry", ELM_WIN_BASIC); + + entry = elm_entry_add(win); + + ck_assert(elm_layout_text_set(entry, NULL, entry_text)); + ck_assert_str_eq(elm_object_text_get(entry), entry_text); + + elm_entry_scrollable_set(entry, EINA_TRUE); + ck_assert(elm_layout_text_set(entry, NULL, entry_text2)); + ck_assert_str_eq(elm_object_text_get(entry), entry_text2); +} +EFL_END_TEST + +EFL_START_TEST(elm_entry_file_get_set) +{ + Evas_Object *win, *entry; + const char *file_path = NULL; + Elm_Text_Format format = ELM_TEXT_FORMAT_PLAIN_UTF8; + + win = win_add(NULL, "entry", ELM_WIN_BASIC); + entry = elm_entry_add(win); + + ck_assert(elm_entry_file_set(entry, TESTS_SRC_DIR"/testfile_entry.txt", ELM_TEXT_FORMAT_PLAIN_UTF8)); + elm_entry_file_get(entry, &file_path, &format); + fprintf(stderr, "elm_entry_file_get_set1 %s, %s, %d\n", elm_object_text_get(entry), file_path, format); + + ck_assert_str_eq(elm_object_text_get(entry), "hello world
"); + ck_assert_str_eq(file_path, TESTS_SRC_DIR"/testfile_entry.txt"); + ck_assert(format == ELM_TEXT_FORMAT_PLAIN_UTF8); + + ck_assert(elm_entry_file_set(entry, TESTS_SRC_DIR"/testfile_entry2.txt", ELM_TEXT_FORMAT_PLAIN_UTF8)); + elm_entry_file_get(entry, &file_path, &format); + fprintf(stderr, "elm_entry_file_get_set2 %s, %s, %d\n", elm_object_text_get(entry), file_path, format); + + ck_assert_str_eq(elm_object_text_get(entry), "hello elementary
hello entry
"); + ck_assert_str_eq(file_path, TESTS_SRC_DIR"/testfile_entry2.txt"); + ck_assert(format == ELM_TEXT_FORMAT_PLAIN_UTF8); + + ck_assert(elm_entry_file_set(entry, NULL, ELM_TEXT_FORMAT_PLAIN_UTF8)); + elm_entry_file_get(entry, &file_path, &format); + fprintf(stderr, "elm_entry_file_get_set3 %s, %s, %d\n", elm_object_text_get(entry), file_path, format); + + ck_assert_str_eq(elm_object_text_get(entry), ""); + ck_assert(file_path == NULL); + ck_assert(format == ELM_TEXT_FORMAT_PLAIN_UTF8); + + fprintf(stderr, "elm_entry_file_get_set4\n"); + +} +EFL_END_TEST + void elm_test_entry(TCase *tc) { tcase_add_test(tc, elm_entry_legacy_type_check); @@ -407,4 +543,7 @@ void elm_test_entry(TCase *tc) tcase_add_test(tc, elm_entry_atspi_text_text_get); tcase_add_test(tc, elm_entry_atspi_text_selections); tcase_add_test(tc, elm_atspi_role_get); + tcase_add_test(tc, elm_entry_text_set); + tcase_add_test(tc, elm_entry_magnifier); + tcase_add_test(tc, elm_entry_file_get_set); } diff --git a/src/tests/elementary/elm_test_fileselector.c b/src/tests/elementary/elm_test_fileselector.c index 52eb5c8840..b26e12fc51 100644 --- a/src/tests/elementary/elm_test_fileselector.c +++ b/src/tests/elementary/elm_test_fileselector.c @@ -6,6 +6,44 @@ #include #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")); + + 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; + + win = win_add(NULL, "fileselector", ELM_WIN_BASIC); + + fileselector = elm_fileselector_add(win); + role = efl_access_object_role_get(fileselector); + + ck_assert(role == EFL_ACCESS_ROLE_FILE_CHOOSER); + +} +EFL_END_TEST + +#if 0 + static Eina_Bool timer_expired_cb(void *user_data) { @@ -45,42 +83,6 @@ fileselector_test_helper_wait_flag(double in, Eina_Bool *done) return !did_timeout; } - -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")); - - 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; - - win = win_add(NULL, "fileselector", ELM_WIN_BASIC); - - fileselector = elm_fileselector_add(win); - role = efl_access_object_role_get(fileselector); - - ck_assert(role == EFL_ACCESS_ROLE_FILE_CHOOSER); - -} -EFL_END_TEST - static void _ready_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { @@ -90,7 +92,8 @@ _ready_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED ecore_main_loop_quit(); } -EFL_START_TEST (elm_fileselector_selected) + +EFL_START_TEST(elm_fileselector_selected) { Evas_Object *win, *fileselector; Eina_Tmpstr *tmp_path; @@ -118,7 +121,6 @@ EFL_START_TEST (elm_fileselector_selected) fileselector = elm_fileselector_add(win); evas_object_smart_callback_add(fileselector, "directory,open", _ready_cb, &open); - evas_object_smart_callback_add(fileselector, "selected", _ready_cb, &selected); ck_assert(!elm_fileselector_selected_set(fileselector, no_exist)); @@ -128,9 +130,13 @@ EFL_START_TEST (elm_fileselector_selected) ck_assert_str_eq(elm_fileselector_selected_get(fileselector), path); + evas_object_smart_callback_del(fileselector, "directory,open", _ready_cb); + evas_object_smart_callback_add(fileselector, "selected", _ready_cb, &selected); + selected = EINA_FALSE; ck_assert(elm_fileselector_selected_set(fileselector, exist)); ck_assert(fileselector_test_helper_wait_flag(10, &selected)); + ck_assert(selected == EINA_TRUE); ck_assert_str_eq(elm_fileselector_selected_get(fileselector), exist); @@ -141,10 +147,13 @@ EFL_START_TEST (elm_fileselector_selected) } EFL_END_TEST +#endif + 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); + //FIXME this should be reenabled when issues on travis are fixed with this. + //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 c5bba5ccfa..291237730d 100644 --- a/src/tests/elementary/elm_test_fileselector_button.c +++ b/src/tests/elementary/elm_test_fileselector_button.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_fileselector_button_legacy_type_check) +EFL_START_TEST(elm_fileselector_button_legacy_type_check) { Evas_Object *win, *fs_button; const char *type; @@ -26,7 +26,20 @@ EFL_START_TEST (elm_fileselector_button_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_fileselector_button_current_name) +{ + Evas_Object *win, *fs_button; + + win = win_add(NULL, "fileselector_button", ELM_WIN_BASIC); + + fs_button = elm_fileselector_button_add(win); + + elm_fileselector_current_name_set(fs_button, "test.txt"); + ck_assert_str_eq(elm_fileselector_current_name_get(fs_button), "test.txt"); +} +EFL_END_TEST + +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *fs_button; Efl_Access_Role role; @@ -44,5 +57,6 @@ EFL_END_TEST void elm_test_fileselector_button(TCase *tc) { tcase_add_test(tc, elm_fileselector_button_legacy_type_check); + tcase_add_test(tc, elm_fileselector_button_current_name); 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 9fa0f14b66..7fadfcb726 100644 --- a/src/tests/elementary/elm_test_fileselector_entry.c +++ b/src/tests/elementary/elm_test_fileselector_entry.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_fileselector_entry_legacy_type_check) +EFL_START_TEST(elm_fileselector_entry_legacy_type_check) { Evas_Object *win, *fileselector_entry; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_fileselector_entry_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *fs_entry; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_flip.c b/src/tests/elementary/elm_test_flip.c index c0bbd4e79f..49b6a56bcc 100644 --- a/src/tests/elementary/elm_test_flip.c +++ b/src/tests/elementary/elm_test_flip.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_flip_legacy_type_check) +EFL_START_TEST(elm_flip_legacy_type_check) { Evas_Object *win, *flip; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_flip_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *flip; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_flipselector.c b/src/tests/elementary/elm_test_flipselector.c index a4c3bafa88..1d2e70aa9a 100644 --- a/src/tests/elementary/elm_test_flipselector.c +++ b/src/tests/elementary/elm_test_flipselector.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_flipselector_legacy_type_check) +EFL_START_TEST(elm_flipselector_legacy_type_check) { Evas_Object *win, *flipselector; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_flipselector_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *flipselector; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_frame.c b/src/tests/elementary/elm_test_frame.c index 4b56c9170f..e7be0311e5 100644 --- a/src/tests/elementary/elm_test_frame.c +++ b/src/tests/elementary/elm_test_frame.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_frame_legacy_type_check) +EFL_START_TEST(elm_frame_legacy_type_check) { Evas_Object *win, *frame; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_frame_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *frame; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_gengrid.c b/src/tests/elementary/elm_test_gengrid.c index 95e55052a9..77a4eb46f7 100644 --- a/src/tests/elementary/elm_test_gengrid.c +++ b/src/tests/elementary/elm_test_gengrid.c @@ -8,7 +8,7 @@ static Elm_Gengrid_Item_Class *gic = NULL; -EFL_START_TEST (elm_gengrid_legacy_type_check) +EFL_START_TEST(elm_gengrid_legacy_type_check) { Evas_Object *win, *gengrid; const char *type; @@ -28,7 +28,7 @@ EFL_START_TEST (elm_gengrid_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *gengrid; Efl_Access_Role role; @@ -101,7 +101,7 @@ _realized(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info ecore_main_loop_quit(); } -EFL_START_TEST (elm_gengrid_focus) +EFL_START_TEST(elm_gengrid_focus) { Evas_Object *win, *grid, *bx, *bt; Elm_Object_Item *it; @@ -153,11 +153,62 @@ EFL_START_TEST (elm_gengrid_focus) } EFL_END_TEST +static void +_gengrid_item_content_test_realize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + ecore_main_loop_quit(); +} + +static Evas_Object * +_item_content_get(void *data EINA_UNUSED, Evas_Object *obj, const char *part EINA_UNUSED) +{ + Evas_Object *ic = elm_button_add(obj); + return ic; +} + +EFL_START_TEST(elm_gengrid_item_content) +{ + Evas_Object *win, *gengrid; + Elm_Genlist_Item_Class *gtc; + Evas_Object *content, *parent; + Elm_Object_Item *it; + + gtc = elm_gengrid_item_class_new(); + gtc->item_style = "default"; + gtc->func.content_get = _item_content_get; + gtc->func.state_get = NULL; + gtc->func.del = NULL; + + win = win_add(NULL, "gengrid", ELM_WIN_BASIC); + + gengrid = elm_gengrid_add(win); + evas_object_smart_callback_add(gengrid, "realized", _gengrid_item_content_test_realize, NULL); + + it = elm_gengrid_item_append(gengrid, gtc, NULL, NULL, NULL); + + evas_object_resize(gengrid, 100, 100); + evas_object_resize(win, 150, 150); + evas_object_show(gengrid); + evas_object_show(win); + + ecore_main_loop_begin(); + + content = elm_object_item_part_content_get(it, "elm.swallow.end"); + parent = elm_object_parent_widget_get(content); + ck_assert_ptr_eq(parent, gengrid); + + elm_gengrid_item_all_contents_unset(it, NULL); + parent = elm_object_parent_widget_get(content); + ck_assert_ptr_eq(parent, win); +} +EFL_END_TEST + void elm_test_gengrid(TCase *tc) { tcase_add_test(tc, elm_gengrid_legacy_type_check); tcase_add_test(tc, elm_atspi_role_get); tcase_add_test(tc, elm_gengrid_focus); + tcase_add_test(tc, elm_gengrid_item_content); #if 0 tcase_add_test(tc, elm_atspi_children_parent); #endif diff --git a/src/tests/elementary/elm_test_genlist.c b/src/tests/elementary/elm_test_genlist.c index 60c9d0028a..1ffec17647 100644 --- a/src/tests/elementary/elm_test_genlist.c +++ b/src/tests/elementary/elm_test_genlist.c @@ -88,7 +88,7 @@ verify_item_iteration_api(Elm_Object_Item *parent) } } -EFL_START_TEST (elm_genlist_test_item_iteration) +EFL_START_TEST(elm_genlist_test_item_iteration) { Elm_Object_Item *parent; int i; @@ -119,7 +119,57 @@ EFL_START_TEST (elm_genlist_test_item_iteration) } EFL_END_TEST -EFL_START_TEST (elm_genlist_test_legacy_type_check) +static void +_genlist_item_content_test_realize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + ecore_main_loop_quit(); +} + +static Evas_Object * +_item_content_get(void *data EINA_UNUSED, Evas_Object *obj, const char *part EINA_UNUSED) +{ + Evas_Object *ic = elm_button_add(obj); + return ic; +} + +EFL_START_TEST(elm_genlist_test_item_content) +{ + Elm_Genlist_Item_Class *gtc; + Evas_Object *content, *parent; + Elm_Object_Item *it; + + gtc = elm_genlist_item_class_new(); + gtc->item_style = "default"; + gtc->func.content_get = _item_content_get; + gtc->func.state_get = NULL; + gtc->func.del = NULL; + + win = win_add(NULL, "genlist", ELM_WIN_BASIC); + + genlist = elm_genlist_add(win); + evas_object_smart_callback_add(genlist, "realized", _genlist_item_content_test_realize, NULL); + + it = elm_genlist_item_append(genlist, gtc, NULL, NULL, + ELM_GENLIST_ITEM_NONE, NULL, NULL); + + evas_object_resize(genlist, 100, 100); + evas_object_resize(win, 150, 150); + evas_object_show(genlist); + evas_object_show(win); + + ecore_main_loop_begin(); + + content = elm_object_item_part_content_get(it, "elm.swallow.end"); + parent = elm_object_parent_widget_get(content); + ck_assert_ptr_eq(parent, genlist); + + elm_genlist_item_all_contents_unset(it, NULL); + parent = elm_object_parent_widget_get(content); + ck_assert_ptr_eq(parent, win); +} +EFL_END_TEST + +EFL_START_TEST(elm_genlist_test_legacy_type_check) { const char *type; @@ -145,7 +195,7 @@ void test_init(void) genlist = elm_genlist_add(win); } -EFL_START_TEST (elm_genlist_test_atspi_role_get) +EFL_START_TEST(elm_genlist_test_atspi_role_get) { test_init(); @@ -220,7 +270,7 @@ EFL_START_TEST(elm_genlist_test_atspi_children_events_add) Elm_Object_Item *it[3]; - efl_access_object_event_handler_add(EFL_ACCESS_OBJECT_MIXIN, _children_changed_cb, NULL); + efl_access_object_event_handler_add(_children_changed_cb, NULL); it[0] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); ck_assert(genlist == current); @@ -256,7 +306,7 @@ EFL_START_TEST(elm_genlist_test_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_object_event_handler_add(EFL_ACCESS_OBJECT_MIXIN, _children_changed_cb, NULL); + efl_access_object_event_handler_add(_children_changed_cb, NULL); elm_object_item_del(it[0]); ck_assert(genlist == current); @@ -283,7 +333,7 @@ EFL_START_TEST(elm_genlist_test_atspi_children_events_del2) it = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); - efl_access_object_event_handler_add(EFL_ACCESS_OBJECT_MIXIN, _children_changed_cb, NULL); + efl_access_object_event_handler_add(_children_changed_cb, NULL); elm_genlist_clear(genlist); ck_assert(genlist == current); @@ -466,13 +516,13 @@ EFL_START_TEST(elm_genlist_test_tree_expand) tree_abort = eina_log_abort_on_critical_get(); tree_abort_level = eina_log_abort_on_critical_level_get(); /* this should never trigger errors */ - eina_log_abort_on_critical_level_set(2); + eina_log_abort_on_critical_level_set(1); eina_log_abort_on_critical_set(1); ecore_main_loop_begin(); } EFL_END_TEST -EFL_START_TEST (elm_genlist_test_focus_state) +EFL_START_TEST(elm_genlist_test_focus_state) { Elm_Object_Item *it; Evas_Object *btn; @@ -520,6 +570,7 @@ void elm_test_genlist(TCase *tc) tcase_add_test(tc, elm_genlist_test_legacy_type_check); tcase_add_test(tc, elm_genlist_test_item_destroy); tcase_add_test(tc, elm_genlist_test_item_iteration); + tcase_add_test(tc, elm_genlist_test_item_content); tcase_add_test(tc, elm_genlist_test_atspi_role_get); tcase_add_test(tc, elm_genlist_test_atspi_children_get1); tcase_add_test(tc, elm_genlist_test_atspi_children_get2); diff --git a/src/tests/elementary/elm_test_glview.c b/src/tests/elementary/elm_test_glview.c index 2d1c8a3609..3c91db9402 100644 --- a/src/tests/elementary/elm_test_glview.c +++ b/src/tests/elementary/elm_test_glview.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_glview_legacy_type_check) +EFL_START_TEST(elm_glview_legacy_type_check) { Evas_Object *win, *glview; const char *type; @@ -29,7 +29,7 @@ EFL_START_TEST (elm_glview_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *glview; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_grid.c b/src/tests/elementary/elm_test_grid.c index f014c712a3..3f4ace2c43 100644 --- a/src/tests/elementary/elm_test_grid.c +++ b/src/tests/elementary/elm_test_grid.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_grid_legacy_type_check) +EFL_START_TEST(elm_grid_legacy_type_check) { Evas_Object *win, *grid; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_grid_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *grid; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_hover.c b/src/tests/elementary/elm_test_hover.c index 42db4b667f..de275216f2 100644 --- a/src/tests/elementary/elm_test_hover.c +++ b/src/tests/elementary/elm_test_hover.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_hover_legacy_type_check) +EFL_START_TEST(elm_hover_legacy_type_check) { Evas_Object *win, *hover; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_hover_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *hover; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_hoversel.c b/src/tests/elementary/elm_test_hoversel.c index 982ab6f824..91de6afee0 100644 --- a/src/tests/elementary/elm_test_hoversel.c +++ b/src/tests/elementary/elm_test_hoversel.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_hoversel_legacy_type_check) +EFL_START_TEST(elm_hoversel_legacy_type_check) { Evas_Object *win, *hoversel; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_hoversel_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *hoversel; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_icon.c b/src/tests/elementary/elm_test_icon.c index 9580e4ebb4..517ace64a2 100644 --- a/src/tests/elementary/elm_test_icon.c +++ b/src/tests/elementary/elm_test_icon.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_icon_legacy_type_check) +EFL_START_TEST(elm_icon_legacy_type_check) { Evas_Object *win, *icon; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_icon_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *icon; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_image.c b/src/tests/elementary/elm_test_image.c index e1e36b4f82..6d6ff52f6f 100644 --- a/src/tests/elementary/elm_test_image.c +++ b/src/tests/elementary/elm_test_image.c @@ -3,6 +3,7 @@ #endif #define EFL_ACCESS_OBJECT_BETA +#include #include #include "elm_suite.h" @@ -17,7 +18,7 @@ struct _Test_Data int success; }; -EFL_START_TEST (elm_image_legacy_type_check) +EFL_START_TEST(elm_image_legacy_type_check) { Evas_Object *win, *image; const char *type; @@ -37,7 +38,7 @@ EFL_START_TEST (elm_image_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *image; Efl_Access_Role role; @@ -127,7 +128,7 @@ _timeout_cb(void *data) return ECORE_CALLBACK_CANCEL; } -EFL_START_TEST (elm_image_async_path) +EFL_START_TEST(elm_image_async_path) { Evas_Object *win, *image; Ecore_Timer *t; @@ -157,7 +158,7 @@ EFL_START_TEST (elm_image_async_path) } EFL_END_TEST -EFL_START_TEST (elm_image_async_mmap) +EFL_START_TEST(elm_image_async_mmap) { Evas_Object *win, *image; Ecore_Timer *t; @@ -195,7 +196,7 @@ EFL_START_TEST (elm_image_async_mmap) } EFL_END_TEST -EFL_START_TEST (elm_image_evas_object_color_set) +EFL_START_TEST(elm_image_evas_object_color_set) { Evas_Object *win, *image; int r = 128, g = 99, b = 3, a = 230; @@ -213,7 +214,7 @@ EFL_START_TEST (elm_image_evas_object_color_set) } EFL_END_TEST -EFL_START_TEST (elm_image_evas_image_get) +EFL_START_TEST(elm_image_evas_image_get) { Evas_Object *win, *image, *obj; @@ -226,7 +227,7 @@ EFL_START_TEST (elm_image_evas_image_get) } EFL_END_TEST -EFL_START_TEST (efl_ui_image_icon) +EFL_START_TEST(efl_ui_image_icon) { Evas_Object *win, *image; Eina_Bool ok; diff --git a/src/tests/elementary/elm_test_index.c b/src/tests/elementary/elm_test_index.c index c335da6551..7baf8396a4 100644 --- a/src/tests/elementary/elm_test_index.c +++ b/src/tests/elementary/elm_test_index.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_index_legacy_type_check) +EFL_START_TEST(elm_index_legacy_type_check) { Evas_Object *win, *index; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_index_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *idx; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_init.c b/src/tests/elementary/elm_test_init.c index da3a584cab..60d3460b79 100644 --- a/src/tests/elementary/elm_test_init.c +++ b/src/tests/elementary/elm_test_init.c @@ -5,7 +5,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_main) +EFL_START_TEST(elm_main) { } EFL_END_TEST diff --git a/src/tests/elementary/elm_test_inwin.c b/src/tests/elementary/elm_test_inwin.c index 5817aeb32a..f4cc8b457a 100644 --- a/src/tests/elementary/elm_test_inwin.c +++ b/src/tests/elementary/elm_test_inwin.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_inwin_legacy_type_check) +EFL_START_TEST(elm_inwin_legacy_type_check) { Evas_Object *win, *inwin; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_inwin_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *inwin; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_label.c b/src/tests/elementary/elm_test_label.c index 55ca1becdb..81e92853f4 100644 --- a/src/tests/elementary/elm_test_label.c +++ b/src/tests/elementary/elm_test_label.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_label_legacy_type_check) +EFL_START_TEST(elm_label_legacy_type_check) { Evas_Object *win, *label; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_label_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *label; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_layout.c b/src/tests/elementary/elm_test_layout.c index bead485a03..5184086538 100644 --- a/src/tests/elementary/elm_test_layout.c +++ b/src/tests/elementary/elm_test_layout.c @@ -48,79 +48,31 @@ EFL_START_TEST(elm_layout_test_swallows) win = win_add(NULL, "layout", ELM_WIN_BASIC); - ly = efl_add(EFL_UI_LAYOUT_CLASS, win); + ly = elm_layout_add(win); snprintf(buf, sizeof(buf), "%s/objects/test.edj", ELM_TEST_DATA_DIR); elm_layout_file_set(ly, buf, "layout"); evas_object_show(ly); - bt = efl_add(EFL_UI_BUTTON_CLASS, ly); - fail_if(!efl_content_set(efl_part(ly, "element1"), bt)); + bt = elm_button_add(ly); + fail_if(!elm_layout_content_set(ly, "element1", bt)); ck_assert_ptr_eq(efl_parent_get(bt), ly); - bt = efl_content_unset(efl_part(ly, "element1")); + bt = elm_object_part_content_unset(ly, "element1"); ck_assert_ptr_eq(efl_parent_get(bt), evas_object_evas_get(bt)); - fail_if(!efl_content_set(efl_part(ly, "element1"), bt)); + fail_if(!elm_layout_content_set(ly, "element1", bt)); ck_assert_ptr_eq(efl_parent_get(bt), ly); - bt2 = efl_add(EFL_UI_BUTTON_CLASS, ly); - fail_if(!efl_content_set(efl_part(ly, "element1"), bt2)); + bt2 = elm_button_add(ly); + fail_if(!elm_layout_content_set(ly, "element1", bt2)); ck_assert_ptr_eq(efl_parent_get(bt2), ly); } 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; -} - -EFL_START_TEST(elm_layout_test_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"; - - win = win_add(NULL, "layout", ELM_WIN_BASIC); - - ly = efl_add(EFL_UI_LAYOUT_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); - - 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)); - f = efl_model_property_set(model, "text_property", &v); - eina_future_then(f, _propagated_cb, NULL, NULL); - - efl_ui_model_connect(ly, "text", "text_property"); - efl_ui_view_model_set(ly, model); - - ecore_main_loop_begin(); - - part_text = elm_layout_text_get(ly, "text"); - - ck_assert_str_eq(part_text, text_value); - -} -EFL_END_TEST - void elm_test_layout(TCase *tc) { tcase_add_test(tc, elm_layout_test_legacy_type_check); tcase_add_test(tc, elm_atspi_role_get); tcase_add_test(tc, elm_layout_test_swallows); - tcase_add_test(tc, elm_layout_test_model_connect); } diff --git a/src/tests/elementary/elm_test_list.c b/src/tests/elementary/elm_test_list.c index 125292613f..d15fb249f7 100644 --- a/src/tests/elementary/elm_test_list.c +++ b/src/tests/elementary/elm_test_list.c @@ -8,7 +8,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_list_legacy_type_check) +EFL_START_TEST(elm_list_legacy_type_check) { Evas_Object *win, *list; const char *type; @@ -32,7 +32,7 @@ EFL_END_TEST // Skip following tests until Elm_Widget_Item will migrate to Eo infrastructure // and following features can be implemented -EFL_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; @@ -58,7 +58,7 @@ EFL_START_TEST (elm_list_atspi_selection_selected_children_count_get) } EFL_END_TEST -EFL_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; @@ -77,7 +77,7 @@ EFL_START_TEST (elm_list_atspi_selection_child_select) } EFL_END_TEST -EFL_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; @@ -99,7 +99,7 @@ EFL_START_TEST (elm_list_atspi_selection_selected_child_deselect) } EFL_END_TEST -EFL_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; @@ -121,7 +121,7 @@ EFL_START_TEST (elm_list_atspi_selection_is_child_selected) } EFL_END_TEST -EFL_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; @@ -148,7 +148,7 @@ EFL_START_TEST (elm_list_atspi_selection_all_children_select) EFL_END_TEST -EFL_START_TEST (elm_list_atspi_selection_clear) +EFL_START_TEST(elm_list_atspi_selection_clear) { Evas_Object *win, *list; Elm_Object_Item *item1, *item2; @@ -173,7 +173,7 @@ EFL_START_TEST (elm_list_atspi_selection_clear) } EFL_END_TEST -EFL_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; @@ -197,7 +197,7 @@ EFL_END_TEST #endif -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *list; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_map.c b/src/tests/elementary/elm_test_map.c index c39da353b2..2694db1827 100644 --- a/src/tests/elementary/elm_test_map.c +++ b/src/tests/elementary/elm_test_map.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_map_legacy_type_check) +EFL_START_TEST(elm_map_legacy_type_check) { Evas_Object *win, *map; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_map_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *map; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_mapbuf.c b/src/tests/elementary/elm_test_mapbuf.c index 9a1111d1b9..699a0e6799 100644 --- a/src/tests/elementary/elm_test_mapbuf.c +++ b/src/tests/elementary/elm_test_mapbuf.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_mapbuf_legacy_type_check) +EFL_START_TEST(elm_mapbuf_legacy_type_check) { Evas_Object *win, *mapbuf; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_mapbuf_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *mapbuf; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_menu.c b/src/tests/elementary/elm_test_menu.c index 05b9996e2e..383063aa30 100644 --- a/src/tests/elementary/elm_test_menu.c +++ b/src/tests/elementary/elm_test_menu.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_menu_legacy_type_check) +EFL_START_TEST(elm_menu_legacy_type_check) { Evas_Object *win, *menu; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_menu_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *menu; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_multibuttonentry.c b/src/tests/elementary/elm_test_multibuttonentry.c index 79fd0f3ade..fa77c54908 100644 --- a/src/tests/elementary/elm_test_multibuttonentry.c +++ b/src/tests/elementary/elm_test_multibuttonentry.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_multibuttonentry_legacy_type_check) +EFL_START_TEST(elm_multibuttonentry_legacy_type_check) { Evas_Object *win, *multibuttonentry; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_multibuttonentry_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *multibuttonentry; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_naviframe.c b/src/tests/elementary/elm_test_naviframe.c index 507711e0a8..159169b5dc 100644 --- a/src/tests/elementary/elm_test_naviframe.c +++ b/src/tests/elementary/elm_test_naviframe.c @@ -9,7 +9,7 @@ static int prev_abort; static int prev_abort_level; -EFL_START_TEST (elm_naviframe_test_legacy_type_check) +EFL_START_TEST(elm_naviframe_test_legacy_type_check) { Evas_Object *win, *naviframe; const char *type; @@ -29,7 +29,7 @@ EFL_START_TEST (elm_naviframe_test_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_naviframe_test_atspi_role_get) +EFL_START_TEST(elm_naviframe_test_atspi_role_get) { Evas_Object *win, *naviframe; Efl_Access_Role role; @@ -78,7 +78,7 @@ _transition_finished(void *data EINA_UNUSED, Evas_Object *obj, void *event_info popped_it = elm_naviframe_item_pop(obj); } -EFL_START_TEST (elm_naviframe_test_content_preserve_on_pop) +EFL_START_TEST(elm_naviframe_test_content_preserve_on_pop) { Evas_Object *win, *naviframe; diff --git a/src/tests/elementary/elm_test_notify.c b/src/tests/elementary/elm_test_notify.c index d32e596cb8..b1fd7a721d 100644 --- a/src/tests/elementary/elm_test_notify.c +++ b/src/tests/elementary/elm_test_notify.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_notify_legacy_type_check) +EFL_START_TEST(elm_notify_legacy_type_check) { Evas_Object *win, *notify; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_notify_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *notify; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_panel.c b/src/tests/elementary/elm_test_panel.c index 2460443e53..c1b44229d8 100644 --- a/src/tests/elementary/elm_test_panel.c +++ b/src/tests/elementary/elm_test_panel.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_panel_legacy_type_check) +EFL_START_TEST(elm_panel_legacy_type_check) { Evas_Object *win, *panel; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_panel_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *panel; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_panes.c b/src/tests/elementary/elm_test_panes.c index 367fce6943..9d88956950 100644 --- a/src/tests/elementary/elm_test_panes.c +++ b/src/tests/elementary/elm_test_panes.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_panes_legacy_type_check) +EFL_START_TEST(elm_panes_legacy_type_check) { Evas_Object *win, *panes; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_panes_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *panes; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_photo.c b/src/tests/elementary/elm_test_photo.c index ec610996ff..159b71cae9 100644 --- a/src/tests/elementary/elm_test_photo.c +++ b/src/tests/elementary/elm_test_photo.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_photo_legacy_type_check) +EFL_START_TEST(elm_photo_legacy_type_check) { Evas_Object *win, *photo; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_photo_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *photo; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_photocam.c b/src/tests/elementary/elm_test_photocam.c index 311b73525b..8313fdb0d2 100644 --- a/src/tests/elementary/elm_test_photocam.c +++ b/src/tests/elementary/elm_test_photocam.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_photocam_legacy_type_check) +EFL_START_TEST(elm_photocam_legacy_type_check) { Evas_Object *win, *photocam; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_photocam_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *photocam; Efl_Access_Role role; @@ -41,27 +41,19 @@ EFL_START_TEST (elm_atspi_role_get) } EFL_END_TEST -EFL_START_TEST (efl_ui_image_zoomable_icon) +EFL_START_TEST(elm_photocam_file) { - Evas_Object *win, *img_zoomable; - Eina_Bool ok; - const char *icon_name; + Evas_Object *win, *photocam; + const char *buf = ELM_IMAGE_DATA_DIR "/images/logo_small.png"; win = win_add(NULL, "photocam", ELM_WIN_BASIC); + photocam = elm_photocam_add(win); - img_zoomable = efl_add(EFL_UI_IMAGE_ZOOMABLE_CLASS, win); - evas_object_show(img_zoomable); - - ok = efl_ui_image_icon_set(img_zoomable, "folder"); - ck_assert(ok); - icon_name = efl_ui_image_icon_get(img_zoomable); - ck_assert_str_eq(icon_name, "folder"); - - ok = efl_ui_image_icon_set(img_zoomable, "None"); - ck_assert(ok == 0); - icon_name = efl_ui_image_icon_get(img_zoomable); - ck_assert(icon_name == NULL); + ck_assert_int_eq(elm_photocam_file_set(photocam, buf), EVAS_LOAD_ERROR_NONE); + ck_assert_str_eq(elm_photocam_file_get(photocam), buf); + ck_assert_int_eq(elm_photocam_file_set(photocam, "non_existing.png"), EVAS_LOAD_ERROR_DOES_NOT_EXIST); + ck_assert_str_eq(elm_photocam_file_get(photocam), "non_existing.png"); } EFL_END_TEST @@ -69,5 +61,5 @@ 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); + tcase_add_test(tc, elm_photocam_file); } diff --git a/src/tests/elementary/elm_test_player.c b/src/tests/elementary/elm_test_player.c index 307aa301b9..7cdbe5761c 100644 --- a/src/tests/elementary/elm_test_player.c +++ b/src/tests/elementary/elm_test_player.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_player_legacy_type_check) +EFL_START_TEST(elm_player_legacy_type_check) { Evas_Object *win, *player; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_player_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *player; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_plug.c b/src/tests/elementary/elm_test_plug.c index 3f3441862c..ef12e183d6 100644 --- a/src/tests/elementary/elm_test_plug.c +++ b/src/tests/elementary/elm_test_plug.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_plug_legacy_type_check) +EFL_START_TEST(elm_plug_legacy_type_check) { Evas_Object *win, *plug; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_plug_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *plug; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_popup.c b/src/tests/elementary/elm_test_popup.c index e288bab9a9..ba3143eb17 100644 --- a/src/tests/elementary/elm_test_popup.c +++ b/src/tests/elementary/elm_test_popup.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_popup_legacy_type_check) +EFL_START_TEST(elm_popup_legacy_type_check) { Evas_Object *win, *popup; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_popup_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *popup; Efl_Access_Role role; @@ -49,7 +49,7 @@ _focus_cb(void *data, Evas_Object *obj EINA_UNUSED, } -EFL_START_TEST (elm_popup_focus_get) +EFL_START_TEST(elm_popup_focus_get) { Evas_Object *win, *popup; Eina_Bool focused = EINA_FALSE; @@ -70,9 +70,24 @@ EFL_START_TEST (elm_popup_focus_get) } EFL_END_TEST +EFL_START_TEST(elm_popup_text_set) +{ + Evas_Object *win, *popup; + const char *popup_text = "hello world"; + + win = win_add(NULL, "popup", ELM_WIN_BASIC); + + popup = elm_popup_add(win); + + ck_assert(elm_layout_text_set(popup, NULL, popup_text)); + ck_assert_str_eq(elm_object_text_get(popup), popup_text); +} +EFL_END_TEST + void elm_test_popup(TCase *tc) { tcase_add_test(tc, elm_popup_focus_get); tcase_add_test(tc, elm_popup_legacy_type_check); + tcase_add_test(tc, elm_popup_text_set); 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 64186e56ec..23b0098b25 100644 --- a/src/tests/elementary/elm_test_prefs.c +++ b/src/tests/elementary/elm_test_prefs.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_prefs_legacy_type_check) +EFL_START_TEST(elm_prefs_legacy_type_check) { Evas_Object *win, *prefs; const char *type; @@ -29,7 +29,7 @@ EFL_START_TEST (elm_prefs_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { #if 0 Evas_Object *win, *prefs; diff --git a/src/tests/elementary/elm_test_progressbar.c b/src/tests/elementary/elm_test_progressbar.c index c0f6f0fb5b..2ad2808de6 100644 --- a/src/tests/elementary/elm_test_progressbar.c +++ b/src/tests/elementary/elm_test_progressbar.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_progressbar_legacy_type_check) +EFL_START_TEST(elm_progressbar_legacy_type_check) { Evas_Object *win, *progressbar; const char *type; @@ -26,7 +26,23 @@ EFL_START_TEST (elm_progressbar_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_progressbar_custom_unit_check) +{ + Evas_Object *win, *progressbar; + char format[50]; + + snprintf(format, sizeof(format), "%d percent (%d%%)", 50, 50); + + win = win_add(NULL, "progressbar", ELM_WIN_BASIC); + + progressbar = elm_progressbar_add(win); + elm_progressbar_unit_format_set(progressbar, format); + elm_progressbar_value_set(progressbar, .50); + ck_assert(!strcmp(elm_object_part_text_get(progressbar, "elm.text.status"), "50 percent (50%)")); +} +EFL_END_TEST + +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *progressbar; Efl_Access_Role role; @@ -44,5 +60,6 @@ EFL_END_TEST void elm_test_progressbar(TCase *tc) { tcase_add_test(tc, elm_progressbar_legacy_type_check); + tcase_add_test(tc, elm_progressbar_custom_unit_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 fedc14f2a5..e619d29a4c 100644 --- a/src/tests/elementary/elm_test_radio.c +++ b/src/tests/elementary/elm_test_radio.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_radio_legacy_type_check) +EFL_START_TEST(elm_radio_legacy_type_check) { Evas_Object *win, *radio; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_radio_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *radio; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_scroller.c b/src/tests/elementary/elm_test_scroller.c index cd2b52d0d1..ec5c74f85d 100644 --- a/src/tests/elementary/elm_test_scroller.c +++ b/src/tests/elementary/elm_test_scroller.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_scroller_legacy_type_check) +EFL_START_TEST(elm_scroller_legacy_type_check) { Evas_Object *win, *scroller; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_scroller_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *scroller; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_segmentcontrol.c b/src/tests/elementary/elm_test_segmentcontrol.c index 7f29ce7977..ad1e205d42 100644 --- a/src/tests/elementary/elm_test_segmentcontrol.c +++ b/src/tests/elementary/elm_test_segmentcontrol.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_segment_control_legacy_type_check) +EFL_START_TEST(elm_segment_control_legacy_type_check) { Evas_Object *win, *segment_control; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_segment_control_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *segmentcontrol; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_separator.c b/src/tests/elementary/elm_test_separator.c index 568e1c20d3..55d8b75f79 100644 --- a/src/tests/elementary/elm_test_separator.c +++ b/src/tests/elementary/elm_test_separator.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_separator_legacy_type_check) +EFL_START_TEST(elm_separator_legacy_type_check) { Evas_Object *win, *separator; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_separator_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *separator; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_slider.c b/src/tests/elementary/elm_test_slider.c index f28682f321..c5038207d9 100644 --- a/src/tests/elementary/elm_test_slider.c +++ b/src/tests/elementary/elm_test_slider.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_slider_legacy_type_check) +EFL_START_TEST(elm_slider_legacy_type_check) { Evas_Object *win, *slider; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_slider_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *slider; Efl_Access_Role role; @@ -41,8 +41,72 @@ EFL_START_TEST (elm_atspi_role_get) } EFL_END_TEST +static Evas_Object *fslider, *scroller; + +static void +mag_job(void *e) +{ + int x, y, w, h; + ck_assert_int_eq(elm_object_scroll_hold_get(scroller), 0); + evas_event_feed_mouse_in(e, 0, NULL); + evas_object_geometry_get(fslider, &x, &y, &w, &h); + evas_event_feed_mouse_move(e, x+w/2, y+h/2, 0, NULL); + //ensure that the scroller is on hold + ck_assert_int_eq(elm_object_scroll_hold_get(scroller), 1); + evas_event_feed_mouse_move(e, x+w+w/2, y+h+h/2, 0, NULL); + ck_assert_int_eq(elm_object_scroll_hold_get(scroller), 0); + ecore_main_loop_quit(); +} + +static void +norendered(void *data EINA_UNUSED, Evas *e, void *event_info EINA_UNUSED) +{ + ecore_job_add(mag_job, e); + evas_event_callback_del(e, EVAS_CALLBACK_RENDER_POST, norendered); +} + +EFL_START_TEST(elm_slider_in_scroller) +{ + Evas_Object *win, *slider, *box; + + win = win_add(NULL, "slider", ELM_WIN_BASIC); + evas_object_size_hint_weight_set(win, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + scroller = elm_scroller_add(win); + evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(scroller); + elm_win_resize_object_add(win, scroller); + + box = elm_box_add(scroller); + evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_content_set(scroller, box); + evas_object_show(box); + + for (int i = 0; i < 20; ++i) + { + slider = elm_slider_add(win); + evas_object_size_hint_weight_set(slider, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_slider_min_max_set(slider, 0, 100); + evas_object_show(slider); + elm_box_pack_end(box, slider); + if (i == 0) + fslider = slider; + } + elm_scroller_page_bring_in(scroller, 0, 0); + evas_object_resize(win, 100, 100); + evas_object_show(win); + + evas_smart_objects_calculate(evas_object_evas_get(win)); + evas_event_callback_add(evas_object_evas_get(win), EVAS_CALLBACK_RENDER_POST, norendered, NULL); + + elm_run(); + +} +EFL_END_TEST + void elm_test_slider(TCase *tc) { tcase_add_test(tc, elm_slider_legacy_type_check); + tcase_add_test(tc, elm_slider_in_scroller); 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 25ec7dd196..d42a256fc6 100644 --- a/src/tests/elementary/elm_test_slideshow.c +++ b/src/tests/elementary/elm_test_slideshow.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_slideshow_legacy_type_check) +EFL_START_TEST(elm_slideshow_legacy_type_check) { Evas_Object *win, *slideshow; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_slideshow_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *slideshow; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_spinner.c b/src/tests/elementary/elm_test_spinner.c index ca4e1c1d52..99c3696188 100644 --- a/src/tests/elementary/elm_test_spinner.c +++ b/src/tests/elementary/elm_test_spinner.c @@ -3,10 +3,11 @@ #endif #define EFL_ACCESS_OBJECT_BETA +#include #include #include "elm_suite.h" -EFL_START_TEST (elm_spinner_legacy_type_check) +EFL_START_TEST(elm_spinner_legacy_type_check) { Evas_Object *win, *spinner; const char *type; @@ -26,7 +27,7 @@ EFL_START_TEST (elm_spinner_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *spinner; Efl_Access_Role role; @@ -42,7 +43,7 @@ EFL_START_TEST (elm_atspi_role_get) EFL_END_TEST -EFL_START_TEST (elm_spinner_focus_next_object) +EFL_START_TEST(elm_spinner_focus_next_object) { Evas_Object *win, *box, *spinner, *btn, *o; diff --git a/src/tests/elementary/elm_test_table.c b/src/tests/elementary/elm_test_table.c index 4ba155193c..8b4d09214f 100644 --- a/src/tests/elementary/elm_test_table.c +++ b/src/tests/elementary/elm_test_table.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_table_legacy_type_check) +EFL_START_TEST(elm_table_legacy_type_check) { Evas_Object *win, *table; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_table_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *table; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_thumb.c b/src/tests/elementary/elm_test_thumb.c index 9ca838db99..28f58808b2 100644 --- a/src/tests/elementary/elm_test_thumb.c +++ b/src/tests/elementary/elm_test_thumb.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_thumb_legacy_type_check) +EFL_START_TEST(elm_thumb_legacy_type_check) { Evas_Object *win, *thumb; const char *type; @@ -27,7 +27,7 @@ EFL_START_TEST (elm_thumb_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *thumb; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_toolbar.c b/src/tests/elementary/elm_test_toolbar.c index b10350dfa5..76b91b0d6d 100644 --- a/src/tests/elementary/elm_test_toolbar.c +++ b/src/tests/elementary/elm_test_toolbar.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_toolbar_legacy_type_check) +EFL_START_TEST(elm_toolbar_legacy_type_check) { Evas_Object *win, *toolbar; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_toolbar_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *toolbar; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_video.c b/src/tests/elementary/elm_test_video.c index 676e128c89..a084c0fbfb 100644 --- a/src/tests/elementary/elm_test_video.c +++ b/src/tests/elementary/elm_test_video.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_video_legacy_type_check) +EFL_START_TEST(elm_video_legacy_type_check) { Evas_Object *win, *video; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_video_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *video; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_web.c b/src/tests/elementary/elm_test_web.c index 5108cea1c1..4200c2703e 100644 --- a/src/tests/elementary/elm_test_web.c +++ b/src/tests/elementary/elm_test_web.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_web_legacy_type_check) +EFL_START_TEST(elm_web_legacy_type_check) { Evas_Object *win, *web; const char *type; @@ -26,7 +26,7 @@ EFL_START_TEST (elm_web_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win, *web; Efl_Access_Role role; diff --git a/src/tests/elementary/elm_test_widget_focus.c b/src/tests/elementary/elm_test_widget_focus.c index 113ae2c86b..6b8ac871ea 100644 --- a/src/tests/elementary/elm_test_widget_focus.c +++ b/src/tests/elementary/elm_test_widget_focus.c @@ -147,7 +147,7 @@ _eventing_test(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_U *val = EINA_TRUE; } -EFL_START_TEST (elm_test_widget_focus_simple_widget) +EFL_START_TEST(elm_test_widget_focus_simple_widget) { Evas_Object *win, *box, *resettor, *o; Eina_Hash *map; diff --git a/src/tests/elementary/elm_test_win.c b/src/tests/elementary/elm_test_win.c index 9e6dc156ba..9327327f6e 100644 --- a/src/tests/elementary/elm_test_win.c +++ b/src/tests/elementary/elm_test_win.c @@ -39,6 +39,14 @@ _timer_delete_request_cb(void *data) return EINA_FALSE; } +static Eina_Bool +_timer_del_window_cb(void *data) +{ + Eo *win = (Eo*) data; + evas_object_del(win); + return EINA_FALSE; +} + static Eina_Bool _timer_hide_window_cb(void *data) { @@ -63,7 +71,7 @@ _timer_fail_flag_cb(void *data) return EINA_FALSE; } -EFL_START_TEST (elm_win_legacy_type_check) +EFL_START_TEST(elm_win_legacy_type_check) { Evas_Object *win, *win_socket, *win_inlined; const char *type; @@ -100,7 +108,7 @@ EFL_START_TEST (elm_win_legacy_type_check) } EFL_END_TEST -EFL_START_TEST (elm_atspi_role_get) +EFL_START_TEST(elm_atspi_role_get) { Evas_Object *win; Efl_Access_Role role; @@ -114,7 +122,7 @@ EFL_START_TEST (elm_atspi_role_get) } EFL_END_TEST -EFL_START_TEST (elm_atspi_component_screen_position) +EFL_START_TEST(elm_atspi_component_screen_position) { Eina_Bool ret; int x, y; @@ -133,7 +141,7 @@ EFL_START_TEST (elm_atspi_component_screen_position) } EFL_END_TEST -EFL_START_TEST (elm_win_autohide) +EFL_START_TEST(elm_win_autohide) { Eo *win = win_add(NULL, "win", ELM_WIN_BASIC); if (elm_win_xwindow_get(win)) @@ -154,7 +162,29 @@ EFL_START_TEST (elm_win_autohide) } EFL_END_TEST -EFL_START_TEST (elm_win_policy_quit_last_window_hidden) +EFL_START_TEST (elm_win_test_app_exit_on_windows_close) +{ + Eo *win = win_add(NULL, "win", ELM_WIN_BASIC); + Eina_Value val, *exit_val; + int code; + + val = eina_value_int_init(66); + efl_ui_win_exit_on_all_windows_closed_set(&val); + efl_gfx_entity_visible_set(win, EINA_TRUE); + + Eina_Bool fail_flag = EINA_FALSE; + ecore_timer_add(_timeout1, _timer_del_window_cb, win); + ecore_timer_add(_timeout_fail, _timer_fail_flag_cb, &fail_flag); + + exit_val = efl_loop_begin(efl_loop_get(win)); + ck_assert(eina_value_int_get(exit_val, &code)); + ck_assert_int_eq(code, 66); + efl_ui_win_exit_on_all_windows_closed_set(&EINA_VALUE_EMPTY); +} +EFL_END_TEST + + +EFL_START_TEST(elm_win_policy_quit_last_window_hidden) { elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN); @@ -177,7 +207,27 @@ EFL_START_TEST (elm_win_policy_quit_last_window_hidden) } EFL_END_TEST -EFL_START_TEST (elm_win_autohide_and_policy_quit_last_window_hidden) +EFL_START_TEST(elm_win_test_exit_on_close) +{ + Eo *win = win_add(NULL, "win", ELM_WIN_BASIC); + Eina_Value val, *exit_val; + int code; + + val = eina_value_int_init(66); + efl_ui_win_exit_on_close_set(win, &val); + efl_gfx_entity_visible_set(win, EINA_TRUE); + + Eina_Bool fail_flag = EINA_FALSE; + ecore_timer_add(_timeout1, _timer_del_window_cb, win); + ecore_timer_add(_timeout_fail, _timer_fail_flag_cb, &fail_flag); + + exit_val = efl_loop_begin(efl_loop_get(win)); + ck_assert(eina_value_int_get(exit_val, &code)); + ck_assert_int_eq(code, 66); +} +EFL_END_TEST + +EFL_START_TEST(elm_win_autohide_and_policy_quit_last_window_hidden) { elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN); @@ -265,7 +315,7 @@ _inputs_timer2_cb(void *data) size_t cnt = 0; int i = 0; - it = efl_canvas_scene_pointer_iterate(win, 0); + it = efl_ui_win_pointer_iterate(win, 0); EINA_ITERATOR_FOREACH(it, ptr) { double x, y; @@ -328,7 +378,7 @@ _inputs_timer3_cb(void *data) size_t cnt = 0; int i = 0; - it = efl_canvas_scene_pointer_iterate(win, 0); + it = efl_ui_win_pointer_iterate(win, 0); EINA_ITERATOR_FOREACH(it, ptr) { int tool, ok = 0; @@ -359,7 +409,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_scene_pointer_position_get(win); + efl_canvas_scene_pointer_position_get(win, NULL, &pos); ck_assert_int_eq(pos.x, points[1][0].x); ck_assert_int_eq(pos.y, points[1][0].y); @@ -368,7 +418,7 @@ _inputs_timer3_cb(void *data) return ECORE_CALLBACK_DONE; } -EFL_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; @@ -399,13 +449,30 @@ EFL_START_TEST (efl_ui_win_multi_touch_inputs) } EFL_END_TEST +EFL_START_TEST(elm_win_test_rotation) +{ + Evas_Object *win; + + win = win_add(NULL, "win", ELM_WIN_BASIC); + + elm_win_rotation_set(win, 90); + ck_assert_int_eq(elm_win_rotation_get(win), 90); + elm_win_rotation_with_resize_set(win, 180); + ck_assert_int_eq(elm_win_rotation_get(win), 180); + ck_assert_int_eq(elm_win_rotation_get(NULL), -1); +} +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_screen_position); tcase_add_test(tc, elm_win_policy_quit_last_window_hidden); + tcase_add_test(tc, elm_win_test_exit_on_close); + tcase_add_test(tc, elm_win_test_app_exit_on_windows_close); tcase_add_test(tc, efl_ui_win_multi_touch_inputs); + tcase_add_test(tc, elm_win_test_rotation); #ifdef HAVE_ELEMENTARY_X tcase_add_test(tc, elm_win_autohide); tcase_add_test(tc, elm_win_autohide_and_policy_quit_last_window_hidden); diff --git a/src/tests/elementary/focus_test.eo b/src/tests/elementary/focus_test.eo index 1293b6535a..f6a1144a95 100644 --- a/src/tests/elementary/focus_test.eo +++ b/src/tests/elementary/focus_test.eo @@ -1,4 +1,4 @@ -class Focus.Test +class @beta Focus.Test extends Efl.Object implements Efl.Ui.Focus.Object, Efl.Gfx.Entity { diff --git a/src/tests/elementary/meson.build b/src/tests/elementary/meson.build index 823e93e1cf..edea9537dc 100644 --- a/src/tests/elementary/meson.build +++ b/src/tests/elementary/meson.build @@ -19,6 +19,8 @@ endforeach elementary_suite_src = [ 'elm_suite.c', + 'elm_suite_build.c', + 'suite_helpers.c', 'elm_test_atspi.c', 'elm_test_check.c', 'elm_test_colorselector.c', @@ -96,16 +98,11 @@ elementary_suite_src = [ 'elm_code_test_widget_text.c', 'elm_code_test_widget_selection.c', 'elm_code_test_widget_undo.c', - 'elm_test_focus_common.c', - 'elm_test_focus_common.h', - 'elm_test_focus.c', - 'elm_test_focus_sub.c', - 'efl_ui_test_grid.c', 'elm_test_widget_focus.c' ] elementary_suite = executable('elementary_suite', - elementary_suite_src, priv_eo_file_target, + elementary_suite_src, dependencies: [check, eina, elementary, elementary_deps], include_directories : [config_dir] + [elementary_config_dir], c_args : [ @@ -116,11 +113,58 @@ elementary_suite = executable('elementary_suite', ] ) +efl_ui_suite_src = [ + 'efl_ui_suite.c', + 'efl_ui_build.c', + 'suite_helpers.c', + 'suite_helpers.h', + 'elm_test_init.c', + 'efl_ui_test_atspi.c', + 'efl_ui_test_callback.c', + 'efl_ui_test_focus_common.c', + 'efl_ui_test_focus_common.h', + 'efl_ui_test_focus.c', + 'efl_ui_test_focus_sub.c', + 'efl_ui_test_box.c', + 'efl_ui_test_box_flow.c', + 'efl_ui_test_box_stack.c', + 'efl_ui_test_table.c', + 'efl_ui_test_grid.c', + 'efl_ui_test_relative_layout.c', + 'efl_ui_test_image.c', + 'efl_ui_test_image_zoomable.c', + 'efl_ui_test_layout.c', + 'efl_ui_suite.h', + 'efl_ui_model.c', + 'efl_ui_test_widget.c', +] + +efl_ui_suite = executable('efl_ui_suite', + efl_ui_suite_src, priv_eo_file_target, + dependencies: [check, eina, elementary, elementary_deps], + include_directories : [config_dir] + [elementary_config_dir], + c_args : [ + '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', + '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"', + '-DELM_IMAGE_DATA_DIR="'+join_paths(meson.source_root(), 'data', 'elementary')+'"', + '-DELM_TEST_DATA_DIR="'+join_paths(meson.build_root(), 'data', 'elementary')+'"', + ] +) + +efl_ui_compile_test = executable('efl_ui_compile_test', + 'efl_ui_compile_test.c', + dependencies: [elementary, eio], +) + test('elementary-suite', elementary_suite, env : test_env ) +test('efl-ui-suite', efl_ui_suite, + env : test_env +) install_data(files(['testdiff.diff', 'testfile-windows.txt', 'testfile-withblanks.txt', 'testfile.txt']), install_dir : join_paths(dir_data, 'elementary') ) +subdir('spec') diff --git a/src/tests/elementary/spec/efl_test_container.c b/src/tests/elementary/spec/efl_test_container.c new file mode 100644 index 0000000000..ecef9b1740 --- /dev/null +++ b/src/tests/elementary/spec/efl_test_container.c @@ -0,0 +1,56 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include +#include "efl_ui_spec_suite.h" +#include "suite_helpers.h" + +void +efl_test_container_content_equal(Efl_Ui_Widget **wid, unsigned int len) +{ + Efl_Ui_Widget *c; + Eina_Iterator *iter; + unsigned int i; + Eina_List *tmp = NULL; + + ck_assert_int_eq(efl_content_count(widget), len); + iter = efl_content_iterate(widget); + EINA_ITERATOR_FOREACH(iter, c) + { + ck_assert_ptr_eq(eina_list_data_find(tmp, c), NULL); + tmp = eina_list_append(tmp, c); + } + eina_iterator_free(iter); + for (i = 0; i < len; ++i) + { + ck_assert_ptr_ne(eina_list_data_find(tmp, wid[i]), NULL); + tmp = eina_list_remove(tmp, wid[i]); + } + ck_assert_int_eq(eina_list_count(tmp), 0); +} + +typedef struct { + Eina_Bool *flag; + void *expected_event_data; +} Efl_Container_Event_Content; + +static void +_evt_called(void *data, const Efl_Event *ev) +{ + Efl_Container_Event_Content *content = data; + + *content->flag = EINA_TRUE; + ck_assert_ptr_eq(content->expected_event_data, ev->info); + efl_event_callback_del(ev->object, ev->desc, _evt_called, data); + free(data); +} + +void +efl_test_container_expect_evt_content_added(Efl_Ui_Widget *widget, const Efl_Event_Description *ev, Eina_Bool *flag, void *event_data) +{ + Efl_Container_Event_Content *c = calloc(1, sizeof(Efl_Container_Event_Content)); + c->flag = flag; + c->expected_event_data = event_data; + efl_event_callback_add(widget, ev, _evt_called, c); +} diff --git a/src/tests/elementary/spec/efl_test_pack.c b/src/tests/elementary/spec/efl_test_pack.c new file mode 100644 index 0000000000..626e3e9b5b --- /dev/null +++ b/src/tests/elementary/spec/efl_test_pack.c @@ -0,0 +1,348 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include +#include "efl_ui_spec_suite.h" +#include "suite_helpers.h" + +/* + In general: + - If a subobject is deleted the box simply forgets about it. Never return this element again container. +*/ + +EFL_START_TEST(base2) +{ + ck_assert(win); + ck_assert(widget); +} +EFL_END_TEST + +static void +_setup_std_pack(Efl_Ui_Widget *wid[3]) +{ + unsigned int i; + + for (i = 0; i < 3; ++i) + { + wid[i] = efl_add(WIDGET_CLASS, widget); + ck_assert_int_eq(efl_pack(widget, wid[i]), EINA_TRUE); + efl_gfx_entity_visible_set(widget, EINA_TRUE); + } +} + +/* + pack_clear function: + - each element must be deleted after the call + - the container must have 0 contents after the call + - the call must return true even if the container is empty +*/ + +EFL_START_TEST(pack_clear1) +{ + Efl_Ui_Widget *wid[3]; + unsigned int i; + + _setup_std_pack(wid); + + for (i = 0; i < sizeof(wid)/sizeof(Efl_Ui_Widget*); ++i) + { + efl_wref_add(wid[i], &wid[i]); + } + + ck_assert_int_eq(efl_pack_clear(widget), EINA_TRUE); + + for (i = 0; i < sizeof(wid)/sizeof(Efl_Ui_Widget*); ++i) + { + ck_assert_ptr_eq(wid[i], NULL); + } + + efl_test_container_content_equal(NULL, 0); +} +EFL_END_TEST + +EFL_START_TEST(pack_clear2) +{ + Efl_Ui_Widget *wid[3]; + + _setup_std_pack(wid); + + ck_assert_int_eq(efl_pack_clear(widget), EINA_TRUE); + ck_assert_int_eq(efl_pack_clear(widget), EINA_TRUE); + ck_assert_int_eq(efl_pack_clear(widget), EINA_TRUE); + ck_assert_int_eq(efl_pack_clear(widget), EINA_TRUE); + ck_assert_int_eq(efl_pack_clear(widget), EINA_TRUE); +} +EFL_END_TEST + +/* + unpack_all function: + - each element must have exactly one reference after the call + - the container must have 0 contents after the call + - the call must return true even if the container is empty +*/ + +EFL_START_TEST(unpack_all1) +{ + Efl_Ui_Widget *wid[3]; + unsigned int i; + + _setup_std_pack(wid); + + ck_assert_int_eq(efl_pack_unpack_all(widget), EINA_TRUE); + + for (i = 0; i < sizeof(wid)/sizeof(Efl_Ui_Widget*); ++i) + { + ck_assert_int_eq(efl_ref_count(wid[i]), 1); + } + efl_test_container_content_equal(NULL, 0); +} +EFL_END_TEST + +EFL_START_TEST(unpack_all2) +{ + Efl_Ui_Widget *wid[3]; + unsigned int i; + + _setup_std_pack(wid); + + ck_assert_int_eq(efl_pack_unpack_all(widget), EINA_TRUE); + ck_assert_int_eq(efl_pack_clear(widget), EINA_TRUE); + + for (i = 0; i < sizeof(wid)/sizeof(Efl_Ui_Widget*); ++i) + { + ck_assert_int_eq(efl_ref_count(wid[i]), 1); + } + efl_test_container_content_equal(NULL, 0); +} +EFL_END_TEST + +/* + unpack function: + - the element must have exactly one reference after the call + - the container must have one content less after the call + - the widget parent must be different from the parent + - unpacking something invalid can return EINA_FALSE but must not print an error +*/ + +EFL_START_TEST(unpack1) +{ + Efl_Ui_Widget *wid[3]; + _setup_std_pack(wid); + + ck_assert_int_eq(efl_pack_unpack(widget, wid[2]), EINA_TRUE); + ck_assert_ptr_ne(efl_ui_widget_parent_get(wid[2]), widget); + ck_assert_int_eq(efl_ref_count(wid[2]), 1); + efl_test_container_content_equal(wid, 2); +} +EFL_END_TEST + +EFL_START_TEST(unpack2) +{ + Efl_Ui_Widget *wid[3]; + _setup_std_pack(wid); + + ck_assert_int_eq(efl_pack_unpack(widget, wid[0]), EINA_TRUE); + ck_assert_int_eq(efl_pack(widget, wid[0]), EINA_TRUE); + ck_assert_int_eq(efl_pack_unpack(widget, wid[0]), EINA_TRUE); + ck_assert_int_eq(efl_pack(widget, wid[0]), EINA_TRUE); + + efl_test_container_content_equal(wid, 3); +} +EFL_END_TEST + +EFL_START_TEST(unpack3) +{ + Efl_Ui_Widget *wid[3], *invalid; + _setup_std_pack(wid); + + invalid = efl_add(WIDGET_CLASS, win); + ck_assert_int_eq(efl_pack_unpack(widget, wid[2]), EINA_TRUE); + EXPECT_ERROR_START; + ck_assert_int_eq(efl_pack_unpack(widget, wid[2]), EINA_FALSE); + EXPECT_ERROR_END; + EXPECT_ERROR_START; + ck_assert_int_eq(efl_pack_unpack(widget, wid[2]), EINA_FALSE); + EXPECT_ERROR_END; + EXPECT_ERROR_START; + ck_assert_int_eq(efl_pack_unpack(widget, (Eo*)0x111), EINA_FALSE); + EXPECT_ERROR_END; + EXPECT_ERROR_START; + ck_assert_int_eq(efl_pack_unpack(widget, invalid), EINA_FALSE); + EXPECT_ERROR_END; + efl_test_container_content_equal(wid, 2); +} +EFL_END_TEST + +/* + pack function: + - element must be added to the content of the container + - elements widget_parent must be the container + - double adding a widdget must error + - adding something invalid must error +*/ + +EFL_START_TEST(pack1) +{ + Efl_Ui_Widget *wid[3]; + unsigned int i; + + _setup_std_pack(wid); + + for (i = 0; i < sizeof(wid)/sizeof(Efl_Ui_Widget*); ++i) + { + ck_assert_int_eq(efl_ref_count(wid[i]), 1); + ck_assert_ptr_eq(efl_ui_widget_parent_get(wid[i]), widget); + } + + efl_test_container_content_equal(wid, 3); +} +EFL_END_TEST + +EFL_START_TEST(pack2) +{ + Efl_Ui_Widget *wid[3]; + _setup_std_pack(wid); + + EXPECT_ERROR_START; + ck_assert_int_eq(efl_pack(widget, wid[0]), EINA_FALSE); + EXPECT_ERROR_END; + efl_test_container_content_equal(wid, 3); +} +EFL_END_TEST + +EFL_START_TEST(pack3) +{ + Efl_Ui_Widget *wid[3]; + _setup_std_pack(wid); + + EXPECT_ERROR_START; + ck_assert_int_eq(efl_pack(widget, (Eo*)0x111F), EINA_FALSE); + EXPECT_ERROR_END; + EXPECT_ERROR_START; + ck_assert_int_eq(efl_pack(widget, widget), EINA_FALSE); + EXPECT_ERROR_END; + EXPECT_ERROR_START; + ck_assert_int_eq(efl_pack(widget, NULL), EINA_FALSE); + EXPECT_ERROR_END; + efl_test_container_content_equal(wid, 3); +} +EFL_END_TEST + +EFL_START_TEST(pack_align) +{ +#define TUPLE_CHECK(H,V,rh,rv) \ + do { \ + double v, h; \ + efl_pack_align_set(widget, H, V); \ + efl_pack_align_get(widget, &h, &v); \ + ck_assert(v == rv); \ + ck_assert(h == rh); \ + } while(0); + + TUPLE_CHECK( 1.0, 1.0, 1.0, 1.0); + TUPLE_CHECK( 0.0, 0.0, 0.0, 0.0); + TUPLE_CHECK(- 1.0, - 1.0, -1.0, -1.0); + TUPLE_CHECK(-42.0, -42.0, -1.0, -1.0); + TUPLE_CHECK( 42.0, 42.0, 1.0, 1.0); + TUPLE_CHECK(-42.0, 42.0, -1.0, 1.0); + TUPLE_CHECK( 42.0, -42.0, 1.0, -1.0); +#undef TUPLE_CHECK +} +EFL_END_TEST + +EFL_START_TEST(pack_padding) +{ +#define TUPLE_CHECK(H, V, rh, rv, S, rs) \ + do { \ + double v, h; \ + Eina_Bool r; \ + efl_pack_padding_set(widget, H, V, S); \ + efl_pack_padding_get(widget, &h, &v, &r); \ + ck_assert(v == rv); \ + ck_assert(h == rh); \ + ck_assert_int_eq(r, S); \ + } while(0); + + TUPLE_CHECK( 0.0, 0.0, 0.0, 0.0, EINA_TRUE, EINA_TRUE); + TUPLE_CHECK( -1.0, -123.0, 0.0, 0.0, EINA_FALSE, EINA_FALSE); + TUPLE_CHECK( -1.0, 123.0, 0.0, 123.0, EINA_FALSE, EINA_FALSE); +#undef TUPLE_CHECK +} +EFL_END_TEST + +EFL_START_TEST(evt_content_added) +{ + Eina_Bool called = EINA_TRUE; + Efl_Ui_Widget *wid = efl_add(WIDGET_CLASS, win); + efl_test_container_expect_evt_content_added(widget, EFL_CONTAINER_EVENT_CONTENT_ADDED, &called, wid); + efl_pack(widget, wid); + ck_assert_int_eq(called, EINA_TRUE); +} +EFL_END_TEST + +EFL_START_TEST(evt_content_removed) +{ + Eina_Bool called = EINA_TRUE; + Efl_Ui_Widget *wid[3]; + + _setup_std_pack(wid); + + efl_test_container_expect_evt_content_added(widget, EFL_CONTAINER_EVENT_CONTENT_REMOVED, &called, wid[1]); + efl_pack_unpack(widget, wid[1]); + ck_assert_int_eq(called, EINA_TRUE); +} +EFL_END_TEST + +EFL_START_TEST(child_killed) +{ + Efl_Ui_Widget *wid[3]; + _setup_std_pack(wid); + + efl_wref_add(wid[0], &wid[0]); + efl_del(wid[0]); + efl_test_container_content_equal(&wid[1], 2); + ck_assert_ptr_eq(wid[0], NULL); +} +EFL_END_TEST + +EFL_START_TEST(container_killed) +{ + Efl_Ui_Widget *wid[3]; + unsigned int i = 0; + + _setup_std_pack(wid); + + for (i = 0; i < sizeof(wid)/sizeof(Efl_Ui_Widget*); ++i) + { + efl_wref_add(wid[i], &wid[i]); + } + efl_del(widget); + for (i = 0; i < sizeof(wid)/sizeof(Efl_Ui_Widget*); ++i) + { + ck_assert_ptr_eq(wid[i], NULL); + } +} +EFL_END_TEST + +void +efl_pack_behavior_test(TCase *tc) +{ + tcase_add_test(tc, base2); + tcase_add_test(tc, pack_clear1); + tcase_add_test(tc, pack_clear2); + tcase_add_test(tc, unpack_all1); + tcase_add_test(tc, unpack_all2); + tcase_add_test(tc, unpack1); + tcase_add_test(tc, unpack2); + tcase_add_test(tc, unpack3); + tcase_add_test(tc, pack1); + tcase_add_test(tc, pack2); + tcase_add_test(tc, pack3); + tcase_add_test(tc, pack_align); + tcase_add_test(tc, pack_padding); + tcase_add_test(tc, evt_content_added); + tcase_add_test(tc, evt_content_removed); + tcase_add_test(tc, child_killed); + tcase_add_test(tc, container_killed); +} diff --git a/src/tests/elementary/spec/efl_test_pack_linear.c b/src/tests/elementary/spec/efl_test_pack_linear.c new file mode 100644 index 0000000000..cf85f9192b --- /dev/null +++ b/src/tests/elementary/spec/efl_test_pack_linear.c @@ -0,0 +1,396 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include +#include "efl_ui_spec_suite.h" +#include "suite_helpers.h" +#include + +static void +_fill_array(Efl_Ui_Widget *wid[3]) +{ + for (int i = 0; i < 3; ++i) + { + wid[i] = efl_add(WIDGET_CLASS, win); + } +} + +static void +_ordering_equals(Efl_Ui_Widget **wid, unsigned int len) +{ + for (unsigned int i = 0; i < len; ++i) + { + ck_assert_ptr_eq(efl_pack_content_get(widget, i), wid[i]); + } + efl_test_container_content_equal(wid, len); +} + +EFL_START_TEST(pack_begin1) +{ + Efl_Ui_Widget *wid[3]; + Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win); + + _fill_array(wid); + + for (int i = 2; i >= 0; i--) + { + efl_pack_begin(widget, wid[i]); + ck_assert_ptr_eq(efl_ui_widget_parent_get(wid[i]), widget); + } + _ordering_equals(wid, 3); + efl_pack_begin(widget, inv); + ck_assert_ptr_eq(efl_pack_content_get(widget, 0), inv); + Efl_Ui_Widget *wid2[] = {inv, wid[0], wid[1], wid[2]}; + _ordering_equals(wid2, 4); +} +EFL_END_TEST + +EFL_START_TEST(pack_begin2) +{ + Efl_Ui_Widget *wid[3]; + + _fill_array(wid); + + for (int i = 2; i >= 0; i--) + { + efl_pack_begin(widget, wid[i]); + ck_assert_ptr_eq(efl_ui_widget_parent_get(wid[i]), widget); + } + + EXPECT_ERROR_START; + ck_assert_int_eq(efl_pack_begin(widget, wid[0]), EINA_FALSE); + EXPECT_ERROR_END; + _ordering_equals(wid, 3); +} +EFL_END_TEST + +EFL_START_TEST(pack_end1) +{ + Efl_Ui_Widget *wid[3]; + Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win); + + _fill_array(wid); + + for (int i = 0; i < 3; i++) + { + efl_pack_end(widget, wid[i]); + ck_assert_ptr_eq(efl_ui_widget_parent_get(wid[i]), widget); + } + + _ordering_equals(wid, 3); + efl_pack_end(widget, inv); + ck_assert_ptr_eq(efl_pack_content_get(widget, 3), inv); + Efl_Ui_Widget *wid2[] = {wid[0], wid[1], wid[2], inv}; + _ordering_equals(wid2, 4); +} +EFL_END_TEST + +EFL_START_TEST(pack_end2) +{ + Efl_Ui_Widget *wid[3]; + + _fill_array(wid); + + for (int i = 0; i < 3; i++) + { + efl_pack_end(widget, wid[i]); + ck_assert_ptr_eq(efl_ui_widget_parent_get(wid[i]), widget); + } + + EXPECT_ERROR_START; + ck_assert_int_eq(efl_pack_end(widget, wid[0]), EINA_FALSE); + EXPECT_ERROR_END; + _ordering_equals(wid, 3); +} +EFL_END_TEST + +EFL_START_TEST(pack_before1) +{ + Efl_Ui_Widget *wid[3]; + Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win); + + _fill_array(wid); + + for (int i = 0; i < 3; i++) + efl_pack_end(widget, wid[i]); + + ck_assert_int_eq(efl_pack_before(widget, inv, wid[0]), EINA_TRUE); + ck_assert_ptr_eq(efl_ui_widget_parent_get(inv), widget); + Efl_Ui_Widget *wid2[] = {inv, wid[0], wid[1], wid[2]}; + _ordering_equals(wid2, 4); + efl_pack_unpack(widget, inv); + + ck_assert_int_eq(efl_pack_before(widget, inv, wid[2]), EINA_TRUE); + ck_assert_ptr_eq(efl_ui_widget_parent_get(inv), widget); + Efl_Ui_Widget *wid3[] = {wid[0], wid[1], inv, wid[2]}; + _ordering_equals(wid3, 4); +} +EFL_END_TEST + +EFL_START_TEST(pack_before2) +{ + Efl_Ui_Widget *wid[3]; + Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win); + + _fill_array(wid); + + for (int i = 0; i < 3; i++) + efl_pack_end(widget, wid[i]); + + ck_assert_int_eq(efl_pack_before(widget, inv, wid[0]), EINA_TRUE); + ck_assert_ptr_eq(efl_ui_widget_parent_get(inv), widget); + Efl_Ui_Widget *wid2[] = {inv, wid[0], wid[1], wid[2]}; + _ordering_equals(wid2, 4); + + EXPECT_ERROR_START; + ck_assert_int_eq(efl_pack_before(widget, inv, wid[2]), EINA_FALSE); + EXPECT_ERROR_END; +} +EFL_END_TEST + +EFL_START_TEST(pack_after1) +{ + Efl_Ui_Widget *wid[3]; + Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win); + + _fill_array(wid); + + for (int i = 0; i < 3; i++) + efl_pack_end(widget, wid[i]); + + ck_assert_int_eq(efl_pack_after(widget, inv, wid[0]), EINA_TRUE); + ck_assert_ptr_eq(efl_ui_widget_parent_get(inv), widget); + Efl_Ui_Widget *wid2[] = {wid[0], inv, wid[1], wid[2]}; + _ordering_equals(wid2, 4); + efl_pack_unpack(widget, inv); + + ck_assert_int_eq(efl_pack_after(widget, inv, wid[2]), EINA_TRUE); + ck_assert_ptr_eq(efl_ui_widget_parent_get(inv), widget); + Efl_Ui_Widget *wid3[] = {wid[0], wid[1], wid[2], inv}; + _ordering_equals(wid3, 4); +} +EFL_END_TEST + +EFL_START_TEST(pack_after2) +{ + Efl_Ui_Widget *wid[3]; + Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win); + + _fill_array(wid); + + for (int i = 0; i < 3; i++) + efl_pack_end(widget, wid[i]); + + ck_assert_int_eq(efl_pack_after(widget, inv, wid[0]), EINA_TRUE); + ck_assert_ptr_eq(efl_ui_widget_parent_get(inv), widget); + Efl_Ui_Widget *wid2[] = {wid[0], inv, wid[1], wid[2]}; + _ordering_equals(wid2, 4); + + EXPECT_ERROR_START; + ck_assert_int_eq(efl_pack_after(widget, inv, wid[2]), EINA_FALSE); + EXPECT_ERROR_END; +} +EFL_END_TEST + +EFL_START_TEST(pack_at1) +{ + for (int x = -3; x < 3; ++x) + { + Efl_Ui_Widget *wid[3]; + Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win); + unsigned int i; + + _fill_array(wid); + for (int i = 0; i < 3; i++) + efl_pack_end(widget, wid[i]); + + efl_pack_at(widget, inv, x); + ck_assert_ptr_eq(efl_ui_widget_parent_get(inv), widget); + + for (i = 0; i < 4; ++i) + { + Efl_Ui_Widget *w = efl_pack_content_get(widget, i); + unsigned int place_to_expect_inv = (3 + x) % 3; + if (i == place_to_expect_inv) + ck_assert_ptr_eq(w, inv); + else if (i < place_to_expect_inv) + ck_assert_ptr_eq(w, wid[i]); + else if (i > place_to_expect_inv) + ck_assert_ptr_eq(w, wid[i - 1]); + } + efl_pack_clear(widget); + } +} +EFL_END_TEST + +EFL_START_TEST(pack_at2) +{ + for (int x = -3; x < 3; ++x) + { + Efl_Ui_Widget *wid[3]; + Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win); + unsigned int i; + + _fill_array(wid); + for (int i = 0; i < 3; i++) + efl_pack_end(widget, wid[i]); + + ck_assert_int_eq(efl_pack_at(widget, inv, x), EINA_TRUE); + ck_assert_ptr_eq(efl_ui_widget_parent_get(inv), widget); + + EXPECT_ERROR_START; + ck_assert_int_eq(efl_pack_at(widget, inv, x - 1), EINA_FALSE); + EXPECT_ERROR_END; + + for (i = 0; i < 4; ++i) + { + Efl_Ui_Widget *w = efl_pack_content_get(widget, i); + unsigned int place_to_expect_inv = (3 + x) % 3; + if (i == place_to_expect_inv) + ck_assert_ptr_eq(w, inv); + else if (i < place_to_expect_inv) + ck_assert_ptr_eq(w, wid[i]); + else if (i > place_to_expect_inv) + ck_assert_ptr_eq(w, wid[i - 1]); + } + efl_pack_clear(widget); + } +} +EFL_END_TEST + + +EFL_START_TEST(pack_at3) +{ + Efl_Ui_Widget *wid[3]; + Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win); + Efl_Ui_Widget *inv2 = efl_add(WIDGET_CLASS, win); + + _fill_array(wid); + for (int i = 0; i < 3; i++) + efl_pack_end(widget, wid[i]); + + ck_assert_int_eq(efl_pack_at(widget, inv,-100000), EINA_TRUE); + ck_assert_ptr_eq(efl_ui_widget_parent_get(inv), widget); + ck_assert_int_eq(efl_pack_at(widget, inv2, 100000), EINA_TRUE); + ck_assert_ptr_eq(efl_ui_widget_parent_get(inv2), widget); + Efl_Ui_Widget *wid2[] = {inv, wid[0], wid[1], wid[2], inv2}; + _ordering_equals(wid2, 5); +} +EFL_END_TEST + +EFL_START_TEST(pack_content_get1) +{ + Efl_Ui_Widget *wid[3]; + + _fill_array(wid); + + for (int i = 0; i < 3; i++) + efl_pack_end(widget, wid[i]); + + for (int i = -100000; i <= 100000; i++) + { + if (i < -3) + ck_assert_ptr_eq(efl_pack_content_get(widget, i), efl_pack_content_get(widget, 0)); + else if (i >= -3 && i < 3) + ck_assert_ptr_eq(efl_pack_content_get(widget, i), wid[(i + 3) % 3]); + else + ck_assert_ptr_eq(efl_pack_content_get(widget, i), efl_pack_content_get(widget, 2)); + } +} +EFL_END_TEST + +EFL_START_TEST(pack_index_get1) +{ + Efl_Ui_Widget *wid[3]; + Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win); + + _fill_array(wid); + for (int i = 0; i < 3; i++) + efl_pack_end(widget, wid[i]); + for (int i = 0; i < 3; i++) + ck_assert_int_eq(efl_pack_index_get(widget, wid[i]), i); + + ck_assert_int_eq(efl_pack_index_get(widget, (void*)0xAFFE), -1); + ck_assert_int_eq(efl_pack_index_get(widget, inv), -1); +} +EFL_END_TEST + +EFL_START_TEST(pack_unpack_at1) +{ + Efl_Ui_Widget *wid[3]; + + _fill_array(wid); + for (int i = 0; i < 3; i++) + efl_pack_end(widget, wid[i]); + for (int i = 0; i < 3; i++) + ck_assert_int_eq(efl_pack_index_get(widget, wid[i]), i); + + ck_assert_ptr_eq(efl_pack_unpack_at(widget, 1), wid[1]); + Efl_Ui_Widget *wid1[] = {wid[0], wid[2]}; + _ordering_equals(wid1, 2); + ck_assert_ptr_eq(efl_pack_unpack_at(widget, 1), wid[2]); + Efl_Ui_Widget *wid2[] = {wid[0]}; + _ordering_equals(wid2, 1); + ck_assert_ptr_eq(efl_pack_unpack_at(widget, 0), wid[0]); + Efl_Ui_Widget *wid3[] = {}; + _ordering_equals(wid3, 0); +} +EFL_END_TEST + + +EFL_START_TEST(pack_unpack_at2) +{ + Efl_Ui_Widget *wid[3]; + + _fill_array(wid); + for (int i = 0; i < 3; i++) + efl_pack_end(widget, wid[i]); + for (int i = 0; i < 3; i++) + ck_assert_int_eq(efl_pack_index_get(widget, wid[i]), i); + + ck_assert_ptr_eq(efl_pack_unpack_at(widget, 1), wid[1]); + efl_del(widget); + ck_assert_int_eq(efl_ref_count(wid[1]), 1); + ck_assert_int_eq(efl_ref_count(widget), 0); +} +EFL_END_TEST + +EFL_START_TEST(pack_unpack_at3) +{ + for (int x = -3; x < 3; ++x) + { + Efl_Ui_Widget *wid[3]; + + _fill_array(wid); + for (int i = 0; i < 3; i++) + efl_pack_end(widget, wid[i]); + ck_assert_ptr_eq(efl_pack_unpack_at(widget, x), wid[(3+x)%3]); + ck_assert_int_eq(efl_content_count(widget), 2); + ck_assert_ptr_ne(efl_ui_widget_parent_get(wid[(3+x)%3]), widget); + efl_pack_unpack_all(widget); + } +} +EFL_END_TEST + +void +efl_pack_linear_behavior_test(TCase *tc) +{ + tcase_add_test(tc, pack_begin1); + tcase_add_test(tc, pack_begin2); + tcase_add_test(tc, pack_end1); + tcase_add_test(tc, pack_end2); + tcase_add_test(tc, pack_before1); + tcase_add_test(tc, pack_before2); + tcase_add_test(tc, pack_after1); + tcase_add_test(tc, pack_after2); + tcase_add_test(tc, pack_at1); + tcase_add_test(tc, pack_at2); + tcase_add_test(tc, pack_at3); + tcase_add_test(tc, pack_content_get1); + tcase_add_test(tc, pack_index_get1); + tcase_add_test(tc, pack_unpack_at1); + tcase_add_test(tc, pack_unpack_at2); + tcase_add_test(tc, pack_unpack_at3); + efl_pack_behavior_test(tc); +} diff --git a/src/tests/elementary/spec/efl_ui_spec_suite.c b/src/tests/elementary/spec/efl_ui_spec_suite.c new file mode 100644 index 0000000000..1b84cf540e --- /dev/null +++ b/src/tests/elementary/spec/efl_ui_spec_suite.c @@ -0,0 +1,66 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include +#include "efl_ui_spec_suite.h" +#include "suite_helpers.h" +#include "eo_internal.h" + +Evas_Object *win = NULL; +Evas_Object *widget = NULL; + +EFL_CLASS_SIMPLE_CLASS(efl_ui_widget, "efl_ui_widget", EFL_UI_WIDGET_CLASS); + +static int tree_abort; +static int tree_abort_level; + +static void +_shutdown(void) +{ + eina_log_abort_on_critical_set(tree_abort); + eina_log_abort_on_critical_level_set(tree_abort_level); +} + +static void +_setup(void) +{ + tree_abort = eina_log_abort_on_critical_get(); + tree_abort_level = eina_log_abort_on_critical_level_get(); + eina_log_abort_on_critical_level_set(2); + eina_log_abort_on_critical_set(1); +} + +static void +_setup_window_and_widget(const Efl_Class *klass) +{ + ck_assert(!win); + ck_assert(!widget); + + win = win_add(); + widget = efl_add(klass, win); + efl_content_set(win, widget); + + ck_assert(win); + ck_assert(widget); +} + +#include "efl_ui_spec_suite_gen.x" +int +main(int argc, char **argv) +{ + int failed_count; + +#define LIST_DECL +#include "efl_ui_spec_suite_gen.x" + + if (!_efl_test_option_disp(argc, argv, etc)) + return 0; + + failed_count = suite_setup(EINA_FALSE); + + failed_count += _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, + "Efl_Ui_Spec", etc, SUITE_INIT_FN(elm2), SUITE_SHUTDOWN_FN(elm)); + + return (failed_count == 0) ? 0 : 255; +} diff --git a/src/tests/elementary/spec/efl_ui_spec_suite.h b/src/tests/elementary/spec/efl_ui_spec_suite.h new file mode 100644 index 0000000000..c8e008fa60 --- /dev/null +++ b/src/tests/elementary/spec/efl_ui_spec_suite.h @@ -0,0 +1,26 @@ +#ifndef EFL_UI_SUITE_H +#define EFL_UI_SUITE_H + +#include + +#define EFL_NOLEGACY_API_SUPPORT +#include +#include "../efl_check.h" + +extern Evas_Object *win; +extern Evas_Object *widget; + +void efl_pack_behavior_test(TCase *tc); +void efl_pack_linear_behavior_test(TCase *tc); + + +void efl_test_container_content_equal(Efl_Ui_Widget **wid, unsigned int len); +void efl_test_container_expect_evt_content_added(Efl_Ui_Widget *widget, const Efl_Event_Description *ev, Eina_Bool *flag, void *event_data); + +Evas_Object * win_add(); + +const Efl_Class* efl_ui_widget_realized_class_get(void); + +#define WIDGET_CLASS efl_ui_widget_realized_class_get() + +#endif diff --git a/src/tests/elementary/spec/generator.py b/src/tests/elementary/spec/generator.py new file mode 100755 index 0000000000..47749fac07 --- /dev/null +++ b/src/tests/elementary/spec/generator.py @@ -0,0 +1,67 @@ +#!/usr/bin/python + +tests = [ + ["Efl.Pack_Linear" , "Efl.Ui.Box"], + ["Efl.Pack" , "Efl.Ui.Table"], +] + +fixture_gen_template = """ +static void +_{}_fixture(void) +{{ + _setup_window_and_widget({}); +}} +""" + +tcase_gen_template = """ +static void +{}(TCase *tc) +{{ + tcase_add_checked_fixture(tc, _{}_fixture, NULL); + tcase_add_checked_fixture(tc, _setup, _shutdown); + {}(tc); +}} + +""" + +file_gen_template = """ +#ifdef LIST_DECL + {} +#else + {} +#endif +""" + +import sys + +list_of_tcases = "static const Efl_Test_Case etc[] = {\n" +list_entry = " {{ \"{}-{}\", {}}},\n" +generated_api = "" + +def interface_to_api(interface_name): + return interface_name+"_behavior_test" + +def to_func_name(class_name): + return class_name.replace('.','_').lower() + +def to_class_getter(class_name): + return class_name.replace('.','_').upper()+'_CLASS' + +widgets = [] + +for test in tests: + interface_test = to_func_name(test[0]) + for widget_class in test[1:]: + combo_name = "_{}_{}".format(to_func_name(interface_test), to_func_name(widget_class)); + list_of_tcases += list_entry.format(interface_test, to_func_name(widget_class), combo_name) + generated_api += tcase_gen_template.format(combo_name, to_func_name(widget_class), interface_to_api(interface_test)) + if widget_class not in widgets: + widgets += [widget_class] + +for widget in widgets: + generated_api = fixture_gen_template.format(to_func_name(widget), to_class_getter(widget)) + generated_api + +list_of_tcases += " { NULL, NULL }\n};" + +output = open(sys.argv[1], "w") +output.write(file_gen_template.format(list_of_tcases, generated_api)) diff --git a/src/tests/elementary/spec/meson.build b/src/tests/elementary/spec/meson.build new file mode 100644 index 0000000000..495d864bda --- /dev/null +++ b/src/tests/elementary/spec/meson.build @@ -0,0 +1,32 @@ +efl_ui_suite_behavior_src = [ + join_paths('..','suite_helpers.c'), + join_paths('..','suite_helpers.h'), + join_paths('..','elm_test_init.c'), + 'efl_ui_spec_suite.c', + 'efl_test_pack.c', + 'efl_test_pack_linear.c', + 'efl_test_container.c', +] + +test_generator = find_program('generator.py') + +generated_test_parts = custom_target('generate_test_suite', + output: 'efl_ui_spec_suite_gen.x', + command: [test_generator, '@OUTPUT@'], +) + +efl_ui_behavior_suite = executable('efl_ui_spec_suite', + efl_ui_suite_behavior_src + [generated_test_parts], + dependencies: [check, eina, elementary, elementary_deps], + include_directories : [config_dir] + [elementary_config_dir] + [include_directories('../')], + c_args : [ + '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', + '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"', + '-DELM_IMAGE_DATA_DIR="'+join_paths(meson.source_root(), 'data', 'elementary')+'"', + '-DELM_TEST_DATA_DIR="'+join_paths(meson.build_root(), 'data', 'elementary')+'"', + ] +) + +test('efl_ui_spec-suite', efl_ui_behavior_suite, + env : test_env +) diff --git a/src/tests/elementary/suite_helpers.c b/src/tests/elementary/suite_helpers.c new file mode 100644 index 0000000000..a57ae493fa --- /dev/null +++ b/src/tests/elementary/suite_helpers.c @@ -0,0 +1,342 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif +#include +#include +#include +#include "eo_internal.h" +#include "../efl_check.h" +#include "elm_widget.h" +#include "ecore_private.h" +#include "ecore_evas_private.h" + + +static int main_pid = -1; +static Eina_Bool did_shutdown; +static Evas_Object *global_win; +static Eina_Bool buffer = EINA_FALSE; +static Eina_Bool legacy_mode = EINA_FALSE; + +void elm_test_init(TCase *tc); + +SUITE_INIT(elm) +{ + char *args[] = { "exe" }; + ck_assert_int_eq(elm_init(1, args), 1); +} + +void +_elm2_suite_init(void) +{ + 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); +} + +void +_elm_suite_shutdown(void) +{ + 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 } +}; + + +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_main_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL); + fail_if(!ecore_init_ex(argc, argv)); + __EFL_MAIN_CONSTRUCTOR; + ret__ = efl_loop_begin(efl_app_main_get()); + real__ = efl_loop_exit_code_process(ret__); + fail_if(real__ != 0); + __EFL_MAIN_DESTRUCTOR; + ecore_shutdown_ex(); + ecore_shutdown(); +} +EFL_END_TEST + +void efl_ui_init(TCase *tc) +{ + tcase_add_test(tc, efl_ui_test_init); +} + + +static const Efl_Test_Case ui_init[] = { + { "init", efl_ui_init }, + { NULL, NULL } +}; + +#undef ecore_timer_add +#define BUFFER_RENDER_INTERVAL 0.005 +#define LOOP_INCREMENT 0.1 +#define TIMER_SCALE ((1.0 / BUFFER_RENDER_INTERVAL) * LOOP_INCREMENT) + +void +loop_timer_interval_set(Eo *obj, double in) +{ + efl_loop_timer_interval_set(obj, in * TIMER_SCALE); +} + +Eo * +timer_add(double in, Ecore_Task_Cb cb, void *data) +{ + return ecore_timer_add(in * TIMER_SCALE, cb, data); +} + +void * +real_timer_add(double in, Ecore_Task_Cb cb, void *data) +{ + return ecore_timer_add(in, cb, data); +} + +static void +_win_manual_render(void *data, const Efl_Event *event EINA_UNUSED) + { + double t = ecore_loop_time_get(); + + ecore_loop_time_set(t + LOOP_INCREMENT); + ecore_animator_custom_tick(); + ecore_evas_render_prepare(ecore_evas_ecore_evas_get(evas_object_evas_get(data))); + evas_norender(evas_object_evas_get(data)); +} + +static void +_loop_iterate(void *data, const Efl_Event *event EINA_UNUSED) +{ + efl_loop_iterate(data); +} + +static void +_win_show(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +{ + Eo *timer = evas_object_data_get(obj, "timer"); + efl_event_thaw(timer); + efl_event_callback_add(efl_loop_get(obj), EFL_LOOP_EVENT_IDLE, _loop_iterate, efl_parent_get(timer)); +} + +static void +_win_hide(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +{ + Eo *timer = evas_object_data_get(obj, "timer"); + efl_event_freeze(timer); + efl_loop_timer_reset(timer); + efl_event_callback_del(efl_loop_get(obj), EFL_LOOP_EVENT_IDLE, _loop_iterate, efl_parent_get(timer)); +} + +static void +_ui_win_visibility_change(void *data EINA_UNUSED, const Efl_Event *ev) +{ + Eina_Bool *visible = ev->info; + if (*visible) + _win_show(NULL, NULL, ev->object, NULL); + else + { + _win_hide(NULL, NULL, ev->object, NULL); + efl_key_data_set(ev->object, "timer", NULL); + } +} + +EFL_CLASS_SIMPLE_CLASS(efl_loop, "Efl.Loop", EFL_LOOP_CLASS) + +static Evas_Object * +_elm_suite_win_create() +{ + Evas_Object *win; + Eo *loop, *timer; + + if (legacy_mode) + win = elm_win_add(NULL, "elm_suite", ELM_WIN_BASIC); + else + win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC)); + if (!buffer) return win; + loop = efl_add(efl_loop_realized_class_get(), win); + timer = efl_add(EFL_LOOP_TIMER_CLASS, loop, + efl_loop_timer_interval_set(efl_added, BUFFER_RENDER_INTERVAL), + efl_event_freeze(efl_added), + efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, _win_manual_render, win) + ); + evas_object_data_set(win, "timer", timer); + ecore_evas_manual_render_set(ecore_evas_ecore_evas_get(evas_object_evas_get(win)), EINA_TRUE); + edje_frametime_set(BUFFER_RENDER_INTERVAL); + ecore_animator_source_set(ECORE_ANIMATOR_SOURCE_CUSTOM); + if (legacy_mode) + { + evas_object_event_callback_add(win, EVAS_CALLBACK_SHOW, _win_show, NULL); + evas_object_event_callback_add(win, EVAS_CALLBACK_HIDE, _win_hide, NULL); + } + else + { + efl_event_callback_add(win, EFL_GFX_ENTITY_EVENT_VISIBILITY_CHANGED, _ui_win_visibility_change, NULL); + } + return win; +} + +Evas_Object * +win_add() +{ + if (getpid() != main_pid) + { + if (global_win) return global_win; + } + return _elm_suite_win_create(); +} + +static void +force_focus_win(Evas_Object *win) +{ + Ecore_Evas *ee; + + ee = ecore_evas_ecore_evas_get(evas_object_evas_get(win)); + ecore_evas_focus_set(ee, EINA_TRUE); + ecore_evas_callback_focus_in_set(ee, NULL); + ecore_evas_callback_focus_out_set(ee, NULL); + Elm_Widget_Smart_Data *pd = efl_data_scope_safe_get(win, EFL_UI_WIDGET_CLASS); + pd->top_win_focused = EINA_TRUE; +} + +Evas_Object * +win_add_focused() +{ + Evas_Object *win; + + if (getpid() != main_pid) + { + if (global_win) return global_win; + } + + win = _elm_suite_win_create(); + force_focus_win(win); + return win; +} + +int +suite_setup(Eina_Bool legacy) +{ + int failed_count; + + legacy_mode = legacy; + +#ifdef NEED_RUN_IN_TREE + putenv("EFL_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(); + + if (legacy) + failed_count = _efl_suite_build_and_run(0, NULL, + "Elementary_Init", etc_init, SUITE_INIT_FN(elm), SUITE_SHUTDOWN_FN(elm)); + else + failed_count = _efl_suite_build_and_run(0, NULL, + "Efl_Ui_Init", ui_init, NULL, NULL); + + failed_count += !elm_init(1, (char*[]){"exe"}); + if (buffer) + { + global_win = _elm_suite_win_create(); + force_focus_win(global_win); + } + EINA_SAFETY_ON_TRUE_RETURN_VAL(failed_count, 255); + /* preload default theme */ + if (legacy) + { + 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); + } + else + { + failed_count += !elm_theme_group_path_find(NULL, "efl/button"); + EINA_SAFETY_ON_TRUE_RETURN_VAL(failed_count, 255); + failed_count += !elm_theme_group_path_find(NULL, "efl/border"); + EINA_SAFETY_ON_TRUE_RETURN_VAL(failed_count, 255); + failed_count += !elm_theme_group_path_find(NULL, "efl/win"); + 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 + */ + if (legacy) + { + 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"); + } + else + { + elm_theme_group_path_find(NULL, "efl/cursor/top_side"); + elm_theme_group_path_find(NULL, "efl/cursor/bottom_side"); + elm_theme_group_path_find(NULL, "efl/cursor/top_left_corner"); + elm_theme_group_path_find(NULL, "efl/cursor/bottom_left_corner"); + elm_theme_group_path_find(NULL, "efl/cursor/top_right_corner"); + elm_theme_group_path_find(NULL, "efl/cursor/bottom_right_corner"); + + + elm_theme_group_path_find(NULL, "efl/colorselector/item/color"); + } + return 0; +} diff --git a/src/tests/elementary/suite_helpers.h b/src/tests/elementary/suite_helpers.h new file mode 100644 index 0000000000..903fa02929 --- /dev/null +++ b/src/tests/elementary/suite_helpers.h @@ -0,0 +1,11 @@ +#ifndef SUITE_HELPERS_H +#define SUITE_HELPERS_H + +#include + +int suite_setup(Eina_Bool legacy); +void _elm2_suite_init(void); +void _elm_suite_shutdown(void); +void *real_timer_add(double in, Ecore_Task_Cb cb, void *data); + +#endif diff --git a/src/tests/elementary/testfile_entry.txt b/src/tests/elementary/testfile_entry.txt new file mode 100644 index 0000000000..3b18e512db --- /dev/null +++ b/src/tests/elementary/testfile_entry.txt @@ -0,0 +1 @@ +hello world diff --git a/src/tests/elementary/testfile_entry2.txt b/src/tests/elementary/testfile_entry2.txt new file mode 100644 index 0000000000..4b870a2e68 --- /dev/null +++ b/src/tests/elementary/testfile_entry2.txt @@ -0,0 +1,2 @@ +hello elementary +hello entry diff --git a/src/tests/elua/elua_lib.c b/src/tests/elua/elua_lib.c index 4f53e7d869..c39d056701 100644 --- a/src/tests/elua/elua_lib.c +++ b/src/tests/elua/elua_lib.c @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -79,22 +80,6 @@ EFL_START_TEST(elua_api) fail_if(lua_type(lst, -1) != LUA_TFUNCTION); lua_pop(lst, 1); - fail_if(!elua_util_require(st, "util")); - fail_if(!elua_util_string_run(st, "return 1337", "foo")); - fail_if(elua_util_string_run(st, "foo bar", "foo")); /* invalid code */ - fail_if(elua_util_app_load(st, "test")); - fail_if(lua_type(lst, -1) != LUA_TFUNCTION); - lua_pop(lst, 1); - fail_if(!elua_util_app_load(st, "non_existent_app")); - fail_if(lua_type(lst, -1) != LUA_TSTRING); - lua_pop(lst, 1); - fail_if(elua_io_loadfile(st, ELUA_CORE_DIR "/util.lua")); - fail_if(lua_type(lst, -1) != LUA_TFUNCTION); - lua_pop(lst, 1); - fail_if(!elua_io_loadfile(st, ELUA_CORE_DIR "/non_existent_file.lua")); - fail_if(lua_type(lst, -1) != LUA_TSTRING); - lua_pop(lst, 1); - fd = mkstemp(buf); fail_if(fd < 0); f = fdopen(fd, "wb"); @@ -112,6 +97,11 @@ EFL_START_TEST(elua_api) fail_if(!elua_util_error_report(st, 5)); fail_if(lua_gettop(lst) > 0); + f = fopen(buf, "wb"); + fail_if(!f); + fprintf(f, "return true"); + fclose(f); + cargv[1] = buf; fail_if(!elua_util_script_run(st, 2, cargv, 1, &quit)); fail_if(quit != 1); @@ -119,11 +109,31 @@ EFL_START_TEST(elua_api) fail_if(!f); fprintf(f, "return false"); fclose(f); - cargv[1] = buf; fail_if(!elua_util_script_run(st, 2, cargv, 1, &quit)); fail_if(quit != 0); fail_if(remove(buf)); + /* elua API here tries accessing files by relative path, + * prevent any unintentional file accesses in cwd + */ + fail_if(chdir(TESTS_SRC_DIR)); + + fail_if(!elua_util_require(st, "util")); + fail_if(!elua_util_string_run(st, "return 1337", "foo")); + fail_if(elua_util_string_run(st, "foo bar", "foo")); /* invalid code */ + fail_if(elua_util_app_load(st, "test")); + fail_if(lua_type(lst, -1) != LUA_TFUNCTION); + lua_pop(lst, 1); + fail_if(!elua_util_app_load(st, "non_existent_app")); + fail_if(lua_type(lst, -1) != LUA_TSTRING); + lua_pop(lst, 1); + fail_if(elua_io_loadfile(st, ELUA_CORE_DIR "/util.lua")); + fail_if(lua_type(lst, -1) != LUA_TFUNCTION); + lua_pop(lst, 1); + fail_if(!elua_io_loadfile(st, ELUA_CORE_DIR "/non_existent_file.lua")); + fail_if(lua_type(lst, -1) != LUA_TSTRING); + lua_pop(lst, 1); + elua_state_free(st); } EFL_END_TEST diff --git a/src/tests/emotion/data/meson.build b/src/tests/emotion/data/meson.build index 5ab6690653..9f6229ad81 100644 --- a/src/tests/emotion/data/meson.build +++ b/src/tests/emotion/data/meson.build @@ -8,7 +8,7 @@ foreach edc_file : edc_files themes += custom_target('edje_cc_' + edc_file, input : edc_file, output : '@BASENAME@.edj', - command : edje_cc_exe + [ '-beta', + command : edje_cc_exe + [ '-beta', '-fastcomp', '-id', meson.current_source_dir(), '-fd', meson.current_source_dir(), '-sd', meson.current_source_dir(), @@ -17,7 +17,7 @@ foreach edc_file : edc_files '-md', meson.current_source_dir(), '-td', meson.current_source_dir(), '@INPUT@', '@OUTPUT@'], - depends : edje_cc, + depends : edje_depends, install : true, install_dir : join_paths(dir_data, 'emotion', 'data') ) diff --git a/src/tests/emotion/emotion_test_main-eo.c b/src/tests/emotion/emotion_test_main-eo.c index 2d5df2f9ab..2ddfb272ca 100644 --- a/src/tests/emotion/emotion_test_main-eo.c +++ b/src/tests/emotion/emotion_test_main-eo.c @@ -1,7 +1,6 @@ #ifdef HAVE_CONFIG_H #include "config.h" #else -#define EFL_EO_API_SUPPORT #define EFL_BETA_API_SUPPORT #endif @@ -112,7 +111,7 @@ static void bg_setup(void) { o_bg = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas); - efl_file_set(o_bg, theme_file, "background"); + efl_file_simple_load(o_bg, theme_file, "background"); 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); @@ -506,7 +505,7 @@ video_obj_signal_frame_move_start_cb(void *data EINA_UNUSED, Evas_Object *o, con evas_pointer_canvas_xy_get(evas_object_evas_get(o), &x, &y); fd->x = x; fd->y = y; - efl_gfx_stack_raise(o); + efl_gfx_stack_raise_to_top(o); } static void @@ -531,7 +530,7 @@ video_obj_signal_frame_resize_start_cb(void *data EINA_UNUSED, Evas_Object *o, c evas_pointer_canvas_xy_get(evas_object_evas_get(o), &x, &y); fd->x = x; fd->y = y; - efl_gfx_stack_raise(o); + efl_gfx_stack_raise_to_top(o); } static void @@ -624,7 +623,7 @@ init_video_object(const char *module_filename, const char *filename) oe = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas); efl_event_callback_add(oe, EFL_EVENT_DEL, _oe_free_cb, fd); efl_key_data_set(oe, "frame_data", fd); - efl_file_set(oe, theme_file, reflex ? "video_controller/reflex" : "video_controller"); + efl_file_simple_load(oe, theme_file, reflex ? "video_controller/reflex" : "video_controller"); edje_object_part_swallow(oe, "video_swallow", o); offset = 20 * (eina_list_count(video_objs) - 1); @@ -634,17 +633,17 @@ init_video_object(const char *module_filename, const char *filename) efl_event_callback_array_add(o, emotion_object_test_callbacks(), oe); - efl_layout_signal_callback_add(oe, "video_control", "play", video_obj_signal_play_cb, o); - efl_layout_signal_callback_add(oe, "video_control", "pause", video_obj_signal_pause_cb, o); - efl_layout_signal_callback_add(oe, "video_control", "stop", video_obj_signal_stop_cb, o); - efl_layout_signal_callback_add(oe, "drag", "video_progress", video_obj_signal_jump_cb, o); - efl_layout_signal_callback_add(oe, "drag", "video_alpha", video_obj_signal_alpha_cb, o); - efl_layout_signal_callback_add(oe, "drag", "video_volume", video_obj_signal_vol_cb, o); - efl_layout_signal_callback_add(oe, "frame_move", "start", video_obj_signal_frame_move_start_cb, oe); - efl_layout_signal_callback_add(oe, "frame_move", "stop", video_obj_signal_frame_move_stop_cb, oe); - efl_layout_signal_callback_add(oe, "frame_resize", "start", video_obj_signal_frame_resize_start_cb, oe); - efl_layout_signal_callback_add(oe, "frame_resize", "stop", video_obj_signal_frame_resize_stop_cb, oe); - efl_layout_signal_callback_add(oe, "mouse, move", "*", video_obj_signal_frame_move_cb, oe); + efl_layout_signal_callback_add(oe, "video_control", "play", o, video_obj_signal_play_cb, NULL); + efl_layout_signal_callback_add(oe, "video_control", "pause", o, video_obj_signal_pause_cb, NULL); + efl_layout_signal_callback_add(oe, "video_control", "stop", o, video_obj_signal_stop_cb, NULL); + efl_layout_signal_callback_add(oe, "drag", "video_progress", o, video_obj_signal_jump_cb, NULL); + efl_layout_signal_callback_add(oe, "drag", "video_alpha", o, video_obj_signal_alpha_cb, NULL); + efl_layout_signal_callback_add(oe, "drag", "video_volume", o, video_obj_signal_vol_cb, NULL); + efl_layout_signal_callback_add(oe, "frame_move", "start", oe, video_obj_signal_frame_move_start_cb, NULL); + efl_layout_signal_callback_add(oe, "frame_move", "stop", oe, video_obj_signal_frame_move_stop_cb, NULL); + efl_layout_signal_callback_add(oe, "frame_resize", "start", oe, video_obj_signal_frame_resize_start_cb, NULL); + efl_layout_signal_callback_add(oe, "frame_resize", "stop", oe, video_obj_signal_frame_resize_stop_cb, NULL); + efl_layout_signal_callback_add(oe, "mouse, move", "*", oe, video_obj_signal_frame_move_cb, NULL); efl_ui_drag_value_set(efl_part(oe, "video_alpha"), 0.0, 1.0); efl_text_set(efl_part(oe, "video_alpha_txt"), "alpha 255"); efl_ui_drag_value_set(efl_part(oe, "video_volume"), 0.0, 0.5); diff --git a/src/tests/eo/access/meson.build b/src/tests/eo/access/meson.build index 79bc65f982..da7fce354f 100644 --- a/src/tests/eo/access/meson.build +++ b/src/tests/eo/access/meson.build @@ -18,3 +18,15 @@ eo_access = executable('eo_access', test('eo-access', eo_access, env : test_env ) + +eo_access = executable('eo_access_dbg', + eo_access_src, + dependencies: [eo_dbg], + c_args : [ + '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', + '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"'] +) + +test('eo-access-dbg', eo_access, + env : test_env +) diff --git a/src/tests/eo/children/meson.build b/src/tests/eo/children/meson.build index e740b5cc9b..ac55d805f4 100644 --- a/src/tests/eo/children/meson.build +++ b/src/tests/eo/children/meson.build @@ -15,3 +15,15 @@ eo_children = executable('eo_children', test('eo-children', eo_children, env : test_env ) + +eo_children = executable('eo_children_dbg', + eo_children_src, + dependencies: [eo_dbg], + c_args : [ + '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', + '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"'] +) + +test('eo-children-dbg', eo_children, + env : test_env +) diff --git a/src/tests/eo/composite_objects/meson.build b/src/tests/eo/composite_objects/meson.build index 578d4fabbc..0a47e14313 100644 --- a/src/tests/eo/composite_objects/meson.build +++ b/src/tests/eo/composite_objects/meson.build @@ -17,3 +17,15 @@ eo_composite_objects = executable('eo_composite_objects', test('eo-composite-objects', eo_composite_objects, env : test_env ) + +eo_composite_objects = executable('eo_composite_objects_dbg', + eo_composite_objects_src, + dependencies: [eo_dbg], + c_args : [ + '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', + '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"'] +) + +test('eo-composite-objects-dbg', eo_composite_objects, + env : test_env +) diff --git a/src/tests/eo/constructors/meson.build b/src/tests/eo/constructors/meson.build index 612c7be3ec..b90058ce5c 100644 --- a/src/tests/eo/constructors/meson.build +++ b/src/tests/eo/constructors/meson.build @@ -29,3 +29,15 @@ eo_constructors = executable('eo_constructors', test('eo-constructors', eo_constructors, env : test_env ) + +eo_constructors = executable('eo_constructors_dbg', + eo_constructors_src, + dependencies: [eo_dbg], + c_args : [ + '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', + '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"'] +) + +test('eo-constructors-dbg', eo_constructors, + env : test_env +) diff --git a/src/tests/eo/function_overrides/function_overrides_inherit2.c b/src/tests/eo/function_overrides/function_overrides_inherit2.c index 71732fe931..e4aa147b67 100644 --- a/src/tests/eo/function_overrides/function_overrides_inherit2.c +++ b/src/tests/eo/function_overrides/function_overrides_inherit2.c @@ -42,20 +42,6 @@ _print2(Eo *obj EINA_UNUSED, void *class_data EINA_UNUSED) return EINA_TRUE; } -static Eina_Bool -_class_print(Efl_Class *klass, void *data EINA_UNUSED) -{ - Eina_Bool called = EINA_FALSE; - printf("Print %s-%s\n", efl_class_name_get(klass), efl_class_name_get(MY_CLASS)); - called = simple_class_print(efl_super(klass, MY_CLASS)); - fail_if(!called); - - called = simple_class_print2(efl_super(klass, MY_CLASS)); - fail_if(!called); - - return EINA_TRUE; -} - EAPI EFL_FUNC_BODY(inherit2_print, Eina_Bool, EINA_FALSE); EAPI EFL_FUNC_BODY(inherit2_print2, Eina_Bool, EINA_FALSE); @@ -67,11 +53,8 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(inherit2_print2, _print2), EFL_OBJECT_OP_FUNC(simple_a_set, _a_set), ); - EFL_OPS_DEFINE(cops, - EFL_OBJECT_OP_FUNC(simple_class_print, _class_print), - ); - return efl_class_functions_set(klass, &ops, &cops); + return efl_class_functions_set(klass, &ops, NULL); } static const Efl_Class_Description class_desc = { diff --git a/src/tests/eo/function_overrides/meson.build b/src/tests/eo/function_overrides/meson.build index fb2b8dcadb..b616e51cce 100644 --- a/src/tests/eo/function_overrides/meson.build +++ b/src/tests/eo/function_overrides/meson.build @@ -21,3 +21,15 @@ eo_function_overrides = executable('eo_function_overrides', test('eo-function-overrides', eo_interface, env : test_env ) + +eo_function_overrides = executable('eo_function_overrides_dbg', + eo_function_overrides_src, + dependencies: [eo_dbg], + c_args : [ + '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', + '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"'] +) + +test('eo-function-overrides-dbg', eo_interface, + env : test_env +) diff --git a/src/tests/eo/interface/interface_main.c b/src/tests/eo/interface/interface_main.c index 53142cfd7f..48685bb047 100644 --- a/src/tests/eo/interface/interface_main.c +++ b/src/tests/eo/interface/interface_main.c @@ -37,6 +37,11 @@ main(int argc, char *argv[]) fail_if(!efl_isa(obj, INTERFACE_CLASS)); fail_if(!efl_isa(obj, INTERFACE2_CLASS)); + fail_if(!efl_isa(SIMPLE_CLASS, INTERFACE_CLASS)); + fail_if(!efl_isa(SIMPLE_CLASS, INTERFACE2_CLASS)); + fail_if(efl_isa(INTERFACE_CLASS, INTERFACE2_CLASS)); + + fail_if(efl_class_type_get(INTERFACE_CLASS) != EFL_CLASS_TYPE_INTERFACE); efl_unref(obj); efl_object_shutdown(); diff --git a/src/tests/eo/interface/meson.build b/src/tests/eo/interface/meson.build index 77f725734b..16b109ac1a 100644 --- a/src/tests/eo/interface/meson.build +++ b/src/tests/eo/interface/meson.build @@ -19,3 +19,15 @@ eo_interface = executable('eo_interface', test('eo-interface', eo_interface, env : test_env ) + +eo_interface = executable('eo_interface_dbg', + eo_interface_src, + dependencies: [eo_dbg], + c_args : [ + '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', + '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"'] +) + +test('eo-interface-dbg', eo_interface, + env : test_env +) diff --git a/src/tests/eo/mixin/meson.build b/src/tests/eo/mixin/meson.build index 5ae83a9672..3e2d73a4b9 100644 --- a/src/tests/eo/mixin/meson.build +++ b/src/tests/eo/mixin/meson.build @@ -25,3 +25,14 @@ eo_mixin = executable('eo_mixin', test('eo-mixins', eo_mixin, env : test_env ) +eo_mixin = executable('eo_mixin_dbg', + eo_mixin_src, + dependencies: [eo_dbg], + c_args : [ + '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', + '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"'] +) + +test('eo-mixins-dbg', eo_mixin, + env : test_env +) diff --git a/src/tests/eo/mixin/mixin_main.c b/src/tests/eo/mixin/mixin_main.c index 2ef7b360a4..3b8a022f2b 100644 --- a/src/tests/eo/mixin/mixin_main.c +++ b/src/tests/eo/mixin/mixin_main.c @@ -46,6 +46,9 @@ main(int argc, char *argv[]) printf("%d\n", a); fail_if(a != 5); + fail_if(efl_class_type_get(MIXIN_CLASS) != EFL_CLASS_TYPE_MIXIN); + + efl_unref(obj); efl_object_shutdown(); return 0; diff --git a/src/tests/eo/signals/meson.build b/src/tests/eo/signals/meson.build index 37006ac3fc..3786367657 100644 --- a/src/tests/eo/signals/meson.build +++ b/src/tests/eo/signals/meson.build @@ -15,3 +15,15 @@ eo_signals = executable('eo_signals', test('eo-signals', eo_signals, env : test_env ) + +eo_signals = executable('eo_signals_dbg', + eo_signals_src, + dependencies: [eo_dbg], + c_args : [ + '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', + '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"'] +) + +test('eo-signals-dbg', eo_signals, + env : test_env +) diff --git a/src/tests/eo/signals/signals_main.c b/src/tests/eo/signals/signals_main.c index 58b9eda958..c3b1648c17 100644 --- a/src/tests/eo/signals/signals_main.c +++ b/src/tests/eo/signals/signals_main.c @@ -171,15 +171,15 @@ main(int argc, char *argv[]) efl_event_callback_priority_add(obj, EV_A_CHANGED, EFL_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 1); fail_if(pd->cb_count != 1); - fcount = efl_event_global_freeze_count_get(EO_CLASS); + fcount = efl_event_global_freeze_count_get(); fail_if(fcount != 0); - efl_event_global_freeze(EO_CLASS); - fcount = efl_event_global_freeze_count_get(EO_CLASS); + efl_event_global_freeze(); + fcount = efl_event_global_freeze_count_get(); fail_if(fcount != 1); - efl_event_global_freeze(EO_CLASS); - fcount = efl_event_global_freeze_count_get(EO_CLASS); + efl_event_global_freeze(); + fcount = efl_event_global_freeze_count_get(); fail_if(fcount != 2); efl_event_callback_priority_add(obj, EV_A_CHANGED, EFL_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 2); @@ -187,30 +187,30 @@ main(int argc, char *argv[]) simple_a_set(obj, 2); fail_if(cb_count != 0); - efl_event_global_thaw(EO_CLASS); - fcount = efl_event_global_freeze_count_get(EO_CLASS); + efl_event_global_thaw(); + fcount = efl_event_global_freeze_count_get(); fail_if(fcount != 1); - efl_event_global_thaw(EO_CLASS); - fcount = efl_event_global_freeze_count_get(EO_CLASS); + efl_event_global_thaw(); + fcount = efl_event_global_freeze_count_get(); fail_if(fcount != 0); simple_a_set(obj, 3); fail_if(cb_count != 2); cb_count = 0; - efl_event_global_thaw(EO_CLASS); - fcount = efl_event_global_freeze_count_get(EO_CLASS); + efl_event_global_thaw(); + fcount = efl_event_global_freeze_count_get(); fail_if(fcount != 0); - efl_event_global_freeze(EO_CLASS); - fcount = efl_event_global_freeze_count_get(EO_CLASS); + efl_event_global_freeze(); + fcount = efl_event_global_freeze_count_get(); fail_if(fcount != 1); simple_a_set(obj, 2); fail_if(cb_count != 0); - efl_event_global_thaw(EO_CLASS); - fcount = efl_event_global_freeze_count_get(EO_CLASS); + efl_event_global_thaw(); + fcount = efl_event_global_freeze_count_get(); fail_if(fcount != 0); efl_event_callback_priority_add(obj, EV_RESTART, EFL_CALLBACK_PRIORITY_DEFAULT, _restart_1_cb, NULL); diff --git a/src/tests/eo/suite/eo_suite.c b/src/tests/eo/suite/eo_suite.c index 57b7c613f3..fe8e419e0f 100644 --- a/src/tests/eo/suite/eo_suite.c +++ b/src/tests/eo/suite/eo_suite.c @@ -20,6 +20,7 @@ static const Efl_Test_Case etc[] = { { "Eo threaded eo calls", eo_test_threaded_calls }, { "Eo event calls", eo_test_event}, { "Eo lifecycle", eo_test_lifecycle}, + { "Eo Reflection", eo_test_reflection}, { NULL, NULL } }; diff --git a/src/tests/eo/suite/eo_suite.h b/src/tests/eo/suite/eo_suite.h index 700325c465..84da2054f8 100644 --- a/src/tests/eo/suite/eo_suite.h +++ b/src/tests/eo/suite/eo_suite.h @@ -12,4 +12,5 @@ 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); +void eo_test_reflection(TCase *tc); #endif /* _EO_SUITE_H */ diff --git a/src/tests/eo/suite/eo_test_class_simple.c b/src/tests/eo/suite/eo_test_class_simple.c index 281549c629..846c2f2cb0 100644 --- a/src/tests/eo/suite/eo_test_class_simple.c +++ b/src/tests/eo/suite/eo_test_class_simple.c @@ -23,14 +23,34 @@ _a_set(Eo *obj EINA_UNUSED, void *class_data, int a) efl_event_callback_legacy_call(obj, EV_A_CHANGED, &pd->a); } +static Eina_Error +_a_set_reflect(Eo *obj, Eina_Value value) +{ + int a; + + eina_value_int_convert(&value, &a); + simple_a_set(obj, a); + eina_value_flush(&value); + + return 0; +} + static int -_a_get(Eo *obj EINA_UNUSED, void *class_data) +_a_get(const Eo *obj EINA_UNUSED, void *class_data) { Simple_Public_Data *pd = class_data; return pd->a; } +static Eina_Value +_a_get_reflect(const Eo *obj) +{ + int a = simple_a_get(obj); + + return eina_value_int_init(a); +} + static Eina_Bool _a_print(Eo *obj EINA_UNUSED, void *class_data) { @@ -40,14 +60,6 @@ _a_print(Eo *obj EINA_UNUSED, void *class_data) return EINA_TRUE; } -static Eina_Bool -_class_hi_print(Efl_Class *klass, void *data EINA_UNUSED) -{ - printf("Hi Print %s\n", efl_class_name_get(klass)); - - return EINA_TRUE; -} - EFL_FUNC_BODYV(simple_part_get, Eo *, NULL, EFL_FUNC_CALL(name), const char *name); static Eo * @@ -82,9 +94,8 @@ _dbg_info_get(Eo *eo_obj, void *_pd EINA_UNUSED, Efl_Dbg_Info *root) } EFL_VOID_FUNC_BODYV(simple_a_set, EFL_FUNC_CALL(a), int a); -EFL_FUNC_BODY(simple_a_get, int, 0); +EFL_FUNC_BODY_CONST(simple_a_get, int, 0); EFL_FUNC_BODY(simple_a_print, Eina_Bool, EINA_FALSE); -EFL_FUNC_BODY_CONST(simple_class_hi_print, Eina_Bool, EINA_FALSE); EFL_VOID_FUNC_BODY(simple_pure_virtual); EFL_VOID_FUNC_BODY(simple_no_implementation); @@ -100,11 +111,14 @@ _class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(simple_pure_virtual, NULL), EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _dbg_info_get), ); - EFL_OPS_DEFINE(cops, - EFL_OBJECT_OP_FUNC(simple_class_hi_print, _class_hi_print), - ); + static const Efl_Object_Property_Reflection reflection_table[] = { + {"simple_a", _a_set_reflect, _a_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops ref_ops = { + reflection_table, EINA_C_ARRAY_LENGTH(reflection_table) + }; - return efl_class_functions_set(klass, &ops, &cops); + return efl_class_functions_set(klass, &ops, &ref_ops); } static const Efl_Class_Description class_desc = { @@ -118,24 +132,13 @@ static const Efl_Class_Description class_desc = { }; EFL_DEFINE_CLASS(simple_class_get, &class_desc, EO_CLASS, NULL) - - -static int -_beef_get(Eo *obj EINA_UNUSED, void *class_data EINA_UNUSED) -{ - return 0xBEEF; -} - EFL_FUNC_BODY_CONST(simple2_class_beef_get, int, 0); static Eina_Bool _class_initializer2(Efl_Class *klass) { - EFL_OPS_DEFINE(cops, - EFL_OBJECT_OP_FUNC(simple2_class_beef_get, _beef_get), - ); - return efl_class_functions_set(klass, NULL, &cops); + return efl_class_functions_set(klass, NULL, NULL); } static const Efl_Class_Description class_desc2 = { diff --git a/src/tests/eo/suite/eo_test_class_simple.h b/src/tests/eo/suite/eo_test_class_simple.h index 9023119577..b438b14d97 100644 --- a/src/tests/eo/suite/eo_test_class_simple.h +++ b/src/tests/eo/suite/eo_test_class_simple.h @@ -7,7 +7,7 @@ typedef struct } Simple_Public_Data; EAPI void simple_a_set(Eo *obj, int a); -EAPI int simple_a_get(Eo *obj); +EAPI int simple_a_get(const Eo *obj); EAPI Eina_Bool simple_a_print(Eo *obj); EAPI Eina_Bool simple_class_hi_print(const Eo *obj); EAPI void simple_recursive(Eo *obj, int n); @@ -24,8 +24,6 @@ extern const Efl_Event_Description _EV_A_CHANGED2; #define SIMPLE_CLASS simple_class_get() const Efl_Class *simple_class_get(void); -EAPI int simple2_class_beef_get(const Efl_Class *obj); - #define SIMPLE2_CLASS simple2_class_get() const Efl_Class *simple2_class_get(void); diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c index 889bfdd294..1494f46c95 100644 --- a/src/tests/eo/suite/eo_test_general.c +++ b/src/tests/eo/suite/eo_test_general.c @@ -66,6 +66,18 @@ _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); } +EAPI int test_class_beef_get(const Efl_Object *obj); + +EFL_FUNC_BODY_CONST(test_class_beef_get, int, 0) + +static int +_simple_obj_override_beef_get(Eo *obj, void *class_data EINA_UNUSED) +{ + test_class_beef_get(efl_super(obj, EFL_OBJECT_OVERRIDE_CLASS)); + + return 1337; +} + EFL_START_TEST(efl_object_override_tests) { @@ -105,7 +117,7 @@ EFL_START_TEST(efl_object_override_tests) /* Try introducing a new function */ EFL_OPS_DEFINE( overrides3, - EFL_OBJECT_OP_FUNC(simple2_class_beef_get, _simple_obj_override_a_double_set)); + EFL_OBJECT_OP_FUNC(test_class_beef_get, _simple_obj_override_beef_get)); fail_if(efl_object_override(obj, &overrides3)); fail_if(!efl_object_override(obj, NULL)); fail_if(efl_object_override(obj, &overrides3)); @@ -327,6 +339,8 @@ EFL_START_TEST(efl_data_safe_fetch) fail_if(!efl_isa(obj, SIMPLE_CLASS)); fail_if(!efl_isa(obj, SIMPLE2_CLASS)); fail_if(!efl_isa(obj, SIMPLE3_CLASS)); + fail_if(!efl_isa(SIMPLE3_CLASS, SIMPLE_CLASS)); + fail_if(!efl_isa(SIMPLE_CLASS, SIMPLE_CLASS)); fail_if(!efl_data_scope_safe_get(obj, SIMPLE_CLASS)); fail_if(!efl_data_scope_safe_get(obj, SIMPLE3_CLASS)); fail_if(efl_data_scope_safe_get(obj, SIMPLE2_CLASS) != NULL); @@ -1792,7 +1806,45 @@ EFL_START_TEST(efl_object_size) { // This test is checking that we are not increasing the size of our object over time // Update this number only if you modified the class size on purpose + +#ifdef EO_DEBUG + ck_assert_int_le(efl_class_memory_size_get(SIMPLE_CLASS), 164); +#else ck_assert_int_le(efl_class_memory_size_get(SIMPLE_CLASS), 148); +#endif +} +EFL_END_TEST + +EFL_START_TEST(eo_test_class_replacement) +{ + Eo *obj; + + /* test basic override */ + ck_assert(efl_class_override_register(SIMPLE_CLASS, SIMPLE3_CLASS)); + obj = efl_add_ref(SIMPLE_CLASS, NULL); + fail_if(!obj); + ck_assert_ptr_eq(efl_class_get(obj), SIMPLE3_CLASS); + efl_unref(obj); + + /* test overriding with non-inheriting class */ + ck_assert(!efl_class_override_register(SIMPLE_CLASS, SIMPLE2_CLASS)); + + /* test removing an invalid override */ + ck_assert(!efl_class_override_unregister(SIMPLE_CLASS, SIMPLE2_CLASS)); + + /* test removing an override */ + ck_assert(efl_class_override_unregister(SIMPLE_CLASS, SIMPLE3_CLASS)); + obj = efl_add_ref(SIMPLE_CLASS, NULL); + fail_if(!obj); + ck_assert_ptr_eq(efl_class_get(obj), SIMPLE_CLASS); + efl_unref(obj); +} +EFL_END_TEST + +EFL_START_TEST(eo_test_class_type) +{ + ck_assert_int_eq(efl_class_type_get(SIMPLE_CLASS), EFL_CLASS_TYPE_REGULAR); + ck_assert_int_eq(efl_class_type_get((void*)0xAFFE), EFL_CLASS_TYPE_INVALID); } EFL_END_TEST @@ -1801,6 +1853,7 @@ void eo_test_general(TCase *tc) tcase_add_test(tc, eo_simple); tcase_add_test(tc, eo_singleton); tcase_add_test(tc, efl_object_override_tests); + tcase_add_test(tc, eo_test_class_replacement); tcase_add_test(tc, eo_signals); tcase_add_test(tc, efl_data_fetch); tcase_add_test(tc, efl_data_safe_fetch); @@ -1824,4 +1877,5 @@ void eo_test_general(TCase *tc) tcase_add_test(tc, efl_object_destruct_test); tcase_add_test(tc, efl_object_auto_unref_test); tcase_add_test(tc, efl_object_size); + tcase_add_test(tc, eo_test_class_type); } diff --git a/src/tests/eo/suite/eo_test_init.c b/src/tests/eo/suite/eo_test_init.c index cee49211e1..4cd2bf26c4 100644 --- a/src/tests/eo/suite/eo_test_init.c +++ b/src/tests/eo/suite/eo_test_init.c @@ -23,10 +23,9 @@ EFL_START_TEST(eo_test_init_shutdown) /* XXX-1: Essential for the next test to assign the wrong op. */ obj = efl_add_ref(SIMPLE_CLASS, NULL); simple_a_set(obj, 1); + /* XXX-1: Essential for the next test to cache the op. */ ck_assert_int_eq(1, simple_a_get(obj)); - /* XXX-1: Essential for the next test to cache the op. */ - ck_assert_int_eq(0xBEEF, simple2_class_beef_get(SIMPLE2_CLASS)); efl_unref(obj); fail_if(efl_object_shutdown()); @@ -34,7 +33,9 @@ EFL_START_TEST(eo_test_init_shutdown) ck_assert_str_eq("Efl.Object", efl_class_name_get(EFL_OBJECT_CLASS)); /* XXX-1: Verify that the op was not cached. */ - ck_assert_int_eq(0xBEEF, simple2_class_beef_get(SIMPLE2_CLASS)); + obj = efl_add_ref(SIMPLE_CLASS, NULL); + simple_a_set(obj, 1); + ck_assert_int_eq(1, simple_a_get(obj)); } EFL_END_TEST diff --git a/src/tests/eo/suite/eo_test_reflection.c b/src/tests/eo/suite/eo_test_reflection.c new file mode 100644 index 0000000000..c5a5b16929 --- /dev/null +++ b/src/tests/eo/suite/eo_test_reflection.c @@ -0,0 +1,91 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include + +#include + +#include "eo_suite.h" +#include "eo_test_class_simple.h" +#include "eo_test_reflection_complex_class_structure.h" + + +EFL_START_TEST(eo_test_reflection_invalid) +{ + Eina_Value numb_val = eina_value_int_init(1337); + Eo *simple = efl_new(SIMPLE_CLASS); + + simple_a_set(simple, 22); + efl_property_reflection_set(simple, "simple_a_asdf", numb_val); + fail_if(efl_property_reflection_get(simple, "simple_a_invalid").type != EINA_VALUE_TYPE_ERROR); +} +EFL_END_TEST + +EFL_START_TEST(eo_test_reflection_inherited) +{ + const int numb = 42; + int number_ref; + Eina_Value numb_val = eina_value_int_init(numb); + Eo *simple = efl_new(SIMPLE3_CLASS); + + simple_a_set(simple, 22); + efl_property_reflection_set(simple, "simple_a", numb_val); + ck_assert_int_eq(simple_a_get(simple), numb); + + simple_a_set(simple, 22); + Eina_Value res = efl_property_reflection_get(simple, "simple_a"); + eina_value_int_convert(&res, &number_ref); + ck_assert_int_eq(number_ref, 22); + +} +EFL_END_TEST + +EFL_START_TEST(eo_test_reflection_simple) +{ + const int numb = 42; + int number_ref; + Eina_Value numb_val = eina_value_int_init(numb); + Eina_Value useless_val = eina_value_int_init(7); + Eo *simple = efl_new(SIMPLE_CLASS); + + simple_a_set(simple, 22); + efl_property_reflection_set(simple, "simple_a", numb_val); + ck_assert_int_eq(simple_a_get(simple), numb); + + ck_assert_int_eq(efl_property_reflection_exist(simple, "simple_a"), EINA_TRUE); + + ck_assert_int_eq(efl_property_reflection_set(simple, "should_fail", useless_val), + EINA_ERROR_NOT_IMPLEMENTED); + + ck_assert_int_eq(efl_property_reflection_exist(simple, "should_fail"), EINA_FALSE); + + simple_a_set(simple, 22); + Eina_Value res = efl_property_reflection_get(simple, "simple_a"); + eina_value_int_convert(&res, &number_ref); + ck_assert_int_eq(number_ref, 22); +} +EFL_END_TEST + +EFL_START_TEST(eo_test_reflection_complex_class_structure) +{ + const int numb = 42; + Eina_Value numb_val = eina_value_int_init(numb); + Eo *simple = efl_new(COMPLEX_CLASS_CLASS); + + efl_property_reflection_set(simple, "m_test", numb_val); + efl_property_reflection_set(simple, "i_test", numb_val); + + ck_assert_int_eq(complex_mixin_m_test_get(simple), numb); + ck_assert_int_eq(complex_interface_i_test_get(simple), numb); +} +EFL_END_TEST + +void eo_test_reflection(TCase *tc) +{ + tcase_add_test(tc, eo_test_reflection_simple); + tcase_add_test(tc, eo_test_reflection_inherited); + tcase_add_test(tc, eo_test_reflection_invalid); + tcase_add_test(tc, eo_test_reflection_complex_class_structure); +} +#include "eo_test_reflection_complex_class_structure.c" diff --git a/src/tests/eo/suite/eo_test_reflection_complex_class_structure.c b/src/tests/eo/suite/eo_test_reflection_complex_class_structure.c new file mode 100644 index 0000000000..19727ca879 --- /dev/null +++ b/src/tests/eo/suite/eo_test_reflection_complex_class_structure.c @@ -0,0 +1,211 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include + +#include + +#include "eo_suite.h" +#include "eo_test_class_simple.h" +#include "eo_test_reflection_complex_class_structure.h" + +typedef struct { + int i; +} Complex_Class_Data; + +typedef struct { + int i; +} Complex_Mixin_Data; + +static void +_complex_class_complex_interface_i_test_set(Eo *obj EINA_UNUSED, Complex_Class_Data *pd, int i) +{ + pd->i = i; +} + +static int +_complex_class_complex_interface_i_test_get(const Eo *obj EINA_UNUSED, Complex_Class_Data *pd) +{ + return pd->i; +} + +static int +_complex_mixin_m_test_get(const Eo *obj EINA_UNUSED, Complex_Mixin_Data *pd) +{ + return pd->i; +} + +static void +_complex_mixin_m_test_set(Eo *obj EINA_UNUSED, Complex_Mixin_Data *pd, int i) +{ + pd->i = i; +} + +static Eina_Bool +_complex_class_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef COMPLEX_CLASS_EXTRA_OPS +#define COMPLEX_CLASS_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(complex_interface_i_test_set, _complex_class_complex_interface_i_test_set), + EFL_OBJECT_OP_FUNC(complex_interface_i_test_get, _complex_class_complex_interface_i_test_get), + COMPLEX_CLASS_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _complex_class_class_desc = { + EO_VERSION, + "Complex_Class", + EFL_CLASS_TYPE_REGULAR, + sizeof(Complex_Class_Data), + _complex_class_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(complex_class_class_get, &_complex_class_class_desc, EO_CLASS, COMPLEX_INTERFACE_INTERFACE, COMPLEX_MIXIN_MIXIN, NULL); + +static Eina_Error +__eolian_complex_interface_i_test_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + complex_interface_i_test_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(complex_interface_i_test_set, EFL_FUNC_CALL(i), int i); + +static Eina_Value +__eolian_complex_interface_i_test_get_reflect(const Eo *obj) +{ + int val = complex_interface_i_test_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(complex_interface_i_test_get, int, 0); + +static Eina_Bool +_complex_interface_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef COMPLEX_INTERFACE_EXTRA_OPS +#define COMPLEX_INTERFACE_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(complex_interface_i_test_set, NULL), + EFL_OBJECT_OP_FUNC(complex_interface_i_test_get, NULL), + COMPLEX_INTERFACE_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"i_test", __eolian_complex_interface_i_test_set_reflect, __eolian_complex_interface_i_test_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _complex_interface_class_desc = { + EO_VERSION, + "Complex_Interface", + EFL_CLASS_TYPE_INTERFACE, + 0, + _complex_interface_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(complex_interface_interface_get, &_complex_interface_class_desc, NULL, NULL); + +static Eina_Error +__eolian_complex_mixin_m_test_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + complex_mixin_m_test_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(complex_mixin_m_test_set, EFL_FUNC_CALL(i), int i); + + +static Eina_Value +__eolian_complex_mixin_m_test_get_reflect(const Eo *obj) +{ + int val = complex_mixin_m_test_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(complex_mixin_m_test_get, int, 0); + +static Eina_Bool +_complex_mixin_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef COMPLEX_MIXIN_EXTRA_OPS +#define COMPLEX_MIXIN_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(complex_mixin_m_test_set, _complex_mixin_m_test_set), + EFL_OBJECT_OP_FUNC(complex_mixin_m_test_get, _complex_mixin_m_test_get), + COMPLEX_MIXIN_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"m_test", __eolian_complex_mixin_m_test_set_reflect, __eolian_complex_mixin_m_test_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _complex_mixin_class_desc = { + EO_VERSION, + "Complex_Mixin", + EFL_CLASS_TYPE_MIXIN, + sizeof(Complex_Mixin_Data), + _complex_mixin_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(complex_mixin_mixin_get, &_complex_mixin_class_desc, NULL, NULL); diff --git a/src/tests/eo/suite/eo_test_reflection_complex_class_structure.h b/src/tests/eo/suite/eo_test_reflection_complex_class_structure.h new file mode 100644 index 0000000000..ae615c9428 --- /dev/null +++ b/src/tests/eo/suite/eo_test_reflection_complex_class_structure.h @@ -0,0 +1,20 @@ +#ifndef EO_TEST_REFLECTION_COMPLEX_CLASS_STRCUTURE_H +#define EO_TEST_REFLECTION_COMPLEX_CLASS_STRCUTURE_H + +typedef Eo Complex_Mixin; +#define COMPLEX_MIXIN_MIXIN complex_mixin_mixin_get() +EWAPI const Efl_Class *complex_mixin_mixin_get(void); +EOAPI void complex_mixin_m_test_set(Eo *obj, int i); +EOAPI int complex_mixin_m_test_get(const Eo *obj); + +typedef Eo Complex_Interface; +#define COMPLEX_INTERFACE_INTERFACE complex_interface_interface_get() +EWAPI const Efl_Class *complex_interface_interface_get(void); +EOAPI void complex_interface_i_test_set(Eo *obj, int i); +EOAPI int complex_interface_i_test_get(const Eo *obj); + +typedef Eo Complex_Class; +#define COMPLEX_CLASS_CLASS complex_class_class_get() +EWAPI const Efl_Class *complex_class_class_get(void); + +#endif diff --git a/src/tests/eo/suite/meson.build b/src/tests/eo/suite/meson.build index 6e7f4ba6f7..3edd5f33b4 100644 --- a/src/tests/eo/suite/meson.build +++ b/src/tests/eo/suite/meson.build @@ -17,7 +17,8 @@ eo_suite_src = [ 'eo_test_event.c', 'eo_test_threaded_calls.c', 'eo_test_init.c', - 'eo_test_lifecycle.c' + 'eo_test_lifecycle.c', + 'eo_test_reflection.c' ] eo_suite = executable('eo_suite', @@ -31,3 +32,30 @@ eo_suite = executable('eo_suite', test('eo-suite', eo_suite, env : test_env ) + +eo_suite = executable('eo_suite_dbg', + eo_suite_src, + dependencies: [eo_dbg, check, valgrind], + c_args : [ + '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', + '-DEO_DEBUG=1', + '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"'] +) + +test('eo-suite-dbg', eo_suite, + env : test_env +) + +eo_suite = executable('eo_suite_fallback', + eo_suite_src, + dependencies: [eo_dbg, check, valgrind], + c_args : [ + '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', + '-DEO_DEBUG=1', + '-D_EO_ADD_FALLBACK_FORCE=1', + '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"'] +) + +test('eo-suite-fallback', eo_suite, + env : test_env +) diff --git a/src/tests/eolian/data/class_simple.eo b/src/tests/eolian/data/class_simple.eo index 6d9e59ddd7..0a89c5eea7 100644 --- a/src/tests/eolian/data/class_simple.eo +++ b/src/tests/eolian/data/class_simple.eo @@ -8,7 +8,6 @@ var @extern Bah: double; // not generated class Class_Simple { [[Class Desc Simple]] - legacy_prefix: evas_object_simple; eo_prefix: efl_canvas_object_simple; data: Evas_Simple_Data; methods { @@ -24,11 +23,6 @@ class Class_Simple { value: int (100); [[Value description]] } } - @property b { - set { - eo: null; - } - } foo @beta { [[comment foo]] params { @@ -39,12 +33,5 @@ class Class_Simple { } return: ptr(char) (null); [[comment for method return]] } - bar { - eo: null; - params { - x: int; - } - return: ptr(int); - } } } diff --git a/src/tests/eolian/data/class_simple_ref.c b/src/tests/eolian/data/class_simple_ref.c index 10fa96b038..4fec41fb02 100644 --- a/src/tests/eolian/data/class_simple_ref.c +++ b/src/tests/eolian/data/class_simple_ref.c @@ -2,16 +2,36 @@ EWAPI float BAR = 10.300000f; Eina_Bool _class_simple_a_set(Eo *obj, Evas_Simple_Data *pd, int value); + +static Eina_Error +__eolian_class_simple_a_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + efl_canvas_object_simple_a_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + 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(const Eo *obj, Evas_Simple_Data *pd); + +static Eina_Value +__eolian_class_simple_a_get_reflect(const Eo *obj) +{ + int val = efl_canvas_object_simple_a_get(obj); + return eina_value_int_init(val); +} + EOAPI EFL_FUNC_BODY_CONST(efl_canvas_object_simple_a_get, int, 100); -void _class_simple_b_set(Eo *obj, Evas_Simple_Data *pd); - -EOAPI EFL_VOID_FUNC_BODY(efl_canvas_object_simple_b_set); - char *_class_simple_foo(Eo *obj, Evas_Simple_Data *pd, int a, char *b, double *c, int *d); static char *__eolian_class_simple_foo(Eo *obj, Evas_Simple_Data *pd, int a, char *b, double *c, int *d) @@ -22,14 +42,12 @@ static char *__eolian_class_simple_foo(Eo *obj, Evas_Simple_Data *pd, int a, cha EOAPI EFL_FUNC_BODYV(efl_canvas_object_simple_foo, char *, NULL /* null */, EFL_FUNC_CALL(a, b, c, d), int a, char *b, double *c, int *d); -int *_class_simple_bar(Eo *obj, Evas_Simple_Data *pd, int x); - -EOAPI EFL_FUNC_BODYV(efl_canvas_object_simple_bar, int *, NULL, EFL_FUNC_CALL(x), int x); - static Eina_Bool _class_simple_class_initializer(Efl_Class *klass) { - const Efl_Object_Ops *opsp = NULL, *copsp = NULL; + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; #ifndef CLASS_SIMPLE_EXTRA_OPS #define CLASS_SIMPLE_EXTRA_OPS @@ -38,19 +56,20 @@ _class_simple_class_initializer(Efl_Class *klass) EFL_OPS_DEFINE(ops, EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_a_set, _class_simple_a_set), EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_a_get, _class_simple_a_get), - EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_b_set, _class_simple_b_set), EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_foo, __eolian_class_simple_foo), - EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_bar, _class_simple_bar), CLASS_SIMPLE_EXTRA_OPS ); opsp = &ops; -#ifdef CLASS_SIMPLE_EXTRA_CLASS_OPS - EFL_OPS_DEFINE(cops, CLASS_SIMPLE_EXTRA_CLASS_OPS); - copsp = &cops; -#endif + static const Efl_Object_Property_Reflection refl_table[] = { + {"a", __eolian_class_simple_a_set_reflect, __eolian_class_simple_a_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; - return efl_class_functions_set(klass, opsp, copsp); + return efl_class_functions_set(klass, opsp, ropsp); } static const Efl_Class_Description _class_simple_class_desc = { @@ -64,15 +83,3 @@ static const Efl_Class_Description _class_simple_class_desc = { }; EFL_DEFINE_CLASS(class_simple_class_get, &_class_simple_class_desc, NULL, NULL); - -EAPI void -evas_object_simple_b_set(Class_Simple *obj) -{ - efl_canvas_object_simple_b_set(obj); -} - -EAPI int * -evas_object_simple_bar(Class_Simple *obj, int x) -{ - return efl_canvas_object_simple_bar(obj, x); -} diff --git a/src/tests/eolian/data/class_simple_ref_eo.h b/src/tests/eolian/data/class_simple_ref_eo.h index 16a690decc..60e6fe27e2 100644 --- a/src/tests/eolian/data/class_simple_ref_eo.h +++ b/src/tests/eolian/data/class_simple_ref_eo.h @@ -41,7 +41,7 @@ EWAPI extern long BAZ; EWAPI const Efl_Class *class_simple_class_get(void); -#ifdef CLASS_SIMPLE_BETA +#ifdef EFL_BETA_API_SUPPORT /** * @brief Common desc for a * @@ -55,9 +55,9 @@ EWAPI const Efl_Class *class_simple_class_get(void); * @ingroup Class_Simple */ EOAPI Eina_Bool efl_canvas_object_simple_a_set(Eo *obj, int value); -#endif +#endif /* EFL_BETA_API_SUPPORT */ -#ifdef CLASS_SIMPLE_BETA +#ifdef EFL_BETA_API_SUPPORT /** * @brief Common desc for a * @@ -68,11 +68,9 @@ EOAPI Eina_Bool efl_canvas_object_simple_a_set(Eo *obj, int value); * @ingroup Class_Simple */ EOAPI int efl_canvas_object_simple_a_get(const Eo *obj); -#endif +#endif /* EFL_BETA_API_SUPPORT */ -EOAPI void efl_canvas_object_simple_b_set(Eo *obj); - -#ifdef CLASS_SIMPLE_BETA +#ifdef EFL_BETA_API_SUPPORT /** * @brief comment foo * @@ -87,8 +85,6 @@ EOAPI void efl_canvas_object_simple_b_set(Eo *obj); * @ingroup Class_Simple */ EOAPI char *efl_canvas_object_simple_foo(Eo *obj, int a, char *b, double *c, int *d); -#endif - -EOAPI int *efl_canvas_object_simple_bar(Eo *obj, int x); +#endif /* EFL_BETA_API_SUPPORT */ #endif diff --git a/src/tests/eolian/data/class_simple_ref_legacy.h b/src/tests/eolian/data/class_simple_ref_legacy.h deleted file mode 100644 index 39320a4ddb..0000000000 --- a/src/tests/eolian/data/class_simple_ref_legacy.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _EOLIAN_CLASS_SIMPLE_EO_LEGACY_H_ -#define _EOLIAN_CLASS_SIMPLE_EO_LEGACY_H_ - -#ifndef _CLASS_SIMPLE_EO_CLASS_TYPE -#define _CLASS_SIMPLE_EO_CLASS_TYPE - -typedef Eo Class_Simple; - -#endif - -#ifndef _CLASS_SIMPLE_EO_TYPES -#define _CLASS_SIMPLE_EO_TYPES - -#ifndef FOO -/** doc for constant - * - * @ingroup Foo - */ -#define FOO 5 -#endif - -/** doc for global - * - * @ingroup Bar - */ -EWAPI extern float BAR; - -/** in header but not in source - * - * @ingroup Baz - */ -EWAPI extern long BAZ; - - -#endif - -EAPI void evas_object_simple_b_set(Class_Simple *obj); - -EAPI int *evas_object_simple_bar(Class_Simple *obj, int x); - -#endif diff --git a/src/tests/eolian/data/complex_type.eo b/src/tests/eolian/data/complex_type.eo index e8fe1a785e..f2c03676e0 100644 --- a/src/tests/eolian/data/complex_type.eo +++ b/src/tests/eolian/data/complex_type.eo @@ -1,4 +1,4 @@ -struct @extern Eo; +struct @free(efl_del) @extern Eo; class Complex_Type { methods { @@ -15,6 +15,7 @@ class Complex_Type { foo { params { buf: mstring @owned; + sl: slice; } return: list @owned; [[comment for method return]] } diff --git a/src/tests/eolian/data/docs.eo b/src/tests/eolian/data/docs.eo index f6bea43744..c81c6e2851 100644 --- a/src/tests/eolian/data/docs.eo +++ b/src/tests/eolian/data/docs.eo @@ -53,7 +53,6 @@ class Docs { @since 1.18 ]] - legacy_prefix: docs; methods { meth { [[Method documentation.]] diff --git a/src/tests/eolian/data/docs_ref_legacy.h b/src/tests/eolian/data/docs_ref_legacy.h deleted file mode 100644 index 8057c7aa7c..0000000000 --- a/src/tests/eolian/data/docs_ref_legacy.h +++ /dev/null @@ -1,119 +0,0 @@ -#ifndef _EOLIAN_DOCS_EO_LEGACY_H_ -#define _EOLIAN_DOCS_EO_LEGACY_H_ - -#ifndef _DOCS_EO_CLASS_TYPE -#define _DOCS_EO_CLASS_TYPE - -typedef Eo Docs; - -#endif - -#ifndef _DOCS_EO_TYPES -#define _DOCS_EO_TYPES - -/** - * @brief This is struct Foo. It does stuff. - * - * @note This is a note. - * - * This is a longer description for struct Foo. - * - * @warning This is a warning. You can only use Warning: and Note: at the - * beginning of a paragraph. - * - * This is another paragraph. - * - * @since 1.66 - * - * @ingroup Foo - */ -typedef struct _Foo -{ - int field1; /**< Field documentation. */ - float field2; - short field3; /**< Another field documentation. */ -} Foo; - -/** Docs for enum Bar. - * - * @ingroup Bar - */ -typedef enum -{ - BAR_BLAH = 0, - BAR_FOO = 1, /**< Docs for foo. */ - BAR_BAR = 2 /**< Docs for bar. */ -} Bar; - -/** - * @brief Docs for typedef. - * - * More docs for typedef. See @ref Bar. - * - * @since 2.0 - * - * @ingroup Alias - */ -typedef Bar Alias; - -/** Docs for var. - * - * @ingroup pants - */ -EWAPI extern int PANTS; - -/** Opaque struct docs. See @ref Foo for another struct. - * - * @ingroup Opaque - */ -typedef struct _Opaque Opaque; - - -#endif - -/** - * @brief Method documentation. - * - * @param[in] obj The object. - * @param[in] a Param documentation. - * @param[out] b - * @param[out] c Another param documentation. - * - * @return Return documentation. - * - * @since 1.18 - * - * @ingroup Docs_Group - */ -EAPI int docs_meth(Docs *obj, int a, float *b, long *c); - -/** - * @brief Property common documentation. - * - * Set documentation. - * - * @param[in] obj The object. - * @param[in] val Value documentation. - * - * @since 1.18 - * - * @ingroup Docs_Group - */ -EAPI void docs_prop_set(Docs *obj, int val); - -/** - * @brief Property common documentation. - * - * Get documentation. - * - * @param[in] obj The object. - * - * @return Value documentation. - * - * @since 1.18 - * - * @ingroup Docs_Group - */ -EAPI int docs_prop_get(const Docs *obj); - -#endif diff --git a/src/tests/eolian/data/free_func.eo b/src/tests/eolian/data/free_func.eo index 6a3228ba81..55cc05e2b6 100644 --- a/src/tests/eolian/data/free_func.eo +++ b/src/tests/eolian/data/free_func.eo @@ -6,18 +6,10 @@ struct @free(test_free) Named2 { field: int; } -/* typedef */ -type Typedef1: int; -type @free(def_free) Typedef2: int; - /* opaque */ struct Opaque1; struct @free(opaque_free) Opaque2; -/* pointers */ -type Pointer1: ptr(char); -type Pointer2: free(ptr(char), ptr_free); - class Free_Func { methods { foo { diff --git a/src/tests/eolian/data/function_as_argument_ref.c b/src/tests/eolian/data/function_as_argument_ref.c index f73c426c97..0c00260e09 100644 --- a/src/tests/eolian/data/function_as_argument_ref.c +++ b/src/tests/eolian/data/function_as_argument_ref.c @@ -14,7 +14,9 @@ EOAPI EFL_FUNC_BODYV(function_as_argument_call_cb, char *, NULL, EFL_FUNC_CALL(a static Eina_Bool _function_as_argument_class_initializer(Efl_Class *klass) { - const Efl_Object_Ops *opsp = NULL, *copsp = NULL; + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; #ifndef FUNCTION_AS_ARGUMENT_EXTRA_OPS #define FUNCTION_AS_ARGUMENT_EXTRA_OPS @@ -28,12 +30,7 @@ _function_as_argument_class_initializer(Efl_Class *klass) ); opsp = &ops; -#ifdef FUNCTION_AS_ARGUMENT_EXTRA_CLASS_OPS - EFL_OPS_DEFINE(cops, FUNCTION_AS_ARGUMENT_EXTRA_CLASS_OPS); - copsp = &cops; -#endif - - return efl_class_functions_set(klass, opsp, copsp); + return efl_class_functions_set(klass, opsp, ropsp); } static const Efl_Class_Description _function_as_argument_class_desc = { diff --git a/src/tests/eolian/data/iface.eo b/src/tests/eolian/data/iface.eo new file mode 100644 index 0000000000..153bc0f914 --- /dev/null +++ b/src/tests/eolian/data/iface.eo @@ -0,0 +1,6 @@ +interface Iface { + methods { + foo {} + bar {} + } +} diff --git a/src/tests/eolian/data/override_ref.c b/src/tests/eolian/data/override_ref.c index c177272ee3..dbbbbae263 100644 --- a/src/tests/eolian/data/override_ref.c +++ b/src/tests/eolian/data/override_ref.c @@ -59,7 +59,9 @@ static void __eolian_override_base_z_get(const Eo *obj EINA_UNUSED, Override_Dat static Eina_Bool _override_class_initializer(Efl_Class *klass) { - const Efl_Object_Ops *opsp = NULL, *copsp = NULL; + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; #ifndef OVERRIDE_EXTRA_OPS #define OVERRIDE_EXTRA_OPS @@ -81,12 +83,7 @@ _override_class_initializer(Efl_Class *klass) ); opsp = &ops; -#ifdef OVERRIDE_EXTRA_CLASS_OPS - EFL_OPS_DEFINE(cops, OVERRIDE_EXTRA_CLASS_OPS); - copsp = &cops; -#endif - - return efl_class_functions_set(klass, opsp, copsp); + return efl_class_functions_set(klass, opsp, ropsp); } static const Efl_Class_Description _override_class_desc = { diff --git a/src/tests/eolian/data/owning.eo.c b/src/tests/eolian/data/owning.eo.c index 0c0d03a9ef..3df14c9098 100644 --- a/src/tests/eolian/data/owning.eo.c +++ b/src/tests/eolian/data/owning.eo.c @@ -43,7 +43,9 @@ EOAPI EFL_VOID_FUNC_BODYV_FALLBACK(owning_test2, _owning_test2_ownership_fallbac static Eina_Bool _owning_class_initializer(Efl_Class *klass) { - const Efl_Object_Ops *opsp = NULL, *copsp = NULL; + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; #ifndef OWNING_EXTRA_OPS #define OWNING_EXTRA_OPS @@ -56,12 +58,7 @@ _owning_class_initializer(Efl_Class *klass) ); opsp = &ops; -#ifdef OWNING_EXTRA_CLASS_OPS - EFL_OPS_DEFINE(cops, OWNING_EXTRA_CLASS_OPS); - copsp = &cops; -#endif - - return efl_class_functions_set(klass, opsp, copsp); + return efl_class_functions_set(klass, opsp, ropsp); } static const Efl_Class_Description _owning_class_desc = { diff --git a/src/tests/eolian/data/unimpl.eo b/src/tests/eolian/data/unimpl.eo new file mode 100644 index 0000000000..a1420e07c6 --- /dev/null +++ b/src/tests/eolian/data/unimpl.eo @@ -0,0 +1,8 @@ +class Unimpl implements Iface { + composite { + Iface; + } + implements { + Iface.foo; + } +} diff --git a/src/tests/eolian/eolian_generation.c b/src/tests/eolian/eolian_generation.c index 5167c01d7e..2fe0be6267 100644 --- a/src/tests/eolian/eolian_generation.c +++ b/src/tests/eolian/eolian_generation.c @@ -163,9 +163,7 @@ EFL_START_TEST(eolian_functions_descriptions) _remove_ref(output_filepath, "eo.h"); fail_if(0 != _eolian_gen_execute(TESTS_SRC_DIR"/data/class_simple.eo", "-gh", output_filepath)); fail_if(!_files_compare(TESTS_SRC_DIR"/data/class_simple_ref_eo.h", output_filepath, "eo.h")); - _remove_ref(output_filepath, "eo.legacy.h"); 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")); } EFL_END_TEST @@ -188,9 +186,7 @@ EFL_START_TEST(eolian_docs) _remove_ref(output_filepath, "eo.h"); fail_if(0 != _eolian_gen_execute(TESTS_SRC_DIR"/data/docs.eo", "-gh", output_filepath)); fail_if(!_files_compare(TESTS_SRC_DIR"/data/docs_ref.h", output_filepath, "eo.h")); - _remove_ref(output_filepath, "eo.legacy.h"); 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")); } EFL_END_TEST diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c index ce2ea68e2f..de1a740aa5 100644 --- a/src/tests/eolian/eolian_parsing.c +++ b/src/tests/eolian/eolian_parsing.c @@ -476,11 +476,10 @@ EFL_START_TEST(eolian_complex_type) fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_STRINGSHARE); fail_if(strcmp(type_name, "Eina_Stringshare *")); eina_stringshare_del(type_name); - /* Methods parameter type */ + /* Methods parameter types */ fail_if(!(iter = eolian_function_parameters_get(fid))); + fail_if(!(eina_iterator_next(iter, (void**)¶m))); - fail_if(eina_iterator_next(iter, &dummy)); - 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(type, EOLIAN_C_TYPE_PARAM))); @@ -489,6 +488,18 @@ EFL_START_TEST(eolian_complex_type) fail_if(strcmp(type_name, "char *")); eina_stringshare_del(type_name); + fail_if(!(eina_iterator_next(iter, (void**)¶m))); + fail_if(strcmp(eolian_parameter_name_get(param), "sl")); + fail_if(!(type = eolian_parameter_type_get(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_SLICE); + fail_if(strcmp(type_name, "Eina_Slice")); + eina_stringshare_del(type_name); + + fail_if(eina_iterator_next(iter, &dummy)); + eina_iterator_free(iter); + eolian_state_free(eos); } EFL_END_TEST @@ -552,7 +563,6 @@ EFL_START_TEST(eolian_simple_parsing) fail_if(eolian_class_type_get(class) != EOLIAN_CLASS_REGULAR); fail_if(eolian_class_parent_get(class) != NULL); fail_if(eolian_class_extensions_get(class) != NULL); - fail_if(strcmp(eolian_class_legacy_prefix_get(class), "evas_object_simple")); fail_if(strcmp(eolian_class_eo_prefix_get(class), "efl_canvas_object_simple")); fail_if(strcmp(eolian_class_data_type_get(class), "Evas_Simple_Data")); Eina_Stringshare *dt = eolian_class_c_data_type_get(class); @@ -602,13 +612,6 @@ EFL_START_TEST(eolian_simple_parsing) fail_if(v.type != EOLIAN_EXPR_INT); fail_if(v.value.i != 100); - /* legacy only + c only */ - 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_by_name_get(class, "foo", EOLIAN_METHOD))); fail_if(!eolian_function_is_beta(fid)); @@ -624,7 +627,6 @@ EFL_START_TEST(eolian_simple_parsing) fail_if(!expr); 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)); /* Function parameters */ fail_if(!(iter = eolian_function_parameters_get(fid))); @@ -655,12 +657,6 @@ EFL_START_TEST(eolian_simple_parsing) fail_if(eina_iterator_next(iter, &dummy)); eina_iterator_free(iter); - /* legacy only + c only */ - 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_state_free(eos); } EFL_END_TEST @@ -675,6 +671,7 @@ EFL_START_TEST(eolian_struct) const Eolian_Unit *unit; const char *type_name; const char *file; + Eina_Iterator *structs; Eolian_State *eos = eolian_state_new(); @@ -686,6 +683,9 @@ EFL_START_TEST(eolian_struct) fail_if(!(class = eolian_unit_class_by_name_get(unit, "Struct"))); fail_if(!eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD)); + fail_if(!(structs = eolian_state_structs_by_file_get(eos, "struct.eo"))); + eina_iterator_free(structs); + /* named struct */ fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Named"))); fail_if(!(type_name = eolian_typedecl_short_name_get(tdl))); @@ -981,7 +981,6 @@ EFL_START_TEST(eolian_free_func) { const Eolian_Class *class; const Eolian_Typedecl *tdl; - const Eolian_Type *type; const Eolian_Unit *unit; Eolian_State *eos = eolian_state_new(); @@ -1000,26 +999,12 @@ EFL_START_TEST(eolian_free_func) 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_unit_alias_by_name_get(unit, "Typedef1"))); - fail_if(eolian_typedecl_free_func_get(tdl)); - 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_unit_struct_by_name_get(unit, "Opaque1"))); fail_if(eolian_typedecl_free_func_get(tdl)); 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_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_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_state_free(eos); } EFL_END_TEST @@ -1633,6 +1618,21 @@ EFL_START_TEST(eolian_class_requires_classes) } EFL_END_TEST +EFL_START_TEST(eolian_class_unimpl) +{ + Eolian_State *eos = eolian_state_new(); + + fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data")); + + setenv("EOLIAN_CLASS_UNIMPLEMENTED_WARN", "1", 1); + const Eolian_Unit *unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/unimpl.eo"); + unsetenv("EOLIAN_CLASS_UNIMPLEMENTED_WARN"); + fail_if(!unit); + + eolian_state_free(eos); +} +EFL_END_TEST + void eolian_parsing_test(TCase *tc) { tcase_add_test(tc, eolian_simple_parsing); @@ -1658,4 +1658,5 @@ void eolian_parsing_test(TCase *tc) tcase_add_test(tc, eolian_parts); tcase_add_test(tc, eolian_mixins_require); tcase_add_test(tc, eolian_class_requires_classes); + tcase_add_test(tc, eolian_class_unimpl); } diff --git a/src/tests/eolian_cxx/beta_class.eo b/src/tests/eolian_cxx/beta_class.eo new file mode 100644 index 0000000000..ba91bf7660 --- /dev/null +++ b/src/tests/eolian_cxx/beta_class.eo @@ -0,0 +1,3 @@ +class @beta Beta_Class extends Efl.Object +{ +} diff --git a/src/tests/eolian_cxx/callback.eo b/src/tests/eolian_cxx/callback.eo index 3f4cd9effe..a62ec0031b 100644 --- a/src/tests/eolian_cxx/callback.eo +++ b/src/tests/eolian_cxx/callback.eo @@ -11,7 +11,7 @@ class Callback extends Efl.Object prefix,event1: void; prefix,event2: Callback; prefix,event3: int; - prefix,event4: list; + prefix,event4: const(array); prefix,event5: Callback_Event; } } diff --git a/src/tests/eolian_cxx/docs.eo b/src/tests/eolian_cxx/docs.eo index 5ca93f02f2..5249b7196e 100644 --- a/src/tests/eolian_cxx/docs.eo +++ b/src/tests/eolian_cxx/docs.eo @@ -53,7 +53,6 @@ class Docs { @since 1.17 ]] - legacy_prefix: docs; methods { meth { [[Method documentation.]] diff --git a/src/tests/eolian_cxx/eolian_cxx_test_binding.cc b/src/tests/eolian_cxx/eolian_cxx_test_binding.cc index 2215312f18..069e876ba5 100644 --- a/src/tests/eolian_cxx/eolian_cxx_test_binding.cc +++ b/src/tests/eolian_cxx/eolian_cxx_test_binding.cc @@ -203,7 +203,7 @@ EFL_START_TEST(eolian_cxx_test_type_callback) event3 = true; ck_assert(v == 42); }); - efl::eolian::event_add(g.prefix_event4_event, g, [&] (nonamespace::Generic, efl::eina::range_list e) + efl::eolian::event_add(g.prefix_event4_event, g, [&] (nonamespace::Generic, efl::eina::range_array e) { event4 = true; ck_assert(e.size() == 1); @@ -258,7 +258,6 @@ EFL_START_TEST(eolian_cxx_test_properties) klass_def cls = init_test_data("property_holder.eo", "Property_Holder", eolian_state); - // FIXME Currently parsing only properties with both get/set values. auto props = cls.properties; ck_assert_int_eq(4, cls.properties.size()); @@ -322,6 +321,48 @@ EFL_START_TEST(eolian_cxx_test_cls_get) } EFL_END_TEST +EFL_START_TEST(eolian_cxx_test_constructors) +{ + efl::eolian::eolian_init eolian_init; + efl::eolian::eolian_state eolian_state; + + klass_def cls = init_test_data("generic.eo", "Generic", eolian_state); + + auto constructors = cls.constructors; + + ck_assert_int_eq(constructors.size(), 4); + + auto ctor = constructors[0]; + ck_assert_str_eq("Generic.required_ctor_a", ctor.name.c_str()); + ck_assert(!ctor.is_optional); + ck_assert(!ctor.is_ctor_param); + + auto function = ctor.function; + ck_assert_str_eq("required_ctor_a", function.name.c_str()); + + ctor = constructors[2]; + ck_assert_str_eq("Generic.optional_ctor_a", ctor.name.c_str()); + ck_assert(ctor.is_optional); + ck_assert(!ctor.is_ctor_param); + + function = ctor.function; + ck_assert_str_eq("optional_ctor_a", function.name.c_str()); +} +EFL_END_TEST + +EFL_START_TEST(eolian_cxx_test_beta) +{ + efl::eolian::eolian_init eolian_init; + efl::eolian::eolian_state eolian_state; + + klass_def cls = init_test_data("generic.eo", "Generic", eolian_state); + klass_def beta_cls = init_test_data("beta_class.eo", "Beta_Class", eolian_state); + + ck_assert(!cls.is_beta); + ck_assert(beta_cls.is_beta); +} +EFL_END_TEST + void eolian_cxx_test_binding(TCase* tc) { @@ -335,4 +376,6 @@ eolian_cxx_test_binding(TCase* tc) tcase_add_test(tc, eolian_cxx_test_properties); tcase_add_test(tc, eolian_cxx_test_parent_extensions); tcase_add_test(tc, eolian_cxx_test_cls_get); + tcase_add_test(tc, eolian_cxx_test_constructors); + tcase_add_test(tc, eolian_cxx_test_beta); } diff --git a/src/tests/eolian_cxx/generic.c b/src/tests/eolian_cxx/generic.c index ee3a0c3e87..65f8025b57 100644 --- a/src/tests/eolian_cxx/generic.c +++ b/src/tests/eolian_cxx/generic.c @@ -115,10 +115,10 @@ static void _generic_call_event3(Eo *obj, Generic_Data* pd EINA_UNUSED) static void _generic_call_event4(Eo *obj, Generic_Data* pd EINA_UNUSED) { int i = 42; - Eina_List* p = eina_list_append(NULL, &i); - ck_assert(p != NULL); + Eina_Array* p = eina_array_new(1); + ck_assert(eina_array_push(p, &i)); efl_event_callback_call(obj, GENERIC_EVENT_PREFIX_EVENT4, p); - eina_list_free(p); + eina_array_free(p); } static void _generic_call_event5(Eo *obj, Generic_Data* pd EINA_UNUSED) { diff --git a/src/tests/eolian_cxx/generic.eo b/src/tests/eolian_cxx/generic.eo index 7f367a975b..192765d7df 100644 --- a/src/tests/eolian_cxx/generic.eo +++ b/src/tests/eolian_cxx/generic.eo @@ -108,7 +108,7 @@ class Generic extends Efl.Object implements Generic_Interface prefix,event1: void; prefix,event2: Generic; prefix,event3: int; - prefix,event4: list; + prefix,event4: const(array); prefix,event5: Generic.Event; protected,event1 @protected: void; beta,event1 @beta: void; diff --git a/src/tests/eolian_cxx/name1_name2_type_generation.eo b/src/tests/eolian_cxx/name1_name2_type_generation.eo index 683cf9f031..920c75df58 100644 --- a/src/tests/eolian_cxx/name1_name2_type_generation.eo +++ b/src/tests/eolian_cxx/name1_name2_type_generation.eo @@ -10,7 +10,7 @@ class Name1.Name2.Type_Generation extends Efl.Object } inrefintown { params { - @in v: ptr(int) @owned; + @in v: free(ptr(int),free) @owned; } } inrefintownfree { @@ -36,7 +36,7 @@ class Name1.Name2.Type_Generation extends Efl.Object } inintptrown { params { - @in v: ptr(int) @owned; + @in v: free(ptr(int),free) @owned; } } inintptrownfree { @@ -78,7 +78,7 @@ class Name1.Name2.Type_Generation extends Efl.Object return: ptr(int); } returnintptrown { - return: ptr(int) @owned; + return: free(ptr(int),free) @owned; } returnintptrownfree { params { @@ -115,7 +115,7 @@ class Name1.Name2.Type_Generation extends Efl.Object } outintptrown { params { - @out v: ptr(int) @owned; + @out v: free(ptr(int),free) @owned; } } outintptrownfree { @@ -166,7 +166,7 @@ class Name1.Name2.Type_Generation extends Efl.Object } optionalinintptrown { params { - @in v: ptr(int) @owned @optional; + @in v: free(ptr(int),free) @owned @optional; } } optionalinintptrownfree { @@ -191,7 +191,7 @@ class Name1.Name2.Type_Generation extends Efl.Object } optionaloutintptrown { params { - @out v: ptr(int) @owned @optional; + @out v: free(ptr(int),free) @owned @optional; } } optionaloutintptrownfree { diff --git a/src/tests/evas/evas_test_image.c b/src/tests/evas/evas_test_image.c index 9e7da26b16..da6ad42365 100644 --- a/src/tests/evas/evas_test_image.c +++ b/src/tests/evas/evas_test_image.c @@ -773,7 +773,7 @@ EFL_START_TEST(evas_object_image_map_unmap) const char *imgpath = TESTS_IMG_DIR "/Pic4.png"; o = efl_add(EFL_CANVAS_IMAGE_CLASS, e); - efl_file_set(o, imgpath, NULL); + efl_file_simple_load(o, imgpath, NULL); sz = efl_gfx_view_size_get(o); cs = efl_gfx_buffer_colorspace_get(o); @@ -852,7 +852,7 @@ EFL_START_TEST(evas_object_image_map_unmap) uint32_t *dest, *orig; o2 = efl_add(EFL_CANVAS_IMAGE_CLASS, e); - efl_file_set(o2, tmp, NULL); + efl_file_simple_load(o2, tmp, NULL); sz = efl_gfx_view_size_get(o); w2 = sz.w; h2 = sz.h; diff --git a/src/tests/evas/evas_test_mask.c b/src/tests/evas/evas_test_mask.c index bdb3b627dd..917c4c3496 100644 --- a/src/tests/evas/evas_test_mask.c +++ b/src/tests/evas/evas_test_mask.c @@ -80,7 +80,7 @@ EFL_START_TEST(evas_mask_test_setget) } fail_if(i != 1); - it = efl_canvas_object_clipees_get(mask); + it = efl_canvas_object_clipped_objects_get(mask); i = 0; EINA_ITERATOR_FOREACH(it, o) { diff --git a/src/tests/evas/evas_test_mesh.c b/src/tests/evas/evas_test_mesh.c index 6ac928daab..aba03730b5 100644 --- a/src/tests/evas/evas_test_mesh.c +++ b/src/tests/evas/evas_test_mesh.c @@ -44,29 +44,38 @@ { \ int set_ok, save_ok; \ Eina_File *f; \ + const Eina_File *f_get = NULL; \ + const char *filename = NULL; \ + const char *key = NULL; \ mesh = efl_add(EVAS_CANVAS3D_MESH_CLASS, e); \ mesh2 = efl_add(EVAS_CANVAS3D_MESH_CLASS, e); \ fail_if(mesh == NULL); \ fail_if(mesh2 == NULL); \ snprintf(buffer, PATH_MAX, "%s%s", tmp, ext); \ - set_ok = efl_file_set(mesh, file->path, NULL); \ + set_ok = efl_file_simple_load(mesh, file->path, NULL); \ save_ok = efl_file_save(mesh, buffer, NULL, NULL); \ fail_if(!set_ok); \ fail_if(!save_ok); \ - set_ok = efl_file_set(mesh2, buffer, NULL); \ + set_ok = efl_file_simple_load(mesh2, buffer, NULL); \ fail_if(!set_ok); \ + efl_file_simple_get(mesh2, &filename, &key); \ + fail_if(!filename); \ + fail_if(!!key); \ res = _compare_meshes(mesh, mesh2); \ fail_if(res == 1); \ f = eina_file_open(file->path, 0); \ fail_if(!f); \ - set_ok = efl_file_mmap_set(mesh, f, NULL); \ + set_ok = efl_file_simple_mmap_load(mesh, f, NULL); \ + efl_file_simple_mmap_get(mesh, &f_get, &key); \ + fail_if(!f_get); \ + fail_if(!!key); \ eina_file_close(f); \ save_ok = efl_file_save(mesh, buffer, NULL, NULL); \ fail_if(!set_ok); \ fail_if(!save_ok); \ f = eina_file_open(buffer, 0); \ fail_if(!f); \ - set_ok = efl_file_mmap_set(mesh2, f, NULL); \ + set_ok = efl_file_simple_mmap_load(mesh2, f, NULL); \ eina_file_close(f); \ fail_if(!set_ok); \ res = _compare_meshes(mesh, mesh2); \ diff --git a/src/tests/evas/evas_test_object.c b/src/tests/evas/evas_test_object.c index ac4424e327..d2de52a58a 100644 --- a/src/tests/evas/evas_test_object.c +++ b/src/tests/evas/evas_test_object.c @@ -30,7 +30,29 @@ EFL_START_TEST(evas_object_various) } EFL_END_TEST +EFL_START_TEST(evas_object_freeze_events) +{ + Evas *evas = EVAS_TEST_INIT_EVAS(); + Evas_Object *obj = evas_object_rectangle_add(evas); + + evas_object_freeze_events_set(obj, EINA_TRUE); + ck_assert_int_eq(evas_object_freeze_events_get(obj), EINA_TRUE); + evas_object_freeze_events_set(obj, EINA_FALSE); + ck_assert_int_eq(evas_object_freeze_events_get(obj), EINA_FALSE); + + evas_object_freeze_events_set(obj, EINA_TRUE); + evas_object_freeze_events_set(obj, EINA_TRUE); + ck_assert_int_eq(evas_object_freeze_events_get(obj), EINA_TRUE); + evas_object_freeze_events_set(obj, EINA_FALSE); + ck_assert_int_eq(evas_object_freeze_events_get(obj), EINA_FALSE); + evas_object_freeze_events_set(obj, EINA_FALSE); + evas_object_freeze_events_set(obj, EINA_TRUE); + ck_assert_int_eq(evas_object_freeze_events_get(obj), EINA_TRUE); +} +EFL_END_TEST + void evas_test_object(TCase *tc) { tcase_add_test(tc, evas_object_various); + tcase_add_test(tc, evas_object_freeze_events); } diff --git a/src/tests/evas/evas_test_object_smart.c b/src/tests/evas/evas_test_object_smart.c index dd72980cd0..188e9c244b 100644 --- a/src/tests/evas/evas_test_object_smart.c +++ b/src/tests/evas/evas_test_object_smart.c @@ -122,7 +122,7 @@ EFL_START_TEST(evas_object_smart_paragraph_direction) evas_textblock_cursor_geometry_get(cur, &x, &y, &w, &h, &dir, EVAS_TEXTBLOCK_CURSOR_UNDER); fail_if(dir == EVAS_BIDI_DIRECTION_RTL); - fail_if(evas_object_text_direction_get(to) == EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) == EVAS_BIDI_DIRECTION_RTL); /* Change paragraph direction of smart parent object */ evas_object_paragraph_direction_set(smart_obj, EVAS_BIDI_DIRECTION_RTL); @@ -131,7 +131,7 @@ EFL_START_TEST(evas_object_smart_paragraph_direction) EVAS_TEXTBLOCK_CURSOR_UNDER); fail_if(dir != EVAS_BIDI_DIRECTION_RTL); fail_if((x >= xx) || (y != yy) || (w != ww) || (h != hh)); - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); /* The paragraph direction of smart member object has to be reset if smart member object is removed from smart parent. */ @@ -142,7 +142,7 @@ EFL_START_TEST(evas_object_smart_paragraph_direction) EVAS_TEXTBLOCK_CURSOR_UNDER); fail_if(dir == EVAS_BIDI_DIRECTION_RTL); fail_if((x >= xx) || (y != yy) || (w != ww) || (h != hh)); - fail_if(evas_object_text_direction_get(to) == EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) == EVAS_BIDI_DIRECTION_RTL); /* The paragraph direction of smart member object has to be changed if smart member object is appended to smart parent. */ @@ -153,7 +153,7 @@ EFL_START_TEST(evas_object_smart_paragraph_direction) EVAS_TEXTBLOCK_CURSOR_UNDER); fail_if(dir != EVAS_BIDI_DIRECTION_RTL); fail_if((x >= xx) || (y != yy) || (w != ww) || (h != hh)); - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); /* Ignore smart parent's paragraph direction */ evas_object_paragraph_direction_set(tb, EVAS_BIDI_DIRECTION_NEUTRAL); @@ -163,7 +163,7 @@ EFL_START_TEST(evas_object_smart_paragraph_direction) EVAS_TEXTBLOCK_CURSOR_UNDER); fail_if(dir == EVAS_BIDI_DIRECTION_RTL); fail_if((x >= xx) || (y != yy) || (w != ww) || (h != hh)); - fail_if(evas_object_text_direction_get(to) == EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) == EVAS_BIDI_DIRECTION_RTL); evas_object_smart_member_del(tb); evas_object_smart_member_del(to); diff --git a/src/tests/evas/evas_test_render_engines.c b/src/tests/evas/evas_test_render_engines.c index 6e9aef730a..f336bf1928 100644 --- a/src/tests/evas/evas_test_render_engines.c +++ b/src/tests/evas/evas_test_render_engines.c @@ -5,8 +5,10 @@ #include #include +#include #include "evas_suite.h" +#include "evas_tests_helpers.h" static Eina_Bool _find_list(const Eina_List *lst, const char *item) @@ -75,8 +77,62 @@ EFL_START_TEST(evas_render_lookup) } EFL_END_TEST +static unsigned int counter; + +static void +render_post(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED) +{ + counter++; +} + +static void +render_flush_post(void *data EINA_UNUSED, Evas *e, void *event_info EINA_UNUSED) +{ + counter++; + evas_event_callback_add(e, EVAS_CALLBACK_RENDER_POST, render_post, NULL); +} + +static void +render_flush_pre(void *data EINA_UNUSED, Evas *e, void *event_info EINA_UNUSED) +{ + counter++; + evas_event_callback_add(e, EVAS_CALLBACK_RENDER_FLUSH_POST, render_flush_post, NULL); +} + +static void +render_pre(void *data EINA_UNUSED, Evas *e, void *event_info EINA_UNUSED) +{ + counter++; + evas_event_callback_add(e, EVAS_CALLBACK_RENDER_FLUSH_PRE, render_flush_pre, NULL); +} + +EFL_START_TEST(evas_render_callbacks) +{ + Evas_Object *rect; + Evas *evas = EVAS_TEST_INIT_EVAS(); + Evas_Engine_Info_Buffer *einfo; + + einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(evas); + /* 500 x 500 */ + einfo->info.dest_buffer_row_bytes = 500 * sizeof(int); + einfo->info.dest_buffer = malloc(einfo->info.dest_buffer_row_bytes * 500); + ck_assert(evas_engine_info_set(evas, (Evas_Engine_Info *)einfo)); + + rect = evas_object_rectangle_add(evas); + evas_object_color_set(rect, 255, 0, 0, 255); + evas_object_resize(rect, 500, 500); + evas_object_show(rect); + + evas_event_callback_add(evas, EVAS_CALLBACK_RENDER_PRE, render_pre, NULL); + evas_render(evas); + ck_assert_int_eq(counter, 4); + evas_free(evas); +} +EFL_END_TEST + void evas_test_render_engines(TCase *tc) { tcase_add_test(tc, evas_render_engines); tcase_add_test(tc, evas_render_lookup); + tcase_add_test(tc, evas_render_callbacks); } diff --git a/src/tests/evas/evas_test_text.c b/src/tests/evas/evas_test_text.c index 7c66fc96c0..929c88ddab 100644 --- a/src/tests/evas/evas_test_text.c +++ b/src/tests/evas/evas_test_text.c @@ -387,26 +387,26 @@ EFL_START_TEST(evas_text_set_get) /* Direction of an empty text should be NEUTRAL */ evas_object_text_text_set(to, ""); - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_NEUTRAL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_NEUTRAL); /* LTR paragraphs */ evas_object_text_text_set(to, "Test נסיון"); - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_LTR); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_LTR); /* RTL paragraphs */ evas_object_text_text_set(to, "נסיון test"); #ifdef HAVE_FRIBIDI - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); #else - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_LTR); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_LTR); #endif #ifdef HAVE_FRIBIDI /* Check direction with evas_object_paragraph_direction_set API */ evas_object_text_text_set(to, "12345"); - fail_if(evas_object_text_direction_get(to) == EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) == EVAS_BIDI_DIRECTION_RTL); evas_object_paragraph_direction_set(to, EVAS_BIDI_DIRECTION_RTL); - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); evas_object_paragraph_direction_set(to, EVAS_BIDI_DIRECTION_NEUTRAL); #endif @@ -478,9 +478,9 @@ EFL_START_TEST(evas_text_bidi) evas_object_text_font_set(to, font, size); evas_object_text_text_set(to, buf); - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_LTR); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_LTR); evas_object_text_text_set(to, "בדיקה"); - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); /* With RTL text coords should be monotontically decreasing. */ evas_object_text_text_set(to, "נסיון..."); diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index ad6d806331..b82e7e4aaa 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -109,7 +109,9 @@ EFL_START_TEST(evas_textblock_cursor) Evas_Coord x, y, w, h; size_t i, j, len; Evas_Coord nw, nh; +#ifdef HAVE_FRIBIDI Evas_BiDi_Direction dir; +#endif const char *buf = "This is a
test.Lets see if this works.עוד פסקה."; /* Walk the textblock using cursor_char_next */ @@ -4630,14 +4632,14 @@ EFL_START_TEST(efl_canvas_text_markup) efl_text_cursor_position_set(txt, start, 1); efl_text_cursor_position_set(txt, end, 2); - res = efl_text_markup_range_get(txt, start, end); + res = efl_text_markup_interactive_markup_range_get(txt, start, end); ck_assert_str_eq(res, "
"); free(res); efl_text_set(txt, "a\u2029bc\ndef\n\u2029"); efl_text_cursor_position_set(txt, start, 2); efl_text_cursor_position_set(txt, end, 5); - res = efl_text_markup_range_get(txt, start, end); + res = efl_text_markup_interactive_markup_range_get(txt, start, end); ck_assert_str_eq(res, "bc
"); free(res); diff --git a/src/tests/evas/meson.build b/src/tests/evas/meson.build index 62898cd241..5c06ff79ff 100644 --- a/src/tests/evas/meson.build +++ b/src/tests/evas/meson.build @@ -21,6 +21,7 @@ evas_suite_src = [ evas_suite = executable('evas_suite', evas_suite_src, dependencies: [evas_bin, evas, ecore_evas, dl, check], + include_directories: include_directories(join_paths('..', '..', 'modules', 'evas', 'engines', 'buffer')), c_args : [ '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"']