summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am4
-rw-r--r--configure.ac87
-rw-r--r--m4/evil_windows.m46
-rw-r--r--pc/ecore-wince.pc.in12
-rw-r--r--src/Makefile.am1
-rw-r--r--src/Makefile_Ecore.am4
-rw-r--r--src/Makefile_Ecore_WinCE.am21
-rw-r--r--src/Makefile_Eina.am4
-rw-r--r--src/Makefile_Evil.am21
-rw-r--r--src/lib/ecore/ecore_getopt.c4
-rw-r--r--src/lib/ecore_wince/Ecore_WinCE.h315
-rw-r--r--src/lib/ecore_wince/ecore_wince.c400
-rw-r--r--src/lib/ecore_wince/ecore_wince_event.c1123
-rw-r--r--src/lib/ecore_wince/ecore_wince_private.h85
-rw-r--r--src/lib/ecore_wince/ecore_wince_window.c827
-rw-r--r--src/lib/eina/eina_inline_lock_wince.x261
-rw-r--r--src/lib/eina/eina_lock.h4
-rw-r--r--src/lib/eina/eina_log.c15
-rw-r--r--src/lib/eina/eina_main.c2
-rw-r--r--src/lib/evas/canvas/evas_object_box.c4
-rw-r--r--src/lib/evas/file/evas_path.c4
-rw-r--r--src/lib/evil/Evil.h6
-rw-r--r--src/lib/evil/dlfcn.c37
-rw-r--r--src/lib/evil/dlfcn.h8
-rw-r--r--src/lib/evil/evil_errno.c9
-rw-r--r--src/lib/evil/evil_fcntl.c12
-rw-r--r--src/lib/evil/evil_langinfo.c4
-rw-r--r--src/lib/evil/evil_langinfo.h4
-rw-r--r--src/lib/evil/evil_link_ce.c90
-rw-r--r--src/lib/evil/evil_mman.c228
-rw-r--r--src/lib/evil/evil_stdio.c193
-rw-r--r--src/lib/evil/evil_stdio.h174
-rw-r--r--src/lib/evil/evil_stdlib.c230
-rw-r--r--src/lib/evil/evil_stdlib.h68
-rw-r--r--src/lib/evil/evil_string.c46
-rw-r--r--src/lib/evil/evil_string.h57
-rw-r--r--src/lib/evil/evil_time.c10
-rw-r--r--src/lib/evil/evil_time.h15
-rw-r--r--src/lib/evil/evil_unistd.c189
-rw-r--r--src/lib/evil/evil_unistd.h95
-rw-r--r--src/lib/evil/evil_util.c8
-rw-r--r--src/lib/evil/evil_util.h2
-rw-r--r--src/lib/evil/evil_uuid.c3
-rw-r--r--src/lib/evil/mingw32ce/errno.h111
-rw-r--r--src/modules/evas/savers/png/evas_image_save_png.c14
45 files changed, 121 insertions, 4696 deletions
diff --git a/Makefile.am b/Makefile.am
index 010e9e69a1..673a75d717 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -232,10 +232,6 @@ if HAVE_WIN32
232pkgconfig_DATA += pc/ecore-win32.pc 232pkgconfig_DATA += pc/ecore-win32.pc
233endif 233endif
234 234
235if HAVE_WINCE
236pkgconfig_DATA += pc/ecore-wince.pc
237endif
238
239if HAVE_ECORE_X 235if HAVE_ECORE_X
240pkgconfig_DATA += pc/ecore-x.pc 236pkgconfig_DATA += pc/ecore-x.pc
241endif 237endif
diff --git a/configure.ac b/configure.ac
index 4a943133ee..aa545e10cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -160,13 +160,9 @@ AC_CANONICAL_HOST
160 160
161# TODO: move me to m4 file that setups module/so related variables 161# TODO: move me to m4 file that setups module/so related variables
162case "$host_os" in 162case "$host_os" in
163 cegcc*) 163 cegcc*|mingw32ce*)
164 AC_MSG_ERROR([ceGCC compiler is not supported anymore. Exiting...]) 164 AC_MSG_ERROR([ceGCC compiler is not supported anymore. Exiting...])
165 ;; 165 ;;
166 mingw32ce*)
167 MODULE_ARCH="v"
168 MODULE_EXT=".dll"
169 ;;
170 mingw*) 166 mingw*)
171 have_win32="yes" 167 have_win32="yes"
172 have_windows="yes" 168 have_windows="yes"
@@ -189,17 +185,12 @@ AC_SUBST(EFL_VERSION_MAJOR)
189AC_SUBST(EFL_VERSION_MINOR) 185AC_SUBST(EFL_VERSION_MINOR)
190 186
191have_systemd_pkg="no" 187have_systemd_pkg="no"
192have_wince="no"
193have_win32="no" 188have_win32="no"
194have_windows="no" 189have_windows="no"
195have_darwin="no" 190have_darwin="no"
196have_linux="no" 191have_linux="no"
197have_ps3="no" 192have_ps3="no"
198case "$host_os" in 193case "$host_os" in
199 mingw32ce*)
200 have_wince="yes"
201 have_windows="yes"
202 ;;
203 mingw*|cygwin*) 194 mingw*|cygwin*)
204 # TODO: check cygwin* here 195 # TODO: check cygwin* here
205 have_win32="yes" 196 have_win32="yes"
@@ -226,7 +217,6 @@ AC_DEFINE_UNQUOTED([MODULE_ARCH], ["${MODULE_ARCH}"], ["Module architecture"])
226AC_DEFINE_UNQUOTED([SHARED_LIB_SUFFIX], ["${MODULE_EXT}"], [Suffix for shared objects]) 217AC_DEFINE_UNQUOTED([SHARED_LIB_SUFFIX], ["${MODULE_EXT}"], [Suffix for shared objects])
227 218
228# TODO: move me to m4 file that setups the windows related variables 219# TODO: move me to m4 file that setups the windows related variables
229AM_CONDITIONAL([HAVE_WINCE], [test "x${have_wince}" = "xyes"])
230AM_CONDITIONAL([HAVE_WIN32], [test "x${have_win32}" = "xyes"]) 220AM_CONDITIONAL([HAVE_WIN32], [test "x${have_win32}" = "xyes"])
231AM_CONDITIONAL([HAVE_WINDOWS], [test "x${have_windows}" = "xyes"]) 221AM_CONDITIONAL([HAVE_WINDOWS], [test "x${have_windows}" = "xyes"])
232AM_CONDITIONAL([HAVE_PS3], [test "x${have_ps3}" = "xyes"]) 222AM_CONDITIONAL([HAVE_PS3], [test "x${have_ps3}" = "xyes"])
@@ -680,14 +670,8 @@ EFL_SELECT_WINDOWS_VERSION
680 670
681### Checks for libraries 671### Checks for libraries
682 672
683EVIL_DLFCN_LIBS="" 673EFL_ADD_LIBS([EVIL], [-lole32 -lws2_32 -lsecur32 -luuid])
684if test "${have_wince}" = "xyes"; then 674EVIL_DLFCN_LIBS="-lpsapi"
685 EFL_ADD_LIBS([EVIL], [-lws2])
686 EVIL_DLFCN_LIBS="-ltoolhelp"
687else
688 EFL_ADD_LIBS([EVIL], [-lole32 -lws2_32 -lsecur32 -luuid])
689 EVIL_DLFCN_LIBS="-lpsapi"
690fi
691 675
692AC_SUBST([EVIL_DLFCN_LIBS]) 676AC_SUBST([EVIL_DLFCN_LIBS])
693 677
@@ -1529,13 +1513,6 @@ if test "${want_wayland}" = "yes" && test "${want_egl}" = "yes" && test "${with_
1529 want_evas_engine_wayland_egl="yes" 1513 want_evas_engine_wayland_egl="yes"
1530fi 1514fi
1531 1515
1532if test "${have_wince}" = "yes"; then
1533 want_fontconfig="no"
1534 want_evas_image_loader_gif="no"
1535 want_evas_image_loader_tiff="no"
1536 want_evas_image_loader_webp="no"
1537fi
1538
1539if test "${want_lua_old}" = "yes"; then 1516if test "${want_lua_old}" = "yes"; then
1540 EFL_CHECK_LUA_OLD([EVAS]) 1517 EFL_CHECK_LUA_OLD([EVAS])
1541else 1518else
@@ -2381,11 +2358,7 @@ EFL_LIB_START([Ecore_Con])
2381want_ecore_con_local_sockets="yes" 2358want_ecore_con_local_sockets="yes"
2382want_ecore_con_abstract_sockets="yes" 2359want_ecore_con_abstract_sockets="yes"
2383 2360
2384if test "${have_wince}" = "yes"; then 2361if test "${have_win32}" = "yes"; then
2385 want_cares="no"
2386 want_ecore_con_local_sockets="no"
2387 want_ecore_con_abstract_sockets="no"
2388elif test "${have_win32}" = "yes"; then
2389 want_cares="yes" 2362 want_cares="yes"
2390 want_ecore_con_abstract_sockets="no" 2363 want_ecore_con_abstract_sockets="no"
2391elif test "${have_darwin}" = "yes"; then 2364elif test "${have_darwin}" = "yes"; then
@@ -3042,37 +3015,6 @@ EFL_LIB_END([Ecore_Avahi])
3042 3015
3043#### End of Ecore_Avahi 3016#### End of Ecore_Avahi
3044 3017
3045#### Ecore_WinCE
3046EFL_LIB_START_OPTIONAL([Ecore_WinCE], [test "${have_wince}" = "yes"])
3047
3048### Additional options to configure
3049
3050### Default values
3051
3052### Checks for programs
3053
3054### Checks for libraries
3055EFL_PLATFORM_DEPEND([ECORE_WINCE], [evil])
3056EFL_INTERNAL_DEPEND_PKG([ECORE_WINCE], [ecore-input])
3057EFL_INTERNAL_DEPEND_PKG([ECORE_WINCE], [ecore])
3058EFL_INTERNAL_DEPEND_PKG([ECORE_WINCE], [eo])
3059EFL_INTERNAL_DEPEND_PKG([ECORE_WINCE], [eina])
3060
3061### Checks for header files
3062
3063### Checks for types
3064
3065### Checks for structures
3066
3067### Checks for compiler characteristics
3068
3069### Checks for linker characteristics
3070
3071### Checks for library functions
3072
3073EFL_LIB_END_OPTIONAL([Ecore_WinCE])
3074#### End of Ecore_WinCE
3075
3076 3018
3077#### Ecore_X 3019#### Ecore_X
3078EFL_LIB_START_OPTIONAL([Ecore_X], [test "${want_x11_any}" = "yes"]) 3020EFL_LIB_START_OPTIONAL([Ecore_X], [test "${want_x11_any}" = "yes"])
@@ -3369,20 +3311,15 @@ want_ecore_imf_xim="no"
3369want_ecore_imf_scim="no" 3311want_ecore_imf_scim="no"
3370want_ecore_imf_ibus="no" 3312want_ecore_imf_ibus="no"
3371want_ecore_imf_wayland="no" 3313want_ecore_imf_wayland="no"
3314want_ecore_imf="yes"
3372 3315
3373if test "${have_wince}" = "yes"; then 3316if test "${have_windows}" = "no" && test "${have_darwin}" = "no"; then
3374 want_ecore_imf="no"
3375else
3376 want_ecore_imf="yes" 3317 want_ecore_imf="yes"
3377 3318 want_ecore_imf_xim="yes"
3378 if test "${have_windows}" = "no" && test "${have_darwin}" = "no"; then 3319 want_ecore_imf_scim="yes"
3379 want_ecore_imf="yes" 3320 want_ecore_imf_ibus="yes"
3380 want_ecore_imf_xim="yes" 3321 if test "${want_wayland}" = "yes"; then
3381 want_ecore_imf_scim="yes" 3322 want_ecore_imf_wayland="yes"
3382 want_ecore_imf_ibus="yes"
3383 if test "${want_wayland}" = "yes"; then
3384 want_ecore_imf_wayland="yes"
3385 fi
3386 fi 3323 fi
3387fi 3324fi
3388 3325
@@ -4436,7 +4373,6 @@ pc/ecore-psl1ght.pc
4436pc/ecore-sdl.pc 4373pc/ecore-sdl.pc
4437pc/ecore-wayland.pc 4374pc/ecore-wayland.pc
4438pc/ecore-win32.pc 4375pc/ecore-win32.pc
4439pc/ecore-wince.pc
4440pc/ecore-x.pc 4376pc/ecore-x.pc
4441pc/ecore-evas.pc 4377pc/ecore-evas.pc
4442pc/ecore-imf.pc 4378pc/ecore-imf.pc
@@ -4591,7 +4527,6 @@ elif test "${have_darwin}" = "yes"; then
4591echo "Ecore_Cocoa.....: $efl_lib_optional_ecore_cocoa" 4527echo "Ecore_Cocoa.....: $efl_lib_optional_ecore_cocoa"
4592elif test "${have_windows}" = "yes"; then 4528elif test "${have_windows}" = "yes"; then
4593echo "Ecore_Win32.....: $have_win32" 4529echo "Ecore_Win32.....: $have_win32"
4594echo "Ecore_WinCE.....: $have_wince"
4595fi 4530fi
4596echo "Ecore_Audio.....: ${efl_lib_optional_ecore_audio} (${features_ecore_audio})" 4531echo "Ecore_Audio.....: ${efl_lib_optional_ecore_audio} (${features_ecore_audio})"
4597echo "Ecore_Avahi.....: yes (${features_ecore_avahi})" 4532echo "Ecore_Avahi.....: yes (${features_ecore_avahi})"
diff --git a/m4/evil_windows.m4 b/m4/evil_windows.m4
index e64d68870d..12c8ff8c04 100644
--- a/m4/evil_windows.m4
+++ b/m4/evil_windows.m4
@@ -12,7 +12,7 @@ AC_DEFUN([EFL_SELECT_WINDOWS_VERSION],
12dnl configure option 12dnl configure option
13 13
14AC_ARG_WITH([windows-version], 14AC_ARG_WITH([windows-version],
15 [AC_HELP_STRING([--with-windows-version], [select the target Windows version (xp, vista, win7 or ce) @<:@default=xp@:>@])], 15 [AC_HELP_STRING([--with-windows-version], [select the target Windows version (xp, vista or win7) @<:@default=xp@:>@])],
16 [ 16 [
17 if test "x${with_windows_version}" = "xvista" ; then 17 if test "x${with_windows_version}" = "xvista" ; then
18 _winver="vista" 18 _winver="vista"
@@ -34,10 +34,6 @@ AC_MSG_CHECKING([which Windows version to target])
34AC_MSG_RESULT([${_winver}]) 34AC_MSG_RESULT([${_winver}])
35 35
36case "${_winver}" in 36case "${_winver}" in
37 ce)
38 EFL_WINDOWS_VERSION_CFLAGS="-D_WIN32_WCE=0x0420"
39 _efl_windows_version="Windows CE"
40 ;;
41 vista) 37 vista)
42 EFL_WINDOWS_VERSION_CFLAGS="-D_WIN32_WINNT=0x0600" 38 EFL_WINDOWS_VERSION_CFLAGS="-D_WIN32_WINNT=0x0600"
43 _efl_windows_version="Windows Vista" 39 _efl_windows_version="Windows Vista"
diff --git a/pc/ecore-wince.pc.in b/pc/ecore-wince.pc.in
deleted file mode 100644
index 299243990b..0000000000
--- a/pc/ecore-wince.pc.in
+++ /dev/null
@@ -1,12 +0,0 @@
1prefix=@prefix@
2exec_prefix=@exec_prefix@
3libdir=@libdir@
4includedir=@includedir@
5
6Name: ecore-wince
7Description: E core library, WinCE module
8Requires.private: @requirements_pc_ecore_wince@
9Version: @VERSION@
10Libs: -L${libdir} -lecore_wince
11Libs.private: @requirements_libs_ecore_wince@
12Cflags: -I${includedir}/efl-@VMAJ@ -I${includedir}/ecore-wince-@VMAJ@
diff --git a/src/Makefile.am b/src/Makefile.am
index 26f42bae63..604ee4c6a0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -57,7 +57,6 @@ include Makefile_Ecore_Psl1ght.am
57include Makefile_Ecore_SDL.am 57include Makefile_Ecore_SDL.am
58include Makefile_Ecore_Wayland.am 58include Makefile_Ecore_Wayland.am
59include Makefile_Ecore_Win32.am 59include Makefile_Ecore_Win32.am
60include Makefile_Ecore_WinCE.am
61include Makefile_Ecore_X.am 60include Makefile_Ecore_X.am
62include Makefile_Ecore_Audio.am 61include Makefile_Ecore_Audio.am
63include Makefile_Ecore_IMF.am 62include Makefile_Ecore_IMF.am
diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am
index 55682c3a7b..f43be40294 100644
--- a/src/Makefile_Ecore.am
+++ b/src/Makefile_Ecore.am
@@ -87,9 +87,6 @@ lib/ecore/ecore_private.h
87if HAVE_WIN32 87if HAVE_WIN32
88lib_ecore_libecore_la_SOURCES += lib/ecore/ecore_exe_win32.c 88lib_ecore_libecore_la_SOURCES += lib/ecore/ecore_exe_win32.c
89else 89else
90if HAVE_WINCE
91lib_ecore_libecore_la_SOURCES += lib/ecore/ecore_exe_wince.c
92else
93EXTRA_DIST += lib/ecore/ecore_exe_ps3.c 90EXTRA_DIST += lib/ecore/ecore_exe_ps3.c
94#if ECORE_HAVE_PS3 91#if ECORE_HAVE_PS3
95#libecore_la_SOURCES += ecore_exe_ps3.c 92#libecore_la_SOURCES += ecore_exe_ps3.c
@@ -101,7 +98,6 @@ lib_ecore_libecore_la_SOURCES += lib/ecore/ecore_signal.c lib/ecore/ecore_exe.c
101#endif 98#endif
102#endif 99#endif
103endif 100endif
104endif
105 101
106lib_ecore_libecore_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ 102lib_ecore_libecore_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
107-DPACKAGE_BIN_DIR=\"$(bindir)\" \ 103-DPACKAGE_BIN_DIR=\"$(bindir)\" \
diff --git a/src/Makefile_Ecore_WinCE.am b/src/Makefile_Ecore_WinCE.am
deleted file mode 100644
index 1f5cac68cd..0000000000
--- a/src/Makefile_Ecore_WinCE.am
+++ /dev/null
@@ -1,21 +0,0 @@
1if HAVE_WINCE
2
3### Library
4
5lib_LTLIBRARIES += lib/ecore_wince/libecore_wince.la
6
7installed_ecorewincemainheadersdir = $(includedir)/ecore-wince-@VMAJ@
8dist_installed_ecorewincemainheaders_DATA = \
9lib/ecore_wince/Ecore_WinCE.h
10
11lib_ecore_wince_libecore_wince_la_SOURCES = \
12lib/ecore_wince/ecore_wince.c \
13lib/ecore_wince/ecore_wince_event.c \
14lib/ecore_wince/ecore_wince_window.c \
15lib/ecore_wince/ecore_wince_private.h
16
17lib_ecore_wince_libecore_wince_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_WINCE_CFLAGS@
18lib_ecore_wince_libecore_wince_la_LIBADD = @ECORE_WINCE_LIBS@
19lib_ecore_wince_libecore_wince_la_DEPENDENCIES = @ECORE_WINCE_INTERNAL_LIBS@
20lib_ecore_wince_libecore_wince_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
21endif
diff --git a/src/Makefile_Eina.am b/src/Makefile_Eina.am
index 63c0ce9fbc..c5caacc93b 100644
--- a/src/Makefile_Eina.am
+++ b/src/Makefile_Eina.am
@@ -87,15 +87,11 @@ lib/eina/eina_inline_unicode.x
87# lib/eina/eina_model.h 87# lib/eina/eina_model.h
88# lib/eina/eina_object.h 88# lib/eina/eina_object.h
89 89
90if HAVE_WINCE
91dist_installed_einaheaders_DATA += lib/eina/eina_inline_lock_wince.x
92else
93if HAVE_WIN32 90if HAVE_WIN32
94dist_installed_einaheaders_DATA += lib/eina/eina_inline_lock_win32.x 91dist_installed_einaheaders_DATA += lib/eina/eina_inline_lock_win32.x
95else 92else
96dist_installed_einaheaders_DATA += lib/eina/eina_inline_lock_posix.x 93dist_installed_einaheaders_DATA += lib/eina/eina_inline_lock_posix.x
97endif 94endif
98endif
99 95
100lib_eina_libeina_la_SOURCES = \ 96lib_eina_libeina_la_SOURCES = \
101lib/eina/eina_abi.c \ 97lib/eina/eina_abi.c \
diff --git a/src/Makefile_Evil.am b/src/Makefile_Evil.am
index 26260302f8..c2e7ee4176 100644
--- a/src/Makefile_Evil.am
+++ b/src/Makefile_Evil.am
@@ -24,10 +24,6 @@ lib/evil/fnmatch.h \
24lib/evil/dirent.h \ 24lib/evil/dirent.h \
25lib/evil/dlfcn.h 25lib/evil/dlfcn.h
26 26
27if HAVE_WINCE
28dist_install_evilheaders_DATA += lib/evil/mingw32ce/errno.h
29endif
30
31evilmmanheadersdir = $(includedir)/evil-@VMAJ@/sys 27evilmmanheadersdir = $(includedir)/evil-@VMAJ@/sys
32dist_evilmmanheaders_DATA = \ 28dist_evilmmanheaders_DATA = \
33lib/evil/sys/mman.h 29lib/evil/sys/mman.h
@@ -39,6 +35,7 @@ lib/evil/evil_fnmatch.c \
39lib/evil/evil_fnmatch_list_of_states.c \ 35lib/evil/evil_fnmatch_list_of_states.c \
40lib/evil/evil_inet.c \ 36lib/evil/evil_inet.c \
41lib/evil/evil_langinfo.c \ 37lib/evil/evil_langinfo.c \
38lib/evil/evil_link_xp.cpp \
42lib/evil/evil_main.c \ 39lib/evil/evil_main.c \
43lib/evil/evil_mman.c \ 40lib/evil/evil_mman.c \
44lib/evil/evil_pwd.c \ 41lib/evil/evil_pwd.c \
@@ -52,23 +49,11 @@ lib/evil/evil_uuid.c \
52lib/evil/evil_private.h \ 49lib/evil/evil_private.h \
53lib/evil/evil_fnmatch_private.h 50lib/evil/evil_fnmatch_private.h
54 51
55if HAVE_WINCE
56lib_evil_libevil_la_SOURCES += lib/evil/evil_errno.c lib/evil/evil_link_ce.c
57else
58lib_evil_libevil_la_SOURCES += lib/evil/evil_link_xp.cpp
59endif
60
61lib_evil_libevil_la_CFLAGS = @EVIL_CFLAGS@ @EVIL_CFLAGS_WRN@ -D__USE_MINGW_ANSI_STDIO 52lib_evil_libevil_la_CFLAGS = @EVIL_CFLAGS@ @EVIL_CFLAGS_WRN@ -D__USE_MINGW_ANSI_STDIO
62lib_evil_libevil_la_CXXFLAGS = @EVIL_CXXFLAGS@ @EVIL_CFLAGS@ 53lib_evil_libevil_la_CXXFLAGS = @EVIL_CXXFLAGS@ @EVIL_CFLAGS@
63lib_evil_libevil_la_LIBADD = @EVIL_LIBS@ 54lib_evil_libevil_la_LIBADD = @EVIL_LIBS@
64lib_evil_libevil_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ 55lib_evil_libevil_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
65 56
66if HAVE_WINCE
67lib_evil_libevil_la_LINK = $(LINK) $(lib_evil_libevil_la_LDFLAGS)
68else
69lib_evil_libevil_la_LINK = $(CXXLINK) $(lib_evil_libevil_la_LDFLAGS)
70endif
71
72# regex 57# regex
73 58
74dist_install_evilheaders_DATA += \ 59dist_install_evilheaders_DATA += \
@@ -129,11 +114,7 @@ bin/evil/evil_test_print.h \
129bin/evil/evil_test_realpath.h \ 114bin/evil/evil_test_realpath.h \
130bin/evil/evil_test_util.h 115bin/evil/evil_test_util.h
131 116
132if HAVE_WINCE
133bin_evil_evil_suite_SOURCES += bin/evil/memcpy_glibc_arm.S
134#else
135#suite_SOURCES += bin/evil/memcpy_glibc_i686.S # see EXTRA_DIST below! 117#suite_SOURCES += bin/evil/memcpy_glibc_i686.S # see EXTRA_DIST below!
136endif
137 118
138bin_evil_evil_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl @EVIL_CFLAGS@ 119bin_evil_evil_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl @EVIL_CFLAGS@
139bin_evil_evil_suite_LDADD = @USE_EVIL_LIBS@ @DL_LIBS@ -lm 120bin_evil_evil_suite_LDADD = @USE_EVIL_LIBS@ @DL_LIBS@ -lm
diff --git a/src/lib/ecore/ecore_getopt.c b/src/lib/ecore/ecore_getopt.c
index d7d8d07b5f..6fc0c64d83 100644
--- a/src/lib/ecore/ecore_getopt.c
+++ b/src/lib/ecore/ecore_getopt.c
@@ -26,10 +26,6 @@
26 26
27#define _(x) dgettext("ecore", x) 27#define _(x) dgettext("ecore", x)
28 28
29#ifdef _WIN32_WCE
30# include <Evil.h>
31#endif
32
33#ifdef HAVE_EXOTIC 29#ifdef HAVE_EXOTIC
34# include <Exotic.h> 30# include <Exotic.h>
35#endif 31#endif
diff --git a/src/lib/ecore_wince/Ecore_WinCE.h b/src/lib/ecore_wince/Ecore_WinCE.h
deleted file mode 100644
index d63e483425..0000000000
--- a/src/lib/ecore_wince/Ecore_WinCE.h
+++ /dev/null
@@ -1,315 +0,0 @@
1#ifndef __ECORE_WINCE_H__
2#define __ECORE_WINCE_H__
3
4/*
5 * DO NOT USE THIS HEADER. IT IS WORK IN PROGRESS. IT IS NOT FINAL AND
6 * THE API MAY CHANGE.
7 */
8
9#ifndef ECORE_WINCE_WIP_OSXCKQSD
10# warning "You are using a work in progress API. This API is not stable"
11# warning "and is subject to change. You use this at your own risk."
12#endif
13
14#include <Eina.h>
15
16#ifdef EAPI
17# undef EAPI
18#endif
19
20#ifdef _WIN32
21# ifdef EFL_ECORE_WINCE_BUILD
22# ifdef DLL_EXPORT
23# define EAPI __declspec(dllexport)
24# else
25# define EAPI
26# endif /* ! DLL_EXPORT */
27# else
28# define EAPI __declspec(dllimport)
29# endif /* ! EFL_ECORE_WINCE_BUILD */
30#else
31# ifdef __GNUC__
32# if __GNUC__ >= 4
33# define EAPI __attribute__ ((visibility("default")))
34# else
35# define EAPI
36# endif
37# else
38# define EAPI
39# endif
40#endif /* ! _WINCE */
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
46/**
47 * @defgroup Ecore_WinCE_Group Ecore_WinCE library
48 * @ingroup Ecore
49 *
50 * @{
51 */
52
53
54/**
55 * @typedef Ecore_WinCE_Window
56 * Abstract type for a window.
57 */
58typedef struct _Ecore_WinCE_Window Ecore_WinCE_Window;
59
60
61/**
62 * @typedef Ecore_WinCE_Event_Mouse_In
63 * Event sent when the mouse enters the window.
64 */
65typedef struct _Ecore_WinCE_Event_Mouse_In Ecore_WinCE_Event_Mouse_In;
66
67/**
68 * @typedef Ecore_WinCE_Event_Mouse_Out
69 * Event sent when the mouse leaves the window.
70 */
71typedef struct _Ecore_WinCE_Event_Mouse_Out Ecore_WinCE_Event_Mouse_Out;
72
73/**
74 * @typedef Ecore_WinCE_Event_Window_Focus_In
75 * Event sent when the window gets the focus.
76 */
77typedef struct _Ecore_WinCE_Event_Window_Focus_In Ecore_WinCE_Event_Window_Focus_In;
78
79/**
80 * @typedef Ecore_WinCE_Event_Window_Focus_Out
81 * Event sent when the window looses the focus.
82 */
83typedef struct _Ecore_WinCE_Event_Window_Focus_Out Ecore_WinCE_Event_Window_Focus_Out;
84
85/**
86 * @typedef Ecore_WinCE_Event_Window_Damage
87 * Event sent when the window is damaged.
88 */
89typedef struct _Ecore_WinCE_Event_Window_Damage Ecore_WinCE_Event_Window_Damage;
90
91/**
92 * @typedef Ecore_WinCE_Event_Window_Create
93 * Event sent when the window is created.
94 */
95typedef struct _Ecore_WinCE_Event_Window_Create Ecore_WinCE_Event_Window_Create;
96
97/**
98 * @typedef Ecore_WinCE_Event_Window_Destroy
99 * Event sent when the window is destroyed.
100 */
101typedef struct _Ecore_WinCE_Event_Window_Destroy Ecore_WinCE_Event_Window_Destroy;
102
103/**
104 * @typedef Ecore_WinCE_Event_Window_Hide
105 * Event sent when the window is hidden.
106 */
107typedef struct _Ecore_WinCE_Event_Window_Hide Ecore_WinCE_Event_Window_Hide;
108
109/**
110 * @typedef Ecore_WinCE_Event_Window_Show
111 * Event sent when the window is shown.
112 */
113typedef struct _Ecore_WinCE_Event_Window_Show Ecore_WinCE_Event_Window_Show;
114
115/**
116 * @typedef Ecore_WinCE_Event_Window_Delete_Request
117 * Event sent when the window is deleted.
118 */
119typedef struct _Ecore_WinCE_Event_Window_Delete_Request Ecore_WinCE_Event_Window_Delete_Request;
120
121
122/**
123 * @struct _Ecore_WinCE_Event_Mouse_In
124 * Event sent when the mouse enters the window.
125 */
126struct _Ecore_WinCE_Event_Mouse_In
127{
128 Ecore_WinCE_Window *window; /**< The window that received the event */
129 int x; /**< The x coordinate where the mouse entered */
130 int y; /**< The y coordinate where the mouse entered */
131 long time; /**< The time the event occurred */
132};
133
134/**
135 * @struct _Ecore_WinCE_Event_Mouse_Out
136 * Event sent when the mouse leaves the window.
137 */
138struct _Ecore_WinCE_Event_Mouse_Out
139{
140 Ecore_WinCE_Window *window; /**< The window that received the event */
141 int x; /**< The x coordinate where the mouse leaved */
142 int y; /**< The y coordinate where the mouse leaved */
143 long time; /**< The time the event occurred */
144};
145
146/**
147 * @struct _Ecore_WinCE_Event_Window_Focus_In
148 * Event sent when the window gets the focus.
149 */
150struct _Ecore_WinCE_Event_Window_Focus_In
151{
152 Ecore_WinCE_Window *window; /**< The window that received the event */
153 long time; /**< The time the event occurred */
154};
155
156/**
157 * @struct _Ecore_WinCE_Event_Window_Focus_Out
158 * Event sent when the window looses the focus.
159 */
160struct _Ecore_WinCE_Event_Window_Focus_Out
161{
162 Ecore_WinCE_Window *window; /**< The window that received the event */
163 long time; /**< The time the event occurred */
164};
165
166/**
167 * @struct _Ecore_WinCE_Event_Window_Damage
168 * Event sent when the window is damaged.
169 */
170struct _Ecore_WinCE_Event_Window_Damage
171{
172 Ecore_WinCE_Window *window; /**< The window that received the event */
173 int x; /**< The x coordinate of the top left corner of the damaged region */
174 int y; /**< The y coordinate of the top left corner of the damaged region */
175 int width; /**< The width of the damaged region */
176 int height; /**< The height of the damaged region */
177 long time; /**< The time the event occurred */
178};
179
180/**
181 * @struct _Ecore_WinCE_Event_Window_Create
182 * Event sent when the window is created.
183 */
184struct _Ecore_WinCE_Event_Window_Create
185{
186 Ecore_WinCE_Window *window; /**< The window that received the event */
187 long time; /**< The time the event occurred */
188};
189
190/**
191 * @struct _Ecore_WinCE_Event_Window_Destroy
192 * Event sent when the window is destroyed.
193 */
194struct _Ecore_WinCE_Event_Window_Destroy
195{
196 Ecore_WinCE_Window *window; /**< The window that received the event */
197 long time; /**< The time the event occurred */
198};
199
200/**
201 * @struct _Ecore_WinCE_Event_Window_Hide
202 * Event sent when the window is hidden.
203 */
204struct _Ecore_WinCE_Event_Window_Hide
205{
206 Ecore_WinCE_Window *window; /**< The window that received the event */
207 long time; /**< The time the event occurred */
208};
209
210/**
211 * @struct _Ecore_WinCE_Event_Window_Show
212 * Event sent when the window is shown.
213 */
214struct _Ecore_WinCE_Event_Window_Show
215{
216 Ecore_WinCE_Window *window; /**< The window that received the event */
217 long time; /**< The time the event occurred */
218};
219
220/**
221 * @struct _Ecore_WinCE_Event_Window_Delete_Request
222 * Event sent when the window is deleted.
223 */
224struct _Ecore_WinCE_Event_Window_Delete_Request
225{
226 Ecore_WinCE_Window *window; /**< The window that received the event */
227 long time; /**< The time the event occurred */
228};
229
230
231EAPI extern int ECORE_WINCE_EVENT_MOUSE_IN; /**< Ecore_Event for the #Ecore_WinCE_Event_Mouse_In event */
232EAPI extern int ECORE_WINCE_EVENT_MOUSE_OUT; /**< Ecore_Event for the #Ecore_WinCE_Event_Mouse_Out event */
233EAPI extern int ECORE_WINCE_EVENT_WINDOW_FOCUS_IN; /**< Ecore_Event for the #Ecore_WinCE_Event_Window_Focus_In event */
234EAPI extern int ECORE_WINCE_EVENT_WINDOW_FOCUS_OUT; /**< Ecore_Event for the #Ecore_WinCE_Event_Window_Focus_Out event */
235EAPI extern int ECORE_WINCE_EVENT_WINDOW_DAMAGE; /**< Ecore_Event for the Ecore_WinCE_Event_Damage event */
236EAPI extern int ECORE_WINCE_EVENT_WINDOW_CREATE; /**< Ecore_Event for the Ecore_WinCE_Event_Create event */
237EAPI extern int ECORE_WINCE_EVENT_WINDOW_DESTROY; /**< Ecore_Event for the Ecore_WinCE_Event_Destroy event */
238EAPI extern int ECORE_WINCE_EVENT_WINDOW_HIDE; /**< Ecore_Event for the Ecore_WinCE_Event_Hide event */
239EAPI extern int ECORE_WINCE_EVENT_WINDOW_SHOW; /**< Ecore_Event for the Ecore_WinCE_Event_Show event */
240EAPI extern int ECORE_WINCE_EVENT_WINDOW_DELETE_REQUEST; /**< Ecore_Event for the #Ecore_WinCE_Event_Window_Delete_Request event */
241
242
243/* Core */
244
245EAPI int ecore_wince_init();
246EAPI int ecore_wince_shutdown();
247EAPI void ecore_wince_double_click_time_set(double t);
248EAPI double ecore_wince_double_click_time_get(void);
249EAPI long ecore_wince_current_time_get(void);
250
251/* Window */
252
253EAPI Ecore_WinCE_Window *ecore_wince_window_new(Ecore_WinCE_Window *parent,
254 int x,
255 int y,
256 int width,
257 int height);
258
259EAPI void ecore_wince_window_free(Ecore_WinCE_Window *window);
260
261EAPI void *ecore_wince_window_hwnd_get(Ecore_WinCE_Window *window);
262
263EAPI void ecore_wince_window_move(Ecore_WinCE_Window *window,
264 int x,
265 int y);
266
267EAPI void ecore_wince_window_resize(Ecore_WinCE_Window *window,
268 int width,
269 int height);
270
271EAPI void ecore_wince_window_move_resize(Ecore_WinCE_Window *window,
272 int x,
273 int y,
274 int width,
275 int height);
276
277EAPI void ecore_wince_window_show(Ecore_WinCE_Window *window);
278
279EAPI void ecore_wince_window_hide(Ecore_WinCE_Window *window);
280
281EAPI void ecore_wince_window_title_set(Ecore_WinCE_Window *window,
282 const char *title);
283
284EAPI void ecore_wince_window_focus(Ecore_WinCE_Window *window);
285
286EAPI void *ecore_wince_window_focus_get(void);
287
288EAPI void ecore_wince_window_backend_set(Ecore_WinCE_Window *window, int backend);
289
290EAPI void ecore_wince_window_suspend_cb_set(Ecore_WinCE_Window *window, int (*suspend_cb)(int));
291
292EAPI void ecore_wince_window_resume_cb_set(Ecore_WinCE_Window *window, int (*resume_cb)(int));
293
294EAPI void ecore_wince_window_geometry_get(Ecore_WinCE_Window *window,
295 int *x,
296 int *y,
297 int *width,
298 int *height);
299
300EAPI void ecore_wince_window_size_get(Ecore_WinCE_Window *window,
301 int *width,
302 int *height);
303
304EAPI void ecore_wince_window_fullscreen_set(Ecore_WinCE_Window *window,
305 Eina_Bool on);
306
307/**
308 * @}
309 */
310
311#ifdef __cplusplus
312}
313#endif
314
315#endif /* __ECORE_WINCE_H__ */
diff --git a/src/lib/ecore_wince/ecore_wince.c b/src/lib/ecore_wince/ecore_wince.c
deleted file mode 100644
index 15da44c5e3..0000000000
--- a/src/lib/ecore_wince/ecore_wince.c
+++ /dev/null
@@ -1,400 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdlib.h>
6#include <stdio.h> /* for printf */
7
8#define WIN32_LEAN_AND_MEAN
9#include <windows.h>
10#undef WIN32_LEAN_AND_MEAN
11
12#include <Eina.h>
13#include <Ecore.h>
14#include <Ecore_Input.h>
15
16#include "Ecore_WinCE.h"
17#include "ecore_wince_private.h"
18
19/*============================================================================*
20 * Local *
21 *============================================================================*/
22
23/**
24 * @cond LOCAL
25 */
26
27static int _ecore_wince_init_count = 0;
28
29LRESULT CALLBACK
30_ecore_wince_window_procedure(HWND window,
31 UINT message,
32 WPARAM window_param,
33 LPARAM data_param)
34{
35 Ecore_WinCE_Callback_Data *data;
36 POINTS pt;
37 DWORD coord;
38
39 data = (Ecore_WinCE_Callback_Data *)malloc(sizeof(Ecore_WinCE_Callback_Data));
40 if (!data) return DefWindowProc(window, message, window_param, data_param);
41
42 data->window = window;
43 data->message = message;
44 data->window_param = window_param;
45 data->data_param = data_param;
46 data->time = GetTickCount();
47 coord = GetMessagePos();
48 pt = MAKEPOINTS(coord);
49 data->x = pt.x;
50 data->y = pt.y;
51
52 switch (data->message)
53 {
54 /* Keyboard input notifications */
55 case WM_CHAR:
56 _ecore_wince_event_handle_key_press(data, 0);
57 break;
58 case WM_HOTKEY:
59 _ecore_wince_event_handle_key_press(data, 1);
60 break;
61 case WM_KEYDOWN:
62 case WM_SYSKEYDOWN:
63 _ecore_wince_event_handle_key_press(data, 1);
64 break;
65 case WM_KEYUP:
66 case WM_SYSKEYUP:
67 _ecore_wince_event_handle_key_release(data, 1);
68 break;
69 case WM_SETFOCUS:
70 _ecore_wince_event_handle_focus_in(data);
71 break;
72 case WM_KILLFOCUS:
73 _ecore_wince_event_handle_focus_out(data);
74 break;
75 /* Mouse input notifications */
76 case WM_LBUTTONDOWN:
77 _ecore_wince_event_handle_button_press(data, 1);
78 break;
79 case WM_LBUTTONUP:
80 _ecore_wince_event_handle_button_release(data, 1);
81 break;
82 case WM_MOUSEMOVE:
83 {
84 RECT rect;
85 Ecore_WinCE_Window *w = NULL;
86
87 w = (Ecore_WinCE_Window *)GetWindowLong(window, GWL_USERDATA);
88
89 if (GetClientRect(window, &rect))
90 {
91 POINT pt;
92
93 INF("mouse in window");
94
95 pt.x = LOWORD(data_param);
96 pt.y = HIWORD(data_param);
97 if (!PtInRect(&rect, pt))
98 {
99 if (w->pointer_is_in)
100 {
101 w->pointer_is_in = 0;
102 _ecore_wince_event_handle_leave_notify(data);
103 }
104 }
105 else
106 {
107 if (!w->pointer_is_in)
108 {
109 w->pointer_is_in = 1;
110 _ecore_wince_event_handle_enter_notify(data);
111 }
112 }
113 }
114 else
115 {
116 ERR("GetClientRect() failed");
117 }
118 _ecore_wince_event_handle_motion_notify(data);
119
120 break;
121 }
122 /* Window notifications */
123 case WM_CREATE:
124 _ecore_wince_event_handle_create_notify(data);
125 break;
126 case WM_DESTROY:
127 _ecore_wince_event_handle_destroy_notify(data);
128 break;
129 case WM_SHOWWINDOW:
130 if ((data->data_param == SW_OTHERUNZOOM) ||
131 (data->data_param == SW_OTHERZOOM))
132 break;
133
134 if (data->window_param)
135 _ecore_wince_event_handle_map_notify(data);
136 else
137 _ecore_wince_event_handle_unmap_notify(data);
138
139 break;
140 case WM_CLOSE:
141 _ecore_wince_event_handle_delete_request(data);
142 break;
143 /* GDI notifications */
144 case WM_ERASEBKGND:
145 return 1;
146 case WM_PAINT:
147 {
148 PAINTSTRUCT paint;
149
150 if (BeginPaint(window, &paint))
151 {
152 data->update = paint.rcPaint;
153 _ecore_wince_event_handle_expose(data);
154 EndPaint(window, &paint);
155 }
156 break;
157 }
158 default:
159 return DefWindowProc(window, message, window_param, data_param);
160 }
161
162 return 0;
163}
164
165static void
166_ecore_wince_error_print_cb(const Eina_Log_Domain *d EINA_UNUSED,
167 Eina_Log_Level level EINA_UNUSED,
168 const char *file EINA_UNUSED,
169 const char *fnc,
170 int line,
171 const char *fmt,
172 void *data EINA_UNUSED,
173 va_list args)
174{
175 fprintf(stderr, "[%s:%d] ", fnc, line);
176 vfprintf(stderr, fmt, args);
177}
178
179/**
180 * @endcond
181 */
182
183
184/*============================================================================*
185 * Global *
186 *============================================================================*/
187
188
189double _ecore_wince_double_click_time = 0.25;
190long _ecore_wince_event_last_time = 0;
191Ecore_WinCE_Window *_ecore_wince_event_last_window = NULL;
192HINSTANCE _ecore_wince_instance = NULL;
193int _ecore_wince_log_dom_global = -1;
194
195int ECORE_WINCE_EVENT_MOUSE_IN = 0;
196int ECORE_WINCE_EVENT_MOUSE_OUT = 0;
197int ECORE_WINCE_EVENT_WINDOW_FOCUS_IN = 0;
198int ECORE_WINCE_EVENT_WINDOW_FOCUS_OUT = 0;
199int ECORE_WINCE_EVENT_WINDOW_DAMAGE = 0;
200int ECORE_WINCE_EVENT_WINDOW_CREATE = 0;
201int ECORE_WINCE_EVENT_WINDOW_DESTROY = 0;
202int ECORE_WINCE_EVENT_WINDOW_SHOW = 0;
203int ECORE_WINCE_EVENT_WINDOW_HIDE = 0;
204int ECORE_WINCE_EVENT_WINDOW_DELETE_REQUEST = 0;
205
206/*============================================================================*
207 * API *
208 *============================================================================*/
209
210/**
211 * @addtogroup Ecore_WinCE_Group Ecore_WinCE library
212 *
213 * Ecore_WinCE is a library that wraps Windows CE graphic functions
214 * and integrate them nicely into the Ecore main loop.
215 *
216 * @{
217 */
218
219/**
220 * @brief Initialize the Ecore_WinCE library.
221 *
222 * @return 1 or greater on success, 0 on error.
223 *
224 * This function sets up the Windows CE graphic system. It returns 0 on
225 * failure, otherwise it returns the number of times it has already been
226 * called.
227 *
228 * When Ecore_WinCE is not used anymore, call ecore_wince_shutdown()
229 * to shut down the Ecore_WinCE library.
230 */
231EAPI int
232ecore_wince_init()
233{
234 WNDCLASS wc;
235
236 if (++_ecore_wince_init_count != 1)
237 return _ecore_wince_init_count;
238
239 if (!eina_init())
240 return --_ecore_wince_init_count;
241
242 eina_log_print_cb_set(_ecore_wince_error_print_cb, NULL);
243 _ecore_wince_log_dom_global = eina_log_domain_register
244 ("ecore_wince", ECORE_WINCE_DEFAULT_LOG_COLOR);
245 if (_ecore_wince_log_dom_global < 0)
246 {
247 EINA_LOG_ERR("Ecore_WinCE: Could not register log domain");
248 goto shutdown_eina;
249 }
250
251 if (!ecore_event_init())
252 {
253 ERR("Ecore_WinCE: Could not init ecore_event");
254 goto unregister_log_domain;
255 }
256
257 _ecore_wince_instance = GetModuleHandle(NULL);
258 if (!_ecore_wince_instance)
259 {
260 ERR("GetModuleHandle() failed");
261 goto shutdown_ecore_event;
262 }
263
264 memset (&wc, 0, sizeof (wc));
265 wc.style = CS_HREDRAW | CS_VREDRAW;
266 wc.lpfnWndProc = _ecore_wince_window_procedure;
267 wc.cbClsExtra = 0;
268 wc.cbWndExtra = 0;
269 wc.hInstance = _ecore_wince_instance;
270 wc.hIcon = NULL;
271 wc.hCursor = LoadCursor (NULL, IDC_ARROW);
272 wc.hbrBackground = GetSysColorBrush(COLOR_BTNFACE);
273 wc.lpszMenuName = NULL;
274 wc.lpszClassName = ECORE_WINCE_WINDOW_CLASS;
275
276 if(!RegisterClass(&wc))
277 {
278 ERR("RegisterClass() failed");
279 goto free_library;
280 }
281
282 if (!ECORE_WINCE_EVENT_MOUSE_IN)
283 {
284 ECORE_WINCE_EVENT_MOUSE_IN = ecore_event_type_new();
285 ECORE_WINCE_EVENT_MOUSE_OUT = ecore_event_type_new();
286 ECORE_WINCE_EVENT_WINDOW_FOCUS_IN = ecore_event_type_new();
287 ECORE_WINCE_EVENT_WINDOW_FOCUS_OUT = ecore_event_type_new();
288 ECORE_WINCE_EVENT_WINDOW_DAMAGE = ecore_event_type_new();
289 ECORE_WINCE_EVENT_WINDOW_CREATE = ecore_event_type_new();
290 ECORE_WINCE_EVENT_WINDOW_DESTROY = ecore_event_type_new();
291 ECORE_WINCE_EVENT_WINDOW_SHOW = ecore_event_type_new();
292 ECORE_WINCE_EVENT_WINDOW_HIDE = ecore_event_type_new();
293 ECORE_WINCE_EVENT_WINDOW_DELETE_REQUEST = ecore_event_type_new();
294 }
295
296 return _ecore_wince_init_count;
297
298 free_library:
299 FreeLibrary(_ecore_wince_instance);
300 shutdown_ecore_event:
301 ecore_event_shutdown();
302 unregister_log_domain:
303 eina_log_domain_unregister(_ecore_wince_log_dom_global);
304 shutdown_eina:
305 eina_shutdown();
306
307 return --_ecore_wince_init_count;
308}
309
310/**
311 * @brief Shut down the Ecore_WinCE library.
312 *
313 * @return 0 when the library is completely shut down, 1 or
314 * greater otherwise.
315 *
316 * This function shuts down the Ecore_WinCE library. It returns 0 when it has
317 * been called the same number of times than ecore_wince_init(). In that case
318 * it shuts down all the Windows CE graphic system.
319 */
320EAPI int
321ecore_wince_shutdown()
322{
323 HWND task_bar;
324
325 if (--_ecore_wince_init_count != 0)
326 return _ecore_wince_init_count;
327
328 /* force task bar to be shown (in case the application exits */
329 /* while being fullscreen) */
330 task_bar = FindWindow(L"HHTaskBar", NULL);
331 if (task_bar)
332 {
333 ShowWindow(task_bar, SW_SHOW);
334 EnableWindow(task_bar, TRUE);
335 }
336
337 if (!UnregisterClass(ECORE_WINCE_WINDOW_CLASS, _ecore_wince_instance))
338 ERR("UnregisterClass() failed");
339
340 if (!FreeLibrary(_ecore_wince_instance))
341 ERR("FreeLibrary() failed");
342
343 _ecore_wince_instance = NULL;
344
345 ecore_event_shutdown();
346 eina_log_domain_unregister(_ecore_wince_log_dom_global);
347 _ecore_wince_log_dom_global = -1;
348 eina_shutdown();
349
350 return _ecore_wince_init_count;
351}
352
353/**
354 * @brief Set the timeout for a double and triple clicks to be flagged.
355 *
356 * @param t The time in seconds.
357 *
358 * This function sets the time @p t between clicks before the
359 * double_click flag is set in a button down event. If 3 clicks occur
360 * within double this time, the triple_click flag is also set.
361 */
362EAPI void
363ecore_wince_double_click_time_set(double t)
364{
365 if (t < 0.0) t = 0.0;
366 _ecore_wince_double_click_time = t;
367}
368
369/**
370 * @brief Retrieve the double and triple click flag timeout.
371 *
372 * @return The timeout for double clicks in seconds.
373 *
374 * This function returns the double clicks in seconds. If
375 * ecore_wince_double_click_time_set() has not been called, the
376 * default value is returned. See ecore_wince_double_click_time_set()
377 * for more informations.
378 */
379EAPI double
380ecore_wince_double_click_time_get(void)
381{
382 return _ecore_wince_double_click_time;
383}
384
385/**
386 * @brief Return the last event time.
387 *
388 * @return The last envent time.
389 *
390 * This function returns the last event time.
391 */
392EAPI long
393ecore_wince_current_time_get(void)
394{
395 return _ecore_wince_event_last_time;
396}
397
398/**
399 * @}
400 */
diff --git a/src/lib/ecore_wince/ecore_wince_event.c b/src/lib/ecore_wince/ecore_wince_event.c
deleted file mode 100644
index 39430343e3..0000000000
--- a/src/lib/ecore_wince/ecore_wince_event.c
+++ /dev/null
@@ -1,1123 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdlib.h>
6
7#define WIN32_LEAN_AND_MEAN
8#include <windows.h>
9#undef WIN32_LEAN_AND_MEAN
10
11#include <Eina.h>
12#include <Ecore.h>
13#include <Ecore_Input.h>
14
15#include "Ecore_WinCE.h"
16#include "ecore_wince_private.h"
17
18/*============================================================================*
19 * Local *
20 *============================================================================*/
21
22/**
23 * @cond LOCAL
24 */
25
26typedef enum
27{
28 ECORE_WINCE_KEY_MASK_LSHIFT = 1 << 0,
29 ECORE_WINCE_KEY_MASK_RSHIFT = 1 << 1,
30 ECORE_WINCE_KEY_MASK_LCONTROL = 1 << 2,
31 ECORE_WINCE_KEY_MASK_RCONTROL = 1 << 3,
32 ECORE_WINCE_KEY_MASK_LMENU = 1 << 4,
33 ECORE_WINCE_KEY_MASK_RMENU = 1 << 5
34} Ecore_Wince_Key_Mask;
35
36static Ecore_WinCE_Window *_ecore_wince_mouse_down_last_window = NULL;
37static Ecore_WinCE_Window *_ecore_wince_mouse_down_last_last_window = NULL;
38static long _ecore_wince_mouse_down_last_time = 0;
39static long _ecore_wince_mouse_down_last_last_time = 0;
40static int _ecore_wince_mouse_down_did_triple = 0;
41static int _ecore_wince_mouse_up_count = 0;
42static Ecore_Wince_Key_Mask _ecore_wince_key_mask = 0;
43
44static void
45_ecore_wince_event_free_key_down(void *data EINA_UNUSED,
46 void *ev)
47{
48 Ecore_Event_Key *e;
49
50 e = ev;
51 if (e->keyname) free((char *)e->keyname);
52 if (e->key) free((char *)e->key);
53 if (e->string) free((char *)e->string);
54 free(e);
55}
56
57static void
58_ecore_wince_event_free_key_up(void *data EINA_UNUSED,
59 void *ev)
60{
61 Ecore_Event_Key *e;
62
63 e = ev;
64 if (e->keyname) free((char *)e->keyname);
65 if (e->key) free((char *)e->key);
66 if (e->string) free((char *)e->string);
67 free(e);
68}
69
70static int
71_ecore_wince_event_keystroke_get(int key,
72 Eina_Bool is_down,
73 char **keyname,
74 char **keysymbol,
75 char **keycompose)
76{
77 char *kn;
78 char *ks;
79 char *kc;
80 int previous_key_state;
81
82 previous_key_state = msg->data_param & 0x40000000;
83
84 *keyname = NULL;
85 *keysymbol = NULL;
86 *keycompose = NULL;
87
88 switch (key)
89 {
90 /* Keystroke */
91 case VK_PRIOR:
92 kn = "Prior";
93 ks = "Prior";
94 kc = "Prior";
95 break;
96 case VK_NEXT:
97 kn = "Next";
98 ks = "Next";
99 kc = "Next";
100 break;
101 case VK_END:
102 kn = "End";
103 ks = "End";
104 kc = "End";
105 break;
106 case VK_HOME:
107 kn = "Home";
108 ks = "Home";
109 kc = "Home";
110 break;
111 case VK_LEFT:
112 kn = "Left";
113 ks = "Left";
114 kc = "Left";
115 break;
116 case VK_UP:
117 kn = "Up";
118 ks = "Up";
119 kc = "Up";
120 break;
121 case VK_RIGHT:
122 kn = "Right";
123 ks = "Right";
124 kc = "Right";
125 break;
126 case VK_DOWN:
127 kn = "Down";
128 ks = "Down";
129 kc = "Down";
130 break;
131 case VK_INSERT:
132 kn = "Insert";
133 ks = "Insert";
134 kc = "Insert";
135 break;
136 case VK_DELETE:
137 kn = "Delete";
138 ks = "Delete";
139 kc = "Delete";
140 break;
141 case VK_F1:
142 kn = "F1";
143 ks = "F1";
144 kc = "";
145 break;
146 case VK_F2:
147 kn = "F2";
148 ks = "F2";
149 kc = "";
150 break;
151 case VK_F3:
152 kn = "F3";
153 ks = "F3";
154 kc = "";
155 break;
156 case VK_F4:
157 kn = "F4";
158 ks = "F4";
159 kc = "";
160 break;
161 case VK_F5:
162 kn = "F5";
163 ks = "F5";
164 kc = "";
165 break;
166 case VK_F6:
167 kn = "F6";
168 ks = "F6";
169 kc = "";
170 break;
171 case VK_F7:
172 kn = "F7";
173 ks = "F7";
174 kc = "";
175 break;
176 case VK_F8:
177 kn = "F8";
178 ks = "F8";
179 kc = "";
180 break;
181 case VK_F9:
182 kn = "F9";
183 ks = "F9";
184 kc = "";
185 break;
186 case VK_F10:
187 kn = "F10";
188 ks = "F10";
189 kc = "";
190 break;
191 case VK_F11:
192 kn = "F11";
193 ks = "F11";
194 kc = "";
195 break;
196 case VK_F12:
197 kn = "F12";
198 ks = "F12";
199 kc = "";
200 break;
201 case VK_F13:
202 kn = "F13";
203 ks = "F13";
204 kc = "";
205 break;
206 case VK_F14:
207 kn = "F14";
208 ks = "F14";
209 kc = "";
210 break;
211 case VK_F15:
212 kn = "F15";
213 ks = "F15";
214 kc = "";
215 break;
216 case VK_F16:
217 kn = "F16";
218 ks = "F16";
219 kc = "";
220 break;
221 case VK_F17:
222 kn = "F17";
223 ks = "F17";
224 kc = "";
225 break;
226 case VK_F18:
227 kn = "F18";
228 ks = "F18";
229 kc = "";
230 break;
231 case VK_F19:
232 kn = "F19";
233 ks = "F19";
234 kc = "";
235 break;
236 case VK_F20:
237 /*
238 * VK_F20 indicates that an arrow key came from a rocker.
239 * This can safely be ignored.
240 */
241 return 0;
242 case VK_F21:
243 /*
244 * VK_F21 indicates that an arrow key came from a directional
245 * pad. This can safely be ignored.
246 */
247 return 0;
248 case VK_F22:
249 kn = "F22";
250 ks = "F22";
251 kc = "";
252 break;
253 case VK_F23:
254 /*
255 * Sent with VK_RETURN when doing an action (usually the middle
256 * button on a directional pad. This can safely be ignored.
257 */
258 return 0;
259 case VK_F24:
260 kn = "F24";
261 ks = "F24";
262 kc = "";
263 break;
264 case VK_APPS:
265 kn = "Application";
266 ks = "Application";
267 kc = "";
268 break;
269 case VK_SHIFT:
270 {
271 SHORT res;
272
273 if (is_down)
274 {
275 if (previous_key_state) return 0;
276 res = GetKeyState(VK_LSHIFT);
277 if (res & 0x8000)
278 {
279 _ecore_wince_key_mask |= ECORE_WINCE_KEY_MASK_LSHIFT;
280 kn = "Shift_L";
281 ks = "Shift_L";
282 kc = "";
283 }
284 res = GetKeyState(VK_RSHIFT);
285 if (res & 0x8000)
286 {
287 _ecore_wince_key_mask |= ECORE_WINCE_KEY_MASK_RSHIFT;
288 kn = "Shift_R";
289 ks = "Shift_R";
290 kc = "";
291 }
292 }
293 else /* is_up */
294 {
295 res = GetKeyState(VK_LSHIFT);
296 if (!(res & 0x8000) &&
297 (_ecore_wince_key_mask & ECORE_WINCE_KEY_MASK_LSHIFT))
298 {
299 kn = "Shift_L";
300 ks = "Shift_L";
301 kc = "";
302 _ecore_wince_key_mask &= ~ECORE_WINCE_KEY_MASK_LSHIFT;
303 }
304 res = GetKeyState(VK_RSHIFT);
305 if (!(res & 0x8000) &&
306 (_ecore_wince_key_mask & ECORE_WINCE_KEY_MASK_RSHIFT))
307 {
308 kn = "Shift_R";
309 ks = "Shift_R";
310 kc = "";
311 _ecore_wince_key_mask &= ~ECORE_WINCE_KEY_MASK_RSHIFT;
312 }
313 }
314 break;
315 }
316 case VK_CONTROL:
317 {
318 SHORT res;
319
320 if (is_down)
321 {
322 if (previous_key_state) return 0;
323 res = GetKeyState(VK_LCONTROL);
324 if (res & 0x8000)
325 {
326 _ecore_wince_key_mask |= ECORE_WINCE_KEY_MASK_LCONTROL;
327 kn = "Control_L";
328 ks = "Control_L";
329 kc = "";
330 break;
331 }
332 res = GetKeyState(VK_RCONTROL);
333 if (res & 0x8000)
334 {
335 _ecore_wince_key_mask |= ECORE_WINCE_KEY_MASK_RCONTROL;
336 kn = "Control_R";
337 ks = "Control_R";
338 kc = "";
339 break;
340 }
341 }
342 else /* is_up */
343 {
344 res = GetKeyState(VK_LCONTROL);
345 if (!(res & 0x8000) &&
346 (_ecore_wince_key_mask & ECORE_WINCE_KEY_MASK_LCONTROL))
347 {
348 kn = "Control_L";
349 ks = "Control_L";
350 kc = "";
351 _ecore_wince_key_mask &= ~ECORE_WINCE_KEY_MASK_LCONTROL;
352 break;
353 }
354 res = GetKeyState(VK_RCONTROL);
355 if (!(res & 0x8000) &&
356 (_ecore_wince_key_mask & ECORE_WINCE_KEY_MASK_RCONTROL))
357 {
358 kn = "Control_R";
359 ks = "Control_R";
360 kc = "";
361 _ecore_wince_key_mask &= ~ECORE_WINCE_KEY_MASK_RCONTROL;
362 break;
363 }
364 }
365 break;
366 }
367 case VK_MENU:
368 {
369 SHORT res;
370
371 if (is_down)
372 {
373 if (previous_key_state) return 0;
374 res = GetKeyState(VK_LMENU);
375 if (res & 0x8000)
376 {
377 _ecore_wince_key_mask |= ECORE_WINCE_KEY_MASK_LMENU;
378 kn = "Alt_L";
379 ks = "Alt_L";
380 kc = "";
381 }
382 res = GetKeyState(VK_RMENU);
383 if (res & 0x8000)
384 {
385 _ecore_wince_key_mask |= ECORE_WINCE_KEY_MASK_RMENU;
386 kn = "Alt_R";
387 ks = "Alt_R";
388 kc = "";
389 }
390 }
391 else /* is_up */
392 {
393 res = GetKeyState(VK_LMENU);
394 if (!(res & 0x8000) &&
395 (_ecore_wince_key_mask & ECORE_WINCE_KEY_MASK_LMENU))
396 {
397 kn = "Alt_L";
398 ks = "Alt_L";
399 kc = "";
400 _ecore_wince_key_mask &= ~ECORE_WINCE_KEY_MASK_LMENU;
401 }
402 res = GetKeyState(VK_RMENU);
403 if (!(res & 0x8000) &&
404 (_ecore_wince_key_mask & ECORE_WINCE_KEY_MASK_RMENU))
405 {
406 kn = "Alt_R";
407 ks = "Alt_R";
408 kc = "";
409 _ecore_wince_key_mask &= ~ECORE_WINCE_KEY_MASK_RMENU;
410 }
411 }
412 break;
413 }
414 case VK_LWIN:
415 {
416 if (is_down)
417 {
418 if (previous_key_state) return 0;
419 kn = "Super_L";
420 ks = "Super_L";
421 kc = "";
422 *modifiers |= ECORE_EVENT_MODIFIER_WIN;
423 }
424 else /* is_up */
425 {
426 kn = "Super_L";
427 ks = "Super_L";
428 kc = "";
429 *modifiers &= ~ECORE_EVENT_MODIFIER_WIN;
430 }
431 break;
432 }
433 case VK_RWIN:
434 {
435 if (is_down)
436 {
437 if (previous_key_state) return 0;
438 kn = "Super_R";
439 ks = "Super_R";
440 kc = "";
441 *modifiers |= ECORE_EVENT_MODIFIER_WIN;
442 }
443 else /* is_up */
444 {
445 kn = "Super_R";
446 ks = "Super_R";
447 kc = "";
448 *modifiers &= ~ECORE_EVENT_MODIFIER_WIN;
449 }
450 break;
451 }
452 default:
453 /* other non keystroke characters */
454 return 0;
455 }
456 *keyname = strdup(kn);
457 if (!*keyname) return 0;
458 *keysymbol = strdup(ks);
459 if (!*keysymbol)
460 {
461 free(*keyname);
462 *keyname = NULL;
463 return 0;
464 }
465 *keycompose = strdup(kc);
466 if (!*keycompose)
467 {
468 free(*keyname);
469 free(*keysymbol);
470 *keyname = NULL;
471 *keysymbol = NULL;
472 return 0;
473 }
474
475 return 1;
476}
477
478static int
479_ecore_wince_event_char_get(int key,
480 char **keyname,
481 char **keysymbol,
482 char **keycompose)
483{
484 char kn[32];
485 char ks[32];
486 char kc[32];
487
488 *keyname = NULL;
489 *keysymbol = NULL;
490 *keycompose = NULL;
491
492 /* check control charaters such as ^a(key:1), ^z(key:26) */
493 if ((key > 0) && (key < 27) &&
494 ((GetKeyState(VK_CONTROL) & 0x8000) ||
495 (GetKeyState(VK_CONTROL) & 0x8000))) key += 96;
496
497 switch (key)
498 {
499 case VK_APP3:
500 case VK_BACK:
501 strncpy(kn, "BackSpace", 32);
502 strncpy(ks, "BackSpace", 32);
503 strncpy(kc, "BackSpace", 32);
504 break;
505 case VK_APP4:
506 case VK_TAB:
507 strncpy(kn, "Tab", 32);
508 strncpy(ks, "Tab", 32);
509 strncpy(kc, "Tab", 32);
510 break;
511 case VK_APP5:
512 case 0x0a:
513 /* Line feed (Shift + Enter) */
514 strncpy(kn, "LineFeed", 32);
515 strncpy(ks, "LineFeed", 32);
516 strncpy(kc, "LineFeed", 32);
517 break;
518 case VK_APP2:
519 case VK_RETURN:
520 strncpy(kn, "Return", 32);
521 strncpy(ks, "Return", 32);
522 strncpy(kc, "Return", 32);
523 break;
524 case VK_APP1:
525 case VK_ESCAPE:
526 strncpy(kn, "Escape", 32);
527 strncpy(ks, "Escape", 32);
528 strncpy(kc, "Escape", 32);
529 break;
530 case VK_SPACE:
531 strncpy(kn, "space", 32);
532 strncpy(ks, "space", 32);
533 strncpy(kc, " ", 32);
534 break;
535 default:
536 /* displayable characters */
537 printf (" * key : %d\n", key);
538 kn[0] = (TCHAR)key;
539 kn[1] = '\0';
540 ks[0] = (TCHAR)key;
541 ks[1] = '\0';
542 kc[0] = (TCHAR)key;
543 kc[1] = '\0';
544 break;
545 }
546 *keyname = strdup(kn);
547 if (!*keyname) return 0;
548 *keysymbol = strdup(ks);
549 if (!*keysymbol)
550 {
551 free(*keyname);
552 *keyname = NULL;
553 return 0;
554 }
555 *keycompose = strdup(kc);
556 if (!*keycompose)
557 {
558 free(*keyname);
559 free(*keysymbol);
560 *keyname = NULL;
561 *keysymbol = NULL;
562 return 0;
563 }
564
565 return 1;
566}
567
568/**
569 * @endcond
570 */
571
572
573/*============================================================================*
574 * Global *
575 *============================================================================*/
576
577void
578_ecore_wince_event_handle_key_press(Ecore_WinCE_Callback_Data *msg,
579 int is_keystroke)
580{
581 Ecore_Event_Key *e;
582
583 INF("key pressed");
584
585 e = (Ecore_Event_Key *)malloc(sizeof(Ecore_Event_Key));
586 if (!e) return;
587
588 if (is_keystroke)
589 {
590 if (!_ecore_wince_event_keystroke_get(LOWORD(msg->window_param),
591 EINA_TRUE,
592 (char **)&e->keyname,
593 (char **)&e->key,
594 (char **)&e->string))
595 {
596 free(e);
597 return;
598 }
599 }
600 else
601 {
602 if (!_ecore_wince_event_char_get(LOWORD(msg->window_param),
603 (char **)&e->keyname,
604 (char **)&e->key,
605 (char **)&e->string))
606 {
607 free(e);
608 return;
609 }
610 }
611
612 e->window = (Ecore_Window)GetWindowLong(msg->window, GWL_USERDATA);
613 e->event_window = e->window;
614 if (!e->window)
615 {
616 free(e);
617 return;
618 }
619 e->timestamp = msg->time;
620
621 _ecore_wince_event_last_time = e->timestamp;
622
623 ecore_event_add(ECORE_EVENT_KEY_DOWN, e, _ecore_wince_event_free_key_down, NULL);
624}
625
626void
627_ecore_wince_event_handle_key_release(Ecore_WinCE_Callback_Data *msg,
628 int is_keystroke)
629{
630 Ecore_Event_Key *e;
631
632 INF("key released");
633
634 e = (Ecore_Event_Key *)calloc(1, sizeof(Ecore_Event_Key));
635 if (!e) return;
636
637 if (is_keystroke)
638 {
639 if (!_ecore_wince_event_keystroke_get(LOWORD(msg->window_param),
640 EINA_FALSE,
641 (char **)&e->keyname,
642 (char **)&e->key,
643 (char **)&e->string))
644 {
645 free(e);
646 return;
647 }
648 }
649 else
650 {
651 if (!_ecore_wince_event_char_get(LOWORD(msg->window_param),
652 (char **)&e->keyname,
653 (char **)&e->key,
654 (char **)&e->string))
655 {
656 free(e);
657 return;
658 }
659 }
660
661 e->window = (Ecore_Window)GetWindowLong(msg->window, GWL_USERDATA);
662 e->event_window = e->window;
663 if (!e->window)
664 {
665 free(e);
666 return;
667 }
668 e->timestamp = msg->time;
669
670 _ecore_wince_event_last_time = e->timestamp;
671
672 ecore_event_add(ECORE_EVENT_KEY_UP, e, _ecore_wince_event_free_key_up, NULL);
673}
674
675void
676_ecore_wince_event_handle_button_press(Ecore_WinCE_Callback_Data *msg,
677 int button)
678{
679 Ecore_WinCE_Window *window;
680
681 INF("mouse button pressed");
682
683 window = (Ecore_WinCE_Window *)GetWindowLong(msg->window, GWL_USERDATA);
684
685 {
686 Ecore_Event_Mouse_Move *e;
687
688 e = (Ecore_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Event_Mouse_Move));
689 if (!e) return;
690
691 e->window = (Ecore_Window)window;
692 e->event_window = e->window;
693 e->x = LOWORD(msg->data_param);
694 e->y = HIWORD(msg->data_param);
695 e->timestamp = msg->time;
696
697 _ecore_wince_event_last_time = e->timestamp;
698 _ecore_wince_event_last_window = (Ecore_WinCE_Window *)e->window;
699
700 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
701 }
702
703 {
704 Ecore_Event_Mouse_Button *e;
705
706 if (_ecore_wince_mouse_down_did_triple)
707 {
708 _ecore_wince_mouse_down_last_window = NULL;
709 _ecore_wince_mouse_down_last_last_window = NULL;
710 _ecore_wince_mouse_down_last_time = 0;
711 _ecore_wince_mouse_down_last_last_time = 0;
712 }
713
714 e = (Ecore_Event_Mouse_Button *)calloc(1, sizeof(Ecore_Event_Mouse_Button));
715 if (!e) return;
716
717 e->window = (Ecore_Window)window;
718 e->event_window = e->window;
719 e->buttons = button;
720 e->x = LOWORD(msg->data_param);
721 e->y = HIWORD(msg->data_param);
722 e->timestamp = msg->time;
723
724 if (((e->timestamp - _ecore_wince_mouse_down_last_time) <= (long)(1000 * _ecore_wince_double_click_time)) &&
725 (e->window == (Ecore_Window)_ecore_wince_mouse_down_last_window))
726 e->double_click = 1;
727
728 if (((e->timestamp - _ecore_wince_mouse_down_last_last_time) <= (long)(2 * 1000 * _ecore_wince_double_click_time)) &&
729 (e->window == (Ecore_Window)_ecore_wince_mouse_down_last_window) &&
730 (e->window == (Ecore_Window)_ecore_wince_mouse_down_last_last_window))
731 {
732 e->triple_click = 1;
733 _ecore_wince_mouse_down_did_triple = 1;
734 }
735 else
736 _ecore_wince_mouse_down_did_triple = 0;
737
738 if (!e->double_click && !e->triple_click)
739 _ecore_wince_mouse_up_count = 0;
740
741 _ecore_wince_event_last_time = e->timestamp;
742 _ecore_wince_event_last_window = (Ecore_WinCE_Window *)e->window;
743
744 if (!_ecore_wince_mouse_down_did_triple)
745 {
746 _ecore_wince_mouse_down_last_last_window = _ecore_wince_mouse_down_last_window;
747 _ecore_wince_mouse_down_last_window = (Ecore_WinCE_Window *)e->window;
748 _ecore_wince_mouse_down_last_last_time = _ecore_wince_mouse_down_last_time;
749 _ecore_wince_mouse_down_last_time = e->timestamp;
750 }
751
752 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL);
753 }
754}
755
756void
757_ecore_wince_event_handle_button_release(Ecore_WinCE_Callback_Data *msg,
758 int button)
759{
760 Ecore_WinCE_Window *window;
761
762 INF("mouse button released");
763
764 window = (void *)GetWindowLong(msg->window, GWL_USERDATA);
765
766 {
767 Ecore_Event_Mouse_Move *e;
768
769 e = (Ecore_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Event_Mouse_Move));
770 if (!e) return;
771
772 e->window = (Ecore_Window)window;
773 e->event_window = e->window;
774 e->x = LOWORD(msg->data_param);
775 e->y = HIWORD(msg->data_param);
776 e->timestamp = msg->time;
777
778 _ecore_wince_event_last_time = e->timestamp;
779 _ecore_wince_event_last_window = (Ecore_WinCE_Window *)e->window;
780
781 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
782 }
783
784 {
785 Ecore_Event_Mouse_Button *e;
786
787 e = (Ecore_Event_Mouse_Button *)calloc(1, sizeof(Ecore_Event_Mouse_Button));
788 if (!e) return;
789
790 e->window = (Ecore_Window)window;
791 e->event_window = e->window;
792 e->buttons = button;
793 e->x = LOWORD(msg->data_param);
794 e->y = HIWORD(msg->data_param);
795 e->timestamp = msg->time;
796
797 _ecore_wince_mouse_up_count++;
798
799 if ((_ecore_wince_mouse_up_count >= 2) &&
800 ((e->timestamp - _ecore_wince_mouse_down_last_time) <= (long)(1000 * _ecore_wince_double_click_time)) &&
801 (e->window == (Ecore_Window)_ecore_wince_mouse_down_last_window))
802 e->double_click = 1;
803
804 if ((_ecore_wince_mouse_up_count >= 3) &&
805 ((e->timestamp - _ecore_wince_mouse_down_last_last_time) <= (long)(2 * 1000 * _ecore_wince_double_click_time)) &&
806 (e->window == (Ecore_Window)_ecore_wince_mouse_down_last_window) &&
807 (e->window == (Ecore_Window)_ecore_wince_mouse_down_last_last_window))
808 e->triple_click = 1;
809
810 _ecore_wince_event_last_time = e->timestamp;
811 _ecore_wince_event_last_window = (Ecore_WinCE_Window *)e->window;
812
813 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL);
814 }
815}
816
817void
818_ecore_wince_event_handle_motion_notify(Ecore_WinCE_Callback_Data *msg)
819{
820 Ecore_Event_Mouse_Move *e;
821
822 INF("mouse moved");
823
824 e = (Ecore_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Event_Mouse_Move));
825 if (!e) return;
826
827 e->window = (Ecore_Window)GetWindowLong(msg->window, GWL_USERDATA);
828 e->event_window = e->window;
829 e->x = LOWORD(msg->data_param);
830 e->y = HIWORD(msg->data_param);
831 e->timestamp = msg->time;
832
833 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
834}
835
836void
837_ecore_wince_event_handle_enter_notify(Ecore_WinCE_Callback_Data *msg)
838{
839 Ecore_WinCE_Window *window;
840
841 INF("mouse in");
842
843 window = (void *)GetWindowLong(msg->window, GWL_USERDATA);
844
845 {
846 Ecore_Event_Mouse_Move *e;
847
848 e = (Ecore_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Event_Mouse_Move));
849 if (!e) return;
850
851 e->window = (Ecore_Window)window;
852 e->event_window = e->window;
853 e->x = msg->x;
854 e->y = msg->y;
855 e->timestamp = msg->time;
856
857 _ecore_wince_event_last_time = e->timestamp;
858 _ecore_wince_event_last_window = (Ecore_WinCE_Window *)e->window;
859
860 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
861 }
862
863 {
864 Ecore_WinCE_Event_Mouse_In *e;
865
866 e = (Ecore_WinCE_Event_Mouse_In *)calloc(1, sizeof(Ecore_WinCE_Event_Mouse_In));
867 if (!e) return;
868
869 e->window = window;
870 e->x = msg->x;
871 e->y = msg->y;
872 e->time = msg->time;
873
874 _ecore_wince_event_last_time = e->time;
875
876 ecore_event_add(ECORE_WINCE_EVENT_MOUSE_IN, e, NULL, NULL);
877 }
878}
879
880void
881_ecore_wince_event_handle_leave_notify(Ecore_WinCE_Callback_Data *msg)
882{
883 Ecore_WinCE_Window *window;
884
885 INF("mouse out");
886
887 window = (void *)GetWindowLong(msg->window, GWL_USERDATA);
888
889 {
890 Ecore_Event_Mouse_Move *e;
891
892 e = (Ecore_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Event_Mouse_Move));
893 if (!e) return;
894
895 e->window = (Ecore_Window)window;
896 e->event_window = e->window;
897 e->x = msg->x;
898 e->y = msg->y;
899 e->timestamp = msg->time;
900
901 _ecore_wince_event_last_time = e->timestamp;
902 _ecore_wince_event_last_window = (Ecore_WinCE_Window *)e->window;
903
904 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
905 }
906
907 {
908 Ecore_WinCE_Event_Mouse_Out *e;
909
910 e = (Ecore_WinCE_Event_Mouse_Out *)calloc(1, sizeof(Ecore_WinCE_Event_Mouse_Out));
911 if (!e) return;
912
913 e->window = window;
914 e->x = msg->x;
915 e->y = msg->y;
916 e->time = msg->time;
917
918 _ecore_wince_event_last_time = e->time;
919
920 ecore_event_add(ECORE_WINCE_EVENT_MOUSE_OUT, e, NULL, NULL);
921 }
922}
923
924void
925_ecore_wince_event_handle_focus_in(Ecore_WinCE_Callback_Data *msg)
926{
927 Ecore_WinCE_Event_Window_Focus_In *e;
928 Ecore_WinCE_Window *window;
929
930 INF("focus in");
931
932 e = (Ecore_WinCE_Event_Window_Focus_In *)calloc(1, sizeof(Ecore_WinCE_Event_Window_Focus_In));
933 if (!e) return;
934
935 window = (void *)GetWindowLong(msg->window, GWL_USERDATA);
936 if (!e->window)
937 {
938 free(e);
939 return;
940 }
941
942 if (window->resume_cb)
943 window->resume_cb(window->backend);
944
945 e->window = window;
946
947 e->time = _ecore_wince_event_last_time;
948 _ecore_wince_event_last_time = e->time;
949
950 ecore_event_add(ECORE_WINCE_EVENT_WINDOW_FOCUS_IN, e, NULL, NULL);
951}
952
953void
954_ecore_wince_event_handle_focus_out(Ecore_WinCE_Callback_Data *msg)
955{
956 Ecore_WinCE_Event_Window_Focus_Out *e;
957 Ecore_WinCE_Window *window;
958
959 INF("focus out");
960
961 e = (Ecore_WinCE_Event_Window_Focus_Out *)calloc(1, sizeof(Ecore_WinCE_Event_Window_Focus_Out));
962 if (!e) return;
963
964 window = (void *)GetWindowLong(msg->window, GWL_USERDATA);
965 if (!e->window)
966 {
967 free(e);
968 return;
969 }
970 if (window->suspend_cb)
971 window->suspend_cb(window->backend);
972
973 e->window = window;
974
975 e->time = _ecore_wince_event_last_time;
976 _ecore_wince_event_last_time = e->time;
977
978 ecore_event_add(ECORE_WINCE_EVENT_WINDOW_FOCUS_OUT, e, NULL, NULL);
979}
980
981void
982_ecore_wince_event_handle_expose(Ecore_WinCE_Callback_Data *msg)
983{
984 Ecore_WinCE_Event_Window_Damage *e;
985
986 INF("window expose");
987
988 e = (Ecore_WinCE_Event_Window_Damage *)calloc(1, sizeof(Ecore_WinCE_Event_Window_Damage));
989 if (!e) return;
990
991 e->window = (void *)GetWindowLong(msg->window, GWL_USERDATA);
992 if (!e->window)
993 {
994 free(e);
995 return;
996 }
997
998 e->x = msg->update.left;
999 e->y = msg->update.top;
1000 e->width = msg->update.right - msg->update.left;
1001 e->height = msg->update.bottom - msg->update.top;
1002 INF("window expose size: %dx%d", e->width, e->height);
1003
1004 e->time = _ecore_wince_event_last_time;
1005
1006 ecore_event_add(ECORE_WINCE_EVENT_WINDOW_DAMAGE, e, NULL, NULL);
1007}
1008
1009void
1010_ecore_wince_event_handle_create_notify(Ecore_WinCE_Callback_Data *msg)
1011{
1012 Ecore_WinCE_Event_Window_Create *e;
1013
1014 INF("window create notify");
1015
1016 e = calloc(1, sizeof(Ecore_WinCE_Event_Window_Create));
1017 if (!e) return;
1018
1019 e->window = (void *)GetWindowLong(msg->window, GWL_USERDATA);
1020 if (!e->window)
1021 {
1022 free(e);
1023 return;
1024 }
1025
1026 e->time = _ecore_wince_event_last_time;
1027
1028 ecore_event_add(ECORE_WINCE_EVENT_WINDOW_CREATE, e, NULL, NULL);
1029}
1030
1031void
1032_ecore_wince_event_handle_destroy_notify(Ecore_WinCE_Callback_Data *msg)
1033{
1034 Ecore_WinCE_Event_Window_Destroy *e;
1035
1036 INF("window destroy notify");
1037
1038 e = calloc(1, sizeof(Ecore_WinCE_Event_Window_Destroy));
1039 if (!e) return;
1040
1041 e->window = (void *)GetWindowLong(msg->window, GWL_USERDATA);
1042 if (!e->window)
1043 {
1044 free(e);
1045 return;
1046 }
1047
1048 e->time = _ecore_wince_event_last_time;
1049/* if (e->window == _ecore_wince_event_last_window) _ecore_wince_event_last_window = NULL; */
1050
1051 ecore_event_add(ECORE_WINCE_EVENT_WINDOW_DESTROY, e, NULL, NULL);
1052}
1053
1054void
1055_ecore_wince_event_handle_map_notify(Ecore_WinCE_Callback_Data *msg)
1056{
1057 Ecore_WinCE_Event_Window_Show *e;
1058
1059 INF("window map notify");
1060
1061 e = calloc(1, sizeof(Ecore_WinCE_Event_Window_Show));
1062 if (!e) return;
1063
1064 e->window = (void *)GetWindowLong(msg->window, GWL_USERDATA);
1065 if (!e->window)
1066 {
1067 free(e);
1068 return;
1069 }
1070
1071 e->time = _ecore_wince_event_last_time;
1072
1073 ecore_event_add(ECORE_WINCE_EVENT_WINDOW_SHOW, e, NULL, NULL);
1074}
1075
1076void
1077_ecore_wince_event_handle_unmap_notify(Ecore_WinCE_Callback_Data *msg)
1078{
1079 Ecore_WinCE_Event_Window_Hide *e;
1080
1081 INF("window unmap notify");
1082
1083 e = calloc(1, sizeof(Ecore_WinCE_Event_Window_Hide));
1084 if (!e) return;
1085
1086 e->window = (void *)GetWindowLong(msg->window, GWL_USERDATA);
1087 if (!e->window)
1088 {
1089 free(e);
1090 return;
1091 }
1092
1093 e->time = _ecore_wince_event_last_time;
1094
1095 ecore_event_add(ECORE_WINCE_EVENT_WINDOW_HIDE, e, NULL, NULL);
1096}
1097
1098void
1099_ecore_wince_event_handle_delete_request(Ecore_WinCE_Callback_Data *msg)
1100{
1101 Ecore_WinCE_Event_Window_Delete_Request *e;
1102
1103 INF("window delete request");
1104
1105 e = calloc(1, sizeof(Ecore_WinCE_Event_Window_Delete_Request));
1106 if (!e) return;
1107
1108 e->window = (void *)GetWindowLong(msg->window, GWL_USERDATA);
1109 if (!e->window)
1110 {
1111 free(e);
1112 return;
1113 }
1114
1115 e->time = _ecore_wince_event_last_time;
1116
1117 ecore_event_add(ECORE_WINCE_EVENT_WINDOW_DELETE_REQUEST, e, NULL, NULL);
1118}
1119
1120/*============================================================================*
1121 * API *
1122 *============================================================================*/
1123
diff --git a/src/lib/ecore_wince/ecore_wince_private.h b/src/lib/ecore_wince/ecore_wince_private.h
deleted file mode 100644
index b506312f99..0000000000
--- a/src/lib/ecore_wince/ecore_wince_private.h
+++ /dev/null
@@ -1,85 +0,0 @@
1#ifndef __ECORE_WINCE_PRIVATE_H__
2#define __ECORE_WINCE_PRIVATE_H__
3
4
5/* logging messages macros */
6extern int _ecore_wince_log_dom_global;
7
8#ifdef ECORE_WINCE_DEFAULT_LOG_COLOR
9#undef ECORE_WINCE_DEFAULT_LOG_COLOR
10#endif
11#define ECORE_WINCE_DEFAULT_LOG_COLOR EINA_COLOR_LIGHTBLUE
12
13#ifdef ERR
14# undef ERR
15#endif
16#define ERR(...) EINA_LOG_DOM_ERR(_ecore_wince_log_dom_global , __VA_ARGS__)
17#ifdef DBG
18# undef DBG
19#endif
20#define DBG(...) EINA_LOG_DOM_DBG(_ecore_wince_log_dom_global , __VA_ARGS__)
21#ifdef INF
22# undef INF
23#endif
24#define INF(...) EINA_LOG_DOM_INFO(_ecore_wince_log_dom_global , __VA_ARGS__)
25
26#define ECORE_WINCE_WINDOW_CLASS L"Ecore_WinCE_Window_Class"
27
28
29typedef struct _Ecore_WinCE_Callback_Data Ecore_WinCE_Callback_Data;
30
31struct _Ecore_WinCE_Callback_Data
32{
33 RECT update;
34 HWND window;
35 unsigned int message;
36 WPARAM window_param;
37 LPARAM data_param;
38 long time;
39 int x;
40 int y;
41};
42
43
44typedef int (*ecore_wince_suspend_cb) (int);
45typedef int (*ecore_wince_resume_cb) (int);
46
47
48struct _Ecore_WinCE_Window
49{
50 HWND window;
51
52 int backend;
53 ecore_wince_suspend_cb suspend_cb;
54 ecore_wince_resume_cb resume_cb;
55
56 RECT rect; /* used to go fullscreen to normal */
57
58 unsigned int pointer_is_in : 1;
59 unsigned int fullscreen : 1;
60};
61
62extern HINSTANCE _ecore_wince_instance;
63extern double _ecore_wince_double_click_time;
64extern long _ecore_wince_event_last_time;
65extern Ecore_WinCE_Window *_ecore_wince_event_last_window;
66
67
68void _ecore_wince_event_handle_key_press(Ecore_WinCE_Callback_Data *msg, int is_keystroke);
69void _ecore_wince_event_handle_key_release(Ecore_WinCE_Callback_Data *msg, int is_keystroke);
70void _ecore_wince_event_handle_button_press(Ecore_WinCE_Callback_Data *msg, int button);
71void _ecore_wince_event_handle_button_release(Ecore_WinCE_Callback_Data *msg, int button);
72void _ecore_wince_event_handle_motion_notify(Ecore_WinCE_Callback_Data *msg);
73void _ecore_wince_event_handle_enter_notify(Ecore_WinCE_Callback_Data *msg);
74void _ecore_wince_event_handle_leave_notify(Ecore_WinCE_Callback_Data *msg);
75void _ecore_wince_event_handle_focus_in(Ecore_WinCE_Callback_Data *msg);
76void _ecore_wince_event_handle_focus_out(Ecore_WinCE_Callback_Data *msg);
77void _ecore_wince_event_handle_expose(Ecore_WinCE_Callback_Data *msg);
78void _ecore_wince_event_handle_create_notify(Ecore_WinCE_Callback_Data *msg);
79void _ecore_wince_event_handle_destroy_notify(Ecore_WinCE_Callback_Data *msg);
80void _ecore_wince_event_handle_map_notify(Ecore_WinCE_Callback_Data *msg);
81void _ecore_wince_event_handle_unmap_notify(Ecore_WinCE_Callback_Data *msg);
82void _ecore_wince_event_handle_delete_request(Ecore_WinCE_Callback_Data *msg);
83
84
85#endif /* __ECORE_WINCE_PRIVATE_H__ */
diff --git a/src/lib/ecore_wince/ecore_wince_window.c b/src/lib/ecore_wince/ecore_wince_window.c
deleted file mode 100644
index 49a6312da3..0000000000
--- a/src/lib/ecore_wince/ecore_wince_window.c
+++ /dev/null
@@ -1,827 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#define WIN32_LEAN_AND_MEAN
6#include <windows.h>
7#undef WIN32_LEAN_AND_MEAN
8
9#include <Evil.h>
10#include <Eina.h>
11
12#include "Ecore_WinCE.h"
13#include "ecore_wince_private.h"
14
15/*============================================================================*
16 * Local *
17 *============================================================================*/
18
19/**
20 * @cond LOCAL
21 */
22
23
24typedef BOOL (__stdcall *UnregisterFunc1Proc)(UINT, UINT);
25
26static int
27_ecore_wince_hardware_keys_register(HWND window)
28{
29 HINSTANCE core_dll;
30 UnregisterFunc1Proc unregister_fct;
31 int i;
32
33 core_dll = LoadLibrary(L"coredll.dll");
34 if (!core_dll)
35 {
36 ERR("LoadLibrary() failed");
37 return 0;
38 }
39
40 unregister_fct = (UnregisterFunc1Proc)GetProcAddress(core_dll, L"UnregisterFunc1");
41 if (!unregister_fct)
42 {
43 ERR("GetProcAddress() failed");
44 FreeLibrary(core_dll);
45 return 0;
46 }
47
48 for (i = 0xc1; i <= 0xcf; i++)
49 {
50 unregister_fct(MOD_WIN, i);
51 RegisterHotKey(window, i, MOD_WIN, i);
52 }
53
54 FreeLibrary(core_dll);
55
56 return 1;
57}
58
59/**
60 * @endcond
61 */
62
63
64/*============================================================================*
65 * Global *
66 *============================================================================*/
67
68/*============================================================================*
69 * API *
70 *============================================================================*/
71
72/**
73 * @addtogroup Ecore_WinCE_Group Ecore_WinCE library
74 *
75 * @{
76 */
77
78/**
79 * @brief Creates a new window.
80 *
81 * @param parent The parent window.
82 * @param x The x coordinate of the top-left corner of the window.
83 * @param y The y coordinate of the top-left corner of the window.
84 * @param width The width of the window.
85 * @param height The height of hte window.
86 * @return A newly allocated window.
87 *
88 * This function creates a new window which parent is @p parent. @p width and
89 * @p height are the size of the window content (the client part),
90 * without the border and title bar. @p x and @p y are the system
91 * coordinates of the top left cerner of the window (that is, of the
92 * title bar). This function returns a newly created window on
93 * success, and @c NULL on failure.
94 */
95EAPI Ecore_WinCE_Window *
96ecore_wince_window_new(Ecore_WinCE_Window *parent,
97 int x,
98 int y,
99 int width,
100 int height)
101{
102 Ecore_WinCE_Window *w;
103 HWND window;
104 RECT rect;
105
106 INF("creating window");
107
108 w = (Ecore_WinCE_Window *)calloc(1, sizeof(Ecore_WinCE_Window));
109 if (!w)
110 {
111 ERR("malloc() failed");
112 return NULL;
113 }
114
115 rect.left = 0;
116 rect.top = 0;
117 rect.right = width;
118 rect.bottom = height;
119 if (!AdjustWindowRectEx(&rect, WS_CAPTION | WS_SYSMENU | WS_VISIBLE, FALSE, WS_EX_TOPMOST))
120 {
121 ERR("AdjustWindowRectEx() failed");
122 free(w);
123 return NULL;
124 }
125
126 window = CreateWindowEx(WS_EX_TOPMOST,
127 ECORE_WINCE_WINDOW_CLASS,
128 L"",
129 WS_CAPTION | WS_SYSMENU | WS_VISIBLE,
130 x, y,
131 rect.right - rect.left, rect.bottom - rect.top,
132 parent ? ((Ecore_WinCE_Window *)parent)->window : NULL,
133 NULL, _ecore_wince_instance, NULL);
134 if (!window)
135 {
136 ERR("CreateWindowEx() failed");
137 free(w);
138 return NULL;
139 }
140
141 if (!_ecore_wince_hardware_keys_register(window))
142 {
143 ERR("_ecore_wince_hardware_keys_register() failed");
144 DestroyWindow(window);
145 free(w);
146 return NULL;
147 }
148
149 w->window = window;
150
151 SetLastError(0);
152 if (!SetWindowLong(window, GWL_USERDATA, (LONG)w) && (GetLastError() != 0))
153 {
154 ERR("SetWindowLong() failed");
155 DestroyWindow(window);
156 free(w);
157 return NULL;
158 }
159
160 w->pointer_is_in = 0;
161
162 return w;
163}
164
165/**
166 * @brief Free the given window.
167 *
168 * @param window The window to free.
169 *
170 * This function frees @p window. If @p window is @c NULL, this
171 * function does nothing.
172 */
173EAPI void
174ecore_wince_window_free(Ecore_WinCE_Window *window)
175{
176 if (!window) return;
177
178 INF("destroying window");
179
180 DestroyWindow(window->window);
181 free(window);
182}
183
184/**
185 * @brief Return the window HANDLE associated to the given window.
186 *
187 * @param window The window to retrieve the HANDLE from.
188 *
189 * This function returns the window HANDLE associated to @p window. If
190 * @p window is @c NULL, this function returns @c NULL.
191 */
192EAPI void *
193ecore_wince_window_hwnd_get(Ecore_WinCE_Window *window)
194{
195 if (!window)
196 return NULL;
197
198 return window->window;
199}
200
201/**
202 * @brief Move the given window to a given position.
203 *
204 * @param window The window to move.
205 * @param x The x coordinate of the destination position.
206 * @param y The y coordinate of the destination position.
207 *
208 * This function move @p window to the new position of coordinates @p x
209 * and @p y. If @p window is @c NULL, or if it is fullscreen, or on
210 * error, this function does nothing.
211 */
212EAPI void
213ecore_wince_window_move(Ecore_WinCE_Window *window,
214 int x,
215 int y)
216{
217 RECT rect;
218
219 if (!window || window->fullscreen)
220 return;
221
222 INF("moving window (%dx%d)", x, y);
223
224 if (!GetWindowRect(window->window, &rect))
225 {
226 ERR("GetWindowRect() failed");
227 return;
228 }
229
230 if (!MoveWindow(window->window, x, y,
231 rect.right - rect.left,
232 rect.bottom - rect.top,
233 TRUE))
234 {
235 ERR("MoveWindow() failed");
236 }
237}
238
239/**
240 * @brief Resize the given window to a given size.
241 *
242 * @param window The window to resize.
243 * @param width The new width.
244 * @param height The new height.
245 *
246 * This function resize @p window to the new @p width and @p height.
247 * If @p window is @c NULL, or if it is fullscreen, or on error, this
248 * function does nothing.
249 */
250EAPI void
251ecore_wince_window_resize(Ecore_WinCE_Window *window,
252 int width,
253 int height)
254{
255 RECT rect;
256 DWORD style;
257 DWORD exstyle;
258 int x;
259 int y;
260
261 if (!window || window->fullscreen)
262 return;
263
264 INF("resizing window (%dx%d)", width, height);
265
266 if (!GetWindowRect(window->window, &rect))
267 {
268 ERR("GetWindowRect() failed");
269 return;
270 }
271
272 x = rect.left;
273 y = rect.top;
274 rect.left = 0;
275 rect.top = 0;
276 rect.right = width;
277 rect.bottom = height;
278 if (!(style = GetWindowLong(window->window, GWL_STYLE)))
279 {
280 ERR("GetWindowLong() failed");
281 return;
282 }
283 if (!(exstyle = GetWindowLong(window->window, GWL_EXSTYLE)))
284 {
285 ERR("GetWindowLong() failed");
286 return;
287 }
288 if (!AdjustWindowRectEx(&rect, style, FALSE, exstyle))
289 {
290 ERR("AdjustWindowRectEx() failed");
291 return;
292 }
293
294 if (!MoveWindow(window->window, x, y,
295 rect.right - rect.left,
296 rect.bottom - rect.top,
297 FALSE))
298 {
299 ERR("MoveWindow() failed");
300 }
301}
302
303/**
304 * @brief Move and resize the given window to a given position and size.
305 *
306 * @param window The window to move and resize.
307 * @param x The x coordinate of the destination position.
308 * @param y The x coordinate of the destination position.
309 * @param width The new width.
310 * @param height The new height.
311 *
312 * This function resize @p window to the new position of coordinates @p x
313 * and @p y and the new @p width and @p height. If @p window is @c NULL,
314 * or if it is fullscreen, or on error, this function does nothing.
315 */
316EAPI void
317ecore_wince_window_move_resize(Ecore_WinCE_Window *window,
318 int x,
319 int y,
320 int width,
321 int height)
322{
323 RECT rect;
324 DWORD style;
325 DWORD exstyle;
326
327 if (!window || window->fullscreen)
328 return;
329
330 INF("moving and resizing window (%dx%d %dx%d)", x, y, width, height);
331
332 rect.left = 0;
333 rect.top = 0;
334 rect.right = width;
335 rect.bottom = height;
336 if (!(style = GetWindowLong(window->window, GWL_STYLE)))
337 {
338 ERR("GetWindowLong() failed");
339 return;
340 }
341 if (!(exstyle = GetWindowLong(window->window, GWL_EXSTYLE)))
342 {
343 ERR("GetWindowLong() failed");
344 return;
345 }
346 if (!AdjustWindowRectEx(&rect, style, FALSE, exstyle))
347 {
348 ERR("AdjustWindowRectEx() failed");
349 return;
350 }
351
352 if (!MoveWindow(window->window, x, y,
353 rect.right - rect.left,
354 rect.bottom - rect.top,
355 TRUE))
356 {
357 ERR("MoveWindow() failed");
358 }
359}
360
361/**
362 * @brief Show the given window.
363 *
364 * @param window The window to show.
365 *
366 * This function shows @p window. If @p window is @c NULL, or on
367 * error, this function does nothing.
368 */
369EAPI void
370ecore_wince_window_show(Ecore_WinCE_Window *window)
371{
372 if (!window) return;
373
374 INF("showing window");
375
376 if (!ShowWindow(window->window, SW_SHOWNORMAL))
377 {
378 ERR("ShowWindow() failed");
379 return;
380 }
381 if (!UpdateWindow(window->window))
382 {
383 ERR("UpdateWindow() failed");
384 }
385 if (!SendMessage(window->window, WM_SHOWWINDOW, 1, 0))
386 {
387 ERR("SendMessage() failed");
388 }
389}
390
391/**
392 * @brief Hide the given window.
393 *
394 * @param window The window to show.
395 *
396 * This function hides @p window. If @p window is @c NULL, or on
397 * error, this function does nothing.
398 */
399EAPI void
400ecore_wince_window_hide(Ecore_WinCE_Window *window)
401{
402 if (!window) return;
403
404 INF("hiding window");
405
406 if (!ShowWindow(window->window, SW_HIDE))
407 {
408 ERR("ShowWindow() failed");
409 return;
410 }
411 if (!SendMessage(window->window, WM_SHOWWINDOW, 0, 0))
412 {
413 ERR("SendMessage() failed");
414 }
415}
416
417/**
418 * @brief Set the title of the given window.
419 *
420 * @param window The window to set the title.
421 * @param title The new title.
422 *
423 * This function sets the title of @p window to @p title. If @p window
424 * is @c NULL, or if @p title is @c NULL or empty, or on error, this
425 * function does nothing.
426 */
427EAPI void
428ecore_wince_window_title_set(Ecore_WinCE_Window *window,
429 const char *title)
430{
431 wchar_t *wtitle;
432
433 if (!window) return;
434
435 if (!title || !title[0]) return;
436
437 INF("setting window title");
438
439 wtitle = evil_char_to_wchar(title);
440 if (!wtitle) return;
441
442 if (!SetWindowText(window->window, wtitle))
443 {
444 ERR("SetWindowText() failed");
445 }
446 free(wtitle);
447}
448
449/**
450 * @brief Set the focus to the given window.
451 *
452 * @param window The window to give focus to.
453 *
454 * This function gives the focus to @p window. If @p window is
455 * @c NULL, this function does nothing.
456 */
457EAPI void
458ecore_wince_window_focus(Ecore_WinCE_Window *window)
459{
460 if (!window) return;
461
462 INF("focusing window");
463
464 if (!SetFocus(window->window))
465 {
466 ERR("SetFocus() failed");
467 }
468}
469
470/**
471 * @brief Get the current focused window.
472 *
473 * @return The window that has focus.
474 *
475 * This function returns the window that has focus. If the calling
476 * thread's message queue does not have an associated window with the
477 * keyboard focus, the return value is @c NULL.
478 *
479 * @note Even if the returned value is @c NULL, another thread's queue
480 * may be associated with a window that has the keyboard focus.
481 *
482 * @note The returned value is of type HWND.
483 */
484EAPI void *
485ecore_wince_window_focus_get(void)
486{
487 HWND focused;
488
489 INF("getting focused window");
490
491 focused = GetFocus();
492 if (!focused)
493 {
494 ERR("GetFocus() failed");
495 return NULL;
496 }
497
498 return focused;
499}
500
501/**
502 * @brief Set the graphic backend used for the given window.
503 *
504 * @param window The window.
505 * @param backend The backend.
506 *
507 * This function sets the graphic backend to use with @p window to
508 * @p backend. If @p window if @c NULL, this function does nothing.
509 *
510 * The valid values for @p backend are
511 *
512 * @li 0: automatic choice of the backend.
513 * @li 1: the framebuffer (fast but could be not well suported).
514 * @li 2: GAPI (less fast but almost always supported).
515 * @li 3: DirectDraw (less fast than GAPI but almost always
516 * supported).
517 * @li 4: GDI (the slowest but always supported).
518 *
519 * The @p backend is used only in Evas and Ecore_Evas. So this
520 * function should not be called if Ecore_Evas is used.
521 */
522EAPI void
523ecore_wince_window_backend_set(Ecore_WinCE_Window *window,
524 int backend)
525{
526 if (!window)
527 return;
528
529 INF("setting backend");
530
531 window->backend = backend;
532}
533
534/**
535 * @brief Set the suspend callback used for the given window.
536 *
537 * @param window The window.
538 * @param suspend_cb The suspend callback.
539 *
540 * This function sets the suspend callback to use with @p window to
541 * @p suspend_cb. If @p window if @c NULL, this function does nothing.
542 *
543 * The @p suspend_cb is used only in Evas and Ecore_Evas. So this
544 * function should not be called if Ecore_Evas is used.
545 */
546EAPI void
547ecore_wince_window_suspend_cb_set(Ecore_WinCE_Window *window, int (*suspend_cb)(int))
548{
549 if (!window)
550 return;
551
552 INF("setting suspend callback");
553
554 window->suspend_cb = suspend_cb;
555}
556
557/**
558 * @brief Set the resume callback used for the given window.
559 *
560 * @param window The window.
561 * @param resume_cb The resume callback.
562 *
563 * This function sets the resume callback to use with @p window to
564 * @p resume_cb. If @p window if @c NULL, this function does nothing.
565 *
566 * The @p resume_cb is used only in Evas and Ecore_Evas. So this
567 * function should not be called if Ecore_Evas is used.
568 */
569EAPI void
570ecore_wince_window_resume_cb_set(Ecore_WinCE_Window *window, int (*resume_cb)(int))
571{
572 if (!window)
573 return;
574
575 INF("setting resume callback");
576
577 window->resume_cb = resume_cb;
578}
579
580/**
581 * @brief Get the geometry of the given window.
582 *
583 * @param window The window to retrieve the geometry from.
584 * @param x The x coordinate of the position.
585 * @param y The x coordinate of the position.
586 * @param width The width.
587 * @param height The height.
588 *
589 * This function retrieves the position and size of @p window. @p x,
590 * @p y, @p width and @p height can be buffers that will be filled with
591 * the corresponding values. If one of them is @c NULL, nothing will
592 * be done for that parameter. If @p window is @c NULL, and if the
593 * buffers are not @c NULL, they will be filled with respectively 0,
594 * 0, the size of the screen and the height of the screen.
595 */
596EAPI void
597ecore_wince_window_geometry_get(Ecore_WinCE_Window *window,
598 int *x,
599 int *y,
600 int *width,
601 int *height)
602{
603 RECT rect;
604 int w;
605 int h;
606
607 INF("getting window geometry");
608
609 if (!window)
610 {
611 if (x) *x = 0;
612 if (y) *y = 0;
613 if (width) *width = GetSystemMetrics(SM_CXSCREEN);
614 if (height) *height = GetSystemMetrics(SM_CYSCREEN);
615
616 return;
617 }
618
619 if (!GetClientRect(window->window, &rect))
620 {
621 ERR("GetClientRect() failed");
622
623 if (x) *x = 0;
624 if (y) *y = 0;
625 if (width) *width = 0;
626 if (height) *height = 0;
627
628 return;
629 }
630
631 w = rect.right - rect.left;
632 h = rect.bottom - rect.top;
633
634 if (!GetWindowRect(window->window, &rect))
635 {
636 ERR("GetWindowRect() failed");
637
638 if (x) *x = 0;
639 if (y) *y = 0;
640 if (width) *width = 0;
641 if (height) *height = 0;
642
643 return;
644 }
645
646 if (x) *x = rect.left;
647 if (y) *y = rect.top;
648 if (width) *width = w;
649 if (height) *height = h;
650}
651
652/**
653 * @brief Get the size of the given window.
654 *
655 * @param window The window to retrieve the size from.
656 * @param width The width.
657 * @param height The height.
658 *
659 * This function retrieves the size of @p window. @p width and
660 * @p height can be buffers that will be filled with the corresponding
661 * values. If one of them is @c NULL, nothing will be done for that
662 * parameter. If @p window is @c NULL, and if the buffers are not
663 * @c NULL, they will be filled with respectively the size of the screen
664 * and the height of the screen.
665 */
666EAPI void
667ecore_wince_window_size_get(Ecore_WinCE_Window *window,
668 int *width,
669 int *height)
670{
671 RECT rect;
672
673 INF("getting window size");
674
675 if (!window)
676 {
677 if (width) *width = GetSystemMetrics(SM_CXSCREEN);
678 if (height) *height = GetSystemMetrics(SM_CYSCREEN);
679
680 return;
681 }
682
683 if (!GetClientRect(window->window, &rect))
684 {
685 ERR("GetClientRect() failed");
686
687 if (width) *width = 0;
688 if (height) *height = 0;
689 }
690
691 if (width) *width = rect.right - rect.left;
692 if (height) *height = rect.bottom - rect.top;
693}
694
695/**
696 * @brief Set the given window to fullscreen.
697 *
698 * @param window The window.
699 * @param on @c EINA_TRUE for fullscreen mode, @c EINA_FALSE for windowed mode.
700 *
701 * This function set @p window to fullscreen or windowed mode. If @p on is set
702 * to @c EINA_TRUE, the window will be fullscreen, if it is set to
703 * @c EINA_FALSE, it will be windowed. If @p window is @c NULL or if the state
704 * does not change (like setting to fullscreen while the window is already
705 * fullscreen), this function does nothing.
706 */
707EAPI void
708ecore_wince_window_fullscreen_set(Ecore_WinCE_Window *window,
709 Eina_Bool on)
710{
711 HWND task_bar;
712
713 if (!window) return;
714
715 if (((window->fullscreen) && (on)) ||
716 ((!window->fullscreen) && (!on)))
717 return;
718
719 INF("setting fullscreen: %s", on ? "yes" : "no");
720
721 window->fullscreen = !!on;
722
723 if (on)
724 {
725 /* save the position and size of the window */
726 if (!GetWindowRect(window->window, &window->rect))
727 {
728 ERR("GetWindowRect() failed");
729 return;
730 }
731
732 /* hide task bar */
733 task_bar = FindWindow(L"HHTaskBar", NULL);
734 if (!task_bar)
735 {
736 INF("FindWindow(): can not find task bar");
737 }
738 if (!ShowWindow(task_bar, SW_HIDE))
739 {
740 INF("ShowWindow(): task bar already hidden");
741 }
742 if (!EnableWindow(task_bar, FALSE))
743 {
744 INF("EnableWindow(): input already disabled");
745 }
746
747 /* style: visible + popup */
748 if (!SetWindowLong(window->window, GWL_STYLE, WS_POPUP | WS_VISIBLE))
749 {
750 INF("SetWindowLong() failed");
751 }
752
753 /* resize window to fit the entire screen */
754 if (!SetWindowPos(window->window, HWND_TOPMOST,
755 0, 0,
756 GetSystemMetrics(SM_CXSCREEN),
757 GetSystemMetrics(SM_CYSCREEN),
758 SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED))
759 {
760 INF("SetWindowPos() failed");
761 }
762 /*
763 * It seems that SetWindowPos is not sufficient.
764 * Call MoveWindow with the correct size and force painting.
765 * Note that UpdateWindow (forcing repainting) is not sufficient
766 */
767 if (!MoveWindow(window->window,
768 0, 0,
769 GetSystemMetrics(SM_CXSCREEN),
770 GetSystemMetrics(SM_CYSCREEN),
771 TRUE))
772 {
773 INF("MoveWindow() failed");
774 }
775 }
776 else
777 {
778 /* show task bar */
779 task_bar = FindWindow(L"HHTaskBar", NULL);
780 if (!task_bar)
781 {
782 INF("FindWindow(): can not find task bar");
783 }
784 if (!ShowWindow(task_bar, SW_SHOW))
785 {
786 INF("ShowWindow(): task bar already visible");
787 }
788 if (!EnableWindow(task_bar, TRUE))
789 {
790 INF("EnableWindow(): input already enabled");
791 }
792
793 /* style: visible + caption + sysmenu */
794 if (!SetWindowLong(window->window, GWL_STYLE, WS_CAPTION | WS_SYSMENU | WS_VISIBLE))
795 {
796 INF("SetWindowLong() failed");
797 }
798 /* restaure the position and size of the window */
799 if (!SetWindowPos(window->window, HWND_TOPMOST,
800 window->rect.left,
801 window->rect.top,
802 window->rect.right - window->rect.left,
803 window->rect.bottom - window->rect.top,
804 SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED))
805 {
806 INF("SetWindowLong() failed");
807 }
808 /*
809 * It seems that SetWindowPos is not sufficient.
810 * Call MoveWindow with the correct size and force painting.
811 * Note that UpdateWindow (forcing repainting) is not sufficient
812 */
813 if (!MoveWindow(window->window,
814 window->rect.left,
815 window->rect.top,
816 window->rect.right - window->rect.left,
817 window->rect.bottom - window->rect.top,
818 TRUE))
819 {
820 INF("MoveWindow() failed");
821 }
822 }
823}
824
825/**
826 * @}
827 */
diff --git a/src/lib/eina/eina_inline_lock_wince.x b/src/lib/eina/eina_inline_lock_wince.x
deleted file mode 100644
index 95374d57a6..0000000000
--- a/src/lib/eina/eina_inline_lock_wince.x
+++ /dev/null
@@ -1,261 +0,0 @@
1/* EINA - EFL data type library
2 * Copyright (C) 2011 Vincent Torri
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library;
16 * if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef EINA_INLINE_LOCK_WIN32_X_
20#define EINA_INLINE_LOCK_WIN32_X_
21
22#ifndef WIN32_LEAN_AND_MEAN
23# define WIN32_LEAN_AND_MEAN
24#endif
25#include <windows.h>
26#undef WIN32_LEAN_AND_MEAN
27
28EAPI extern Eina_Bool _threads_activated;
29EAPI extern Eina_Bool _eina_thread_tls_cb_register(Eina_TLS key, Eina_TLS_Delete_Cb cb);
30EAPI extern Eina_Bool _eina_thread_tls_cb_unregister(Eina_TLS key);
31EAPI extern Eina_Bool _eina_thread_tls_key_add(Eina_TLS key);
32
33/** @privatesection @{ */
34typedef HANDLE Eina_Lock;
35typedef Eina_Lock Eina_Spinlock;
36typedef Eina_Lock Eina_RWLock;
37typedef DWORD Eina_TLS;
38typedef void * Eina_Semaphore;
39/** @} privatesection */
40
41static inline Eina_Bool
42eina_lock_new(Eina_Lock *mutex)
43{
44 Eina_Lock m;
45
46 m = CreateMutex(NULL, FALSE, NULL);
47 if (m) *mutex = m;
48 return (m != NULL);
49}
50
51static inline void
52eina_lock_free(Eina_Lock *mutex)
53{
54 CloseHandle(*mutex);
55}
56
57static inline Eina_Lock_Result
58eina_lock_take(Eina_Lock *mutex)
59{
60 DWORD res;
61
62#ifdef EINA_HAVE_ON_OFF_THREADS
63 if (!_eina_threads_activated) return EINA_LOCK_FAIL;
64#endif
65
66 res = WaitForSingleObject(*mutex, INFINITE);
67 if ((res == WAIT_ABANDONED) || (res == WAIT_FAILED))
68 return EINA_LOCK_FAIL;
69
70 return EINA_LOCK_SUCCEED;
71}
72
73static inline Eina_Lock_Result
74eina_lock_take_try(Eina_Lock *mutex)
75{
76 return eina_lock_take(*mutex);
77}
78
79static inline Eina_Lock_Result
80eina_lock_release(Eina_Lock *mutex)
81{
82#ifdef EINA_HAVE_ON_OFF_THREADS
83 if (!_eina_threads_activated) return ;
84#endif
85
86 return ReleaseMutex(*mutex) ? EINA_LOCK_SUCCEED : EINA_LOCK_FAIL;
87}
88
89static inline void
90eina_lock_debug(const Eina_Lock *mutex)
91{
92}
93
94static inline Eina_Bool
95eina_condition_new(Eina_Condition *cond, Eina_Lock *mutex)
96{
97 return EINA_FALSE;
98}
99
100static inline void
101eina_condition_free(Eina_Condition *cond)
102{
103}
104
105static inline Eina_Bool
106eina_condition_wait(Eina_Condition *cond)
107{
108 return EINA_FALSE;
109}
110
111static inline Eina_Bool
112eina_condition_timedwait(Eina_Condition *cond, double t)
113{
114 return EINA_FALSE;
115}
116
117static inline Eina_Bool
118eina_condition_broadcast(Eina_Condition *cond)
119{
120 return EINA_FALSE;
121}
122
123static inline Eina_Bool
124eina_condition_signal(Eina_Condition *cond)
125{
126 return EINA_FALSE;
127}
128
129static inline Eina_Bool
130eina_rwlock_new(Eina_RWLock *mutex)
131{
132 return eina_lock_new(mutex);
133}
134
135static inline void
136eina_rwlock_free(Eina_RWLock *mutex)
137{
138 return eina_lock_free(mutex);
139}
140
141static inline Eina_Lock_Result
142eina_rwlock_take_read(Eina_RWLock *mutex)
143{
144 return eina_lock_take(mutex);
145}
146
147static inline Eina_Lock_Result
148eina_rwlock_take_write(Eina_RWLock *mutex)
149{
150 return eina_lock_take(mutex);
151}
152
153static inline Eina_Lock_Result
154eina_rwlock_release(Eina_RWLock *mutex)
155{
156 return eina_lock_release(mutex);
157}
158
159static inline Eina_Bool
160eina_tls_cb_new(Eina_TLS *key, Eina_TLS_Delete_Cb delete_cb)
161{
162 if ((*key = TlsAlloc()) == TLS_OUT_OF_INDEXES)
163 return EINA_FALSE;
164 if (delete_cb)
165 {
166 if (!_eina_thread_tls_cb_register(*key, delete_cb))
167 {
168 TlsFree(*key);
169 return EINA_FALSE;
170 }
171 }
172 return EINA_TRUE;
173}
174
175static inline Eina_Bool
176eina_tls_new(Eina_TLS *key)
177{
178 return eina_tls_cb_new(key, NULL);
179}
180
181static inline void
182eina_tls_free(Eina_TLS key)
183{
184 _eina_thread_tls_cb_unregister(key);
185 TlsFree(key);
186}
187
188static inline void *
189eina_tls_get(Eina_TLS key)
190{
191 return (void*)TlsGetValue(key);
192}
193
194static inline Eina_Bool
195eina_tls_set(Eina_TLS key, const void *data)
196{
197 if (TlsSetValue(key, (LPVOID)data) == 0)
198 return EINA_FALSE;
199 _eina_thread_tls_key_add(key);
200 return EINA_TRUE;
201}
202
203static inline Eina_Bool
204eina_semaphore_new(Eina_Semaphore *sem EINA_UNUSED,
205 int count_init EINA_UNUSED)
206{
207 return EINA_FALSE;
208}
209
210static inline Eina_Bool
211eina_semaphore_free(Eina_Semaphore *sem EINA_UNUSED)
212{
213 return EINA_FALSE;
214}
215
216static inline Eina_Bool
217eina_semaphore_lock(Eina_Semaphore *sem EINA_UNUSED)
218{
219 return EINA_FALSE;
220}
221
222static inline Eina_Bool
223eina_semaphore_release(Eina_Semaphore *sem EINA_UNUSED,
224 int count_release EINA_UNUSED)
225{
226 return EINA_FALSE;
227}
228
229static inline Eina_Bool
230eina_spinlock_new(Eina_Spinlock *spinlock)
231{
232 return eina_lock_new(spinlock);
233}
234
235static inline void
236eina_spinlock_free(Eina_Spinlock *spinlock)
237{
238 eina_lock_free(spinlock);
239}
240
241static inline Eina_Lock_Result
242eina_spinlock_take(Eina_Spinlock *spinlock)
243{
244 return eina_lock_take(spinlock);
245}
246
247static inline Eina_Lock_Result
248eina_spinlock_take_try(Eina_Spinlock *spinlock)
249{
250 return eina_lock_take_try(spinlock);
251}
252
253static inline Eina_Lock_Result
254eina_spinlock_release(Eina_Spinlock *spinlock)
255{
256 return eina_lock_release(spinlock);
257}
258
259#include "eina_inline_lock_barrier.x"
260
261#endif
diff --git a/src/lib/eina/eina_lock.h b/src/lib/eina/eina_lock.h
index d0f2e3154a..3aa49e25e5 100644
--- a/src/lib/eina/eina_lock.h
+++ b/src/lib/eina/eina_lock.h
@@ -106,9 +106,7 @@ typedef enum
106/** Type definition for deallocation callbacks for thread level sotrage data. A simple function pointer. */ 106/** Type definition for deallocation callbacks for thread level sotrage data. A simple function pointer. */
107typedef void (*Eina_TLS_Delete_Cb)(void *ptr); 107typedef void (*Eina_TLS_Delete_Cb)(void *ptr);
108 108
109#ifdef _WIN32_WCE 109#ifdef _WIN32
110# include "eina_inline_lock_wince.x"
111#elif defined(_WIN32)
112# include "eina_inline_lock_win32.x" 110# include "eina_inline_lock_win32.x"
113#else 111#else
114# include "eina_inline_lock_posix.x" 112# include "eina_inline_lock_posix.x"
diff --git a/src/lib/eina/eina_log.c b/src/lib/eina/eina_log.c
index 140816d989..f3d6345551 100644
--- a/src/lib/eina/eina_log.c
+++ b/src/lib/eina/eina_log.c
@@ -427,10 +427,7 @@ eina_log_print_prefix_NOthreads_color_file_func(FILE *fp,
427 int line) 427 int line)
428{ 428{
429 DECLARE_LEVEL_NAME_COLOR(level); 429 DECLARE_LEVEL_NAME_COLOR(level);
430#ifdef _WIN32_WCE 430#ifdef _WIN32
431 fprintf(fp, "%s<%u>:%s %s:%d %s() ", name, eina_log_pid_get(),
432 d->domain_str, file, line, fnc);
433#elif _WIN32
434 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 431 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
435 color); 432 color);
436 fprintf(fp, "%s", name); 433 fprintf(fp, "%s", name);
@@ -468,10 +465,7 @@ eina_log_print_prefix_NOthreads_color_NOfile_func(FILE *fp,
468 int line EINA_UNUSED) 465 int line EINA_UNUSED)
469{ 466{
470 DECLARE_LEVEL_NAME_COLOR(level); 467 DECLARE_LEVEL_NAME_COLOR(level);
471#ifdef _WIN32_WCE 468#ifdef _WIN32
472 fprintf(fp, "%s<%u>:%s %s() ", name, eina_log_pid_get(), d->domain_str,
473 fnc);
474#elif _WIN32
475 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 469 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
476 color); 470 color);
477 fprintf(fp, "%s", name); 471 fprintf(fp, "%s", name);
@@ -506,10 +500,7 @@ eina_log_print_prefix_NOthreads_color_file_NOfunc(FILE *fp,
506 int line) 500 int line)
507{ 501{
508 DECLARE_LEVEL_NAME_COLOR(level); 502 DECLARE_LEVEL_NAME_COLOR(level);
509#ifdef _WIN32_WCE 503#ifdef _WIN32
510 fprintf(fp, "%s<%u>:%s %s:%d ", name, eina_log_pid_get(), d->domain_str,
511 file, line);
512#elif _WIN32
513 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 504 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
514 color); 505 color);
515 fprintf(fp, "%s", name); 506 fprintf(fp, "%s", name);
diff --git a/src/lib/eina/eina_main.c b/src/lib/eina/eina_main.c
index 808e02e913..fc54e02fc2 100644
--- a/src/lib/eina/eina_main.c
+++ b/src/lib/eina/eina_main.c
@@ -117,7 +117,7 @@ static int _mt_enabled = 0;
117 117
118#ifdef EFL_HAVE_THREADS 118#ifdef EFL_HAVE_THREADS
119EAPI int _eina_threads_debug = 0; 119EAPI int _eina_threads_debug = 0;
120# if !defined(_WIN32_WCE) && !defined(_WIN32) 120# if !defined(_WIN32)
121EAPI pthread_mutex_t _eina_tracking_lock; 121EAPI pthread_mutex_t _eina_tracking_lock;
122EAPI Eina_Inlist *_eina_tracking = NULL; 122EAPI Eina_Inlist *_eina_tracking = NULL;
123# endif 123# endif
diff --git a/src/lib/evas/canvas/evas_object_box.c b/src/lib/evas/canvas/evas_object_box.c
index 00e7c4afdf..ecdcf46b99 100644
--- a/src/lib/evas/canvas/evas_object_box.c
+++ b/src/lib/evas/canvas/evas_object_box.c
@@ -1,10 +1,6 @@
1#include "evas_common_private.h" 1#include "evas_common_private.h"
2#include "evas_private.h" 2#include "evas_private.h"
3 3
4#ifdef _WIN32_WCE
5# undef remove
6#endif
7
8#define MY_CLASS_NAME "Evas_Box" 4#define MY_CLASS_NAME "Evas_Box"
9#define MY_CLASS_NAME_LEGACY "Evas_Object_Box" 5#define MY_CLASS_NAME_LEGACY "Evas_Object_Box"
10 6
diff --git a/src/lib/evas/file/evas_path.c b/src/lib/evas/file/evas_path.c
index 6d78218dc4..cc0703abd2 100644
--- a/src/lib/evas/file/evas_path.c
+++ b/src/lib/evas/file/evas_path.c
@@ -35,9 +35,7 @@ int
35evas_file_path_is_full_path(const char *path) 35evas_file_path_is_full_path(const char *path)
36{ 36{
37 if (!path) return 0; 37 if (!path) return 0;
38#if defined _WIN32_WCE 38#ifdef _WIN32
39 if (path[0] == '\\') return 1;
40#elif defined _WIN32
41 if (evil_path_is_absolute(path)) return 1; 39 if (evil_path_is_absolute(path)) return 1;
42#else 40#else
43 if (path[0] == '/') return 1; 41 if (path[0] == '/') return 1;
diff --git a/src/lib/evil/Evil.h b/src/lib/evil/Evil.h
index 57efe1d7d9..ac5f321c29 100644
--- a/src/lib/evil/Evil.h
+++ b/src/lib/evil/Evil.h
@@ -137,12 +137,6 @@ typedef SSIZE_T ssize_t;
137 137
138#endif /* _MSC_VER */ 138#endif /* _MSC_VER */
139 139
140#ifdef _WIN32_WCE
141# ifndef offsetof
142# define offsetof(type, ident) ((size_t)&(((type*)0)->ident))
143# endif
144#endif
145
146typedef unsigned long uid_t; 140typedef unsigned long uid_t;
147typedef unsigned long gid_t; 141typedef unsigned long gid_t;
148 142
diff --git a/src/lib/evil/dlfcn.c b/src/lib/evil/dlfcn.c
index 823398c934..fec541ec19 100644
--- a/src/lib/evil/dlfcn.c
+++ b/src/lib/evil/dlfcn.c
@@ -4,9 +4,9 @@
4 4
5#include <stdlib.h> 5#include <stdlib.h>
6 6
7#if defined(__MINGW32CE__) || defined(_MSC_VER) 7#ifdef _MSC_VER
8# include <limits.h> 8# include <limits.h>
9#endif /* __MINGW32CE__ || _MSC_VER */ 9#endif /* _MSC_VER */
10 10
11#ifndef WIN32_LEAN_AND_MEAN 11#ifndef WIN32_LEAN_AND_MEAN
12# define WIN32_LEAN_AND_MEAN 12# define WIN32_LEAN_AND_MEAN
@@ -14,11 +14,7 @@
14#include <windows.h> 14#include <windows.h>
15#undef WIN32_LEAN_AND_MEAN 15#undef WIN32_LEAN_AND_MEAN
16 16
17#ifdef _WIN32_WCE 17#include <psapi.h> /* EnumProcessModules(Ex) */
18# include <tlhelp32.h> /* CreateToolhelp32Snapshot */
19#else
20# include <psapi.h> /* EnumProcessModules(Ex) */
21#endif
22 18
23#include "Evil.h" 19#include "Evil.h"
24#include "evil_private.h" 20#include "evil_private.h"
@@ -141,26 +137,6 @@ dlsym(void *handle, const char *symbol)
141 137
142 if (handle == RTLD_DEFAULT) 138 if (handle == RTLD_DEFAULT)
143 { 139 {
144#ifdef _WIN32_WCE
145 HANDLE snapshot;
146 MODULEENTRY32 module;
147
148 snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS |
149 TH32CS_SNAPMODULE |
150 TH32CS_GETALLMODS,
151 0);
152 if (!snapshot)
153 return NULL;
154
155 module.dwSize = sizeof(module);
156 if (Module32First(snapshot, &module))
157 do {
158 fp = GetProcAddress(module.hModule, new_symbol);
159 if (fp) break;
160 } while (Module32Next(snapshot, &module));
161
162 CloseToolhelp32Snapshot(snapshot);
163#else
164 HMODULE modules[1024]; 140 HMODULE modules[1024];
165 DWORD needed; 141 DWORD needed;
166 DWORD i; 142 DWORD i;
@@ -175,7 +151,6 @@ dlsym(void *handle, const char *symbol)
175 fp = GetProcAddress(modules[i], new_symbol); 151 fp = GetProcAddress(modules[i], new_symbol);
176 if (fp) break; 152 if (fp) break;
177 } 153 }
178#endif
179 } 154 }
180 else 155 else
181 fp = GetProcAddress(handle, new_symbol); 156 fp = GetProcAddress(handle, new_symbol);
@@ -202,7 +177,6 @@ dladdr (const void *addr EVIL_UNUSED, Dl_info *info)
202 if (!info) 177 if (!info)
203 return 0; 178 return 0;
204 179
205#ifdef _WIN32_WINNT
206 length = VirtualQuery(addr, &mbi, sizeof(mbi)); 180 length = VirtualQuery(addr, &mbi, sizeof(mbi));
207 if (!length) 181 if (!length)
208 return 0; 182 return 0;
@@ -216,11 +190,6 @@ dladdr (const void *addr EVIL_UNUSED, Dl_info *info)
216 ret = GetModuleFileName((HMODULE)mbi.AllocationBase, (LPTSTR)&tpath, PATH_MAX); 190 ret = GetModuleFileName((HMODULE)mbi.AllocationBase, (LPTSTR)&tpath, PATH_MAX);
217 if (!ret) 191 if (!ret)
218 return 0; 192 return 0;
219#else
220 ret = GetModuleFileName(NULL, (LPTSTR)&tpath, PATH_MAX);
221 if (!ret)
222 return 0;
223#endif
224 193
225#ifdef UNICODE 194#ifdef UNICODE
226 path = evil_wchar_to_char(tpath); 195 path = evil_wchar_to_char(tpath);
diff --git a/src/lib/evil/dlfcn.h b/src/lib/evil/dlfcn.h
index a054fe907c..d85811a02f 100644
--- a/src/lib/evil/dlfcn.h
+++ b/src/lib/evil/dlfcn.h
@@ -26,12 +26,6 @@
26extern "C" { 26extern "C" {
27#endif 27#endif
28 28
29#ifdef _WIN32_WCE
30# ifndef PATH_MAX
31# define PATH_MAX 260
32# endif
33#endif
34
35 29
36/** 30/**
37 * @file dlfcn.h 31 * @file dlfcn.h
@@ -39,7 +33,7 @@ extern "C" {
39 * @defgroup Evil_Dlfcn Functions that manage dynamic-link libraries. 33 * @defgroup Evil_Dlfcn Functions that manage dynamic-link libraries.
40 * @ingroup Evil 34 * @ingroup Evil
41 * 35 *
42 * This header provides functions to load and unload dynamic-link 36x * This header provides functions to load and unload dynamic-link
43 * libaries, to get the address of a symbol, and to get diagnostic 37 * libaries, to get the address of a symbol, and to get diagnostic
44 * information. 38 * information.
45 */ 39 */
diff --git a/src/lib/evil/evil_errno.c b/src/lib/evil/evil_errno.c
deleted file mode 100644
index 37cac611f0..0000000000
--- a/src/lib/evil/evil_errno.c
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include "Evil.h"
6#include "mingw32ce/errno.h"
7
8
9int errno = 0;
diff --git a/src/lib/evil/evil_fcntl.c b/src/lib/evil/evil_fcntl.c
index aa68ec1abf..76b6a603e1 100644
--- a/src/lib/evil/evil_fcntl.c
+++ b/src/lib/evil/evil_fcntl.c
@@ -15,11 +15,6 @@
15#include "Evil.h" 15#include "Evil.h"
16 16
17 17
18#ifdef __MINGW32CE__
19# define _get_osfhandle(FILEDES) ((HANDLE)FILEDES)
20#endif /* __MINGW32CE__ */
21
22
23/* 18/*
24 * port of fcntl function 19 * port of fcntl function
25 * 20 *
@@ -39,14 +34,12 @@ int fcntl(int fd, int cmd, ...)
39 34
40 if (cmd == F_GETFD) 35 if (cmd == F_GETFD)
41 { 36 {
42#ifndef __MINGW32CE__
43 DWORD flag; 37 DWORD flag;
44 38
45 if (!GetHandleInformation(h, &flag)) 39 if (!GetHandleInformation(h, &flag))
46 return -1; 40 return -1;
47 41
48 res = 0; 42 res = 0;
49#endif /* ! __MINGW32CE__ */
50 } 43 }
51 44
52 if (cmd == F_SETFD) 45 if (cmd == F_SETFD)
@@ -56,10 +49,8 @@ int fcntl(int fd, int cmd, ...)
56 flag = va_arg(va, long); 49 flag = va_arg(va, long);
57 if (flag == FD_CLOEXEC) 50 if (flag == FD_CLOEXEC)
58 { 51 {
59#ifndef __MINGW32CE__
60 if (SetHandleInformation(h, HANDLE_FLAG_INHERIT, 0)) 52 if (SetHandleInformation(h, HANDLE_FLAG_INHERIT, 0))
61 res = 0; 53 res = 0;
62#endif /* ! __MINGW32CE__ */
63 } 54 }
64 } 55 }
65 else if (cmd == F_GETFL) 56 else if (cmd == F_GETFL)
@@ -87,7 +78,6 @@ int fcntl(int fd, int cmd, ...)
87 } 78 }
88 } 79 }
89 } 80 }
90#ifndef __MINGW32CE__
91 else if ((cmd == F_SETLK) || (cmd == F_SETLKW)) 81 else if ((cmd == F_SETLK) || (cmd == F_SETLKW))
92 { 82 {
93 struct flock *fl; 83 struct flock *fl;
@@ -120,8 +110,6 @@ int fcntl(int fd, int cmd, ...)
120 res = _locking(fd, _LK_UNLCK, fl->l_len); 110 res = _locking(fd, _LK_UNLCK, fl->l_len);
121 }