summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:48:42 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:48:42 -0700
commitd179a5c2a95785e64015c9d69f9e0f23dfc6699e (patch)
tree2cb2120e7ce066fd4bcc3e90ccd691d71033adc5
parente6b4878a9e348b6fdf6112ba2ef359e63ccbd09c (diff)
efl: remove PS3 backend.
This backend has received no patch and maintenance from anyone who could actually test it over the last few years. After talking with KaKaRoTo it is best to remove it. If anyone want to take over its maintenance, you are welcome to revert this patch.
-rw-r--r--Makefile.am8
-rw-r--r--README8
-rw-r--r--configure.ac48
-rw-r--r--pc/.gitignore2
-rw-r--r--pc/ecore-psl1ght.pc.in12
-rw-r--r--pc/evas-psl1ght.pc.in3
-rw-r--r--src/Makefile.am1
-rw-r--r--src/Makefile_Ecore_Evas.am25
-rw-r--r--src/Makefile_Ecore_Psl1ght.am29
-rw-r--r--src/Makefile_Evas.am35
-rw-r--r--src/lib/ecore_evas/Ecore_Evas.h2
-rw-r--r--src/lib/ecore_evas/ecore_evas.c16
-rw-r--r--src/lib/ecore_evas/ecore_evas_module.c6
-rw-r--r--src/lib/ecore_psl1ght/Ecore_Psl1ght.h124
-rw-r--r--src/lib/ecore_psl1ght/Ecore_Psl1ght_Keys.h78
-rw-r--r--src/lib/ecore_psl1ght/ecore_psl1ght.c862
-rw-r--r--src/lib/ecore_psl1ght/ecore_psl1ght_private.h36
-rw-r--r--src/lib/ecore_psl1ght/gemutil.c281
-rw-r--r--src/lib/ecore_psl1ght/gemutil.h19
-rw-r--r--src/lib/ecore_psl1ght/moveutil.c245
-rw-r--r--src/lib/ecore_psl1ght/moveutil.h43
-rw-r--r--src/lib/ecore_psl1ght/spursutil.c62
-rw-r--r--src/lib/ecore_psl1ght/spursutil.h24
-rw-r--r--src/lib/elementary/efl_ui_win.c14
-rw-r--r--src/lib/elementary/elm_config.c3
-rw-r--r--src/lib/evas/file/evas_module.c4
-rw-r--r--src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c467
-rw-r--r--src/modules/evas/engines/psl1ght/Evas_Engine_PSL1GHT.h16
-rw-r--r--src/modules/evas/engines/psl1ght/evas_engine.c449
-rw-r--r--src/modules/evas/engines/psl1ght/evas_engine.h30
-rw-r--r--src/modules/evas/engines/psl1ght/rsxutil.c275
-rw-r--r--src/modules/evas/engines/psl1ght/rsxutil.h43
-rw-r--r--src/tests/evas/evas_test_render_engines.c3
33 files changed, 3 insertions, 3270 deletions
diff --git a/Makefile.am b/Makefile.am
index 939687b..1106b60 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -221,10 +221,6 @@ if BUILD_ENGINE_SOFTWARE_DDRAW
221pkgconfig_DATA += pc/evas-software-ddraw.pc 221pkgconfig_DATA += pc/evas-software-ddraw.pc
222endif 222endif
223 223
224if BUILD_ENGINE_PSL1GHT
225pkgconfig_DATA += pc/evas-psl1ght.pc
226endif
227
228if BUILD_ENGINE_WAYLAND_SHM 224if BUILD_ENGINE_WAYLAND_SHM
229pkgconfig_DATA += pc/evas-wayland-shm.pc 225pkgconfig_DATA += pc/evas-wayland-shm.pc
230endif 226endif
@@ -249,10 +245,6 @@ if HAVE_ECORE_DRM
249pkgconfig_DATA += pc/ecore-drm.pc 245pkgconfig_DATA += pc/ecore-drm.pc
250endif 246endif
251 247
252if HAVE_PS3
253pkgconfig_DATA += pc/ecore-psl1ght.pc
254endif
255
256if HAVE_ECORE_SDL 248if HAVE_ECORE_SDL
257pkgconfig_DATA += pc/ecore-sdl.pc 249pkgconfig_DATA += pc/ecore-sdl.pc
258endif 250endif
diff --git a/README b/README
index cc44271..9d0b03c 100644
--- a/README
+++ b/README
@@ -168,14 +168,6 @@ supports all the transport layers Ecore Con supports.
168 168
169 169
170 170
171**Ecore Psl1ght:**
172
173//BSD 2-Clause license//
174
175This library acts as a helper for porting to the Playstation 3 (PS3)
176native runtime environment.
177
178
179 171
180**Ecore SDL:** 172**Ecore SDL:**
181 173
diff --git a/configure.ac b/configure.ac
index 830e362..4b1e469 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2523,13 +2523,8 @@ define([EVAS_ENGINE_DEP_CHECK_FB], [
2523AC_CHECK_HEADER([linux/fb.h], [:], [AC_MSG_ERROR([Missing linux/fb.h])]) 2523AC_CHECK_HEADER([linux/fb.h], [:], [AC_MSG_ERROR([Missing linux/fb.h])])
2524]) 2524])
2525 2525
2526define([EVAS_ENGINE_DEP_CHECK_PSL1GHT], [
2527AC_CHECK_HEADER([rsx/rsx.h], [:], [AC_MSG_ERROR([Missing rsx/rsx.h])])
2528])
2529
2530EVAS_ENGINE([buffer], [static]) 2526EVAS_ENGINE([buffer], [static])
2531EVAS_ENGINE([fb], [${want_fb}], [EVAS_ENGINE_DEP_CHECK_FB]) 2527EVAS_ENGINE([fb], [${want_fb}], [EVAS_ENGINE_DEP_CHECK_FB])
2532EVAS_ENGINE([psl1ght], [${have_ps3}], [EVAS_ENGINE_DEP_CHECK_PSL1GHT])
2533 2528
2534# XXX TODO: 2529# XXX TODO:
2535EVAS_CHECK_ENGINE([gl-cocoa], [${want_evas_engine_gl_cocoa}], [no], [OpenGL Cocoa]) 2530EVAS_CHECK_ENGINE([gl-cocoa], [${want_evas_engine_gl_cocoa}], [no], [OpenGL Cocoa])
@@ -3521,42 +3516,6 @@ EFL_LIB_END_OPTIONAL([Ecore_FB])
3521#### End of Ecore_FB 3516#### End of Ecore_FB
3522 3517
3523 3518
3524#### Ecore_Psl1ght
3525EFL_LIB_START_OPTIONAL([Ecore_Psl1ght], [test "${have_ps3}" = "yes"])
3526
3527### Additional options to configure
3528
3529### Default values
3530
3531### Checks for programs
3532
3533### Checks for libraries
3534EFL_PLATFORM_DEPEND([ECORE_PSL1GHT], [escape])
3535
3536EFL_INTERNAL_DEPEND_PKG([ECORE_PSL1GHT], [ecore-input])
3537EFL_INTERNAL_DEPEND_PKG([ECORE_PSL1GHT], [ecore])
3538EFL_INTERNAL_DEPEND_PKG([ECORE_PSL1GHT], [eo])
3539EFL_INTERNAL_DEPEND_PKG([ECORE_PSL1GHT], [efl])
3540EFL_INTERNAL_DEPEND_PKG([ECORE_PSL1GHT], [eina])
3541
3542EFL_ADD_LIBS([ECORE_PSL1GHT], [-lio -lsysutil -lgem -lcamera -lspurs])
3543
3544### Checks for header files
3545
3546### Checks for types
3547
3548### Checks for structures
3549
3550### Checks for compiler characteristics
3551
3552### Checks for linker characteristics
3553
3554### Checks for library functions
3555
3556EFL_LIB_END_OPTIONAL([Ecore_Psl1ght])
3557#### End of Ecore_Psl1ght
3558
3559
3560#### Ecore_SDL 3519#### Ecore_SDL
3561EFL_LIB_START_OPTIONAL([Ecore_SDL], [test "${want_sdl}" = "yes"]) 3520EFL_LIB_START_OPTIONAL([Ecore_SDL], [test "${want_sdl}" = "yes"])
3562 3521
@@ -4492,7 +4451,6 @@ ECORE_EVAS_MODULE([drm], [${want_drm}],
4492 [EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [${want_drm}], [ecore-drm2])]) 4451 [EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [${want_drm}], [ecore-drm2])])
4493ECORE_EVAS_MODULE([gl-drm], [${want_gl_drm}], 4452ECORE_EVAS_MODULE([gl-drm], [${want_gl_drm}],
4494 [EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [${want_gl_drm}], [ecore-drm2])]) 4453 [EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [${want_gl_drm}], [ecore-drm2])])
4495ECORE_EVAS_MODULE([psl1ght], [${have_ps3}])
4496 4454
4497ECORE_EVAS_MODULE([opengl-cocoa], [${want_ecore_evas_gl_cocoa}]) 4455ECORE_EVAS_MODULE([opengl-cocoa], [${want_ecore_evas_gl_cocoa}])
4498 4456
@@ -5389,7 +5347,6 @@ EFL_INTERNAL_DEPEND_PKG([ELEMENTARY], [elocation])
5389 5347
5390EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ELEMENTARY], [${want_x11_any}], [ecore_x]) 5348EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ELEMENTARY], [${want_x11_any}], [ecore_x])
5391EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ELEMENTARY], [${want_fb}], [ecore_fb]) 5349EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ELEMENTARY], [${want_fb}], [ecore_fb])
5392EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ELEMENTARY], [${have_ps3}], [ecore_psl1ght])
5393EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ELEMENTARY], [${want_sdl}], [ecore_sdl]) 5350EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ELEMENTARY], [${want_sdl}], [ecore_sdl])
5394EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ELEMENTARY], [${want_ecore_evas_gl_cocoa}], [ecore_cocoa]) 5351EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ELEMENTARY], [${want_ecore_evas_gl_cocoa}], [ecore_cocoa])
5395EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ELEMENTARY], [${build_ecore_evas_win32}], [ecore_win32]) 5352EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ELEMENTARY], [${build_ecore_evas_win32}], [ecore_win32])
@@ -5409,7 +5366,6 @@ EFL_ADD_LIBS([ELEMENTARY], [-lm])
5409 5366
5410ELM_CHECK_BACKEND([X], [${want_x11_any}]) 5367ELM_CHECK_BACKEND([X], [${want_x11_any}])
5411ELM_CHECK_BACKEND([FB], [${want_fb}]) 5368ELM_CHECK_BACKEND([FB], [${want_fb}])
5412ELM_CHECK_BACKEND([PSL1GHT], [${have_ps3}])
5413ELM_CHECK_BACKEND([SDL], [${want_sdl}]) 5369ELM_CHECK_BACKEND([SDL], [${want_sdl}])
5414ELM_CHECK_BACKEND([Cocoa], [${want_ecore_evas_gl_cocoa}]) 5370ELM_CHECK_BACKEND([Cocoa], [${want_ecore_evas_gl_cocoa}])
5415ELM_CHECK_BACKEND([Win32], [${build_ecore_evas_win32}]) 5371ELM_CHECK_BACKEND([Win32], [${build_ecore_evas_win32}])
@@ -5689,7 +5645,6 @@ pc/evas-eglfs.pc
5689pc/evas-opengl-x11.pc 5645pc/evas-opengl-x11.pc
5690pc/evas-opengl-sdl.pc 5646pc/evas-opengl-sdl.pc
5691pc/evas-opengl-cocoa.pc 5647pc/evas-opengl-cocoa.pc
5692pc/evas-psl1ght.pc
5693pc/evas-software-buffer.pc 5648pc/evas-software-buffer.pc
5694pc/evas-software-x11.pc 5649pc/evas-software-x11.pc
5695pc/evas-software-gdi.pc 5650pc/evas-software-gdi.pc
@@ -5710,7 +5665,6 @@ pc/ecore-input-evas.pc
5710pc/ecore-cocoa.pc 5665pc/ecore-cocoa.pc
5711pc/ecore-drm.pc 5666pc/ecore-drm.pc
5712pc/ecore-fb.pc 5667pc/ecore-fb.pc
5713pc/ecore-psl1ght.pc
5714pc/ecore-sdl.pc 5668pc/ecore-sdl.pc
5715pc/ecore-wayland.pc 5669pc/ecore-wayland.pc
5716pc/ecore-wl2.pc 5670pc/ecore-wl2.pc
@@ -5897,8 +5851,6 @@ echo "IVI-Shell.......: $want_wayland_ivi_shell"
5897echo "Ecore_Buffer....: $want_ecore_buffer (${features_ecore_buffer})" 5851echo "Ecore_Buffer....: $want_ecore_buffer (${features_ecore_buffer})"
5898if test "${have_linux}" = "yes"; then 5852if test "${have_linux}" = "yes"; then
5899echo "Ecore_FB........: $want_fb (${features_ecore_fb})" 5853echo "Ecore_FB........: $want_fb (${features_ecore_fb})"
5900elif test "${have_ps3}" = "yes"; then
5901echo "Ecore_PSL1GHT...: $have_ps3"
5902elif test "${have_darwin}" = "yes"; then 5854elif test "${have_darwin}" = "yes"; then
5903echo "Ecore_Cocoa.....: $efl_lib_optional_ecore_cocoa" 5855echo "Ecore_Cocoa.....: $efl_lib_optional_ecore_cocoa"
5904elif test "${have_windows}" = "yes"; then 5856elif test "${have_windows}" = "yes"; then
diff --git a/pc/.gitignore b/pc/.gitignore
index 893e937..f16d2a3 100644
--- a/pc/.gitignore
+++ b/pc/.gitignore
@@ -11,7 +11,6 @@
11/ecore-input-evas.pc 11/ecore-input-evas.pc
12/ecore-input.pc 12/ecore-input.pc
13/ecore-ipc.pc 13/ecore-ipc.pc
14/ecore-psl1ght.pc
15/ecore-sdl.pc 14/ecore-sdl.pc
16/ecore-wayland.pc 15/ecore-wayland.pc
17/ecore-wl2.pc 16/ecore-wl2.pc
@@ -49,7 +48,6 @@
49/evas-opengl-cocoa.pc 48/evas-opengl-cocoa.pc
50/evas-opengl-sdl.pc 49/evas-opengl-sdl.pc
51/evas-opengl-x11.pc 50/evas-opengl-x11.pc
52/evas-psl1ght.pc
53/evas-software-buffer.pc 51/evas-software-buffer.pc
54/evas-software-ddraw.pc 52/evas-software-ddraw.pc
55/evas-software-gdi.pc 53/evas-software-gdi.pc
diff --git a/pc/ecore-psl1ght.pc.in b/pc/ecore-psl1ght.pc.in
deleted file mode 100644
index 6a8b97e..0000000
--- a/pc/ecore-psl1ght.pc.in
+++ /dev/null
@@ -1,12 +0,0 @@
1prefix=@prefix@
2exec_prefix=@exec_prefix@
3libdir=@libdir@
4includedir=@includedir@
5
6Name: ecore-psl1ght
7Description: E core library, PSL1GHT module
8Requires.private: @requirements_pc_ecore_psl1ght@
9Version: @VERSION@
10Libs: -L${libdir} -lecore_psl1ght
11Libs.private: @requirements_libs_ecore_psl1ght@
12Cflags: -I${includedir}/efl-@VMAJ@ -I${includedir}/ecore-psl1ght-@VMAJ@
diff --git a/pc/evas-psl1ght.pc.in b/pc/evas-psl1ght.pc.in
deleted file mode 100644
index ba17d58..0000000
--- a/pc/evas-psl1ght.pc.in
+++ /dev/null
@@ -1,3 +0,0 @@
1Name: evas-psl1ght
2Description: Evas PSL1GHT engine
3Version: @VERSION@
diff --git a/src/Makefile.am b/src/Makefile.am
index b3cced6..c696978 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -48,7 +48,6 @@ include Makefile_Ecore_Input.am
48include Makefile_Ecore_Input_Evas.am 48include Makefile_Ecore_Input_Evas.am
49include Makefile_Ecore_Cocoa.am 49include Makefile_Ecore_Cocoa.am
50include Makefile_Ecore_FB.am 50include Makefile_Ecore_FB.am
51include Makefile_Ecore_Psl1ght.am
52include Makefile_Ecore_SDL.am 51include Makefile_Ecore_SDL.am
53include Makefile_Ecore_Wayland.am 52include Makefile_Ecore_Wayland.am
54include Makefile_Ecore_Wl2.am 53include Makefile_Ecore_Wl2.am
diff --git a/src/Makefile_Ecore_Evas.am b/src/Makefile_Ecore_Evas.am
index 711047b..debc996 100644
--- a/src/Makefile_Ecore_Evas.am
+++ b/src/Makefile_Ecore_Evas.am
@@ -144,31 +144,6 @@ modules_ecore_evas_engines_fb_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
144modules_ecore_evas_engines_fb_module_la_LIBTOOLFLAGS = --tag=disable-static 144modules_ecore_evas_engines_fb_module_la_LIBTOOLFLAGS = --tag=disable-static
145endif 145endif
146 146
147if BUILD_ECORE_EVAS_PSL1GHT
148PSL1GHTSOURCES = modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
149ecoreevasenginepsl1ghtpkgdir = $(libdir)/ecore_evas/engines/psl1ght/$(MODULE_ARCH)
150ecoreevasenginepsl1ghtpkg_LTLIBRARIES = modules/ecore_evas/engines/psl1ght/module.la
151
152# Workaround for broken parallel install support in automake (relink issue)
153# http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7328
154install_ecoreevasenginepsl1ghtpkgLTLIBRARIES = install-ecoreevasenginepsl1ghtpkgLTLIBRARIES
155$(install_ecoreevasenginepsl1ghtpkgLTLIBRARIES): install-libLTLIBRARIES
156
157modules_ecore_evas_engines_psl1ght_module_la_SOURCES = $(PSL1GHTSOURCES)
158modules_ecore_evas_engines_psl1ght_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
159@ECORE_EVAS_CFLAGS@ \
160@ECORE_PSL1GHT_CFLAGS@ \
161-I$(top_srcdir)/src/modules/evas/engines/psl1ght
162modules_ecore_evas_engines_psl1ght_module_la_LIBADD = \
163@USE_ECORE_EVAS_LIBS@ \
164@USE_ECORE_PSL1GHT_LIBS@
165modules_ecore_evas_engines_psl1ght_module_la_DEPENDENCIES = \
166@USE_ECORE_EVAS_INTERNAL_LIBS@ \
167@USE_ECORE_PSL1GHT_INTERNAL_LIBS@
168modules_ecore_evas_engines_psl1ght_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
169modules_ecore_evas_engines_psl1ght_module_la_LIBTOOLFLAGS = --tag=disable-static
170endif
171
172if BUILD_ECORE_EVAS_WAYLAND 147if BUILD_ECORE_EVAS_WAYLAND
173WAYLANDSOURCES = \ 148WAYLANDSOURCES = \
174modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c \ 149modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c \
diff --git a/src/Makefile_Ecore_Psl1ght.am b/src/Makefile_Ecore_Psl1ght.am
deleted file mode 100644
index 8d7b3a4..0000000
--- a/src/Makefile_Ecore_Psl1ght.am
+++ /dev/null
@@ -1,29 +0,0 @@
1if HAVE_PS3
2
3### Library
4
5lib_LTLIBRARIES += lib/ecore_psl1ght/libecore_psl1ght.la
6
7installed_ecorepsl1ghtmainheadersdir = $(includedir)/ecore-psl1ght-@VMAJ@
8dist_installed_ecorepsl1ghtmainheaders_DATA = \
9lib/ecore_psl1ght/Ecore_Psl1ght.h
10
11lib_ecore_psl1ght_libecore_psl1ght_la_SOURCES = \
12lib/ecore_psl1ght/ecore_psl1ght.c \
13lib/ecore_psl1ght/moveutil.c \
14lib/ecore_psl1ght/moveutil.h \
15lib/ecore_psl1ght/spursutil.c \
16lib/ecore_psl1ght/spursutil.h \
17lib/ecore_psl1ght/Ecore_Psl1ght_Keys.h \
18lib/ecore_psl1ght/ecore_psl1ght_private.h
19
20lib_ecore_psl1ght_libecore_psl1ght_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_PSL1GHT_CFLAGS@
21lib_ecore_psl1ght_libecore_psl1ght_la_LIBADD = @ECORE_PSL1GHT_LIBS@
22lib_ecore_psl1ght_libecore_psl1ght_la_DEPENDENCIES = @ECORE_PSL1GHT_INTERNAL_LIBS@
23lib_ecore_psl1ght_libecore_psl1ght_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
24endif
25
26# TODO: what are they used for?
27EXTRA_DIST2 += \
28lib/ecore_psl1ght/gemutil.c \
29lib/ecore_psl1ght/gemutil.h
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index 61648bd..27d86e5 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -1043,41 +1043,6 @@ modules_evas_engines_gl_x11_module_la_LIBTOOLFLAGS = --tag=disable-static
1043endif 1043endif
1044endif 1044endif
1045 1045
1046if BUILD_ENGINE_PSL1GHT
1047PSL1GHT_SOURCES = \
1048modules/evas/engines/psl1ght/evas_engine.c \
1049modules/evas/engines/psl1ght/rsxutil.c \
1050modules/evas/engines/psl1ght/evas_engine.h \
1051modules/evas/engines/psl1ght/rsxutil.h \
1052modules/evas/engines/psl1ght/Evas_Engine_PSL1GHT.h
1053if EVAS_STATIC_BUILD_PSL1GHT
1054lib_evas_libevas_la_SOURCES += $(PSL1GHT_SOURCES)
1055lib_evas_libevas_la_CPPFLAGS += @evas_engine_psl1ght_cflags@
1056lib_evas_libevas_la_LIBADD += @evas_engine_psl1ght_libs@
1057else
1058enginepsl1ghtpkgdir = $(libdir)/evas/modules/engines/psl1ght/$(MODULE_ARCH)
1059enginepsl1ghtpkg_LTLIBRARIES = modules/evas/engines/psl1ght/module.la
1060
1061# Workaround for broken parallel install support in automake (relink issue)
1062# http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7328
1063install_enginepsl1ghtpkgLTLIBRARIES = install-enginepsl1ghtpkgLTLIBRARIES
1064$(install_enginepsl1ghtpkgLTLIBRARIES): install-libLTLIBRARIES
1065
1066modules_evas_engines_psl1ght_module_la_SOURCES = $(PSL1GHT_SOURCES)
1067modules_evas_engines_psl1ght_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
1068-I$(top_srcdir)/src/lib/evas/include \
1069-I$(top_srcdir)/src/lib/evas/cserve2 \
1070@EVAS_CFLAGS@ \
1071@evas_engine_psl1ght_cflags@
1072modules_evas_engines_psl1ght_module_la_LIBADD = \
1073@USE_EVAS_LIBS@ \
1074@evas_engine_psl1ght_libs@
1075modules_evas_engines_psl1ght_module_la_DEPENDENCIES = @USE_EVAS_INTERNAL_LIBS@
1076modules_evas_engines_psl1ght_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
1077modules_evas_engines_psl1ght_module_la_LIBTOOLFLAGS = --tag=disable-static
1078endif
1079endif
1080
1081if BUILD_ENGINE_SOFTWARE_DDRAW 1046if BUILD_ENGINE_SOFTWARE_DDRAW
1082SOFTWARE_DDRAW_SOURCES = \ 1047SOFTWARE_DDRAW_SOURCES = \
1083modules/evas/engines/software_ddraw/evas_engine.c \ 1048modules/evas/engines/software_ddraw/evas_engine.c \
diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
index f680458..7255181 100644
--- a/src/lib/ecore_evas/Ecore_Evas.h
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -2020,7 +2020,7 @@ EAPI Ecore_Evas *ecore_evas_cocoa_new(Ecore_Cocoa_Window *parent,
2020 * 2020 *
2021 * The psl1ght backend is used for the PS3 GameOS. 2021 * The psl1ght backend is used for the PS3 GameOS.
2022 */ 2022 */
2023EAPI Ecore_Evas *ecore_evas_psl1ght_new(const char* name, int w, int h); 2023EAPI Ecore_Evas *ecore_evas_psl1ght_new(const char* name, int w, int h) EINA_DEPRECATED;
2024 2024
2025 2025
2026/* generic manipulation calls */ 2026/* generic manipulation calls */
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 127b945..d95e3bd 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -555,11 +555,7 @@ ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
555 return EINA_FALSE; 555 return EINA_FALSE;
556#endif 556#endif
557 case ECORE_EVAS_ENGINE_PSL1GHT: 557 case ECORE_EVAS_ENGINE_PSL1GHT:
558#ifdef BUILD_ECORE_EVAS_PSL1GHT
559 return EINA_TRUE;
560#else
561 return EINA_FALSE; 558 return EINA_FALSE;
562#endif
563 case ECORE_EVAS_ENGINE_WAYLAND_SHM: 559 case ECORE_EVAS_ENGINE_WAYLAND_SHM:
564#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM 560#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
565 return EINA_TRUE; 561 return EINA_TRUE;
@@ -897,17 +893,9 @@ _ecore_evas_constructor_fb(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, c
897} 893}
898 894
899static Ecore_Evas * 895static Ecore_Evas *
900_ecore_evas_constructor_psl1ght(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options) 896_ecore_evas_constructor_psl1ght(int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED, const char *extra_options EINA_UNUSED)
901{ 897{
902 Ecore_Evas *ee; 898 return NULL;
903 char *name = NULL;
904
905 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
906 ee = ecore_evas_psl1ght_new(name, w, h);
907 free(name);
908
909 if (ee) ecore_evas_move(ee, x, y);
910 return ee;
911} 899}
912 900
913static Ecore_Evas * 901static Ecore_Evas *
diff --git a/src/lib/ecore_evas/ecore_evas_module.c b/src/lib/ecore_evas/ecore_evas_module.c
index b8dcdee..581e013 100644
--- a/src/lib/ecore_evas/ecore_evas_module.c
+++ b/src/lib/ecore_evas/ecore_evas_module.c
@@ -290,12 +290,6 @@ _ecore_evas_available_engines_get(void)
290 ADDENG("opengl_cocoa"); 290 ADDENG("opengl_cocoa");
291#endif 291#endif
292 } 292 }
293 else if (!strcmp(name, "psl1ght"))
294 {
295#ifdef BUILD_ECORE_EVAS_PSL1GHT
296 ADDENG("psl1ght");
297#endif
298 }
299 else if (!strcmp(name, "sdl")) 293 else if (!strcmp(name, "sdl"))
300 { 294 {
301#ifdef BUILD_ECORE_EVAS_OPENGL_SDL 295#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
diff --git a/src/lib/ecore_psl1ght/Ecore_Psl1ght.h b/src/lib/ecore_psl1ght/Ecore_Psl1ght.h
deleted file mode 100644
index 2eaca29..0000000
--- a/src/lib/ecore_psl1ght/Ecore_Psl1ght.h
+++ /dev/null
@@ -1,124 +0,0 @@
1#ifndef _ECORE_PSL1GHT_H
2#define _ECORE_PSL1GHT_H
3
4#ifdef EAPI
5# undef EAPI
6#endif
7
8#ifdef __GNUC__
9# if __GNUC__ >= 4
10# define EAPI __attribute__ ((visibility("default")))
11# else
12# define EAPI
13# endif
14#else
15# define EAPI
16#endif
17
18/**
19 * @file
20 * @brief Ecore PSL1GHT system functions.
21 */
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27EAPI extern int ECORE_PSL1GHT_EVENT_KEY_MODIFIERS;
28EAPI extern int ECORE_PSL1GHT_EVENT_GOT_FOCUS;
29EAPI extern int ECORE_PSL1GHT_EVENT_LOST_FOCUS;
30EAPI extern int ECORE_PSL1GHT_EVENT_EXPOSE;
31EAPI extern int ECORE_PSL1GHT_EVENT_QUIT;
32
33typedef struct _Ecore_Psl1ght_Event_Key_Modifiers Ecore_Psl1ght_Event_Key_Modifiers;
34struct _Ecore_Psl1ght_Event_Key_Modifiers /** PSL1GHT Key Modifier event */
35{
36 unsigned int timestamp;
37 unsigned int modifiers;
38 int shift_changed : 1;
39 int shift : 1;
40 int alt_changed : 1;
41 int alt : 1;
42 int ctrl_changed : 1;
43 int ctrl : 1;
44 int win_changed : 1;
45 int win : 1;
46 int num_lock_changed : 1;
47 int num_lock : 1;
48 int caps_lock_changed : 1;
49 int caps_lock : 1;
50 int scroll_lock_changed : 1;
51 int scroll_lock : 1;
52};
53
54typedef struct _Ecore_Psl1ght_Event_Key_Down Ecore_Psl1ght_Event_Key_Down;
55struct _Ecore_Psl1ght_Event_Key_Down /** PSL1GHT Key Down event */
56{
57 const char *keyname; /**< The name of the key that was pressed */
58 const char *keycompose; /**< The UTF-8 string conversion if any */
59 unsigned int time;
60};
61
62typedef struct _Ecore_Psl1ght_Event_Key_Up Ecore_Psl1ght_Event_Key_Up;
63struct _Ecore_Psl1ght_Event_Key_Up /** PSL1GHT Key Up event */
64{
65 const char *keyname; /**< The name of the key that was released */
66 const char *keycompose; /**< The UTF-8 string conversion if any */
67 unsigned int time;
68};
69
70typedef struct _Ecore_Psl1ght_Event_Mouse_Button_Down Ecore_Psl1ght_Event_Mouse_Button_Down;
71struct _Ecore_Psl1ght_Event_Mouse_Button_Down /** PSL1GHT Mouse Down event */
72{
73 int button; /**< Mouse button that was pressed (1 - 32) */
74 int x; /**< Mouse co-ordinates when mouse button was pressed */
75 int y; /**< Mouse co-ordinates when mouse button was pressed */
76 int double_click : 1; /**< Set if click was a double click */
77 int triple_click : 1; /**< Set if click was a triple click */
78 unsigned int time;
79};
80
81typedef struct _Ecore_Psl1ght_Event_Mouse_Button_Up Ecore_Psl1ght_Event_Mouse_Button_Up;
82struct _Ecore_Psl1ght_Event_Mouse_Button_Up /** PSL1GHT Mouse Up event */
83{
84 int button; /**< Mouse button that was released (1 - 32) */
85 int x; /**< Mouse co-ordinates when mouse button was raised */
86 int y; /**< Mouse co-ordinates when mouse button was raised */
87 int double_click : 1; /**< Set if click was a double click */
88 int triple_click : 1; /**< Set if click was a triple click */
89 unsigned int time;
90};
91
92typedef struct _Ecore_Psl1ght_Event_Mouse_Move Ecore_Psl1ght_Event_Mouse_Move;
93struct _Ecore_Psl1ght_Event_Mouse_Move /** PSL1GHT Mouse Move event */
94{
95 int x; /**< Mouse co-ordinates where the mouse cursor moved to */
96 int y; /**< Mouse co-ordinates where the mouse cursor moved to */
97 unsigned int time;
98};
99
100typedef struct _Ecore_Psl1ght_Event_Mouse_Wheel Ecore_Psl1ght_Event_Mouse_Wheel;
101struct _Ecore_Psl1ght_Event_Mouse_Wheel /** PSL1GHT Mouse Wheel event */
102{
103 int x, y;
104 int direction; /* 0 = vertical, 1 = horizontal */
105 int wheel; /* value 1 (left/up), -1 (right/down) */
106 unsigned int time;
107};
108
109EAPI int ecore_psl1ght_init(const char *name);
110EAPI int ecore_psl1ght_shutdown(void);
111EAPI void ecore_psl1ght_resolution_set(int width, int height);
112EAPI void ecore_psl1ght_poll_events(void);
113
114EAPI void ecore_psl1ght_screen_resolution_get(int *w, int *h);
115EAPI void ecore_psl1ght_optimal_screen_resolution_get(int *w, int *h);
116
117#ifdef __cplusplus
118}
119#endif
120
121#undef EAPI
122#define EAPI
123
124#endif
diff --git a/src/lib/ecore_psl1ght/Ecore_Psl1ght_Keys.h b/src/lib/ecore_psl1ght/Ecore_Psl1ght_Keys.h
deleted file mode 100644
index e385af8..0000000
--- a/src/lib/ecore_psl1ght/Ecore_Psl1ght_Keys.h
+++ /dev/null
@@ -1,78 +0,0 @@
1#ifndef ECORE_PSL1GHT_KEYS_H__
2# define ECORE_PSL1GHT_KEYS_H__
3
4struct _ecore_psl1ght_keys_s
5{
6 int code;
7 const char *name;
8 const char *compose;
9};
10
11static const struct _ecore_psl1ght_keys_s keystable[] =
12{
13 { KB_RAWKEY_NO_EVENT, "0x00", "" },
14 { KB_RAWKEY_BS, "BackSpace", "\010" },
15 { KB_RAWKEY_TAB, "Tab", "\011" },
16 { KB_RAWKEY_ENTER, "Return", "\015" },
17 { KB_RAWKEY_PAUSE, "Pause", "Pause" },
18 { KB_RAWKEY_ESCAPE, "Escape", "\033" },
19 { KB_RAWKEY_SPACE, "space", " " },
20
21 /* Skip uppercase letters */
22 { KB_RAWKEY_LEFT_BRACKET_101, "bracketleft", "[" },
23 { KB_RAWKEY_BACKSLASH_101, "backslash", "\\" },
24 { KB_RAWKEY_RIGHT_BRACKET_101, "bracketright", "]" },
25 { KB_RAWKEY_ACCENT_CIRCONFLEX_106, "asciicircumm", "^" },
26 { KB_RAWKEY_DELETE, "Delete", "\177" },
27 /* End of ASCII mapped keysyms */
28
29 /* Numeric keypad */
30 { KB_RAWKEY_KPAD_0, "KP0", "0" },
31 { KB_RAWKEY_KPAD_1, "KP1", "1" },
32 { KB_RAWKEY_KPAD_2, "KP2", "2" },
33 { KB_RAWKEY_KPAD_3, "KP3", "3" },
34 { KB_RAWKEY_KPAD_4, "KP4", "4" },
35 { KB_RAWKEY_KPAD_5, "KP5", "5" },
36 { KB_RAWKEY_KPAD_6, "KP6", "6" },
37 { KB_RAWKEY_KPAD_7, "KP7", "7" },
38 { KB_RAWKEY_KPAD_8, "KP8", "8" },
39 { KB_RAWKEY_KPAD_9, "KP9", "9" },
40 { KB_RAWKEY_KPAD_PERIOD, "period", "." },
41 { KB_RAWKEY_KPAD_SLASH, "KP_Divide", "/" },
42 { KB_RAWKEY_KPAD_ASTERISK, "KP_Multiply", "*" },
43 { KB_RAWKEY_KPAD_MINUS, "KP_Minus", "-" },
44 { KB_RAWKEY_KPAD_PLUS, "KP_Plus", "+" },
45 { KB_RAWKEY_KPAD_ENTER, "KP_Enter", "\015" },
46
47 /* Arrows + Home/End pad */
48 { KB_RAWKEY_UP_ARROW, "Up", "Up" },
49 { KB_RAWKEY_DOWN_ARROW, "Down", "Down" },
50 { KB_RAWKEY_RIGHT_ARROW, "Right", "Right" },
51 { KB_RAWKEY_LEFT_ARROW, "Left", "Left" },
52 { KB_RAWKEY_INSERT, "Insert", "Insert" },
53 { KB_RAWKEY_HOME, "Home", "Home" },
54 { KB_RAWKEY_END, "End", "End" },
55 { KB_RAWKEY_PAGE_UP, "Page_Up", "Page_Up" },
56 { KB_RAWKEY_PAGE_DOWN, "Page_Down", "Page_Down" },
57
58 /* Function keys */
59 { KB_RAWKEY_F1, "F1", "F1" },
60 { KB_RAWKEY_F2, "F2", "F2" },
61 { KB_RAWKEY_F3, "F3", "F3" },
62 { KB_RAWKEY_F4, "F4", "F4" },
63 { KB_RAWKEY_F5, "F5", "F5" },
64 { KB_RAWKEY_F6, "F6", "F6" },
65 { KB_RAWKEY_F7, "F7", "F7" },
66 { KB_RAWKEY_F8, "F8", "F8" },
67 { KB_RAWKEY_F9, "F9", "F9" },
68 { KB_RAWKEY_F10, "F10", "F10" },
69 { KB_RAWKEY_F11, "F11", "F11" },
70 { KB_RAWKEY_F12, "F12", "F12" },
71
72 /* Key state modifier keys */
73 { KB_RAWKEY_KPAD_NUMLOCK, "Num_Lock", "Num_Lock" },
74 { KB_RAWKEY_CAPS_LOCK, "Caps_Lock", "Caps_Lock" },
75 { KB_RAWKEY_SCROLL_LOCK, "Scroll_Lock", "Scroll_Lock" },
76};
77
78#endif /* ECORE_PSL1GHT_KEYS_H__ */
diff --git a/src/lib/ecore_psl1ght/ecore_psl1ght.c b/src/lib/ecore_psl1ght/ecore_psl1ght.c
deleted file mode 100644
index 1a16145..0000000
--- a/src/lib/ecore_psl1ght/ecore_psl1ght.c
+++ /dev/null
@@ -1,862 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <sysutil/video.h>
6#include <sysutil/sysutil.h>
7#include <sysmodule/sysmodule.h>
8#include <io/pad.h>
9#include <io/mouse.h>
10#include <io/kb.h>
11#include <io/camera.h>
12#include <io/move.h>
13#include <sys/process.h>
14
15#include "moveutil.h"
16
17#include "Eina.h"
18#include "Ecore_Psl1ght.h"
19#include "Ecore_Input.h"
20#include "Ecore.h"
21#include "ecore_psl1ght_private.h"
22#include "ecore_private.h"
23#include "Ecore_Psl1ght_Keys.h"
24
25/* Allocate 1MB stack to avoid overflows */
26SYS_PROCESS_PARAM(1001, 0x100000);
27
28int _ecore_psl1ght_log_dom = -1;
29
30EAPI int ECORE_PSL1GHT_EVENT_KEY_MODIFIERS = 0;
31EAPI int ECORE_PSL1GHT_EVENT_GOT_FOCUS = 0;
32EAPI int ECORE_PSL1GHT_EVENT_LOST_FOCUS = 0;
33EAPI int ECORE_PSL1GHT_EVENT_EXPOSE = 0;
34EAPI int ECORE_PSL1GHT_EVENT_QUIT = 0;
35
36static int _ecore_psl1ght_init_count = 0;
37static int window_width = 0;
38static int window_height = 0;
39/* Mouse support */
40static int mouse_connected = FALSE;
41static u8 mouse_buttons = 0;
42static int mouse_x = 0;
43static int mouse_y = 0;
44/* Keyboard support */
45static int keyboard_connected = FALSE;
46static KbLed keyboard_leds = {{0}};
47static KbMkey keyboard_mods = {{0}};
48static u16 keyboard_old_key = 0;
49/* Pad support */
50static padData pad_data;
51static padData old_pad_data = {0};
52static int pad_old_x = 0;
53static int pad_old_o = 0;
54/* Move support */
55static int move_connected = FALSE;
56static moveContext *move_context = NULL;
57u16 move_buttons = 0;
58
59static void xmb_event_handler(u64 status, u64 param, void *user_data);
60
61/**
62 * @defgroup Ecore_Psl1ght_Library_Group PSL1GHT Library Functions
63 * @ingroup Ecore
64 *
65 * Functions used to set up and shut down the Ecore_Psl1ght functions.
66 */
67
68/**
69 * Sets up the Ecore_Psl1ght library.
70 * @param name device target name
71 * @return @c 0 on failure. Otherwise, the number of times the library has
72 * been initialised without being shut down.
73 * @ingroup Ecore_PSL1GHT_Library_Group
74 */
75EAPI int
76ecore_psl1ght_init(const char *name EINA_UNUSED)
77{
78 videoState state;
79 videoResolution resolution;
80 int ret, camera_loaded, gem_loaded;
81
82 if (++_ecore_psl1ght_init_count != 1)
83 return _ecore_psl1ght_init_count;
84 _ecore_psl1ght_log_dom = eina_log_domain_register
85 ("ecore_psl1ght", ECORE_PSL1GHT_DEFAULT_LOG_COLOR);
86 if (_ecore_psl1ght_log_dom < 0)
87 {
88 EINA_LOG_ERR("Impossible to create a log domain for the Ecore PSL1GHT module.");
89 return --_ecore_psl1ght_init_count;
90 }
91 if (!ecore_event_init())
92 {
93 eina_log_domain_unregister(_ecore_psl1ght_log_dom);
94 _ecore_psl1ght_log_dom = -1;
95 return --_ecore_psl1ght_init_count;
96 }
97
98 if (videoGetState (0, 0, &state) == 0 &&
99 videoGetResolution (state.displayMode.resolution, &resolution) == 0)
100 {
101 ecore_psl1ght_resolution_set (resolution.width, resolution.height);
102 }
103 else
104 {
105 ecore_event_shutdown();
106 eina_log_domain_unregister(_ecore_psl1ght_log_dom);
107 _ecore_psl1ght_log_dom = -1;
108 return --_ecore_psl1ght_init_count;
109 }
110
111 /* Pad support */
112 ioPadInit (7);
113 /* Mouse support */
114 ioMouseInit(2);
115 mouse_buttons = 0;
116 mouse_x = 0;
117 mouse_y = 0;
118
119 /* Keyboard support */
120 ioKbInit(2);
121 keyboard_leds._KbLedU.leds = 0;
122 keyboard_mods._KbMkeyU.mkeys = 0;
123
124 /* Initialize Move */
125 move_context = NULL;
126 move_buttons = 0;
127
128 camera_loaded = !sysModuleIsLoaded (SYSMODULE_CAMERA);
129 if (!camera_loaded)
130 ret = sysModuleLoad (SYSMODULE_CAMERA);
131 else
132 ret = 0;
133 if (ret == 0)
134 {
135 gem_loaded = !sysModuleIsLoaded (SYSMODULE_GEM);
136 if (!gem_loaded)
137 ret = sysModuleLoad (SYSMODULE_GEM);
138 if (ret == 0)
139 {
140 move_context = initMove ();
141 }
142 else {
143 if (gem_loaded)
144 sysModuleUnload (SYSMODULE_CAMERA);
145 }
146 }
147
148 sysUtilRegisterCallback (SYSUTIL_EVENT_SLOT0, xmb_event_handler, NULL);
149
150 if (ECORE_PSL1GHT_EVENT_GOT_FOCUS == 0)
151 {
152 ECORE_PSL1GHT_EVENT_GOT_FOCUS = ecore_event_type_new();
153 ECORE_PSL1GHT_EVENT_LOST_FOCUS = ecore_event_type_new();
154 ECORE_PSL1GHT_EVENT_EXPOSE = ecore_event_type_new();
155 ECORE_PSL1GHT_EVENT_KEY_MODIFIERS = ecore_event_type_new();
156 ECORE_PSL1GHT_EVENT_QUIT = ecore_event_type_new();
157 }
158
159 mouse_x = 0;
160 mouse_y = 0;
161
162 return _ecore_psl1ght_init_count;
163}
164
165/**
166 * Shuts down the Ecore_Psl1ght library.
167 * @return @c The number of times the system has been initialised without
168 * being shut down.
169 * @ingroup Ecore_PSL1GHT_Library_Group
170 */
171EAPI int
172ecore_psl1ght_shutdown(void)
173{
174 if (--_ecore_psl1ght_init_count != 0)
175 return _ecore_psl1ght_init_count;
176
177 ecore_event_shutdown();
178 eina_log_domain_unregister(_ecore_psl1ght_log_dom);
179 _ecore_psl1ght_log_dom = -1;
180
181 ecore_event_type_flush(ECORE_PSL1GHT_EVENT_GOT_FOCUS,
182 ECORE_PSL1GHT_EVENT_LOST_FOCUS,
183 ECORE_PSL1GHT_EVENT_EXPOSE,
184 ECORE_PSL1GHT_EVENT_KEY_MODIFIERS,
185 ECORE_PSL1GHT_EVENT_QUIT);
186
187 ioPadEnd();
188 ioMouseEnd();
189 ioKbEnd();
190
191 if (move_context)
192 {
193 endMove (move_context);
194 move_context = NULL;
195 sysModuleUnload (SYSMODULE_CAMERA);
196 sysModuleUnload (SYSMODULE_GEM);
197 }
198
199 sysUtilUnregisterCallback(SYSUTIL_EVENT_SLOT0);
200
201 return _ecore_psl1ght_init_count;
202}
203
204static unsigned int
205_ecore_psl1ght_get_time(void)
206{
207 return (unsigned int)((unsigned long long)
208 (ecore_time_get() * 1000.0) & 0xffffffff);
209}
210
211static unsigned int
212_ecore_psl1ght_get_modifiers(void)
213{
214 unsigned int modifiers = 0;
215
216 if (keyboard_mods._KbMkeyU._KbMkeyS.r_shift ||
217 keyboard_mods._KbMkeyU._KbMkeyS.l_shift)
218 modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
219 if (keyboard_mods._KbMkeyU._KbMkeyS.r_ctrl ||
220 keyboard_mods._KbMkeyU._KbMkeyS.l_ctrl)
221 modifiers |= ECORE_EVENT_MODIFIER_CTRL;
222 if (keyboard_mods._KbMkeyU._KbMkeyS.r_alt ||
223 keyboard_mods._KbMkeyU._KbMkeyS.l_alt)
224 modifiers |= ECORE_EVENT_MODIFIER_ALT;
225 if (keyboard_mods._KbMkeyU._KbMkeyS.r_win ||
226 keyboard_mods._KbMkeyU._KbMkeyS.l_win)
227 modifiers |= ECORE_EVENT_MODIFIER_WIN;
228
229 if (keyboard_leds._KbLedU._KbLedS.num_lock)
230 modifiers |= ECORE_EVENT_LOCK_NUM;
231 if (keyboard_leds._KbLedU._KbLedS.caps_lock)
232 modifiers |= ECORE_EVENT_LOCK_CAPS;
233 if (keyboard_leds._KbLedU._KbLedS.scroll_lock)
234 modifiers |= ECORE_EVENT_LOCK_SCROLL;
235
236 return modifiers;
237}
238
239static void
240_ecore_psl1ght_key_modifiers(KbMkey *mods, KbLed *leds)
241{
242 Ecore_Psl1ght_Event_Key_Modifiers *ev;
243 Eina_Bool emit = EINA_FALSE;
244
245 ev = malloc(sizeof(Ecore_Psl1ght_Event_Key_Modifiers));
246 if (!ev) return;
247
248 if (mods->_KbMkeyU._KbMkeyS.l_shift !=
249 keyboard_mods._KbMkeyU._KbMkeyS.l_shift ||
250 mods->_KbMkeyU._KbMkeyS.r_shift !=
251 keyboard_mods._KbMkeyU._KbMkeyS.r_shift)
252 {
253 emit = EINA_TRUE;
254 ev->shift_changed = EINA_TRUE;
255 ev->shift = mods->_KbMkeyU._KbMkeyS.r_shift |
256 mods->_KbMkeyU._KbMkeyS.l_shift;
257 }
258 if (mods->_KbMkeyU._KbMkeyS.l_ctrl !=
259 keyboard_mods._KbMkeyU._KbMkeyS.l_ctrl ||
260 mods->_KbMkeyU._KbMkeyS.r_ctrl !=
261 keyboard_mods._KbMkeyU._KbMkeyS.r_ctrl)
262 {
263 emit = EINA_TRUE;
264 ev->ctrl_changed = EINA_TRUE;
265 ev->ctrl = mods->_KbMkeyU._KbMkeyS.r_ctrl |
266 mods->_KbMkeyU._KbMkeyS.l_ctrl;
267 }
268 if (mods->_KbMkeyU._KbMkeyS.l_alt !=
269 keyboard_mods._KbMkeyU._KbMkeyS.l_alt ||
270 mods->_KbMkeyU._KbMkeyS.r_alt !=
271 keyboard_mods._KbMkeyU._KbMkeyS.r_alt)
272 {
273 emit = EINA_TRUE;
274 ev->alt_changed = EINA_TRUE;
275 ev->alt = mods->_KbMkeyU._KbMkeyS.r_alt |
276 mods->_KbMkeyU._KbMkeyS.l_alt;
277 }
278 if (mods->_KbMkeyU._KbMkeyS.l_win !=
279 keyboard_mods._KbMkeyU._KbMkeyS.l_win ||
280 mods->_KbMkeyU._KbMkeyS.r_win !=
281 keyboard_mods._KbMkeyU._KbMkeyS.r_win)
282 {
283 emit = EINA_TRUE;
284 ev->win_changed = EINA_TRUE;
285 ev->win = mods->_KbMkeyU._KbMkeyS.r_win |
286 mods->_KbMkeyU._KbMkeyS.l_win;
287 }
288 keyboard_mods = *mods;
289
290 if (leds->_KbLedU._KbLedS.num_lock !=
291 keyboard_leds._KbLedU._KbLedS.num_lock)
292 {
293 emit = EINA_TRUE;
294 ev->num_lock_changed = EINA_TRUE;
295 ev->num_lock = leds->_KbLedU._KbLedS.num_lock;
296 }
297 if (leds->_KbLedU._KbLedS.caps_lock !=
298 keyboard_leds._KbLedU._KbLedS.caps_lock)
299 {
300 emit = EINA_TRUE;
301 ev->caps_lock_changed = EINA_TRUE;
302 ev->caps_lock = leds->_KbLedU._KbLedS.caps_lock;
303 }
304 if (leds->_KbLedU._KbLedS.scroll_lock !=
305 keyboard_leds._KbLedU._KbLedS.scroll_lock)
306 {
307 emit = EINA_TRUE;
308 ev->scroll_lock_changed = EINA_TRUE;
309 ev->scroll_lock = leds->_KbLedU._KbLedS.scroll_lock;
310 }
311 keyboard_leds = *leds;
312
313 if (emit)
314 {
315 ev->timestamp = _ecore_psl1ght_get_time ();
316 ev->modifiers = _ecore_psl1ght_get_modifiers();
317 ecore_event_add(ECORE_PSL1GHT_EVENT_KEY_MODIFIERS, ev, NULL, NULL);
318 }
319 else
320 {
321 free(ev);
322 }
323}
324
325static void
326unicodeToUtf8(u16 w, char *utf8buf)
327{
328 unsigned char *utf8s = (unsigned char *)utf8buf;
329
330 if ( w < 0x0080 )
331 {
332 utf8s[0] = ( unsigned char )w;
333 utf8s[1] = 0;
334 }
335 else if ( w < 0x0800 )
336 {
337 utf8s[0] = 0xc0 | ((w) >> 6);
338 utf8s[1] = 0x80 | ((w) & 0x3f);
339 utf8s[2] = 0;
340 }
341 else {
342 utf8s[0] = 0xe0 | ((w) >> 12);
343 utf8s[1] = 0x80 | (((w) >> 6) & 0x3f);
344 utf8s[2] = 0x80 | ((w) & 0x3f);
345 utf8s[3] = 0;
346 }
347}
348
349static Ecore_Event_Key *
350_ecore_psl1ght_event_key(u16 key)
351{
352 Ecore_Event_Key *ev;
353 char utf8[4];
354 u16 utf16;
355 unsigned int i;
356
357 ev = calloc(1, sizeof(Ecore_Event_Key));
358 if (!ev) return NULL;
359
360 ev->timestamp = _ecore_psl1ght_get_time ();
361 ev->window = 0;
362 ev->event_window = 0;
363 ev->modifiers = _ecore_psl1ght_get_modifiers();
364
365 key &= ~KB_KEYPAD;
366 for (i = 0; i < sizeof(keystable) / sizeof(struct _ecore_psl1ght_keys_s); ++i)
367 if (keystable[i].code == key)
368 {
369 ev->keyname = keystable[i].name;
370 ev->key = keystable[i].name;
371 ev->string = keystable[i].compose;
372 ev->compose = keystable[i].compose;
373
374 return ev;
375 }
376
377 utf16 = ioKbCnvRawCode (KB_MAPPING_101, keyboard_mods, keyboard_leds, key);
378 unicodeToUtf8(utf16, utf8);
379 ev->keyname = ev->key = ev->string = ev->compose = strdup (utf8);
380
381 return ev;
382}
383
384static void
385_ecore_psl1ght_mouse_move(s32 x_axis, s32 y_axis)
386{
387 Ecore_Event_Mouse_Move *ev;
388
389 ev = calloc(1, sizeof(Ecore_Event_Mouse_Move));
390 if (!ev) return;
391
392 mouse_x += x_axis;
393 mouse_y += y_axis;
394 if (mouse_x < 0) mouse_x = 0;
395 if (mouse_y < 0) mouse_y = 0;
396 if (mouse_x > window_width) mouse_x = window_width;
397 if (mouse_y > window_height) mouse_y = window_height;
398
399 ev->window = 0;
400 ev->root_window = 0;
401 ev->event_window = 0;
402 ev->same_screen = 0;
403 ev->timestamp = _ecore_psl1ght_get_time ();
404 ev->modifiers = _ecore_psl1ght_get_modifiers ();
405 ev->x = ev->root.x = mouse_x;
406 ev->y = ev->root.x = mouse_y;
407
408 ev->multi.device = 0;
409 ev->multi.radius = ev->multi.radius_x = ev->multi.radius_y = 0;
410 ev->multi.pressure = ev->multi.angle = 0;
411 ev->multi.x = ev->multi.y = ev->multi.root.x = ev->multi.root.y = 0;
412
413 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
414}
415
416static void
417_ecore_psl1ght_mouse_button(int button, int pressed)
418{
419 Ecore_Event_Mouse_Button *ev;
420 static unsigned int previous_timestamp = 0;
421
422 ev = calloc(1, sizeof(Ecore_Event_Mouse_Button));
423 if (!ev) return;
424
425 ev->window = 0;
426 ev->root_window = 0;
427 ev->event_window = 0;
428 ev->same_screen = 0;
429 ev->timestamp = _ecore_psl1ght_get_time ();
430 ev->modifiers = _ecore_psl1ght_get_modifiers ();
431 ev->buttons = button;
432 if (ev->timestamp - previous_timestamp <= 500)
433 ev->double_click = 1;
434 ev->triple_click = 0;
435 previous_timestamp = ev->timestamp;
436
437 ev->x = ev->root.x = mouse_x;
438 ev->y = ev->root.y = mouse_y;
439 ev->multi.device = 0;
440 ev->multi.radius = ev->multi.radius_x = ev->multi.radius_y = 0;
441 ev->multi.pressure = ev->multi.angle = 0;
442 ev->multi.x = ev->multi.y = ev->multi.root.x = ev->multi.root.y = 0;
443
444 if (pressed)
445 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL);
446 else
447 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
448}
449
450static void
451_ecore_psl1ght_mouse_wheel(s8 wheel, s8 tilt)
452{
453 Ecore_Event_Mouse_Wheel *ev;
454
455 ev = calloc(1, sizeof(Ecore_Event_Mouse_Wheel));
456 if (!ev) return;
457
458 ev->timestamp = _ecore_psl1ght_get_time ();
459 ev->window = 0;
460 ev->event_window = 0;
461 ev->modifiers = _ecore_psl1ght_get_modifiers ();
462 ev->direction = 0;
463 ev->z = wheel;
464
465 ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, NULL, NULL);
466}
467
468static void
469_ecore_psl1ght_pad_button (const char *name, int pressed)
470{
471 Ecore_Event_Key *ev = NULL;
472
473 ev = calloc(1, sizeof(Ecore_Event_Key));
474 if (!ev) return;
475
476 ev->timestamp = _ecore_psl1ght_get_time ();
477 ev->window = 0;
478 ev->event_window = 0;
479 ev->modifiers = 0;
480
481 ev->keyname = name;
482 ev->key = name;
483 ev->string = "";
484 ev->compose = "";
485
486 if (pressed)
487 ecore_event_add(ECORE_EVENT_KEY_DOWN, ev, NULL, NULL);
488 else
489 ecore_event_add(ECORE_EVENT_KEY_UP, ev, NULL, NULL);
490}
491
492#define PAD_STICK_DEADZONE 0x20
493
494static void
495_ecore_psl1ght_poll_joypad(void)
496{
497 padInfo padinfo;
498 int i;
499
500 /**/
501 /* Check mouse events */
502 ioPadGetInfo (&padinfo);
503
504 for (i = 0; i < 4; i++) /* Ignore the move */
505 {
506 if (padinfo.status[i])
507 {
508 int analog_h, analog_v;
509
510 if (ioPadGetData (i, &pad_data) != 0)
511 continue;
512 analog_h = pad_data.ANA_L_H - 0x80;
513 analog_v = pad_data.ANA_L_V - 0x80;
514
515 if (analog_h > PAD_STICK_DEADZONE)
516 analog_h -= PAD_STICK_DEADZONE;
517 else if (analog_h < -PAD_STICK_DEADZONE)
518 analog_h += PAD_STICK_DEADZONE;
519 else
520 analog_h = 0;
521 analog_h /= 10;
522
523 if (analog_v > PAD_STICK_DEADZONE)
524 analog_v -= PAD_STICK_DEADZONE;
525 else if (analog_v < -PAD_STICK_DEADZONE)
526 analog_v += PAD_STICK_DEADZONE;
527 else
528 analog_v = 0;
529 analog_v /= 10;
530
531 if (analog_h != 0 || analog_v != 0)
532 _ecore_psl1ght_mouse_move (analog_h, analog_v);
533
534 if (old_pad_data.BTN_CROSS ^ pad_data.BTN_CROSS) {
535 _ecore_psl1ght_pad_button ("Cross", pad_data.BTN_CROSS);
536 _ecore_psl1ght_mouse_button (1, pad_data.BTN_CROSS);
537 }
538 if (old_pad_data.BTN_CIRCLE ^ pad_data.BTN_CIRCLE) {
539 _ecore_psl1ght_pad_button ("Circle", pad_data.BTN_CIRCLE);
540 _ecore_psl1ght_mouse_button (3, pad_data.BTN_CIRCLE);
541 }
542 if (old_pad_data.BTN_SQUARE ^ pad_data.BTN_SQUARE)
543 _ecore_psl1ght_pad_button ("Square", pad_data.BTN_SQUARE);
544 if (old_pad_data.BTN_TRIANGLE ^ pad_data.BTN_TRIANGLE)
545 _ecore_psl1ght_pad_button ("Triangle", pad_data.BTN_TRIANGLE);
546 if (old_pad_data.BTN_UP ^ pad_data.BTN_UP)
547 _ecore_psl1ght_pad_button ("Up", pad_data.BTN_UP);
548 if (old_pad_data.BTN_DOWN ^ pad_data.BTN_DOWN)
549 _ecore_psl1ght_pad_button ("Down", pad_data.BTN_DOWN);
550 if (old_pad_data.BTN_LEFT ^ pad_data.BTN_LEFT)
551 _ecore_psl1ght_pad_button ("Left", pad_data.BTN_LEFT);
552 if (old_pad_data.BTN_RIGHT ^ pad_data.BTN_RIGHT)
553 _ecore_psl1ght_pad_button ("Right", pad_data.BTN_RIGHT);
554 if (old_pad_data.BTN_L1 ^ pad_data.BTN_L1)
555 _ecore_psl1ght_pad_button ("L1", pad_data.BTN_L1);
556 if (old_pad_data.BTN_L2 ^ pad_data.BTN_L2)
557 _ecore_psl1ght_pad_button ("L2", pad_data.BTN_L2);
558 if (old_pad_data.BTN_L3 ^ pad_data.BTN_L3)
559 _ecore_psl1ght_pad_button ("L3", pad_data.BTN_L3);
560 if (old_pad_data.BTN_R1 ^ pad_data.BTN_R1)
561 _ecore_psl1ght_pad_button ("R1", pad_data.BTN_R1);
562 if (old_pad_data.BTN_R2 ^ pad_data.BTN_R2)
563 _ecore_psl1ght_pad_button ("R2", pad_data.BTN_R2);
564 if (old_pad_data.BTN_R3 ^ pad_data.BTN_R3)
565 _ecore_psl1ght_pad_button ("R3", pad_data.BTN_R3);
566 if (old_pad_data.BTN_START ^ pad_data.BTN_START)
567 _ecore_psl1ght_pad_button ("Start", pad_data.BTN_START);
568 if (old_pad_data.BTN_SELECT ^ pad_data.BTN_SELECT)
569 _ecore_psl1ght_pad_button ("Select", pad_data.BTN_SELECT);
570
571 old_pad_data = pad_data;
572 }
573 }
574}
575
576static void
577_ecore_psl1ght_poll_mouse(void)
578{
579 mouseInfo mouseinfo;
580 u32 i;
581
582 /**/
583 /* Check mouse events */
584 ioMouseGetInfo(&mouseinfo);
585
586 if (mouseinfo.status[0] == 1 && !mouse_connected) // Connected
587 {
588 mouse_connected = TRUE;
589 mouse_buttons = 0;
590
591 // Old events in the queue are discarded
592 ioMouseClearBuf(0);
593 }
594 else if (mouseinfo.status[0] != 1 && mouse_connected) // Disconnected
595 {
596 mouse_connected = FALSE;
597 mouse_buttons = 0;
598 }
599
600 if (mouse_connected)
601 {
602 mouseDataList datalist;
603
604 ioMouseGetDataList(0, &datalist);
605
606 for (i = 0; i < datalist.count; i++)
607 {
608 u8 old_left = mouse_buttons & 1;
609 u8 new_left = datalist.list[i].buttons & 1;
610 u8 old_right = mouse_buttons & 2;
611 u8 new_right = datalist.list[i].buttons & 2;
612 u8 old_middle = mouse_buttons & 4;
613 u8 new_middle = datalist.list[i].buttons & 4;
614
615 if (datalist.list[i].x_axis != 0 ||
616 datalist.list[i].y_axis != 0)
617 _ecore_psl1ght_mouse_move (datalist.list[i].x_axis,
618 datalist.list[i].y_axis);
619
620 if (old_left != new_left)
621 _ecore_psl1ght_mouse_button (1, new_left);
622 if (old_middle != new_middle)
623 _ecore_psl1ght_mouse_button (2, new_middle);
624 if (old_right != new_right)
625 _ecore_psl1ght_mouse_button (3, new_right);
626
627 if (datalist.list[i].wheel != 0)
628 _ecore_psl1ght_mouse_wheel (datalist.list[i].wheel,
629 datalist.list[i].tilt);
630
631 mouse_buttons = datalist.list[i].buttons;
632 }
633 }
634}
635
636static void
637_ecore_psl1ght_poll_move(void)
638{
639 u16 new_buttons;
640 static int t_pressed = 0;
641 static int calibrated = 0;
642 static float prev_x = 0;
643 static float prev_y = 0;
644 static int gyro = 0;
645 float x, y, z;
646
647 /* Check move events */
648 processMove (move_context);
649 new_buttons = move_context->state.paddata.buttons & (~move_buttons);
650 move_buttons = move_context->state.paddata.buttons;
651
652 moveGet3DPosition (move_context, &x, &y, &z);
653 //printf ("Move 3D position is : %f, %f, %f\n", x,y,z);
654
655 switch (new_buttons) {
656 case 1:
657 gyro = !gyro;
658 break;
659
660 case 4:
661 // Move button
662 //printf ("Calibrating\n");
663 gemCalibrate (0);
664 calibrated = 1;
665 break;
666
667 case 8:
668 // start button
669 _ecore_psl1ght_mouse_move ((window_width / 2) - mouse_x, (window_height / 2) - mouse_y);
670 break;
671 }
672
673 if (calibrated)
674 {
675 float x_axis, y_axis;
676
677 if (gyro)
678 {
679 gemInertialState gem_inert;
680
681 gemGetInertialState (0, 0, 0, &gem_inert);
682 x_axis = -vec_array (gem_inert.gyro, 1) * 25;
683 y_axis = -vec_array (gem_inert.gyro, 0) * 25;
684 if (abs (x_axis) > 2 || abs (y_axis) > 2)
685 _ecore_psl1ght_mouse_move (x_axis, y_axis);
686 }
687 else {
688 x_axis = (x - prev_x) * 2.5;
689 y_axis = -(y - prev_y) * 2.5;
690 prev_x = x;
691 prev_y = y;
692 _ecore_psl1ght_mouse_move (x_axis, y_axis);
693 }
694
695 if (!t_pressed && (move_buttons & 0x2))
696 _ecore_psl1ght_mouse_button (1, 1);
697 else if (t_pressed && (move_buttons & 0x2) == 0)
698 _ecore_psl1ght_mouse_button (1, 0);
699 t_pressed = move_buttons & 0x2;
700 }
701}
702
703static void
704_ecore_psl1ght_poll_keyboard(void)
705{
706 KbInfo kbInfo;
707 int i;
708
709 /* Check keyboard events */
710 ioKbGetInfo(&kbInfo);
711
712 if (kbInfo.status[0] == 1 && !keyboard_connected)
713 {
714 /* Connected */
715 keyboard_connected = true;
716
717 // Old events in the queue are discarded
718 ioKbClearBuf(0);
719 keyboard_leds._KbLedU.leds = 0;
720 keyboard_mods._KbMkeyU.mkeys = 0;
721 keyboard_old_key = 0;
722
723 // Set raw keyboard code types to get scan codes
724 ioKbSetCodeType(0, KB_CODETYPE_RAW);
725 ioKbSetReadMode(0, KB_RMODE_INPUTCHAR);
726 }
727 else if (kbInfo.status[0] != 1 && keyboard_connected)
728 {
729 /* Disconnected keyboard */
730 keyboard_connected = FALSE;
731 }
732
733 if (keyboard_connected)
734 {
735 KbData Keys;
736
737 // Read data from the keyboard buffer
738 if (ioKbRead(0, &Keys) == 0 && Keys.nb_keycode > 0)
739 {
740 Ecore_Event_Key *ev = NULL;
741
742 _ecore_psl1ght_key_modifiers (&Keys.mkey, &Keys.led);
743
744 if (Keys.nb_keycode == 0 && keyboard_old_key != 0)
745 {
746 ev = _ecore_psl1ght_event_key (keyboard_old_key);
747 if (ev) ecore_event_add(ECORE_EVENT_KEY_UP, ev, NULL, NULL);
748 }
749 for (i = 0; i < Keys.nb_keycode; i++)
750 {
751 if (Keys.keycode[i] != keyboard_old_key)
752 {
753 if (Keys.keycode[i] != 0)
754 {
755 ev = _ecore_psl1ght_event_key (Keys.keycode[i]);
756 if (ev)
757 ecore_event_add(ECORE_EVENT_KEY_DOWN, ev,
758 NULL, NULL);
759 }
760 else
761 {
762 ev = _ecore_psl1ght_event_key (keyboard_old_key);
763 if (ev)
764 ecore_event_add(ECORE_EVENT_KEY_UP, ev,
765 NULL, NULL);
766 }
767 keyboard_old_key = Keys.keycode[0];
768 }
769 }
770 }
771 }
772}
773
774static void
775xmb_event_handler(u64 status, u64 param, void *user_data)
776{
777 //printf ("Received event %lX\n", status);
778 switch (status) {
779 case SYSUTIL_EXIT_GAME:
780 ecore_event_add(ECORE_PSL1GHT_EVENT_QUIT, NULL, NULL, NULL);
781 break;
782 case SYSUTIL_DRAW_BEGIN:
783 ecore_event_add(ECORE_PSL1GHT_EVENT_EXPOSE, NULL, NULL, NULL);
784 case SYSUTIL_MENU_OPEN:
785 ecore_event_add(ECORE_PSL1GHT_EVENT_LOST_FOCUS, NULL, NULL, NULL);
786 break;
787 case SYSUTIL_DRAW_END:
788 ecore_event_add(ECORE_PSL1GHT_EVENT_EXPOSE, NULL, NULL, NULL);
789 case SYSUTIL_MENU_CLOSE:
790 ecore_event_add(ECORE_PSL1GHT_EVENT_GOT_FOCUS, NULL, NULL, NULL);
791 break;
792 default:
793 break;
794 }
795}
796
797EAPI void
798ecore_psl1ght_poll_events(void)
799{
800 _ecore_psl1ght_poll_joypad ();
801 _ecore_psl1ght_poll_mouse ();
802 if (move_context)
803 _ecore_psl1ght_poll_move ();
804 _ecore_psl1ght_poll_keyboard ();
805
806 sysUtilCheckCallback ();
807}
808
809EAPI void
810ecore_psl1ght_resolution_set(int width, int height)
811{
812 window_width = width;
813 window_height = height;
814 if (mouse_x > window_width) mouse_x = window_width;
815 if (mouse_y > window_height) mouse_y = window_height;
816}
817
818EAPI void
819ecore_psl1ght_screen_resolution_get(int *w, int *h)
820{
821 videoState state;
822 videoResolution resolution;
823
824 /* Get the state of the display */
825 if (videoGetState (0, 0, &state) == 0 &&
826 videoGetResolution (state.displayMode.resolution, &resolution) == 0)
827 {
828 if (w) *w = resolution.width;
829 if (h) *h = resolution.height;
830 }
831 else {
832 if (w) *w = 0;
833 if (h) *h = 0;
834 }
835}
836
837EAPI void
838ecore_psl1ght_optimal_screen_resolution_get(int *w, int *h)
839{
840 videoDeviceInfo info;
841 videoResolution res;
842 int area = 720 * 480;
843 int mode_area;
844 int i;
845
846 if (w) *w = 720;
847 if (h) *h = 480;
848
849 videoGetDeviceInfo(0, 0, &info);
850
851 for (i = 0; i < info.availableModeCount; i++) {
852 videoGetResolution (info.availableModes[i].resolution, &res);
853 mode_area = res.width * res.height;
854 if (mode_area > area)
855 {
856 area = mode_area;
857 if (w) *w = res.width;
858 if (h) *h = res.height;
859 }
860 }
861}
862
diff --git a/src/lib/ecore_psl1ght/ecore_psl1ght_private.h b/src/lib/ecore_psl1ght/ecore_psl1ght_private.h
deleted file mode 100644
index b3def79..0000000
--- a/src/lib/ecore_psl1ght/ecore_psl1ght_private.h
+++ /dev/null
@@ -1,36 +0,0 @@
1#ifndef _ECORE_PSL1GHT_PRIVATE_H
2# define _ECORE_PSL1GHT_PRIVATE_H
3
4extern int _ecore_psl1ght_log_dom;
5
6# ifdef ECORE_PSL1GHT_DEFAULT_LOG_COLOR
7# undef ECORE_PSL1GHT_DEFAULT_LOG_COLOR
8# endif
9# define ECORE_PSL1GHT_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
10
11# ifdef ERR
12# undef ERR
13# endif
14# define ERR(...) EINA_LOG_DOM_ERR(_ecore_psl1ght_log_dom, __VA_ARGS__)
15
16# ifdef DBG
17# undef DBG
18# endif
19# define DBG(...) EINA_LOG_DOM_DBG(_ecore_psl1ght_log_dom, __VA_ARGS__)
20
21# ifdef INF
22# undef INF
23# endif
24# define INF(...) EINA_LOG_DOM_INFO(_ecore_psl1ght_log_dom, __VA_ARGS__)
25
26# ifdef WRN
27# undef WRN
28# endif
29# define WRN(...) EINA_LOG_DOM_WARN(_ecore_psl1ght_log_dom, __VA_ARGS__)
30
31# ifdef CRI
32# undef CRI
33# endif
34# define CRI(...) EINA_LOG_DOM_CRIT(_ecore_psl1ght_log_dom, __VA_ARGS__)
35
36#endif
diff --git a/src/lib/ecore_psl1ght/gemutil.c b/src/lib/ecore_psl1ght/gemutil.c
deleted file mode 100644
index 9ccfc1c..0000000
--- a/src/lib/ecore_psl1ght/gemutil.c
+++ /dev/null
@@ -1,281 +0,0 @@
1#include <stdio.h>
2#include <io/move.h>
3#include <sys/memory.h>
4#include <ppu-types.h>
5#include <io/camera.h>
6#include <ppu-types.h>
7#include <spurs/spurs.h>
8#include <sys/spu.h>
9#include <sys/thread.h>
10#include <sys/systime.h>
11
12#define SPURS_DEFAULT_PREFIX_NAME "gem_spurs"
13
14u16 oldGemPad = 0;
15u16 newGemPad = 0;
16u16 newGemAnalogT = 0;
17extern cameraReadInfo camread;
18
19static inline float
20vec_array(vec_float4 vec, unsigned int idx)
21{
22 union {
23 vec_float4 vec;
24 float array[4];
25 } v;
26
27 v.vec = vec;
28
29 if (idx > 3)
30 return -1;
31 return v.array[idx];
32}
33
34int
35initMove()
36{
37 Spurs *spurs;
38 gemAttribute gem_attr;
39 u8 gem_spu_priorities[8] = { 1, 0, 0, 0, 0, 0, 0, 0 };
40 int ret;
41 int i;
42
43 spurs = initSpurs (NULL);
44
45 if (spurs == NULL)
46 goto error;
47
48 printf ("preparing GemAttribute structure with spurs\n");
49
50 initAttributeGem (&gem_attr, 1, NULL, spurs, gem_spu_priorities);
51 gem_attr->version = 2;
52 gem_attr->max = 1;
53 gem_attr->spurs = spurs;
54 gem_attr->memory = NULL;
55 gem_attr->spu_priorities[0] = 1;
56 for (i = 1; i < 8; ++i)
57 gem_attr->spu_priorities[i] = 0;
58
59 printf ("calling GemInit with GemAttribute structure version=%d max_connect=%d spurs=%X\n",
60 gem_attr.version, gem_attr.max, gem_attr.spurs);
61 ret = gemInit (&gem_attr);
62 printf ("return from GemInit %X \n", ret);
63 if (ret)
64 goto error;
65
66 ret = gemPrepareCamera (128, 0.5);
67 printf ("GemPrepareCamera return %d exposure set to 128 and quality to 0.5\n",
68 ret);
69 if (ret)
70 goto error;
71 ret = gemReset (0);
72 printf ("GemReset return %X \n", ret);
73 if (ret)
74 goto error;
75 return ret;
76
77error:
78 if (spurs)
79 endSpurs (spurs);
80 return NULL;
81}
82
83int
84endMove()
85{
86 endSpurs (spurs);
87 gemEnd ();
88 return 0;
89}
90
91int
92proccessGem(int t)
93{
94 int ret;
95
96 switch (t) {
97 case 0:
98
99 ret = gemUpdateStart (camread.buffer, camread.timestamp);
100
101 if (ret != 0)
102 {
103 printf ("Return from gemUpdateStart %X\n", ret);
104 }
105 break;
106
107 case 2:
108
109 ret = gemUpdateFinish ();
110 if (ret != 0)
111 {
112 printf ("Return from gemUpdateFinish %X\n", ret);
113 }
114 break;
115
116 case 3:
117 ret = gemConvertVideoFinish ();
118 if (ret != 0)
119 {
120 printf ("Return from gemConvertVideoFinish %X\n", ret);
121 }
122 break;
123
124 default:
125 ret = -1;
126 break;
127 }
128 return ret;
129}
130
131void
132readGemPad(int num_gem)
133{
134 gemState gem_state;
135 int ret;
136 unsigned int hues[] = { 4 << 24, 4 << 24, 4 << 24, 4 << 24 };
137 ret = gemGetState (0, 0, -22000, &gem_state);
138
139 newGemPad = gem_state.paddata.buttons & (~oldGemPad);
140 newGemAnalogT = gem_state.paddata.ANA_T;
141 oldGemPad = gem_state.paddata.buttons;
142
143 switch (ret) {
144 case 2:
145 gemForceRGB (num_gem, 0.5, 0.5, 0.5);
146 break;
147
148 case 5:
149
150 gemTrackHues (hues, NULL);
151 break;
152
153 default:
154 break;
155 }
156}
157
158void
159readGemAccPosition(int num_gem)
160{
161 vec_float4 position;
162
163 gemGetAccelerometerPositionInDevice (num_gem, &position);
164
165 printf (" accelerometer device coordinates [%f,%f,%f,%f]\n",
166 vec_array (position, 0), vec_array (position, 1), vec_array (position, 2),
167 vec_array (position, 3));
168}
169
170void
171readGemInertial(int num_gem)
172{
173 gemInertialState gem_inertial_state;
174 int ret;
175
176 ret = gemGetInertialState (num_gem, 0, -22000, &gem_inertial_state);
177 printf ("gemGetInertialState return %X\n", ret);
178 printf ("counter %d temperature %f\n", gem_inertial_state.counter,
179 gem_inertial_state.temperature);
180
181 printf (" accelerometer sensor [%f,%f,%f,%f]\n",
182 vec_array (gem_inertial_state.accelerometer, 0),
183 vec_array (gem_inertial_state.accelerometer, 1),
184 vec_array (gem_inertial_state.accelerometer, 2),
185 vec_array (gem_inertial_state.accelerometer, 3));
186
187 printf (" accelerometer_bias sensor [%f,%f,%f,%f]\n",
188 vec_array (gem_inertial_state.accelerometer_bias, 0),
189 vec_array (gem_inertial_state.accelerometer_bias, 1),
190 vec_array (gem_inertial_state.accelerometer_bias, 2),
191 vec_array (gem_inertial_state.accelerometer_bias, 3));
192
193 printf (" gyro sensor [%f,%f,%f,%f]\n", vec_array (gem_inertial_state.gyro,
194 0), vec_array (gem_inertial_state.gyro, 1),
195 vec_array (gem_inertial_state.gyro, 2),
196 vec_array (gem_inertial_state.gyro, 3));
197
198 printf (" gyro_bias sensor [%f,%f,%f,%f]\n",
199 vec_array (gem_inertial_state.gyro_bias, 0),
200 vec_array (gem_inertial_state.gyro_bias, 1),
201 vec_array (gem_inertial_state.gyro_bias, 2),
202 vec_array (gem_inertial_state.gyro_bias, 3));
203}
204
205void
206readGem()
207{
208 gemState gem_state;
209 proccessGem (0);
210
211 proccessGem (2);
212
213 readGemPad (0); // This will read buttons from Move
214 switch (newGemPad) {
215 case 1:
216 printf ("Select pressed \n");
217 break;
218
219 case 2:
220 printf ("T pressed value %d\n", newGemAnalogT);
221 printf
222 ("Frame %d center of the sphere in world coordinates %f %f %f %f \n",
223 camread.frame, vec_array (gem_state.pos, 0), vec_array (gem_state.pos,
224 1), vec_array (gem_state.pos, 2), vec_array (gem_state.pos, 3));
225 break;
226
227 case 4:
228 printf ("Move pressed \n");
229 gemCalibrate (0);
230 break;
231
232 case 8:
233 printf ("Start pressed \n");
234 pos_x = 0;
235 pos_y = 0;
236 break;
237
238 case 16:
239 printf ("Triangle pressed \n");
240 getImageState ();
241 break;
242
243 case 32:
244 printf ("Circle pressed \n");
245 break;
246
247 case 64:
248 printf ("Cross pressed \n");
249 printf ("X,Y,Z position (mm) %f %f %f\n", vec_array (gem_state.pos, 0),
250 vec_array (gem_state.pos, 1), vec_array (gem_state.pos, 2));
251 readGemAccPosition (0);
252 break;
253
254 case 128:
255 printf ("Square pressed \n");
256 readGemInertial (0);
257 break;
258
259 default:
260 break;
261 }
262}
263
264void
265getImageState()
266{
267 int ret;
268
269 gemImageState imgState;
270
271 gemGetImageState (0, &imgState);
272 printf (" u [%f]\n", imgState.u);
273 printf (" v [%f]\n", imgState.v);
274 printf (" r [%f]\n", imgState.r);
275 printf (" projectionx [%f]\n", imgState.projectionx);
276 printf (" projectiony [%f]\n", imgState.projectiony);
277 printf (" distance [%f]\n", imgState.distance);
278 printf ("visible=%d r_valid=%d\n", imgState.visible, imgState.r_valid);
279 printf ("tiemestamp=%Ld\n", imgState.frame_time);
280}
281
diff --git a/src/lib/ecore_psl1ght/gemutil.h b/src/lib/ecore_psl1ght/gemutil.h
deleted file mode 100644
index ce4b544..0000000
--- a/src/lib/ecore_psl1ght/gemutil.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * Copyright (C) Antonio José Ramos Márquez (bigboss)
3 * Copyright (C) Youness Alaoui (KaKaRoTo)
4 */
5
6#ifndef __GEMUTIL_H__
7#define __GEMUTIL_H__
8
9#include <ppu-types.h>
10#include <spurs/spurs.h>
11#include <io/camera.h>
12#include <io/move.h>
13
14typedef struct
15{
16 Spurs *spurs;
17} moveContext;
18
19#endif /* __GEMUTIL_H__ */
diff --git a/src/lib/ecore_psl1ght/moveutil.c b/src/lib/ecore_psl1ght/moveutil.c
deleted file mode 100644
index 1dadfbc..0000000
--- a/src/lib/ecore_psl1ght/moveutil.c
+++ /dev/null
@@ -1,245 +0,0 @@
1#include <stdio.h>
2#include <io/move.h>
3#include <sys/memory.h>
4#include <ppu-types.h>
5#include <io/camera.h>
6#include <ppu-types.h>
7#include <spurs/spurs.h>
8#include <sys/thread.h>
9#include <sys/systime.h>
10
11#include "spursutil.h"
12#include "moveutil.h"
13
14u16 oldGemPad = 0;
15u16 newGemPad = 0;
16u16 newGemAnalogT = 0;
17
18static void
19endCamera(moveContext *context)
20{
21 cameraStop (0);
22
23 cameraClose (0);
24 cameraEnd ();
25
26 sysMemContainerDestroy (context->camInfo.container);
27}
28
29static int
30initCamera(moveContext *context)
31{
32 int ret;
33
34 context->camInfo.container = NULL;
35
36 ret = cameraInit ();
37 printf ("cameraInit() returned %d\n", ret);
38 if (ret == 0)
39 {
40 cameraType type = CAM_TYPE_UNKNOWN;
41
42 ret = cameraGetType (0, &type);
43 if (ret == 0 && type == CAM_TYPE_PLAYSTATION_EYE)
44 {
45 context->camInfo.format = CAM_FORM_RAW8;
46 context->camInfo.framerate = 60;
47 context->camInfo.resolution = CAM_RESO_VGA;
48 context->camInfo.info_ver = 0x0101;
49 ret = sysMemContainerCreate (&context->camInfo.container, 0x200000);
50 printf ("sysMemContainerCreate() for camera container returned %d\n", ret);
51
52 ret = cameraOpenEx (0, &context->camInfo);
53 switch (ret) {
54 case 0:
55 printf ("Found me an eye, arrr!\n");
56 printf ("cameraOpenEx returned %08X\n", ret);
57 printf ("Video dimensions: %dx%d\n", context->camInfo.width, context->camInfo.height);
58 printf ("Buffer at %08X\n", context->camInfo.buffer);
59 printf ("pbuf0 Buffer at %08X\n", context->camInfo.pbuf[0]);
60 printf ("pbuf0 Buffer at %08X\n", context->camInfo.pbuf[1]);
61 printf ("context->camInfo.info_ver %X\n", context->camInfo.info_ver);
62
63 context->camRead.buffer = context->camInfo.buffer;
64 context->camRead.version = 0x0100;
65 printf ("Setting CameraReadEx %08X buffer to cameraInfoex buffer \n",
66 context->camRead.buffer);
67 break;
68
69 default:
70 printf ("Error %X detected opening PlayStation Eye\n", ret);
71 goto error;
72 }
73 }
74 else {
75 printf ("Device detected is not a PlayStation Eye and this sample need it\n");
76 goto error;
77 }
78 }
79 else {
80 goto error;
81 }
82 return ret;
83
84error:
85 if (context->camInfo.container)
86 sysMemContainerDestroy (context->camInfo.container);
87 return ret;
88}
89
90static int
91readCamera(moveContext *context)
92{
93 int ret;
94
95 ret = cameraReadEx (0, &context->camRead);
96 switch (ret) {
97 case CAMERA_ERRO_NEED_START:
98 cameraReset (0);
99 ret = gemPrepareCamera (128, 0.5);
100 printf ("GemPrepareCamera return %d exposure set to 128 and quality to 0.5 before cameraStart\n",
101 ret);
102 printf ("lets go!! It's time to look your face in Sony Bravia :P\n");
103 ret = cameraStart (0);
104 printf ("cameraStart return %d \n", ret);
105 printf ("*******************************************\n");
106 printf ("* Now make sure you have a Move connected\n");
107 printf ("* and point it towards the camera and press\n");
108 printf ("* the action button to calibrate\n");
109 printf ("*******************************************\n");
110 break;
111
112 case 0:
113 break;
114
115 default:
116 printf ("error %08X ", ret);
117 ret = 1;
118 break;
119 }
120 // printf("despues de start return %d \n",ret);
121 if (ret == 0 && context->camRead.readcount != 0)
122 {
123 return context->camRead.readcount;
124 }
125 else {
126 return 0;
127 }
128}
129
130moveContext *
131initMove()
132{
133 moveContext *context = NULL;
134 Spurs *spurs;
135 gemAttribute gem_attr;
136 int ret;
137 int i;
138
139 spurs = initSpurs ("gem_spurs");
140
141 if (spurs == NULL)
142 goto error;
143
144 printf ("preparing GemAttribute structure with spurs\n");
145
146 gem_attr.version = 2;
147 gem_attr.max = 1;
148 gem_attr.spurs = spurs;
149 gem_attr.memory = NULL;
150 gem_attr.spu_priorities[0] = 1;
151 for (i = 1; i < 8; ++i)
152 gem_attr.spu_priorities[i] = 0;
153
154 printf ("calling GemInit with GemAttribute structure version=%d max_connect=%d spurs=%X\n",
155 gem_attr.version, gem_attr.max, gem_attr.spurs);
156 ret = gemInit (&gem_attr);
157 printf ("return from GemInit %X \n", ret);
158 if (ret)
159 goto error;
160
161 ret = gemPrepareCamera (128, 0.5);
162 printf ("GemPrepareCamera return %d exposure set to 128 and quality to 0.5\n",
163 ret);
164 if (ret)
165 goto error;
166 ret = gemReset (0);
167 printf ("GemReset return %X \n", ret);
168 if (ret)
169 goto error;
170
171 context = (moveContext *)malloc (sizeof (moveContext));
172 context->spurs = spurs;
173 ret = initCamera (context);
174
175 if (ret == 0)
176 return context;
177
178error:
179 if (spurs)
180 endSpurs (spurs);
181 if (context)
182 free (context);
183 return NULL;
184}
185
186void
187endMove(moveContext *context)
188{
189 /* Stop Move */
190 gemEnd ();
191 /* Stop Camera */
192 endCamera (context);
193 /* Stop Spurs */
194 endSpurs (context->spurs);
195
196 free (context);
197}
198
199int
200processMove(moveContext *context)
201{
202 const unsigned int hues[] = { 4 << 24, 4 << 24, 4 << 24, 4 << 24 };
203 int ret = -1;
204
205 if (readCamera (context) > 0)
206 {
207 ret = gemUpdateStart (context->camRead.buffer, context->camRead.timestamp);
208 //printf ("Return from gemUpdateStart %X\n", ret);
209 if (ret == 0)
210 {
211 ret = gemUpdateFinish ();
212 //printf ("Return from gemUpdateFinish %X\n", ret);
213 if (ret == 0)
214 {
215 ret = gemGetState (0, STATE_LATEST_IMAGE_TIME, 0, &context->state);
216 switch (ret) {
217 case 2:
218 gemForceRGB (0, 0.5, 0.5, 0.5);
219 break;
220
221 case 5:
222 gemTrackHues (hues, NULL);
223 break;
224
225 default:
226 break;
227 }
228 }
229 }
230 }
231
232 return ret;
233}
234
235void
236moveGet3DPosition(moveContext *context, float *x, float *y, float *z)
237{
238 if (x)
239 *x = vec_array (context->state.pos, 0);
240 if (y)
241 *y = vec_array (context->state.pos, 1);
242 if (z)
243 *z = vec_array (context->state.pos, 2);
244}
245
diff --git a/src/lib/ecore_psl1ght/moveutil.h b/src/lib/ecore_psl1ght/moveutil.h
deleted file mode 100644
index bb4b22c..0000000
--- a/src/lib/ecore_psl1ght/moveutil.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * Copyright (C) Antonio José Ramos Márquez (bigboss)
3 * Copyright (C) Youness Alaoui (KaKaRoTo)
4 */
5
6#ifndef __MOVEUTIL_H__
7#define __MOVEUTIL_H__
8
9#include <ppu-types.h>
10#include <spurs/spurs.h>
11#include <io/camera.h>
12#include <io/move.h>
13
14typedef struct
15{
16 Spurs *spurs;
17 cameraInfoEx camInfo;
18 cameraReadInfo camRead;
19 gemState state;
20} moveContext;
21
22static inline float
23vec_array(vec_float4 vec, unsigned int idx)
24{
25 union {
26 vec_float4 vec;
27 float array[4];
28 } v;
29
30 v.vec = vec;
31
32 if (idx > 3)
33 return -1;
34 return v.array[idx];
35}
36
37moveContext *initMove();
38void endMove(moveContext *context);
39void readGemState(moveContext *context);
40int processMove(moveContext *context);
41void moveGet3DPosition(moveContext *context, float *x, float *y, float *z);
42
43#endif /* __MOVEUTIL_H__ */
diff --git a/src/lib/ecore_psl1ght/spursutil.c b/src/lib/ecore_psl1ght/spursutil.c
deleted file mode 100644
index 27b5c1d..0000000
--- a/src/lib/ecore_psl1ght/spursutil.c
+++ /dev/null
@@ -1,62 +0,0 @@
1#include "spursutil.h"
2#include <sys/spu.h>
3
4#define SPURS_DEFAULT_PREFIX_NAME "spursutil"
5
6Spurs *
7initSpurs(const char *prefix_name)
8{
9 Spurs *spurs = NULL;
10 SpursAttribute attributeSpurs;
11 int ret;
12 int i;
13
14 ret = sysSpuInitialize (6, 0);
15 printf ("sysSpuInitialize return %d\n", ret);
16
17 /* initialize spurs */
18 printf ("Initializing spurs\n");
19 spurs = (void *)memalign (SPURS_ALIGN, sizeof (Spurs));
20 printf ("Initializing spurs attribute\n");
21
22 ret = spursAttributeInitialize (&attributeSpurs, 5, 250, 1000, true);
23 if (ret)
24 {
25 printf ("error : spursAttributeInitialize failed %x\n", ret);
26 goto error;
27 }
28
29 printf ("Setting name prefix\n");
30 if (!prefix_name)
31 prefix_name = SPURS_DEFAULT_PREFIX_NAME;
32 ret = spursAttributeSetNamePrefix (&attributeSpurs,
33 prefix_name, strlen (prefix_name));
34 if (ret)
35 {
36 printf ("error : spursAttributeInitialize failed %x\n", ret);
37 goto error;
38 }
39
40 printf ("Initializing with attribute\n");
41 ret = spursInitializeWithAttribute (spurs, &attributeSpurs);
42 if (ret)
43 {
44 printf ("error: spursInitializeWithAttribute failed %x\n", ret);
45 goto error;
46 }
47
48 return spurs;
49
50error:
51 if (spurs)
52 free (spurs);
53 return NULL;
54}
55
56void
57endSpurs(Spurs *spurs)
58{
59 spursFinalize (spurs);
60 free (spurs);
61}
62
diff --git a/src/lib/ecore_psl1ght/spursutil.h b/src/lib/ecore_psl1ght/spursutil.h
deleted file mode 100644
index 0b35030..0000000
--- a/src/lib/ecore_psl1ght/spursutil.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * Copyright (C) Antonio José Ramos Márquez (bigboss)
3 * Copyright (C) Youness Alaoui (KaKaRoTo)
4 */
5
6#ifndef __SPURSUTIL_H__
7#define __SPURSUTIL_H__
8
9#include <ppu-types.h>
10#include <spurs/spurs.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16/* Initialize spurs with a given name prefix (*/
17Spurs *initSpurs(const char *prefix_name);
18void endSpurs(Spurs *spurs);
19
20#ifdef __cplusplus
21}
22#endif
23
24#endif /* __SPURSUTIL_H__ */
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 52993e2..f0e41d5 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -4778,12 +4778,6 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4778 } 4778 }
4779#endif 4779#endif
4780 4780
4781#ifdef HAVE_ELEMENTARY_PSL1GHT
4782 else if ((disp) && (!strcmp(disp, "ps3")))
4783 {
4784 enginelist[p++] = ELM_SOFTWARE_PSL1GHT;
4785 }
4786#endif
4787#ifdef HAVE_ELEMENTARY_X 4781#ifdef HAVE_ELEMENTARY_X
4788 else if (!_elm_preferred_engine && 4782 else if (!_elm_preferred_engine &&
4789 getenv("DISPLAY") && !getenv("ELM_ENGINE")) 4783 getenv("DISPLAY") && !getenv("ELM_ENGINE"))
@@ -4856,9 +4850,6 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4856#ifdef HAVE_ELEMENTARY_SDL 4850#ifdef HAVE_ELEMENTARY_SDL
4857 enginelist[p++] = ELM_SOFTWARE_SDL; 4851 enginelist[p++] = ELM_SOFTWARE_SDL;
4858#endif 4852#endif
4859#ifdef HAVE_ELEMENTARY_PSL1GHT
4860 enginelist[p++] = ELM_SOFTWARE_PSL1GHT;
4861#endif
4862 } 4853 }
4863 else 4854 else
4864 { 4855 {
@@ -4906,9 +4897,6 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4906#ifdef HAVE_ELEMENTARY_SDL 4897#ifdef HAVE_ELEMENTARY_SDL
4907 enginelist[p++] = ELM_OPENGL_SDL; 4898 enginelist[p++] = ELM_OPENGL_SDL;
4908#endif 4899#endif
4909#ifdef HAVE_ELEMENTARY_PSL1GHT
4910 enginelist[p++] = ELM_SOFTWARE_PSL1GHT;
4911#endif
4912 } 4900 }
4913 } 4901 }
4914 if (parent) parent_id = elm_win_window_id_get(parent); 4902 if (parent) parent_id = elm_win_window_id_get(parent);
@@ -4966,8 +4954,6 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4966 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1); 4954 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
4967 else if (!strcmp(enginelist[i], ELM_BUFFER)) 4955 else if (!strcmp(enginelist[i], ELM_BUFFER))
4968 tmp_sd.ee = ecore_evas_buffer_new(1, 1); 4956 tmp_sd.ee = ecore_evas_buffer_new(1, 1);
4969 else if (!strcmp(enginelist[i], ELM_SOFTWARE_PSL1GHT))
4970 tmp_sd.ee = ecore_evas_psl1ght_new(NULL, 1, 1);
4971 else if (!strcmp(enginelist[i], ELM_DRM)) 4957 else if (!strcmp(enginelist[i], ELM_DRM))
4972 tmp_sd.ee = ecore_evas_drm_new(NULL, 0, 0, 0, 1, 1); 4958 tmp_sd.ee = ecore_evas_drm_new(NULL, 0, 0, 0, 1, 1);
4973 else if (!strncmp(enginelist[i], "shot:", 5)) 4959 else if (!strncmp(enginelist[i], "shot:", 5))
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index d403262..a931b1d 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -55,7 +55,6 @@ const char *_elm_engines[] = {
55 "buffer", 55 "buffer",
56 "ews", 56 "ews",
57 "opengl_cocoa", 57 "opengl_cocoa",
58 "psl1ght",
59 "wayland_shm", 58 "wayland_shm",
60 "wayland_egl", 59 "wayland_egl",
61 "drm", 60 "drm",
@@ -2259,8 +2258,6 @@ _env_get(void)
2259 (!strcasecmp(s, "software-fb")) || 2258 (!strcasecmp(s, "software-fb")) ||
2260 (!strcasecmp(s, "software_fb"))) 2259 (!strcasecmp(s, "software_fb")))
2261 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_FB); 2260 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_FB);
2262 else if ((!strcasecmp(s, "psl1ght")))
2263 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_PSL1GHT);
2264 else if ((!strcasecmp(s, "sdl")) || 2261 else if ((!strcasecmp(s, "sdl")) ||
2265 (!strcasecmp(s, "software-sdl")) || 2262 (!strcasecmp(s, "software-sdl")) ||
2266 (!strcasecmp(s, "software_sdl"))) 2263 (!strcasecmp(s, "software_sdl")))
diff --git a/src/lib/evas/file/evas_module.c b/src/lib/evas/file/evas_module.c
index 5930e21..e0309c2 100644
--- a/src/lib/evas/file/evas_module.c
+++ b/src/lib/evas/file/evas_module.c
@@ -171,7 +171,6 @@ EVAS_EINA_STATIC_MODULE_DEFINE(engine, fb);
171EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_generic); 171EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_generic);
172EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_x11); 172EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_x11);
173EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_sdl); 173EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_sdl);
174EVAS_EINA_STATIC_MODULE_DEFINE(engine, psl1ght);
175EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_8); 174EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_8);
176EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_8_x11); 175EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_8_x11);
177EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_ddraw); 176EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_ddraw);
@@ -239,9 +238,6 @@ static const struct {
239#ifdef EVAS_STATIC_BUILD_GL_SDL 238#ifdef EVAS_STATIC_BUILD_GL_SDL
240 EVAS_EINA_STATIC_MODULE_USE(engine, gl_sdl), 239 EVAS_EINA_STATIC_MODULE_USE(engine, gl_sdl),
241#endif 240#endif
242#ifdef EVAS_STATIC_BUILD_PSL1GHT
243 EVAS_EINA_STATIC_MODULE_USE(engine, psl1ght),
244#endif
245#ifdef EVAS_STATIC_BUILD_SOFTWARE_DDRAW 241#ifdef EVAS_STATIC_BUILD_SOFTWARE_DDRAW
246 EVAS_EINA_STATIC_MODULE_USE(engine, software_ddraw), 242 EVAS_EINA_STATIC_MODULE_USE(engine, software_ddraw),
247#endif 243#endif
diff --git a/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c b/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
deleted file mode 100644
index 0ad3b87..0000000
--- a/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
+++ /dev/null
@@ -1,467 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <Ecore.h>
6#include "ecore_private.h"
7#include <Ecore_Input.h>
8#include <Ecore_Input_Evas.h>
9
10#include <Ecore_Psl1ght.h>
11#include <Evas_Engine_PSL1GHT.h>
12
13#include <Ecore_Evas.h>
14#include "ecore_evas_private.h"
15
16#ifdef EAPI
17# undef EAPI
18#endif
19
20#ifdef _WIN32
21# ifdef DLL_EXPORT
22# define EAPI __declspec(dllexport)
23# else
24# define EAPI
25# endif /* ! DLL_EXPORT */
26#else
27# ifdef __GNUC__
28# if __GNUC__ >= 4
29# define EAPI __attribute__ ((visibility("default")))
30# else
31# define EAPI
32# endif
33# else
34# define EAPI
35# endif
36#endif /* ! _WIN32 */
37
38static int _ecore_evas_init_count = 0;
39
40static Ecore_Evas *psl1ght_ee = NULL;
41static Ecore_Event_Handler *ecore_evas_event_handlers[5] = {
42 NULL, NULL, NULL, NULL
43};
44
45static const char *ecore_evas_psl1ght_default = "EFL PSL1GHT";
46static int _ecore_evas_fps_debug = 0;
47static Ecore_Poller *ecore_evas_event;
48
49static unsigned int
50_ecore_evas_time_get()
51{
52 return (unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff;
53}
54
55static Ecore_Evas *
56_ecore_evas_psl1ght_match(void)
57{
58 return psl1ght_ee;
59}
60
61static Eina_Bool
62_ecore_evas_psl1ght_event_got_focus(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
63{
64 Ecore_Evas *ee;
65
66 ee = _ecore_evas_psl1ght_match();
67
68 if (!ee) return ECORE_CALLBACK_PASS_ON;
69 /* pass on event */
70 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
71 return ECORE_CALLBACK_PASS_ON;
72}
73
74static Eina_Bool
75_ecore_evas_psl1ght_event_lost_focus(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
76{
77 Ecore_Evas *ee;
78
79 ee = _ecore_evas_psl1ght_match();
80
81 if (!ee) return ECORE_CALLBACK_PASS_ON;
82 /* pass on event */
83 _ecore_evas_focus_device_set(ee, NULL, EINA_FALSE);
84 return ECORE_CALLBACK_PASS_ON;
85}
86
87static Eina_Bool
88_ecore_evas_psl1ght_event_video_expose(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
89{
90 Ecore_Evas *ee;
91 int w;
92 int h;
93
94 ee = _ecore_evas_psl1ght_match();
95
96 if (!ee) return ECORE_CALLBACK_PASS_ON;
97 evas_output_size_get(ee->evas, &w, &h);
98 evas_damage_rectangle_add(ee->evas, 0, 0, w, h);
99
100 return ECORE_CALLBACK_PASS_ON;
101}
102
103static Eina_Bool
104_ecore_evas_psl1ght_event_key_modifiers(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
105{
106 Ecore_Evas *ee;
107 Ecore_Psl1ght_Event_Key_Modifiers *e = event;
108
109 ee = _ecore_evas_psl1ght_match();
110
111 if (!ee) return ECORE_CALLBACK_PASS_ON;
112 ecore_event_evas_modifier_lock_update(ee->evas, e->modifiers);
113
114 return ECORE_CALLBACK_PASS_ON;
115}
116
117static Eina_Bool
118_ecore_evas_psl1ght_event_quit (void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
119{
120 Ecore_Evas *ee;
121
122 ee = _ecore_evas_psl1ght_match();
123
124 if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
125 if (ee->func.fn_delete_request)
126 ee->func.fn_delete_request(ee);
127 return ECORE_CALLBACK_PASS_ON;
128}
129
130static Eina_Bool
131_ecore_evas_psl1ght_event(void *data EINA_UNUSED)
132{
133 ecore_psl1ght_poll_events();
134 return ECORE_CALLBACK_RENEW;
135}
136
137static int
138_ecore_evas_psl1ght_init(int w EINA_UNUSED, int h EINA_UNUSED)
139{
140 _ecore_evas_init_count++;
141 if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
142
143 _ecore_evas_fps_debug = 1;
144
145 // this is pretty bad: poller? and set poll time? pol time is meant to be
146 // adjustable for things like polling battery state, or amoutn of spare
147 // memory etc.
148 //
149 ecore_evas_event = ecore_poller_add(ECORE_POLLER_CORE, 1, _ecore_evas_psl1ght_event, NULL);
150 ecore_poller_poll_interval_set(ECORE_POLLER_CORE, 0.006);
151
152 if (_ecore_evas_fps_debug)
153 _ecore_evas_fps_debug_init();
154
155 ecore_event_evas_init();
156
157 ecore_evas_event_handlers[0] =
158 ecore_event_handler_add(ECORE_PSL1GHT_EVENT_GOT_FOCUS,
159 _ecore_evas_psl1ght_event_got_focus, NULL);
160 ecore_evas_event_handlers[1] =
161 ecore_event_handler_add(ECORE_PSL1GHT_EVENT_LOST_FOCUS,
162 _ecore_evas_psl1ght_event_lost_focus, NULL);
163 ecore_evas_event_handlers[2] =
164 ecore_event_handler_add(ECORE_PSL1GHT_EVENT_EXPOSE,
165 _ecore_evas_psl1ght_event_video_expose, NULL);
166 ecore_evas_event_handlers[3] =
167 ecore_event_handler_add(ECORE_PSL1GHT_EVENT_KEY_MODIFIERS,
168 _ecore_evas_psl1ght_event_key_modifiers, NULL);
169 ecore_evas_event_handlers[4] =
170 ecore_event_handler_add(ECORE_PSL1GHT_EVENT_QUIT,
171 _ecore_evas_psl1ght_event_quit, NULL);
172
173 return _ecore_evas_init_count;
174}
175
176static int
177_ecore_evas_psl1ght_shutdown(void)
178{
179 _ecore_evas_init_count--;
180 if (_ecore_evas_init_count == 0)
181 {
182 unsigned int i;
183
184 for (i = 0; i < sizeof (ecore_evas_event_handlers) / sizeof (Ecore_Event_Handler *); i++)
185 ecore_event_handler_del(ecore_evas_event_handlers[i]);
186 ecore_event_evas_shutdown();
187 ecore_poller_del(ecore_evas_event);
188 ecore_evas_event = NULL;
189 if (_ecore_evas_fps_debug)
190 _ecore_evas_fps_debug_shutdown();
191 }
192 if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
193 return _ecore_evas_init_count;
194}
195
196static void
197_ecore_evas_psl1ght_free(Ecore_Evas *ee)
198{
199 if (psl1ght_ee == ee) psl1ght_ee = NULL;
200
201 ecore_event_window_unregister(0);
202 _ecore_evas_psl1ght_shutdown();
203 ecore_psl1ght_shutdown();
204}
205
206static void
207_ecore_evas_psl1ght_callback_delete_request_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
208{
209 ee->func.fn_delete_request = func;
210}
211
212static void
213_ecore_evas_screen_resized(Ecore_Evas *ee)
214{
215 const Evas_Device *pointer;
216 Ecore_Evas_Cursor *cursor;
217 int w, h;
218
219 /* Do not resize if the window is not fullscreen */
220 if (!ee->prop.fullscreen) return;
221
222 ecore_psl1ght_screen_resolution_get (&w, &h);
223
224 pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_MOUSE);
225 pointer = evas_device_parent_get(pointer);
226 cursor = eina_hash_find(ee->prop.cursors, &pointer);
227 EINA_SAFETY_ON_NULL_RETURN(cursor);
228
229 if (w != ee->w || h != ee->h)
230 {
231 ee->req.w = ee->w = w;
232 ee->req.h = ee->h = h;
233 evas_output_size_set(ee->evas, ee->w, ee->h);
234 evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
235 ecore_psl1ght_resolution_set (w, h);
236 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
237
238 _ecore_evas_mouse_move_process(ee, cursor->pos_x, cursor->pos_y,
239 _ecore_evas_time_get());
240 if (ee->func.fn_resize) ee->func.fn_resize(ee);
241 }
242}
243
244static void
245_ecore_evas_resize(Ecore_Evas *ee, int w, int h)
246{
247 if ((w == ee->w) && (h == ee->h)) return;
248 ee->w = w;
249 ee->h = h;
250
251 evas_output_size_set(ee->evas, ee->w, ee->h);
252
253 evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
254 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
255
256 ecore_psl1ght_resolution_set (w, h);
257
258 if (ee->func.fn_resize) ee->func.fn_resize(ee);
259
260 _ecore_evas_screen_resized (ee);
261}
262
263static void
264_ecore_evas_move_resize(Ecore_Evas *ee, int x EINA_UNUSED, int y EINA_UNUSED, int w, int h)
265{
266 _ecore_evas_resize (ee, w, h);
267}
268
269static void
270_ecore_evas_show(Ecore_Evas *ee)
271{
272 ee->prop.withdrawn = EINA_FALSE;
273 if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
274 if (ecore_evas_focus_device_get(ee, NULL)) return;
275 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
276}
277
278static void
279_ecore_evas_screen_geometry_get(const Ecore_Evas *ee EINA_UNUSED, int *x, int *y, int *w, int *h)
280{
281 if (x) *x = 0;
282 if (y) *y = 0;
283 ecore_psl1ght_screen_resolution_get (w, h);
284}
285
286static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func =
287{
288 _ecore_evas_psl1ght_free,
289 NULL,
290 NULL,
291 NULL,
292 NULL,
293 _ecore_evas_psl1ght_callback_delete_request_set,
294 NULL,
295 NULL,
296 NULL,
297 NULL,
298 NULL,
299 NULL,
300 NULL,
301 NULL,
302 NULL,
303 NULL,
304 NULL,
305 _ecore_evas_resize,
306 _ecore_evas_move_resize,
307 NULL,
308 NULL,
309 _ecore_evas_show,
310 NULL,
311 NULL,
312 NULL,
313 NULL,
314 NULL,
315 NULL,
316 NULL,
317 NULL,
318 NULL,
319 NULL,
320 NULL,
321 NULL,
322 NULL,
323 NULL,
324 NULL,
325 NULL,
326 NULL,
327 NULL,
328 NULL,
329 NULL,
330 NULL,
331 NULL,
332 NULL,
333 NULL,
334 NULL, //transparent
335 NULL, // profiles_set
336 NULL, // profile_set
337
338 NULL,
339 NULL,
340 NULL,
341 NULL,
342 NULL,
343 NULL,
344
345 NULL, // render
346 _ecore_evas_screen_geometry_get, // screen_geometry_get
347 NULL, // screen_dpi_get
348 NULL,
349 NULL, //msg_send
350
351 NULL, // pointer_xy_get
352 NULL, // pointer_warp
353
354 NULL, // wm_rot_preferred_rotation_set
355 NULL, // wm_rot_available_rotations_set
356 NULL, // wm_rot_manual_rotation_done_set
357 NULL, // wm_rot_manual_rotation_done
358
359 NULL, // aux_hints_set
360
361 NULL, // fn_animator_register
362 NULL, // fn_animator_unregister
363
364 NULL, // fn_evas_changed
365 NULL, //fn_focus_device_set
366 NULL, //fn_callback_focus_device_in_set
367 NULL, //fn_callback_focus_device_out_set
368 NULL, //fn_callback_device_mouse_in_set
369 NULL, //fn_callback_device_mouse_out_set
370 NULL, //fn_pointer_device_xy_get
371 NULL, //fn_prepare
372 NULL, //fn_last_tick_get
373};
374
375EAPI Ecore_Evas *
376ecore_evas_psl1ght_new_internal(const char *name, int w, int h)
377{
378 void *einfo;
379 Ecore_Evas *ee;
380
381 if (!name)
382 name = ecore_evas_psl1ght_default;
383
384 ee = calloc(1, sizeof(Ecore_Evas));
385 if (!ee) return NULL;
386
387 ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
388
389 ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_psl1ght_engine_func;
390
391 ee->driver = "psl1ght";
392 if (name) ee->name = strdup(name);
393
394 if (w < 1) w = 1;
395 if (h < 1) h = 1;
396 ee->visible = 1;
397 ee->w = w;
398 ee->h = h;
399
400 ee->prop.max.w = 0;
401 ee->prop.max.h = 0;
402 ee->prop.layer = 0;
403 ee->prop.borderless = EINA_TRUE;
404 ee->prop.override = EINA_TRUE;
405 ee->prop.maximized = EINA_TRUE;
406 ee->prop.fullscreen = EINA_FALSE;
407 ee->prop.withdrawn = EINA_TRUE;
408 ee->prop.sticky = EINA_FALSE;
409 ee->prop.window = 0;
410
411 /* init evas here */
412 ee->evas = evas_new();
413 evas_data_attach_set(ee->evas, ee);
414 evas_output_method_set(ee->evas, evas_render_method_lookup("psl1ght"));
415
416 evas_output_size_set(ee->evas, w, h);
417 evas_output_viewport_set(ee->evas, 0, 0, w, h);
418
419 einfo = evas_engine_info_get(ee->evas);
420 if (einfo)
421 {
422 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
423 {
424 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
425 ecore_evas_free(ee);
426 return NULL;
427 }
428 }
429 else
430 {
431 ERR("evas_engine_info_set() init engine '%s' failed.", ee->driver);
432 ecore_evas_free(ee);
433 return NULL;
434 }
435
436 if (!ecore_psl1ght_init(name))
437 {
438 evas_free(ee->evas);
439 if (ee->name) free(ee->name);
440 free(ee);
441 return NULL;
442 }
443 ecore_psl1ght_resolution_set (w, h);
444
445 _ecore_evas_psl1ght_init(w, h);
446
447 ecore_event_window_register(0, ee, ee->evas,
448 (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
449 (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
450 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
451 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
452 _ecore_event_window_direct_cb_set(0, _ecore_evas_input_direct_cb);
453
454 _ecore_evas_register(ee);
455
456 psl1ght_ee = ee;
457
458 _ecore_evas_screen_resized (ee);
459
460 if (getenv("ECORE_EVAS_PSL1GHT_CURSOR_PATH"))
461 ecore_evas_cursor_set(ee, getenv("ECORE_EVAS_PSL1GHT_CURSOR_PATH"), EVAS_LAYER_MAX, 0, 0);
462
463 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
464 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
465
466 return ee;
467}
diff --git a/src/modules/evas/engines/psl1ght/Evas_Engine_PSL1GHT.h b/src/modules/evas/engines/psl1ght/Evas_Engine_PSL1GHT.h
deleted file mode 100644
index f1d5636..0000000
--- a/src/modules/evas/engines/psl1ght/Evas_Engine_PSL1GHT.h
+++ /dev/null
@@ -1,16 +0,0 @@
1#ifndef _EVAS_ENGINE_PSL1GHT_H
2#define _EVAS_ENGINE_PSL1GHT_H
3
4typedef struct _Evas_Engine_Info_PSL1GHT Evas_Engine_Info_PSL1GHT;
5
6struct _Evas_Engine_Info_PSL1GHT
7{
8 /* PRIVATE - don't mess with this baby or evas will poke its tongue out */
9 /* at you and make nasty noises */
10 Evas_Engine_Info magic;
11
12 /* non-blocking or blocking mode */
13 Evas_Engine_Render_Mode render_mode;
14};
15#endif
16
diff --git a/src/modules/evas/engines/psl1ght/evas_engine.c b/src/modules/evas/engines/psl1ght/evas_engine.c
deleted file mode 100644
index 168543b..0000000
--- a/src/modules/evas/engines/psl1ght/evas_engine.c
+++ /dev/null
@@ -1,449 +0,0 @@
1#include "evas_common_private.h"
2#include "evas_private.h"
3#include "evas_engine.h"
4#include "rsxutil.h"
5#include "Evas_Engine_PSL1GHT.h"
6
7#include <malloc.h>
8
9int _evas_engine_psl1ght_log_dom = -1;
10
11/* function tables - filled in later (func and parent func) */
12static Evas_Func func, pfunc;
13
14/* engine struct data */
15typedef struct _Render_Engine Render_Engine;
16
17#define MAX_BUFFERS 2
18
19struct _Render_Engine
20{
21 Tilebuf *tb;
22 Tilebuf_Rect *rects;
23 Eina_Inlist *cur_rect;
24
25 /* RSX device context */
26 gcmContextData *context;
27 void *host_addr;
28
29 /* The buffers we will be drawing into. */
30 rsxBuffer buffers[MAX_BUFFERS];
31 int currentBuffer;
32 int width;
33 int height;
34 RGBA_Image *rgba_image;
35 uint32_t rgba_image_offset;
36
37 int end : 1;
38};
39
40/* prototypes we will use here */
41static void *_output_setup(int w, int h);
42
43/* internal engine routines */
44static void *
45_output_setup(int w, int h)
46{
47 Render_Engine *re;
48 int i;
49 u16 width, height;
50 DATA32 *image_data = NULL;
51 int image_size;
52
53 printf ("_output_setup called : %dx%d\n", w, h);
54 re = calloc(1, sizeof(Render_Engine));
55 if (!re)
56 return NULL;
57
58 /* Allocate a 1Mb buffer, alligned to a 1Mb boundary
59 * to be our shared IO memory with the RSX. */
60 re->host_addr = memalign (1024 * 1024, HOST_SIZE);
61 if (re->host_addr == NULL)
62 {
63 free (re);
64 return NULL;
65 }
66 re->context = initScreen (re->host_addr, HOST_SIZE);
67 if (re->context == NULL)
68 {
69 free (re->host_addr);
70 free (re);
71 return NULL;
72 }
73 width = w;
74 height = h;
75 setResolution (re->context, &width, &height);
76 re->currentBuffer = 0;
77 re->width = width;
78 re->height = height;
79
80 for (i = 0; i < MAX_BUFFERS; i++)
81 makeBuffer (&re->buffers[i], width, height, i);
82
83 flipBuffer(re->context, MAX_BUFFERS - 1);
84
85 re->tb = evas_common_tilebuf_new(w, h);
86
87 /* in preliminary tests 16x16 gave highest framerates */
88 evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
89
90 /* Allocate our memaligned backbuffer */
91 image_size = ((w * h * sizeof(u32)) + 0xfffff) & - 0x100000;
92 image_data = memalign (1024 * 1024, image_size);
93 re->rgba_image = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
94 w, h, image_data, 1, EVAS_COLORSPACE_ARGB8888);
95 gcmMapMainMemory(image_data, image_size, &re->rgba_image_offset);
96
97 return re;
98}
99
100/* engine api this module provides */
101static void
102eng_output_info_setup(void *info)
103{
104 Evas_Engine_Info_PSL1GHT *einfo = info;
105
106 einfo->render_mode = EVAS_RENDER_MODE_BLOCKING;
107}
108
109static void *
110eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h)
111{
112 Evas_Engine_Info_PSL1GHT *info = in;
113
114 printf ("eng_setup called\n");
115
116 return _output_setup(w, h);
117}
118
119static void
120eng_output_free(void *engine EINA_UNUSED, void *data)
121{
122 Render_Engine *re;
123 int i;
124
125 printf ("eng_output_free called\n");
126 re = (Render_Engine *)data;
127
128 gcmSetWaitFlip(re->context);
129 for (i = 0; i < MAX_BUFFERS; i++)
130 rsxFree (re->buffers[i].ptr);
131
132 if (re->rgba_image)
133 {
134 DATA32 *image_data;
135
136 image_data = re->rgba_image->image.data;
137 evas_cache_image_drop(&re->rgba_image->cache_entry);
138 free (image_data);
139 }
140
141 freeScreen (re->context);
142 free (re->host_addr);
143
144 evas_common_tilebuf_free(re->tb);
145 if (re->rects)
146 evas_common_tilebuf_free_render_rects(re->rects);
147
148 free(re);
149}
150
151static void
152eng_output_resize(void *engine EINA_UNUSED, void *data, int w, int h)
153{
154 Render_Engine *re;
155 int i;
156 u16 width, height;
157 DATA32 *image_data;
158 int image_size;
159
160 printf ("eng_output_resize called : %dx%d\n", w, h);
161 re = (Render_Engine *)data;
162
163 width = w;
164 height = h;
165 if (setResolution (re->context, &width, &height))
166 {
167 re->width = width;
168 re->height = height;
169
170 gcmSetWaitFlip(re->context);
171 for (i = 0; i < MAX_BUFFERS; i++) {
172 rsxFree (re->buffers[i].ptr);
173 makeBuffer (&re->buffers[i], width, height, i);
174 }
175
176 flipBuffer(re->context, MAX_BUFFERS - 1);
177
178 evas_common_tilebuf_free(re->tb);
179 re->tb = evas_common_tilebuf_new(w, h);
180 evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
181
182 /* Realloc our backbuf image */
183 if (re->rgba_image)
184 {
185 image_data = re->rgba_image->image.data;
186 evas_cache_image_drop(&re->rgba_image->cache_entry);
187 free (image_data);
188 }
189 image_size = ((w * h * sizeof(u32)) + 0xfffff) & - 0x100000;
190 image_data = memalign (1024 * 1024, image_size);
191 re->rgba_image = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
192 w, h, image_data, 1, EVAS_COLORSPACE_ARGB8888);
193 gcmMapMainMemory(image_data, image_size, &re->rgba_image_offset);
194 }
195}
196
197static void
198eng_output_tile_size_set(void *engine EINA_UNUSED, void *data, int w, int h)
199{
200 Render_Engine *re;
201
202 printf ("eng_output_tile_size_set called : %dx%d\n", w, h);
203 re = (Render_Engine *)data;
204 evas_common_tilebuf_set_tile_size(re->tb, w, h);
205}
206
207static void
208eng_output_redraws_rect_add(void *engine EINA_UNUSED, void *data, int x, int y, int w, int h)
209{
210 Render_Engine *re;
211
212 //printf ("eng_output_redraws_rect_add called : %d,%d %dx%d\n", x, y, w, h);
213 re = (Render_Engine *)data;
214 evas_common_tilebuf_add_redraw(re->tb, x, y, w, h);
215}
216
217static void
218eng_output_redraws_rect_del(void *engine EINA_UNUSED, void *data, int x, int y, int w, int h)
219{
220 Render_Engine *re;
221
222 //printf ("eng_output_redraws_rect_del called : %d,%d %dx%d\n", x, y, w, h);
223 re = (Render_Engine *)data;
224 evas_common_tilebuf_del_redraw(re->tb, x, y, w, h);
225}
226
227static void
228eng_output_redraws_clear(void *engine EINA_UNUSED, void *data)
229{
230 Render_Engine *re;
231
232 //printf ("eng_output_redraws_clear called\n");
233 re = (Render_Engine *)data;
234 evas_common_tilebuf_clear(re->tb);
235}
236
237static void *
238eng_output_redraws_next_update_get(void *engine EINA_UNUSED, void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch)
239{
240 Render_Engine *re;
241 Tilebuf_Rect *rect;
242 int ux, uy, uw, uh;
243
244 re = (Render_Engine *)data;
245 /*printf ("eng_output_redraws_next_update_get called : %d,%d %dx%d -- %d,%d %dx%d\n",
246 *x, *y, *w, *h, *cx, *cy, *cw, *ch);*/
247 if (re->end)
248 {
249 re->end = 0;
250 return NULL;
251 }
252 if (!re->rects)
253 {
254 re->rects = evas_common_tilebuf_get_render_rects(re->tb);
255 re->cur_rect = EINA_INLIST_GET(re->rects);
256 }
257 if (!re->cur_rect)
258 return NULL;
259
260 rect = (Tilebuf_Rect *)re->cur_rect;
261 ux = rect->x; uy = rect->y; uw = rect->w; uh = rect->h;
262 re->cur_rect = re->cur_rect->next;
263 if (!re->cur_rect)
264 {
265 evas_common_tilebuf_free_render_rects(re->rects);
266 re->rects = NULL;
267 re->end = 1;
268 }
269
270 *x = *cx = ux;
271 *y = *cy = uy;
272 *w = *cw = uw;
273 *h = *ch = uh;
274 /*printf ("eng_output_redraws_next_update_get returning : %d,%d %dx%d -- %d,%d %dx%d\n",
275 *x, *y, *w, *h, *cx, *cy, *cw, *ch);*/
276
277 return re->rgba_image;
278}
279
280static void
281eng_output_redraws_next_update_push(void *engine EINA_UNUSED, void *data EINA_UNUSED, void *surface EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED, Evas_Render_Mode render_mode EINA_UNUSED)
282{
283 /* Don't do anything, we'll just coy the whole buffer when it's time to flush */
284}
285
286static void
287eng_output_flush(void *engine EINA_UNUSED, void *data, Evas_Render_Mode render_mode)
288{
289 Render_Engine *re;
290 rsxBuffer *buffer;
291 int width;
292 int height;
293
294 if (render_mode == EVAS_RENDER_MODE_ASYNC_INIT) return;
295
296 //printf ("eng_output_flush called\n");
297 re = (Render_Engine *)data;
298 buffer = &re->buffers[re->currentBuffer];
299 width = re->rgba_image->cache_entry.w;
300 height = re->rgba_image->cache_entry.h;
301
302 /* Wait for the flip before copying the buffer */
303 waitFlip ();
304
305 if (re->width == width &&
306 re->height == height)
307 {
308 /* DMA the back buffer into the rsx buffer */
309 rsxSetTransferImage (re->context,
310 GCM_TRANSFER_MAIN_TO_LOCAL,
311 buffer->offset, buffer->width * sizeof(u32),
312 0, 0,
313 re->rgba_image_offset, re->width * sizeof(u32),
314 0, 0, re->width, re->height, sizeof(u32));
315 }
316 else
317 {
318 gcmTransferScale gcm_scale;
319 gcmTransferSurface gcm_surface;
320
321 gcm_surface.format = GCM_TRANSFER_SURFACE_FORMAT_A8R8G8B8;
322 gcm_surface.pitch = buffer->width * sizeof(u32);
323 gcm_surface._pad0[0] = gcm_surface._pad0[1] = 0;
324 gcm_surface.offset = buffer->offset;
325
326 gcm_scale.interp = GCM_TRANSFER_INTERPOLATOR_LINEAR;
327 gcm_scale.conversion = GCM_TRANSFER_CONVERSION_TRUNCATE;
328 gcm_scale.format = GCM_TRANSFER_SCALE_FORMAT_A8R8G8B8;
329 gcm_scale.origin = GCM_TRANSFER_ORIGIN_CORNER;
330 gcm_scale.operation = GCM_TRANSFER_OPERATION_SRCCOPY;
331 gcm_scale.offset = re->rgba_image_offset;
332 gcm_scale.clipX = 0;
333 gcm_scale.clipY = 0;
334 gcm_scale.clipW = re->width;
335 gcm_scale.clipH = re->height;
336 gcm_scale.outX = 0;
337 gcm_scale.outY = 0;
338 gcm_scale.outW = re->width;
339 gcm_scale.outH = re->height;
340 gcm_scale.ratioX = rsxGetFixedSint32 ((float)width / (float)re->width);
341 gcm_scale.ratioY = rsxGetFixedSint32 ((float)height / (float)re->height);
342 gcm_scale.inX = 0;
343 gcm_scale.inY = 0;
344 gcm_scale.inW = (width & ~1); // Width must be a multiple of 2
345 gcm_scale.inH = height;
346 if (gcm_scale.inW < 2) // Minimum inW value is 2
347 gcm_scale.inW = 2;
348 if (gcm_scale.inW > 2046) // Maximum inW value is 2046
349 gcm_scale.inW = 2046;
350 if (gcm_scale.inH < 1) // Minimum inH value is 1
351 gcm_scale.inH = 1;
352 if (gcm_scale.inH > 2047) // Maximum inW value is 2047
353 gcm_scale.inH = 2047;
354 gcm_scale.pitch = sizeof(u32) * width;
355
356 rsxSetTransferScaleMode (re->context, GCM_TRANSFER_MAIN_TO_LOCAL, GCM_TRANSFER_SURFACE);
357 rsxSetTransferScaleSurface (re->context, &gcm_scale, &gcm_surface);
358 }
359 /* Wait for the DMA to finish */
360 flushRSX (re->context);
361
362 /* Flip buffer onto screen */
363 flipBuffer (re->context, re->currentBuffer);
364 re->currentBuffer = (re->currentBuffer + 1) % MAX_BUFFERS;
365}
366
367static void
368eng_output_idle_flush(void *engine EINA_UNUSED, void *data)
369{
370 Render_Engine *re;
371
372 printf ("eng_output_idle_flush called\n");
373 re = (Render_Engine *)data;
374}
375
376static Eina_Bool
377eng_canvas_alpha_get(void *engine)
378{
379 Render_Engine *re;
380
381 // printf ("eng_output_alpha_get called\n");
382 re = (Render_Engine *)engine;
383 return EINA_TRUE;
384}
385
386/* module advertising code */
387static int
388module_open(Evas_Module *em)
389{
390 if (!em) return 0;
391 /* get whatever engine module we inherit from */
392 if (!_evas_module_engine_inherit(&pfunc, "software_generic", sizeof (Evas_Engine_Info_PSL1GHT))) return 0;
393 _evas_engine_psl1ght_log_dom = eina_log_domain_register
394 ("evas-psl1ght", EVAS_DEFAULT_LOG_COLOR);
395 if (_evas_engine_psl1ght_log_dom < 0)
396 {
397 EINA_LOG_ERR("Can not create a module log domain.");
398 return 0;
399 }
400
401 /* store it for later use */
402 func = pfunc;
403 /* now to override methods */
404#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
405 ORD(output_info_setup);
406 ORD(output_setup);
407 ORD(canvas_alpha_get);
408 ORD(output_free);
409 ORD(output_resize);
410 ORD(output_tile_size_set);
411 ORD(output_redraws_rect_add);
412 ORD(output_redraws_rect_del);
413 ORD(output_redraws_clear);
414 ORD(output_redraws_next_update_get);
415 ORD(output_redraws_next_update_push);
416 ORD(output_flush);
417 ORD(output_idle_flush);
418
419 /* now advertise out own api */
420 em->functions = (void *)(&func);
421 return 1;
422}
423
424static void
425module_close(Evas_Module *em EINA_UNUSED)
426{
427 if (_evas_engine_psl1ght_log_dom >= 0)
428 {
429 eina_log_domain_unregister(_evas_engine_psl1ght_log_dom);
430 _evas_engine_psl1ght_log_dom = -1;
431 }
432}
433
434static Evas_Module_Api evas_modapi =
435{
436 EVAS_MODULE_API_VERSION,
437 "psl1ght",
438 "none",
439 {
440 module_open,
441 module_close
442 }
443};
444
445EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_ENGINE, engine, psl1ght);
446
447#ifndef EVAS_STATIC_BUILD_PSL1GHT
448EVAS_EINA_MODULE_DEFINE(engine, psl1ght);
449#endif
diff --git a/src/modules/evas/engines/psl1ght/evas_engine.h b/src/modules/evas/engines/psl1ght/evas_engine.h
deleted file mode 100644
index 638106e..0000000
--- a/src/modules/evas/engines/psl1ght/evas_engine.h
+++ /dev/null
@@ -1,30 +0,0 @@
1#ifndef EVAS_ENGINE_H
2#define EVAS_ENGINE_H
3
4extern int _evas_engine_psl1ght_log_dom;
5#ifdef ERR
6# undef ERR
7#endif
8#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_psl1ght_log_dom, __VA_ARGS__)
9
10#ifdef DBG
11# undef DBG
12#endif
13#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_psl1ght_log_dom, __VA_ARGS__)
14
15#ifdef INF
16# undef INF
17#endif
18#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_psl1ght_log_dom, __VA_ARGS__)
19
20#ifdef WRN
21# undef WRN
22#endif
23#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_psl1ght_log_dom, __VA_ARGS__)
24
25#ifdef CRI
26# undef CRI
27#endif
28#define CRI(...) EINA_LOG_DOM_CRIT(_evas_engine_psl1ght_log_dom, __VA_ARGS__)
29
30#endif
diff --git a/src/modules/evas/engines/psl1ght/rsxutil.c b/src/modules/evas/engines/psl1ght/rsxutil.c
deleted file mode 100644
index 7567a8c..0000000
--- a/src/modules/evas/engines/psl1ght/rsxutil.c
+++ /dev/null
@@ -1,275 +0,0 @@
1/*
2 * This software is distributed under the terms of the MIT License
3 */
4
5#include <ppu-lv2.h>
6#include <stdio.h>
7#include <malloc.h>
8#include <string.h>
9#include <unistd.h>
10#include <sysutil/video.h>
11#include <rsx/gcm_sys.h>
12#include <rsx/rsx.h>
13#include <io/pad.h>
14#include <time.h>
15#include <cairo/cairo.h>
16#include <math.h>
17
18#include "rsxutil.h"
19
20#define GCM_LABEL_INDEX 255
21
22static void
23waitRSXIdle(gcmContextData *context);
24
25static int flipped = FALSE;
26
27void
28waitFlip()
29{
30 if (flipped)
31 {
32 while (gcmGetFlipStatus () != 0)
33 usleep (200); /* Sleep, to not stress the cpu. */
34 gcmResetFlipStatus ();
35 flipped = FALSE;
36 }
37}
38
39int
40flipBuffer(gcmContextData *context, s32 buffer)
41{
42 if (gcmSetFlip (context, buffer) == 0)
43 {
44 rsxFlushBuffer (context);
45 // Prevent the RSX from continuing until the flip has finished.
46 gcmSetWaitFlip (context);
47
48 flipped = TRUE;
49 return TRUE;
50 }
51 return FALSE;
52}
53
54int
55makeBuffer(rsxBuffer *buffer, u16 width, u16 height, int id)
56{
57 int depth = sizeof(u32);
58 int pitch = depth * width;
59 int size = depth * width * height;
60
61 buffer->ptr = (uint32_t *)rsxMemalign (64, size);
62
63 if (buffer->ptr == NULL)
64 goto error;
65
66 if (rsxAddressToOffset (buffer->ptr, &buffer->offset) != 0)
67 goto error;
68
69 /* Register the display buffer with the RSX */
70 if (gcmSetDisplayBuffer (id, buffer->offset, pitch, width, height) != 0)
71 goto error;
72
73 buffer->width = width;
74 buffer->height = height;
75 buffer->id = id;
76
77 return TRUE;
78
79error:
80 if (buffer->ptr != NULL)
81 rsxFree (buffer->ptr);
82
83 return FALSE;
84}
85
86int
87copyBuffer(gcmContextData *context, rsxBuffer *source, rsxBuffer *destination)
88{
89 rsxSetTransferData(context, GCM_TRANSFER_LOCAL_TO_LOCAL,
90 destination->offset,
91 destination->width * sizeof(u32),
92 source->offset,
93 source->width * sizeof(u32),
94 source->width * sizeof(u32),
95 source->height);
96}
97
98int
99getResolution(u16 *width, u16 *height)
100{
101 videoState state;
102 videoResolution resolution;
103
104 /* Get the state of the display */
105 if (videoGetState (0, 0, &state) == 0 &&
106 videoGetResolution (state.displayMode.resolution, &resolution) == 0)
107 {
108 if (width)
109 *width = resolution.width;
110 if (height)
111 *height = resolution.height;
112
113 return TRUE;
114 }
115 return FALSE;
116}
117
118static u8
119getPreferredResolution(u16 width, u16 height)
120{
121 videoDeviceInfo info;
122 videoResolution res;
123 int area = width * height;
124 int mode_area;
125 int min_area_diff = abs (area - (720 * 480));
126 int area_diff;
127 u8 resolution = VIDEO_RESOLUTION_480;
128 int i;
129
130 videoGetDeviceInfo(0, 0, &info);
131
132 for (i = 0; i < info.availableModeCount; i++) {
133 videoGetResolution (info.availableModes[i].resolution, &res);
134 mode_area = res.width * res.height;
135 area_diff = abs (area - mode_area);
136 if (area_diff < min_area_diff)
137 {
138 min_area_diff = area_diff;
139 resolution = info.availableModes[i].resolution;
140 }
141 }
142
143 return resolution;
144}
145
146int
147setResolution(gcmContextData *context, u16 *width, u16 *height)
148{
149 videoState state;
150 videoConfiguration vconfig;
151 videoResolution res;
152 u8 resolution;
153
154 resolution = getPreferredResolution (*width, *height);
155
156 /* Get the state of the display */
157 if (videoGetState (0, 0, &state) != 0)
158 return FALSE;
159
160 /* Make sure display is enabled */
161 if (state.state != 0)
162 return FALSE;
163
164 if (videoGetResolution (resolution, &res) != 0)
165 return FALSE;
166
167 /* Configure the buffer format to xRGB */
168 memset (&vconfig, 0, sizeof(videoConfiguration));
169 vconfig.resolution = resolution;
170 vconfig.format = VIDEO_BUFFER_FORMAT_XRGB;
171 vconfig.pitch = res.width * sizeof(u32);
172 vconfig.aspect = VIDEO_ASPECT_AUTO;
173
174 flushRSX(context);
175
176 if (videoConfigure (0, &vconfig, NULL, 0) != 0)
177 return FALSE;
178
179 *width = res.width;
180 *height = res.height;
181
182 return TRUE;
183}
184
185gcmContextData *
186initScreen(void *host_addr, u32 size)
187{
188 gcmContextData *context = NULL; /* Context to keep track of the RSX buffer. */
189 videoState state;
190 videoConfiguration vconfig;
191 videoResolution res; /* Screen Resolution */
192
193 /* Initilise Reality, which sets up the command buffer and shared IO memory */
194 context = rsxInit (CB_SIZE, size, host_addr);
195 if (context == NULL)
196 goto error;
197
198 /* Get the state of the display */
199 if (videoGetState (0, 0, &state) != 0)
200 goto error;
201
202 /* Make sure display is enabled */
203 if (state.state != 0)
204 goto error;
205
206 /* Get the current resolution */
207 if (videoGetResolution (state.displayMode.resolution, &res) != 0)
208 goto error;
209
210 /* Configure the buffer format to xRGB */
211 memset (&vconfig, 0, sizeof(videoConfiguration));
212 vconfig.resolution = state.displayMode.resolution;
213 vconfig.format = VIDEO_BUFFER_FORMAT_XRGB;
214 vconfig.pitch = res.width * sizeof(u32);
215 vconfig.aspect = state.displayMode.aspect;
216
217 flushRSX(context);
218
219 if (videoConfigure (0, &vconfig, NULL, 0) != 0)
220 goto error;
221
222 if (videoGetState (0, 0, &state) != 0)
223 goto error;
224
225 gcmSetFlipMode (GCM_FLIP_VSYNC); // Wait for VSYNC to flip
226
227 gcmResetFlipStatus();
228
229 return context;
230
231error:
232 if (context)
233 rsxFinish (context, 0);
234
235 return NULL;
236}
237
238void
239freeScreen(gcmContextData *context)
240{
241 rsxFinish (context, 0);
242}
243
244static void
245waitFinish(gcmContextData *context, u32 sLabelVal)
246{
247 rsxSetWriteBackendLabel (context, GCM_LABEL_INDEX, sLabelVal);
248
249 rsxFlushBuffer (context);
250
251 while (*(vu32 *)gcmGetLabelAddress (GCM_LABEL_INDEX) != sLabelVal)
252 usleep(30);
253}
254
255static void
256waitRSXIdle(gcmContextData *context)
257{
258 static u32 sLabelVal = 1;
259
260 rsxSetWriteBackendLabel (context, GCM_LABEL_INDEX, sLabelVal);
261 rsxSetWaitLabel (context, GCM_LABEL_INDEX, sLabelVal);
262
263 sLabelVal++;
264
265 waitFinish(context, sLabelVal++);
266}
267
268void
269flushRSX(gcmContextData *context)
270{
271 if (flipped)
272 waitFlip ();
273 waitRSXIdle(context);
274}
275
diff --git a/src/modules/evas/engines/psl1ght/rsxutil.h b/src/modules/evas/engines/psl1ght/rsxutil.h
deleted file mode 100644
index 838a751..0000000
--- a/src/modules/evas/engines/psl1ght/rsxutil.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * This software is distributed under the terms of the MIT License
3 */
4
5#ifndef __RSXUTIL_H__
6#define __RSXUTIL_H__
7
8#include <rsx/rsx.h>
9#include <ppu-types.h>
10
11#define CB_SIZE 0x100000
12#define HOST_SIZE (32 * 1024 * 1024)
13
14typedef struct
15{
16 int height;
17 int width;
18 int id;
19 uint32_t *ptr;
20 // Internal stuff
21 uint32_t offset;
22} rsxBuffer;
23
24/* Initilize the RSX properly. Returns NULL on error */
25gcmContextData *initScreen(void *host_addr, u32 size);
26/* Block the PPU thread untill the previous flip operation has finished. */
27void waitFlip(void);
28/* Flip a buffer onto the screen. Returns TRUE on success */
29int flipBuffer(gcmContextData *context, s32 buffer);
30/* Create a buffer to draw into and assign it to @id. Returns NULL on error */
31int makeBuffer(rsxBuffer *buffer, u16 width, u16 height, int id);
32/* Copy the contents of a buffer to another buffer */
33int copyBuffer(gcmContextData *context, rsxBuffer *source, rsxBuffer *destination);
34/* Get current screen resolution. returns TRUE on success */
35int getResolution(u16 *width, u16 *height);
36/* Set screen resolution to closest matching and. returns TRUE on success */
37int setResolution(gcmContextData *context, u16 *width, u16 *height);
38/* Initilize the RSX properly. Returns NULL on error */
39void freeScreen(gcmContextData *context);
40/* Flush the RSX pipeline (any commands and wait for flip) */
41void flushRSX(gcmContextData *context);
42
43#endif /* __RSXUTIL_H__ */
diff --git a/src/tests/evas/evas_test_render_engines.c b/src/tests/evas/evas_test_render_engines.c
index 3f3ab09..99f2955 100644
--- a/src/tests/evas/evas_test_render_engines.c
+++ b/src/tests/evas/evas_test_render_engines.c
@@ -30,9 +30,6 @@ static const char *built_engines[] = {
30#ifdef BUILD_ENGINE_GL_X11 30#ifdef BUILD_ENGINE_GL_X11
31 "gl_x11", 31 "gl_x11",
32#endif 32#endif
33#ifdef BUILD_ENGINE_PSL1GHT
34 "psl1ght",
35#endif
36#ifdef BUILD_ENGINE_SOFTWARE_DDRAW 33#ifdef BUILD_ENGINE_SOFTWARE_DDRAW
37 "software_ddraw", 34 "software_ddraw",
38#endif 35#endif