summaryrefslogtreecommitdiff
path: root/legacy/evas/src
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-11-13 23:52:18 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-11-13 23:52:18 +0000
commitcd926b304dc8f072d99d55f90ef4bd6ad9d3a62f (patch)
treeab108ceeb5d9b72e9998c7e5c58d7ba3aaeed5e7 /legacy/evas/src
parent30965869f0e3aaea6adb2765e98a6797e9f03749 (diff)
move libs already in EFL into... IN-EFL - this will stop/prevent/limit
thnigs like people using them and patching them, etc. SVN revision: 79255
Diffstat (limited to 'legacy/evas/src')
-rw-r--r--legacy/evas/src/Makefile.am3
-rw-r--r--legacy/evas/src/bin/Makefile.am75
-rw-r--r--legacy/evas/src/bin/loaders/Makefile.am51
-rw-r--r--legacy/evas/src/bin/loaders/bmp/Makefile.am32
-rw-r--r--legacy/evas/src/bin/loaders/eet/Makefile.am34
-rw-r--r--legacy/evas/src/bin/loaders/ico/Makefile.am32
-rw-r--r--legacy/evas/src/bin/loaders/jpeg/Makefile.am33
-rw-r--r--legacy/evas/src/bin/loaders/pmaps/Makefile.am33
-rw-r--r--legacy/evas/src/bin/loaders/png/Makefile.am33
-rw-r--r--legacy/evas/src/bin/loaders/psd/Makefile.am32
-rw-r--r--legacy/evas/src/bin/loaders/tga/Makefile.am32
-rw-r--r--legacy/evas/src/bin/loaders/tiff/Makefile.am34
-rw-r--r--legacy/evas/src/bin/loaders/wbmp/Makefile.am32
-rw-r--r--legacy/evas/src/bin/loaders/webp/Makefile.am34
-rw-r--r--legacy/evas/src/bin/loaders/xpm/Makefile.am34
-rw-r--r--legacy/evas/src/examples/Makefile.am160
-rw-r--r--legacy/evas/src/examples/aspect.edc17
-rw-r--r--legacy/evas/src/examples/cube1.pngbin183167 -> 0 bytes
-rw-r--r--legacy/evas/src/examples/enlightenment.pngbin17541 -> 0 bytes
-rw-r--r--legacy/evas/src/examples/evas-aspect-hints.c249
-rw-r--r--legacy/evas/src/examples/evas-box.c382
-rw-r--r--legacy/evas/src/examples/evas-buffer-simple.c228
-rw-r--r--legacy/evas/src/examples/evas-events.c413
-rw-r--r--legacy/evas/src/examples/evas-hints.c378
-rw-r--r--legacy/evas/src/examples/evas-images.c353
-rw-r--r--legacy/evas/src/examples/evas-images2.c311
-rw-r--r--legacy/evas/src/examples/evas-images3.c196
-rw-r--r--legacy/evas/src/examples/evas-init-shutdown.c56
-rw-r--r--legacy/evas/src/examples/evas-map-utils.c321
-rw-r--r--legacy/evas/src/examples/evas-object-manipulation.c235
-rw-r--r--legacy/evas/src/examples/evas-smart-interface.c790
-rw-r--r--legacy/evas/src/examples/evas-smart-object.c756
-rw-r--r--legacy/evas/src/examples/evas-stacking.c329
-rw-r--r--legacy/evas/src/examples/evas-table.c120
-rw-r--r--legacy/evas/src/examples/evas-text.c411
-rw-r--r--legacy/evas/src/examples/im1.pngbin467518 -> 0 bytes
-rw-r--r--legacy/evas/src/examples/red.pngbin225 -> 0 bytes
-rw-r--r--legacy/evas/src/lib/Makefile.am213
-rw-r--r--legacy/evas/src/lib/cache/Makefile.am21
-rw-r--r--legacy/evas/src/lib/cache2/Makefile.am27
-rw-r--r--legacy/evas/src/lib/canvas/Makefile.am67
-rw-r--r--legacy/evas/src/lib/cserve2/Makefile.am31
-rw-r--r--legacy/evas/src/lib/engines/Makefile.am3
-rw-r--r--legacy/evas/src/lib/engines/common/Makefile.am111
-rw-r--r--legacy/evas/src/lib/engines/common/evas_convert_gry_1.c6
-rw-r--r--legacy/evas/src/lib/engines/common/evas_op_add/Makefile.am13
-rw-r--r--legacy/evas/src/lib/engines/common/evas_op_blend/Makefile.am46
-rw-r--r--legacy/evas/src/lib/engines/common/evas_op_copy/Makefile.am18
-rw-r--r--legacy/evas/src/lib/engines/common/evas_op_mask/Makefile.am13
-rw-r--r--legacy/evas/src/lib/engines/common/evas_op_mul/Makefile.am13
-rw-r--r--legacy/evas/src/lib/engines/common/evas_op_sub/Makefile.am14
-rw-r--r--legacy/evas/src/lib/file/Makefile.am25
-rw-r--r--legacy/evas/src/lib/include/Makefile.am13
-rw-r--r--legacy/evas/src/lib/include/evas_common_soft16.h100
-rw-r--r--legacy/evas/src/lib/include/evas_common_soft8.h184
-rw-r--r--legacy/evas/src/modules/Makefile.am3
-rw-r--r--legacy/evas/src/modules/engines/Makefile.am52
-rw-r--r--legacy/evas/src/modules/engines/buffer/Makefile.am44
-rw-r--r--legacy/evas/src/modules/engines/direct3d/Makefile.am72
-rw-r--r--legacy/evas/src/modules/engines/directfb/Makefile.am45
-rw-r--r--legacy/evas/src/modules/engines/fb/Makefile.am49
-rw-r--r--legacy/evas/src/modules/engines/gl_cocoa/Makefile.am47
-rw-r--r--legacy/evas/src/modules/engines/gl_common/Makefile.am145
-rw-r--r--legacy/evas/src/modules/engines/gl_sdl/Makefile.am47
-rw-r--r--legacy/evas/src/modules/engines/gl_x11/Makefile.am48
-rw-r--r--legacy/evas/src/modules/engines/psl1ght/Makefile.am48
-rw-r--r--legacy/evas/src/modules/engines/software_ddraw/Makefile.am49
-rw-r--r--legacy/evas/src/modules/engines/software_gdi/Makefile.am48
-rw-r--r--legacy/evas/src/modules/engines/software_generic/Makefile.am35
-rw-r--r--legacy/evas/src/modules/engines/software_x11/Makefile.am91
-rw-r--r--legacy/evas/src/modules/engines/wayland_egl/Makefile.am48
-rw-r--r--legacy/evas/src/modules/engines/wayland_shm/Makefile.am48
-rw-r--r--legacy/evas/src/modules/loaders/Makefile.am93
-rw-r--r--legacy/evas/src/modules/loaders/bmp/Makefile.am33
-rw-r--r--legacy/evas/src/modules/loaders/eet/Makefile.am35
-rw-r--r--legacy/evas/src/modules/loaders/generic/Makefile.am36
-rw-r--r--legacy/evas/src/modules/loaders/gif/Makefile.am34
-rw-r--r--legacy/evas/src/modules/loaders/ico/Makefile.am33
-rw-r--r--legacy/evas/src/modules/loaders/jpeg/Makefile.am34
-rw-r--r--legacy/evas/src/modules/loaders/pmaps/Makefile.am34
-rw-r--r--legacy/evas/src/modules/loaders/png/Makefile.am34
-rw-r--r--legacy/evas/src/modules/loaders/psd/Makefile.am33
-rw-r--r--legacy/evas/src/modules/loaders/svg/Makefile.am34
-rw-r--r--legacy/evas/src/modules/loaders/tga/Makefile.am33
-rw-r--r--legacy/evas/src/modules/loaders/tiff/Makefile.am35
-rw-r--r--legacy/evas/src/modules/loaders/wbmp/Makefile.am33
-rw-r--r--legacy/evas/src/modules/loaders/webp/Makefile.am36
-rw-r--r--legacy/evas/src/modules/loaders/xpm/Makefile.am35
-rw-r--r--legacy/evas/src/modules/savers/Makefile.am27
-rw-r--r--legacy/evas/src/modules/savers/eet/Makefile.am34
-rw-r--r--legacy/evas/src/modules/savers/jpeg/Makefile.am33
-rw-r--r--legacy/evas/src/modules/savers/png/Makefile.am35
-rw-r--r--legacy/evas/src/modules/savers/tiff/Makefile.am34
-rw-r--r--legacy/evas/src/static_deps/Makefile.am3
-rw-r--r--legacy/evas/src/static_deps/liblinebreak/Makefile.am20
-rw-r--r--legacy/evas/src/tests/Makefile.am29
-rw-r--r--legacy/evas/src/tests/evas_suite.c106
-rw-r--r--legacy/evas/src/tests/evas_suite.h12
-rw-r--r--legacy/evas/src/tests/evas_test_callbacks.c135
-rw-r--r--legacy/evas/src/tests/evas_test_init.c19
-rw-r--r--legacy/evas/src/tests/evas_test_text.c493
-rw-r--r--legacy/evas/src/tests/evas_test_textblock.c2219
-rw-r--r--legacy/evas/src/tests/evas_tests_helpers.h40
103 files changed, 0 insertions, 11910 deletions
diff --git a/legacy/evas/src/Makefile.am b/legacy/evas/src/Makefile.am
deleted file mode 100644
index c44a82efe1..0000000000
--- a/legacy/evas/src/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3SUBDIRS = static_deps lib bin modules tests examples
diff --git a/legacy/evas/src/bin/Makefile.am b/legacy/evas/src/bin/Makefile.am
deleted file mode 100644
index 8f118811bc..0000000000
--- a/legacy/evas/src/bin/Makefile.am
+++ /dev/null
@@ -1,75 +0,0 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3if EVAS_CSERVE2
4
5SUBDIRS = loaders
6
7libexec_PROGRAMS = evas_cserve2 evas_cserve2_slave dummy_slave
8bin_PROGRAMS = evas_cserve2_client evas_cserve2_usage evas_cserve2_debug
9
10AM_CPPFLAGS = \
11-I. \
12-I$(top_srcdir)/src/lib \
13-I$(top_srcdir)/src/lib/include \
14-I$(top_srcdir)/src/lib/cserve2 \
15-DPACKAGE_BIN_DIR=\"$(bindir)\" \
16-DPACKAGE_LIB_DIR=\"$(libdir)\" \
17-DPACKAGE_LIBEXEC_DIR=\"$(libexecdir)\" \
18@FREETYPE_CFLAGS@ \
19@EVAS_GENERAL_CFLAGS@ \
20@EET_CFLAGS@
21
22evas_cserve2_SOURCES = \
23evas_cserve2.h \
24evas_cserve2_slave.h \
25evas_cserve2_main.c \
26evas_cserve2_slaves.c \
27evas_cserve2_messages.c \
28evas_cserve2_shm.c \
29evas_cserve2_cache.c \
30evas_cserve2_requests.c \
31evas_cserve2_fonts.c \
32evas_cserve2_main_loop_linux.c
33
34libevas_cserve2_utils_la = $(top_builddir)/src/lib/cserve2/libevas_cserve2_utils.la
35
36evas_cserve2_LDADD = \
37@FREETYPE_LIBS@ \
38@EVAS_GENERAL_LIBS@ \
39@EFL_SHM_OPEN_LIBS@ \
40@EET_LIBS@ \
41$(libevas_cserve2_utils_la)
42
43evas_cserve2_client_SOURCES = \
44evas_cserve2_client.c
45
46evas_cserve2_usage_SOURCES = \
47evas_cserve2_usage.c
48
49evas_cserve2_debug_SOURCES = \
50evas_cserve2_debug.c
51
52evas_cserve2_usage_LDADD = \
53@EVAS_GENERAL_LIBS@
54
55evas_cserve2_debug_LDADD = \
56@EVAS_GENERAL_LIBS@
57
58evas_cserve2_slave_SOURCES = \
59evas_cserve2_slave.c \
60evas_cserve2_utils.c
61
62evas_cserve2_slave_LDFLAGS = -export-dynamic
63
64evas_cserve2_slave_LDADD = \
65@EVAS_GENERAL_LIBS@ \
66@EFL_SHM_OPEN_LIBS@
67
68dummy_slave_SOURCES = \
69dummy_slave.c
70
71dummy_slave_LDADD = \
72@EVAS_GENERAL_LIBS@ \
73@EFL_SHM_OPEN_LIBS@
74
75endif
diff --git a/legacy/evas/src/bin/loaders/Makefile.am b/legacy/evas/src/bin/loaders/Makefile.am
deleted file mode 100644
index 96d0c5eac6..0000000000
--- a/legacy/evas/src/bin/loaders/Makefile.am
+++ /dev/null
@@ -1,51 +0,0 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3SUBDIRS =
4
5if BUILD_LOADER_BMP
6SUBDIRS += bmp
7endif
8
9if BUILD_LOADER_EET
10SUBDIRS += eet
11endif
12
13if BUILD_LOADER_ICO
14SUBDIRS += ico
15endif
16
17if BUILD_LOADER_JPEG
18SUBDIRS += jpeg
19endif
20
21if BUILD_LOADER_PMAPS
22SUBDIRS += pmaps
23endif
24
25if BUILD_LOADER_PNG
26SUBDIRS += png
27endif
28
29if BUILD_LOADER_PSD
30SUBDIRS += psd
31endif
32
33if BUILD_LOADER_TGA
34SUBDIRS += tga
35endif
36
37if BUILD_LOADER_TIFF
38SUBDIRS += tiff
39endif
40
41if BUILD_LOADER_WBMP
42SUBDIRS += wbmp
43endif
44
45if BUILD_LOADER_WEBP
46SUBDIRS += webp
47endif
48
49if BUILD_LOADER_XPM
50SUBDIRS += xpm
51endif
diff --git a/legacy/evas/src/bin/loaders/bmp/Makefile.am b/legacy/evas/src/bin/loaders/bmp/Makefile.am
deleted file mode 100644
index faba4a514f..0000000000
--- a/legacy/evas/src/bin/loaders/bmp/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8-I$(top_srcdir)/src/lib/cserve2 \
9-I$(top_srcdir)/src/bin \
10@EVAS_GENERAL_CFLAGS@ \
11@EVIL_CFLAGS@
12
13if BUILD_LOADER_BMP
14#if !EVAS_STATIC_BUILD_BMP
15
16pkgdir = $(libdir)/evas/cserve2/loaders/bmp/$(MODULE_ARCH)
17pkg_LTLIBRARIES = module.la
18
19module_la_SOURCES = evas_image_load_bmp.c
20
21module_la_LIBADD = @EVAS_GENERAL_LIBS@ @EVIL_LIBS@ -lm
22module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
23module_la_LIBTOOLFLAGS = --tag=disable-static
24
25#else
26
27#noinst_LTLIBRARIES = libevas_loader_bmp.la
28#libevas_loader_bmp_la_SOURCES = evas_image_load_bmp.c
29#libevas_loader_bmp_la_LIBADD =
30
31#endif
32endif
diff --git a/legacy/evas/src/bin/loaders/eet/Makefile.am b/legacy/evas/src/bin/loaders/eet/Makefile.am
deleted file mode 100644
index a164bcda1c..0000000000
--- a/legacy/evas/src/bin/loaders/eet/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8-I$(top_srcdir)/src/lib/cserve2 \
9-I$(top_srcdir)/src/bin \
10@evas_image_loader_eet_cflags@ \
11@EVAS_GENERAL_CFLAGS@
12
13
14if BUILD_LOADER_EET
15#if !EVAS_STATIC_BUILD_EET
16
17pkgdir = $(libdir)/evas/cserve2/loaders/eet/$(MODULE_ARCH)
18pkg_LTLIBRARIES = module.la
19
20module_la_SOURCES = evas_image_load_eet.c
21
22module_la_LIBADD = @EVAS_GENERAL_LIBS@ @evas_image_loader_eet_libs@
23module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
24module_la_LIBTOOLFLAGS = --tag=disable-static
25
26#else
27
28#noinst_LTLIBRARIES = libevas_loader_eet.la
29
30#libevas_loader_eet_la_SOURCES = evas_image_load_eet.c
31#libevas_loader_eet_la_LIBADD = @evas_image_loader_eet_libs@
32
33#endif
34endif
diff --git a/legacy/evas/src/bin/loaders/ico/Makefile.am b/legacy/evas/src/bin/loaders/ico/Makefile.am
deleted file mode 100644
index 9c045e0010..0000000000
--- a/legacy/evas/src/bin/loaders/ico/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8-I$(top_srcdir)/src/lib/cserve2 \
9-I$(top_srcdir)/src/bin \
10@EVAS_GENERAL_CFLAGS@ \
11@EVIL_CFLAGS@
12
13if BUILD_LOADER_ICO
14#if !EVAS_STATIC_BUILD_ICO
15
16pkgdir = $(libdir)/evas/cserve2/loaders/ico/$(MODULE_ARCH)
17pkg_LTLIBRARIES = module.la
18
19module_la_SOURCES = evas_image_load_ico.c
20
21module_la_LIBADD = @EVAS_GENERAL_LIBS@ @EVIL_LIBS@
22module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
23module_la_LIBTOOLFLAGS = --tag=disable-static
24
25#else
26
27#noinst_LTLIBRARIES = libevas_loader_ico.la
28#libevas_loader_ico_la_SOURCES = evas_image_load_ico.c
29#libevas_loader_ico_la_LIBADD =
30
31#endif
32endif
diff --git a/legacy/evas/src/bin/loaders/jpeg/Makefile.am b/legacy/evas/src/bin/loaders/jpeg/Makefile.am
deleted file mode 100644
index 03e3928a33..0000000000
--- a/legacy/evas/src/bin/loaders/jpeg/Makefile.am
+++ /dev/null
@@ -1,33 +0,0 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8-I$(top_srcdir)/src/lib/cserve2 \
9-I$(top_srcdir)/src/bin \
10@EVAS_GENERAL_CFLAGS@ \
11@evas_image_loader_jpeg_cflags@ \
12@EVIL_CFLAGS@
13
14if BUILD_LOADER_JPEG
15#if !EVAS_STATIC_BUILD_JPEG
16
17pkgdir = $(libdir)/evas/cserve2/loaders/jpeg/$(MODULE_ARCH)
18pkg_LTLIBRARIES = module.la
19
20module_la_SOURCES = evas_image_load_jpeg.c
21
22module_la_LIBADD = @EVAS_GENERAL_LIBS@ @EVIL_LIBS@ @evas_image_loader_jpeg_libs@
23module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
24module_la_LIBTOOLFLAGS = --tag=disable-static
25
26#else
27
28#noinst_LTLIBRARIES = libevas_loader_jpeg.la
29#libevas_loader_jpeg_la_SOURCES = evas_image_load_jpeg.c
30#libevas_loader_jpeg_la_LIBADD = @evas_image_loader_jpeg_libs@
31
32#endif
33endif
diff --git a/legacy/evas/src/bin/loaders/pmaps/Makefile.am b/legacy/evas/src/bin/loaders/pmaps/Makefile.am
deleted file mode 100644
index 07480b98d6..0000000000
--- a/legacy/evas/src/bin/loaders/pmaps/Makefile.am
+++ /dev/null
@@ -1,33 +0,0 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8-I$(top_srcdir)/src/lib/cserve2 \
9-I$(top_srcdir)/src/bin \
10@EVAS_GENERAL_CFLAGS@ \
11@evas_image_loader_pmaps_cflags@ \
12@EVIL_CFLAGS@
13
14if BUILD_LOADER_PMAPS
15#if !EVAS_STATIC_BUILD_PMAPS
16
17pkgdir = $(libdir)/evas/cserve2/loaders/pmaps/$(MODULE_ARCH)
18pkg_LTLIBRARIES = module.la
19
20module_la_SOURCES = evas_image_load_pmaps.c
21
22module_la_LIBADD = @evas_image_loader_pmaps_libs@ @EVAS_GENERAL_LIBS@ @EVIL_LIBS@
23module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
24module_la_LIBTOOLFLAGS = --tag=disable-static
25
26#else
27
28#noinst_LTLIBRARIES = libevas_loader_pmaps.la
29#libevas_loader_pmaps_la_SOURCES = evas_image_load_pmaps.c
30#libevas_loader_pmaps_la_LIBADD = @evas_image_loader_pmaps_libs@
31
32#endif
33endif
diff --git a/legacy/evas/src/bin/loaders/png/Makefile.am b/legacy/evas/src/bin/loaders/png/Makefile.am
deleted file mode 100644
index 554f44d1c7..0000000000
--- a/legacy/evas/src/bin/loaders/png/Makefile.am
+++ /dev/null
@@ -1,33 +0,0 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8-I$(top_srcdir)/src/lib/cserve2 \
9-I$(top_srcdir)/src/bin \
10@EVAS_GENERAL_CFLAGS@ \
11@evas_image_loader_png_cflags@ \
12@EVIL_CFLAGS@
13
14if BUILD_LOADER_PNG
15#if !EVAS_STATIC_BUILD_PNG
16
17pkgdir = $(libdir)/evas/cserve2/loaders/png/$(MODULE_ARCH)
18pkg_LTLIBRARIES = module.la
19
20module_la_SOURCES = evas_image_load_png.c
21
22module_la_LIBADD = @EVAS_GENERAL_LIBS@ @evas_image_loader_png_libs@ @EVIL_LIBS@
23module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
24module_la_LIBTOOLFLAGS = --tag=disable-static
25
26#else
27
28#noinst_LTLIBRARIES = libevas_loader_png.la
29#libevas_loader_png_la_SOURCES = evas_image_load_png.c
30#libevas_loader_png_la_LIBADD = @evas_image_loader_png_libs@
31
32#endif
33endif
diff --git a/legacy/evas/src/bin/loaders/psd/Makefile.am b/legacy/evas/src/bin/loaders/psd/Makefile.am
deleted file mode 100644
index 2b09650852..0000000000
--- a/legacy/evas/src/bin/loaders/psd/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8-I$(top_srcdir)/src/lib/cserve2 \
9-I$(top_srcdir)/src/bin \
10@EVAS_GENERAL_CFLAGS@ \
11@EVIL_CFLAGS@
12
13if BUILD_LOADER_PSD
14#if !EVAS_STATIC_BUILD_PSD
15
16pkgdir = $(libdir)/evas/cserve2/loaders/psd/$(MODULE_ARCH)
17pkg_LTLIBRARIES = module.la
18
19module_la_SOURCES = evas_image_load_psd.c
20
21module_la_LIBADD = @EVAS_GENERAL_LIBS@ @EVIL_LIBS@
22module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
23module_la_LIBTOOLFLAGS = --tag=disable-static
24
25#else
26
27#noinst_LTLIBRARIES = libevas_loader_psd.la
28#libevas_loader_psd_la_SOURCES = evas_image_load_psd.c
29#libevas_loader_psd_la_LIBADD =
30
31#endif
32endif
diff --git a/legacy/evas/src/bin/loaders/tga/Makefile.am b/legacy/evas/src/bin/loaders/tga/Makefile.am
deleted file mode 100644
index b861412628..0000000000
--- a/legacy/evas/src/bin/loaders/tga/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8-I$(top_srcdir)/src/lib/cserve2 \
9-I$(top_srcdir)/src/bin \
10@EVAS_GENERAL_CFLAGS@ \
11@EVIL_CFLAGS@
12
13if BUILD_LOADER_TGA
14#if !EVAS_STATIC_BUILD_TGA
15
16pkgdir = $(libdir)/evas/cserve2/loaders/tga/$(MODULE_ARCH)
17pkg_LTLIBRARIES = module.la
18
19module_la_SOURCES = evas_image_load_tga.c
20
21module_la_LIBADD = @EVAS_GENERAL_LIBS@ @EVIL_LIBS@
22module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
23module_la_LIBTOOLFLAGS = --tag=disable-static
24
25#else
26
27#noinst_LTLIBRARIES = libevas_loader_tga.la
28#libevas_loader_tga_la_SOURCES = evas_image_load_tga.c
29#libevas_loader_tga_la_LIBADD =
30
31#endif
32endif
diff --git a/legacy/evas/src/bin/loaders/tiff/Makefile.am b/legacy/evas/src/bin/loaders/tiff/Makefile.am
deleted file mode 100644
index 8c33b61b9b..0000000000
--- a/legacy/evas/src/bin/loaders/tiff/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8-I$(top_srcdir)/src/lib/cserve2 \
9-I$(top_srcdir)/src/bin \
10@EVAS_GENERAL_CFLAGS@ \
11@evas_image_loader_tiff_cflags@ \
12@EVIL_CFLAGS@
13
14if BUILD_LOADER_TIFF
15#if !EVAS_STATIC_BUILD_TIFF
16
17pkgdir = $(libdir)/evas/cserve2/loaders/tiff/$(MODULE_ARCH)
18pkg_LTLIBRARIES = module.la
19
20module_la_SOURCES = evas_image_load_tiff.c
21
22module_la_LIBADD = @EVAS_GENERAL_LIBS@ @EVIL_LIBS@ @evas_image_loader_tiff_libs@
23module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
24module_la_LIBTOOLFLAGS = --tag=disable-static
25
26#else
27
28#noinst_LTLIBRARIES = libevas_loader_tiff.la
29
30#libevas_loader_tiff_la_SOURCES = evas_image_load_tiff.c
31#libevas_loader_tiff_la_LIBADD = @evas_image_loader_tiff_libs@
32
33#endif
34endif
diff --git a/legacy/evas/src/bin/loaders/wbmp/Makefile.am b/legacy/evas/src/bin/loaders/wbmp/Makefile.am
deleted file mode 100644
index bed8c29ce6..0000000000
--- a/legacy/evas/src/bin/loaders/wbmp/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8-I$(top_srcdir)/src/lib/cserve2 \
9-I$(top_srcdir)/src/bin \
10@EVAS_GENERAL_CFLAGS@ \
11@EVIL_CFLAGS@
12
13if BUILD_LOADER_WBMP
14#if !EVAS_STATIC_BUILD_WBMP
15
16pkgdir = $(libdir)/evas/cserve2/loaders/wbmp/$(MODULE_ARCH)
17pkg_LTLIBRARIES = module.la
18
19module_la_SOURCES = evas_image_load_wbmp.c
20
21module_la_LIBADD = @EVAS_GENERAL_LIBS@ @EVIL_LIBS@
22module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
23module_la_LIBTOOLFLAGS = --tag=disable-static
24
25#else
26
27#noinst_LTLIBRARIES = libevas_loader_wbmp.la
28#libevas_loader_wbmp_la_SOURCES = evas_image_load_wbmp.c
29#libevas_loader_wbmp_la_LIBADD =
30
31#endif
32endif
diff --git a/legacy/evas/src/bin/loaders/webp/Makefile.am b/legacy/evas/src/bin/loaders/webp/Makefile.am
deleted file mode 100644
index ea6a909b91..0000000000
--- a/legacy/evas/src/bin/loaders/webp/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8-I$(top_srcdir)/src/lib/cserve2 \
9-I$(top_srcdir)/src/bin \
10@EVAS_GENERAL_CFLAGS@ \
11@EINA_CFLAGS@ \
12@evas_image_loader_webp_cflags@ \
13@EVIL_CFLAGS@
14
15if BUILD_LOADER_WEBP
16#if !EVAS_STATIC_BUILD_WEBP
17
18pkgdir = $(libdir)/evas/cserve2/loaders/webp/$(MODULE_ARCH)
19pkg_LTLIBRARIES = module.la
20
21module_la_SOURCES = evas_image_load_webp.c
22
23module_la_LIBADD = @EINA_LIBS@ @evas_image_loader_webp_libs@ @EVIL_LIBS@
24module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
25module_la_LIBTOOLFLAGS = --tag=disable-static
26
27#else
28
29#noinst_LTLIBRARIES = libevas_loader_webp.la
30#libevas_loader_webp_la_SOURCES = evas_image_load_webp.c
31#libevas_loader_webp_la_LIBADD = @evas_image_loader_webp_libs@
32
33#endif
34endif
diff --git a/legacy/evas/src/bin/loaders/xpm/Makefile.am b/legacy/evas/src/bin/loaders/xpm/Makefile.am
deleted file mode 100644
index c8117d8146..0000000000
--- a/legacy/evas/src/bin/loaders/xpm/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8-I$(top_srcdir)/src/lib/cserve2 \
9-I$(top_srcdir)/src/bin \
10@EVAS_GENERAL_CFLAGS@ \
11@evas_image_loader_xpm_cflags@ \
12@EVIL_CFLAGS@
13
14if BUILD_LOADER_XPM
15#if !EVAS_STATIC_BUILD_XPM
16pkgdir = $(libdir)/evas/cserve2/loaders/xpm/$(MODULE_ARCH)
17
18pkg_LTLIBRARIES = module.la
19
20module_la_SOURCES = evas_image_load_xpm.c
21
22module_la_LIBADD = @EVAS_GENERAL_LIBS@ @EVIL_LIBS@ @evas_image_loader_xpm_libs@
23module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
24module_la_LIBTOOLFLAGS = --tag=disable-static
25
26#else
27
28#noinst_LTLIBRARIES = libevas_loader_xpm.la
29
30#libevas_loader_xpm_la_SOURCES = evas_image_load_xpm.c
31#libevas_loader_xpm_la_LIBADD = @evas_image_loader_xpm_libs@
32
33#endif
34endif
diff --git a/legacy/evas/src/examples/Makefile.am b/legacy/evas/src/examples/Makefile.am
deleted file mode 100644
index 276ac9fe65..0000000000
--- a/legacy/evas/src/examples/Makefile.am
+++ /dev/null
@@ -1,160 +0,0 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3examplesdir = $(datadir)/$(PACKAGE)/examples
4
5#put here all EDCs one needs to the tests
6EDCS = aspect.edc
7
8filesdir = $(datadir)/$(PACKAGE)/examples
9files_DATA =
10
11if BUILD_EXAMPLES
12
13AM_CPPFLAGS = \
14-I. \
15-I$(top_srcdir)/src/lib \
16-I$(top_srcdir)/src/lib/include \
17-DPACKAGE_BIN_DIR=\"$(bindir)\" \
18-DPACKAGE_LIB_DIR=\"$(libdir)\" \
19-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
20-DPACKAGE_EXAMPLES_DIR=\"$(datadir)/$(PACKAGE)/examples\" \
21@EVAS_GENERAL_CFLAGS@ \
22@FREETYPE_CFLAGS@ \
23@PIXMAN_CFLAGS@ \
24@FRIBIDI_CFLAGS@ \
25@EET_CFLAGS@ \
26@FONTCONFIG_CFLAGS@ \
27@pthread_cflags@
28
29examples_PROGRAMS =
30
31if BUILD_ENGINE_BUFFER
32AM_CPPFLAGS += -I$(top_srcdir)/src/modules/engines/buffer
33
34examples_PROGRAMS += evas_buffer_simple
35evas_buffer_simple_SOURCES = evas-buffer-simple.c
36evas_buffer_simple_LDADD = $(top_builddir)/src/lib/libevas.la
37endif
38
39examples_PROGRAMS += evas_init_shutdown
40evas_init_shutdown_SOURCES = evas-init-shutdown.c
41evas_init_shutdown_LDADD = $(top_builddir)/src/lib/libevas.la
42
43#the ones using ecore_evas follow
44AM_CPPFLAGS += @ECORE_EVAS_CFLAGS@
45
46examples_PROGRAMS += evas_images
47evas_images_SOURCES = evas-images.c
48evas_images_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@
49
50examples_PROGRAMS += evas_events
51evas_events_SOURCES = evas-events.c
52evas_events_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@
53
54examples_PROGRAMS += evas_object_manipulation
55evas_object_manipulation_SOURCES = evas-object-manipulation.c
56evas_object_manipulation_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@
57
58examples_PROGRAMS += evas_hints
59evas_hints_SOURCES = evas-hints.c
60evas_hints_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@
61
62examples_PROGRAMS += evas_stacking
63evas_stacking_SOURCES = evas-stacking.c
64evas_stacking_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@
65
66examples_PROGRAMS += evas_images2
67evas_images2_SOURCES = evas-images2.c
68evas_images2_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@
69
70examples_PROGRAMS += evas_images3
71evas_images3_SOURCES = evas-images3.c
72evas_images3_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@
73
74examples_PROGRAMS += evas_text
75evas_text_SOURCES = evas-text.c
76evas_text_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@
77
78examples_PROGRAMS += evas_smart_object
79evas_smart_object_SOURCES = evas-smart-object.c
80evas_smart_object_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@
81
82examples_PROGRAMS += evas_smart_interface
83evas_smart_interface_SOURCES = evas-smart-interface.c
84evas_smart_interface_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@
85
86examples_PROGRAMS += evas_box
87evas_box_SOURCES = evas-box.c
88evas_box_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ @EVAS_GENERAL_LIBS@
89
90#the ones using ecore_evas and edje follow
91AM_CPPFLAGS += @EDJE_CFLAGS@
92
93examples_PROGRAMS += evas_aspect_hints
94evas_aspect_hints_DEPS = $(srcdir)/aspect.edc
95evas_aspect_hints_SOURCES = evas-aspect-hints.c
96evas_aspect_hints_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ @EDJE_LIBS@
97
98examples_PROGRAMS += evas_map_utils
99evas_map_utils_SOURCES = evas-map-utils.c
100evas_map_utils_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@
101
102aspect.edj: ${evas_aspect_hints_DEPS}
103
104.edc.edj:
105 $(edje_cc) -v -id $(srcdir) $< $(builddir)/$(@F)
106
107EDJS = $(EDCS:%.edc=%.edj)
108
109files_DATA += $(EDJS)
110
111endif # if BUILD_EXAMPLES
112
113if INSTALL_EXAMPLES
114
115#put here additional data when installing examples
116files_DATA += $(srcdir)/enlightenment.png \
117 $(srcdir)/red.png \
118 $(srcdir)/im1.png \
119 $(srcdir)/cube1.png
120
121files_DATA += \
122 $(EDCS) \
123 $(srcdir)/evas-buffer-simple.c \
124 $(srcdir)/evas-init-shutdown.c \
125 $(srcdir)/evas-images.c \
126 $(srcdir)/evas-images2.c \
127 $(srcdir)/evas-images3.c \
128 $(srcdir)/evas-object-manipulation.c \
129 $(srcdir)/evas-events.c \
130 $(srcdir)/evas-aspect-hints.c \
131 $(srcdir)/evas-hints.c \
132 $(srcdir)/evas-stacking.c \
133 $(srcdir)/evas-map-utils.c \
134 $(srcdir)/evas-text.c \
135 $(srcdir)/evas-smart-object.c \
136 $(srcdir)/evas-smart-interface.c \
137 $(srcdir)/evas-box.c
138endif
139
140EXTRA_DIST = $(EDCS) \
141 $(srcdir)/evas-buffer-simple.c \
142 $(srcdir)/evas-init-shutdown.c \
143 $(srcdir)/evas-images.c \
144 $(srcdir)/evas-images2.c \
145 $(srcdir)/evas-images3.c \
146 $(srcdir)/evas-object-manipulation.c \
147 $(srcdir)/evas-events.c \
148 $(srcdir)/evas-aspect-hints.c \
149 $(srcdir)/evas-hints.c \
150 $(srcdir)/evas-stacking.c \
151 $(srcdir)/evas-map-utils.c \
152 $(srcdir)/evas-text.c \
153 $(srcdir)/evas-smart-object.c \
154 $(srcdir)/evas-smart-interface.c \
155 $(srcdir)/evas-box.c \
156 $(srcdir)/evas-table.c \
157 $(srcdir)/enlightenment.png \
158 $(srcdir)/red.png \
159 $(srcdir)/im1.png \
160 $(srcdir)/cube1.png
diff --git a/legacy/evas/src/examples/aspect.edc b/legacy/evas/src/examples/aspect.edc
deleted file mode 100644
index b8bfb313e0..0000000000
--- a/legacy/evas/src/examples/aspect.edc
+++ /dev/null
@@ -1,17 +0,0 @@
1collections {
2 group {
3 name: "main";
4 parts {
5 part {
6 name: "content";
7 mouse_events: 0;
8 type: SWALLOW;
9 description {
10 state: "default" 0.0;
11 visible: 1;
12 }
13 }
14 }
15 }
16}
17
diff --git a/legacy/evas/src/examples/cube1.png b/legacy/evas/src/examples/cube1.png
deleted file mode 100644
index c2f4fda6b3..0000000000
--- a/legacy/evas/src/examples/cube1.png
+++ /dev/null
Binary files differ
diff --git a/legacy/evas/src/examples/enlightenment.png b/legacy/evas/src/examples/enlightenment.png
deleted file mode 100644
index aeb836bc98..0000000000
--- a/legacy/evas/src/examples/enlightenment.png
+++ /dev/null
Binary files differ
diff --git a/legacy/evas/src/examples/evas-aspect-hints.c b/legacy/evas/src/examples/evas-aspect-hints.c
deleted file mode 100644
index de8ed50178..0000000000
--- a/legacy/evas/src/examples/evas-aspect-hints.c
+++ /dev/null
@@ -1,249 +0,0 @@
1/**
2 * Simple Evas example illustrating aspect control hints on objects.
3 *
4 * You'll need at least one engine built for it (excluding the buffer
5 * one) and the png image loader also built. See stdout/stderr for
6 * output.
7 *
8 * You'll also need @b Edje for this one, as it has the only smart
9 * object implementing aspect control for children.
10 *
11 * @verbatim
12 * gcc -o evas-events evas-events.c `pkg-config --libs --cflags ecore-evas edje`
13 * @endverbatim
14 */
15
16#ifdef HAVE_CONFIG_H
17
18#include "config.h"
19#endif
20
21#include <Ecore.h>
22#include <Ecore_Evas.h>
23#include <Edje.h>
24#include <stdio.h>
25#include <errno.h>
26
27#define WIDTH 320
28#define HEIGHT 480
29
30static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png";
31static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/aspect.edj";
32
33struct test_data
34{
35 Ecore_Evas *ee;
36 Evas *canvas;
37 Evas_Object *bg, *rect, *container, *border;
38};
39
40static struct test_data d = {0};
41
42/* here just to keep our example's window size and background image's
43 * size in synchrony */
44static void
45_canvas_resize_cb(Ecore_Evas *ee)
46{
47 int w, h;
48
49 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
50 evas_object_resize(d.bg, w, h);
51}
52
53static const char *
54_get_aspect_name(Evas_Aspect_Control aspect)
55{
56 switch (aspect)
57 {
58 case 0:
59 return "NONE";
60
61 case 1:
62 return "NEITHER";
63
64 case 2:
65 return "HORIZONTAL";
66
67 case 3:
68 return "VERTICAL";
69
70 case 4:
71 return "BOTH";
72
73 default:
74 return "INVALID";
75 }
76}
77
78static void
79_on_keydown(void *data __UNUSED__,
80 Evas *evas __UNUSED__,
81 Evas_Object *o,
82 void *einfo)
83{
84 const Evas_Modifier *mods;
85 Evas_Event_Key_Down *ev = einfo;
86
87 mods = evas_key_modifier_get(evas_object_evas_get(o));
88
89 if (evas_key_modifier_is_set(mods, "Shift") &&
90 strcmp(ev->keyname, "h") == 0) /* print help */
91 {
92 fprintf(stdout, "commands are:\n"
93 "\tc - cycle aspect control on object\n"
94 "\th - change horizontal aspect component\n"
95 "\tv - change vertical aspect component\n"
96 "\ts - print current object's status\n"
97 "\tH - print help\n");
98 return;
99 }
100
101 if (strcmp(ev->keyname, "s") == 0) /* get aspect status of the obj */
102 {
103 Evas_Coord w, h;
104 Evas_Aspect_Control aspect;
105
106 evas_object_size_hint_aspect_get(d.rect, &aspect, &w, &h);
107
108 fprintf(stdout, "Object has aspect %s, with horizontal compontent %d"
109 " and vertical compontent %d\n",
110 _get_aspect_name(aspect), w, h);
111
112 return;
113 }
114
115 if (strcmp(ev->keyname, "c") == 0) /* cycle aspect control on obj */
116 {
117 Evas_Coord w, h;
118 Evas_Aspect_Control aspect;
119
120 evas_object_size_hint_aspect_get(d.rect, &aspect, &w, &h);
121
122 aspect = (aspect + 1) % 5;
123
124 evas_object_size_hint_aspect_set(d.rect, aspect, w, h);
125
126 fprintf(stdout, "Changing aspect control to %s\n",
127 _get_aspect_name(aspect));
128
129 return;
130 }
131
132 if (strcmp(ev->keyname, "h") == 0) /* change horizontal aspect component */
133 {
134 Evas_Coord w, h;
135 Evas_Aspect_Control aspect;
136
137 evas_object_size_hint_aspect_get(d.rect, &aspect, &w, &h);
138
139 w = (w + 1) % 3;
140
141 evas_object_size_hint_aspect_set(d.rect, aspect, w, h);
142
143 fprintf(stdout, "Changing horizontal aspect component to %d\n", w);
144
145 return;
146 }
147
148 if (strcmp(ev->keyname, "v") == 0) /* change vertical aspect component */
149 {
150 Evas_Coord w, h;
151 Evas_Aspect_Control aspect;
152
153 evas_object_size_hint_aspect_get(d.rect, &aspect, &w, &h);
154
155 h = (h + 1) % 3;
156
157 evas_object_size_hint_aspect_set(d.rect, aspect, w, h);
158
159 fprintf(stdout, "Changing vertical aspect component to %d\n", h);
160
161 return;
162 }
163}
164
165int
166main(void)
167{
168 Eina_Bool ret;
169
170 if (!ecore_evas_init())
171 return EXIT_FAILURE;
172
173 if (!edje_init())
174 return EXIT_FAILURE;
175
176 /* this will give you a window with an Evas canvas under the first
177 * engine available */
178 d.ee = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL);
179 if (!d.ee)
180 goto error;
181
182 ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb);
183 ecore_evas_show(d.ee);
184
185 /* the canvas pointer, de facto */
186 d.canvas = ecore_evas_get(d.ee);
187
188 d.bg = evas_object_rectangle_add(d.canvas);
189 evas_object_color_set(d.bg, 255, 255, 255, 255); /* white bg */
190 evas_object_move(d.bg, 0, 0); /* at canvas' origin */
191 evas_object_resize(d.bg, WIDTH, HEIGHT); /* covers full canvas */
192 evas_object_show(d.bg);
193
194 evas_object_focus_set(d.bg, EINA_TRUE);
195 evas_object_event_callback_add(
196 d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL);
197
198 d.container = edje_object_add(d.canvas);
199 ret = edje_object_file_set(d.container, edje_file_path, "main");
200 if (!ret)
201 {
202 Edje_Load_Error err = edje_object_load_error_get(d.container);
203 const char *msg = edje_load_error_str(err);
204 fprintf(stderr, "could not load 'main' from %s: %s",
205 edje_file_path, msg);
206
207 goto panic;
208 }
209
210 evas_object_move(d.container, (WIDTH / 4), (HEIGHT / 4));
211 evas_object_resize(d.container, (WIDTH / 2), (HEIGHT / 2));
212 evas_object_show(d.container);
213
214 d.rect = evas_object_rectangle_add(d.canvas);
215 evas_object_color_set(d.rect, 0, 0, 255, 255);
216 evas_object_size_hint_aspect_set(d.rect, EVAS_ASPECT_CONTROL_NONE, 1, 1);
217 evas_object_show(d.rect);
218
219 edje_object_part_swallow(d.container, "content", d.rect);
220 evas_object_smart_changed(d.container);
221
222 /* this is a border around the edje object, container of the
223 * rectangle we are going to experiment with (change its aspect
224 * hints). this way you can see how their sizes relate */
225 d.border = evas_object_image_filled_add(d.canvas);
226 evas_object_image_file_set(d.border, border_img_path, NULL);
227 evas_object_image_border_set(d.border, 3, 3, 3, 3);
228 evas_object_image_border_center_fill_set(d.border, EVAS_BORDER_FILL_NONE);
229 evas_object_move(d.border, (WIDTH / 4) - 3, (HEIGHT / 4) - 3);
230 evas_object_resize(d.border, (WIDTH / 2) + 6, (HEIGHT / 2) + 6);
231 evas_object_show(d.border);
232
233 ecore_main_loop_begin();
234
235 ecore_evas_free(d.ee);
236 ecore_evas_shutdown();
237 edje_shutdown();
238 return 0;
239
240error:
241 fprintf(stderr, "you got to have at least one evas engine built and linked"
242 " up to ecore-evas for this example to run properly.\n");
243panic:
244 ecore_evas_free(d.ee);
245 ecore_evas_shutdown();
246 edje_shutdown();
247
248 return -1;
249}
diff --git a/legacy/evas/src/examples/evas-box.c b/legacy/evas/src/examples/evas-box.c
deleted file mode 100644
index ec795355fc..0000000000
--- a/legacy/evas/src/examples/evas-box.c
+++ /dev/null
@@ -1,382 +0,0 @@
1/**
2 * Simple Evas example illustrating a custom Evas box object
3 *
4 * You'll need at least one engine built for it (excluding the buffer
5 * one). See stdout/stderr for output.
6 *
7 * @verbatim
8 * gcc -o evas-box evas-box.c `pkg-config --libs --cflags evas ecore ecore-evas eina`
9 * @endverbatim
10 */
11
12#ifdef HAVE_CONFIG_H
13
14#include "config.h"
15#else
16#define PACKAGE_EXAMPLES_DIR "."
17#define __UNUSED__
18#endif
19
20#include <Ecore.h>
21#include <Ecore_Evas.h>
22
23#include <stdlib.h>
24#include <stdio.h>
25#include <string.h>
26
27#define WIDTH (640)
28#define HEIGHT (480)
29
30static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png";
31
32static const char *commands = \
33 "commands are:\n"
34 "\ta - change the box's alignment values\n"
35 "\tp - change the box's padding values\n"
36 "\t1 - change the box's layout to horizontal\n"
37 "\t2 - change the box's layout to vertical\n"
38 "\t3 - change the box's layout to horizontal homogeneous\n"
39 "\t4 - change the box's layout to vertical homogeneous\n"
40 "\t5 - change the box's layout to horizontal maximum size homogeneous\n"
41 "\t6 - change the box's layout to vertical maximum size homogeneous\n"
42 "\t7 - change the box's layout to horizontal flow\n"
43 "\t8 - change the box's layout to vertical flow\n"
44 "\t9 - change the box's layout to stack\n"
45 "\t0 - change the box's layout to a custom-made one\n"
46 "\tCtrl + NUMBER - insert a new child object at that position in the box\n"
47 "\tShift + NUMBER - remove the child object at that position in the box\n"
48 "\th - print help\n";
49
50struct exemple_data
51{
52 Ecore_Evas *ee;
53 Evas *evas;
54 Evas_Object *bg, *box, *border;
55};
56
57static struct exemple_data d;
58
59static void /* custom 'diagonal' layout */
60_custom_layout(Evas_Object *o,
61 Evas_Object_Box_Data *p,
62 void *data __UNUSED__)
63{
64 int x, y, w, h;
65 int xx, yy, ww, hh;
66 int count;
67 Eina_List *l;
68 Evas_Object_Box_Option *opt;
69
70 evas_object_geometry_get(o, &x, &y, &w, &h);
71 count = eina_list_count(p->children);
72 ww = w / (count ? : 1);
73 hh = h / (count ? : 1);
74 if (ww < 1) ww = 1;
75 if (hh < 1) hh = 1;
76
77 xx = x;
78 yy = y;
79 EINA_LIST_FOREACH(p->children, l, opt)
80 {
81 evas_object_move(opt->obj, xx, yy);
82 xx += ww;
83 yy += hh;
84 }
85}
86
87static Evas_Object * /* new rectangle to be put in the box */
88_new_rectangle_add(Evas *e)
89{
90 Evas_Object *o;
91
92 o = evas_object_rectangle_add(e);
93 evas_object_resize(o, 10, 10);
94 evas_object_color_set(o, 0, 255, 0, 255);
95 evas_object_show(o);
96
97 return o;
98}
99
100/* use the following commands to interact with this example - 'h' is
101 * the key for help */
102static void
103_on_keydown(void *data __UNUSED__,
104 Evas *evas __UNUSED__,
105 Evas_Object *o __UNUSED__,
106 void *einfo)
107{
108 Evas_Event_Key_Down *ev = einfo;
109 const Evas_Modifier *mods = evas_key_modifier_get(evas);
110
111 if (strcmp(ev->keyname, "h") == 0) /* print help */
112 {
113 fprintf(stdout, commands);
114 return;
115 }
116
117 if (evas_key_modifier_is_set(mods, "Shift"))
118 {
119 int pos;
120 Eina_Bool ret;
121 Evas_Object *obj;
122 Eina_List *children;
123
124 pos = atoi(ev->keyname);
125 children = evas_object_box_children_get(d.box);
126
127 obj = eina_list_nth(children, pos);
128 if (!obj) goto list_free;
129
130 ret = evas_object_box_remove_at(d.box, pos);
131 if (ret) evas_object_del(obj);
132
133list_free:
134 eina_list_free(children);
135 return;
136 }
137
138 if (evas_key_modifier_is_set(mods, "Control"))
139 {
140 Evas_Object *o;
141 int pos;
142 pos = atoi(ev->keyname);
143 o = _new_rectangle_add(d.evas);
144 if (!evas_object_box_insert_at(d.box, o, pos))
145 evas_object_box_append(d.box, o);
146 return;
147 }
148
149 if (strcmp(ev->keyname, "a") == 0)
150 {
151 double h, v;
152
153 evas_object_box_align_get(d.box, &h, &v);
154
155 if (h == 0.5)
156 h = v = 1.0;
157 else if (h == 1.0)
158 h = v = -1.0;
159 else if (h == -1.0)
160 h = v = 0.0;
161 else if (h == 0.0)
162 h = v = 0.5;
163
164 evas_object_box_align_set(d.box, h, v);
165
166 fprintf(stdout, "Applying new alignment values (%.1f, %.1f)"
167 " on the box\n", h, v);
168 return;
169 }
170
171 if (strcmp(ev->keyname, "p") == 0)
172 {
173 int h, v;
174
175 evas_object_box_padding_get(d.box, &h, &v);
176
177 if (h == 0)
178 h = v = 50;
179 else
180 h = v = 0;
181
182 evas_object_box_padding_set(d.box, h, v);
183
184 fprintf(stdout, "Applying new padding values (%d, %d)"
185 " on the box\n", h, v);
186 return;
187 }
188
189 if (strcmp(ev->keyname, "1") == 0)
190 {
191 evas_object_box_layout_set(
192 d.box, evas_object_box_layout_horizontal, NULL, NULL);
193
194 fprintf(stdout, "Applying '%s' layout on the box\n", "horizontal");
195 return;
196 }
197
198 if (strcmp(ev->keyname, "2") == 0)
199 {
200 evas_object_box_layout_set(
201 d.box, evas_object_box_layout_vertical, NULL, NULL);
202
203 fprintf(stdout, "Applying '%s' layout on the box\n", "vertical");
204 return;
205 }
206
207 if (strcmp(ev->keyname, "3") == 0)
208 {
209 evas_object_box_layout_set(
210 d.box, evas_object_box_layout_homogeneous_horizontal, NULL,
211 NULL);
212
213 fprintf(stdout, "Applying '%s' layout on the box\n",
214 "horizontal homogeneous");
215 return;
216 }
217
218 if (strcmp(ev->keyname, "4") == 0)
219 {
220 evas_object_box_layout_set(
221 d.box, evas_object_box_layout_homogeneous_vertical, NULL, NULL);
222
223 fprintf(stdout, "Applying '%s' layout on the box\n",
224 "vertical homogeneous");
225 return;
226 }
227
228 if (strcmp(ev->keyname, "5") == 0)
229 {
230 evas_object_box_layout_set(
231 d.box, evas_object_box_layout_homogeneous_max_size_horizontal,
232 NULL, NULL);
233
234 fprintf(stdout, "Applying '%s' layout on the box\n",
235 "horizontal maximum size homogeneous");
236 return;
237 }
238
239 if (strcmp(ev->keyname, "6") == 0)
240 {
241 evas_object_box_layout_set(
242 d.box, evas_object_box_layout_homogeneous_max_size_vertical,
243 NULL, NULL);
244
245 fprintf(stdout, "Applying '%s' layout on the box\n",
246 "vertical maximum size homogeneous");
247 return;
248 }
249
250 if (strcmp(ev->keyname, "7") == 0)
251 {
252 evas_object_box_layout_set(
253 d.box, evas_object_box_layout_flow_horizontal, NULL, NULL);
254
255 fprintf(stdout, "Applying '%s' layout on the box\n", "horizontal flow");
256 return;
257 }
258
259 if (strcmp(ev->keyname, "8") == 0)
260 {
261 evas_object_box_layout_set(
262 d.box, evas_object_box_layout_flow_vertical, NULL, NULL);
263
264 fprintf(stdout, "Applying '%s' layout on the box\n", "vertical flow");
265 return;
266 }
267
268 if (strcmp(ev->keyname, "9") == 0)
269 {
270 evas_object_box_layout_set(
271 d.box, evas_object_box_layout_stack, NULL, NULL);
272
273 fprintf(stdout, "Applying '%s' layout on the box\n", "stack");
274 return;
275 }
276
277 if (strcmp(ev->keyname, "0") == 0)
278 {
279 evas_object_box_layout_set(d.box, _custom_layout, NULL, NULL);
280
281 fprintf(stdout, "Applying '%s' layout on the box\n", "CUSTOM");
282 return;
283 }
284}
285
286static void
287_on_delete(Ecore_Evas *ee __UNUSED__)
288{
289 ecore_main_loop_quit();
290}
291
292static void /* adjust canvas' contents on resizes */
293_canvas_resize_cb(Ecore_Evas *ee)
294{
295 int w, h;
296
297 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
298
299 evas_object_resize(d.bg, w, h);
300
301 evas_object_move(d.box, (w / 4), (h / 4));
302 evas_object_resize(d.box, (w / 2), (h / 2));
303
304 evas_object_move(d.border, (w / 4) - 2, (h / 4) - 2);
305 evas_object_resize(d.border, (w / 2) + 4, (h / 2) + 4);
306}
307
308int
309main(void)
310{
311 Evas_Object *last, *o;
312 int i;
313
314 srand(time(NULL));
315
316 if (!ecore_evas_init())
317 return EXIT_FAILURE;
318
319 /* this will give you a window with an Evas canvas under the first
320 * engine available */
321 d.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
322 if (!d.ee)
323 goto panic;
324
325 ecore_evas_callback_delete_request_set(d.ee, _on_delete);
326 ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb);
327 ecore_evas_show(d.ee);
328
329 d.evas = ecore_evas_get(d.ee);
330
331 d.bg = evas_object_rectangle_add(d.evas);
332 evas_object_color_set(d.bg, 255, 255, 255, 255); /* white bg */
333 evas_object_show(d.bg);
334
335 evas_object_focus_set(d.bg, EINA_TRUE);
336 evas_object_event_callback_add(
337 d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL);
338
339 d.box = evas_object_box_add(d.evas);
340 evas_object_show(d.box);
341
342 for (i = 1; i <= 5; i++)
343 {
344 o = last = evas_object_rectangle_add(d.evas);
345 evas_object_size_hint_min_set(o, 50, 50);
346 evas_object_color_set(
347 o, rand() % 256, rand() % 256, rand() % 256, 255);
348 evas_object_show(o);
349
350 if (!evas_object_box_append(d.box, o))
351 {
352 fprintf(stderr, "Error appending child object on the box!\n");
353 goto error;
354 }
355 }
356
357 /* this is a border around the box, container of the rectangles we
358 * are going to experiment with. this way you can see how the
359 * container relates to the children */
360 d.border = evas_object_image_filled_add(d.evas);
361 evas_object_image_file_set(d.border, border_img_path, NULL);
362 evas_object_image_border_set(d.border, 2, 2, 2, 2);
363 evas_object_image_border_center_fill_set(d.border, EVAS_BORDER_FILL_NONE);
364 evas_object_show(d.border);
365
366 fprintf(stdout, commands);
367
368 _canvas_resize_cb(d.ee);
369 ecore_main_loop_begin();
370 ecore_evas_shutdown();
371 return 0;
372
373error:
374 ecore_evas_shutdown();
375 return -1;
376
377panic:
378 fprintf(stderr, "You got to have at least one evas engine built and linked"
379 " up to ecore-evas for this example to run properly.\n");
380 return -2;
381}
382
diff --git a/legacy/evas/src/examples/evas-buffer-simple.c b/legacy/evas/src/examples/evas-buffer-simple.c
deleted file mode 100644
index 6676ef10b0..0000000000
--- a/legacy/evas/src/examples/evas-buffer-simple.c
+++ /dev/null
@@ -1,228 +0,0 @@
1/**
2 * Simple Evas example using the Buffer engine.
3 *
4 * You must have Evas compiled with the buffer engine, and have the
5 * evas-software-buffer pkg-config files installed.
6 *
7 * Compile with:
8 *
9 * @verbatim
10 * gcc -o evas-buffer-simple evas-buffer-simple.c `pkg-config --libs --cflags evas evas-software-buffer`
11 * @endverbatim
12 *
13 */
14#include <Evas.h>
15#include <Evas_Engine_Buffer.h>
16#include <stdio.h>
17#include <errno.h>
18
19#define WIDTH (320)
20#define HEIGHT (240)
21
22/*
23 * create_canvas(), destroy_canvas() and draw_scene() are support functions.
24 *
25 * They are only required to use raw Evas, but for real world usage,
26 * it is recommended to use ecore and its ecore-evas submodule, that
27 * provide convenience canvas creators, integration with main loop and
28 * automatic render of updates (draw_scene()) when system goes back to
29 * main loop.
30 */
31static Evas *create_canvas(int width, int height);
32static void destroy_canvas(Evas *canvas);
33static void draw_scene(Evas *canvas);
34
35// support function to save scene as PPM image
36static void save_scene(Evas *canvas, const char *dest);
37
38int main(void)
39{
40 Evas *canvas;
41 Evas_Object *bg, *r1, *r2, *r3;
42
43 evas_init();
44
45 // create your canvas
46 // NOTE: consider using ecore_evas_buffer_new() instead!
47 canvas = create_canvas(WIDTH, HEIGHT);
48 if (!canvas)
49 return -1;
50
51 bg = evas_object_rectangle_add(canvas);
52 evas_object_color_set(bg, 255, 255, 255, 255); // white bg
53 evas_object_move(bg, 0, 0); // at origin
54 evas_object_resize(bg, WIDTH, HEIGHT); // covers full canvas
55 evas_object_show(bg);
56
57 puts("initial scene, with just background:");
58 draw_scene(canvas);
59
60 r1 = evas_object_rectangle_add(canvas);
61 evas_object_color_set(r1, 255, 0, 0, 255); // 100% opaque red
62 evas_object_move(r1, 10, 10);
63 evas_object_resize(r1, 100, 100);
64 evas_object_show(r1);
65
66 // pay attention to transparency! Evas color values are pre-multiplied by
67 // alpha, so 50% opaque green is:
68 // non-premul: r=0, g=255, b=0 a=128 (50% alpha)
69 // premul:
70 // r_premul = r * a / 255 = 0 * 128 / 255 = 0
71 // g_premul = g * a / 255 = 255 * 128 / 255 = 128
72 // b_premul = b * a / 255 = 0 * 128 / 255 = 0
73 //
74 // this 50% green is over a red background, so it will show in the
75 // final output as yellow (green + red = yellow)
76 r2 = evas_object_rectangle_add(canvas);
77 evas_object_color_set(r2, 0, 128, 0, 128); // 50% opaque green
78 evas_object_move(r2, 10, 10);
79 evas_object_resize(r2, 50, 50);
80 evas_object_show(r2);
81
82 r3 = evas_object_rectangle_add(canvas);
83 evas_object_color_set(r3, 0, 128, 0, 255); // 100% opaque dark green
84 evas_object_move(r3, 60, 60);
85 evas_object_resize(r3, 50, 50);
86 evas_object_show(r3);
87
88 puts("final scene (note updates):");
89 draw_scene(canvas);
90 save_scene(canvas, "/tmp/evas-buffer-simple-render.ppm");
91
92 // NOTE: use ecore_evas_buffer_new() and here ecore_evas_free()
93 destroy_canvas(canvas);
94
95 evas_shutdown();
96
97 return 0;
98}
99
100static Evas *create_canvas(int width, int height)
101{
102 Evas *canvas;
103 Evas_Engine_Info_Buffer *einfo;
104 int method;
105 void *pixels;
106
107 method = evas_render_method_lookup("buffer");
108 if (method <= 0)
109 {
110 fputs("ERROR: evas was not compiled with 'buffer' engine!\n", stderr);
111 return NULL;
112 }
113
114 canvas = evas_new();
115 if (!canvas)
116 {
117 fputs("ERROR: could not instantiate new evas canvas.\n", stderr);
118 return NULL;
119 }
120
121 evas_output_method_set(canvas, method);
122 evas_output_size_set(canvas, width, height);
123 evas_output_viewport_set(canvas, 0, 0, width, height);
124
125 einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(canvas);
126 if (!einfo)
127 {
128 fputs("ERROR: could not get evas engine info!\n", stderr);
129 evas_free(canvas);
130 return NULL;
131 }
132
133 // ARGB32 is sizeof(int), that is 4 bytes, per pixel
134 pixels = malloc(width * height * sizeof(int));
135 if (!pixels)
136 {
137 fputs("ERROR: could not allocate canvas pixels!\n", stderr);
138 evas_free(canvas);
139 return NULL;
140 }
141
142 einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32;
143 einfo->info.dest_buffer = pixels;
144 einfo->info.dest_buffer_row_bytes = width * sizeof(int);
145 einfo->info.use_color_key = 0;
146 einfo->info.alpha_threshold = 0;
147 einfo->info.func.new_update_region = NULL;
148 einfo->info.func.free_update_region = NULL;
149 evas_engine_info_set(canvas, (Evas_Engine_Info *)einfo);
150
151 return canvas;
152}
153
154static void destroy_canvas(Evas *canvas)
155{
156 Evas_Engine_Info_Buffer *einfo;
157
158 einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(canvas);
159 if (!einfo)
160 {
161 fputs("ERROR: could not get evas engine info!\n", stderr);
162 evas_free(canvas);
163 return;
164 }
165
166 free(einfo->info.dest_buffer);
167 evas_free(canvas);
168}
169
170static void draw_scene(Evas *canvas)
171{
172 Eina_List *updates, *n;
173 Eina_Rectangle *update;
174
175 // render and get the updated rectangles:
176 updates = evas_render_updates(canvas);
177
178 // informative only here, just print the updated areas:
179 EINA_LIST_FOREACH(updates, n, update)
180 printf("UPDATED REGION: pos: %3d, %3d size: %3dx%3d\n",
181 update->x, update->y, update->w, update->h);
182
183 // free list of updates
184 evas_render_updates_free(updates);
185}
186
187static void save_scene(Evas *canvas, const char *dest)
188{
189 Evas_Engine_Info_Buffer *einfo;
190 const unsigned int *pixels, *pixels_end;
191 int width, height;
192 FILE *f;
193
194 einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(canvas);
195 if (!einfo)
196 {
197 fputs("ERROR: could not get evas engine info!\n", stderr);
198 return;
199 }
200 evas_output_size_get(canvas, &width, &height);
201
202 f = fopen(dest, "wb+");
203 if (!f)
204 {
205 fprintf(stderr, "ERROR: could not open for writing '%s': %s\n",
206 dest, strerror(errno));
207 return;
208 }
209
210 pixels = einfo->info.dest_buffer;
211 pixels_end = pixels + (width * height);
212
213 // PPM P6 format is dead simple to write:
214 fprintf(f, "P6\n%d %d\n255\n", width, height);
215 for (; pixels < pixels_end; pixels++)
216 {
217 int r, g, b;
218
219 r = ((*pixels) & 0xff0000) >> 16;
220 g = ((*pixels) & 0x00ff00) >> 8;
221 b = (*pixels) & 0x0000ff;
222
223 fprintf(f, "%c%c%c", r, g, b);
224 }
225
226 fclose(f);
227 printf("saved scene as '%s'\n", dest);
228}
diff --git a/legacy/evas/src/examples/evas-events.c b/legacy/evas/src/examples/evas-events.c
deleted file mode 100644
index 28b22ed7e5..0000000000
--- a/legacy/evas/src/examples/evas-events.c
+++ /dev/null
@@ -1,413 +0,0 @@
1/**
2 * Simple Evas example illustrating how to interact with canvas' (and
3 * its objects') events and other canvas operations.
4 *
5 * You'll need at least one engine built for it (excluding the buffer
6 * one) and the png image loader also built. See stdout/stderr for
7 * output.
8 *
9 * @verbatim
10 * gcc -o evas-events evas-events.c `pkg-config --libs --cflags evas ecore ecore-evas`
11 * @endverbatim
12 */
13
14#ifdef HAVE_CONFIG_H
15
16#include "config.h"
17#else
18
19#define PACKAGE_EXAMPLES_DIR "."
20#define __UNUSED__
21
22#endif
23
24#include <Ecore.h>
25#include <Ecore_Evas.h>
26#include <stdio.h>
27#include <errno.h>
28
29#define WIDTH (320)
30#define HEIGHT (240)
31
32static const char *img_path = PACKAGE_EXAMPLES_DIR "/enlightenment.png";
33
34static const char *commands = \
35 "commands are:\n"
36 "\ta - toggle animation timer\n"
37 "\tc - cycle between focus and key grabs for key input\n"
38 "\td - delete canvas callbacks\n"
39 "\tf - freeze input for 3 seconds\n"
40 "\tp - toggle precise point collision detection on image\n"
41 "\tControl + o - add an obscured rectangle\n"
42 "\th - print help\n";
43
44struct test_data
45{
46 Ecore_Evas *ee;
47 Evas *canvas;
48 Evas_Object *img, *bg;
49 Ecore_Timer *resize_timer, *freeze_timer;
50 Eina_Bool obscured, focus;
51};
52
53static struct test_data d = {0};
54
55/* here to keep our example's window size and background image's
56 * size in synchrony */
57static void
58_canvas_resize_cb(Ecore_Evas *ee)
59{
60 int w, h;
61
62 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
63 evas_object_resize(d.bg, w, h);
64}
65
66/* called when our rectangle gets focus */
67static void
68_object_focus_in_cb(void *data __UNUSED__,
69 Evas *e,
70 void *event_info)
71{
72 fprintf(stdout, "An object got focused: %s\n",
73 evas_object_name_get(event_info));
74
75 fprintf(stdout, "Let's recheck it: %s\n",
76 evas_object_name_get(evas_focus_get(e)));
77
78 fprintf(stdout, "And again: %s\n", evas_object_focus_get(event_info) ?
79 "OK!" : "Oops, something is bad.");
80}
81
82/* render flush callback */
83static void
84_render_flush_cb(void *data __UNUSED__,
85 Evas *e __UNUSED__,
86 void *event_info __UNUSED__)
87{
88 fprintf(stdout, "Canvas is about to flush its rendering pipeline!\n");
89}
90
91/* put some action in the canvas */
92static Eina_Bool
93_resize_cb(void *data __UNUSED__)
94{
95 int w, h, cw, ch;
96
97 evas_object_geometry_get(d.img, NULL, NULL, &w, &h);
98 ecore_evas_geometry_get(d.ee, NULL, NULL, &cw, &ch);
99
100 if (w < cw)
101 evas_object_resize(d.img, cw, ch);
102 else
103 evas_object_resize(d.img, cw / 2, ch / 2);
104
105 return EINA_TRUE; /* re-issue the timer */
106}
107
108/* let's have our events back */
109static Eina_Bool
110_thaw_cb(void *data __UNUSED__)
111{
112 fprintf(stdout, "Canvas was frozen %d times, now thawing.\n",
113 evas_event_freeze_get(d.canvas));
114 evas_event_thaw(d.canvas);
115 return EINA_FALSE; /* do not re-issue the timer */
116}
117
118/* mouse enters the object's area */
119static void
120_on_mouse_in(void *data __UNUSED__,
121 Evas *evas __UNUSED__,
122 Evas_Object *o __UNUSED__,
123 void *einfo __UNUSED__)
124{
125 fprintf(stdout, "Enlightenment logo has had the mouse in.\n");
126}
127
128static void
129_on_mouse_out(void *data __UNUSED__,
130 Evas *evas __UNUSED__,
131 Evas_Object *o __UNUSED__,
132 void *einfo __UNUSED__)
133{
134 fprintf(stdout, "Enlightenment logo has had the mouse out.\n");
135} /* mouse exits the object's area */
136
137/* examine the keys pressed */
138static void
139_on_keydown(void *data __UNUSED__,
140 Evas *evas,
141 Evas_Object *o __UNUSED__,
142 void *einfo)
143{
144 const Evas_Modifier *mods;
145 Evas_Event_Key_Down *ev = einfo;
146
147 fprintf(stdout, "We've got key input: %s\n", ev->keyname);
148 fprintf(stdout, "It actually came from %s\n", d.focus ?
149 "focus" : "key grab");
150
151 if (strcmp(ev->keyname, "h") == 0) /* print help */
152 {
153 fprintf(stdout, commands);
154 return;
155 }
156
157 if (strcmp(ev->keyname, "a") == 0) /* toggle animation timer */
158 {
159 if (d.resize_timer != NULL)
160 {
161 fprintf(stdout, "Stopping animation timer\n");
162 ecore_timer_del(d.resize_timer);
163 d.resize_timer = NULL;
164 }
165 else
166 {
167 fprintf(stdout, "Re-issuing animation timer\n");
168 d.resize_timer = ecore_timer_add(2, _resize_cb, NULL);
169 }
170 return;
171 }
172
173 if (strcmp(ev->keyname, "c") == 0) /* cycle between focus and key
174 * grabs for key input */
175 {
176 Eina_Bool ret;
177 Evas_Modifier_Mask mask =
178 evas_key_modifier_mask_get(d.canvas, "Control");
179
180 fprintf(stdout, "Switching to %s for key input\n", d.focus ?
181 "key grabs" : "focus");
182
183 if (d.focus)
184 {
185 evas_object_focus_set(d.bg, EINA_FALSE);
186 fprintf(stdout, "Focused object is now %s\n",
187 evas_focus_get(d.canvas) ?
188 "still valid! Something went wrong." : "none.");
189
190 ret = evas_object_key_grab(d.bg, "a", 0, 0, EINA_TRUE);
191 if (!ret)
192 {
193 fprintf(stdout, "Something went wrong with key grabs.\n");
194 goto c_end;
195 }
196 ret = evas_object_key_grab(d.bg, "c", 0, 0, EINA_TRUE);
197 if (!ret)
198 {
199 fprintf(stdout, "Something went wrong with key grabs.\n");
200 goto c_end;
201 }
202 ret = evas_object_key_grab(d.bg, "d", 0, 0, EINA_TRUE);
203 if (!ret)
204 {
205 fprintf(stdout, "Something went wrong with key grabs.\n");
206 goto c_end;
207 }
208 ret = evas_object_key_grab(d.bg, "f", 0, 0, EINA_TRUE);
209 if (!ret)
210 {
211 fprintf(stdout, "Something went wrong with key grabs.\n");
212 goto c_end;
213 }
214 ret = evas_object_key_grab(d.bg, "p", 0, 0, EINA_TRUE);
215 if (!ret)
216 {
217 fprintf(stdout, "Something went wrong with key grabs.\n");
218 goto c_end;
219 }
220 ret = evas_object_key_grab(d.bg, "o", mask, 0, EINA_TRUE);
221 if (!ret)
222 {
223 fprintf(stdout, "Something went wrong with key grabs.\n");
224 goto c_end;
225 }
226 ret = evas_object_key_grab(d.bg, "h", 0, 0, EINA_TRUE);
227 if (!ret)
228 {
229 fprintf(stdout, "Something went wrong with key grabs.\n");
230 goto c_end;
231 }
232 }
233 else /* got here by key grabs */
234 {
235 evas_object_key_ungrab(d.bg, "a", 0, 0);
236 evas_object_key_ungrab(d.bg, "c", 0, 0);
237 evas_object_key_ungrab(d.bg, "d", 0, 0);
238 evas_object_key_ungrab(d.bg, "f", 0, 0);
239 evas_object_key_ungrab(d.bg, "p", 0, 0);
240 evas_object_key_ungrab(d.bg, "o", mask, 0);
241 evas_object_key_ungrab(d.bg, "h", 0, 0);
242
243 evas_object_focus_set(d.bg, EINA_TRUE);
244 }
245
246c_end:
247 d.focus = !d.focus;
248
249 return;
250 }
251
252 if (strcmp(ev->keyname, "d") == 0) /* delete canvas' callbacks */
253 {
254 fprintf(stdout, "Deleting canvas event callbacks\n");
255 evas_event_callback_del_full(evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
256 _render_flush_cb, NULL);
257 evas_event_callback_del_full(
258 evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
259 _object_focus_in_cb, NULL);
260 return;
261 }
262
263 if (strcmp(ev->keyname, "f") == 0) /* freeze input for 3 seconds */
264 {
265 fprintf(stdout, "Freezing input for 3 seconds\n");
266 evas_event_freeze(evas);
267 d.freeze_timer = ecore_timer_add(3, _thaw_cb, NULL);
268 return;
269 }
270
271 if (strcmp(ev->keyname, "p") == 0) /* toggle precise point
272 * collision detection */
273 {
274 Eina_Bool precise = evas_object_precise_is_inside_get(d.img);
275
276 fprintf(stdout, "Toggling precise point collision detection %s on"
277 " Enlightenment logo\n", precise ? "off" : "on");
278 evas_object_precise_is_inside_set(d.img, !precise);
279
280 return;
281 }
282
283 mods = evas_key_modifier_get(evas);
284 if (evas_key_modifier_is_set(mods, "Control") &&
285 (strcmp(ev->keyname, "o") == 0)) /* add an obscured
286 * rectangle to the middle
287 * of the canvas */
288 {
289 fprintf(stdout, "Toggling obscured rectangle on canvas\n");
290 if (!d.obscured)
291 {
292 int w, h;
293 evas_output_viewport_get(evas, NULL, NULL, &w, &h);
294 evas_obscured_rectangle_add(evas, w / 4, h / 4, w / 2, h / 2);
295 }
296 else
297 {
298 int w, h;
299 Eina_Rectangle *rect;
300 Eina_List *updates, *l;
301
302 evas_output_viewport_get(evas, NULL, NULL, &w, &h);
303 evas_obscured_clear(evas);
304
305 /* we have to flag a damage region here because
306 * evas_obscured_clear() doesn't change the canvas'
307 * state. we'd have to wait for an animation step, for
308 * example, to get the result, without it */
309 evas_damage_rectangle_add(evas, 0, 0, w, h);
310
311 updates = evas_render_updates(evas);
312
313 EINA_LIST_FOREACH(updates, l, rect)
314 {
315 fprintf(stdout, "Rectangle (%d, %d, %d, %d) on canvas got a"
316 " rendering update.\n", rect->x, rect->y,
317 rect->w,
318 rect->h);
319 }
320 evas_render_updates_free(updates);
321 }
322 d.obscured = !d.obscured;
323 } /* end of obscured region command */
324}
325
326int
327main(void)
328{
329 int err;
330
331 if (!ecore_evas_init())
332 return EXIT_FAILURE;
333
334 /* this will give you a window with an Evas canvas under the first
335 * engine available */
336 d.ee = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL);
337 if (!d.ee)
338 goto error;
339
340 ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb);
341 ecore_evas_show(d.ee);
342
343 /* the canvas pointer, de facto */
344 d.canvas = ecore_evas_get(d.ee);
345
346 evas_event_callback_add(d.canvas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
347 _render_flush_cb, NULL);
348 if (evas_alloc_error() != EVAS_ALLOC_ERROR_NONE)
349 {
350 fprintf(stderr, "ERROR: Callback registering failed! Aborting.\n");
351 goto panic;
352 }
353
354 evas_event_callback_add(d.canvas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
355 _object_focus_in_cb, NULL);
356 if (evas_alloc_error() != EVAS_ALLOC_ERROR_NONE)
357 {
358 fprintf(stderr, "ERROR: Callback registering failed! Aborting.\n");
359 goto panic;
360 } /* two canvas event callbacks */
361
362 d.bg = evas_object_rectangle_add(d.canvas);
363 evas_object_name_set(d.bg, "our dear rectangle");
364 evas_object_color_set(d.bg, 255, 255, 255, 255); /* white bg */
365 evas_object_move(d.bg, 0, 0); /* at canvas' origin */
366 evas_object_resize(d.bg, WIDTH, HEIGHT); /* covers full canvas */
367 evas_object_show(d.bg);
368
369 evas_object_focus_set(d.bg, EINA_TRUE); /* so we get input events */
370 d.focus = EINA_TRUE;
371
372 evas_object_event_callback_add(
373 d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL);
374 if (evas_alloc_error() != EVAS_ALLOC_ERROR_NONE)
375 {
376 fprintf(stderr, "ERROR: Callback registering failed! Aborting.\n");
377 goto panic;
378 }
379
380 d.img = evas_object_image_filled_add(d.canvas);
381 evas_object_image_file_set(d.img, img_path, NULL);
382 err = evas_object_image_load_error_get(d.img);
383 if (err != EVAS_LOAD_ERROR_NONE)
384 {
385 goto panic;
386 }
387 else
388 {
389 evas_object_move(d.img, 0, 0);
390 evas_object_resize(d.img, WIDTH, HEIGHT);
391 evas_object_show(d.img);
392 evas_object_event_callback_add(
393 d.img, EVAS_CALLBACK_MOUSE_IN, _on_mouse_in, NULL);
394 evas_object_event_callback_add(
395 d.img, EVAS_CALLBACK_MOUSE_OUT, _on_mouse_out, NULL);
396 }
397
398 d.resize_timer = ecore_timer_add(2, _resize_cb, NULL);
399
400 fprintf(stdout, commands);
401 ecore_main_loop_begin();
402
403 ecore_evas_free(d.ee);
404 ecore_evas_shutdown();
405 return 0;
406
407error:
408 fprintf(stderr, "you got to have at least one evas engine built and linked"
409 " up to ecore-evas for this example to run properly.\n");
410panic:
411 ecore_evas_shutdown();
412 return -1;
413}
diff --git a/legacy/evas/src/examples/evas-hints.c b/legacy/evas/src/examples/evas-hints.c
deleted file mode 100644
index 78c09ba4ab..0000000000
--- a/legacy/evas/src/examples/evas-hints.c
+++ /dev/null
@@ -1,378 +0,0 @@
1/**
2 * Simple Evas example illustrating <b>alignment, minimum size, maximum
3 * size, padding and weight</b> hints on objects.
4 *
5 * To exemplify those hints, whe use the Evas box object, one of the
6 * managers using size hints to layout its children.
7 *
8 * You'll need at least one engine built for it (excluding the buffer
9 * one) and the png image loader also built. See stdout/stderr for
10 * output.
11 *
12 * @verbatim
13 * gcc -o evas-events evas-events.c `pkg-config --libs --cflags ecore-evas`
14 * @endverbatim
15 */
16
17#ifdef HAVE_CONFIG_H
18#include "config.h"
19#else
20#define __UNUSED__
21#endif
22
23#include <Ecore.h>
24#include <Ecore_Evas.h>
25
26#include <stdlib.h>
27#include <stdio.h>
28#include <string.h>
29
30#define WIDTH 320
31#define HEIGHT 480
32#define PACKAGE_EXAMPLES_DIR "."
33
34static const char commands[] = \
35 "commands are:\n"
36 "\tShift + a - change alignment hints on top rectangle\n"
37 "\tShift + m - change min. size hint on top rectangle\n"
38 "\tShift + n - change max. size hint on top rectangle\n"
39 "\tShift + p - change padding hints on top rectangle\n"
40 "\tShift + w - change weight hints on top rectangle\n\n"
41 "\tControl + a - change alignment hints on bottom rectangle\n"
42 "\tControl + m - change min. size hint on bottom rectangle\n"
43 "\tControl + n - change max. size hint on bottom rectangle\n"
44 "\tControl + p - change padding hints on bottom rectangle\n"
45 "\tControl + w - change weight hints on bottom rectangle\n\n"
46 "\ts - print current hints information\n"
47 "\th - print help\n";
48
49static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png";
50
51struct coord_tuple
52{
53 Evas_Coord w, h;
54};
55
56struct weight_tuple
57{
58 double x, y;
59};
60
61struct padding_tuple
62{
63 Evas_Coord l, r, t, b;
64};
65
66struct rect_data
67{
68 struct coord_tuple *min_ptr;
69 struct coord_tuple min[4];
70
71 struct coord_tuple *max_ptr;
72 struct coord_tuple max[4];
73
74 struct weight_tuple *align_ptr;
75 struct weight_tuple align[3];
76
77 struct weight_tuple *weight_ptr;
78 struct weight_tuple weight[3];
79
80 struct padding_tuple *padding_ptr;
81 struct padding_tuple padding[3];
82};
83
84struct test_data
85{
86 Ecore_Evas *ee;
87 Evas *canvas;
88 struct rect_data t_data, b_data;
89 Evas_Object *bg, *box, *t_rect, *b_rect, *border;
90};
91
92static struct test_data d = {0};
93
94/* here just to keep our example's window size and background image's
95 * size in synchrony */
96static void
97_canvas_resize_cb(Ecore_Evas *ee)
98{
99 int w, h;
100
101 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
102 evas_object_resize(d.bg, w, h);
103
104 evas_object_move(d.box, (w / 4), (h / 4));
105 evas_object_resize(d.box, (w / 2), (h / 2));
106
107 evas_object_move(d.border, (w / 4) - 3, (h / 4) - 3);
108 evas_object_resize(d.border, (w / 2) + 6, (h / 2) + 6);
109}
110
111static void
112_print_rect_stats(Evas_Object *rect)
113{
114 Evas_Coord w, h, l, r, t, b;
115 double x, y;
116
117 evas_object_size_hint_align_get(rect, &x, &y);
118 fprintf(stdout, "\talign hints: h(%f), v(%f)\n", x, y);
119
120 evas_object_size_hint_min_get(rect, &w, &h);
121 fprintf(stdout, "\tmin. size hints: h(%d), v(%d)\n", w, h);
122
123 evas_object_size_hint_max_get(rect, &w, &h);
124 fprintf(stdout, "\tmax. size hints: h(%d), v(%d)\n", w, h);
125
126 evas_object_size_hint_padding_get(rect, &l, &r, &t, &b);
127 fprintf(stdout, "\tpadding hints: l(%d), r(%d), t(%d), b(%d)\n",
128 l, r, t, b);
129
130 evas_object_size_hint_weight_get(rect, &x, &y);
131 fprintf(stdout, "\tweight hints: h(%f), v(%f)\n", x, y);
132}
133
134/* use the following commands to interact with this example - 'h' is
135 * the key for help */
136static void
137_on_keydown(void *data __UNUSED__,
138 Evas *evas __UNUSED__,
139 Evas_Object *o __UNUSED__,
140 void *einfo)
141{
142 Evas_Event_Key_Down *ev = einfo;
143 struct rect_data *r_data = NULL;
144 const Evas_Modifier *mods;
145 Evas_Object *rect = NULL;
146 const char *name = NULL;
147
148 mods = evas_key_modifier_get(evas);
149 if (evas_key_modifier_is_set(mods, "Shift"))
150 {
151 rect = d.t_rect;
152 r_data = &d.t_data;
153 name = "top";
154 }
155 else if (evas_key_modifier_is_set(mods, "Control"))
156 {
157 rect = d.b_rect;
158 r_data = &d.b_data;
159 name = "bottom";
160 }
161 else if (strcmp(ev->keyname, "h") == 0) /* print help */
162 {
163 fprintf(stdout, commands);
164 return;
165 }
166 else if (strcmp(ev->keyname, "s") == 0) /* get aspect status of the
167 * rectangles WRT size
168 * hints */
169 {
170 fprintf(stdout, "Top rectangle:\n");
171 _print_rect_stats(d.t_rect);
172
173 fprintf(stdout, "\nBottom rectangle:\n");
174 _print_rect_stats(d.b_rect);
175
176 return;
177 }
178
179 if (!rect) return;
180
181 if (strcmp(ev->keyname, "a") == 0) /* alignment hints */
182 {
183 (r_data->align_ptr)++;
184
185 if ((unsigned)
186 (((void *)(r_data->align_ptr)) - ((void *)(r_data->align))) >=
187 sizeof(r_data->align))
188 r_data->align_ptr = r_data->align;
189
190 evas_object_size_hint_align_set(
191 rect, r_data->align_ptr->x, r_data->align_ptr->y);
192
193 fprintf(stdout, "Changing align hints for %s rect. to (%f, %f)\n",
194 name, r_data->align_ptr->x, r_data->align_ptr->y);
195 return;
196 }
197
198 if (strcmp(ev->keyname, "m") == 0) /* min. size hints */
199 {
200 (r_data->min_ptr)++;
201
202 if ((unsigned)
203 (((void *)(r_data->min_ptr)) - ((void *)(r_data->min))) >=
204 sizeof(r_data->min))
205 r_data->min_ptr = r_data->min;
206
207 evas_object_size_hint_min_set(
208 rect, r_data->min_ptr->w, r_data->min_ptr->h);
209
210 fprintf(stdout, "Changing min. size hints for %s rect. to (%d, %d)\n",
211 name, r_data->min_ptr->w, r_data->min_ptr->h);
212 return;
213 }
214
215 if (strcmp(ev->keyname, "n") == 0) /* max. size hints */
216 {
217 (r_data->max_ptr)++;
218
219 if ((unsigned)
220 (((void *)(r_data->max_ptr)) - ((void *)(r_data->max))) >=
221 sizeof(r_data->max))
222 r_data->max_ptr = r_data->max;
223
224 evas_object_size_hint_max_set(
225 rect, r_data->max_ptr->w, r_data->max_ptr->h);
226
227 fprintf(stdout, "Changing max. size hints for %s rect. to (%d, %d)\n",
228 name, r_data->max_ptr->w, r_data->max_ptr->h);
229 return;
230 }
231
232 if (strcmp(ev->keyname, "p") == 0) /* padding size hints */
233 {
234 (r_data->padding_ptr)++;
235
236 if ((unsigned)
237 (((void *)(r_data->padding_ptr)) - ((void *)(r_data->padding))) >=
238 sizeof(r_data->padding))
239 r_data->padding_ptr = r_data->padding;
240
241 evas_object_size_hint_padding_set(
242 rect, r_data->padding_ptr->l, r_data->padding_ptr->r,
243 r_data->padding_ptr->t, r_data->padding_ptr->b);
244
245 fprintf(stdout, "Changing padding size hints for %s rect."
246 " to (%d, %d, %d, %d)\n",
247 name, r_data->padding_ptr->l, r_data->padding_ptr->r,
248 r_data->padding_ptr->t, r_data->padding_ptr->b);
249 return;
250 }
251
252 /* experiment with weights here. keep in mind that, for the box
253 * object, only if all the children have non zero weights this hint
254 * will have an effect */
255 if (strcmp(ev->keyname, "w") == 0) /* weight hints */
256 {
257 (r_data->weight_ptr)++;
258
259 if ((unsigned)
260 (((void *)(r_data->weight_ptr)) - ((void *)(r_data->weight))) >=
261 sizeof(r_data->weight))
262 r_data->weight_ptr = r_data->weight;
263
264 evas_object_size_hint_weight_set(
265 rect, r_data->weight_ptr->x, r_data->weight_ptr->y);
266
267 fprintf(stdout, "Changing weight hints for %s rect. to (%f, %f)\n",
268 name, r_data->weight_ptr->x, r_data->weight_ptr->y);
269 return;
270 }
271}
272
273static void
274_on_destroy(Ecore_Evas *ee __UNUSED__)
275{
276 ecore_main_loop_quit();
277}
278
279int
280main(void)
281{
282 if (!ecore_evas_init())
283 return EXIT_FAILURE;
284
285 /* init values one is going to cycle through while running this
286 * example */
287 struct rect_data init_data = \
288 {
289 .min = {{0, 0}, {30, 30}, {100, 70}, {200, 200}},
290 .max = {{0, 0}, {100, 100}, {100, 70}, {300, 300}},
291 .align = {{0.0, 0.0}, {0.5, 0.5}, {1.0, 0.5}},
292 .weight = {{0.0, 0.0}, {3, 6}, {10, 100}},
293 .padding = {{0, 0, 0, 0}, {3, 6, 9, 12}, {10, 20, 0, 30}}
294 };
295
296 d.t_data = init_data;
297
298 d.t_data.min_ptr = d.t_data.min + 1;
299 d.t_data.max_ptr = d.t_data.max + 1;
300 d.t_data.align_ptr = d.t_data.align;
301 d.t_data.weight_ptr = d.t_data.weight;
302 d.t_data.padding_ptr = d.t_data.padding;
303
304 d.b_data = init_data;
305
306 d.b_data.min_ptr = d.b_data.min + 1;
307 d.b_data.max_ptr = d.b_data.max + 1;
308 d.b_data.align_ptr = d.b_data.align;
309 d.b_data.weight_ptr = d.b_data.weight;
310 d.b_data.padding_ptr = d.b_data.padding;
311
312 /* this will give you a window with an Evas canvas under the first
313 * engine available */
314 d.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
315 if (!d.ee)
316 goto error;
317
318 ecore_evas_callback_destroy_set(d.ee, _on_destroy);
319 ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb);
320 ecore_evas_show(d.ee);
321
322 /* the canvas pointer, de facto */
323 d.canvas = ecore_evas_get(d.ee);
324
325 d.bg = evas_object_rectangle_add(d.canvas);
326 evas_object_color_set(d.bg, 255, 255, 255, 255); /* white bg */
327 evas_object_move(d.bg, 0, 0); /* at canvas' origin */
328 evas_object_resize(d.bg, WIDTH, HEIGHT); /* covers full canvas */
329 evas_object_show(d.bg);
330
331 evas_object_focus_set(d.bg, EINA_TRUE);
332 evas_object_event_callback_add(
333 d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL);
334
335 /* Evas box with vertical layout */
336 d.box = evas_object_box_add(d.canvas);
337 evas_object_box_layout_set(
338 d.box, evas_object_box_layout_vertical, NULL, NULL);
339 evas_object_show(d.box);
340
341 /* this is a border around the box, container of the rectangles we
342 * are going to experiment with (changing some size hints). this
343 * way you can see how the container relates to the children */
344 d.border = evas_object_image_filled_add(d.canvas);
345 evas_object_image_file_set(d.border, border_img_path, NULL);
346 evas_object_image_border_set(d.border, 3, 3, 3, 3);
347 evas_object_image_border_center_fill_set(d.border, EVAS_BORDER_FILL_NONE);
348 evas_object_show(d.border);
349
350 d.t_rect = evas_object_rectangle_add(d.canvas);
351 evas_object_color_set(d.t_rect, 0, 0, 255, 255);
352
353 evas_object_size_hint_min_set(
354 d.t_rect, d.t_data.min_ptr->w, d.t_data.min_ptr->h);
355 evas_object_show(d.t_rect);
356 evas_object_box_append(d.box, d.t_rect);
357
358 d.b_rect = evas_object_rectangle_add(d.canvas);
359 evas_object_color_set(d.b_rect, 0, 255, 0, 255);
360
361 evas_object_size_hint_min_set(
362 d.b_rect, d.b_data.min_ptr->w, d.b_data.min_ptr->h);
363 evas_object_show(d.b_rect);
364 evas_object_box_append(d.box, d.b_rect);
365
366 _canvas_resize_cb(d.ee);
367
368 fprintf(stdout, commands);
369 ecore_main_loop_begin();
370 ecore_evas_shutdown();
371 return 0;
372
373error:
374 fprintf(stderr, "You got to have at least one evas engine built and linked"
375 " up to ecore-evas for this example to run properly.\n");
376 return -1;
377}
378
diff --git a/legacy/evas/src/examples/evas-images.c b/legacy/evas/src/examples/evas-images.c
deleted file mode 100644
index a8cf3c41fa..0000000000
--- a/legacy/evas/src/examples/evas-images.c
+++ /dev/null
@@ -1,353 +0,0 @@
1/**
2 * Simple Evas example illustrating some image objects functions
3 *
4 * You'll need at least one engine built for it (excluding the buffer
5 * one) and the png image loader also built. See stdout/stderr for
6 * output.
7 *
8 * @verbatim
9 * gcc -o evas-images evas-images.c `pkg-config --libs --cflags evas ecore ecore-evas`
10 * @endverbatim
11 */
12
13#ifdef HAVE_CONFIG_H
14
15#include "config.h"
16#else
17
18#define PACKAGE_EXAMPLES_DIR "."
19#define __UNUSED__
20
21#endif
22
23#include <Ecore.h>
24#include <Ecore_Evas.h>
25#include <stdio.h>
26#include <errno.h>
27
28#define WIDTH (320)
29#define HEIGHT (240)
30
31static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png";
32static const char *valid_path = PACKAGE_EXAMPLES_DIR "/enlightenment.png";
33static const char *bogus_path = "/tmp/non-existent-220986.png";
34static const char *commands = \
35 "commands are:\n"
36 "\tx - change image's x fill coordinate\n"
37 "\ty - change image's y fill coordinate\n"
38 "\tw - change image's w fill size\n"
39 "\te - change image's h fill size\n"
40 "\tf - toggle image filled property (overrides fill)\n"
41 "\ta - toggle image's alpha channel usage\n"
42 "\tm - toggle border's smooth scaling\n"
43 "\tt - change border's thickness\n"
44 "\tb - change border's center region aspect\n"
45 "\tc - change border's scaling factor\n"
46 "\ts - print image's fill property status\n"
47 "\th - print help\n";
48
49struct test_data
50{
51 Ecore_Evas *ee;
52 Evas *evas;
53 Evas_Object *img1, *img2, *bg, *border;
54};
55
56static struct test_data d = {0};
57
58static void
59_on_destroy(Ecore_Evas *ee __UNUSED__)
60{
61 ecore_main_loop_quit();
62}
63
64/* here just to keep our example's window size and background image's
65 * size in synchrony */
66static void
67_canvas_resize_cb(Ecore_Evas *ee)
68{
69 int w, h;
70
71 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
72 evas_object_resize(d.bg, w, h);
73}
74
75static const char *
76_border_fill_mode_to_str(Evas_Border_Fill_Mode mode)
77{
78 switch (mode)
79 {
80 case EVAS_BORDER_FILL_NONE:
81 return "none";
82
83 case EVAS_BORDER_FILL_DEFAULT:
84 return "default";
85
86 case EVAS_BORDER_FILL_SOLID:
87 return "solid";
88
89 default:
90 return "invalid";
91 }
92}
93
94static void
95_on_keydown(void *data __UNUSED__,
96 Evas *evas __UNUSED__,
97 Evas_Object *o __UNUSED__,
98 void *einfo)
99{
100 Evas_Event_Key_Down *ev = einfo;
101
102 if (strcmp(ev->keyname, "h") == 0) /* print help */
103 {
104 fprintf(stdout, commands);
105 return;
106 }
107
108 if (strcmp(ev->keyname, "m") == 0) /* toggle border image's smooth scaling */
109 {
110 Eina_Bool smooth_scale = evas_object_image_smooth_scale_get(d.border);
111
112 evas_object_image_smooth_scale_set(d.border, !smooth_scale);
113
114 fprintf(stdout, "Image's border is now %s smooth scaling\n",
115 smooth_scale ? "without" : "with");
116
117 return;
118 }
119
120 if (strcmp(ev->keyname, "t") == 0) /* change border's thickness */
121 {
122 int l, r, t, b;
123
124 evas_object_image_border_get(d.border, &l, &r, &t, &b);
125
126 l = (l + 3) % 9;
127 r = (r + 3) % 9;
128 t = (t + 3) % 9;
129 b = (b + 3) % 9;
130
131 evas_object_image_border_set(d.border, l, r, t, b);
132
133 fprintf(stdout, "Image's border thickness is now %d\n", l);
134
135 return;
136 }
137
138 if (strcmp(ev->keyname, "c") == 0) /* change border's scaling factor */
139 {
140 double scale = evas_object_image_border_scale_get(d.border);
141
142 scale *= 2;
143 if (scale > 4.0) scale = 1.0;
144
145 evas_object_image_border_scale_set(d.border, scale);
146
147 fprintf(stdout, "Image's border scaling factor is now %f\n", scale);
148
149 return;
150 }
151
152 if (strcmp(ev->keyname, "b") == 0) /* change border's center
153 * region's aspect */
154 {
155 Eina_Bool fill = \
156 evas_object_image_border_center_fill_get(d.border);
157
158 fill = (fill + 1) % 3;
159
160 evas_object_image_border_center_fill_set(d.border, fill);
161
162 fprintf(stdout, "Image's border center region aspect is now \"%s\"\n",
163 _border_fill_mode_to_str(fill));
164
165 return;
166 }
167
168 if (strcmp(ev->keyname, "a") == 0) /* toggle alpha channel usage */
169 {
170 Eina_Bool alpha = evas_object_image_alpha_get(d.img1);
171
172 evas_object_image_alpha_set(d.img1, !alpha);
173
174 fprintf(stdout, "Image's alpha channel is now %s\n",
175 alpha ? "off" : "on");
176
177 return;
178 }
179
180 if (strcmp(ev->keyname, "f") == 0) /* toggle filled property */
181 {
182 Eina_Bool filled = evas_object_image_filled_get(d.img1);
183
184 evas_object_image_filled_set(d.img1, !filled);
185
186 fprintf(stdout, "Image's x filled property is now %s\n",
187 filled ? "off" : "on");
188
189 return;
190 }
191
192 if (strcmp(ev->keyname, "x") == 0) /* change x fill coordinate */
193 {
194 Evas_Coord x, y, w, h;
195
196 evas_object_image_fill_get(d.img1, &x, &y, &w, &h);
197 x = (x + 20) % (WIDTH / 2);
198 evas_object_image_fill_set(d.img1, x, y, w, h);
199
200 fprintf(stdout, "Image's x fill coordinate changed to %d\n", x);
201
202 return;
203 }
204
205 if (strcmp(ev->keyname, "y") == 0) /* change y fill coordinate */
206 {
207 Evas_Coord x, y, w, h;
208
209 evas_object_image_fill_get(d.img1, &x, &y, &w, &h);
210 y = (y + 20) % (HEIGHT / 2);
211 evas_object_image_fill_set(d.img1, x, y, w, h);
212
213 fprintf(stdout, "Image's y fill coordinate changed to %d\n", y);
214
215 return;
216 }
217
218 if (strcmp(ev->keyname, "w") == 0) /* change w fill size */
219 {
220 Evas_Coord x, y, w, h;
221
222 evas_object_image_fill_get(d.img1, &x, &y, &w, &h);
223 if (w == (WIDTH / 4)) w = (WIDTH / 2);
224 else if (w == WIDTH / 2) w = WIDTH;
225 else w = (WIDTH / 4);
226 evas_object_image_fill_set(d.img1, x, y, w, h);
227
228 fprintf(stdout, "Image's w fill size changed to %d\n", w);
229
230 return;
231 }
232
233 if (strcmp(ev->keyname, "e") == 0) /* change h fill size */
234 {
235 Evas_Coord x, y, w, h;
236
237 evas_object_image_fill_get(d.img1, &x, &y, &w, &h);
238 if (h == (HEIGHT / 4)) h = (HEIGHT / 2);
239 else if (h == HEIGHT / 2) h = HEIGHT;
240 else h = (HEIGHT / 4);
241 evas_object_image_fill_set(d.img1, x, y, w, h);
242
243 fprintf(stdout, "Image's h fill size changed to %d\n", h);
244
245 return;
246 }
247
248 if (strcmp(ev->keyname, "s") == 0) /* status */
249 {
250 Evas_Coord x, y, w, h;
251
252 evas_object_image_fill_get(d.img1, &x, &y, &w, &h);
253
254 fprintf(stdout, "Image has fill properties set to: %d, %d, %d, %d\n",
255 x, y, w, h);
256
257 return;
258 }
259}
260
261int
262main(void)
263{
264 int err;
265
266 if (!ecore_evas_init())
267 return EXIT_FAILURE;
268
269 /* this will give you a window with an Evas canvas under the first
270 * engine available */
271 d.ee = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL);
272 if (!d.ee)
273 goto error;
274
275 ecore_evas_callback_destroy_set(d.ee, _on_destroy);
276 ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb);
277 ecore_evas_show(d.ee);
278
279 /* the canvas pointer, de facto */
280 d.evas = ecore_evas_get(d.ee);
281
282 d.bg = evas_object_rectangle_add(d.evas);
283 evas_object_color_set(d.bg, 255, 255, 255, 255); /* white bg */
284 evas_object_move(d.bg, 0, 0); /* at canvas' origin */
285 evas_object_resize(d.bg, WIDTH, HEIGHT); /* covers full canvas */
286 evas_object_show(d.bg);
287
288 d.img1 = evas_object_image_add(d.evas);
289 evas_object_image_file_set(d.img1, valid_path, NULL);
290 err = evas_object_image_load_error_get(d.img1);
291 if (err != EVAS_LOAD_ERROR_NONE)
292 {
293 fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
294 valid_path, evas_load_error_str(err));
295 }
296 else
297 {
298 fprintf(stdout,
299 "loaded image '%s' with succes! error string is \"%s\"\n",
300 valid_path, evas_load_error_str(err));
301
302 evas_object_move(d.img1, 3, 3);
303 evas_object_image_fill_set(d.img1, 0, 0, WIDTH / 2, HEIGHT / 2);
304 evas_object_resize(d.img1, WIDTH / 2, HEIGHT / 2);
305 evas_object_show(d.img1);
306
307 evas_object_focus_set(d.bg, EINA_TRUE);
308 evas_object_event_callback_add(
309 d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL);
310 }
311
312 /* this is a border around the image above, here just to emphasize
313 * its geometry */
314 d.border = evas_object_image_filled_add(d.evas);
315 evas_object_image_file_set(d.border, border_img_path, NULL);
316 evas_object_image_border_set(d.border, 3, 3, 3, 3);
317 evas_object_image_border_center_fill_set(d.border, EVAS_BORDER_FILL_NONE);
318
319 evas_object_move(d.border, 0, 0);
320 evas_object_resize(d.border, (WIDTH / 2) + 6, (HEIGHT / 2) + 6);
321 evas_object_show(d.border);
322
323 /* image loading will fail for this one -- unless one cheats and
324 * puts a valid image on that path */
325 d.img2 = evas_object_image_add(d.evas);
326 evas_object_image_file_set(d.img2, bogus_path, NULL);
327 err = evas_object_image_load_error_get(d.img2);
328 if (err != EVAS_LOAD_ERROR_NONE)
329 {
330 fprintf(stderr, "could not load image '%s': error string is \"%s\"\n",
331 bogus_path, evas_load_error_str(err));
332 }
333 else
334 {
335 evas_object_move(d.img2, WIDTH / 2, HEIGHT / 2);
336 evas_object_image_fill_set(d.img2, 0, 0, WIDTH / 2, HEIGHT / 2);
337 evas_object_resize(d.img2, WIDTH / 2, HEIGHT / 2);
338 evas_object_show(d.img2);
339 }
340
341 fprintf(stdout, commands);
342 ecore_main_loop_begin();
343
344 ecore_evas_free(d.ee);
345 ecore_evas_shutdown();
346 return 0;
347
348error:
349 fprintf(stderr, "you got to have at least one evas engine built and linked"
350 " up to ecore-evas for this example to run properly.\n");
351 ecore_evas_shutdown();
352 return -1;
353}
diff --git a/legacy/evas/src/examples/evas-images2.c b/legacy/evas/src/examples/evas-images2.c
deleted file mode 100644
index 64f4c9fc43..0000000000
--- a/legacy/evas/src/examples/evas-images2.c
+++ /dev/null
@@ -1,311 +0,0 @@
1/**
2 * Simple Evas example illustrating some image objects functions
3 *
4 * You'll need at least one engine built for it (excluding the buffer
5 * one) and the png image loader/saver also built. See stdout/stderr
6 * for output.
7 *
8 * @verbatim
9 * gcc -o evas-images2 evas-images2.c `pkg-config --libs --cflags evas ecore ecore-evas`
10 * @endverbatim
11 */
12
13#ifdef HAVE_CONFIG_H
14
15#include "config.h"
16#else
17
18#define PACKAGE_EXAMPLES_DIR "."
19#define __UNUSED__
20
21#endif
22
23#include <Ecore.h>
24#include <Ecore_Evas.h>
25#include <stdio.h>
26#include <errno.h>
27
28#define WIDTH (320)
29#define HEIGHT (240)
30
31static const char *img_path = PACKAGE_EXAMPLES_DIR "/enlightenment.png";
32static const char *commands = \
33 "commands are:\n"
34 "\tp - change proxy image's source\n"
35 "\ts - print noise image's stride value\n"
36 "\ta - save noise image to disk (/tmp dir)\n"
37 "\tv - change source visibility\n"
38 "\te - enable/disable source events\n"
39 "\th - print help\n";
40
41const char *file_path = "/tmp/evas-images2-example.png";
42const char *quality_str = "quality=100";
43
44struct test_data
45{
46 Ecore_Evas *ee;
47 Evas *evas;
48 Evas_Object *logo, *noise_img, *proxy_img, *bg;
49};
50
51static struct test_data d = {0};
52
53static void
54_mouse_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
55 void *event_info)
56{
57 Evas_Event_Mouse_Down *ev = event_info;
58 printf("Mouse Down - obj(%p), coords(%d %d)\n", obj, ev->canvas.x,
59 ev->canvas.y);
60}
61
62static void
63_mouse_move(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
64 void *event_info)
65{
66 Evas_Event_Mouse_Move *ev = event_info;
67 printf("Mouse Move - obj(%p), coords(%d %d)\n", obj, ev->cur.canvas.x,
68 ev->cur.canvas.y);
69}
70
71static void
72_mouse_up(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
73 void *event_info)
74{
75 Evas_Event_Mouse_Up *ev = event_info;
76 printf("Mouse Up - obj(%p), coords(%d %d)\n", obj, ev->canvas.x,
77 ev->canvas.y);
78}
79
80static void
81_multi_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
82 void *event_info)
83{
84 Evas_Event_Multi_Down *ev = event_info;
85 printf("Multi Down - obj(%p), coords(%d %d)\n", obj, ev->canvas.x,
86 ev->canvas.y);
87}
88
89static void
90_multi_move(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
91 void *event_info)
92{
93 Evas_Event_Multi_Move *ev = event_info;
94 printf("Multi Move - obj(%p), coords(%d %d)\n", obj, ev->cur.canvas.x,
95 ev->cur.canvas.y);
96}
97
98static void
99_multi_up(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
100 void *event_info)
101{
102 Evas_Event_Multi_Up *ev = event_info;
103 printf("Multi Up - obj(%p), coords(%d %d)\n", obj, ev->canvas.x,
104 ev->canvas.y);
105}
106
107static void
108_mouse_in(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
109 void *event_info)
110{
111 Evas_Event_Mouse_In *ev = event_info;
112 printf("Mouse In - obj(%p), coords(%d %d)\n", obj, ev->canvas.x,
113 ev->canvas.y);
114}
115
116static void
117_mouse_out(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
118 void *event_info)
119{
120 Evas_Event_Mouse_Out *ev = event_info;
121 printf("Mouse Out - obj(%p), coords(%d %d)\n", obj, ev->canvas.x,
122 ev->canvas.y);
123}
124
125static void
126_hold(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
127 void *event_info)
128{
129 Evas_Event_Hold *ev = event_info;
130 printf("Hold - obj(%p), hold(%d)\n", obj, ev->hold);
131}
132
133static void
134_on_preloaded(void *data __UNUSED__,
135 Evas *e __UNUSED__,
136 Evas_Object *obj __UNUSED__,
137 void *event_info __UNUSED__)
138{
139 fprintf(stdout, "Image has been pre-loaded!\n");
140}
141
142static void
143_on_destroy(Ecore_Evas *ee __UNUSED__)
144{
145 ecore_main_loop_quit();
146}
147
148/* here just to keep our example's window size and background image's
149 * size in synchrony */
150static void
151_canvas_resize_cb(Ecore_Evas *ee)
152{
153 int w, h;
154
155 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
156 evas_object_resize(d.bg, w, h);
157}
158
159static void
160_on_keydown(void *data __UNUSED__,
161 Evas *evas __UNUSED__,
162 Evas_Object *o __UNUSED__,
163 void *einfo)
164{
165 Evas_Event_Key_Down *ev = einfo;
166
167 if (strcmp(ev->keyname, "h") == 0) /* print help */
168 {
169 fprintf(stdout, commands);
170 return;
171 }
172
173 if (strcmp(ev->keyname, "s") == 0) /* print proxy image' stride value */
174 {
175 int stride = evas_object_image_stride_get(d.noise_img);
176
177 fprintf(stdout, "Image has row stride value of %d, which accounts"
178 " for %d pixels\n", stride, stride / 4);
179
180 return;
181 }
182
183 if (strcmp(ev->keyname, "p") == 0) /* change proxy's source */
184 {
185 Evas_Object *source = evas_object_image_source_get(d.proxy_img);
186
187 if (source == d.logo) source = d.noise_img;
188 else source = d.logo;
189
190 evas_object_image_source_set(d.proxy_img, source);
191
192 fprintf(stdout, "Proxy image's source changed\n");
193
194 return;
195 }
196
197 if (strcmp(ev->keyname, "a") == 0) /* save noise image to disk */
198 {
199 if (!evas_object_image_save(d.noise_img, file_path, NULL, quality_str))
200 fprintf(stderr, "Cannot save image to '%s' (flags '%s')\n",
201 file_path, quality_str);
202 else
203 fprintf(stdout, "Image saved to '%s' (flags '%s'), check it out with "
204 "an image viewer\n", file_path, quality_str);
205
206 return;
207 }
208
209 if (strcmp(ev->keyname, "v") == 0) /* change source visibility */
210 {
211 Eina_Bool src_visible =
212 evas_object_image_source_visible_get(d.proxy_img);
213 evas_object_image_source_visible_set(d.proxy_img, !src_visible);
214 return;
215 }
216
217 if (strcmp(ev->keyname, "e") == 0) /* change source events */
218 {
219 Eina_Bool src_events = evas_object_image_source_events_get(d.proxy_img);
220 evas_object_image_source_events_set(d.proxy_img, !src_events);
221 return;
222 }
223}
224
225int
226main(void)
227{
228 unsigned int i;
229 unsigned int pixels[(WIDTH / 4) * (HEIGHT / 4)];
230
231 srand(time(NULL));
232
233 if (!ecore_evas_init())
234 return EXIT_FAILURE;
235
236 /* this will give you a window with an Evas canvas under the first
237 * engine available */
238 d.ee = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL);
239 if (!d.ee)
240 goto error;
241
242 ecore_evas_callback_destroy_set(d.ee, _on_destroy);
243 ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb);
244 ecore_evas_show(d.ee);
245
246 /* the canvas pointer, de facto */
247 d.evas = ecore_evas_get(d.ee);
248
249 d.bg = evas_object_rectangle_add(d.evas);
250 evas_object_color_set(d.bg, 255, 255, 255, 255); /* white bg */
251 evas_object_move(d.bg, 0, 0); /* at canvas' origin */
252 evas_object_resize(d.bg, WIDTH, HEIGHT); /* covers full canvas */
253 evas_object_show(d.bg);
254
255 evas_object_focus_set(d.bg, EINA_TRUE);
256 evas_object_event_callback_add(
257 d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL);
258
259 d.logo = evas_object_image_filled_add(d.evas);
260
261 evas_object_event_callback_add(
262 d.logo, EVAS_CALLBACK_IMAGE_PRELOADED, _on_preloaded, NULL);
263 evas_object_image_preload(d.logo, EINA_TRUE);
264
265 evas_object_image_file_set(d.logo, img_path, NULL);
266 evas_object_resize(d.logo, WIDTH / 2, HEIGHT / 2);
267 evas_object_event_callback_add(d.logo, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, 0);
268 evas_object_event_callback_add(d.logo, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move, 0);
269 evas_object_event_callback_add(d.logo, EVAS_CALLBACK_MOUSE_UP, _mouse_up, 0);
270 evas_object_event_callback_add(d.logo, EVAS_CALLBACK_MOUSE_IN, _mouse_in, 0);
271 evas_object_event_callback_add(d.logo, EVAS_CALLBACK_MOUSE_OUT, _mouse_out, 0);
272 evas_object_event_callback_add(d.logo, EVAS_CALLBACK_MULTI_DOWN, _multi_down, 0);
273 evas_object_event_callback_add(d.logo, EVAS_CALLBACK_MULTI_UP, _multi_up, 0);
274 evas_object_event_callback_add(d.logo, EVAS_CALLBACK_MULTI_MOVE, _multi_move, 0);
275 evas_object_event_callback_add(d.logo, EVAS_CALLBACK_HOLD, _hold, 0);
276
277 evas_object_show(d.logo);
278
279 /* creating noise image */
280 for (i = 0; i < sizeof(pixels) / sizeof(pixels[0]); i++)
281 pixels[i] = rand();
282
283 d.noise_img = evas_object_image_add(d.evas);
284 evas_object_image_size_set(d.noise_img, WIDTH / 4, HEIGHT / 4);
285 evas_object_image_data_set(d.noise_img, pixels);
286 evas_object_image_filled_set(d.noise_img, EINA_TRUE);
287 evas_object_move(d.noise_img, (WIDTH * 3) / 4, 0);
288 evas_object_resize(d.noise_img, WIDTH / 4, HEIGHT / 4);
289 evas_object_show(d.noise_img);
290 fprintf(stdout, "Creating noise image with size %d, %d\n",
291 WIDTH / 4, HEIGHT / 4);
292
293 d.proxy_img = evas_object_image_filled_add(d.evas);
294 evas_object_image_source_set(d.proxy_img, d.logo);
295 evas_object_move(d.proxy_img, WIDTH / 4, HEIGHT / 2);
296 evas_object_resize(d.proxy_img, WIDTH / 2, HEIGHT / 2);
297 evas_object_show(d.proxy_img);
298
299 fprintf(stdout, commands);
300 ecore_main_loop_begin();
301
302 ecore_evas_free(d.ee);
303 ecore_evas_shutdown();
304 return 0;
305
306error:
307 fprintf(stderr, "you got to have at least one evas engine built and linked"
308 " up to ecore-evas for this example to run properly.\n");
309 ecore_evas_shutdown();
310 return -1;
311}
diff --git a/legacy/evas/src/examples/evas-images3.c b/legacy/evas/src/examples/evas-images3.c
deleted file mode 100644
index 5d627b0a37..0000000000
--- a/legacy/evas/src/examples/evas-images3.c
+++ /dev/null
@@ -1,196 +0,0 @@
1/**
2 * Simple Evas example illustrating some image objects functions
3 *
4 * You'll need at least one engine built for it (excluding the buffer
5 * one) and the png image loader/saver also built. See stdout/stderr
6 * for output.
7 *
8 * @verbatim
9 * gcc -o evas-images2 evas-images2.c `pkg-config --libs --cflags evas ecore ecore-evas`
10 * @endverbatim
11 */
12
13#ifdef HAVE_CONFIG_H
14
15#include "config.h"
16#else
17
18#define PACKAGE_EXAMPLES_DIR "."
19#define __UNUSED__
20
21#endif
22
23#include <Ecore.h>
24#include <Ecore_Evas.h>
25#include <stdio.h>
26#include <errno.h>
27
28#define WIDTH (320)
29#define HEIGHT (240)
30
31static const char *img_path = PACKAGE_EXAMPLES_DIR "/enlightenment.png";
32static const char *commands = \
33 "commands are:\n"
34 "\tw - write new pixel data to image\n"
35 "\ti - print image info\n"
36 "\ta - save noise image to disk (/tmp dir)\n"
37 "\th - print help\n";
38
39const char *file_path = "/tmp/evas-images2-example.png";
40const char *quality_str = "quality=100";
41
42struct test_data
43{
44 Ecore_Evas *ee;
45 Evas *evas;
46 Evas_Object *bg;
47 Evas_Object *logo, *logo1;
48};
49
50static struct test_data d = {0};
51
52static void
53_on_destroy(Ecore_Evas *ee __UNUSED__)
54{
55 ecore_main_loop_quit();
56}
57
58/* here just to keep our example's window size and background image's
59 * size in synchrony */
60static void
61_canvas_resize_cb(Ecore_Evas *ee)
62{
63 int w, h;
64
65 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
66 evas_object_resize(d.bg, w, h);
67 evas_object_resize(d.logo, w / 2, h);
68 evas_object_move(d.logo1, w / 2, 0);
69 evas_object_resize(d.logo1, w / 2, h);
70}
71
72static void
73_on_keydown(void *data __UNUSED__,
74 Evas *evas __UNUSED__,
75 Evas_Object *o __UNUSED__,
76 void *einfo)
77{
78 Evas_Event_Key_Down *ev = einfo;
79
80 if (strcmp(ev->keyname, "h") == 0) /* print help */
81 {
82 fprintf(stdout, commands);
83 return;
84 }
85
86 if (strcmp(ev->keyname, "i") == 0) /* change proxy's source */
87 {
88 int stride = evas_object_image_stride_get(d.logo);
89 int w, h;
90
91 evas_object_image_size_get(d.logo, &w, &h);
92
93 printf("image size: %dx%d; stride: %d\n", w, h, stride);
94
95 return;
96 }
97
98 if (strcmp(ev->keyname, "w") == 0) /* save noise image to disk */
99 {
100 int i;
101 char *pixels = evas_object_image_data_get(d.logo, EINA_FALSE);
102 char *bufpixels;
103 int w, h;
104 int stride;
105 Eina_Bool equal = EINA_TRUE;
106
107 evas_object_image_size_get(d.logo, &w, &h);
108 stride = evas_object_image_stride_get(d.logo);
109
110 bufpixels = malloc(sizeof(char) * stride * h);
111 memcpy(bufpixels, pixels, sizeof(char) * stride * h);
112
113 pixels = evas_object_image_data_get(d.logo, EINA_TRUE);
114
115 for (i = 0; i < (stride * h); i++)
116 {
117 if (bufpixels[i] != pixels[i])
118 {
119 equal = EINA_FALSE;
120 break;
121 }
122 }
123
124 free(bufpixels);
125
126 if (!equal)
127 printf("write pixels different from readonly pixels.\n");
128
129 for (i = ((stride * h) / 4) ; i < ((stride * h) / 2) ; i++)
130 {
131 pixels[i] = 0;
132 }
133
134 // evas_object_image_data_set(d.logo, pixels);
135 evas_object_image_data_update_add(d.logo, 0, 0, w, h);
136 return;
137 }
138}
139
140int
141main(void)
142{
143 // unsigned int i;
144 // unsigned int pixels[(WIDTH / 4) * (HEIGHT / 4)];
145
146 if (!ecore_evas_init())
147 return EXIT_FAILURE;
148
149 /* this will give you a window with an Evas canvas under the first
150 * engine available */
151 d.ee = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL);
152 if (!d.ee)
153 goto error;
154
155 ecore_evas_callback_destroy_set(d.ee, _on_destroy);
156 ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb);
157 ecore_evas_show(d.ee);
158
159 /* the canvas pointer, de facto */
160 d.evas = ecore_evas_get(d.ee);
161
162 d.bg = evas_object_rectangle_add(d.evas);
163 evas_object_color_set(d.bg, 255, 255, 255, 255); /* white bg */
164 evas_object_move(d.bg, 0, 0); /* at canvas' origin */
165 evas_object_resize(d.bg, WIDTH, HEIGHT); /* covers full canvas */
166 evas_object_show(d.bg);
167
168 evas_object_focus_set(d.bg, EINA_TRUE);
169 evas_object_event_callback_add(
170 d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL);
171
172 d.logo = evas_object_image_filled_add(d.evas);
173
174 evas_object_image_file_set(d.logo, img_path, NULL);
175 evas_object_resize(d.logo, WIDTH / 2, HEIGHT);
176 evas_object_show(d.logo);
177
178 d.logo1 = evas_object_image_filled_add(d.evas);
179 evas_object_image_file_set(d.logo1, img_path, NULL);
180 evas_object_resize(d.logo1, WIDTH / 2, HEIGHT);
181 evas_object_move(d.logo1, WIDTH / 2, 0);
182 evas_object_show(d.logo1);
183
184 fprintf(stdout, commands);
185 ecore_main_loop_begin();
186
187 ecore_evas_free(d.ee);
188 ecore_evas_shutdown();
189 return 0;
190
191error:
192 fprintf(stderr, "you got to have at least one evas engine built and linked"
193 " up to ecore-evas for this example to run properly.\n");
194 ecore_evas_shutdown();
195 return -1;
196}
diff --git a/legacy/evas/src/examples/evas-init-shutdown.c b/legacy/evas/src/examples/evas-init-shutdown.c
deleted file mode 100644
index a7508d8685..0000000000
--- a/legacy/evas/src/examples/evas-init-shutdown.c
+++ /dev/null
@@ -1,56 +0,0 @@
1/**
2 * Simple example illustrating usage of evas_init() and
3 * evas_shutdown(). Usually one would instantiate a canvas to have
4 * something useful out of Evas. For an example of this kind, see the
5 * @ref Example_Evas_Buffer_Simple.
6 *
7 * Here, we are just listing the engine Evas was compiled with support
8 * to.
9 *
10 * @verbatim
11 * gcc -o evas-init-shutdown evas-init-shutdown.c `pkg-config --libs \
12 * --cflags evas`
13 * @endverbatim
14 *
15 */
16
17#include <Evas.h>
18#include <stdio.h>
19#include <errno.h>
20
21/*
22 * Simple example illustrating usage of evas_init() and
23 * evas_shutdown(). Usually one would instantiate a canvas to have
24 * something useful out of Evas. For an example of this kind, see the
25 * evas-buffer-simple.c, which requires the buffer engine module
26 * compiled in Evas.
27 *
28 * Here, we are just listing the engine Evas was compiled with support
29 * to.
30 */
31
32int
33main(void)
34{
35 Eina_List *engine_list, *l;
36 char *engine_name;
37
38 evas_init();
39
40 engine_list = evas_render_method_list();
41 if (!engine_list)
42 {
43 fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
44 exit(-1);
45 }
46
47 printf("Available Evas Engines:\n");
48 EINA_LIST_FOREACH(engine_list, l, engine_name)
49 printf("%s\n", engine_name);
50
51 evas_render_method_list_free(engine_list);
52
53 evas_shutdown();
54 return 0;
55 }
56
diff --git a/legacy/evas/src/examples/evas-map-utils.c b/legacy/evas/src/examples/evas-map-utils.c
deleted file mode 100644
index 2d15882f53..0000000000
--- a/legacy/evas/src/examples/evas-map-utils.c
+++ /dev/null
@@ -1,321 +0,0 @@
1/*
2 * gcc -o evas-map-utils evas-map-utils.c `pkg-config --cflags --libs evas ecore ecore-evas`
3 */
4#ifdef HAVE_CONFIG_H
5#include "config.h"
6#else
7#define __UNUSED__
8#endif
9
10#include <Ecore.h>
11#include <Ecore_Evas.h>
12
13#include <stdlib.h>
14#include <stdio.h>
15#include <string.h>
16#include <math.h>
17
18#define WIDTH 480
19#define HEIGHT 480
20
21typedef struct
22{
23 Ecore_Evas *ee;
24 Evas *canvas;
25 struct {
26 int r, g, b, a;
27 } colors[6];
28 int colors_index;
29 int frame;
30 Eina_Bool alpha : 1;
31 Eina_Bool smooth : 1;
32 Eina_Bool backface_culling : 1;
33 Eina_Bool apply_perspective : 1;
34 Eina_Bool apply_lighting : 1;
35} App_Data;
36
37static const char *help_string =
38 "Valid commands:\n"
39 "\ta - toggle alpha for maps\n"
40 "\ts - toggle smooth for maps\n"
41 "\tc - switch map color\n"
42 "\tb - toggle backface culling\n"
43 "\tp - toggle perspective\n"
44 "\tl - toggle lighting\n"
45 "\th - prints this help\n";
46
47static Eina_Bool
48_anim_cb(void *data)
49{
50 App_Data *ad = data;
51 Evas_Map *m;
52 const Evas_Map *old_map;
53 Evas_Object *o;
54 int r, g, b, a;
55 int win_w, win_h, img_w, img_h;
56 Evas_Coord x, y, w, h;
57
58 evas_output_size_get(ad->canvas, &win_w, &win_h);
59
60 m = evas_map_new(4);
61 evas_map_smooth_set(m, ad->smooth);
62 evas_map_alpha_set(m, ad->alpha);
63
64 r = ad->colors[ad->colors_index].r;
65 g = ad->colors[ad->colors_index].g;
66 b = ad->colors[ad->colors_index].b;
67 a = ad->colors[ad->colors_index].a;
68 evas_map_util_points_color_set(m, r, g, b, a);
69
70 o = evas_object_name_find(ad->canvas, "obj1");
71 evas_object_geometry_get(o, &x, &y, &w, &h);
72
73 evas_map_util_points_populate_from_object(m, o);
74 evas_map_util_rotate(m, 3 * ad->frame, x + (w / 2), y + (h / 2));
75 evas_object_map_set(o, m);
76 evas_object_map_enable_set(o, EINA_TRUE);
77
78 o = evas_object_name_find(ad->canvas, "obj2");
79 evas_object_geometry_get(o, &x, &y, &w, &h);
80 evas_object_image_size_get(o, &img_w, &img_h);
81
82 evas_map_util_points_populate_from_object_full(m, o, 100);
83 evas_map_point_image_uv_set(m, 0, 0, 0);
84 evas_map_point_image_uv_set(m, 1, img_w, 0);
85 evas_map_point_image_uv_set(m, 2, img_w, img_h);
86 evas_map_point_image_uv_set(m, 3, 0, img_h);
87 evas_map_util_3d_rotate(m, ad->frame * 6, ad->frame * 6, ad->frame * 6,
88 x + (w / 3), y + 10, 0);
89 if (ad->apply_lighting)
90 evas_map_util_3d_lighting(m, win_w / 2, win_h / 2, -100,
91 255, 255, 255, 0, 0, 0);
92 evas_object_map_set(o, m);
93 evas_object_map_enable_set(o, EINA_TRUE);
94
95 o = evas_object_name_find(ad->canvas, "obj3");
96 evas_object_geometry_get(o, &x, &y, &w, &h);
97 evas_object_image_size_get(o, &img_w, &img_h);
98
99 evas_map_util_points_populate_from_geometry(m, x, y + (h / 2), w, h, -20);
100 evas_map_point_image_uv_set(m, 0, 0, 0);
101 evas_map_point_image_uv_set(m, 1, img_w, 0);
102 evas_map_point_image_uv_set(m, 2, img_w, img_h);
103 evas_map_point_image_uv_set(m, 3, 0, img_h);
104 evas_map_util_3d_rotate(m, 20, ad->frame * 6, 0,
105 x + (w / 2), y + (w / 2), w / 2);
106
107 if (ad->apply_perspective)
108 evas_map_util_3d_perspective(m, x + (w / 2), y + (h / 2), 0, 256);
109 if (ad->apply_lighting)
110 {
111 Evas_Coord mx, my;
112 evas_pointer_canvas_xy_get(ad->canvas, &mx, &my);
113 evas_map_util_3d_lighting(m, mx, my, -256,
114 255, 255, 255, 0, 0, 0);
115 }
116 if (ad->backface_culling)
117 {
118 if (evas_map_util_clockwise_get(m))
119 evas_object_show(o);
120 else
121 evas_object_hide(o);
122 }
123 else
124 evas_object_show(o);
125 evas_object_map_set(o, m);
126 evas_object_map_enable_set(o, EINA_TRUE);
127
128 evas_map_free(m);
129
130 o = evas_object_name_find(ad->canvas, "obj4");
131 evas_object_geometry_get(o, &x, &y, &w, &h);
132 evas_object_image_size_get(evas_object_image_source_get(o), &img_w, &img_h);
133
134 m = evas_map_new(4);
135 evas_map_point_coord_set(m, 0, x, y + h, 0);
136 evas_map_point_coord_set(m, 1, x + w, y + h, 0);
137 evas_map_point_coord_set(m, 2, win_w - 10, win_h - 30, 0);
138 evas_map_point_coord_set(m, 3, (win_w / 2) + 10, win_h - 30, 0);
139 evas_map_point_image_uv_set(m, 0, 0, img_h);
140 evas_map_point_image_uv_set(m, 1, img_w, img_h);
141 evas_map_point_image_uv_set(m, 2, img_w, 2 * (img_h / 3));
142 evas_map_point_image_uv_set(m, 3, 0, 2 * (img_h / 3));
143 evas_map_point_color_set(m, 0, 200, 200, 200, 150);
144 evas_map_point_color_set(m, 1, 200, 200, 200, 150);
145 evas_map_point_color_set(m, 2, 0, 0, 0, 0);
146 evas_map_point_color_set(m, 3, 0, 0, 0, 0);
147 evas_object_map_set(o, m);
148 evas_object_map_enable_set(o, EINA_TRUE);
149
150 evas_map_free(m);
151
152 ad->frame = (ad->frame + 1) % 60;
153
154 return EINA_TRUE;
155}
156
157static void
158_on_keydown(void *data, Evas *e, Evas_Object *o, void *event)
159{
160 App_Data *ad = data;
161 Evas_Event_Key_Down *ev = event;
162 const Evas_Modifier *mods;
163
164 mods = evas_key_modifier_get(ad->canvas);
165 switch (ev->keyname[0])
166 {
167 case 'a':
168 ad->alpha = !ad->alpha;
169 break;
170 case 's':
171 ad->smooth = !ad->smooth;
172 break;
173 case 'c':
174 ad->colors_index = (ad->colors_index + 1) % 6;
175 break;
176 case 'b':
177 ad->backface_culling = !ad->backface_culling;
178 break;
179 case 'p':
180 ad->apply_perspective = !ad->apply_perspective;
181 break;
182 case 'l':
183 ad->apply_lighting = !ad->apply_lighting;
184 break;
185 case 'h':
186 puts(help_string);
187 break;
188 default:
189 break;
190 }
191}
192
193static void
194_objs_fit(Evas *e)
195{
196 Evas_Object *o;
197 int w, h;
198
199 evas_output_size_get(e, &w, &h);
200 w /= 2;
201 h /= 2;
202
203 o = evas_object_name_find(e, "obj1");
204 evas_object_move(o, w / 4, h / 4);
205 evas_object_resize(o, w / 2, h / 2);
206
207 o = evas_object_name_find(e, "obj2");
208 evas_object_move(o, 5 * w / 4, h / 4);
209 evas_object_resize(o, w / 2, h / 2);
210
211 o = evas_object_name_find(e, "obj3");
212 evas_object_move(o, w / 4, 5 * h / 4);
213 evas_object_resize(o, w / 2, h / 2);
214
215 o = evas_object_name_find(e, "obj4_source");
216 evas_object_move(o, 5 * w / 4, 5 * h / 4);
217 evas_object_resize(o, w / 2, h / 2);
218
219 o = evas_object_name_find(e, "obj4");
220 evas_object_move(o, 5 * w / 4, 5 * h / 4);
221 evas_object_resize(o, w / 2, h / 2);
222}
223
224static void
225_on_resize(void *data __UNUSED__, Evas *e, Evas_Object *o __UNUSED__, void *event __UNUSED__)
226{
227 _objs_fit(e);
228}
229
230static void
231_on_free(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event __UNUSED__)
232{
233 ecore_main_loop_quit();
234}
235
236int
237main(void)
238{
239 Evas_Object *bg, *o, *osrc;
240 static App_Data d = {
241 .ee = NULL,
242 .canvas = NULL,
243 .colors = {
244 { 255, 255, 255, 255 },
245 { 128, 128, 0, 128 },
246 { 255, 0, 0, 255 },
247 { 64, 128, 255, 255 },
248 { 11, 23, 58, 132 },
249 { 0, 0, 0, 255 }
250 },
251 .colors_index = 0,
252 .frame = 0,
253 .alpha = EINA_FALSE,
254 .smooth = EINA_FALSE,
255 .backface_culling = EINA_FALSE,
256 .apply_perspective = EINA_TRUE,
257 .apply_lighting = EINA_TRUE
258 };
259
260 if (!ecore_evas_init())
261 return EXIT_FAILURE;
262
263 d.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
264 if (!d.ee)
265 goto error;
266
267 d.canvas = ecore_evas_get(d.ee);
268
269 bg = evas_object_image_filled_add(d.canvas);