From 213301df35358d7baeb46daee0e59d4fa9a4fb12 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Mon, 15 Jul 2019 14:09:13 +0900 Subject: [PATCH 01/23] efl.h: avoid redefinition of typedef 'Efl_Gfx_Path_Command' Reviewers: zmike, bu5hm4n, cedric, raster Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9311 --- src/lib/efl/Efl.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index 5cbd1c2f96..d2746eeedc 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -227,8 +227,6 @@ EAPI Eina_Future *efl_ui_view_factory_create_with_event(Efl_Ui_Factory *factory, #include "interfaces/efl_text_types.eot.h" #endif -typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; - #endif /* work-around bug in gcc --as-needed link optimization */ From 480bb10243f45d5ed8c956336000c2443565c251 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Mon, 15 Jul 2019 10:15:58 +0100 Subject: [PATCH 02/23] add INSTALL file back as permanent instructions on meson building --- .gitignore | 1 - INSTALL | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 INSTALL diff --git a/.gitignore b/.gitignore index 325b2059cd..ead1bd993e 100644 --- a/.gitignore +++ b/.gitignore @@ -72,7 +72,6 @@ __pycache__ /compile /test-driver /missing -/INSTALL /ABOUT-NLS /config.rpath /coverage diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000000..2eac4a6af4 --- /dev/null +++ b/INSTALL @@ -0,0 +1,59 @@ +** COMPILING and INSTALLING ** +------------------------------ + +Meson is the build system used for this project. For more information please +see: + + http://mesonbuild.com + +---- + +Normal compilation in /usr/local: + + meson . build + ninja -C build + sudo ninja -C build install + +For meson build generic options: + + meson --help + +For a list of project specific options supported: + + cat meson_options.txt + +To set 1 or more project specific options: + + meson --prefix=/path/to -Doption=value [-Dother=value2] [...] . build + +To display current configuration: + + meson configure build + +The above will only work after at least the following is done: + + meson . build + +** QUICK AND DIRTY HELP ** +-------------------------- + +How clean out the build and config and start fresh: + + rm -rf build + +How to make a dist tarball and check its build: +(must do it from git tree clone and commit all changes to git first) + + ninja -C build dist + +How to change prefix: + + meson --prefix=/path/to/prefix . build + +How to install in a specific destination directory for packaging: + + DESTDIR=/path/to/destdir ninja -C build install + +How to build with verbose output (full commands run): + + ninja -C build -v From cf005ac54abdea843e5731765e41e5088275249f Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Mon, 15 Jul 2019 11:09:31 +0100 Subject: [PATCH 03/23] build - let's make xinput 2.2 default these days... about time since it's common enough by now. --- meson_options.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index 9dac48279d..4aa22fda0f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -158,13 +158,13 @@ option('xgesture', option('xinput2', type : 'boolean', value : true, - description : 'xi2 support' + description : 'xinpput 2.0+ support' ) option('xinput22', type : 'boolean', - value : false, - description : 'xi22 support' + value : true, + description : 'xiinput 2.2+ support' ) option('tslib', From 1ed15f5b42a05a59cab134fb48d7e676d3fd6aca Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Mon, 15 Jul 2019 11:15:33 +0100 Subject: [PATCH 04/23] config - make harfbuzz default on these days probably a good move given how common it is now. --- meson_options.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index 4aa22fda0f..ac78778bbf 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -228,14 +228,14 @@ option('emotion-generic-loaders-disabler', option('harfbuzz', type : 'boolean', - value : false, - description : 'harfbuzz support' + value : true, + description : 'harfbuzz (complex text layout library) support' ) option('fribidi', type : 'boolean', value : true, - description : 'fribidi support' + description : 'fribidi (right to left text layout library) support' ) option('fontconfig', From 01d6683e3293c945840644ff9d5ebd44f286044f Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Mon, 15 Jul 2019 11:46:26 +0100 Subject: [PATCH 05/23] build - update/improve meson option strings to be short and descriptive this should make it easier to know what an option does and not be redundant in the description. --- meson_options.txt | 121 +++++++++++++++++++++++----------------------- 1 file changed, 61 insertions(+), 60 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index ac78778bbf..c51e12bd18 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,227 +1,228 @@ option('audio', type : 'boolean', value : true, - description : 'Flag for handling audio support in efl' + description : 'Audio support in efl' ) option('avahi', type : 'boolean', value : true, - description : 'Flag for handling avahi support in efl' + description : 'Avahi (zeroconf) support in efl' ) option('x11', type : 'boolean', value : true, - description : 'Flag for handling x11 support in efl' + description : 'X11 support in efl' ) option('fb', type : 'boolean', value : false, - description : 'Flag for handling frame buffer support in efl' + description : 'Framebuffer (/dev/fb / fbocon) support in efl' ) option('sdl', type : 'boolean', value : false, - description : 'Flag for handling sdl support in efl' + description : 'SDL support in efl' ) option('wl', type : 'boolean', value : false, - description : 'Flag for handling wayland support in efl' + description : 'Wayland client support in efl' ) option('buffer', type : 'boolean', value : false, - description : 'Flag for handling buffer support in efl' + description : 'Generic graphics buffer API support in efl' ) option('drm', type : 'boolean', value : false, - description : 'Flag for handling drm support in efl' + description : 'DRM/KMS advanced framebuffer/console support in efl' ) option('cocoa', type : 'boolean', value : false, - description : 'Flag for handling apple cocoa support in efl' + description : 'Apple MacOS cocoa support in efl' ) option('physics', type : 'boolean', value : true, - description : 'Flag for handling the internal physics engine in efl' + description : 'Physics engine (bullet) in efl' ) option('eeze', type : 'boolean', value : true, - description : 'Flag for handling the device abstraction layer in efl' + description : 'Device abstraction (udev wrapper) in efl' ) option('opengl', type : 'combo', choices : ['full', 'es-egl', 'none'], value : 'full', - description : 'build efl with a special opengl support' + description : 'Type of OpenGL support in efl' ) option('build-id', type : 'string', value : 'none', - description : 'The build id to attach to the efl build') + description : 'The build id string for efl set as the EFL_BUILD_ID define') option('eina-magic-debug', type : 'boolean', value : true, - description : 'magic debug of eina structure' + description : 'Magic number checking of eina structures in efl' ) option('debug-threads', type : 'boolean', value : false, - description : 'thread debugging' + description : 'Thread debugging in efl' ) option('build-examples', type : 'boolean', value : true, - description : 'build examples' + description : 'Compile examples' ) option('build-tests', type : 'boolean', value : true, - description : 'build tests' + description : 'Compile tests' ) option('crypto', type : 'combo', choices : ['gnutls', 'openssl'], - value : 'openssl' + value : 'openssl', + description : 'Which SSL Crypto library used in efl' ) option('glib', type : 'boolean', value : true, - description : 'use glib or not' + description : 'Main loop integration for glib in efl' ) option('g-mainloop', type : 'boolean', value : false, - description : 'use glib mainloop or not' + description : 'Use glib to run the main loop in efl' ) option('gstreamer', type : 'boolean', value : true, - description : 'use gstreamer 1.0 support' + description : 'GStreamer 1.0+ support in efl' ) option('systemd', type : 'boolean', value : true, - description : 'use systemd support' + description : 'Systemd support in efl' ) option('pulseaudio', type : 'boolean', value : true, - description : 'pulseaudio support' + description : 'Pulseaudio support for audio API' ) option('network-backend', type : 'combo', choices : ['connman', 'none'], value : 'none', - description : 'connman support' + description : 'Connman support in efl' ) option('xpresent', type : 'boolean', value : false, - description : 'xpresent support' + description : 'X11 XPresent extension support in efl' ) option('xgesture', type : 'boolean', value : false, - description : 'xgesture support' + description : 'X11 XGesture support in efl' ) option('xinput2', type : 'boolean', value : true, - description : 'xinpput 2.0+ support' + description : 'X11 XInput 2.0+ support in efl' ) option('xinput22', type : 'boolean', value : true, - description : 'xiinput 2.2+ support' + description : 'X11 XInput 2.2+ support in efl' ) option('tslib', type : 'boolean', value : true, - description : 'tslib support' + description : 'Framebuffer (/dev/fb / fbcon) touchscreen tslib support in efl' ) option('eject-path', type : 'string', value : 'detect', - description : 'path to use as eject binary, if "detect" internal eeze bins are used' + description : 'Path to the eject binary, if "detect" internal eeze bins are used' ) option('mount-path', type : 'string', value : 'detect', - description : 'path to use as eject binary, if "detect" internal eeze bins are used' + description : 'Path to the mount binary, if "detect" internal eeze bins are used' ) option('unmount-path', type : 'string', value : 'detect', - description : 'path to use as eject binary, if "detect" internal eeze bins are used' + description : 'Path to the unmount binary, if "detect" internal eeze bins are used' ) option('evas-modules', type : 'combo', choices : ['shared', 'static'], value : 'shared', - description : 'how to build the evas modules' + description : 'Should modules be shared or statically inlined' ) option('evas-loaders-disabler', type : 'array', - description : 'add names here to disable the loaders', + description : 'List of modular image loaders to disable in efl', choices : ['gst', 'pdf', 'ps', 'raw', 'svg', 'xcf', 'bmp', 'dds', 'eet', 'generic', 'gif', 'ico', 'jp2k', 'jpeg', 'pmaps', 'png', 'psd', 'tga', 'tgv', 'tiff', 'wbmp', 'webp', 'xpm', 'json'], value : ['webp', 'json'] ) option('ecore-imf-loaders-disabler', type : 'array', - description : 'add names here to disable the loaders', + description : 'List of input methods to disable in efl', choices : ['xim', 'ibus', 'scim'], value : ['scim'] ) option('emotion-loaders-disabler', type : 'array', - description : 'add names here to disable the loaders', + description : 'List of video back-ends to disable in efl', choices : ['gstreamer', 'gstreamer1', 'libvlc', 'xine'], value : ['gstreamer', 'libvlc', 'xine'] ) option('emotion-generic-loaders-disabler', type : 'array', - description : 'add names here to disable the loaders', + description : 'List of out-of-process generic binary video loaders to disable in efl', choices : ['vlc'], value : ['vlc'] ) @@ -229,19 +230,19 @@ option('emotion-generic-loaders-disabler', option('harfbuzz', type : 'boolean', value : true, - description : 'harfbuzz (complex text layout library) support' + description : 'Harfbuzz (complex text layout library) support in efl' ) option('fribidi', type : 'boolean', value : true, - description : 'fribidi (right to left text layout library) support' + description : 'Fribidi (right to left text layout library) support in efl' ) option('fontconfig', type : 'boolean', value : true, - description : 'fontconfig support' + description : 'Fontconfig (system font database) support in efl' ) option('edje-sound-and-video', @@ -253,122 +254,122 @@ option('edje-sound-and-video', option('pixman', type : 'boolean', value : false, - description : 'Enable pixman support in evas' + description : 'Pixman software renderer support in efl' ) option('hyphen', type : 'boolean', value : false, - description : 'Enable hyphen support in evas' + description : 'Hyphen text layout support in efl' ) option('embedded-lz4', type : 'boolean', value : true, - description : 'do not use the system lz4, but rather the embedded r131 release' + description : 'Use the embedded in-tree zlib r131 release instead of system zlib' ) option('libmount', type : 'boolean', value : true, - description : 'use libmount support or not' + description : 'Libmount support for device mounting in efl' ) option('vnc-server', type : 'boolean', value : false, - description : 'enable building a vnc-server for multiseat testing' + description : 'VNS server support in efl for multiseat testing' ) option('v4l2', type : 'boolean', value : true, - description : 'add v4l2 support' + description : 'Video v4l2 support' ) option('elua', type : 'boolean', value : true, - description : 'Flag for handling elua support in efl' + description : 'Lua launcher binary support in efl' ) option('wl-deprecated', type : 'boolean', value : false, - description : 'Flag for handling deprecated wayland support in efl' + description : 'Deprecated wayland support in efl' ) option('drm-deprecated', type : 'boolean', value : false, - description : 'Flag for handling deprecated drm support in efl' + description : 'Deprecated DRM/KMS support in efl' ) option('nls', type: 'boolean', value: true, - description: 'enable localization: (default=true)' + description: 'Localization' ) option('bindings', type : 'array', choices : ['luajit', 'cxx', 'mono'], value : ['luajit', 'cxx'], - description : 'Add values here to enable the bindings', + description : 'Which auto-generated language bindings for efl to enable', ) option('mono-beta', type: 'boolean', value: false, - description: 'Flag for enabling @beta Eo methods in the api' + description: 'Mono/C# @beta Eo methods enabled in the efl' ) option('mono-examples-dir', type: 'string', value: '', - description: 'Directory where eolian_mono will search for examples to embed into the documentation' + description: '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' + description: 'Which Lua back-end library to use in efl' ) option('native-arch-optimization', type: 'boolean', value: true, - description: 'Flag for enabling architecture native optimizations' + description: 'Enable architecture native optimizations in efl' ) option('elogind', type : 'boolean', value : false, - description : 'use elogind support' + description : 'elogind support in efl (subset of systemd)' ) option('windows-version', type : 'combo', choices : ['vista', 'win7', 'win8', 'win81', 'win10'], value : 'win7', - description : 'When host_machine is windows, compile the efl with the specified version of Windows' + description : 'When on Windows, compile efl with the specified Windows version' ) option('dictionaries-hyphen-dir', type : 'string', value : '/usr/share/hyphen/', - description : 'Put the path to hyphen dictionaries directory' + description : 'The path to the hyphen dictionaries directory' ) option('elementary-base-dir', type : 'string', value : '.elementary', - description : 'Put the name of a base directory for elementary data' + description : 'The name of the directory for user supplied elementary data files like themes, config files' ) option('install-eo-files', type: 'boolean', value: false, - description : 'Set this to false to not install any eo file' + description : 'Install any eo file' ) From 84fcc5d073c7be9ff4152745fcbc63383cb95dc3 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Mon, 15 Jul 2019 21:22:03 +0900 Subject: [PATCH 06/23] evas_vg_load_svg: Prevent duplicate operations on radial gradient variables Summary: This solves the problem of radial gradient being displayed abnormally when the radial gradient variables are 0 to 1. Test Plan: Sample SVG Reviewers: Hermet, kimcinoo, smohanty Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9312 --- .../evas/vg_loaders/svg/evas_vg_load_svg.c | 56 ++++++++++++++++++- src/static_libs/vg_common/vg_common_svg.c | 16 ++++-- 2 files changed, 67 insertions(+), 5 deletions(-) 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 32bfb17d76..5bfdf41728 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 @@ -1758,15 +1758,63 @@ _handle_radial_r_attr(Evas_SVG_Loader *loader, Svg_Radial_Gradient* radial, cons radial->r = _gradient_to_double(loader->svg_parse, value, SVG_PARSER_LENGTH_OTHER); } +static void +_recalc_radial_cx_attr(Evas_SVG_Loader *loader, Svg_Radial_Gradient* radial, Eina_Bool user_space) +{ + if (!user_space) + { + radial->cx = radial->cx * loader->svg_parse->global.width; + } +} + +static void +_recalc_radial_cy_attr(Evas_SVG_Loader *loader, Svg_Radial_Gradient* radial, Eina_Bool user_space) +{ + if (!user_space) + { + radial->cy = radial->cy * loader->svg_parse->global.height; + } +} + +static void +_recalc_radial_fx_attr(Evas_SVG_Loader *loader, Svg_Radial_Gradient* radial, Eina_Bool user_space) +{ + if (!user_space) + { + radial->fx = radial->fx * loader->svg_parse->global.width; + } +} + +static void +_recalc_radial_fy_attr(Evas_SVG_Loader *loader, Svg_Radial_Gradient* radial, Eina_Bool user_space) +{ + if (!user_space) + { + radial->fy = radial->fy * loader->svg_parse->global.height; + } +} + +static void +_recalc_radial_r_attr(Evas_SVG_Loader *loader, Svg_Radial_Gradient* radial, Eina_Bool user_space) +{ + if (!user_space) + { + radial->r = radial->r * (sqrt(pow(loader->svg_parse->global.height, 2) + pow(loader->svg_parse->global.width, 2)) / sqrt(2.0)); + } +} + + typedef void (*Radial_Method)(Evas_SVG_Loader *loader, Svg_Radial_Gradient *radial, const char *value); +typedef void (*Radial_Method_Recalc)(Evas_SVG_Loader *loader, Svg_Radial_Gradient *radial, Eina_Bool user_space); #define RADIAL_DEF(Name) \ - { #Name, sizeof (#Name), _handle_radial_##Name##_attr} + { #Name, sizeof (#Name), _handle_radial_##Name##_attr, _recalc_radial_##Name##_attr} static const struct { const char *tag; int sz; Radial_Method tag_handler;; + Radial_Method_Recalc tag_recalc; } radial_tags[] = { RADIAL_DEF(cx), RADIAL_DEF(cy), @@ -1814,6 +1862,7 @@ _attr_parse_radial_gradient_node(void *data, const char *key, const char *value) static Svg_Style_Gradient * _create_radialGradient(Evas_SVG_Loader *loader, const char *buf, unsigned buflen) { + unsigned int i = 0; Svg_Style_Gradient *grad = calloc(1, sizeof(Svg_Style_Gradient)); loader->svg_parse->style_grad = grad; @@ -1834,6 +1883,11 @@ _create_radialGradient(Evas_SVG_Loader *loader, const char *buf, unsigned buflen eina_simple_xml_attributes_parse(buf, buflen, _attr_parse_radial_gradient_node, loader); + for (i = 0; i < sizeof (radial_tags) / sizeof(radial_tags[0]); i++) + radial_tags[i].tag_recalc(loader, grad->radial, grad->user_space); + + grad->use_percentage = EINA_TRUE; + return loader->svg_parse->style_grad; } diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index e753e229d0..20a167c806 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -618,10 +618,18 @@ _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); } + if (g->use_percentage) + { + g->radial->cx = g->radial->cx * r.w + r.x; + g->radial->cy = g->radial->cy * r.h + r.y; + g->radial->r = g->radial->r * radius; + g->radial->fx = g->radial->fx * r.w + r.x; + g->radial->fy = 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); + efl_gfx_gradient_radial_center_set(grad_obj, g->radial->cx, g->radial->cy); + efl_gfx_gradient_radial_radius_set(grad_obj, g->radial->r); + efl_gfx_gradient_radial_focal_set(grad_obj, g->radial->fx, g->radial->fy); /* in case of objectBoundingBox it need proper scaling */ if (!g->user_space) @@ -955,7 +963,6 @@ _create_gradient_node(Efl_VG *vg) 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); - grad->use_percentage = EINA_FALSE; } else { @@ -966,6 +973,7 @@ _create_gradient_node(Efl_VG *vg) efl_gfx_gradient_radial_focal_get(vg, &grad->radial->fx, &grad->radial->fy); grad->radial->r = efl_gfx_gradient_radial_radius_get(vg); } + grad->use_percentage = EINA_FALSE; return grad; From 2e4c928d81f85826a3ae608d4186dd35f4c282c8 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Mon, 15 Jul 2019 21:23:38 +0900 Subject: [PATCH 07/23] evas_vg_load_svg: Support multiple gradient without part Summary: Multiple gradients can be declared. There is a problem of keeping only one gradient information when it is declared outside defs or when defs is not declared. It supports the use of multiple gradients even if no defs are declared. Test Plan: (with D9312 patch) cd src/example/edje edje_cc -beta svg.edc && gcc -o svg-test svg-test.c `pkg-config --libs --cflags evas ecore ecore-evas edje` ./svg-test Reviewers: Hermet, kimcinoo, smohanty Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9315 --- src/examples/edje/gradients.svg | 62 +++++++++++++++++++ src/examples/edje/svg.edc | 5 +- .../evas/vg_loaders/svg/evas_vg_load_svg.c | 25 ++++++-- 3 files changed, 85 insertions(+), 7 deletions(-) create mode 100644 src/examples/edje/gradients.svg diff --git a/src/examples/edje/gradients.svg b/src/examples/edje/gradients.svg new file mode 100644 index 0000000000..c0f85c4941 --- /dev/null +++ b/src/examples/edje/gradients.svg @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/examples/edje/svg.edc b/src/examples/edje/svg.edc index 208d95bf0c..f702bcfae6 100644 --- a/src/examples/edje/svg.edc +++ b/src/examples/edje/svg.edc @@ -72,6 +72,7 @@ collections { vector: "favorite_off.svg"; vector: "batman1.svg"; vector: "batman2.svg"; + vector: "gradients.svg"; } group { name: "svg-test"; @@ -104,6 +105,7 @@ collections { SVG_PART("bg22", "vg22", 0.2, 0.8, .4, 1.0,"favorite_on.svg") SVG_PART("bg23", "vg23", 0.4, 0.8, .6, 1.0,"favorite_off.svg") SVG_PART_INTERPOLATE("bg24", "vg24", 0.6, 0.8, .8, 1.0,"batman1.svg", "batman2.svg") + SVG_PART("bg25", "vg25", 0.8, 0.8, 1.0, 1.0,"gradients.svg") } programs { SVG_PROGRAM("bg1", "vg1") @@ -130,6 +132,7 @@ collections { SVG_PROGRAM("bg22", "vg22") SVG_PROGRAM("bg23", "vg23") SVG_PROGRAM("bg24", "vg24") + SVG_PROGRAM("bg25", "vg25") } } -} \ No newline at end of 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 5bfdf41728..36edaabdba 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 @@ -35,7 +35,8 @@ struct _Evas_SVG_Loader Eina_Array *stack; Svg_Node *doc; Svg_Node *def; - Svg_Style_Gradient *gradient; + Eina_List *gradients; + Svg_Style_Gradient *latest_gradient; //for stops Evas_SVG_Parser *svg_parse; int level; Eina_Bool result:1; @@ -2158,11 +2159,21 @@ _evas_svg_loader_xml_open_parser(Evas_SVG_Loader *loader, { Svg_Style_Gradient *gradient; gradient = gradient_method(loader, attrs, attrs_length); + /*FIXME: The current parsing structure does not distinguish end tags. + There is no way to know if the currently parsed gradient is in defs. + If a gradient is declared outside of defs after defs is set, it is included in the gradients of defs. + But finally, the loader has a gradient style list regardless of defs. + This is only to support this when multiple gradients are declared, even if no defs are declared. + refer to: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs */ if (loader->doc->node.doc.defs) { loader->def->node.defs.gradients = eina_list_append(loader->def->node.defs.gradients, gradient); } - loader->gradient = gradient; + else + { + loader->gradients = eina_list_append(loader->gradients, gradient); + } + loader->latest_gradient = gradient; } else if (!strcmp(tag_name, "stop")) { @@ -2172,8 +2183,10 @@ _evas_svg_loader_xml_open_parser(Evas_SVG_Loader *loader, stop->a = 255; eina_simple_xml_attributes_parse(attrs, attrs_length, _attr_parse_stops, loader); - if (loader->gradient) - loader->gradient->stops = eina_list_append(loader->gradient->stops, stop); + if (loader->latest_gradient) + { + loader->latest_gradient->stops = eina_list_append(loader->latest_gradient->stops, stop); + } } } @@ -2415,9 +2428,9 @@ evas_vg_load_file_open_svg(Eina_File *file, _update_gradient(loader.doc, defs->node.defs.gradients); else { - if (loader.gradient) + if (loader.gradients) { - Eina_List* gradient_list = eina_list_append(NULL, loader.gradient); + Eina_List* gradient_list = loader.gradients; _update_gradient(loader.doc, gradient_list); eina_list_free(gradient_list); } From 43993fd7fceb982da2d0f6c294c28a9af48d7ae5 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 15 Jul 2019 09:51:01 -0400 Subject: [PATCH 08/23] examples: fix function signature for edje color class example Reviewers: devilhorns Reviewed By: devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9303 --- src/examples/edje/edje-color-class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/examples/edje/edje-color-class.c b/src/examples/edje/edje-color-class.c index 52db84b546..c153d7c9c0 100644 --- a/src/examples/edje/edje-color-class.c +++ b/src/examples/edje/edje-color-class.c @@ -138,7 +138,7 @@ _canvas_resize_cb(Ecore_Evas *_ee) } static void -_color_class_callback_delete(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, +_color_class_callback_delete(void *data, Evas_Object *obj EINA_UNUSED, const char *emission, void *source EINA_UNUSED) { if (!strcmp(data, "process")) From e33609937e90c4129a495fadf8f68baee0d645f4 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 15 Jul 2019 08:35:49 -0400 Subject: [PATCH 09/23] tests: Add start of Ecore_Wl2 test suite Small patch set to add the start of a Ecore_Wl2 test suite ref T8016 --- src/tests/ecore_wl2/ecore_wl2_suite.c | 45 +++++++++++++++++++ src/tests/ecore_wl2/ecore_wl2_suite.h | 9 ++++ .../ecore_wl2/ecore_wl2_test_ecore_wl2.c | 23 ++++++++++ src/tests/ecore_wl2/meson.build | 17 +++++++ 4 files changed, 94 insertions(+) create mode 100644 src/tests/ecore_wl2/ecore_wl2_suite.c create mode 100644 src/tests/ecore_wl2/ecore_wl2_suite.h create mode 100644 src/tests/ecore_wl2/ecore_wl2_test_ecore_wl2.c create mode 100644 src/tests/ecore_wl2/meson.build diff --git a/src/tests/ecore_wl2/ecore_wl2_suite.c b/src/tests/ecore_wl2/ecore_wl2_suite.c new file mode 100644 index 0000000000..234a581ef0 --- /dev/null +++ b/src/tests/ecore_wl2/ecore_wl2_suite.c @@ -0,0 +1,45 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "ecore_wl2_suite.h" +#include "../efl_check.h" +#include + +static const Efl_Test_Case etc[] = +{ +#if HAVE_ECORE_WL2 + { "Ecore_Wl2", ecore_wl2_test_init }, +#endif + { NULL, NULL } +}; + +SUITE_INIT(ecore_wl2) +{ + ck_assert_int_eq(ecore_wl2_init(), 1); +} + +SUITE_SHUTDOWN(ecore_wl2) +{ + ck_assert_int_eq(ecore_wl2_shutdown(), 0); +} + +int +main(int argc, char **argv) +{ + int count; + + if (!_efl_test_option_disp(argc, argv, etc)) return 0; + +#ifdef NEED_RUN_IN_TREE + putenv("EFL_RUN_IN_TREE=1"); +#endif + + count = + _efl_suite_build_and_run(argc - 1, + (const char **)argv + 1, "Ecore_Wl2", etc, + SUITE_INIT_FN(ecore_wl2), + SUITE_SHUTDOWN_FN(ecore_wl2)); + + return (count == 0) ? 0 : 255; +} diff --git a/src/tests/ecore_wl2/ecore_wl2_suite.h b/src/tests/ecore_wl2/ecore_wl2_suite.h new file mode 100644 index 0000000000..b17d8a767f --- /dev/null +++ b/src/tests/ecore_wl2/ecore_wl2_suite.h @@ -0,0 +1,9 @@ +#ifndef _ECORE_WL2_SUITE_H +# define _ECORE_WL2_SUITE_H + +# include +# include "../efl_check.h" + +void ecore_wl2_test_init(TCase *tc); + +#endif diff --git a/src/tests/ecore_wl2/ecore_wl2_test_ecore_wl2.c b/src/tests/ecore_wl2/ecore_wl2_test_ecore_wl2.c new file mode 100644 index 0000000000..6ed6b7343f --- /dev/null +++ b/src/tests/ecore_wl2/ecore_wl2_test_ecore_wl2.c @@ -0,0 +1,23 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#include +#include +#include + +#include "ecore_wl2_suite.h" + +EFL_START_TEST(ecore_wl2_simple) +{ +} +EFL_END_TEST + +void +ecore_wl2_test_init(TCase *tc) +{ + tcase_add_test(tc, ecore_wl2_simple); +} diff --git a/src/tests/ecore_wl2/meson.build b/src/tests/ecore_wl2/meson.build new file mode 100644 index 0000000000..11500c781e --- /dev/null +++ b/src/tests/ecore_wl2/meson.build @@ -0,0 +1,17 @@ +ecore_wl2_suite_src = [ + 'ecore_wl2_suite.c', + 'ecore_wl2_suite.h', + 'ecore_wl2_test_ecore_wl2.c' +] + +ecore_wl2_suite = executable('ecore_wl2_suite', + ecore_wl2_suite_src, + dependencies: [ecore_wl2, ecore, check], + c_args : [ + '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', + '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"'] +) + +test('ecore_wl2-suite', ecore_wl2_suite, + env : test_env +) From 3b28a0a0f5bf3ce7c5b4d710f91391476271f5f8 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 15 Jul 2019 08:38:43 -0400 Subject: [PATCH 10/23] meson: Modify Ecore_Wl2 sub project to add tests ref T8016 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index dfc8907c9d..962a30efd2 100644 --- a/meson.build +++ b/meson.build @@ -284,7 +284,7 @@ subprojects = [ ['ecore_input' ,[] , false, true, false, false, false, false, ['eina', 'eo'], []], ['ecore_x' ,['x11'] , false, true, false, false, false, false, ['eina', 'efl'], []], ['ecore_fb' ,['fb'] , false, true, false, false, false, false, ['eina'], []], -['ecore_wl2' ,['wl'] , true, true, false, false, false, false, ['eina'], ['libdrm']], +['ecore_wl2' ,['wl'] , true, true, false, false, true, false, ['eina'], ['libdrm']], ['ecore_sdl' ,['sdl'] , false, true, false, false, false, false, ['eina'], []], ['ecore_win32' ,[] , false, true, false, false, false, false, ['eina'], []], ['ecore_ipc' ,[] , false, true, false, false, false, false, ['eina'], []], From 73acf72cc4333ac9b69765214d54b78db6c72715 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 15 Jul 2019 09:49:31 -0400 Subject: [PATCH 11/23] tests: Add file for Ecore_Wl2 display tests Add file which can be used to add tests for ecore_wl2 display functions ref T8016 --- src/tests/ecore_wl2/ecore_wl2_suite.c | 1 + src/tests/ecore_wl2/ecore_wl2_suite.h | 1 + src/tests/ecore_wl2/ecore_wl2_test_display.c | 39 +++++++++++++++++++ src/tests/ecore_wl2/ecore_wl2_tests_helpers.h | 17 ++++++++ src/tests/ecore_wl2/meson.build | 4 +- 5 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 src/tests/ecore_wl2/ecore_wl2_test_display.c create mode 100644 src/tests/ecore_wl2/ecore_wl2_tests_helpers.h diff --git a/src/tests/ecore_wl2/ecore_wl2_suite.c b/src/tests/ecore_wl2/ecore_wl2_suite.c index 234a581ef0..7f7d5fd107 100644 --- a/src/tests/ecore_wl2/ecore_wl2_suite.c +++ b/src/tests/ecore_wl2/ecore_wl2_suite.c @@ -10,6 +10,7 @@ static const Efl_Test_Case etc[] = { #if HAVE_ECORE_WL2 { "Ecore_Wl2", ecore_wl2_test_init }, + { "Display", ecore_wl2_test_display }, #endif { NULL, NULL } }; diff --git a/src/tests/ecore_wl2/ecore_wl2_suite.h b/src/tests/ecore_wl2/ecore_wl2_suite.h index b17d8a767f..2ff7074dcd 100644 --- a/src/tests/ecore_wl2/ecore_wl2_suite.h +++ b/src/tests/ecore_wl2/ecore_wl2_suite.h @@ -5,5 +5,6 @@ # include "../efl_check.h" void ecore_wl2_test_init(TCase *tc); +void ecore_wl2_test_display(TCase *tc); #endif diff --git a/src/tests/ecore_wl2/ecore_wl2_test_display.c b/src/tests/ecore_wl2/ecore_wl2_test_display.c new file mode 100644 index 0000000000..e566ab8901 --- /dev/null +++ b/src/tests/ecore_wl2/ecore_wl2_test_display.c @@ -0,0 +1,39 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include +#include + +#include "ecore_wl2_suite.h" +#include "ecore_wl2_tests_helpers.h" + +EFL_START_TEST(wl2_display_create) +{ + Ecore_Wl2_Display *disp; + + disp = ECORE_WL2_TEST_DISPLAY_SETUP(); + ck_assert(disp != NULL); +} +EFL_END_TEST + +EFL_START_TEST(wl2_display_destroy) +{ + Ecore_Wl2_Display *disp; + + disp = ECORE_WL2_TEST_DISPLAY_SETUP(); + ck_assert(disp != NULL); + + ecore_wl2_display_destroy(disp); +} +EFL_END_TEST + +void +ecore_wl2_test_display(TCase *tc) +{ + tcase_add_test(tc, wl2_display_create); + tcase_add_test(tc, wl2_display_destroy); +} diff --git a/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h b/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h new file mode 100644 index 0000000000..24175a505a --- /dev/null +++ b/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h @@ -0,0 +1,17 @@ +#ifndef ECORE_WL2_TEST_HELPERS_H +# define ECORE_WL2_TEST_HELPERS_H + +# include + +# define ECORE_WL2_TEST_DISPLAY_SETUP() _setup_display() + +static Ecore_Wl2_Display * +_setup_display(void) +{ + Ecore_Wl2_Display *disp; + + disp = ecore_wl2_display_create(NULL); + return disp; +} + +#endif diff --git a/src/tests/ecore_wl2/meson.build b/src/tests/ecore_wl2/meson.build index 11500c781e..97bce4eed7 100644 --- a/src/tests/ecore_wl2/meson.build +++ b/src/tests/ecore_wl2/meson.build @@ -1,7 +1,9 @@ ecore_wl2_suite_src = [ 'ecore_wl2_suite.c', 'ecore_wl2_suite.h', - 'ecore_wl2_test_ecore_wl2.c' + 'ecore_wl2_tests_helpers.h', + 'ecore_wl2_test_ecore_wl2.c', + 'ecore_wl2_test_display.c' ] ecore_wl2_suite = executable('ecore_wl2_suite', From b9f89fabb6f90b5bbd8a0198d2c626f3cbda101a Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 15 Jul 2019 10:08:32 -0400 Subject: [PATCH 12/23] tests: Add tests for ecore_wl2_display_get and ecore_wl2_display_name_get ref T8016 --- src/tests/ecore_wl2/ecore_wl2_test_display.c | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/tests/ecore_wl2/ecore_wl2_test_display.c b/src/tests/ecore_wl2/ecore_wl2_test_display.c index e566ab8901..5806d002f8 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_display.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_display.c @@ -31,9 +31,35 @@ EFL_START_TEST(wl2_display_destroy) } EFL_END_TEST +EFL_START_TEST(wl2_display_get) +{ + Ecore_Wl2_Display *disp; + struct wl_display *wdisp; + + disp = ECORE_WL2_TEST_DISPLAY_SETUP(); + ck_assert(disp != NULL); + + wdisp = ecore_wl2_display_get(disp); + ck_assert(wdisp != NULL); +} +EFL_END_TEST + +EFL_START_TEST(wl2_display_name_get) +{ + Ecore_Wl2_Display *disp; + + disp = ECORE_WL2_TEST_DISPLAY_SETUP(); + ck_assert(disp != NULL); + + ck_assert(ecore_wl2_display_name_get(disp) != NULL); +} +EFL_END_TEST + void ecore_wl2_test_display(TCase *tc) { tcase_add_test(tc, wl2_display_create); tcase_add_test(tc, wl2_display_destroy); + tcase_add_test(tc, wl2_display_get); + tcase_add_test(tc, wl2_display_name_get); } From 723412404f812d0ec4479d6b9c1a3cea07c9f7bf Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 15 Jul 2019 10:28:29 -0400 Subject: [PATCH 13/23] tests/ecore_wl2: Add test cases for wl2 client-side functions This patch separates the ecore_wl2 tests to support both server-side and client-side functionality. In order to test client-side functions, these tests MUST be run under an existing Wayland Compositor (Enlightenment, Weston, etc). ref T8016 --- src/tests/ecore_wl2/ecore_wl2_test_display.c | 39 +++++++++++++++++-- src/tests/ecore_wl2/ecore_wl2_tests_helpers.h | 10 +++++ 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/src/tests/ecore_wl2/ecore_wl2_test_display.c b/src/tests/ecore_wl2/ecore_wl2_test_display.c index 5806d002f8..c79621ac74 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_display.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_display.c @@ -55,11 +55,42 @@ EFL_START_TEST(wl2_display_name_get) } EFL_END_TEST +EFL_START_TEST(wl2_display_connect) +{ + Ecore_Wl2_Display *disp; + + disp = ECORE_WL2_TEST_DISPLAY_CONNECT(); + ck_assert(disp != NULL); +} +EFL_END_TEST + +EFL_START_TEST(wl2_display_disconnect) +{ + Ecore_Wl2_Display *disp; + + disp = ECORE_WL2_TEST_DISPLAY_CONNECT(); + ck_assert(disp != NULL); + + ecore_wl2_display_disconnect(disp); +} +EFL_END_TEST + void ecore_wl2_test_display(TCase *tc) { - tcase_add_test(tc, wl2_display_create); - tcase_add_test(tc, wl2_display_destroy); - tcase_add_test(tc, wl2_display_get); - tcase_add_test(tc, wl2_display_name_get); + if (!getenv("WAYLAND_DISPLAY")) + { + /* tests here are for server-side functions */ + tcase_add_test(tc, wl2_display_create); + tcase_add_test(tc, wl2_display_destroy); + tcase_add_test(tc, wl2_display_get); + tcase_add_test(tc, wl2_display_name_get); + } + + if (getenv("WAYLAND_DISPLAY")) + { + /* tests here are for client-side functions */ + tcase_add_test(tc, wl2_display_connect); + tcase_add_test(tc, wl2_display_disconnect); + } } diff --git a/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h b/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h index 24175a505a..e06cea7859 100644 --- a/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h +++ b/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h @@ -4,6 +4,7 @@ # include # define ECORE_WL2_TEST_DISPLAY_SETUP() _setup_display() +# define ECORE_WL2_TEST_DISPLAY_CONNECT() _connect_display() static Ecore_Wl2_Display * _setup_display(void) @@ -14,4 +15,13 @@ _setup_display(void) return disp; } +static Ecore_Wl2_Display * +_connect_display(void) +{ + Ecore_Wl2_Display *disp; + + disp = ecore_wl2_display_connect(NULL); + return disp; +} + #endif From 3a3a2f667a182d7c940845cfe6ac546331666623 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 15 Jul 2019 10:31:56 -0400 Subject: [PATCH 14/23] tests/ecore_wl2: Add ecore_wl2_display_shm_get test ref T8016 --- src/tests/ecore_wl2/ecore_wl2_test_display.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/tests/ecore_wl2/ecore_wl2_test_display.c b/src/tests/ecore_wl2/ecore_wl2_test_display.c index c79621ac74..941b06e35e 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_display.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_display.c @@ -75,6 +75,19 @@ EFL_START_TEST(wl2_display_disconnect) } EFL_END_TEST +EFL_START_TEST(wl2_display_shm_get) +{ + Ecore_Wl2_Display *disp; + struct wl_shm *shm; + + disp = ECORE_WL2_TEST_DISPLAY_CONNECT(); + ck_assert(disp != NULL); + + shm = ecore_wl2_display_shm_get(disp); + ck_assert(shm != NULL); +} +EFL_END_TEST + void ecore_wl2_test_display(TCase *tc) { @@ -92,5 +105,6 @@ ecore_wl2_test_display(TCase *tc) /* tests here are for client-side functions */ tcase_add_test(tc, wl2_display_connect); tcase_add_test(tc, wl2_display_disconnect); + tcase_add_test(tc, wl2_display_shm_get); } } From 7618a6caf01cbcc168921a97be54cab88033c513 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 15 Jul 2019 10:33:37 -0400 Subject: [PATCH 15/23] tests/ecore_wl2: Add ecore_wl2_display_dmabuf_get test ref T8016 --- src/tests/ecore_wl2/ecore_wl2_test_display.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/tests/ecore_wl2/ecore_wl2_test_display.c b/src/tests/ecore_wl2/ecore_wl2_test_display.c index 941b06e35e..a04f2a58eb 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_display.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_display.c @@ -88,6 +88,19 @@ EFL_START_TEST(wl2_display_shm_get) } EFL_END_TEST +EFL_START_TEST(wl2_display_dmabuf_get) +{ + Ecore_Wl2_Display *disp; + void *dma; + + disp = ECORE_WL2_TEST_DISPLAY_CONNECT(); + ck_assert(disp != NULL); + + dma = ecore_wl2_display_dmabuf_get(disp); + ck_assert(dma != NULL); +} +EFL_END_TEST + void ecore_wl2_test_display(TCase *tc) { @@ -106,5 +119,6 @@ ecore_wl2_test_display(TCase *tc) tcase_add_test(tc, wl2_display_connect); tcase_add_test(tc, wl2_display_disconnect); tcase_add_test(tc, wl2_display_shm_get); + tcase_add_test(tc, wl2_display_dmabuf_get); } } From 9ef1ab7876c2baa4e447f299b528cd2f5436f2f3 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 15 Jul 2019 10:42:27 -0400 Subject: [PATCH 16/23] tests/ecore_wl2: Add printf for compositor detection ref T8016 --- src/tests/ecore_wl2/ecore_wl2_test_display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tests/ecore_wl2/ecore_wl2_test_display.c b/src/tests/ecore_wl2/ecore_wl2_test_display.c index a04f2a58eb..5327347c08 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_display.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_display.c @@ -107,6 +107,7 @@ ecore_wl2_test_display(TCase *tc) if (!getenv("WAYLAND_DISPLAY")) { /* tests here are for server-side functions */ + printf("No Wayland Compositor detected. Testing server-side functions\n"); tcase_add_test(tc, wl2_display_create); tcase_add_test(tc, wl2_display_destroy); tcase_add_test(tc, wl2_display_get); @@ -116,6 +117,7 @@ ecore_wl2_test_display(TCase *tc) if (getenv("WAYLAND_DISPLAY")) { /* tests here are for client-side functions */ + printf("Wayland Compositor detected. Testing client-side functions\n"); tcase_add_test(tc, wl2_display_connect); tcase_add_test(tc, wl2_display_disconnect); tcase_add_test(tc, wl2_display_shm_get); From 539775b1cd1ae6d49f6a2b54a0ec5a1f1a1f6b0d Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 15 Jul 2019 10:47:36 -0400 Subject: [PATCH 17/23] tests/ecore_wl2: Add test for ecore_wl2_display_globals_get function ref T8016 --- src/tests/ecore_wl2/ecore_wl2_test_display.c | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/tests/ecore_wl2/ecore_wl2_test_display.c b/src/tests/ecore_wl2/ecore_wl2_test_display.c index 5327347c08..ece3078b52 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_display.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_display.c @@ -101,6 +101,29 @@ EFL_START_TEST(wl2_display_dmabuf_get) } EFL_END_TEST +EFL_START_TEST(wl2_display_globals_get) +{ + Ecore_Wl2_Display *disp; + Ecore_Wl2_Global *global; + Eina_Iterator *itr; + void *data; + + disp = ECORE_WL2_TEST_DISPLAY_CONNECT(); + ck_assert(disp != NULL); + + itr = ecore_wl2_display_globals_get(disp); + ck_assert(itr != NULL); + + EINA_ITERATOR_FOREACH(itr, data) + { + global = (Ecore_Wl2_Global *)data; + printf("Interface: <%s>\n", global->interface); + } + + eina_iterator_free(itr); +} +EFL_END_TEST + void ecore_wl2_test_display(TCase *tc) { @@ -122,5 +145,6 @@ ecore_wl2_test_display(TCase *tc) tcase_add_test(tc, wl2_display_disconnect); tcase_add_test(tc, wl2_display_shm_get); tcase_add_test(tc, wl2_display_dmabuf_get); + tcase_add_test(tc, wl2_display_globals_get); } } From a081920c7dda4459f35f89824f43f88cb2f61ab7 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 15 Jul 2019 10:53:42 -0400 Subject: [PATCH 18/23] tests/ecore_wl2: Add test for ecore_wl2_display_screen_size_get function ref T8016 --- src/tests/ecore_wl2/ecore_wl2_test_display.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/tests/ecore_wl2/ecore_wl2_test_display.c b/src/tests/ecore_wl2/ecore_wl2_test_display.c index ece3078b52..37fa1e5817 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_display.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_display.c @@ -124,6 +124,20 @@ EFL_START_TEST(wl2_display_globals_get) } EFL_END_TEST +EFL_START_TEST(wl2_display_screen_size_get) +{ + Ecore_Wl2_Display *disp; + int w, h; + + disp = ECORE_WL2_TEST_DISPLAY_CONNECT(); + ck_assert(disp != NULL); + + ecore_wl2_display_screen_size_get(disp, &w, &h); + ck_assert_int_ne(w, 0); + ck_assert_int_ne(h, 0); +} +EFL_END_TEST + void ecore_wl2_test_display(TCase *tc) { @@ -146,5 +160,6 @@ ecore_wl2_test_display(TCase *tc) tcase_add_test(tc, wl2_display_shm_get); tcase_add_test(tc, wl2_display_dmabuf_get); tcase_add_test(tc, wl2_display_globals_get); + tcase_add_test(tc, wl2_display_screen_size_get); } } From 7a85ad660b9f5ffb6694ce2b14fc1ba92f4f0b78 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 15 Jul 2019 11:00:05 -0400 Subject: [PATCH 19/23] tests/ecore_wl2: Add test for ecore_wl2_display_registry_get function ref T8016 --- src/tests/ecore_wl2/ecore_wl2_test_display.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/tests/ecore_wl2/ecore_wl2_test_display.c b/src/tests/ecore_wl2/ecore_wl2_test_display.c index 37fa1e5817..c76b7d6f72 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_display.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_display.c @@ -75,6 +75,17 @@ EFL_START_TEST(wl2_display_disconnect) } EFL_END_TEST +EFL_START_TEST(wl2_display_registry_get) +{ + Ecore_Wl2_Display *disp; + + disp = ECORE_WL2_TEST_DISPLAY_CONNECT(); + ck_assert(disp != NULL); + + ck_assert(ecore_wl2_display_registry_get(disp) != NULL); +} +EFL_END_TEST + EFL_START_TEST(wl2_display_shm_get) { Ecore_Wl2_Display *disp; @@ -157,6 +168,7 @@ ecore_wl2_test_display(TCase *tc) printf("Wayland Compositor detected. Testing client-side functions\n"); tcase_add_test(tc, wl2_display_connect); tcase_add_test(tc, wl2_display_disconnect); + tcase_add_test(tc, wl2_display_registry_get); tcase_add_test(tc, wl2_display_shm_get); tcase_add_test(tc, wl2_display_dmabuf_get); tcase_add_test(tc, wl2_display_globals_get); From 3be7c844fd81cf9f21653ef831c6e0ec5cf4edbb Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 15 Jul 2019 12:32:50 -0400 Subject: [PATCH 20/23] tests/ecore_wl2: Add test for ecore_wl2_display_inputs_get ref T8016 --- src/tests/ecore_wl2/ecore_wl2_test_display.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/tests/ecore_wl2/ecore_wl2_test_display.c b/src/tests/ecore_wl2/ecore_wl2_test_display.c index c76b7d6f72..c90c944cb2 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_display.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_display.c @@ -149,6 +149,19 @@ EFL_START_TEST(wl2_display_screen_size_get) } EFL_END_TEST +EFL_START_TEST(wl2_display_inputs_get) +{ + Ecore_Wl2_Display *disp; + Eina_Iterator *itr; + + disp = ECORE_WL2_TEST_DISPLAY_CONNECT(); + ck_assert(disp != NULL); + + itr = ecore_wl2_display_inputs_get(disp); + ck_assert(itr != NULL); +} +EFL_END_TEST + void ecore_wl2_test_display(TCase *tc) { @@ -173,5 +186,6 @@ ecore_wl2_test_display(TCase *tc) tcase_add_test(tc, wl2_display_dmabuf_get); tcase_add_test(tc, wl2_display_globals_get); tcase_add_test(tc, wl2_display_screen_size_get); + tcase_add_test(tc, wl2_display_inputs_get); } } From f30ef634adbb776cd04e65480faafb1fe297dc85 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 15 Jul 2019 12:40:29 -0400 Subject: [PATCH 21/23] tests/ecore_wl2: Add start of Ecore_Wl2 Window tests ref T8016 --- src/tests/ecore_wl2/ecore_wl2_suite.c | 1 + src/tests/ecore_wl2/ecore_wl2_suite.h | 1 + src/tests/ecore_wl2/ecore_wl2_test_window.c | 52 +++++++++++++++++++++ src/tests/ecore_wl2/meson.build | 3 +- 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 src/tests/ecore_wl2/ecore_wl2_test_window.c diff --git a/src/tests/ecore_wl2/ecore_wl2_suite.c b/src/tests/ecore_wl2/ecore_wl2_suite.c index 7f7d5fd107..b4285ccd62 100644 --- a/src/tests/ecore_wl2/ecore_wl2_suite.c +++ b/src/tests/ecore_wl2/ecore_wl2_suite.c @@ -11,6 +11,7 @@ static const Efl_Test_Case etc[] = #if HAVE_ECORE_WL2 { "Ecore_Wl2", ecore_wl2_test_init }, { "Display", ecore_wl2_test_display }, + { "Window", ecore_wl2_test_window }, #endif { NULL, NULL } }; diff --git a/src/tests/ecore_wl2/ecore_wl2_suite.h b/src/tests/ecore_wl2/ecore_wl2_suite.h index 2ff7074dcd..a344818814 100644 --- a/src/tests/ecore_wl2/ecore_wl2_suite.h +++ b/src/tests/ecore_wl2/ecore_wl2_suite.h @@ -6,5 +6,6 @@ void ecore_wl2_test_init(TCase *tc); void ecore_wl2_test_display(TCase *tc); +void ecore_wl2_test_window(TCase *tc); #endif diff --git a/src/tests/ecore_wl2/ecore_wl2_test_window.c b/src/tests/ecore_wl2/ecore_wl2_test_window.c new file mode 100644 index 0000000000..4608f767a6 --- /dev/null +++ b/src/tests/ecore_wl2/ecore_wl2_test_window.c @@ -0,0 +1,52 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include +#include + +#include "ecore_wl2_suite.h" + +static Ecore_Wl2_Display * +_display_connect(void) +{ + Ecore_Wl2_Display *disp; + + disp = ecore_wl2_display_connect(NULL); + return disp; +} + +static Ecore_Wl2_Window * +_window_create(Ecore_Wl2_Display *disp) +{ + Ecore_Wl2_Window *win; + + win = ecore_wl2_window_new(disp, NULL, 100, 100, 500, 500); + return win; +} + +EFL_START_TEST(wl2_window_new) +{ + Ecore_Wl2_Display *disp; + Ecore_Wl2_Window *win; + + disp = _display_connect(); + ck_assert(disp != NULL); + + win = _window_create(disp); + ck_assert(win != NULL); +} +EFL_END_TEST + +void +ecore_wl2_test_window(TCase *tc) +{ + if (getenv("WAYLAND_DISPLAY")) + { + /* window tests can only run if there is an existing compositor */ + tcase_add_test(tc, wl2_window_new); + } +} diff --git a/src/tests/ecore_wl2/meson.build b/src/tests/ecore_wl2/meson.build index 97bce4eed7..70d9ed1e96 100644 --- a/src/tests/ecore_wl2/meson.build +++ b/src/tests/ecore_wl2/meson.build @@ -3,7 +3,8 @@ ecore_wl2_suite_src = [ 'ecore_wl2_suite.h', 'ecore_wl2_tests_helpers.h', 'ecore_wl2_test_ecore_wl2.c', - 'ecore_wl2_test_display.c' + 'ecore_wl2_test_display.c', + 'ecore_wl2_test_window.c' ] ecore_wl2_suite = executable('ecore_wl2_suite', From af0a37da03a77a96e187fd5c08debc6791b8b3c5 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 15 Jul 2019 14:21:36 -0400 Subject: [PATCH 22/23] tests/ecore_wl2: Check for valid xdg_runtime_dir Seems these tests need XDG_RUNTIME_DIR to be set, and it does not get set in Travis builds, so add a small check here so that Travis builds don't fail ... thanks Marcel ;) ref T8016 --- src/tests/ecore_wl2/ecore_wl2_test_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/ecore_wl2/ecore_wl2_test_display.c b/src/tests/ecore_wl2/ecore_wl2_test_display.c index c90c944cb2..828db2f432 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_display.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_display.c @@ -165,7 +165,7 @@ EFL_END_TEST void ecore_wl2_test_display(TCase *tc) { - if (!getenv("WAYLAND_DISPLAY")) + if ((!getenv("WAYLAND_DISPLAY")) && (getenv("XDG_RUNTIME_DIR"))) { /* tests here are for server-side functions */ printf("No Wayland Compositor detected. Testing server-side functions\n"); From ab26579cab36451c9efd33adfba22ecce4010ef1 Mon Sep 17 00:00:00 2001 From: Vitor Sousa Date: Wed, 10 Jul 2019 20:22:42 -0300 Subject: [PATCH 23/23] Revert "Revert "efl: prevent usage of some Eina.* stub types in stable APIs"" EFL# support for slice and rw_slice was added in a previous commit. So now it is safe to undo the reversion of this commit. This reverts commit 25ef604467b083d1f5ff2c7f9a1a82e660e04443. --- src/lib/efl/interfaces/efl_io_reader.eo | 2 +- src/lib/efl/interfaces/efl_io_writer.eo | 4 ++-- src/lib/eo/eina_types.eot | 22 +++++++++++----------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/lib/efl/interfaces/efl_io_reader.eo b/src/lib/efl/interfaces/efl_io_reader.eo index 2e166031a9..374e81e1fb 100644 --- a/src/lib/efl/interfaces/efl_io_reader.eo +++ b/src/lib/efl/interfaces/efl_io_reader.eo @@ -29,7 +29,7 @@ interface Efl.Io.Reader { You can understand this method as read(2) libc function. ]] params { - @inout rw_slice: Eina.Rw_Slice; [[Provides a pre-allocated memory to be filled up to rw_slice.len. It will be populated and the length will be set to the actually used amount of bytes, which can be smaller than the request.]] + @inout rw_slice: rw_slice; [[Provides a pre-allocated memory to be filled up to rw_slice.len. It will be populated and the length will be set to the actually used amount of bytes, which can be smaller than the request.]] } return: Eina.Error; [[0 on succeed, a mapping of errno otherwise]] } diff --git a/src/lib/efl/interfaces/efl_io_writer.eo b/src/lib/efl/interfaces/efl_io_writer.eo index 471b6a0d60..d83d5beb0f 100644 --- a/src/lib/efl/interfaces/efl_io_writer.eo +++ b/src/lib/efl/interfaces/efl_io_writer.eo @@ -29,8 +29,8 @@ interface Efl.Io.Writer { You can understand this method as write(2) libc function. ]] params { - @inout slice: Eina.Slice; [[Provides a pre-populated memory to be used up to slice.len. The returned slice will be adapted as length will be set to the actually used amount of bytes, which can be smaller than the request.]] - @out remaining: Eina.Slice @optional; [[Convenience to output the remaining parts of slice that was not written. If the full slice was written, this will be a slice of zero-length.]] + @inout slice: slice; [[Provides a pre-populated memory to be used up to slice.len. The returned slice will be adapted as length will be set to the actually used amount of bytes, which can be smaller than the request.]] + @out remaining: slice @optional; [[Convenience to output the remaining parts of slice that was not written. If the full slice was written, this will be a slice of zero-length.]] } return: Eina.Error; [[0 on succeed, a mapping of errno otherwise]] } diff --git a/src/lib/eo/eina_types.eot b/src/lib/eo/eina_types.eot index 95d15a4782..d936901eea 100644 --- a/src/lib/eo/eina_types.eot +++ b/src/lib/eo/eina_types.eot @@ -42,9 +42,9 @@ struct @extern Eina.Matrix3 { zz: double; [[ZZ matrix value]] } -type @extern Eina.Unicode: uint32; [[Eina unicode type]] +type @extern @beta Eina.Unicode: uint32; [[Eina unicode type]] -struct @extern Eina.File_Direct_Info; [[Eina file direct information data structure]] +struct @extern @beta Eina.File_Direct_Info; [[Eina file direct information data structure]] /*{ path_lenght: size_t; [[Size of the whole path]] name_length: size_t; [[Size of the filename/basename component]] @@ -53,7 +53,7 @@ struct @extern Eina.File_Direct_Info; [[Eina file direct information data struct path: char[EINA_PATH_MAX]; [[The path]] };*/ -enum @extern Eina.Xattr.Flags { +enum @extern @beta Eina.Xattr.Flags { [[Eina file extended attributes flags]] insert, [[This is the default behaviour, it will either create or replace the extended attribute]] replace, [[This will only succeed if the extended attribute previously existed]] @@ -62,25 +62,25 @@ enum @extern Eina.Xattr.Flags { type @extern Eina.Error: int; [[Eina error type]] -struct @extern @free(eina_binbuf_free) Eina.Binbuf; [[Eina binbuf data structure]] -struct @extern @free(eina_strbuf_free) Eina.Strbuf; [[Eina strbuf data structure]] +struct @extern @beta @free(eina_binbuf_free) Eina.Binbuf; [[Eina binbuf data structure]] +struct @extern @beta @free(eina_strbuf_free) Eina.Strbuf; [[Eina strbuf data structure]] -struct @extern Eina.Slice { +struct @extern @beta Eina.Slice { [[A linear, read-only, memory segment]] len: size; [[Length of the memory segment]] mem: const(void_ptr); [[Pointer to memory segment]] } -struct @extern Eina.Rw_Slice { +struct @extern @beta Eina.Rw_Slice { [[A linear, read-write, memory segment]] len: size; [[Length of the memory segment]] 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 @beta Eina.Value; [[Eina value placeholder so it can be referenced from docs.]] +struct @extern @beta Eina.Value_Type; [[Eina value type]] -struct @extern Eina.Stat { +struct @extern @beta Eina.Stat { [[The structure to store some file statistics.]] dev : ulong; [[The device where this file is located]] ino : ulong; [[The inode]] @@ -103,5 +103,5 @@ struct @extern Eina.Stat { 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]] +type @beta Efl.Event_Cb: __undefined_type; [[Efl event callback type]]