diff options
author | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
commit | 07274513e984f0b5544586c74508ccd16e7dcafa (patch) | |
tree | b32ff2a9136fbc1a4a6a0ed1e4d79cde0f5f16d9 /libraries/evas/src/tests | |
parent | Added Irrlicht 1.8, but without all the Windows binaries. (diff) | |
download | SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.zip SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.gz SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.bz2 SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.xz |
Remove EFL, since it's been released now.
Diffstat (limited to 'libraries/evas/src/tests')
-rw-r--r-- | libraries/evas/src/tests/Makefile.am | 29 | ||||
-rw-r--r-- | libraries/evas/src/tests/Makefile.in | 697 | ||||
-rw-r--r-- | libraries/evas/src/tests/evas_suite.c | 104 | ||||
-rw-r--r-- | libraries/evas/src/tests/evas_suite.h | 12 | ||||
-rw-r--r-- | libraries/evas/src/tests/evas_test_callbacks.c | 135 | ||||
-rw-r--r-- | libraries/evas/src/tests/evas_test_init.c | 21 | ||||
-rw-r--r-- | libraries/evas/src/tests/evas_test_text.c | 493 | ||||
-rw-r--r-- | libraries/evas/src/tests/evas_test_textblock.c | 2148 | ||||
-rw-r--r-- | libraries/evas/src/tests/evas_tests_helpers.h | 40 |
9 files changed, 0 insertions, 3679 deletions
diff --git a/libraries/evas/src/tests/Makefile.am b/libraries/evas/src/tests/Makefile.am deleted file mode 100644 index c659106..0000000 --- a/libraries/evas/src/tests/Makefile.am +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | MAINTAINERCLEANFILES = Makefile.in | ||
2 | |||
3 | AM_CPPFLAGS = \ | ||
4 | -I$(top_srcdir)/src/lib \ | ||
5 | -I$(top_srcdir)/src/include \ | ||
6 | -I$(top_builddir)/src/include \ | ||
7 | -I$(top_builddir)/src/lib \ | ||
8 | -DPACKAGE_BIN_DIR=\"$(bindir)\" \ | ||
9 | -DPACKAGE_LIB_DIR=\"$(libdir)\" \ | ||
10 | -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ | ||
11 | @EINA_CFLAGS@ \ | ||
12 | @CHECK_CFLAGS@ | ||
13 | |||
14 | if EFL_ENABLE_TESTS | ||
15 | |||
16 | check_PROGRAMS = evas_suite | ||
17 | |||
18 | evas_suite_SOURCES = \ | ||
19 | evas_suite.c \ | ||
20 | evas_test_init.c \ | ||
21 | evas_test_textblock.c \ | ||
22 | evas_test_text.c \ | ||
23 | evas_test_callbacks.c \ | ||
24 | evas_tests_helpers.h \ | ||
25 | evas_suite.h | ||
26 | |||
27 | evas_suite_LDADD = @CHECK_LIBS@ $(top_builddir)/src/lib/libevas.la @EINA_LIBS@ | ||
28 | |||
29 | endif | ||
diff --git a/libraries/evas/src/tests/Makefile.in b/libraries/evas/src/tests/Makefile.in deleted file mode 100644 index f3c46d3..0000000 --- a/libraries/evas/src/tests/Makefile.in +++ /dev/null | |||
@@ -1,697 +0,0 @@ | |||
1 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | ||
2 | # @configure_input@ | ||
3 | |||
4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | ||
5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, | ||
6 | # Inc. | ||
7 | # This Makefile.in is free software; the Free Software Foundation | ||
8 | # gives unlimited permission to copy and/or distribute it, | ||
9 | # with or without modifications, as long as this notice is preserved. | ||
10 | |||
11 | # This program is distributed in the hope that it will be useful, | ||
12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | ||
13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
14 | # PARTICULAR PURPOSE. | ||
15 | |||
16 | @SET_MAKE@ | ||
17 | VPATH = @srcdir@ | ||
18 | pkgdatadir = $(datadir)/@PACKAGE@ | ||
19 | pkgincludedir = $(includedir)/@PACKAGE@ | ||
20 | pkglibdir = $(libdir)/@PACKAGE@ | ||
21 | pkglibexecdir = $(libexecdir)/@PACKAGE@ | ||
22 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
23 | install_sh_DATA = $(install_sh) -c -m 644 | ||
24 | install_sh_PROGRAM = $(install_sh) -c | ||
25 | install_sh_SCRIPT = $(install_sh) -c | ||
26 | INSTALL_HEADER = $(INSTALL_DATA) | ||
27 | transform = $(program_transform_name) | ||
28 | NORMAL_INSTALL = : | ||
29 | PRE_INSTALL = : | ||
30 | POST_INSTALL = : | ||
31 | NORMAL_UNINSTALL = : | ||
32 | PRE_UNINSTALL = : | ||
33 | POST_UNINSTALL = : | ||
34 | build_triplet = @build@ | ||
35 | host_triplet = @host@ | ||
36 | @EFL_ENABLE_TESTS_TRUE@check_PROGRAMS = evas_suite$(EXEEXT) | ||
37 | subdir = src/tests | ||
38 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in | ||
39 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
40 | am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ | ||
41 | $(top_srcdir)/m4/efl_coverage.m4 \ | ||
42 | $(top_srcdir)/m4/efl_doxygen.m4 \ | ||
43 | $(top_srcdir)/m4/efl_fnmatch.m4 \ | ||
44 | $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ | ||
45 | $(top_srcdir)/m4/evas_check_engine.m4 \ | ||
46 | $(top_srcdir)/m4/evas_check_loader.m4 \ | ||
47 | $(top_srcdir)/m4/evas_converter.m4 \ | ||
48 | $(top_srcdir)/m4/evas_dither.m4 \ | ||
49 | $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \ | ||
50 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | ||
51 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | ||
52 | $(top_srcdir)/configure.ac | ||
53 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
54 | $(ACLOCAL_M4) | ||
55 | mkinstalldirs = $(install_sh) -d | ||
56 | CONFIG_HEADER = $(top_builddir)/config.h | ||
57 | CONFIG_CLEAN_FILES = | ||
58 | CONFIG_CLEAN_VPATH_FILES = | ||
59 | am__evas_suite_SOURCES_DIST = evas_suite.c evas_test_init.c \ | ||
60 | evas_test_textblock.c evas_test_text.c evas_test_callbacks.c \ | ||
61 | evas_tests_helpers.h evas_suite.h | ||
62 | @EFL_ENABLE_TESTS_TRUE@am_evas_suite_OBJECTS = evas_suite.$(OBJEXT) \ | ||
63 | @EFL_ENABLE_TESTS_TRUE@ evas_test_init.$(OBJEXT) \ | ||
64 | @EFL_ENABLE_TESTS_TRUE@ evas_test_textblock.$(OBJEXT) \ | ||
65 | @EFL_ENABLE_TESTS_TRUE@ evas_test_text.$(OBJEXT) \ | ||
66 | @EFL_ENABLE_TESTS_TRUE@ evas_test_callbacks.$(OBJEXT) | ||
67 | evas_suite_OBJECTS = $(am_evas_suite_OBJECTS) | ||
68 | @EFL_ENABLE_TESTS_TRUE@evas_suite_DEPENDENCIES = \ | ||
69 | @EFL_ENABLE_TESTS_TRUE@ $(top_builddir)/src/lib/libevas.la | ||
70 | AM_V_lt = $(am__v_lt_$(V)) | ||
71 | am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) | ||
72 | am__v_lt_0 = --silent | ||
73 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) | ||
74 | depcomp = $(SHELL) $(top_srcdir)/depcomp | ||
75 | am__depfiles_maybe = depfiles | ||
76 | am__mv = mv -f | ||
77 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
78 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
79 | LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
80 | $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ | ||
81 | $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ | ||
82 | $(AM_CFLAGS) $(CFLAGS) | ||
83 | AM_V_CC = $(am__v_CC_$(V)) | ||
84 | am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) | ||
85 | am__v_CC_0 = @echo " CC " $@; | ||
86 | AM_V_at = $(am__v_at_$(V)) | ||
87 | am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) | ||
88 | am__v_at_0 = @ | ||
89 | CCLD = $(CC) | ||
90 | LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
91 | $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ | ||
92 | $(AM_LDFLAGS) $(LDFLAGS) -o $@ | ||
93 | AM_V_CCLD = $(am__v_CCLD_$(V)) | ||
94 | am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) | ||
95 | am__v_CCLD_0 = @echo " CCLD " $@; | ||
96 | AM_V_GEN = $(am__v_GEN_$(V)) | ||
97 | am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) | ||
98 | am__v_GEN_0 = @echo " GEN " $@; | ||
99 | SOURCES = $(evas_suite_SOURCES) | ||
100 | DIST_SOURCES = $(am__evas_suite_SOURCES_DIST) | ||
101 | ETAGS = etags | ||
102 | CTAGS = ctags | ||
103 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
104 | ACLOCAL = @ACLOCAL@ | ||
105 | ALLOCA = @ALLOCA@ | ||
106 | AMTAR = @AMTAR@ | ||
107 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | ||
108 | AR = @AR@ | ||
109 | AS = @AS@ | ||
110 | AUTOCONF = @AUTOCONF@ | ||
111 | AUTOHEADER = @AUTOHEADER@ | ||
112 | AUTOMAKE = @AUTOMAKE@ | ||
113 | AWK = @AWK@ | ||
114 | CC = @CC@ | ||
115 | CCDEPMODE = @CCDEPMODE@ | ||
116 | CFLAGS = @CFLAGS@ | ||
117 | CHECK_CFLAGS = @CHECK_CFLAGS@ | ||
118 | CHECK_LIBS = @CHECK_LIBS@ | ||
119 | CPP = @CPP@ | ||
120 | CPPFLAGS = @CPPFLAGS@ | ||
121 | CXX = @CXX@ | ||
122 | CXXCPP = @CXXCPP@ | ||
123 | CXXDEPMODE = @CXXDEPMODE@ | ||
124 | CXXFLAGS = @CXXFLAGS@ | ||
125 | CYGPATH_W = @CYGPATH_W@ | ||
126 | DEFS = @DEFS@ | ||
127 | DEPDIR = @DEPDIR@ | ||
128 | DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@ | ||
129 | DIRECTFB_LIBS = @DIRECTFB_LIBS@ | ||
130 | DLLTOOL = @DLLTOOL@ | ||
131 | DSYMUTIL = @DSYMUTIL@ | ||
132 | DUMPBIN = @DUMPBIN@ | ||
133 | ECHO_C = @ECHO_C@ | ||
134 | ECHO_N = @ECHO_N@ | ||
135 | ECHO_T = @ECHO_T@ | ||
136 | ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@ | ||
137 | ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@ | ||
138 | EDB_CFLAGS = @EDB_CFLAGS@ | ||
139 | EDB_LIBS = @EDB_LIBS@ | ||
140 | EDJE_CFLAGS = @EDJE_CFLAGS@ | ||
141 | EDJE_LIBS = @EDJE_LIBS@ | ||
142 | EET_CFLAGS = @EET_CFLAGS@ | ||
143 | EET_LIBS = @EET_LIBS@ | ||
144 | EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@ | ||
145 | EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@ | ||
146 | EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@ | ||
147 | EGREP = @EGREP@ | ||
148 | EINA_CFLAGS = @EINA_CFLAGS@ | ||
149 | EINA_LIBS = @EINA_LIBS@ | ||
150 | EVAS_CFLAGS = @EVAS_CFLAGS@ | ||
151 | EVAS_LIBS = @EVAS_LIBS@ | ||
152 | EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@ | ||
153 | EVIL_CFLAGS = @EVIL_CFLAGS@ | ||
154 | EVIL_LIBS = @EVIL_LIBS@ | ||
155 | EXEEXT = @EXEEXT@ | ||
156 | EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ | ||
157 | EXOTIC_LIBS = @EXOTIC_LIBS@ | ||
158 | FGREP = @FGREP@ | ||
159 | FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ | ||
160 | FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ | ||
161 | FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ | ||
162 | FREETYPE_LIBS = @FREETYPE_LIBS@ | ||
163 | FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ | ||
164 | FRIBIDI_LIBS = @FRIBIDI_LIBS@ | ||
165 | GL_EET_CFLAGS = @GL_EET_CFLAGS@ | ||
166 | GL_EET_LIBS = @GL_EET_LIBS@ | ||
167 | GREP = @GREP@ | ||
168 | HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ | ||
169 | HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ | ||
170 | INSTALL = @INSTALL@ | ||
171 | INSTALL_DATA = @INSTALL_DATA@ | ||
172 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
173 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
174 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
175 | LD = @LD@ | ||
176 | LDFLAGS = @LDFLAGS@ | ||
177 | LIBOBJS = @LIBOBJS@ | ||
178 | LIBS = @LIBS@ | ||
179 | LIBTOOL = @LIBTOOL@ | ||
180 | LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@ | ||
181 | LINEBREAK_LIBS = @LINEBREAK_LIBS@ | ||
182 | LIPO = @LIPO@ | ||
183 | LN_S = @LN_S@ | ||
184 | LTLIBOBJS = @LTLIBOBJS@ | ||
185 | MAKEINFO = @MAKEINFO@ | ||
186 | MKDIR_P = @MKDIR_P@ | ||
187 | MODULE_ARCH = @MODULE_ARCH@ | ||
188 | NM = @NM@ | ||
189 | NMEDIT = @NMEDIT@ | ||
190 | OBJC = @OBJC@ | ||
191 | OBJCDEPMODE = @OBJCDEPMODE@ | ||
192 | OBJCFLAGS = @OBJCFLAGS@ | ||
193 | OBJDUMP = @OBJDUMP@ | ||
194 | OBJEXT = @OBJEXT@ | ||
195 | OTOOL = @OTOOL@ | ||
196 | OTOOL64 = @OTOOL64@ | ||
197 | PACKAGE = @PACKAGE@ | ||
198 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
199 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
200 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
201 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
202 | PACKAGE_URL = @PACKAGE_URL@ | ||
203 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
204 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
205 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | ||
206 | PIXMAN_LIBS = @PIXMAN_LIBS@ | ||
207 | PKG_CONFIG = @PKG_CONFIG@ | ||
208 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
209 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
210 | PNG_CFLAGS = @PNG_CFLAGS@ | ||
211 | PNG_LIBS = @PNG_LIBS@ | ||
212 | RANLIB = @RANLIB@ | ||
213 | SDL_CFLAGS = @SDL_CFLAGS@ | ||
214 | SDL_LIBS = @SDL_LIBS@ | ||
215 | SED = @SED@ | ||
216 | SET_MAKE = @SET_MAKE@ | ||
217 | SHELL = @SHELL@ | ||
218 | SHM_OPEN_LINK = @SHM_OPEN_LINK@ | ||
219 | STRIP = @STRIP@ | ||
220 | SVG_CFLAGS = @SVG_CFLAGS@ | ||
221 | SVG_LIBS = @SVG_LIBS@ | ||
222 | VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | ||
223 | VALGRIND_LIBS = @VALGRIND_LIBS@ | ||
224 | VERSION = @VERSION@ | ||
225 | VMAJ = @VMAJ@ | ||
226 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
227 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
228 | XCB_CFLAGS = @XCB_CFLAGS@ | ||
229 | XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ | ||
230 | XCB_GL_LIBS = @XCB_GL_LIBS@ | ||
231 | XCB_LIBS = @XCB_LIBS@ | ||
232 | XEXT_CFLAGS = @XEXT_CFLAGS@ | ||
233 | XEXT_LIBS = @XEXT_LIBS@ | ||
234 | XMKMF = @XMKMF@ | ||
235 | X_CFLAGS = @X_CFLAGS@ | ||
236 | X_EXTRA_LIBS = @X_EXTRA_LIBS@ | ||
237 | X_LIBS = @X_LIBS@ | ||
238 | X_PRE_LIBS = @X_PRE_LIBS@ | ||
239 | abs_builddir = @abs_builddir@ | ||
240 | abs_srcdir = @abs_srcdir@ | ||
241 | abs_top_builddir = @abs_top_builddir@ | ||
242 | abs_top_srcdir = @abs_top_srcdir@ | ||
243 | ac_ct_CC = @ac_ct_CC@ | ||
244 | ac_ct_CXX = @ac_ct_CXX@ | ||
245 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ | ||
246 | ac_ct_OBJC = @ac_ct_OBJC@ | ||
247 | altivec_cflags = @altivec_cflags@ | ||
248 | am__include = @am__include@ | ||
249 | am__leading_dot = @am__leading_dot@ | ||
250 | am__quote = @am__quote@ | ||
251 | am__tar = @am__tar@ | ||
252 | am__untar = @am__untar@ | ||
253 | bindir = @bindir@ | ||
254 | build = @build@ | ||
255 | build_alias = @build_alias@ | ||
256 | build_cpu = @build_cpu@ | ||
257 | build_os = @build_os@ | ||
258 | build_vendor = @build_vendor@ | ||
259 | builddir = @builddir@ | ||
260 | datadir = @datadir@ | ||
261 | datarootdir = @datarootdir@ | ||
262 | dlopen_libs = @dlopen_libs@ | ||
263 | docdir = @docdir@ | ||
264 | dvidir = @dvidir@ | ||
265 | edje_cc = @edje_cc@ | ||
266 | efl_doxygen = @efl_doxygen@ | ||
267 | efl_have_doxygen = @efl_have_doxygen@ | ||
268 | evas_engine_buffer_cflags = @evas_engine_buffer_cflags@ | ||
269 | evas_engine_buffer_libs = @evas_engine_buffer_libs@ | ||
270 | evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@ | ||
271 | evas_engine_direct3d_libs = @evas_engine_direct3d_libs@ | ||
272 | evas_engine_directfb_cflags = @evas_engine_directfb_cflags@ | ||
273 | evas_engine_directfb_libs = @evas_engine_directfb_libs@ | ||
274 | evas_engine_fb_cflags = @evas_engine_fb_cflags@ | ||
275 | evas_engine_fb_libs = @evas_engine_fb_libs@ | ||
276 | evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@ | ||
277 | evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@ | ||
278 | evas_engine_gl_common_libs = @evas_engine_gl_common_libs@ | ||
279 | evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@ | ||
280 | evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@ | ||
281 | evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@ | ||
282 | evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@ | ||
283 | evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@ | ||
284 | evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@ | ||
285 | evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@ | ||
286 | evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@ | ||
287 | evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@ | ||
288 | evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@ | ||
289 | evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@ | ||
290 | evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@ | ||
291 | evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@ | ||
292 | evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@ | ||
293 | evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@ | ||
294 | evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@ | ||
295 | evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@ | ||
296 | evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@ | ||
297 | evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@ | ||
298 | evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ | ||
299 | evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ | ||
300 | evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ | ||
301 | evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | ||
302 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | ||
303 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | ||
304 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | ||
305 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
306 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
307 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
308 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
309 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | ||
310 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | ||
311 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | ||
312 | evas_image_loader_edb_libs = @evas_image_loader_edb_libs@ | ||
313 | evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@ | ||
314 | evas_image_loader_eet_libs = @evas_image_loader_eet_libs@ | ||
315 | evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@ | ||
316 | evas_image_loader_generic_libs = @evas_image_loader_generic_libs@ | ||
317 | evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@ | ||
318 | evas_image_loader_gif_libs = @evas_image_loader_gif_libs@ | ||
319 | evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@ | ||
320 | evas_image_loader_ico_libs = @evas_image_loader_ico_libs@ | ||
321 | evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@ | ||
322 | evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@ | ||
323 | evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@ | ||
324 | evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@ | ||
325 | evas_image_loader_png_cflags = @evas_image_loader_png_cflags@ | ||
326 | evas_image_loader_png_libs = @evas_image_loader_png_libs@ | ||
327 | evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@ | ||
328 | evas_image_loader_psd_libs = @evas_image_loader_psd_libs@ | ||
329 | evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@ | ||
330 | evas_image_loader_svg_libs = @evas_image_loader_svg_libs@ | ||
331 | evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@ | ||
332 | evas_image_loader_tga_libs = @evas_image_loader_tga_libs@ | ||
333 | evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@ | ||
334 | evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@ | ||
335 | evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@ | ||
336 | evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@ | ||
337 | evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@ | ||
338 | evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@ | ||
339 | exec_prefix = @exec_prefix@ | ||
340 | have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@ | ||
341 | have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@ | ||
342 | have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@ | ||
343 | have_evas_engine_software_x11 = @have_evas_engine_software_x11@ | ||
344 | have_evas_engine_software_xcb = @have_evas_engine_software_xcb@ | ||
345 | have_evas_engine_software_xlib = @have_evas_engine_software_xlib@ | ||
346 | have_lcov = @have_lcov@ | ||
347 | host = @host@ | ||
348 | host_alias = @host_alias@ | ||
349 | host_cpu = @host_cpu@ | ||
350 | host_os = @host_os@ | ||
351 | host_vendor = @host_vendor@ | ||
352 | htmldir = @htmldir@ | ||
353 | includedir = @includedir@ | ||
354 | infodir = @infodir@ | ||
355 | install_sh = @install_sh@ | ||
356 | libdir = @libdir@ | ||
357 | libexecdir = @libexecdir@ | ||
358 | localedir = @localedir@ | ||
359 | localstatedir = @localstatedir@ | ||
360 | lt_ECHO = @lt_ECHO@ | ||
361 | lt_enable_auto_import = @lt_enable_auto_import@ | ||
362 | mandir = @mandir@ | ||
363 | mkdir_p = @mkdir_p@ | ||
364 | oldincludedir = @oldincludedir@ | ||
365 | pdfdir = @pdfdir@ | ||
366 | pkgconfig_requires_private = @pkgconfig_requires_private@ | ||
367 | prefix = @prefix@ | ||
368 | program_transform_name = @program_transform_name@ | ||
369 | psdir = @psdir@ | ||
370 | pthread_cflags = @pthread_cflags@ | ||
371 | pthread_libs = @pthread_libs@ | ||
372 | release_info = @release_info@ | ||
373 | requirement_evas = @requirement_evas@ | ||
374 | sbindir = @sbindir@ | ||
375 | sharedstatedir = @sharedstatedir@ | ||
376 | srcdir = @srcdir@ | ||
377 | sysconfdir = @sysconfdir@ | ||
378 | target_alias = @target_alias@ | ||
379 | top_build_prefix = @top_build_prefix@ | ||
380 | top_builddir = @top_builddir@ | ||
381 | top_srcdir = @top_srcdir@ | ||
382 | version_info = @version_info@ | ||
383 | MAINTAINERCLEANFILES = Makefile.in | ||
384 | AM_CPPFLAGS = \ | ||
385 | -I$(top_srcdir)/src/lib \ | ||
386 | -I$(top_srcdir)/src/include \ | ||
387 | -I$(top_builddir)/src/include \ | ||
388 | -I$(top_builddir)/src/lib \ | ||
389 | -DPACKAGE_BIN_DIR=\"$(bindir)\" \ | ||
390 | -DPACKAGE_LIB_DIR=\"$(libdir)\" \ | ||
391 | -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ | ||
392 | @EINA_CFLAGS@ \ | ||
393 | @CHECK_CFLAGS@ | ||
394 | |||
395 | @EFL_ENABLE_TESTS_TRUE@evas_suite_SOURCES = \ | ||
396 | @EFL_ENABLE_TESTS_TRUE@evas_suite.c \ | ||
397 | @EFL_ENABLE_TESTS_TRUE@evas_test_init.c \ | ||
398 | @EFL_ENABLE_TESTS_TRUE@evas_test_textblock.c \ | ||
399 | @EFL_ENABLE_TESTS_TRUE@evas_test_text.c \ | ||
400 | @EFL_ENABLE_TESTS_TRUE@evas_test_callbacks.c \ | ||
401 | @EFL_ENABLE_TESTS_TRUE@evas_tests_helpers.h \ | ||
402 | @EFL_ENABLE_TESTS_TRUE@evas_suite.h | ||
403 | |||
404 | @EFL_ENABLE_TESTS_TRUE@evas_suite_LDADD = @CHECK_LIBS@ $(top_builddir)/src/lib/libevas.la @EINA_LIBS@ | ||
405 | all: all-am | ||
406 | |||
407 | .SUFFIXES: | ||
408 | .SUFFIXES: .c .lo .o .obj | ||
409 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
410 | @for dep in $?; do \ | ||
411 | case '$(am__configure_deps)' in \ | ||
412 | *$$dep*) \ | ||
413 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ | ||
414 | && { if test -f $@; then exit 0; else break; fi; }; \ | ||
415 | exit 1;; \ | ||
416 | esac; \ | ||
417 | done; \ | ||
418 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/tests/Makefile'; \ | ||
419 | $(am__cd) $(top_srcdir) && \ | ||
420 | $(AUTOMAKE) --gnu src/tests/Makefile | ||
421 | .PRECIOUS: Makefile | ||
422 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
423 | @case '$?' in \ | ||
424 | *config.status*) \ | ||
425 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
426 | *) \ | ||
427 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
428 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
429 | esac; | ||
430 | |||
431 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
432 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
433 | |||
434 | $(top_srcdir)/configure: $(am__configure_deps) | ||
435 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
436 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
437 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
438 | $(am__aclocal_m4_deps): | ||
439 | |||
440 | clean-checkPROGRAMS: | ||
441 | @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ | ||
442 | echo " rm -f" $$list; \ | ||
443 | rm -f $$list || exit $$?; \ | ||
444 | test -n "$(EXEEXT)" || exit 0; \ | ||
445 | list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ | ||
446 | echo " rm -f" $$list; \ | ||
447 | rm -f $$list | ||
448 | evas_suite$(EXEEXT): $(evas_suite_OBJECTS) $(evas_suite_DEPENDENCIES) | ||
449 | @rm -f evas_suite$(EXEEXT) | ||
450 | $(AM_V_CCLD)$(LINK) $(evas_suite_OBJECTS) $(evas_suite_LDADD) $(LIBS) | ||
451 | |||
452 | mostlyclean-compile: | ||
453 | -rm -f *.$(OBJEXT) | ||
454 | |||
455 | distclean-compile: | ||
456 | -rm -f *.tab.c | ||
457 | |||
458 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_suite.Po@am__quote@ | ||
459 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_test_callbacks.Po@am__quote@ | ||
460 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_test_init.Po@am__quote@ | ||
461 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_test_text.Po@am__quote@ | ||
462 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_test_textblock.Po@am__quote@ | ||
463 | |||
464 | .c.o: | ||
465 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
466 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
467 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
468 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
469 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
470 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< | ||
471 | |||
472 | .c.obj: | ||
473 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
474 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
475 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
476 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
477 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
478 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
479 | |||
480 | .c.lo: | ||
481 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
482 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
483 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
484 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ | ||
485 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
486 | @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< | ||
487 | |||
488 | mostlyclean-libtool: | ||
489 | -rm -f *.lo | ||
490 | |||
491 | clean-libtool: | ||
492 | -rm -rf .libs _libs | ||
493 | |||
494 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
495 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
496 | unique=`for i in $$list; do \ | ||
497 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
498 | done | \ | ||
499 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
500 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
501 | mkid -fID $$unique | ||
502 | tags: TAGS | ||
503 | |||
504 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
505 | $(TAGS_FILES) $(LISP) | ||
506 | set x; \ | ||
507 | here=`pwd`; \ | ||
508 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
509 | unique=`for i in $$list; do \ | ||
510 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
511 | done | \ | ||
512 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
513 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
514 | shift; \ | ||
515 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ | ||
516 | test -n "$$unique" || unique=$$empty_fix; \ | ||
517 | if test $$# -gt 0; then \ | ||
518 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
519 | "$$@" $$unique; \ | ||
520 | else \ | ||
521 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
522 | $$unique; \ | ||
523 | fi; \ | ||
524 | fi | ||
525 | ctags: CTAGS | ||
526 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
527 | $(TAGS_FILES) $(LISP) | ||
528 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
529 | unique=`for i in $$list; do \ | ||
530 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
531 | done | \ | ||
532 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
533 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
534 | test -z "$(CTAGS_ARGS)$$unique" \ | ||
535 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
536 | $$unique | ||
537 | |||
538 | GTAGS: | ||
539 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
540 | && $(am__cd) $(top_srcdir) \ | ||
541 | && gtags -i $(GTAGS_ARGS) "$$here" | ||
542 | |||
543 | distclean-tags: | ||
544 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
545 | |||
546 | distdir: $(DISTFILES) | ||
547 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
548 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
549 | list='$(DISTFILES)'; \ | ||
550 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
551 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
552 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
553 | case $$dist_files in \ | ||
554 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
555 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
556 | sort -u` ;; \ | ||
557 | esac; \ | ||
558 | for file in $$dist_files; do \ | ||
559 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
560 | if test -d $$d/$$file; then \ | ||
561 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
562 | if test -d "$(distdir)/$$file"; then \ | ||
563 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
564 | fi; \ | ||
565 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
566 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ | ||
567 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
568 | fi; \ | ||
569 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ | ||
570 | else \ | ||
571 | test -f "$(distdir)/$$file" \ | ||
572 | || cp -p $$d/$$file "$(distdir)/$$file" \ | ||
573 | || exit 1; \ | ||
574 | fi; \ | ||
575 | done | ||
576 | check-am: all-am | ||
577 | $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) | ||
578 | check: check-am | ||
579 | all-am: Makefile | ||
580 | installdirs: | ||
581 | install: install-am | ||
582 | install-exec: install-exec-am | ||
583 | install-data: install-data-am | ||
584 | uninstall: uninstall-am | ||
585 | |||
586 | install-am: all-am | ||
587 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
588 | |||
589 | installcheck: installcheck-am | ||
590 | install-strip: | ||
591 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
592 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
593 | `test -z '$(STRIP)' || \ | ||
594 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
595 | mostlyclean-generic: | ||
596 | |||
597 | clean-generic: | ||
598 | |||
599 | distclean-generic: | ||
600 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
601 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) | ||
602 | |||
603 | maintainer-clean-generic: | ||
604 | @echo "This command is intended for maintainers to use" | ||
605 | @echo "it deletes files that may require special tools to rebuild." | ||
606 | -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) | ||
607 | clean: clean-am | ||
608 | |||
609 | clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ | ||
610 | mostlyclean-am | ||
611 | |||
612 | distclean: distclean-am | ||
613 | -rm -rf ./$(DEPDIR) | ||
614 | -rm -f Makefile | ||
615 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
616 | distclean-tags | ||
617 | |||
618 | dvi: dvi-am | ||
619 | |||
620 | dvi-am: | ||
621 | |||
622 | html: html-am | ||
623 | |||
624 | html-am: | ||
625 | |||
626 | info: info-am | ||
627 | |||
628 | info-am: | ||
629 | |||
630 | install-data-am: | ||
631 | |||
632 | install-dvi: install-dvi-am | ||
633 | |||
634 | install-dvi-am: | ||
635 | |||
636 | install-exec-am: | ||
637 | |||
638 | install-html: install-html-am | ||
639 | |||
640 | install-html-am: | ||
641 | |||
642 | install-info: install-info-am | ||
643 | |||
644 | install-info-am: | ||
645 | |||
646 | install-man: | ||
647 | |||
648 | install-pdf: install-pdf-am | ||
649 | |||
650 | install-pdf-am: | ||
651 | |||
652 | install-ps: install-ps-am | ||
653 | |||
654 | install-ps-am: | ||
655 | |||
656 | installcheck-am: | ||
657 | |||
658 | maintainer-clean: maintainer-clean-am | ||
659 | -rm -rf ./$(DEPDIR) | ||
660 | -rm -f Makefile | ||
661 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
662 | |||
663 | mostlyclean: mostlyclean-am | ||
664 | |||
665 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
666 | mostlyclean-libtool | ||
667 | |||
668 | pdf: pdf-am | ||
669 | |||
670 | pdf-am: | ||
671 | |||
672 | ps: ps-am | ||
673 | |||
674 | ps-am: | ||
675 | |||
676 | uninstall-am: | ||
677 | |||
678 | .MAKE: check-am install-am install-strip | ||
679 | |||
680 | .PHONY: CTAGS GTAGS all all-am check check-am clean \ | ||
681 | clean-checkPROGRAMS clean-generic clean-libtool ctags \ | ||
682 | distclean distclean-compile distclean-generic \ | ||
683 | distclean-libtool distclean-tags distdir dvi dvi-am html \ | ||
684 | html-am info info-am install install-am install-data \ | ||
685 | install-data-am install-dvi install-dvi-am install-exec \ | ||
686 | install-exec-am install-html install-html-am install-info \ | ||
687 | install-info-am install-man install-pdf install-pdf-am \ | ||
688 | install-ps install-ps-am install-strip installcheck \ | ||
689 | installcheck-am installdirs maintainer-clean \ | ||
690 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | ||
691 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
692 | tags uninstall uninstall-am | ||
693 | |||
694 | |||
695 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
696 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
697 | .NOEXPORT: | ||
diff --git a/libraries/evas/src/tests/evas_suite.c b/libraries/evas/src/tests/evas_suite.c deleted file mode 100644 index 55f4123..0000000 --- a/libraries/evas/src/tests/evas_suite.c +++ /dev/null | |||
@@ -1,104 +0,0 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include <config.h> | ||
3 | #endif | ||
4 | |||
5 | #include <stdlib.h> | ||
6 | #include <stdio.h> | ||
7 | |||
8 | #include <Evas.h> | ||
9 | |||
10 | #include "evas_suite.h" | ||
11 | |||
12 | typedef struct _Evas_Test_Case Evas_Test_Case; | ||
13 | |||
14 | struct _Evas_Test_Case | ||
15 | { | ||
16 | const char *test_case; | ||
17 | void (*build)(TCase *tc); | ||
18 | }; | ||
19 | |||
20 | static const Evas_Test_Case etc[] = { | ||
21 | { "Evas", evas_test_init }, | ||
22 | { "Object Textblock", evas_test_textblock }, | ||
23 | { "Object Text", evas_test_text }, | ||
24 | { "Callbacks", evas_test_callbacks }, | ||
25 | { NULL, NULL } | ||
26 | }; | ||
27 | |||
28 | static void | ||
29 | _list_tests(void) | ||
30 | { | ||
31 | const Evas_Test_Case *itr; | ||
32 | |||
33 | itr = etc; | ||
34 | fputs("Available Test Cases:\n", stderr); | ||
35 | for (; itr->test_case; itr++) | ||
36 | fprintf(stderr, "\t%s\n", itr->test_case); | ||
37 | } | ||
38 | static Eina_Bool | ||
39 | _use_test(int argc, const char **argv, const char *test_case) | ||
40 | { | ||
41 | if (argc < 1) | ||
42 | return 1; | ||
43 | |||
44 | for (; argc > 0; argc--, argv++) | ||
45 | if (strcmp(test_case, *argv) == 0) | ||
46 | return 1; | ||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | static Suite * | ||
51 | evas_suite_build(int argc, const char **argv) | ||
52 | { | ||
53 | TCase *tc; | ||
54 | Suite *s; | ||
55 | int i; | ||
56 | |||
57 | s = suite_create("Evas"); | ||
58 | |||
59 | for (i = 0; etc[i].test_case; ++i) | ||
60 | { | ||
61 | if (!_use_test(argc, argv, etc[i].test_case)) continue; | ||
62 | tc = tcase_create(etc[i].test_case); | ||
63 | |||
64 | etc[i].build(tc); | ||
65 | |||
66 | suite_add_tcase(s, tc); | ||
67 | tcase_set_timeout(tc, 0); | ||
68 | } | ||
69 | |||
70 | return s; | ||
71 | } | ||
72 | |||
73 | int | ||
74 | main(int argc, char **argv) | ||
75 | { | ||
76 | Suite *s; | ||
77 | SRunner *sr; | ||
78 | int i, failed_count; | ||
79 | |||
80 | for (i = 1; i < argc; i++) | ||
81 | if ((strcmp(argv[i], "-h") == 0) || | ||
82 | (strcmp(argv[i], "--help") == 0)) | ||
83 | { | ||
84 | fprintf(stderr, "Usage:\n\t%s [test_case1 .. [test_caseN]]\n", | ||
85 | argv[0]); | ||
86 | _list_tests(); | ||
87 | return 0; | ||
88 | } | ||
89 | else if ((strcmp(argv[i], "-l") == 0) || | ||
90 | (strcmp(argv[i], "--list") == 0)) | ||
91 | { | ||
92 | _list_tests(); | ||
93 | return 0; | ||
94 | } | ||
95 | |||
96 | s = evas_suite_build(argc - 1, (const char **)argv + 1); | ||
97 | sr = srunner_create(s); | ||
98 | |||
99 | srunner_run_all(sr, CK_ENV); | ||
100 | failed_count = srunner_ntests_failed(sr); | ||
101 | srunner_free(sr); | ||
102 | |||
103 | return (failed_count == 0) ? 0 : 255; | ||
104 | } | ||
diff --git a/libraries/evas/src/tests/evas_suite.h b/libraries/evas/src/tests/evas_suite.h deleted file mode 100644 index 31d6d18..0000000 --- a/libraries/evas/src/tests/evas_suite.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #ifndef _EVAS_SUITE_H | ||
2 | #define _EVAS_SUITE_H | ||
3 | |||
4 | #include <check.h> | ||
5 | |||
6 | void evas_test_init(TCase *tc); | ||
7 | void evas_test_textblock(TCase *tc); | ||
8 | void evas_test_text(TCase *tc); | ||
9 | void evas_test_callbacks(TCase *tc); | ||
10 | |||
11 | |||
12 | #endif /* _EVAS_SUITE_H */ | ||
diff --git a/libraries/evas/src/tests/evas_test_callbacks.c b/libraries/evas/src/tests/evas_test_callbacks.c deleted file mode 100644 index 164851e..0000000 --- a/libraries/evas/src/tests/evas_test_callbacks.c +++ /dev/null | |||
@@ -1,135 +0,0 @@ | |||
1 | |||
2 | #ifdef HAVE_CONFIG_H | ||
3 | # include "config.h" | ||
4 | #endif | ||
5 | |||
6 | #include <stdio.h> | ||
7 | |||
8 | #include "evas_suite.h" | ||
9 | #include "Evas.h" | ||
10 | #include "evas_tests_helpers.h" | ||
11 | |||
12 | #define START_CALLBACK_TEST() \ | ||
13 | Evas *evas; \ | ||
14 | Evas_Object *rect; \ | ||
15 | evas = EVAS_TEST_INIT_EVAS(); \ | ||
16 | rect = evas_object_rectangle_add(evas); \ | ||
17 | do \ | ||
18 | { \ | ||
19 | } \ | ||
20 | while (0) | ||
21 | |||
22 | #define END_CALLBACK_TEST() \ | ||
23 | do \ | ||
24 | { \ | ||
25 | evas_object_del(rect); \ | ||
26 | evas_free(evas); \ | ||
27 | evas_shutdown(); \ | ||
28 | } \ | ||
29 | while (0) | ||
30 | |||
31 | static uintptr_t counter = 1; | ||
32 | |||
33 | static void | ||
34 | _obj_event_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) | ||
35 | { | ||
36 | (void) e; | ||
37 | (void) obj; | ||
38 | (void) event_info; | ||
39 | |||
40 | fail_if(((uintptr_t) data) != counter); | ||
41 | |||
42 | counter++; | ||
43 | } | ||
44 | |||
45 | START_TEST(evas_object_event_callbacks_priority) | ||
46 | { | ||
47 | START_CALLBACK_TEST(); | ||
48 | counter = 1; | ||
49 | evas_object_event_callback_priority_add(rect, EVAS_CALLBACK_MOVE, -10, | ||
50 | _obj_event_cb, (void *) 1); | ||
51 | evas_object_event_callback_priority_add(rect, EVAS_CALLBACK_MOVE, 0, | ||
52 | _obj_event_cb, (void *) 2); | ||
53 | evas_object_event_callback_priority_add(rect, EVAS_CALLBACK_MOVE, 10, | ||
54 | _obj_event_cb, (void *) 3); | ||
55 | evas_object_move(rect, 2, 2); | ||
56 | |||
57 | /* Make sure we got through all the callbacks */ | ||
58 | fail_if(counter != 4); | ||
59 | |||
60 | /* Delete _obj_event_cb 3 times */ | ||
61 | evas_object_event_callback_del(rect, EVAS_CALLBACK_MOVE, _obj_event_cb); | ||
62 | evas_object_event_callback_del(rect, EVAS_CALLBACK_MOVE, _obj_event_cb); | ||
63 | evas_object_event_callback_del(rect, EVAS_CALLBACK_MOVE, _obj_event_cb); | ||
64 | counter = 1; | ||
65 | evas_object_event_callback_priority_add(rect, EVAS_CALLBACK_MOVE, 0, | ||
66 | _obj_event_cb, (void *) 2); | ||
67 | evas_object_event_callback_priority_add(rect, EVAS_CALLBACK_MOVE, -10, | ||
68 | _obj_event_cb, (void *) 1); | ||
69 | evas_object_event_callback_priority_add(rect, EVAS_CALLBACK_MOVE, 10, | ||
70 | _obj_event_cb, (void *) 3); | ||
71 | evas_object_move(rect, 3, 3); | ||
72 | |||
73 | /* Make sure we got through all the callbacks */ | ||
74 | fail_if(counter != 4); | ||
75 | |||
76 | END_CALLBACK_TEST(); | ||
77 | } | ||
78 | END_TEST | ||
79 | |||
80 | static void | ||
81 | _event_cb(void *data, Evas *e, void *event_info) | ||
82 | { | ||
83 | (void) e; | ||
84 | (void) event_info; | ||
85 | |||
86 | fail_if(((uintptr_t) data) != counter); | ||
87 | |||
88 | counter++; | ||
89 | } | ||
90 | |||
91 | START_TEST(evas_event_callbacks_priority) | ||
92 | { | ||
93 | START_CALLBACK_TEST(); | ||
94 | evas_object_focus_set(rect, EINA_FALSE); | ||
95 | counter = 1; | ||
96 | evas_event_callback_priority_add(evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, | ||
97 | -10, _event_cb, (void *) 1); | ||
98 | evas_event_callback_priority_add(evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, | ||
99 | 0, _event_cb, (void *) 2); | ||
100 | evas_event_callback_priority_add(evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, | ||
101 | 10, _event_cb, (void *) 3); | ||
102 | evas_object_focus_set(rect, EINA_TRUE); | ||
103 | |||
104 | /* Make sure we got through all the callbacks */ | ||
105 | fail_if(counter != 4); | ||
106 | |||
107 | /* Delete _event_cb 3 times */ | ||
108 | evas_event_callback_del(evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, | ||
109 | _event_cb); | ||
110 | evas_event_callback_del(evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, | ||
111 | _event_cb); | ||
112 | evas_event_callback_del(evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, | ||
113 | _event_cb); | ||
114 | evas_object_focus_set(rect, EINA_FALSE); | ||
115 | counter = 1; | ||
116 | evas_event_callback_priority_add(evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, | ||
117 | 0, _event_cb, (void *) 2); | ||
118 | evas_event_callback_priority_add(evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, | ||
119 | -10, _event_cb, (void *) 1); | ||
120 | evas_event_callback_priority_add(evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, | ||
121 | 10, _event_cb, (void *) 3); | ||
122 | evas_object_focus_set(rect, EINA_TRUE); | ||
123 | |||
124 | /* Make sure we got through all the callbacks */ | ||
125 | fail_if(counter != 4); | ||
126 | |||
127 | END_CALLBACK_TEST(); | ||
128 | } | ||
129 | END_TEST | ||
130 | |||
131 | void evas_test_callbacks(TCase *tc) | ||
132 | { | ||
133 | tcase_add_test(tc, evas_object_event_callbacks_priority); | ||
134 | tcase_add_test(tc, evas_event_callbacks_priority); | ||
135 | } | ||
diff --git a/libraries/evas/src/tests/evas_test_init.c b/libraries/evas/src/tests/evas_test_init.c deleted file mode 100644 index f4271ec..0000000 --- a/libraries/evas/src/tests/evas_test_init.c +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | |||
2 | #ifdef HAVE_CONFIG_H | ||
3 | # include "config.h" | ||
4 | #endif | ||
5 | |||
6 | #include <stdio.h> | ||
7 | |||
8 | #include "evas_suite.h" | ||
9 | #include "Evas.h" | ||
10 | |||
11 | START_TEST(evas_simple) | ||
12 | { | ||
13 | fail_if(evas_init() != 1); /* one init by test suite */ | ||
14 | fail_if(evas_shutdown() != 0); | ||
15 | } | ||
16 | END_TEST | ||
17 | |||
18 | void evas_test_init(TCase *tc) | ||
19 | { | ||
20 | tcase_add_test(tc, evas_simple); | ||
21 | } | ||
diff --git a/libraries/evas/src/tests/evas_test_text.c b/libraries/evas/src/tests/evas_test_text.c deleted file mode 100644 index f87ee79..0000000 --- a/libraries/evas/src/tests/evas_test_text.c +++ /dev/null | |||
@@ -1,493 +0,0 @@ | |||
1 | |||
2 | #ifdef HAVE_CONFIG_H | ||
3 | # include "config.h" | ||
4 | #endif | ||
5 | |||
6 | #include <stdio.h> | ||
7 | |||
8 | #include "evas_suite.h" | ||
9 | #include "Evas.h" | ||
10 | #include "evas_tests_helpers.h" | ||
11 | |||
12 | #define START_TEXT_TEST() \ | ||
13 | Evas *evas; \ | ||
14 | Evas_Object *to; \ | ||
15 | evas = EVAS_TEST_INIT_EVAS(); \ | ||
16 | evas_font_hinting_set(evas, EVAS_FONT_HINTING_AUTO); \ | ||
17 | to = evas_object_text_add(evas); \ | ||
18 | do \ | ||
19 | { \ | ||
20 | } \ | ||
21 | while (0) | ||
22 | |||
23 | #define END_TEXT_TEST() \ | ||
24 | do \ | ||
25 | { \ | ||
26 | evas_object_del(to); \ | ||
27 | evas_free(evas); \ | ||
28 | evas_shutdown(); \ | ||
29 | } \ | ||
30 | while (0) | ||
31 | |||
32 | START_TEST(evas_text_simple) | ||
33 | { | ||
34 | START_TEXT_TEST(); | ||
35 | const char *buf = "Test - בדיקה"; | ||
36 | evas_object_text_text_set(to, buf); | ||
37 | fail_if(strcmp(evas_object_text_text_get(to), buf)); | ||
38 | END_TEXT_TEST(); | ||
39 | } | ||
40 | END_TEST | ||
41 | |||
42 | /* Various text related geometries */ | ||
43 | START_TEST(evas_text_geometries) | ||
44 | { | ||
45 | START_TEXT_TEST(); | ||
46 | const char *buf = "Tests"; | ||
47 | const char *font = "Sans"; | ||
48 | Evas_Font_Size size = 14; | ||
49 | Evas_Coord prev; | ||
50 | int i; | ||
51 | Evas_Coord x, y, w, h, px; | ||
52 | |||
53 | evas_object_text_text_set(to, buf); | ||
54 | |||
55 | /* All should be 0 without a font set */ | ||
56 | fail_if(evas_object_text_ascent_get(to) != 0); | ||
57 | fail_if(evas_object_text_descent_get(to) != 0); | ||
58 | fail_if(evas_object_text_max_ascent_get(to) != 0); | ||
59 | fail_if(evas_object_text_max_descent_get(to) != 0); | ||
60 | fail_if(evas_object_text_horiz_advance_get(to) != 0); | ||
61 | fail_if(evas_object_text_vert_advance_get(to) != 0); | ||
62 | |||
63 | evas_object_text_font_set(to, font, size); | ||
64 | |||
65 | /* Check that they are bigger than 0. */ | ||
66 | fail_if(evas_object_text_ascent_get(to) <= 0); | ||
67 | fail_if(evas_object_text_descent_get(to) <= 0); | ||
68 | fail_if(evas_object_text_max_ascent_get(to) <= 0); | ||
69 | fail_if(evas_object_text_max_descent_get(to) <= 0); | ||
70 | fail_if(evas_object_text_horiz_advance_get(to) <= 0); | ||
71 | fail_if(evas_object_text_vert_advance_get(to) <= 0); | ||
72 | |||
73 | /* Check that expanding the text does what we expect it */ | ||
74 | evas_object_text_text_set(to, "Test"); | ||
75 | prev = evas_object_text_ascent_get(to); | ||
76 | evas_object_text_text_set(to, "Testing"); | ||
77 | fail_if(evas_object_text_ascent_get(to) != prev); | ||
78 | |||
79 | evas_object_text_text_set(to, "Test"); | ||
80 | prev = evas_object_text_descent_get(to); | ||
81 | evas_object_text_text_set(to, "Testing"); | ||
82 | fail_if(evas_object_text_descent_get(to) != prev); | ||
83 | |||
84 | evas_object_text_text_set(to, "Test"); | ||
85 | prev = evas_object_text_max_ascent_get(to); | ||
86 | evas_object_text_text_set(to, "Testing"); | ||
87 | fail_if(evas_object_text_max_ascent_get(to) != prev); | ||
88 | |||
89 | evas_object_text_text_set(to, "Test"); | ||
90 | prev = evas_object_text_max_descent_get(to); | ||
91 | evas_object_text_text_set(to, "Testing"); | ||
92 | fail_if(evas_object_text_max_descent_get(to) != prev); | ||
93 | |||
94 | evas_object_text_text_set(to, "Test"); | ||
95 | prev = evas_object_text_horiz_advance_get(to); | ||
96 | evas_object_text_text_set(to, "Testing"); | ||
97 | fail_if(evas_object_text_horiz_advance_get(to) <= prev); | ||
98 | |||
99 | evas_object_text_text_set(to, "Test"); | ||
100 | prev = evas_object_text_vert_advance_get(to); | ||
101 | evas_object_text_text_set(to, "Testing"); | ||
102 | fail_if(evas_object_text_vert_advance_get(to) != prev); | ||
103 | |||
104 | /* Go through all the characters, making sure the geometries we get | ||
105 | * are in a monotonically increasing order and that all sizes are | ||
106 | * bigger than 0. */ | ||
107 | evas_object_text_text_set(to, "Testing..."); | ||
108 | x = 0; | ||
109 | px = -100; | ||
110 | for (i = 0 ; i < eina_unicode_utf8_get_len("Testing...") ; i++) | ||
111 | { | ||
112 | fail_if(!evas_object_text_char_pos_get(to, i, &x, &y, &w, &h)); | ||
113 | fail_if(x <= px); | ||
114 | px = x; | ||
115 | /* Get back the coords */ | ||
116 | fail_if(i != evas_object_text_char_coords_get(to, x + (w / 2), | ||
117 | y + (h / 2), &x, &y, &w, &h)); | ||
118 | } | ||
119 | |||
120 | /* Last up to pos */ | ||
121 | Evas_Coord adv; | ||
122 | int pos, prev_pos; | ||
123 | evas_object_text_text_set(to, "Test - 유니코드"); | ||
124 | adv = evas_object_text_horiz_advance_get(to); | ||
125 | pos = prev_pos = 0; | ||
126 | for (x = 0 ; x <= (adv - 1) ; x++) | ||
127 | { | ||
128 | pos = evas_object_text_last_up_to_pos(to, x, 0); | ||
129 | fail_if(pos < prev_pos); | ||
130 | prev_pos = pos; | ||
131 | } | ||
132 | pos = evas_object_text_last_up_to_pos(to, x, 0); | ||
133 | fail_if(pos != -1); | ||
134 | pos = evas_object_text_last_up_to_pos(to, -50, 0); | ||
135 | fail_if(pos != -1); | ||
136 | |||
137 | END_TEXT_TEST(); | ||
138 | } | ||
139 | END_TEST | ||
140 | |||
141 | /* Various evas stuff, such as scale */ | ||
142 | START_TEST(evas_text_evas) | ||
143 | { | ||
144 | Evas_Coord w, h, bw, bh; | ||
145 | START_TEXT_TEST(); | ||
146 | const char *buf = "Test - בדיקה"; | ||
147 | const char *font = "Sans"; | ||
148 | Evas_Font_Size size = 14; | ||
149 | |||
150 | evas_object_text_font_set(to, font, size); | ||
151 | evas_object_text_text_set(to, buf); | ||
152 | evas_object_geometry_get(to, NULL, NULL, &bw, &bh); | ||
153 | evas_object_scale_set(to, 3.0); | ||
154 | evas_object_geometry_get(to, NULL, NULL, &w, &h); | ||
155 | fail_if((w <= bw) || (h <= bh)); | ||
156 | |||
157 | evas_object_scale_set(to, 0.5); | ||
158 | evas_object_geometry_get(to, NULL, NULL, &w, &h); | ||
159 | fail_if((w >= bw) || (h >= bh)); | ||
160 | |||
161 | END_TEXT_TEST(); | ||
162 | } | ||
163 | END_TEST | ||
164 | |||
165 | /* Tests for functions that are in evas_object_text.c but | ||
166 | * don't really have anything to do with it. */ | ||
167 | START_TEST(evas_text_unrelated) | ||
168 | { | ||
169 | START_TEXT_TEST(); | ||
170 | const char *buf = "נסיון"; | ||
171 | int pos; | ||
172 | Eina_Unicode value; | ||
173 | /* Actually, they are tested in eina, just doing it for completeness. */ | ||
174 | fail_if(evas_string_char_len_get(buf) != 5); | ||
175 | |||
176 | pos = 0; | ||
177 | fail_if(2 != evas_string_char_next_get(buf, pos, &value)); | ||
178 | fail_if(value != L'נ'); | ||
179 | |||
180 | pos = 2; | ||
181 | fail_if(0 != evas_string_char_prev_get(buf, pos, &value)); | ||
182 | fail_if(value != L'ס'); | ||
183 | |||
184 | END_TEXT_TEST(); | ||
185 | } | ||
186 | END_TEST | ||
187 | |||
188 | #define _CHECK_SET_GET(x) \ | ||
189 | do \ | ||
190 | { \ | ||
191 | Evas_Coord r, g, b, a; \ | ||
192 | evas_object_text_##x##_set(to, 100, 150, 125, 12); \ | ||
193 | evas_object_text_##x##_get(to, &r, &g, &b, &a); \ | ||
194 | fail_if((r != 100) || (g != 150) || (b != 125) || (a != 12)); \ | ||
195 | /* Set to the same value */ \ | ||
196 | evas_object_text_##x##_set(to, 100, 150, 125, 12); \ | ||
197 | evas_object_text_##x##_get(to, &r, &g, &b, &a); \ | ||
198 | fail_if((r != 100) || (g != 150) || (b != 125) || (a != 12)); \ | ||
199 | } \ | ||
200 | while (0) | ||
201 | |||
202 | START_TEST(evas_text_set_get) | ||
203 | { | ||
204 | START_TEXT_TEST(); | ||
205 | const char *buf = "Test - בדיקה"; | ||
206 | /* Text */ | ||
207 | evas_object_text_text_set(to, buf); | ||
208 | fail_if(strcmp(evas_object_text_text_get(to), buf)); | ||
209 | |||
210 | /* Colors */ | ||
211 | _CHECK_SET_GET(shadow_color); | ||
212 | _CHECK_SET_GET(glow_color); | ||
213 | _CHECK_SET_GET(glow2_color); | ||
214 | _CHECK_SET_GET(outline_color); | ||
215 | |||
216 | /* Font and size */ | ||
217 | const char *font = "Sans"; | ||
218 | Evas_Font_Size size = 14; | ||
219 | evas_object_text_font_set(to, font, size); | ||
220 | font = NULL; | ||
221 | size = 0; | ||
222 | evas_object_text_font_get(to, &font, &size); | ||
223 | fail_if(strcmp(font, "Sans")); | ||
224 | fail_if(size != 14); | ||
225 | evas_object_text_font_set(to, font, size); | ||
226 | font = NULL; | ||
227 | size = 0; | ||
228 | evas_object_text_font_get(to, &font, &size); | ||
229 | fail_if(strcmp(font, "Sans")); | ||
230 | fail_if(size != 14); | ||
231 | |||
232 | font = "NON-EXISTING-FONT"; | ||
233 | size = 14; | ||
234 | evas_object_text_font_set(to, font, size); | ||
235 | font = NULL; | ||
236 | size = 0; | ||
237 | evas_object_text_font_get(to, &font, &size); | ||
238 | fail_if(strcmp(font, "NON-EXISTING-FONT")); | ||
239 | |||
240 | font = "Serif"; | ||
241 | size = 2; | ||
242 | evas_object_text_font_set(to, font, size); | ||
243 | font = NULL; | ||
244 | size = 0; | ||
245 | evas_object_text_font_get(to, &font, &size); | ||
246 | fail_if(strcmp(font, "Serif")); | ||
247 | fail_if(size != 2); | ||
248 | |||
249 | evas_object_text_font_source_set(to, "/usr/share/fonts/Sans.ttf"); | ||
250 | font = evas_object_text_font_source_get(to); | ||
251 | fail_if(strcmp(font, "/usr/share/fonts/Sans.ttf")); | ||
252 | evas_object_text_font_source_set(to, "/usr/share/fonts/Sans.ttf"); | ||
253 | font = evas_object_text_font_source_get(to); | ||
254 | fail_if(strcmp(font, "/usr/share/fonts/Sans.ttf")); | ||
255 | |||
256 | /* BiDi Delimiters */ | ||
257 | evas_object_text_bidi_delimiters_set(to, ",.|"); | ||
258 | fail_if(strcmp(evas_object_text_bidi_delimiters_get(to), ",.|")); | ||
259 | evas_object_text_bidi_delimiters_set(to, ",|"); | ||
260 | fail_if(strcmp(evas_object_text_bidi_delimiters_get(to), ",|")); | ||
261 | evas_object_text_bidi_delimiters_set(to, NULL); | ||
262 | fail_if(evas_object_text_bidi_delimiters_get(to)); | ||
263 | evas_object_text_bidi_delimiters_set(to, ",|"); | ||
264 | fail_if(strcmp(evas_object_text_bidi_delimiters_get(to), ",|")); | ||
265 | |||
266 | /* Style */ | ||
267 | evas_object_text_text_set(to, ""); | ||
268 | evas_object_text_style_set(to, EVAS_TEXT_STYLE_SHADOW); | ||
269 | fail_if(evas_object_text_style_get(to) != EVAS_TEXT_STYLE_SHADOW); | ||
270 | evas_object_text_style_set(to, EVAS_TEXT_STYLE_OUTLINE); | ||
271 | fail_if(evas_object_text_style_get(to) != EVAS_TEXT_STYLE_OUTLINE); | ||
272 | |||
273 | /* Rehinting */ | ||
274 | evas_object_text_text_set(to, "Bla"); | ||
275 | evas_font_hinting_set(evas, EVAS_FONT_HINTING_NONE); | ||
276 | evas_font_hinting_set(evas, EVAS_FONT_HINTING_AUTO); | ||
277 | evas_font_hinting_set(evas, EVAS_FONT_HINTING_BYTECODE); | ||
278 | |||
279 | /* Direction of an empty text should be NEUTRAL */ | ||
280 | evas_object_text_text_set(to, ""); | ||
281 | fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_NEUTRAL); | ||
282 | |||
283 | END_TEXT_TEST(); | ||
284 | } | ||
285 | END_TEST | ||
286 | |||
287 | START_TEST(evas_text_style) | ||
288 | { | ||
289 | Evas_Coord l, r, t, b; | ||
290 | START_TEXT_TEST(); | ||
291 | const char *buf = "Test"; | ||
292 | evas_object_text_text_set(to, buf); | ||
293 | evas_object_text_style_set(to, EVAS_TEXT_STYLE_PLAIN); | ||
294 | evas_object_text_style_pad_get(to, &l, &r, &t, &b); | ||
295 | fail_if((l != 0) || (r != 0) || (t != 0) || (b != 0)); | ||
296 | |||
297 | evas_object_text_style_set(to, EVAS_TEXT_STYLE_SHADOW); | ||
298 | evas_object_text_style_pad_get(to, &l, &r, &t, &b); | ||
299 | fail_if((l != 0) || (r != 1) || (t != 0) || (b != 1)); | ||
300 | |||
301 | evas_object_text_style_set(to, EVAS_TEXT_STYLE_OUTLINE); | ||
302 | evas_object_text_style_pad_get(to, &l, &r, &t, &b); | ||
303 | fail_if((l != 1) || (r != 1) || (t != 1) || (b != 1)); | ||
304 | |||
305 | evas_object_text_style_set(to, EVAS_TEXT_STYLE_SOFT_OUTLINE); | ||
306 | evas_object_text_style_pad_get(to, &l, &r, &t, &b); | ||
307 | fail_if((l != 2) || (r != 2) || (t != 2) || (b != 2)); | ||
308 | |||
309 | evas_object_text_style_set(to, EVAS_TEXT_STYLE_GLOW); | ||
310 | evas_object_text_style_pad_get(to, &l, &r, &t, &b); | ||
311 | fail_if((l != 2) || (r != 2) || (t != 2) || (b != 2)); | ||
312 | |||
313 | evas_object_text_style_set(to, EVAS_TEXT_STYLE_OUTLINE_SHADOW); | ||
314 | evas_object_text_style_pad_get(to, &l, &r, &t, &b); | ||
315 | fail_if((l != 1) || (r != 2) || (t != 1) || (b != 2)); | ||
316 | |||
317 | evas_object_text_style_set(to, EVAS_TEXT_STYLE_FAR_SHADOW); | ||
318 | evas_object_text_style_pad_get(to, &l, &r, &t, &b); | ||
319 | fail_if((l != 1) || (r != 2) || (t != 1) || (b != 2)); | ||
320 | |||
321 | evas_object_text_style_set(to, EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW); | ||
322 | evas_object_text_style_pad_get(to, &l, &r, &t, &b); | ||
323 | fail_if((l != 1) || (r != 3) || (t != 1) || (b != 3)); | ||
324 | |||
325 | evas_object_text_style_set(to, EVAS_TEXT_STYLE_SOFT_SHADOW); | ||
326 | evas_object_text_style_pad_get(to, &l, &r, &t, &b); | ||
327 | fail_if((l != 1) || (r != 3) || (t != 1) || (b != 3)); | ||
328 | |||
329 | evas_object_text_style_set(to, EVAS_TEXT_STYLE_FAR_SOFT_SHADOW); | ||
330 | evas_object_text_style_pad_get(to, &l, &r, &t, &b); | ||
331 | fail_if((l != 0) || (r != 4) || (t != 0) || (b != 4)); | ||
332 | |||
333 | fail_if(strcmp(evas_object_text_text_get(to), buf)); | ||
334 | END_TEXT_TEST(); | ||
335 | } | ||
336 | END_TEST | ||
337 | |||
338 | #ifdef HAVE_FRIBIDI | ||
339 | START_TEST(evas_text_bidi) | ||
340 | { | ||
341 | START_TEXT_TEST(); | ||
342 | const char *buf = "Test - בדיקה"; | ||
343 | int i; | ||
344 | Evas_Coord x, y, w, h, px; | ||
345 | const char *font = "Sans"; | ||
346 | Evas_Font_Size size = 14; | ||
347 | |||
348 | evas_object_text_font_set(to, font, size); | ||
349 | |||
350 | evas_object_text_text_set(to, buf); | ||
351 | fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_LTR); | ||
352 | evas_object_text_text_set(to, "בדיקה"); | ||
353 | fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); | ||
354 | |||
355 | /* With RTL text coords should be monotontically decreasing. */ | ||
356 | evas_object_text_text_set(to, "נסיון..."); | ||
357 | x = 0; | ||
358 | px = 200; | ||
359 | for (i = 0 ; i < eina_unicode_utf8_get_len("נסיון...") ; i++) | ||
360 | { | ||
361 | fail_if(!evas_object_text_char_pos_get(to, i, &x, &y, &w, &h)); | ||
362 | fail_if(x >= px); | ||
363 | px = x; | ||
364 | /* Get back the coords */ | ||
365 | fail_if(i != evas_object_text_char_coords_get(to, x + (w / 2), | ||
366 | y + (h / 2), &x, &y, &w, &h)); | ||
367 | } | ||
368 | |||
369 | /* Bidi text is a bit more complex */ | ||
370 | evas_object_text_text_set(to, "Test - נסיון..."); | ||
371 | x = 0; | ||
372 | px = -100; | ||
373 | for (i = 0 ; i < eina_unicode_utf8_get_len("Test - ") ; i++) | ||
374 | { | ||
375 | fail_if(!evas_object_text_char_pos_get(to, i, &x, &y, &w, &h)); | ||
376 | fail_if(x <= px); | ||
377 | px = x; | ||
378 | /* Get back the coords */ | ||
379 | fail_if(i != evas_object_text_char_coords_get(to, x + (w / 2), | ||
380 | y + (h / 2), &x, &y, &w, &h)); | ||
381 | } | ||
382 | |||
383 | /* First rtl char requires more specific handling */ | ||
384 | fail_if(!evas_object_text_char_pos_get(to, i, &x, &y, &w, &h)); | ||
385 | fail_if(x <= px); | ||
386 | px = x; | ||
387 | fail_if(i != evas_object_text_char_coords_get(to, x + (w / 2), | ||
388 | y + (h / 2), &x, &y, &w, &h)); | ||
389 | i++; | ||
390 | for ( ; i < eina_unicode_utf8_get_len("Test - נסיון") ; i++) | ||
391 | { | ||
392 | fail_if(!evas_object_text_char_pos_get(to, i, &x, &y, &w, &h)); | ||
393 | fail_if(x >= px); | ||
394 | px = x; | ||
395 | /* Get back the coords */ | ||
396 | fail_if(i != evas_object_text_char_coords_get(to, x + (w / 2), | ||
397 | y + (h / 2), &x, &y, &w, &h)); | ||
398 | } | ||
399 | /* First ltr char requires more specific handling */ | ||
400 | fail_if(!evas_object_text_char_pos_get(to, i, &x, &y, &w, &h)); | ||
401 | fail_if(x <= px); | ||
402 | px = x; | ||
403 | i++; | ||
404 | for ( ; i < eina_unicode_utf8_get_len("Test - נסיון...") ; i++) | ||
405 | { | ||
406 | fail_if(!evas_object_text_char_pos_get(to, i, &x, &y, &w, &h)); | ||
407 | fail_if(x <= px); | ||
408 | px = x; | ||
409 | /* Get back the coords */ | ||
410 | fail_if(i != evas_object_text_char_coords_get(to, x + (w / 2), | ||
411 | y + (h / 2), &x, &y, &w, &h)); | ||
412 | } | ||
413 | |||
414 | /* And with an rtl text */ | ||
415 | evas_object_text_text_set(to, "נסיון - test..."); | ||
416 | x = 0; | ||
417 | px = 100; | ||
418 | for (i = 0 ; i < eina_unicode_utf8_get_len("נסיון - ") ; i++) | ||
419 | { | ||
420 | fail_if(!evas_object_text_char_pos_get(to, i, &x, &y, &w, &h)); | ||
421 | fail_if(x >= px); | ||
422 | px = x; | ||
423 | /* Get back the coords */ | ||
424 | fail_if(i != evas_object_text_char_coords_get(to, x + (w / 2), | ||
425 | y + (h / 2), &x, &y, &w, &h)); | ||
426 | } | ||
427 | |||
428 | /* First ltr char requires more specific handling */ | ||
429 | fail_if(!evas_object_text_char_pos_get(to, i, &x, &y, &w, &h)); | ||
430 | fail_if(x >= px); | ||
431 | px = x; | ||
432 | fail_if(i != evas_object_text_char_coords_get(to, x + (w / 2), | ||
433 | y + (h / 2), &x, &y, &w, &h)); | ||
434 | i++; | ||
435 | for ( ; i < eina_unicode_utf8_get_len("נסיון - test") ; i++) | ||
436 | { | ||
437 | fail_if(!evas_object_text_char_pos_get(to, i, &x, &y, &w, &h)); | ||
438 | fail_if(x <= px); | ||
439 | px = x; | ||
440 | /* Get back the coords */ | ||
441 | fail_if(i != evas_object_text_char_coords_get(to, x + (w / 2), | ||
442 | y + (h / 2), &x, &y, &w, &h)); | ||
443 | } | ||
444 | /* First rtl char requires more specific handling */ | ||
445 | fail_if(!evas_object_text_char_pos_get(to, i, &x, &y, &w, &h)); | ||
446 | fail_if(x >= px); | ||
447 | px = x; | ||
448 | i++; | ||
449 | for ( ; i < eina_unicode_utf8_get_len("נסיון - test...") ; i++) | ||
450 | { | ||
451 | fail_if(!evas_object_text_char_pos_get(to, i, &x, &y, &w, &h)); | ||
452 | fail_if(x >= px); | ||
453 | px = x; | ||
454 | /* Get back the coords */ | ||
455 | fail_if(i != evas_object_text_char_coords_get(to, x + (w / 2), | ||
456 | y + (h / 2), &x, &y, &w, &h)); | ||
457 | } | ||
458 | |||
459 | /* And some last up to pos tests */ | ||
460 | Evas_Coord adv; | ||
461 | int pos, prev_pos; | ||
462 | evas_object_text_text_set(to, "Test - נסיון..."); | ||
463 | adv = evas_object_text_horiz_advance_get(to); | ||
464 | pos = prev_pos = 0; | ||
465 | for (x = 0 ; x <= (adv - 1) ; x++) | ||
466 | { | ||
467 | pos = evas_object_text_last_up_to_pos(to, x, 0); | ||
468 | fail_if(pos < prev_pos); | ||
469 | prev_pos = pos; | ||
470 | } | ||
471 | pos = evas_object_text_last_up_to_pos(to, x, 0); | ||
472 | fail_if(pos != -1); | ||
473 | pos = evas_object_text_last_up_to_pos(to, -50, 0); | ||
474 | fail_if(pos != -1); | ||
475 | |||
476 | END_TEXT_TEST(); | ||
477 | } | ||
478 | END_TEST | ||
479 | #endif | ||
480 | |||
481 | void evas_test_text(TCase *tc) | ||
482 | { | ||
483 | tcase_add_test(tc, evas_text_simple); | ||
484 | tcase_add_test(tc, evas_text_style); | ||
485 | tcase_add_test(tc, evas_text_set_get); | ||
486 | tcase_add_test(tc, evas_text_geometries); | ||
487 | tcase_add_test(tc, evas_text_evas); | ||
488 | #ifdef HAVE_FRIBIDI | ||
489 | tcase_add_test(tc, evas_text_bidi); | ||
490 | #endif | ||
491 | |||
492 | tcase_add_test(tc, evas_text_unrelated); | ||
493 | } | ||
diff --git a/libraries/evas/src/tests/evas_test_textblock.c b/libraries/evas/src/tests/evas_test_textblock.c deleted file mode 100644 index 983a2fc..0000000 --- a/libraries/evas/src/tests/evas_test_textblock.c +++ /dev/null | |||
@@ -1,2148 +0,0 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include "config.h" | ||
3 | #endif | ||
4 | |||
5 | #include <stdio.h> | ||
6 | |||
7 | #include <Eina.h> | ||
8 | |||
9 | #include "evas_suite.h" | ||
10 | #include "Evas.h" | ||
11 | |||
12 | #include "evas_tests_helpers.h" | ||
13 | |||
14 | /* Functions defined in evas_object_textblock.c */ | ||
15 | EAPI Eina_Bool | ||
16 | _evas_textblock_check_item_node_link(Evas_Object *obj); | ||
17 | EAPI int | ||
18 | _evas_textblock_format_offset_get(const Evas_Object_Textblock_Node_Format *n); | ||
19 | /* end of functions defined in evas_object_textblock.c */ | ||
20 | |||
21 | |||
22 | static const char *style_buf = | ||
23 | "DEFAULT='font=Sans font_size=10 color=#000 text_class=entry'" | ||
24 | "newline='br'" | ||
25 | "b='+ font=Sans:style=bold'"; | ||
26 | |||
27 | #define START_TB_TEST() \ | ||
28 | Evas *evas; \ | ||
29 | Evas_Object *tb; \ | ||
30 | Evas_Textblock_Style *st; \ | ||
31 | Evas_Textblock_Cursor *cur; \ | ||
32 | evas = EVAS_TEST_INIT_EVAS(); \ | ||
33 | evas_font_hinting_set(evas, EVAS_FONT_HINTING_AUTO); \ | ||
34 | tb = evas_object_textblock_add(evas); \ | ||
35 | fail_if(!tb); \ | ||
36 | evas_object_textblock_legacy_newline_set(tb, EINA_FALSE); \ | ||
37 | st = evas_textblock_style_new(); \ | ||
38 | fail_if(!st); \ | ||
39 | evas_textblock_style_set(st, style_buf); \ | ||
40 | fail_if(strcmp(style_buf, evas_textblock_style_get(st))); \ | ||
41 | evas_object_textblock_style_set(tb, st); \ | ||
42 | cur = evas_object_textblock_cursor_new(tb); \ | ||
43 | do \ | ||
44 | { \ | ||
45 | } \ | ||
46 | while (0) | ||
47 | |||
48 | #define END_TB_TEST() \ | ||
49 | do \ | ||
50 | { \ | ||
51 | evas_textblock_cursor_free(cur); \ | ||
52 | evas_object_del(tb); \ | ||
53 | evas_textblock_style_free(st); \ | ||
54 | evas_free(evas); \ | ||
55 | evas_shutdown(); \ | ||
56 | } \ | ||
57 | while (0) | ||
58 | |||
59 | START_TEST(evas_textblock_simple) | ||
60 | { | ||
61 | START_TB_TEST(); | ||
62 | const char *buf = "Th<i>i</i>s is a <br/> te<b>s</b>t."; | ||
63 | evas_object_textblock_text_markup_set(tb, buf); | ||
64 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), buf)); | ||
65 | END_TB_TEST(); | ||
66 | } | ||
67 | END_TEST | ||
68 | |||
69 | #define _CHECK_CURSOR_COORDS() \ | ||
70 | do \ | ||
71 | { \ | ||
72 | Evas_Coord cx, cy, cw, ch; \ | ||
73 | int ret; \ | ||
74 | ret = evas_textblock_cursor_geometry_get(cur, &cx, &cy, &cw, &ch, \ | ||
75 | NULL, EVAS_TEXTBLOCK_CURSOR_UNDER); \ | ||
76 | fail_if(ret == -1); \ | ||
77 | ret = evas_textblock_cursor_geometry_get(cur, &cx, &cy, &cw, &ch, \ | ||
78 | NULL, EVAS_TEXTBLOCK_CURSOR_BEFORE); \ | ||
79 | fail_if(ret == -1); \ | ||
80 | ret = evas_textblock_cursor_char_geometry_get(cur, \ | ||
81 | &cx, &cy, &cw, &ch); \ | ||
82 | fail_if(ret == -1); \ | ||
83 | ret = evas_textblock_cursor_pen_geometry_get(cur, &cx, &cy, &cw, &ch); \ | ||
84 | fail_if(ret == -1); \ | ||
85 | ret = evas_textblock_cursor_line_geometry_get(cur, \ | ||
86 | &cx, &cy, &cw, &ch); \ | ||
87 | fail_if(ret == -1); \ | ||
88 | } \ | ||
89 | while (0) | ||
90 | START_TEST(evas_textblock_cursor) | ||
91 | { | ||
92 | START_TB_TEST(); | ||
93 | Evas_Coord x, y, w, h; | ||
94 | size_t i, len; | ||
95 | Evas_Coord nw, nh; | ||
96 | const char *buf = "This is a<br/> test.<ps/>Lets see if this works.<ps/>עוד פסקה."; | ||
97 | |||
98 | /* Walk the textblock using cursor_char_next */ | ||
99 | evas_object_textblock_text_markup_set(tb, buf); | ||
100 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), buf)); | ||
101 | len = eina_unicode_utf8_get_len(buf) - 12; /* 12 because len(<br/>) == 1 and len(<ps/>) == 1 */ | ||
102 | for (i = 0 ; i < len ; i++) | ||
103 | { | ||
104 | _CHECK_CURSOR_COORDS(); | ||
105 | |||
106 | fail_if(evas_textblock_cursor_pos_get(cur) != (int) i); | ||
107 | |||
108 | fail_if(!evas_textblock_cursor_char_next(cur) && (i < len - 1)); | ||
109 | } | ||
110 | fail_if(evas_textblock_cursor_char_next(cur)); | ||
111 | |||
112 | /* Jump to positions all aronud the textblock */ | ||
113 | evas_textblock_cursor_pos_set(cur, -1); | ||
114 | fail_if(evas_textblock_cursor_pos_get(cur) != 0); | ||
115 | |||
116 | evas_textblock_cursor_pos_set(cur, len + 5); | ||
117 | fail_if(evas_textblock_cursor_pos_get(cur) != (int) len); | ||
118 | |||
119 | for (i = 0 ; i < len ; i++) | ||
120 | { | ||
121 | evas_textblock_cursor_pos_set(cur, i); | ||
122 | |||
123 | _CHECK_CURSOR_COORDS(); | ||
124 | |||
125 | fail_if(evas_textblock_cursor_pos_get(cur) != (int) i); | ||
126 | } | ||
127 | |||
128 | /* Create another cursor and insert text, making sure everything | ||
129 | * is in sync. */ | ||
130 | evas_object_textblock_clear(tb); | ||
131 | Evas_Textblock_Cursor *main_cur = evas_object_textblock_cursor_get(tb); | ||
132 | evas_textblock_cursor_copy(main_cur, cur); | ||
133 | fail_if(evas_textblock_cursor_pos_get(cur) != | ||
134 | evas_textblock_cursor_pos_get(main_cur)); | ||
135 | |||
136 | evas_textblock_cursor_text_prepend(main_cur, "a"); | ||
137 | fail_if(evas_textblock_cursor_pos_get(cur) == | ||
138 | evas_textblock_cursor_pos_get(main_cur)); | ||
139 | evas_textblock_cursor_text_prepend(main_cur, "a"); | ||
140 | fail_if(evas_textblock_cursor_pos_get(cur) == | ||
141 | evas_textblock_cursor_pos_get(main_cur)); | ||
142 | |||
143 | /* Insert text to a non-empty textblock */ | ||
144 | evas_object_textblock_clear(tb); | ||
145 | evas_object_textblock_text_markup_set(tb, buf); | ||
146 | evas_textblock_cursor_copy(main_cur, cur); | ||
147 | fail_if(evas_textblock_cursor_pos_get(cur) != | ||
148 | evas_textblock_cursor_pos_get(main_cur)); | ||
149 | |||
150 | evas_textblock_cursor_text_prepend(main_cur, "a"); | ||
151 | fail_if(evas_textblock_cursor_pos_get(cur) == | ||
152 | evas_textblock_cursor_pos_get(main_cur)); | ||
153 | evas_textblock_cursor_text_prepend(main_cur, "a"); | ||
154 | fail_if(evas_textblock_cursor_pos_get(cur) == | ||
155 | evas_textblock_cursor_pos_get(main_cur)); | ||
156 | |||
157 | /* Make sure append works */ | ||
158 | evas_textblock_cursor_copy(main_cur, cur); | ||
159 | fail_if(evas_textblock_cursor_pos_get(cur) != | ||
160 | evas_textblock_cursor_pos_get(main_cur)); | ||
161 | evas_textblock_cursor_text_append(main_cur, "a"); | ||
162 | fail_if(evas_textblock_cursor_pos_get(cur) != | ||
163 | evas_textblock_cursor_pos_get(main_cur)); | ||
164 | |||
165 | /* Cursor comparison */ | ||
166 | evas_textblock_cursor_pos_set(cur, 1); | ||
167 | evas_textblock_cursor_pos_set(main_cur, 2); | ||
168 | fail_if(evas_textblock_cursor_compare(cur, main_cur) != -1); | ||
169 | |||
170 | evas_textblock_cursor_pos_set(cur, 2); | ||
171 | evas_textblock_cursor_pos_set(main_cur, 2); | ||
172 | fail_if(evas_textblock_cursor_compare(cur, main_cur) != 0); | ||
173 | |||
174 | evas_textblock_cursor_pos_set(cur, 3); | ||
175 | evas_textblock_cursor_pos_set(main_cur, 2); | ||
176 | fail_if(evas_textblock_cursor_compare(cur, main_cur) != 1); | ||
177 | |||
178 | /* Paragraph first */ | ||
179 | evas_object_textblock_text_markup_set(tb, buf); | ||
180 | for (i = 0 ; i < len ; i++) | ||
181 | { | ||
182 | evas_textblock_cursor_pos_set(cur, i); | ||
183 | |||
184 | evas_textblock_cursor_paragraph_first(cur); | ||
185 | fail_if(evas_textblock_cursor_pos_get(cur) != 0); | ||
186 | } | ||
187 | |||
188 | /* Paragraph last */ | ||
189 | for (i = 0 ; i < len ; i++) | ||
190 | { | ||
191 | evas_textblock_cursor_pos_set(cur, i); | ||
192 | |||
193 | evas_textblock_cursor_paragraph_last(cur); | ||
194 | fail_if(evas_textblock_cursor_pos_get(cur) != (int) len); | ||
195 | } | ||
196 | |||
197 | /* Paragraph next */ | ||
198 | evas_textblock_cursor_paragraph_last(cur); | ||
199 | fail_if(evas_textblock_cursor_paragraph_next(cur)); | ||
200 | |||
201 | evas_textblock_cursor_paragraph_first(cur); | ||
202 | fail_if(!evas_textblock_cursor_paragraph_next(cur)); | ||
203 | fail_if(!evas_textblock_cursor_paragraph_next(cur)); | ||
204 | |||
205 | /* Paragraph prev */ | ||
206 | evas_textblock_cursor_paragraph_first(cur); | ||
207 | fail_if(evas_textblock_cursor_paragraph_prev(cur)); | ||
208 | |||
209 | evas_textblock_cursor_paragraph_last(cur); | ||
210 | fail_if(!evas_textblock_cursor_paragraph_prev(cur)); | ||
211 | fail_if(!evas_textblock_cursor_paragraph_prev(cur)); | ||
212 | |||
213 | /* Cher next */ | ||
214 | evas_textblock_cursor_paragraph_last(cur); | ||
215 | fail_if(evas_textblock_cursor_char_next(cur)); | ||
216 | |||
217 | evas_textblock_cursor_paragraph_first(cur); | ||
218 | fail_if(!evas_textblock_cursor_char_next(cur)); | ||
219 | fail_if(!evas_textblock_cursor_paragraph_next(cur)); | ||
220 | fail_if(!evas_textblock_cursor_char_next(cur)); | ||
221 | fail_if(!evas_textblock_cursor_paragraph_next(cur)); | ||
222 | fail_if(!evas_textblock_cursor_char_next(cur)); | ||
223 | |||
224 | /* Cher prev */ | ||
225 | evas_textblock_cursor_paragraph_first(cur); | ||
226 | fail_if(evas_textblock_cursor_char_prev(cur)); | ||
227 | |||
228 | evas_textblock_cursor_paragraph_last(cur); | ||
229 | fail_if(!evas_textblock_cursor_char_prev(cur)); | ||
230 | fail_if(!evas_textblock_cursor_paragraph_prev(cur)); | ||
231 | fail_if(!evas_textblock_cursor_char_prev(cur)); | ||
232 | |||
233 | /* Paragraph char first */ | ||
234 | evas_textblock_cursor_paragraph_first(main_cur); | ||
235 | evas_textblock_cursor_paragraph_first(cur); | ||
236 | fail_if(!evas_textblock_cursor_char_next(cur)); | ||
237 | evas_textblock_cursor_paragraph_char_first(cur); | ||
238 | fail_if(evas_textblock_cursor_compare(cur, main_cur)); | ||
239 | |||
240 | /* Paragraph char last */ | ||
241 | evas_textblock_cursor_paragraph_last(main_cur); | ||
242 | evas_textblock_cursor_paragraph_last(cur); | ||
243 | fail_if(!evas_textblock_cursor_char_prev(cur)); | ||
244 | evas_textblock_cursor_paragraph_char_last(cur); | ||
245 | fail_if(evas_textblock_cursor_compare(cur, main_cur)); | ||
246 | |||
247 | /* Line char first */ | ||
248 | evas_textblock_cursor_paragraph_first(main_cur); | ||
249 | evas_textblock_cursor_paragraph_first(cur); | ||
250 | fail_if(!evas_textblock_cursor_char_next(cur)); | ||
251 | evas_textblock_cursor_line_char_first(cur); | ||
252 | fail_if(evas_textblock_cursor_compare(cur, main_cur)); | ||
253 | |||
254 | evas_textblock_cursor_pos_set(cur, 12); | ||
255 | evas_textblock_cursor_line_char_first(cur); | ||
256 | fail_if(evas_textblock_cursor_pos_get(cur) != 10); | ||
257 | |||
258 | /* Line char first */ | ||
259 | evas_textblock_cursor_paragraph_last(main_cur); | ||
260 | evas_textblock_cursor_paragraph_last(cur); | ||
261 | fail_if(!evas_textblock_cursor_char_prev(cur)); | ||
262 | evas_textblock_cursor_line_char_last(cur); | ||
263 | fail_if(evas_textblock_cursor_compare(cur, main_cur)); | ||
264 | |||
265 | evas_textblock_cursor_pos_set(cur, 12); | ||
266 | evas_textblock_cursor_line_char_last(cur); | ||
267 | fail_if(evas_textblock_cursor_pos_get(cur) != 16); | ||
268 | |||
269 | /* Line set */ | ||
270 | evas_textblock_cursor_paragraph_first(main_cur); | ||
271 | evas_textblock_cursor_paragraph_last(cur); | ||
272 | |||
273 | fail_if(!evas_textblock_cursor_line_set(cur, 0)); | ||
274 | fail_if(evas_textblock_cursor_compare(cur, main_cur)); | ||
275 | fail_if(!evas_textblock_cursor_line_set(cur, 1)); | ||
276 | fail_if(!evas_textblock_cursor_line_set(cur, 2)); | ||
277 | fail_if(!evas_textblock_cursor_line_set(cur, 3)); | ||
278 | |||
279 | fail_if(evas_textblock_cursor_line_set(cur, -1)); | ||
280 | fail_if(evas_textblock_cursor_line_set(cur, 99)); | ||
281 | |||
282 | /* Paragraph text get */ | ||
283 | evas_textblock_cursor_paragraph_first(cur); | ||
284 | fail_if(strcmp(evas_textblock_cursor_paragraph_text_get(cur), | ||
285 | "This is a<br/> test.")); | ||
286 | evas_textblock_cursor_paragraph_next(cur); | ||
287 | fail_if(strcmp(evas_textblock_cursor_paragraph_text_get(cur), | ||
288 | "Lets see if this works.")); | ||
289 | evas_textblock_cursor_paragraph_next(cur); | ||
290 | fail_if(strcmp(evas_textblock_cursor_paragraph_text_get(cur), | ||
291 | "עוד פסקה.")); | ||
292 | |||
293 | /* Paragraph length get */ | ||
294 | evas_textblock_cursor_paragraph_first(cur); | ||
295 | /* -4 because len(<br/>) == 1 */ | ||
296 | fail_if(evas_textblock_cursor_paragraph_text_length_get(cur) != | ||
297 | eina_unicode_utf8_get_len("This is a<br/> test.") - 4); | ||
298 | evas_textblock_cursor_paragraph_next(cur); | ||
299 | fail_if(evas_textblock_cursor_paragraph_text_length_get(cur) != | ||
300 | eina_unicode_utf8_get_len("Lets see if this works.")); | ||
301 | evas_textblock_cursor_paragraph_next(cur); | ||
302 | fail_if(evas_textblock_cursor_paragraph_text_length_get(cur) != | ||
303 | eina_unicode_utf8_get_len("עוד פסקה.")); | ||
304 | |||
305 | /* Cursor content get */ | ||
306 | evas_textblock_cursor_pos_set(cur, 0); | ||
307 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "T")); | ||
308 | evas_textblock_cursor_pos_set(cur, 9); | ||
309 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "<br/>")); | ||
310 | evas_textblock_cursor_pos_set(cur, 43); | ||
311 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "ד")); | ||
312 | |||
313 | /* Eol get */ | ||
314 | for (i = 0 ; i < len ; i++) | ||
315 | { | ||
316 | evas_textblock_cursor_pos_set(cur, i); | ||
317 | evas_textblock_cursor_copy(cur, main_cur); | ||
318 | evas_textblock_cursor_line_char_last(main_cur); | ||
319 | |||
320 | if (!evas_textblock_cursor_compare(cur, main_cur)) | ||
321 | { | ||
322 | fail_if(!evas_textblock_cursor_eol_get(cur)); | ||
323 | } | ||
324 | else | ||
325 | { | ||
326 | fail_if(evas_textblock_cursor_eol_get(cur)); | ||
327 | } | ||
328 | } | ||
329 | |||
330 | /* Format positions */ | ||
331 | const Evas_Object_Textblock_Node_Format *fnode; | ||
332 | fnode = evas_textblock_node_format_first_get(tb); | ||
333 | fail_if(!fnode); | ||
334 | evas_textblock_cursor_at_format_set(cur, fnode); | ||
335 | evas_textblock_cursor_copy(cur, main_cur); | ||
336 | fail_if(evas_textblock_cursor_pos_get(cur) != 9); | ||
337 | fail_if(evas_textblock_cursor_format_get(cur) != fnode); | ||
338 | |||
339 | fnode = evas_textblock_node_format_next_get(fnode); | ||
340 | fail_if(!fnode); | ||
341 | evas_textblock_cursor_at_format_set(cur, fnode); | ||
342 | fail_if(evas_textblock_cursor_pos_get(cur) != 16); | ||
343 | fail_if(evas_textblock_cursor_format_get(cur) != fnode); | ||
344 | evas_textblock_cursor_format_next(main_cur); | ||
345 | fail_if(evas_textblock_cursor_compare(main_cur, cur)); | ||
346 | |||
347 | fnode = evas_textblock_node_format_prev_get(fnode); | ||
348 | fail_if(!fnode); | ||
349 | evas_textblock_cursor_at_format_set(cur, fnode); | ||
350 | fail_if(evas_textblock_cursor_pos_get(cur) != 9); | ||
351 | fail_if(evas_textblock_cursor_format_get(cur) != fnode); | ||
352 | evas_textblock_cursor_format_prev(main_cur); | ||
353 | fail_if(evas_textblock_cursor_compare(main_cur, cur)); | ||
354 | |||
355 | evas_textblock_cursor_char_next(main_cur); | ||
356 | evas_textblock_cursor_format_prev(main_cur); | ||
357 | fail_if(evas_textblock_cursor_compare(main_cur, cur)); | ||
358 | |||
359 | |||
360 | evas_object_textblock_text_markup_set(tb, buf); | ||
361 | |||
362 | /* Check that pen geometry and getting char at coord are in sync. */ | ||
363 | do | ||
364 | { | ||
365 | int cur_pos; | ||
366 | |||
367 | /* Check if it's the last char, if it is, break, otherwise, go back | ||
368 | * to the current char because our test advanced the cursor. */ | ||
369 | if (!evas_textblock_cursor_char_next(cur)) | ||
370 | break; | ||
371 | else | ||
372 | evas_textblock_cursor_char_prev(cur); | ||
373 | |||
374 | cur_pos = evas_textblock_cursor_pos_get(cur); | ||
375 | evas_textblock_cursor_pen_geometry_get(cur, &x, &y, &w, &h); | ||
376 | evas_textblock_cursor_char_coord_set(cur, x + (w / 2), y + (h / 2)); | ||
377 | fail_if(cur_pos != evas_textblock_cursor_pos_get(cur)); | ||
378 | } | ||
379 | while (evas_textblock_cursor_char_next(cur)); | ||
380 | |||
381 | /* Try positions before the first paragraph, and after the last paragraph */ | ||
382 | evas_object_textblock_text_markup_set(tb, buf); | ||
383 | evas_object_textblock_size_native_get(tb, &nw, &nh); | ||
384 | evas_object_resize(tb, nw, nh); | ||
385 | evas_textblock_cursor_pos_set(cur, 5); | ||
386 | evas_textblock_cursor_char_coord_set(cur, nw / 2, | ||
387 | -50); | ||
388 | evas_textblock_cursor_paragraph_first(main_cur); | ||
389 | fail_if(evas_textblock_cursor_compare(cur, main_cur)); | ||
390 | |||
391 | evas_textblock_cursor_pos_set(cur, 5); | ||
392 | evas_textblock_cursor_char_coord_set(cur, nw / 2, | ||
393 | nh + 50); | ||
394 | evas_textblock_cursor_paragraph_last(main_cur); | ||
395 | fail_if(evas_textblock_cursor_compare(cur, main_cur)); | ||
396 | |||
397 | /* Try positions beyond the left/right limits of lines. */ | ||
398 | for (i = 0 ; i < 2 ; i++) | ||
399 | { | ||
400 | evas_textblock_cursor_line_set(cur, i); | ||
401 | evas_textblock_cursor_line_geometry_get(cur, &x, &y, &w, &h); | ||
402 | |||
403 | evas_textblock_cursor_pos_set(main_cur, 5); | ||
404 | evas_textblock_cursor_char_coord_set(main_cur, x - 50, y); | ||
405 | fail_if(evas_textblock_cursor_compare(main_cur, cur)); | ||
406 | |||
407 | evas_textblock_cursor_line_char_last(cur); | ||
408 | evas_textblock_cursor_pos_set(main_cur, 5); | ||
409 | evas_textblock_cursor_char_coord_set(main_cur, x + w + 50, y); | ||
410 | fail_if(evas_textblock_cursor_compare(main_cur, cur)); | ||
411 | } | ||
412 | |||
413 | #ifdef HAVE_FRIBIDI | ||
414 | evas_object_textblock_text_markup_set(tb, | ||
415 | "testנסיוןtestנסיון<ps/>" | ||
416 | "נסיוןtestנסיוןtest<ps/>" | ||
417 | "testנסיוןtest<ps/>" | ||
418 | "נסיוןtestנסיון<ps/>" | ||
419 | "testנסיון<br/>נסיון<ps/>" | ||
420 | "נסיוןtest<br/>test" | ||
421 | ); | ||
422 | |||
423 | for (i = 0 ; i < 8 ; i++) | ||
424 | { | ||
425 | evas_textblock_cursor_line_set(cur, i); | ||
426 | evas_textblock_cursor_line_geometry_get(cur, &x, &y, &w, &h); | ||
427 | switch (i) | ||
428 | { | ||
429 | case 0: | ||
430 | case 2: | ||
431 | case 4: | ||
432 | case 5: | ||
433 | /* Ltr paragraph */ | ||
434 | evas_textblock_cursor_pos_set(main_cur, 7); | ||
435 | evas_textblock_cursor_char_coord_set(main_cur, x - 50, y); | ||
436 | fail_if(evas_textblock_cursor_compare(main_cur, cur)); | ||
437 | |||
438 | evas_textblock_cursor_line_char_last(cur); | ||
439 | evas_textblock_cursor_pos_set(main_cur, 7); | ||
440 | evas_textblock_cursor_char_coord_set(main_cur, x + w + 50, y); | ||
441 | fail_if(evas_textblock_cursor_compare(main_cur, cur)); | ||
442 | break; | ||
443 | case 1: | ||
444 | case 3: | ||
445 | case 6: | ||
446 | case 7: | ||
447 | /* Rtl paragraph */ | ||
448 | evas_textblock_cursor_line_char_last(cur); | ||
449 | evas_textblock_cursor_pos_set(main_cur, 7); | ||
450 | evas_textblock_cursor_char_coord_set(main_cur, x - 50, y); | ||
451 | fail_if(evas_textblock_cursor_compare(main_cur, cur)); | ||
452 | |||
453 | evas_textblock_cursor_line_char_first(cur); | ||
454 | evas_textblock_cursor_pos_set(main_cur, 7); | ||
455 | evas_textblock_cursor_char_coord_set(main_cur, x + w + 50, y); | ||
456 | fail_if(evas_textblock_cursor_compare(main_cur, cur)); | ||
457 | break; | ||
458 | } | ||
459 | } | ||
460 | #endif | ||
461 | |||
462 | evas_object_textblock_text_markup_set(tb, buf); | ||
463 | /* Testing line geometry.*/ | ||
464 | { | ||
465 | Evas_Coord lx, ly, lw, lh; | ||
466 | Evas_Coord plx, ply, plw, plh; | ||
467 | evas_textblock_cursor_line_set(cur, 0); | ||
468 | evas_textblock_cursor_copy(cur, main_cur); | ||
469 | evas_textblock_cursor_line_char_last(main_cur); | ||
470 | evas_textblock_cursor_line_geometry_get(cur, &plx, &ply, &plw, &plh); | ||
471 | |||
472 | while (evas_textblock_cursor_compare(cur, main_cur) <= 0) | ||
473 | { | ||
474 | evas_textblock_cursor_pen_geometry_get(cur, &x, &y, &w, &h); | ||
475 | fail_if(0 != evas_textblock_cursor_line_geometry_get( | ||
476 | cur, &lx, &ly, &lw, &lh)); | ||
477 | fail_if((x < lx) || (x + w > lx + lw) || | ||
478 | (y < ly) || (y + h > ly + lh)); | ||
479 | fail_if((lx != plx) || (ly != ply) || (lw != plw) || (lh != plh)); | ||
480 | |||
481 | plx = lx; | ||
482 | ply = ly; | ||
483 | plw = lw; | ||
484 | plh = lh; | ||
485 | evas_textblock_cursor_char_next(cur); | ||
486 | } | ||
487 | |||
488 | evas_textblock_cursor_line_set(cur, 1); | ||
489 | evas_textblock_cursor_copy(cur, main_cur); | ||
490 | evas_textblock_cursor_line_char_last(main_cur); | ||
491 | evas_textblock_cursor_line_geometry_get(cur, &plx, &ply, &plw, &plh); | ||
492 | |||
493 | while (evas_textblock_cursor_compare(cur, main_cur) <= 0) | ||
494 | { | ||
495 | evas_textblock_cursor_pen_geometry_get(cur, &x, &y, &w, &h); | ||
496 | fail_if(1 != evas_textblock_cursor_line_geometry_get( | ||
497 | cur, &lx, &ly, &lw, &lh)); | ||
498 | fail_if((x < lx) || (x + w > lx + lw) || | ||
499 | (y < ly) || (y + h > ly + lh)); | ||
500 | fail_if((lx != plx) || (ly != ply) || (lw != plw) || (lh != plh)); | ||
501 | |||
502 | plx = lx; | ||
503 | ply = ly; | ||
504 | plw = lw; | ||
505 | plh = lh; | ||
506 | evas_textblock_cursor_char_next(cur); | ||
507 | } | ||
508 | |||
509 | evas_textblock_cursor_paragraph_last(cur); | ||
510 | evas_textblock_cursor_line_set(cur, 0); | ||
511 | evas_textblock_cursor_line_geometry_get(cur, &plx, &ply, &plw, &plh); | ||
512 | evas_object_textblock_line_number_geometry_get(tb, 0, | ||
513 | &lx, &ly, &lw, &lh); | ||
514 | fail_if((lx != plx) || (ly != ply) || (lw != plw) || (lh != plh)); | ||
515 | fail_if(0 != evas_textblock_cursor_line_coord_set(cur, ly + (lh / 2))); | ||
516 | |||
517 | evas_textblock_cursor_line_set(cur, 1); | ||
518 | evas_textblock_cursor_line_geometry_get(cur, &plx, &ply, &plw, &plh); | ||
519 | evas_object_textblock_line_number_geometry_get(tb, 1, | ||
520 | &lx, &ly, &lw, &lh); | ||
521 | fail_if((lx != plx) || (ly != ply) || (lw != plw) || (lh != plh)); | ||
522 | fail_if(1 != evas_textblock_cursor_line_coord_set(cur, ly + (lh / 2))); | ||
523 | |||
524 | /* Before the start of the textblock */ | ||
525 | fail_if(0 != evas_textblock_cursor_line_coord_set(cur, -50)); | ||
526 | fail_if(3 != evas_textblock_cursor_line_coord_set(cur, 100000)); | ||
527 | |||
528 | /* And now with a valigned textblock. */ | ||
529 | evas_object_textblock_text_markup_set(tb, buf); | ||
530 | evas_object_textblock_size_native_get(tb, &nw, &nh); | ||
531 | evas_object_resize(tb, 2 * nw, 2 * nh); | ||
532 | |||
533 | evas_object_textblock_valign_set(tb, 0.5); | ||
534 | evas_textblock_cursor_paragraph_first(cur); | ||
535 | evas_textblock_cursor_pen_geometry_get(cur, &x, &y, &w, &h); | ||
536 | fail_if(y <= 0); | ||
537 | |||
538 | evas_textblock_cursor_paragraph_last(main_cur); | ||
539 | evas_textblock_cursor_char_coord_set(main_cur, x + w, y / 2); | ||
540 | fail_if(evas_textblock_cursor_compare(main_cur, cur)); | ||
541 | |||
542 | evas_textblock_cursor_paragraph_last(main_cur); | ||
543 | evas_textblock_cursor_line_coord_set(main_cur, y / 2); | ||
544 | fail_if(evas_textblock_cursor_compare(main_cur, cur)); | ||
545 | |||
546 | /* Fail if they are equal, i.e if it for some reason thinks it should | ||
547 | * go to the end. */ | ||
548 | evas_textblock_cursor_paragraph_first(main_cur); | ||
549 | evas_textblock_cursor_paragraph_last(cur); | ||
550 | evas_textblock_cursor_char_coord_set(main_cur, x + w, nh + 1); | ||
551 | fail_if(!evas_textblock_cursor_compare(main_cur, cur)); | ||
552 | |||
553 | evas_textblock_cursor_paragraph_first(main_cur); | ||
554 | evas_textblock_cursor_paragraph_last(cur); | ||
555 | evas_textblock_cursor_line_coord_set(main_cur, nh + 1); | ||
556 | fail_if(!evas_textblock_cursor_compare(main_cur, cur)); | ||
557 | |||
558 | /* Fail if it doesn't go to the end. */ | ||
559 | evas_textblock_cursor_paragraph_last(cur); | ||
560 | evas_textblock_cursor_paragraph_first(main_cur); | ||
561 | evas_textblock_cursor_char_coord_set(main_cur, x + w, (2 * nh) - 1); | ||
562 | fail_if(evas_textblock_cursor_compare(main_cur, cur)); | ||
563 | |||
564 | evas_textblock_cursor_paragraph_first(main_cur); | ||
565 | evas_textblock_cursor_line_coord_set(main_cur, (2 * nh) - 1); | ||
566 | fail_if(evas_textblock_cursor_compare(main_cur, cur)); | ||
567 | } | ||
568 | |||
569 | { | ||
570 | const char *buf_wb = "a This is_a t:e.s't a"; | ||
571 | evas_object_textblock_text_markup_set(tb, buf_wb); | ||
572 | |||
573 | /* Word start/end */ | ||
574 | evas_textblock_cursor_pos_set(cur, 3); | ||
575 | evas_textblock_cursor_word_start(cur); | ||
576 | fail_if(2 != evas_textblock_cursor_pos_get(cur)); | ||
577 | evas_textblock_cursor_word_end(cur); | ||
578 | fail_if(5 != evas_textblock_cursor_pos_get(cur)); | ||
579 | |||
580 | evas_textblock_cursor_pos_set(cur, 13); | ||
581 | evas_textblock_cursor_word_end(cur); | ||
582 | fail_if(18 != evas_textblock_cursor_pos_get(cur)); | ||
583 | evas_textblock_cursor_word_start(cur); | ||
584 | fail_if(12 != evas_textblock_cursor_pos_get(cur)); | ||
585 | evas_textblock_cursor_word_start(cur); | ||
586 | fail_if(12 != evas_textblock_cursor_pos_get(cur)); | ||
587 | evas_textblock_cursor_word_start(cur); | ||
588 | fail_if(12 != evas_textblock_cursor_pos_get(cur)); | ||
589 | evas_textblock_cursor_word_end(cur); | ||
590 | fail_if(18 != evas_textblock_cursor_pos_get(cur)); | ||
591 | evas_textblock_cursor_word_end(cur); | ||
592 | fail_if(18 != evas_textblock_cursor_pos_get(cur)); | ||
593 | } | ||
594 | |||
595 | END_TB_TEST(); | ||
596 | } | ||
597 | END_TEST | ||
598 | |||
599 | START_TEST(evas_textblock_format_removal) | ||
600 | { | ||
601 | START_TB_TEST(); | ||
602 | int i; | ||
603 | const char *buf = "Th<b>is a<a>tes</a>st</b>."; | ||
604 | const Evas_Object_Textblock_Node_Format *fnode; | ||
605 | Evas_Textblock_Cursor *main_cur = evas_object_textblock_cursor_get(tb); | ||
606 | evas_object_textblock_text_markup_set(tb, buf); | ||
607 | |||
608 | /* Remove the "b" pair. */ | ||
609 | fnode = evas_textblock_node_format_first_get(tb); | ||
610 | evas_textblock_node_format_remove_pair(tb, | ||
611 | (Evas_Object_Textblock_Node_Format *) fnode); | ||
612 | |||
613 | fnode = evas_textblock_node_format_first_get(tb); | ||
614 | fail_if (!fnode); | ||
615 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
616 | "+ a")); | ||
617 | |||
618 | fnode = evas_textblock_node_format_next_get(fnode); | ||
619 | fail_if (!fnode); | ||
620 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
621 | "- a")); | ||
622 | |||
623 | fnode = evas_textblock_node_format_next_get(fnode); | ||
624 | fail_if (fnode); | ||
625 | |||
626 | /* Now also remove the a pair */ | ||
627 | fnode = evas_textblock_node_format_first_get(tb); | ||
628 | evas_textblock_node_format_remove_pair(tb, | ||
629 | (Evas_Object_Textblock_Node_Format *) fnode); | ||
630 | fnode = evas_textblock_node_format_first_get(tb); | ||
631 | fail_if (fnode); | ||
632 | |||
633 | /* Remove the "a" pair. */ | ||
634 | evas_object_textblock_text_markup_set(tb, buf); | ||
635 | |||
636 | fnode = evas_textblock_node_format_first_get(tb); | ||
637 | fnode = evas_textblock_node_format_next_get(fnode); | ||
638 | evas_textblock_node_format_remove_pair(tb, | ||
639 | (Evas_Object_Textblock_Node_Format *) fnode); | ||
640 | |||
641 | fnode = evas_textblock_node_format_first_get(tb); | ||
642 | fail_if (!fnode); | ||
643 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
644 | "+ b")); | ||
645 | |||
646 | fnode = evas_textblock_node_format_next_get(fnode); | ||
647 | fail_if (!fnode); | ||
648 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
649 | "- b")); | ||
650 | |||
651 | fnode = evas_textblock_node_format_next_get(fnode); | ||
652 | fail_if (fnode); | ||
653 | |||
654 | /* Now also remove the b pair */ | ||
655 | fnode = evas_textblock_node_format_first_get(tb); | ||
656 | evas_textblock_node_format_remove_pair(tb, | ||
657 | (Evas_Object_Textblock_Node_Format *) fnode); | ||
658 | fnode = evas_textblock_node_format_first_get(tb); | ||
659 | fail_if (fnode); | ||
660 | |||
661 | /* Now remove formats by removing text */ | ||
662 | evas_object_textblock_text_markup_set(tb, buf); | ||
663 | evas_textblock_cursor_pos_set(cur, 6); | ||
664 | evas_textblock_cursor_char_delete(cur); | ||
665 | evas_textblock_cursor_char_delete(cur); | ||
666 | evas_textblock_cursor_char_delete(cur); | ||
667 | /* Only b formats should remain */ | ||
668 | fnode = evas_textblock_node_format_first_get(tb); | ||
669 | fail_if (!fnode); | ||
670 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
671 | "+ b")); | ||
672 | |||
673 | fnode = evas_textblock_node_format_next_get(fnode); | ||
674 | fail_if (!fnode); | ||
675 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
676 | "- b")); | ||
677 | |||
678 | fnode = evas_textblock_node_format_next_get(fnode); | ||
679 | fail_if (fnode); | ||
680 | |||
681 | /* No formats should remain. */ | ||
682 | evas_textblock_cursor_pos_set(cur, 2); | ||
683 | evas_textblock_cursor_char_delete(cur); | ||
684 | evas_textblock_cursor_char_delete(cur); | ||
685 | evas_textblock_cursor_char_delete(cur); | ||
686 | evas_textblock_cursor_char_delete(cur); | ||
687 | evas_textblock_cursor_char_delete(cur); | ||
688 | evas_textblock_cursor_char_delete(cur); | ||
689 | fnode = evas_textblock_node_format_first_get(tb); | ||
690 | fail_if (fnode); | ||
691 | |||
692 | /* Try to remove the formats in a way that shouldn't remove them */ | ||
693 | evas_object_textblock_text_markup_set(tb, buf); | ||
694 | evas_textblock_cursor_pos_set(cur, 7); | ||
695 | evas_textblock_cursor_char_delete(cur); | ||
696 | evas_textblock_cursor_char_delete(cur); | ||
697 | evas_textblock_cursor_char_delete(cur); | ||
698 | evas_textblock_cursor_char_delete(cur); | ||
699 | fnode = evas_textblock_node_format_first_get(tb); | ||
700 | fail_if (!fnode); | ||
701 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
702 | "+ b")); | ||
703 | |||
704 | fnode = evas_textblock_node_format_next_get(fnode); | ||
705 | fail_if (!fnode); | ||
706 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
707 | "+ a")); | ||
708 | |||
709 | fnode = evas_textblock_node_format_next_get(fnode); | ||
710 | fail_if (!fnode); | ||
711 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
712 | "- a")); | ||
713 | |||
714 | fnode = evas_textblock_node_format_next_get(fnode); | ||
715 | fail_if (!fnode); | ||
716 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
717 | "- b")); | ||
718 | |||
719 | fnode = evas_textblock_node_format_next_get(fnode); | ||
720 | fail_if (fnode); | ||
721 | |||
722 | /* Try range deletion to delete a */ | ||
723 | evas_object_textblock_text_markup_set(tb, buf); | ||
724 | evas_textblock_cursor_pos_set(cur, 6); | ||
725 | evas_textblock_cursor_pos_set(main_cur, 9); | ||
726 | evas_textblock_cursor_range_delete(cur, main_cur); | ||
727 | fnode = evas_textblock_node_format_first_get(tb); | ||
728 | fail_if (!fnode); | ||
729 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
730 | "+ b")); | ||
731 | |||
732 | fnode = evas_textblock_node_format_next_get(fnode); | ||
733 | fail_if (!fnode); | ||
734 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
735 | "- b")); | ||
736 | |||
737 | fnode = evas_textblock_node_format_next_get(fnode); | ||
738 | fail_if (fnode); | ||
739 | |||
740 | /* Range deletion to delete both */ | ||
741 | evas_object_textblock_text_markup_set(tb, buf); | ||
742 | evas_textblock_cursor_pos_set(cur, 2); | ||
743 | evas_textblock_cursor_pos_set(main_cur, 11); | ||
744 | evas_textblock_cursor_range_delete(cur, main_cur); | ||
745 | fnode = evas_textblock_node_format_first_get(tb); | ||
746 | fail_if (fnode); | ||
747 | |||
748 | /* Range deletion across paragraphs */ | ||
749 | evas_object_textblock_text_markup_set(tb, | ||
750 | "Th<b>is a<a>te<ps/>" | ||
751 | "s</a>st</b>."); | ||
752 | evas_textblock_cursor_pos_set(cur, 6); | ||
753 | evas_textblock_cursor_pos_set(main_cur, 10); | ||
754 | evas_textblock_cursor_range_delete(cur, main_cur); | ||
755 | fnode = evas_textblock_node_format_first_get(tb); | ||
756 | fail_if (!fnode); | ||
757 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
758 | "+ b")); | ||
759 | |||
760 | fnode = evas_textblock_node_format_next_get(fnode); | ||
761 | fail_if (!fnode); | ||
762 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
763 | "- b")); | ||
764 | |||
765 | fnode = evas_textblock_node_format_next_get(fnode); | ||
766 | fail_if (fnode); | ||
767 | |||
768 | /* Two formats in the same place. */ | ||
769 | evas_object_textblock_text_markup_set(tb, "a<b><a>b</a></b>b"); | ||
770 | evas_textblock_cursor_pos_set(cur, 1); | ||
771 | evas_textblock_cursor_char_delete(cur); | ||
772 | fnode = evas_textblock_node_format_first_get(tb); | ||
773 | fail_if (fnode); | ||
774 | |||
775 | /* Two formats across different paragraphs with notihng in between. */ | ||
776 | evas_object_textblock_text_markup_set(tb, "<b><ps/></b>"); | ||
777 | evas_textblock_cursor_pos_set(cur, 0); | ||
778 | evas_textblock_cursor_char_delete(cur); | ||
779 | fnode = evas_textblock_node_format_first_get(tb); | ||
780 | fail_if (fnode); | ||
781 | |||
782 | /* Try with range */ | ||
783 | evas_object_textblock_text_markup_set(tb, "<b><ps/></b>"); | ||
784 | evas_textblock_cursor_pos_set(cur, 0); | ||
785 | evas_textblock_cursor_pos_set(main_cur, 1); | ||
786 | evas_textblock_cursor_range_delete(cur, main_cur); | ||
787 | fnode = evas_textblock_node_format_first_get(tb); | ||
788 | fail_if (fnode); | ||
789 | |||
790 | /* Verify fmt position and REP_CHAR positions are the same */ | ||
791 | evas_object_textblock_text_markup_set(tb, | ||
792 | "This is<ps/>an <item absize=93x152 vsize=ascent></>a."); | ||
793 | evas_textblock_cursor_pos_set(cur, 7); | ||
794 | evas_textblock_cursor_char_delete(cur); | ||
795 | fnode = evas_textblock_node_format_first_get(tb); | ||
796 | fail_if(_evas_textblock_format_offset_get(fnode) != 10); | ||
797 | |||
798 | /* Out of order <b><i></b></i> mixes. */ | ||
799 | evas_object_textblock_text_markup_set(tb, "a<b>b<i>c</b>d</i>e"); | ||
800 | evas_textblock_cursor_pos_set(cur, 2); | ||
801 | |||
802 | for (i = 0 ; i < 2 ; i++) | ||
803 | { | ||
804 | fnode = evas_textblock_node_format_first_get(tb); | ||
805 | fail_if (!fnode); | ||
806 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "+ b")); | ||
807 | |||
808 | fnode = evas_textblock_node_format_next_get(fnode); | ||
809 | fail_if (!fnode); | ||
810 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "+ i")); | ||
811 | |||
812 | fnode = evas_textblock_node_format_next_get(fnode); | ||
813 | fail_if (!fnode); | ||
814 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "- b")); | ||
815 | |||
816 | fnode = evas_textblock_node_format_next_get(fnode); | ||
817 | fail_if (!fnode); | ||
818 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "- i")); | ||
819 | |||
820 | fnode = evas_textblock_node_format_next_get(fnode); | ||
821 | fail_if (fnode); | ||
822 | |||
823 | evas_textblock_cursor_char_delete(cur); | ||
824 | } | ||
825 | fnode = evas_textblock_node_format_first_get(tb); | ||
826 | fail_if (!fnode); | ||
827 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "+ b")); | ||
828 | |||
829 | fnode = evas_textblock_node_format_next_get(fnode); | ||
830 | fail_if (!fnode); | ||
831 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "- b")); | ||
832 | |||
833 | fnode = evas_textblock_node_format_next_get(fnode); | ||
834 | fail_if (fnode); | ||
835 | |||
836 | /* This time with a generic closer */ | ||
837 | evas_object_textblock_text_markup_set(tb, "a<b>b<i>c</b>d</>e"); | ||
838 | evas_textblock_cursor_pos_set(cur, 2); | ||
839 | |||
840 | for (i = 0 ; i < 2 ; i++) | ||
841 | { | ||
842 | fnode = evas_textblock_node_format_first_get(tb); | ||
843 | fail_if (!fnode); | ||
844 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "+ b")); | ||
845 | |||
846 | fnode = evas_textblock_node_format_next_get(fnode); | ||
847 | fail_if (!fnode); | ||
848 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "+ i")); | ||
849 | |||
850 | fnode = evas_textblock_node_format_next_get(fnode); | ||
851 | fail_if (!fnode); | ||
852 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "- b")); | ||
853 | |||
854 | fnode = evas_textblock_node_format_next_get(fnode); | ||
855 | fail_if (!fnode); | ||
856 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "- ")); | ||
857 | |||
858 | fnode = evas_textblock_node_format_next_get(fnode); | ||
859 | fail_if (fnode); | ||
860 | |||
861 | evas_textblock_cursor_char_delete(cur); | ||
862 | } | ||
863 | fnode = evas_textblock_node_format_first_get(tb); | ||
864 | fail_if (!fnode); | ||
865 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "+ b")); | ||
866 | |||
867 | fnode = evas_textblock_node_format_next_get(fnode); | ||
868 | fail_if (!fnode); | ||
869 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "- b")); | ||
870 | |||
871 | fnode = evas_textblock_node_format_next_get(fnode); | ||
872 | fail_if (fnode); | ||
873 | |||
874 | /* And now with remove pair. */ | ||
875 | evas_object_textblock_text_markup_set(tb, "a<b>b<i>c</b>d</i>e"); | ||
876 | evas_textblock_cursor_pos_set(cur, 2); | ||
877 | fnode = evas_textblock_node_format_first_get(tb); | ||
878 | evas_textblock_node_format_remove_pair(tb, | ||
879 | (Evas_Object_Textblock_Node_Format *) fnode); | ||
880 | |||
881 | fnode = evas_textblock_node_format_first_get(tb); | ||
882 | fail_if (!fnode); | ||
883 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "+ i")); | ||
884 | |||
885 | fnode = evas_textblock_node_format_next_get(fnode); | ||
886 | fail_if (!fnode); | ||
887 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "- i")); | ||
888 | |||
889 | fnode = evas_textblock_node_format_next_get(fnode); | ||
890 | fail_if (fnode); | ||
891 | |||
892 | /* Remove the other pair */ | ||
893 | evas_object_textblock_text_markup_set(tb, "a<b>b<i>c</>d</i>e"); | ||
894 | evas_textblock_cursor_pos_set(cur, 2); | ||
895 | fnode = evas_textblock_node_format_first_get(tb); | ||
896 | fnode = evas_textblock_node_format_next_get(fnode); | ||
897 | evas_textblock_node_format_remove_pair(tb, | ||
898 | (Evas_Object_Textblock_Node_Format *) fnode); | ||
899 | |||
900 | fnode = evas_textblock_node_format_first_get(tb); | ||
901 | fail_if (!fnode); | ||
902 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "+ b")); | ||
903 | |||
904 | fnode = evas_textblock_node_format_next_get(fnode); | ||
905 | fail_if (!fnode); | ||
906 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "- i")); | ||
907 | |||
908 | fnode = evas_textblock_node_format_next_get(fnode); | ||
909 | fail_if (fnode); | ||
910 | |||
911 | /* Remove two pairs with the same name and same positions. */ | ||
912 | evas_object_textblock_text_markup_set(tb, "<a><a>A</a></a>"); | ||
913 | evas_textblock_cursor_pos_set(cur, 0); | ||
914 | evas_textblock_cursor_char_delete(cur); | ||
915 | |||
916 | fnode = evas_textblock_node_format_first_get(tb); | ||
917 | fail_if (fnode); | ||
918 | |||
919 | /* Try to remove a format that doesn't have a pair (with a bad mkup) */ | ||
920 | evas_object_textblock_text_markup_set(tb, "a<b>b<i>c</>d</i>e"); | ||
921 | evas_textblock_cursor_pos_set(cur, 2); | ||
922 | fnode = evas_textblock_node_format_first_get(tb); | ||
923 | evas_textblock_node_format_remove_pair(tb, | ||
924 | (Evas_Object_Textblock_Node_Format *) fnode); | ||
925 | |||
926 | fnode = evas_textblock_node_format_first_get(tb); | ||
927 | fail_if (!fnode); | ||
928 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "+ i")); | ||
929 | |||
930 | fnode = evas_textblock_node_format_next_get(fnode); | ||
931 | fail_if (!fnode); | ||
932 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "- ")); | ||
933 | |||
934 | fnode = evas_textblock_node_format_next_get(fnode); | ||
935 | fail_if (!fnode); | ||
936 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "- i")); | ||
937 | |||
938 | fnode = evas_textblock_node_format_next_get(fnode); | ||
939 | fail_if (fnode); | ||
940 | |||
941 | END_TB_TEST(); | ||
942 | } | ||
943 | END_TEST | ||
944 | |||
945 | /* Testing items */ | ||
946 | START_TEST(evas_textblock_items) | ||
947 | { | ||
948 | Evas_Coord w, h, w2, h2, nw, nh, ih; | ||
949 | START_TB_TEST(); | ||
950 | const char *buf = "This is an <item absize=93x152></>."; | ||
951 | |||
952 | /* Absolute item size */ | ||
953 | buf = "This is an <item absize=93x152 vsize=full></>."; | ||
954 | evas_object_textblock_text_markup_set(tb, buf); | ||
955 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
956 | fail_if((w < 93) || (h != 152)); | ||
957 | evas_textblock_cursor_pos_set(cur, 11); | ||
958 | evas_textblock_cursor_format_item_geometry_get(cur, NULL, NULL, &w, &h); | ||
959 | fail_if((w != 93) || (h != 152)); | ||
960 | |||
961 | buf = "This is an <item absize=93x152 vsize=ascent></>."; | ||
962 | evas_object_textblock_text_markup_set(tb, buf); | ||
963 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
964 | fail_if((w < 93) || (h <= 152)); | ||
965 | evas_textblock_cursor_pos_set(cur, 11); | ||
966 | evas_textblock_cursor_format_item_geometry_get(cur, NULL, NULL, &w, &h); | ||
967 | fail_if((w != 93) || (h != 152)); | ||
968 | |||
969 | /* Size is the same as abssize, unless there's scaling applied. */ | ||
970 | buf = "This is an <item size=93x152 vsize=full></>."; | ||
971 | evas_object_textblock_text_markup_set(tb, buf); | ||
972 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
973 | fail_if((w < 93) || (h != 152)); | ||
974 | evas_textblock_cursor_pos_set(cur, 11); | ||
975 | evas_textblock_cursor_format_item_geometry_get(cur, NULL, NULL, &w, &h); | ||
976 | fail_if((w != 93) || (h != 152)); | ||
977 | |||
978 | buf = "This is an <item size=93x152 vsize=ascent></>."; | ||
979 | evas_object_textblock_text_markup_set(tb, buf); | ||
980 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
981 | fail_if((w < 93) || (h <= 152)); | ||
982 | evas_textblock_cursor_pos_set(cur, 11); | ||
983 | evas_textblock_cursor_format_item_geometry_get(cur, NULL, NULL, &w, &h); | ||
984 | fail_if((w != 93) || (h != 152)); | ||
985 | |||
986 | evas_object_scale_set(tb, 2.0); | ||
987 | buf = "This is an <item size=93x152 vsize=full></>."; | ||
988 | evas_object_textblock_text_markup_set(tb, buf); | ||
989 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
990 | fail_if((w < (2 * 93)) || (h != (2 * 152))); | ||
991 | evas_textblock_cursor_pos_set(cur, 11); | ||
992 | evas_textblock_cursor_format_item_geometry_get(cur, NULL, NULL, &w, &h); | ||
993 | fail_if((w != (2 * 93)) || (h != (2 * 152))); | ||
994 | evas_textblock_cursor_pos_set(cur, 11); | ||
995 | evas_textblock_cursor_format_item_geometry_get(cur, NULL, NULL, &w, &h); | ||
996 | fail_if((w != (2 * 93)) || (h != (2 * 152))); | ||
997 | |||
998 | buf = "This is an <item size=93x152 vsize=ascent></>."; | ||
999 | evas_object_textblock_text_markup_set(tb, buf); | ||
1000 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1001 | fail_if((w < (2 * 93)) || (h <= (2 * 152))); | ||
1002 | evas_textblock_cursor_pos_set(cur, 11); | ||
1003 | evas_textblock_cursor_format_item_geometry_get(cur, NULL, NULL, &w, &h); | ||
1004 | fail_if((w != (2 * 93)) || (h != (2 * 152))); | ||
1005 | |||
1006 | evas_object_scale_set(tb, 1.0); | ||
1007 | |||
1008 | /* Relsize */ | ||
1009 | /* relsize means it should adjust itself to the size of the line */ | ||
1010 | buf = "This is an <item relsize=93x152 vsize=full></>."; | ||
1011 | evas_object_textblock_text_markup_set(tb, buf); | ||
1012 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1013 | fail_if((w >= 93) || (h >= 152)); | ||
1014 | evas_textblock_cursor_pos_set(cur, 11); | ||
1015 | evas_textblock_cursor_format_item_geometry_get(cur, NULL, NULL, &w, &ih); | ||
1016 | fail_if((w > 90) || (h != ih)); | ||
1017 | |||
1018 | buf = "This is an <item relize=93x152 vsize=ascent></>."; | ||
1019 | evas_object_textblock_text_markup_set(tb, buf); | ||
1020 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1021 | fail_if((w >= 93) || (h >= 152)); | ||
1022 | evas_textblock_cursor_pos_set(cur, 11); | ||
1023 | evas_textblock_cursor_format_item_geometry_get(cur, NULL, NULL, &w, &ih); | ||
1024 | fail_if((w > 90) || (h <= ih)); | ||
1025 | |||
1026 | /* Relsize and abs size in the same line, all should be the same size */ | ||
1027 | buf = "<item relsize=64x64 vsize=ascent href=emoticon/knowing-grin></item><item absize=64x64 vsize=ascent href=emoticon/knowing-grin></item><item relsize=64x64 vsize=ascent href=emoticon/knowing-grin></item>"; | ||
1028 | evas_object_textblock_text_markup_set(tb, buf); | ||
1029 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1030 | evas_object_textblock_size_native_get(tb, &nw, &nh); | ||
1031 | fail_if((nw != w) || (nh != h)); | ||
1032 | evas_textblock_cursor_format_item_geometry_get(cur, NULL, NULL, &w, &h); | ||
1033 | evas_textblock_cursor_char_next(cur); | ||
1034 | evas_textblock_cursor_format_item_geometry_get(cur, NULL, NULL, &w2, &h2); | ||
1035 | fail_if((w != w2) || (h != h2)); | ||
1036 | evas_textblock_cursor_format_item_geometry_get(cur, NULL, NULL, &w, &h); | ||
1037 | evas_textblock_cursor_char_next(cur); | ||
1038 | evas_textblock_cursor_format_item_geometry_get(cur, NULL, NULL, &w2, &h2); | ||
1039 | fail_if((w != w2) || (h != h2)); | ||
1040 | |||
1041 | /* FIXME: Also verify x,y positions of the item. */ | ||
1042 | |||
1043 | /* FIXME We need some item tests that involve line wrapping that make the | ||
1044 | * items move between lines that are in different sizes. | ||
1045 | * Also, tests that involve wrapping positions with relsized items. We | ||
1046 | * want to make sure the item gets a relsize on the correct time (before | ||
1047 | * the wrapping, and then is updated after the wrapping) and that | ||
1048 | * all the lines have the correct sizes afterwards. */ | ||
1049 | |||
1050 | END_TB_TEST(); | ||
1051 | } | ||
1052 | END_TEST | ||
1053 | |||
1054 | /* Wrapping tests */ | ||
1055 | START_TEST(evas_textblock_wrapping) | ||
1056 | { | ||
1057 | Evas_Coord bw, bh, w, h, nw, nh; | ||
1058 | int i; | ||
1059 | START_TB_TEST(); | ||
1060 | evas_object_textblock_text_markup_set(tb, "a"); | ||
1061 | evas_object_textblock_size_formatted_get(tb, &bw, &bh); | ||
1062 | |||
1063 | /* Char wrap */ | ||
1064 | evas_object_textblock_text_markup_set(tb, "aaaaaaa"); | ||
1065 | evas_textblock_cursor_format_prepend(cur, "+ wrap=char"); | ||
1066 | evas_object_resize(tb, bw, bh); | ||
1067 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1068 | /* Wrap to minimum */ | ||
1069 | fail_if(w != bw); | ||
1070 | fail_if(h <= bh); | ||
1071 | |||
1072 | /* Mixed - fallback to char wrap */ | ||
1073 | evas_object_textblock_text_markup_set(tb, "aaaaaaa"); | ||
1074 | evas_textblock_cursor_format_prepend(cur, "+ wrap=mixed"); | ||
1075 | evas_object_resize(tb, bw, bh); | ||
1076 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1077 | /* Wrap to minimum */ | ||
1078 | fail_if(w != bw); | ||
1079 | fail_if(h <= bh); | ||
1080 | |||
1081 | /* Basic Word wrap */ | ||
1082 | evas_object_textblock_text_markup_set(tb, "aaaa"); | ||
1083 | evas_object_textblock_size_formatted_get(tb, &bw, &bh); | ||
1084 | |||
1085 | evas_object_textblock_text_markup_set(tb, "aaaa aa"); | ||
1086 | evas_textblock_cursor_format_prepend(cur, "+ wrap=word"); | ||
1087 | evas_object_resize(tb, bw, bh); | ||
1088 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1089 | /* Wrap to minimum */ | ||
1090 | fail_if(w != bw); | ||
1091 | fail_if(h <= bh); | ||
1092 | |||
1093 | /* Mixed - fallback to word wrap */ | ||
1094 | evas_object_textblock_text_markup_set(tb, "aaaa aa"); | ||
1095 | evas_textblock_cursor_format_prepend(cur, "+ wrap=mixed"); | ||
1096 | evas_object_resize(tb, bw + 1, bh); | ||
1097 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1098 | /* Wrap to minimum */ | ||
1099 | fail_if(w != bw); | ||
1100 | fail_if(h <= bh); | ||
1101 | |||
1102 | /* Wrap and then expand again. */ | ||
1103 | evas_object_textblock_text_markup_set(tb, "aaaa aa"); | ||
1104 | evas_textblock_cursor_format_prepend(cur, "+ wrap=word"); | ||
1105 | evas_object_resize(tb, bw, bh); | ||
1106 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1107 | evas_object_textblock_size_native_get(tb, &nw, &nh); | ||
1108 | evas_object_resize(tb, nw, nh); | ||
1109 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1110 | fail_if((w != nw) || (h != nh)); | ||
1111 | |||
1112 | /* Reduce size until reaching the minimum, making sure we don't | ||
1113 | * get something wrong along the way */ | ||
1114 | /* Char wrap */ | ||
1115 | evas_object_textblock_text_markup_set(tb, "a"); | ||
1116 | evas_object_textblock_size_formatted_get(tb, &bw, &bh); | ||
1117 | evas_object_textblock_text_markup_set(tb, | ||
1118 | "aaaa aaaa aaa aa aaa<ps/>" | ||
1119 | "aaaa aaa aaa aaa aaa<ps/>" | ||
1120 | "a aaaaa aaaaaaaaaaaaaa<br/>aaaaa<ps/>" | ||
1121 | "aaaaaa" | ||
1122 | ); | ||
1123 | evas_textblock_cursor_format_prepend(cur, "+ wrap=char"); | ||
1124 | evas_object_textblock_size_native_get(tb, &nw, &nh); | ||
1125 | |||
1126 | Evas_Coord iw; | ||
1127 | for (iw = nw ; iw >= bw ; iw--) | ||
1128 | { | ||
1129 | evas_object_resize(tb, iw, 1000); | ||
1130 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1131 | fail_if(w < bw); | ||
1132 | fail_if(w > iw); | ||
1133 | } | ||
1134 | fail_if(w != bw); | ||
1135 | |||
1136 | /* Word wrap */ | ||
1137 | evas_object_textblock_text_markup_set(tb, "aaaaaa"); | ||
1138 | evas_object_textblock_size_formatted_get(tb, &bw, &bh); | ||
1139 | evas_object_textblock_text_markup_set(tb, | ||
1140 | "aaaa aaaa aaa aa aaa<ps/>" | ||
1141 | "aaaa aaa aaa aaa aaa<ps/>" | ||
1142 | "a aaaaa aaaaaa<br/>aaaaa<ps/>" | ||
1143 | "aaaaa" | ||
1144 | ); | ||
1145 | evas_textblock_cursor_format_prepend(cur, "+ wrap=word"); | ||
1146 | evas_object_textblock_size_native_get(tb, &nw, &nh); | ||
1147 | |||
1148 | for (iw = nw ; iw >= bw ; iw--) | ||
1149 | { | ||
1150 | evas_object_resize(tb, iw, 1000); | ||
1151 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1152 | fail_if(w < bw); | ||
1153 | fail_if(w > iw); | ||
1154 | } | ||
1155 | fail_if(w != bw); | ||
1156 | |||
1157 | /* Mixed wrap */ | ||
1158 | evas_object_textblock_text_markup_set(tb, "a"); | ||
1159 | evas_object_textblock_size_formatted_get(tb, &bw, &bh); | ||
1160 | evas_object_textblock_text_markup_set(tb, | ||
1161 | "aaaa aaaa aaa aa aaa<ps/>" | ||
1162 | "aaaa aaa aaa aaa aaa<ps/>" | ||
1163 | "a aaaaa aaaaaa<br/>aaaaa<ps/>" | ||
1164 | "aaaaa" | ||
1165 | ); | ||
1166 | evas_textblock_cursor_format_prepend(cur, "+ wrap=mixed"); | ||
1167 | evas_object_textblock_size_native_get(tb, &nw, &nh); | ||
1168 | |||
1169 | for (iw = nw ; iw >= bw ; iw--) | ||
1170 | { | ||
1171 | evas_object_resize(tb, iw, 1000); | ||
1172 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1173 | fail_if(w < bw); | ||
1174 | fail_if(w > iw); | ||
1175 | } | ||
1176 | fail_if(w != bw); | ||
1177 | |||
1178 | /* Resize, making sure we keep going down in the minimum size. */ | ||
1179 | char *wrap_style[] = { "+ wrap=word", "+ wrap=char", "+ wrap=mixed" }; | ||
1180 | int wrap_items = sizeof(wrap_style) / sizeof(*wrap_style); | ||
1181 | |||
1182 | evas_object_textblock_text_markup_set(tb, | ||
1183 | "This is an entry widget in this window that<br/>" | ||
1184 | "uses markup <b>like this</> for styling and<br/>" | ||
1185 | "formatting <em>like this</>, as well as<br/>" | ||
1186 | "<a href=X><link>links in the text</></a>, so enter text<br/>" | ||
1187 | "in here to edit it. By the way, links are<br/>" | ||
1188 | "called <a href=anc-02>Anchors</a> so you will need<br/>" | ||
1189 | "to refer to them this way.<br/>" | ||
1190 | "<br/>" | ||
1191 | |||
1192 | "Also you can stick in items with (relsize + ascent): " | ||
1193 | "<item relsize=16x16 vsize=ascent href=emoticon/evil-laugh></item>" | ||
1194 | " (full) " | ||
1195 | "<item relsize=16x16 vsize=full href=emoticon/guilty-smile></item>" | ||
1196 | " (to the left)<br/>" | ||
1197 | |||
1198 | "Also (size + ascent): " | ||
1199 | "<item size=16x16 vsize=ascent href=emoticon/haha></item>" | ||
1200 | " (full) " | ||
1201 | "<item size=16x16 vsize=full href=emoticon/happy-panting></item>" | ||
1202 | " (before this)<br/>" | ||
1203 | |||
1204 | "And as well (absize + ascent): " | ||
1205 | "<item absize=64x64 vsize=ascent href=emoticon/knowing-grin></item>" | ||
1206 | " (full) " | ||
1207 | "<item absize=64x64 vsize=full href=emoticon/not-impressed></item>" | ||
1208 | " or even paths to image files on disk too like: " | ||
1209 | "<item absize=96x128 vsize=full href=file://%s/images/sky_01.jpg></item>" | ||
1210 | " ... end." | ||
1211 | ); | ||
1212 | |||
1213 | /* Get minimum size */ | ||
1214 | evas_object_textblock_size_native_get(tb, &nw, &nh); | ||
1215 | |||
1216 | for (i = 0 ; i < wrap_items ; i++) | ||
1217 | { | ||
1218 | evas_textblock_cursor_format_prepend(cur, wrap_style[i]); | ||
1219 | evas_object_resize(tb, 0, 0); | ||
1220 | evas_object_textblock_size_formatted_get(tb, &bw, &bh); | ||
1221 | |||
1222 | for (iw = nw ; iw >= bw ; iw--) | ||
1223 | { | ||
1224 | evas_object_resize(tb, iw, 1000); | ||
1225 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1226 | fail_if(w < bw); | ||
1227 | fail_if(w > iw); | ||
1228 | } | ||
1229 | fail_if(w != bw); | ||
1230 | } | ||
1231 | |||
1232 | |||
1233 | /* Ellipsis */ | ||
1234 | evas_object_textblock_text_markup_set(tb, "aaaaaaaaaa"); | ||
1235 | evas_textblock_cursor_format_prepend(cur, "+ ellipsis=1.0"); | ||
1236 | evas_object_textblock_size_native_get(tb, &nw, &nh); | ||
1237 | evas_object_resize(tb, nw / 2, nh); | ||
1238 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1239 | fail_if((w > (nw / 2)) || (h != nh)); | ||
1240 | |||
1241 | evas_object_textblock_text_markup_set(tb, "aaaaaaaaaaaaaaaaaa<br/>b"); | ||
1242 | evas_textblock_cursor_format_prepend(cur, "+ ellipsis=1.0 wrap=word"); | ||
1243 | evas_object_textblock_size_native_get(tb, &nw, &nh); | ||
1244 | evas_object_resize(tb, nw / 2, nh * 2); | ||
1245 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1246 | fail_if(w > (nw / 2)); | ||
1247 | |||
1248 | END_TB_TEST(); | ||
1249 | } | ||
1250 | END_TEST | ||
1251 | |||
1252 | /* Various textblock stuff */ | ||
1253 | START_TEST(evas_textblock_various) | ||
1254 | { | ||
1255 | Evas_Coord w, h, bw, bh; | ||
1256 | START_TB_TEST(); | ||
1257 | const char *buf = "This<ps/>textblock<ps/>has<ps/>a<ps/>lot<ps/>of<ps/>lines<ps/>."; | ||
1258 | evas_object_textblock_text_markup_set(tb, buf); | ||
1259 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1260 | /* Move outside of the screen so it'll have to search for the correct | ||
1261 | * paragraph and etc. */ | ||
1262 | evas_object_move(tb, -(w / 2), -(h / 2)); | ||
1263 | |||
1264 | /* Replacement char */ | ||
1265 | evas_object_textblock_text_markup_set(tb, "*"); | ||
1266 | evas_object_textblock_size_formatted_get(tb, &bw, &bh); | ||
1267 | evas_object_textblock_replace_char_set(tb, "*"); | ||
1268 | evas_object_textblock_text_markup_set(tb, "|"); | ||
1269 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1270 | fail_if((w != bw) || (h != bh)); | ||
1271 | |||
1272 | /* Items have correct text node information */ | ||
1273 | evas_object_textblock_text_markup_set(tb, ""); | ||
1274 | fail_if(!_evas_textblock_check_item_node_link(tb)); | ||
1275 | evas_object_textblock_text_markup_set(tb, "<ps/>"); | ||
1276 | fail_if(!_evas_textblock_check_item_node_link(tb)); | ||
1277 | evas_object_textblock_text_markup_set(tb, "a<ps/>"); | ||
1278 | fail_if(!_evas_textblock_check_item_node_link(tb)); | ||
1279 | evas_object_textblock_text_markup_set(tb, "a<ps/>a"); | ||
1280 | fail_if(!_evas_textblock_check_item_node_link(tb)); | ||
1281 | evas_object_textblock_text_markup_set(tb, "a<ps/>a<ps/>"); | ||
1282 | fail_if(!_evas_textblock_check_item_node_link(tb)); | ||
1283 | evas_object_textblock_text_markup_set(tb, "a<ps/>a<ps/>a"); | ||
1284 | fail_if(!_evas_textblock_check_item_node_link(tb)); | ||
1285 | |||
1286 | /* These shouldn't crash (although the desired outcome is not yet defined) */ | ||
1287 | evas_object_textblock_text_markup_set(tb, ""); | ||
1288 | evas_textblock_cursor_pos_set(cur, 0); | ||
1289 | evas_textblock_cursor_char_delete(cur); | ||
1290 | |||
1291 | evas_object_textblock_text_markup_set(tb, "\xEF\xBF\xBC"); | ||
1292 | evas_textblock_cursor_pos_set(cur, 0); | ||
1293 | evas_textblock_cursor_char_delete(cur); | ||
1294 | |||
1295 | END_TB_TEST(); | ||
1296 | } | ||
1297 | END_TEST | ||
1298 | |||
1299 | /* Various geometries. e.g. range geometry. */ | ||
1300 | START_TEST(evas_textblock_geometries) | ||
1301 | { | ||
1302 | START_TB_TEST(); | ||
1303 | const char *buf = "This is a <br/> test."; | ||
1304 | evas_object_textblock_text_markup_set(tb, buf); | ||
1305 | |||
1306 | /* Single line range */ | ||
1307 | Evas_Textblock_Cursor *main_cur = evas_object_textblock_cursor_get(tb); | ||
1308 | evas_textblock_cursor_pos_set(cur, 0); | ||
1309 | evas_textblock_cursor_pos_set(main_cur, 6); | ||
1310 | |||
1311 | Eina_List *rects, *rects2; | ||
1312 | Evas_Textblock_Rectangle *tr, *tr2; | ||
1313 | rects = evas_textblock_cursor_range_geometry_get(cur, main_cur); | ||
1314 | fail_if(!rects); | ||
1315 | rects2 = evas_textblock_cursor_range_geometry_get(main_cur, cur); | ||
1316 | fail_if(!rects2); | ||
1317 | |||
1318 | fail_if(eina_list_count(rects) != 1); | ||
1319 | fail_if(eina_list_count(rects2) != 1); | ||
1320 | |||
1321 | tr = eina_list_data_get(rects); | ||
1322 | fail_if((tr->h <= 0) || (tr->w <= 0)); | ||
1323 | tr2 = eina_list_data_get(rects2); | ||
1324 | fail_if((tr2->h <= 0) || (tr2->w <= 0)); | ||
1325 | |||
1326 | fail_if((tr->x != tr2->x) || (tr->y != tr2->y) || (tr->w != tr2->w) || | ||
1327 | (tr->h != tr2->h)); | ||
1328 | |||
1329 | /* Multiline range */ | ||
1330 | evas_textblock_cursor_pos_set(cur, 0); | ||
1331 | evas_textblock_cursor_pos_set(main_cur, 14); | ||
1332 | |||
1333 | rects = evas_textblock_cursor_range_geometry_get(cur, main_cur); | ||
1334 | fail_if(!rects); | ||
1335 | rects2 = evas_textblock_cursor_range_geometry_get(main_cur, cur); | ||
1336 | fail_if(!rects2); | ||
1337 | |||
1338 | fail_if(eina_list_count(rects) != 2); | ||
1339 | fail_if(eina_list_count(rects2) != 2); | ||
1340 | |||
1341 | tr = eina_list_data_get(rects); | ||
1342 | fail_if((tr->h <= 0) || (tr->w <= 0)); | ||
1343 | tr2 = eina_list_data_get(rects2); | ||
1344 | fail_if((tr2->h <= 0) || (tr2->w <= 0)); | ||
1345 | |||
1346 | fail_if((tr->x != tr2->x) || (tr->y != tr2->y) || (tr->w != tr2->w) || | ||
1347 | (tr->h != tr2->h)); | ||
1348 | |||
1349 | tr = eina_list_data_get(eina_list_next(rects)); | ||
1350 | fail_if((tr->h <= 0) || (tr->w <= 0)); | ||
1351 | tr2 = eina_list_data_get(eina_list_next(rects2)); | ||
1352 | fail_if((tr2->h <= 0) || (tr2->w <= 0)); | ||
1353 | |||
1354 | fail_if((tr->x != tr2->x) || (tr->y != tr2->y) || (tr->w != tr2->w) || | ||
1355 | (tr->h != tr2->h)); | ||
1356 | |||
1357 | /* Check that the second line is positioned below the first */ | ||
1358 | tr = eina_list_data_get(rects); | ||
1359 | tr2 = eina_list_data_get(eina_list_next(rects)); | ||
1360 | fail_if(tr->y >= tr2->y); | ||
1361 | |||
1362 | END_TB_TEST(); | ||
1363 | } | ||
1364 | END_TEST | ||
1365 | |||
1366 | /* Should handle all the text editing. */ | ||
1367 | START_TEST(evas_textblock_editing) | ||
1368 | { | ||
1369 | START_TB_TEST(); | ||
1370 | const char *buf = "First par.<ps/>Second par."; | ||
1371 | evas_object_textblock_text_markup_set(tb, buf); | ||
1372 | Evas_Textblock_Cursor *main_cur = evas_object_textblock_cursor_get(tb); | ||
1373 | |||
1374 | /* Check deletion works */ | ||
1375 | /* Try deleting after the end of the textblock */ | ||
1376 | { | ||
1377 | char *content; | ||
1378 | evas_textblock_cursor_paragraph_last(cur); | ||
1379 | content = strdup(evas_object_textblock_text_markup_get(tb)); | ||
1380 | evas_textblock_cursor_char_delete(cur); | ||
1381 | fail_if(strcmp(content, evas_object_textblock_text_markup_get(tb))); | ||
1382 | free(content); | ||
1383 | } | ||
1384 | |||
1385 | /* Delete the first char */ | ||
1386 | evas_textblock_cursor_paragraph_first(cur); | ||
1387 | evas_textblock_cursor_char_delete(cur); | ||
1388 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), | ||
1389 | "irst par.<ps/>Second par.")); | ||
1390 | |||
1391 | /* Delete some arbitrary char */ | ||
1392 | evas_textblock_cursor_char_next(cur); | ||
1393 | evas_textblock_cursor_char_next(cur); | ||
1394 | evas_textblock_cursor_char_next(cur); | ||
1395 | evas_textblock_cursor_char_delete(cur); | ||
1396 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), | ||
1397 | "irs par.<ps/>Second par.")); | ||
1398 | |||
1399 | /* Delete a range */ | ||
1400 | evas_textblock_cursor_pos_set(main_cur, 1); | ||
1401 | evas_textblock_cursor_pos_set(cur, 6); | ||
1402 | evas_textblock_cursor_range_delete(cur, main_cur); | ||
1403 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), | ||
1404 | "ir.<ps/>Second par.")); | ||
1405 | evas_textblock_cursor_paragraph_char_first(main_cur); | ||
1406 | evas_textblock_cursor_paragraph_char_last(cur); | ||
1407 | evas_textblock_cursor_char_next(cur); | ||
1408 | evas_textblock_cursor_range_delete(cur, main_cur); | ||
1409 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), | ||
1410 | "Second par.")); | ||
1411 | |||
1412 | evas_object_textblock_text_markup_set(tb, buf); | ||
1413 | evas_textblock_cursor_paragraph_last(main_cur); | ||
1414 | evas_object_textblock_text_markup_prepend(main_cur, "Test<b>bla</b>bla."); | ||
1415 | evas_textblock_cursor_paragraph_last(cur); | ||
1416 | evas_textblock_cursor_paragraph_char_first(main_cur); | ||
1417 | evas_textblock_cursor_range_delete(cur, main_cur); | ||
1418 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), | ||
1419 | "First par.<ps/>")); | ||
1420 | |||
1421 | /* Merging paragraphs */ | ||
1422 | evas_object_textblock_text_markup_set(tb, buf); | ||
1423 | evas_textblock_cursor_paragraph_char_last(cur); | ||
1424 | evas_textblock_cursor_copy(cur, main_cur); | ||
1425 | evas_textblock_cursor_char_delete(cur); | ||
1426 | |||
1427 | evas_textblock_cursor_paragraph_first(cur); | ||
1428 | fail_if(evas_textblock_cursor_paragraph_next(cur)); | ||
1429 | |||
1430 | /* Split paragraphs */ | ||
1431 | evas_textblock_cursor_format_prepend(cur, "ps"); | ||
1432 | |||
1433 | evas_textblock_cursor_paragraph_first(cur); | ||
1434 | fail_if(!evas_textblock_cursor_paragraph_next(cur)); | ||
1435 | fail_if(evas_textblock_cursor_paragraph_next(cur)); | ||
1436 | |||
1437 | /* Merge paragraphs using range deletion */ | ||
1438 | evas_object_textblock_text_markup_set(tb, buf); | ||
1439 | evas_textblock_cursor_paragraph_first(cur); | ||
1440 | evas_textblock_cursor_paragraph_char_last(cur); | ||
1441 | evas_textblock_cursor_copy(cur, main_cur); | ||
1442 | evas_textblock_cursor_char_prev(cur); | ||
1443 | evas_textblock_cursor_char_next(main_cur); | ||
1444 | |||
1445 | evas_textblock_cursor_range_delete(cur, main_cur); | ||
1446 | evas_textblock_cursor_paragraph_first(cur); | ||
1447 | fail_if(evas_textblock_cursor_paragraph_next(cur)); | ||
1448 | |||
1449 | /* Insert illegal characters inside the format. */ | ||
1450 | { | ||
1451 | const char *content; | ||
1452 | evas_object_textblock_text_markup_set(tb, "a\n"); | ||
1453 | evas_textblock_cursor_pos_set(cur, 1); | ||
1454 | content = evas_textblock_cursor_content_get(cur); | ||
1455 | |||
1456 | evas_object_textblock_text_markup_set(tb, "a\t"); | ||
1457 | evas_textblock_cursor_pos_set(cur, 1); | ||
1458 | content = evas_textblock_cursor_content_get(cur); | ||
1459 | |||
1460 | evas_object_textblock_text_markup_set(tb, "a\xEF\xBF\xBC"); | ||
1461 | evas_textblock_cursor_pos_set(cur, 1); | ||
1462 | content = evas_textblock_cursor_content_get(cur); | ||
1463 | |||
1464 | evas_object_textblock_text_markup_set(tb, "a\xE2\x80\xA9"); | ||
1465 | evas_textblock_cursor_pos_set(cur, 1); | ||
1466 | content = evas_textblock_cursor_content_get(cur); | ||
1467 | (void) content; | ||
1468 | } | ||
1469 | |||
1470 | /* FIXME: Also add text appending/prepending */ | ||
1471 | |||
1472 | END_TB_TEST(); | ||
1473 | } | ||
1474 | END_TEST | ||
1475 | |||
1476 | /* Text getters */ | ||
1477 | START_TEST(evas_textblock_text_getters) | ||
1478 | { | ||
1479 | START_TB_TEST(); | ||
1480 | const char *buf = "This is a <br/> test.<ps/>" | ||
1481 | "טקסט בעברית<ps/>and now in english."; | ||
1482 | evas_object_textblock_text_markup_set(tb, buf); | ||
1483 | evas_textblock_cursor_paragraph_first(cur); | ||
1484 | |||
1485 | fail_if(strcmp(evas_textblock_cursor_paragraph_text_get(cur), | ||
1486 | "This is a <br/> test.")); | ||
1487 | |||
1488 | evas_textblock_cursor_paragraph_next(cur); | ||
1489 | fail_if(strcmp(evas_textblock_cursor_paragraph_text_get(cur), | ||
1490 | "טקסט בעברית")); | ||
1491 | |||
1492 | evas_textblock_cursor_paragraph_next(cur); | ||
1493 | fail_if(strcmp(evas_textblock_cursor_paragraph_text_get(cur), | ||
1494 | "and now in english.")); | ||
1495 | |||
1496 | /* Range get */ | ||
1497 | Evas_Textblock_Cursor *main_cur = evas_object_textblock_cursor_get(tb); | ||
1498 | evas_textblock_cursor_pos_set(main_cur, 2); | ||
1499 | evas_textblock_cursor_pos_set(cur, 2); | ||
1500 | fail_if(*evas_textblock_cursor_range_text_get(main_cur, cur, | ||
1501 | EVAS_TEXTBLOCK_TEXT_MARKUP)); | ||
1502 | |||
1503 | evas_textblock_cursor_pos_set(main_cur, 2); | ||
1504 | evas_textblock_cursor_pos_set(cur, 6); | ||
1505 | fail_if(strcmp(evas_textblock_cursor_range_text_get(main_cur, cur, | ||
1506 | EVAS_TEXTBLOCK_TEXT_MARKUP), "is i")); | ||
1507 | |||
1508 | evas_textblock_cursor_pos_set(main_cur, 5); | ||
1509 | evas_textblock_cursor_pos_set(cur, 14); | ||
1510 | fail_if(strcmp(evas_textblock_cursor_range_text_get(main_cur, cur, | ||
1511 | EVAS_TEXTBLOCK_TEXT_MARKUP), "is a <br/> te")); | ||
1512 | |||
1513 | evas_textblock_cursor_pos_set(main_cur, 14); | ||
1514 | evas_textblock_cursor_pos_set(cur, 20); | ||
1515 | fail_if(strcmp(evas_textblock_cursor_range_text_get(main_cur, cur, | ||
1516 | EVAS_TEXTBLOCK_TEXT_MARKUP), "st.<ps/>טק")); | ||
1517 | |||
1518 | evas_textblock_cursor_pos_set(main_cur, 14); | ||
1519 | evas_textblock_cursor_pos_set(cur, 32); | ||
1520 | fail_if(strcmp(evas_textblock_cursor_range_text_get(main_cur, cur, | ||
1521 | EVAS_TEXTBLOCK_TEXT_MARKUP), "st.<ps/>טקסט בעברית<ps/>an")); | ||
1522 | |||
1523 | /* Backward range get */ | ||
1524 | evas_textblock_cursor_pos_set(main_cur, 2); | ||
1525 | evas_textblock_cursor_pos_set(cur, 2); | ||
1526 | fail_if(*evas_textblock_cursor_range_text_get(cur, main_cur, | ||
1527 | EVAS_TEXTBLOCK_TEXT_MARKUP)); | ||
1528 | |||
1529 | evas_textblock_cursor_pos_set(main_cur, 2); | ||
1530 | evas_textblock_cursor_pos_set(cur, 6); | ||
1531 | fail_if(strcmp(evas_textblock_cursor_range_text_get(cur, main_cur, | ||
1532 | EVAS_TEXTBLOCK_TEXT_MARKUP), "is i")); | ||
1533 | |||
1534 | evas_textblock_cursor_pos_set(main_cur, 5); | ||
1535 | evas_textblock_cursor_pos_set(cur, 14); | ||
1536 | fail_if(strcmp(evas_textblock_cursor_range_text_get(cur, main_cur, | ||
1537 | EVAS_TEXTBLOCK_TEXT_MARKUP), "is a <br/> te")); | ||
1538 | |||
1539 | evas_textblock_cursor_pos_set(main_cur, 14); | ||
1540 | evas_textblock_cursor_pos_set(cur, 20); | ||
1541 | fail_if(strcmp(evas_textblock_cursor_range_text_get(cur, main_cur, | ||
1542 | EVAS_TEXTBLOCK_TEXT_MARKUP), "st.<ps/>טק")); | ||
1543 | |||
1544 | evas_textblock_cursor_pos_set(main_cur, 14); | ||
1545 | evas_textblock_cursor_pos_set(cur, 32); | ||
1546 | fail_if(strcmp(evas_textblock_cursor_range_text_get(cur, main_cur, | ||
1547 | EVAS_TEXTBLOCK_TEXT_MARKUP), "st.<ps/>טקסט בעברית<ps/>an")); | ||
1548 | |||
1549 | /* Uninit cursors and other weird cases */ | ||
1550 | evas_object_textblock_clear(tb); | ||
1551 | evas_textblock_cursor_copy(main_cur, cur); | ||
1552 | evas_textblock_cursor_text_prepend(main_cur, "aaa"); | ||
1553 | fail_if(strcmp(evas_textblock_cursor_range_text_get(cur, main_cur, | ||
1554 | EVAS_TEXTBLOCK_TEXT_MARKUP), "aaa")); | ||
1555 | |||
1556 | /* Markup to plain and vice versa */ | ||
1557 | { | ||
1558 | char *tmp, *tmp2; | ||
1559 | |||
1560 | /* Real textblock object */ | ||
1561 | tmp = evas_textblock_text_markup_to_utf8(tb, "<br/>aa<\n/>bb<\t/>"); | ||
1562 | fail_if(strcmp(tmp, "\naa\nbb\t")); | ||
1563 | tmp2 = evas_textblock_text_utf8_to_markup(tb, tmp); | ||
1564 | fail_if(strcmp(tmp2, "<br/>aa<br/>bb<tab/>")); | ||
1565 | free(tmp2); | ||
1566 | free(tmp); | ||
1567 | |||
1568 | tmp = evas_textblock_text_markup_to_utf8(tb, "a<item></item>"); | ||
1569 | fail_if(strcmp(tmp, "a\xEF\xBF\xBC")); | ||
1570 | tmp2 = evas_textblock_text_utf8_to_markup(tb, tmp); | ||
1571 | fail_if(strcmp(tmp2, "a")); | ||
1572 | free(tmp2); | ||
1573 | free(tmp); | ||
1574 | |||
1575 | tmp = evas_textblock_text_markup_to_utf8(tb, "a "); | ||
1576 | fail_if(strcmp(tmp, "a\xC2\xA0")); | ||
1577 | tmp2 = evas_textblock_text_utf8_to_markup(tb, tmp); | ||
1578 | fail_if(strcmp(tmp2, "a\xC2\xA0")); | ||
1579 | free(tmp2); | ||
1580 | free(tmp); | ||
1581 | |||
1582 | tmp = evas_textblock_text_markup_to_utf8(tb, "a<b>b</b><more></>a"); | ||
1583 | fail_if(strcmp(tmp, "aba")); | ||
1584 | tmp2 = evas_textblock_text_utf8_to_markup(tb, tmp); | ||
1585 | fail_if(strcmp(tmp2, "aba")); | ||
1586 | free(tmp2); | ||
1587 | free(tmp); | ||
1588 | |||
1589 | tmp = evas_textblock_text_markup_to_utf8(tb, "a&a"); | ||
1590 | fail_if(strcmp(tmp, "a&a")); | ||
1591 | tmp2 = evas_textblock_text_utf8_to_markup(tb, tmp); | ||
1592 | fail_if(strcmp(tmp2, "a&a")); | ||
1593 | free(tmp2); | ||
1594 | free(tmp); | ||
1595 | |||
1596 | tmp = evas_textblock_text_markup_to_utf8(tb, "a<newline/>a"); | ||
1597 | fail_if(strcmp(tmp, "a\na")); | ||
1598 | tmp2 = evas_textblock_text_utf8_to_markup(tb, tmp); | ||
1599 | fail_if(strcmp(tmp2, "a<br/>a")); | ||
1600 | free(tmp2); | ||
1601 | free(tmp); | ||
1602 | |||
1603 | /* NULL textblock object */ | ||
1604 | tmp = evas_textblock_text_markup_to_utf8(NULL, "<br/>aa<\n/>bb<\t/>"); | ||
1605 | fail_if(strcmp(tmp, "\naa\nbb\t")); | ||
1606 | tmp2 = evas_textblock_text_utf8_to_markup(NULL, tmp); | ||
1607 | fail_if(strcmp(tmp2, "<br/>aa<br/>bb<tab/>")); | ||
1608 | free(tmp2); | ||
1609 | free(tmp); | ||
1610 | |||
1611 | tmp = evas_textblock_text_markup_to_utf8(NULL, "a<item></item>"); | ||
1612 | fail_if(strcmp(tmp, "a\xEF\xBF\xBC")); | ||
1613 | tmp2 = evas_textblock_text_utf8_to_markup(NULL, tmp); | ||
1614 | fail_if(strcmp(tmp2, "a")); | ||
1615 | free(tmp2); | ||
1616 | free(tmp); | ||
1617 | |||
1618 | tmp = evas_textblock_text_markup_to_utf8(NULL, "a "); | ||
1619 | fail_if(strcmp(tmp, "a\xC2\xA0")); | ||
1620 | tmp2 = evas_textblock_text_utf8_to_markup(NULL, tmp); | ||
1621 | fail_if(strcmp(tmp2, "a\xC2\xA0")); | ||
1622 | free(tmp2); | ||
1623 | free(tmp); | ||
1624 | |||
1625 | tmp = evas_textblock_text_markup_to_utf8(NULL, "a<b>b</b><more></>a"); | ||
1626 | fail_if(strcmp(tmp, "aba")); | ||
1627 | tmp2 = evas_textblock_text_utf8_to_markup(NULL, tmp); | ||
1628 | fail_if(strcmp(tmp2, "aba")); | ||
1629 | free(tmp2); | ||
1630 | free(tmp); | ||
1631 | |||
1632 | tmp = evas_textblock_text_markup_to_utf8(tb, "a&a"); | ||
1633 | fail_if(strcmp(tmp, "a&a")); | ||
1634 | tmp2 = evas_textblock_text_utf8_to_markup(tb, tmp); | ||
1635 | fail_if(strcmp(tmp2, "a&a")); | ||
1636 | free(tmp2); | ||
1637 | free(tmp); | ||
1638 | |||
1639 | tmp = evas_textblock_text_markup_to_utf8(NULL, "a<newline/>a"); | ||
1640 | fail_if(strcmp(tmp, "aa")); | ||
1641 | tmp2 = evas_textblock_text_utf8_to_markup(NULL, tmp); | ||
1642 | fail_if(strcmp(tmp2, "aa")); | ||
1643 | free(tmp2); | ||
1644 | free(tmp); | ||
1645 | } | ||
1646 | |||
1647 | END_TB_TEST(); | ||
1648 | } | ||
1649 | END_TEST | ||
1650 | |||
1651 | /* Formats */ | ||
1652 | START_TEST(evas_textblock_formats) | ||
1653 | { | ||
1654 | START_TB_TEST(); | ||
1655 | const char *buf = "Th<b>i<font_size=15 wrap=none>s i</font_size=13>s</> a <br/> te<ps/>st<item></>."; | ||
1656 | const Evas_Object_Textblock_Node_Format *fnode; | ||
1657 | evas_object_textblock_text_markup_set(tb, buf); | ||
1658 | |||
1659 | /* Walk from the start */ | ||
1660 | fnode = evas_textblock_node_format_first_get(tb); | ||
1661 | fail_if(!fnode); | ||
1662 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "+ b")); | ||
1663 | |||
1664 | fnode = evas_textblock_node_format_next_get(fnode); | ||
1665 | fail_if(!fnode); | ||
1666 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
1667 | "+ font_size=15 wrap=none")); | ||
1668 | |||
1669 | fnode = evas_textblock_node_format_next_get(fnode); | ||
1670 | fail_if(!fnode); | ||
1671 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
1672 | "- font_size=13")); | ||
1673 | |||
1674 | fnode = evas_textblock_node_format_next_get(fnode); | ||
1675 | fail_if(!fnode); | ||
1676 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "- ")); | ||
1677 | |||
1678 | fnode = evas_textblock_node_format_next_get(fnode); | ||
1679 | fail_if(!fnode); | ||
1680 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "br")); | ||
1681 | |||
1682 | fnode = evas_textblock_node_format_next_get(fnode); | ||
1683 | fail_if(!fnode); | ||
1684 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "ps")); | ||
1685 | |||
1686 | fnode = evas_textblock_node_format_next_get(fnode); | ||
1687 | fail_if(!fnode); | ||
1688 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "+ item")); | ||
1689 | |||
1690 | fnode = evas_textblock_node_format_next_get(fnode); | ||
1691 | fail_if(!fnode); | ||
1692 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "- ")); | ||
1693 | |||
1694 | fnode = evas_textblock_node_format_next_get(fnode); | ||
1695 | fail_if(fnode); | ||
1696 | |||
1697 | /* Walk backwards */ | ||
1698 | fnode = evas_textblock_node_format_last_get(tb); | ||
1699 | fail_if(!fnode); | ||
1700 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "- ")); | ||
1701 | |||
1702 | fnode = evas_textblock_node_format_prev_get(fnode); | ||
1703 | fail_if(!fnode); | ||
1704 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "+ item")); | ||
1705 | |||
1706 | fnode = evas_textblock_node_format_prev_get(fnode); | ||
1707 | fail_if(!fnode); | ||
1708 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "ps")); | ||
1709 | |||
1710 | fnode = evas_textblock_node_format_prev_get(fnode); | ||
1711 | fail_if(!fnode); | ||
1712 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "br")); | ||
1713 | |||
1714 | fnode = evas_textblock_node_format_prev_get(fnode); | ||
1715 | fail_if(!fnode); | ||
1716 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "- ")); | ||
1717 | |||
1718 | fnode = evas_textblock_node_format_prev_get(fnode); | ||
1719 | fail_if(!fnode); | ||
1720 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
1721 | "- font_size=13")); | ||
1722 | |||
1723 | fnode = evas_textblock_node_format_prev_get(fnode); | ||
1724 | fail_if(!fnode); | ||
1725 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), | ||
1726 | "+ font_size=15 wrap=none")); | ||
1727 | |||
1728 | fnode = evas_textblock_node_format_prev_get(fnode); | ||
1729 | fail_if(!fnode); | ||
1730 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "+ b")); | ||
1731 | |||
1732 | fnode = evas_textblock_node_format_prev_get(fnode); | ||
1733 | fail_if(fnode); | ||
1734 | |||
1735 | /* Cursor and format detection */ | ||
1736 | fnode = evas_textblock_node_format_first_get(tb); | ||
1737 | fail_if(!fnode); | ||
1738 | evas_textblock_cursor_at_format_set(cur, fnode); | ||
1739 | fail_if(evas_textblock_cursor_format_is_visible_get(cur)); | ||
1740 | |||
1741 | fnode = evas_textblock_node_format_next_get(fnode); | ||
1742 | fail_if(!fnode); | ||
1743 | evas_textblock_cursor_at_format_set(cur, fnode); | ||
1744 | fail_if(evas_textblock_cursor_format_is_visible_get(cur)); | ||
1745 | |||
1746 | fnode = evas_textblock_node_format_next_get(fnode); | ||
1747 | fail_if(!fnode); | ||
1748 | evas_textblock_cursor_at_format_set(cur, fnode); | ||
1749 | fail_if(evas_textblock_cursor_format_is_visible_get(cur)); | ||
1750 | |||
1751 | fnode = evas_textblock_node_format_next_get(fnode); | ||
1752 | fail_if(!fnode); | ||
1753 | evas_textblock_cursor_at_format_set(cur, fnode); | ||
1754 | fail_if(evas_textblock_cursor_format_is_visible_get(cur)); | ||
1755 | |||
1756 | fnode = evas_textblock_node_format_next_get(fnode); | ||
1757 | fail_if(!fnode); | ||
1758 | evas_textblock_cursor_at_format_set(cur, fnode); | ||
1759 | fail_if(!evas_textblock_cursor_format_is_visible_get(cur)); | ||
1760 | |||
1761 | fnode = evas_textblock_node_format_next_get(fnode); | ||
1762 | fail_if(!fnode); | ||
1763 | evas_textblock_cursor_at_format_set(cur, fnode); | ||
1764 | fail_if(!evas_textblock_cursor_format_is_visible_get(cur)); | ||
1765 | |||
1766 | size_t i = 0; | ||
1767 | evas_textblock_cursor_paragraph_first(cur); | ||
1768 | do | ||
1769 | { | ||
1770 | switch (i) | ||
1771 | { | ||
1772 | case 2: | ||
1773 | case 3: | ||
1774 | case 6: | ||
1775 | case 7: | ||
1776 | case 10: | ||
1777 | case 14: | ||
1778 | case 17: | ||
1779 | case 18: | ||
1780 | fail_if(!evas_textblock_cursor_is_format(cur)); | ||
1781 | break; | ||
1782 | default: | ||
1783 | fail_if(evas_textblock_cursor_is_format(cur)); | ||
1784 | fail_if(evas_textblock_cursor_format_is_visible_get(cur)); | ||
1785 | break; | ||
1786 | } | ||
1787 | i++; | ||
1788 | } | ||
1789 | while (evas_textblock_cursor_char_next(cur)); | ||
1790 | |||
1791 | /* Format text nodes invalidation */ | ||
1792 | { | ||
1793 | Evas_Coord w, h, nw, nh; | ||
1794 | evas_object_textblock_text_markup_set(tb, "Test"); | ||
1795 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1796 | evas_textblock_cursor_paragraph_first(cur); | ||
1797 | evas_textblock_cursor_format_prepend(cur, "+ font_size=40"); | ||
1798 | evas_object_textblock_size_formatted_get(tb, &nw, &nh); | ||
1799 | fail_if((w >= nw) || (h >= nh)); | ||
1800 | } | ||
1801 | /* FIXME: Should extend invalidation tests. */ | ||
1802 | |||
1803 | /* Various formats, just verify there's no seg, we can't really | ||
1804 | * verify them visually, well, we can some of them. Possibly in the | ||
1805 | * future we will */ | ||
1806 | evas_object_textblock_text_markup_set(tb, | ||
1807 | "<font_size=40>font_size=40</><ps/>" | ||
1808 | "<color=#F210B3FF>color=#F210B3FF</><ps/>" | ||
1809 | "<underline=single underline_color=#A2B3C4>underline=single underline_color=#A2B3C4</><ps/>" | ||
1810 | "<underline=double underline_color=#F00 underline2_color=#00F>underline=double underline_color=#F00 underline2_color=#00F</><ps/>" | ||
1811 | "<underline=dashed underline_dash_color=#0F0 underline_dash_width=2 underline_dash_gap=1>underline=dashed underline_dash_color=#0F0 underline_dash_width=2 underline_dash_gap=1</><ps/>" | ||
1812 | "<style=outline outline_color=#F0FA>style=outline outline_color=#F0FA</><ps/>" | ||
1813 | "<style=shadow shadow_color=#F0F>style=shadow shadow_color=#F0F</><ps/>" | ||
1814 | "<style=glow glow_color=#BBB>style=glow glow_color=#BBB</><ps/>" | ||
1815 | "<style=glow glow2_color=#0F0>style=glow glow2_color=#0F0</><ps/>" | ||
1816 | "<style=glow color=#fff glow2_color=#fe87 glow_color=#f214>style=glow color=#fff glow2_color=#fe87 glow_color=#f214</><ps/>" | ||
1817 | "<backing=on backing_color=#00F>backing=on backing_color=#00F</><ps/>" | ||
1818 | "<strikethrough=on strikethrough_color=#FF0>strikethrough=on strikethrough_color=#FF0</><ps/>" | ||
1819 | "<align=right>align=right</><ps/>" | ||
1820 | "<backing=on backing_color=#F008 valign=0.0>valign=0.0</><ps/>" | ||
1821 | "<backing=on backing_color=#0F08 tabstops=50>tabstops=<\\t></>50</><ps/>" | ||
1822 | "<backing=on backing_color=#00F8 linesize=40>linesize=40</><ps/>" | ||
1823 | "<backing=on backing_color=#F0F8 linerelsize=200%>linerelsize=200%</><ps/>" | ||
1824 | "<backing=on backing_color=#0FF8 linegap=20>linegap=20</><ps/>" | ||
1825 | "<backing=on backing_color=#FF08 linerelgap=100%>linerelgap=100%</><ps/>"); | ||
1826 | |||
1827 | /* Force a relayout */ | ||
1828 | evas_object_textblock_size_formatted_get(tb, NULL, NULL); | ||
1829 | |||
1830 | /* Removing paired formats. */ | ||
1831 | evas_object_textblock_text_markup_set(tb, "<a>aa<b>bb</b>cc</a>"); | ||
1832 | fnode = evas_textblock_node_format_first_get(tb); | ||
1833 | evas_textblock_node_format_remove_pair(tb, (Evas_Object_Textblock_Node_Format *) fnode); | ||
1834 | fnode = evas_textblock_node_format_first_get(tb); | ||
1835 | fail_if(!fnode); | ||
1836 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "+ b")); | ||
1837 | fnode = evas_textblock_node_format_next_get(fnode); | ||
1838 | fail_if(!fnode); | ||
1839 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "- b")); | ||
1840 | |||
1841 | evas_object_textblock_text_markup_set(tb, "<a>aa<b>bb</b>cc</a>"); | ||
1842 | fnode = evas_textblock_node_format_first_get(tb); | ||
1843 | fnode = evas_textblock_node_format_next_get(fnode); | ||
1844 | evas_textblock_node_format_remove_pair(tb, (Evas_Object_Textblock_Node_Format *) fnode); | ||
1845 | fnode = evas_textblock_node_format_first_get(tb); | ||
1846 | fail_if(!fnode); | ||
1847 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "+ a")); | ||
1848 | fnode = evas_textblock_node_format_next_get(fnode); | ||
1849 | fail_if(!fnode); | ||
1850 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "- a")); | ||
1851 | |||
1852 | /* Format list get */ | ||
1853 | evas_object_textblock_text_markup_set(tb, "<a>a</>a<item>b</>" | ||
1854 | "b<item>b</>c<a>c</>"); | ||
1855 | const Eina_List *flist = evas_textblock_node_format_list_get(tb, "a"); | ||
1856 | const Eina_List *itr; | ||
1857 | EINA_LIST_FOREACH(flist, itr, fnode) | ||
1858 | { | ||
1859 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "+ a")); | ||
1860 | } | ||
1861 | |||
1862 | flist = evas_textblock_node_format_list_get(tb, "item"); | ||
1863 | EINA_LIST_FOREACH(flist, itr, fnode) | ||
1864 | { | ||
1865 | fail_if(strcmp(evas_textblock_node_format_text_get(fnode), "+ item")); | ||
1866 | } | ||
1867 | |||
1868 | /* Make sure we get all the types of visible formats correctly. */ | ||
1869 | evas_object_textblock_text_markup_set(tb, "<ps/>a<br/>a<tab/>a<item></>"); | ||
1870 | fail_if(strcmp(evas_textblock_node_format_text_get( | ||
1871 | evas_textblock_cursor_format_get(cur)), "ps")); | ||
1872 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "<ps/>")); | ||
1873 | fail_if(!evas_textblock_cursor_format_is_visible_get(cur)); | ||
1874 | fail_if(!evas_textblock_cursor_char_next(cur)); | ||
1875 | fail_if(!evas_textblock_cursor_char_next(cur)); | ||
1876 | fail_if(strcmp(evas_textblock_node_format_text_get( | ||
1877 | evas_textblock_cursor_format_get(cur)), "br")); | ||
1878 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "<br/>")); | ||
1879 | fail_if(!evas_textblock_cursor_format_is_visible_get(cur)); | ||
1880 | fail_if(!evas_textblock_cursor_char_next(cur)); | ||
1881 | fail_if(!evas_textblock_cursor_char_next(cur)); | ||
1882 | fail_if(strcmp(evas_textblock_node_format_text_get( | ||
1883 | evas_textblock_cursor_format_get(cur)), "tab")); | ||
1884 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "<tab/>")); | ||
1885 | fail_if(!evas_textblock_cursor_format_is_visible_get(cur)); | ||
1886 | fail_if(!evas_textblock_cursor_char_next(cur)); | ||
1887 | fail_if(!evas_textblock_cursor_char_next(cur)); | ||
1888 | fail_if(strcmp(evas_textblock_node_format_text_get( | ||
1889 | evas_textblock_cursor_format_get(cur)), "+ item")); | ||
1890 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "<item>")); | ||
1891 | fail_if(!evas_textblock_cursor_format_is_visible_get(cur)); | ||
1892 | |||
1893 | END_TB_TEST(); | ||
1894 | } | ||
1895 | END_TEST | ||
1896 | |||
1897 | /* Different text styles, for example, shadow. */ | ||
1898 | START_TEST(evas_textblock_style) | ||
1899 | { | ||
1900 | Evas_Coord w, h, nw, nh; | ||
1901 | Evas_Coord l, r, t, b; | ||
1902 | START_TB_TEST(); | ||
1903 | Evas_Textblock_Style *newst; | ||
1904 | const char *buf = "Test<ps/>Test2<ps/>נסיון"; | ||
1905 | evas_object_textblock_text_markup_set(tb, buf); | ||
1906 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), buf)); | ||
1907 | |||
1908 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1909 | newst = evas_textblock_style_new(); | ||
1910 | fail_if(!newst); | ||
1911 | evas_textblock_style_set(newst, | ||
1912 | "DEFAULT='font=Sans font_size=20 color=#000 text_class=entry'" | ||
1913 | "br='\n'" | ||
1914 | "ps='ps'" | ||
1915 | "tab='\t'"); | ||
1916 | evas_object_textblock_style_set(tb, newst); | ||
1917 | evas_object_textblock_size_formatted_get(tb, &nw, &nh); | ||
1918 | fail_if((w >= nw) || (h >= nh)); | ||
1919 | |||
1920 | /* Style padding. */ | ||
1921 | evas_object_textblock_text_markup_set(tb, "Test"); | ||
1922 | evas_object_textblock_style_insets_get(tb, &l, &r, &t, &b); | ||
1923 | fail_if((l != 0) || (r != 0) || (t != 0) || (b != 0)); | ||
1924 | |||
1925 | evas_object_textblock_text_markup_set(tb, "<style=shadow>Test</>"); | ||
1926 | evas_object_textblock_style_insets_get(tb, &l, &r, &t, &b); | ||
1927 | fail_if((l != 0) || (r != 1) || (t != 0) || (b != 1)); | ||
1928 | |||
1929 | evas_object_textblock_text_markup_set(tb, "<style=outline>Test</>"); | ||
1930 | evas_object_textblock_style_insets_get(tb, &l, &r, &t, &b); | ||
1931 | fail_if((l != 1) || (r != 1) || (t != 1) || (b != 1)); | ||
1932 | |||
1933 | evas_object_textblock_text_markup_set(tb, "<style=soft_outline>Test</>"); | ||
1934 | evas_object_textblock_style_insets_get(tb, &l, &r, &t, &b); | ||
1935 | fail_if((l != 2) || (r != 2) || (t != 2) || (b != 2)); | ||
1936 | |||
1937 | evas_object_textblock_text_markup_set(tb, "<style=glow>Test</>"); | ||
1938 | evas_object_textblock_style_insets_get(tb, &l, &r, &t, &b); | ||
1939 | fail_if((l != 2) || (r != 2) || (t != 2) || (b != 2)); | ||
1940 | |||
1941 | evas_object_textblock_text_markup_set(tb, "<style=outline_shadow>Test</>"); | ||
1942 | evas_object_textblock_style_insets_get(tb, &l, &r, &t, &b); | ||
1943 | fail_if((l != 1) || (r != 2) || (t != 1) || (b != 2)); | ||
1944 | |||
1945 | evas_object_textblock_text_markup_set(tb, "<style=far_shadow>Test</>"); | ||
1946 | evas_object_textblock_style_insets_get(tb, &l, &r, &t, &b); | ||
1947 | fail_if((l != 1) || (r != 2) || (t != 1) || (b != 2)); | ||
1948 | |||
1949 | evas_object_textblock_text_markup_set(tb, "<style=outline_soft_shadow>Test</>"); | ||
1950 | evas_object_textblock_style_insets_get(tb, &l, &r, &t, &b); | ||
1951 | fail_if((l != 1) || (r != 3) || (t != 1) || (b != 3)); | ||
1952 | |||
1953 | evas_object_textblock_text_markup_set(tb, "<style=soft_shadow>Test</>"); | ||
1954 | evas_object_textblock_style_insets_get(tb, &l, &r, &t, &b); | ||
1955 | fail_if((l != 1) || (r != 3) || (t != 1) || (b != 3)); | ||
1956 | |||
1957 | evas_object_textblock_text_markup_set(tb, "<style=far_soft_shadow>Test</>"); | ||
1958 | evas_object_textblock_style_insets_get(tb, &l, &r, &t, &b); | ||
1959 | fail_if((l != 0) || (r != 4) || (t != 0) || (b != 4)); | ||
1960 | |||
1961 | /* Mixed style padding */ | ||
1962 | evas_object_textblock_text_markup_set(tb, | ||
1963 | "<style=far_shadow>Test</><style=far_soft_shadow>Test</>"); | ||
1964 | evas_object_textblock_style_insets_get(tb, &l, &r, &t, &b); | ||
1965 | fail_if((l != 1) || (r != 4) || (t != 1) || (b != 4)); | ||
1966 | |||
1967 | END_TB_TEST(); | ||
1968 | } | ||
1969 | END_TEST | ||
1970 | |||
1971 | /* Various setters and getters */ | ||
1972 | START_TEST(evas_textblock_set_get) | ||
1973 | { | ||
1974 | START_TB_TEST(); | ||
1975 | const char *buf = ""; | ||
1976 | evas_object_textblock_text_markup_set(tb, buf); | ||
1977 | fail_if(strcmp(evas_textblock_style_get(st), style_buf)); | ||
1978 | fail_if(evas_object_textblock_style_get(tb) != st); | ||
1979 | evas_object_textblock_replace_char_set(tb, "|"); | ||
1980 | fail_if(strcmp(evas_object_textblock_replace_char_get(tb), "|")); | ||
1981 | evas_object_textblock_replace_char_set(tb, "ש"); | ||
1982 | fail_if(strcmp(evas_object_textblock_replace_char_get(tb), "ש")); | ||
1983 | |||
1984 | evas_object_textblock_valign_set(tb, -1.0); | ||
1985 | fail_if(evas_object_textblock_valign_get(tb) != 0.0); | ||
1986 | evas_object_textblock_valign_set(tb, 0.0); | ||
1987 | fail_if(evas_object_textblock_valign_get(tb) != 0.0); | ||
1988 | evas_object_textblock_valign_set(tb, 0.432); | ||
1989 | fail_if(evas_object_textblock_valign_get(tb) != 0.432); | ||
1990 | evas_object_textblock_valign_set(tb, 1.0); | ||
1991 | fail_if(evas_object_textblock_valign_get(tb) != 1.0); | ||
1992 | evas_object_textblock_valign_set(tb, 1.5); | ||
1993 | fail_if(evas_object_textblock_valign_get(tb) != 1.0); | ||
1994 | |||
1995 | evas_object_textblock_bidi_delimiters_set(tb, ",.|"); | ||
1996 | fail_if(strcmp(evas_object_textblock_bidi_delimiters_get(tb), ",.|")); | ||
1997 | evas_object_textblock_bidi_delimiters_set(tb, ",|"); | ||
1998 | fail_if(strcmp(evas_object_textblock_bidi_delimiters_get(tb), ",|")); | ||
1999 | evas_object_textblock_bidi_delimiters_set(tb, NULL); | ||
2000 | fail_if(evas_object_textblock_bidi_delimiters_get(tb)); | ||
2001 | evas_object_textblock_bidi_delimiters_set(tb, ",|"); | ||
2002 | fail_if(strcmp(evas_object_textblock_bidi_delimiters_get(tb), ",|")); | ||
2003 | |||
2004 | /* Hinting */ | ||
2005 | evas_object_textblock_text_markup_set(tb, "This is<ps/>a test<br/>bla"); | ||
2006 | /* Force relayout */ | ||
2007 | evas_object_textblock_size_formatted_get(tb, NULL, NULL); | ||
2008 | evas_font_hinting_set(evas, EVAS_FONT_HINTING_NONE); | ||
2009 | evas_font_hinting_set(evas, EVAS_FONT_HINTING_AUTO); | ||
2010 | evas_font_hinting_set(evas, EVAS_FONT_HINTING_BYTECODE); | ||
2011 | END_TB_TEST(); | ||
2012 | } | ||
2013 | END_TEST | ||
2014 | |||
2015 | /* Aux evas stuff, such as scale. */ | ||
2016 | START_TEST(evas_textblock_evas) | ||
2017 | { | ||
2018 | Evas_Coord w, h, sw, sh; | ||
2019 | START_TB_TEST(); | ||
2020 | const char *buf = "Test"; | ||
2021 | evas_object_textblock_text_markup_set(tb, buf); | ||
2022 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
2023 | evas_object_scale_set(tb, 3.0); | ||
2024 | evas_object_textblock_size_formatted_get(tb, &sw, &sh); | ||
2025 | fail_if((sw <= w) || (sh <= h)); | ||
2026 | |||
2027 | evas_object_scale_set(tb, 0.5); | ||
2028 | evas_object_textblock_size_formatted_get(tb, &sw, &sh); | ||
2029 | fail_if((sw >= w) || (sh >= h)); | ||
2030 | |||
2031 | END_TB_TEST(); | ||
2032 | } | ||
2033 | END_TEST | ||
2034 | |||
2035 | /* All the string escaping stuff */ | ||
2036 | START_TEST(evas_textblock_escaping) | ||
2037 | { | ||
2038 | int len; | ||
2039 | START_TB_TEST(); | ||
2040 | fail_if(strcmp(evas_textblock_escape_string_get("&"), "&")); | ||
2041 | fail_if(strcmp(evas_textblock_string_escape_get("&", &len), "&")); | ||
2042 | fail_if(len != 1); | ||
2043 | |||
2044 | fail_if(strcmp(evas_textblock_escape_string_get("·"), "\xc2\xb7")); | ||
2045 | fail_if(strcmp(evas_textblock_string_escape_get("\xc2\xb7", &len), | ||
2046 | "·")); | ||
2047 | fail_if(len != 2); | ||
2048 | |||
2049 | fail_if(strcmp(evas_textblock_escape_string_get("👙"), | ||
2050 | "\xF0\x9F\x91\x99")); | ||
2051 | fail_if(strcmp(evas_textblock_escape_string_get("👙"), | ||
2052 | "\xF0\x9F\x91\x99")); | ||
2053 | |||
2054 | fail_if(evas_textblock_escape_string_get("·aa")); | ||
2055 | const char *tmp = "·aa"; | ||
2056 | fail_if(strcmp(evas_textblock_escape_string_range_get(tmp, tmp + 8), | ||
2057 | "\xc2\xb7")); | ||
2058 | fail_if(evas_textblock_escape_string_range_get(tmp, tmp + 9)); | ||
2059 | fail_if(evas_textblock_escape_string_range_get(tmp, tmp + 7)); | ||
2060 | fail_if(evas_textblock_escape_string_range_get(tmp, tmp + 5)); | ||
2061 | |||
2062 | const char *buf = "This · is"; | ||
2063 | evas_object_textblock_text_markup_set(tb, buf); | ||
2064 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), buf)); | ||
2065 | |||
2066 | buf = "This is"; | ||
2067 | evas_object_textblock_text_markup_set(tb, buf); | ||
2068 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), buf)); | ||
2069 | |||
2070 | END_TB_TEST(); | ||
2071 | } | ||
2072 | END_TEST | ||
2073 | |||
2074 | START_TEST(evas_textblock_size) | ||
2075 | { | ||
2076 | START_TB_TEST(); | ||
2077 | Evas_Coord w, h, h2, nw, nh; | ||
2078 | const char *buf = "This is a <br/> test.<br/>גם בעברית"; | ||
2079 | /* When wrapping is off, native size should be the same as formatted | ||
2080 | * size */ | ||
2081 | |||
2082 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
2083 | evas_object_textblock_size_native_get(tb, &nw, &nh); | ||
2084 | fail_if((w != nw) || (h != nh)); | ||
2085 | fail_if(w != 0); | ||
2086 | |||
2087 | evas_object_textblock_text_markup_set(tb, "a<br/>a"); | ||
2088 | evas_object_textblock_size_formatted_get(tb, &w, &h2); | ||
2089 | evas_object_textblock_size_native_get(tb, &nw, &nh); | ||
2090 | fail_if((w != nw) || (h2 != nh)); | ||
2091 | |||
2092 | /* Two lines == double the height */ | ||
2093 | fail_if(h * 2 != h2); | ||
2094 | |||
2095 | evas_object_textblock_text_markup_set(tb, buf); | ||
2096 | |||
2097 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
2098 | evas_object_textblock_size_native_get(tb, &nw, &nh); | ||
2099 | fail_if((w != nw) || (h != nh)); | ||
2100 | fail_if(w <= 0); | ||
2101 | |||
2102 | /* This time with margins. */ | ||
2103 | { | ||
2104 | Evas_Textblock_Style *newst; | ||
2105 | Evas_Coord oldw, oldh, oldnw, oldnh; | ||
2106 | |||
2107 | evas_object_textblock_text_markup_set(tb, buf); | ||
2108 | evas_object_textblock_size_formatted_get(tb, &oldw, &oldh); | ||
2109 | evas_object_textblock_size_native_get(tb, &oldnw, &oldnh); | ||
2110 | |||
2111 | |||
2112 | newst = evas_textblock_style_new(); | ||
2113 | fail_if(!newst); | ||
2114 | evas_textblock_style_set(newst, | ||
2115 | "DEFAULT='left_margin=4 right_margin=4'"); | ||
2116 | evas_object_textblock_style_user_push(tb, newst); | ||
2117 | |||
2118 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
2119 | evas_object_textblock_size_native_get(tb, &nw, &nh); | ||
2120 | |||
2121 | fail_if((w != oldw + 8) || (h != oldh) || | ||
2122 | (nw != oldnw + 8) || (nh != oldnh)); | ||
2123 | } | ||
2124 | |||
2125 | /* FIXME: There is a lot more to be done. */ | ||
2126 | END_TB_TEST(); | ||
2127 | } | ||
2128 | END_TEST | ||
2129 | |||
2130 | void evas_test_textblock(TCase *tc) | ||
2131 | { | ||
2132 | tcase_add_test(tc, evas_textblock_simple); | ||
2133 | tcase_add_test(tc, evas_textblock_cursor); | ||
2134 | tcase_add_test(tc, evas_textblock_size); | ||
2135 | tcase_add_test(tc, evas_textblock_editing); | ||
2136 | tcase_add_test(tc, evas_textblock_style); | ||
2137 | tcase_add_test(tc, evas_textblock_evas); | ||
2138 | tcase_add_test(tc, evas_textblock_text_getters); | ||
2139 | tcase_add_test(tc, evas_textblock_formats); | ||
2140 | tcase_add_test(tc, evas_textblock_format_removal); | ||
2141 | tcase_add_test(tc, evas_textblock_escaping); | ||
2142 | tcase_add_test(tc, evas_textblock_set_get); | ||
2143 | tcase_add_test(tc, evas_textblock_geometries); | ||
2144 | tcase_add_test(tc, evas_textblock_various); | ||
2145 | tcase_add_test(tc, evas_textblock_wrapping); | ||
2146 | tcase_add_test(tc, evas_textblock_items); | ||
2147 | } | ||
2148 | |||
diff --git a/libraries/evas/src/tests/evas_tests_helpers.h b/libraries/evas/src/tests/evas_tests_helpers.h deleted file mode 100644 index 2ed0789..0000000 --- a/libraries/evas/src/tests/evas_tests_helpers.h +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | #ifndef EVAS_TEST_HELPERS_H | ||
2 | #define EVAS_TEST_HELPERS_H | ||
3 | |||
4 | /* FIXME: Currently depends on the buffer engine, should we do anything | ||
5 | * fancier? */ | ||
6 | |||
7 | #define EVAS_TEST_INIT_EVAS() _setup_evas() | ||
8 | |||
9 | #define EVAS_TEST_FREE_EVAS() \ | ||
10 | do \ | ||
11 | { \ | ||
12 | evas_textblock_cursor_free(cur); \ | ||
13 | evas_object_del(tb); \ | ||
14 | evas_textblock_style_free(st); \ | ||
15 | evas_free(evas); \ | ||
16 | evas_shutdown(); \ | ||
17 | } \ | ||
18 | while (0) | ||
19 | |||
20 | static Evas * | ||
21 | _setup_evas() | ||
22 | { | ||
23 | Evas *evas; | ||
24 | Evas_Engine_Info *einfo; | ||
25 | |||
26 | evas_init(); | ||
27 | evas = evas_new(); | ||
28 | |||
29 | evas_output_method_set(evas, evas_render_method_lookup("buffer")); | ||
30 | einfo = evas_engine_info_get(evas); | ||
31 | evas_engine_info_set(evas, einfo); | ||
32 | |||
33 | evas_output_size_set(evas, 500, 500); | ||
34 | evas_output_viewport_set(evas, 0, 0, 500, 500); | ||
35 | |||
36 | return evas; | ||
37 | } | ||
38 | |||
39 | #endif | ||
40 | |||